digitalmarketplace-frontend
Version:
Digital Marketplace Frontend contains assets and components used in Digital Marketplace projects
2 lines • 109 kB
JavaScript
const version="3.8.0",loadGoogleTagManager=()=>((e,i,o,w,$)=>{e[w]=e[w]||[],e[w].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});const x=i.getElementsByTagName(o)[0],O=i.createElement(o);O.async=!0,O.src="https://www.googletagmanager.com/gtm.js?id="+$,x.parentNode.insertBefore(O,x)})(window,document,"script","dataLayer","GTM-WCGFX3GW");function assign(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var w in o)e[w]=o[w]}return e}var e,i=function init(e,i){function set(o,w,$){if("undefined"!=typeof document){"number"==typeof($=assign({},i,$)).expires&&($.expires=new Date(Date.now()+864e5*$.expires)),$.expires&&($.expires=$.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var x="";for(var O in $)$[O]&&(x+="; "+O,!0!==$[O]&&(x+="="+$[O].split(";")[0]));return document.cookie=o+"="+e.write(w,o)+x}}return Object.create({set:set,get:function(i){if("undefined"!=typeof document&&(!arguments.length||i)){for(var o=document.cookie?document.cookie.split("; "):[],w={},$=0;$<o.length;$++){var x=o[$].split("="),O=x.slice(1).join("=");try{var A=decodeURIComponent(x[0]);if(w[A]=e.read(O,A),i===A)break}catch(B){}}return i?w[i]:w}},remove:function(e,i){set(e,"",assign({},i,{expires:-1}))},withAttributes:function(e){return init(this.converter,assign({},this.attributes,e))},withConverter:function(e){return init(assign({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(e)}})}({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:"/"});!function(e){e.GRANTED="granted",e.NOT_GRANTED="not granted"}(e||(e={}));const getGrantedText=i=>i?e.GRANTED:e.NOT_GRANTED,o=[{cookieName:"usage",cookiePrefixes:["_ga","_gi"]},{cookieName:"glassbox",cookiePrefixes:["_cls"]}],w=[".marketplace.team",".digitalmarketplace.service.gov.uk","www.applytosupply.digitalmarketplace.service.gov.uk"],getCookiePreferences=()=>JSON.parse(i.get("cookie_preferences_dmp")??'{"usage":false,"glassbox":false}'),setCookiePreferences=o=>{const w=getCookiePreferences();w.usage=o,w.settings_viewed=!0,i.set("cookie_preferences_dmp",JSON.stringify(w),{expires:365}),(i=>{window.dataLayer.push({event:"gtm_consent_update",usage_consent:getGrantedText(i.usage),glassbox_consent:getGrantedText(i.glassbox),marketing_consent:e.NOT_GRANTED})})(w),removeUnwantedCookies()},removeUnwantedCookies=()=>{const e=Object.keys(i.get()),$=["digitalmarketplace_cookie_settings_viewed","digitalmarketplace_google_analytics_enabled","digitalmarketplace_cookie_options_v1","dm_cookies_policy"],x=getCookiePreferences(),O=[];o.forEach((e=>{x[e.cookieName]||O.push(...e.cookiePrefixes)}));for(let i=0;i<e.length;i++){const o=e[i];O.some((e=>o.startsWith(e)))&&$.push(o)}("localhost"===window.location.hostname?w.concat(["localhost"]):w).forEach((e=>{$.forEach((o=>{i.remove(o,{path:"/",domain:e})}))}))},initGoogleAnalytics=()=>{loadGoogleTagManager(),removeUnwantedCookies()};function _arrayLikeToArray(e,i){(null==i||i>e.length)&&(i=e.length);for(var o=0,w=Array(i);o<i;o++)w[o]=e[o];return w}function _createClass(e,i,o){return i&&function(e,i){for(var o=0;o<i.length;o++){var w=i[o];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(e,_toPropertyKey(w.key),w)}}(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _createForOfIteratorHelperLoose(e,i){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return(o=o.call(e)).next.bind(o);if(Array.isArray(e)||(o=function(e,i){if(e){if("string"==typeof e)return _arrayLikeToArray(e,i);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,i):void 0}}(e))||i){o&&(e=o);var w=0;return function(){return w>=e.length?{done:!0}:{done:!1,value:e[w++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inheritsLoose(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,_setPrototypeOf(e,i)}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _setPrototypeOf(e,i){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,i){return e.__proto__=i,e},_setPrototypeOf(e,i)}function _toPropertyKey(e){var i=function(e,i){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var w=o.call(e,i);if("object"!=typeof w)return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof i?i:i+""}function _wrapNativeSuper(e){var i="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(i){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,Wrapper)}function Wrapper(){return function(e,i,o){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var w=[null];w.push.apply(w,i);var $=new(e.bind.apply(e,w));return o&&_setPrototypeOf($,o.prototype),$}(e,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,e)},_wrapNativeSuper(e)}function isObject(e){return!!e&&"object"==typeof e&&!function(e){return Array.isArray(e)}(e)}function formatErrorMessage(e,i){return e.moduleName+": "+i}var x=function(e){function GOVUKFrontendError(){for(var i,o=arguments.length,w=new Array(o),$=0;$<o;$++)w[$]=arguments[$];return(i=e.call.apply(e,[this].concat(w))||this).name="GOVUKFrontendError",i}return _inheritsLoose(GOVUKFrontendError,e),GOVUKFrontendError}(_wrapNativeSuper(Error)),O=function(e){function SupportError(i){var o;void 0===i&&(i=document.body);var w="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";return(o=e.call(this,i?w:'GOV.UK Frontend initialised without `<script type="module">`')||this).name="SupportError",o}return _inheritsLoose(SupportError,e),SupportError}(x),A=function(e){function ConfigError(){for(var i,o=arguments.length,w=new Array(o),$=0;$<o;$++)w[$]=arguments[$];return(i=e.call.apply(e,[this].concat(w))||this).name="ConfigError",i}return _inheritsLoose(ConfigError,e),ConfigError}(x),B=function(e){function ElementError(i){var o,w="string"==typeof i?i:"";if("object"==typeof i){var $=i.component,x=i.identifier,O=i.element,A=i.expectedType;w=x,w=formatErrorMessage($,w+=O?" is not of type "+(null!=A?A:"HTMLElement"):" not found")}return(o=e.call(this,w)||this).name="ElementError",o}return _inheritsLoose(ElementError,e),ElementError}(x),Q=function(e){function InitError(i){var o,w="string"==typeof i?i:formatErrorMessage(i,"Root element (`$root`) already initialised");return(o=e.call(this,w)||this).name="InitError",o}return _inheritsLoose(InitError,e),InitError}(x),W=function(){function Component(e){this._$root=void 0;var i=this.constructor;if("string"!=typeof i.moduleName)throw new Q("`moduleName` not defined in component");if(!(e instanceof i.elementType))throw new B({element:e,component:i,identifier:"Root element (`$root`)",expectedType:i.elementType.name});this._$root=e,i.checkSupport(),this.checkInitialised();var o=i.moduleName;this.$root.setAttribute("data-"+o+"-init","")}return Component.prototype.checkInitialised=function(){var e=this.constructor,i=e.moduleName;if(i&&function(e,i){return e instanceof HTMLElement&&e.hasAttribute("data-"+i+"-init")}(this.$root,i))throw new Q(e)},Component.checkSupport=function(){if(void 0===e&&(e=document.body),!e||!e.classList.contains("govuk-frontend-supported"))throw new O;var e},_createClass(Component,[{key:"$root",get:function(){return this._$root}}])}();W.elementType=HTMLElement;var K=Symbol.for("configOverride"),Y=function(e){function ConfigurableComponent(i,o){var w;(w=e.call(this,i)||this)._config=void 0;var $=w.constructor;if(!isObject($.defaults))throw new A(formatErrorMessage($,"Config passed as parameter into constructor but no defaults defined"));var x=function(e,i){if(!isObject(e.schema))throw new A(formatErrorMessage(e,"Config passed as parameter into constructor but no schema defined"));for(var o={},w=Object.entries(e.schema.properties),$=0,x=w;$<x.length;$++){var O=x[$],B=O[0],Q=O[1],W=B.toString();W in i&&(o[W]=normaliseString(i[W],Q)),"object"===(null==Q?void 0:Q.type)&&(o[W]=extractConfigByNamespace(e.schema,i,B))}return o}($,w._$root.dataset);return w._config=mergeConfigs($.defaults,null!=o?o:{},w[K](x),x),w}return _inheritsLoose(ConfigurableComponent,e),ConfigurableComponent.prototype[K]=function(e){return{}},_createClass(ConfigurableComponent,[{key:"config",get:function(){return this._config}}])}(W);function normaliseString(e,i){var o,w=e?e.trim():"",$=null==i?void 0:i.type;switch($||(["true","false"].includes(w)&&($="boolean"),w.length>0&&isFinite(Number(w))&&($="number")),$){case"boolean":o="true"===w;break;case"number":o=Number(w);break;default:o=e}return o}function mergeConfigs(){for(var e={},i=arguments.length,o=new Array(i),w=0;w<i;w++)o[w]=arguments[w];for(var $=0,x=o;$<x.length;$++)for(var O=x[$],A=0,B=Object.keys(O);A<B.length;A++){var Q=B[A],W=e[Q],K=O[Q];isObject(W)&&isObject(K)?e[Q]=mergeConfigs(W,K):e[Q]=K}return e}function extractConfigByNamespace(e,i,o){var w,$=e.properties[o];if("object"===(null==$?void 0:$.type)){for(var x=((w={})[o]={},w),O=0,A=Object.entries(i);O<A.length;O++)for(var B,Q=A[O],W=Q[0],K=Q[1],Y=x,Z=W.split("."),X=_createForOfIteratorHelperLoose(Z.entries());!(B=X()).done;){var J=B.value,tt=J[0],et=J[1];isObject(Y)&&(tt<Z.length-1?(isObject(Y[et])||(Y[et]={}),Y=Y[et]):W!==o&&(Y[et]=normaliseString(K)))}return x[o]}}var Z=function(){function I18n(e,i){var o;void 0===e&&(e={}),void 0===i&&(i={}),this.translations=void 0,this.locale=void 0,this.translations=e,this.locale=null!=(o=i.locale)?o:document.documentElement.lang||"en"}var e=I18n.prototype;return e.t=function(e,i){if(!e)throw new Error("i18n: lookup key missing");var o=this.translations[e];if("number"==typeof(null==i?void 0:i.count)&&"object"==typeof o){var w=o[this.getPluralSuffix(e,i.count)];w&&(o=w)}if("string"==typeof o){if(o.match(/%{(.\S+)}/)){if(!i)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(o,i)}return o}return e},e.replacePlaceholders=function(e,i){var o=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,(function(e,w){if(Object.prototype.hasOwnProperty.call(i,w)){var $=i[w];return!1===$||"number"!=typeof $&&"string"!=typeof $?"":"number"==typeof $?o?o.format($):""+$:$}throw new Error("i18n: no data found to replace "+e+" placeholder in string")}))},e.hasIntlPluralRulesSupport=function(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)},e.getPluralSuffix=function(e,i){if(i=Number(i),!isFinite(i))return"other";var o=this.translations[e],w=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(i):this.selectPluralFormUsingFallbackRules(i);if("object"==typeof o){if(w in o)return w;if("other"in o)return console.warn('i18n: Missing plural form ".'+w+'" for "'+this.locale+'" locale. Falling back to ".other".'),"other"}throw new Error('i18n: Plural form ".other" is required for "'+this.locale+'" locale')},e.selectPluralFormUsingFallbackRules=function(e){e=Math.abs(Math.floor(e));var i=this.getPluralRulesForLocale();return i?I18n.pluralRules[i](e):"other"},e.getPluralRulesForLocale=function(){var e=this.locale.split("-")[0];for(var i in I18n.pluralRulesMap){var o=I18n.pluralRulesMap[i];if(o.includes(this.locale)||o.includes(e))return i}},I18n}();Z.pluralRulesMap={arabic:["ar"],chinese:["my","zh","id","ja","jv","ko","ms","th","vi"],french:["hy","bn","fr","gu","hi","fa","pa","zu"],german:["af","sq","az","eu","bg","ca","da","nl","en","et","fi","ka","de","el","hu","lb","no","so","sw","sv","ta","te","tr","ur"],irish:["ga"],russian:["ru","uk"],scottish:["gd"],spanish:["pt-PT","it","es"],welsh:["cy"]},Z.pluralRules={arabic:function(e){return 0===e?"zero":1===e?"one":2===e?"two":e%100>=3&&e%100<=10?"few":e%100>=11&&e%100<=99?"many":"other"},chinese:function(){return"other"},french:function(e){return 0===e||1===e?"one":"other"},german:function(e){return 1===e?"one":"other"},irish:function(e){return 1===e?"one":2===e?"two":e>=3&&e<=6?"few":e>=7&&e<=10?"many":"other"},russian:function(e){var i=e%100,o=i%10;return 1===o&&11!==i?"one":o>=2&&o<=4&&!(i>=12&&i<=14)?"few":0===o||o>=5&&o<=9||i>=11&&i<=14?"many":"other"},scottish:function(e){return 1===e||11===e?"one":2===e||12===e?"two":e>=3&&e<=10||e>=13&&e<=19?"few":"other"},spanish:function(e){return 1===e?"one":e%1e6==0&&0!==e?"many":"other"},welsh:function(e){return 0===e?"zero":1===e?"one":2===e?"two":3===e?"few":6===e?"many":"other"}};var X,J=function(e){function FileUpload(i,o){var w;void 0===o&&(o={}),(w=e.call(this,i,o)||this).$input=void 0,w.$button=void 0,w.$status=void 0,w.i18n=void 0,w.id=void 0,w.$announcements=void 0,w.enteredAnotherElement=void 0;var $,x,O,A=w.$root.querySelector("input");if(null===A)throw new B({component:FileUpload,identifier:'File inputs (`<input type="file">`)'});if("file"!==A.type)throw new B(formatErrorMessage(FileUpload,'File input (`<input type="file">`) attribute (`type`) is not `file`'));if(w.$input=A,w.$input.setAttribute("hidden","true"),!w.$input.id)throw new B({component:FileUpload,identifier:'File input (`<input type="file">`) attribute (`id`)'});w.id=w.$input.id,w.i18n=new Z(w.config.i18n,{locale:($=w.$root,x="lang",O=$.closest("["+x+"]"),O?O.getAttribute(x):null)});var Q=w.findLabel();Q.id||(Q.id=w.id+"-label"),w.$input.id=w.id+"-input";var W=document.createElement("button");W.classList.add("govuk-file-upload-button"),W.type="button",W.id=w.id,W.classList.add("govuk-file-upload-button--empty");var K=w.$input.getAttribute("aria-describedby");K&&W.setAttribute("aria-describedby",K);var Y=document.createElement("span");Y.className="govuk-body govuk-file-upload-button__status",Y.setAttribute("aria-live","polite"),Y.innerText=w.i18n.t("noFileChosen"),W.appendChild(Y);var X=document.createElement("span");X.className="govuk-visually-hidden",X.innerText=", ",X.id=w.id+"-comma",W.appendChild(X);var J=document.createElement("span");J.className="govuk-file-upload-button__pseudo-button-container";var tt=document.createElement("span");tt.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",tt.innerText=w.i18n.t("chooseFilesButton"),J.appendChild(tt),J.insertAdjacentText("beforeend"," ");var et=document.createElement("span");return et.className="govuk-body govuk-file-upload-button__instruction",et.innerText=w.i18n.t("dropInstruction"),J.appendChild(et),W.appendChild(J),W.setAttribute("aria-labelledby",Q.id+" "+X.id+" "+W.id),W.addEventListener("click",w.onClick.bind(w)),W.addEventListener("dragover",(function(e){e.preventDefault()})),w.$root.insertAdjacentElement("afterbegin",W),w.$input.setAttribute("tabindex","-1"),w.$input.setAttribute("aria-hidden","true"),w.$button=W,w.$status=Y,w.$input.addEventListener("change",w.onChange.bind(w)),w.updateDisabledState(),w.observeDisabledState(),w.$announcements=document.createElement("span"),w.$announcements.classList.add("govuk-file-upload-announcements"),w.$announcements.classList.add("govuk-visually-hidden"),w.$announcements.setAttribute("aria-live","assertive"),w.$root.insertAdjacentElement("afterend",w.$announcements),w.$button.addEventListener("drop",w.onDrop.bind(w)),document.addEventListener("dragenter",w.updateDropzoneVisibility.bind(w)),document.addEventListener("dragenter",(function(){w.enteredAnotherElement=!0})),document.addEventListener("dragleave",(function(){w.enteredAnotherElement||w.$button.disabled||(w.hideDraggingState(),w.$announcements.innerText=w.i18n.t("leftDropZone")),w.enteredAnotherElement=!1})),w}_inheritsLoose(FileUpload,e);var i=FileUpload.prototype;return i.updateDropzoneVisibility=function(e){this.$button.disabled||e.target instanceof Node&&(this.$root.contains(e.target)?e.dataTransfer&&isContainingFiles(e.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))},i.showDraggingState=function(){this.$button.classList.add("govuk-file-upload-button--dragging")},i.hideDraggingState=function(){this.$button.classList.remove("govuk-file-upload-button--dragging")},i.onDrop=function(e){e.preventDefault(),e.dataTransfer&&isContainingFiles(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())},i.onChange=function(){var e=this.$input.files.length;0===e?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===e?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:e}),this.$button.classList.remove("govuk-file-upload-button--empty"))},i.findLabel=function(){var e=document.querySelector('label[for="'+this.$input.id+'"]');if(!e)throw new B({component:FileUpload,identifier:"Field label (`<label for="+this.$input.id+">`)"});return e},i.onClick=function(){this.$input.click()},i.observeDisabledState=function(){var e=this;new MutationObserver((function(i){for(var o,w=_createForOfIteratorHelperLoose(i);!(o=w()).done;){var $=o.value;"attributes"===$.type&&"disabled"===$.attributeName&&e.updateDisabledState()}})).observe(this.$input,{attributes:!0})},i.updateDisabledState=function(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-drop-zone--disabled",this.$button.disabled)},FileUpload}(Y);function isContainingFiles(e){var i=0===e.types.length,o=e.types.some((function(e){return"Files"===e}));return i||o}J.moduleName="govuk-file-upload",J.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),J.schema=Object.freeze({properties:{i18n:{type:"object"}}});class ComplianceCommunicationAttachmentListRowFileInput{$dropZone;$input;$label;$hint;$button;$comma;$announcements;constructor(e,i){const o=e.find(`.govuk-grid-column-one-half:nth-of-type(${i})`);this.$dropZone=o.find(".govuk-drop-zone"),this.$input=o.find("input"),this.$label=o.find(".govuk-label"),this.$hint=o.find("div.govuk-hint"),this.$button=o.find("button"),this.$comma=o.find("button > span.govuk-visually-hidden"),this.$announcements=o.find("span.govuk-file-upload-announcements")}updateIndex(e){const i=this.$input.attr("name").replace(/\d+/,e.toString()),o=`input-${i}`;this.$button.length?(this.$label.attr("for",o),this.$label.attr("id",`${o}-label`),this.$hint.attr("id",`${o}-hint`),this.$input.attr("id",`${o}-input`),this.$input.attr("name",i),this.$input.attr("aria-describedby",`${o}-hint`),this.$button.attr("id",o),this.$button.attr("aria-describedby",`${o}-hint`),this.$button.attr("aria-labelledby",`${o}-label ${o}-comma ${o}`),this.$comma.attr("id",`${o}-comma`)):(this.$label.attr("for",o),this.$hint.attr("id",`${o}-hint`),this.$input.attr("id",o),this.$input.attr("name",i),this.$input.attr("aria-describedby",`${o}-hint`))}makeInteractable(){if(!this.$button.length)return new J(this.$dropZone.get(0))}resetHtml(){this.$label.removeAttr("id"),this.$dropZone.removeAttr("data-govuk-file-upload-init"),this.$button.remove();const e=this.$input.attr("id");this.$input.removeAttr("hidden"),this.$input.removeAttr("aria-hidden"),this.$input.attr("id",e.substring(0,e.length-6)),this.$announcements.remove()}}class ComplianceCommunicationAttachmentListRequiredInput{$requiredSection;$input;$label;constructor(e){this.$requiredSection=e.find(".dm-compliance-communication__attachments-item-required"),this.$input=this.$requiredSection.find(".govuk-checkboxes__item > input"),this.$label=this.$requiredSection.find(".govuk-checkboxes__item > .govuk-label")}isChecked(){return this.$input.is(":checked")}updateIndex(e){const i=this.$input.attr("name").replace(/\d+/,e.toString()),o=`input-${i}`;this.$label.attr("for",o),this.$input.attr("id",o),this.$input.attr("name",i)}checkRow(){this.$requiredSection.toggleClass("govuk-visually-hidden",!0),this.$input.prop("checked",!0),this.$input.attr("tabindex",-1),this.$input.attr("tabindex",-1)}}class ComplianceCommunicationAttachmentListRowRemoveButton{attachmentListRow;$button;$removeButtonCounter;constructor(e,i){this.attachmentListRow=e,this.$button=i.find(".dm-compliance-communication__attachments-item-remove"),this.$removeButtonCounter=this.$button.find(".dm-compliance-communication__attachments-item-remove-counter")}init(){this.toggleVisibility(!0),this.$button.on("click",(()=>{this.attachmentListRow.removeRow()}))}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e),e?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}updateIndex(e){this.$removeButtonCounter.text(e+1)}}class ComplianceCommunicationAttachmentListRow{$row;attachmentList;index;$legendCounter;attachmentListRowFileInput;attachmentListRowRequiredInput;attachmentListRowRemoveButton;constructor(e,i,o){this.$row=o,this.attachmentList=e,this.index=i,this.$legendCounter=this.$row.find(".dm-compliance-communication__attachments-item-legend-counter"),this.attachmentListRowFileInput=new ComplianceCommunicationAttachmentListRowFileInput(o,1),this.attachmentListRowRequiredInput=new ComplianceCommunicationAttachmentListRequiredInput(o),this.attachmentListRowRemoveButton=new ComplianceCommunicationAttachmentListRowRemoveButton(this,o)}init(){this.attachmentListRowRemoveButton.init(),this.attachmentListRowFileInput.makeInteractable(),this.attachmentListRowRequiredInput.checkRow()}updateIndex(e){this.index=e,this.attachmentListRowFileInput.updateIndex(e),this.attachmentListRowRequiredInput.updateIndex(e),this.attachmentListRowRemoveButton.updateIndex(e),this.$legendCounter.text(e+1)}removeRow(){this.attachmentList.removeRow(this.index),this.deleteRow()}deleteRow(){this.$row.remove()}toggleRemoveButtonVisibility(e){this.attachmentListRowRemoveButton.toggleVisibility(e)}isRowChecked(){return this.attachmentListRowRequiredInput.isChecked()}}class ComplianceCommunicationAttachmentListAddButton{attachmentList;$button;$buttonCounter;constructor(e,i){this.attachmentList=e,this.$button=i,this.$buttonCounter=i.find(".dm-compliance-communication__attachments__js-remaining-counter")}init(e){this.$button.on("click",(()=>{this.attachmentList.addRow()})),this.updateButtonText(this.attachmentList.maxNumberOfAttachments-e)}updateButtonText(e){this.$buttonCounter.text(e)}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e),e?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}}class ComplianceCommunicationAttachments{static moduleName="dm-compliance-communication-attachments";$attachmentList;$attachmentListItems;attachmentListRows;attachmentListTemplateRow;attachmentListAddButton;maxNumberOfAttachments;constructor(e){this.$attachmentList=e,this.$attachmentListItems=this.$attachmentList.find(".dm-compliance-communication__attachments-items"),this.attachmentListRows=this.$attachmentListItems.find(".dm-compliance-communication__attachments-item").get().map(((e,i)=>new ComplianceCommunicationAttachmentListRow(this,i,$(e)))),this.attachmentListTemplateRow=new ComplianceCommunicationAttachmentListRow(this,99,this.$attachmentList.find(".dm-compliance-communication__attachments-item-template > .dm-compliance-communication__attachments-item")),this.attachmentListAddButton=new ComplianceCommunicationAttachmentListAddButton(this,this.$attachmentList.find(".dm-compliance-communication__attachments-add")),this.maxNumberOfAttachments=this.$attachmentList.data("maxNumberOfAttachments")}init(){const e=this.attachmentListRows.map((e=>e.isRowChecked()));let i;i=e.every((e=>!e))?0:e.indexOf(!1),i>=0&&(this.attachmentListRows.slice(i).forEach((e=>e.deleteRow())),this.attachmentListRows.splice(i)),this.attachmentListAddButton.init(this.attachmentListRows.length),this.attachmentListRows.forEach((e=>e.init())),this.attachmentListTemplateRow.attachmentListRowFileInput.resetHtml(),this.updateIfMinRows(),this.updateAttachmentButton()}removeRow(e){this.attachmentListRows.splice(e,1),this.attachmentListRows.slice(e).forEach(((i,o)=>{i.updateIndex(e+o)})),this.updateIfMinRows(),this.updateAttachmentButton(),e>0?this.focusOnRow(e):this.attachmentListAddButton.$button.focus()}addRow(){const e=this.attachmentListRows.length;if(e<this.maxNumberOfAttachments){const i=this.attachmentListTemplateRow.$row.clone(),o=new ComplianceCommunicationAttachmentListRow(this,e,i);o.updateIndex(e),this.attachmentListRows.push(o),this.$attachmentListItems.append(i),this.attachmentListRows[e].init(),this.updateIfMinRows(),this.updateAttachmentButton(),this.focusOnRow(e)}}updateIfMinRows(){0!==this.attachmentListRows.length&&this.attachmentListRows[0].toggleRemoveButtonVisibility(!0)}updateAttachmentButton(){this.attachmentListRows.length===this.maxNumberOfAttachments?this.attachmentListAddButton.toggleVisibility(!1):(this.attachmentListAddButton.toggleVisibility(!0),this.attachmentListAddButton.updateButtonText(this.maxNumberOfAttachments-this.attachmentListRows.length))}focusOnRow(e){const i=this.attachmentListRows.length;let o=e;e>=i&&(o=i-1),this.attachmentListRows[o].attachmentListRowFileInput.$button.focus()}}class CookieBanner{static moduleName="dm-cookie-banner";$module;$cookieBannerMainContent;$cookieBannerConfirmationContent;$cookieBannerConfirmationMessage;$hideLink;$acceptCookiesLink;$rejectCookiesLink;constructor(e){this.$module=e,this.$cookieBannerMainContent=this.$module.find(".dm-cookie-banner__button--main"),this.$cookieBannerConfirmationContent=this.$module.find(".dm-cookie-banner--selection-made"),this.$cookieBannerConfirmationMessage=this.$module.find(".dm-cookie-banner__confirmation-message"),this.$hideLink=this.$module.find("button[data-hide-cookie-banner]"),this.$acceptCookiesLink=this.$module.find("button[data-accept-cookies=true]"),this.$rejectCookiesLink=this.$module.find("button[data-accept-cookies=false]")}init(){this.$hideLink.on("click",(e=>{this.hideCookieMessage(e)})),this.$acceptCookiesLink.on("click",(()=>{this.setCookieConsent(!0)})),this.$rejectCookiesLink.on("click",(()=>{this.setCookieConsent(!1)})),this.showCookieMessage()}setCookieConsent(e){setCookiePreferences(e),this.showConfirmationMessage(e),this.$cookieBannerConfirmationContent.trigger("focus")}showCookieMessage(){const e=getCookiePreferences();this.$module&&!e.settings_viewed&&this.$module.css("display","block")}hideCookieMessage(e){this.$module.css("display","none"),e.target&&e.preventDefault()}showConfirmationMessage(e){const i=e?"You’ve accepted analytics cookies.":"You told us not to use analytics cookies.";this.$cookieBannerMainContent.attr("hidden","hidden"),this.$cookieBannerConfirmationMessage.prepend(i),this.$cookieBannerConfirmationContent.removeAttr("hidden")}}class CookieSettings{static moduleName="dm-cookie-settings";$moudle;$radioButtonAnalyticsYes;$radioButtonAnalyticsNo;$confirmationMessage;$previousPageLink;$errorSummary;$formGroup;$warningMessage;$cookieBanner;constructor(e){this.$moudle=e,this.$radioButtonAnalyticsYes=this.$moudle.find("input[name=cookies-analytics][value=On]"),this.$radioButtonAnalyticsNo=this.$moudle.find("input[name=cookies-analytics][value=Off]"),this.$confirmationMessage=$("#dm-cookie-settings-confirmation"),this.$previousPageLink=$(".dm-cookie-settings__prev-page"),this.$errorSummary=$("#dm-cookie-settings-error"),this.$formGroup=this.$moudle.find(".govuk-form-group"),this.$warningMessage=$("#dm-cookie-settings-warning"),this.$cookieBanner=$(".dm-cookie-banner")}init(){this.$moudle.on("submit",(e=>{this.submitSettingsForm(e)})),this.hideCookieBanner(),this.setInitialFormValues()}setInitialFormValues(){const e=getCookiePreferences();if(!e.settings_viewed)return;let i;this.hideWarningMessage(),i=e.usage?this.$radioButtonAnalyticsYes:this.$radioButtonAnalyticsNo,i.prop("checked",!0)}submitSettingsForm(e){let i;e.preventDefault();for(const o of this.$moudle.serializeArray())if("cookies-analytics"===o.name){i="On"===o.value;break}void 0!==i?(setCookiePreferences(i),this.hideWarningMessage(),this.hideError(),this.showConfirmationMessage()):this.showError()}showConfirmationMessage(){const e=CookieSettings.getReferrerLink();document.body.scrollTop=document.documentElement.scrollTop=0,e&&e!==document.location.pathname?(this.$previousPageLink.attr("href",e),this.$previousPageLink.css("display","block")):this.$previousPageLink.css("display","none"),this.$confirmationMessage.css("display","block")}showError(){this.$errorSummary.length&&(this.$errorSummary.css("display","block"),document.body.scrollTop=document.documentElement.scrollTop=0),this.showErrorMessage()}showErrorMessage(){this.$formGroup.addClass("govuk-form-group--error");const e=$(document.createElement("p"));e.attr("id","dm-cookie-settings-error-message"),e.addClass("govuk-error-message"),e.html('<span class="govuk-visually-hidden">Error:</span> Select yes to accept analytics cookies'),e.insertBefore("#cookie-settings-1, .govuk-radios--inline")}hideError(){this.$errorSummary.css("display","none"),this.hideErrorMessage()}hideErrorMessage(){this.$moudle.find("#dm-cookie-settings-error-message").css("display","none"),this.$formGroup.removeClass("govuk-form-group--error")}hideWarningMessage(){this.$warningMessage.css("display","none")}hideCookieBanner(){this.$cookieBanner.css("display","none")}static getReferrerLink(){return!!document.referrer&&new URL(document.referrer).pathname}}class ListInput{static moduleName="dm-list-input";static itemContainerClass="dm-list-input__item-container";static hiddenItemClass="dm-list-input__item--hidden";static visibleItemClass="dm-list-input__item--visible";static itemInputClass="dm-list-input__item-input";static itemErrorClass="dm-list-input__item--error";static itemErrorMsgClass="dm-list-input-error-message";static itemCounterClass="dm-list-input__counter";static inputErrorClass="govuk-input--error";static removeButtonClass="dm-list-input__item-remove";static hiddenRemoveButtonClass="dm-list-input__item-remove--hidden";static formGroupErrorClass="govuk-form-group--error";static hiddenAddButtonClass="dm-list-input__item-add--hidden";static addButtonRemainingClass="dm-list-input__js-remaining-counter";$module;$allVisibleItems;$addAnotherButton;$allItems;constructor(e){this.$module=e,this.$allVisibleItems=this.findVisibleItems(),this.$addAnotherButton=this.$module.find(".dm-list-input__item-add"),this.$allItems=this.$module.find(".dm-list-input__item")}init(){this.hideEmptyItems(),this.updateAllCounters(),this.addRemoveClickEvent(),this.toggleAddAnotherButton(),this.addAddClickEvent()}findVisibleItems(){return this.$module.find(".dm-list-input__item--visible")}hideEmptyItems(){let e=0,i=0;this.$allItems.each(((o,w)=>{const x=$(w),O=x.find("."+ListInput.itemInputClass),A=x.find("."+ListInput.removeButtonClass);O.attr("value")?(x.removeClass(ListInput.hiddenItemClass),x.addClass(ListInput.visibleItemClass),A.removeClass(ListInput.hiddenRemoveButtonClass),i+=1):(0===e||1===e&&0===i?A.removeClass(ListInput.hiddenRemoveButtonClass):(x.addClass(ListInput.hiddenItemClass),x.removeClass(ListInput.visibleItemClass),A.addClass(ListInput.hiddenRemoveButtonClass),O.attr("disabled","true")),e+=1)})),this.$allVisibleItems=this.findVisibleItems()}addRemoveClickEvent(){this.$allItems.each(((e,i)=>{const o=$(i),w=o.find("."+ListInput.itemInputClass),x=o.find("."+ListInput.removeButtonClass);x.on("click",(()=>{if(w.val(""),w.removeAttr("value"),w.attr("disabled","true"),x.addClass(ListInput.hiddenRemoveButtonClass),o.addClass(ListInput.hiddenItemClass),o.removeClass(ListInput.visibleItemClass),this.$allVisibleItems=this.findVisibleItems(),o.hasClass(ListInput.itemErrorClass)){o.removeClass(ListInput.itemErrorClass);const e=o.find("."+ListInput.formGroupErrorClass);e.removeClass(ListInput.formGroupErrorClass),e.remove("."+ListInput.itemErrorMsgClass);const i=e.find("."+ListInput.inputErrorClass),w=i.attr("id"),$=i.attr("aria-describedby");i.attr("aria-describedby",$.replace(w+"-error","")),i.removeClass(ListInput.inputErrorClass)}if(1===this.$allVisibleItems.length){this.$module.find("."+ListInput.removeButtonClass).each(((e,i)=>{$(i).addClass(ListInput.hiddenRemoveButtonClass)})),$(this.$allVisibleItems.get(0)).find("input").trigger("focus")}else{const e=ListInput.getSibling("next",o,"."+ListInput.visibleItemClass);if(e)e.find("input").trigger("focus");else{ListInput.getSibling("previous",o,"."+ListInput.visibleItemClass).find("input").trigger("focus")}}this.updateAllCounters(),this.toggleAddAnotherButton()}))}))}updateCounters(){this.$allVisibleItems.each(((e,i)=>{$(i).find("."+ListInput.itemCounterClass).each(((i,o)=>{$(o).text(e+1)}))}))}updateRemainingCounter(){const e=this.$allVisibleItems,i=this.$allItems.length;this.$module.find("."+ListInput.addButtonRemainingClass).text(i-e.length)}addAddClickEvent(){this.$addAnotherButton.on("click",(()=>{const e=this.$module.find("."+ListInput.hiddenItemClass).first(),i=e.find("."+ListInput.itemInputClass);e.length&&(i.removeAttr("disabled"),this.$module.find("."+ListInput.itemContainerClass).append(e),e.removeClass(ListInput.hiddenItemClass),e.addClass(ListInput.visibleItemClass),this.$allVisibleItems=this.findVisibleItems(),this.updateAllCounters(),e.find("."+ListInput.removeButtonClass).removeClass(ListInput.hiddenRemoveButtonClass),i.trigger("focus"),this.toggleAddAnotherButton(),this.$allVisibleItems.length>1&&this.$module.find("."+ListInput.removeButtonClass).each(((e,i)=>{$(i).removeClass(ListInput.hiddenRemoveButtonClass)})))}))}toggleAddAnotherButton(){this.$module.find("."+ListInput.hiddenItemClass).length?this.$addAnotherButton.removeClass(ListInput.hiddenAddButtonClass):this.$addAnotherButton.addClass(ListInput.hiddenAddButtonClass)}updateAllCounters(){this.updateCounters(),this.updateRemainingCounter()}static getSibling(e,i,o){let w="next"===e?i.next():i.prev();if(!o)return w;for(;w.length;){if(w.is(o))return w;w="next"===e?w.next():w.prev()}}}!function(e){e[e.CONTROLLER=0]="CONTROLLER",e[e.CONTROLLER_AND_TARGET=1]="CONTROLLER_AND_TARGET",e[e.TARGET=2]="TARGET"}(X||(X={}));class QuestionInput{question;$input;targets;constructor(e,i){this.question=e,this.$input=i;const o=this.$input.attr("data-target");this.targets=o?o.split(" "):[]}setEventListener(){this.$input.on("click",(()=>{this.question.updateTargetQuestionsVisibility()}))}isChecked(){return this.$input.is(":checked")}}class QuestionQuestion{questionWatcher;$question;id;questionType;questionInputs;possibleTargetIds;targetOf;constructor(e,i,o){this.questionWatcher=e,this.$question=i,this.id=this.$question.attr("id"),this.questionType=o,this.questionType===X.CONTROLLER?this.enableControllerQuestionMethods():this.enableTargetQuestionMethods()}enableControllerQuestionMethods(){this.questionInputs=this.$question.find("input").get().map((e=>new QuestionInput(this,$(e)))),this.possibleTargetIds=new Set(this.questionInputs.map((e=>e.targets)).flat())}enableTargetQuestionMethods(){this.targetOf=[]}isVisible(){return!this.$question.hasClass("govuk-visually-hidden")}currentTargetIds(){let e;return e=this.isVisible()&&this.questionInputs?this.questionInputs.filter((e=>e.isChecked())).map((e=>e.targets)).flat():[],new Set(e)}updateTargetQuestionsVisibility(){this.questionWatcher.updateTargetQuestionsVisibility(this.possibleTargetIds)}appendTargetOf(e){void 0!==this.targetOf&&this.targetOf.push(e)}toggleVisibility(e){this.$question.toggleClass("govuk-visually-hidden",!e),this.$question.attr("aria-hidden",(!e).toString()),e?this.$question.removeAttr("hidden"):this.$question.attr("hidden","")}}class Question{static moduleName="dm-question";questions;constructor(){this.questions={},$(`[data-module="${Question.moduleName}"]`).each(((e,i)=>{this.push(new QuestionQuestion(this,$(i),X.CONTROLLER))}));for(const[e,i]of Object.entries(this.questions))for(const o of i.possibleTargetIds||[])o in this.questions?this.questions[o].questionType===X.CONTROLLER&&(this.questions[o].questionType=X.CONTROLLER_AND_TARGET,this.questions[o].enableTargetQuestionMethods()):this.push(new QuestionQuestion(this,$(`#${o}`),X.TARGET)),this.questions[o].appendTargetOf(e)}init(){for(const e of Object.values(this.questions))if(e.questionType<X.TARGET){for(const i of e.questionInputs||[])i.setEventListener();e.questionType===X.CONTROLLER&&this.updateTargetQuestionsVisibility(e.possibleTargetIds)}}push(e){this.questions[e.id]=e}updateTargetQuestionsVisibility(e,i){for(const o of e||[]){const e=this.questions[o];let w;if(void 0===i){const i=e.targetOf?.map((e=>this.questions[e]));w=new Set(i?.map((e=>Array.from(e.currentTargetIds()))).flat()).has(o)}else w=i;e.toggleVisibility(w),e.questionType===X.CONTROLLER_AND_TARGET&&(w?this.updateTargetQuestionsVisibility(e.possibleTargetIds):this.updateTargetQuestionsVisibility(e.possibleTargetIds,!1))}}}class QuestionCheckboxTreeSummary{$totalSelected;$totalSelectedText;itemNameSingular;itemNamePlural;constructor(e,i,o){this.$totalSelected=e.find(".dm-checkbox-tree__summary-total-selected"),this.$totalSelectedText=e.find(".dm-checkbox-tree__summary-total-selected-text"),this.itemNameSingular=i,this.itemNamePlural=o}updateSelectedCount(e){this.$totalSelected.text(e),1===e?this.$totalSelectedText.text(`${this.itemNameSingular} selected.`):this.$totalSelectedText.text(`${this.itemNamePlural} selected.`)}}class QuestionCheckboxTreeSection{checkboxTree;$section;$accordionButton;checkboxes;$summary;constructor(e,i){this.checkboxTree=e,this.$section=i,this.$accordionButton=this.$section.find("button.govuk-accordion__section-button"),this.checkboxes=this.$section.find(".govuk-checkboxes__input").get().map((e=>$(e))),this.$summary=this.$section.find(".dm-checkbox-tree__options-number-selected")}init(){this.openSectionIfSelected(),this.checkboxes.forEach((e=>{e.on("click",(()=>{this.checkboxTree.updateTotals(e.val(),e.is(":checked"))}))}))}selectedItems(){return this.checkboxes.filter((e=>e.is(":checked")))}countSelected(){return this.selectedItems().length}openSectionIfSelected(){this.$accordionButton.length&&this.countSelected()>0&&"false"===this.$accordionButton.attr("aria-expanded")&&this.$accordionButton.trigger("click")}slectedItemValues(){return this.selectedItems().map((e=>e.val()))}updateSelectedCount(){if(this.$summary.length){const e=this.countSelected();e>0?this.$summary.text(`, ${e} selected`):this.$summary.text("")}}toggleCheckbox(e,i){this.checkboxes.forEach((o=>{o.val()===e&&o.prop("checked",i)}))}}class QuestionCheckboxTree{static moduleName="dm-question-checkbox-tree";$checkboxTree;checkboxTreeSummary;checkboxTreeSections;constructor(e){this.$checkboxTree=e,this.checkboxTreeSummary=new QuestionCheckboxTreeSummary(this.$checkboxTree.find(".dm-checkbox-tree__summary"),this.$checkboxTree.data("itemNameSingular"),this.$checkboxTree.data("itemNamePlural"));const i=this.$checkboxTree.find(".govuk-accordion__section").get().map((e=>new QuestionCheckboxTreeSection(this,$(e))));i.length?this.checkboxTreeSections=i:this.checkboxTreeSections=[new QuestionCheckboxTreeSection(this,$(".dm-checkbox-tree__options"))]}init(){this.checkboxTreeSections.forEach((e=>e.init())),this.updateCheckboxTreeSummaryCount(),this.updateCheckboxTreeSectionSelectedCounts()}countSelected(){return new Set(this.checkboxTreeSections.map((e=>e.slectedItemValues())).flat()).size}updateCheckboxTreeSummaryCount(){this.checkboxTreeSummary.updateSelectedCount(this.countSelected())}updateCheckboxTreeSectionSelectedCounts(){this.checkboxTreeSections.forEach((e=>e.updateSelectedCount()))}updateTotals(e,i){this.checkboxTreeSections.forEach((o=>o.toggleCheckbox(e,i))),this.updateCheckboxTreeSummaryCount(),this.updateCheckboxTreeSectionSelectedCounts()}}class QuestionListRowInput{$input;$label;$labelCounter;$prefixText;constructor(e){this.$input=e.find(".dm-list__item-input"),this.$label=e.find(".govuk-label"),this.$labelCounter=this.$label.find(".dm-list__item-label-counter"),this.$prefixText=e.find(".govuk-input__prefix")}getValue(){return this.$input.val()}clearValue(){this.$input.val(""),this.$input.attr("value","")}updateIndex(e){const i=`input-${this.$input.attr("name")}-${e}`;this.$label.attr("for",i),this.$labelCounter.text(e+1),this.$prefixText.text(`${e+1}.`),this.$input.attr("id",i)}}class QuestionListRowRemoveButton{answerListRow;$button;$removeButtonCounter;constructor(e,i){this.answerListRow=e,this.$button=i.find(".dm-list__item-remove"),this.$removeButtonCounter=this.$button.find(".dm-list__item-remove-counter")}init(){this.toggleVisibility(!0),this.$button.on("click",(()=>{this.answerListRow.removeRow()}))}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e)}updateIndex(e){this.$removeButtonCounter.text(e+1)}}class QuestionListRow{answerList;index;$row;answerListRowInput;answerListRowRemoveButton;constructor(e,i,o){this.answerList=e,this.index=i,this.$row=o,this.answerListRowInput=new QuestionListRowInput(o),this.answerListRowRemoveButton=new QuestionListRowRemoveButton(this,o)}init(){this.answerListRowRemoveButton.init()}updateIndex(e){this.index=e,this.answerListRowInput.updateIndex(e),this.answerListRowRemoveButton.updateIndex(e)}removeRow(){this.answerList.removeRow(this.index),this.deleteRow()}deleteRow(){this.$row.remove()}toggleRemoveButtonVisibility(e){this.answerListRowRemoveButton.toggleVisibility(e)}inputValue(){return this.answerListRowInput.getValue()}}class QuestionListAddButton{answerList;$button;$buttonCounter;constructor(e,i){this.answerList=e,this.$button=i,this.$buttonCounter=i.find(".dm-list__item-add-counter")}init(e){this.$button.on("click",(()=>{this.answerList.addRow()})),this.updateButtonText(this.answerList.maxNumberOfItems-e)}updateButtonText(e){this.$buttonCounter.text(e)}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e)}}class QuestionList{static moduleName="dm-question-list";$answerList;$answerListItems;answerListRows;answerListAddButton;maxNumberOfItems;numberOfItemsShownAsDefault;constructor(e){this.$answerList=e,this.maxNumberOfItems=this.$answerList.data("maxNumberOfItems"),this.numberOfItemsShownAsDefault=this.$answerList.data("numberOfItemsShownAsDefault"),this.$answerListItems=this.$answerList.find(".dm-list__items"),this.answerListRows=this.$answerList.find(".dm-list__item").get().map(((e,i)=>new QuestionListRow(this,i,$(e)))),this.answerListAddButton=new QuestionListAddButton(this,this.$answerList.find(".dm-list__item-add"))}init(){const e=this.answerListRows.map((e=>e.inputValue()));let i=1;e.every((e=>!e))?i=this.numberOfItemsShownAsDefault:e.forEach(((e,o)=>{e&&(i=o+1)})),i>=0&&(this.answerListRows.slice(i).forEach((e=>e.deleteRow())),this.answerListRows.splice(i)),this.answerListAddButton.init(this.answerListRows.length),this.answerListRows.forEach((e=>e.init())),this.updateIfMinRows(),this.updateAnswerButton()}removeRow(e){this.answerListRows.splice(e,1),this.answerListRows.slice(e).forEach(((i,o)=>{i.updateIndex(e+o)})),this.updateIfMinRows(),this.updateAnswerButton(),this.focusOnRow(e)}addRow(){const e=this.answerListRows.length;if(e<this.maxNumberOfItems){const i=this.answerListRows[0].$row.clone(),o=new QuestionListRow(this,e,i);o.updateIndex(e),o.answerListRowInput.clearValue(),this.answerListRows.push(o),this.$answerListItems.append(i),this.answerListRows[e].init(),this.updateIfMinRows(),this.updateAnswerButton(),this.focusOnRow(e)}}updateIfMinRows(){1===this.answerListRows.length?this.answerListRows[0].toggleRemoveButtonVisibility(!1):this.answerListRows[0].toggleRemoveButtonVisibility(!0)}updateAnswerButton(){this.answerListRows.length===this.maxNumberOfItems?this.answerListAddButton.toggleVisibility(!1):(this.answerListAddButton.toggleVisibility(!0),this.answerListAddButton.updateButtonText(this.maxNumberOfItems-this.answerListRows.length))}focusOnRow(e){const i=this.answerListRows.length;let o=e;e>=i&&(o=i-1),this.answerListRows[o].answerListRowInput.$input.focus()}}class QuestionListMultiquestionQuestionInput{$input;constructor(e){this.$input=e.find("input")}getValue(){return this.$input.val()}toggleVisibility(e){e?this.$input.removeAttr("tabindex"):(this.$input.val(""),this.$input.attr("value",""),this.$input.attr("tabindex",-1))}}class QuestionListMultiquestionRow{answerList;$row;answerListRowInputs;constructor(e,i){this.answerList=e,this.$row=i,this.answerListRowInputs=i.find(".question").get().map((e=>new QuestionListMultiquestionQuestionInput($(e))))}toggleVisibility(e){this.$row.toggleClass("govuk-visually-hidden",!e),this.answerListRowInputs.forEach((i=>i.toggleVisibility(e)))}isRowVisible(){return!this.$row.hasClass("govuk-visually-hidden")}rowHasValues(){return this.answerListRowInputs.some((e=>!!e.getValue()))}}class QuestionListMultiquestionButton{answerList;$button;$buttonCounter;constructor(e,i,o){this.answerList=e,this.$button=i,this.$buttonCounter=i.find(`.dm-list-multiquestion__item-${o}-counter`)}updateButtonText(e){this.$buttonCounter.text(e)}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e),e?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}}class QuestionListMultiquestionRemoveButton extends QuestionListMultiquestionButton{constructor(e,i){super(e,i,"remove")}init(e){this.$button.on("click",(()=>{this.answerList.hideRow()})),this.updateButtonText(e)}}class QuestionListMultiquestionAddButton extends QuestionListMultiquestionButton{maxNumberOfItems;constructor(e,i,o){super(e,i,"add"),this.maxNumberOfItems=o}init(e){this.$button.on("click",(()=>{this.answerList.addRow()})),this.updateButtonText(this.maxNumberOfItems-e)}}class QuestionListMultiquestionClientSide{static moduleName="dm-question-list-multiquestion-client-side";$answerList;maxNumberOfItems;answerListRows;answerListAddButton;answerListRemoveButton;constructor(e){this.$answerList=e,this.maxNumberOfItems=this.$answerList.data("maxNumberOfItems"),this.answerListRows=this.$answerList.find(".dm-list-multiquestion__item").get().map((e=>new QuestionListMultiquestionRow(this,$(e)))),this.answerListAddButton=new QuestionListMultiquestionAddButton(this,this.$answerList.find(".dm-list-multiquestion__item-add"),this.maxNumberOfItems),this.answerListRemoveButton=new QuestionListMultiquestionRemoveButton(this,this.$answerList.find(".dm-list-multiquestion__item-remove"))}init(){const e=this.answerListRows.map((e=>e.rowHasValues()));let i=-1;if(e.every((e=>!e)))i=1;else{let o=!0;e.forEach(((e,w)=>{o&&!e&&(i=w),o=e}))}i>=0&&this.answerListRows.slice(i).forEach((e=>e.toggleVisibility(!1)));const o=this.visibleRowsCount();this.answerListAddButton.init(o),this.answerListRemoveButton.init(o),this.updateRemoveButton(o),this.updateAnswerButton(o)}hideRow(){const e=this.visibleRowsCount();e>1&&(this.answerListRows[e-1].toggleVisibility(!1),this.updateRemoveButton(e-1),this.updateAnswerButton(e-1),this.focusOnRow(e-1))}addRow(){const e=this.visibleRowsCount();e<this.maxNumberOfItems&&(this.answerListRows[e].toggleVisibility(!0),this.updateRemoveButton(e+1),this.updateAnswerButton(e+1),this.focusOnRow(e+1))}visibleRowsCount(){return this.answerListRows.reduce(((e,i)=>e+(i.isRowVisible()?1:0)),0)}updateRemoveButton(e){1===e?this.answerListRemoveButton.toggleVisibility(!1):(this.answerListRemoveButton.toggleVisibility(!0),this.answerListRemoveButton.updateButtonText(e))}updateAnswerButton(e){e===this.maxNumberOfItems?this.answerListAddButton.toggleVisibility(!1):(this.answerListAddButton.toggleVisibility(!0),this.answerListAddButton.updateButtonText(this.maxNumberOfItems-e))}focusOnRow(e){this.answerListRows[e-1].answerListRowInputs[0].$input.focus()}}class OptionSelect{static moduleName="dm-option-select";$optionSelect;$options;$optionsContainer;$optionList;$allCheckboxes;checkedCheckboxes;constructor(e){this.$optionSelect=e,this.$options=this.$optionSelect.find('input[type="checkbox"]'),this.$optionsContainer=this.$optionSelect.find(".js-options-container"),this.$optionList=this.$optionsContainer.find(".js-auto-height-inner"),this.$allCheckboxes=this.$optionsContainer.find(".govuk-checkboxes__item"),this.checkedCheckboxes=[]}init(){this.$optionSelect.on("change",(e=>{const i=e.target;"INPUT"===i.tagName&&"checkbox"===i.getAttribute("type")&&this.updateCheckedCount()})),this.replaceHeadingSpanWithButton(),this.$optionSelect.addClass("js-collapsible"),this.$optionSelect.find(".js-container-button").on("click",(e=>{this.toggleOptionSelect(e)})),this.$optionSelect.data().closedOnLoad?this.close():this.setupHeight();const e=this.checkedString();e&&this.attachCheckedCounter(e)}getAllCheckedCheckboxes(){this.checkedCheckboxes=[],this.$allCheckboxes.each(((e,i)=>{$(i).find("input[type=checkbox]").is(":checked")&&this.checkedCheckboxes.push(i)}))}replaceHeadingSpanWithButton(){const e=this.$optionSelect.find(".js-container-button"),i=e.html(),o=document.createElement("button");o.classList.add("js-container-button","dm-option-select__title","dm-option-select__button"),o.setAttribute("type","button"),o.setAttribute("aria-expanded","true"),o.setAttribute("id",e.attr("id")),o.setAttribute("aria-controls",this.$optionsContainer.attr("id")),o.innerHTML=i,e.after(o.outerHTML),e.remove()}attachCheckedCounter(e){this.$optionSelect.find(".js-container-button").after(`<div class="dm-option-select__selected-counter js-selected-counter">${e}</div>`)}updateCheckedCount(){const e=this.checkedString(),i=this.$optionSelect.find(".js-selected-counter");e?i.length?i.text(e):this.attachCheckedCounter(e):i.remove()}checkedString(){this.getAllCheckedCheckboxes();const e=this.checkedCheckboxes.length;let i="";return e>0&&(i=e+" selected"),i}toggleOptionSelect(e){this.isClosed()?this.open():this.close(),e.preventDefault()}open(){this.isClosed()&&(this.$optionSelect.find(".js-container-button").attr("aria-expanded","true"),this.$optionSelect.removeClass("js-closed"),this.$optionSelect.addClass("js-opened"),this.$optionsContainer.css("height")||this.setupHeight())}close(){this.$optionSelect.removeClass("js-opened"),this.$optionSelect.addClass("js-closed"),this.$optionSelect.find(".js-container-button").attr("aria-expanded","false")}isClosed(){return this.$optionSelect.hasClass("js-closed")}setContainerHeight(e){this.$optionsContainer.css("height",e+"px")}isCheckboxVisible(e){const i=this.$optionsContainer.get(0)?.clientHeight,o=this.$optionList.get(0).getBoundingClientRect().top+document.body.scrollTop;return e.get(0).getBoundingClientRect().top+document.body.scrollTop-o<i}getVisibleCheckboxes(){const e=this.$options.get().filter((e=>this.isCheckboxVisible($(e))));return e.length<this.$options.length&&e.push(this.$options.get(e.length)),e}setupHeight(){const e=this.$optionsContainer.get(0),i=this.$optionList.get(0);let o=e.clientHeight,w=i.offsetHeight;if(null===e.offsetParent&&(o=200,w=200),w<o+50)return void this.setContainerHeight(w+1);const $=this.getVisibleCheckboxes(),x=$[$.length-1],O=(x?.parentNode).offsetTop;this.setContainerHeight(O+parseFloat(window.getComputedStyle(x,null).height.replace("px",""))/1.5)}}class SearchBox{static moduleName="dm-search-box";$module;$toggleTarget;constructor(e){this.$module=e,this.$toggleTarget=this.$module.find(".js-class-toggle")}init(){this.inputIsEmpty()||this.addFocusClass(),this.$toggleTarget.on("focus",this.addFocusClass.bind(this)),this.$toggleTarget.on("blur",this.removeFocusClassFromEmptyInput.bind(this))}inputIsEmpty(){return""===this.$toggleTarget.val()}addFocusClass(){this.$toggleTarget.addClass("focus")}removeFocusClassFromEmptyInput(){this.inputIsEmpty()&&this.$toggleTarget.removeClass("focus")}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tt,et={exports:{}};var nt=getDefaultExportFromCjs((tt||(tt=1,self,et.exports=function(){var e={8952:function(e,i,o){var w=o(4328),$=o(36),x=TypeError;e.exports=function(e){if(w(e))return e;throw new x($(e)+" is not a function")}},2096:function(e,i,o){var w=o(2424),$=String,x=TypeError;e.exports=function(e){if(w(e))return e;throw new x("Can't set "+$(e)+" as a prototype")}},4764:function(e,i,o){var w=o(9764).charAt;e.exports=function(e,i,o){return i+(o?w(e,i).length:1)}},6100:function(e,i,o){var w=o(7e3),$=TypeError;e.exports=function(e,i){if(w(i,e))return e;throw new $("Incorrect invocation")}},3951:function(e,i,o){var w=o(1632),$=String,x=TypeError;e.exports=function(e){if(w(e))return e;throw new x($(e)+" is not an object")}},2504:function(e,i,o){var w=o(4096),$=o(2495),x=o(3556),u=function(e){return function(i,o,O){var A=w(i),B=x(A);if(0===B)return!e&&-1;var Q,W=$(O,B);if(e&&o!=o){for(;B>W;)if((Q=A[W++])!=Q)return!0}else for(;B>W;W++)if((e||W in A)&&A[W]===o)return e||W||0;return!e&&-1}};e.exports={includes:u(!0),indexOf:u(!1)}},3364:function(e,i,o){var w=o(8992),$=o(1664),x=o(5712),O=o(4356),A=o(3556),B=o(2568),Q=$([].push),l=function(e){var i=1===e,o=2===e,$=3===e,W=4===e,K=6===e,Y=7===e,Z=5===e||K;return function(X,J,tt,et){for(var nt,it,ot=O(X),rt=x(ot),st=A(rt),at=w(J,tt),ut=0,ct=et||B,lt=i?ct(X,st):o||Y?ct(X,0):void 0;st>ut;ut++)if((Z||ut in rt)&&(it=at(nt=rt[ut],ut,ot),e))if(i)lt[ut]=it;else if(it)switch(e){case 3:return!0;case 5:return nt;case 6:return ut;case 2:Q(lt,nt)}else switch(e){case 4:return!1;case 7:Q(lt,nt)}return K?-1:$||W?W:lt}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},953:function(e,i,o){var w=o(9957),$=o(9972),x=o(8504),O=$("species");e.exports=function(e){return x>=51||!w((function(){var i=[];return(i.constructor={})[O]=function(){return{foo:1}},1!==i[e](Boolean).foo}))}},1496:function(e,i,o){var w=o(9957);e.exports=function(e,i){var o=[][e];return!!o&&w((function(){o.call(null,i||function(){return 1},1)}))}},6728:function(e,i,o){var w=o(3476),$=o(1432),x=TypeError,O=Object.getOwnPropertyDescriptor,A=w&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=A?function(e,i){if($(e)&&!O(e,"length").writable)throw new x("Cannot set read only .length");return e.length=i}:function(e,i){return e.length=i}},6736:function(e,i,o){var w=o(1432),$=o(6072),x=o(1632),O=o(9972)("species"),A=Array;e.exports=function(e){var i;return w(e)&&(i=e.constructor,($(i)&&(i===A||w(i.prototype))||x(i)&&null===(i=i[O]))&&(i=void 0)),void 0===i?A:i}},2568:function(e,i,o){var w=o(6736);e.exports=function(e,i){return new(w(e))(0===i?0:i)}},8696:function(e,i,o){var w=o(3951),$=o(3112);e.exports=function(e,i,o,x){try{return x?i(w(o)[0],o[1]):i(o)}catch(O){$(e,"throw",O)}}},1888:function(e,i,o){var w=o(1664),$=w({}.toString),x=w("".slice);e.exports=function(e){return x($(e),8,-1)}},4427:function(e,i,o){var w=o(16),$=o(4328),x=o(1888),O=o(9972)("toStringTag"),A=Object,B="Arguments"===x(function(){return arguments}());e.exports=w?x:function(e){var i,o,w;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(o=function(e,i){try{return e[i]}catch(o){}}(i=A(e),O))?o:B?x(i):"Object"===(w=x(i))&&$(i.callee)?"Arguments":w}},9968:function(e,i,o){var w=o(5152),$=o(9252),x=o(9444),O=o(8352);e.exports=function(e,i,o){for(var A=$(i),B=O.f,Q=x.f,W=0;W<A.length;W++){var K=A[W];w(e,K)||o&&w(o,K)||B(e,K,Q(i,K))}}},2272:function(e,i,o){var w=o(9957);e.exports=!w((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3336:function(e){e.exports=function(e,i){return{value:e,done:i}}},3440:function(e,i,o){var w=o(3476),$=o(8352),x=o(9728);e.exports=w?function(e,i,o){return $.f(e,i,x(1,o))}:function(e,i,o){return e[i]=o,e}},9728:function(e){e.exports=function(e,i){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:i}}},92:function(e,i,o){var w=o(3476),$=o(8352),x=o(9728);e.exports=function(e,i,o){w?$.f(e,i,x(0,o)):e[i]=o}},2544:function(e,i,o){var w=o(5312),$=o(8352);e.exports=function(e,i,o){return o.get&&w(o.get,i,{getter:!0}),o.set&&w(o.set,i,{setter:!0}),$.f(e,i,o)}},6076:function(e,i,o){var w=o(4328),$=o(8352),x=o(5312),O=o(4636);e.exports=function(e,i,o,A){A||(A={});var B=A.enumerable,Q=void 0!==A.name?A.name:i;if(w(o)&&x(o,Q,A),A.global)B?e[i]=o:O(i,o);else{try{A.unsafe?e[i]&&(B=!0):delete e[i]}catch(W){}B?e[i]=o:$.f(e,i,{value:o,enumerable:!1,configurable:!A.nonConfigurable,writable:!A.nonWritable})}return e}},4036:function(e,i,o){var w=o(6076);e.exports=function(e,i,o){for(var $ in i)w(e,$,i[$],o);return e}},4636:function(e,i,o){var w=o(6420),$=Object.defineProperty;e.exports=function(e,i){try{$(w,e,{value:i,configurable:!0,writable:!0})}catch(o){w[e]=i}return i}},3476:function(e,i,o){var w=o(9957);e.exports=!w((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8168:function(e,i,o){var w=o(6420),$=o(1632),x=w.document,O=$(x)&&$(x.createElement);e.exports=function(e){return O?x.createElement(e):{}}},4316:function(e){var i=TypeError;e.exports=function(e){if(e>9007199254740991)throw i("Maximum allowed index exceeded");return e}},6064:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:function(e,i,o){var w,$,x=o(6420),O=o(6064),A=x.process,B=x.Deno,Q=A&&A.versions||B&&B.version,W=Q&&Q.v8;W&&($=(w=W.split("."))[0]>0&&w[0]<4?1:+(w[0]+w[1])),!$&&O&&(!(w=O.match(/Edge\/(\d+)/))||w[1]>=74)&&(w=O.match(/Chrome\/(\d+)/))&&($=+w[1]),e.exports=$},8256:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6520:function(e,i,o){var w=o(1664),$=Error,x=w("".replace),O=String(new $("zxcasd").stack),A=/\n\s*at [^:]*:[^\n]*/,B=A.test(O);e.exports=function(e,i){if(B&&"string"==typeof e&&!$.prepareStackTrace)for(;i--;)e=x(e,A,"");return e}},3696:function(e,i,o){var w=o(3440),$=o(6520),x=o(9184),O=Error.captureStackTrace;e.exports=function(e,i,o,A){x&&(O?O(e,i):w(e,"stack",$(o,A)))}},9184:function(e,i,o){var w=o(9957),$=o(9728);e.exports=!w((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",$(1,7)),7!==e.stack)}))},9160:function(e,i,o){var w=o(6420),$=o(9444).f,x=o(3440),O=o(6076),A=o(4636),B=o(9968),Q=o(6704);e.exports=function(e,i){var o,W,K,Y,Z,X=e.target,J=e.global,tt=e.stat;if(o=J?w:tt?w[X]||A(X,{}):w[X]&&w[X].prototype)for(W in i){if(Y=i[W],K=e.dontCallGetSet?(Z=$(o,W))&&Z.value:o[W],!Q(J?W:X+(tt?".":"#")+W,e.forced)&&void 0!==K){if(typeof Y==typeof K)continue;B(Y,K)}(e.sham||K&&K.sham)&&x(Y,"sham",!0),O(o,W,Y,e)}}},9957:function(e){e.exports=function(e){try{return!!e()}catch(i){return!0}}},7176:function(e,i,o){o(880);var w=o(8448),$=o(6076),x=o(7680),O=o(9957),A=o(9972),B=o(3440),Q=A("species"),W=RegExp.prototype;e.exports=function(e,i,o,K){var Y=A(e),Z=!O((function(){var i={};return i[Y]=function(){return 7},7!==""[e](i)})),X=Z&&!O((function(){var i=!1,o=/a/;return"split"===e&&((o={}).constructor={},o.constructor[Q]=function(){return o},o.flags="",o[Y]=/./[Y]),o.exec=function(){return i=!0,null},o[Y](""),!i}));if(!Z||!X||o){var J=/./[Y],tt=i(Y,""[e],(function(e,i,o,$,O){var A=i.exec;return A===x||A===W.exec?Z&&!O?{done:!0,value:w(J,i,o,$)}:{done:!0,value:w(e,o,i,$)}:{done:!1}}));$(String.prototype,e,tt[0]),$(W,Y,tt[1])}K&&B(W[Y],"sham",!0)}},908:function(e,i,o){var w=o(7332),$=Function.prototype,x=$.apply,O=$.call;e.exports="object"==typeof Reflect&&Reflect.apply||(w?O.bind(x):function(){return O.apply(x,arguments)})},8992:function(e,i,o){var w=o(3180),$=o(8952),x=o(7332),O=w(w.bind);e.exports=function(e,i){return $(e),void 0===i?e:x?O(e,i):function(){return e.apply(i,arguments)}}},7332:function(e,i,o){var w=o(9957);e.exports=!w((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8448:function(e,i,o){var w=o(7332),$=Function.prototype.call;e.exports=w?$.bind($):function(){return $.apply($,arguments)}},6208:function(e,i,o){var w=o(3476),$=o(5152),x=Function.prototype,O=w&&Object.getOwnPropertyDescriptor,A=$(x,"name"),B=A&&"something"===function(){}.name,Q=A&&(!w||w&&O(x,"name").configurable);e.exports={EXISTS:A,PROPER:B,CONFIGURABLE:Q}},5288:function(e,i,o){var w=o(1664),$=o(8952);e.exports=function(e,i,o){try{return w($(Object.getOwnPropertyDescriptor(e,i)[o]))}catch(x){}}},3180:function(e,i,o){var w=o(1888),$=o(1664);e.exports=function(e){if("Function"===w(e))return $(e)}},1664:function(e,i,o){var w=o(7332),$=Function.prototype,x=$.call,O=w&&$.bind.bind(x,x);e.exports=w?O:function(e){return function(){return x.apply(e,arguments)}}},5232:function(e,i,o){var w=o(6420),$=o(4328);e.exports=function(e,i){return arguments.length<2?(o=w[e],$(o)?o:void 0):w[e]&&w[e][i];var o}},6752:function(e){e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},4504:function(e,i,o){var w=o(8952),$=o(9760);e.exports=function(e,i){var o=e[i];return $(o)?void 0:w(o)}},6420:function(e,i,o){var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof o.g&&o.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5152:function(e,i,o){var w=o(1664),$=o(4356),x=w({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,i){return x($(e),i)}},2560:function(e){e.exports={}},4168:function(e,i,o){var w=o(5232);e.exports=w("document","documentElement")},9888:function(e,i,o){var w=o(3476),$=o(9957),x=o(8168);e.exports=!w&&!$((function(){return 7!==Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a}))},5712:function(e,i,o){var w=o(1664),$=o(9957),x=o(1888),O=Object,A=w("".split);e.exports=$((function(){return!O("z").propertyIsEnumerable(0)}))?function(e){return"String"===x(e)?A(e,""):O(e)}:O},7512:function(e,i,o){var w=o(4328),$=o(1632),x=o(4024);e.exports=function(e,i,o){var O,A;return x&&w(O=i.constructor)&&O!==o&&$(A=O.prototype)&&A!==o.prototype&&x(e,A),e}},9112:function(e,i,o){var w=o(1664),$=o(4328),x=o(3976),O=w(Function.toString);$(x.inspectSource)||(x.inspectSource=function(e){return O(e)}),e.exports=x.inspectSource},3480:function(e,i,o){var w=o(1632),$=o(3440);e.exports=function(e,i){w(i)&&"cause"in i&&$(e,"cause",i.cause)}},9104:function(e,i,o){var w,$,x,O=o(4288),A=o(6420),B=o(1632),Q=o(3440),W=o(5152),K=o(3976),Y=o(6504),Z=o(2560),X="Object already initialized",J=A.TypeError,tt=A.WeakMap;if(O||K.state){var et=K.state||(K.state=new tt);et.get=et.get,et.has=et.has,et.set=et.set,w=function(e,i){if(et.has(e))throw new J(X);return i.facade=e,et.set(e,i),i},$=function(e){return et.get(e)||{}},x=function(e){return et.has(e)}}else{var nt=Y("state");Z[nt]=!0,w=function(e,i){if(W(e,nt))throw new J(X);return i.facade=e,Q(e,nt,i),i},$=function(e){return W(e,nt)?e[nt]:{}},x=function(e){return W(e,nt)}}e.exports={set:w,get:$,has:x,enforce:function(e){return x(e)?$(e):w(e,{})},getterFor:function(e){return function(i){var o;if(!B(i)||(o=$(i)).type!==e)throw new J("Incompatible receiver, "+e+" required");return o}}}},1432:function(e,i,o){var w=o(1888);e.exports=Array.isArray||function(e){return"Array"===w(e)}},4328:function(e){var i="object"==typeof document&&document.all;e.exports=void 0===i&&void 0!==i?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},6072:function(e,i,o){var w=o(1664),$=o(9957),x=o(4328),O=o(4427),A=o(5232),B=o(9112),s=function(){},Q=A("Reflect","construct"),W=/^\s*(?:class|function)\b/,K=w(W.exec),Y=!W.test(s),h=function(e){if(!x(e))return!1;try{return Q(s,[],e),!0}catch(i){return!1}},v=function(e){if(!x(e))return!1;switch(O(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Y||!!K(W,B(e))}catch(i){return!0}};v.sham=!0,e.exports=!Q||$((function(){var e;return h(h.call)||!h(Object)||!h((function(){e=!0}))||e}))?v:h},6704:function(e,i,o){var w=o(9957),$=o(4328),x=/#|\.prototype\./,u=function(e,i){var o=A[O(e)];return o===Q||o!==B&&($(i)?w(i):!!i)},O=u.normalize=function(e){return String(e).replace(x,".").toLowerCase()},A=u.data={},B=u.NATIVE="N",Q=u.POLYFILL="P";e.exports=u},9760:function(e){e.exports=function(e){return null==e}},1632:function(e,i,o){var w=o(4328);e.exports=function(e){return"object"==typeof e?null!==e:w(e)}},2424:function(e,i,o){var w=o(1632);e.exports=function(e){return w(e)||null===e}},7048:function(e){e.exports=!1},7728:function(e,i,o){var w=o(5232),$=o(4328),x=o(7e3),O=o(6536),A=Object;e.exports=O?function(e){return"symbol"==typeof e}:function(e){var i=w("Symbol");return $(i)&&x(i.prototype,A(e))}},3112:function(e,i,o){var w=o(8448),$=o(3951),x=o(4504);e.exports=function(e,i,o){var O,A;$(e);try{if(!(O=x(e,"return"))){if("throw"===i)throw o;return o}O=w(O,e)}catch(B){A=!0,O=B}if("throw"===i)throw o;if(A)throw O;return $(O),o}},9724:function(e,i,o){var w=o(8448),$=o(9368),x=o(3440),O=o(4036),A=o(9972),B=o(9104),Q=o(4504),W=o(336).IteratorPrototype,K=o(3336),Y=o(3112),Z=A("toStringTag"),X="IteratorHelper",J="WrapForValidIterator",tt=B.set,y=function(e){var i=B.getterFor(e?J:X);return O($(W),{next:function(){var o=i(this);if(e)return o.nextHandler();try{var w=o.done?void 0:o.nextHandler();return K(w,o.done)}catch($){throw o.done=!0,$}},return:function(){var o=i(this),$=o.iterator;if(o.done=!0,e){var x=Q($,"return");return x?w(x,$):K(void 0,!0)}if(o.inner)try{Y(o.inner.iterator,"normal")}catch(O){return Y($,"throw",O)}return Y($,"normal"),K(void 0,!0)}})},et=y(!0),nt=y(!1);x(nt,Z,"Iterator Helper"),e.exports=function(e,i){var n=function(o,w){w?(w.iterator=o.iterator,w.next=o.next):w=o,w.type=i?J:X,w.nextHandler=e,w.counter=0,w.done=!1,tt(this,w)};return n.prototype=i?et:nt,n}},5792:function(e,i,o){var w=o(8448),$=o(8952),x=o(3951),O=o(6752),A=o(9724),B=o(8696),Q=A((function(){var e=this.iterator,i=x(w(this.next,e));if(!(this.done=!!i.done))return B(e,this.mapper,[i.value,this.counter++],!0)}));e.exports=function(e){return x(this),$(e),new Q(O(this),{mapper:e})}},336:function(e,i,o){var w,$,x,O=o(9957),A=o(4328),B=o(1632),Q=o(9368),W=o(7796),K=o(6076),Y=o(9972),Z=o(7048),X=Y("iterator"),J=!1;[].keys&&("next"in(x=[].keys())?($=W(W(x)))!==Object.prototype&&(w=$):J=!0),!B(w)||O((function(){var e={};return w[X].call(e)!==e}))?w={}:Z&&(w=Q(w)),A(w[X])||K(w,X,(function(){return this})),e.exports={IteratorPrototype:w,BUGGY_SAFARI_ITERATORS:J}},3556:function(e,i,o){var w=o(7584);e.exports=function(e){return w(e.length)}},5312:function(e,i,o){var w=o(1664),$=o(9957),x=o(4328),O=o(5152),A=o(3476),B=o(6208).CONFIGURABLE,Q=o(9112),W=o(9104),K=W.enforce,Y=W.get,Z=String,X=Object.defineProperty,J=w("".slice),tt=w("".replace),et=w([].join),nt=A&&!$((function(){return 8!==X((function(){}),"length",{value:8}).length})),it=String(String).split("String"),ot=e.exports=function(e,i,o){"Symbol("===J(Z(i),0,7)&&(i="["+tt(Z(i),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),o&&o.getter&&(i="get "+i),o&&o.setter&&(i="set "+i),(!O(e,"name")||B&&e.name!==i)&&(A?X(e,"name",{value:i,configurable:!0}):e.name=i),nt&&o&&O(o,"arity")&&e.length!==o.arity&&X(e,"length",{value:o.arity});try{o&&O(o,"constructor")&&o.constructor?A&&X(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch($){}var w=K(e);return O(w,"source")||(w.source=et(it,"string"==typeof i?i:"")),e};Function.prototype.toString=ot((function(){return x(this)&&Y(this).source||Q(this)}),"toString")},1748:function(e){var i=Math.ceil,o=Math.floor;e.exports=Math.trunc||function(e){var w=+e;return(w>0?o:i)(w)}},8948:function(e,i,o){var w=o(5016);e.exports=function(e,i){return void 0===e?arguments.length<2?"":i:w(e)}},9292:function(e,i,o){var w=o(3476),$=o(1664),x=o(8448),O=o(9957),A=o(1531),B=o(9392),Q=o(8912),W=o(4356),K=o(5712),Y=Object.assign,Z=Object.defineProperty,X=$([].concat);e.exports=!Y||O((function(){if(w&&1!==Y({b:1},Y(Z({},"a",{enumerable:!0,get:function(){Z(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},i={},o=Symbol("assign detection"),$="abcdefghijklmnopqrst";return e[o]=7,$.split("").forEach((function(e){i[e]=e})),7!==Y({},e)[o]||A(Y({},i)).join("")!==$}))?function(e,i){for(var o=W(e),$=arguments.length,O=1,Y=B.f,Z=Q.f;$>O;)for(var J,tt=K(arguments[O++]),et=Y?X(A(tt),Y(tt)):A(tt),nt=et.length,it=0;nt>it;)J=et[it++],w&&!x(Z,tt,J)||(o[J]=tt[J]);return o}:Y},9368:function(e,i,o){var w,$=o(3951),x=o(2056),O=o(8256),A=o(2560),B=o(4168),Q=o(8168),W=o(6504),K="prototype",Y="script",Z=W("IE_PROTO"),h=function(){},v=function(e){return"<"+Y+">"+e+"</"+Y+">"},m=function(e){e.write(v("")),e.close();var i=e.parentWindow.Object;return e=null,i},_y=function(){try{w=new ActiveXObject("htmlfile")}catch(x){}var e,i,o;_y="undefined"!=typeof document?document.domain&&w?m(w):(i=Q("iframe"),o="java"+Y+":",i.style.display="none",B.appendChild(i),i.src=String(o),(e=i.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):m(w);for(var $=O.length;$--;)delete _y[K][O[$]];return _y()};A[Z]=!0,e.exports=Object.create||function(e,i){var o;return null!==e?(h[K]=$(e),o=new h,h[K]=null,o[Z]=e):o=_y(),void 0===i?o:x.f(o,i)}},2056:function(e,i,o){var w=o(3476),$=o(1576),x=o(8352),O=o(3951),A=o(4096),B=o(1531);i.f=w&&!$?Object.defineProperties:function(e,i){O(e);for(var o,w=A(i),$=B(i),Q=$.length,W=0;Q>W;)x.f(e,o=$[W++],w[o]);return e}},8352:function(e,i,o){var w=o(3476),$=o(9888),x=o(1576),O=o(3951),A=o(88),B=TypeError,Q=Object.defineProperty,W=Object.getOwnPropertyDescriptor,K="enumerable",Y="configurable",Z="writable";i.f=w?x?function(e,i,o){if(O(e),i=A(i),O(o),"function"==typeof e&&"prototype"===i&&"value"in o&&Z in o&&!o[Z]){var w=W(e,i);w&&w[Z]&&(e[i]=o.value,o={configurable:Y in o?o[Y]:w[Y],enumerable:K in o?o[K]:w[K],writable:!1})}return Q(e,i,o)}:Q:function(e,i,o){if(O(e),i=A(i),O(o),$)try{return Q(e,i,o)}catch(w){}if("get"in o||"set"in o)throw new B("Accessors not supported");return"value"in o&&(e[i]=o.value),e}},9444:function(e,i,o){var w=o(3476),$=o(8448),x=o(8912),O=o(9728),A=o(4096),B=o(88),Q=o(5152),W=o(9888),K=Object.getOwnPropertyDescriptor;i.f=w?K:function(e,i){if(e=A(e),i=B(i),W)try{return K(e,i)}catch(o){}if(Q(e,i))return O(!$(x.f,e,i),e[i])}},5048:function(e,i,o){var w=o(9008),$=o(8256).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(e){return w(e,$)}},9392:function(e,i){i.f=Object.getOwnPropertySymbols},7796:function(e,i,o){var w=o(5152),$=o(4328),x=o(4356),O=o(6504),A=o(2272),B=O("IE_PROTO"),Q=Object,W=Q.prototype;e.exports=A?Q.getPrototypeOf:function(e){var i=x(e);if(w(i,B))return i[B];var o=i.constructor;return $(o)&&i instanceof o?o.prototype:i instanceof Q?W:null}},7e3:function(e,i,o){var w=o(1664);e.exports=w({}.isPrototypeOf)},9008:function(e,i,o){var w=o(1664),$=o(5152),x=o(4096),O=o(2504).indexOf,A=o(2560),B=w([].push);e.exports=function(e,i){var o,w=x(e),Q=0,W=[];for(o in w)!$(A,o)&&$(w,o)&&B(W,o);for(;i.length>Q;)$(w,o=i[Q++])&&(~O(W,o)||B(W,o));return W}},1531:function(e,i,o){var w=o(9008),$=o(8256);e.exports=Object.keys||function(e){return w(e,$)}},8912:function(e,i){var o={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,$=w&&!o.call({1:2},1);i.f=$?function(e){var i=w(this,e);return!!i&&i.enumerable}:o},4024:function(e,i,o){var w=o(5288),$=o(3951),x=o(2096);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,i=!1,o={};try{(e=w(Object.prototype,"__proto__","set"))(o,[]),i=o instanceof Array}catch(O){}return function(o,w){return $(o),x(w),i?e(o,w):o.__proto__=w,o}}():void 0)},7032:function(e,i,o){var w=o(16),$=o(4427);e.exports=w?{}.toString:function(){return"[object "+$(this)+"]"}},2104:function(e,i,o){var w=o(8448),$=o(4328),x=o(1632),O=TypeError;e.exports=function(e,i){var o,A;if("string"===i&&$(o=e.toString)&&!x(A=w(o,e)))return A;if($(o=e.valueOf)&&!x(A=w(o,e)))return A;if("string"!==i&&$(o=e.toString)&&!x(A=w(o,e)))return A;throw new O("Can't convert object to primitive value")}},9252:function(e,i,o){var w=o(5232),$=o(1664),x=o(5048),O=o(9392),A=o(3951),B=$([].concat);e.exports=w("Reflect","ownKeys")||function(e){var i=x.f(A(e)),o=O.f;return o?B(i,o(e)):i}},584:function(e,i,o){var w=o(8352).f;e.exports=function(e,i,o){o in e||w(e,o,{configurable:!0,get:function(){return i[o]},set:function(e){i[o]=e}})}},9092:function(e,i,o){var w=o(8448),$=o(3951),x=o(4328),O=o(1888),A=o(7680),B=TypeError;e.exports=function(e,i){var o=e.exec;if(x(o)){var Q=w(o,e,i);return null!==Q&&$(Q),Q}if("RegExp"===O(e))return w(A,e,i);throw new B("RegExp#exec called on incompatible receiver")}},7680:function(e,i,o){var w,$,x=o(8448),O=o(1664),A=o(5016),B=o(8872),Q=o(3548),W=o(4696),K=o(9368),Y=o(9104).get,Z=o(8e3),X=o(9124),J=W("native-string-replace",String.prototype.replace),tt=RegExp.prototype.exec,et=tt,nt=O("".charAt),it=O("".indexOf),ot=O("".replace),rt=O("".slice),st=($=/b*/g,x(tt,w=/a/,"a"),x(tt,$,"a"),0!==w.lastIndex||0!==$.lastIndex),at=Q.BROKEN_CARET,ut=void 0!==/()??/.exec("")[1];(st||ut||at||Z||X)&&(et=function(e){var i,o,w,$,O,Q,W,Z=this,X=Y(Z),ct=A(e),lt=X.raw;if(lt)return lt.lastIndex=Z.lastIndex,i=x(et,lt,ct),Z.lastIndex=lt.lastIndex,i;var ht=X.groups,dt=at&&Z.sticky,pt=x(B,Z),ft=Z.source,mt=0,vt=ct;if(dt&&(pt=ot(pt,"y",""),-1===it(pt,"g")&&(pt+="g"),vt=rt(ct,Z.lastIndex),Z.lastIndex>0&&(!Z.multiline||Z.multiline&&"\n"!==nt(ct,Z.lastIndex-1))&&(ft="(?: "+ft+")",vt=" "+vt,mt++),o=new RegExp("^(?:"+ft+")",pt)),ut&&(o=new RegExp("^"+ft+"$(?!\\s)",pt)),st&&(w=Z.lastIndex),$=x(tt,dt?o:Z,vt),dt?$?($.input=rt($.input,mt),$[0]=rt($[0],mt),$.index=Z.lastIndex,Z.lastIndex+=$[0].length):Z.lastIndex=0:st&&$&&(Z.lastIndex=Z.global?$.index+$[0].length:w),ut&&$&&$.length>1&&x(J,$[0],o,(function(){for(O=1;O<arguments.length-2;O++)void 0===arguments[O]&&($[O]=void 0)})),$&&ht)for($.groups=Q=K(null),O=0;O<ht.length;O++)Q[(W=ht[O])[0]]=$[W[1]];return $}),e.exports=et},8872:function(e,i,o){var w=o(3951);e.exports=function(){var e=w(this),i="";return e.hasIndices&&(i+="d"),e.global&&(i+="g"),e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.dotAll&&(i+="s"),e.unicode&&(i+="u"),e.unicodeSets&&(i+="v"),e.sticky&&(i+="y"),i}},3548:function(e,i,o){var w=o(9957),$=o(6420).RegExp,x=w((function(){var e=$("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),O=x||w((function(){return!$("a","y").sticky})),A=x||w((function(){var e=$("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:A,MISSED_STICKY:O,UNSUPPORTED_Y:x}},8e3:function(e,i,o){var w=o(9957),$=o(6420).RegExp;e.exports=w((function(){var e=$(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},9124:function(e,i,o){var w=o(9957),$=o(6420).RegExp;e.exports=w((function(){var e=$("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},5436:function(e,i,o){var w=o(9760),$=TypeError;e.exports=function(e){if(w(e))throw new $("Can't call method on "+e);return e}},6504:function(e,i,o){var w=o(4696),$=o(7776),x=w("keys");e.exports=function(e){return x[e]||(x[e]=$(e))}},3976:function(e,i,o){var w=o(7048),$=o(6420),x=o(4636),O="__core-js_shared__",A=e.exports=$[O]||x(O,{});(A.versions||(A.versions=[])).push({version:"3.36.0",mode:w?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4696:function(e,i,o){var w=o(3976);e.exports=function(e,i){return w[e]||(w[e]=i||{})}},9764:function(e,i,o){var w=o(1664),$=o(6180),x=o(5016),O=o(5436),A=w("".charAt),B=w("".charCodeAt),Q=w("".slice),l=function(e){return function(i,o){var w,W,K=x(O(i)),Y=$(o),Z=K.length;return Y<0||Y>=Z?e?"":void 0:(w=B(K,Y))<55296||w>56319||Y+1===Z||(W=B(K,Y+1))<56320||W>57343?e?A(K,Y):w:e?Q(K,Y,Y+2):W-56320+(w-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},772:function(e,i,o){var w=o(8504),$=o(9957),x=o(6420).String;e.exports=!!Object.getOwnPropertySymbols&&!$((function(){var e=Symbol("symbol detection");return!x(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&w&&w<41}))},2495:function(e,i,o){var w=o(6180),$=Math.max,x=Math.min;e.exports=function(e,i){var o=w(e);return o<0?$(o+i,0):x(o,i)}},4096:function(e,i,o){var w=o(5712),$=o(5436);e.exports=function(e){return w($(e))}},6180:function(e,i,o){var w=o(1748);e.exports=function(e){var i=+e;return i!=i||0===i?0:w(i)}},7584:function(e,i,o){var w=o(6180),$=Math.min;e.exports=function(e){var i=w(e);return i>0?$(i,9007199254740991):0}},4356:function(e,i,o){var w=o(5436),$=Object;e.exports=function(e){return $(w(e))}},7024:function(e,i,o){var w=o(8448),$=o(1632),x=o(7728),O=o(4504),A=o(2104),B=o(9972),Q=TypeError,W=B("toPrimitive");e.exports=function(e,i){if(!$(e)||x(e))return e;var o,B=O(e,W);if(B){if(void 0===i&&(i="default"),o=w(B,e,i),!$(o)||x(o))return o;throw new Q("Can't convert object to primitive value")}return void 0===i&&(i="number"),A(e,i)}},88:function(e,i,o){var w=o(7024),$=o(7728);e.exports=function(e){var i=w(e,"string");return $(i)?i:i+""}},16:function(e,i,o){var w={};w[o(9972)("toStringTag")]="z",e.exports="[object z]"===String(w)},5016:function(e,i,o){var w=o(4427),$=String;e.exports=function(e){if("Symbol"===w(e))throw new TypeError("Cannot convert a Symbol value to a string");return $(e)}},36:function(e){var i=String;e.exports=function(e){try{return i(e)}catch(n){return"Object"}}},7776:function(e,i,o){var w=o(1664),$=0,x=Math.random(),O=w(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+O(++$+x,36)}},6536:function(e,i,o){var w=o(772);e.exports=w&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:function(e,i,o){var w=o(3476),$=o(9957);e.exports=w&&$((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4288:function(e,i,o){var w=o(6420),$=o(4328),x=w.WeakMap;e.exports=$(x)&&/native code/.test(String(x))},9972:function(e,i,o){var w=o(6420),$=o(4696),x=o(5152),O=o(7776),A=o(772),B=o(6536),Q=w.Symbol,W=$("wks"),K=B?Q.for||Q:Q&&Q.withoutSetter||O;e.exports=function(e){return x(W,e)||(W[e]=A&&x(Q,e)?Q[e]:K("Symbol."+e)),W[e]}},6488:function(e,i,o){var w=o(5232),$=o(5152),x=o(3440),O=o(7e3),A=o(4024),B=o(9968),Q=o(584),W=o(7512),K=o(8948),Y=o(3480),Z=o(3696),X=o(3476),J=o(7048);e.exports=function(e,i,o,tt){var et="stackTraceLimit",nt=tt?2:1,it=e.split("."),ot=it[it.length-1],rt=w.apply(null,it);if(rt){var st=rt.prototype;if(!J&&$(st,"cause")&&delete st.cause,!o)return rt;var at=w("Error"),ut=i((function(e,i){var o=K(tt?i:e,void 0),w=tt?new rt(e):new rt;return void 0!==o&&x(w,"message",o),Z(w,ut,w.stack,2),this&&O(st,this)&&W(w,this,ut),arguments.length>nt&&Y(w,arguments[nt]),w}));if(ut.prototype=st,"Error"!==ot?A?A(ut,at):B(ut,at,{name:!0}):X&&et in rt&&(Q(ut,rt,et),Q(ut,rt,"prepareStackTrace")),B(ut,rt),!J)try{st.name!==ot&&x(st,"name",ot),st.constructor=ut}catch(ct){}return ut}}},7476:function(e,i,o){var w=o(9160),$=o(9957),x=o(1432),O=o(1632),A=o(4356),B=o(3556),Q=o(4316),W=o(92),K=o(2568),Y=o(953),Z=o(9972),X=o(8504),J=Z("isConcatSpreadable"),tt=X>=51||!$((function(){var e=[];return e[J]=!1,e.concat()[0]!==e})),y=function(e){if(!O(e))return!1;var i=e[J];return void 0!==i?!!i:x(e)};w({target:"Array",proto:!0,arity:1,forced:!tt||!Y("concat")},{concat:function(e){var i,o,w,$,x,O=A(this),Y=K(O,0),Z=0;for(i=-1,w=arguments.length;i<w;i++)if(y(x=-1===i?O:arguments[i]))for($=B(x),Q(Z+$),o=0;o<$;o++,Z++)o in x&&W(Y,Z,x[o]);else Q(Z+1),W(Y,Z++,x);return Y.length=Z,Y}})},6932:function(e,i,o){var w=o(9160),$=o(3364).filter;w({target:"Array",proto:!0,forced:!o(953)("filter")},{filter:function(e){return $(this,e,arguments.length>1?arguments[1]:void 0)}})},700:function(e,i,o){var w=o(9160),$=o(1664),x=o(5712),O=o(4096),A=o(1496),B=$([].join);w({target:"Array",proto:!0,forced:x!==Object||!A("join",",")},{join:function(e){return B(O(this),void 0===e?",":e)}})},4456:function(e,i,o){var w=o(9160),$=o(3364).map;w({target:"Array",proto:!0,forced:!o(953)("map")},{map:function(e){return $(this,e,arguments.length>1?arguments[1]:void 0)}})},4728:function(e,i,o){var w=o(9160),$=o(4356),x=o(3556),O=o(6728),A=o(4316);w({target:"Array",proto:!0,arity:1,forced:o(9957)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var i=$(this),o=x(i),w=arguments.length;A(o+w);for(var B=0;B<w;B++)i[o]=arguments[B],o++;return O(i,o),o}})},8752:function(e,i,o){var w=o(9160),$=o(6420),x=o(908),O=o(6488),A="WebAssembly",B=$[A],Q=7!==new Error("e",{cause:7}).cause,l=function(e,i){var o={};o[e]=O(e,i,Q),w({global:!0,constructor:!0,arity:1,forced:Q},o)},f=function(e,i){if(B&&B[e]){var o={};o[e]=O(A+"."+e,i,Q),w({target:A,stat:!0,constructor:!0,arity:1,forced:Q},o)}};l("Error",(function(e){return function(i){return x(e,this,arguments)}})),l("EvalError",(function(e){return function(i){return x(e,this,arguments)}})),l("RangeError",(function(e){return function(i){return x(e,this,arguments)}})),l("ReferenceError",(function(e){return function(i){return x(e,this,arguments)}})),l("SyntaxError",(function(e){return function(i){return x(e,this,arguments)}})),l("TypeError",(function(e){return function(i){return x(e,this,arguments)}})),l("URIError",(function(e){return function(i){return x(e,this,arguments)}})),f("CompileError",(function(e){return function(i){return x(e,this,arguments)}})),f("LinkError",(function(e){return function(i){return x(e,this,arguments)}})),f("RuntimeError",(function(e){return function(i){return x(e,this,arguments)}}))},508:function(e,i,o){var w=o(3476),$=o(6208).EXISTS,x=o(1664),O=o(2544),A=Function.prototype,B=x(A.toString),Q=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,W=x(Q.exec);w&&!$&&O(A,"name",{configurable:!0,get:function(){try{return W(Q,B(this))[1]}catch(e){return""}}})},232:function(e,i,o){var w=o(9160),$=o(9292);w({target:"Object",stat:!0,arity:2,forced:Object.assign!==$},{assign:$})},5443:function(e,i,o){var w=o(16),$=o(6076),x=o(7032);w||$(Object.prototype,"toString",x,{unsafe:!0})},880:function(e,i,o){var w=o(9160),$=o(7680);w({target:"RegExp",proto:!0,forced:/./.exec!==$},{exec:$})},9836:function(e,i,o){var w=o(8448),$=o(7176),x=o(3951),O=o(9760),A=o(7584),B=o(5016),Q=o(5436),W=o(4504),K=o(4764),Y=o(9092);$("match",(function(e,i,o){return[function(i){var o=Q(this),$=O(i)?void 0:W(i,e);return $?w($,i,o):new RegExp(i)[e](B(o))},function(e){var w=x(this),$=B(e),O=o(i,w,$);if(O.done)return O.value;if(!w.global)return Y(w,$);var Q=w.unicode;w.lastIndex=0;for(var W,Z=[],X=0;null!==(W=Y(w,$));){var J=B(W[0]);Z[X]=J,""===J&&(w.lastIndex=K($,A(w.lastIndex),Q)),X++}return 0===X?null:Z}]}))},3536:function(e,i,o){var w=o(9160),$=o(6420),x=o(6100),O=o(3951),A=o(4328),B=o(7796),Q=o(2544),W=o(92),K=o(9957),Y=o(5152),Z=o(9972),X=o(336).IteratorPrototype,J=o(3476),tt=o(7048),et="constructor",nt="Iterator",it=Z("toStringTag"),ot=TypeError,rt=$[nt],st=tt||!A(rt)||rt.prototype!==X||!K((function(){rt({})})),_=function(){if(x(this,X),B(this)===X)throw new ot("Abstract class Iterator not directly constructable")},S=function(e,i){J?Q(X,e,{configurable:!0,get:function(){return i},set:function(i){if(O(this),this===X)throw new ot("You can't redefine this property");Y(this,e)?this[e]=i:W(this,e,i)}}):X[e]=i};Y(X,it)||S(it,nt),!st&&Y(X,et)&&X[et]!==Object||S(et,_),_.prototype=X,w({global:!0,constructor:!0,forced:st},{Iterator:_})},2144:function(e,i,o){var w=o(9160),$=o(8448),x=o(8952),O=o(3951),A=o(6752),B=o(9724),Q=o(8696),W=o(7048),K=B((function(){for(var e,i,o=this.iterator,w=this.predicate,x=this.next;;){if(e=O($(x,o)),this.done=!!e.done)return;if(i=e.value,Q(o,w,[i,this.counter++],!0))return i}}));w({target:"Iterator",proto:!0,real:!0,forced:W},{filter:function(e){return O(this),x(e),new K(A(this),{predicate:e})}})},9080:function(e,i,o){var w=o(9160),$=o(5792);w({target:"Iterator",proto:!0,real:!0,forced:o(7048)},{map:$})}},i={};function n(o){var w=i[o];if(void 0!==w)return w.exports;var $=i[o]={exports:{}};return e[o].call($.exports,$,$.exports,n),$.exports}n.d=function(e,i){for(var o in i)n.o(i,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)};var o={};return function(){n.d(o,{default:function(){return J}}),n(8752),n(6932),n(4456),n(508),n(232),n(5443),n(3536),n(2144),n(9080);var t=function(){},e={},i=[],w=[];function u(o,$){var x,O,A,B,Q=w;for(B=arguments.length;B-- >2;)i.push(arguments[B]);for($&&null!=$.children&&(i.length||i.push($.children),delete $.children);i.length;)if((O=i.pop())&&void 0!==O.pop)for(B=O.length;B--;)i.push(O[B]);else"boolean"==typeof O&&(O=null),(A="function"!=typeof o)&&(null==O?O="":"number"==typeof O?O=String(O):"string"!=typeof O&&(A=!1)),A&&x?Q[Q.length-1]+=O:Q===w?Q=[O]:Q.push(O),x=A;var W=new t;return W.nodeName=o,W.children=Q,W.attributes=null==$?void 0:$,W.key=null==$?void 0:$.key,void 0!==e.vnode&&e.vnode(W),W}function a(e,i){for(var o in i)e[o]=i[o];return e}function c(e,i){e&&("function"==typeof e?e(i):e.current=i)}var $="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,x=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,O=[];function p(i){!i._dirty&&(i._dirty=!0)&&1==O.push(i)&&(e.debounceRendering||$)(d)}function d(){for(var e;e=O.pop();)e._dirty&&T(e)}function h(e,i,o){return"string"==typeof i||"number"==typeof i?void 0!==e.splitText:"string"==typeof i.nodeName?!e._componentConstructor&&v(e,i.nodeName):o||e._componentConstructor===i.nodeName}function v(e,i){return e.normalizedNodeName===i||e.nodeName.toLowerCase()===i.toLowerCase()}function m(e){var i=a({},e.attributes);i.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var w in o)void 0===i[w]&&(i[w]=o[w]);return i}function y(e){var i=e.parentNode;i&&i.removeChild(e)}function g(e,i,o,w,O){if("className"===i&&(i="class"),"key"===i);else if("ref"===i)c(o,null),c(w,e);else if("class"!==i||O)if("style"===i){if(w&&"string"!=typeof w&&"string"!=typeof o||(e.style.cssText=w||""),w&&"object"==typeof w){if("string"!=typeof o)for(var A in o)A in w||(e.style[A]="");for(var A in w)e.style[A]="number"==typeof w[A]&&!1===x.test(A)?w[A]+"px":w[A]}}else if("dangerouslySetInnerHTML"===i)w&&(e.innerHTML=w.__html||"");else if("o"==i[0]&&"n"==i[1]){var B=i!==(i=i.replace(/Capture$/,""));i=i.toLowerCase().substring(2),w?o||e.addEventListener(i,b,B):e.removeEventListener(i,b,B),(e._listeners||(e._listeners={}))[i]=w}else if("list"!==i&&"type"!==i&&!O&&i in e){try{e[i]=null==w?"":w}catch($){}null!=w&&!1!==w||"spellcheck"==i||e.removeAttribute(i)}else{var Q=O&&i!==(i=i.replace(/^xlink:?/,""));null==w||!1===w?Q?e.removeAttributeNS("http://www.w3.org/1999/xlink",i.toLowerCase()):e.removeAttribute(i):"function"!=typeof w&&(Q?e.setAttributeNS("http://www.w3.org/1999/xlink",i.toLowerCase(),w):e.setAttribute(i,w))}else e.className=w||""}function b(i){return this._listeners[i.type](e.event&&e.event(i)||i)}var A=[],B=0,Q=!1,W=!1;function S(){for(var i;i=A.shift();)e.afterMount&&e.afterMount(i),i.componentDidMount&&i.componentDidMount()}function C(e,i,o,w,$,x){B++||(Q=null!=$&&void 0!==$.ownerSVGElement,W=null!=e&&!("__preactattr_"in e));var O=E(e,i,o,w,x);return $&&O.parentNode!==$&&$.appendChild(O),--B||(W=!1,x||S()),O}function E(e,i,o,w,$){var x=e,O=Q;if(null!=i&&"boolean"!=typeof i||(i=""),"string"==typeof i||"number"==typeof i)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||$)?e.nodeValue!=i&&(e.nodeValue=i):(x=document.createTextNode(i),e&&(e.parentNode&&e.parentNode.replaceChild(x,e),I(e,!0))),x.__preactattr_=!0,x;var A,B,K=i.nodeName;if("function"==typeof K)return function(e,i,o,w){for(var $=e&&e._component,x=$,O=e,A=$&&e._componentConstructor===i.nodeName,B=A,Q=m(i);$&&!B&&($=$._parentComponent);)B=$.constructor===i.nodeName;return $&&B&&(!w||$._component)?(k($,Q,3,o,w),e=$.base):(x&&!A&&(R(x),e=O=null),$=P(i.nodeName,Q,o),e&&!$.nextBase&&($.nextBase=e,O=null),k($,Q,1,o,w),e=$.base,O&&e!==O&&(O._component=null,I(O,!1))),e}(e,i,o,w);if(Q="svg"===K||"foreignObject"!==K&&Q,K=String(K),(!e||!v(e,K))&&(A=K,(B=Q?document.createElementNS("http://www.w3.org/2000/svg",A):document.createElement(A)).normalizedNodeName=A,x=B,e)){for(;e.firstChild;)x.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(x,e),I(e,!0)}var Y=x.firstChild,Z=x.__preactattr_,X=i.children;if(null==Z){Z=x.__preactattr_={};for(var J=x.attributes,tt=J.length;tt--;)Z[J[tt].name]=J[tt].value}return!W&&X&&1===X.length&&"string"==typeof X[0]&&null!=Y&&void 0!==Y.splitText&&null==Y.nextSibling?Y.nodeValue!=X[0]&&(Y.nodeValue=X[0]):(X&&X.length||null!=Y)&&function(e,i,o,w,$){var x,O,A,B,Q,W=e.childNodes,K=[],Y={},Z=0,X=0,J=W.length,tt=0,et=i?i.length:0;if(0!==J)for(var nt=0;nt<J;nt++){var it=W[nt],ot=it.__preactattr_;null!=(rt=et&&ot?it._component?it._component.__key:ot.key:null)?(Z++,Y[rt]=it):(ot||(void 0!==it.splitText?!$||it.nodeValue.trim():$))&&(K[tt++]=it)}if(0!==et)for(nt=0;nt<et;nt++){var rt;if(Q=null,null!=(rt=(B=i[nt]).key))Z&&void 0!==Y[rt]&&(Q=Y[rt],Y[rt]=void 0,Z--);else if(X<tt)for(x=X;x<tt;x++)if(void 0!==K[x]&&h(O=K[x],B,$)){Q=O,K[x]=void 0,x===tt-1&&tt--,x===X&&X++;break}Q=E(Q,B,o,w),A=W[nt],Q&&Q!==e&&Q!==A&&(null==A?e.appendChild(Q):Q===A.nextSibling?y(A):e.insertBefore(Q,A))}if(Z)for(var nt in Y)void 0!==Y[nt]&&I(Y[nt],!1);for(;X<=tt;)void 0!==(Q=K[tt--])&&I(Q,!1)}(x,X,o,w,W||null!=Z.dangerouslySetInnerHTML),function(e,i,o){var w;for(w in o)i&&null!=i[w]||null==o[w]||g(e,w,o[w],o[w]=void 0,Q);for(w in i)"children"===w||"innerHTML"===w||w in o&&i[w]===("value"===w||"checked"===w?e[w]:o[w])||g(e,w,o[w],o[w]=i[w],Q)}(x,i.attributes,Z),Q=O,x}function I(e,i){var o=e._component;o?R(o):(null!=e.__preactattr_&&c(e.__preactattr_.ref,null),!1!==i&&null!=e.__preactattr_||y(e),j(e))}function j(e){for(e=e.lastChild;e;){var i=e.previousSibling;I(e,!0),e=i}}var K=[];function P(e,i,o){var w,$=K.length;for(e.prototype&&e.prototype.render?(w=new e(i,o),M.call(w,i,o)):((w=new M(i,o)).constructor=e,w.render=N);$--;)if(K[$].constructor===e)return w.nextBase=K[$].nextBase,K.splice($,1),w;return w}function N(e,i,o){return this.constructor(e,o)}function k(i,o,w,$,x){i._disable||(i._disable=!0,i.__ref=o.ref,i.__key=o.key,delete o.ref,delete o.key,void 0===i.constructor.getDerivedStateFromProps&&(!i.base||x?i.componentWillMount&&i.componentWillMount():i.componentWillReceiveProps&&i.componentWillReceiveProps(o,$)),$&&$!==i.context&&(i.prevContext||(i.prevContext=i.context),i.context=$),i.prevProps||(i.prevProps=i.props),i.props=o,i._disable=!1,0!==w&&(1!==w&&!1===e.syncComponentUpdates&&i.base?p(i):T(i,1,x)),c(i.__ref,i))}function T(i,o,w,$){if(!i._disable){var x,O,Q,W=i.props,K=i.state,Y=i.context,Z=i.prevProps||W,X=i.prevState||K,J=i.prevContext||Y,tt=i.base,et=i.nextBase,nt=tt||et,it=i._component,ot=!1,rt=J;if(i.constructor.getDerivedStateFromProps&&(K=a(a({},K),i.constructor.getDerivedStateFromProps(W,K)),i.state=K),tt&&(i.props=Z,i.state=X,i.context=J,2!==o&&i.shouldComponentUpdate&&!1===i.shouldComponentUpdate(W,K,Y)?ot=!0:i.componentWillUpdate&&i.componentWillUpdate(W,K,Y),i.props=W,i.state=K,i.context=Y),i.prevProps=i.prevState=i.prevContext=i.nextBase=null,i._dirty=!1,!ot){x=i.render(W,K,Y),i.getChildContext&&(Y=a(a({},Y),i.getChildContext())),tt&&i.getSnapshotBeforeUpdate&&(rt=i.getSnapshotBeforeUpdate(Z,X));var st,at,ut=x&&x.nodeName;if("function"==typeof ut){var ct=m(x);(O=it)&&O.constructor===ut&&ct.key==O.__key?k(O,ct,1,Y,!1):(st=O,i._component=O=P(ut,ct,Y),O.nextBase=O.nextBase||et,O._parentComponent=i,k(O,ct,0,Y,!1),T(O,1,w,!0)),at=O.base}else Q=nt,(st=it)&&(Q=i._component=null),(nt||1===o)&&(Q&&(Q._component=null),at=C(Q,x,Y,w||!tt,nt&&nt.parentNode,!0));if(nt&&at!==nt&&O!==it){var lt=nt.parentNode;lt&&at!==lt&&(lt.replaceChild(at,nt),st||(nt._component=null,I(nt,!1)))}if(st&&R(st),i.base=at,at&&!$){for(var ht=i,dt=i;dt=dt._parentComponent;)(ht=dt).base=at;at._component=ht,at._componentConstructor=ht.constructor}}for(!tt||w?A.push(i):ot||(i.componentDidUpdate&&i.componentDidUpdate(Z,X,rt),e.afterUpdate&&e.afterUpdate(i));i._renderCallbacks.length;)i._renderCallbacks.pop().call(i);B||$||S()}}function R(i){e.beforeUnmount&&e.beforeUnmount(i);var o=i.base;i._disable=!0,i.componentWillUnmount&&i.componentWillUnmount(),i.base=null;var w=i._component;w?R(w):o&&(null!=o.__preactattr_&&c(o.__preactattr_.ref,null),i.nextBase=o,y(o),K.push(i),j(o)),c(i.__ref,null)}function M(e,i){this._dirty=!0,this.context=i,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}function L(e,i,o){return C(o,e,{},!1,i,!1)}function D(e,i){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,i){return e.__proto__=i,e},D(e,i)}a(M.prototype,{setState:function(e,i){this.prevState||(this.prevState=this.state),this.state=a(a({},this.state),"function"==typeof e?e(this.state,this.props):e),i&&this._renderCallbacks.push(i),p(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),T(this,2)},render:function(){}}),n(700),n(4728),n(880),n(9836),n(7476);var Y=function(e){var i,o;function r(){for(var i,o=arguments.length,w=new Array(o),$=0;$<o;$++)w[$]=arguments[$];return(i=e.call.apply(e,[this].concat(w))||this).state={bump:!1,debounced:!1},i}o=e,(i=r).prototype=Object.create(o.prototype),i.prototype.constructor=i,D(i,o);var w=r.prototype;return w.componentWillMount=function(){var e,i,o,w=this;this.debounceStatusUpdate=(e=function(){if(!w.state.debounced){var e=!w.props.isInFocus||w.props.validChoiceMade;w.setState((function(i){return{bump:!i.bump,debounced:!0,silenced:e}}))}},i=1400,function(){var w=this,$=arguments;clearTimeout(o),o=setTimeout((function(){o=null,e.apply(w,$)}),i)})},w.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1})},w.render=function(){var e=this.props,i=e.id,o=e.length,w=e.queryLength,$=e.minQueryLength,x=e.selectedOption,O=e.selectedOptionIndex,A=e.tQueryTooShort,B=e.tNoResults,Q=e.tSelectedOption,W=e.tResults,K=e.className,Y=this.state,Z=Y.bump,X=Y.debounced,J=Y.silenced,tt=w<$,et=0===o,nt=x?Q(x,o,O):"",it=null;return it=tt?A($):et?B():W(o,nt),this.debounceStatusUpdate(),u("div",{className:K,style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},u("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!J&&X&&Z?it:""),u("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},J||!X||Z?"":it))},r}(M);Y.defaultProps={tQueryTooShort:function(e){return"Type in "+e+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(e,i,o){return e+" "+(o+1)+" of "+i+" is highlighted"},tResults:function(e,i){return e+" "+(1===e?"result":"results")+" "+(1===e?"is":"are")+" available. "+i}};var F=function(e){return u("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e.className,focusable:"false"},u("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},u("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};function U(){return U=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var w in o)Object.prototype.hasOwnProperty.call(o,w)&&(e[w]=o[w])}return e},U.apply(this,arguments)}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,i){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,i){return e.__proto__=i,e},q(e,i)}var Z={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function H(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var X=function(e){var i,o;function r(i){var o;return(o=e.call(this,i)||this).elementReferences={},o.state={focused:null,hovered:null,menuOpen:!1,options:i.defaultValue?[i.defaultValue]:[],query:i.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},o.handleComponentBlur=o.handleComponentBlur.bind(V(o)),o.handleKeyDown=o.handleKeyDown.bind(V(o)),o.handleUpArrow=o.handleUpArrow.bind(V(o)),o.handleDownArrow=o.handleDownArrow.bind(V(o)),o.handleEnter=o.handleEnter.bind(V(o)),o.handlePrintableKey=o.handlePrintableKey.bind(V(o)),o.handleListMouseLeave=o.handleListMouseLeave.bind(V(o)),o.handleOptionBlur=o.handleOptionBlur.bind(V(o)),o.handleOptionClick=o.handleOptionClick.bind(V(o)),o.handleOptionFocus=o.handleOptionFocus.bind(V(o)),o.handleOptionMouseDown=o.handleOptionMouseDown.bind(V(o)),o.handleOptionMouseEnter=o.handleOptionMouseEnter.bind(V(o)),o.handleInputBlur=o.handleInputBlur.bind(V(o)),o.handleInputChange=o.handleInputChange.bind(V(o)),o.handleInputClick=o.handleInputClick.bind(V(o)),o.handleInputFocus=o.handleInputFocus.bind(V(o)),o.pollInputElement=o.pollInputElement.bind(V(o)),o.getDirectInputChanges=o.getDirectInputChanges.bind(V(o)),o}o=e,(i=r).prototype=Object.create(o.prototype),i.prototype.constructor=i,q(i,o);var w=r.prototype;return w.isQueryAnOption=function(e,i){var o=this;return-1!==i.map((function(e){return o.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())},w.componentDidMount=function(){this.pollInputElement()},w.componentWillUnmount=function(){clearTimeout(this.$pollInput)},w.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement()}),100)},w.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},w.componentDidUpdate=function(e,i){var o=this.state.focused,w=null===o,$=i.focused!==o;$&&!w&&this.elementReferences[o].focus();var x=-1===o,O=$&&null===i.focused;if(x&&O){var A=this.elementReferences[o];A.setSelectionRange(0,A.value.length)}},w.hasAutoselect=function(){return!H()&&this.props.autoselect},w.templateInputValue=function(e){var i=this.props.templates&&this.props.templates.inputValue;return i?i(e):e},w.templateSuggestion=function(e){var i=this.props.templates&&this.props.templates.suggestion;return i?i(e):e},w.handleComponentBlur=function(e){var i,o=this.state,w=o.options,$=o.query,x=o.selected;this.props.confirmOnBlur?(i=e.query||$,this.props.onConfirm(w[x])):i=$,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:i,selected:null,validChoiceMade:this.isQueryAnOption(i,w)})},w.handleListMouseLeave=function(e){this.setState({hovered:null})},w.handleOptionBlur=function(e,i){var o=this.state,w=o.focused,$=o.menuOpen,x=o.options,O=o.selected,A=null===e.relatedTarget,B=e.relatedTarget===this.elementReferences[-1],Q=w!==i&&-1!==w;if(!Q&&A||!Q&&!B){var W=$&&H();this.handleComponentBlur({menuOpen:W,query:this.templateInputValue(x[O])})}},w.handleInputBlur=function(e){var i=this.state,o=i.focused,w=i.menuOpen,$=i.options,x=i.query,O=i.selected;if(-1===o){var A=w&&H(),B=H()?x:this.templateInputValue($[O]);this.handleComponentBlur({menuOpen:A,query:B})}},w.handleInputChange=function(e){var i=this,o=this.props,w=o.minLength,$=o.source,x=o.showAllValues,O=this.hasAutoselect(),A=e.target.value,B=0===A.length,Q=this.state.query!==A,W=A.length>=w;this.setState({query:A,ariaHint:B}),x||!B&&Q&&W?$(A,(function(e){var o=e.length>0;i.setState({menuOpen:o,options:e,selected:O&&o?0:-1,validChoiceMade:!1})})):!B&&W||this.setState({menuOpen:!1,options:[]})},w.handleInputClick=function(e){this.handleInputChange(e)},w.handleInputFocus=function(e){var i=this.state,o=i.query,w=i.validChoiceMade,$=i.options,x=this.props.minLength,O=!w&&o.length>=x&&$.length>0;O?this.setState((function(e){var i=e.menuOpen;return{focused:-1,menuOpen:O||i,selected:-1}})):this.setState({focused:-1})},w.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},w.handleOptionMouseEnter=function(e,i){H()||this.setState({hovered:i})},w.handleOptionClick=function(e,i){var o=this.state.options[i],w=this.templateInputValue(o);this.props.onConfirm(o),this.setState({focused:-1,hovered:null,menuOpen:!1,query:w,selected:-1,validChoiceMade:!0}),this.forceUpdate()},w.handleOptionMouseDown=function(e){e.preventDefault()},w.handleUpArrow=function(e){e.preventDefault();var i=this.state,o=i.menuOpen,w=i.selected;-1!==w&&o&&this.handleOptionFocus(w-1)},w.handleDownArrow=function(e){var i=this;if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source("",(function(e){i.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var o=this.state,w=o.menuOpen,$=o.options,x=o.selected;x!==$.length-1&&w&&this.handleOptionFocus(x+1)}},w.handleSpace=function(e){var i=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(e.preventDefault(),this.props.source("",(function(e){i.setState({menuOpen:!0,options:e})}))),-1!==this.state.focused&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused))},w.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},w.handlePrintableKey=function(e){var i=this.elementReferences[-1];e.target===i||i.focus()},w.handleKeyDown=function(e){switch(Z[e.keyCode]){case"up":this.handleUpArrow(e);break;case"down":this.handleDownArrow(e);break;case"space":this.handleSpace(e);break;case"enter":this.handleEnter(e);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:((i=e.keyCode)>47&&i<58||32===i||8===i||i>64&&i<91||i>95&&i<112||i>185&&i<193||i>218&&i<223)&&this.handlePrintableKey(e)}var i},w.render=function(){var e,i=this,o=this.props,w=o.cssNamespace,$=o.displayMenu,x=o.id,O=o.minLength,A=o.name,B=o.placeholder,Q=o.required,W=o.showAllValues,K=o.tNoResults,Z=o.tStatusQueryTooShort,X=o.tStatusNoResults,J=o.tStatusSelectedOption,tt=o.tStatusResults,et=o.tAssistiveHint,nt=o.dropdownArrow,it=o.menuAttributes,ot=o.inputClasses,rt=o.hintClasses,st=o.menuClasses,at=this.state,ut=at.focused,ct=at.hovered,lt=at.menuOpen,ht=at.options,dt=at.query,pt=at.selected,ft=at.ariaHint,mt=at.validChoiceMade,vt=this.hasAutoselect(),gt=-1===ut,bt=0===ht.length,yt=0!==dt.length,wt=dt.length>=O,Ct=this.props.showNoOptionsFound&>&&bt&&yt&&wt,$t=w+"__wrapper",xt=w+"__status",Lt=w+"__dropdown-arrow-down",kt=-1!==ut&&null!==ut,_t=w+"__option",It=w+"__hint",Rt=this.templateInputValue(ht[pt]),Ot=Rt&&0===Rt.toLowerCase().indexOf(dt.toLowerCase())&&vt?dt+Rt.substr(dt.length):"",St=x+"__assistiveHint",Et={"aria-describedby":ft?St:null,"aria-expanded":lt?"true":"false","aria-activedescendant":kt?x+"__option--"+ut:null,"aria-controls":x+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"};W&&"string"==typeof(e=nt({className:Lt}))&&(e=u("div",{className:w+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}}));var Tt=w+"__input",At=[Tt,this.props.showAllValues?Tt+"--show-all-values":Tt+"--default"];null!==ut&&At.push(Tt+"--focused"),ot&&At.push(ot);var Bt=w+"__menu",Nt=[Bt,Bt+"--"+$,Bt+"--"+(lt||Ct?"visible":"hidden")];st&&Nt.push(st),(null!=it&&it.class||null!=it&&it.className)&&Nt.push((null==it?void 0:it.class)||(null==it?void 0:it.className));var jt=Object.assign({"aria-labelledby":x},it,{id:x+"__listbox",role:"listbox",className:Nt.join(" "),onMouseLeave:this.handleListMouseLeave});return delete jt.class,u("div",{className:$t,onKeyDown:this.handleKeyDown},u(Y,{id:x,length:ht.length,queryLength:dt.length,minQueryLength:O,selectedOption:this.templateInputValue(ht[pt]),selectedOptionIndex:pt,validChoiceMade:mt,isInFocus:null!==this.state.focused,tQueryTooShort:Z,tNoResults:X,tSelectedOption:J,tResults:tt,className:xt}),Ot&&u("span",null,u("input",{className:[It,null===rt?ot:rt].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:Ot})),u("input",U({},Et,{autoComplete:"off",className:At.join(" "),id:x,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:A,placeholder:B,ref:function(e){i.elementReferences[-1]=e},type:"text",role:"combobox",required:Q,value:dt})),e,u("ul",jt,ht.map((function(e,o){var w=(-1===ut?pt===o:ut===o)&&null===ct?" "+_t+"--focused":"",$=o%2?" "+_t+"--odd":"",O=H()?"<span id="+x+"__option-suffix--"+o+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(o+1)+" of "+ht.length+"</span>":"";return u("li",{"aria-selected":ut===o?"true":"false",className:""+_t+w+$,dangerouslySetInnerHTML:{__html:i.templateSuggestion(e)+O},id:x+"__option--"+o,key:o,onBlur:function(e){return i.handleOptionBlur(e,o)},onClick:function(e){return i.handleOptionClick(e,o)},onMouseDown:i.handleOptionMouseDown,onMouseEnter:function(e){return i.handleOptionMouseEnter(e,o)},ref:function(e){i.elementReferences[o]=e},role:"option",tabIndex:"-1","aria-posinset":o+1,"aria-setsize":ht.length})})),Ct&&u("li",{className:_t+" "+_t+"--no-results",role:"option","aria-disabled":"true"},K())),u("span",{id:St,style:{display:"none"}},et()))},r}(M);function z(e){if(!e.element)throw new Error("element is not defined");if(!e.id)throw new Error("id is not defined");if(!e.source)throw new Error("source is not defined");Array.isArray(e.source)&&(e.source=G(e.source)),L(u(X,e),e.element)}X.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:F,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};var G=function(e){return function(i,o){o(e.filter((function(e){return-1!==e.toLowerCase().indexOf(i.toLowerCase())})))}};z.enhanceSelectElement=function(e){if(!e.selectElement)throw new Error("selectElement is not defined");if(!e.source){var i=[].filter.call(e.selectElement.options,(function(i){return i.value||e.preserveNullOptions}));e.source=i.map((function(e){return e.textContent||e.innerText}))}if(e.onConfirm=e.onConfirm||function(i){var o=[].filter.call(e.selectElement.options,(function(e){return(e.textContent||e.innerText)===i}))[0];o&&(o.selected=!0)},e.selectElement.value||void 0===e.defaultValue){var o=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=o.textContent||o.innerText}void 0===e.name&&(e.name=""),void 0===e.id&&(void 0===e.selectElement.id?e.id="":e.id=e.selectElement.id),void 0===e.autoselect&&(e.autoselect=!0);var w=document.createElement("div");e.selectElement.parentNode.insertBefore(w,e.selectElement),z(Object.assign({},e,{element:w})),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select"};var J=z}(),o.default}()),et.exports));class SelectCountryFromForm{static moduleName="dm-select-country-from-form";$module;constructor(e){this.$module=e}init(){nt.enhanceSelectElement({selectElement:this.$module.get(0)})}}const createAll=e=>{$(`[data-module="${e.moduleName}"]`).each(((i,o)=>{new e($(o)).init()}))},initAll=()=>{[ComplianceCommunicationAttachments,CookieSettings,CookieBanner,ListInput,OptionSelect,QuestionCheckboxTree,QuestionList,QuestionListMultiquestionClientSide,Question,SearchBox,SelectCountryFromForm].forEach((e=>{createAll(e)})),initGoogleAnalytics()};export{ComplianceCommunicationAttachments,CookieBanner,CookieSettings,ListInput,OptionSelect,Question,QuestionCheckboxTree,QuestionList,QuestionListMultiquestionClientSide,SearchBox,SelectCountryFromForm,createAll,initAll,initGoogleAnalytics,version};//# sourceMappingURL=digitalmarketplace-frontend.min.js.map