Winter vulnerable to Prototype Pollution in Snowboard framework
Description
Winter is a free, open-source content management system based on the Laravel PHP framework. The Snowboard framework in versions 1.1.8, 1.1.9, and 1.2.0 is vulnerable to prototype pollution in the main Snowboard class as well as its plugin loader. The 1.0 branch of Winter is not affected, as it does not contain the Snowboard framework. This issue has been patched in v1.1.10 and v1.2.1. As a workaround, one may avoid this issue by following some common security practices for JavaScript, including implementing a content security policy and auditing scripts.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
wintercms/winterPackagist | >= 1.1.8, < 1.1.10 | 1.1.10 |
wintercms/winterPackagist | >= 1.2.0, < 1.2.1 | 1.2.1 |
Affected products
1Patches
2bce4b59584abHarden Snowboard (#687)
20 files changed · +395 −52
modules/system/assets/js/build/manifest.js+1 −1 modified@@ -1 +1 @@ -!function(){"use strict";var n,r={},t={};function e(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return r[n](u,u.exports,e),u.exports}e.m=r,n=[],e.O=function(r,t,o,u){if(!t){var i=1/0;for(a=0;a<n.length;a++){t=n[a][0],o=n[a][1],u=n[a][2];for(var f=!0,c=0;c<t.length;c++)(!1&u||i>=u)&&Object.keys(e.O).every((function(n){return e.O[n](t[c])}))?t.splice(c--,1):(f=!1,u<i&&(i=u));if(f){n.splice(a--,1);var s=o();void 0!==s&&(r=s)}}return r}u=u||0;for(var a=n.length;a>0&&n[a-1][2]>u;a--)n[a]=n[a-1];n[a]=[t,o,u]},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,{a:r}),r},e.d=function(n,r){for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},function(){var n={911:0};e.O.j=function(r){return 0===n[r]};var r=function(r,t){var o,u,i=t[0],f=t[1],c=t[2],s=0;if(i.some((function(r){return 0!==n[r]}))){for(o in f)e.o(f,o)&&(e.m[o]=f[o]);if(c)var a=c(e)}for(r&&r(t);s<i.length;s++)u=i[s],e.o(n,u)&&n[u]&&n[u][0](),n[u]=0;return e.O(a)},t=self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))}()}(); \ No newline at end of file +!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<r.length;a++){e=r[a][0],o=r[a][1],i=r[a][2];for(var f=!0,c=0;c<e.length;c++)(!1&i||u>=i)&&Object.keys(t.O).every((function(r){return t.O[r](e[c])}))?e.splice(c--,1):(f=!1,i<u&&(u=i));if(f){r.splice(a--,1);var s=o();void 0!==s&&(n=s)}}return n}i=i||0;for(var a=r.length;a>0&&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.length;s++)i=u[s],t.o(r,i)&&r[i]&&r[i][0](),r[i]=0;return t.O(a)},e=self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[];e.forEach(n.bind(null,0)),e.push=n.bind(null,e.push.bind(e))}()}(); \ No newline at end of file
modules/system/assets/js/build/system.js+1 −1 modifiedmodules/system/assets/js/snowboard/build/snowboard.base.debug.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{1705:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});n(6886),n(9529);class r{constructor(t){this.snowboard=t}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class o extends r{}class i{constructor(t,e,n){this.name=t,this.snowboard=e,this.instance=n,this.instances=[],this.singleton=n.prototype instanceof o,this.initialised=n.prototype instanceof r,this.mocks={},this.originalFunctions={}}hasMethod(t){return!this.isFunction()&&"function"==typeof this.instance.prototype[t]}callMethod(){if(this.isFunction())return null;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e,o=r.shift();return this.instance.prototype[o](r)}getInstance(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const t=this.getDependencies().filter((t=>!this.snowboard.getPluginNames().includes(t)));throw new Error('The "'.concat(this.name,'" plugin requires the following plugins: ').concat(t.join(", ")))}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instances[0][e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instances[0][n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instance.prototype[e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instance.prototype[n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}})));const o=new this.instance(this.snowboard,...n);return o.detach=()=>this.instances.splice(this.instances.indexOf(o),1),o.construct(...n),this.instances.push(o),o}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof r==!1}isSingleton(){return this.instance.prototype instanceof o==!0}isInitialised(){return this.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=new this.instance(this.snowboard,...e);r.detach=()=>this.instances.splice(this.instances.indexOf(r),1),r.construct(...e),this.instances.push(r),this.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((t=>t.toLowerCase()))}dependenciesFulfilled(){const t=this.getDependencies();let e=!0;return t.forEach((t=>{this.snowboard.hasPlugin(t)||(e=!1)})),e}mock(t,e){var n=this;if(!this.isFunction()){if(!this.instance.prototype[t])throw new Error('Function "'.concat(t,'" does not exist and cannot be mocked'));this.mocks[t]=e,this.originalFunctions[t]=this.instance.prototype[t],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][t]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e(n,...r)})}}unmock(t){this.isFunction()||this.mocks[t]&&(this.isSingleton()&&(this.instances[0][t]=this.originalFunctions[t]),delete this.mocks[t],delete this.originalFunctions[t])}}var s=n(26);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l extends o{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(t){if("object"!=typeof t)throw new Error("Cookie defaults must be provided as an object");Object.entries(t).forEach((t=>{const[e,n]=t;void 0!==this.defaults[e]&&(this.defaults[e]=n)}))}getDefaults(){const t={};return Object.entries(this.defaults).forEach((e=>{const[n,r]=e;null!==this.defaults[n]&&(t[n]=r)})),t}get(t){if(void 0===t){const t=s.Z.get();return Object.entries(t).forEach((e=>{const[n,r]=e;this.snowboard.globalEvent("cookie.get",n,r,(e=>{t[n]=e}))})),t}let e=s.Z.get(t);return this.snowboard.globalEvent("cookie.get",t,e,(t=>{e=t})),e}set(t,e,n){let r=e;return this.snowboard.globalEvent("cookie.set",t,e,(t=>{r=t})),s.Z.set(t,r,a(a({},this.getDefaults()),n))}remove(t,e){s.Z.remove(t,a(a({},this.getDefaults()),e))}}class f extends o{construct(){window.wnJSON=t=>this.parse(t),window.ocJSON=window.wnJSON}parse(t){const e=this.parseString(t);return JSON.parse(e)}parseString(t){let e=t.trim();if(!e.length)throw new Error("Broken JSON object.");let n="",r=null,o=null,i="";for(;e&&","===e[0];)e=e.substr(1);if('"'===e[0]||"'"===e[0]){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");i='"';for(let t=1;t<e.length;t+=1)if("\\"===e[t])"'"===e[t+1]||(i+=e[t]),i+=e[t+1],t+=1;else{if(e[t]===e[0])return i+='"',i;'"'===e[t]?i+='\\"':i+=e[t]}throw new Error("Invalid string JSON object.")}if("true"===e||"false"===e)return e;if("null"===e)return"null";const s=parseFloat(e);if(!Number.isNaN(s))return s.toString();if("{"===e[0]){r="needKey",o=null,n="{";for(let t=1;t<e.length;t+=1)if(!this.isBlankChar(e[t]))if("needKey"!==r||'"'!==e[t]&&"'"!==e[t]){if("needKey"===r&&this.canBeKeyHead(e[t]))o=this.parseKey(e,t),n+='"',n+=o,n+='"',t+=o.length-1,r="afterKey";else if("afterKey"===r&&":"===e[t])n+=":",r=":";else if(":"===r)i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody";else if("afterBody"===r||"needKey"===r){let o=t;for(;","===e[o]||this.isBlankChar(e[o]);)o+=1;if("}"===e[o]&&o===e.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}o!==t&&"{"!==n&&(n+=",",r="needKey",t=o-1)}}else o=this.parseKey(e,t+1,e[t]),n+='"'.concat(o,'"'),t+=o.length,t+=1,r="afterKey";throw new Error("Broken JSON object near ".concat(n))}if("["===e[0]){n="[",r="needBody";for(let t=1;t<e.length;t+=1)if(" "!==e[t]&&"\n"!==e[t]&&"\t"!==e[t])if("needBody"===r){if(","===e[t]){n+="null,";continue}if("]"===e[t]&&t===e.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody"}else if("afterBody"===r)if(","===e[t])for(n+=",",r="needBody";","===e[t+1]||this.isBlankChar(e[t+1]);)","===e[t+1]&&(n+="null,"),t+=1;else if("]"===e[t]&&t===e.length-1)return n+="]",n;throw new Error("Broken JSON array near ".concat(n))}return""}getBody(t,e){let n="";if('"'===t[e]||"'"===t[e]){n=t[e];for(let r=e+1;r<t.length;r+=1)if("\\"===t[r])n+=t[r],r+1<t.length&&(n+=t[r+1]),r+=1;else{if(t[r]===t[e])return n+=t[e],{originLength:n.length,body:n};n+=t[r]}throw new Error("Broken JSON string body near ".concat(n))}if("t"===t[e]){if(t.indexOf("true",e)===e)return{originLength:"true".length,body:"true"};throw new Error("Broken JSON boolean body near ".concat(t.substr(0,e+10)))}if("f"===t[e]){if(t.indexOf("f",e)===e)return{originLength:"false".length,body:"false"};throw new Error("Broken JSON boolean body near ".concat(t.substr(0,e+10)))}if("n"===t[e]){if(t.indexOf("null",e)===e)return{originLength:"null".length,body:"null"};throw new Error("Broken JSON boolean body near ".concat(t.substr(0,e+10)))}if("-"===t[e]||"+"===t[e]||"."===t[e]||t[e]>="0"&&t[e]<="9"){n="";for(let r=e;r<t.length;r+=1){if(!("-"===t[r]||"+"===t[r]||"."===t[r]||t[r]>="0"&&t[r]<="9"))return{originLength:n.length,body:n};n+=t[r]}throw new Error("Broken JSON number body near ".concat(n))}if("{"===t[e]||"["===t[e]){const r=[t[e]];n=t[e];for(let o=e+1;o<t.length;o+=1){if(n+=t[o],"\\"===t[o])o+1<t.length&&(n+=t[o+1]),o+=1;else if('"'===t[o])'"'===r[r.length-1]?r.pop():"'"!==r[r.length-1]&&r.push(t[o]);else if("'"===t[o])"'"===r[r.length-1]?r.pop():'"'!==r[r.length-1]&&r.push(t[o]);else if('"'!==r[r.length-1]&&"'"!==r[r.length-1])if("{"===t[o])r.push("{");else if("}"===t[o]){if("{"!==r[r.length-1])throw new Error("Broken JSON ".concat("{"===t[e]?"object":"array"," body near ").concat(n));r.pop()}else if("["===t[o])r.push("[");else if("]"===t[o]){if("["!==r[r.length-1])throw new Error("Broken JSON ".concat("{"===t[e]?"object":"array"," body near ").concat(n));r.pop()}if(!r.length)return{originLength:o-e,body:n}}throw new Error("Broken JSON ".concat("{"===t[e]?"object":"array"," body near ").concat(n))}throw new Error("Broken JSON body near ".concat(t.substr(e-5>=0?e-5:0,50)))}parseKey(t,e,n){let r="";for(let o=e;o<t.length;o+=1){if(n&&n===t[o])return r;if(!n&&(" "===t[o]||":"===t[o]))return r;r+=t[o],"\\"===t[o]&&o+1<t.length&&(r+=t[o+1],o+=1)}throw new Error("Broken JSON syntax near ".concat(r))}canBeKeyHead(t){return"\\"!==t[0]&&(t[0]>="a"&&t[0]<="z"||t[0]>="A"&&t[0]<="Z"||"_"===t[0]||(t[0]>="0"&&t[0]<="9"||("$"===t[0]||t.charCodeAt(0)>255)))}isBlankChar(t){return" "===t||"\n"===t||"\t"===t}}class h extends o{construct(){window.wnSanitize=t=>this.sanitize(t),window.ocSanitize=window.wnSanitize}sanitize(t,e){const n=(new DOMParser).parseFromString(t,"text/html"),r=void 0===e||"boolean"!=typeof e||e;return this.sanitizeNode(n.getRootNode()),r?n.body.innerHTML:n.innerHTML}sanitizeNode(t){if("SCRIPT"===t.tagName)return void t.remove();this.trimAttributes(t);Array.from(t.children).forEach((t=>{this.sanitizeNode(t)}))}trimAttributes(t){if(t.attributes)for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes.item(e).name,r=t.attributes.item(e).value;0!==n.indexOf("on")&&0!==r.indexOf("javascript:")||t.removeAttribute(n)}}}n(5940);class p extends o{construct(){this.foundBaseUrl=null,this.baseUrl()}to(t){if(t.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return t;const e=t.replace(/^\/+/,"");return"".concat(this.baseUrl()).concat(e)}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const t=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=t.join(""),this.foundBaseUrl}validateBaseUrl(t){const e=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(t),n=e[2],r=e[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!r)throw new Error("Invalid base URL detected");return"/"===t.substr(-1)?t:"".concat(t,"/")}}class g{constructor(t,e){this.debugEnabled="boolean"==typeof e&&!0===e,this.autoInitSingletons="boolean"==typeof t&&!1===t,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.domReady=!1,this.attachAbstracts(),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=r,this.Singleton=o}loadUtilities(){this.addPlugin("cookie",l),this.addPlugin("jsonParser",f),this.addPlugin("sanitizer",h),this.addPlugin("url",p)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.domReady=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((t=>{t.isSingleton()&&t.dependenciesFulfilled()&&t.initialiseSingleton()}))}addPlugin(t,e){var n=this;const o=t.toLowerCase();if(this.hasPlugin(o))throw new Error('A plugin called "'.concat(t,'" is already registered.'));if("function"!=typeof e&&e instanceof r==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[t]||void 0!==this[o])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[o]=new i(o,this,e);const s=function(){return n.plugins[o].getInstance(...arguments)};this[t]=s,this[o]=s,this.debug('Plugin "'.concat(t,'" registered')),Object.values(this.getPlugins()).forEach((t=>{if(t.isSingleton()&&!t.isInitialised()&&t.dependenciesFulfilled()&&t.hasMethod("listens")&&Object.keys(t.callMethod("listens")).includes("ready")&&this.domReady){const e=t.callMethod("listens").ready;t.callMethod(e)}}))}removePlugin(t){const e=t.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((t=>{t.destruct()})),delete this.plugins[e],delete this[e],delete this[t],this.debug('Plugin "'.concat(t,'" removed'))):this.debug('Plugin "'.concat(t,'" already removed'))}hasPlugin(t){const e=t.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(t){if(!this.hasPlugin(t))throw new Error('No plugin called "'.concat(t,'" has been registered.'));return this.plugins[t]}listensToEvent(t){const e=[];return Object.entries(this.plugins).forEach((n=>{const[r,o]=n;if(o.isFunction())return;if(!o.dependenciesFulfilled())return;if(!o.hasMethod("listens"))return;"string"==typeof o.callMethod("listens")[t]&&e.push(r)})),e}ready(t){this.domReady&&t(),this.on("ready",t)}on(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].includes(e)||this.listeners[t].push(e)}off(t,e){if(!this.listeners[t])return;const n=this.listeners[t].indexOf(e);-1!==n&&this.listeners[t].splice(n,1)}globalEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug('Calling global event "'.concat(t,'"'),...n);const o=this.listensToEvent(t);if(0===o.length)return this.debug('No listeners found for global event "'.concat(t,'"')),!0;this.debug('Listeners found for global event "'.concat(t,'": ').concat(o.join(", ")));let i=!1;return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!i){if(!r[o])throw new Error('Missing "'.concat(o,'" method in "').concat(e,'" plugin'));try{!1===r[o](...n)&&(i=!0,this.debug('Global event "'.concat(t,'" cancelled by "').concat(e,'" plugin')))}catch(n){this.error('Error thrown in "'.concat(t,'" event by "').concat(e,'" plugin.'),n)}}}))})),!i&&this.listeners[t]&&this.listeners[t].length>0&&(this.debug("Found ".concat(this.listeners[t].length,' ad-hoc listener(s) for global event "').concat(t,'"')),this.listeners[t].forEach((e=>{if(!i)try{!1===e(...n)&&(i=!0,this.debug('Global event "'.concat(t," cancelled by an ad-hoc listener.")))}catch(e){this.error('Error thrown in "'.concat(t,'" event by an ad-hoc listener.'),e)}}))),!i}globalPromiseEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug('Calling global promise event "'.concat(t,'"'));const o=this.listensToEvent(t);if(0===o.length)return this.debug('No listeners found for global promise event "'.concat(t,'"')),Promise.resolve();this.debug('Listeners found for global promise event "'.concat(t,'": ').concat(o.join(", ")));const i=[];return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!r[o])throw new Error('Missing "'.concat(o,'" method in "').concat(e,'" plugin'));try{const t=r[o](...n);if(t instanceof Promise==!1)return;i.push(t)}catch(n){this.error('Error thrown in "'.concat(t,'" promise event by "').concat(e,'" plugin.'),n)}}))})),this.listeners[t]&&this.listeners[t].length>0&&(this.debug("Found ".concat(this.listeners[t].length,' ad-hoc listener(s) for global promise event "').concat(t,'"')),this.listeners[t].forEach((e=>{try{const t=e(...n);if(t instanceof Promise==!1)return;i.push(t)}catch(e){this.error('Error thrown in "'.concat(t,'" promise event by an ad-hoc listener.'),e)}}))),0===i.length?Promise.resolve():Promise.all(i)}logMessage(t,e,n){console.groupCollapsed("%c[Snowboard]","color: ".concat(t,"; font-weight: ").concat(e?"bold":"normal",";"),n);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];if(o.length){console.groupCollapsed("%cParameters %c(".concat(o.length,")"),"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let t=0;o.forEach((e=>{t+=1,console.log("%c".concat(t,":"),"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(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}debug(t){if(this.debugEnabled){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}}error(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(229, 35, 35)",!0,t,...n)}}},2165:function(t,e,n){"use strict";var r=n(1705);(t=>{const e=new r.Z(!0,!0);t.snowboard=e,t.Snowboard=e,t.SnowBoard=e})(window)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},8505:function(t,e,n){var r=n(6733),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),c=Array.prototype;null==c[s]&&i(c,s,{configurable:!0,value:o(null)}),t.exports=function(t){c[s][t]=!0}},6637:function(t,e,n){"use strict";var r=n(966).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var c,a=r(e),u=i(a),l=o(s,u);if(t&&n!=n){for(;u>l;)if((c=a[l++])!=c)return!0}else for(;u>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},1589:function(t,e,n){var r=n(1601),o=n(6733),i=n(7079),s=n(95)("toStringTag"),c=Object,a="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=c(t),s))?n:a?i(e):"Object"==(r=i(e))&&o(e.callee)?"Arguments":r}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var c=o(e),a=s.f,u=i.f,l=0;l<c.length;l++){var f=c[l];r(t,f)||n&&r(n,f)||a(t,f,u(e,f))}}},7528:function(t,e,n){var r=n(4229);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3723:function(t,e,n){"use strict";var r=n(693).IteratorPrototype,o=n(2391),i=n(5358),s=n(4555),c=n(5495),a=function(){return this};t.exports=function(t,e,n,u){var l=e+" Iterator";return t.prototype=o(r,{next:i(+!u,n)}),s(t,l,!1,!0),c[l]=a,t}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(5762),i=n(6039),s=n(8400);t.exports=function(t,e,n,c){c||(c={});var a=c.enumerable,u=void 0!==c.name?c.name:e;return r(n)&&i(n,u,c),c.global?a?t[e]=n:s(e,n):(c.unsafe?t[e]&&(a=!0):delete t[e],a?t[e]=n:o(t,e,n)),t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7675:function(t,e,n){"use strict";var r=n(3103),o=n(266),i=n(4231),s=n(1805),c=n(6733),a=n(3723),u=n(7567),l=n(6540),f=n(4555),h=n(5762),p=n(4768),g=n(95),d=n(5495),v=n(693),b=s.PROPER,y=s.CONFIGURABLE,w=v.IteratorPrototype,m=v.BUGGY_SAFARI_ITERATORS,x=g("iterator"),O="keys",S="values",E="entries",j=function(){return this};t.exports=function(t,e,n,s,g,v,P){a(n,e,s);var k,I,A,L=function(t){if(t===g&&M)return M;if(!m&&t in N)return N[t];switch(t){case O:case S:case E:return function(){return new n(this,t)}}return function(){return new n(this)}},B=e+" Iterator",T=!1,N=t.prototype,F=N[x]||N["@@iterator"]||g&&N[g],M=!m&&F||L(g),C="Array"==e&&N.entries||F;if(C&&(k=u(C.call(new t)))!==Object.prototype&&k.next&&(i||u(k)===w||(l?l(k,w):c(k[x])||p(k,x,j)),f(k,B,!0,!0),i&&(d[B]=j)),b&&g==S&&F&&F.name!==S&&(!i&&y?h(N,"name",S):(T=!0,M=function(){return o(F,this)})),g)if(I={values:L(S),keys:v?M:L(O),entries:L(E)},P)for(A in I)(m||T||!(A in N))&&p(N,A,I[A]);else r({target:e,proto:!0,forced:m||T},I);return i&&!P||N[x]===M||p(N,x,M,{name:g}),d[e]=M,I}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},5694:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8865:function(t,e,n){var r=n(2635)("span").classList,o=r&&r.constructor&&r.constructor.prototype;t.exports=o===Object.prototype?void 0:o},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),c=i.process,a=i.Deno,u=c&&c.versions||a&&a.version,l=u&&u.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),c=n(8400),a=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,h,p,g=t.target,d=t.global,v=t.stat;if(n=d?r:v?r[g]||c(g,{}):(r[g]||{}).prototype)for(l in e){if(h=e[l],f=t.dontCallGetSet?(p=o(n,l))&&p.value:n[l],!u(d?l:g+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;a(h,f)}(t.sham||f&&f.sham)&&i(h,"sham",!0),s(n,l,h,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4954:function(t,e,n){"use strict";n(7950);var r=n(5968),o=n(4768),i=n(3466),s=n(4229),c=n(95),a=n(5762),u=c("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var h=c(t),p=!s((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),g=p&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return e=!0,null},n[h](""),!e}));if(!p||!g||n){var d=r(/./[h]),v=e(h,""[t],(function(t,e,n,o,s){var c=r(t),a=e.exec;return a===i||a===l.exec?p&&!s?{done:!0,value:d(e,n,o)}:{done:!0,value:c(n,e,o)}:{done:!1}}));o(String.prototype,t,v[0]),o(l,h,v[1])}f&&a(l[h],"sham",!0)}},3171:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.apply,s=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,u=c&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,c=r&&i.bind(s,s);t.exports=r?function(t){return t&&c(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},17:function(t,e,n){var r=n(5968),o=n(2991),i=Math.floor,s=r("".charAt),c=r("".replace),a=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,f,h){var p=n+t.length,g=r.length,d=l;return void 0!==f&&(f=o(f),d=u),c(h,d,(function(o,c){var u;switch(s(c,0)){case"$":return"$";case"&":return t;case"`":return a(e,0,n);case"'":return a(e,p);case"<":u=f[a(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>g){var h=i(l/10);return 0===h?o:h<=g?void 0===r[h-1]?s(c,1):r[h-1]+s(c,1):o}u=r[l-1]}return void 0===u?"":u}))}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,c=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(8694),c=n(9859),a=n(5968),u=n(5052),l=n(5762),f=n(8270),h=n(5353),p=n(4399),g=n(5977),d="Object already initialized",v=c.TypeError,b=c.WeakMap;if(s||h.state){var y=h.state||(h.state=new b),w=a(y.get),m=a(y.has),x=a(y.set);r=function(t,e){if(m(y,t))throw new v(d);return e.facade=t,x(y,t,e),e},o=function(t){return w(y,t)||{}},i=function(t){return m(y,t)}}else{var O=p("state");g[O]=!0,r=function(t,e){if(f(t,O))throw new v(d);return e.facade=t,l(t,O,e),e},o=function(t){return f(t,O)?t[O]:{}},i=function(t){return f(t,O)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=a[c(t)];return n==l||n!=u&&(o(e)?r(e):!!e)},c=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},5052:function(t,e,n){var r=n(6733);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),c=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,c(t))}},693:function(t,e,n){"use strict";var r,o,i,s=n(4229),c=n(6733),a=n(2391),u=n(7567),l=n(4768),f=n(95),h=n(4231),p=f("iterator"),g=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(r=o):g=!0),null==r||s((function(){var t={};return r[p].call(t)!==t}))?r={}:h&&(r=a(r)),c(r[p])||l(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},5495:function(t){t.exports={}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),c=n(1805).CONFIGURABLE,a=n(8511),u=n(6407),l=u.enforce,f=u.get,h=Object.defineProperty,p=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),d=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||c&&t.name!==e)&&h(t,"name",{value:e,configurable:!0}),p&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return i(r,"source")||(r.source=g.join("string"==typeof e?e:"")),t};Function.prototype.toString=d((function(){return o(this)&&f(this).source||a(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},3839:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8694:function(t,e,n){var r=n(9859),o=n(6733),i=n(8511),s=r.WeakMap;t.exports=o(s)&&/native code/.test(i(s))},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),c=n(5977),a=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"</"+"script>"},g=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},d=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;d="undefined"!=typeof document?document.domain&&r?g(r):((e=u("iframe")).style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):g(r);for(var n=s.length;n--;)delete d.prototype[s[n]];return d()};c[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=o(t),n=new h,h.prototype=null,n[f]=t):n=d(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),c=n(905),a=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=c(e),o=a(e),u=o.length,l=0;u>l;)i.f(t,n=o[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),c=n(9310),a=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",p="writable";e.f=r?i?function(t,e,n){if(s(t),e=c(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=c(e),s(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),c=n(905),a=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=c(t),e=a(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},7567:function(t,e,n){var r=n(8270),o=n(6733),i=n(2991),s=n(4399),c=n(7528),a=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=c?u.getPrototypeOf:function(t){var e=i(t);if(r(e,a))return e[a];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof u?l:null}},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,c=n(5977),a=r([].push);t.exports=function(t,e){var n,r=i(t),u=0,l=[];for(n in r)!o(c,n)&&o(r,n)&&a(l,n);for(;e.length>u;)o(r,n=e[u++])&&(~s(l,n)||a(l,n));return l}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},6540:function(t,e,n){var r=n(5968),o=n(1176),i=n(8505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,c;if("string"===e&&o(n=t.toString)&&!i(c=r(n,t)))return c;if(o(n=t.valueOf)&&!i(c=r(n,t)))return c;if("string"!==e&&o(n=t.toString)&&!i(c=r(n,t)))return c;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),c=n(1176),a=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(c(t)),n=s.f;return n?a(e,n(t)):e}},8115:function(t,e,n){var r=n(266),o=n(1176),i=n(6733),s=n(7079),c=n(3466),a=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var u=r(n,t,e);return null!==u&&o(u),u}if("RegExp"===s(t))return r(c,t,e);throw a("RegExp#exec called on incompatible receiver")}},3466:function(t,e,n){"use strict";var r,o,i=n(266),s=n(5968),c=n(3326),a=n(895),u=n(5650),l=n(3036),f=n(2391),h=n(6407).get,p=n(2926),g=n(461),d=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,b=v,y=s("".charAt),w=s("".indexOf),m=s("".replace),x=s("".slice),O=(o=/b*/g,i(v,r=/a/,"a"),i(v,o,"a"),0!==r.lastIndex||0!==o.lastIndex),S=u.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(O||E||S||p||g)&&(b=function(t){var e,n,r,o,s,u,l,p=this,g=h(p),j=c(t),P=g.raw;if(P)return P.lastIndex=p.lastIndex,e=i(b,P,j),p.lastIndex=P.lastIndex,e;var k=g.groups,I=S&&p.sticky,A=i(a,p),L=p.source,B=0,T=j;if(I&&(A=m(A,"y",""),-1===w(A,"g")&&(A+="g"),T=x(j,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(j,p.lastIndex-1))&&(L="(?: "+L+")",T=" "+T,B++),n=new RegExp("^(?:"+L+")",A)),E&&(n=new RegExp("^"+L+"$(?!\\s)",A)),O&&(r=p.lastIndex),o=i(v,I?n:p,T),I?o?(o.input=x(o.input,B),o[0]=x(o[0],B),o.index=p.lastIndex,p.lastIndex+=o[0].length):p.lastIndex=0:O&&o&&(p.lastIndex=p.global?o.index+o[0].length:r),E&&o&&o.length>1&&i(d,o[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(o[s]=void 0)})),o&&k)for(o.groups=u=f(null),s=0;s<k.length;s++)u[(l=k[s])[0]]=o[l[1]];return o}),t.exports=b},895:function(t,e,n){"use strict";var r=n(1176);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},5650:function(t,e,n){var r=n(4229),o=n(9859).RegExp,i=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=i||r((function(){return!o("a","y").sticky})),c=i||r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:c,MISSED_STICKY:s,UNSUPPORTED_Y:i}},2926:function(t,e,n){var r=n(4229),o=n(9859).RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},461:function(t,e,n){var r=n(4229),o=n(9859).RegExp;t.exports=r((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},8885:function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},4555:function(t,e,n){var r=n(1787).f,o=n(8270),i=n(95)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.8",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE",source:"https://github.com/zloirock/core-js"})},966:function(t,e,n){var r=n(5968),o=n(3329),i=n(3326),s=n(8885),c=r("".charAt),a=r("".charCodeAt),u=r("".slice),l=function(t){return function(e,n){var r,l,f=i(s(e)),h=o(n),p=f.length;return h<0||h>=p?t?"":void 0:(r=a(f,h))<55296||r>56319||h+1===p||(l=a(f,h+1))<56320||l>57343?t?c(f,h):r:t?u(f,h,h+2):l-56320+(r-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),c=n(2914),a=n(95),u=TypeError,l=a("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,a=s(t,l);if(a){if(void 0===e&&(e="default"),n=r(a,t,e),!o(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1601:function(t,e,n){var r={};r[n(95)("toStringTag")]="z",t.exports="[object z]"===String(r)},3326:function(t,e,n){var r=n(1589),o=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(3839);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),c=n(3839),a=n(6969),u=o("wks"),l=r.Symbol,f=l&&l.for,h=a?l:l&&l.withoutSetter||s;t.exports=function(t){if(!i(u,t)||!c&&"string"!=typeof u[t]){var e="Symbol."+t;c&&i(l,t)?u[t]=l[t]:u[t]=a&&f?f(e):h(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},5735:function(t,e,n){"use strict";var r=n(905),o=n(9736),i=n(5495),s=n(6407),c=n(1787).f,a=n(7675),u=n(4231),l=n(7400),f="Array Iterator",h=s.set,p=s.getterFor(f);t.exports=a(Array,"Array",(function(t,e){h(this,{type:f,target:r(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var g=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!u&&l&&"values"!==g.name)try{c(g,"name",{value:"values"})}catch(t){}},7950:function(t,e,n){"use strict";var r=n(3103),o=n(3466);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},5940:function(t,e,n){"use strict";var r=n(3171),o=n(266),i=n(5968),s=n(4954),c=n(4229),a=n(1176),u=n(6733),l=n(3329),f=n(4237),h=n(3326),p=n(8885),g=n(6637),d=n(5300),v=n(17),b=n(8115),y=n(95)("replace"),w=Math.max,m=Math.min,x=i([].concat),O=i([].push),S=i("".indexOf),E=i("".slice),j="$0"==="a".replace(/./,"$0"),P=!!/./[y]&&""===/./[y]("a","$0");s("replace",(function(t,e,n){var i=P?"$":"$0";return[function(t,n){var r=p(this),i=null==t?void 0:d(t,y);return i?o(i,t,r,n):o(e,h(r),t,n)},function(t,o){var s=a(this),c=h(t);if("string"==typeof o&&-1===S(o,i)&&-1===S(o,"$<")){var p=n(e,s,c,o);if(p.done)return p.value}var d=u(o);d||(o=h(o));var y=s.global;if(y){var j=s.unicode;s.lastIndex=0}for(var P=[];;){var k=b(s,c);if(null===k)break;if(O(P,k),!y)break;""===h(k[0])&&(s.lastIndex=g(c,f(s.lastIndex),j))}for(var I,A="",L=0,B=0;B<P.length;B++){for(var T=h((k=P[B])[0]),N=w(m(l(k.index),c.length),0),F=[],M=1;M<k.length;M++)O(F,void 0===(I=k[M])?I:String(I));var C=k.groups;if(d){var R=x([T],F,N,c);void 0!==C&&O(R,C);var _=h(r(o,void 0,R))}else _=v(T,c,N,F,C,o);N>=L&&(A+=E(c,L,N)+_,L=N+T.length)}return A+E(c,L)}]}),!!c((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!j||P)},6886:function(t,e,n){var r=n(9859),o=n(5694),i=n(8865),s=n(5735),c=n(5762),a=n(95),u=a("iterator"),l=a("toStringTag"),f=s.values,h=function(t,e){if(t){if(t[u]!==f)try{c(t,u,f)}catch(e){t[u]=f}if(t[l]||c(t,l,e),o[e])for(var n in s)if(t[n]!==s[n])try{c(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var p in o)h(r[p]&&r[p].prototype,p);h(i,"DOMTokenList")}},function(t){t.O(0,[109],(function(){return e=2165,t(t.s=e);var e}));t.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{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)}}},878:function(e,t,n){n.d(t,{Z:function(){return b}});class i{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class s extends i{}var 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<e;n++)t[n]=arguments[n];const i=t,s=i.shift();return this.instance.prototype[s](i)}getInstance(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const e=this.getDependencies().filter((e=>!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;s<t;s++)n[s]=arguments[s];return i(e,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(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;s<t;s++)n[s]=arguments[s];return i(e,...n)}})));const s=new this.instance(this.snowboard,...n);return s.detach=()=>this.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==!1}isSingleton(){return this.instance.prototype instanceof s==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=new this.instance(this.snowboard,...t);i.detach=()=>this.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<e;s++)i[s]=arguments[s];return t(n,...i)})}}unmock(e){this.isFunction()||this.mocks[e]&&(this.isSingleton()&&(this.instances[0][e]=this.originalFunctions[e]),delete this.mocks[e],delete this.originalFunctions[e])}}var l=n(805);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class u extends s{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(e){if("object"!=typeof e)throw new Error("Cookie defaults must be provided as an object");Object.entries(e).forEach((e=>{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 g extends s{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<t.length;e+=1)if("\\"===t[e])"'"===t[e+1]||(r+=t[e]),r+=t[e+1],e+=1;else{if(t[e]===t[0])return r+='"',r;'"'===t[e]?r+='\\"':r+=t[e]}throw new Error("Invalid string JSON object.")}if("true"===t||"false"===t)return t;if("null"===t)return"null";const o=parseFloat(t);if(!Number.isNaN(o))return o.toString();if("{"===t[0]){i="needKey",s=null,n="{";for(let e=1;e<t.length;e+=1)if(!this.isBlankChar(t[e]))if("needKey"!==i||'"'!==t[e]&&"'"!==t[e]){if("needKey"===i&&this.canBeKeyHead(t[e]))s=this.parseKey(t,e),n+='"',n+=s,n+='"',e+=s.length-1,i="afterKey";else if("afterKey"===i&&":"===t[e])n+=":",i=":";else if(":"===i)r=this.getBody(t,e),e=e+r.originLength-1,n+=this.parseString(r.body),i="afterBody";else if("afterBody"===i||"needKey"===i){let s=e;for(;","===t[s]||this.isBlankChar(t[s]);)s+=1;if("}"===t[s]&&s===t.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}s!==e&&"{"!==n&&(n+=",",i="needKey",e=s-1)}}else s=this.parseKey(t,e+1,t[e]),n+=`"${s}"`,e+=s.length,e+=1,i="afterKey";throw new Error(`Broken JSON object near ${n}`)}if("["===t[0]){n="[",i="needBody";for(let e=1;e<t.length;e+=1)if(" "!==t[e]&&"\n"!==t[e]&&"\t"!==t[e])if("needBody"===i){if(","===t[e]){n+="null,";continue}if("]"===t[e]&&e===t.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;r=this.getBody(t,e),e=e+r.originLength-1,n+=this.parseString(r.body),i="afterBody"}else if("afterBody"===i)if(","===t[e])for(n+=",",i="needBody";","===t[e+1]||this.isBlankChar(t[e+1]);)","===t[e+1]&&(n+="null,"),e+=1;else if("]"===t[e]&&e===t.length-1)return n+="]",n;throw new Error(`Broken JSON array near ${n}`)}return""}getBody(e,t){let n="";if('"'===e[t]||"'"===e[t]){n=e[t];for(let i=t+1;i<e.length;i+=1)if("\\"===e[i])n+=e[i],i+1<e.length&&(n+=e[i+1]),i+=1;else{if(e[i]===e[t])return n+=e[t],{originLength:n.length,body:n};n+=e[i]}throw new Error(`Broken JSON string body near ${n}`)}if("t"===e[t]){if(e.indexOf("true",t)===t)return{originLength:"true".length,body:"true"};throw new Error(`Broken JSON boolean body near ${e.substr(0,t+10)}`)}if("f"===e[t]){if(e.indexOf("f",t)===t)return{originLength:"false".length,body:"false"};throw new Error(`Broken JSON boolean body near ${e.substr(0,t+10)}`)}if("n"===e[t]){if(e.indexOf("null",t)===t)return{originLength:"null".length,body:"null"};throw new Error(`Broken JSON boolean body near ${e.substr(0,t+10)}`)}if("-"===e[t]||"+"===e[t]||"."===e[t]||e[t]>="0"&&e[t]<="9"){n="";for(let i=t;i<e.length;i+=1){if(!("-"===e[i]||"+"===e[i]||"."===e[i]||e[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<e.length;s+=1){if(n+=e[s],"\\"===e[s])s+1<e.length&&(n+=e[s+1]),s+=1;else if('"'===e[s])'"'===i[i.length-1]?i.pop():"'"!==i[i.length-1]&&i.push(e[s]);else if("'"===e[s])"'"===i[i.length-1]?i.pop():'"'!==i[i.length-1]&&i.push(e[s]);else if('"'!==i[i.length-1]&&"'"!==i[i.length-1])if("{"===e[s])i.push("{");else if("}"===e[s]){if("{"!==i[i.length-1])throw new Error(`Broken JSON ${"{"===e[t]?"object":"array"} body near ${n}`);i.pop()}else if("["===e[s])i.push("[");else if("]"===e[s]){if("["!==i[i.length-1])throw new Error(`Broken JSON ${"{"===e[t]?"object":"array"} body near ${n}`);i.pop()}if(!i.length)return{originLength:s-t,body:n}}throw new Error(`Broken JSON ${"{"===e[t]?"object":"array"} body near ${n}`)}throw new Error(`Broken JSON body near ${e.substr(t-5>=0?t-5:0,50)}`)}parseKey(e,t,n){let i="";for(let s=t;s<e.length;s+=1){if(n&&n===e[s])return i;if(!n&&(" "===e[s]||":"===e[s]))return i;i+=e[s],"\\"===e[s]&&s+1<e.length&&(i+=e[s+1],s+=1)}throw new Error(`Broken JSON syntax near ${i}`)}canBeKeyHead(e){return"\\"!==e[0]&&(e[0]>="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{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<e.attributes.length;t+=1){const n=e.attributes.item(t).name,i=e.attributes.item(t).value;0!==n.indexOf("on")&&0!==i.indexOf("javascript:")||e.removeAttribute(n)}}}class f extends s{construct(){this.foundBaseUrl=null,this.baseUrl()}to(e){if(e.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return e;const t=e.replace(/^\/+/,"");return`${this.baseUrl()}${t}`}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const e=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=e.join(""),this.foundBaseUrl}validateBaseUrl(e){const t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(e),n=t[2],i=t[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!i)throw new Error("Invalid base URL detected");return"/"===e.substr(-1)?e:`${e}/`}}class b{constructor(e,t){this.debugEnabled="boolean"==typeof t&&!0===t,this.autoInitSingletons="boolean"==typeof e&&!1===e,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.readiness={dom:!1},Object.seal(this.readiness),this.attachAbstracts(),Object.freeze(b.prototype),Object.freeze(this),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=i,this.Singleton=s,Object.freeze(this.PluginBase.prototype),Object.freeze(this.PluginBase),Object.freeze(this.Singleton.prototype),Object.freeze(this.Singleton)}loadUtilities(){this.addPlugin("cookie",u),this.addPlugin("jsonParser",g),this.addPlugin("sanitizer",d),this.addPlugin("url",f)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{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==!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;"string"==typeof s.callMethod("listens")[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<t;i++)n[i-1]=arguments[i];this.debug(`Calling global event "${e}"`,...n);const s=this.listensToEvent(e);if(0===s.length)return this.debug(`No listeners found for global event "${e}"`),!0;this.debug(`Listeners found for global event "${e}": ${s.join(", ")}`);let r=!1;return s.forEach((t=>{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(!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)}}}))})),!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<t;i++)n[i-1]=arguments[i];this.debug(`Calling global promise event "${e}"`);const s=this.listensToEvent(e);if(0===s.length)return this.debug(`No listeners found for global promise event "${e}"`),Promise.resolve();this.debug(`Listeners found for global promise event "${e}": ${s.join(", ")}`);const r=[];return s.forEach((t=>{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(!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)}}))})),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<i;r++)s[r-3]=arguments[r];if(s.length){console.groupCollapsed(`%cParameters %c(${s.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let e=0;s.forEach((t=>{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;i<t;i++)n[i-1]=arguments[i];this.logMessage("rgb(45, 167, 199)",!1,e,...n)}debug(e){if(this.debugEnabled){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.logMessage("rgb(45, 167, 199)",!1,e,...n)}}error(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.logMessage("rgb(229, 35, 35)",!0,e,...n)}}},165:function(e,t,n){var i=n(878),s=n(662);(e=>{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
modules/system/assets/js/snowboard/build/snowboard.base.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{1705:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});n(6886),n(9529);class r{constructor(t){this.snowboard=t}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class o extends r{}class i{constructor(t,e,n){this.name=t,this.snowboard=e,this.instance=n,this.instances=[],this.singleton=n.prototype instanceof o,this.initialised=n.prototype instanceof r,this.mocks={},this.originalFunctions={}}hasMethod(t){return!this.isFunction()&&"function"==typeof this.instance.prototype[t]}callMethod(){if(this.isFunction())return null;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e,o=r.shift();return this.instance.prototype[o](r)}getInstance(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const t=this.getDependencies().filter((t=>!this.snowboard.getPluginNames().includes(t)));throw new Error('The "'.concat(this.name,'" plugin requires the following plugins: ').concat(t.join(", ")))}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instances[0][e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instances[0][n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instance.prototype[e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instance.prototype[n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}})));const o=new this.instance(this.snowboard,...n);return o.detach=()=>this.instances.splice(this.instances.indexOf(o),1),o.construct(...n),this.instances.push(o),o}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof r==!1}isSingleton(){return this.instance.prototype instanceof o==!0}isInitialised(){return this.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=new this.instance(this.snowboard,...e);r.detach=()=>this.instances.splice(this.instances.indexOf(r),1),r.construct(...e),this.instances.push(r),this.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((t=>t.toLowerCase()))}dependenciesFulfilled(){const t=this.getDependencies();let e=!0;return t.forEach((t=>{this.snowboard.hasPlugin(t)||(e=!1)})),e}mock(t,e){var n=this;if(!this.isFunction()){if(!this.instance.prototype[t])throw new Error('Function "'.concat(t,'" does not exist and cannot be mocked'));this.mocks[t]=e,this.originalFunctions[t]=this.instance.prototype[t],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][t]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e(n,...r)})}}unmock(t){this.isFunction()||this.mocks[t]&&(this.isSingleton()&&(this.instances[0][t]=this.originalFunctions[t]),delete this.mocks[t],delete this.originalFunctions[t])}}var s=n(26);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l extends o{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(t){if("object"!=typeof t)throw new Error("Cookie defaults must be provided as an object");Object.entries(t).forEach((t=>{const[e,n]=t;void 0!==this.defaults[e]&&(this.defaults[e]=n)}))}getDefaults(){const t={};return Object.entries(this.defaults).forEach((e=>{const[n,r]=e;null!==this.defaults[n]&&(t[n]=r)})),t}get(t){if(void 0===t){const t=s.Z.get();return Object.entries(t).forEach((e=>{const[n,r]=e;this.snowboard.globalEvent("cookie.get",n,r,(e=>{t[n]=e}))})),t}let e=s.Z.get(t);return this.snowboard.globalEvent("cookie.get",t,e,(t=>{e=t})),e}set(t,e,n){let r=e;return this.snowboard.globalEvent("cookie.set",t,e,(t=>{r=t})),s.Z.set(t,r,a(a({},this.getDefaults()),n))}remove(t,e){s.Z.remove(t,a(a({},this.getDefaults()),e))}}class f extends o{construct(){window.wnJSON=t=>this.parse(t),window.ocJSON=window.wnJSON}parse(t){const e=this.parseString(t);return JSON.parse(e)}parseString(t){let e=t.trim();if(!e.length)throw new Error("Broken JSON object.");let n="",r=null,o=null,i="";for(;e&&","===e[0];)e=e.substr(1);if('"'===e[0]||"'"===e[0]){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");i='"';for(let t=1;t<e.length;t+=1)if("\\"===e[t])"'"===e[t+1]||(i+=e[t]),i+=e[t+1],t+=1;else{if(e[t]===e[0])return i+='"',i;'"'===e[t]?i+='\\"':i+=e[t]}throw new Error("Invalid string JSON object.")}if("true"===e||"false"===e)return e;if("null"===e)return"null";const s=parseFloat(e);if(!Number.isNaN(s))return s.toString();if("{"===e[0]){r="needKey",o=null,n="{";for(let t=1;t<e.length;t+=1)if(!this.isBlankChar(e[t]))if("needKey"!==r||'"'!==e[t]&&"'"!==e[t]){if("needKey"===r&&this.canBeKeyHead(e[t]))o=this.parseKey(e,t),n+='"',n+=o,n+='"',t+=o.length-1,r="afterKey";else if("afterKey"===r&&":"===e[t])n+=":",r=":";else if(":"===r)i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody";else if("afterBody"===r||"needKey"===r){let o=t;for(;","===e[o]||this.isBlankChar(e[o]);)o+=1;if("}"===e[o]&&o===e.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}o!==t&&"{"!==n&&(n+=",",r="needKey",t=o-1)}}else o=this.parseKey(e,t+1,e[t]),n+='"'.concat(o,'"'),t+=o.length,t+=1,r="afterKey";throw new Error("Broken JSON object near ".concat(n))}if("["===e[0]){n="[",r="needBody";for(let t=1;t<e.length;t+=1)if(" "!==e[t]&&"\n"!==e[t]&&"\t"!==e[t])if("needBody"===r){if(","===e[t]){n+="null,";continue}if("]"===e[t]&&t===e.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody"}else if("afterBody"===r)if(","===e[t])for(n+=",",r="needBody";","===e[t+1]||this.isBlankChar(e[t+1]);)","===e[t+1]&&(n+="null,"),t+=1;else if("]"===e[t]&&t===e.length-1)return n+="]",n;throw new Error("Broken JSON array near ".concat(n))}return""}getBody(t,e){let n="";if('"'===t[e]||"'"===t[e]){n=t[e];for(let r=e+1;r<t.length;r+=1)if("\\"===t[r])n+=t[r],r+1<t.length&&(n+=t[r+1]),r+=1;else{if(t[r]===t[e])return n+=t[e],{originLength:n.length,body:n};n+=t[r]}throw new Error("Broken JSON string body near ".concat(n))}if("t"===t[e]){if(t.indexOf("true",e)===e)return{originLength:"true".length,body:"true"};throw new Error("Broken JSON boolean body near ".concat(t.substr(0,e+10)))}if("f"===t[e]){if(t.indexOf("f",e)===e)return{originLength:"false".length,body:"false"};throw new Error("Broken JSON boolean body near ".concat(t.substr(0,e+10)))}if("n"===t[e]){if(t.indexOf("null",e)===e)return{originLength:"null".length,body:"null"};throw new Error("Broken JSON boolean body near ".concat(t.substr(0,e+10)))}if("-"===t[e]||"+"===t[e]||"."===t[e]||t[e]>="0"&&t[e]<="9"){n="";for(let r=e;r<t.length;r+=1){if(!("-"===t[r]||"+"===t[r]||"."===t[r]||t[r]>="0"&&t[r]<="9"))return{originLength:n.length,body:n};n+=t[r]}throw new Error("Broken JSON number body near ".concat(n))}if("{"===t[e]||"["===t[e]){const r=[t[e]];n=t[e];for(let o=e+1;o<t.length;o+=1){if(n+=t[o],"\\"===t[o])o+1<t.length&&(n+=t[o+1]),o+=1;else if('"'===t[o])'"'===r[r.length-1]?r.pop():"'"!==r[r.length-1]&&r.push(t[o]);else if("'"===t[o])"'"===r[r.length-1]?r.pop():'"'!==r[r.length-1]&&r.push(t[o]);else if('"'!==r[r.length-1]&&"'"!==r[r.length-1])if("{"===t[o])r.push("{");else if("}"===t[o]){if("{"!==r[r.length-1])throw new Error("Broken JSON ".concat("{"===t[e]?"object":"array"," body near ").concat(n));r.pop()}else if("["===t[o])r.push("[");else if("]"===t[o]){if("["!==r[r.length-1])throw new Error("Broken JSON ".concat("{"===t[e]?"object":"array"," body near ").concat(n));r.pop()}if(!r.length)return{originLength:o-e,body:n}}throw new Error("Broken JSON ".concat("{"===t[e]?"object":"array"," body near ").concat(n))}throw new Error("Broken JSON body near ".concat(t.substr(e-5>=0?e-5:0,50)))}parseKey(t,e,n){let r="";for(let o=e;o<t.length;o+=1){if(n&&n===t[o])return r;if(!n&&(" "===t[o]||":"===t[o]))return r;r+=t[o],"\\"===t[o]&&o+1<t.length&&(r+=t[o+1],o+=1)}throw new Error("Broken JSON syntax near ".concat(r))}canBeKeyHead(t){return"\\"!==t[0]&&(t[0]>="a"&&t[0]<="z"||t[0]>="A"&&t[0]<="Z"||"_"===t[0]||(t[0]>="0"&&t[0]<="9"||("$"===t[0]||t.charCodeAt(0)>255)))}isBlankChar(t){return" "===t||"\n"===t||"\t"===t}}class h extends o{construct(){window.wnSanitize=t=>this.sanitize(t),window.ocSanitize=window.wnSanitize}sanitize(t,e){const n=(new DOMParser).parseFromString(t,"text/html"),r=void 0===e||"boolean"!=typeof e||e;return this.sanitizeNode(n.getRootNode()),r?n.body.innerHTML:n.innerHTML}sanitizeNode(t){if("SCRIPT"===t.tagName)return void t.remove();this.trimAttributes(t);Array.from(t.children).forEach((t=>{this.sanitizeNode(t)}))}trimAttributes(t){if(t.attributes)for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes.item(e).name,r=t.attributes.item(e).value;0!==n.indexOf("on")&&0!==r.indexOf("javascript:")||t.removeAttribute(n)}}}n(5940);class p extends o{construct(){this.foundBaseUrl=null,this.baseUrl()}to(t){if(t.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return t;const e=t.replace(/^\/+/,"");return"".concat(this.baseUrl()).concat(e)}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const t=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=t.join(""),this.foundBaseUrl}validateBaseUrl(t){const e=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(t),n=e[2],r=e[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!r)throw new Error("Invalid base URL detected");return"/"===t.substr(-1)?t:"".concat(t,"/")}}class g{constructor(t,e){this.debugEnabled="boolean"==typeof e&&!0===e,this.autoInitSingletons="boolean"==typeof t&&!1===t,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.domReady=!1,this.attachAbstracts(),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=r,this.Singleton=o}loadUtilities(){this.addPlugin("cookie",l),this.addPlugin("jsonParser",f),this.addPlugin("sanitizer",h),this.addPlugin("url",p)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.domReady=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((t=>{t.isSingleton()&&t.dependenciesFulfilled()&&t.initialiseSingleton()}))}addPlugin(t,e){var n=this;const o=t.toLowerCase();if(this.hasPlugin(o))throw new Error('A plugin called "'.concat(t,'" is already registered.'));if("function"!=typeof e&&e instanceof r==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[t]||void 0!==this[o])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[o]=new i(o,this,e);const s=function(){return n.plugins[o].getInstance(...arguments)};this[t]=s,this[o]=s,this.debug('Plugin "'.concat(t,'" registered')),Object.values(this.getPlugins()).forEach((t=>{if(t.isSingleton()&&!t.isInitialised()&&t.dependenciesFulfilled()&&t.hasMethod("listens")&&Object.keys(t.callMethod("listens")).includes("ready")&&this.domReady){const e=t.callMethod("listens").ready;t.callMethod(e)}}))}removePlugin(t){const e=t.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((t=>{t.destruct()})),delete this.plugins[e],delete this[e],delete this[t],this.debug('Plugin "'.concat(t,'" removed'))):this.debug('Plugin "'.concat(t,'" already removed'))}hasPlugin(t){const e=t.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(t){if(!this.hasPlugin(t))throw new Error('No plugin called "'.concat(t,'" has been registered.'));return this.plugins[t]}listensToEvent(t){const e=[];return Object.entries(this.plugins).forEach((n=>{const[r,o]=n;if(o.isFunction())return;if(!o.dependenciesFulfilled())return;if(!o.hasMethod("listens"))return;"string"==typeof o.callMethod("listens")[t]&&e.push(r)})),e}ready(t){this.domReady&&t(),this.on("ready",t)}on(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].includes(e)||this.listeners[t].push(e)}off(t,e){if(!this.listeners[t])return;const n=this.listeners[t].indexOf(e);-1!==n&&this.listeners[t].splice(n,1)}globalEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug('Calling global event "'.concat(t,'"'),...n);const o=this.listensToEvent(t);if(0===o.length)return this.debug('No listeners found for global event "'.concat(t,'"')),!0;this.debug('Listeners found for global event "'.concat(t,'": ').concat(o.join(", ")));let i=!1;return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!i){if(!r[o])throw new Error('Missing "'.concat(o,'" method in "').concat(e,'" plugin'));try{!1===r[o](...n)&&(i=!0,this.debug('Global event "'.concat(t,'" cancelled by "').concat(e,'" plugin')))}catch(n){this.error('Error thrown in "'.concat(t,'" event by "').concat(e,'" plugin.'),n)}}}))})),!i&&this.listeners[t]&&this.listeners[t].length>0&&(this.debug("Found ".concat(this.listeners[t].length,' ad-hoc listener(s) for global event "').concat(t,'"')),this.listeners[t].forEach((e=>{if(!i)try{!1===e(...n)&&(i=!0,this.debug('Global event "'.concat(t," cancelled by an ad-hoc listener.")))}catch(e){this.error('Error thrown in "'.concat(t,'" event by an ad-hoc listener.'),e)}}))),!i}globalPromiseEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug('Calling global promise event "'.concat(t,'"'));const o=this.listensToEvent(t);if(0===o.length)return this.debug('No listeners found for global promise event "'.concat(t,'"')),Promise.resolve();this.debug('Listeners found for global promise event "'.concat(t,'": ').concat(o.join(", ")));const i=[];return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!r[o])throw new Error('Missing "'.concat(o,'" method in "').concat(e,'" plugin'));try{const t=r[o](...n);if(t instanceof Promise==!1)return;i.push(t)}catch(n){this.error('Error thrown in "'.concat(t,'" promise event by "').concat(e,'" plugin.'),n)}}))})),this.listeners[t]&&this.listeners[t].length>0&&(this.debug("Found ".concat(this.listeners[t].length,' ad-hoc listener(s) for global promise event "').concat(t,'"')),this.listeners[t].forEach((e=>{try{const t=e(...n);if(t instanceof Promise==!1)return;i.push(t)}catch(e){this.error('Error thrown in "'.concat(t,'" promise event by an ad-hoc listener.'),e)}}))),0===i.length?Promise.resolve():Promise.all(i)}logMessage(t,e,n){console.groupCollapsed("%c[Snowboard]","color: ".concat(t,"; font-weight: ").concat(e?"bold":"normal",";"),n);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];if(o.length){console.groupCollapsed("%cParameters %c(".concat(o.length,")"),"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let t=0;o.forEach((e=>{t+=1,console.log("%c".concat(t,":"),"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(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}debug(t){if(this.debugEnabled){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}}error(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(229, 35, 35)",!0,t,...n)}}},6236:function(t,e,n){"use strict";var r=n(1705);(t=>{const e=new r.Z;t.snowboard=e,t.Snowboard=e,t.SnowBoard=e})(window)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},8505:function(t,e,n){var r=n(6733),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),c=Array.prototype;null==c[s]&&i(c,s,{configurable:!0,value:o(null)}),t.exports=function(t){c[s][t]=!0}},6637:function(t,e,n){"use strict";var r=n(966).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var c,a=r(e),u=i(a),l=o(s,u);if(t&&n!=n){for(;u>l;)if((c=a[l++])!=c)return!0}else for(;u>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},1589:function(t,e,n){var r=n(1601),o=n(6733),i=n(7079),s=n(95)("toStringTag"),c=Object,a="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=c(t),s))?n:a?i(e):"Object"==(r=i(e))&&o(e.callee)?"Arguments":r}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var c=o(e),a=s.f,u=i.f,l=0;l<c.length;l++){var f=c[l];r(t,f)||n&&r(n,f)||a(t,f,u(e,f))}}},7528:function(t,e,n){var r=n(4229);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3723:function(t,e,n){"use strict";var r=n(693).IteratorPrototype,o=n(2391),i=n(5358),s=n(4555),c=n(5495),a=function(){return this};t.exports=function(t,e,n,u){var l=e+" Iterator";return t.prototype=o(r,{next:i(+!u,n)}),s(t,l,!1,!0),c[l]=a,t}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(5762),i=n(6039),s=n(8400);t.exports=function(t,e,n,c){c||(c={});var a=c.enumerable,u=void 0!==c.name?c.name:e;return r(n)&&i(n,u,c),c.global?a?t[e]=n:s(e,n):(c.unsafe?t[e]&&(a=!0):delete t[e],a?t[e]=n:o(t,e,n)),t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7675:function(t,e,n){"use strict";var r=n(3103),o=n(266),i=n(4231),s=n(1805),c=n(6733),a=n(3723),u=n(7567),l=n(6540),f=n(4555),h=n(5762),p=n(4768),g=n(95),d=n(5495),v=n(693),b=s.PROPER,y=s.CONFIGURABLE,w=v.IteratorPrototype,m=v.BUGGY_SAFARI_ITERATORS,x=g("iterator"),O="keys",S="values",E="entries",j=function(){return this};t.exports=function(t,e,n,s,g,v,P){a(n,e,s);var k,I,A,L=function(t){if(t===g&&M)return M;if(!m&&t in N)return N[t];switch(t){case O:case S:case E:return function(){return new n(this,t)}}return function(){return new n(this)}},B=e+" Iterator",T=!1,N=t.prototype,F=N[x]||N["@@iterator"]||g&&N[g],M=!m&&F||L(g),C="Array"==e&&N.entries||F;if(C&&(k=u(C.call(new t)))!==Object.prototype&&k.next&&(i||u(k)===w||(l?l(k,w):c(k[x])||p(k,x,j)),f(k,B,!0,!0),i&&(d[B]=j)),b&&g==S&&F&&F.name!==S&&(!i&&y?h(N,"name",S):(T=!0,M=function(){return o(F,this)})),g)if(I={values:L(S),keys:v?M:L(O),entries:L(E)},P)for(A in I)(m||T||!(A in N))&&p(N,A,I[A]);else r({target:e,proto:!0,forced:m||T},I);return i&&!P||N[x]===M||p(N,x,M,{name:g}),d[e]=M,I}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},5694:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8865:function(t,e,n){var r=n(2635)("span").classList,o=r&&r.constructor&&r.constructor.prototype;t.exports=o===Object.prototype?void 0:o},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),c=i.process,a=i.Deno,u=c&&c.versions||a&&a.version,l=u&&u.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),c=n(8400),a=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,h,p,g=t.target,d=t.global,v=t.stat;if(n=d?r:v?r[g]||c(g,{}):(r[g]||{}).prototype)for(l in e){if(h=e[l],f=t.dontCallGetSet?(p=o(n,l))&&p.value:n[l],!u(d?l:g+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;a(h,f)}(t.sham||f&&f.sham)&&i(h,"sham",!0),s(n,l,h,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4954:function(t,e,n){"use strict";n(7950);var r=n(5968),o=n(4768),i=n(3466),s=n(4229),c=n(95),a=n(5762),u=c("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var h=c(t),p=!s((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),g=p&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return e=!0,null},n[h](""),!e}));if(!p||!g||n){var d=r(/./[h]),v=e(h,""[t],(function(t,e,n,o,s){var c=r(t),a=e.exec;return a===i||a===l.exec?p&&!s?{done:!0,value:d(e,n,o)}:{done:!0,value:c(n,e,o)}:{done:!1}}));o(String.prototype,t,v[0]),o(l,h,v[1])}f&&a(l[h],"sham",!0)}},3171:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.apply,s=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,u=c&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,c=r&&i.bind(s,s);t.exports=r?function(t){return t&&c(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},17:function(t,e,n){var r=n(5968),o=n(2991),i=Math.floor,s=r("".charAt),c=r("".replace),a=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,f,h){var p=n+t.length,g=r.length,d=l;return void 0!==f&&(f=o(f),d=u),c(h,d,(function(o,c){var u;switch(s(c,0)){case"$":return"$";case"&":return t;case"`":return a(e,0,n);case"'":return a(e,p);case"<":u=f[a(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>g){var h=i(l/10);return 0===h?o:h<=g?void 0===r[h-1]?s(c,1):r[h-1]+s(c,1):o}u=r[l-1]}return void 0===u?"":u}))}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,c=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(8694),c=n(9859),a=n(5968),u=n(5052),l=n(5762),f=n(8270),h=n(5353),p=n(4399),g=n(5977),d="Object already initialized",v=c.TypeError,b=c.WeakMap;if(s||h.state){var y=h.state||(h.state=new b),w=a(y.get),m=a(y.has),x=a(y.set);r=function(t,e){if(m(y,t))throw new v(d);return e.facade=t,x(y,t,e),e},o=function(t){return w(y,t)||{}},i=function(t){return m(y,t)}}else{var O=p("state");g[O]=!0,r=function(t,e){if(f(t,O))throw new v(d);return e.facade=t,l(t,O,e),e},o=function(t){return f(t,O)?t[O]:{}},i=function(t){return f(t,O)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=a[c(t)];return n==l||n!=u&&(o(e)?r(e):!!e)},c=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},5052:function(t,e,n){var r=n(6733);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),c=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,c(t))}},693:function(t,e,n){"use strict";var r,o,i,s=n(4229),c=n(6733),a=n(2391),u=n(7567),l=n(4768),f=n(95),h=n(4231),p=f("iterator"),g=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(r=o):g=!0),null==r||s((function(){var t={};return r[p].call(t)!==t}))?r={}:h&&(r=a(r)),c(r[p])||l(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},5495:function(t){t.exports={}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),c=n(1805).CONFIGURABLE,a=n(8511),u=n(6407),l=u.enforce,f=u.get,h=Object.defineProperty,p=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),d=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||c&&t.name!==e)&&h(t,"name",{value:e,configurable:!0}),p&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return i(r,"source")||(r.source=g.join("string"==typeof e?e:"")),t};Function.prototype.toString=d((function(){return o(this)&&f(this).source||a(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},3839:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8694:function(t,e,n){var r=n(9859),o=n(6733),i=n(8511),s=r.WeakMap;t.exports=o(s)&&/native code/.test(i(s))},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),c=n(5977),a=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"</"+"script>"},g=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},d=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;d="undefined"!=typeof document?document.domain&&r?g(r):((e=u("iframe")).style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):g(r);for(var n=s.length;n--;)delete d.prototype[s[n]];return d()};c[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=o(t),n=new h,h.prototype=null,n[f]=t):n=d(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),c=n(905),a=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=c(e),o=a(e),u=o.length,l=0;u>l;)i.f(t,n=o[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),c=n(9310),a=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",p="writable";e.f=r?i?function(t,e,n){if(s(t),e=c(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=c(e),s(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),c=n(905),a=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=c(t),e=a(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},7567:function(t,e,n){var r=n(8270),o=n(6733),i=n(2991),s=n(4399),c=n(7528),a=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=c?u.getPrototypeOf:function(t){var e=i(t);if(r(e,a))return e[a];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof u?l:null}},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,c=n(5977),a=r([].push);t.exports=function(t,e){var n,r=i(t),u=0,l=[];for(n in r)!o(c,n)&&o(r,n)&&a(l,n);for(;e.length>u;)o(r,n=e[u++])&&(~s(l,n)||a(l,n));return l}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},6540:function(t,e,n){var r=n(5968),o=n(1176),i=n(8505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,c;if("string"===e&&o(n=t.toString)&&!i(c=r(n,t)))return c;if(o(n=t.valueOf)&&!i(c=r(n,t)))return c;if("string"!==e&&o(n=t.toString)&&!i(c=r(n,t)))return c;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),c=n(1176),a=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(c(t)),n=s.f;return n?a(e,n(t)):e}},8115:function(t,e,n){var r=n(266),o=n(1176),i=n(6733),s=n(7079),c=n(3466),a=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var u=r(n,t,e);return null!==u&&o(u),u}if("RegExp"===s(t))return r(c,t,e);throw a("RegExp#exec called on incompatible receiver")}},3466:function(t,e,n){"use strict";var r,o,i=n(266),s=n(5968),c=n(3326),a=n(895),u=n(5650),l=n(3036),f=n(2391),h=n(6407).get,p=n(2926),g=n(461),d=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,b=v,y=s("".charAt),w=s("".indexOf),m=s("".replace),x=s("".slice),O=(o=/b*/g,i(v,r=/a/,"a"),i(v,o,"a"),0!==r.lastIndex||0!==o.lastIndex),S=u.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(O||E||S||p||g)&&(b=function(t){var e,n,r,o,s,u,l,p=this,g=h(p),j=c(t),P=g.raw;if(P)return P.lastIndex=p.lastIndex,e=i(b,P,j),p.lastIndex=P.lastIndex,e;var k=g.groups,I=S&&p.sticky,A=i(a,p),L=p.source,B=0,T=j;if(I&&(A=m(A,"y",""),-1===w(A,"g")&&(A+="g"),T=x(j,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(j,p.lastIndex-1))&&(L="(?: "+L+")",T=" "+T,B++),n=new RegExp("^(?:"+L+")",A)),E&&(n=new RegExp("^"+L+"$(?!\\s)",A)),O&&(r=p.lastIndex),o=i(v,I?n:p,T),I?o?(o.input=x(o.input,B),o[0]=x(o[0],B),o.index=p.lastIndex,p.lastIndex+=o[0].length):p.lastIndex=0:O&&o&&(p.lastIndex=p.global?o.index+o[0].length:r),E&&o&&o.length>1&&i(d,o[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(o[s]=void 0)})),o&&k)for(o.groups=u=f(null),s=0;s<k.length;s++)u[(l=k[s])[0]]=o[l[1]];return o}),t.exports=b},895:function(t,e,n){"use strict";var r=n(1176);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},5650:function(t,e,n){var r=n(4229),o=n(9859).RegExp,i=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=i||r((function(){return!o("a","y").sticky})),c=i||r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:c,MISSED_STICKY:s,UNSUPPORTED_Y:i}},2926:function(t,e,n){var r=n(4229),o=n(9859).RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},461:function(t,e,n){var r=n(4229),o=n(9859).RegExp;t.exports=r((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},8885:function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},4555:function(t,e,n){var r=n(1787).f,o=n(8270),i=n(95)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.8",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE",source:"https://github.com/zloirock/core-js"})},966:function(t,e,n){var r=n(5968),o=n(3329),i=n(3326),s=n(8885),c=r("".charAt),a=r("".charCodeAt),u=r("".slice),l=function(t){return function(e,n){var r,l,f=i(s(e)),h=o(n),p=f.length;return h<0||h>=p?t?"":void 0:(r=a(f,h))<55296||r>56319||h+1===p||(l=a(f,h+1))<56320||l>57343?t?c(f,h):r:t?u(f,h,h+2):l-56320+(r-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),c=n(2914),a=n(95),u=TypeError,l=a("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,a=s(t,l);if(a){if(void 0===e&&(e="default"),n=r(a,t,e),!o(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1601:function(t,e,n){var r={};r[n(95)("toStringTag")]="z",t.exports="[object z]"===String(r)},3326:function(t,e,n){var r=n(1589),o=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(3839);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),c=n(3839),a=n(6969),u=o("wks"),l=r.Symbol,f=l&&l.for,h=a?l:l&&l.withoutSetter||s;t.exports=function(t){if(!i(u,t)||!c&&"string"!=typeof u[t]){var e="Symbol."+t;c&&i(l,t)?u[t]=l[t]:u[t]=a&&f?f(e):h(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},5735:function(t,e,n){"use strict";var r=n(905),o=n(9736),i=n(5495),s=n(6407),c=n(1787).f,a=n(7675),u=n(4231),l=n(7400),f="Array Iterator",h=s.set,p=s.getterFor(f);t.exports=a(Array,"Array",(function(t,e){h(this,{type:f,target:r(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var g=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!u&&l&&"values"!==g.name)try{c(g,"name",{value:"values"})}catch(t){}},7950:function(t,e,n){"use strict";var r=n(3103),o=n(3466);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},5940:function(t,e,n){"use strict";var r=n(3171),o=n(266),i=n(5968),s=n(4954),c=n(4229),a=n(1176),u=n(6733),l=n(3329),f=n(4237),h=n(3326),p=n(8885),g=n(6637),d=n(5300),v=n(17),b=n(8115),y=n(95)("replace"),w=Math.max,m=Math.min,x=i([].concat),O=i([].push),S=i("".indexOf),E=i("".slice),j="$0"==="a".replace(/./,"$0"),P=!!/./[y]&&""===/./[y]("a","$0");s("replace",(function(t,e,n){var i=P?"$":"$0";return[function(t,n){var r=p(this),i=null==t?void 0:d(t,y);return i?o(i,t,r,n):o(e,h(r),t,n)},function(t,o){var s=a(this),c=h(t);if("string"==typeof o&&-1===S(o,i)&&-1===S(o,"$<")){var p=n(e,s,c,o);if(p.done)return p.value}var d=u(o);d||(o=h(o));var y=s.global;if(y){var j=s.unicode;s.lastIndex=0}for(var P=[];;){var k=b(s,c);if(null===k)break;if(O(P,k),!y)break;""===h(k[0])&&(s.lastIndex=g(c,f(s.lastIndex),j))}for(var I,A="",L=0,B=0;B<P.length;B++){for(var T=h((k=P[B])[0]),N=w(m(l(k.index),c.length),0),F=[],M=1;M<k.length;M++)O(F,void 0===(I=k[M])?I:String(I));var C=k.groups;if(d){var R=x([T],F,N,c);void 0!==C&&O(R,C);var _=h(r(o,void 0,R))}else _=v(T,c,N,F,C,o);N>=L&&(A+=E(c,L,N)+_,L=N+T.length)}return A+E(c,L)}]}),!!c((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!j||P)},6886:function(t,e,n){var r=n(9859),o=n(5694),i=n(8865),s=n(5735),c=n(5762),a=n(95),u=a("iterator"),l=a("toStringTag"),f=s.values,h=function(t,e){if(t){if(t[u]!==f)try{c(t,u,f)}catch(e){t[u]=f}if(t[l]||c(t,l,e),o[e])for(var n in s)if(t[n]!==s[n])try{c(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var p in o)h(r[p]&&r[p].prototype,p);h(i,"DOMTokenList")}},function(t){t.O(0,[109],(function(){return e=6236,t(t.s=e);var e}));t.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{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)}}},878:function(e,t,n){n.d(t,{Z:function(){return b}});class i{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class s extends i{}var 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<e;n++)t[n]=arguments[n];const i=t,s=i.shift();return this.instance.prototype[s](i)}getInstance(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const e=this.getDependencies().filter((e=>!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;s<t;s++)n[s]=arguments[s];return i(e,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(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;s<t;s++)n[s]=arguments[s];return i(e,...n)}})));const s=new this.instance(this.snowboard,...n);return s.detach=()=>this.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==!1}isSingleton(){return this.instance.prototype instanceof s==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=new this.instance(this.snowboard,...t);i.detach=()=>this.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<e;s++)i[s]=arguments[s];return t(n,...i)})}}unmock(e){this.isFunction()||this.mocks[e]&&(this.isSingleton()&&(this.instances[0][e]=this.originalFunctions[e]),delete this.mocks[e],delete this.originalFunctions[e])}}var l=n(805);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class u extends s{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(e){if("object"!=typeof e)throw new Error("Cookie defaults must be provided as an object");Object.entries(e).forEach((e=>{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 g extends s{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<t.length;e+=1)if("\\"===t[e])"'"===t[e+1]||(r+=t[e]),r+=t[e+1],e+=1;else{if(t[e]===t[0])return r+='"',r;'"'===t[e]?r+='\\"':r+=t[e]}throw new Error("Invalid string JSON object.")}if("true"===t||"false"===t)return t;if("null"===t)return"null";const o=parseFloat(t);if(!Number.isNaN(o))return o.toString();if("{"===t[0]){i="needKey",s=null,n="{";for(let e=1;e<t.length;e+=1)if(!this.isBlankChar(t[e]))if("needKey"!==i||'"'!==t[e]&&"'"!==t[e]){if("needKey"===i&&this.canBeKeyHead(t[e]))s=this.parseKey(t,e),n+='"',n+=s,n+='"',e+=s.length-1,i="afterKey";else if("afterKey"===i&&":"===t[e])n+=":",i=":";else if(":"===i)r=this.getBody(t,e),e=e+r.originLength-1,n+=this.parseString(r.body),i="afterBody";else if("afterBody"===i||"needKey"===i){let s=e;for(;","===t[s]||this.isBlankChar(t[s]);)s+=1;if("}"===t[s]&&s===t.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}s!==e&&"{"!==n&&(n+=",",i="needKey",e=s-1)}}else s=this.parseKey(t,e+1,t[e]),n+=`"${s}"`,e+=s.length,e+=1,i="afterKey";throw new Error(`Broken JSON object near ${n}`)}if("["===t[0]){n="[",i="needBody";for(let e=1;e<t.length;e+=1)if(" "!==t[e]&&"\n"!==t[e]&&"\t"!==t[e])if("needBody"===i){if(","===t[e]){n+="null,";continue}if("]"===t[e]&&e===t.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;r=this.getBody(t,e),e=e+r.originLength-1,n+=this.parseString(r.body),i="afterBody"}else if("afterBody"===i)if(","===t[e])for(n+=",",i="needBody";","===t[e+1]||this.isBlankChar(t[e+1]);)","===t[e+1]&&(n+="null,"),e+=1;else if("]"===t[e]&&e===t.length-1)return n+="]",n;throw new Error(`Broken JSON array near ${n}`)}return""}getBody(e,t){let n="";if('"'===e[t]||"'"===e[t]){n=e[t];for(let i=t+1;i<e.length;i+=1)if("\\"===e[i])n+=e[i],i+1<e.length&&(n+=e[i+1]),i+=1;else{if(e[i]===e[t])return n+=e[t],{originLength:n.length,body:n};n+=e[i]}throw new Error(`Broken JSON string body near ${n}`)}if("t"===e[t]){if(e.indexOf("true",t)===t)return{originLength:"true".length,body:"true"};throw new Error(`Broken JSON boolean body near ${e.substr(0,t+10)}`)}if("f"===e[t]){if(e.indexOf("f",t)===t)return{originLength:"false".length,body:"false"};throw new Error(`Broken JSON boolean body near ${e.substr(0,t+10)}`)}if("n"===e[t]){if(e.indexOf("null",t)===t)return{originLength:"null".length,body:"null"};throw new Error(`Broken JSON boolean body near ${e.substr(0,t+10)}`)}if("-"===e[t]||"+"===e[t]||"."===e[t]||e[t]>="0"&&e[t]<="9"){n="";for(let i=t;i<e.length;i+=1){if(!("-"===e[i]||"+"===e[i]||"."===e[i]||e[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<e.length;s+=1){if(n+=e[s],"\\"===e[s])s+1<e.length&&(n+=e[s+1]),s+=1;else if('"'===e[s])'"'===i[i.length-1]?i.pop():"'"!==i[i.length-1]&&i.push(e[s]);else if("'"===e[s])"'"===i[i.length-1]?i.pop():'"'!==i[i.length-1]&&i.push(e[s]);else if('"'!==i[i.length-1]&&"'"!==i[i.length-1])if("{"===e[s])i.push("{");else if("}"===e[s]){if("{"!==i[i.length-1])throw new Error(`Broken JSON ${"{"===e[t]?"object":"array"} body near ${n}`);i.pop()}else if("["===e[s])i.push("[");else if("]"===e[s]){if("["!==i[i.length-1])throw new Error(`Broken JSON ${"{"===e[t]?"object":"array"} body near ${n}`);i.pop()}if(!i.length)return{originLength:s-t,body:n}}throw new Error(`Broken JSON ${"{"===e[t]?"object":"array"} body near ${n}`)}throw new Error(`Broken JSON body near ${e.substr(t-5>=0?t-5:0,50)}`)}parseKey(e,t,n){let i="";for(let s=t;s<e.length;s+=1){if(n&&n===e[s])return i;if(!n&&(" "===e[s]||":"===e[s]))return i;i+=e[s],"\\"===e[s]&&s+1<e.length&&(i+=e[s+1],s+=1)}throw new Error(`Broken JSON syntax near ${i}`)}canBeKeyHead(e){return"\\"!==e[0]&&(e[0]>="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{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<e.attributes.length;t+=1){const n=e.attributes.item(t).name,i=e.attributes.item(t).value;0!==n.indexOf("on")&&0!==i.indexOf("javascript:")||e.removeAttribute(n)}}}class f extends s{construct(){this.foundBaseUrl=null,this.baseUrl()}to(e){if(e.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return e;const t=e.replace(/^\/+/,"");return`${this.baseUrl()}${t}`}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const e=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=e.join(""),this.foundBaseUrl}validateBaseUrl(e){const t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(e),n=t[2],i=t[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!i)throw new Error("Invalid base URL detected");return"/"===e.substr(-1)?e:`${e}/`}}class b{constructor(e,t){this.debugEnabled="boolean"==typeof t&&!0===t,this.autoInitSingletons="boolean"==typeof e&&!1===e,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.readiness={dom:!1},Object.seal(this.readiness),this.attachAbstracts(),Object.freeze(b.prototype),Object.freeze(this),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=i,this.Singleton=s,Object.freeze(this.PluginBase.prototype),Object.freeze(this.PluginBase),Object.freeze(this.Singleton.prototype),Object.freeze(this.Singleton)}loadUtilities(){this.addPlugin("cookie",u),this.addPlugin("jsonParser",g),this.addPlugin("sanitizer",d),this.addPlugin("url",f)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{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==!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;"string"==typeof s.callMethod("listens")[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<t;i++)n[i-1]=arguments[i];this.debug(`Calling global event "${e}"`,...n);const s=this.listensToEvent(e);if(0===s.length)return this.debug(`No listeners found for global event "${e}"`),!0;this.debug(`Listeners found for global event "${e}": ${s.join(", ")}`);let r=!1;return s.forEach((t=>{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(!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)}}}))})),!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<t;i++)n[i-1]=arguments[i];this.debug(`Calling global promise event "${e}"`);const s=this.listensToEvent(e);if(0===s.length)return this.debug(`No listeners found for global promise event "${e}"`),Promise.resolve();this.debug(`Listeners found for global promise event "${e}": ${s.join(", ")}`);const r=[];return s.forEach((t=>{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(!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)}}))})),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<i;r++)s[r-3]=arguments[r];if(s.length){console.groupCollapsed(`%cParameters %c(${s.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let e=0;s.forEach((t=>{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;i<t;i++)n[i-1]=arguments[i];this.logMessage("rgb(45, 167, 199)",!1,e,...n)}debug(e){if(this.debugEnabled){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.logMessage("rgb(45, 167, 199)",!1,e,...n)}}error(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.logMessage("rgb(229, 35, 35)",!0,e,...n)}}},236:function(e,t,n){var i=n(878),s=n(662);(e=>{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
modules/system/assets/js/snowboard/build/snowboard.data-attr.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[806],{9250:function(){function e(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 t(t){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Data Attributes plugin.");class a extends Snowboard.Singleton{listens(){return{ready:"ready",ajaxSetup:"onAjaxSetup"}}ready(){this.attachHandlers(),this.disableDefaultFormValidation()}dependencies(){return["request","jsonParser"]}destruct(){this.detachHandlers(),super.destruct()}attachHandlers(){window.addEventListener("change",(e=>this.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(;"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 r=e.element.getAttribute("name"),a=t(t({},this.getParentRequestData(e.element)),e.options.data);e.element&&e.element.matches("input, textarea, select, button")&&!e.form&&r&&!e.options.data[r]&&(a[r]=e.element.value),e.options.data=a}getParentRequestData(e){const r=[];let a={},n=e;for(;n.parentElement&&"HTML"!==n.parentElement.tagName;)r.push(n.parentElement),n=n.parentElement;return r.reverse(),r.forEach((e=>{const r=e.dataset;"requestData"in r&&(a=t(t({},a),this.parseData(r.requestData)))})),a}parseData(e){let t;if(void 0===e&&(t=""),"object"==typeof t)return t;try{return this.snowboard.jsonparser().parse("{".concat(e,"}"))}catch(e){throw new Error("Error parsing the data attribute on element: ".concat(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)}}Snowboard.addPlugin("attributeRequest",a)}},function(e){var t;t=9250,e(e.s=t)}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[806],{250:function(){function e(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 t(t){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Data Attributes plugin.");class a extends Snowboard.Singleton{listens(){return{ready:"ready",ajaxSetup:"onAjaxSetup"}}ready(){this.attachHandlers(),this.disableDefaultFormValidation()}dependencies(){return["request","jsonParser"]}destruct(){this.detachHandlers(),super.destruct()}attachHandlers(){window.addEventListener("change",(e=>this.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(;"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 r=e.element.getAttribute("name"),a=t(t({},this.getParentRequestData(e.element)),e.options.data);e.element&&e.element.matches("input, textarea, select, button")&&!e.form&&r&&!e.options.data[r]&&(a[r]=e.element.value),e.options.data=a}getParentRequestData(e){const r=[];let a={},n=e;for(;n.parentElement&&"HTML"!==n.parentElement.tagName;)r.push(n.parentElement),n=n.parentElement;return r.reverse(),r.forEach((e=>{const r=e.dataset;"requestData"in r&&(a=t(t({},a),this.parseData(r.requestData)))})),a}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)}}Snowboard.addPlugin("attributeRequest",a)}},function(e){var t;t=250,e(e.s=t)}]); \ No newline at end of file
modules/system/assets/js/snowboard/build/snowboard.extras.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{8809:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(6886);class r extends window.Snowboard.Singleton{listens(){return{ajaxLoadAssets:"load"}}async load(t){if(t.js&&t.js.length>0)for(const e of t.js)try{await this.loadScript(e)}catch(t){return Promise.reject(t)}if(t.css&&t.css.length>0)for(const e of t.css)try{await this.loadStyle(e)}catch(t){return Promise.reject(t)}if(t.img&&t.img.length>0)for(const e of t.img)try{await this.loadImage(e)}catch(t){return Promise.reject(t)}return Promise.resolve()}loadScript(t){return new Promise(((e,n)=>{if(document.querySelector('script[src="'.concat(t,'"]')))return void e();const r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",t),r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",t,r),n(new Error('Unable to load script file: "'.concat(t,'"')))})),document.body.append(r)}))}loadStyle(t){return new Promise(((e,n)=>{if(document.querySelector('link[rel="stylesheet"][href="'.concat(t,'"]')))return void e();const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",t),r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",t,r),n(new Error('Unable to load stylesheet file: "'.concat(t,'"')))})),document.head.append(r)}))}loadImage(t){return new Promise(((e,n)=>{const r=new Image;r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",t,r),n(new Error('Unable to load image file: "'.concat(t,'"')))})),r.src=t}))}}},9553:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.add(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.add(this.getLoadingClass(e.element))}ajaxDone(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.remove(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.remove(this.getLoadingClass(e.element))}getLoadingClass(t){return void 0!==t.dataset.attachLoading&&""!==t.dataset.attachLoading?t.dataset.attachLoading:"wn-loading"}}},5763:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(9529),n(5940);class r extends Snowboard.PluginBase{construct(t,e){if(t instanceof Snowboard.PluginBase==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(e instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=t,this.element=e,this.refresh()}get(t){return void 0===t?this.instanceConfig:void 0!==this.instanceConfig[t]?this.instanceConfig[t]:void 0}set(t,e,n){if(void 0===t)throw new Error("You must provide a configuration key to set");this.instanceConfig[t]=e,!0===n&&(this.element.dataset[t]=e)}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 t=this.getDefaults();if(!1===this.acceptedConfigs)return t;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(t[e]=this.coerceValue(this.element.dataset[e]));return t}coerceValue(t){const e=String(t);if("null"===e)return null;if("undefined"!==e){if(e.startsWith("base64:")){const t=e.replace(/^base64:/,""),n=atob(t);return this.coerceValue(n)}if(["true","yes"].includes(e.toLowerCase()))return!0;if(["false","no"].includes(e.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(e))return Number(e);try{return this.snowboard.jsonParser().parse(e)}catch(t){return""===e||e}}}}},2270:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.PluginBase{construct(t,e,n){if(this.message=t,this.type=e||"default",this.duration=Number(n||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((t=>t.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,"".concat(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)}}},6277:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(1515);class r extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(t){this.show(),t.catch((()=>{this.hide()})).finally((()=>{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 t=this.stripe.cloneNode(!0);this.indicator.appendChild(t),this.stripe.remove(),this.stripe=t,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(t){this.counter-=1,!0===t&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},8032:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{listens(){return{ready:"ready"}}ready(){let t=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((e=>{e.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(t=!0)})),!t){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",this.snowboard.url().to("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(t)}}}},8269:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(6886);class r extends Snowboard.PluginBase{construct(t,e,n,r,o){if(t instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=t,"string"!=typeof e)throw new Error("Transition name must be specified as a string");if(this.transition=e,n&&"function"!=typeof n)throw new Error("Callback must be a valid function");this.callback=n,this.duration=r?this.parseDuration(r):null,this.trailTo=!0===o,this.doTransition()}eventClasses(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r={in:"".concat(this.transition,"-in"),active:"".concat(this.transition,"-active"),out:"".concat(this.transition,"-out")};if(0===e.length)return Object.values(r);const o=[];return Object.entries(r).forEach((t=>{const[n,r]=t;-1!==e.indexOf(n)&&o.push(r)})),o}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((t=>{this.element.classList.add(t)})),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((t=>{this.element.classList.remove(t)})),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((t=>{this.element.classList.remove(t)}))}parseDuration(t){const e=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(t),n=Number(e[1]),r="s"===e[3]?"sec":"msec";return"".concat("sec"===r?1e3*n:Math.floor(n),"ms")}}},3783:function(t,e,n){"use strict";var r=n(2270);n(6886);class o extends Snowboard.Singleton{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((t=>{this.snowboard.flash(t.innerHTML,t.dataset.flashType,t.dataset.flashDuration)}))}ajaxErrorMessage(t){return this.snowboard.flash(t,"error"),!1}ajaxFlashMessages(t){return Object.entries(t).forEach((t=>{const[e,n]=t;this.snowboard.flash(n,e)})),!1}}var i=n(8269),s=n(9553),a=n(6277),c=n(8032),u=n(8809),l=n(5763);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(t=>{t.addPlugin("assetLoader",u.Z),t.addPlugin("dataConfig",l.Z),t.addPlugin("extrasStyles",c.Z),t.addPlugin("transition",i.Z),t.addPlugin("flash",r.Z),t.addPlugin("flashListener",o),t.addPlugin("attachLoading",s.Z),t.addPlugin("stripeLoader",a.Z)})(window.Snowboard)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},7988:function(t,e,n){var r=n(2359),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a constructor")}},8505:function(t,e,n){var r=n(6733),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},6637:function(t,e,n){"use strict";var r=n(966).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=i(c),l=o(s,u);if(t&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},1589:function(t,e,n){var r=n(1601),o=n(6733),i=n(7079),s=n(95)("toStringTag"),a=Object,c="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:c?i(e):"Object"==(r=i(e))&&o(e.callee)?"Arguments":r}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=o(e),c=s.f,u=i.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},7528:function(t,e,n){var r=n(4229);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3723:function(t,e,n){"use strict";var r=n(693).IteratorPrototype,o=n(2391),i=n(5358),s=n(4555),a=n(5495),c=function(){return this};t.exports=function(t,e,n,u){var l=e+" Iterator";return t.prototype=o(r,{next:i(+!u,n)}),s(t,l,!1,!0),a[l]=c,t}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(5762),i=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;return r(n)&&i(n,u,a),a.global?c?t[e]=n:s(e,n):(a.unsafe?t[e]&&(c=!0):delete t[e],c?t[e]=n:o(t,e,n)),t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7675:function(t,e,n){"use strict";var r=n(3103),o=n(266),i=n(4231),s=n(1805),a=n(6733),c=n(3723),u=n(7567),l=n(6540),f=n(4555),d=n(5762),h=n(4768),p=n(95),v=n(5495),m=n(693),g=s.PROPER,y=s.CONFIGURABLE,b=m.IteratorPrototype,x=m.BUGGY_SAFARI_ITERATORS,w=p("iterator"),S="keys",E="values",L="entries",O=function(){return this};t.exports=function(t,e,n,s,p,m,j){c(n,e,s);var T,C,P,A=function(t){if(t===p&&_)return _;if(!x&&t in M)return M[t];switch(t){case S:case E:case L:return function(){return new n(this,t)}}return function(){return new n(this)}},I=e+" Iterator",k=!1,M=t.prototype,R=M[w]||M["@@iterator"]||p&&M[p],_=!x&&R||A(p),D="Array"==e&&M.entries||R;if(D&&(T=u(D.call(new t)))!==Object.prototype&&T.next&&(i||u(T)===b||(l?l(T,b):a(T[w])||h(T,w,O)),f(T,I,!0,!0),i&&(v[I]=O)),g&&p==E&&R&&R.name!==E&&(!i&&y?d(M,"name",E):(k=!0,_=function(){return o(R,this)})),p)if(C={values:A(E),keys:m?_:A(S),entries:A(L)},j)for(P in C)(x||k||!(P in M))&&h(M,P,C[P]);else r({target:e,proto:!0,forced:x||k},C);return i&&!j||M[w]===_||h(M,w,_,{name:p}),v[e]=_,C}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},5694:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8865:function(t,e,n){var r=n(2635)("span").classList,o=r&&r.constructor&&r.constructor.prototype;t.exports=o===Object.prototype?void 0:o},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),a=i.process,c=i.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,d,h,p=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[p]||a(p,{}):(r[p]||{}).prototype)for(l in e){if(d=e[l],f=t.dontCallGetSet?(h=o(n,l))&&h.value:n[l],!u(v?l:p+(m?".":"#")+l,t.forced)&&void 0!==f){if(typeof d==typeof f)continue;c(d,f)}(t.sham||f&&f.sham)&&i(d,"sham",!0),s(n,l,d,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4954:function(t,e,n){"use strict";n(7950);var r=n(5968),o=n(4768),i=n(3466),s=n(4229),a=n(95),c=n(5762),u=a("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var d=a(t),h=!s((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=h&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e}));if(!h||!p||n){var v=r(/./[d]),m=e(d,""[t],(function(t,e,n,o,s){var a=r(t),c=e.exec;return c===i||c===l.exec?h&&!s?{done:!0,value:v(e,n,o)}:{done:!0,value:a(n,e,o)}:{done:!1}}));o(String.prototype,t,m[0]),o(l,d,m[1])}f&&c(l[d],"sham",!0)}},3171:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.apply,s=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},17:function(t,e,n){var r=n(5968),o=n(2991),i=Math.floor,s=r("".charAt),a=r("".replace),c=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,f,d){var h=n+t.length,p=r.length,v=l;return void 0!==f&&(f=o(f),v=u),a(d,v,(function(o,a){var u;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return c(e,0,n);case"'":return c(e,h);case"<":u=f[c(a,1,-1)];break;default:var l=+a;if(0===l)return o;if(l>p){var d=i(l/10);return 0===d?o:d<=p?void 0===r[d-1]?s(a,1):r[d-1]+s(a,1):o}u=r[l-1]}return void 0===u?"":u}))}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(8694),a=n(9859),c=n(5968),u=n(5052),l=n(5762),f=n(8270),d=n(5353),h=n(4399),p=n(5977),v="Object already initialized",m=a.TypeError,g=a.WeakMap;if(s||d.state){var y=d.state||(d.state=new g),b=c(y.get),x=c(y.has),w=c(y.set);r=function(t,e){if(x(y,t))throw new m(v);return e.facade=t,w(y,t,e),e},o=function(t){return b(y,t)||{}},i=function(t){return x(y,t)}}else{var S=h("state");p[S]=!0,r=function(t,e){if(f(t,S))throw new m(v);return e.facade=t,l(t,S,e),e},o=function(t){return f(t,S)?t[S]:{}},i=function(t){return f(t,S)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw m("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},2359:function(t,e,n){var r=n(5968),o=n(4229),i=n(6733),s=n(1589),a=n(1333),c=n(8511),u=function(){},l=[],f=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,h=r(d.exec),p=!d.exec(u),v=function(t){if(!i(t))return!1;try{return f(u,l,t),!0}catch(t){return!1}},m=function(t){if(!i(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(d,c(t))}catch(t){return!0}};m.sham=!0,t.exports=!f||o((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?m:v},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==l||n!=u&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},5052:function(t,e,n){var r=n(6733);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},693:function(t,e,n){"use strict";var r,o,i,s=n(4229),a=n(6733),c=n(2391),u=n(7567),l=n(4768),f=n(95),d=n(4231),h=f("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(r=o):p=!0),null==r||s((function(){var t={};return r[h].call(t)!==t}))?r={}:d&&(r=c(r)),a(r[h])||l(r,h,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},5495:function(t){t.exports={}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),l=u.enforce,f=u.get,d=Object.defineProperty,h=s&&!r((function(){return 8!==d((function(){}),"length",{value:8}).length})),p=String(String).split("String"),v=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&d(t,"name",{value:e,configurable:!0}),h&&n&&i(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return i(r,"source")||(r.source=p.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return o(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},3839:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8694:function(t,e,n){var r=n(9859),o=n(6733),i=n(8511),s=r.WeakMap;t.exports=o(s)&&/native code/.test(i(s))},6485:function(t,e,n){"use strict";var r=n(7111),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),d=function(){},h=function(t){return"<script>"+t+"</"+"script>"},p=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&r?p(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):p(r);for(var n=s.length;n--;)delete v.prototype[s[n]];return v()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=o(t),n=new d,d.prototype=null,n[f]=t):n=v(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=c(e),u=o.length,l=0;u>l;)i.f(t,n=o[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",h="writable";e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&h in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:d in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},7567:function(t,e,n){var r=n(8270),o=n(6733),i=n(2991),s=n(4399),a=n(7528),c=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=a?u.getPrototypeOf:function(t){var e=i(t);if(r(e,c))return e[c];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof u?l:null}},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=i(t),u=0,l=[];for(n in r)!o(a,n)&&o(r,n)&&c(l,n);for(;e.length>u;)o(r,n=e[u++])&&(~s(l,n)||c(l,n));return l}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},6540:function(t,e,n){var r=n(5968),o=n(1176),i=n(8505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),a=n(1176),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?c(e,n(t)):e}},4473:function(t,e,n){var r=n(9859);t.exports=r.Promise},7757:function(t,e,n){var r=n(1176),o=n(5052),i=n(6485);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},8115:function(t,e,n){var r=n(266),o=n(1176),i=n(6733),s=n(7079),a=n(3466),c=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var u=r(n,t,e);return null!==u&&o(u),u}if("RegExp"===s(t))return r(a,t,e);throw c("RegExp#exec called on incompatible receiver")}},3466:function(t,e,n){"use strict";var r,o,i=n(266),s=n(5968),a=n(3326),c=n(895),u=n(5650),l=n(3036),f=n(2391),d=n(6407).get,h=n(2926),p=n(461),v=l("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,g=m,y=s("".charAt),b=s("".indexOf),x=s("".replace),w=s("".slice),S=(o=/b*/g,i(m,r=/a/,"a"),i(m,o,"a"),0!==r.lastIndex||0!==o.lastIndex),E=u.BROKEN_CARET,L=void 0!==/()??/.exec("")[1];(S||L||E||h||p)&&(g=function(t){var e,n,r,o,s,u,l,h=this,p=d(h),O=a(t),j=p.raw;if(j)return j.lastIndex=h.lastIndex,e=i(g,j,O),h.lastIndex=j.lastIndex,e;var T=p.groups,C=E&&h.sticky,P=i(c,h),A=h.source,I=0,k=O;if(C&&(P=x(P,"y",""),-1===b(P,"g")&&(P+="g"),k=w(O,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(O,h.lastIndex-1))&&(A="(?: "+A+")",k=" "+k,I++),n=new RegExp("^(?:"+A+")",P)),L&&(n=new RegExp("^"+A+"$(?!\\s)",P)),S&&(r=h.lastIndex),o=i(m,C?n:h,k),C?o?(o.input=w(o.input,I),o[0]=w(o[0],I),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:S&&o&&(h.lastIndex=h.global?o.index+o[0].length:r),L&&o&&o.length>1&&i(v,o[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(o[s]=void 0)})),o&&T)for(o.groups=u=f(null),s=0;s<T.length;s++)u[(l=T[s])[0]]=o[l[1]];return o}),t.exports=g},895:function(t,e,n){"use strict";var r=n(1176);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},5650:function(t,e,n){var r=n(4229),o=n(9859).RegExp,i=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=i||r((function(){return!o("a","y").sticky})),a=i||r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:i}},2926:function(t,e,n){var r=n(4229),o=n(9859).RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},461:function(t,e,n){var r=n(4229),o=n(9859).RegExp;t.exports=r((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},8885:function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},4555:function(t,e,n){var r=n(1787).f,o=n(8270),i=n(95)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.8",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE",source:"https://github.com/zloirock/core-js"})},7942:function(t,e,n){var r=n(1176),o=n(7988),i=n(95)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||null==(n=r(s)[i])?e:o(n)}},966:function(t,e,n){var r=n(5968),o=n(3329),i=n(3326),s=n(8885),a=r("".charAt),c=r("".charCodeAt),u=r("".slice),l=function(t){return function(e,n){var r,l,f=i(s(e)),d=o(n),h=f.length;return d<0||d>=h?t?"":void 0:(r=c(f,d))<55296||r>56319||d+1===h||(l=c(f,d+1))<56320||l>57343?t?a(f,d):r:t?u(f,d,d+2):l-56320+(r-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=s(t,l);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1601:function(t,e,n){var r={};r[n(95)("toStringTag")]="z",t.exports="[object z]"===String(r)},3326:function(t,e,n){var r=n(1589),o=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(3839);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),a=n(3839),c=n(6969),u=o("wks"),l=r.Symbol,f=l&&l.for,d=c?l:l&&l.withoutSetter||s;t.exports=function(t){if(!i(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&i(l,t)?u[t]=l[t]:u[t]=c&&f?f(e):d(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},5735:function(t,e,n){"use strict";var r=n(905),o=n(9736),i=n(5495),s=n(6407),a=n(1787).f,c=n(7675),u=n(4231),l=n(7400),f="Array Iterator",d=s.set,h=s.getterFor(f);t.exports=c(Array,"Array",(function(t,e){d(this,{type:f,target:r(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var p=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!u&&l&&"values"!==p.name)try{a(p,"name",{value:"values"})}catch(t){}},1515:function(t,e,n){"use strict";var r=n(3103),o=n(4231),i=n(4473),s=n(4229),a=n(1333),c=n(6733),u=n(7942),l=n(7757),f=n(4768),d=i&&i.prototype;if(r({target:"Promise",proto:!0,real:!0,forced:!!i&&s((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=u(this,a("Promise")),n=c(t);return this.then(n?function(n){return l(e,t()).then((function(){return n}))}:t,n?function(n){return l(e,t()).then((function(){throw n}))}:t)}}),!o&&c(i)){var h=a("Promise").prototype.finally;d.finally!==h&&f(d,"finally",h,{unsafe:!0})}},7950:function(t,e,n){"use strict";var r=n(3103),o=n(3466);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},5940:function(t,e,n){"use strict";var r=n(3171),o=n(266),i=n(5968),s=n(4954),a=n(4229),c=n(1176),u=n(6733),l=n(3329),f=n(4237),d=n(3326),h=n(8885),p=n(6637),v=n(5300),m=n(17),g=n(8115),y=n(95)("replace"),b=Math.max,x=Math.min,w=i([].concat),S=i([].push),E=i("".indexOf),L=i("".slice),O="$0"==="a".replace(/./,"$0"),j=!!/./[y]&&""===/./[y]("a","$0");s("replace",(function(t,e,n){var i=j?"$":"$0";return[function(t,n){var r=h(this),i=null==t?void 0:v(t,y);return i?o(i,t,r,n):o(e,d(r),t,n)},function(t,o){var s=c(this),a=d(t);if("string"==typeof o&&-1===E(o,i)&&-1===E(o,"$<")){var h=n(e,s,a,o);if(h.done)return h.value}var v=u(o);v||(o=d(o));var y=s.global;if(y){var O=s.unicode;s.lastIndex=0}for(var j=[];;){var T=g(s,a);if(null===T)break;if(S(j,T),!y)break;""===d(T[0])&&(s.lastIndex=p(a,f(s.lastIndex),O))}for(var C,P="",A=0,I=0;I<j.length;I++){for(var k=d((T=j[I])[0]),M=b(x(l(T.index),a.length),0),R=[],_=1;_<T.length;_++)S(R,void 0===(C=T[_])?C:String(C));var D=T.groups;if(v){var F=w([k],R,M,a);void 0!==D&&S(F,D);var N=d(r(o,void 0,F))}else N=m(k,a,M,R,D,o);M>=A&&(P+=L(a,A,M)+N,A=M+k.length)}return P+L(a,A)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!O||j)},6886:function(t,e,n){var r=n(9859),o=n(5694),i=n(8865),s=n(5735),a=n(5762),c=n(95),u=c("iterator"),l=c("toStringTag"),f=s.values,d=function(t,e){if(t){if(t[u]!==f)try{a(t,u,f)}catch(e){t[u]=f}if(t[l]||a(t,l,e),o[e])for(var n in s)if(t[n]!==s[n])try{a(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var h in o)d(r[h]&&r[h].prototype,h);d(i,"DOMTokenList")}},function(t){var e;e=3783,t(t.s=e)}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{809:function(t,e,s){s.d(e,{Z:function(){return i}});class i extends window.Snowboard.Singleton{listens(){return{ajaxLoadAssets:"load"}}async load(t){if(t.js&&t.js.length>0)for(const e of t.js)try{await this.loadScript(e)}catch(t){return Promise.reject(t)}if(t.css&&t.css.length>0)for(const e of t.css)try{await this.loadStyle(e)}catch(t){return Promise.reject(t)}if(t.img&&t.img.length>0)for(const e of t.img)try{await this.loadImage(e)}catch(t){return Promise.reject(t)}return Promise.resolve()}loadScript(t){return new Promise(((e,s)=>{if(document.querySelector(`script[src="${t}"]`))return void e();const i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",t),i.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",t,i),e()})),i.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",t,i),s(new Error(`Unable to load script file: "${t}"`))})),document.body.append(i)}))}loadStyle(t){return new Promise(((e,s)=>{if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e();const i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",t),i.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",t,i),e()})),i.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",t,i),s(new Error(`Unable to load stylesheet file: "${t}"`))})),document.head.append(i)}))}loadImage(t){return new Promise(((e,s)=>{const i=new Image;i.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",t,i),e()})),i.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",t,i),s(new Error(`Unable to load image file: "${t}"`))})),i.src=t}))}}},553:function(t,e,s){s.d(e,{Z:function(){return i}});class i extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.add(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.add(this.getLoadingClass(e.element))}ajaxDone(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.remove(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.remove(this.getLoadingClass(e.element))}getLoadingClass(t){return void 0!==t.dataset.attachLoading&&""!==t.dataset.attachLoading?t.dataset.attachLoading:"wn-loading"}}},763:function(t,e,s){s.d(e,{Z:function(){return i}});class i extends Snowboard.PluginBase{construct(t,e){if(t instanceof Snowboard.PluginBase==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(e instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=t,this.element=e,this.refresh()}get(t){return void 0===t?this.instanceConfig:void 0!==this.instanceConfig[t]?this.instanceConfig[t]:void 0}set(t,e,s){if(void 0===t)throw new Error("You must provide a configuration key to set");this.instanceConfig[t]=e,!0===s&&(this.element.dataset[t]=e)}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 t=this.getDefaults();if(!1===this.acceptedConfigs)return t;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(t[e]=this.coerceValue(this.element.dataset[e]));return t}coerceValue(t){const e=String(t);if("null"===e)return null;if("undefined"!==e){if(e.startsWith("base64:")){const t=e.replace(/^base64:/,""),s=atob(t);return this.coerceValue(s)}if(["true","yes"].includes(e.toLowerCase()))return!0;if(["false","no"].includes(e.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(e))return Number(e);try{return this.snowboard.jsonParser().parse(e)}catch(t){return""===e||e}}}}},270:function(t,e,s){s.d(e,{Z:function(){return i}});class i extends Snowboard.PluginBase{construct(t,e,s){if(this.message=t,this.type=e||"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((t=>t.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(t,e,s){s.d(e,{Z:function(){return i}});class i extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(t){this.show(),t.catch((()=>{this.hide()})).finally((()=>{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 t=this.stripe.cloneNode(!0);this.indicator.appendChild(t),this.stripe.remove(),this.stripe=t,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(t){this.counter-=1,!0===t&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(t,e,s){s.d(e,{Z:function(){return i}});class i extends Snowboard.Singleton{listens(){return{ready:"ready"}}ready(){let t=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((e=>{e.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(t=!0)})),!t){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",this.snowboard.url().to("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(t)}}}},269:function(t,e,s){s.d(e,{Z:function(){return i}});class i extends Snowboard.PluginBase{construct(t,e,s,i,n){if(t instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=t,"string"!=typeof e)throw new Error("Transition name must be specified as a string");if(this.transition=e,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 t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];const i={in:`${this.transition}-in`,active:`${this.transition}-active`,out:`${this.transition}-out`};if(0===e.length)return Object.values(i);const n=[];return Object.entries(i).forEach((t=>{const[s,i]=t;-1!==e.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((t=>{this.element.classList.add(t)})),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((t=>{this.element.classList.remove(t)})),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((t=>{this.element.classList.remove(t)}))}parseDuration(t){const e=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(t),s=Number(e[1]);return"sec"===("s"===e[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},783:function(t,e,s){var i=s(270);class n extends Snowboard.Singleton{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((t=>{this.snowboard.flash(t.innerHTML,t.dataset.flashType,t.dataset.flashDuration)}))}ajaxErrorMessage(t){return this.snowboard.flash(t,"error"),!1}ajaxFlashMessages(t){return Object.entries(t).forEach((t=>{const[e,s]=t;this.snowboard.flash(s,e)})),!1}}var a=s(269),r=s(553),o=s(277),l=s(32),d=s(809),h=s(763);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(t=>{t.addPlugin("assetLoader",d.Z),t.addPlugin("dataConfig",h.Z),t.addPlugin("extrasStyles",l.Z),t.addPlugin("transition",a.Z),t.addPlugin("flash",i.Z),t.addPlugin("flashListener",n),t.addPlugin("attachLoading",r.Z),t.addPlugin("stripeLoader",o.Z)})(window.Snowboard)}},function(t){var e;e=783,t(t.s=e)}]); \ No newline at end of file
modules/system/assets/js/snowboard/build/snowboard.request.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{2026:function(t,e,r){"use strict";r(9529),r(6886);function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Request plugin.");class s extends Snowboard.PluginBase{construct(t,e,r){if("string"==typeof t){const e=document.querySelector(t);if(null===e)throw new Error("No element was found with the given selector: ".concat(t));this.element=e}else this.element=t;if(this.handler=e,this.options=r||{},this.fetchOptions={},this.responseData=null,this.responseError=null,this.cancelled=!1,this.checkRequest(),this.snowboard.globalEvent("ajaxSetup",this)){if(this.element){const t=new Event("ajaxSetup",{cancelable:!0});if(t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return void(this.cancelled=!0)}this.doClientValidation()?this.confirm?this.doConfirm().then((t=>{t&&this.doAjax().then((t=>{if(t.cancelled)return this.cancelled=!0,void this.complete();this.responseData=t,this.processUpdate(t).then((()=>{!1===t.X_WINTER_SUCCESS?this.processError(t):this.processResponse(t)}))}),(t=>{this.responseError=t,this.processError(t)}))})):this.doAjax().then((t=>{if(t.cancelled)return this.cancelled=!0,void this.complete();this.responseData=t,this.processUpdate(t).then((()=>{!1===t.X_WINTER_SUCCESS?this.processError(t):this.processResponse(t)}))}),(t=>{this.responseError=t,this.processError(t)})):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.handler.match(/^(?:\w+:{2})?on*/))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 t=new Promise(((t,e)=>{this.getFetch().then((r=>{r.ok||406===r.status?r.headers.has("Content-Type")&&r.headers.get("Content-Type").includes("/json")?r.json().then((e=>{t(o(o({},e),{},{X_WINTER_SUCCESS:406!==r.status,X_WINTER_RESPONSE_CODE:r.status}))}),(t=>{e(this.renderError("Unable to parse JSON response: ".concat(t)))})):r.text().then((e=>{t(e)}),(t=>{e(this.renderError("Unable to process response: ".concat(t)))})):r.headers.has("Content-Type")&&r.headers.get("Content-Type").includes("/json")?r.json().then((t=>{e(this.renderError(t.message,t.exception,t.file,t.line,t.trace))}),(t=>{e(this.renderError("Unable to parse JSON response: ".concat(t)))})):r.text().then((t=>{e(this.renderError(t))}),(t=>{e(this.renderError("Unable to process response: ".concat(t)))}))}),(t=>{e(this.renderError("Unable to retrieve a response from the server: ".concat(t)))}))}));if(this.snowboard.globalEvent("ajaxStart",t,this),this.element){const e=new Event("ajaxPromise");e.promise=t,this.element.dispatchEvent(e)}return t}processUpdate(t){return new Promise(((e,r)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[t]))return void r();const n={};if(Object.entries(t).forEach((t=>{const[e,r]=t;"X_WINTER"!==e.substr(0,8)&&(n[e]=r)})),0===Object.keys(n).length)return void(t.X_WINTER_ASSETS?this.processAssets(t.X_WINTER_ASSETS).then((()=>{e()}),(()=>{r()})):e());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",t,this).then((async()=>{t.X_WINTER_ASSETS&&await this.processAssets(t.X_WINTER_ASSETS),this.doUpdate(n).then((()=>{window.requestAnimationFrame((()=>e()))}),(()=>{r()}))}),(()=>{r()}))}))}doUpdate(t){return new Promise((e=>{const r=[];Object.entries(t).forEach((t=>{const[e,n]=t;let o=this.options.update&&this.options.update[e]?this.options.update[e]:e,i="replace";"@"===o.substr(0,1)?(i="append",o=o.substr(1)):"^"===o.substr(0,1)&&(i="prepend",o=o.substr(1));const s=document.querySelectorAll(o);s.length>0&&s.forEach((t=>{switch(i){case"append":t.innerHTML+=n;break;case"prepend":t.innerHTML=n+t.innerHTML;break;default:t.innerHTML=n}r.push(t),this.snowboard.globalEvent("ajaxUpdate",t,n,this);const e=new Event("ajaxUpdate");e.content=n,t.dispatchEvent(e)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",r,this),e()}))}processResponse(t){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 t=new Event("ajaxDone",{cancelable:!0});if(t.responseData=this.responseData,t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return}this.flash&&t.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(t.X_WINTER_FLASH_MESSAGES),this.redirect||t.X_WINTER_REDIRECT?this.processRedirect(this.redirect||t.X_WINTER_REDIRECT):this.complete()}}processError(t){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 t=new Event("ajaxFail",{cancelable:!0});if(t.responseError=this.responseError,t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return}t instanceof Error?this.processErrorMessage(t.message):(t.X_WINTER_ERROR_FIELDS&&this.processValidationErrors(t.X_WINTER_ERROR_FIELDS),t.X_WINTER_ERROR_MESSAGE&&this.processErrorMessage(t.X_WINTER_ERROR_MESSAGE)),this.complete()}}processRedirect(t){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[t])||!1!==this.snowboard.globalEvent("ajaxRedirect",t,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const t=document.createEvent("CustomEvent");t.eventName="ajaxRedirected",this.element.dispatchEvent(t)}}),{once:!0}),window.location.assign(t))}processErrorMessage(t){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[t])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",t,this)&&window.alert(t)}processFlashMessages(t){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[t])||this.snowboard.globalEvent("ajaxFlashMessages",t,this)}processValidationErrors(t){"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,t])||this.snowboard.globalEvent("ajaxValidationErrors",this.form,t,this)}processAssets(t){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",t)}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 t=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await t)return!0}catch(t){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 t=new Event("ajaxAlways");t.request=this,t.responseData=this.responseData,t.responseError=this.responseError,this.element.dispatchEvent(t)}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 t={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(t["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(t["X-XSRF-TOKEN"]=this.xsrfToken),t}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 t="object"==typeof this.options.data?this.options.data:{},e=new FormData(this.form||void 0);return Object.keys(t).length>0&&Object.entries(t).forEach((t=>{const[r,n]=t;e.append(r,n)})),e}get confirm(){return this.options.confirm||!1}extractPartials(t){return Object.keys(t).join("&")}renderError(t,e,r,n,o){const i=new Error(t);return i.exception=e||null,i.file=r||null,i.line=n||null,i.trace=o||[],i}}Snowboard.addPlugin("request",s)},7111:function(t,e,r){var n=r(6733),o=r(9821),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a function")}},8505:function(t,e,r){var n=r(6733),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},9736:function(t,e,r){var n=r(95),o=r(2391),i=r(1787).f,s=n("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,r){var n=r(5052),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,r){var n=r(905),o=r(3231),i=r(9646),s=function(t){return function(e,r,s){var a,c=n(e),u=i(c),p=o(s,u);if(t&&r!=r){for(;u>p;)if((a=c[p++])!=a)return!0}else for(;u>p;p++)if((t||p in c)&&c[p]===r)return t||p||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,r){var n=r(5968),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},7081:function(t,e,r){var n=r(8270),o=r(4826),i=r(7933),s=r(1787);t.exports=function(t,e,r){for(var a=o(e),c=s.f,u=i.f,p=0;p<a.length;p++){var f=a[p];n(t,f)||r&&n(r,f)||c(t,f,u(e,f))}}},7528:function(t,e,r){var n=r(4229);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3723:function(t,e,r){"use strict";var n=r(693).IteratorPrototype,o=r(2391),i=r(5358),s=r(4555),a=r(5495),c=function(){return this};t.exports=function(t,e,r,u){var p=e+" Iterator";return t.prototype=o(n,{next:i(+!u,r)}),s(t,p,!1,!0),a[p]=c,t}},5762:function(t,e,r){var n=r(7400),o=r(1787),i=r(5358);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,r){var n=r(6733),o=r(5762),i=r(6039),s=r(8400);t.exports=function(t,e,r,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;return n(r)&&i(r,u,a),a.global?c?t[e]=r:s(e,r):(a.unsafe?t[e]&&(c=!0):delete t[e],c?t[e]=r:o(t,e,r)),t}},8400:function(t,e,r){var n=r(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},7675:function(t,e,r){"use strict";var n=r(3103),o=r(266),i=r(4231),s=r(1805),a=r(6733),c=r(3723),u=r(7567),p=r(6540),f=r(4555),l=r(5762),h=r(4768),d=r(95),v=r(5495),y=r(693),b=s.PROPER,m=s.CONFIGURABLE,g=y.IteratorPrototype,E=y.BUGGY_SAFARI_ITERATORS,w=d("iterator"),S="keys",x="values",O="entries",j=function(){return this};t.exports=function(t,e,r,s,d,y,T){c(r,e,s);var R,_,P,A=function(t){if(t===d&&k)return k;if(!E&&t in M)return M[t];switch(t){case S:case x:case O:return function(){return new r(this,t)}}return function(){return new r(this)}},L=e+" Iterator",I=!1,M=t.prototype,C=M[w]||M["@@iterator"]||d&&M[d],k=!E&&C||A(d),N="Array"==e&&M.entries||C;if(N&&(R=u(N.call(new t)))!==Object.prototype&&R.next&&(i||u(R)===g||(p?p(R,g):a(R[w])||h(R,w,j)),f(R,L,!0,!0),i&&(v[L]=j)),b&&d==x&&C&&C.name!==x&&(!i&&m?l(M,"name",x):(I=!0,k=function(){return o(C,this)})),d)if(_={values:A(x),keys:y?k:A(S),entries:A(O)},T)for(P in _)(E||I||!(P in M))&&h(M,P,_[P]);else n({target:e,proto:!0,forced:E||I},_);return i&&!T||M[w]===k||h(M,w,k,{name:d}),v[e]=k,_}},7400:function(t,e,r){var n=r(4229);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,r){var n=r(9859),o=r(5052),i=n.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},5694:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8865:function(t,e,r){var n=r(2635)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},598:function(t,e,r){var n=r(1333);t.exports=n("navigator","userAgent")||""},6358:function(t,e,r){var n,o,i=r(9859),s=r(598),a=i.process,c=i.Deno,u=a&&a.versions||c&&c.version,p=u&&u.v8;p&&(o=(n=p.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,r){var n=r(9859),o=r(7933).f,i=r(5762),s=r(4768),a=r(8400),c=r(7081),u=r(6541);t.exports=function(t,e){var r,p,f,l,h,d=t.target,v=t.global,y=t.stat;if(r=v?n:y?n[d]||a(d,{}):(n[d]||{}).prototype)for(p in e){if(l=e[p],f=t.dontCallGetSet?(h=o(r,p))&&h.value:r[p],!u(v?p:d+(y?".":"#")+p,t.forced)&&void 0!==f){if(typeof l==typeof f)continue;c(l,f)}(t.sham||f&&f.sham)&&i(l,"sham",!0),s(r,p,l,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,r){var n=r(4229);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,r){var n=r(7188),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,r){var n=r(7400),o=r(8270),i=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,u=a&&(!n||n&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,r){var n=r(7188),o=Function.prototype,i=o.bind,s=o.call,a=n&&i.bind(s,s);t.exports=n?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,r){var n=r(9859),o=r(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t]):n[t]&&n[t][e]}},5300:function(t,e,r){var n=r(7111);t.exports=function(t,e){var r=t[e];return null==r?void 0:n(r)}},9859:function(t,e,r){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},8270:function(t,e,r){var n=r(5968),o=r(2991),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,r){var n=r(1333);t.exports=n("document","documentElement")},4394:function(t,e,r){var n=r(7400),o=r(4229),i=r(2635);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,r){var n=r(5968),o=r(4229),i=r(7079),s=Object,a=n("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},8511:function(t,e,r){var n=r(5968),o=r(6733),i=r(5353),s=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,r){var n,o,i,s=r(8694),a=r(9859),c=r(5968),u=r(5052),p=r(5762),f=r(8270),l=r(5353),h=r(4399),d=r(5977),v="Object already initialized",y=a.TypeError,b=a.WeakMap;if(s||l.state){var m=l.state||(l.state=new b),g=c(m.get),E=c(m.has),w=c(m.set);n=function(t,e){if(E(m,t))throw new y(v);return e.facade=t,w(m,t,e),e},o=function(t){return g(m,t)||{}},i=function(t){return E(m,t)}}else{var S=h("state");d[S]=!0,n=function(t,e){if(f(t,S))throw new y(v);return e.facade=t,p(t,S,e),e},o=function(t){return f(t,S)?t[S]:{}},i=function(t){return f(t,S)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=o(e)).type!==t)throw y("Incompatible receiver, "+t+" required");return r}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,r){var n=r(4229),o=r(6733),i=/#|\.prototype\./,s=function(t,e){var r=c[a(t)];return r==p||r!=u&&(o(e)?n(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",p=s.POLYFILL="P";t.exports=s},5052:function(t,e,r){var n=r(6733);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},4231:function(t){t.exports=!1},9395:function(t,e,r){var n=r(1333),o=r(6733),i=r(1321),s=r(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return o(e)&&i(e.prototype,a(t))}},693:function(t,e,r){"use strict";var n,o,i,s=r(4229),a=r(6733),c=r(2391),u=r(7567),p=r(4768),f=r(95),l=r(4231),h=f("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(n=o):d=!0),null==n||s((function(){var t={};return n[h].call(t)!==t}))?n={}:l&&(n=c(n)),a(n[h])||p(n,h,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},5495:function(t){t.exports={}},9646:function(t,e,r){var n=r(4237);t.exports=function(t){return n(t.length)}},6039:function(t,e,r){var n=r(4229),o=r(6733),i=r(8270),s=r(7400),a=r(1805).CONFIGURABLE,c=r(8511),u=r(6407),p=u.enforce,f=u.get,l=Object.defineProperty,h=s&&!n((function(){return 8!==l((function(){}),"length",{value:8}).length})),d=String(String).split("String"),v=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&l(t,"name",{value:e,configurable:!0}),h&&r&&i(r,"arity")&&t.length!==r.arity&&l(t,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?s&&l(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=p(t);return i(n,"source")||(n.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return o(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},3839:function(t,e,r){var n=r(6358),o=r(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8694:function(t,e,r){var n=r(9859),o=r(6733),i=r(8511),s=n.WeakMap;t.exports=o(s)&&/native code/.test(i(s))},2391:function(t,e,r){var n,o=r(1176),i=r(219),s=r(3837),a=r(5977),c=r(3777),u=r(2635),p=r(4399),f=p("IE_PROTO"),l=function(){},h=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&n?d(n):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):d(n);for(var r=s.length;r--;)delete v.prototype[s[r]];return v()};a[f]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(l.prototype=o(t),r=new l,l.prototype=null,r[f]=t):r=v(),void 0===e?r:i.f(r,e)}},219:function(t,e,r){var n=r(7400),o=r(7137),i=r(1787),s=r(1176),a=r(905),c=r(5632);e.f=n&&!o?Object.defineProperties:function(t,e){s(t);for(var r,n=a(e),o=c(e),u=o.length,p=0;u>p;)i.f(t,r=o[p++],n[r]);return t}},1787:function(t,e,r){var n=r(7400),o=r(4394),i=r(7137),s=r(1176),a=r(9310),c=TypeError,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,f="enumerable",l="configurable",h="writable";e.f=n?i?function(t,e,r){if(s(t),e=a(e),s(r),"function"==typeof t&&"prototype"===e&&"value"in r&&h in r&&!r.writable){var n=p(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:l in r?r.configurable:n.configurable,enumerable:f in r?r.enumerable:n.enumerable,writable:!1})}return u(t,e,r)}:u:function(t,e,r){if(s(t),e=a(e),s(r),o)try{return u(t,e,r)}catch(t){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},7933:function(t,e,r){var n=r(7400),o=r(266),i=r(9195),s=r(5358),a=r(905),c=r(9310),u=r(8270),p=r(4394),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=a(t),e=c(e),p)try{return f(t,e)}catch(t){}if(u(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,r){var n=r(140),o=r(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},7567:function(t,e,r){var n=r(8270),o=r(6733),i=r(2991),s=r(4399),a=r(7528),c=s("IE_PROTO"),u=Object,p=u.prototype;t.exports=a?u.getPrototypeOf:function(t){var e=i(t);if(n(e,c))return e[c];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof u?p:null}},1321:function(t,e,r){var n=r(5968);t.exports=n({}.isPrototypeOf)},140:function(t,e,r){var n=r(5968),o=r(8270),i=r(905),s=r(9540).indexOf,a=r(5977),c=n([].push);t.exports=function(t,e){var r,n=i(t),u=0,p=[];for(r in n)!o(a,r)&&o(n,r)&&c(p,r);for(;e.length>u;)o(n,r=e[u++])&&(~s(p,r)||c(p,r));return p}},5632:function(t,e,r){var n=r(140),o=r(3837);t.exports=Object.keys||function(t){return n(t,o)}},9195:function(t,e){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},6540:function(t,e,r){var n=r(5968),o=r(1176),i=r(8505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return o(r),i(n),e?t(r,n):r.__proto__=n,r}}():void 0)},2914:function(t,e,r){var n=r(266),o=r(6733),i=r(5052),s=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&o(r=t.toString)&&!i(a=n(r,t)))return a;if(o(r=t.valueOf)&&!i(a=n(r,t)))return a;if("string"!==e&&o(r=t.toString)&&!i(a=n(r,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,r){var n=r(1333),o=r(5968),i=r(8151),s=r(894),a=r(1176),c=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(a(t)),r=s.f;return r?c(e,r(t)):e}},8885:function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},4555:function(t,e,r){var n=r(1787).f,o=r(8270),i=r(95)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:e})}},4399:function(t,e,r){var n=r(3036),o=r(1441),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,r){var n=r(9859),o=r(8400),i="__core-js_shared__",s=n[i]||o(i,{});t.exports=s},3036:function(t,e,r){var n=r(4231),o=r(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.8",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE",source:"https://github.com/zloirock/core-js"})},3231:function(t,e,r){var n=r(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},905:function(t,e,r){var n=r(9337),o=r(8885);t.exports=function(t){return n(o(t))}},3329:function(t,e,r){var n=r(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},4237:function(t,e,r){var n=r(3329),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},2991:function(t,e,r){var n=r(8885),o=Object;t.exports=function(t){return o(n(t))}},2066:function(t,e,r){var n=r(266),o=r(5052),i=r(9395),s=r(5300),a=r(2914),c=r(95),u=TypeError,p=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var r,c=s(t,p);if(c){if(void 0===e&&(e="default"),r=n(c,t,e),!o(r)||i(r))return r;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,r){var n=r(2066),o=r(9395);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,r){var n=r(5968),o=0,i=Math.random(),s=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,r){var n=r(3839);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,r){var n=r(7400),o=r(4229);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},95:function(t,e,r){var n=r(9859),o=r(3036),i=r(8270),s=r(1441),a=r(3839),c=r(6969),u=o("wks"),p=n.Symbol,f=p&&p.for,l=c?p:p&&p.withoutSetter||s;t.exports=function(t){if(!i(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&i(p,t)?u[t]=p[t]:u[t]=c&&f?f(e):l(e)}return u[t]}},9529:function(t,e,r){"use strict";var n=r(3103),o=r(9540).includes,i=r(4229),s=r(9736);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},5735:function(t,e,r){"use strict";var n=r(905),o=r(9736),i=r(5495),s=r(6407),a=r(1787).f,c=r(7675),u=r(4231),p=r(7400),f="Array Iterator",l=s.set,h=s.getterFor(f);t.exports=c(Array,"Array",(function(t,e){l(this,{type:f,target:n(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");var d=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!u&&p&&"values"!==d.name)try{a(d,"name",{value:"values"})}catch(t){}},6886:function(t,e,r){var n=r(9859),o=r(5694),i=r(8865),s=r(5735),a=r(5762),c=r(95),u=c("iterator"),p=c("toStringTag"),f=s.values,l=function(t,e){if(t){if(t[u]!==f)try{a(t,u,f)}catch(e){t[u]=f}if(t[p]||a(t,p,e),o[e])for(var r in s)if(t[r]!==s[r])try{a(t,r,s[r])}catch(e){t[r]=s[r]}}};for(var h in o)l(n[h]&&n[h].prototype,h);l(i,"DOMTokenList")}},function(t){var e;e=2026,t(t.s=e)}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{26:function(){function e(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,o)}return s}function t(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Request plugin.");class o extends Snowboard.PluginBase{construct(e,t,s){if("string"==typeof e){const t=document.querySelector(e);if(null===t)throw new Error(`No element was found with the given selector: ${e}`);this.element=t}else this.element=e;if(this.handler=t,this.options=s||{},this.fetchOptions={},this.responseData=null,this.responseError=null,this.cancelled=!1,this.checkRequest(),this.snowboard.globalEvent("ajaxSetup",this)){if(this.element){const e=new Event("ajaxSetup",{cancelable:!0});if(e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return void(this.cancelled=!0)}this.doClientValidation()?this.confirm?this.doConfirm().then((e=>{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.handler.match(/^(?:\w+:{2})?on*/))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,s)=>{this.getFetch().then((o=>{o.ok||406===o.status?o.headers.has("Content-Type")&&o.headers.get("Content-Type").includes("/json")?o.json().then((s=>{e(t(t({},s),{},{X_WINTER_SUCCESS:406!==o.status,X_WINTER_RESPONSE_CODE:o.status}))}),(e=>{s(this.renderError(`Unable to parse JSON response: ${e}`))})):o.text().then((t=>{e(t)}),(e=>{s(this.renderError(`Unable to process response: ${e}`))})):o.headers.has("Content-Type")&&o.headers.get("Content-Type").includes("/json")?o.json().then((e=>{s(this.renderError(e.message,e.exception,e.file,e.line,e.trace))}),(e=>{s(this.renderError(`Unable to parse JSON response: ${e}`))})):o.text().then((e=>{s(this.renderError(e))}),(e=>{s(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{s(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 s();const o={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(o[t]=s)})),0===Object.keys(o).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(o).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{s()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,o]=e;let r=this.options.update&&this.options.update[t]?this.options.update[t]:t,n="replace";"@"===r.substr(0,1)?(n="append",r=r.substr(1)):"^"===r.substr(0,1)&&(n="prepend",r=r.substr(1));const i=document.querySelectorAll(r);i.length>0&&i.forEach((e=>{switch(n){case"append":e.innerHTML+=o;break;case"prepend":e.innerHTML=o+e.innerHTML;break;default:e.innerHTML=o}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,o,this);const t=new Event("ajaxUpdate");t.content=o,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}e instanceof Error?this.processErrorMessage(e.message):(e.X_WINTER_ERROR_FIELDS&&this.processValidationErrors(e.X_WINTER_ERROR_FIELDS),e.X_WINTER_ERROR_MESSAGE&&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){"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||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,o]=e;t.append(s,o)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,o,r){const n=new Error(e);return n.exception=t||null,n.file=s||null,n.line=o||null,n.trace=r||[],n}}Snowboard.addPlugin("request",o)}},function(e){var t;t=26,e(e.s=t)}]); \ No newline at end of file
modules/system/assets/js/snowboard/build/snowboard.vendor.js+1 −1 modified@@ -1,3 +1,3 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[109],{26:function(e,t){ +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[109],{805:function(e,t){ /*! js-cookie v3.0.1 | MIT */ function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var r=function e(t,r){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=n({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+c}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(r[u]=t.read(c,u),e===u)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){o(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});t.Z=r}}]); \ No newline at end of file
modules/system/assets/js/snowboard/main/InnerProxyHandler.js+43 −0 added@@ -0,0 +1,43 @@ +/** + * 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); + }, +};
modules/system/assets/js/snowboard/main/PluginLoader.js+25 −5 modified@@ -1,5 +1,6 @@ import PluginBase from '../abstracts/PluginBase'; import Singleton from '../abstracts/Singleton'; +import InnerProxyHandler from './InnerProxyHandler'; /** * Plugin loader class. @@ -22,13 +23,28 @@ export default class PluginLoader { */ constructor(name, snowboard, instance) { this.name = name; - this.snowboard = snowboard; + 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 = instance.prototype instanceof Singleton; - this.initialised = instance.prototype instanceof PluginBase; + 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); } /** @@ -162,7 +178,11 @@ export default class PluginLoader { * @returns {boolean} */ isInitialised() { - return this.initialised; + if (!this.isSingleton()) { + return true; + } + + return this.singleton.initialised; } /** @@ -179,7 +199,7 @@ export default class PluginLoader { newInstance.detach = () => this.instances.splice(this.instances.indexOf(newInstance), 1); newInstance.construct(...parameters); this.instances.push(newInstance); - this.initialised = true; + this.singleton.initialised = true; } /**
modules/system/assets/js/snowboard/main/ProxyHandler.js+25 −0 added@@ -0,0 +1,25 @@ +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); + }, +};
modules/system/assets/js/snowboard/main/Snowboard.js+23 −12 modified@@ -31,9 +31,17 @@ export default class Snowboard { this.plugins = {}; this.listeners = {}; this.foundBaseUrl = null; - this.domReady = false; - + 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(); @@ -55,6 +63,11 @@ export default class Snowboard { 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); } /** @@ -79,7 +92,7 @@ export default class Snowboard { this.initialiseSingletons(); } this.globalEvent('ready'); - this.domReady = true; + this.readiness.dom = true; }); } @@ -124,9 +137,6 @@ export default class Snowboard { } this.plugins[lowerName] = new PluginLoader(lowerName, this, instance); - const callback = (...parameters) => this.plugins[lowerName].getInstance(...parameters); - this[name] = callback; - this[lowerName] = callback; this.debug(`Plugin "${name}" registered`); @@ -139,7 +149,7 @@ export default class Snowboard { && plugin.dependenciesFulfilled() && plugin.hasMethod('listens') && Object.keys(plugin.callMethod('listens')).includes('ready') - && this.domReady + && this.readiness.dom ) { const readyMethod = plugin.callMethod('listens').ready; plugin.callMethod(readyMethod); @@ -213,11 +223,13 @@ export default class Snowboard { * @returns {PluginLoader} */ getPlugin(name) { - if (!this.hasPlugin(name)) { - throw new Error(`No plugin called "${name}" has been registered.`); + const lowerName = name.toLowerCase(); + + if (!this.hasPlugin(lowerName)) { + throw new Error(`No plugin called "${lowerName}" has been registered.`); } - return this.plugins[name]; + return this.plugins[lowerName]; } /** @@ -263,7 +275,7 @@ export default class Snowboard { * @param {Function} callback */ ready(callback) { - if (this.domReady) { + if (this.readiness.dom) { callback(); } @@ -524,7 +536,6 @@ export default class Snowboard { this.logMessage('rgb(45, 167, 199)', false, message, ...parameters); } - /** * Log a debug message. *
modules/system/assets/js/snowboard/snowboard.base.debug.js+5 −1 modified@@ -1,7 +1,11 @@ import Snowboard from './main/Snowboard'; +import ProxyHandler from './main/ProxyHandler'; ((window) => { - const snowboard = new Snowboard(true, true); + const snowboard = new Proxy( + new Snowboard(true, true), + ProxyHandler, + ); // Cover all aliases window.snowboard = snowboard;
modules/system/assets/js/snowboard/snowboard.base.js+5 −1 modified@@ -1,7 +1,11 @@ import Snowboard from './main/Snowboard'; +import ProxyHandler from './main/ProxyHandler'; ((window) => { - const snowboard = new Snowboard(); + const snowboard = new Proxy( + new Snowboard(), + ProxyHandler, + ); // Cover all aliases window.snowboard = snowboard;
modules/system/.eslintrc.json+5 −1 modified@@ -32,5 +32,9 @@ "math": "always" }], "vue/multi-word-component-names": ["off"] - } + }, + "ignorePatterns": [ + "tests/js", + "**/build/*.js" + ] }
tests/js/cases/snowboard/main/PluginLoader.test.js+97 −0 modified@@ -34,4 +34,101 @@ describe('PluginLoader class', function () { } ); }); + + 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', + 'tests/js/fixtures/framework/TestPlugin.js', + '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); + } + ); + }); });
tests/js/cases/snowboard/main/Snowboard.test.js+153 −22 modified@@ -42,6 +42,49 @@ describe('Snowboard framework', function () { ); }); + 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', + '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() @@ -59,16 +102,22 @@ describe('Snowboard framework', function () { try { // Check plugin caller - expect(Snowboard.hasPlugin('test')).toBe(true); + 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', 'test']) + expect.arrayContaining(['jsonparser', 'sanitizer', 'testplugin']) ); - expect(Snowboard.test).toEqual(expect.any(Function)); - const instance = Snowboard.test(); + const instance = Snowboard.testPlugin(); // Check plugin injected methods - expect(instance.snowboard).toBe(Snowboard); + 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 @@ -77,20 +126,20 @@ describe('Snowboard framework', function () { expect(instance.testMethod()).toEqual('Tested'); // Check multiple instances - const instanceOne = Snowboard.test(); + const instanceOne = Snowboard.testPlugin(); instanceOne.changed = true; - const instanceTwo = Snowboard.test(); + const instanceTwo = Snowboard.testPlugin(); expect(instanceOne).not.toEqual(instanceTwo); - const factory = Snowboard.getPlugin('test'); + const factory = Snowboard.getPlugin('testPlugin'); expect(factory.getInstances()).toEqual([instance, instanceOne, instanceTwo]); // Remove plugin - Snowboard.removePlugin('test'); - expect(Snowboard.hasPlugin('test')).toEqual(false); + Snowboard.removePlugin('testPlugin'); + expect(Snowboard.hasPlugin('testPlugin')).toEqual(false); expect(dom.window.Snowboard.getPluginNames()).toEqual( expect.arrayContaining(['jsonparser', 'sanitizer']) ); - expect(Snowboard.test).not.toBeDefined(); + expect(Snowboard.testPlugin).not.toBeDefined(); done(); } catch (error) { @@ -119,17 +168,24 @@ describe('Snowboard framework', function () { const Snowboard = dom.window.Snowboard; try { + expect('testPlugin' in Snowboard).toEqual(false); + expect('testSingleton' in Snowboard).toEqual(true); + // Check plugin caller - expect(Snowboard.hasPlugin('test')).toBe(true); + expect(Snowboard.hasPlugin('testSingleton')).toBe(true); expect(Snowboard.getPluginNames()).toEqual( - expect.arrayContaining(['jsonparser', 'sanitizer', 'test']) + expect.arrayContaining(['jsonparser', 'sanitizer', 'testsingleton']) ); - expect(Snowboard.test).toEqual(expect.any(Function)); + expect(Snowboard.testSingleton).toEqual(expect.any(Function)); - const instance = Snowboard.test(); + const instance = Snowboard.testSingleton(); // Check plugin injected methods - expect(instance.snowboard).toBe(Snowboard); + 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 @@ -138,20 +194,20 @@ describe('Snowboard framework', function () { expect(instance.testMethod()).toEqual('Tested'); // Check multiple instances (these should all be the same as this instance is a singleton) - const instanceOne = Snowboard.test(); + const instanceOne = Snowboard.testSingleton(); instanceOne.changed = true; - const instanceTwo = Snowboard.test(); + const instanceTwo = Snowboard.testSingleton(); expect(instanceOne).toEqual(instanceTwo); - const factory = Snowboard.getPlugin('test'); + const factory = Snowboard.getPlugin('testSingleton'); expect(factory.getInstances()).toEqual([instance]); // Remove plugin - Snowboard.removePlugin('test'); - expect(Snowboard.hasPlugin('test')).toEqual(false); + Snowboard.removePlugin('testSingleton'); + expect(Snowboard.hasPlugin('testSingleton')).toEqual(false); expect(dom.window.Snowboard.getPluginNames()).toEqual( expect.arrayContaining([ 'jsonparser', 'sanitizer']) ); - expect(Snowboard.test).not.toBeDefined(); + expect(Snowboard.testSingleton).not.toBeDefined(); done(); } catch (error) { @@ -380,4 +436,79 @@ describe('Snowboard framework', function () { } ); }); + + 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', + 'tests/js/fixtures/framework/TestDependencyOne.js', + '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); + }, + ); + }); });
tests/js/fixtures/framework/TestPlugin.js+1 −1 modified@@ -7,5 +7,5 @@ } } - Snowboard.addPlugin('test', TestPlugin); + Snowboard.addPlugin('testPlugin', TestPlugin); })(window.Snowboard);
tests/js/fixtures/framework/TestSingleton.js+1 −1 modified@@ -7,5 +7,5 @@ } } - Snowboard.addPlugin('test', TestSingleton); + Snowboard.addPlugin('testSingleton', TestSingleton); })(window.Snowboard);
tests/js/fixtures/framework/TestSingletonWithDependency.js+4 −0 modified@@ -19,6 +19,10 @@ testMethod() { return 'Tested'; } + + dependencyTest() { + return this.snowboard.testDependencyOne().testMethod(); + } } Snowboard.addPlugin('testSingleton', TestSingletonWithDependency);
2a13faf99972Harden Snowboard (#687)
17 files changed · +392 −49
modules/system/assets/js/build/system.js+1 −1 modifiedmodules/system/assets/js/snowboard/build/snowboard.base.debug.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{1705:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});n(9529);class r{constructor(t){this.snowboard=t}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class o extends r{}class i{constructor(t,e,n){this.name=t,this.snowboard=e,this.instance=n,this.instances=[],this.singleton=n.prototype instanceof o,this.initialised=n.prototype instanceof r,this.mocks={},this.originalFunctions={}}hasMethod(t){return!this.isFunction()&&"function"==typeof this.instance.prototype[t]}callMethod(){if(this.isFunction())return null;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e,o=r.shift();return this.instance.prototype[o](r)}getInstance(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const t=this.getDependencies().filter((t=>!this.snowboard.getPluginNames().includes(t)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${t.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instances[0][e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instances[0][n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instance.prototype[e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instance.prototype[n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}})));const o=new this.instance(this.snowboard,...n);return o.detach=()=>this.instances.splice(this.instances.indexOf(o),1),o.construct(...n),this.instances.push(o),o}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof r==!1}isSingleton(){return this.instance.prototype instanceof o==!0}isInitialised(){return this.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=new this.instance(this.snowboard,...e);r.detach=()=>this.instances.splice(this.instances.indexOf(r),1),r.construct(...e),this.instances.push(r),this.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((t=>t.toLowerCase()))}dependenciesFulfilled(){const t=this.getDependencies();let e=!0;return t.forEach((t=>{this.snowboard.hasPlugin(t)||(e=!1)})),e}mock(t,e){var n=this;if(!this.isFunction()){if(!this.instance.prototype[t])throw new Error(`Function "${t}" does not exist and cannot be mocked`);this.mocks[t]=e,this.originalFunctions[t]=this.instance.prototype[t],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][t]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e(n,...r)})}}unmock(t){this.isFunction()||this.mocks[t]&&(this.isSingleton()&&(this.instances[0][t]=this.originalFunctions[t]),delete this.mocks[t],delete this.originalFunctions[t])}}var s=n(26);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l extends o{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(t){if("object"!=typeof t)throw new Error("Cookie defaults must be provided as an object");Object.entries(t).forEach((t=>{const[e,n]=t;void 0!==this.defaults[e]&&(this.defaults[e]=n)}))}getDefaults(){const t={};return Object.entries(this.defaults).forEach((e=>{const[n,r]=e;null!==this.defaults[n]&&(t[n]=r)})),t}get(t){if(void 0===t){const t=s.Z.get();return Object.entries(t).forEach((e=>{const[n,r]=e;this.snowboard.globalEvent("cookie.get",n,r,(e=>{t[n]=e}))})),t}let e=s.Z.get(t);return this.snowboard.globalEvent("cookie.get",t,e,(t=>{e=t})),e}set(t,e,n){let r=e;return this.snowboard.globalEvent("cookie.set",t,e,(t=>{r=t})),s.Z.set(t,r,u(u({},this.getDefaults()),n))}remove(t,e){s.Z.remove(t,u(u({},this.getDefaults()),e))}}class f extends o{construct(){window.wnJSON=t=>this.parse(t),window.ocJSON=window.wnJSON}parse(t){const e=this.parseString(t);return JSON.parse(e)}parseString(t){let e=t.trim();if(!e.length)throw new Error("Broken JSON object.");let n="",r=null,o=null,i="";for(;e&&","===e[0];)e=e.substr(1);if('"'===e[0]||"'"===e[0]){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");i='"';for(let t=1;t<e.length;t+=1)if("\\"===e[t])"'"===e[t+1]||(i+=e[t]),i+=e[t+1],t+=1;else{if(e[t]===e[0])return i+='"',i;'"'===e[t]?i+='\\"':i+=e[t]}throw new Error("Invalid string JSON object.")}if("true"===e||"false"===e)return e;if("null"===e)return"null";const s=parseFloat(e);if(!Number.isNaN(s))return s.toString();if("{"===e[0]){r="needKey",o=null,n="{";for(let t=1;t<e.length;t+=1)if(!this.isBlankChar(e[t]))if("needKey"!==r||'"'!==e[t]&&"'"!==e[t]){if("needKey"===r&&this.canBeKeyHead(e[t]))o=this.parseKey(e,t),n+='"',n+=o,n+='"',t+=o.length-1,r="afterKey";else if("afterKey"===r&&":"===e[t])n+=":",r=":";else if(":"===r)i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody";else if("afterBody"===r||"needKey"===r){let o=t;for(;","===e[o]||this.isBlankChar(e[o]);)o+=1;if("}"===e[o]&&o===e.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}o!==t&&"{"!==n&&(n+=",",r="needKey",t=o-1)}}else o=this.parseKey(e,t+1,e[t]),n+=`"${o}"`,t+=o.length,t+=1,r="afterKey";throw new Error(`Broken JSON object near ${n}`)}if("["===e[0]){n="[",r="needBody";for(let t=1;t<e.length;t+=1)if(" "!==e[t]&&"\n"!==e[t]&&"\t"!==e[t])if("needBody"===r){if(","===e[t]){n+="null,";continue}if("]"===e[t]&&t===e.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody"}else if("afterBody"===r)if(","===e[t])for(n+=",",r="needBody";","===e[t+1]||this.isBlankChar(e[t+1]);)","===e[t+1]&&(n+="null,"),t+=1;else if("]"===e[t]&&t===e.length-1)return n+="]",n;throw new Error(`Broken JSON array near ${n}`)}return""}getBody(t,e){let n="";if('"'===t[e]||"'"===t[e]){n=t[e];for(let r=e+1;r<t.length;r+=1)if("\\"===t[r])n+=t[r],r+1<t.length&&(n+=t[r+1]),r+=1;else{if(t[r]===t[e])return n+=t[e],{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON string body near ${n}`)}if("t"===t[e]){if(t.indexOf("true",e)===e)return{originLength:"true".length,body:"true"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("f"===t[e]){if(t.indexOf("f",e)===e)return{originLength:"false".length,body:"false"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("n"===t[e]){if(t.indexOf("null",e)===e)return{originLength:"null".length,body:"null"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("-"===t[e]||"+"===t[e]||"."===t[e]||t[e]>="0"&&t[e]<="9"){n="";for(let r=e;r<t.length;r+=1){if(!("-"===t[r]||"+"===t[r]||"."===t[r]||t[r]>="0"&&t[r]<="9"))return{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON number body near ${n}`)}if("{"===t[e]||"["===t[e]){const r=[t[e]];n=t[e];for(let o=e+1;o<t.length;o+=1){if(n+=t[o],"\\"===t[o])o+1<t.length&&(n+=t[o+1]),o+=1;else if('"'===t[o])'"'===r[r.length-1]?r.pop():"'"!==r[r.length-1]&&r.push(t[o]);else if("'"===t[o])"'"===r[r.length-1]?r.pop():'"'!==r[r.length-1]&&r.push(t[o]);else if('"'!==r[r.length-1]&&"'"!==r[r.length-1])if("{"===t[o])r.push("{");else if("}"===t[o]){if("{"!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}else if("["===t[o])r.push("[");else if("]"===t[o]){if("["!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}if(!r.length)return{originLength:o-e,body:n}}throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`)}throw new Error(`Broken JSON body near ${t.substr(e-5>=0?e-5:0,50)}`)}parseKey(t,e,n){let r="";for(let o=e;o<t.length;o+=1){if(n&&n===t[o])return r;if(!n&&(" "===t[o]||":"===t[o]))return r;r+=t[o],"\\"===t[o]&&o+1<t.length&&(r+=t[o+1],o+=1)}throw new Error(`Broken JSON syntax near ${r}`)}canBeKeyHead(t){return"\\"!==t[0]&&(t[0]>="a"&&t[0]<="z"||t[0]>="A"&&t[0]<="Z"||"_"===t[0]||(t[0]>="0"&&t[0]<="9"||("$"===t[0]||t.charCodeAt(0)>255)))}isBlankChar(t){return" "===t||"\n"===t||"\t"===t}}class h extends o{construct(){window.wnSanitize=t=>this.sanitize(t),window.ocSanitize=window.wnSanitize}sanitize(t,e){const n=(new DOMParser).parseFromString(t,"text/html"),r=void 0===e||"boolean"!=typeof e||e;return this.sanitizeNode(n.getRootNode()),r?n.body.innerHTML:n.innerHTML}sanitizeNode(t){if("SCRIPT"===t.tagName)return void t.remove();this.trimAttributes(t);Array.from(t.children).forEach((t=>{this.sanitizeNode(t)}))}trimAttributes(t){if(t.attributes)for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes.item(e).name,r=t.attributes.item(e).value;0!==n.indexOf("on")&&0!==r.indexOf("javascript:")||t.removeAttribute(n)}}}class d extends o{construct(){this.foundBaseUrl=null,this.baseUrl()}to(t){if(t.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return t;const e=t.replace(/^\/+/,"");return`${this.baseUrl()}${e}`}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const t=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=t.join(""),this.foundBaseUrl}validateBaseUrl(t){const e=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(t),n=e[2],r=e[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!r)throw new Error("Invalid base URL detected");return"/"===t.substr(-1)?t:`${t}/`}}class g{constructor(t,e){this.debugEnabled="boolean"==typeof e&&!0===e,this.autoInitSingletons="boolean"==typeof t&&!1===t,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.domReady=!1,this.attachAbstracts(),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=r,this.Singleton=o}loadUtilities(){this.addPlugin("cookie",l),this.addPlugin("jsonParser",f),this.addPlugin("sanitizer",h),this.addPlugin("url",d)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.domReady=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((t=>{t.isSingleton()&&t.dependenciesFulfilled()&&t.initialiseSingleton()}))}addPlugin(t,e){var n=this;const o=t.toLowerCase();if(this.hasPlugin(o))throw new Error(`A plugin called "${t}" is already registered.`);if("function"!=typeof e&&e instanceof r==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[t]||void 0!==this[o])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[o]=new i(o,this,e);const s=function(){return n.plugins[o].getInstance(...arguments)};this[t]=s,this[o]=s,this.debug(`Plugin "${t}" registered`),Object.values(this.getPlugins()).forEach((t=>{if(t.isSingleton()&&!t.isInitialised()&&t.dependenciesFulfilled()&&t.hasMethod("listens")&&Object.keys(t.callMethod("listens")).includes("ready")&&this.domReady){const e=t.callMethod("listens").ready;t.callMethod(e)}}))}removePlugin(t){const e=t.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((t=>{t.destruct()})),delete this.plugins[e],delete this[e],delete this[t],this.debug(`Plugin "${t}" removed`)):this.debug(`Plugin "${t}" already removed`)}hasPlugin(t){const e=t.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(t){if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(t){const e=[];return Object.entries(this.plugins).forEach((n=>{const[r,o]=n;if(o.isFunction())return;if(!o.dependenciesFulfilled())return;if(!o.hasMethod("listens"))return;"string"==typeof o.callMethod("listens")[t]&&e.push(r)})),e}ready(t){this.domReady&&t(),this.on("ready",t)}on(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].includes(e)||this.listeners[t].push(e)}off(t,e){if(!this.listeners[t])return;const n=this.listeners[t].indexOf(e);-1!==n&&this.listeners[t].splice(n,1)}globalEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global event "${t}"`,...n);const o=this.listensToEvent(t);if(0===o.length)return this.debug(`No listeners found for global event "${t}"`),!0;this.debug(`Listeners found for global event "${t}": ${o.join(", ")}`);let i=!1;return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!i){if(!r[o])throw new Error(`Missing "${o}" method in "${e}" plugin`);try{!1===r[o](...n)&&(i=!0,this.debug(`Global event "${t}" cancelled by "${e}" plugin`))}catch(n){this.error(`Error thrown in "${t}" event by "${e}" plugin.`,n)}}}))})),!i&&this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global event "${t}"`),this.listeners[t].forEach((e=>{if(!i)try{!1===e(...n)&&(i=!0,this.debug(`Global event "${t} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${t}" event by an ad-hoc listener.`,e)}}))),!i}globalPromiseEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global promise event "${t}"`);const o=this.listensToEvent(t);if(0===o.length)return this.debug(`No listeners found for global promise event "${t}"`),Promise.resolve();this.debug(`Listeners found for global promise event "${t}": ${o.join(", ")}`);const i=[];return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!r[o])throw new Error(`Missing "${o}" method in "${e}" plugin`);try{const t=r[o](...n);if(t instanceof Promise==!1)return;i.push(t)}catch(n){this.error(`Error thrown in "${t}" promise event by "${e}" plugin.`,n)}}))})),this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global promise event "${t}"`),this.listeners[t].forEach((e=>{try{const t=e(...n);if(t instanceof Promise==!1)return;i.push(t)}catch(e){this.error(`Error thrown in "${t}" promise event by an ad-hoc listener.`,e)}}))),0===i.length?Promise.resolve():Promise.all(i)}logMessage(t,e,n){console.groupCollapsed("%c[Snowboard]",`color: ${t}; font-weight: ${e?"bold":"normal"};`,n);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];if(o.length){console.groupCollapsed(`%cParameters %c(${o.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let t=0;o.forEach((e=>{t+=1,console.log(`%c${t}:`,"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(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}debug(t){if(this.debugEnabled){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}}error(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(229, 35, 35)",!0,t,...n)}}},2165:function(t,e,n){"use strict";var r=n(1705);(t=>{const e=new r.Z(!0,!0);t.snowboard=e,t.Snowboard=e,t.SnowBoard=e})(window)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var a,u=r(e),c=i(u),l=o(s,c);if(t&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=o(e),u=s.f,c=i.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||u(t,f,c(e,f))}}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(1787),i=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var u=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&i(n,c,a),a.global)u?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),a=i.process,u=i.Deno,c=a&&a.versions||u&&u.version,l=c&&c.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),a=n(8400),u=n(7081),c=n(6541);t.exports=function(t,e){var n,l,f,h,d,g=t.target,p=t.global,b=t.stat;if(n=p?r:b?r[g]||a(g,{}):(r[g]||{}).prototype)for(l in e){if(h=e[l],f=t.dontCallGetSet?(d=o(n,l))&&d.value:n[l],!c(p?l:g+(b?".":"#")+l,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(t.sham||f&&f.sham)&&i(h,"sham",!0),s(n,l,h,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),u=a&&"something"===function(){}.name,c=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:u,CONFIGURABLE:c}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),o=n(9650);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(1180),a=n(9859),u=n(5968),c=n(5052),l=n(5762),f=n(8270),h=n(5353),d=n(4399),g=n(5977),p="Object already initialized",b=a.TypeError,y=a.WeakMap;if(s||h.state){var v=h.state||(h.state=new y),w=u(v.get),m=u(v.has),O=u(v.set);r=function(t,e){if(m(v,t))throw b(p);return e.facade=t,O(v,t,e),e},o=function(t){return w(v,t)||{}},i=function(t){return m(v,t)}}else{var S=d("state");g[S]=!0,r=function(t,e){if(f(t,S))throw b(p);return e.facade=t,l(t,S,e),e},o=function(t){return f(t,S)?t[S]:{}},i=function(t){return f(t,S)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=u[a(t)];return n==l||n!=c&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=s.data={},c=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),o="object"==typeof document&&document.all,i=void 0===o&&void 0!==o;t.exports=i?function(t){return"object"==typeof t?null!==t:r(t)||t===o}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,u=n(8511),c=n(6407),l=c.enforce,f=c.get,h=Object.defineProperty,d=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),p=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return i(r,"source")||(r.source=g.join("string"==typeof e?e:"")),t};Function.prototype.toString=p((function(){return o(this)&&f(this).source||u(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),a=n(5977),u=n(3777),c=n(2635),l=n(4399),f=l("IE_PROTO"),h=function(){},d=function(t){return"<script>"+t+"</"+"script>"},g=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;p="undefined"!=typeof document?document.domain&&r?g(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):g(r);for(var n=s.length;n--;)delete p.prototype[s[n]];return p()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=o(t),n=new h,h.prototype=null,n[f]=t):n=p(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),a=n(905),u=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=u(e),c=o.length,l=0;c>l;)i.f(t,n=o[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),a=n(9310),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",d="writable";e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&d in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),a=n(905),u=n(9310),c=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=u(e),l)try{return f(t,e)}catch(t){}if(c(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,a=n(5977),u=r([].push);t.exports=function(t,e){var n,r=i(t),c=0,l=[];for(n in r)!o(a,n)&&o(r,n)&&u(l,n);for(;e.length>c;)o(r,n=e[c++])&&(~s(l,n)||u(l,n));return l}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),a=n(1176),u=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?u(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),o=TypeError;t.exports=function(t){if(r(t))throw o("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.0",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),a=n(2914),u=n(95),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,u=s(t,l);if(u){if(void 0===e&&(e="default"),n=r(u,t,e),!o(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),o=n(6733),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),a=n(4860),u=n(6969),c=o("wks"),l=r.Symbol,f=l&&l.for,h=u?l:l&&l.withoutSetter||s;t.exports=function(t){if(!i(c,t)||!a&&"string"!=typeof c[t]){var e="Symbol."+t;a&&i(l,t)?c[t]=l[t]:c[t]=u&&f?f(e):h(e)}return c[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){t.O(0,[109],(function(){return e=2165,t(t.s=e);var e}));t.O()}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{1662:function(t,e){"use strict";e.Z={get(t,e,n){if("string"==typeof e){const n=e.toLowerCase();if(t.hasPlugin(n))return function(){return Reflect.get(t,"plugins")[n].getInstance(...arguments)}}return Reflect.get(t,e,n)},has(t,e){if("string"==typeof e){const n=e.toLowerCase();if(t.hasPlugin(n))return!0}return Reflect.has(t,e)}}},5878:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});n(9529);class r{constructor(t){this.snowboard=t}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class i extends r{}var o={get(t,e,n){if("string"==typeof e){const n=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))throw new Error(`You cannot use the "${e}" Snowboard method within a plugin.`);if(t.hasPlugin(n))return function(){return Reflect.get(t,"plugins")[n].getInstance(...arguments)}}return Reflect.get(t,e,n)},has(t,e){if("string"==typeof e){const n=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))return!1;if(t.hasPlugin(n))return!0}return Reflect.has(t,e)}};class s{constructor(t,e,n){this.name=t,this.snowboard=new Proxy(e,o),this.instance=n,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(t){return!this.isFunction()&&"function"==typeof this.instance.prototype[t]}callMethod(){if(this.isFunction())return null;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e,i=r.shift();return this.instance.prototype[i](r)}getInstance(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const t=this.getDependencies().filter((t=>!this.snowboard.getPluginNames().includes(t)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${t.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instances[0][e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instances[0][n]=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r(t,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instance.prototype[e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instance.prototype[n]=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r(t,...n)}})));const i=new this.instance(this.snowboard,...n);return i.detach=()=>this.instances.splice(this.instances.indexOf(i),1),i.construct(...n),this.instances.push(i),i}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof r==!1}isSingleton(){return this.instance.prototype instanceof i==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=new this.instance(this.snowboard,...e);r.detach=()=>this.instances.splice(this.instances.indexOf(r),1),r.construct(...e),this.instances.push(r),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((t=>t.toLowerCase()))}dependenciesFulfilled(){const t=this.getDependencies();let e=!0;return t.forEach((t=>{this.snowboard.hasPlugin(t)||(e=!1)})),e}mock(t,e){var n=this;if(!this.isFunction()){if(!this.instance.prototype[t])throw new Error(`Function "${t}" does not exist and cannot be mocked`);this.mocks[t]=e,this.originalFunctions[t]=this.instance.prototype[t],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][t]=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e(n,...r)})}}unmock(t){this.isFunction()||this.mocks[t]&&(this.isSingleton()&&(this.instances[0][t]=this.originalFunctions[t]),delete this.mocks[t],delete this.originalFunctions[t])}}var a=n(26);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f extends i{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(t){if("object"!=typeof t)throw new Error("Cookie defaults must be provided as an object");Object.entries(t).forEach((t=>{const[e,n]=t;void 0!==this.defaults[e]&&(this.defaults[e]=n)}))}getDefaults(){const t={};return Object.entries(this.defaults).forEach((e=>{const[n,r]=e;null!==this.defaults[n]&&(t[n]=r)})),t}get(t){if(void 0===t){const t=a.Z.get();return Object.entries(t).forEach((e=>{const[n,r]=e;this.snowboard.globalEvent("cookie.get",n,r,(e=>{t[n]=e}))})),t}let e=a.Z.get(t);return this.snowboard.globalEvent("cookie.get",t,e,(t=>{e=t})),e}set(t,e,n){let r=e;return this.snowboard.globalEvent("cookie.set",t,e,(t=>{r=t})),a.Z.set(t,r,u(u({},this.getDefaults()),n))}remove(t,e){a.Z.remove(t,u(u({},this.getDefaults()),e))}}class h extends i{construct(){window.wnJSON=t=>this.parse(t),window.ocJSON=window.wnJSON}parse(t){const e=this.parseString(t);return JSON.parse(e)}parseString(t){let e=t.trim();if(!e.length)throw new Error("Broken JSON object.");let n="",r=null,i=null,o="";for(;e&&","===e[0];)e=e.substr(1);if('"'===e[0]||"'"===e[0]){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");o='"';for(let t=1;t<e.length;t+=1)if("\\"===e[t])"'"===e[t+1]||(o+=e[t]),o+=e[t+1],t+=1;else{if(e[t]===e[0])return o+='"',o;'"'===e[t]?o+='\\"':o+=e[t]}throw new Error("Invalid string JSON object.")}if("true"===e||"false"===e)return e;if("null"===e)return"null";const s=parseFloat(e);if(!Number.isNaN(s))return s.toString();if("{"===e[0]){r="needKey",i=null,n="{";for(let t=1;t<e.length;t+=1)if(!this.isBlankChar(e[t]))if("needKey"!==r||'"'!==e[t]&&"'"!==e[t]){if("needKey"===r&&this.canBeKeyHead(e[t]))i=this.parseKey(e,t),n+='"',n+=i,n+='"',t+=i.length-1,r="afterKey";else if("afterKey"===r&&":"===e[t])n+=":",r=":";else if(":"===r)o=this.getBody(e,t),t=t+o.originLength-1,n+=this.parseString(o.body),r="afterBody";else if("afterBody"===r||"needKey"===r){let i=t;for(;","===e[i]||this.isBlankChar(e[i]);)i+=1;if("}"===e[i]&&i===e.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}i!==t&&"{"!==n&&(n+=",",r="needKey",t=i-1)}}else i=this.parseKey(e,t+1,e[t]),n+=`"${i}"`,t+=i.length,t+=1,r="afterKey";throw new Error(`Broken JSON object near ${n}`)}if("["===e[0]){n="[",r="needBody";for(let t=1;t<e.length;t+=1)if(" "!==e[t]&&"\n"!==e[t]&&"\t"!==e[t])if("needBody"===r){if(","===e[t]){n+="null,";continue}if("]"===e[t]&&t===e.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;o=this.getBody(e,t),t=t+o.originLength-1,n+=this.parseString(o.body),r="afterBody"}else if("afterBody"===r)if(","===e[t])for(n+=",",r="needBody";","===e[t+1]||this.isBlankChar(e[t+1]);)","===e[t+1]&&(n+="null,"),t+=1;else if("]"===e[t]&&t===e.length-1)return n+="]",n;throw new Error(`Broken JSON array near ${n}`)}return""}getBody(t,e){let n="";if('"'===t[e]||"'"===t[e]){n=t[e];for(let r=e+1;r<t.length;r+=1)if("\\"===t[r])n+=t[r],r+1<t.length&&(n+=t[r+1]),r+=1;else{if(t[r]===t[e])return n+=t[e],{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON string body near ${n}`)}if("t"===t[e]){if(t.indexOf("true",e)===e)return{originLength:"true".length,body:"true"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("f"===t[e]){if(t.indexOf("f",e)===e)return{originLength:"false".length,body:"false"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("n"===t[e]){if(t.indexOf("null",e)===e)return{originLength:"null".length,body:"null"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("-"===t[e]||"+"===t[e]||"."===t[e]||t[e]>="0"&&t[e]<="9"){n="";for(let r=e;r<t.length;r+=1){if(!("-"===t[r]||"+"===t[r]||"."===t[r]||t[r]>="0"&&t[r]<="9"))return{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON number body near ${n}`)}if("{"===t[e]||"["===t[e]){const r=[t[e]];n=t[e];for(let i=e+1;i<t.length;i+=1){if(n+=t[i],"\\"===t[i])i+1<t.length&&(n+=t[i+1]),i+=1;else if('"'===t[i])'"'===r[r.length-1]?r.pop():"'"!==r[r.length-1]&&r.push(t[i]);else if("'"===t[i])"'"===r[r.length-1]?r.pop():'"'!==r[r.length-1]&&r.push(t[i]);else if('"'!==r[r.length-1]&&"'"!==r[r.length-1])if("{"===t[i])r.push("{");else if("}"===t[i]){if("{"!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}else if("["===t[i])r.push("[");else if("]"===t[i]){if("["!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}if(!r.length)return{originLength:i-e,body:n}}throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`)}throw new Error(`Broken JSON body near ${t.substr(e-5>=0?e-5:0,50)}`)}parseKey(t,e,n){let r="";for(let i=e;i<t.length;i+=1){if(n&&n===t[i])return r;if(!n&&(" "===t[i]||":"===t[i]))return r;r+=t[i],"\\"===t[i]&&i+1<t.length&&(r+=t[i+1],i+=1)}throw new Error(`Broken JSON syntax near ${r}`)}canBeKeyHead(t){return"\\"!==t[0]&&(t[0]>="a"&&t[0]<="z"||t[0]>="A"&&t[0]<="Z"||"_"===t[0]||(t[0]>="0"&&t[0]<="9"||("$"===t[0]||t.charCodeAt(0)>255)))}isBlankChar(t){return" "===t||"\n"===t||"\t"===t}}class g extends i{construct(){window.wnSanitize=t=>this.sanitize(t),window.ocSanitize=window.wnSanitize}sanitize(t,e){const n=(new DOMParser).parseFromString(t,"text/html"),r=void 0===e||"boolean"!=typeof e||e;return this.sanitizeNode(n.getRootNode()),r?n.body.innerHTML:n.innerHTML}sanitizeNode(t){if("SCRIPT"===t.tagName)return void t.remove();this.trimAttributes(t);Array.from(t.children).forEach((t=>{this.sanitizeNode(t)}))}trimAttributes(t){if(t.attributes)for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes.item(e).name,r=t.attributes.item(e).value;0!==n.indexOf("on")&&0!==r.indexOf("javascript:")||t.removeAttribute(n)}}}class d extends i{construct(){this.foundBaseUrl=null,this.baseUrl()}to(t){if(t.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return t;const e=t.replace(/^\/+/,"");return`${this.baseUrl()}${e}`}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const t=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=t.join(""),this.foundBaseUrl}validateBaseUrl(t){const e=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(t),n=e[2],r=e[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!r)throw new Error("Invalid base URL detected");return"/"===t.substr(-1)?t:`${t}/`}}class p{constructor(t,e){this.debugEnabled="boolean"==typeof e&&!0===e,this.autoInitSingletons="boolean"==typeof t&&!1===t,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.readiness={dom:!1},Object.seal(this.readiness),this.attachAbstracts(),Object.freeze(p.prototype),Object.freeze(this),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=r,this.Singleton=i,Object.freeze(this.PluginBase.prototype),Object.freeze(this.PluginBase),Object.freeze(this.Singleton.prototype),Object.freeze(this.Singleton)}loadUtilities(){this.addPlugin("cookie",f),this.addPlugin("jsonParser",h),this.addPlugin("sanitizer",g),this.addPlugin("url",d)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((t=>{t.isSingleton()&&t.dependenciesFulfilled()&&t.initialiseSingleton()}))}addPlugin(t,e){const n=t.toLowerCase();if(this.hasPlugin(n))throw new Error(`A plugin called "${t}" is already registered.`);if("function"!=typeof e&&e instanceof r==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[t]||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 s(n,this,e),this.debug(`Plugin "${t}" registered`),Object.values(this.getPlugins()).forEach((t=>{if(t.isSingleton()&&!t.isInitialised()&&t.dependenciesFulfilled()&&t.hasMethod("listens")&&Object.keys(t.callMethod("listens")).includes("ready")&&this.readiness.dom){const e=t.callMethod("listens").ready;t.callMethod(e)}}))}removePlugin(t){const e=t.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((t=>{t.destruct()})),delete this.plugins[e],delete this[e],delete this[t],this.debug(`Plugin "${t}" removed`)):this.debug(`Plugin "${t}" already removed`)}hasPlugin(t){const e=t.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(t){const e=t.toLowerCase();if(!this.hasPlugin(e))throw new Error(`No plugin called "${e}" has been registered.`);return this.plugins[e]}listensToEvent(t){const e=[];return Object.entries(this.plugins).forEach((n=>{const[r,i]=n;if(i.isFunction())return;if(!i.dependenciesFulfilled())return;if(!i.hasMethod("listens"))return;"string"==typeof i.callMethod("listens")[t]&&e.push(r)})),e}ready(t){this.readiness.dom&&t(),this.on("ready",t)}on(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].includes(e)||this.listeners[t].push(e)}off(t,e){if(!this.listeners[t])return;const n=this.listeners[t].indexOf(e);-1!==n&&this.listeners[t].splice(n,1)}globalEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global event "${t}"`,...n);const i=this.listensToEvent(t);if(0===i.length)return this.debug(`No listeners found for global event "${t}"`),!0;this.debug(`Listeners found for global event "${t}": ${i.join(", ")}`);let o=!1;return i.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const i=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!o){if(!r[i])throw new Error(`Missing "${i}" method in "${e}" plugin`);try{!1===r[i](...n)&&(o=!0,this.debug(`Global event "${t}" cancelled by "${e}" plugin`))}catch(n){this.error(`Error thrown in "${t}" event by "${e}" plugin.`,n)}}}))})),!o&&this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global event "${t}"`),this.listeners[t].forEach((e=>{if(!o)try{!1===e(...n)&&(o=!0,this.debug(`Global event "${t} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${t}" event by an ad-hoc listener.`,e)}}))),!o}globalPromiseEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global promise event "${t}"`);const i=this.listensToEvent(t);if(0===i.length)return this.debug(`No listeners found for global promise event "${t}"`),Promise.resolve();this.debug(`Listeners found for global promise event "${t}": ${i.join(", ")}`);const o=[];return i.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const i=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!r[i])throw new Error(`Missing "${i}" method in "${e}" plugin`);try{const t=r[i](...n);if(t instanceof Promise==!1)return;o.push(t)}catch(n){this.error(`Error thrown in "${t}" promise event by "${e}" plugin.`,n)}}))})),this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global promise event "${t}"`),this.listeners[t].forEach((e=>{try{const t=e(...n);if(t instanceof Promise==!1)return;o.push(t)}catch(e){this.error(`Error thrown in "${t}" promise event by an ad-hoc listener.`,e)}}))),0===o.length?Promise.resolve():Promise.all(o)}logMessage(t,e,n){console.groupCollapsed("%c[Snowboard]",`color: ${t}; font-weight: ${e?"bold":"normal"};`,n);for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];if(i.length){console.groupCollapsed(`%cParameters %c(${i.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let t=0;i.forEach((e=>{t+=1,console.log(`%c${t}:`,"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(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}debug(t){if(this.debugEnabled){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}}error(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(229, 35, 35)",!0,t,...n)}}},2165:function(t,e,n){"use strict";var r=n(5878),i=n(1662);(t=>{const e=new Proxy(new r.Z(!0,!0),i.Z);t.snowboard=e,t.Snowboard=e,t.SnowBoard=e})(window)},7111:function(t,e,n){var r=n(6733),i=n(9821),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),i=n(2391),o=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&o(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),i=n(3231),o=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=o(c),l=i(s,u);if(t&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},7081:function(t,e,n){var r=n(8270),i=n(4826),o=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=i(e),c=s.f,u=o.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},5762:function(t,e,n){var r=n(7400),i=n(1787),o=n(5358);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),i=n(1787),o=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(r(n)&&o(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),i=n(5052),o=r.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,i,o=n(9859),s=n(598),a=o.process,c=o.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),i=n(7933).f,o=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,h,g,d=t.target,p=t.global,b=t.stat;if(n=p?r:b?r[d]||a(d,{}):(r[d]||{}).prototype)for(l in e){if(h=e[l],f=t.dontCallGetSet?(g=i(n,l))&&g.value:n[l],!u(p?l:d+(b?".":"#")+l,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;c(h,f)}(t.sham||f&&f.sham)&&o(h,"sham",!0),s(n,l,h,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},1805:function(t,e,n){var r=n(7400),i=n(8270),o=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(o,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),i=Function.prototype,o=i.bind,s=i.call,a=r&&o.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),i=n(6733),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),i=n(9650);t.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),i=n(2991),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),i=n(4229),o=n(2635);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),i=n(4229),o=n(7079),s=Object,a=r("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),i=n(6733),o=n(5353),s=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},6407:function(t,e,n){var r,i,o,s=n(1180),a=n(9859),c=n(5968),u=n(5052),l=n(5762),f=n(8270),h=n(5353),g=n(4399),d=n(5977),p="Object already initialized",b=a.TypeError,y=a.WeakMap;if(s||h.state){var v=h.state||(h.state=new y),w=c(v.get),m=c(v.has),O=c(v.set);r=function(t,e){if(m(v,t))throw b(p);return e.facade=t,O(v,t,e),e},i=function(t){return w(v,t)||{}},o=function(t){return m(v,t)}}else{var S=g("state");d[S]=!0,r=function(t,e){if(f(t,S))throw b(p);return e.facade=t,l(t,S,e),e},i=function(t){return f(t,S)?t[S]:{}},o=function(t){return f(t,S)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),i=n(6733),o=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==l||n!=u&&(i(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),i="object"==typeof document&&document.all,o=void 0===i&&void 0!==i;t.exports=o?function(t){return"object"==typeof t?null!==t:r(t)||t===i}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),i=n(6733),o=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),i=n(6733),o=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),l=u.enforce,f=u.get,h=Object.defineProperty,g=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),d=String(String).split("String"),p=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),g&&n&&o(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return o(r,"source")||(r.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=p((function(){return i(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,i=n(1176),o=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),h=function(){},g=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;p="undefined"!=typeof document?document.domain&&r?d(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):d(r);for(var n=s.length;n--;)delete p.prototype[s[n]];return p()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=i(t),n=new h,h.prototype=null,n[f]=t):n=p(),void 0===e?n:o.f(n,e)}},219:function(t,e,n){var r=n(7400),i=n(7137),o=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!i?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),i=c(e),u=i.length,l=0;u>l;)o.f(t,n=i[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),i=n(4394),o=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",g="writable";e.f=r?o?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&g in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),i=n(266),o=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!i(o.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),i=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),i=n(8270),o=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=o(t),u=0,l=[];for(n in r)!i(a,n)&&i(r,n)&&c(l,n);for(;e.length>u;)i(r,n=e[u++])&&(~s(l,n)||c(l,n));return l}},5632:function(t,e,n){var r=n(140),i=n(3837);t.exports=Object.keys||function(t){return r(t,i)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);e.f=i?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),i=n(6733),o=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!o(a=r(n,t)))return a;if(i(n=t.valueOf)&&!o(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!o(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),i=n(5968),o=n(8151),s=n(894),a=n(1176),c=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=s.f;return n?c(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),i=TypeError;t.exports=function(t){if(r(t))throw i("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),i=n(1441),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5353:function(t,e,n){var r=n(9859),i=n(8400),o="__core-js_shared__",s=r[o]||i(o,{});t.exports=s},3036:function(t,e,n){var r=n(4231),i=n(5353);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),i=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},905:function(t,e,n){var r=n(9337),i=n(8885);t.exports=function(t){return r(i(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),i=Object;t.exports=function(t){return i(r(t))}},2066:function(t,e,n){var r=n(266),i=n(5052),o=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,c=s(t,l);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!i(n)||o(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),i=n(9395);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),i=0,o=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+o,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),i=n(4229);t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),i=n(6733),o=r.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},95:function(t,e,n){var r=n(9859),i=n(3036),o=n(8270),s=n(1441),a=n(4860),c=n(6969),u=i("wks"),l=r.Symbol,f=l&&l.for,h=c?l:l&&l.withoutSetter||s;t.exports=function(t){if(!o(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&o(l,t)?u[t]=l[t]:u[t]=c&&f?f(e):h(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),i=n(9540).includes,o=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){t.O(0,[109],(function(){return e=2165,t(t.s=e);var e}));t.O()}]); \ No newline at end of file
modules/system/assets/js/snowboard/build/snowboard.base.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{1705:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});n(9529);class r{constructor(t){this.snowboard=t}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class o extends r{}class i{constructor(t,e,n){this.name=t,this.snowboard=e,this.instance=n,this.instances=[],this.singleton=n.prototype instanceof o,this.initialised=n.prototype instanceof r,this.mocks={},this.originalFunctions={}}hasMethod(t){return!this.isFunction()&&"function"==typeof this.instance.prototype[t]}callMethod(){if(this.isFunction())return null;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e,o=r.shift();return this.instance.prototype[o](r)}getInstance(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const t=this.getDependencies().filter((t=>!this.snowboard.getPluginNames().includes(t)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${t.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instances[0][e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instances[0][n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instance.prototype[e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instance.prototype[n]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r(t,...n)}})));const o=new this.instance(this.snowboard,...n);return o.detach=()=>this.instances.splice(this.instances.indexOf(o),1),o.construct(...n),this.instances.push(o),o}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof r==!1}isSingleton(){return this.instance.prototype instanceof o==!0}isInitialised(){return this.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=new this.instance(this.snowboard,...e);r.detach=()=>this.instances.splice(this.instances.indexOf(r),1),r.construct(...e),this.instances.push(r),this.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((t=>t.toLowerCase()))}dependenciesFulfilled(){const t=this.getDependencies();let e=!0;return t.forEach((t=>{this.snowboard.hasPlugin(t)||(e=!1)})),e}mock(t,e){var n=this;if(!this.isFunction()){if(!this.instance.prototype[t])throw new Error(`Function "${t}" does not exist and cannot be mocked`);this.mocks[t]=e,this.originalFunctions[t]=this.instance.prototype[t],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][t]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e(n,...r)})}}unmock(t){this.isFunction()||this.mocks[t]&&(this.isSingleton()&&(this.instances[0][t]=this.originalFunctions[t]),delete this.mocks[t],delete this.originalFunctions[t])}}var s=n(26);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l extends o{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(t){if("object"!=typeof t)throw new Error("Cookie defaults must be provided as an object");Object.entries(t).forEach((t=>{const[e,n]=t;void 0!==this.defaults[e]&&(this.defaults[e]=n)}))}getDefaults(){const t={};return Object.entries(this.defaults).forEach((e=>{const[n,r]=e;null!==this.defaults[n]&&(t[n]=r)})),t}get(t){if(void 0===t){const t=s.Z.get();return Object.entries(t).forEach((e=>{const[n,r]=e;this.snowboard.globalEvent("cookie.get",n,r,(e=>{t[n]=e}))})),t}let e=s.Z.get(t);return this.snowboard.globalEvent("cookie.get",t,e,(t=>{e=t})),e}set(t,e,n){let r=e;return this.snowboard.globalEvent("cookie.set",t,e,(t=>{r=t})),s.Z.set(t,r,u(u({},this.getDefaults()),n))}remove(t,e){s.Z.remove(t,u(u({},this.getDefaults()),e))}}class f extends o{construct(){window.wnJSON=t=>this.parse(t),window.ocJSON=window.wnJSON}parse(t){const e=this.parseString(t);return JSON.parse(e)}parseString(t){let e=t.trim();if(!e.length)throw new Error("Broken JSON object.");let n="",r=null,o=null,i="";for(;e&&","===e[0];)e=e.substr(1);if('"'===e[0]||"'"===e[0]){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");i='"';for(let t=1;t<e.length;t+=1)if("\\"===e[t])"'"===e[t+1]||(i+=e[t]),i+=e[t+1],t+=1;else{if(e[t]===e[0])return i+='"',i;'"'===e[t]?i+='\\"':i+=e[t]}throw new Error("Invalid string JSON object.")}if("true"===e||"false"===e)return e;if("null"===e)return"null";const s=parseFloat(e);if(!Number.isNaN(s))return s.toString();if("{"===e[0]){r="needKey",o=null,n="{";for(let t=1;t<e.length;t+=1)if(!this.isBlankChar(e[t]))if("needKey"!==r||'"'!==e[t]&&"'"!==e[t]){if("needKey"===r&&this.canBeKeyHead(e[t]))o=this.parseKey(e,t),n+='"',n+=o,n+='"',t+=o.length-1,r="afterKey";else if("afterKey"===r&&":"===e[t])n+=":",r=":";else if(":"===r)i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody";else if("afterBody"===r||"needKey"===r){let o=t;for(;","===e[o]||this.isBlankChar(e[o]);)o+=1;if("}"===e[o]&&o===e.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}o!==t&&"{"!==n&&(n+=",",r="needKey",t=o-1)}}else o=this.parseKey(e,t+1,e[t]),n+=`"${o}"`,t+=o.length,t+=1,r="afterKey";throw new Error(`Broken JSON object near ${n}`)}if("["===e[0]){n="[",r="needBody";for(let t=1;t<e.length;t+=1)if(" "!==e[t]&&"\n"!==e[t]&&"\t"!==e[t])if("needBody"===r){if(","===e[t]){n+="null,";continue}if("]"===e[t]&&t===e.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;i=this.getBody(e,t),t=t+i.originLength-1,n+=this.parseString(i.body),r="afterBody"}else if("afterBody"===r)if(","===e[t])for(n+=",",r="needBody";","===e[t+1]||this.isBlankChar(e[t+1]);)","===e[t+1]&&(n+="null,"),t+=1;else if("]"===e[t]&&t===e.length-1)return n+="]",n;throw new Error(`Broken JSON array near ${n}`)}return""}getBody(t,e){let n="";if('"'===t[e]||"'"===t[e]){n=t[e];for(let r=e+1;r<t.length;r+=1)if("\\"===t[r])n+=t[r],r+1<t.length&&(n+=t[r+1]),r+=1;else{if(t[r]===t[e])return n+=t[e],{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON string body near ${n}`)}if("t"===t[e]){if(t.indexOf("true",e)===e)return{originLength:"true".length,body:"true"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("f"===t[e]){if(t.indexOf("f",e)===e)return{originLength:"false".length,body:"false"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("n"===t[e]){if(t.indexOf("null",e)===e)return{originLength:"null".length,body:"null"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("-"===t[e]||"+"===t[e]||"."===t[e]||t[e]>="0"&&t[e]<="9"){n="";for(let r=e;r<t.length;r+=1){if(!("-"===t[r]||"+"===t[r]||"."===t[r]||t[r]>="0"&&t[r]<="9"))return{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON number body near ${n}`)}if("{"===t[e]||"["===t[e]){const r=[t[e]];n=t[e];for(let o=e+1;o<t.length;o+=1){if(n+=t[o],"\\"===t[o])o+1<t.length&&(n+=t[o+1]),o+=1;else if('"'===t[o])'"'===r[r.length-1]?r.pop():"'"!==r[r.length-1]&&r.push(t[o]);else if("'"===t[o])"'"===r[r.length-1]?r.pop():'"'!==r[r.length-1]&&r.push(t[o]);else if('"'!==r[r.length-1]&&"'"!==r[r.length-1])if("{"===t[o])r.push("{");else if("}"===t[o]){if("{"!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}else if("["===t[o])r.push("[");else if("]"===t[o]){if("["!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}if(!r.length)return{originLength:o-e,body:n}}throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`)}throw new Error(`Broken JSON body near ${t.substr(e-5>=0?e-5:0,50)}`)}parseKey(t,e,n){let r="";for(let o=e;o<t.length;o+=1){if(n&&n===t[o])return r;if(!n&&(" "===t[o]||":"===t[o]))return r;r+=t[o],"\\"===t[o]&&o+1<t.length&&(r+=t[o+1],o+=1)}throw new Error(`Broken JSON syntax near ${r}`)}canBeKeyHead(t){return"\\"!==t[0]&&(t[0]>="a"&&t[0]<="z"||t[0]>="A"&&t[0]<="Z"||"_"===t[0]||(t[0]>="0"&&t[0]<="9"||("$"===t[0]||t.charCodeAt(0)>255)))}isBlankChar(t){return" "===t||"\n"===t||"\t"===t}}class h extends o{construct(){window.wnSanitize=t=>this.sanitize(t),window.ocSanitize=window.wnSanitize}sanitize(t,e){const n=(new DOMParser).parseFromString(t,"text/html"),r=void 0===e||"boolean"!=typeof e||e;return this.sanitizeNode(n.getRootNode()),r?n.body.innerHTML:n.innerHTML}sanitizeNode(t){if("SCRIPT"===t.tagName)return void t.remove();this.trimAttributes(t);Array.from(t.children).forEach((t=>{this.sanitizeNode(t)}))}trimAttributes(t){if(t.attributes)for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes.item(e).name,r=t.attributes.item(e).value;0!==n.indexOf("on")&&0!==r.indexOf("javascript:")||t.removeAttribute(n)}}}class d extends o{construct(){this.foundBaseUrl=null,this.baseUrl()}to(t){if(t.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return t;const e=t.replace(/^\/+/,"");return`${this.baseUrl()}${e}`}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const t=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=t.join(""),this.foundBaseUrl}validateBaseUrl(t){const e=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(t),n=e[2],r=e[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!r)throw new Error("Invalid base URL detected");return"/"===t.substr(-1)?t:`${t}/`}}class g{constructor(t,e){this.debugEnabled="boolean"==typeof e&&!0===e,this.autoInitSingletons="boolean"==typeof t&&!1===t,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.domReady=!1,this.attachAbstracts(),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=r,this.Singleton=o}loadUtilities(){this.addPlugin("cookie",l),this.addPlugin("jsonParser",f),this.addPlugin("sanitizer",h),this.addPlugin("url",d)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.domReady=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((t=>{t.isSingleton()&&t.dependenciesFulfilled()&&t.initialiseSingleton()}))}addPlugin(t,e){var n=this;const o=t.toLowerCase();if(this.hasPlugin(o))throw new Error(`A plugin called "${t}" is already registered.`);if("function"!=typeof e&&e instanceof r==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[t]||void 0!==this[o])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[o]=new i(o,this,e);const s=function(){return n.plugins[o].getInstance(...arguments)};this[t]=s,this[o]=s,this.debug(`Plugin "${t}" registered`),Object.values(this.getPlugins()).forEach((t=>{if(t.isSingleton()&&!t.isInitialised()&&t.dependenciesFulfilled()&&t.hasMethod("listens")&&Object.keys(t.callMethod("listens")).includes("ready")&&this.domReady){const e=t.callMethod("listens").ready;t.callMethod(e)}}))}removePlugin(t){const e=t.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((t=>{t.destruct()})),delete this.plugins[e],delete this[e],delete this[t],this.debug(`Plugin "${t}" removed`)):this.debug(`Plugin "${t}" already removed`)}hasPlugin(t){const e=t.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(t){if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(t){const e=[];return Object.entries(this.plugins).forEach((n=>{const[r,o]=n;if(o.isFunction())return;if(!o.dependenciesFulfilled())return;if(!o.hasMethod("listens"))return;"string"==typeof o.callMethod("listens")[t]&&e.push(r)})),e}ready(t){this.domReady&&t(),this.on("ready",t)}on(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].includes(e)||this.listeners[t].push(e)}off(t,e){if(!this.listeners[t])return;const n=this.listeners[t].indexOf(e);-1!==n&&this.listeners[t].splice(n,1)}globalEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global event "${t}"`,...n);const o=this.listensToEvent(t);if(0===o.length)return this.debug(`No listeners found for global event "${t}"`),!0;this.debug(`Listeners found for global event "${t}": ${o.join(", ")}`);let i=!1;return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!i){if(!r[o])throw new Error(`Missing "${o}" method in "${e}" plugin`);try{!1===r[o](...n)&&(i=!0,this.debug(`Global event "${t}" cancelled by "${e}" plugin`))}catch(n){this.error(`Error thrown in "${t}" event by "${e}" plugin.`,n)}}}))})),!i&&this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global event "${t}"`),this.listeners[t].forEach((e=>{if(!i)try{!1===e(...n)&&(i=!0,this.debug(`Global event "${t} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${t}" event by an ad-hoc listener.`,e)}}))),!i}globalPromiseEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global promise event "${t}"`);const o=this.listensToEvent(t);if(0===o.length)return this.debug(`No listeners found for global promise event "${t}"`),Promise.resolve();this.debug(`Listeners found for global promise event "${t}": ${o.join(", ")}`);const i=[];return o.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const o=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!r[o])throw new Error(`Missing "${o}" method in "${e}" plugin`);try{const t=r[o](...n);if(t instanceof Promise==!1)return;i.push(t)}catch(n){this.error(`Error thrown in "${t}" promise event by "${e}" plugin.`,n)}}))})),this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global promise event "${t}"`),this.listeners[t].forEach((e=>{try{const t=e(...n);if(t instanceof Promise==!1)return;i.push(t)}catch(e){this.error(`Error thrown in "${t}" promise event by an ad-hoc listener.`,e)}}))),0===i.length?Promise.resolve():Promise.all(i)}logMessage(t,e,n){console.groupCollapsed("%c[Snowboard]",`color: ${t}; font-weight: ${e?"bold":"normal"};`,n);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];if(o.length){console.groupCollapsed(`%cParameters %c(${o.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let t=0;o.forEach((e=>{t+=1,console.log(`%c${t}:`,"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(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}debug(t){if(this.debugEnabled){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}}error(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(229, 35, 35)",!0,t,...n)}}},6236:function(t,e,n){"use strict";var r=n(1705);(t=>{const e=new r.Z;t.snowboard=e,t.Snowboard=e,t.SnowBoard=e})(window)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var a,u=r(e),c=i(u),l=o(s,c);if(t&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=o(e),u=s.f,c=i.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||u(t,f,c(e,f))}}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(1787),i=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var u=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&i(n,c,a),a.global)u?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),a=i.process,u=i.Deno,c=a&&a.versions||u&&u.version,l=c&&c.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),a=n(8400),u=n(7081),c=n(6541);t.exports=function(t,e){var n,l,f,h,d,g=t.target,p=t.global,b=t.stat;if(n=p?r:b?r[g]||a(g,{}):(r[g]||{}).prototype)for(l in e){if(h=e[l],f=t.dontCallGetSet?(d=o(n,l))&&d.value:n[l],!c(p?l:g+(b?".":"#")+l,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(t.sham||f&&f.sham)&&i(h,"sham",!0),s(n,l,h,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),u=a&&"something"===function(){}.name,c=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:u,CONFIGURABLE:c}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),o=n(9650);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(1180),a=n(9859),u=n(5968),c=n(5052),l=n(5762),f=n(8270),h=n(5353),d=n(4399),g=n(5977),p="Object already initialized",b=a.TypeError,y=a.WeakMap;if(s||h.state){var v=h.state||(h.state=new y),w=u(v.get),m=u(v.has),O=u(v.set);r=function(t,e){if(m(v,t))throw b(p);return e.facade=t,O(v,t,e),e},o=function(t){return w(v,t)||{}},i=function(t){return m(v,t)}}else{var S=d("state");g[S]=!0,r=function(t,e){if(f(t,S))throw b(p);return e.facade=t,l(t,S,e),e},o=function(t){return f(t,S)?t[S]:{}},i=function(t){return f(t,S)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=u[a(t)];return n==l||n!=c&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=s.data={},c=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),o="object"==typeof document&&document.all,i=void 0===o&&void 0!==o;t.exports=i?function(t){return"object"==typeof t?null!==t:r(t)||t===o}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,u=n(8511),c=n(6407),l=c.enforce,f=c.get,h=Object.defineProperty,d=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),p=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return i(r,"source")||(r.source=g.join("string"==typeof e?e:"")),t};Function.prototype.toString=p((function(){return o(this)&&f(this).source||u(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),a=n(5977),u=n(3777),c=n(2635),l=n(4399),f=l("IE_PROTO"),h=function(){},d=function(t){return"<script>"+t+"</"+"script>"},g=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;p="undefined"!=typeof document?document.domain&&r?g(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):g(r);for(var n=s.length;n--;)delete p.prototype[s[n]];return p()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=o(t),n=new h,h.prototype=null,n[f]=t):n=p(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),a=n(905),u=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=u(e),c=o.length,l=0;c>l;)i.f(t,n=o[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),a=n(9310),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",d="writable";e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&d in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),a=n(905),u=n(9310),c=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=u(e),l)try{return f(t,e)}catch(t){}if(c(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,a=n(5977),u=r([].push);t.exports=function(t,e){var n,r=i(t),c=0,l=[];for(n in r)!o(a,n)&&o(r,n)&&u(l,n);for(;e.length>c;)o(r,n=e[c++])&&(~s(l,n)||u(l,n));return l}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),a=n(1176),u=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?u(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),o=TypeError;t.exports=function(t){if(r(t))throw o("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.0",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),a=n(2914),u=n(95),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,u=s(t,l);if(u){if(void 0===e&&(e="default"),n=r(u,t,e),!o(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),o=n(6733),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),a=n(4860),u=n(6969),c=o("wks"),l=r.Symbol,f=l&&l.for,h=u?l:l&&l.withoutSetter||s;t.exports=function(t){if(!i(c,t)||!a&&"string"!=typeof c[t]){var e="Symbol."+t;a&&i(l,t)?c[t]=l[t]:c[t]=u&&f?f(e):h(e)}return c[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){t.O(0,[109],(function(){return e=6236,t(t.s=e);var e}));t.O()}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{1662:function(t,e){"use strict";e.Z={get(t,e,n){if("string"==typeof e){const n=e.toLowerCase();if(t.hasPlugin(n))return function(){return Reflect.get(t,"plugins")[n].getInstance(...arguments)}}return Reflect.get(t,e,n)},has(t,e){if("string"==typeof e){const n=e.toLowerCase();if(t.hasPlugin(n))return!0}return Reflect.has(t,e)}}},5878:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});n(9529);class r{constructor(t){this.snowboard=t}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}class i extends r{}var o={get(t,e,n){if("string"==typeof e){const n=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))throw new Error(`You cannot use the "${e}" Snowboard method within a plugin.`);if(t.hasPlugin(n))return function(){return Reflect.get(t,"plugins")[n].getInstance(...arguments)}}return Reflect.get(t,e,n)},has(t,e){if("string"==typeof e){const n=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))return!1;if(t.hasPlugin(n))return!0}return Reflect.has(t,e)}};class s{constructor(t,e,n){this.name=t,this.snowboard=new Proxy(e,o),this.instance=n,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(t){return!this.isFunction()&&"function"==typeof this.instance.prototype[t]}callMethod(){if(this.isFunction())return null;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e,i=r.shift();return this.instance.prototype[i](r)}getInstance(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(this.isFunction())return this.instance(...n);if(!this.dependenciesFulfilled()){const t=this.getDependencies().filter((t=>!this.snowboard.getPluginNames().includes(t)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${t.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instances[0][e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instances[0][n]=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r(t,...n)}}))),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((t=>{const[e,n]=t;this.instance.prototype[e]=n})),Object.entries(this.mocks).forEach((e=>{const[n,r]=e;this.instance.prototype[n]=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r(t,...n)}})));const i=new this.instance(this.snowboard,...n);return i.detach=()=>this.instances.splice(this.instances.indexOf(i),1),i.construct(...n),this.instances.push(i),i}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof r==!1}isSingleton(){return this.instance.prototype instanceof i==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=new this.instance(this.snowboard,...e);r.detach=()=>this.instances.splice(this.instances.indexOf(r),1),r.construct(...e),this.instances.push(r),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((t=>t.toLowerCase()))}dependenciesFulfilled(){const t=this.getDependencies();let e=!0;return t.forEach((t=>{this.snowboard.hasPlugin(t)||(e=!1)})),e}mock(t,e){var n=this;if(!this.isFunction()){if(!this.instance.prototype[t])throw new Error(`Function "${t}" does not exist and cannot be mocked`);this.mocks[t]=e,this.originalFunctions[t]=this.instance.prototype[t],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][t]=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e(n,...r)})}}unmock(t){this.isFunction()||this.mocks[t]&&(this.isSingleton()&&(this.instances[0][t]=this.originalFunctions[t]),delete this.mocks[t],delete this.originalFunctions[t])}}var a=n(26);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f extends i{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(t){if("object"!=typeof t)throw new Error("Cookie defaults must be provided as an object");Object.entries(t).forEach((t=>{const[e,n]=t;void 0!==this.defaults[e]&&(this.defaults[e]=n)}))}getDefaults(){const t={};return Object.entries(this.defaults).forEach((e=>{const[n,r]=e;null!==this.defaults[n]&&(t[n]=r)})),t}get(t){if(void 0===t){const t=a.Z.get();return Object.entries(t).forEach((e=>{const[n,r]=e;this.snowboard.globalEvent("cookie.get",n,r,(e=>{t[n]=e}))})),t}let e=a.Z.get(t);return this.snowboard.globalEvent("cookie.get",t,e,(t=>{e=t})),e}set(t,e,n){let r=e;return this.snowboard.globalEvent("cookie.set",t,e,(t=>{r=t})),a.Z.set(t,r,u(u({},this.getDefaults()),n))}remove(t,e){a.Z.remove(t,u(u({},this.getDefaults()),e))}}class h extends i{construct(){window.wnJSON=t=>this.parse(t),window.ocJSON=window.wnJSON}parse(t){const e=this.parseString(t);return JSON.parse(e)}parseString(t){let e=t.trim();if(!e.length)throw new Error("Broken JSON object.");let n="",r=null,i=null,o="";for(;e&&","===e[0];)e=e.substr(1);if('"'===e[0]||"'"===e[0]){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");o='"';for(let t=1;t<e.length;t+=1)if("\\"===e[t])"'"===e[t+1]||(o+=e[t]),o+=e[t+1],t+=1;else{if(e[t]===e[0])return o+='"',o;'"'===e[t]?o+='\\"':o+=e[t]}throw new Error("Invalid string JSON object.")}if("true"===e||"false"===e)return e;if("null"===e)return"null";const s=parseFloat(e);if(!Number.isNaN(s))return s.toString();if("{"===e[0]){r="needKey",i=null,n="{";for(let t=1;t<e.length;t+=1)if(!this.isBlankChar(e[t]))if("needKey"!==r||'"'!==e[t]&&"'"!==e[t]){if("needKey"===r&&this.canBeKeyHead(e[t]))i=this.parseKey(e,t),n+='"',n+=i,n+='"',t+=i.length-1,r="afterKey";else if("afterKey"===r&&":"===e[t])n+=":",r=":";else if(":"===r)o=this.getBody(e,t),t=t+o.originLength-1,n+=this.parseString(o.body),r="afterBody";else if("afterBody"===r||"needKey"===r){let i=t;for(;","===e[i]||this.isBlankChar(e[i]);)i+=1;if("}"===e[i]&&i===e.length-1){for(;","===n[n.length-1];)n=n.substr(0,n.length-1);return n+="}",n}i!==t&&"{"!==n&&(n+=",",r="needKey",t=i-1)}}else i=this.parseKey(e,t+1,e[t]),n+=`"${i}"`,t+=i.length,t+=1,r="afterKey";throw new Error(`Broken JSON object near ${n}`)}if("["===e[0]){n="[",r="needBody";for(let t=1;t<e.length;t+=1)if(" "!==e[t]&&"\n"!==e[t]&&"\t"!==e[t])if("needBody"===r){if(","===e[t]){n+="null,";continue}if("]"===e[t]&&t===e.length-1)return","===n[n.length-1]&&(n=n.substr(0,n.length-1)),n+="]",n;o=this.getBody(e,t),t=t+o.originLength-1,n+=this.parseString(o.body),r="afterBody"}else if("afterBody"===r)if(","===e[t])for(n+=",",r="needBody";","===e[t+1]||this.isBlankChar(e[t+1]);)","===e[t+1]&&(n+="null,"),t+=1;else if("]"===e[t]&&t===e.length-1)return n+="]",n;throw new Error(`Broken JSON array near ${n}`)}return""}getBody(t,e){let n="";if('"'===t[e]||"'"===t[e]){n=t[e];for(let r=e+1;r<t.length;r+=1)if("\\"===t[r])n+=t[r],r+1<t.length&&(n+=t[r+1]),r+=1;else{if(t[r]===t[e])return n+=t[e],{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON string body near ${n}`)}if("t"===t[e]){if(t.indexOf("true",e)===e)return{originLength:"true".length,body:"true"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("f"===t[e]){if(t.indexOf("f",e)===e)return{originLength:"false".length,body:"false"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("n"===t[e]){if(t.indexOf("null",e)===e)return{originLength:"null".length,body:"null"};throw new Error(`Broken JSON boolean body near ${t.substr(0,e+10)}`)}if("-"===t[e]||"+"===t[e]||"."===t[e]||t[e]>="0"&&t[e]<="9"){n="";for(let r=e;r<t.length;r+=1){if(!("-"===t[r]||"+"===t[r]||"."===t[r]||t[r]>="0"&&t[r]<="9"))return{originLength:n.length,body:n};n+=t[r]}throw new Error(`Broken JSON number body near ${n}`)}if("{"===t[e]||"["===t[e]){const r=[t[e]];n=t[e];for(let i=e+1;i<t.length;i+=1){if(n+=t[i],"\\"===t[i])i+1<t.length&&(n+=t[i+1]),i+=1;else if('"'===t[i])'"'===r[r.length-1]?r.pop():"'"!==r[r.length-1]&&r.push(t[i]);else if("'"===t[i])"'"===r[r.length-1]?r.pop():'"'!==r[r.length-1]&&r.push(t[i]);else if('"'!==r[r.length-1]&&"'"!==r[r.length-1])if("{"===t[i])r.push("{");else if("}"===t[i]){if("{"!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}else if("["===t[i])r.push("[");else if("]"===t[i]){if("["!==r[r.length-1])throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`);r.pop()}if(!r.length)return{originLength:i-e,body:n}}throw new Error(`Broken JSON ${"{"===t[e]?"object":"array"} body near ${n}`)}throw new Error(`Broken JSON body near ${t.substr(e-5>=0?e-5:0,50)}`)}parseKey(t,e,n){let r="";for(let i=e;i<t.length;i+=1){if(n&&n===t[i])return r;if(!n&&(" "===t[i]||":"===t[i]))return r;r+=t[i],"\\"===t[i]&&i+1<t.length&&(r+=t[i+1],i+=1)}throw new Error(`Broken JSON syntax near ${r}`)}canBeKeyHead(t){return"\\"!==t[0]&&(t[0]>="a"&&t[0]<="z"||t[0]>="A"&&t[0]<="Z"||"_"===t[0]||(t[0]>="0"&&t[0]<="9"||("$"===t[0]||t.charCodeAt(0)>255)))}isBlankChar(t){return" "===t||"\n"===t||"\t"===t}}class g extends i{construct(){window.wnSanitize=t=>this.sanitize(t),window.ocSanitize=window.wnSanitize}sanitize(t,e){const n=(new DOMParser).parseFromString(t,"text/html"),r=void 0===e||"boolean"!=typeof e||e;return this.sanitizeNode(n.getRootNode()),r?n.body.innerHTML:n.innerHTML}sanitizeNode(t){if("SCRIPT"===t.tagName)return void t.remove();this.trimAttributes(t);Array.from(t.children).forEach((t=>{this.sanitizeNode(t)}))}trimAttributes(t){if(t.attributes)for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes.item(e).name,r=t.attributes.item(e).value;0!==n.indexOf("on")&&0!==r.indexOf("javascript:")||t.removeAttribute(n)}}}class d extends i{construct(){this.foundBaseUrl=null,this.baseUrl()}to(t){if(t.match(/[-a-z0-9_+:]+:\/\/[-a-z0-9@:%._+~#=]{1,256}\.[a-z0-9()]{1,6}\b([-a-z0-9()@:%_+.~#?&//=]*)/i))return t;const e=t.replace(/^\/+/,"");return`${this.baseUrl()}${e}`}baseUrl(){if(null!==this.foundBaseUrl)return this.foundBaseUrl;if(null!==document.querySelector('script[data-module="snowboard-base"]'))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl),this.foundBaseUrl;if(null!==document.querySelector("base"))return this.foundBaseUrl=this.validateBaseUrl(document.querySelector("base").getAttribute("href")),this.foundBaseUrl;const t=[window.location.protocol,"//",window.location.host,"/"];return this.foundBaseUrl=t.join(""),this.foundBaseUrl}validateBaseUrl(t){const e=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i.exec(t),n=e[2],r=e[4];if(n&&-1===["http","https"].indexOf(n.toLowerCase()))throw new Error("Invalid base URL detected");if(!r)throw new Error("Invalid base URL detected");return"/"===t.substr(-1)?t:`${t}/`}}class p{constructor(t,e){this.debugEnabled="boolean"==typeof e&&!0===e,this.autoInitSingletons="boolean"==typeof t&&!1===t,this.plugins={},this.listeners={},this.foundBaseUrl=null,this.readiness={dom:!1},Object.seal(this.readiness),this.attachAbstracts(),Object.freeze(p.prototype),Object.freeze(this),this.loadUtilities(),this.initialise(),this.debug("Snowboard framework initialised")}attachAbstracts(){this.PluginBase=r,this.Singleton=i,Object.freeze(this.PluginBase.prototype),Object.freeze(this.PluginBase),Object.freeze(this.Singleton.prototype),Object.freeze(this.Singleton)}loadUtilities(){this.addPlugin("cookie",f),this.addPlugin("jsonParser",h),this.addPlugin("sanitizer",g),this.addPlugin("url",d)}initialise(){window.addEventListener("DOMContentLoaded",(()=>{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((t=>{t.isSingleton()&&t.dependenciesFulfilled()&&t.initialiseSingleton()}))}addPlugin(t,e){const n=t.toLowerCase();if(this.hasPlugin(n))throw new Error(`A plugin called "${t}" is already registered.`);if("function"!=typeof e&&e instanceof r==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[t]||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 s(n,this,e),this.debug(`Plugin "${t}" registered`),Object.values(this.getPlugins()).forEach((t=>{if(t.isSingleton()&&!t.isInitialised()&&t.dependenciesFulfilled()&&t.hasMethod("listens")&&Object.keys(t.callMethod("listens")).includes("ready")&&this.readiness.dom){const e=t.callMethod("listens").ready;t.callMethod(e)}}))}removePlugin(t){const e=t.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((t=>{t.destruct()})),delete this.plugins[e],delete this[e],delete this[t],this.debug(`Plugin "${t}" removed`)):this.debug(`Plugin "${t}" already removed`)}hasPlugin(t){const e=t.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(t){const e=t.toLowerCase();if(!this.hasPlugin(e))throw new Error(`No plugin called "${e}" has been registered.`);return this.plugins[e]}listensToEvent(t){const e=[];return Object.entries(this.plugins).forEach((n=>{const[r,i]=n;if(i.isFunction())return;if(!i.dependenciesFulfilled())return;if(!i.hasMethod("listens"))return;"string"==typeof i.callMethod("listens")[t]&&e.push(r)})),e}ready(t){this.readiness.dom&&t(),this.on("ready",t)}on(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].includes(e)||this.listeners[t].push(e)}off(t,e){if(!this.listeners[t])return;const n=this.listeners[t].indexOf(e);-1!==n&&this.listeners[t].splice(n,1)}globalEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global event "${t}"`,...n);const i=this.listensToEvent(t);if(0===i.length)return this.debug(`No listeners found for global event "${t}"`),!0;this.debug(`Listeners found for global event "${t}": ${i.join(", ")}`);let o=!1;return i.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const i=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!o){if(!r[i])throw new Error(`Missing "${i}" method in "${e}" plugin`);try{!1===r[i](...n)&&(o=!0,this.debug(`Global event "${t}" cancelled by "${e}" plugin`))}catch(n){this.error(`Error thrown in "${t}" event by "${e}" plugin.`,n)}}}))})),!o&&this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global event "${t}"`),this.listeners[t].forEach((e=>{if(!o)try{!1===e(...n)&&(o=!0,this.debug(`Global event "${t} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${t}" event by an ad-hoc listener.`,e)}}))),!o}globalPromiseEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.debug(`Calling global promise event "${t}"`);const i=this.listensToEvent(t);if(0===i.length)return this.debug(`No listeners found for global promise event "${t}"`),Promise.resolve();this.debug(`Listeners found for global promise event "${t}": ${i.join(", ")}`);const o=[];return i.forEach((e=>{const r=this.getPlugin(e);if(r.isFunction())return;r.isSingleton()&&0===r.getInstances().length&&r.initialiseSingleton();const i=r.callMethod("listens")[t];r.getInstances().forEach((r=>{if(!r[i])throw new Error(`Missing "${i}" method in "${e}" plugin`);try{const t=r[i](...n);if(t instanceof Promise==!1)return;o.push(t)}catch(n){this.error(`Error thrown in "${t}" promise event by "${e}" plugin.`,n)}}))})),this.listeners[t]&&this.listeners[t].length>0&&(this.debug(`Found ${this.listeners[t].length} ad-hoc listener(s) for global promise event "${t}"`),this.listeners[t].forEach((e=>{try{const t=e(...n);if(t instanceof Promise==!1)return;o.push(t)}catch(e){this.error(`Error thrown in "${t}" promise event by an ad-hoc listener.`,e)}}))),0===o.length?Promise.resolve():Promise.all(o)}logMessage(t,e,n){console.groupCollapsed("%c[Snowboard]",`color: ${t}; font-weight: ${e?"bold":"normal"};`,n);for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];if(i.length){console.groupCollapsed(`%cParameters %c(${i.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let t=0;i.forEach((e=>{t+=1,console.log(`%c${t}:`,"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(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}debug(t){if(this.debugEnabled){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(45, 167, 199)",!1,t,...n)}}error(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.logMessage("rgb(229, 35, 35)",!0,t,...n)}}},6236:function(t,e,n){"use strict";var r=n(5878),i=n(1662);(t=>{const e=new Proxy(new r.Z,i.Z);t.snowboard=e,t.Snowboard=e,t.SnowBoard=e})(window)},7111:function(t,e,n){var r=n(6733),i=n(9821),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),i=n(2391),o=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&o(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),i=n(3231),o=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=o(c),l=i(s,u);if(t&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},7081:function(t,e,n){var r=n(8270),i=n(4826),o=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=i(e),c=s.f,u=o.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},5762:function(t,e,n){var r=n(7400),i=n(1787),o=n(5358);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),i=n(1787),o=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(r(n)&&o(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),i=n(5052),o=r.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,i,o=n(9859),s=n(598),a=o.process,c=o.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),i=n(7933).f,o=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,h,g,d=t.target,p=t.global,b=t.stat;if(n=p?r:b?r[d]||a(d,{}):(r[d]||{}).prototype)for(l in e){if(h=e[l],f=t.dontCallGetSet?(g=i(n,l))&&g.value:n[l],!u(p?l:d+(b?".":"#")+l,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;c(h,f)}(t.sham||f&&f.sham)&&o(h,"sham",!0),s(n,l,h,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},1805:function(t,e,n){var r=n(7400),i=n(8270),o=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(o,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),i=Function.prototype,o=i.bind,s=i.call,a=r&&o.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),i=n(6733),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),i=n(9650);t.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),i=n(2991),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),i=n(4229),o=n(2635);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),i=n(4229),o=n(7079),s=Object,a=r("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),i=n(6733),o=n(5353),s=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},6407:function(t,e,n){var r,i,o,s=n(1180),a=n(9859),c=n(5968),u=n(5052),l=n(5762),f=n(8270),h=n(5353),g=n(4399),d=n(5977),p="Object already initialized",b=a.TypeError,y=a.WeakMap;if(s||h.state){var v=h.state||(h.state=new y),w=c(v.get),m=c(v.has),O=c(v.set);r=function(t,e){if(m(v,t))throw b(p);return e.facade=t,O(v,t,e),e},i=function(t){return w(v,t)||{}},o=function(t){return m(v,t)}}else{var S=g("state");d[S]=!0,r=function(t,e){if(f(t,S))throw b(p);return e.facade=t,l(t,S,e),e},i=function(t){return f(t,S)?t[S]:{}},o=function(t){return f(t,S)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),i=n(6733),o=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==l||n!=u&&(i(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),i="object"==typeof document&&document.all,o=void 0===i&&void 0!==i;t.exports=o?function(t){return"object"==typeof t?null!==t:r(t)||t===i}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),i=n(6733),o=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),i=n(6733),o=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),l=u.enforce,f=u.get,h=Object.defineProperty,g=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),d=String(String).split("String"),p=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),g&&n&&o(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return o(r,"source")||(r.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=p((function(){return i(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,i=n(1176),o=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),h=function(){},g=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;p="undefined"!=typeof document?document.domain&&r?d(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):d(r);for(var n=s.length;n--;)delete p.prototype[s[n]];return p()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=i(t),n=new h,h.prototype=null,n[f]=t):n=p(),void 0===e?n:o.f(n,e)}},219:function(t,e,n){var r=n(7400),i=n(7137),o=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!i?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),i=c(e),u=i.length,l=0;u>l;)o.f(t,n=i[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),i=n(4394),o=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",h="configurable",g="writable";e.f=r?o?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&g in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),i=n(266),o=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!i(o.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),i=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),i=n(8270),o=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=o(t),u=0,l=[];for(n in r)!i(a,n)&&i(r,n)&&c(l,n);for(;e.length>u;)i(r,n=e[u++])&&(~s(l,n)||c(l,n));return l}},5632:function(t,e,n){var r=n(140),i=n(3837);t.exports=Object.keys||function(t){return r(t,i)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);e.f=i?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),i=n(6733),o=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!o(a=r(n,t)))return a;if(i(n=t.valueOf)&&!o(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!o(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),i=n(5968),o=n(8151),s=n(894),a=n(1176),c=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=s.f;return n?c(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),i=TypeError;t.exports=function(t){if(r(t))throw i("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),i=n(1441),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5353:function(t,e,n){var r=n(9859),i=n(8400),o="__core-js_shared__",s=r[o]||i(o,{});t.exports=s},3036:function(t,e,n){var r=n(4231),i=n(5353);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),i=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},905:function(t,e,n){var r=n(9337),i=n(8885);t.exports=function(t){return r(i(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),i=Object;t.exports=function(t){return i(r(t))}},2066:function(t,e,n){var r=n(266),i=n(5052),o=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,c=s(t,l);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!i(n)||o(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),i=n(9395);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),i=0,o=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+o,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),i=n(4229);t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),i=n(6733),o=r.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},95:function(t,e,n){var r=n(9859),i=n(3036),o=n(8270),s=n(1441),a=n(4860),c=n(6969),u=i("wks"),l=r.Symbol,f=l&&l.for,h=c?l:l&&l.withoutSetter||s;t.exports=function(t){if(!o(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&o(l,t)?u[t]=l[t]:u[t]=c&&f?f(e):h(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),i=n(9540).includes,o=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){t.O(0,[109],(function(){return e=6236,t(t.s=e);var e}));t.O()}]); \ No newline at end of file
modules/system/assets/js/snowboard/build/snowboard.extras.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{8809:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends window.Snowboard.Singleton{listens(){return{ajaxLoadAssets:"load"}}async load(t){if(t.js&&t.js.length>0)for(const e of t.js)try{await this.loadScript(e)}catch(t){return Promise.reject(t)}if(t.css&&t.css.length>0)for(const e of t.css)try{await this.loadStyle(e)}catch(t){return Promise.reject(t)}if(t.img&&t.img.length>0)for(const e of t.img)try{await this.loadImage(e)}catch(t){return Promise.reject(t)}return Promise.resolve()}loadScript(t){return new Promise(((e,n)=>{if(document.querySelector(`script[src="${t}"]`))return void e();const r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",t),r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",t,r),n(new Error(`Unable to load script file: "${t}"`))})),document.body.append(r)}))}loadStyle(t){return new Promise(((e,n)=>{if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e();const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",t),r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",t,r),n(new Error(`Unable to load stylesheet file: "${t}"`))})),document.head.append(r)}))}loadImage(t){return new Promise(((e,n)=>{const r=new Image;r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",t,r),n(new Error(`Unable to load image file: "${t}"`))})),r.src=t}))}}},9553:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.add(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.add(this.getLoadingClass(e.element))}ajaxDone(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.remove(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.remove(this.getLoadingClass(e.element))}getLoadingClass(t){return void 0!==t.dataset.attachLoading&&""!==t.dataset.attachLoading?t.dataset.attachLoading:"wn-loading"}}},5763:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(9529);class r extends Snowboard.PluginBase{construct(t,e){if(t instanceof Snowboard.PluginBase==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(e instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=t,this.element=e,this.refresh()}get(t){return void 0===t?this.instanceConfig:void 0!==this.instanceConfig[t]?this.instanceConfig[t]:void 0}set(t,e,n){if(void 0===t)throw new Error("You must provide a configuration key to set");this.instanceConfig[t]=e,!0===n&&(this.element.dataset[t]=e)}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 t=this.getDefaults();if(!1===this.acceptedConfigs)return t;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(t[e]=this.coerceValue(this.element.dataset[e]));return t}coerceValue(t){const e=String(t);if("null"===e)return null;if("undefined"!==e){if(e.startsWith("base64:")){const t=e.replace(/^base64:/,""),n=atob(t);return this.coerceValue(n)}if(["true","yes"].includes(e.toLowerCase()))return!0;if(["false","no"].includes(e.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(e))return Number(e);try{return this.snowboard.jsonParser().parse(e)}catch(t){return""===e||e}}}}},2270:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.PluginBase{construct(t,e,n){if(this.message=t,this.type=e||"default",this.duration=Number(n||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((t=>t.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)}}},6277:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(t){this.show(),t.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 t=this.stripe.cloneNode(!0);this.indicator.appendChild(t),this.stripe.remove(),this.stripe=t,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(t){this.counter-=1,!0===t&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},8032:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{listens(){return{ready:"ready"}}ready(){let t=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((e=>{e.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(t=!0)})),!t){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",this.snowboard.url().to("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(t)}}}},8269:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.PluginBase{construct(t,e,n,r,i){if(t instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=t,"string"!=typeof e)throw new Error("Transition name must be specified as a string");if(this.transition=e,n&&"function"!=typeof n)throw new Error("Callback must be a valid function");this.callback=n,this.duration=r?this.parseDuration(r):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r={in:`${this.transition}-in`,active:`${this.transition}-active`,out:`${this.transition}-out`};if(0===e.length)return Object.values(r);const i=[];return Object.entries(r).forEach((t=>{const[n,r]=t;-1!==e.indexOf(n)&&i.push(r)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((t=>{this.element.classList.add(t)})),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((t=>{this.element.classList.remove(t)})),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((t=>{this.element.classList.remove(t)}))}parseDuration(t){const e=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(t),n=Number(e[1]);return"sec"===("s"===e[3]?"sec":"msec")?1e3*n+"ms":`${Math.floor(n)}ms`}}},3783:function(t,e,n){"use strict";var r=n(2270);class i extends Snowboard.Singleton{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((t=>{this.snowboard.flash(t.innerHTML,t.dataset.flashType,t.dataset.flashDuration)}))}ajaxErrorMessage(t){return this.snowboard.flash(t,"error"),!1}ajaxFlashMessages(t){return Object.entries(t).forEach((t=>{const[e,n]=t;this.snowboard.flash(n,e)})),!1}}var o=n(8269),s=n(9553),a=n(6277),c=n(8032),u=n(8809),l=n(5763);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(t=>{t.addPlugin("assetLoader",u.Z),t.addPlugin("dataConfig",l.Z),t.addPlugin("extrasStyles",c.Z),t.addPlugin("transition",o.Z),t.addPlugin("flash",r.Z),t.addPlugin("flashListener",i),t.addPlugin("attachLoading",s.Z),t.addPlugin("stripeLoader",a.Z)})(window.Snowboard)},7111:function(t,e,n){var r=n(6733),i=n(9821),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),i=n(2391),o=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&o(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),i=n(3231),o=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=o(c),l=i(s,u);if(t&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},7081:function(t,e,n){var r=n(8270),i=n(4826),o=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=i(e),c=s.f,u=o.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},5762:function(t,e,n){var r=n(7400),i=n(1787),o=n(5358);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),i=n(1787),o=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(r(n)&&o(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),i=n(5052),o=r.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,i,o=n(9859),s=n(598),a=o.process,c=o.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),i=n(7933).f,o=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,d,h,p=t.target,m=t.global,v=t.stat;if(n=m?r:v?r[p]||a(p,{}):(r[p]||{}).prototype)for(l in e){if(d=e[l],f=t.dontCallGetSet?(h=i(n,l))&&h.value:n[l],!u(m?l:p+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof d==typeof f)continue;c(d,f)}(t.sham||f&&f.sham)&&o(d,"sham",!0),s(n,l,d,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},1805:function(t,e,n){var r=n(7400),i=n(8270),o=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(o,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),i=Function.prototype,o=i.bind,s=i.call,a=r&&o.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),i=n(6733),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),i=n(9650);t.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),i=n(2991),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),i=n(4229),o=n(2635);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),i=n(4229),o=n(7079),s=Object,a=r("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),i=n(6733),o=n(5353),s=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},6407:function(t,e,n){var r,i,o,s=n(1180),a=n(9859),c=n(5968),u=n(5052),l=n(5762),f=n(8270),d=n(5353),h=n(4399),p=n(5977),m="Object already initialized",v=a.TypeError,g=a.WeakMap;if(s||d.state){var b=d.state||(d.state=new g),y=c(b.get),w=c(b.has),x=c(b.set);r=function(t,e){if(w(b,t))throw v(m);return e.facade=t,x(b,t,e),e},i=function(t){return y(b,t)||{}},o=function(t){return w(b,t)}}else{var S=h("state");p[S]=!0,r=function(t,e){if(f(t,S))throw v(m);return e.facade=t,l(t,S,e),e},i=function(t){return f(t,S)?t[S]:{}},o=function(t){return f(t,S)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),i=n(6733),o=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==l||n!=u&&(i(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),i="object"==typeof document&&document.all,o=void 0===i&&void 0!==i;t.exports=o?function(t){return"object"==typeof t?null!==t:r(t)||t===i}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),i=n(6733),o=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),i=n(6733),o=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),l=u.enforce,f=u.get,d=Object.defineProperty,h=s&&!r((function(){return 8!==d((function(){}),"length",{value:8}).length})),p=String(String).split("String"),m=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&(s?d(t,"name",{value:e,configurable:!0}):t.name=e),h&&n&&o(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return o(r,"source")||(r.source=p.join("string"==typeof e?e:"")),t};Function.prototype.toString=m((function(){return i(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,i=n(1176),o=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),d=function(){},h=function(t){return"<script>"+t+"</"+"script>"},p=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;m="undefined"!=typeof document?document.domain&&r?p(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):p(r);for(var n=s.length;n--;)delete m.prototype[s[n]];return m()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=i(t),n=new d,d.prototype=null,n[f]=t):n=m(),void 0===e?n:o.f(n,e)}},219:function(t,e,n){var r=n(7400),i=n(7137),o=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!i?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),i=c(e),u=i.length,l=0;u>l;)o.f(t,n=i[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),i=n(4394),o=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",h="writable";e.f=r?o?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&h in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:d in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),i=n(266),o=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!i(o.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),i=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),i=n(8270),o=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=o(t),u=0,l=[];for(n in r)!i(a,n)&&i(r,n)&&c(l,n);for(;e.length>u;)i(r,n=e[u++])&&(~s(l,n)||c(l,n));return l}},5632:function(t,e,n){var r=n(140),i=n(3837);t.exports=Object.keys||function(t){return r(t,i)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);e.f=i?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),i=n(6733),o=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!o(a=r(n,t)))return a;if(i(n=t.valueOf)&&!o(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!o(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),i=n(5968),o=n(8151),s=n(894),a=n(1176),c=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=s.f;return n?c(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),i=TypeError;t.exports=function(t){if(r(t))throw i("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),i=n(1441),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5353:function(t,e,n){var r=n(9859),i=n(8400),o="__core-js_shared__",s=r[o]||i(o,{});t.exports=s},3036:function(t,e,n){var r=n(4231),i=n(5353);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.0",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),i=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},905:function(t,e,n){var r=n(9337),i=n(8885);t.exports=function(t){return r(i(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),i=Object;t.exports=function(t){return i(r(t))}},2066:function(t,e,n){var r=n(266),i=n(5052),o=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,c=s(t,l);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!i(n)||o(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),i=n(9395);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),i=0,o=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+o,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),i=n(4229);t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),i=n(6733),o=r.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},95:function(t,e,n){var r=n(9859),i=n(3036),o=n(8270),s=n(1441),a=n(4860),c=n(6969),u=i("wks"),l=r.Symbol,f=l&&l.for,d=c?l:l&&l.withoutSetter||s;t.exports=function(t){if(!o(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&o(l,t)?u[t]=l[t]:u[t]=c&&f?f(e):d(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),i=n(9540).includes,o=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){var e;e=3783,t(t.s=e)}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{8809:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends window.Snowboard.Singleton{listens(){return{ajaxLoadAssets:"load"}}async load(t){if(t.js&&t.js.length>0)for(const e of t.js)try{await this.loadScript(e)}catch(t){return Promise.reject(t)}if(t.css&&t.css.length>0)for(const e of t.css)try{await this.loadStyle(e)}catch(t){return Promise.reject(t)}if(t.img&&t.img.length>0)for(const e of t.img)try{await this.loadImage(e)}catch(t){return Promise.reject(t)}return Promise.resolve()}loadScript(t){return new Promise(((e,n)=>{if(document.querySelector(`script[src="${t}"]`))return void e();const r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",t),r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",t,r),n(new Error(`Unable to load script file: "${t}"`))})),document.body.append(r)}))}loadStyle(t){return new Promise(((e,n)=>{if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e();const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",t),r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",t,r),n(new Error(`Unable to load stylesheet file: "${t}"`))})),document.head.append(r)}))}loadImage(t){return new Promise(((e,n)=>{const r=new Image;r.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",t,r),e()})),r.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",t,r),n(new Error(`Unable to load image file: "${t}"`))})),r.src=t}))}}},9553:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.add(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.add(this.getLoadingClass(e.element))}ajaxDone(t,e){if(e.element)if("FORM"===e.element.tagName){const t=e.element.querySelectorAll("[data-attach-loading]");t.length>0&&t.forEach((t=>{t.classList.remove(this.getLoadingClass(t))}))}else void 0!==e.element.dataset.attachLoading&&e.element.classList.remove(this.getLoadingClass(e.element))}getLoadingClass(t){return void 0!==t.dataset.attachLoading&&""!==t.dataset.attachLoading?t.dataset.attachLoading:"wn-loading"}}},5763:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(9529);class r extends Snowboard.PluginBase{construct(t,e){if(t instanceof Snowboard.PluginBase==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(e instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=t,this.element=e,this.refresh()}get(t){return void 0===t?this.instanceConfig:void 0!==this.instanceConfig[t]?this.instanceConfig[t]:void 0}set(t,e,n){if(void 0===t)throw new Error("You must provide a configuration key to set");this.instanceConfig[t]=e,!0===n&&(this.element.dataset[t]=e)}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 t=this.getDefaults();if(!1===this.acceptedConfigs)return t;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(t[e]=this.coerceValue(this.element.dataset[e]));return t}coerceValue(t){const e=String(t);if("null"===e)return null;if("undefined"!==e){if(e.startsWith("base64:")){const t=e.replace(/^base64:/,""),n=atob(t);return this.coerceValue(n)}if(["true","yes"].includes(e.toLowerCase()))return!0;if(["false","no"].includes(e.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(e))return Number(e);try{return this.snowboard.jsonParser().parse(e)}catch(t){return""===e||e}}}}},2270:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.PluginBase{construct(t,e,n){if(this.message=t,this.type=e||"default",this.duration=Number(n||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((t=>t.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)}}},6277:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(t){this.show(),t.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 t=this.stripe.cloneNode(!0);this.indicator.appendChild(t),this.stripe.remove(),this.stripe=t,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(t){this.counter-=1,!0===t&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},8032:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.Singleton{listens(){return{ready:"ready"}}ready(){let t=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((e=>{e.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(t=!0)})),!t){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",this.snowboard.url().to("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(t)}}}},8269:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});class r extends Snowboard.PluginBase{construct(t,e,n,r,i){if(t instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=t,"string"!=typeof e)throw new Error("Transition name must be specified as a string");if(this.transition=e,n&&"function"!=typeof n)throw new Error("Callback must be a valid function");this.callback=n,this.duration=r?this.parseDuration(r):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r={in:`${this.transition}-in`,active:`${this.transition}-active`,out:`${this.transition}-out`};if(0===e.length)return Object.values(r);const i=[];return Object.entries(r).forEach((t=>{const[n,r]=t;-1!==e.indexOf(n)&&i.push(r)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((t=>{this.element.classList.add(t)})),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((t=>{this.element.classList.remove(t)})),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((t=>{this.element.classList.remove(t)}))}parseDuration(t){const e=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(t),n=Number(e[1]);return"sec"===("s"===e[3]?"sec":"msec")?1e3*n+"ms":`${Math.floor(n)}ms`}}},3783:function(t,e,n){"use strict";var r=n(2270);class i extends Snowboard.Singleton{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((t=>{this.snowboard.flash(t.innerHTML,t.dataset.flashType,t.dataset.flashDuration)}))}ajaxErrorMessage(t){return this.snowboard.flash(t,"error"),!1}ajaxFlashMessages(t){return Object.entries(t).forEach((t=>{const[e,n]=t;this.snowboard.flash(n,e)})),!1}}var o=n(8269),s=n(9553),a=n(6277),c=n(8032),u=n(8809),l=n(5763);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(t=>{t.addPlugin("assetLoader",u.Z),t.addPlugin("dataConfig",l.Z),t.addPlugin("extrasStyles",c.Z),t.addPlugin("transition",o.Z),t.addPlugin("flash",r.Z),t.addPlugin("flashListener",i),t.addPlugin("attachLoading",s.Z),t.addPlugin("stripeLoader",a.Z)})(window.Snowboard)},7111:function(t,e,n){var r=n(6733),i=n(9821),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),i=n(2391),o=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&o(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),i=n(3231),o=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=o(c),l=i(s,u);if(t&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},7081:function(t,e,n){var r=n(8270),i=n(4826),o=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=i(e),c=s.f,u=o.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},5762:function(t,e,n){var r=n(7400),i=n(1787),o=n(5358);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),i=n(1787),o=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(r(n)&&o(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),i=n(5052),o=r.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,i,o=n(9859),s=n(598),a=o.process,c=o.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),i=n(7933).f,o=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,l,f,d,h,p=t.target,m=t.global,v=t.stat;if(n=m?r:v?r[p]||a(p,{}):(r[p]||{}).prototype)for(l in e){if(d=e[l],f=t.dontCallGetSet?(h=i(n,l))&&h.value:n[l],!u(m?l:p+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof d==typeof f)continue;c(d,f)}(t.sham||f&&f.sham)&&o(d,"sham",!0),s(n,l,d,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},1805:function(t,e,n){var r=n(7400),i=n(8270),o=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(o,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),i=Function.prototype,o=i.bind,s=i.call,a=r&&o.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),i=n(6733),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),i=n(9650);t.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),i=n(2991),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),i=n(4229),o=n(2635);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),i=n(4229),o=n(7079),s=Object,a=r("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),i=n(6733),o=n(5353),s=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},6407:function(t,e,n){var r,i,o,s=n(1180),a=n(9859),c=n(5968),u=n(5052),l=n(5762),f=n(8270),d=n(5353),h=n(4399),p=n(5977),m="Object already initialized",v=a.TypeError,g=a.WeakMap;if(s||d.state){var b=d.state||(d.state=new g),y=c(b.get),w=c(b.has),x=c(b.set);r=function(t,e){if(w(b,t))throw v(m);return e.facade=t,x(b,t,e),e},i=function(t){return y(b,t)||{}},o=function(t){return w(b,t)}}else{var S=h("state");p[S]=!0,r=function(t,e){if(f(t,S))throw v(m);return e.facade=t,l(t,S,e),e},i=function(t){return f(t,S)?t[S]:{}},o=function(t){return f(t,S)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),i=n(6733),o=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==l||n!=u&&(i(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),i="object"==typeof document&&document.all,o=void 0===i&&void 0!==i;t.exports=o?function(t){return"object"==typeof t?null!==t:r(t)||t===i}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),i=n(6733),o=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),i=n(6733),o=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),l=u.enforce,f=u.get,d=Object.defineProperty,h=s&&!r((function(){return 8!==d((function(){}),"length",{value:8}).length})),p=String(String).split("String"),m=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&(s?d(t,"name",{value:e,configurable:!0}):t.name=e),h&&n&&o(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return o(r,"source")||(r.source=p.join("string"==typeof e?e:"")),t};Function.prototype.toString=m((function(){return i(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,i=n(1176),o=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),l=n(4399),f=l("IE_PROTO"),d=function(){},h=function(t){return"<script>"+t+"</"+"script>"},p=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;m="undefined"!=typeof document?document.domain&&r?p(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):p(r);for(var n=s.length;n--;)delete m.prototype[s[n]];return m()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=i(t),n=new d,d.prototype=null,n[f]=t):n=m(),void 0===e?n:o.f(n,e)}},219:function(t,e,n){var r=n(7400),i=n(7137),o=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!i?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),i=c(e),u=i.length,l=0;u>l;)o.f(t,n=i[l++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),i=n(4394),o=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",h="writable";e.f=r?o?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&h in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:d in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),i=n(266),o=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),l=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return s(!i(o.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),i=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),i=n(8270),o=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=o(t),u=0,l=[];for(n in r)!i(a,n)&&i(r,n)&&c(l,n);for(;e.length>u;)i(r,n=e[u++])&&(~s(l,n)||c(l,n));return l}},5632:function(t,e,n){var r=n(140),i=n(3837);t.exports=Object.keys||function(t){return r(t,i)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);e.f=i?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),i=n(6733),o=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!o(a=r(n,t)))return a;if(i(n=t.valueOf)&&!o(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!o(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),i=n(5968),o=n(8151),s=n(894),a=n(1176),c=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=s.f;return n?c(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),i=TypeError;t.exports=function(t){if(r(t))throw i("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),i=n(1441),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5353:function(t,e,n){var r=n(9859),i=n(8400),o="__core-js_shared__",s=r[o]||i(o,{});t.exports=s},3036:function(t,e,n){var r=n(4231),i=n(5353);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),i=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},905:function(t,e,n){var r=n(9337),i=n(8885);t.exports=function(t){return r(i(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),i=Object;t.exports=function(t){return i(r(t))}},2066:function(t,e,n){var r=n(266),i=n(5052),o=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,c=s(t,l);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!i(n)||o(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),i=n(9395);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),i=0,o=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+o,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),i=n(4229);t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),i=n(6733),o=r.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},95:function(t,e,n){var r=n(9859),i=n(3036),o=n(8270),s=n(1441),a=n(4860),c=n(6969),u=i("wks"),l=r.Symbol,f=l&&l.for,d=c?l:l&&l.withoutSetter||s;t.exports=function(t){if(!o(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&o(l,t)?u[t]=l[t]:u[t]=c&&f?f(e):d(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),i=n(9540).includes,o=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){var e;e=3783,t(t.s=e)}]); \ No newline at end of file
modules/system/assets/js/snowboard/build/snowboard.request.js+1 −1 modified@@ -1 +1 @@ -(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{2026:function(t,e,n){"use strict";n(9529);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Request plugin.");class s extends Snowboard.PluginBase{construct(t,e,n){if("string"==typeof t){const e=document.querySelector(t);if(null===e)throw new Error(`No element was found with the given selector: ${t}`);this.element=e}else this.element=t;if(this.handler=e,this.options=n||{},this.fetchOptions={},this.responseData=null,this.responseError=null,this.cancelled=!1,this.checkRequest(),this.snowboard.globalEvent("ajaxSetup",this)){if(this.element){const t=new Event("ajaxSetup",{cancelable:!0});if(t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return void(this.cancelled=!0)}this.doClientValidation()?this.confirm?this.doConfirm().then((t=>{t&&this.doAjax().then((t=>{if(t.cancelled)return this.cancelled=!0,void this.complete();this.responseData=t,this.processUpdate(t).then((()=>{!1===t.X_WINTER_SUCCESS?this.processError(t):this.processResponse(t)}))}),(t=>{this.responseError=t,this.processError(t)}))})):this.doAjax().then((t=>{if(t.cancelled)return this.cancelled=!0,void this.complete();this.responseData=t,this.processUpdate(t).then((()=>{!1===t.X_WINTER_SUCCESS?this.processError(t):this.processResponse(t)}))}),(t=>{this.responseError=t,this.processError(t)})):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.handler.match(/^(?:\w+:{2})?on*/))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 t=new Promise(((t,e)=>{this.getFetch().then((n=>{n.ok||406===n.status?n.headers.has("Content-Type")&&n.headers.get("Content-Type").includes("/json")?n.json().then((e=>{t(o(o({},e),{},{X_WINTER_SUCCESS:406!==n.status,X_WINTER_RESPONSE_CODE:n.status}))}),(t=>{e(this.renderError(`Unable to parse JSON response: ${t}`))})):n.text().then((e=>{t(e)}),(t=>{e(this.renderError(`Unable to process response: ${t}`))})):n.headers.has("Content-Type")&&n.headers.get("Content-Type").includes("/json")?n.json().then((t=>{e(this.renderError(t.message,t.exception,t.file,t.line,t.trace))}),(t=>{e(this.renderError(`Unable to parse JSON response: ${t}`))})):n.text().then((t=>{e(this.renderError(t))}),(t=>{e(this.renderError(`Unable to process response: ${t}`))}))}),(t=>{e(this.renderError(`Unable to retrieve a response from the server: ${t}`))}))}));if(this.snowboard.globalEvent("ajaxStart",t,this),this.element){const e=new Event("ajaxPromise");e.promise=t,this.element.dispatchEvent(e)}return t}processUpdate(t){return new Promise(((e,n)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[t]))return void n();const r={};if(Object.entries(t).forEach((t=>{const[e,n]=t;"X_WINTER"!==e.substr(0,8)&&(r[e]=n)})),0===Object.keys(r).length)return void(t.X_WINTER_ASSETS?this.processAssets(t.X_WINTER_ASSETS).then((()=>{e()}),(()=>{n()})):e());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",t,this).then((async()=>{t.X_WINTER_ASSETS&&await this.processAssets(t.X_WINTER_ASSETS),this.doUpdate(r).then((()=>{window.requestAnimationFrame((()=>e()))}),(()=>{n()}))}),(()=>{n()}))}))}doUpdate(t){return new Promise((e=>{const n=[];Object.entries(t).forEach((t=>{const[e,r]=t;let o=this.options.update&&this.options.update[e]?this.options.update[e]:e,i="replace";"@"===o.substr(0,1)?(i="append",o=o.substr(1)):"^"===o.substr(0,1)?(i="prepend",o=o.substr(1)):"#"!==o.substr(0,1)&&"."!==o.substr(0,1)&&(i="noop");const s=document.querySelectorAll(o);s.length>0&&s.forEach((t=>{switch(i){case"append":t.innerHTML+=r;break;case"prepend":t.innerHTML=r+t.innerHTML;break;case"noop":break;default:t.innerHTML=r}n.push(t),this.snowboard.globalEvent("ajaxUpdate",t,r,this);const e=new Event("ajaxUpdate");e.content=r,t.dispatchEvent(e)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",n,this),e()}))}processResponse(t){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 t=new Event("ajaxDone",{cancelable:!0});if(t.responseData=this.responseData,t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return}this.flash&&t.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(t.X_WINTER_FLASH_MESSAGES),this.redirect||t.X_WINTER_REDIRECT?this.processRedirect(this.redirect||t.X_WINTER_REDIRECT):this.complete()}}processError(t){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 t=new Event("ajaxFail",{cancelable:!0});if(t.responseError=this.responseError,t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return}t instanceof Error?this.processErrorMessage(t.message):(t.X_WINTER_ERROR_FIELDS&&this.processValidationErrors(t.X_WINTER_ERROR_FIELDS),t.X_WINTER_ERROR_MESSAGE&&this.processErrorMessage(t.X_WINTER_ERROR_MESSAGE)),this.complete()}}processRedirect(t){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[t])||!1!==this.snowboard.globalEvent("ajaxRedirect",t,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const t=document.createEvent("CustomEvent");t.eventName="ajaxRedirected",this.element.dispatchEvent(t)}}),{once:!0}),window.location.assign(t))}processErrorMessage(t){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[t])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",t,this)&&window.alert(t)}processFlashMessages(t){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[t])||this.snowboard.globalEvent("ajaxFlashMessages",t,this)}processValidationErrors(t){"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,t])||this.snowboard.globalEvent("ajaxValidationErrors",this.form,t,this)}processAssets(t){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",t)}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 t=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await t)return!0}catch(t){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 t=new Event("ajaxAlways");t.request=this,t.responseData=this.responseData,t.responseError=this.responseError,this.element.dispatchEvent(t)}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 t={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(t["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(t["X-XSRF-TOKEN"]=this.xsrfToken),t}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 t="object"==typeof this.options.data?this.options.data:{},e=new FormData(this.form||void 0);return Object.keys(t).length>0&&Object.entries(t).forEach((t=>{const[n,r]=t;e.append(n,r)})),e}get confirm(){return this.options.confirm||!1}extractPartials(t){return Object.keys(t).join("&")}renderError(t,e,n,r,o){const i=new Error(t);return i.exception=e||null,i.file=n||null,i.line=r||null,i.trace=o||[],i}}Snowboard.addPlugin("request",s)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=i(c),p=o(s,u);if(t&&n!=n){for(;u>p;)if((a=c[p++])!=a)return!0}else for(;u>p;p++)if((t||p in c)&&c[p]===n)return t||p||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=o(e),c=s.f,u=i.f,p=0;p<a.length;p++){var f=a[p];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(1787),i=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(r(n)&&i(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),a=i.process,c=i.Deno,u=a&&a.versions||c&&c.version,p=u&&u.v8;p&&(o=(r=p.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,p,f,l,h,d=t.target,v=t.global,b=t.stat;if(n=v?r:b?r[d]||a(d,{}):(r[d]||{}).prototype)for(p in e){if(l=e[p],f=t.dontCallGetSet?(h=o(n,p))&&h.value:n[p],!u(v?p:d+(b?".":"#")+p,t.forced)&&void 0!==f){if(typeof l==typeof f)continue;c(l,f)}(t.sham||f&&f.sham)&&i(l,"sham",!0),s(n,p,l,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),o=n(9650);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(1180),a=n(9859),c=n(5968),u=n(5052),p=n(5762),f=n(8270),l=n(5353),h=n(4399),d=n(5977),v="Object already initialized",b=a.TypeError,m=a.WeakMap;if(s||l.state){var E=l.state||(l.state=new m),g=c(E.get),y=c(E.has),w=c(E.set);r=function(t,e){if(y(E,t))throw b(v);return e.facade=t,w(E,t,e),e},o=function(t){return g(E,t)||{}},i=function(t){return y(E,t)}}else{var x=h("state");d[x]=!0,r=function(t,e){if(f(t,x))throw b(v);return e.facade=t,p(t,x,e),e},o=function(t){return f(t,x)?t[x]:{}},i=function(t){return f(t,x)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==p||n!=u&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",p=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),o="object"==typeof document&&document.all,i=void 0===o&&void 0!==o;t.exports=i?function(t){return"object"==typeof t?null!==t:r(t)||t===o}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),p=u.enforce,f=u.get,l=Object.defineProperty,h=s&&!r((function(){return 8!==l((function(){}),"length",{value:8}).length})),d=String(String).split("String"),v=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&(s?l(t,"name",{value:e,configurable:!0}):t.name=e),h&&n&&i(n,"arity")&&t.length!==n.arity&&l(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&l(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=p(t);return i(r,"source")||(r.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return o(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),p=n(4399),f=p("IE_PROTO"),l=function(){},h=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&r?d(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):d(r);for(var n=s.length;n--;)delete v.prototype[s[n]];return v()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(l.prototype=o(t),n=new l,l.prototype=null,n[f]=t):n=v(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=c(e),u=o.length,p=0;u>p;)i.f(t,n=o[p++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,f="enumerable",l="configurable",h="writable";e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&h in n&&!n.writable){var r=p(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:l in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),p=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),p)try{return f(t,e)}catch(t){}if(u(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=i(t),u=0,p=[];for(n in r)!o(a,n)&&o(r,n)&&c(p,n);for(;e.length>u;)o(r,n=e[u++])&&(~s(p,n)||c(p,n));return p}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),a=n(1176),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?c(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),o=TypeError;t.exports=function(t){if(r(t))throw o("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.0",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,p=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=s(t,p);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),o=n(6733),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),a=n(4860),c=n(6969),u=o("wks"),p=r.Symbol,f=p&&p.for,l=c?p:p&&p.withoutSetter||s;t.exports=function(t){if(!i(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&i(p,t)?u[t]=p[t]:u[t]=c&&f?f(e):l(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){var e;e=2026,t(t.s=e)}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{2026:function(t,e,n){"use strict";n(9529);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Request plugin.");class s extends Snowboard.PluginBase{construct(t,e,n){if("string"==typeof t){const e=document.querySelector(t);if(null===e)throw new Error(`No element was found with the given selector: ${t}`);this.element=e}else this.element=t;if(this.handler=e,this.options=n||{},this.fetchOptions={},this.responseData=null,this.responseError=null,this.cancelled=!1,this.checkRequest(),this.snowboard.globalEvent("ajaxSetup",this)){if(this.element){const t=new Event("ajaxSetup",{cancelable:!0});if(t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return void(this.cancelled=!0)}this.doClientValidation()?this.confirm?this.doConfirm().then((t=>{t&&this.doAjax().then((t=>{if(t.cancelled)return this.cancelled=!0,void this.complete();this.responseData=t,this.processUpdate(t).then((()=>{!1===t.X_WINTER_SUCCESS?this.processError(t):this.processResponse(t)}))}),(t=>{this.responseError=t,this.processError(t)}))})):this.doAjax().then((t=>{if(t.cancelled)return this.cancelled=!0,void this.complete();this.responseData=t,this.processUpdate(t).then((()=>{!1===t.X_WINTER_SUCCESS?this.processError(t):this.processResponse(t)}))}),(t=>{this.responseError=t,this.processError(t)})):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.handler.match(/^(?:\w+:{2})?on*/))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 t=new Promise(((t,e)=>{this.getFetch().then((n=>{n.ok||406===n.status?n.headers.has("Content-Type")&&n.headers.get("Content-Type").includes("/json")?n.json().then((e=>{t(o(o({},e),{},{X_WINTER_SUCCESS:406!==n.status,X_WINTER_RESPONSE_CODE:n.status}))}),(t=>{e(this.renderError(`Unable to parse JSON response: ${t}`))})):n.text().then((e=>{t(e)}),(t=>{e(this.renderError(`Unable to process response: ${t}`))})):n.headers.has("Content-Type")&&n.headers.get("Content-Type").includes("/json")?n.json().then((t=>{e(this.renderError(t.message,t.exception,t.file,t.line,t.trace))}),(t=>{e(this.renderError(`Unable to parse JSON response: ${t}`))})):n.text().then((t=>{e(this.renderError(t))}),(t=>{e(this.renderError(`Unable to process response: ${t}`))}))}),(t=>{e(this.renderError(`Unable to retrieve a response from the server: ${t}`))}))}));if(this.snowboard.globalEvent("ajaxStart",t,this),this.element){const e=new Event("ajaxPromise");e.promise=t,this.element.dispatchEvent(e)}return t}processUpdate(t){return new Promise(((e,n)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[t]))return void n();const r={};if(Object.entries(t).forEach((t=>{const[e,n]=t;"X_WINTER"!==e.substr(0,8)&&(r[e]=n)})),0===Object.keys(r).length)return void(t.X_WINTER_ASSETS?this.processAssets(t.X_WINTER_ASSETS).then((()=>{e()}),(()=>{n()})):e());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",t,this).then((async()=>{t.X_WINTER_ASSETS&&await this.processAssets(t.X_WINTER_ASSETS),this.doUpdate(r).then((()=>{window.requestAnimationFrame((()=>e()))}),(()=>{n()}))}),(()=>{n()}))}))}doUpdate(t){return new Promise((e=>{const n=[];Object.entries(t).forEach((t=>{const[e,r]=t;let o=this.options.update&&this.options.update[e]?this.options.update[e]:e,i="replace";"@"===o.substr(0,1)?(i="append",o=o.substr(1)):"^"===o.substr(0,1)?(i="prepend",o=o.substr(1)):"#"!==o.substr(0,1)&&"."!==o.substr(0,1)&&(i="noop");const s=document.querySelectorAll(o);s.length>0&&s.forEach((t=>{switch(i){case"append":t.innerHTML+=r;break;case"prepend":t.innerHTML=r+t.innerHTML;break;case"noop":break;default:t.innerHTML=r}n.push(t),this.snowboard.globalEvent("ajaxUpdate",t,r,this);const e=new Event("ajaxUpdate");e.content=r,t.dispatchEvent(e)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",n,this),e()}))}processResponse(t){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 t=new Event("ajaxDone",{cancelable:!0});if(t.responseData=this.responseData,t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return}this.flash&&t.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(t.X_WINTER_FLASH_MESSAGES),this.redirect||t.X_WINTER_REDIRECT?this.processRedirect(this.redirect||t.X_WINTER_REDIRECT):this.complete()}}processError(t){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 t=new Event("ajaxFail",{cancelable:!0});if(t.responseError=this.responseError,t.request=this,this.element.dispatchEvent(t),t.defaultPrevented)return}t instanceof Error?this.processErrorMessage(t.message):(t.X_WINTER_ERROR_FIELDS&&this.processValidationErrors(t.X_WINTER_ERROR_FIELDS),t.X_WINTER_ERROR_MESSAGE&&this.processErrorMessage(t.X_WINTER_ERROR_MESSAGE)),this.complete()}}processRedirect(t){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[t])||!1!==this.snowboard.globalEvent("ajaxRedirect",t,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const t=document.createEvent("CustomEvent");t.eventName="ajaxRedirected",this.element.dispatchEvent(t)}}),{once:!0}),window.location.assign(t))}processErrorMessage(t){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[t])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",t,this)&&window.alert(t)}processFlashMessages(t){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[t])||this.snowboard.globalEvent("ajaxFlashMessages",t,this)}processValidationErrors(t){"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,t])||this.snowboard.globalEvent("ajaxValidationErrors",this.form,t,this)}processAssets(t){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",t)}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 t=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await t)return!0}catch(t){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 t=new Event("ajaxAlways");t.request=this,t.responseData=this.responseData,t.responseError=this.responseError,this.element.dispatchEvent(t)}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 t={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(t["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(t["X-XSRF-TOKEN"]=this.xsrfToken),t}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 t="object"==typeof this.options.data?this.options.data:{},e=new FormData(this.form||void 0);return Object.keys(t).length>0&&Object.entries(t).forEach((t=>{const[n,r]=t;e.append(n,r)})),e}get confirm(){return this.options.confirm||!1}extractPartials(t){return Object.keys(t).join("&")}renderError(t,e,n,r,o){const i=new Error(t);return i.exception=e||null,i.file=n||null,i.line=r||null,i.trace=o||[],i}}Snowboard.addPlugin("request",s)},7111:function(t,e,n){var r=n(6733),o=n(9821),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},9736:function(t,e,n){var r=n(95),o=n(2391),i=n(1787).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1176:function(t,e,n){var r=n(5052),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},9540:function(t,e,n){var r=n(905),o=n(3231),i=n(9646),s=function(t){return function(e,n,s){var a,c=r(e),u=i(c),p=o(s,u);if(t&&n!=n){for(;u>p;)if((a=c[p++])!=a)return!0}else for(;u>p;p++)if((t||p in c)&&c[p]===n)return t||p||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},7079:function(t,e,n){var r=n(5968),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},7081:function(t,e,n){var r=n(8270),o=n(4826),i=n(7933),s=n(1787);t.exports=function(t,e,n){for(var a=o(e),c=s.f,u=i.f,p=0;p<a.length;p++){var f=a[p];r(t,f)||n&&r(n,f)||c(t,f,u(e,f))}}},5762:function(t,e,n){var r=n(7400),o=n(1787),i=n(5358);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},5358:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4768:function(t,e,n){var r=n(6733),o=n(1787),i=n(6039),s=n(8400);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(r(n)&&i(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},8400:function(t,e,n){var r=n(9859),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},7400:function(t,e,n){var r=n(4229);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2635:function(t,e,n){var r=n(9859),o=n(5052),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},598:function(t,e,n){var r=n(1333);t.exports=r("navigator","userAgent")||""},6358:function(t,e,n){var r,o,i=n(9859),s=n(598),a=i.process,c=i.Deno,u=a&&a.versions||c&&c.version,p=u&&u.v8;p&&(o=(r=p.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3837:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3103:function(t,e,n){var r=n(9859),o=n(7933).f,i=n(5762),s=n(4768),a=n(8400),c=n(7081),u=n(6541);t.exports=function(t,e){var n,p,f,l,h,d=t.target,v=t.global,b=t.stat;if(n=v?r:b?r[d]||a(d,{}):(r[d]||{}).prototype)for(p in e){if(l=e[p],f=t.dontCallGetSet?(h=o(n,p))&&h.value:n[p],!u(v?p:d+(b?".":"#")+p,t.forced)&&void 0!==f){if(typeof l==typeof f)continue;c(l,f)}(t.sham||f&&f.sham)&&i(l,"sham",!0),s(n,p,l,t)}}},4229:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7188:function(t,e,n){var r=n(4229);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},266:function(t,e,n){var r=n(7188),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},1805:function(t,e,n){var r=n(7400),o=n(8270),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,u=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5968:function(t,e,n){var r=n(7188),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},1333:function(t,e,n){var r=n(9859),o=n(6733),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},5300:function(t,e,n){var r=n(7111),o=n(9650);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},9859:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8270:function(t,e,n){var r=n(5968),o=n(2991),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},5977:function(t){t.exports={}},3777:function(t,e,n){var r=n(1333);t.exports=r("document","documentElement")},4394:function(t,e,n){var r=n(7400),o=n(4229),i=n(2635);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:function(t,e,n){var r=n(5968),o=n(4229),i=n(7079),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},8511:function(t,e,n){var r=n(5968),o=n(6733),i=n(5353),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},6407:function(t,e,n){var r,o,i,s=n(1180),a=n(9859),c=n(5968),u=n(5052),p=n(5762),f=n(8270),l=n(5353),h=n(4399),d=n(5977),v="Object already initialized",b=a.TypeError,m=a.WeakMap;if(s||l.state){var E=l.state||(l.state=new m),g=c(E.get),y=c(E.has),w=c(E.set);r=function(t,e){if(y(E,t))throw b(v);return e.facade=t,w(E,t,e),e},o=function(t){return g(E,t)||{}},i=function(t){return y(E,t)}}else{var x=h("state");d[x]=!0,r=function(t,e){if(f(t,x))throw b(v);return e.facade=t,p(t,x,e),e},o=function(t){return f(t,x)?t[x]:{}},i=function(t){return f(t,x)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},6733:function(t){t.exports=function(t){return"function"==typeof t}},6541:function(t,e,n){var r=n(4229),o=n(6733),i=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==p||n!=u&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",p=s.POLYFILL="P";t.exports=s},9650:function(t){t.exports=function(t){return null==t}},5052:function(t,e,n){var r=n(6733),o="object"==typeof document&&document.all,i=void 0===o&&void 0!==o;t.exports=i?function(t){return"object"==typeof t?null!==t:r(t)||t===o}:function(t){return"object"==typeof t?null!==t:r(t)}},4231:function(t){t.exports=!1},9395:function(t,e,n){var r=n(1333),o=n(6733),i=n(1321),s=n(6969),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},9646:function(t,e,n){var r=n(4237);t.exports=function(t){return r(t.length)}},6039:function(t,e,n){var r=n(4229),o=n(6733),i=n(8270),s=n(7400),a=n(1805).CONFIGURABLE,c=n(8511),u=n(6407),p=u.enforce,f=u.get,l=Object.defineProperty,h=s&&!r((function(){return 8!==l((function(){}),"length",{value:8}).length})),d=String(String).split("String"),v=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&(s?l(t,"name",{value:e,configurable:!0}):t.name=e),h&&n&&i(n,"arity")&&t.length!==n.arity&&l(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&l(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=p(t);return i(r,"source")||(r.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return o(this)&&f(this).source||c(this)}),"toString")},917:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2391:function(t,e,n){var r,o=n(1176),i=n(219),s=n(3837),a=n(5977),c=n(3777),u=n(2635),p=n(4399),f=p("IE_PROTO"),l=function(){},h=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&r?d(r):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):d(r);for(var n=s.length;n--;)delete v.prototype[s[n]];return v()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(l.prototype=o(t),n=new l,l.prototype=null,n[f]=t):n=v(),void 0===e?n:i.f(n,e)}},219:function(t,e,n){var r=n(7400),o=n(7137),i=n(1787),s=n(1176),a=n(905),c=n(5632);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=c(e),u=o.length,p=0;u>p;)i.f(t,n=o[p++],r[n]);return t}},1787:function(t,e,n){var r=n(7400),o=n(4394),i=n(7137),s=n(1176),a=n(9310),c=TypeError,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,f="enumerable",l="configurable",h="writable";e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&h in n&&!n.writable){var r=p(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:l in n?n.configurable:r.configurable,enumerable:f in n?n.enumerable:r.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7933:function(t,e,n){var r=n(7400),o=n(266),i=n(9195),s=n(5358),a=n(905),c=n(9310),u=n(8270),p=n(4394),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),p)try{return f(t,e)}catch(t){}if(u(t,e))return s(!o(i.f,t,e),t[e])}},8151:function(t,e,n){var r=n(140),o=n(3837).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},894:function(t,e){e.f=Object.getOwnPropertySymbols},1321:function(t,e,n){var r=n(5968);t.exports=r({}.isPrototypeOf)},140:function(t,e,n){var r=n(5968),o=n(8270),i=n(905),s=n(9540).indexOf,a=n(5977),c=r([].push);t.exports=function(t,e){var n,r=i(t),u=0,p=[];for(n in r)!o(a,n)&&o(r,n)&&c(p,n);for(;e.length>u;)o(r,n=e[u++])&&(~s(p,n)||c(p,n));return p}},5632:function(t,e,n){var r=n(140),o=n(3837);t.exports=Object.keys||function(t){return r(t,o)}},9195:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2914:function(t,e,n){var r=n(266),o=n(6733),i=n(5052),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4826:function(t,e,n){var r=n(1333),o=n(5968),i=n(8151),s=n(894),a=n(1176),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?c(e,n(t)):e}},8885:function(t,e,n){var r=n(9650),o=TypeError;t.exports=function(t){if(r(t))throw o("Can't call method on "+t);return t}},4399:function(t,e,n){var r=n(3036),o=n(1441),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5353:function(t,e,n){var r=n(9859),o=n(8400),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},3036:function(t,e,n){var r=n(4231),o=n(5353);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE",source:"https://github.com/zloirock/core-js"})},4860:function(t,e,n){var r=n(6358),o=n(4229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3231:function(t,e,n){var r=n(3329),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},905:function(t,e,n){var r=n(9337),o=n(8885);t.exports=function(t){return r(o(t))}},3329:function(t,e,n){var r=n(917);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},4237:function(t,e,n){var r=n(3329),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},2991:function(t,e,n){var r=n(8885),o=Object;t.exports=function(t){return o(r(t))}},2066:function(t,e,n){var r=n(266),o=n(5052),i=n(9395),s=n(5300),a=n(2914),c=n(95),u=TypeError,p=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=s(t,p);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},9310:function(t,e,n){var r=n(2066),o=n(9395);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},9821:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},1441:function(t,e,n){var r=n(5968),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},6969:function(t,e,n){var r=n(4860);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7137:function(t,e,n){var r=n(7400),o=n(4229);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1180:function(t,e,n){var r=n(9859),o=n(6733),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},95:function(t,e,n){var r=n(9859),o=n(3036),i=n(8270),s=n(1441),a=n(4860),c=n(6969),u=o("wks"),p=r.Symbol,f=p&&p.for,l=c?p:p&&p.withoutSetter||s;t.exports=function(t){if(!i(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&i(p,t)?u[t]=p[t]:u[t]=c&&f?f(e):l(e)}return u[t]}},9529:function(t,e,n){"use strict";var r=n(3103),o=n(9540).includes,i=n(4229),s=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}},function(t){var e;e=2026,t(t.s=e)}]); \ No newline at end of file
modules/system/assets/js/snowboard/main/InnerProxyHandler.js+43 −0 added@@ -0,0 +1,43 @@ +/** + * 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); + }, +};
modules/system/assets/js/snowboard/main/PluginLoader.js+25 −5 modified@@ -1,5 +1,6 @@ import PluginBase from '../abstracts/PluginBase'; import Singleton from '../abstracts/Singleton'; +import InnerProxyHandler from './InnerProxyHandler'; /** * Plugin loader class. @@ -22,13 +23,28 @@ export default class PluginLoader { */ constructor(name, snowboard, instance) { this.name = name; - this.snowboard = snowboard; + 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 = instance.prototype instanceof Singleton; - this.initialised = instance.prototype instanceof PluginBase; + 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); } /** @@ -162,7 +178,11 @@ export default class PluginLoader { * @returns {boolean} */ isInitialised() { - return this.initialised; + if (!this.isSingleton()) { + return true; + } + + return this.singleton.initialised; } /** @@ -179,7 +199,7 @@ export default class PluginLoader { newInstance.detach = () => this.instances.splice(this.instances.indexOf(newInstance), 1); newInstance.construct(...parameters); this.instances.push(newInstance); - this.initialised = true; + this.singleton.initialised = true; } /**
modules/system/assets/js/snowboard/main/ProxyHandler.js+25 −0 added@@ -0,0 +1,25 @@ +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); + }, +};
modules/system/assets/js/snowboard/main/Snowboard.js+23 −12 modified@@ -31,9 +31,17 @@ export default class Snowboard { this.plugins = {}; this.listeners = {}; this.foundBaseUrl = null; - this.domReady = false; - + 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(); @@ -55,6 +63,11 @@ export default class Snowboard { 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); } /** @@ -79,7 +92,7 @@ export default class Snowboard { this.initialiseSingletons(); } this.globalEvent('ready'); - this.domReady = true; + this.readiness.dom = true; }); } @@ -124,9 +137,6 @@ export default class Snowboard { } this.plugins[lowerName] = new PluginLoader(lowerName, this, instance); - const callback = (...parameters) => this.plugins[lowerName].getInstance(...parameters); - this[name] = callback; - this[lowerName] = callback; this.debug(`Plugin "${name}" registered`); @@ -139,7 +149,7 @@ export default class Snowboard { && plugin.dependenciesFulfilled() && plugin.hasMethod('listens') && Object.keys(plugin.callMethod('listens')).includes('ready') - && this.domReady + && this.readiness.dom ) { const readyMethod = plugin.callMethod('listens').ready; plugin.callMethod(readyMethod); @@ -213,11 +223,13 @@ export default class Snowboard { * @returns {PluginLoader} */ getPlugin(name) { - if (!this.hasPlugin(name)) { - throw new Error(`No plugin called "${name}" has been registered.`); + const lowerName = name.toLowerCase(); + + if (!this.hasPlugin(lowerName)) { + throw new Error(`No plugin called "${lowerName}" has been registered.`); } - return this.plugins[name]; + return this.plugins[lowerName]; } /** @@ -263,7 +275,7 @@ export default class Snowboard { * @param {Function} callback */ ready(callback) { - if (this.domReady) { + if (this.readiness.dom) { callback(); } @@ -524,7 +536,6 @@ export default class Snowboard { this.logMessage('rgb(45, 167, 199)', false, message, ...parameters); } - /** * Log a debug message. *
modules/system/assets/js/snowboard/snowboard.base.debug.js+5 −1 modified@@ -1,7 +1,11 @@ import Snowboard from './main/Snowboard'; +import ProxyHandler from './main/ProxyHandler'; ((window) => { - const snowboard = new Snowboard(true, true); + const snowboard = new Proxy( + new Snowboard(true, true), + ProxyHandler, + ); // Cover all aliases window.snowboard = snowboard;
modules/system/assets/js/snowboard/snowboard.base.js+5 −1 modified@@ -1,7 +1,11 @@ import Snowboard from './main/Snowboard'; +import ProxyHandler from './main/ProxyHandler'; ((window) => { - const snowboard = new Snowboard(); + const snowboard = new Proxy( + new Snowboard(), + ProxyHandler, + ); // Cover all aliases window.snowboard = snowboard;
modules/system/.eslintrc.json+5 −1 modified@@ -33,5 +33,9 @@ "math": "always" }], "vue/multi-word-component-names": ["off"] - } + }, + "ignorePatterns": [ + "tests/js", + "**/build/*.js" + ] }
modules/system/tests/js/cases/snowboard/main/PluginLoader.test.js+97 −0 modified@@ -34,4 +34,101 @@ describe('PluginLoader class', function () { } ); }); + + 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); + } + ); + }); });
modules/system/tests/js/cases/snowboard/main/Snowboard.test.js+153 −22 modified@@ -42,6 +42,49 @@ describe('Snowboard framework', function () { ); }); + 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() @@ -59,16 +102,22 @@ describe('Snowboard framework', function () { try { // Check plugin caller - expect(Snowboard.hasPlugin('test')).toBe(true); + 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', 'test']) + expect.arrayContaining(['jsonparser', 'sanitizer', 'testplugin']) ); - expect(Snowboard.test).toEqual(expect.any(Function)); - const instance = Snowboard.test(); + const instance = Snowboard.testPlugin(); // Check plugin injected methods - expect(instance.snowboard).toBe(Snowboard); + 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 @@ -77,20 +126,20 @@ describe('Snowboard framework', function () { expect(instance.testMethod()).toEqual('Tested'); // Check multiple instances - const instanceOne = Snowboard.test(); + const instanceOne = Snowboard.testPlugin(); instanceOne.changed = true; - const instanceTwo = Snowboard.test(); + const instanceTwo = Snowboard.testPlugin(); expect(instanceOne).not.toEqual(instanceTwo); - const factory = Snowboard.getPlugin('test'); + const factory = Snowboard.getPlugin('testPlugin'); expect(factory.getInstances()).toEqual([instance, instanceOne, instanceTwo]); // Remove plugin - Snowboard.removePlugin('test'); - expect(Snowboard.hasPlugin('test')).toEqual(false); + Snowboard.removePlugin('testPlugin'); + expect(Snowboard.hasPlugin('testPlugin')).toEqual(false); expect(dom.window.Snowboard.getPluginNames()).toEqual( expect.arrayContaining(['jsonparser', 'sanitizer']) ); - expect(Snowboard.test).not.toBeDefined(); + expect(Snowboard.testPlugin).not.toBeDefined(); done(); } catch (error) { @@ -119,17 +168,24 @@ describe('Snowboard framework', function () { const Snowboard = dom.window.Snowboard; try { + expect('testPlugin' in Snowboard).toEqual(false); + expect('testSingleton' in Snowboard).toEqual(true); + // Check plugin caller - expect(Snowboard.hasPlugin('test')).toBe(true); + expect(Snowboard.hasPlugin('testSingleton')).toBe(true); expect(Snowboard.getPluginNames()).toEqual( - expect.arrayContaining(['jsonparser', 'sanitizer', 'test']) + expect.arrayContaining(['jsonparser', 'sanitizer', 'testsingleton']) ); - expect(Snowboard.test).toEqual(expect.any(Function)); + expect(Snowboard.testSingleton).toEqual(expect.any(Function)); - const instance = Snowboard.test(); + const instance = Snowboard.testSingleton(); // Check plugin injected methods - expect(instance.snowboard).toBe(Snowboard); + 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 @@ -138,20 +194,20 @@ describe('Snowboard framework', function () { expect(instance.testMethod()).toEqual('Tested'); // Check multiple instances (these should all be the same as this instance is a singleton) - const instanceOne = Snowboard.test(); + const instanceOne = Snowboard.testSingleton(); instanceOne.changed = true; - const instanceTwo = Snowboard.test(); + const instanceTwo = Snowboard.testSingleton(); expect(instanceOne).toEqual(instanceTwo); - const factory = Snowboard.getPlugin('test'); + const factory = Snowboard.getPlugin('testSingleton'); expect(factory.getInstances()).toEqual([instance]); // Remove plugin - Snowboard.removePlugin('test'); - expect(Snowboard.hasPlugin('test')).toEqual(false); + Snowboard.removePlugin('testSingleton'); + expect(Snowboard.hasPlugin('testSingleton')).toEqual(false); expect(dom.window.Snowboard.getPluginNames()).toEqual( expect.arrayContaining([ 'jsonparser', 'sanitizer']) ); - expect(Snowboard.test).not.toBeDefined(); + expect(Snowboard.testSingleton).not.toBeDefined(); done(); } catch (error) { @@ -380,4 +436,79 @@ describe('Snowboard framework', function () { } ); }); + + 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); + }, + ); + }); });
modules/system/tests/js/fixtures/framework/TestPlugin.js+1 −1 modified@@ -7,5 +7,5 @@ } } - Snowboard.addPlugin('test', TestPlugin); + Snowboard.addPlugin('testPlugin', TestPlugin); })(window.Snowboard);
modules/system/tests/js/fixtures/framework/TestSingleton.js+1 −1 modified@@ -7,5 +7,5 @@ } } - Snowboard.addPlugin('test', TestSingleton); + Snowboard.addPlugin('testSingleton', TestSingleton); })(window.Snowboard);
modules/system/tests/js/fixtures/framework/TestSingletonWithDependency.js+4 −0 modified@@ -19,6 +19,10 @@ testMethod() { return 'Tested'; } + + dependencyTest() { + return this.snowboard.testDependencyOne().testMethod(); + } } Snowboard.addPlugin('testSingleton', TestSingletonWithDependency);
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-3fh5-q6fg-w28qghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-39357ghsaADVISORY
- github.com/wintercms/winter/commit/2a13faf99972e84c9661258f16c4750fa99d29a1ghsaWEB
- github.com/wintercms/winter/commit/bce4b59584abf961e9400af3d7a4fd7638e26c7fghsaWEB
- github.com/wintercms/winter/releases/tag/v1.1.10ghsaWEB
- github.com/wintercms/winter/releases/tag/v1.2.1ghsaWEB
- github.com/wintercms/winter/security/advisories/GHSA-3fh5-q6fg-w28qghsaWEB
News mentions
0No linked articles in our index yet.