vendor: 5,047 bytes, line 1
1import"./bootstrap-Bj43h_rG.js";import{i as ze,C as Xe,m as Qe}from"./light-border-BNaWlZoc.js";/* empty css *//*! choices.js v11.1.0 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */var oe=function(s,e){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},oe(s,e)};function Ne(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");oe(s,e);function t(){this.constructor=s}s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var I=function(){return I=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},I.apply(this,arguments)};function Ze(s,e,t){for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return s.concat(o||Array.prototype.slice.call(e))}var b={ADD_CHOICE:"ADD_CHOICE",REMOVE_CHOICE:"REMOVE_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM"},C={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},E={TAB_KEY:9,SHIFT_KEY:16,BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},et=["fuseOptions","classNames"],R={Text:"text",SelectOne:"select-one",SelectMultiple:"select-multiple"},ve=function(s){return{type:b.ADD_CHOICE,choice:s}},tt=function(s){return{type:b.REMOVE_CHOICE,choice:s}},it=function(s){return{type:b.FILTER_CHOICES,results:s}},st=function(s){return{type:b.ACTIVATE_CHOICES,active:s}},nt=function(s){return{type:b.ADD_GROUP,group:s}},_e=function(s){return{type:b.ADD_ITEM,item:s}},ye=function(s){return{type:b.REMOVE_ITEM,item:s}},z=function(s,e){return{type:b.HIGHLIGHT_ITEM,item:s,highlighted:e}},rt=function(s,e){return Math.floor(Math.random()*(e-s)+s)},be=function(s){return Array.from({length:s},function(){return rt(0,36).toString(36)}).join("")},ot=function(s,e){var t=s.id||s.name&&"".concat(s.name,"-").concat(be(2))||be(4);return t=t.replace(/(:|\.|\[|\]|,)/g,""),t="".concat(e,"-").concat(t),t},at=function(s,e,t){t===void 0&&(t=1);for(var i="".concat(t>0?"next":"previous","ElementSibling"),n=s[i];n;){if(n.matches(e))return n;n=n[i]}return null},lt=function(s,e,t){t===void 0&&(t=1);var i;return t>0?i=e.scrollTop+e.offsetHeight>=s.offsetTop+s.offsetHeight:i=s.offsetTop>=e.scrollTop,i},Z=function(s){if(typeof s!="string"){if(s==null)return"";if(typeof s=="object"){if("raw"in s)return Z(s.raw);if("trusted"in s)return s.trusted}return s}return s.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""")},ct=function(){var s=document.createElement("div");return function(e){s.innerHTML=e.trim();for(var t=s.children[0];s.firstChild;)s.removeChild(s.firstChild);return t}}(),q=function(s,e){return typeof s=="function"?s(Z(e),e):s},Se=function(s){return typeof s=="function"?s():s},V=function(s){if(typeof s=="string")return s;if(typeof s=="object"){if("trusted"in s)return s.trusted;if("raw"in s)return s.raw}return""},Pe=function(s){if(typeof s=="string")return s;if(typeof s=="object"){if("escaped"in s)return s.escaped;if("trusted"in s)return s.trusted}return""},fe=function(s,e){return s?Pe(e):Z(e)},M=function(s,e,t){s.innerHTML=fe(e,t)},ht=function(s,e){var t=s.value,i=s.label,n=i===void 0?t:i,o=e.value,r=e.label,a=r===void 0?o:r;return V(n).localeCompare(V(a),[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},ut=function(s,e){return s.rank-e.rank},dt=function(s,e,t){t===void 0&&(t=null);var i=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return s.dispatchEvent(i)},ft=function(s,e){var t=Object.keys(s).sort(),i=Object.keys(e).sort();return t.filter(function(n){return i.indexOf(n)<0})},ee=function(s){return Array.isArray(s)?s:[s]},Y=function(s){return s&&Array.isArray(s)?s.map(function(e){return".".concat(e)}).join(""):".".concat(s)},v=function(s,e){var t;(t=s.classList).add.apply(t,ee(e))},L=function(s,e){var t;(t=s.classList).remove.apply(t,ee(e))},pt=function(s){if(typeof s<"u")try{return JSON.parse(s)}catch{return s}return{}},mt=function(s,e,t){var i=s.itemEl;i&&(L(i,t),v(i,e))},gt=function(){function s(e){var t=e.element,i=e.type,n=e.classNames;this.element=t,this.classNames=n,this.type=i,this.isActive=!1}return s.prototype.show=function(){return v(this.element,this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},s.prototype.hide=function(){return L(this.element,this.classNames.activeState),this.element.setAttribute("aria-expanded","fal
1se"),this.isActive=!1,this},s}(),Ee=function(){function s(e){var t=e.element,i=e.type,n=e.classNames,o=e.position;this.element=t,this.classNames=n,this.type=i,this.position=o,this.isOpen=!1,this.isFlipped=!1,this.isDisabled=!1,this.isLoading=!1}return s.prototype.shouldFlip=function(e,t){var i=!1;return this.position==="auto"?i=this.element.getBoundingClientRect().top-t>=0&&!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:this.position==="top"&&(i=!0),i},s.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},s.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},s.prototype.open=function(e,t){v(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t)&&(v(this.element,this.classNames.flippedState),this.isFlipped=!0)},s.prototype.close=function(){L(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(L(this.element,this.classNames.flippedState),this.isFlipped=!1)},s.prototype.addFocusState=function(){v(this.element,this.classNames.focusState)},s.prototype.removeFocusState=function(){L(this.element,this.classNames.focusState)},s.prototype.enable=function(){L(this.element,this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===R.SelectOne&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},s.prototype.disable=function(){v(this.element,this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===R.SelectOne&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},s.prototype.wrap=function(e){var t=this.element,i=e.parentNode;i&&(e.nextSibling?i.insertBefore(t,e.nextSibling):i.appendChild(t)),t.appendChild(e)},s.prototype.unwrap=function(e){var t=this.element,i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))},s.prototype.addLoadingState=function(){v(this.element,this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},s.prototype.removeLoadingState=function(){L(this.element,this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},s}(),vt=function(){function s(e){var t=e.element,i=e.type,n=e.classNames,o=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=o,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(s.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),s.prototype.addEventListeners=function(){var e=this.element;e.addEventListener("paste",this._onPaste),e.addEventListener("input",this._onInput,{passive:!0}),e.addEventListener("focus",this._onFocus,{passive:!0}),e.addEventListener("blur",this._onBlur,{passive:!0})},s.prototype.removeEventListeners=function(){var e=this.element;e.removeEventListener("input",this._onInput),e.removeEventListener("paste",this._onPaste),e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur)},s.prototype.enable=function(){var e=this.element;e.removeAttribute("disabled"),this.isDisabled=!1},s.prototype.disable=function(){var e=this.element;e.setAttribute("disabled",""),this.isDisabled=!0},s.prototype.focus=function(){this.isFocussed||this.element.focus()},s.prototype.blur=function(){this.isFocussed&&this.element.blur()},s.prototype.clear=function(e){return e===void 0&&(e=!0),this.element.value="",e&&this.setWidth(),this},s.prototype.setWidth=function(){var e=this.element;e.style.minWidth="".concat(e.placeholder.length+1,"ch"),e.style.width="".concat(e.value.length+1,"ch")},s.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},s.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},s.prototype._onInput=function(){this.type!==R.SelectOne&&this.setWidth()},s.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},s.prototype._onFocus=function(){this.isFocussed=!0},s.prototype._onBlur=function(){this.isFocussed=!1},s}(),_t=4,we=function(){function s(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return s.prototype.prepend=function(e){var t=this.element.firstElementChild;t?this.element.insertBefore(e,t):this.element.append(e)},s.prototype.scrollToTop=function(){this.element.scrollTop=0},s.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=this.element.offsetHeight,o=this.element.scrollTop+n,r=e.offsetHeight,a=e.offsetTop+r,l=t>0?this.element.scrollTop+a-o:e.offsetTop;requestAnimationFrame(function(){i._animateScroll(l,t)})}},s.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,o=n>1?n:1;this.element.scrollTop=e+o},s.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,o=n>1?n:1;this.element.scrollTop=e-o},s.prototype._animateScroll=function(e,t){var i=this,n=_t,o=this.element.scrollTop,r
vendor: 63,671 bytes, line 1
1=!1;t>0?(this._scrollDown(o,n,e),o<e&&(r=!0)):(this._scrollUp(o,n,e),o>e&&(r=!0)),r&&requestAnimationFrame(function(){i._animateScroll(e,t)})},s}(),Fe=function(){function s(e){var t=e.element,i=e.classNames;this.element=t,this.classNames=i,this.isDisabled=!1}return Object.defineProperty(s.prototype,"isActive",{get:function(){return this.element.dataset.choice==="active"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),s.prototype.conceal=function(){var e=this.element;v(e,this.classNames.input),e.hidden=!0,e.tabIndex=-1;var t=e.getAttribute("style");t&&e.setAttribute("data-choice-orig-style",t),e.setAttribute("data-choice","active")},s.prototype.reveal=function(){var e=this.element;L(e,this.classNames.input),e.hidden=!1,e.removeAttribute("tabindex");var t=e.getAttribute("data-choice-orig-style");t?(e.removeAttribute("data-choice-orig-style"),e.setAttribute("style",t)):e.removeAttribute("style"),e.removeAttribute("data-choice")},s.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},s.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},s.prototype.triggerEvent=function(e,t){dt(this.element,e,t||{})},s}(),yt=function(s){Ne(e,s);function e(){return s!==null&&s.apply(this,arguments)||this}return e}(Fe),U=function(s,e){return e===void 0&&(e=!0),typeof s>"u"?e:!!s},Re=function(s){if(typeof s=="string"&&(s=s.split(" ").filter(function(e){return e.length})),Array.isArray(s)&&s.length)return s},k=function(s,e,t){if(t===void 0&&(t=!0),typeof s=="string"){var i=Z(s),n=t||i===s?s:{escaped:i,raw:s},o=k({value:s,label:n,selected:!0},!1);return o}var r=s;if("choices"in r){if(!e)throw new TypeError("optGroup is not allowed");var a=r,l=a.choices.map(function(f){return k(f,!1)}),c={id:0,label:V(a.label)||a.value,active:!!l.length,disabled:!!a.disabled,choices:l};return c}var h=r,u={id:0,group:null,score:0,rank:0,value:h.value,label:h.label||h.value,active:U(h.active),selected:U(h.selected,!1),disabled:U(h.disabled,!1),placeholder:U(h.placeholder,!1),highlighted:!1,labelClass:Re(h.labelClass),labelDescription:h.labelDescription,customProperties:h.customProperties};return u},bt=function(s){return s.tagName==="INPUT"},He=function(s){return s.tagName==="SELECT"},St=function(s){return s.tagName==="OPTION"},Et=function(s){return s.tagName==="OPTGROUP"},wt=function(s){Ne(e,s);function e(t){var i=t.element,n=t.classNames,o=t.template,r=t.extractPlaceholder,a=s.call(this,{element:i,classNames:n})||this;return a.template=o,a.extractPlaceholder=r,a}return Object.defineProperty(e.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),e.prototype.addOptions=function(t){var i=this,n=document.createDocumentFragment();t.forEach(function(o){var r=o;if(!r.element){var a=i.template(r);n.appendChild(a),r.element=a}}),this.element.appendChild(n)},e.prototype.optionsAsChoices=function(){var t=this,i=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach(function(n){St(n)?i.push(t._optionToChoice(n)):Et(n)&&i.push(t._optgroupToChoice(n))}),i},e.prototype._optionToChoice=function(t){return!t.hasAttribute("value")&&t.hasAttribute("placeholder")&&(t.setAttribute("value",""),t.value=""),{id:0,group:null,score:0,rank:0,value:t.value,label:t.label,element:t,active:!0,selected:this.extractPlaceholder?t.selected:t.hasAttribute("selected"),disabled:t.disabled,highlighted:!1,placeholder:this.extractPlaceholder&&(!t.value||t.hasAttribute("placeholder")),labelClass:typeof t.dataset.labelClass<"u"?Re(t.dataset.labelClass):void 0,labelDescription:typeof t.dataset.labelDescription<"u"?t.dataset.labelDescription:void 0,customProperties:pt(t.dataset.customProperties)}},e.prototype._optgroupToChoice=function(t){var i=this,n=t.querySelectorAll("option"),o=Array.from(n).map(function(r){return i._optionToChoice(r)});return{id:0,label:t.label||"",element:t,active:!!o.length,disabled:t.disabled,choices:o}},e}(Fe),Dt={containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],notice:["choices__notice"],addChoice:["choices__item--selectable","add-choice"],noResults:["has-no-results"],noChoices:["has-no-choices"]},De={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,closeDropdownOnSelect:"auto",singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(s){return!!s&&s!==""},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:ht,shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(s){return'Press Enter to add <b>"'.concat(s,'"</b>')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(s){return"Remove item: ".concat(s)},maxItemText:function(s){return"Only ".concat(s," values can be added")},valueComparer:function(s,e){return s===e},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:Dt,appendGroupInSearch:!1},Ce=function(s){var e=s.itemEl;e&&(e.remove(),s.itemEl=void 0)};function Ct(s,e,t){var i=s,n=!0;switch(e.type){case b.ADD_ITEM:{e.item.selected=!0;var o=e.item.element;o&&(o.selected=!0,o.setAttribute("selected","")),i.push(e.item);break}case b.REMOVE_ITEM:{e.item.selected=!1;var o=e.item.element;if(o){o.selected=!1,o.removeAttribute("selected");var r=o.parentElement;r&&He(r)&&r.type===R.SelectOne&&(r.value="")}Ce(e.item),i=i.filter(function(h){return h.id!==e.item.id});break}case b.REMOVE_CHOICE:{Ce(e.choice),i=i.filter(function(c){return c.id!==e.choice.id});break}case b.HIGHLIGHT_ITEM:{var a=e.highlighted,l=i.find(function(c){return c.id===e.item.id});l&&l.highlighted!==a&&(l.highlighted=a,t&&mt(l,a?t.classNames.highlightedState:t.classNames.selectedState,a?t.classNames.selectedState:t.classNames.highlightedState));break}default:{n=!1;break}}return{state:i,update:n}}function It(s,e){var t=s,i=!0;switch(e.type){case b.ADD_GROUP:{t.push(e.group);break}case b.CLEAR_CHOICES:{t=[];break}default:{i=!1;break}}return{state:t,update:i}}function At(s,e,t){var i=s,n=!0;switch(e.type){case b.ADD_CHOICE:{i.push(e.choice);break}case b.REMOVE_CHOICE:{e.choice.choiceEl=void 0,e.choice.group&&(e.choice.group.choices=e.choice.group.choices.filter(function(r){return r.id!==e.choice.id})),i=i.filter(function(r){return r.id!==e.choice.id});break}case b.ADD_ITEM:case b.REMOVE_ITEM:{e.item.choiceEl=void 0;break}case b.FILTER_CHOICES:{var o=[];e.results.forEach(function(r){o[r.item.id]=r}),i.forEach(function(r){var a=o[r.id];a!==void 0?(r.score=a.score,r.rank=a.rank,r.active=!0):(r.score=0,r.rank=0,r.active=!1),t&&t.appendGroupInSearch&&(r.choiceEl=void 0)});break}case b.ACTIVATE_CHOICES:{i.forEach(function(r){r.active=e.active,t&&t.appendGroupInSearch&&(r.choiceEl=void 0)});break}case b.CLEAR_CHOICES:{i=[];break}default:{n=!1;break}}return{state:i,update:n}}var Ie={groups:It,items:Ct,choices:At},Ot=function(){function s(e){this._state=this.defaultState,this._listeners=[],this._txn=0,this._context=e}return Object.defineProperty(s.prototype,"defaultState",{get:function(){return{groups:[],items:[],choices:[]}},enumerable:!1,configurable:!0}),s.prototype.changeSet=function(e){return{groups:e,items:e,choices:e}},s.prototype.reset=function(){this._state=this.defaultState;var e=this.changeSet(!0);this._txn?this._changeSet=e:this._listeners.forEach(function(t){return t(e)})},s.prototype.subscribe=function(e){return this._listeners.push(e),this},s.prototype.dispatch=function(e){var t=this,i=this._state,n=!1,o=this._changeSet||this.changeSet(!1);Object.keys(Ie).forEach(function(r){var a=Ie[r](i[r],e,t._context);a.update&&(n=!0,o[r]=!0,i[r]=a.state)}),n&&(this._txn?this._changeSet=o:this._listeners.forEach(function(r){return r(o)}))},s.prototype.withTxn=function(e){this._txn++;try{e()}finally{if(this._txn=Math.max(0,this._txn-1),!this._txn){var t=this._changeSet;t&&(this._changeSet=void 0,this._listeners.forEach(function(i){return i(t)}))}}},Object.defineProperty(s.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"highlightedActiveItems",{get:function(){return this.items.filter(function(e){return e.active&&e.highlighted})},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"activeChoices",{get:function(){return this.choices.filter(function(e){return e.active})},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"searchableChoices",{get:function(){return this.choices.filter(function(e){return!e.disabled&&!e.placeholder})},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"activeGroups",{get:function(){var e=this;return this.state.groups.filter(function(t){var i=t.active&&!t.disabled,n=e.state.choices.some(function(o){return o.active&&!o.disabled});return i&&n},[])},enumerable:!1,configurable:!0}),s.prototype.inTxn=function(){return this._txn>0},s.prototype.getChoiceById=function(e){return this.activeChoices.find(function(t){return t.id===e})},s.prototype.getGroupById=function(e){return this.groups.find(function(t){return t.id===e})},s}(),S={noChoices:"no-choices",noResults:"no-results",addChoice:"add-choice",generic:""};function Tt(s,e,t){return(e=Lt(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Ae(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function $(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ae(Object(t),!0).forEach(function(i){Tt(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):Ae(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function kt(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function Lt(s){var e=kt(s,"string");return typeof e=="symbol"?e:e+""}function N(s){return Array.isArray?Array.isArray(s):Ve(s)==="[object Array]"}function xt(s){if(typeof s=="string")return s;let e=s+"";return e=="0"&&1/s==-1/0?"-0":e}function Mt(s){return s==null?"":xt(s)}function x(s){return typeof s=="string"}function Ke(s){return typeof s=="number"}function Nt(s){return s===!0||s===!1||Pt(s)&&Ve(s)=="[object Boolean]"}function je(s){return typeof s=="object"}function Pt(s){return je(s)&&s!==null}function A(s){return s!=null}function se(s){return!s.trim().length}function Ve(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Ft="Incorrect 'index' type",Rt=s=>`Invalid value for key ${s}`,Ht=s=>`Pattern length exceeds max of ${s}.`,Kt=s=>`Missing ${s} property in key`,jt=s=>`Property 'weight' in key '${s}' must be a positive integer`,Oe=Object.prototype.hasOwnProperty;class Vt{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(i=>{let n=Be(i);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(i=>{i.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Be(s){let e=null,t=null,i=null,n=1,o=null;if(x(s)||N(s))i=s,e=Te(s),t=ae(s);else{if(!Oe.call(s,"name"))throw new Error(Kt("name"));const r=s.name;if(i=r,Oe.call(s,"weight")&&(n=s.weight,n<=0))throw new Error(jt(r));e=Te(r),t=ae(r),o=s.getFn}return{path:e,id:t,weight:n,src:i,getFn:o}}function Te(s){return N(s)?s:s.split(".")}function ae(s){return N(s)?s.join("."):s}function Bt(s,e){let t=[],i=!1;const n=(o,r,a)=>{if(A(o))if(!r[a])t.push(o);else{let l=r[a];const c=o[l];if(!A(c))return;if(a===r.length-1&&(x(c)||Ke(c)||Nt(c)))t.push(Mt(c));else if(N(c)){i=!0;for(let h=0,u=c.length;h<u;h+=1)n(c[h],r,a+1)}else r.length&&n(c,r,a+1)}};return n(s,x(e)?e.split("."):e,0),i?t:t[0]}const $t={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Gt={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(s,e)=>s.score===e.score?s.idx<e.idx?-1:1:s.score<e.score?-1:1},Yt={location:0,threshold:.6,distance:100},Wt={useExtendedSearch:!1,getFn:Bt,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var g=$($($($({},Gt),$t),Yt),Wt);const Ut=/[^ ]+/g;function qt(s=1,e=3){const t=new Map,i=Math.pow(10,e);return{get(n){const o=n.match(Ut).length;if(t.has(o))return t.get(o);const r=1/Math.pow(o,.5*s),a=parseFloat(Math.round(r*i)/i);return t.set(o,a),a},clear(){t.clear()}}}class pe{constructor({getFn:e=g.getFn,fieldNormWeight:t=g.fieldNormWeight}={}){this.norm=qt(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,i)=>{this._keysMap[t.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,x(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();x(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!A(e)||se(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach((n,o)=>{let r=n.getFn?n.getFn(e):this.getFn(e,n.path);if(A(r)){if(N(r)){let a=[];const l=[{nestedArrIndex:-1,value:r}];for(;l.length;){const{nestedArrIndex:c,value:h}=l.pop();if(A(h))if(x(h)&&!se(h)){let u={v:h,i:c,n:this.norm.get(h)};a.push(u)}else N(h)&&h.forEach((u,f)=>{l.push({nestedArrIndex:f,value:u})})}i.$[o]=a}else if(x(r)&&!se(r)){let a={v:r,n:this.norm.get(r)};i.$[o]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function $e(s,e,{getFn:t=g.getFn,fieldNormWeight:i=g.fieldNormWeight}={}){const n=new pe({getFn:t,fieldNormWeight:i});return n.setKeys(s.map(Be)),n.setSources(e),n.create(),n}function Jt(s,{getFn:e=g.getFn,fieldNormWeight:t=g.fieldNormWeight}={}){const{keys:i,records:n}=s,o=new pe({getFn:e,fieldNormWeight:t});return o.setKeys(i),o.setIndexRecords(n),o}function X(s,{errors:e=0,currentLocation:t=0,expectedLocation:i=0,distance:n=g.distance,ignoreLocation:o=g.ignoreLocation}={}){const r=e/s.length;if(o)return r;const a=Math.abs(i-t);return n?r+a/n:a?1:r}function zt(s=[],e=g.minMatchCharLength){let t=[],i=-1,n=-1,o=0;for(let r=s.length;o<r;o+=1){let a=s[o];a&&i===-1?i=o:!a&&i!==-1&&(n=o-1,n-i+1>=e&&t.push([i,n]),i=-1)}return s[o-1]&&o-i>=e&&t.push([i,o-1]),t}const j=32;function Xt(s,e,t,{location:i=g.location,distance:n=g.distance,threshold:o=g.threshold,findAllMatches:r=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,includeMatches:l=g.includeMatches,ignoreLocation:c=g.ignoreLocation}={}){if(e.length>j)throw new Error(Ht(j));const h=e.length,u=s.length,f=Math.max(0,Math.min(i,u));let m=o,d=f;const p=a>1||l,y=p?Array(u):[];let _;for(;(_=s.indexOf(e,d))>-1;){let O=X(e,{currentLocation:_,expectedLocation:f,distance:n,ignoreLocation:c});if(m=Math.min(O,m),d=_+h,p){let P=0;for(;P<h;)y[_+P]=1,P+=1}}d=-1;let w=[],D=1,K=h+u;const Je=1<<h-1;for(let O=0;O<h;O+=1){let P=0,F=K;for(;P<F;)X(e,{errors:O,currentLocation:f+F,expectedLocation:f,distance:n,ignoreLocation:c})<=m?P=F:K=F,F=Math.floor((K-P)/2+P);K=F;let me=Math.max(1,f-F+1),ie=r?u:Math.min(f+F,u)+h,B=Array(ie+2);B[ie+1]=(1<<O)-1;for(let T=ie;T>=me;T-=1){let J=T-1,ge=t[s.charAt(J)];if(p&&(y[J]=+!!ge),B[T]=(B[T+1]<<1|1)&ge,O&&(B[T]|=(w[T+1]|w[T])<<1|1|w[T+1]),B[T]&Je&&(D=X(e,{errors:O,currentLocation:J,expectedLocation:f,distance:n,ignoreLocation:c}),D<=m)){if(m=D,d=J,d<=f)break;me=Math.max(1,2*f-d)}}if(X(e,{errors:O+1,currentLocation:f,expectedLocation:f,distance:n,ignoreLocation:c})>m)break;w=B}const te={isMatch:d>=0,score:Math.max(.001,D)};if(p){const O=zt(y,a);O.length?l&&(te.indices=O):te.isMatch=!1}return te}function Qt(s){let e={};for(let t=0,i=s.length;t<i;t+=1){const n=s.charAt(t);e[n]=(e[n]||0)|1<<i-t-1}return e}class Ge{constructor(e,{location:t=g.location,threshold:i=g.threshold,distance:n=g.distance,includeMatches:o=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,isCaseSensitive:l=g.isCaseSensitive,ignoreLocation:c=g.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const h=(f,m)=>{this.chunks.push({pattern:f,alphabet:Qt(f),startIndex:m})},u=this.pattern.length;if(u>j){let f=0;const m=u%j,d=u-m;for(;f<d;)h(this.pattern.substr(f,j),f),f+=j;if(m){const p=u-j;h(this.pattern.substr(p),p)}}else h(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let d={isMatch:!0,score:0};return i&&(d.indices=[[0,e.length-1]]),d}const{location:n,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options;let h=[],u=0,f=!1;this.chunks.forEach(({pattern:d,alphabet:p,startIndex:y})=>{const{isMatch:_,score:w,indices:D}=Xt(e,d,p,{location:n+y,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});_&&(f=!0),u+=w,_&&D&&(h=[...h,...D])});let m={isMatch:f,score:f?u/this.chunks.length:1};return f&&i&&(m.indices=h),m}}class H{constructor(e){this.pattern=e}static isMultiMatch(e){return ke(e,this.multiRegex)}static isSingleMatch(e){return ke(e,this.singleRegex)}search(){}}function ke(s,e){const t=s.match(e);return t?t[1]:null}class Zt extends H{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class ei extends H{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class ti extends H{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class ii extends H{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class si extends H{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ni extends H{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Ye extends H{constructor(e,{location:t=g.location,threshold:i=g.threshold,distance:n=g.distance,includeMatches:o=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,isCaseSensitive:l=g.isCaseSensitive,ignoreLocation:c=g.ignoreLocation}={}){super(e),this._bitapSearch=new Ge(e,{location:t,threshold:i,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class We extends H{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,i;const n=[],o=this.pattern.length;for(;(i=e.indexOf(this.pattern,t))>-1;)t=i+o,n.push([i,t-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const le=[Zt,We,ti,ii,ni,si,ei,Ye],Le=le.length,ri=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,oi="|";function ai(s,e={}){return s.split(oi).map(t=>{let i=t.trim().split(ri).filter(o=>o&&!!o.trim()),n=[];for(let o=0,r=i.length;o<r;o+=1){const a=i[o];let l=!1,c=-1;for(;!l&&++c<Le;){const h=le[c];let u=h.isMultiMatch(a);u&&(n.push(new h(u,e)),l=!0)}if(!l)for(c=-1;++c<Le;){const h=le[c];let u=h.isSingleMatch(a);if(u){n.push(new h(u,e));break}}}return n})}const li=new Set([Ye.type,We.type]);class ci{constructor(e,{isCaseSensitive:t=g.isCaseSensitive,includeMatches:i=g.includeMatches,minMatchCharLength:n=g.minMatchCharLength,ignoreLocation:o=g.ignoreLocation,findAllMatches:r=g.findAllMatches,location:a=g.location,threshold:l=g.threshold,distance:c=g.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:o,location:a,threshold:l,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=ai(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let o=0,r=[],a=0;for(let l=0,c=t.length;l<c;l+=1){const h=t[l];r.length=0,o=0;for(let u=0,f=h.length;u<f;u+=1){const m=h[u],{isMatch:d,indices:p,score:y}=m.search(e);if(d){if(o+=1,a+=y,i){const _=m.constructor.type;li.has(_)?r=[...r,...p]:r.push(p)}}else{a=0,o=0,r.length=0;break}}if(o){let u={isMatch:!0,score:a/o};return i&&(u.indices=r),u}}return{isMatch:!1,score:1}}}const ce=[];function hi(...s){ce.push(...s)}function he(s,e){for(let t=0,i=ce.length;t<i;t+=1){let n=ce[t];if(n.condition(s,e))return new n(s,e)}return new Ge(s,e)}const Q={AND:"$and",OR:"$or"},ue={PATH:"$path",PATTERN:"$val"},de=s=>!!(s[Q.AND]||s[Q.OR]),ui=s=>!!s[ue.PATH],di=s=>!N(s)&&je(s)&&!de(s),xe=s=>({[Q.AND]:Object.keys(s).map(e=>({[e]:s[e]}))});function Ue(s,e,{auto:t=!0}={}){const i=n=>{let o=Object.keys(n);const r=ui(n);if(!r&&o.length>1&&!de(n))return i(xe(n));if(di(n)){const l=r?n[ue.PATH]:o[0],c=r?n[ue.PATTERN]:n[l];if(!x(c))throw new Error(Rt(l));const h={keyId:ae(l),pattern:c};return t&&(h.searcher=he(c,e)),h}let a={children:[],operator:o[0]};return o.forEach(l=>{const c=n[l];N(c)&&c.forEach(h=>{a.children.push(i(h))})}),a};return de(s)||(s=xe(s)),i(s)}function fi(s,{ignoreFieldNorm:e=g.ignoreFieldNorm}){s.forEach(t=>{let i=1;t.matches.forEach(({key:n,norm:o,score:r})=>{const a=n?n.weight:null;i*=Math.pow(r===0&&a?Number.EPSILON:r,(a||1)*(e?1:o))}),t.score=i})}function pi(s,e){const t=s.matches;e.matches=[],A(t)&&t.forEach(i=>{if(!A(i.indices)||!i.indices.length)return;const{indices:n,value:o}=i;let r={indices:n,value:o};i.key&&(r.key=i.key.src),i.idx>-1&&(r.refIndex=i.idx),e.matches.push(r)})}function mi(s,e){e.score=s.score}function gi(s,e,{includeMatches:t=g.includeMatches,includeScore:i=g.includeScore}={}){const n=[];return t&&n.push(pi),i&&n.push(mi),s.map(o=>{const{idx:r}=o,a={item:e[r],refIndex:r};return n.length&&n.forEach(l=>{l(o,a)}),a})}class G{constructor(e,t={},i){this.options=$($({},g),t),this.options.useExtendedSearch,this._keyStore=new Vt(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof pe))throw new Error(Ft);this._myIndex=t||$e(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){A(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const o=this._docs[i];e(o,i)&&(this.removeAt(i),i-=1,n-=1,t.push(o))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:o,sortFn:r,ignoreFieldNorm:a}=this.options;let l=x(e)?x(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fi(l,{ignoreFieldNorm:a}),o&&l.sort(r),Ke(t)&&t>-1&&(l=l.slice(0,t)),gi(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=he(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:o,i:r,n:a})=>{if(!A(o))return;const{isMatch:l,score:c,indices:h}=t.searchIn(o);l&&n.push({item:o,idx:r,matches:[{score:c,value:o,norm:a,indices:h}]})}),n}_searchLogical(e){const t=Ue(e,this.options),i=(a,l,c)=>{if(!a.children){const{keyId:u,searcher:f}=a,m=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(l,u),searcher:f});return m&&m.length?[{idx:c,item:l,matches:m}]:[]}const h=[];for(let u=0,f=a.children.length;u<f;u+=1){const m=a.children[u],d=i(m,l,c);if(d.length)h.push(...d);else if(a.operator===Q.AND)return[]}return h},n=this._myIndex.records,o={},r=[];return n.forEach(({$:a,i:l})=>{if(A(a)){let c=i(t,a,l);c.length&&(o[l]||(o[l]={idx:l,item:a,matches:[]},r.push(o[l])),c.forEach(({matches:h})=>{o[l].matches.push(...h)}))}}),r}_searchObjectList(e){const t=he(e,this.options),{keys:i,records:n}=this._myIndex,o=[];return n.forEach(({$:r,i:a})=>{if(!A(r))return;let l=[];i.forEach((c,h)=>{l.push(...this._findMatches({key:c,value:r[h],searcher:t}))}),l.length&&o.push({idx:a,item:r,matches:l})}),o}_findMatches({key:e,value:t,searcher:i}){if(!A(t))return[];let n=[];if(N(t))t.forEach(({v:o,i:r,n:a})=>{if(!A(o))return;const{isMatch:l,score:c,indices:h}=i.searchIn(o);l&&n.push({score:c,key:e,value:o,idx:r,norm:a,indices:h})});else{const{v:o,n:r}=t,{isMatch:a,score:l,indices:c}=i.searchIn(o);a&&n.push({score:l,key:e,value:o,norm:r,indices:c})}return n}}G.version="7.0.0";G.createIndex=$e;G.parseIndex=Jt;G.config=g;G.parseQuery=Ue;hi(ci);var vi=function(){function s(e){this._haystack=[],this._fuseOptions=I(I({},e.fuseOptions),{keys:Ze([],e.searchFields),includeMatches:!0})}return s.prototype.index=function(e){this._haystack=e,this._fuse&&this._fuse.setCollection(e)},s.prototype.reset=function(){this._haystack=[],this._fuse=void 0},s.prototype.isEmptyIndex=function(){return!this._haystack.length},s.prototype.search=function(e){this._fuse||(this._fuse=new G(this._haystack,this._fuseOptions));var t=this._fuse.search(e);return t.map(function(i,n){return{item:i.item,score:i.score||0,rank:n+1}})},s}();function _i(s){return new vi(s)}var yi=function(s){for(var e in s)if(Object.prototype.hasOwnProperty.call(s,e))return!1;return!0},ne=function(s,e,t){var i=s.dataset,n=e.customProperties,o=e.labelClass,r=e.labelDescription;o&&(i.labelClass=ee(o).join(" ")),r&&(i.labelDescription=r),t&&n&&(typeof n=="string"?i.customProperties=n:typeof n=="object"&&!yi(n)&&(i.customProperties=JSON.stringify(n)))},Me=function(s,e,t){var i=e&&s.querySelector("label[for='".concat(e,"']")),n=i&&i.innerText;n&&t.setAttribute("aria-label",n)},bi={containerOuter:function(s,e,t,i,n,o,r){var a=s.classNames.containerOuter,l=document.createElement("div");return v(l,a),l.dataset.type=o,e&&(l.dir=e),i&&(l.tabIndex=0),t&&(l.setAttribute("role",n?"combobox":"listbox"),n?l.setAttribute("aria-autocomplete","list"):r||Me(this._docRoot,this.passedElement.element.id,l),l.setAttribute("aria-haspopup","true"),l.setAttribute("aria-expanded","false")),r&&l.setAttribute("aria-labelledby",r),l},containerInner:function(s){var e=s.classNames.containerInner,t=document.createElement("div");return v(t,e),t},itemList:function(s,e){var t=s.searchEnabled,i=s.classNames,n=i.list,o=i.listSingle,r=i.listItems,a=document.createElement("div");return v(a,n),v(a,e?o:r),this._isSelectElement&&t&&a.setAttribute("role","listbox"),a},placeholder:function(s,e){var t=s.allowHTML,i=s.classNames.placeholder,n=document.createElement("div");return v(n,i),M(n,t,e),n},item:function(s,e,t){var i=s.allowHTML,n=s.removeItemButtonAlignLeft,o=s.removeItemIconText,r=s.removeItemLabelText,a=s.classNames,l=a.item,c=a.button,h=a.highlightedState,u=a.itemSelectable,f=a.placeholder,m=V(e.value),d=document.createElement("div");if(v(d,l),e.labelClass){var p=document.createElement("span");M(p,i,e.label),v(p,e.labelClass),d.appendChild(p)}else M(d,i,e.label);if(d.dataset.item="",d.dataset.id=e.id,d.dataset.value=m,ne(d,e,!0),(e.disabled||this.containerOuter.isDisabled)&&d.setAttribute("aria-disabled","true"),this._isSelectElement&&(d.setAttribute("aria-selected","true"),d.setAttribute("role","option")),e.placeholder&&(v(d,f),d.dataset.placeholder=""),v(d,e.highlighted?h:u),t){e.disabled&&L(d,u),d.dataset.deletable="";var y=document.createElement("button");y.type="button",v(y,c),M(y,!0,q(o,e.value));var _=q(r,e.value);_&&y.setAttribute("aria-label",_),y.dataset.button="",n?d.insertAdjacentElement("afterbegin",y):d.appendChild(y)}return d},choiceList:function(s,e){var t=s.classNames.list,i=document.createElement("div");return v(i,t),e||i.setAttribute("aria-multiselectable","true"),i.setAttribute("role","listbox"),i},choiceGroup:function(s,e){var t=s.allowHTML,i=s.classNames,n=i.group,o=i.groupHeading,r=i.itemDisabled,a=e.id,l=e.label,c=e.disabled,h=V(l),u=document.createElement("div");v(u,n),c&&v(u,r),u.setAttribute("role","group"),u.dataset.group="",u.dataset.id=a,u.dataset.value=h,c&&u.setAttribute("aria-disabled","true");var f=document.createElement("div");return v(f,o),M(f,t,l||""),u.appendChild(f),u},choice:function(s,e,t,i){var n=s.allowHTML,o=s.classNames,r=o.item,a=o.itemChoice,l=o.itemSelectable,c=o.selectedState,h=o.itemDisabled,u=o.description,f=o.placeholder,m=e.label,d=V(e.value),p=document.createElement("div");p.id=e.elementId,v(p,r),v(p,a),i&&typeof m=="string"&&(m=fe(n,m),m+=" (".concat(i,")"),m={trusted:m});var y=p;if(e.labelClass){var _=document.createElement("span");M(_,n,m),v(_,e.labelClass),y=_,p.appendChild(_)}else M(p,n,m);if(e.labelDescription){var w="".concat(e.elementId,"-description");y.setAttribute("aria-describedby",w);var D=document.createElement("span");M(D,n,e.labelDescription),D.id=w,v(D,u),p.appendChild(D)}return e.selected&&v(p,c),e.placeholder&&v(p,f),p.setAttribute("role",e.group?"treeitem":"option"),p.dataset.choice="",p.dataset.id=e.id,p.dataset.value=d,t&&(p.dataset.selectText=t),e.group&&(p.dataset.groupId="".concat(e.group.id)),ne(p,e,!1),e.disabled?(v(p,h),p.dataset.choiceDisabled="",p.setAttribute("aria-disabled","true")):(v(p,l),p.dataset.choiceSelectable=""),p},input:function(s,e){var t=s.classNames,i=t.input,n=t.inputCloned,o=s.labelId,r=document.createElement("input");return r.type="search",v(r,i),v(r,n),r.autocomplete="off",r.autocapitalize="off",r.spellcheck=!1,r.setAttribute("aria-autocomplete","list"),e?r.setAttribute("aria-label",e):o||Me(this._docRoot,this.passedElement.element.id,r),r},dropdown:function(s){var e=s.classNames,t=e.list,i=e.listDropdown,n=document.createElement("div");return v(n,t),v(n,i),n.setAttribute("aria-expanded","false"),n},notice:function(s,e,t){var i=s.classNames,n=i.item,o=i.itemChoice,r=i.addChoice,a=i.noResults,l=i.noChoices,c=i.notice;t===void 0&&(t=S.generic);var h=document.createElement("div");switch(M(h,!0,e),v(h,n),v(h,o),v(h,c),t){case S.addChoice:v(h,r);break;case S.noResults:v(h,a);break;case S.noChoices:v(h,l);break}return t===S.addChoice&&(h.dataset.choiceSelectable="",h.dataset.choice=""),h},option:function(s){var e=V(s.label),t=new Option(e,s.value,!1,s.selected);return ne(t,s,!0),t.disabled=s.disabled,s.selected&&t.setAttribute("selected",""),t}},Si="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,Ei={},re=function(s){if(s)return s.dataset.id?parseInt(s.dataset.id,10):void 0},W="[data-choice-selectable]",qe=function(){function s(e,t){e===void 0&&(e="[data-choice]"),t===void 0&&(t={});var i=this;this.initialisedOK=void 0,this._hasNonChoicePlaceholder=!1,this._lastAddedChoiceId=0,this._lastAddedGroupId=0;var n=s.defaults;this.config=I(I(I({},n.allOptions),n.options),t),et.forEach(function(_){i.config[_]=I(I(I({},n.allOptions[_]),n.options[_]),t[_])});var o=this.config;o.silent||this._validateConfig();var r=o.shadowRoot||document.documentElement;this._docRoot=r;var a=typeof e=="string"?r.querySelector(e):e;if(!a||typeof a!="object"||!(bt(a)||He(a)))throw TypeError(!a&&typeof e=="string"?"Selector ".concat(e," failed to find an element"):"Expected one of the following types text|select-one|select-multiple");var l=a.type,c=l===R.Text;(c||o.maxItemCount!==1)&&(o.singleModeForMultiSelect=!1),o.singleModeForMultiSelect&&(l=R.SelectMultiple);var h=l===R.SelectOne,u=l===R.SelectMultiple,f=h||u;if(this._elementType=l,this._isTextElement=c,this._isSelectOneElement=h,this._isSelectMultipleElement=u,this._isSelectElement=h||u,this._canAddUserChoices=c&&o.addItems||f&&o.addChoices,typeof o.renderSelectedChoices!="boolean"&&(o.renderSelectedChoices=o.renderSelectedChoices==="always"||h),o.closeDropdownOnSelect==="auto"?o.closeDropdownOnSelect=c||h||o.singleModeForMultiSelect:o.closeDropdownOnSelect=U(o.closeDropdownOnSelect),o.placeholder&&(o.placeholderValue?this._hasNonChoicePlaceholder=!0:a.dataset.placeholder&&(this._hasNonChoicePlaceholder=!0,o.placeholderValue=a.dataset.placeholder)),t.addItemFilter&&typeof t.addItemFilter!="function"){var m=t.addItemFilter instanceof RegExp?t.addItemFilter:new RegExp(t.addItemFilter);o.addItemFilter=m.test.bind(m)}if(this._isTextElement)this.passedElement=new yt({element:a,classNames:o.classNames});else{var d=a;this.passedElement=new wt({element:d,classNames:o.classNames,template:function(_){return i._templates.option(_)},extractPlaceholder:o.placeholder&&!this._hasNonChoicePlaceholder})}if(this.initialised=!1,this._store=new Ot(o),this._currentValue="",o.searchEnabled=!c&&o.searchEnabled||u,this._canSearch=o.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=ot(a,"choices-"),this._direction=a.dir,!this._direction){var p=window.getComputedStyle(a).direction,y=window.getComputedStyle(document.documentElement).direction;p!==y&&(this._direction=p)}if(this._idNames={itemChoice:"item-choice"},this._templates=n.templates,this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onInput=this._onInput.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive){o.silent||console.warn("Trying to initialise Choices on element already initialised",{element:e}),this.initialised=!0,this.initialisedOK=!1;return}this.init(),this._initialItems=this._store.items.map(function(_){return _.value})}return Object.defineProperty(s,"defaults",{get:function(){return Object.preventExtensions({get options(){return Ei},get allOptions(){return De},get templates(){return bi}})},enumerable:!1,configurable:!0}),s.prototype.init=function(){if(!(this.initialised||this.initialisedOK!==void 0)){this._searcher=_i(this.config),this._loadChoices(),this._createTemplates(),this._createElements(),this._createStructure(),this._isTextElement&&!this.config.addItems||this.passedElement.element.hasAttribute("disabled")||this.passedElement.element.closest("fieldset:disabled")?this.disable():(this.enable(),this._addEventListeners()),this._initStore(),this.initialised=!0,this.initialisedOK=!0;var e=this.config.callbackOnInit;typeof e=="function"&&e.call(this)}},s.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._store._listeners=[],this.clearStore(!1),this._stopSearch(),this._templates=s.defaults.templates,this.initialised=!1,this.initialisedOK=void 0)},s.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},s.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},s.prototype.highlightItem=function(e,t){if(t===void 0&&(t=!0),!e||!e.id)return this;var i=this._store.items.find(function(n){return n.id===e.id});return!i||i.highlighted?this:(this._store.dispatch(z(i,!0)),t&&this.passedElement.triggerEvent(C.highlightItem,this._getChoiceForOutput(i)),this)},s.prototype.unhighlightItem=function(e,t){if(t===void 0&&(t=!0),!e||!e.id)return this;var i=this._store.items.find(function(n){return n.id===e.id});return!i||!i.highlighted?this:(this._store.dispatch(z(i,!1)),t&&this.passedElement.triggerEvent(C.unhighlightItem,this._getChoiceForOutput(i)),this)},s.prototype.highlightAll=function(){var e=this;return this._store.withTxn(function(){e._store.items.forEach(function(t){t.highlighted||(e._store.dispatch(z(t,!0)),e.passedElement.triggerEvent(C.highlightItem,e._getChoiceForOutput(t)))})}),this},s.prototype.unhighlightAll=function(){var e=this;return this._store.withTxn(function(){e._store.items.forEach(function(t){t.highlighted&&(e._store.dispatch(z(t,!1)),e.passedElement.triggerEvent(C.highlightItem,e._getChoiceForOutput(t)))})}),this},s.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.withTxn(function(){t._store.items.filter(function(i){return i.value===e}).forEach(function(i){return t._removeItem(i)})}),this},s.prototype.removeActiveItems=function(e){var t=this;return this._store.withTxn(function(){t._store.items.filter(function(i){var n=i.id;return n!==e}).forEach(function(i){return t._removeItem(i)})}),this},s.prototype.removeHighlightedItems=function(e){var t=this;return e===void 0&&(e=!1),this._store.withTxn(function(){t._store.highlightedActiveItems.forEach(function(i){t._removeItem(i),e&&t._triggerChange(i.value)})}),this},s.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive?this:(e===void 0&&(e=!this._canSearch),requestAnimationFrame(function(){t.dropdown.show();var i=t.dropdown.element.getBoundingClientRect();t.containerOuter.open(i.bottom,i.height),e||t.input.focus(),t.passedElement.triggerEvent(C.showDropdown)}),this)},s.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame(function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(C.hideDropdown)}),this):this},s.prototype.getValue=function(e){var t=this,i=this._store.items.map(function(n){return e?n.value:t._getChoiceForOutput(n)});return this._isSelectOneElement||this.config.singleModeForMultiSelect?i[0]:i},s.prototype.setValue=function(e){var t=this;return this.initialisedOK?(this._store.withTxn(function(){e.forEach(function(i){i&&t._addChoice(k(i,!1))})}),this._searcher.reset(),this):(this._warnChoicesInitFailed("setValue"),this)},s.prototype.setChoiceByValue=function(e){var t=this;return this.initialisedOK?this._isTextElement?this:(this._store.withTxn(function(){var i=Array.isArray(e)?e:[e];i.forEach(function(n){return t._findAndSelectChoiceByValue(n)}),t.unhighlightAll()}),this._searcher.reset(),this):(this._warnChoicesInitFailed("setChoiceByValue"),this)},s.prototype.setChoices=function(e,t,i,n,o,r){var a=this;if(e===void 0&&(e=[]),t===void 0&&(t="value"),i===void 0&&(i="label"),n===void 0&&(n=!1),o===void 0&&(o=!0),r===void 0&&(r=!1),!this.initialisedOK)return this._warnChoicesInitFailed("setChoices"),this;if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if(typeof t!="string"||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(typeof e=="function"){var l=e(this);if(typeof Promise=="function"&&l instanceof Promise)return new Promise(function(c){return requestAnimationFrame(c)}).then(function(){return a._handleLoadingState(!0)}).then(function(){return l}).then(function(c){return a.setChoices(c,t,i,n,o,r)}).catch(function(c){a.config.silent||console.error(c)}).then(function(){return a._handleLoadingState(!1)}).then(function(){return a});if(!Array.isArray(l))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof l));return this.setChoices(l,t,i,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._store.withTxn(function(){o&&(a._isSearching=!1),n&&a.clearChoices(!0,r);var c=t==="value",h=i==="label";e.forEach(function(u){if("choices"in u){var f=u;h||(f=I(I({},f),{label:f[i]})),a._addGroup(k(f,!0))}else{var m=u;(!h||!c)&&(m=I(I({},m),{value:m[t],label:m[i]}));var d=k(m,!1);a._addChoice(d),d.placeholder&&!a._hasNonChoicePlaceholder&&(a._placeholderValue=Pe(d.label))}}),a.unhighlightAll()}),this._searcher.reset(),this},s.prototype.refresh=function(e,t,i){var n=this;return e===void 0&&(e=!1),t===void 0&&(t=!1),i===void 0&&(i=!1),this._isSelectElement?(this._store.withTxn(function(){var o=n.passedElement.optionsAsChoices(),r={};i||n._store.items.forEach(function(l){l.id&&l.active&&l.selected&&(r[l.value]=!0)}),n.clearStore(!1);var a=function(l){i?n._store.dispatch(ye(l)):r[l.value]&&(l.selected=!0)};o.forEach(function(l){if("choices"in l){l.choices.forEach(a);return}a(l)}),n._addPredefinedChoices(o,t,e),n._isSearching&&n._searchChoices(n.input.value)}),this):(this.config.silent||console.warn("refresh method can only be used on choices backed by a <select> element"),this)},s.prototype.removeChoice=function(e){var t=this._store.choices.find(function(i){return i.value===e});return t?(this._clearNotice(),this._store.dispatch(tt(t)),this._searcher.reset(),t.selected&&this.passedElement.triggerEvent(C.removeItem,this._getChoiceForOutput(t)),this):this},s.prototype.clearChoices=function(e,t){var i=this;return e===void 0&&(e=!0),t===void 0&&(t=!1),e&&(t?this.passedElement.element.replaceChildren(""):this.passedElement.element.querySelectorAll(":not([selected])").forEach(function(n){n.remove()})),this.itemList.element.replaceChildren(""),this.choiceList.element.replaceChildren(""),this._clearNotice(),this._store.withTxn(function(){var n=t?[]:i._store.items;i._store.reset(),n.forEach(function(o){i._store.dispatch(ve(o)),i._store.dispatch(_e(o))})}),this._searcher.reset(),this},s.prototype.clearStore=function(e){return e===void 0&&(e=!0),this.clearChoices(e,!0),this._stopSearch(),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this},s.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),this._stopSearch(),this},s.prototype._validateConfig=function(){var e=this.config,t=ft(e,De);t.length&&console.warn("Unknown config option(s) passed",t.join(", ")),e.allowHTML&&e.allowHtmlUserInput&&(e.addItems&&console.warn("Warning: allowHTML/allowHtmlUserInput/addItems all being true is strongly not recommended and may lead to XSS attacks"),e.addChoices&&console.warn("Warning: allowHTML/allowHtmlUserInput/addChoices all being true is strongly not recommended and may lead to XSS attacks"))},s.prototype._render=function(e){e===void 0&&(e={choices:!0,groups:!0,items:!0}),!this._store.inTxn()&&(this._isSelectElement&&(e.choices||e.groups)&&this._renderChoices(),e.items&&this._renderItems())},s.prototype._renderChoices=function(){var e=this;if(this._canAddItems()){var t=this,i=t.config,n=t._isSearching,o=this._store,r=o.activeGroups,a=o.activeChoices,l=0;if(n&&i.searchResultLimit>0?l=i.searchResultLimit:i.renderChoiceLimit>0&&(l=i.renderChoiceLimit),this._isSelectElement){var c=a.filter(function(d){return!d.element});c.length&&this.passedElement.addOptions(c)}var h=document.createDocumentFragment(),u=function(d){return d.filter(function(p){return!p.placeholder&&(n?!!p.rank:i.renderSelectedChoices||!p.selected)})},f=!1,m=function(d,p,y){n?d.sort(ut):i.shouldSort&&d.sort(i.sorter);var _=d.length;_=!p&&l&&_>l?l:_,_--,d.every(function(w,D){var K=w.choiceEl||e._templates.choice(i,w,i.itemSelectText,y);return w.choiceEl=K,h.appendChild(K),(n||!w.selected)&&(f=!0),D<_})};a.length&&(i.resetScrollPosition&&requestAnimationFrame(function(){return e.choiceList.scrollToTop()}),!this._hasNonChoicePlaceholder&&!n&&this._isSelectOneElement&&m(a.filter(function(d){return d.placeholder&&!d.group}),!1,void 0),r.length&&!n?(i.shouldSort&&r.sort(i.sorter),m(a.filter(function(d){return!d.placeholder&&!d.group}),!1,void 0),r.forEach(function(d){var p=u(d.choices);if(p.length){if(d.label){var y=d.groupEl||e._templates.choiceGroup(e.config,d);d.groupEl=y,y.remove(),h.appendChild(y)}m(p,!0,i.appendGroupInSearch&&n?d.label:void 0)}})):m(u(a),!1,void 0)),!f&&(n||!h.children.length||!i.renderSelectedChoices)&&(this._notice||(this._notice={text:Se(n?i.noResultsText:i.noChoicesText),type:n?S.noResults:S.noChoices}),h.replaceChildren("")),this._renderNotice(h),this.choiceList.element.replaceChildren(h),f&&this._highlightChoice()}},s.prototype._renderItems=function(){var e=this,t=this._store.items||[],i=this.itemList.element,n=this.config,o=document.createDocumentFragment(),r=function(u){return i.querySelector('[data-item][data-id="'.concat(u.id,'"]'))},a=function(u){var f=u.itemEl;f&&f.parentElement||(f=r(u)||e._templates.item(n,u,n.removeItemButton),u.itemEl=f,o.appendChild(f))};t.forEach(a);var l=!!o.childNodes.length;if(this._isSelectOneElement){var c=i.children.length;if(l||c>1){var h=i.querySelector(Y(n.classNames.placeholder));h&&h.remove()}else!l&&!c&&this._placeholderValue&&(l=!0,a(k({selected:!0,value:"",label:this._placeholderValue,placeholder:!0},!1)))}l&&(i.append(o),n.shouldSortItems&&!this._isSelectOneElement&&(t.sort(n.sorter),t.forEach(function(u){var f=r(u);f&&(f.remove(),o.append(f))}),i.append(o))),this._isTextElement&&(this.passedElement.value=t.map(function(u){var f=u.value;return f}).join(n.delimiter))},s.prototype._displayNotice=function(e,t,i){i===void 0&&(i=!0);var n=this._notice;if(n&&(n.type===t&&n.text===e||n.type===S.addChoice&&(t===S.noResults||t===S.noChoices))){i&&this.showDropdown(!0);return}this._clearNotice(),this._notice=e?{text:e,type:t}:void 0,this._renderNotice(),i&&e&&this.showDropdown(!0)},s.prototype._clearNotice=function(){if(this._notice){var e=this.choiceList.element.querySelector(Y(this.config.classNames.notice));e&&e.remove(),this._notice=void 0}},s.prototype._renderNotice=function(e){var t=this._notice;if(t){var i=this._templates.notice(this.config,t.text,t.type);e?e.append(i):this.choiceList.prepend(i)}},s.prototype._getChoiceForOutput=function(e,t){return{id:e.id,highlighted:e.highlighted,labelClass:e.labelClass,labelDescription:e.labelDescription,customProperties:e.customProperties,disabled:e.disabled,active:e.active,label:e.label,placeholder:e.placeholder,value:e.value,groupValue:e.group?e.group.label:void 0,element:e.element,keyCode:t}},s.prototype._triggerChange=function(e){e!=null&&this.passedElement.triggerEvent(C.change,{value:e})},s.prototype._handleButtonAction=function(e){var t=this,i=this._store.items;if(!(!i.length||!this.config.removeItems||!this.config.removeItemButton)){var n=e&&re(e.parentElement),o=n&&i.find(function(r){return r.id===n});o&&this._store.withTxn(function(){if(t._removeItem(o),t._triggerChange(o.value),t._isSelectOneElement&&!t._hasNonChoicePlaceholder){var r=(t.config.shouldSort?t._store.choices.reverse():t._store.choices).find(function(a){return a.placeholder});r&&(t._addItem(r),t.unhighlightAll(),r.value&&t._triggerChange(r.value))}})}},s.prototype._handleItemAction=function(e,t){var i=this;t===void 0&&(t=!1);var n=this._store.items;if(!(!n.length||!this.config.removeItems||this._isSelectOneElement)){var o=re(e);o&&(n.forEach(function(r){r.id===o&&!r.highlighted?i.highlightItem(r):!t&&r.highlighted&&i.unhighlightItem(r)}),this.input.focus())}},s.prototype._handleChoiceAction=function(e){var t=this,i=re(e),n=i&&this._store.getChoiceById(i);if(!n||n.disabled)return!1;var o=this.dropdown.isActive;if(!n.selected){if(!this._canAddItems())return!0;this._store.withTxn(function(){t._addItem(n,!0,!0),t.clearInput(),t.unhighlightAll()}),this._triggerChange(n.value)}return o&&this.config.closeDropdownOnSelect&&(this.hideDropdown(!0),this.containerOuter.element.focus()),!0},s.prototype._handleBackspace=function(e){var t=this.config;if(!(!t.removeItems||!e.length)){var i=e[e.length-1],n=e.some(function(o){return o.highlighted});t.editItems&&!n&&i?(this.input.value=i.value,this.input.setWidth(),this._removeItem(i),this._triggerChange(i.value)):(n||this.highlightItem(i,!1),this.removeHighlightedItems(!0))}},s.prototype._loadChoices=function(){var e,t=this,i=this.config;if(this._isTextElement){if(this._presetChoices=i.items.map(function(r){return k(r,!1)}),this.passedElement.value){var n=this.passedElement.value.split(i.delimiter).map(function(r){return k(r,!1,t.config.allowHtmlUserInput)});this._presetChoices=this._presetChoices.concat(n)}this._presetChoices.forEach(function(r){r.selected=!0})}else if(this._isSelectElement){this._presetChoices=i.choices.map(function(r){return k(r,!0)});var o=this.passedElement.optionsAsChoices();o&&(e=this._presetChoices).push.apply(e,o)}},s.prototype._handleLoadingState=function(e){e===void 0&&(e=!0);var t=this.itemList.element;e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t.replaceChildren(this._templates.placeholder(this.config,this.config.loadingText)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?(t.replaceChildren(""),this._render()):this.input.placeholder=this._placeholderValue||"")},s.prototype._handleSearch=function(e){if(this.input.isFocussed)if(e!==null&&typeof e<"u"&&e.length>=this.config.searchFloor){var t=this.config.searchChoices?this._searchChoices(e):0;t!==null&&this.passedElement.triggerEvent(C.search,{value:e,resultCount:t})}else this._store.choices.some(function(i){return!i.active})&&this._stopSearch()},s.prototype._canAddItems=function(){var e=this.config,t=e.maxItemCount,i=e.maxItemText;return!e.singleModeForMultiSelect&&t>0&&t<=this._store.items.length?(this.choiceList.element.replaceChildren(""),this._notice=void 0,this._displayNotice(typeof i=="function"?i(t):i,S.addChoice),!1):(this._notice&&this._notice.type===S.addChoice&&this._clearNotice(),!0)},s.prototype._canCreateItem=function(e){var t=this.config,i=!0,n="";if(i&&typeof t.addItemFilter=="function"&&!t.addItemFilter(e)&&(i=!1,n=q(t.customAddItemText,e)),i){var o=this._store.choices.find(function(r){return t.valueComparer(r.value,e)});if(o){if(this._isSelectElement)return this._displayNotice("",S.addChoice),!1;t.duplicateItemsAllowed||(i=!1,n=q(t.uniqueItemText,e))}}return i&&(n=q(t.addItemText,e)),n&&this._displayNotice(n,S.addChoice),i},s.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(!t.length||t===this._currentValue)return null;var i=this._searcher;i.isEmptyIndex()&&i.index(this._store.searchableChoices);var n=i.search(t);this._currentValue=t,this._highlightPosition=0,this._isSearching=!0;var o=this._notice,r=o&&o.type;return r!==S.addChoice&&(n.length?this._clearNotice():this._displayNotice(Se(this.config.noResultsText),S.noResults)),this._store.dispatch(it(n)),n.length},s.prototype._stopSearch=function(){this._isSearching&&(this._currentValue="",this._isSearching=!1,this._clearNotice(),this._store.dispatch(st(!0)),this.passedElement.triggerEvent(C.search,{value:"",resultCount:0}))},s.prototype._addEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element;e.addEventListener("touchend",this._onTouchEnd,!0),t.addEventListener("keydown",this._onKeyDown,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(t.addEventListener("focus",this._onFocus,{passive:!0}),t.addEventListener("blur",this._onBlur,{passive:!0})),i.addEventListener("keyup",this._onKeyUp,{passive:!0}),i.addEventListener("input",this._onInput,{passive:!0}),i.addEventListener("focus",this._onFocus,{passive:!0}),i.addEventListener("blur",this._onBlur,{passive:!0}),i.form&&i.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},s.prototype._removeEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element;e.removeEventListener("touchend",this._onTouchEnd,!0),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur)),i.removeEventListener("keyup",this._onKeyUp),i.removeEventListener("input",this._onInput),i.removeEventListener("focus",this._onFocus),i.removeEventListener("blur",this._onBlur),i.form&&i.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},s.prototype._onKeyDown=function(e){var t=e.keyCode,i=this.dropdown.isActive,n=e.key.length===1||e.key.length===2&&e.key.charCodeAt(0)>=55296||e.key==="Unidentified";switch(!this._isTextElement&&!i&&t!==E.ESC_KEY&&t!==E.TAB_KEY&&t!==E.SHIFT_KEY&&(this.showDropdown(),!this.input.isFocussed&&n&&(this.input.value+=e.key,e.key===" "&&e.preventDefault())),t){case E.A_KEY:return this._onSelectKey(e,this.itemList.element.hasChildNodes());case E.ENTER_KEY:return this._onEnterKey(e,i);case E.ESC_KEY:return this._onEscapeKey(e,i);case E.UP_KEY:case E.PAGE_UP_KEY:case E.DOWN_KEY:case E.PAGE_DOWN_KEY:return this._onDirectionKey(e,i);case E.DELETE_KEY:case E.BACK_KEY:return this._onDeleteKey(e,this._store.items,this.input.isFocussed)}},s.prototype._onKeyUp=function(){this._canSearch=this.config.searchEnabled},s.prototype._onInput=function(){var e=this.input.value;if(!e){this._isTextElement?this.hideDropdown(!0):this._stopSearch();return}this._canAddItems()&&(this._canSearch&&this._handleSearch(e),this._canAddUserChoices&&(this._canCreateItem(e),this._isSelectElement&&(this._highlightPosition=0,this._highlightChoice())))},s.prototype._onSelectKey=function(e,t){if((e.ctrlKey||e.metaKey)&&t){this._canSearch=!1;var i=this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement;i&&this.highlightAll()}},s.prototype._onEnterKey=function(e,t){var i=this,n=this.input.value,o=e.target;if(e.preventDefault(),o&&o.hasAttribute("data-button")){this._handleButtonAction(o);return}if(!t){(this._isSelectElement||this._notice)&&this.showDropdown();return}var r=this.dropdown.element.querySelector(Y(this.config.classNames.highlightedState));if(!(r&&this._handleChoiceAction(r))){if(!o||!n){this.hideDropdown(!0);return}if(this._canAddItems()){var a=!1;this._store.withTxn(function(){if(a=i._findAndSelectChoiceByValue(n,!0),!a){if(!i._canAddUserChoices||!i._canCreateItem(n))return;i._addChoice(k(n,!1,i.config.allowHtmlUserInput),!0,!0),a=!0}i.clearInput(),i.unhighlightAll()}),a&&(this._triggerChange(n),this.config.closeDropdownOnSelect&&this.hideDropdown(!0))}}},s.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this._stopSearch(),this.containerOuter.element.focus())},s.prototype._onDirectionKey=function(e,t){var i=e.keyCode;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var n=i===E.DOWN_KEY||i===E.PAGE_DOWN_KEY?1:-1,o=e.metaKey||i===E.PAGE_DOWN_KEY||i===E.PAGE_UP_KEY,r=void 0;if(o)n>0?r=this.dropdown.element.querySelector("".concat(W,":last-of-type")):r=this.dropdown.element.querySelector(W);else{var a=this.dropdown.element.querySelector(Y(this.config.classNames.highlightedState));a?r=at(a,W,n):r=this.dropdown.element.querySelector(W)}r&&(lt(r,this.choiceList.element,n)||this.choiceList.scrollToChildElement(r,n),this._highlightChoice(r)),e.preventDefault()}},s.prototype._onDeleteKey=function(e,t,i){!this._isSelectOneElement&&!e.target.value&&i&&(this._handleBackspace(t),e.preventDefault())},s.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},s.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target,i=this._wasTap&&this.containerOuter.element.contains(t);if(i){var n=t===this.containerOuter.element||t===this.containerInner.element;n&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()}this._wasTap=!0},s.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(Si&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild;this._isScrollingOnIe=this._direction==="ltr"?e.offsetX>=i.offsetWidth:e.offsetX<i.offsetLeft}if(t!==this.input.element){var n=t.closest("[data-button],[data-item],[data-choice]");n instanceof HTMLElement&&("button"in n.dataset?this._handleButtonAction(n):"item"in n.dataset?this._handleItemAction(n,e.shiftKey):"choice"in n.dataset&&this._handleChoiceAction(n)),e.preventDefault()}}},s.prototype._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},s.prototype._onClick=function(e){var t=e.target,i=this.containerOuter,n=i.element.contains(t);n?!this.dropdown.isActive&&!i.isDisabled?this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),i.element.focus()):this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():(i.removeFocusState(),this.hideDropdown(!0),this.unhighlightAll())},s.prototype._onFocus=function(e){var t=e.target,i=this.containerOuter,n=t&&i.element.contains(t);if(n){var o=t===this.input.element;this._isTextElement?o&&i.addFocusState():this._isSelectMultipleElement?o&&(this.showDropdown(!0),i.addFocusState()):(i.addFocusState(),o&&this.showDropdown(!0))}},s.prototype._onBlur=function(e){var t=e.target,i=this.containerOuter,n=t&&i.element.contains(t);n&&!this._isScrollingOnIe?t===this.input.element?(i.removeFocusState(),this.hideDropdown(!0),(this._isTextElement||this._isSelectMultipleElement)&&this.unhighlightAll()):t===this.containerOuter.element&&(i.removeFocusState(),this._canSearch||this.hideDropdown(!0)):(this._isScrollingOnIe=!1,this.input.element.focus())},s.prototype._onFormReset=function(){var e=this;this._store.withTxn(function(){e.clearInput(),e.hideDropdown(),e.refresh(!1,!1,!0),e._initialItems.length&&e.setChoiceByValue(e._initialItems)})},s.prototype._highlightChoice=function(e){e===void 0&&(e=null);var t=Array.from(this.dropdown.element.querySelectorAll(W));if(t.length){var i=e,n=this.config.classNames.highlightedState,o=Array.from(this.dropdown.element.querySelectorAll(Y(n)));o.forEach(function(r){L(r,n),r.setAttribute("aria-selected","false")}),i?this._highlightPosition=t.indexOf(i):(t.length>this._highlightPosition?i=t[this._highlightPosition]:i=t[t.length-1],i||(i=t[0])),v(i,n),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(C.highlightChoice,{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},s.prototype._addItem=function(e,t,i){if(t===void 0&&(t=!0),i===void 0&&(i=!1),!e.id)throw new TypeError("item.id must be set before _addItem is called for a choice/item");(this.config.singleModeForMultiSelect||this._isSelectOneElement)&&this.removeActiveItems(e.id),this._store.dispatch(_e(e)),t&&(this.passedElement.triggerEvent(C.addItem,this._getChoiceForOutput(e)),i&&this.passedElement.triggerEvent(C.choice,this._getChoiceForOutput(e)))},s.prototype._removeItem=function(e){if(e.id){this._store.dispatch(ye(e));var t=this._notice;t&&t.type===S.noChoices&&this._clearNotice(),this.passedElement.triggerEvent(C.removeItem,this._getChoiceForOutput(e))}},s.prototype._addChoice=function(e,t,i){if(t===void 0&&(t=!0),i===void 0&&(i=!1),e.id)throw new TypeError("Can not re-add a choice which has already been added");var n=this.config;if(!(!n.duplicateItemsAllowed&&this._store.choices.find(function(a){return n.valueComparer(a.value,e.value)}))){this._lastAddedChoiceId++,e.id=this._lastAddedChoiceId,e.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(e.id);var o=n.prependValue,r=n.appendValue;o&&(e.value=o+e.value),r&&(e.value+=r.toString()),(o||r)&&e.element&&(e.element.value=e.value),this._clearNotice(),this._store.dispatch(ve(e)),e.selected&&this._addItem(e,t,i)}},s.prototype._addGroup=function(e,t){var i=this;if(t===void 0&&(t=!0),e.id)throw new TypeError("Can not re-add a group which has already been added");this._store.dispatch(nt(e)),e.choices&&(this._lastAddedGroupId++,e.id=this._lastAddedGroupId,e.choices.forEac
1h(function(n){n.group=e,e.disabled&&(n.disabled=!0),i._addChoice(n,t)}))},s.prototype._createTemplates=function(){var e=this,t=this.config.callbackOnCreateTemplates,i={};typeof t=="function"&&(i=t.call(this,ct,fe,ee));var n={};Object.keys(this._templates).forEach(function(o){o in i?n[o]=i[o].bind(e):n[o]=e._templates[o].bind(e)}),this._templates=n},s.prototype._createElements=function(){var e=this._templates,t=this,i=t.config,n=t._isSelectOneElement,o=i.position,r=i.classNames,a=this._elementType;this.containerOuter=new Ee({element:e.containerOuter(i,this._direction,this._isSelectElement,n,i.searchEnabled,a,i.labelId),classNames:r,type:a,position:o}),this.containerInner=new Ee({element:e.containerInner(i),classNames:r,type:a,position:o}),this.input=new vt({element:e.input(i,this._placeholderValue),classNames:r,type:a,preventPaste:!i.paste}),this.choiceList=new we({element:e.choiceList(i,n)}),this.itemList=new we({element:e.itemList(i,n)}),this.dropdown=new gt({element:e.dropdown(i),classNames:r,type:a})},s.prototype._createStructure=function(){var e=this,t=e.containerInner,i=e.containerOuter,n=e.passedElement,o=this.dropdown.element;n.conceal(),t.wrap(n.element),i.wrap(t.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":(this._placeholderValue&&(this.input.placeholder=this._placeholderValue),this.input.setWidth()),i.element.appendChild(t.element),i.element.appendChild(o),t.element.appendChild(this.itemList.element),o.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&o.insertBefore(this.input.element,o.firstChild):t.element.appendChild(this.input.element),this._highlightPosition=0,this._isSearching=!1},s.prototype._initStore=function(){var e=this;this._store.subscribe(this._render).withTxn(function(){e._addPredefinedChoices(e._presetChoices,e._isSelectOneElement&&!e._hasNonChoicePlaceholder,!1)}),(!this._store.choices.length||this._isSelectOneElement&&this._hasNonChoicePlaceholder)&&this._render()},s.prototype._addPredefinedChoices=function(e,t,i){var n=this;if(t===void 0&&(t=!1),i===void 0&&(i=!0),t){var o=e.findIndex(function(r){return r.selected})===-1;o&&e.some(function(r){return r.disabled||"choices"in r?!1:(r.selected=!0,!0)})}e.forEach(function(r){"choices"in r?n._isSelectElement&&n._addGroup(r,i):n._addChoice(r,i)})},s.prototype._findAndSelectChoiceByValue=function(e,t){var i=this;t===void 0&&(t=!1);var n=this._store.choices.find(function(o){return i.config.valueComparer(o.value,e)});return n&&!n.disabled&&!n.selected?(this._addItem(n,!0,t),!0):!1},s.prototype._generatePlaceholderValue=function(){var e=this.config;if(!e.placeholder)return null;if(this._hasNonChoicePlaceholder)return e.placeholderValue;if(this._isSelectElement){var t=this.passedElement.placeholderOption;return t?t.text:null}return null},s.prototype._warnChoicesInitFailed=function(e){if(!this.config.silent)if(this.initialised){if(!this.initialisedOK)throw new TypeError("".concat(e," called for an element which has multiple instances of Choices initialised on it"))}else throw new TypeError("".concat(e," called on a non-initialised instance of Choices"))},s.version="11.1.0",s}();const wi=(s={},e={})=>({__fetch:e.fetchImpl??((...t)=>globalThis.fetch(...t)),__now:e.now??(()=>new Date),_iso(t){return t.toISOString().slice(0,10)},_parseISO(t){return new Date(t+"T00:00:00Z")},MAX_NIGHTS:31,propertyId:Number(s.propertyId??0),websiteId:Number(s.websiteId??0),availability:s.availability??{},propertyName:s.propertyName??"",firstSelectedDate:null,secondSelectedDate:null,tariffShow:!1,selectedTariff:null,feeBreakdown:[],currencySymbol:"£",isLoadingTariff:!1,errorNotice:null,showNoticeForToday:null,showNoticeForTomorrow:null,_today:null,_eachDateInclusive(t,i,n){let o=this._parseISO(t),r=this._parseISO(i);r<o&&([o,r]=[r,o]);for(let a=new Date(o);a<=r;a.setUTCDate(a.getUTCDate()+1)){const l=this._iso(a);if(n(l)===!1)return!1}return!0},_hasContinuity(t,i,{allowYesterday:n=!0}={}){return this._eachDateInclusive(t,i,o=>this.isDateAvailable(o)||n&&this.isDateAvailableYesterday(o)?void 0:!1)},_resetSecondarySelection(){this.secondSelectedDate=null,this.selectedTariff=null,this.tariffShow=!1,this.showNoticeForToday=!1,this.showNoticeForTomorrow=!1,this.feeBreakdown=[]},_setError(t){this.errorNotice=t||"",t&&this.scrollToTop()},_isWeeklyCycle(t){const i=this.getNightsAvailability(t);return i[7]===!0&&Object.values(i).filter(n=>n===!0).length===1},_canWeeklyExtend(t){var i;return((i=this.getNightsAvailability(t))==null?void 0:i[7])===!0},isDateAvailable(t){var i;return((i=this.availability[t])==null?void 0:i.available_today)===!0},isDateAvailableYesterday(t){var i;return((i=this.availability[t])==null?void 0:i.available_yesterday)===!0},isDateAvailableTomorrow(t){var i;return((i=this.availability[t])==null?void 0:i.available_tomorrow)===!0},isToday(t){const i=new Date,n=new Date(t);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()},isFirstUnavailableDay(t){return!this.isDateAvailable(t)&&this.isDateAvailableYesterday(t)},isLastUnavailableDay(t){return!this.isDateAvailable(t)&&this.isDateAvailableTomorrow(t)},isCheckinAllowed(t){return this.isDateAvailable(t)&&this.hasAnyStayLength(t)},todayLocalISO(){return this._now??(this._now=this._iso(new Date))},tomorrowLocalISO(){const t=new Date;return t.setDate(t.getDate()+1),this._iso(t)},isAfter10amLocal(){return this.__now().getHours()>=10},isPastDate(t){return t<this.todayLocalISO()},isBlockedStart(t){return this.isPastDate(t)?!0:this.isDateAvailable(t)&&!this.hasAnyStayLength(t)||!this.isDateAvailable(t)},isBlockedCheckout(t){return this.firstSelectedDate!==null&&this.secondSelectedDate===null&&!this.canCheckoutOnForCurrentStart(t)},getAllowedStayLengths(t){var n;const i=((n=this.availability[t])==null?void 0:n.nights)??{};return Object.entries(i).filter(([o,r])=>r===!0).map(([o])=>Number(o)).sort((o,r)=>o-r)},getSingleAllowedStayLength(t){const i=this.getAllowedStayLengths(t).filter(n=>n>=2);return i.length===1?i[0]:null},getMinAllowedStayLength(t){var o;const i=((o=this.availability[t])==null?void 0:o.nights)??{};let n=1/0;for(const[r,a]of Object.entries(i)){const l=Number(r);a===!0&&l>=2&&l<n&&(n=l)}return n===1/0?null:n},autoSelectSecondDateIfSingle(t){const i=this.getSingleAllowedStayLength(t);if(!i)return;const n=this.addDays(t,i);this.isStayLengthAllowed(n,i)||this.canSelectDateRange(t,n)&&(this.secondSelectedDate=n,this.fetchTariff())},addDays(t,i){const n=new Date(t+"T00:00:00Z");return n.setUTCDate(n.getUTCDate()+i),n.toISOString().slice(0,10)},nightsBetween(t,i){const n=new Date(t+"T00:00:00Z"),o=new Date(i+"T00:00:00Z");return Math.round((o-n)/864e5)},getNightsAvailability(t){var i;return((i=this.availability[t])==null?void 0:i.nights)??{}},hasAnyStayLength(t){const i=this.getNightsAvailability(t);return Object.values(i).some(n=>n===!0)},isStayLengthAllowed(t,i){var a;if(i>this.MAX_NIGHTS)return!1;const n=this.getNightsAvailability(t);if(this._isWeeklyCycle(t))return i%7===0;if(this._canWeeklyExtend(t)&&i%7===0){const l=this.addDays(t,i);if(this._hasContinuity(t,l,{allowYesterday:!0}))return!0}if((n==null?void 0:n[i])===!0)return!0;
1if(!(((a=this.availability[t])==null?void 0:a.extendable)===!0))return!1;const r=this.getMinAllowedStayLength(t);return r!==null&&i>=r&&i<=31},allowedCheckoutDates(t){var r;const i=new Set,n=this.getNightsAvailability(t);if(this._canWeeklyExtend(t))for(let a=7;a<=this.MAX_NIGHTS;a+=7){const l=this.addDays(t,a);this._hasContinuity(t,l,{allowYesterday:!1})&&i.add(l)}for(const[a,l]of Object.entries(n||{}))l===!0&&i.add(this.addDays(t,Number(a)));if(((r=this.availability[t])==null?void 0:r.extendable)===!0){const a=this.getMinAllowedStayLength(t);if(a!==null)for(let l=a;l<=this.MAX_NIGHTS;l++)i.add(this.addDays(t,l))}return i},isValidCheckoutForCurrentStart(t){if(!this.firstSelectedDate)return!1;const i=this.nightsBetween(this.firstSelectedDate,t);return i<1?!1:this.isStayLengthAllowed(this.firstSelectedDate,i)},isSelected(t){return this.firstSelectedDate&&this.secondSelectedDate?t>=this.firstSelectedDate&&t<=this.secondSelectedDate:t===this.firstSelectedDate},canSelectEndDate(t,i){return this._hasContinuity(t,i,{allowYesterday:!1})},canSelectDateRange(t,i){let n=this._parseISO(t),o=this._parseISO(i);o<n&&([n,o]=[o,n]);const r=this._iso(n),a=this._iso(o);if(!this.isCheckinAllowed(r))return!1;const l=this.nightsBetween(r,a);return!(l<2||!this.isStayLengthAllowed(r,l)||!this._hasContinuity(r,a,{allowYesterday:!0}))},canCheckoutOnForCurrentStart(t){if(!this.firstSelectedDate||this.secondSelectedDate!==null)return!1;const i=this.nightsBetween(this.firstSelectedDate,t);return i<2||!this.isStayLengthAllowed(this.firstSelectedDate,i)?!1:this._hasContinuity(this.firstSelectedDate,t,{allowYesterday:!0})},getDateDifference(t,i){let n=new Date(t);return(new Date(i).getTime()-n.getTime())/(1e3*3600*24)},formatMoney(t){const i=Number(t)/100;return this.currencySymbol+i.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})},inferSymbolFromFormatted(t){return(t||"").replace(/[\d\s.,-]/g,"")||this.currencySymbol},async handleDateSelection(t){this._setError("");const i=this.todayLocalISO()===t&&this.hasAnyStayLength(t),n=this.tomorrowLocalISO()===t&&this.isAfter10amLocal()&&this.hasAnyStayLength(t);if(i||n){this.showNoticeForToday=i,this.showNoticeForTomorrow=n,this.firstSelectedDate=null,this.secondSelectedDate=null,this.tariffShow=!1,this.selectedTariff=null,this.feeBreakdown=[],this.scrollToTop();return}if(this.isPastDate(t))return!1;if(this.firstSelectedDate===null){if(!this.isCheckinAllowed(t)){this._setError("You canât start your stay on this date.");return}this.firstSelectedDate=t,this.showNoticeForToday=!1,this.showNoticeForTomorrow=!1,this.autoSelectSecondDateIfSingle(this.firstSelectedDate);return}if(this.secondSelectedDate===null&&this.firstSelectedDate===t){this.firstSelectedDate=null,this._resetSecondarySelection();return}if(this.secondSelectedDate===null){if(this.firstSelectedDate!==t&&!this.canCheckoutOnForCurrentStart(t)){const o=Math.abs(this.nightsBetween(this.firstSelectedDate,t));o<2?this._setError("Minimum selection is 3 days (2 nights)."):this.isStayLengthAllowed(this.firstSelectedDate,o)?this._setError("Invalid selection: There are unavailable days in that span."):this._setError(`That checkout isnât available for a ${o}-night stay from your arrival.`),this._resetSecondarySelection();return}if(this.secondSelectedDate=t,new Date(this.secondSelectedDate)<new Date(this.firstSelectedDate)&&([this.firstSelectedDate,this.secondSelectedDate]=[this.secondSelectedDate,this.firstSelectedDate]),this.getDateDifference(this.firstSelectedDate,this.secondSelectedDate)<2){this._setError("Minimum selection is 3 days (2 nights)."),this._resetSecondarySelection();return}await this.fetchTariff();return}if(!this.isCheckinAllowed(t)){this._setError("You canât start your stay on this date.");return}this.firstSelectedDate=t,this._resetSecondarySelection(),this.autoSelectSecondDateIfSingle(this.firstSelectedDate)},formattedDate(t){const i={year:"numeric",month:"long",day:"numeric"};return new Date(t).toLocaleDateString(void 0,i)},async fetchTariff(){var n;const t=this.firstSelectedDate,i=this.secondSelectedDate;if(t&&i){this.isLoadingTariff=!0;try{const o=new URLSearchParams({startDate:t,endDate:i,propertyId:String(this.propertyId)}),r=await this.__fetch(`/availability/${this.propertyId}/tariff?${o.toString()}`,{headers:{Accept:"application/json"}}),a=await r.json();if(!r.ok){if(r.status===404)this.errorNotice=(a==null?void 0:a.message)??"Property unavailable for requested dates";else if(r.status===422){const h=(a==null?void 0:a.errors)??{};this.errorNotice=Object.values(h).flat().join(" ")}else this.errorNotice=(a==null?void 0:a.message)??"Error fetching tariff";this.tariffShow=!1,this.selectedTariff=null,this.feeBreakdown=[];return}const l=a.data??a,c=l.discount_tariff??l.tariff;this.currencySymbol=this.inferSymbolFromFormatted((n=c==null?void 0:c.formatted)==null?void 0:n.total)||this.currencySymbol,this.nights=l.nights??this.getDateDifference(t,i),this.selectedTariff=c,this.feeBreakdown=(c==null?void 0:c.breakdown)??[],this.tariffShow=!0,this.scrollToTop()}catch(o){console.error("Error fetching tariff:",o),this.errorNotice="Error fetching tariff",this.tariffShow=!1,this.selectedTariff=null,this.feeBreakdown=[]}finally{this.isLoadingTariff=!1}}},scrollToTop(){if(typeof document>"u"||typeof window>"u")return;const t=document.getElementById("top-section");if(!t)return;const i=t.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:i,behavior:"smooth"})}});function Di(){return{isFixed:!1,init(){window.addEventListener("scroll",()=>{this.isFixed=window.scrollY>1})}}}function Ci(s="#search"){const e=document.querySelector(s);if(!e||e.dataset.choicesInitialized)return;e.dataset.choicesInitialized="true";const t="searchOptions",i="searchOptionsExpires",n=24*60*60*1e3;async function o(){const a=localStorage.getItem(t),l=localStorage.getItem(i),c=Date.now();if(a&&l&&c<Number(l))return JSON.parse(a);try{const h=await fetch("/api/search/options"),{items:u}=await h.json();return localStorage.setItem(t,JSON.stringify(u)),localStorage.setItem(i,Str
1ing(c+n)),u}catch(h){return console.error("Failed to load search options:",h),a?JSON.parse(a):[]}}const r=new qe(e,{allowHTML:!0,searchResultLimit:10,shouldSort:!1,placeholder:!0,renderChoiceLimit:5,placeholderValue:"Destination/Property",searchPlaceholderValue:"Search for a destination or property",fuseOptions:{threshold:.3,ignoreLocation:!0,includeScore:!1,distance:100,findAllMatches:!0,keys:["label"]}});return o().then(a=>{if(!Array.isArray(a))return;const l=a.map(c=>({value:c.value,label:c.label,customProperties:{type:c.type}}));r.setChoices(l,"value","label",!0)}),e.addEventListener("change",a=>{const l=a.target.selectedOptions[0],c=l.getAttribute("data-custom-properties"),{type:h}=c?JSON.parse(c):{},u=l.value;h==="property"?window.location.href=u:window.dispatchEvent(new CustomEvent("open-calendar")),window.dispatchEvent(new CustomEvent("search-choice-changed"))}),r}function Ii(s={}){return{showGuestpicker:!1,guestpickerValue:"",adults:s.adults??0,children:s.children??0,infants:s.infants??0,dogs:s.dogs??0,showAdditionalGuestOptions:!1,init(){this.updateGuestpickerValue(),this.adults>0&&(this.showAdditionalGuestOptions=!0),this.updateHiddenFields()},updateGuests(e,t){this[e]=t,e==="adults"&&(t===0?(this.children=0,this.infants=0,this.dogs=0,this.showAdditionalGuestOptions=!1):this.showAdditionalGuestOptions=!0),this.updateGuestpickerValue(),this.updateHiddenFields()},updateGuestpickerValue(){const e=[];this.adults>0&&e.push(`${this.adults} Adult${this.adults>1?"s":""}`),this.children>0&&e.push(`${this.children} Child${this.children>1?"ren":""}`),this.infants>0&&e.push(`${this.infants} Infant${this.infants>1?"s":""}`),this.dogs>0&&e.push(`${this.dogs} Dog${this.dogs>1?"s":""}`),this.guestpickerValue=e.join(", ")},updateHiddenFields(){this.$refs.adults.value=this.adults,this.$refs.children.value=this.children,this.$refs.infants.value=this.infants,this.$refs.dogs.value=this.dogs}}}function Ai(){const s=["January","February","March","April","May","June","July","August","September","October","November","December"],e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=document.getElementById("datepicker"),i=t.getAttribute("data-checkin"),n=t.getAttribute("data-checkout"),o=t.getAttribute("data-flexibility");return{MONTH_NAMES:s,DAYS:e,showDatepicker:!1,datepickerValue:"",hasError:!1,checkinDate:i?new Date(i):null,checkoutDate:n?new Date(n):null,flexibility:o||"3d",temporaryCheckoutDate:null,month:"",year:"",no_of_days:[],blankdays:[],days:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],initDate(){let r=new Date;this.setFlexibility(this.flexibility),this.month=this.checkinDate?this.checkinDate.getMonth():r.getMonth(),this.year=this.checkinDate?this.checkinDate.getFullYear():r.getFullYear(),this.initDateValue(),this.getNoOfDays(),window.addEventListener("open-calendar",()=>{this.showDatepicker||this.showDatepickerToggle(),this.$nextTick(()=>this.$refs.datepickerInput.focus())}),window.addEventListener("search-date-error",()=>{this.hasError=!0}),window.addEventListener("search-date-error-clear",()=>{this.hasError=!1})},formatDate(r){return r.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})},formatDateWithYear(r){return r.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short",year:"numeric"})},formatDateString(r){return r.getFullYear()+"-"+("0"+(r.getMonth()+1)).slice(-2)+"-"+("0"+r.getDate()).slice(-2)},formatFlexibility(r){if(!r||r==="exact")return"";let a=parseInt(r.replace("d",""));return` (+/- ${a} day${a>1?"s":""})`},initDateValue(){this.checkinDate&&this.checkoutDate?this.datepickerValue=this.formatDate(this.checkinDate)+" - "+this.formatDateWithYear(this.checkoutDate)+this.formatFlexibility(this.flexibility):this.checkinDate?this.datepickerValue=this.formatDate(this.checkinDate)+" / Check-out":this.datepickerValue="Check-in / Check-out",this.checkinDate&&(this.$refs.checkin.value=this.formatDateString(this.checkinDate)),this.checkoutDate&&(this.$refs.checkout.value=this.formatDateString(this.checkoutDate)),this.setFlexibility(this.flexibility)},setDateValues(r){!this.checkinDate||this.checkoutDate?(this.checkinDate=r,this.checkoutDate=null,this.temporaryCheckoutDate=null,this.$refs.checkin.value=this.formatDateString(r),this.$refs.checkout.value=null,this.datepickerValue=this.formatDate(this.checkinDate)+" / Checkout"):r>=this.checkinDate?(this.checkoutDate=r,this.$refs.checkout.value=this.formatDateString(r),this.datepickerValue=this.formatDate(this.checkinDate)+" - "+this.formatDateWithYear(this.checkoutDate)+this.formatFlexibility(this.flexibility),window.dispatchEvent(new CustomEvent("search-dates-changed"))):(this.checkinDate=r,this.checkoutDate=null,this.$refs.checkin.value=this.formatDateString(r),this.$refs.checkout.value=null,this.datepickerValue=this.formatDate(this.checkinDate)+" / Checkout")},isToday(r){const a=new Date,l=new Date(this.year,this.month,r);return a.toDateString()===l.toDateString()},getDateValue(r){let a=new Date(this.year,this.month,r);this.isDateSelectable(a)&&this.setDateValues(a)},getNoOfDays(){let r=new Date(this.year,this.month+1,0).getDate(),a=new Date(this.year,this.month).getDay(),l=[];for(var c=1;c<=a;
1c++)l.push(c);let h=[];for(var c=1;c<=r;c++)h.push(c);this.blankdays=l,this.no_of_days=h},isDateSelectable(r){return ze(r,{checkinDate:this.checkinDate,checkoutDate:this.checkoutDate,cutoffHour:10,maxYear:2028})},showDatepickerToggle(){this.showDatepicker=!this.showDatepicker,this.showDatepicker&&this.adjustDatePickerPosition()},adjustDatePickerPosition(){if(window.innerWidth<768){const r=this.$refs.datepickerInput;if(r){const a=r.getBoundingClientRect().top-120;a>1&&window.scrollTo({top:a,behavior:"smooth"})}}},incrementMonth(){this.month==11?this.year<2029&&(this.year++,this.month=0):this.month++,this.getNoOfDays()},decrementMonth(){this.month==0?(this.year>new Date().getFullYear()||this.year==new Date().getFullYear()&&new Date().getMonth()==0)&&(this.year--,this.month=11):this.month--,this.getNoOfDays()},handleDateHover(r){let a=new Date(this.year,this.month,r);this.checkinDate&&!this.checkoutDate&&a>this.checkinDate?this.temporaryCheckoutDate=a:this.temporaryCheckoutDate=null},isDateInRange(r){const a=new Date(this.year,this.month,r);if(!this.checkinDate)return!1;const l=this.checkoutDate||this.temporaryCheckoutDate;return l?a>=this.checkinDate&&a<=l:!1},dateClass(r){let a="cursor-pointer text-center text-sm leading-none rounded-full leading-loose transition ease-in-out duration-100";const l=new Date(this.year,this.month,r),c=this.checkinDate&&l.toDateString()===this.checkinDate.toDateString(),h=this.checkoutDate&&l.toDateString()===this.checkoutDate.toDateString(),u=this.temporaryCheckoutDate&&l.toDateString()===this.temporaryCheckoutDate.toDateString();return c||h||u?(a+=" bg-cg-seafoam text-white",a):this.isDateInRange(r)?(a+=" bg-cg-seafoam text-white opacity-50",a):(this.isToday(r)?a+=" text-gray-300 hover:cursor-not-allowed":this.isDateSelectable(l)?a+=" hover:bg-cg-seafoam hover:text-white":a+=" text-gray-300 hover:cursor-not-allowed",a)},setFlexibility(r){this.flexibility=r,this.checkinDate&&this.checkoutDate&&(this.datepickerValue=this.formatDate(this.checkinDate)+" - "+this.formatDateWithYear(this.checkoutDate)+this.formatFlexibility(this.flexibility)),this.$refs.flexibilityField.value=r,this.showDatepicker=!1}}}function Oi(){return{searchSelected:!1,showSearchError:!1,showDateError:!1,init(){if(this.$el.tagName==="FORM"?this.$el:this.$el.closest("form")){const e=new URLSearchParams(window.location.search);e.has("search")&&e.get("search")&&(this.searchSelected=!0)}window.addEventListener("search-choice-changed",()=>{this.searchSelected=!0,this.showSearchError=!1,window.dispatchEvent(new CustomEvent("search-choice-error-clear"))}),window.addEventListener("search-dates-changed",()=>{this.showDateError=!1,window.dispatchEvent(new CustomEvent("search-date-error-clear"))})},validate(s){var n,o;const e=s.target,t=((n=e.querySelector('[name="checkin"]'))==null?void 0:n.value)||"",i=((o=e.querySelector('[name="checkout"]'))==null?void 0:o.value)||"";if(!this.searchSelected){this.showSearchError=!0,window.dispatchEvent(new CustomEvent("search-choice-error"));const r=e.querySelector('[name="search"]');r!=null&&r.choices&&r.choices.showDropdown();return}if(!t||!i){this.showDateError=!0,window.dispatchEvent(new CustomEvent("search-date-error")),window.dispatchEvent(new CustomEvent("open-calendar"));return}e.submit()}}}window.Choices=qe;Object.assign(window,{scrollBehavior:Di,initSearchDropdown:Ci,guestPickerApp:Ii,datePickerApp:Ai,searchFormValidation:Oi});window.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-chart]").forEach(s=>{new Xe(s,JSON.parse(s.dataset.chart))})});Alpine.plugin(Qe);Alpine.data("availabilityCalendar",wi);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.