@contributte/datagrid 0.0.0-20250804-2874d03 → 0.0.0-20250805-f476dfd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,17 +4,17 @@ const e=e=>{"loading"===document.readyState?document.addEventListener("DOMConten
4
4
  *
5
5
  * This file is part of the Nette Framework (https://nette.org)
6
6
  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
7
- */var b=(m||(m=1,v.exports=function(){class e{filled(e,t,i){return""!==i&&!1!==i&&null!==i&&(!Array.isArray(i)||i.length>0)&&(!(i instanceof FileList)||i.length>0)}blank(e,t,i){return!this.filled(e,t,i)}valid(e,t){return t.validateControl(e,void 0,!0)}equal(e,t,i){if(void 0===t)return null;let n=e=>"number"==typeof e||"string"==typeof e?""+e:!0===e?"1":"",r=Array.isArray(i)?i:[i],s=Array.isArray(t)?t:[t];e:for(let e of r){for(let t of s)if(n(e)===n(t))continue e;return!1}return r.length>0}notEqual(e,t,i){return void 0===t?null:!this.equal(e,t,i)}minLength(e,t,i){return(i="number"==typeof i?i.toString():i).length>=t}maxLength(e,t,i){return(i="number"==typeof i?i.toString():i).length<=t}length(e,t,i){return i="number"==typeof i?i.toString():i,(null===(t=Array.isArray(t)?t:[t,t])[0]||i.length>=t[0])&&(null===t[1]||i.length<=t[1])}email(e,t,i){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(i)}url(e,t,i,n){return/^[a-z\d+.-]+:/.test(i)||(i="https://"+i),!!/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(i)&&(n.value=i,!0)}regexp(e,t,i){let n="string"==typeof t&&t.match(/^\/(.*)\/([imu]*)$/);try{return n&&new RegExp(n[1],n[2].replace("u","")).test(i)}catch{return null}}pattern(e,t,i,n,r){if("string"!=typeof t)return null;try{let e;try{e=new RegExp("^(?:"+t+")$",r?"ui":"u")}catch{e=new RegExp("^(?:"+t+")$",r?"i":"")}return i instanceof FileList?Array.from(i).every(t=>e.test(t.name)):e.test(i)}catch{return null}}patternCaseInsensitive(e,t,i){return this.pattern(e,t,i,null,!0)}numeric(e,t,i){return/^[0-9]+$/.test(i)}integer(e,t,i,n){return!!/^-?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}float(e,t,i,n){return i=i.replace(/ +/g,"").replace(/,/g,"."),!!/^-?[0-9]*\.?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}min(e,t,i){return Number.isFinite(t)&&(i=parseFloat(i)),i>=t}max(e,t,i){return Number.isFinite(t)&&(i=parseFloat(i)),i<=t}range(e,t,i){return Array.isArray(t)?"time"===e.type&&t[0]>t[1]?i>=t[0]||i<=t[1]:(null===t[0]||this.min(e,t[0],i))&&(null===t[1]||this.max(e,t[1],i)):null}submitted(e){return e.form["nette-submittedBy"]===e}fileSize(e,t,i){return Array.from(i).every(e=>e.size<=t)}mimeType(e,t,i){let n=[];(t=Array.isArray(t)?t:[t]).forEach(e=>n.push("^"+e.replace(/([^\w])/g,"\\$1").replace("\\*",".*")+"$"));let r=new RegExp(n.join("|"));return Array.from(i).every(e=>!e.type||r.test(e.type))}image(e,t,i){return this.mimeType(e,t??["image/gif","image/png","image/jpeg","image/webp"],i)}static(e,t){return t}}class t{formErrors=[];validators=new e;#e={};#t={};#i=new WeakMap;#n(e,t){let i=e.elements.namedItem(t);return i instanceof RadioNodeList?i[0]:i}#r(e){let t=e.form.elements.namedItem(e.name);return t instanceof RadioNodeList?Array.from(t):[t]}#s(e){"loading"!==document.readyState?e.call(this):document.addEventListener("DOMContentLoaded",e)}getValue(e){return e instanceof HTMLInputElement?"radio"===e.type?this.#r(e).find(e=>e.checked)?.value??null:"file"===e.type?e.files:"checkbox"===e.type?e.name.endsWith("[]")?this.#r(e).filter(e=>e.checked).map(e=>e.value):e.checked:e.value.trim():e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions,e=>e.value):e.selectedOptions[0]?.value??null:e instanceof HTMLTextAreaElement?e.value:e instanceof RadioNodeList?this.getValue(e[0]):null}getEffectiveValue(e,t=!1){let i=this.getValue(e);if(i===e.getAttribute("data-nette-empty-value")&&(i=""),t&&void 0===this.#e[e.name]){this.#e[e.name]=!0;let t={value:i};this.validateControl(e,void 0,!0,t),i=t.value,delete this.#e[e.name]}return i}validateControl(e,t,i=!1,n,r){t??=JSON.parse(e.getAttribute("data-nette-rules")??"[]"),n??={value:this.getEffectiveValue(e)},r??=!this.validateRule(e,":filled",null,n);for(let s of t){let t=s.op.match(/(~)?([^?]+)/),o=s.control?this.#n(e.form,s.control):e;if(s.neg=!!t[1],s.op=t[2],s.condition=!!s.rules,!o)continue;if(r&&!s.condition&&":filled"!==s.op)continue;let a=this.validateRule(o,s.op,s.arg,e===o?n:void 0);if(null!==a)if(s.neg&&(a=!a),s.condition&&a){if(!this.validateControl(e,s.rules,i,n,":blank"!==s.op&&r))return!1}else if(!s.condition&&!a){if(this.isDisabled(o))continue;if(!i){let t=Array.isArray(s.arg)?s.arg:[s.arg],i=s.msg.replace(/%(value|\d+)/g,(i,n)=>this.getValue("value"===n?o:e.form.elements.namedItem(t[n].control)));this.addError(o,i)}return!1}}return!0}validateForm(e,t=!1){let i,n=e.form??e;if(this.formErrors=[],null!==e.getAttribute("formnovalidate")){let t=JSON.parse(e.getAttribute("data-nette-validation-scope")??"[]");if(!t.length)return this.showFormErrors(n,[]),!0;i=new RegExp("^("+t.join("-|")+"-)")}for(let e of n.elements)if(e.willValidate&&e.validity.badInput)return e.reportValidity(),!1;for(let e of n.elements)if(e.getAttribute("data-nette-rules")&&(!i||e.name.replace(/]\[|\[|]|$/g,"-").match(i))&&!this.isDisabled(e)&&!this.validateControl(e,void 0,t)&&!this.formErrors.length)return!1;let r=!this.formErrors.length;return this.showFormErrors(n,this.formErrors),r}isDisabled(e){return"radio"===e.type?this.#r(e).every(e=>e.disabled):e.disabled}addError(e,t){this.formErrors.push({element:e,message:t})}showFormErrors(e,t){let i,n=[];for(let e of t)n.indexOf(e.message)<0&&(n.push(e.message),i??=e.element);n.length&&this.showModal(n.join("\n"),()=>{i?.focus()})}showModal(e,t){let i=document.createElement("dialog");if(!i.showModal)return alert(e),void t();let n=document.createElement("style");n.innerText=".netteFormsModal { text-align: center; margin: auto; border: 2px solid black; padding: 1rem } .netteFormsModal button { padding: .1em 2em }";let r=document.createElement("button");r.innerText="OK",r.onclick=()=>{i.remove(),t()},i.setAttribute("class","netteFormsModal"),i.innerText=e+"\n\n",i.append(n,r),document.body.append(i),i.showModal()}validateRule(e,t,i,n){if(e.validity.badInput)return":filled"===t;n??={value:this.getEffectiveValue(e,!0)};let r=":"===t.charAt(0)?t.substring(1):t;r=r.replace("::","_").replaceAll("\\","");let s=Array.isArray(i)?i:[i];return s=s.map(t=>{if(t?.control){let i=this.#n(e.form,t.control);return i===e?n.value:this.getEffectiveValue(i,!0)}return t}),"valid"===r&&(s[0]=this),this.validators[r]?this.validators[r](e,Array.isArray(i)?s:s[0],n.value,n):null}toggleForm(e,t){this.#t={};for(let i of Array.from(e.elements))i.getAttribute("data-nette-rules")&&this.toggleControl(i,void 0,null,!t);for(let e in this.#t)this.toggle(e,this.#t[e].state,this.#t[e].elem,t)}toggleControl(e,t,i=null,n=!1,r,s){t??=JSON.parse(e.getAttribute("data-nette-rules")??"[]"),r??={value:this.getEffectiveValue(e)},s??=!this.validateRule(e,":filled",null,r);let o,a=!1;for(let l of t){let t=l.op.match(/(~)?([^?]+)/),c=l.control?this.#n(e.form,l.control):e;if(l.neg=!!t[1],l.op=t[2],l.condition=!!l.rules,c&&(!s||l.condition||":filled"===l.op)){if(o=i,!1!==i){if(o=this.validateRule(c,l.op,l.arg,e===c?r:void 0),null===o)continue;l.neg&&(o=!o),l.condition||(i=o)}if(l.condition&&this.toggleControl(e,l.rules,o,n,r,":blank"!==l.op&&s)||l.toggle){a=!0,n&&this.#r(c).filter(e=>!this.#i.has(e)).forEach(t=>{t.addEventListener("change",t=>this.toggleForm(e.form,t)),this.#i.set(t,null)});for(let t in l.toggle??{})this.#t[t]??={elem:e,state:!1},this.#t[t].state||=l.toggle[t]?!!o:!o}}}return a}toggle(e,t,i,n){/^\w[\w.:-]*$/.test(e)&&(e="#"+e),Array.from(document.querySelectorAll(e)).forEach(e=>e.hidden=!t)}compactCheckboxes(e,t){let i={};for(let n of e.elements)n instanceof HTMLInputElement&&"checkbox"===n.type&&n.name.endsWith("[]")&&n.checked&&!n.disabled&&(t.delete(n.name),i[n.name]??=[],i[n.name].push(n.value));for(let e in i)t.set(e.substring(0,e.length-2),i[e].join(","))}initForm(e){"get"===e.method&&e.hasAttribute("data-nette-compact")&&e.addEventListener("formdata",t=>this.compactCheckboxes(e,t.formData)),Array.from(e.elements).some(e=>e.getAttribute("data-nette-rules"))&&(this.toggleForm(e),e.noValidate||(e.noValidate=!0,e.addEventListener("submit",t=>{this.validateForm(t.submitter||e)||(t.stopImmediatePropagation(),t.preventDefault())}),e.addEventListener("reset",()=>{setTimeout(()=>this.toggleForm(e))})))}initOnLoad(){this.#s(()=>{Array.from(document.forms).forEach(e=>this.initForm(e))})}}let i={"á":"a","ä":"a","č":"c","ď":"d","é":"e","ě":"e","í":"i","ľ":"l","ň":"n","ó":"o","ô":"o","ř":"r","š":"s","ť":"t","ú":"u","ů":"u","ý":"y","ž":"z"};function n(e){e=e.toLowerCase();let t="";for(let n=0;n<e.length;n++){let r=i[e.charAt(n)];t+=r||e.charAt(n)}return t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}var r="3.5.3";let s=new t;return s.version=r,s.webalize=n,s}()),v.exports),y=g(b);function _(e){return"Enter"===e.key}function w(){return null!=w?w:{}}function E(e,t=200){let i=null,n=!1;return(...r)=>{n||(i&&clearTimeout(i),i=setTimeout(()=>{const t=e(...r);var i;"object"==typeof(i=t)&&"function"==typeof i.then&&(n=!0,t.finally(()=>{n=!1}))},t))}}function A(e,t){e.split(/\s+/).forEach(e=>{t(e)})}class S{constructor(){this._events={}}on(e,t){A(e,e=>{const i=this._events[e]||[];i.push(t),this._events[e]=i})}off(e,t){var i=arguments.length;0!==i?A(e,e=>{if(1===i)return void delete this._events[e];const n=this._events[e];void 0!==n&&(n.splice(n.indexOf(t),1),this._events[e]=n)}):this._events={}}trigger(e,...t){var i=this;A(e,e=>{const n=i._events[e];void 0!==n&&n.forEach(e=>{e.apply(i,t)})})}}const k=e=>(e=e.filter(Boolean)).length<2?e[0]||"":1==T(e)?"["+e.join("")+"]":"(?:"+e.join("|")+")",O=e=>{if(!D(e))return e.join("");let t="",i=0;const n=()=>{i>1&&(t+="{"+i+"}")};return e.forEach((r,s)=>{r!==e[s-1]?(n(),t+=r,i=1):i++}),n(),t},C=e=>{let t=Array.from(e);return k(t)},D=e=>new Set(e).size!==e.length,x=e=>(e+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),T=e=>e.reduce((e,t)=>Math.max(e,L(t)),0),L=e=>Array.from(e).length,I=e=>{if(1===e.length)return[[e]];let t=[];const i=e.substring(1);return I(i).forEach(function(i){let n=i.slice(0);n[0]=e.charAt(0)+n[0],t.push(n),n=i.slice(0),n.unshift(e.charAt(0)),t.push(n)}),t},M=[[0,65535]];let F,N;const j={},P={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let e in P){let t=P[e]||"";for(let i=0;i<t.length;i++){let n=t.substring(i,i+1);j[n]=e}}const $=new RegExp(Object.keys(j).join("|")+"|[̀-ͯ·ʾʼ]","gu"),H=(e,t="NFKD")=>e.normalize(t),q=e=>Array.from(e).reduce((e,t)=>e+R(t),""),R=e=>(e=H(e).toLowerCase().replace($,e=>j[e]||""),H(e,"NFC"));const B=e=>{const t={},i=(e,i)=>{const n=t[e]||new Set,r=new RegExp("^"+C(n)+"$","iu");i.match(r)||(n.add(x(i)),t[e]=n)};for(let t of function*(e){for(const[t,i]of e)for(let e=t;e<=i;e++){let t=String.fromCharCode(e),i=q(t);i!=t.toLowerCase()&&(i.length>3||0!=i.length&&(yield{folded:i,composed:t,code_point:e}))}}(e))i(t.folded,t.folded),i(t.folded,t.composed);return t},V=e=>{const t=B(e),i={};let n=[];for(let e in t){let r=t[e];r&&(i[e]=C(r)),e.length>1&&n.push(x(e))}n.sort((e,t)=>t.length-e.length);const r=k(n);return N=new RegExp("^"+r,"u"),i},z=(e,t=1)=>(t=Math.max(t,e.length-1),k(I(e).map(e=>((e,t=1)=>{let i=0;return e=e.map(e=>(F[e]&&(i+=e.length),F[e]||e)),i>=t?O(e):""})(e,t)))),W=(e,t=!0)=>{let i=e.length>1?1:0;return k(e.map(e=>{let n=[];const r=t?e.length():e.length()-1;for(let t=0;t<r;t++)n.push(z(e.substrs[t]||"",i));return O(n)}))},Y=(e,t)=>{for(const i of t){if(i.start!=e.start||i.end!=e.end)continue;if(i.substrs.join("")!==e.substrs.join(""))continue;let t=e.parts;const n=e=>{for(const i of t){if(i.start===e.start&&i.substr===e.substr)return!1;if(1!=e.length&&1!=i.length){if(e.start<i.start&&e.end>i.start)return!0;if(i.start<e.start&&i.end>e.start)return!0}}return!1};if(!(i.parts.filter(n).length>0))return!0}return!1};class K{parts;substrs;start;end;constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(e){e&&(this.parts.push(e),this.substrs.push(e.substr),this.start=Math.min(e.start,this.start),this.end=Math.max(e.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(e,t){let i=new K,n=JSON.parse(JSON.stringify(this.parts)),r=n.pop();for(const e of n)i.add(e);let s=t.substr.substring(0,e-r.start),o=s.length;return i.add({start:r.start,end:r.start+o,length:o,substr:s}),i}}const U=e=>{void 0===F&&(F=V(M)),e=q(e);let t="",i=[new K];for(let n=0;n<e.length;n++){let r=e.substring(n).match(N);const s=e.substring(n,n+1),o=r?r[0]:null;let a=[],l=new Set;for(const e of i){const t=e.last();if(!t||1==t.length||t.end<=n)if(o){const t=o.length;e.add({start:n,end:n+t,length:t,substr:o}),l.add("1")}else e.add({start:n,end:n+1,length:1,substr:s}),l.add("2");else if(o){let i=e.clone(n,t);const r=o.length;i.add({start:n,end:n+r,length:r,substr:o}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort((e,t)=>e.length()-t.length());for(let e of a)Y(e,i)||i.push(e)}else if(n>0&&1==l.size&&!l.has("3")){t+=W(i,!1);let e=new K;const n=i[0];n&&e.add(n.last()),i=[e]}}return t+=W(i,!0),t},X=(e,t)=>{if(e)return e[t]},Q=(e,t)=>{if(e){for(var i,n=t.split(".");(i=n.shift())&&(e=e[i]););return e}},G=(e,t,i)=>{var n,r;return e?(e+="",null==t.regex||-1===(r=e.search(t.regex))?0:(n=t.string.length/e.length,0===r&&(n+=.5),n*i)):0},J=(e,t)=>{var i=e[t];if("function"==typeof i)return i;i&&!Array.isArray(i)&&(e[t]=[i])},Z=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},ee=(e,t)=>"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=q(e+"").toLowerCase())>(t=q(t+"").toLowerCase())?1:t>e?-1:0;class te{items;settings;constructor(e,t){this.items=e,this.settings=t||{diacritics:!0}}tokenize(e,t,i){if(!e||!e.length)return[];const n=[],r=e.split(/\s+/);var s;return i&&(s=new RegExp("^("+Object.keys(i).map(x).join("|")+"):(.*)$")),r.forEach(e=>{let i,r=null,o=null;s&&(i=e.match(s))&&(r=i[1],e=i[2]),e.length>0&&(o=this.settings.diacritics?U(e)||null:x(e),o&&t&&(o="\\b"+o)),n.push({string:e,regex:o?new RegExp(o,"iu"):null,field:r})}),n}getScoreFunction(e,t){var i=this.prepareSearch(e,t);return this._getScoreFunction(i)}_getScoreFunction(e){const t=e.tokens,i=t.length;if(!i)return function(){return 0};const n=e.options.fields,r=e.weights,s=n.length,o=e.getAttrFn;if(!s)return function(){return 1};const a=1===s?function(e,t){const i=n[0].field;return G(o(t,i),e,r[i]||1)}:function(e,t){var i=0;if(e.field){const n=o(t,e.field);!e.regex&&n?i+=1/s:i+=G(n,e,1)}else Z(r,(n,r)=>{i+=G(o(t,r),e,n)});return i/s};return 1===i?function(e){return a(t[0],e)}:"and"===e.options.conjunction?function(e){var n,r=0;for(let i of t){if((n=a(i,e))<=0)return 0;r+=n}return r/i}:function(e){var n=0;return Z(t,t=>{n+=a(t,e)}),n/i}}getSortFunction(e,t){var i=this.prepareSearch(e,t);return this._getSortFunction(i)}_getSortFunction(e){var t,i=[];const n=this,r=e.options,s=!e.query&&r.sort_empty?r.sort_empty:r.sort;if("function"==typeof s)return s.bind(this);const o=function(t,i){return"$score"===t?i.score:e.getAttrFn(n.items[i.id],t)};if(s)for(let t of s)(e.query||"$score"!==t.field)&&i.push(t);if(e.query){t=!0;for(let e of i)if("$score"===e.field){t=!1;break}t&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter(e=>"$score"!==e.field);return i.length?function(e,t){var n,r;for(let s of i){if(r=s.field,n=("desc"===s.direction?-1:1)*ee(o(r,e),o(r,t)))return n}return 0}:null}prepareSearch(e,t){const i={};var n=Object.assign({},t);if(J(n,"sort"),J(n,"sort_empty"),n.fields){J(n,"fields");const e=[];n.fields.forEach(t=>{"string"==typeof t&&(t={field:t,weight:1}),e.push(t),i[t.field]="weight"in t?t.weight:1}),n.fields=e}return{options:n,query:e.toLowerCase().trim(),tokens:this.tokenize(e,n.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:n.nesting?Q:X}}search(e,t){var i,n,r=this;n=this.prepareSearch(e,t),t=n.options,e=n.query;const s=t.score||r._getScoreFunction(n);e.length?Z(r.items,(e,r)=>{i=s(e),(!1===t.filter||i>0)&&n.items.push({score:i,id:r})}):Z(r.items,(e,t)=>{n.items.push({score:1,id:t})});const o=r._getSortFunction(n);return o&&n.items.sort(o),n.total=n.items.length,"number"==typeof t.limit&&(n.items=n.items.slice(0,t.limit)),n}}const ie=e=>null==e?null:ne(e),ne=e=>"boolean"==typeof e?e?"1":"0":e+"",re=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),se=(e,t)=>{var i;return function(n,r){var s=this;i&&(s.loading=Math.max(s.loading-1,0),clearTimeout(i)),i=setTimeout(function(){i=null,s.loadedSearches[n]=!0,e.call(s,n,r)},t)}},oe=(e,t,i)=>{var n,r=e.trigger,s={};for(n of(e.trigger=function(){var i=arguments[0];if(-1===t.indexOf(i))return r.apply(e,arguments);s[i]=arguments},i.apply(e,[]),e.trigger=r,t))n in s&&r.apply(e,s[n])},ae=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},le=(e,t,i,n)=>{e.addEventListener(t,i,n)},ce=(e,t)=>!!t&&(!!t[e]&&1===(t.altKey?1:0)+(t.ctrlKey?1:0)+(t.shiftKey?1:0)+(t.metaKey?1:0)),de=(e,t)=>{const i=e.getAttribute("id");return i||(e.setAttribute("id",t),t)},ue=e=>e.replace(/[\\"']/g,"\\$&"),he=(e,t)=>{t&&e.append(t)},pe=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},fe=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(ge(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},ge=e=>"string"==typeof e&&e.indexOf("<")>-1,me=(e,t)=>{var i=document.createEvent("HTMLEvents");i.initEvent(t,!0,!1),e.dispatchEvent(i)},ve=(e,t)=>{Object.assign(e.style,t)},be=(e,...t)=>{var i=_e(t);(e=we(e)).map(e=>{i.map(t=>{e.classList.add(t)})})},ye=(e,...t)=>{var i=_e(t);(e=we(e)).map(e=>{i.map(t=>{e.classList.remove(t)})})},_e=e=>{var t=[];return pe(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},we=e=>(Array.isArray(e)||(e=[e]),e),Ee=(e,t,i)=>{if(!i||i.contains(e))for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}},Ae=(e,t=0)=>t>0?e[e.length-1]:e[0],Se=(e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i},ke=(e,t)=>{pe(t,(t,i)=>{null==t?e.removeAttribute(i):e.setAttribute(i,""+t)})},Oe=(e,t)=>{e.parentNode&&e.parentNode.replaceChild(t,e)},Ce=(e,t)=>{if(null===t)return;if("string"==typeof t){if(!t.length)return;t=new RegExp(t,"i")}const i=e=>3===e.nodeType?(e=>{var i=e.data.match(t);if(i&&e.data.length>0){var n=document.createElement("span");n.className="highlight";var r=e.splitText(i.index);r.splitText(i[0].length);var s=r.cloneNode(!0);return n.appendChild(s),Oe(r,n),1}return 0})(e):((e=>{1!==e.nodeType||!e.childNodes||/(script|style)/i.test(e.tagName)||"highlight"===e.className&&"SPAN"===e.tagName||Array.from(e.childNodes).forEach(e=>{i(e)})})(e),0);i(e)},De="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var xe={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,refreshThrottle:300,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(e){return e.length>0},render:{}};function Te(e,t){var i=Object.assign({},xe,t),n=i.dataAttr,r=i.labelField,s=i.valueField,o=i.disabledField,a=i.optgroupField,l=i.optgroupLabelField,c=i.optgroupValueField,d=e.tagName.toLowerCase(),u=e.getAttribute("placeholder")||e.getAttribute("data-placeholder");if(!u&&!i.allowEmptyOption){let t=e.querySelector('option[value=""]');t&&(u=t.textContent)}var h={placeholder:u,options:[],optgroups:[],items:[],maxItems:null};return"select"===d?(()=>{var t,d=h.options,u={},p=1;let f=0;var g=e=>{var t=Object.assign({},e.dataset),i=n&&t[n];return"string"==typeof i&&i.length&&(t=Object.assign(t,JSON.parse(i))),t},m=(e,t)=>{var n=ie(e.value);if(null!=n&&(n||i.allowEmptyOption)){if(u.hasOwnProperty(n)){if(t){var l=u[n][a];l?Array.isArray(l)?l.push(t):u[n][a]=[l,t]:u[n][a]=t}}else{var c=g(e);c[r]=c[r]||e.textContent,c[s]=c[s]||n,c[o]=c[o]||e.disabled,c[a]=c[a]||t,c.$option=e,c.$order=c.$order||++f,u[n]=c,d.push(c)}e.selected&&h.items.push(n)}};h.maxItems=e.hasAttribute("multiple")?null:1,pe(e.children,e=>{var i,n,r;"optgroup"===(t=e.tagName.toLowerCase())?((r=g(i=e))[l]=r[l]||i.getAttribute("label")||"",r[c]=r[c]||p++,r[o]=r[o]||i.disabled,r.$order=r.$order||++f,h.optgroups.push(r),n=r[c],pe(i.children,e=>{m(e,n)})):"option"===t&&m(e)})})():(()=>{const t=e.getAttribute(n);if(t)h.options=JSON.parse(t),pe(h.options,e=>{h.items.push(e[s])});else{var o=e.value.trim()||"";if(!i.allowEmptyOption&&!o.length)return;const t=o.split(i.delimiter);pe(t,e=>{const t={};t[r]=e,t[s]=e,h.options.push(t)}),h.items=t}})(),Object.assign({},xe,h,t)}var Le=0;let Ie=class extends(function(e){return e.plugins={},class extends e{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(t,i){e.plugins[t]={name:t,fn:i}}initializePlugins(e){var t,i;const n=this,r=[];if(Array.isArray(e))e.forEach(e=>{"string"==typeof e?r.push(e):(n.plugins.settings[e.name]=e.options,r.push(e.name))});else if(e)for(t in e)e.hasOwnProperty(t)&&(n.plugins.settings[t]=e[t],r.push(t));for(;i=r.shift();)n.require(i)}loadPlugin(t){var i=this,n=i.plugins,r=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');n.requested[t]=!0,n.loaded[t]=r.fn.apply(i,[i.plugins.settings[t]||{}]),n.names.push(t)}require(e){var t=this,i=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(i.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return i.loaded[e]}}}(S)){constructor(e,t){var i;super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,Le++;var n=fe(e);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,i=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const r=Te(n,t);this.settings=r,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(i),this.inputId=de(n,"tomselect-"+Le),this.isRequired=n.required,this.sifter=new te(this.options,{diacritics:r.diacritics}),r.mode=r.mode||(1===r.maxItems?"single":"multi"),"boolean"!=typeof r.hideSelected&&(r.hideSelected="multi"===r.mode),"boolean"!=typeof r.hidePlaceholder&&(r.hidePlaceholder="multi"!==r.mode);var s=r.createFilter;"function"!=typeof s&&("string"==typeof s&&(s=new RegExp(s)),s instanceof RegExp?r.createFilter=e=>s.test(e):r.createFilter=e=>this.settings.duplicates||!this.options[e]),this.initializePlugins(r.plugins),this.setupCallbacks(),this.setupTemplates();const o=fe("<div>"),a=fe("<div>"),l=this._render("dropdown"),c=fe('<div role="listbox" tabindex="-1">'),d=this.input.getAttribute("class")||"",u=r.mode;var h;if(be(o,r.wrapperClass,d,u),be(a,r.controlClass),he(o,a),be(l,r.dropdownClass,u),r.copyClassesToDropdown&&be(l,d),be(c,r.dropdownContentClass),he(l,c),fe(r.dropdownParent||o).appendChild(l),ge(r.controlInput)){h=fe(r.controlInput);pe(["autocorrect","autocapitalize","autocomplete","spellcheck"],e=>{n.getAttribute(e)&&ke(h,{[e]:n.getAttribute(e)})}),h.tabIndex=-1,a.appendChild(h),this.focus_node=h}else r.controlInput?(h=fe(r.controlInput),this.focus_node=h):(h=fe("<input/>"),this.focus_node=a);this.wrapper=o,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=h,this.setup()}setup(){const e=this,t=e.settings,i=e.control_input,n=e.dropdown,r=e.dropdown_content,s=e.wrapper,o=e.control,a=e.input,l=e.focus_node,c={passive:!0},d=e.inputId+"-ts-dropdown";ke(r,{id:d}),ke(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":d});const u=de(l,e.inputId+"-ts-control"),h="label[for='"+(e=>e.replace(/['"\\]/g,"\\$&"))(e.inputId)+"']",p=document.querySelector(h),f=e.focus.bind(e);if(p){le(p,"click",f),ke(p,{for:u});const t=de(p,e.inputId+"-ts-label");ke(l,{"aria-labelledby":t}),ke(r,{"aria-labelledby":t})}if(s.style.width=a.style.width,e.plugins.names.length){const t="plugin-"+e.plugins.names.join(" plugin-");be([s,n],t)}(null===t.maxItems||t.maxItems>1)&&e.is_select_tag&&ke(a,{multiple:"multiple"}),t.placeholder&&ke(i,{placeholder:t.placeholder}),!t.splitOn&&t.delimiter&&(t.splitOn=new RegExp("\\s*"+x(t.delimiter)+"+\\s*")),t.load&&t.loadThrottle&&(t.load=se(t.load,t.loadThrottle)),le(n,"mousemove",()=>{e.ignoreHover=!1}),le(n,"mouseenter",t=>{var i=Ee(t.target,"[data-selectable]",n);i&&e.onOptionHover(t,i)},{capture:!0}),le(n,"click",t=>{const i=Ee(t.target,"[data-selectable]");i&&(e.onOptionSelect(t,i),ae(t,!0))}),le(o,"click",t=>{var n=Ee(t.target,"[data-ts-item]",o);n&&e.onItemSelect(t,n)?ae(t,!0):""==i.value&&(e.onClick(),ae(t,!0))}),le(l,"keydown",t=>e.onKeyDown(t)),le(i,"keypress",t=>e.onKeyPress(t)),le(i,"input",t=>e.onInput(t)),le(l,"blur",t=>e.onBlur(t)),le(l,"focus",t=>e.onFocus(t)),le(i,"paste",t=>e.onPaste(t));const g=t=>{const r=t.composedPath()[0];if(!s.contains(r)&&!n.contains(r))return e.isFocused&&e.blur(),void e.inputState();r==i&&e.isOpen?t.stopPropagation():ae(t,!0)},m=()=>{e.isOpen&&e.positionDropdown()};le(document,"mousedown",g),le(window,"scroll",m,c),le(window,"resize",m,c),this._destroy=()=>{document.removeEventListener("mousedown",g),window.removeEventListener("scroll",m),window.removeEventListener("resize",m),p&&p.removeEventListener("click",f)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",e.wrapper),e.sync(!1),t.items=[],delete t.optgroups,delete t.options,le(a,"invalid",()=>{e.isValid&&(e.isValid=!1,e.isInvalid=!0,e.refreshState())}),e.updateOriginalInput(),e.refreshItems(),e.close(!1),e.inputState(),e.isSetup=!0,a.disabled?e.disable():a.readOnly?e.setReadOnly(!0):e.enable(),e.on("change",this.onChange),be(a,"tomselected","ts-hidden-accessible"),e.trigger("initialize"),!0===t.preload&&e.preload()}setupOptions(e=[],t=[]){this.addOptions(e),pe(t,e=>{this.registerOptionGroup(e)})}setupTemplates(){var e=this,t=e.settings.labelField,i=e.settings.optgroupLabelField,n={optgroup:e=>{let t=document.createElement("div");return t.className="optgroup",t.appendChild(e.options),t},optgroup_header:(e,t)=>'<div class="optgroup-header">'+t(e[i])+"</div>",option:(e,i)=>"<div>"+i(e[t])+"</div>",item:(e,i)=>"<div>"+i(e[t])+"</div>",option_create:(e,t)=>'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};e.settings.render=Object.assign({},n,e.settings.render)}setupCallbacks(){var e,t,i={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in i)(t=this.settings[i[e]])&&this.on(e,t)}sync(e=!0){const t=this,i=e?Te(t.input,{delimiter:t.settings.delimiter}):t.settings;t.setupOptions(i.options,i.optgroups),t.setValue(i.items||[],!0),t.lastQuery=null}onClick(){var e=this;if(e.activeItems.length>0)return e.clearActiveItems(),void e.focus();e.isFocused&&e.isOpen?e.blur():e.focus()}onMouseDown(){}onChange(){me(this.input,"input"),me(this.input,"change")}onPaste(e){var t=this;t.isInputHidden||t.isLocked?ae(e):t.settings.splitOn&&setTimeout(()=>{var e=t.inputValue();if(e.match(t.settings.splitOn)){var i=e.trim().split(t.settings.splitOn);pe(i,e=>{ie(e)&&(this.options[e]?t.addItem(e):t.createItem(e))})}},0)}onKeyPress(e){var t=this;if(!t.isLocked){var i=String.fromCharCode(e.keyCode||e.which);return t.settings.create&&"multi"===t.settings.mode&&i===t.settings.delimiter?(t.createItem(),void ae(e)):void 0}ae(e)}onKeyDown(e){var t=this;if(t.ignoreHover=!0,t.isLocked)9!==e.keyCode&&ae(e);else{switch(e.keyCode){case 65:if(ce(De,e)&&""==t.control_input.value)return ae(e),void t.selectAll();break;case 27:return t.isOpen&&(ae(e,!0),t.close()),void t.clearActiveItems();case 40:if(!t.isOpen&&t.hasOptions)t.open();else if(t.activeOption){let e=t.getAdjacent(t.activeOption,1);e&&t.setActiveOption(e)}return void ae(e);case 38:if(t.activeOption){let e=t.getAdjacent(t.activeOption,-1);e&&t.setActiveOption(e)}return void ae(e);case 13:return void(t.canSelect(t.activeOption)?(t.onOptionSelect(e,t.activeOption),ae(e)):(t.settings.create&&t.createItem()||document.activeElement==t.control_input&&t.isOpen)&&ae(e));case 37:return void t.advanceSelection(-1,e);case 39:return void t.advanceSelection(1,e);case 9:return void(t.settings.selectOnTab&&(t.canSelect(t.activeOption)&&(t.onOptionSelect(e,t.activeOption),ae(e)),t.settings.create&&t.createItem()&&ae(e)));case 8:case 46:return void t.deleteSelection(e)}t.isInputHidden&&!ce(De,e)&&ae(e)}}onInput(e){if(this.isLocked)return;const t=this.inputValue();this.lastValue!==t&&(this.lastValue=t,""!=t?(this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=((e,t)=>t>0?window.setTimeout(e,t):(e.call(null),null))(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)):this._onInput())}_onInput(){const e=this.lastValue;this.settings.shouldLoad.call(this,e)&&this.load(e),this.refreshOptions(),this.trigger("type",e)}onOptionHover(e,t){this.ignoreHover||this.setActiveOption(t,!1)}onFocus(e){var t=this,i=t.isFocused;if(t.isDisabled||t.isReadOnly)return t.blur(),void ae(e);t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.preload(),i||t.trigger("focus"),t.activeItems.length||(t.inputState(),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())}onBlur(e){if(!1!==document.hasFocus()){var t=this;if(t.isFocused){t.isFocused=!1,t.ignoreFocus=!1;var i=()=>{t.close(),t.setActiveItem(),t.setCaret(t.items.length),t.trigger("blur")};t.settings.create&&t.settings.createOnBlur?t.createItem(null,i):i()}}}onOptionSelect(e,t){var i,n=this;t.parentElement&&t.parentElement.matches("[data-disabled]")||(t.classList.contains("create")?n.createItem(null,()=>{n.settings.closeAfterSelect&&n.close()}):void 0!==(i=t.dataset.value)&&(n.lastQuery=null,n.addItem(i),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&e.type&&/click/.test(e.type)&&n.setActiveOption(t)))}canSelect(e){return!!(this.isOpen&&e&&this.dropdown_content.contains(e))}onItemSelect(e,t){var i=this;return!i.isLocked&&"multi"===i.settings.mode&&(ae(e),i.setActiveItem(t,e),!0)}canLoad(e){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(e)}load(e){const t=this;if(!t.canLoad(e))return;be(t.wrapper,t.settings.loadingClass),t.loading++;const i=t.loadCallback.bind(t);t.settings.load.call(t,e,i)}loadCallback(e,t){const i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(e,t),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||ye(i.wrapper,i.settings.loadingClass),i.trigger("load",e,t)}preload(){var e=this.wrapper.classList;e.contains("preloaded")||(e.add("preloaded"),this.load(""))}setTextboxValue(e=""){var t=this.control_input;t.value!==e&&(t.value=e,me(t,"update"),this.lastValue=e)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(e,t){oe(this,t?[]:["change"],()=>{this.clear(t),this.addItems(e,t)})}setMaxItems(e){0===e&&(e=null),this.settings.maxItems=e,this.refreshState()}setActiveItem(e,t){var i,n,r,s,o,a,l=this;if("single"!==l.settings.mode){if(!e)return l.clearActiveItems(),void(l.isFocused&&l.inputState());if("click"===(i=t&&t.type.toLowerCase())&&ce("shiftKey",t)&&l.activeItems.length){for(a=l.getLastActive(),(r=Array.prototype.indexOf.call(l.control.children,a))>(s=Array.prototype.indexOf.call(l.control.children,e))&&(o=r,r=s,s=o),n=r;n<=s;n++)e=l.control.children[n],-1===l.activeItems.indexOf(e)&&l.setActiveItemClass(e);ae(t)}else"click"===i&&ce(De,t)||"keydown"===i&&ce("shiftKey",t)?e.classList.contains("active")?l.removeActiveItem(e):l.setActiveItemClass(e):(l.clearActiveItems(),l.setActiveItemClass(e));l.inputState(),l.isFocused||l.focus()}}setActiveItemClass(e){const t=this,i=t.control.querySelector(".last-active");i&&ye(i,"last-active"),be(e,"active last-active"),t.trigger("item_select",e),-1==t.activeItems.indexOf(e)&&t.activeItems.push(e)}removeActiveItem(e){var t=this.activeItems.indexOf(e);this.activeItems.splice(t,1),ye(e,"active")}clearActiveItems(){ye(this.activeItems,"active"),this.activeItems=[]}setActiveOption(e,t=!0){e!==this.activeOption&&(this.clearActiveOption(),e&&(this.activeOption=e,ke(this.focus_node,{"aria-activedescendant":e.getAttribute("id")}),ke(e,{"aria-selected":"true"}),be(e,"active"),t&&this.scrollToOption(e)))}scrollToOption(e,t){if(!e)return;const i=this.dropdown_content,n=i.clientHeight,r=i.scrollTop||0,s=e.offsetHeight,o=e.getBoundingClientRect().top-i.getBoundingClientRect().top+r;o+s>n+r?this.scroll(o-n+s,t):o<r&&this.scroll(o,t)}scroll(e,t){const i=this.dropdown_content;t&&(i.style.scrollBehavior=t),i.scrollTop=e,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(ye(this.activeOption,"active"),ke(this.activeOption,{"aria-selected":null})),this.activeOption=null,ke(this.focus_node,{"aria-activedescendant":null})}selectAll(){const e=this;if("single"===e.settings.mode)return;const t=e.controlChildren();t.length&&(e.inputState(),e.close(),e.activeItems=t,pe(t,t=>{e.setActiveItemClass(t)}))}inputState(){var e=this;e.control.contains(e.control_input)&&(ke(e.control_input,{placeholder:e.settings.placeholder}),e.activeItems.length>0||!e.isFocused&&e.settings.hidePlaceholder&&e.items.length>0?(e.setTextboxValue(),e.isInputHidden=!0):(e.settings.hidePlaceholder&&e.items.length>0&&ke(e.control_input,{placeholder:""}),e.isInputHidden=!1),e.wrapper.classList.toggle("input-hidden",e.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var e=this;e.isDisabled||e.isReadOnly||(e.ignoreFocus=!0,e.control_input.offsetWidth?e.control_input.focus():e.focus_node.focus(),setTimeout(()=>{e.ignoreFocus=!1,e.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())}getSearchOptions(){var e=this.settings,t=e.sortField;return"string"==typeof e.sortField&&(t=[{field:e.sortField}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}}search(e){var t,i,n=this,r=this.getSearchOptions();if(n.settings.score&&"function"!=typeof(i=n.settings.score.call(n,e)))throw new Error('Tom Select "score" setting must be a function that returns a function');return e!==n.lastQuery?(n.lastQuery=e,t=n.sifter.search(e,Object.assign(r,{score:i})),n.currentResults=t):t=Object.assign({},n.currentResults),n.settings.hideSelected&&(t.items=t.items.filter(e=>{let t=ie(e.id);return!(t&&-1!==n.items.indexOf(t))})),t}refreshOptions(e=!0){var t,i,n,r,s,o,a,l,c,d;const u={},h=[];var p=this,f=p.inputValue();const g=f===p.lastQuery||""==f&&null==p.lastQuery;var m=p.search(f),v=null,b=p.settings.shouldOpen||!1,y=p.dropdown_content;g&&(v=p.activeOption)&&(c=v.closest("[data-group]")),r=m.items.length,"number"==typeof p.settings.maxOptions&&(r=Math.min(r,p.settings.maxOptions)),r>0&&(b=!0);const _=(e,t)=>{let i=u[e];if(void 0!==i){let e=h[i];if(void 0!==e)return[i,e.fragment]}let n=document.createDocumentFragment();return i=h.length,h.push({fragment:n,order:t,optgroup:e}),[i,n]};for(t=0;t<r;t++){let e=m.items[t];if(!e)continue;let r=e.id,a=p.options[r];if(void 0===a)continue;let l=ne(r),d=p.getOption(l,!0);for(p.settings.hideSelected||d.classList.toggle("selected",p.items.includes(l)),s=a[p.settings.optgroupField]||"",i=0,n=(o=Array.isArray(s)?s:[s])&&o.length;i<n;i++){s=o[i];let e=a.$order,t=p.optgroups[s];void 0===t?s="":e=t.$order;const[n,l]=_(s,e);i>0&&(d=d.cloneNode(!0),ke(d,{id:a.$id+"-clone-"+i,"aria-selected":null}),d.classList.add("ts-cloned"),ye(d,"active"),p.activeOption&&p.activeOption.dataset.value==r&&c&&c.dataset.group===s.toString()&&(v=d)),l.appendChild(d),""!=s&&(u[s]=n)}}var w;p.settings.lockOptgroupOrder&&h.sort((e,t)=>e.order-t.order),a=document.createDocumentFragment(),pe(h,e=>{let t=e.fragment,i=e.optgroup;if(!t||!t.children.length)return;let n=p.optgroups[i];if(void 0!==n){let e=document.createDocumentFragment(),i=p.render("optgroup_header",n);he(e,i),he(e,t);let r=p.render("optgroup",{group:n,options:e});he(a,r)}else he(a,t)}),y.innerHTML="",he(y,a),p.settings.highlight&&(w=y.querySelectorAll("span.highlight"),Array.prototype.forEach.call(w,function(e){var t=e.parentNode;t.replaceChild(e.firstChild,e),t.normalize()}),m.query.length&&m.tokens.length&&pe(m.tokens,e=>{Ce(y,e.regex)}));var E=e=>{let t=p.render(e,{input:f});return t&&(b=!0,y.insertBefore(t,y.firstChild)),t};if(p.loading?E("loading"):p.settings.shouldLoad.call(p,f)?0===m.items.length&&E("no_results"):E("not_loading"),(l=p.canCreate(f))&&(d=E("option_create")),p.hasOptions=m.items.length>0||l,b){if(m.items.length>0){if(v||"single"!==p.settings.mode||null==p.items[0]||(v=p.getOption(p.items[0])),!y.contains(v)){let e=0;d&&!p.settings.addPrecedence&&(e=1),v=p.selectable()[e]}}else d&&(v=d);e&&!p.isOpen&&(p.open(),p.scrollToOption(v,"auto")),p.setActiveOption(v)}else p.clearActiveOption(),e&&p.isOpen&&p.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(e,t=!1){const i=this;if(Array.isArray(e))return i.addOptions(e,t),!1;const n=ie(e[i.settings.valueField]);return null!==n&&!i.options.hasOwnProperty(n)&&(e.$order=e.$order||++i.order,e.$id=i.inputId+"-opt-"+e.$order,i.options[n]=e,i.lastQuery=null,t&&(i.userOptions[n]=t,i.trigger("option_add",n,e)),n)}addOptions(e,t=!1){pe(e,e=>{this.addOption(e,t)})}registerOption(e){return this.addOption(e)}registerOptionGroup(e){var t=ie(e[this.settings.optgroupValueField]);return null!==t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)}addOptionGroup(e,t){var i;t[this.settings.optgroupValueField]=e,(i=this.registerOptionGroup(t))&&this.trigger("optgroup_add",i,t)}removeOptionGroup(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.clearCache(),this.trigger("optgroup_remove",e))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(e,t){const i=this;var n,r;const s=ie(e),o=ie(t[i.settings.valueField]);if(null===s)return;const a=i.options[s];if(null==a)return;if("string"!=typeof o)throw new Error("Value must be set in option data");const l=i.getOption(s),c=i.getItem(s);if(t.$order=t.$order||a.$order,delete i.options[s],i.uncacheValue(o),i.options[o]=t,l){if(i.dropdown_content.contains(l)){const e=i._render("option",t);Oe(l,e),i.activeOption===l&&i.setActiveOption(e)}l.remove()}c&&(-1!==(r=i.items.indexOf(s))&&i.items.splice(r,1,o),n=i._render("item",t),c.classList.contains("active")&&be(n,"active"),Oe(c,n)),i.lastQuery=null}removeOption(e,t){const i=this;e=ne(e),i.uncacheValue(e),delete i.userOptions[e],delete i.options[e],i.lastQuery=null,i.trigger("option_remove",e),i.removeItem(e,t)}clearOptions(e){const t=(e||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const i={};pe(this.options,(e,n)=>{t(e,n)&&(i[n]=e)}),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(e,t){return this.items.indexOf(t)>=0}getOption(e,t=!1){const i=ie(e);if(null===i)return null;const n=this.options[i];if(null!=n){if(n.$div)return n.$div;if(t)return this._render("option",n)}return null}getAdjacent(e,t,i="option"){var n;if(!e)return null;n="item"==i?this.controlChildren():this.dropdown_content.querySelectorAll("[data-selectable]");for(let i=0;i<n.length;i++)if(n[i]==e)return t>0?n[i+1]:n[i-1];return null}getItem(e){if("object"==typeof e)return e;var t=ie(e);return null!==t?this.control.querySelector(`[data-value="${ue(t)}"]`):null}addItems(e,t){var i=this,n=Array.isArray(e)?e:[e];const r=(n=n.filter(e=>-1===i.items.indexOf(e)))[n.length-1];n.forEach(e=>{i.isPending=e!==r,i.addItem(e,t)})}addItem(e,t){oe(this,t?[]:["change","dropdown_close"],()=>{var i,n;const r=this,s=r.settings.mode,o=ie(e);if((!o||-1===r.items.indexOf(o)||("single"===s&&r.close(),"single"!==s&&r.settings.duplicates))&&null!==o&&r.options.hasOwnProperty(o)&&("single"===s&&r.clear(t),"multi"!==s||!r.isFull())){if(i=r._render("item",r.options[o]),r.control.contains(i)&&(i=i.cloneNode(!0)),n=r.isFull(),r.items.splice(r.caretPos,0,o),r.insertAtCaret(i),r.isSetup){if(!r.isPending&&r.settings.hideSelected){let e=r.getOption(o),t=r.getAdjacent(e,1);t&&r.setActiveOption(t)}r.isPending||r.settings.closeAfterSelect||r.refreshOptions(r.isFocused&&"single"!==s),0!=r.settings.closeAfterSelect&&r.isFull()?r.close():r.isPending||r.positionDropdown(),r.trigger("item_add",o,i),r.isPending||r.updateOriginalInput({silent:t})}(!r.isPending||!n&&r.isFull())&&(r.inputState(),r.refreshState())}})}removeItem(e=null,t){const i=this;if(!(e=i.getItem(e)))return;var n,r;const s=e.dataset.value;n=Se(e),e.remove(),e.classList.contains("active")&&(r=i.activeItems.indexOf(e),i.activeItems.splice(r,1),ye(e,"active")),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(s)&&i.removeOption(s,t),n<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:t}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",s,e)}createItem(e=null,t=()=>{}){3===arguments.length&&(t=arguments[2]),"function"!=typeof t&&(t=()=>{});var i,n=this,r=n.caretPos;if(e=e||n.inputValue(),!n.canCreate(e))return t(),!1;n.lock();var s=!1,o=e=>{if(n.unlock(),!e||"object"!=typeof e)return t();var i=ie(e[n.settings.valueField]);if("string"!=typeof i)return t();n.setTextboxValue(),n.addOption(e,!0),n.setCaret(r),n.addItem(i),t(e),s=!0};return i="function"==typeof n.settings.create?n.settings.create.call(this,e,o):{[n.settings.labelField]:e,[n.settings.valueField]:e},s||o(i),!0}refreshItems(){var e=this;e.lastQuery=null,e.isSetup&&e.addItems(e.items),e.updateOriginalInput(),e.refreshState()}refreshState(){const e=this;e.refreshValidityState();const t=e.isFull(),i=e.isLocked;e.wrapper.classList.toggle("rtl",e.rtl);const n=e.wrapper.classList;var r;n.toggle("focus",e.isFocused),n.toggle("disabled",e.isDisabled),n.toggle("readonly",e.isReadOnly),n.toggle("required",e.isRequired),n.toggle("invalid",!e.isValid),n.toggle("locked",i),n.toggle("full",t),n.toggle("input-active",e.isFocused&&!e.isInputHidden),n.toggle("dropdown-active",e.isOpen),n.toggle("has-options",(r=e.options,0===Object.keys(r).length)),n.toggle("has-items",e.items.length>0)}refreshValidityState(){var e=this;e.input.validity&&(e.isValid=e.input.validity.valid,e.isInvalid=!e.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(e={}){const t=this;var i,n;const r=t.input.querySelector('option[value=""]');if(t.is_select_tag){const s=[],o=t.input.querySelectorAll("option:checked").length;function a(e,i,n){return e||(e=fe('<option value="'+re(i)+'">'+re(n)+"</option>")),e!=r&&t.input.append(e),s.push(e),(e!=r||o>0)&&(e.selected=!0),e}t.input.querySelectorAll("option:checked").forEach(e=>{e.selected=!1}),0==t.items.length&&"single"==t.settings.mode?a(r,"",""):t.items.forEach(e=>{if(i=t.options[e],n=i[t.settings.labelField]||"",s.includes(i.$option)){a(t.input.querySelector(`option[value="${ue(e)}"]:not(:checked)`),e,n)}else i.$option=a(i.$option,e,n)})}else t.input.value=t.getValue();t.isSetup&&(e.silent||t.trigger("change",t.getValue()))}open(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.isOpen=!0,ke(e.focus_node,{"aria-expanded":"true"}),e.refreshState(),ve(e.dropdown,{visibility:"hidden",display:"block"}),e.positionDropdown(),ve(e.dropdown,{visibility:"visible",display:"block"}),e.focus(),e.trigger("dropdown_open",e.dropdown))}close(e=!0){var t=this,i=t.isOpen;e&&(t.setTextboxValue(),"single"===t.settings.mode&&t.items.length&&t.inputState()),t.isOpen=!1,ke(t.focus_node,{"aria-expanded":"false"}),ve(t.dropdown,{display:"none"}),t.settings.hideSelected&&t.clearActiveOption(),t.refreshState(),i&&t.trigger("dropdown_close",t.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var e=this.control,t=e.getBoundingClientRect(),i=e.offsetHeight+t.top+window.scrollY,n=t.left+window.scrollX;ve(this.dropdown,{width:t.width+"px",top:i+"px",left:n+"px"})}}clear(e){var t=this;if(t.items.length){var i=t.controlChildren();pe(i,e=>{t.removeItem(e,!0)}),t.inputState(),e||t.updateOriginalInput(),t.trigger("clear")}}insertAtCaret(e){const t=this,i=t.caretPos,n=t.control;n.insertBefore(e,n.children[i]||null),t.setCaret(i+1)}deleteSelection(e){var t,i,n,r,s,o=this;t=e&&8===e.keyCode?-1:1,i={start:(s=o.control_input).selectionStart||0,length:(s.selectionEnd||0)-(s.selectionStart||0)};const a=[];if(o.activeItems.length)r=Ae(o.activeItems,t),n=Se(r),t>0&&n++,pe(o.activeItems,e=>a.push(e));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const e=o.controlChildren();let n;t<0&&0===i.start&&0===i.length?n=e[o.caretPos-1]:t>0&&i.start===o.inputValue().length&&(n=e[o.caretPos]),void 0!==n&&a.push(n)}if(!o.shouldDelete(a,e))return!1;for(ae(e,!0),void 0!==n&&o.setCaret(n);a.length;)o.removeItem(a.pop());return o.inputState(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(e,t){const i=e.map(e=>e.dataset.value);return!(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(i,t))}advanceSelection(e,t){var i,n,r=this;r.rtl&&(e*=-1),r.inputValue().length||(ce(De,t)||ce("shiftKey",t)?(n=(i=r.getLastActive(e))?i.classList.contains("active")?r.getAdjacent(i,e,"item"):i:e>0?r.control_input.nextElementSibling:r.control_input.previousElementSibling)&&(n.classList.contains("active")&&r.removeActiveItem(i),r.setActiveItemClass(n)):r.moveCaret(e))}moveCaret(e){}getLastActive(e){let t=this.control.querySelector(".last-active");if(t)return t;var i=this.control.querySelectorAll(".active");return i?Ae(i,e):void 0}setCaret(e){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(e=this.isReadOnly||this.isDisabled){this.isLocked=e,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(e){this.focus_node.tabIndex=e?-1:this.tabIndex,this.isDisabled=e,this.input.disabled=e,this.control_input.disabled=e,this.setLocked()}setReadOnly(e){this.isReadOnly=e,this.input.readOnly=e,this.control_input.readOnly=e,this.setLocked()}destroy(){var e=this,t=e.revertSettings;e.trigger("destroy"),e.off(),e.wrapper.remove(),e.dropdown.remove(),e.input.innerHTML=t.innerHTML,e.input.tabIndex=t.tabIndex,ye(e.input,"tomselected","ts-hidden-accessible"),e._destroy(),delete e.input.tomselect}render(e,t){var i,n;const r=this;if("function"!=typeof this.settings.render[e])return null;if(!(n=r.settings.render[e].call(this,t,re)))return null;if(n=fe(n),"option"===e||"option_create"===e?t[r.settings.disabledField]?ke(n,{"aria-disabled":"true"}):ke(n,{"data-selectable":""}):"optgroup"===e&&(i=t.group[r.settings.optgroupValueField],ke(n,{"data-group":i}),t.group[r.settings.disabledField]&&ke(n,{"data-disabled":""})),"option"===e||"item"===e){const i=ne(t[r.settings.valueField]);ke(n,{"data-value":i}),"item"===e?(be(n,r.settings.itemClass),ke(n,{"data-ts-item":""})):(be(n,r.settings.optionClass),ke(n,{role:"option",id:t.$id}),t.$div=n,r.options[i]=t)}return n}_render(e,t){const i=this.render(e,t);if(null==i)throw"HTMLElement expected";return i}clearCache(){pe(this.options,e=>{e.$div&&(e.$div.remove(),delete e.$div)})}uncacheValue(e){const t=this.getOption(e);t&&t.remove()}canCreate(e){return this.settings.create&&e.length>0&&this.settings.createFilter.call(this,e)}hook(e,t,i){var n=this,r=n[t];n[t]=function(){var t,s;return"after"===e&&(t=r.apply(n,arguments)),s=i.apply(n,arguments),"instead"===e?s:("before"===e&&(t=r.apply(n,arguments)),t)}}};const Me=e=>"boolean"==typeof e?e?"1":"0":e+"",Fe=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},Ne=e=>"string"==typeof e&&e.indexOf("<")>-1;const je=e=>"string"==typeof e&&e.indexOf("<")>-1;const Pe=(e,t,i,n)=>{e.addEventListener(t,i,n)},$e=e=>"string"==typeof e&&e.indexOf("<")>-1,He=(e,t)=>{((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(t,(t,i)=>{null==t?e.removeAttribute(i):e.setAttribute(i,""+t)})};const qe=e=>"string"==typeof e&&e.indexOf("<")>-1;const Re=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Be=e=>(Array.isArray(e)||(e=[e]),e);const Ve=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(ze(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},ze=e=>"string"==typeof e&&e.indexOf("<")>-1,We=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ye=e=>(Array.isArray(e)||(e=[e]),e);const Ke=(e,t,i,n)=>{e.addEventListener(t,i,n)};const Ue=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},Xe=(e,t,i,n)=>{e.addEventListener(t,i,n)},Qe=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Ge(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},Ge=e=>"string"==typeof e&&e.indexOf("<")>-1;const Je=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ze=e=>(Array.isArray(e)||(e=[e]),e);Ie.define("change_listener",function(){var e,t,i,n;e=this.input,t="change",i=()=>{this.sync()},e.addEventListener(t,i,n)}),Ie.define("checkbox_options",function(e){var t=this,i=t.onOptionSelect;t.settings.hideSelected=!1;const n=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},e);var r=function(e,t){t?(e.checked=!0,n.uncheckedClassNames&&e.classList.remove(...n.uncheckedClassNames),n.checkedClassNames&&e.classList.add(...n.checkedClassNames)):(e.checked=!1,n.checkedClassNames&&e.classList.remove(...n.checkedClassNames),n.uncheckedClassNames&&e.classList.add(...n.uncheckedClassNames))},s=function(e){setTimeout(()=>{var t=e.querySelector("input."+n.className);t instanceof HTMLInputElement&&r(t,e.classList.contains("selected"))},1)};t.hook("after","setupTemplates",()=>{var e=t.settings.render.option;t.settings.render.option=(i,s)=>{var o=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Ne(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(e.call(t,i,s)),a=document.createElement("input");n.className&&a.classList.add(n.className),a.addEventListener("click",function(e){Fe(e)}),a.type="checkbox";const l=null==(c=i[t.settings.valueField])?null:Me(c);var c;return r(a,!!(l&&t.items.indexOf(l)>-1)),o.prepend(a),o}}),t.on("item_remove",e=>{var i=t.getOption(e);i&&(i.classList.remove("selected"),s(i))}),t.on("item_add",e=>{var i=t.getOption(e);i&&s(i)}),t.hook("instead","onOptionSelect",(e,n)=>{if(n.classList.contains("selected"))return n.classList.remove("selected"),t.removeItem(n.dataset.value),t.refreshOptions(),void Fe(e,!0);i.call(t,e,n),s(n)})}),Ie.define("clear_button",function(e){const t=this,i=Object.assign({className:"clear-button",title:"Clear All",html:e=>`<div class="${e.className}" title="${e.title}">&#10799;</div>`},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(je(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(i.html(i));e.addEventListener("click",e=>{t.isLocked||(t.clear(),"single"===t.settings.mode&&t.settings.allowEmptyOption&&t.addItem(""),e.preventDefault(),e.stopPropagation())}),t.control.appendChild(e)})}),Ie.define("drag_drop",function(){var e=this;if("multi"!==e.settings.mode)return;var t=e.lock,i=e.unlock;let n,r=!0;e.hook("after","setupTemplates",()=>{var t=e.settings.render.item;e.settings.render.item=(i,s)=>{const o=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if($e(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(t.call(e,i,s));He(o,{draggable:"true"});const a=e=>{e.preventDefault(),o.classList.add("ts-drag-over"),l(o,n)},l=(e,t)=>{var i,n,r;void 0!==t&&(((e,t)=>{do{var i;if(e==(t=null==(i=t)?void 0:i.previousElementSibling))return!0}while(t&&t.previousElementSibling);return!1})(t,o)?(n=t,null==(r=(i=e).parentNode)||r.insertBefore(n,i.nextSibling)):((e,t)=>{var i;null==(i=e.parentNode)||i.insertBefore(t,e)})(e,t))};return Pe(o,"mousedown",e=>{r||((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e),e.stopPropagation()}),Pe(o,"dragstart",e=>{n=o,setTimeout(()=>{o.classList.add("ts-dragging")},0)}),Pe(o,"dragenter",a),Pe(o,"dragover",a),Pe(o,"dragleave",()=>{o.classList.remove("ts-drag-over")}),Pe(o,"dragend",()=>{var t;document.querySelectorAll(".ts-drag-over").forEach(e=>e.classList.remove("ts-drag-over")),null==(t=n)||t.classList.remove("ts-dragging"),n=void 0;var i=[];e.control.querySelectorAll("[data-value]").forEach(e=>{if(e.dataset.value){let t=e.dataset.value;t&&i.push(t)}}),e.setValue(i)}),o}}),e.hook("instead","lock",()=>(r=!1,t.call(e))),e.hook("instead","unlock",()=>(r=!0,i.call(e)))}),Ie.define("dropdown_header",function(e){const t=this,i=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:e=>'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a class="'+e.closeClass+'">&times;</a></div></div>'},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(qe(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(i.html(i)),n=e.querySelector("."+i.closeClass);n&&n.addEventListener("click",e=>{((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e,!0),t.close()}),t.dropdown.insertBefore(e,t.dropdown.firstChild)})}),Ie.define("caret_position",function(){var e=this;e.hook("instead","setCaret",t=>{"single"!==e.settings.mode&&e.control.contains(e.control_input)?(t=Math.max(0,Math.min(e.items.length,t)))==e.caretPos||e.isPending||e.controlChildren().forEach((i,n)=>{n<t?e.control_input.insertAdjacentElement("beforebegin",i):e.control.appendChild(i)}):t=e.items.length,e.caretPos=t}),e.hook("instead","moveCaret",t=>{if(!e.isFocused)return;const i=e.getLastActive(t);if(i){const n=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i})(i);e.setCaret(t>0?n+1:n),e.setActiveItem(),((e,...t)=>{var i=Re(t);(e=Be(e)).map(e=>{i.map(t=>{e.classList.remove(t)})})})(i,"last-active")}else e.setCaret(e.caretPos+t)})}),Ie.define("dropdown_input",function(){const e=this;e.settings.shouldOpen=!0,e.hook("before","setup",()=>{e.focus_node=e.control,((e,...t)=>{var i=We(t);(e=Ye(e)).map(e=>{i.map(t=>{e.classList.add(t)})})})(e.control_input,"dropdown-input");const t=Ve('<div class="dropdown-input-wrap">');t.append(e.control_input),e.dropdown.insertBefore(t,e.dropdown.firstChild);const i=Ve('<input class="items-placeholder" tabindex="-1" />');i.placeholder=e.settings.placeholder||"",e.control.append(i)}),e.on("initialize",()=>{e.control_input.addEventListener("keydown",t=>{switch(t.keyCode){case 27:return e.isOpen&&(((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(t,!0),e.close()),void e.clearActiveItems();case 9:e.focus_node.tabIndex=-1}return e.onKeyDown.call(e,t)}),e.on("blur",()=>{e.focus_node.tabIndex=e.isDisabled?-1:e.tabIndex}),e.on("dropdown_open",()=>{e.control_input.focus()});const t=e.onBlur;var i,n,r,s;e.hook("instead","onBlur",i=>{if(!i||i.relatedTarget!=e.control_input)return t.call(e)}),i=e.control_input,n="blur",r=()=>e.onBlur(),i.addEventListener(n,r,s),e.hook("before","close",()=>{e.isOpen&&e.focus_node.focus({preventScroll:!0})})})}),Ie.define("input_autogrow",function(){var e=this;e.on("initialize",()=>{var t=document.createElement("span"),i=e.control_input;t.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",e.wrapper.appendChild(t);for(const e of["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"])t.style[e]=i.style[e];var n=()=>{t.textContent=i.value,i.style.width=t.clientWidth+"px"};n(),e.on("update item_add item_remove",n),Ke(i,"input",n),Ke(i,"keyup",n),Ke(i,"blur",n),Ke(i,"update",n)})}),Ie.define("no_backspace_delete",function(){var e=this,t=e.deleteSelection;this.hook("instead","deleteSelection",i=>!!e.activeItems.length&&t.call(e,i))}),Ie.define("no_active_items",function(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}),Ie.define("optgroup_columns",function(){var e=this,t=e.onKeyDown;e.hook("instead","onKeyDown",i=>{var n,r,s,o;if(!e.isOpen||37!==i.keyCode&&39!==i.keyCode)return t.call(e,i);e.ignoreHover=!0,o=((e,t)=>{for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}})(e.activeOption,"[data-group]"),n=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i})(e.activeOption,"[data-selectable]"),o&&(o=37===i.keyCode?o.previousSibling:o.nextSibling)&&(r=(s=o.querySelectorAll("[data-selectable]"))[Math.min(s.length-1,n)])&&e.setActiveOption(r)})}),Ie.define("remove_button",function(e){const t=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},e);var i=this;if(t.append){var n='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+((t.title+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")+'">')+t.label+"</a>";i.hook("after","setupTemplates",()=>{var e=i.settings.render.item;i.settings.render.item=(t,r)=>{var s=Qe(e.call(i,t,r)),o=Qe(n);return s.appendChild(o),Xe(o,"mousedown",e=>{Ue(e,!0)}),Xe(o,"click",e=>{i.isLocked||(Ue(e,!0),i.isLocked||i.shouldDelete([s],e)&&(i.removeItem(s),i.refreshOptions(!1),i.inputState()))}),s}})}}),Ie.define("restore_on_backspace",function(e){const t=this,i=Object.assign({text:e=>e[t.settings.labelField]},e);t.on("item_remove",function(e){if(t.isFocused&&""===t.control_input.value.trim()){var n=t.options[e];n&&t.setTextboxValue(i.text.call(t,n))}})}),Ie.define("virtual_scroll",function(){const e=this,t=e.canLoad,i=e.clearActiveOption,n=e.loadCallback;var r,s,o={},a=!1,l=[];if(e.settings.shouldLoadMore||(e.settings.shouldLoadMore=()=>{if(r.clientHeight/(r.scrollHeight-r.scrollTop)>.9)return!0;if(e.activeOption){var t=e.selectable();if(Array.from(t).indexOf(e.activeOption)>=t.length-2)return!0}return!1}),!e.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";e.settings.sortField=[{field:"$order"},{field:"$score"}];const c=t=>!("number"==typeof e.settings.maxOptions&&r.children.length>=e.settings.maxOptions)&&!(!(t in o)||!o[t]),d=(t,i)=>e.items.indexOf(i)>=0||l.indexOf(i)>=0;e.setNextUrl=(e,t)=>{o[e]=t},e.getUrl=t=>{if(t in o){const e=o[t];return o[t]=!1,e}return e.clearPagination(),e.settings.firstUrl.call(e,t)},e.clearPagination=()=>{o={}},e.hook("instead","clearActiveOption",()=>{if(!a)return i.call(e)}),e.hook("instead","canLoad",i=>i in o?c(i):t.call(e,i)),e.hook("instead","loadCallback",(t,i)=>{if(a){if(s){const i=t[0];void 0!==i&&(s.dataset.value=i[e.settings.valueField])}}else e.clearOptions(d);n.call(e,t,i),a=!1}),e.hook("after","refreshOptions",()=>{const t=e.lastValue;var i;c(t)?(i=e.render("loading_more",{query:t}))&&(i.setAttribute("data-selectable",""),s=i):t in o&&!r.querySelector(".no-results")&&(i=e.render("no_more_results",{query:t})),i&&(((e,...t)=>{var i=Je(t);(e=Ze(e)).map(e=>{i.map(t=>{e.classList.add(t)})})})(i,e.settings.optionClass),r.append(i))}),e.on("initialize",()=>{l=Object.keys(e.options),r=e.dropdown_content,e.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},e.settings.render),r.addEventListener("scroll",()=>{e.settings.shouldLoadMore.call(e)&&c(e.lastValue)&&(a||(a=!0,e.load.call(e,e.lastValue)))})})});class et{constructor(e){this.datepicker=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initDatepicker(e)}),this.initDatepicker(e),!0}initDatepicker(e){const t=e.el.querySelectorAll("input[data-provide='datepicker']");t.length>=1&&this.datepicker.initDatepickers(Array.from(t),e)}}class tt{constructor(e){this.nette=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initNetteForms(e)}),this.initNetteForms(e),!0}initNetteForms(e){var t,i;const n=null!==(i=null!==(t=this.nette)&&void 0!==t?t:w().Nette)&&void 0!==i?i:null;n&&e.el.querySelectorAll("form").forEach(e=>n.initForm(e))}}class it{constructor(e){this.selectpicker=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initSelectpicker(e)}),this.initSelectpicker(e),!0}initSelectpicker(e){const t=e.el.querySelectorAll("select.selectpicker");t.length>=1&&this.selectpicker.initSelectpickers(Array.from(t),e)}}class nt{constructor(e){this.sortable=e}onDatagridInit(e){return e.ajax.addEventListener("before",e=>{}),this.sortable.initSortable(e),e.ajax.addEventListener("success",({detail:{payload:t}})=>{if(t._datagrid_sort){for(const i in t._datagrid_sort){const n=t._datagrid_sort[i],r=e.el.querySelector(`#datagrid-sort-${i}`);r&&(r.setAttribute("href",n),r.setAttribute("data-href",n))}this.sortable.initSortable(e)}if(t._datagrid_tree){const i=e.el.querySelector(`.datagrid-tree-item[data-id='${t._datagrid_tree}'] .datagrid-tree-item-children`);if(i&&t.snippets){i.classList.add("loaded");for(const e in t.snippets){const n=t.snippets[e],r=(new DOMParser).parseFromString(n,"text/html").firstElementChild;if(r){const t=document.createElement("div");t.id=e,t.classList.add("datagrid-tree-item"),t.setAttribute("data-id",e),r.hasAttribute("has-children")&&t.classList.add("has-children"),i.append(t)}}}this.sortable.initSortableTree(e)}}),!0}}class rt{onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initPerPage(e),this.initChange(e)}),this.initPerPage(e),this.initChange(e),!0}initPerPage(e){e.el.querySelectorAll("select[data-autosubmit-per-page]").forEach(t=>{t.addEventListener("change",()=>{var i,n;let r=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("input[type=submit]");if(r||(r=null===(n=t.parentElement)||void 0===n?void 0:n.querySelector("button[type=submit]")),!(r instanceof HTMLElement))return;const s=r.closest("form");s&&e.ajax.submitForm(s)})})}initChange(e){e.el.querySelectorAll("[data-autosubmit]").forEach(t=>{const i=t.closest("form");i&&"true"!==t.dataset.listenersAttached&&(t.dataset.listenersAttached="true",t instanceof HTMLSelectElement?t.addEventListener("change",()=>e.ajax.submitForm(i)):t instanceof HTMLInputElement&&(t.hasAttribute("data-autosubmit-change")&&t.addEventListener("change",E(()=>e.ajax.submitForm(i))),t.addEventListener("keyup",E(t=>{if(_(t)||!function(e,t,i){const n=1===e.key.length?e.key.charCodeAt(0):0;return n>=t&&n<=i}(t,9,40)&&!function(e){return 2===e.key.length&&e.key.startsWith("F")}(t))return e.ajax.submitForm(i)}))))})}}class st{onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.init(e)}),this.init(e)}init(e){let t=null;e.el.addEventListener("click",e=>{if(e.target instanceof HTMLElement&&e.target.classList.contains("col-checkbox")&&(t=e.target,e.shiftKey&&t)){const e=t.closest("tr");if(!e)return;const i=t.closest("tr");if(!i)return;const n=i.closest("tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr")),[s,o]=[i.rowIndex,e.rowIndex].sort();r.slice(s,o+1).forEach(e=>{const t=e.querySelector('.col-checkbox input[type="checkbox"]');t&&(t.checked=!0)})}});const i=Array.from(e.el.querySelectorAll(`input[data-check='${e.name}']:not([data-check-all])`)),n=e.el.querySelector(`input[data-check='${e.name}'][data-check-all]`),r=e.el.querySelector("select[name='group_action[group_action]']"),s=document.querySelectorAll(".row-group-actions *[type='submit']"),o=document.querySelector(".datagrid-selected-rows-count");return[...i,n].forEach(t=>{t&&t.addEventListener("change",()=>{if(t.hasAttribute("data-check-all")){if(e.name!==t.getAttribute("data-check-all"))return;if(i.forEach(e=>e.checked=t.checked),s.forEach(e=>e.disabled=!t.checked),r&&(r.disabled=!t.checked),o){const e=i.length;o.innerText=`${t.checked?e:0}/${e}`}return}n&&(n.checked=i.every(e=>e.checked));const a=i.filter(e=>e.checked),l=a.length>=1;s.forEach(e=>e.disabled=!l),r&&(r.disabled=!l),o&&(o.innerText=`${a.length}/${i.length}`)})}),!0}}const ot="data-datagrid-confirm";class at{onDatagridInit(e){return e.el.querySelectorAll(`[${ot}]:not(.ajax)`).forEach(t=>t.addEventListener("click",t=>this.confirmEventHandler.bind(e)(t.target,t))),e.ajax.addEventListener("interact",t=>this.confirmEventHandler.bind(e)(t.detail.element,t)),!0}confirmEventHandler(e,t){var i;const n=null===(i=e.closest("a"))||void 0===i?void 0:i.getAttribute(ot);n&&(window.confirm.bind(window)(n)||(t.stopPropagation(),t.preventDefault()))}}const lt="data-datagrid-editable-url";class ct{onDatagridInit(e){return e.ajax.addEventListener("success",t=>{this.initEditableCells(e)}),this.initEditableCells(e),!0}initEditableCells(e){e.el.querySelectorAll(`[${lt}]`).forEach(t=>{t.addEventListener("click",i=>{var n,r,s,o;if(!(t instanceof HTMLAnchorElement||t.classList.contains("datagrid-inline-edit")||t.classList.contains("editing"))){t.classList.add("editing");const i=t.innerHTML.replace(/<\/?br>/g,"\n"),a=null!==(n=t.getAttribute("data-datagrid-editable-value"))&&void 0!==n?n:i;t.setAttribute("originalValue",i),t.setAttribute("valueToEdit",a);const l=null!==(r=t.getAttribute("data-datagrid-editable-type"))&&void 0!==r?r:"text";let c;switch(l){case"textarea":t.innerHTML=`<textarea rows="${function(e){var t;const i=e.style.padding?parseInt(e.style.padding.replace(/[^-\d\.]/g,""),10):0,n=e.getBoundingClientRect().height,r=Math.round(parseFloat(null!==(t=e.style.lineHeight)&&void 0!==t?t:"0"));return Math.round((n-2*i)/r)}(t)}">${a}</textarea>`,c=t.querySelector("textarea");break;case"select":c=t.querySelector(null!==(s=t.getAttribute("data-datagrid-editable-element"))&&void 0!==s?s:""),c.querySelectorAll(`option[value='${a}']`).forEach(e=>e.setAttribute("selected","true"));break;default:t.innerHTML=`<input type='${l}' />`,c=t.querySelector("input"),c.setAttribute("value",a.trim())}const d=JSON.parse(null!==(o=t.getAttribute("datagrid-editable-attrs"))&&void 0!==o?o:"{}");for(const e in d){const t=d[e];c.setAttribute(e,t)}t.classList.remove("edited");const u=async n=>{var r,s,o;let c=n.value;if(c!==a)try{const i=await e.ajax.request({url:null!==(r=t.getAttribute(lt))&&void 0!==r?r:"",method:"POST",data:{value:c}});"select"===l?t.innerHTML=null!==(o=null===(s=t.querySelector(`option[value='${c}']`))||void 0===s?void 0:s.innerHTML)&&void 0!==o?o:"":(i._datagrid_editable_new_value&&(c=i._datagrid_editable_new_value),t.innerHTML=c),t.classList.add("edited")}catch(e){t.innerHTML=i,t.classList.add("edited-error")}else t.innerHTML=i;t.classList.remove("editing")};t.querySelectorAll("input, textarea, select").forEach(e=>{e.addEventListener("blur",()=>u(e)),e.addEventListener("keydown",n=>{if(_(n))return n.stopPropagation(),n.preventDefault(),u(e);(function(e){return"Escape"===e.key})(n)&&(n.stopPropagation(),n.preventDefault(),t.classList.remove("editing"),t.innerHTML=i)}),e instanceof HTMLSelectElement&&e.addEventListener("change",()=>u(e))})}})})}}class dt{onInit(e){}onDatagridInit(e){return e.ajax.addEventListener("success",({detail:{payload:t}})=>{var i,n;if(t._datagrid_name&&t._datagrid_name===e.name){if(t._datagrid_inline_edited||t._datagrid_inline_edit_cancel){const i=e.el.querySelector(".datagrid-inline-edit-trigger");if(t._datagrid_inline_edited){e.el.querySelectorAll(`tr[data-id='${t._datagrid_inline_edited}'] > td`).forEach(e=>{e.classList.add("edited")})}return void(null==i||i.classList.remove("hidden"))}if(t._datagrid_inline_adding){const t=e.el.querySelector(".datagrid-row-inline-add");t&&(t.classList.remove("datagrid-row-inline-add-hidden"),null===(i=t.querySelector("input:not([readonly]), textarea:not([readonly])"))||void 0===i||i.focus())}t._datagrid_inline_editing&&(null===(n=e.el.querySelector(".datagrid-inline-edit-trigger"))||void 0===n||n.classList.add("hidden")),e.el.querySelectorAll(".datagrid-inline-edit input").forEach(e=>{e.addEventListener("keydown",t=>{var i,n;if(_(t))return t.stopPropagation(),t.preventDefault(),null===(n=null===(i=e.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_edit[submit]']"))||void 0===n?void 0:n.click()})}),e.el.querySelectorAll(".datagrid-inline-add input").forEach(e=>{e.addEventListener("keydown",t=>{var i,n;if(_(t))return t.stopPropagation(),t.preventDefault(),null===(n=null===(i=e.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_add[submit]']"))||void 0===n?void 0:n.click()})}),e.el.querySelectorAll("[data-datagrid-cancel-inline-add]").forEach(e=>{e.addEventListener("mouseup",t=>{if(0===t.button){t.stopPropagation(),t.preventDefault();const i=e.closest(".datagrid-row-inline-add");i&&i.classList.add("datagrid-row-inline-add-hidden")}})})}}),!0}}class ut{onDatagridInit(e){return e.el.querySelectorAll("[data-toggle-detail-grid]").forEach(t=>{if(t.getAttribute("data-toggle-detail-grid")!==e.name)return;const i=t.getAttribute("data-toggle-detail");t.addEventListener("click",n=>{const r=e.el.querySelector(`.item-detail-${e.name}-id-${i}`);t.closest("tr"),r&&(r.classList.add("datagrid--content-row"),r.classList.toggle("is-active")),e.ajax.addEventListener("before",t=>{t.detail.params.url.includes(`do=${e.name}-getItemDetail`)&&t.detail.params.url.includes(`grid-id=${i}`)&&(t.stopPropagation(),t.preventDefault())})})}),e.ajax.addEventListener("success",({detail:{payload:t}})=>{var i;t._datagrid_redraw_item_id&&t._datagrid_redraw_item_class&&(null===(i=e.el.querySelector(`tr[data-id='${t._datagrid_redraw_item_id}']`))||void 0===i||i.setAttribute("class",t._datagrid_redraw_item_class))}),!0}}class ht{onDatagridInit(e){return e.ajax.addEventListener("before",e=>{}),e.ajax.addEventListener("success",({detail:{payload:e}})=>{var t,i;if(e._datagrid_tree){const n=e._datagrid_tree,r=document.querySelector(`.datagrid-tree-item[data-id="${n}"]`),s=document.querySelector(`.datagrid-tree-item[data-id="${n}"] .datagrid-tree-item-children`);if(s){if(s.classList.contains("showed")){if(s.innerHTML="",s.classList.remove("showed"),r){const e=r.querySelector("a.chevron");e&&(e.style.transform="rotate(0deg)")}return}if(s.classList.add("showed"),r){const e=r.querySelector("a.chevron");e&&(e.style.transform="rotate(90deg)")}const n=e.snippets;for(const e in n){const r=n[e],o=(new DOMParser).parseFromString(r,"text/html").querySelector("[data-id]"),a=null!==(t=null==o?void 0:o.getAttribute("data-id"))&&void 0!==t?t:"",l=`\n<div class="datagrid-tree-item" class='${null!==(i=null==o?void 0:o.hasAttribute("data-has-children"))&&void 0!==i&&i?"has-children":""}' id="${e}" data-id="${a}">${r}</div>`;s.innerHTML=l}}}}),!0}}
7
+ */var b=(m||(m=1,v.exports=function(){class e{filled(e,t,i){return""!==i&&!1!==i&&null!==i&&(!Array.isArray(i)||i.length>0)&&(!(i instanceof FileList)||i.length>0)}blank(e,t,i){return!this.filled(e,t,i)}valid(e,t){return t.validateControl(e,void 0,!0)}equal(e,t,i){if(void 0===t)return null;let n=e=>"number"==typeof e||"string"==typeof e?""+e:!0===e?"1":"",r=Array.isArray(i)?i:[i],s=Array.isArray(t)?t:[t];e:for(let e of r){for(let t of s)if(n(e)===n(t))continue e;return!1}return r.length>0}notEqual(e,t,i){return void 0===t?null:!this.equal(e,t,i)}minLength(e,t,i){return(i="number"==typeof i?i.toString():i).length>=t}maxLength(e,t,i){return(i="number"==typeof i?i.toString():i).length<=t}length(e,t,i){return i="number"==typeof i?i.toString():i,(null===(t=Array.isArray(t)?t:[t,t])[0]||i.length>=t[0])&&(null===t[1]||i.length<=t[1])}email(e,t,i){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(i)}url(e,t,i,n){return/^[a-z\d+.-]+:/.test(i)||(i="https://"+i),!!/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(i)&&(n.value=i,!0)}regexp(e,t,i){let n="string"==typeof t&&t.match(/^\/(.*)\/([imu]*)$/);try{return n&&new RegExp(n[1],n[2].replace("u","")).test(i)}catch{return null}}pattern(e,t,i,n,r){if("string"!=typeof t)return null;try{let e;try{e=new RegExp("^(?:"+t+")$",r?"ui":"u")}catch{e=new RegExp("^(?:"+t+")$",r?"i":"")}return i instanceof FileList?Array.from(i).every(t=>e.test(t.name)):e.test(i)}catch{return null}}patternCaseInsensitive(e,t,i){return this.pattern(e,t,i,null,!0)}numeric(e,t,i){return/^[0-9]+$/.test(i)}integer(e,t,i,n){return!!/^-?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}float(e,t,i,n){return i=i.replace(/ +/g,"").replace(/,/g,"."),!!/^-?[0-9]*\.?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}min(e,t,i){return Number.isFinite(t)&&(i=parseFloat(i)),i>=t}max(e,t,i){return Number.isFinite(t)&&(i=parseFloat(i)),i<=t}range(e,t,i){return Array.isArray(t)?"time"===e.type&&t[0]>t[1]?i>=t[0]||i<=t[1]:(null===t[0]||this.min(e,t[0],i))&&(null===t[1]||this.max(e,t[1],i)):null}submitted(e){return e.form["nette-submittedBy"]===e}fileSize(e,t,i){return Array.from(i).every(e=>e.size<=t)}mimeType(e,t,i){let n=[];(t=Array.isArray(t)?t:[t]).forEach(e=>n.push("^"+e.replace(/([^\w])/g,"\\$1").replace("\\*",".*")+"$"));let r=new RegExp(n.join("|"));return Array.from(i).every(e=>!e.type||r.test(e.type))}image(e,t,i){return this.mimeType(e,t??["image/gif","image/png","image/jpeg","image/webp"],i)}static(e,t){return t}}class t{formErrors=[];validators=new e;#e={};#t={};#i=new WeakMap;#n(e,t){let i=e.elements.namedItem(t);return i instanceof RadioNodeList?i[0]:i}#r(e){let t=e.form.elements.namedItem(e.name);return t instanceof RadioNodeList?Array.from(t):[t]}#s(e){"loading"!==document.readyState?e.call(this):document.addEventListener("DOMContentLoaded",e)}getValue(e){return e instanceof HTMLInputElement?"radio"===e.type?this.#r(e).find(e=>e.checked)?.value??null:"file"===e.type?e.files:"checkbox"===e.type?e.name.endsWith("[]")?this.#r(e).filter(e=>e.checked).map(e=>e.value):e.checked:e.value.trim():e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions,e=>e.value):e.selectedOptions[0]?.value??null:e instanceof HTMLTextAreaElement?e.value:e instanceof RadioNodeList?this.getValue(e[0]):null}getEffectiveValue(e,t=!1){let i=this.getValue(e);if(i===e.getAttribute("data-nette-empty-value")&&(i=""),t&&void 0===this.#e[e.name]){this.#e[e.name]=!0;let t={value:i};this.validateControl(e,void 0,!0,t),i=t.value,delete this.#e[e.name]}return i}validateControl(e,t,i=!1,n,r){t??=JSON.parse(e.getAttribute("data-nette-rules")??"[]"),n??={value:this.getEffectiveValue(e)},r??=!this.validateRule(e,":filled",null,n);for(let s of t){let t=s.op.match(/(~)?([^?]+)/),o=s.control?this.#n(e.form,s.control):e;if(s.neg=!!t[1],s.op=t[2],s.condition=!!s.rules,!o)continue;if(r&&!s.condition&&":filled"!==s.op)continue;let a=this.validateRule(o,s.op,s.arg,e===o?n:void 0);if(null!==a)if(s.neg&&(a=!a),s.condition&&a){if(!this.validateControl(e,s.rules,i,n,":blank"!==s.op&&r))return!1}else if(!s.condition&&!a){if(this.isDisabled(o))continue;if(!i){let t=Array.isArray(s.arg)?s.arg:[s.arg],i=s.msg.replace(/%(value|\d+)/g,(i,n)=>this.getValue("value"===n?o:e.form.elements.namedItem(t[n].control)));this.addError(o,i)}return!1}}return!0}validateForm(e,t=!1){let i,n=e.form??e;if(this.formErrors=[],null!==e.getAttribute("formnovalidate")){let t=JSON.parse(e.getAttribute("data-nette-validation-scope")??"[]");if(!t.length)return this.showFormErrors(n,[]),!0;i=new RegExp("^("+t.join("-|")+"-)")}for(let e of n.elements)if(e.willValidate&&e.validity.badInput)return e.reportValidity(),!1;for(let e of n.elements)if(e.getAttribute("data-nette-rules")&&(!i||e.name.replace(/]\[|\[|]|$/g,"-").match(i))&&!this.isDisabled(e)&&!this.validateControl(e,void 0,t)&&!this.formErrors.length)return!1;let r=!this.formErrors.length;return this.showFormErrors(n,this.formErrors),r}isDisabled(e){return"radio"===e.type?this.#r(e).every(e=>e.disabled):e.disabled}addError(e,t){this.formErrors.push({element:e,message:t})}showFormErrors(e,t){let i,n=[];for(let e of t)n.indexOf(e.message)<0&&(n.push(e.message),i??=e.element);n.length&&this.showModal(n.join("\n"),()=>{i?.focus()})}showModal(e,t){let i=document.createElement("dialog");if(!i.showModal)return alert(e),void t();let n=document.createElement("style");n.innerText=".netteFormsModal { text-align: center; margin: auto; border: 2px solid black; padding: 1rem } .netteFormsModal button { padding: .1em 2em }";let r=document.createElement("button");r.innerText="OK",r.onclick=()=>{i.remove(),t()},i.setAttribute("class","netteFormsModal"),i.innerText=e+"\n\n",i.append(n,r),document.body.append(i),i.showModal()}validateRule(e,t,i,n){if(e.validity.badInput)return":filled"===t;n??={value:this.getEffectiveValue(e,!0)};let r=":"===t.charAt(0)?t.substring(1):t;r=r.replace("::","_").replaceAll("\\","");let s=Array.isArray(i)?i:[i];return s=s.map(t=>{if(t?.control){let i=this.#n(e.form,t.control);return i===e?n.value:this.getEffectiveValue(i,!0)}return t}),"valid"===r&&(s[0]=this),this.validators[r]?this.validators[r](e,Array.isArray(i)?s:s[0],n.value,n):null}toggleForm(e,t){this.#t={};for(let i of Array.from(e.elements))i.getAttribute("data-nette-rules")&&this.toggleControl(i,void 0,null,!t);for(let e in this.#t)this.toggle(e,this.#t[e].state,this.#t[e].elem,t)}toggleControl(e,t,i=null,n=!1,r,s){t??=JSON.parse(e.getAttribute("data-nette-rules")??"[]"),r??={value:this.getEffectiveValue(e)},s??=!this.validateRule(e,":filled",null,r);let o,a=!1;for(let l of t){let t=l.op.match(/(~)?([^?]+)/),c=l.control?this.#n(e.form,l.control):e;if(l.neg=!!t[1],l.op=t[2],l.condition=!!l.rules,c&&(!s||l.condition||":filled"===l.op)){if(o=i,!1!==i){if(o=this.validateRule(c,l.op,l.arg,e===c?r:void 0),null===o)continue;l.neg&&(o=!o),l.condition||(i=o)}if(l.condition&&this.toggleControl(e,l.rules,o,n,r,":blank"!==l.op&&s)||l.toggle){a=!0,n&&this.#r(c).filter(e=>!this.#i.has(e)).forEach(t=>{t.addEventListener("change",t=>this.toggleForm(e.form,t)),this.#i.set(t,null)});for(let t in l.toggle??{})this.#t[t]??={elem:e,state:!1},this.#t[t].state||=l.toggle[t]?!!o:!o}}}return a}toggle(e,t,i,n){/^\w[\w.:-]*$/.test(e)&&(e="#"+e),Array.from(document.querySelectorAll(e)).forEach(e=>e.hidden=!t)}compactCheckboxes(e,t){let i={};for(let n of e.elements)n instanceof HTMLInputElement&&"checkbox"===n.type&&n.name.endsWith("[]")&&n.checked&&!n.disabled&&(t.delete(n.name),i[n.name]??=[],i[n.name].push(n.value));for(let e in i)t.set(e.substring(0,e.length-2),i[e].join(","))}initForm(e){"get"===e.method&&e.hasAttribute("data-nette-compact")&&e.addEventListener("formdata",t=>this.compactCheckboxes(e,t.formData)),Array.from(e.elements).some(e=>e.getAttribute("data-nette-rules"))&&(this.toggleForm(e),e.noValidate||(e.noValidate=!0,e.addEventListener("submit",t=>{this.validateForm(t.submitter||e)||(t.stopImmediatePropagation(),t.preventDefault())}),e.addEventListener("reset",()=>{setTimeout(()=>this.toggleForm(e))})))}initOnLoad(){this.#s(()=>{Array.from(document.forms).forEach(e=>this.initForm(e))})}}let i={"á":"a","ä":"a","č":"c","ď":"d","é":"e","ě":"e","í":"i","ľ":"l","ň":"n","ó":"o","ô":"o","ř":"r","š":"s","ť":"t","ú":"u","ů":"u","ý":"y","ž":"z"};function n(e){e=e.toLowerCase();let t="";for(let n=0;n<e.length;n++){let r=i[e.charAt(n)];t+=r||e.charAt(n)}return t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}var r="3.5.3";let s=new t;return s.version=r,s.webalize=n,s}()),v.exports),y=g(b);function _(e){return"Enter"===e.key}function w(){return null!=w?w:{}}function E(e,t=200){let i=null,n=!1;return(...r)=>{n||(i&&clearTimeout(i),i=setTimeout(()=>{const t=e(...r);var i;"object"==typeof(i=t)&&"function"==typeof i.then&&(n=!0,t.finally(()=>{n=!1}))},t))}}function A(e,t){e.split(/\s+/).forEach(e=>{t(e)})}class S{constructor(){this._events={}}on(e,t){A(e,e=>{const i=this._events[e]||[];i.push(t),this._events[e]=i})}off(e,t){var i=arguments.length;0!==i?A(e,e=>{if(1===i)return void delete this._events[e];const n=this._events[e];void 0!==n&&(n.splice(n.indexOf(t),1),this._events[e]=n)}):this._events={}}trigger(e,...t){var i=this;A(e,e=>{const n=i._events[e];void 0!==n&&n.forEach(e=>{e.apply(i,t)})})}}const k=e=>(e=e.filter(Boolean)).length<2?e[0]||"":1==T(e)?"["+e.join("")+"]":"(?:"+e.join("|")+")",O=e=>{if(!D(e))return e.join("");let t="",i=0;const n=()=>{i>1&&(t+="{"+i+"}")};return e.forEach((r,s)=>{r!==e[s-1]?(n(),t+=r,i=1):i++}),n(),t},C=e=>{let t=Array.from(e);return k(t)},D=e=>new Set(e).size!==e.length,x=e=>(e+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),T=e=>e.reduce((e,t)=>Math.max(e,L(t)),0),L=e=>Array.from(e).length,I=e=>{if(1===e.length)return[[e]];let t=[];const i=e.substring(1);return I(i).forEach(function(i){let n=i.slice(0);n[0]=e.charAt(0)+n[0],t.push(n),n=i.slice(0),n.unshift(e.charAt(0)),t.push(n)}),t},M=[[0,65535]];let F,N;const j={},P={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let e in P){let t=P[e]||"";for(let i=0;i<t.length;i++){let n=t.substring(i,i+1);j[n]=e}}const H=new RegExp(Object.keys(j).join("|")+"|[̀-ͯ·ʾʼ]","gu"),q=(e,t="NFKD")=>e.normalize(t),R=e=>Array.from(e).reduce((e,t)=>e+B(t),""),B=e=>(e=q(e).toLowerCase().replace(H,e=>j[e]||""),q(e,"NFC"));const V=e=>{const t={},i=(e,i)=>{const n=t[e]||new Set,r=new RegExp("^"+C(n)+"$","iu");i.match(r)||(n.add(x(i)),t[e]=n)};for(let t of function*(e){for(const[t,i]of e)for(let e=t;e<=i;e++){let t=String.fromCharCode(e),i=R(t);i!=t.toLowerCase()&&(i.length>3||0!=i.length&&(yield{folded:i,composed:t,code_point:e}))}}(e))i(t.folded,t.folded),i(t.folded,t.composed);return t},z=e=>{const t=V(e),i={};let n=[];for(let e in t){let r=t[e];r&&(i[e]=C(r)),e.length>1&&n.push(x(e))}n.sort((e,t)=>t.length-e.length);const r=k(n);return N=new RegExp("^"+r,"u"),i},W=(e,t=1)=>(t=Math.max(t,e.length-1),k(I(e).map(e=>((e,t=1)=>{let i=0;return e=e.map(e=>(F[e]&&(i+=e.length),F[e]||e)),i>=t?O(e):""})(e,t)))),Y=(e,t=!0)=>{let i=e.length>1?1:0;return k(e.map(e=>{let n=[];const r=t?e.length():e.length()-1;for(let t=0;t<r;t++)n.push(W(e.substrs[t]||"",i));return O(n)}))},K=(e,t)=>{for(const i of t){if(i.start!=e.start||i.end!=e.end)continue;if(i.substrs.join("")!==e.substrs.join(""))continue;let t=e.parts;const n=e=>{for(const i of t){if(i.start===e.start&&i.substr===e.substr)return!1;if(1!=e.length&&1!=i.length){if(e.start<i.start&&e.end>i.start)return!0;if(i.start<e.start&&i.end>e.start)return!0}}return!1};if(!(i.parts.filter(n).length>0))return!0}return!1};class U{parts;substrs;start;end;constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(e){e&&(this.parts.push(e),this.substrs.push(e.substr),this.start=Math.min(e.start,this.start),this.end=Math.max(e.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(e,t){let i=new U,n=JSON.parse(JSON.stringify(this.parts)),r=n.pop();for(const e of n)i.add(e);let s=t.substr.substring(0,e-r.start),o=s.length;return i.add({start:r.start,end:r.start+o,length:o,substr:s}),i}}const X=e=>{void 0===F&&(F=z(M)),e=R(e);let t="",i=[new U];for(let n=0;n<e.length;n++){let r=e.substring(n).match(N);const s=e.substring(n,n+1),o=r?r[0]:null;let a=[],l=new Set;for(const e of i){const t=e.last();if(!t||1==t.length||t.end<=n)if(o){const t=o.length;e.add({start:n,end:n+t,length:t,substr:o}),l.add("1")}else e.add({start:n,end:n+1,length:1,substr:s}),l.add("2");else if(o){let i=e.clone(n,t);const r=o.length;i.add({start:n,end:n+r,length:r,substr:o}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort((e,t)=>e.length()-t.length());for(let e of a)K(e,i)||i.push(e)}else if(n>0&&1==l.size&&!l.has("3")){t+=Y(i,!1);let e=new U;const n=i[0];n&&e.add(n.last()),i=[e]}}return t+=Y(i,!0),t},Q=(e,t)=>{if(e)return e[t]},G=(e,t)=>{if(e){for(var i,n=t.split(".");(i=n.shift())&&(e=e[i]););return e}},J=(e,t,i)=>{var n,r;return e?(e+="",null==t.regex||-1===(r=e.search(t.regex))?0:(n=t.string.length/e.length,0===r&&(n+=.5),n*i)):0},Z=(e,t)=>{var i=e[t];if("function"==typeof i)return i;i&&!Array.isArray(i)&&(e[t]=[i])},ee=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},te=(e,t)=>"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=R(e+"").toLowerCase())>(t=R(t+"").toLowerCase())?1:t>e?-1:0;class ie{items;settings;constructor(e,t){this.items=e,this.settings=t||{diacritics:!0}}tokenize(e,t,i){if(!e||!e.length)return[];const n=[],r=e.split(/\s+/);var s;return i&&(s=new RegExp("^("+Object.keys(i).map(x).join("|")+"):(.*)$")),r.forEach(e=>{let i,r=null,o=null;s&&(i=e.match(s))&&(r=i[1],e=i[2]),e.length>0&&(o=this.settings.diacritics?X(e)||null:x(e),o&&t&&(o="\\b"+o)),n.push({string:e,regex:o?new RegExp(o,"iu"):null,field:r})}),n}getScoreFunction(e,t){var i=this.prepareSearch(e,t);return this._getScoreFunction(i)}_getScoreFunction(e){const t=e.tokens,i=t.length;if(!i)return function(){return 0};const n=e.options.fields,r=e.weights,s=n.length,o=e.getAttrFn;if(!s)return function(){return 1};const a=1===s?function(e,t){const i=n[0].field;return J(o(t,i),e,r[i]||1)}:function(e,t){var i=0;if(e.field){const n=o(t,e.field);!e.regex&&n?i+=1/s:i+=J(n,e,1)}else ee(r,(n,r)=>{i+=J(o(t,r),e,n)});return i/s};return 1===i?function(e){return a(t[0],e)}:"and"===e.options.conjunction?function(e){var n,r=0;for(let i of t){if((n=a(i,e))<=0)return 0;r+=n}return r/i}:function(e){var n=0;return ee(t,t=>{n+=a(t,e)}),n/i}}getSortFunction(e,t){var i=this.prepareSearch(e,t);return this._getSortFunction(i)}_getSortFunction(e){var t,i=[];const n=this,r=e.options,s=!e.query&&r.sort_empty?r.sort_empty:r.sort;if("function"==typeof s)return s.bind(this);const o=function(t,i){return"$score"===t?i.score:e.getAttrFn(n.items[i.id],t)};if(s)for(let t of s)(e.query||"$score"!==t.field)&&i.push(t);if(e.query){t=!0;for(let e of i)if("$score"===e.field){t=!1;break}t&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter(e=>"$score"!==e.field);return i.length?function(e,t){var n,r;for(let s of i){if(r=s.field,n=("desc"===s.direction?-1:1)*te(o(r,e),o(r,t)))return n}return 0}:null}prepareSearch(e,t){const i={};var n=Object.assign({},t);if(Z(n,"sort"),Z(n,"sort_empty"),n.fields){Z(n,"fields");const e=[];n.fields.forEach(t=>{"string"==typeof t&&(t={field:t,weight:1}),e.push(t),i[t.field]="weight"in t?t.weight:1}),n.fields=e}return{options:n,query:e.toLowerCase().trim(),tokens:this.tokenize(e,n.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:n.nesting?G:Q}}search(e,t){var i,n,r=this;n=this.prepareSearch(e,t),t=n.options,e=n.query;const s=t.score||r._getScoreFunction(n);e.length?ee(r.items,(e,r)=>{i=s(e),(!1===t.filter||i>0)&&n.items.push({score:i,id:r})}):ee(r.items,(e,t)=>{n.items.push({score:1,id:t})});const o=r._getSortFunction(n);return o&&n.items.sort(o),n.total=n.items.length,"number"==typeof t.limit&&(n.items=n.items.slice(0,t.limit)),n}}const ne=e=>null==e?null:re(e),re=e=>"boolean"==typeof e?e?"1":"0":e+"",se=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),oe=(e,t)=>{var i;return function(n,r){var s=this;i&&(s.loading=Math.max(s.loading-1,0),clearTimeout(i)),i=setTimeout(function(){i=null,s.loadedSearches[n]=!0,e.call(s,n,r)},t)}},ae=(e,t,i)=>{var n,r=e.trigger,s={};for(n of(e.trigger=function(){var i=arguments[0];if(-1===t.indexOf(i))return r.apply(e,arguments);s[i]=arguments},i.apply(e,[]),e.trigger=r,t))n in s&&r.apply(e,s[n])},le=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},ce=(e,t,i,n)=>{e.addEventListener(t,i,n)},de=(e,t)=>!!t&&(!!t[e]&&1===(t.altKey?1:0)+(t.ctrlKey?1:0)+(t.shiftKey?1:0)+(t.metaKey?1:0)),ue=(e,t)=>{const i=e.getAttribute("id");return i||(e.setAttribute("id",t),t)},he=e=>e.replace(/[\\"']/g,"\\$&"),pe=(e,t)=>{t&&e.append(t)},fe=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},ge=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(me(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},me=e=>"string"==typeof e&&e.indexOf("<")>-1,ve=(e,t)=>{var i=document.createEvent("HTMLEvents");i.initEvent(t,!0,!1),e.dispatchEvent(i)},be=(e,t)=>{Object.assign(e.style,t)},ye=(e,...t)=>{var i=we(t);(e=Ee(e)).map(e=>{i.map(t=>{e.classList.add(t)})})},_e=(e,...t)=>{var i=we(t);(e=Ee(e)).map(e=>{i.map(t=>{e.classList.remove(t)})})},we=e=>{var t=[];return fe(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ee=e=>(Array.isArray(e)||(e=[e]),e),Ae=(e,t,i)=>{if(!i||i.contains(e))for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}},Se=(e,t=0)=>t>0?e[e.length-1]:e[0],ke=(e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i},Oe=(e,t)=>{fe(t,(t,i)=>{null==t?e.removeAttribute(i):e.setAttribute(i,""+t)})},Ce=(e,t)=>{e.parentNode&&e.parentNode.replaceChild(t,e)},De=(e,t)=>{if(null===t)return;if("string"==typeof t){if(!t.length)return;t=new RegExp(t,"i")}const i=e=>3===e.nodeType?(e=>{var i=e.data.match(t);if(i&&e.data.length>0){var n=document.createElement("span");n.className="highlight";var r=e.splitText(i.index);r.splitText(i[0].length);var s=r.cloneNode(!0);return n.appendChild(s),Ce(r,n),1}return 0})(e):((e=>{1!==e.nodeType||!e.childNodes||/(script|style)/i.test(e.tagName)||"highlight"===e.className&&"SPAN"===e.tagName||Array.from(e.childNodes).forEach(e=>{i(e)})})(e),0);i(e)},xe="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var Te={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,refreshThrottle:300,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(e){return e.length>0},render:{}};function Le(e,t){var i=Object.assign({},Te,t),n=i.dataAttr,r=i.labelField,s=i.valueField,o=i.disabledField,a=i.optgroupField,l=i.optgroupLabelField,c=i.optgroupValueField,d=e.tagName.toLowerCase(),u=e.getAttribute("placeholder")||e.getAttribute("data-placeholder");if(!u&&!i.allowEmptyOption){let t=e.querySelector('option[value=""]');t&&(u=t.textContent)}var h={placeholder:u,options:[],optgroups:[],items:[],maxItems:null};return"select"===d?(()=>{var t,d=h.options,u={},p=1;let f=0;var g=e=>{var t=Object.assign({},e.dataset),i=n&&t[n];return"string"==typeof i&&i.length&&(t=Object.assign(t,JSON.parse(i))),t},m=(e,t)=>{var n=ne(e.value);if(null!=n&&(n||i.allowEmptyOption)){if(u.hasOwnProperty(n)){if(t){var l=u[n][a];l?Array.isArray(l)?l.push(t):u[n][a]=[l,t]:u[n][a]=t}}else{var c=g(e);c[r]=c[r]||e.textContent,c[s]=c[s]||n,c[o]=c[o]||e.disabled,c[a]=c[a]||t,c.$option=e,c.$order=c.$order||++f,u[n]=c,d.push(c)}e.selected&&h.items.push(n)}};h.maxItems=e.hasAttribute("multiple")?null:1,fe(e.children,e=>{var i,n,r;"optgroup"===(t=e.tagName.toLowerCase())?((r=g(i=e))[l]=r[l]||i.getAttribute("label")||"",r[c]=r[c]||p++,r[o]=r[o]||i.disabled,r.$order=r.$order||++f,h.optgroups.push(r),n=r[c],fe(i.children,e=>{m(e,n)})):"option"===t&&m(e)})})():(()=>{const t=e.getAttribute(n);if(t)h.options=JSON.parse(t),fe(h.options,e=>{h.items.push(e[s])});else{var o=e.value.trim()||"";if(!i.allowEmptyOption&&!o.length)return;const t=o.split(i.delimiter);fe(t,e=>{const t={};t[r]=e,t[s]=e,h.options.push(t)}),h.items=t}})(),Object.assign({},Te,h,t)}var Ie=0;let Me=class extends(function(e){return e.plugins={},class extends e{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(t,i){e.plugins[t]={name:t,fn:i}}initializePlugins(e){var t,i;const n=this,r=[];if(Array.isArray(e))e.forEach(e=>{"string"==typeof e?r.push(e):(n.plugins.settings[e.name]=e.options,r.push(e.name))});else if(e)for(t in e)e.hasOwnProperty(t)&&(n.plugins.settings[t]=e[t],r.push(t));for(;i=r.shift();)n.require(i)}loadPlugin(t){var i=this,n=i.plugins,r=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');n.requested[t]=!0,n.loaded[t]=r.fn.apply(i,[i.plugins.settings[t]||{}]),n.names.push(t)}require(e){var t=this,i=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(i.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return i.loaded[e]}}}(S)){constructor(e,t){var i;super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,Ie++;var n=ge(e);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,i=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const r=Le(n,t);this.settings=r,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(i),this.inputId=ue(n,"tomselect-"+Ie),this.isRequired=n.required,this.sifter=new ie(this.options,{diacritics:r.diacritics}),r.mode=r.mode||(1===r.maxItems?"single":"multi"),"boolean"!=typeof r.hideSelected&&(r.hideSelected="multi"===r.mode),"boolean"!=typeof r.hidePlaceholder&&(r.hidePlaceholder="multi"!==r.mode);var s=r.createFilter;"function"!=typeof s&&("string"==typeof s&&(s=new RegExp(s)),s instanceof RegExp?r.createFilter=e=>s.test(e):r.createFilter=e=>this.settings.duplicates||!this.options[e]),this.initializePlugins(r.plugins),this.setupCallbacks(),this.setupTemplates();const o=ge("<div>"),a=ge("<div>"),l=this._render("dropdown"),c=ge('<div role="listbox" tabindex="-1">'),d=this.input.getAttribute("class")||"",u=r.mode;var h;if(ye(o,r.wrapperClass,d,u),ye(a,r.controlClass),pe(o,a),ye(l,r.dropdownClass,u),r.copyClassesToDropdown&&ye(l,d),ye(c,r.dropdownContentClass),pe(l,c),ge(r.dropdownParent||o).appendChild(l),me(r.controlInput)){h=ge(r.controlInput);fe(["autocorrect","autocapitalize","autocomplete","spellcheck"],e=>{n.getAttribute(e)&&Oe(h,{[e]:n.getAttribute(e)})}),h.tabIndex=-1,a.appendChild(h),this.focus_node=h}else r.controlInput?(h=ge(r.controlInput),this.focus_node=h):(h=ge("<input/>"),this.focus_node=a);this.wrapper=o,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=h,this.setup()}setup(){const e=this,t=e.settings,i=e.control_input,n=e.dropdown,r=e.dropdown_content,s=e.wrapper,o=e.control,a=e.input,l=e.focus_node,c={passive:!0},d=e.inputId+"-ts-dropdown";Oe(r,{id:d}),Oe(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":d});const u=ue(l,e.inputId+"-ts-control"),h="label[for='"+(e=>e.replace(/['"\\]/g,"\\$&"))(e.inputId)+"']",p=document.querySelector(h),f=e.focus.bind(e);if(p){ce(p,"click",f),Oe(p,{for:u});const t=ue(p,e.inputId+"-ts-label");Oe(l,{"aria-labelledby":t}),Oe(r,{"aria-labelledby":t})}if(s.style.width=a.style.width,e.plugins.names.length){const t="plugin-"+e.plugins.names.join(" plugin-");ye([s,n],t)}(null===t.maxItems||t.maxItems>1)&&e.is_select_tag&&Oe(a,{multiple:"multiple"}),t.placeholder&&Oe(i,{placeholder:t.placeholder}),!t.splitOn&&t.delimiter&&(t.splitOn=new RegExp("\\s*"+x(t.delimiter)+"+\\s*")),t.load&&t.loadThrottle&&(t.load=oe(t.load,t.loadThrottle)),ce(n,"mousemove",()=>{e.ignoreHover=!1}),ce(n,"mouseenter",t=>{var i=Ae(t.target,"[data-selectable]",n);i&&e.onOptionHover(t,i)},{capture:!0}),ce(n,"click",t=>{const i=Ae(t.target,"[data-selectable]");i&&(e.onOptionSelect(t,i),le(t,!0))}),ce(o,"click",t=>{var n=Ae(t.target,"[data-ts-item]",o);n&&e.onItemSelect(t,n)?le(t,!0):""==i.value&&(e.onClick(),le(t,!0))}),ce(l,"keydown",t=>e.onKeyDown(t)),ce(i,"keypress",t=>e.onKeyPress(t)),ce(i,"input",t=>e.onInput(t)),ce(l,"blur",t=>e.onBlur(t)),ce(l,"focus",t=>e.onFocus(t)),ce(i,"paste",t=>e.onPaste(t));const g=t=>{const r=t.composedPath()[0];if(!s.contains(r)&&!n.contains(r))return e.isFocused&&e.blur(),void e.inputState();r==i&&e.isOpen?t.stopPropagation():le(t,!0)},m=()=>{e.isOpen&&e.positionDropdown()};ce(document,"mousedown",g),ce(window,"scroll",m,c),ce(window,"resize",m,c),this._destroy=()=>{document.removeEventListener("mousedown",g),window.removeEventListener("scroll",m),window.removeEventListener("resize",m),p&&p.removeEventListener("click",f)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",e.wrapper),e.sync(!1),t.items=[],delete t.optgroups,delete t.options,ce(a,"invalid",()=>{e.isValid&&(e.isValid=!1,e.isInvalid=!0,e.refreshState())}),e.updateOriginalInput(),e.refreshItems(),e.close(!1),e.inputState(),e.isSetup=!0,a.disabled?e.disable():a.readOnly?e.setReadOnly(!0):e.enable(),e.on("change",this.onChange),ye(a,"tomselected","ts-hidden-accessible"),e.trigger("initialize"),!0===t.preload&&e.preload()}setupOptions(e=[],t=[]){this.addOptions(e),fe(t,e=>{this.registerOptionGroup(e)})}setupTemplates(){var e=this,t=e.settings.labelField,i=e.settings.optgroupLabelField,n={optgroup:e=>{let t=document.createElement("div");return t.className="optgroup",t.appendChild(e.options),t},optgroup_header:(e,t)=>'<div class="optgroup-header">'+t(e[i])+"</div>",option:(e,i)=>"<div>"+i(e[t])+"</div>",item:(e,i)=>"<div>"+i(e[t])+"</div>",option_create:(e,t)=>'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};e.settings.render=Object.assign({},n,e.settings.render)}setupCallbacks(){var e,t,i={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in i)(t=this.settings[i[e]])&&this.on(e,t)}sync(e=!0){const t=this,i=e?Le(t.input,{delimiter:t.settings.delimiter}):t.settings;t.setupOptions(i.options,i.optgroups),t.setValue(i.items||[],!0),t.lastQuery=null}onClick(){var e=this;if(e.activeItems.length>0)return e.clearActiveItems(),void e.focus();e.isFocused&&e.isOpen?e.blur():e.focus()}onMouseDown(){}onChange(){ve(this.input,"input"),ve(this.input,"change")}onPaste(e){var t=this;t.isInputHidden||t.isLocked?le(e):t.settings.splitOn&&setTimeout(()=>{var e=t.inputValue();if(e.match(t.settings.splitOn)){var i=e.trim().split(t.settings.splitOn);fe(i,e=>{ne(e)&&(this.options[e]?t.addItem(e):t.createItem(e))})}},0)}onKeyPress(e){var t=this;if(!t.isLocked){var i=String.fromCharCode(e.keyCode||e.which);return t.settings.create&&"multi"===t.settings.mode&&i===t.settings.delimiter?(t.createItem(),void le(e)):void 0}le(e)}onKeyDown(e){var t=this;if(t.ignoreHover=!0,t.isLocked)9!==e.keyCode&&le(e);else{switch(e.keyCode){case 65:if(de(xe,e)&&""==t.control_input.value)return le(e),void t.selectAll();break;case 27:return t.isOpen&&(le(e,!0),t.close()),void t.clearActiveItems();case 40:if(!t.isOpen&&t.hasOptions)t.open();else if(t.activeOption){let e=t.getAdjacent(t.activeOption,1);e&&t.setActiveOption(e)}return void le(e);case 38:if(t.activeOption){let e=t.getAdjacent(t.activeOption,-1);e&&t.setActiveOption(e)}return void le(e);case 13:return void(t.canSelect(t.activeOption)?(t.onOptionSelect(e,t.activeOption),le(e)):(t.settings.create&&t.createItem()||document.activeElement==t.control_input&&t.isOpen)&&le(e));case 37:return void t.advanceSelection(-1,e);case 39:return void t.advanceSelection(1,e);case 9:return void(t.settings.selectOnTab&&(t.canSelect(t.activeOption)&&(t.onOptionSelect(e,t.activeOption),le(e)),t.settings.create&&t.createItem()&&le(e)));case 8:case 46:return void t.deleteSelection(e)}t.isInputHidden&&!de(xe,e)&&le(e)}}onInput(e){if(this.isLocked)return;const t=this.inputValue();this.lastValue!==t&&(this.lastValue=t,""!=t?(this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=((e,t)=>t>0?window.setTimeout(e,t):(e.call(null),null))(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)):this._onInput())}_onInput(){const e=this.lastValue;this.settings.shouldLoad.call(this,e)&&this.load(e),this.refreshOptions(),this.trigger("type",e)}onOptionHover(e,t){this.ignoreHover||this.setActiveOption(t,!1)}onFocus(e){var t=this,i=t.isFocused;if(t.isDisabled||t.isReadOnly)return t.blur(),void le(e);t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.preload(),i||t.trigger("focus"),t.activeItems.length||(t.inputState(),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())}onBlur(e){if(!1!==document.hasFocus()){var t=this;if(t.isFocused){t.isFocused=!1,t.ignoreFocus=!1;var i=()=>{t.close(),t.setActiveItem(),t.setCaret(t.items.length),t.trigger("blur")};t.settings.create&&t.settings.createOnBlur?t.createItem(null,i):i()}}}onOptionSelect(e,t){var i,n=this;t.parentElement&&t.parentElement.matches("[data-disabled]")||(t.classList.contains("create")?n.createItem(null,()=>{n.settings.closeAfterSelect&&n.close()}):void 0!==(i=t.dataset.value)&&(n.lastQuery=null,n.addItem(i),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&e.type&&/click/.test(e.type)&&n.setActiveOption(t)))}canSelect(e){return!!(this.isOpen&&e&&this.dropdown_content.contains(e))}onItemSelect(e,t){var i=this;return!i.isLocked&&"multi"===i.settings.mode&&(le(e),i.setActiveItem(t,e),!0)}canLoad(e){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(e)}load(e){const t=this;if(!t.canLoad(e))return;ye(t.wrapper,t.settings.loadingClass),t.loading++;const i=t.loadCallback.bind(t);t.settings.load.call(t,e,i)}loadCallback(e,t){const i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(e,t),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||_e(i.wrapper,i.settings.loadingClass),i.trigger("load",e,t)}preload(){var e=this.wrapper.classList;e.contains("preloaded")||(e.add("preloaded"),this.load(""))}setTextboxValue(e=""){var t=this.control_input;t.value!==e&&(t.value=e,ve(t,"update"),this.lastValue=e)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(e,t){ae(this,t?[]:["change"],()=>{this.clear(t),this.addItems(e,t)})}setMaxItems(e){0===e&&(e=null),this.settings.maxItems=e,this.refreshState()}setActiveItem(e,t){var i,n,r,s,o,a,l=this;if("single"!==l.settings.mode){if(!e)return l.clearActiveItems(),void(l.isFocused&&l.inputState());if("click"===(i=t&&t.type.toLowerCase())&&de("shiftKey",t)&&l.activeItems.length){for(a=l.getLastActive(),(r=Array.prototype.indexOf.call(l.control.children,a))>(s=Array.prototype.indexOf.call(l.control.children,e))&&(o=r,r=s,s=o),n=r;n<=s;n++)e=l.control.children[n],-1===l.activeItems.indexOf(e)&&l.setActiveItemClass(e);le(t)}else"click"===i&&de(xe,t)||"keydown"===i&&de("shiftKey",t)?e.classList.contains("active")?l.removeActiveItem(e):l.setActiveItemClass(e):(l.clearActiveItems(),l.setActiveItemClass(e));l.inputState(),l.isFocused||l.focus()}}setActiveItemClass(e){const t=this,i=t.control.querySelector(".last-active");i&&_e(i,"last-active"),ye(e,"active last-active"),t.trigger("item_select",e),-1==t.activeItems.indexOf(e)&&t.activeItems.push(e)}removeActiveItem(e){var t=this.activeItems.indexOf(e);this.activeItems.splice(t,1),_e(e,"active")}clearActiveItems(){_e(this.activeItems,"active"),this.activeItems=[]}setActiveOption(e,t=!0){e!==this.activeOption&&(this.clearActiveOption(),e&&(this.activeOption=e,Oe(this.focus_node,{"aria-activedescendant":e.getAttribute("id")}),Oe(e,{"aria-selected":"true"}),ye(e,"active"),t&&this.scrollToOption(e)))}scrollToOption(e,t){if(!e)return;const i=this.dropdown_content,n=i.clientHeight,r=i.scrollTop||0,s=e.offsetHeight,o=e.getBoundingClientRect().top-i.getBoundingClientRect().top+r;o+s>n+r?this.scroll(o-n+s,t):o<r&&this.scroll(o,t)}scroll(e,t){const i=this.dropdown_content;t&&(i.style.scrollBehavior=t),i.scrollTop=e,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(_e(this.activeOption,"active"),Oe(this.activeOption,{"aria-selected":null})),this.activeOption=null,Oe(this.focus_node,{"aria-activedescendant":null})}selectAll(){const e=this;if("single"===e.settings.mode)return;const t=e.controlChildren();t.length&&(e.inputState(),e.close(),e.activeItems=t,fe(t,t=>{e.setActiveItemClass(t)}))}inputState(){var e=this;e.control.contains(e.control_input)&&(Oe(e.control_input,{placeholder:e.settings.placeholder}),e.activeItems.length>0||!e.isFocused&&e.settings.hidePlaceholder&&e.items.length>0?(e.setTextboxValue(),e.isInputHidden=!0):(e.settings.hidePlaceholder&&e.items.length>0&&Oe(e.control_input,{placeholder:""}),e.isInputHidden=!1),e.wrapper.classList.toggle("input-hidden",e.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var e=this;e.isDisabled||e.isReadOnly||(e.ignoreFocus=!0,e.control_input.offsetWidth?e.control_input.focus():e.focus_node.focus(),setTimeout(()=>{e.ignoreFocus=!1,e.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())}getSearchOptions(){var e=this.settings,t=e.sortField;return"string"==typeof e.sortField&&(t=[{field:e.sortField}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}}search(e){var t,i,n=this,r=this.getSearchOptions();if(n.settings.score&&"function"!=typeof(i=n.settings.score.call(n,e)))throw new Error('Tom Select "score" setting must be a function that returns a function');return e!==n.lastQuery?(n.lastQuery=e,t=n.sifter.search(e,Object.assign(r,{score:i})),n.currentResults=t):t=Object.assign({},n.currentResults),n.settings.hideSelected&&(t.items=t.items.filter(e=>{let t=ne(e.id);return!(t&&-1!==n.items.indexOf(t))})),t}refreshOptions(e=!0){var t,i,n,r,s,o,a,l,c,d;const u={},h=[];var p=this,f=p.inputValue();const g=f===p.lastQuery||""==f&&null==p.lastQuery;var m=p.search(f),v=null,b=p.settings.shouldOpen||!1,y=p.dropdown_content;g&&(v=p.activeOption)&&(c=v.closest("[data-group]")),r=m.items.length,"number"==typeof p.settings.maxOptions&&(r=Math.min(r,p.settings.maxOptions)),r>0&&(b=!0);const _=(e,t)=>{let i=u[e];if(void 0!==i){let e=h[i];if(void 0!==e)return[i,e.fragment]}let n=document.createDocumentFragment();return i=h.length,h.push({fragment:n,order:t,optgroup:e}),[i,n]};for(t=0;t<r;t++){let e=m.items[t];if(!e)continue;let r=e.id,a=p.options[r];if(void 0===a)continue;let l=re(r),d=p.getOption(l,!0);for(p.settings.hideSelected||d.classList.toggle("selected",p.items.includes(l)),s=a[p.settings.optgroupField]||"",i=0,n=(o=Array.isArray(s)?s:[s])&&o.length;i<n;i++){s=o[i];let e=a.$order,t=p.optgroups[s];void 0===t?s="":e=t.$order;const[n,l]=_(s,e);i>0&&(d=d.cloneNode(!0),Oe(d,{id:a.$id+"-clone-"+i,"aria-selected":null}),d.classList.add("ts-cloned"),_e(d,"active"),p.activeOption&&p.activeOption.dataset.value==r&&c&&c.dataset.group===s.toString()&&(v=d)),l.appendChild(d),""!=s&&(u[s]=n)}}var w;p.settings.lockOptgroupOrder&&h.sort((e,t)=>e.order-t.order),a=document.createDocumentFragment(),fe(h,e=>{let t=e.fragment,i=e.optgroup;if(!t||!t.children.length)return;let n=p.optgroups[i];if(void 0!==n){let e=document.createDocumentFragment(),i=p.render("optgroup_header",n);pe(e,i),pe(e,t);let r=p.render("optgroup",{group:n,options:e});pe(a,r)}else pe(a,t)}),y.innerHTML="",pe(y,a),p.settings.highlight&&(w=y.querySelectorAll("span.highlight"),Array.prototype.forEach.call(w,function(e){var t=e.parentNode;t.replaceChild(e.firstChild,e),t.normalize()}),m.query.length&&m.tokens.length&&fe(m.tokens,e=>{De(y,e.regex)}));var E=e=>{let t=p.render(e,{input:f});return t&&(b=!0,y.insertBefore(t,y.firstChild)),t};if(p.loading?E("loading"):p.settings.shouldLoad.call(p,f)?0===m.items.length&&E("no_results"):E("not_loading"),(l=p.canCreate(f))&&(d=E("option_create")),p.hasOptions=m.items.length>0||l,b){if(m.items.length>0){if(v||"single"!==p.settings.mode||null==p.items[0]||(v=p.getOption(p.items[0])),!y.contains(v)){let e=0;d&&!p.settings.addPrecedence&&(e=1),v=p.selectable()[e]}}else d&&(v=d);e&&!p.isOpen&&(p.open(),p.scrollToOption(v,"auto")),p.setActiveOption(v)}else p.clearActiveOption(),e&&p.isOpen&&p.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(e,t=!1){const i=this;if(Array.isArray(e))return i.addOptions(e,t),!1;const n=ne(e[i.settings.valueField]);return null!==n&&!i.options.hasOwnProperty(n)&&(e.$order=e.$order||++i.order,e.$id=i.inputId+"-opt-"+e.$order,i.options[n]=e,i.lastQuery=null,t&&(i.userOptions[n]=t,i.trigger("option_add",n,e)),n)}addOptions(e,t=!1){fe(e,e=>{this.addOption(e,t)})}registerOption(e){return this.addOption(e)}registerOptionGroup(e){var t=ne(e[this.settings.optgroupValueField]);return null!==t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)}addOptionGroup(e,t){var i;t[this.settings.optgroupValueField]=e,(i=this.registerOptionGroup(t))&&this.trigger("optgroup_add",i,t)}removeOptionGroup(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.clearCache(),this.trigger("optgroup_remove",e))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(e,t){const i=this;var n,r;const s=ne(e),o=ne(t[i.settings.valueField]);if(null===s)return;const a=i.options[s];if(null==a)return;if("string"!=typeof o)throw new Error("Value must be set in option data");const l=i.getOption(s),c=i.getItem(s);if(t.$order=t.$order||a.$order,delete i.options[s],i.uncacheValue(o),i.options[o]=t,l){if(i.dropdown_content.contains(l)){const e=i._render("option",t);Ce(l,e),i.activeOption===l&&i.setActiveOption(e)}l.remove()}c&&(-1!==(r=i.items.indexOf(s))&&i.items.splice(r,1,o),n=i._render("item",t),c.classList.contains("active")&&ye(n,"active"),Ce(c,n)),i.lastQuery=null}removeOption(e,t){const i=this;e=re(e),i.uncacheValue(e),delete i.userOptions[e],delete i.options[e],i.lastQuery=null,i.trigger("option_remove",e),i.removeItem(e,t)}clearOptions(e){const t=(e||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const i={};fe(this.options,(e,n)=>{t(e,n)&&(i[n]=e)}),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(e,t){return this.items.indexOf(t)>=0}getOption(e,t=!1){const i=ne(e);if(null===i)return null;const n=this.options[i];if(null!=n){if(n.$div)return n.$div;if(t)return this._render("option",n)}return null}getAdjacent(e,t,i="option"){var n;if(!e)return null;n="item"==i?this.controlChildren():this.dropdown_content.querySelectorAll("[data-selectable]");for(let i=0;i<n.length;i++)if(n[i]==e)return t>0?n[i+1]:n[i-1];return null}getItem(e){if("object"==typeof e)return e;var t=ne(e);return null!==t?this.control.querySelector(`[data-value="${he(t)}"]`):null}addItems(e,t){var i=this,n=Array.isArray(e)?e:[e];const r=(n=n.filter(e=>-1===i.items.indexOf(e)))[n.length-1];n.forEach(e=>{i.isPending=e!==r,i.addItem(e,t)})}addItem(e,t){ae(this,t?[]:["change","dropdown_close"],()=>{var i,n;const r=this,s=r.settings.mode,o=ne(e);if((!o||-1===r.items.indexOf(o)||("single"===s&&r.close(),"single"!==s&&r.settings.duplicates))&&null!==o&&r.options.hasOwnProperty(o)&&("single"===s&&r.clear(t),"multi"!==s||!r.isFull())){if(i=r._render("item",r.options[o]),r.control.contains(i)&&(i=i.cloneNode(!0)),n=r.isFull(),r.items.splice(r.caretPos,0,o),r.insertAtCaret(i),r.isSetup){if(!r.isPending&&r.settings.hideSelected){let e=r.getOption(o),t=r.getAdjacent(e,1);t&&r.setActiveOption(t)}r.isPending||r.settings.closeAfterSelect||r.refreshOptions(r.isFocused&&"single"!==s),0!=r.settings.closeAfterSelect&&r.isFull()?r.close():r.isPending||r.positionDropdown(),r.trigger("item_add",o,i),r.isPending||r.updateOriginalInput({silent:t})}(!r.isPending||!n&&r.isFull())&&(r.inputState(),r.refreshState())}})}removeItem(e=null,t){const i=this;if(!(e=i.getItem(e)))return;var n,r;const s=e.dataset.value;n=ke(e),e.remove(),e.classList.contains("active")&&(r=i.activeItems.indexOf(e),i.activeItems.splice(r,1),_e(e,"active")),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(s)&&i.removeOption(s,t),n<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:t}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",s,e)}createItem(e=null,t=()=>{}){3===arguments.length&&(t=arguments[2]),"function"!=typeof t&&(t=()=>{});var i,n=this,r=n.caretPos;if(e=e||n.inputValue(),!n.canCreate(e))return t(),!1;n.lock();var s=!1,o=e=>{if(n.unlock(),!e||"object"!=typeof e)return t();var i=ne(e[n.settings.valueField]);if("string"!=typeof i)return t();n.setTextboxValue(),n.addOption(e,!0),n.setCaret(r),n.addItem(i),t(e),s=!0};return i="function"==typeof n.settings.create?n.settings.create.call(this,e,o):{[n.settings.labelField]:e,[n.settings.valueField]:e},s||o(i),!0}refreshItems(){var e=this;e.lastQuery=null,e.isSetup&&e.addItems(e.items),e.updateOriginalInput(),e.refreshState()}refreshState(){const e=this;e.refreshValidityState();const t=e.isFull(),i=e.isLocked;e.wrapper.classList.toggle("rtl",e.rtl);const n=e.wrapper.classList;var r;n.toggle("focus",e.isFocused),n.toggle("disabled",e.isDisabled),n.toggle("readonly",e.isReadOnly),n.toggle("required",e.isRequired),n.toggle("invalid",!e.isValid),n.toggle("locked",i),n.toggle("full",t),n.toggle("input-active",e.isFocused&&!e.isInputHidden),n.toggle("dropdown-active",e.isOpen),n.toggle("has-options",(r=e.options,0===Object.keys(r).length)),n.toggle("has-items",e.items.length>0)}refreshValidityState(){var e=this;e.input.validity&&(e.isValid=e.input.validity.valid,e.isInvalid=!e.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(e={}){const t=this;var i,n;const r=t.input.querySelector('option[value=""]');if(t.is_select_tag){const s=[],o=t.input.querySelectorAll("option:checked").length;function a(e,i,n){return e||(e=ge('<option value="'+se(i)+'">'+se(n)+"</option>")),e!=r&&t.input.append(e),s.push(e),(e!=r||o>0)&&(e.selected=!0),e}t.input.querySelectorAll("option:checked").forEach(e=>{e.selected=!1}),0==t.items.length&&"single"==t.settings.mode?a(r,"",""):t.items.forEach(e=>{if(i=t.options[e],n=i[t.settings.labelField]||"",s.includes(i.$option)){a(t.input.querySelector(`option[value="${he(e)}"]:not(:checked)`),e,n)}else i.$option=a(i.$option,e,n)})}else t.input.value=t.getValue();t.isSetup&&(e.silent||t.trigger("change",t.getValue()))}open(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.isOpen=!0,Oe(e.focus_node,{"aria-expanded":"true"}),e.refreshState(),be(e.dropdown,{visibility:"hidden",display:"block"}),e.positionDropdown(),be(e.dropdown,{visibility:"visible",display:"block"}),e.focus(),e.trigger("dropdown_open",e.dropdown))}close(e=!0){var t=this,i=t.isOpen;e&&(t.setTextboxValue(),"single"===t.settings.mode&&t.items.length&&t.inputState()),t.isOpen=!1,Oe(t.focus_node,{"aria-expanded":"false"}),be(t.dropdown,{display:"none"}),t.settings.hideSelected&&t.clearActiveOption(),t.refreshState(),i&&t.trigger("dropdown_close",t.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var e=this.control,t=e.getBoundingClientRect(),i=e.offsetHeight+t.top+window.scrollY,n=t.left+window.scrollX;be(this.dropdown,{width:t.width+"px",top:i+"px",left:n+"px"})}}clear(e){var t=this;if(t.items.length){var i=t.controlChildren();fe(i,e=>{t.removeItem(e,!0)}),t.inputState(),e||t.updateOriginalInput(),t.trigger("clear")}}insertAtCaret(e){const t=this,i=t.caretPos,n=t.control;n.insertBefore(e,n.children[i]||null),t.setCaret(i+1)}deleteSelection(e){var t,i,n,r,s,o=this;t=e&&8===e.keyCode?-1:1,i={start:(s=o.control_input).selectionStart||0,length:(s.selectionEnd||0)-(s.selectionStart||0)};const a=[];if(o.activeItems.length)r=Se(o.activeItems,t),n=ke(r),t>0&&n++,fe(o.activeItems,e=>a.push(e));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const e=o.controlChildren();let n;t<0&&0===i.start&&0===i.length?n=e[o.caretPos-1]:t>0&&i.start===o.inputValue().length&&(n=e[o.caretPos]),void 0!==n&&a.push(n)}if(!o.shouldDelete(a,e))return!1;for(le(e,!0),void 0!==n&&o.setCaret(n);a.length;)o.removeItem(a.pop());return o.inputState(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(e,t){const i=e.map(e=>e.dataset.value);return!(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(i,t))}advanceSelection(e,t){var i,n,r=this;r.rtl&&(e*=-1),r.inputValue().length||(de(xe,t)||de("shiftKey",t)?(n=(i=r.getLastActive(e))?i.classList.contains("active")?r.getAdjacent(i,e,"item"):i:e>0?r.control_input.nextElementSibling:r.control_input.previousElementSibling)&&(n.classList.contains("active")&&r.removeActiveItem(i),r.setActiveItemClass(n)):r.moveCaret(e))}moveCaret(e){}getLastActive(e){let t=this.control.querySelector(".last-active");if(t)return t;var i=this.control.querySelectorAll(".active");return i?Se(i,e):void 0}setCaret(e){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(e=this.isReadOnly||this.isDisabled){this.isLocked=e,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(e){this.focus_node.tabIndex=e?-1:this.tabIndex,this.isDisabled=e,this.input.disabled=e,this.control_input.disabled=e,this.setLocked()}setReadOnly(e){this.isReadOnly=e,this.input.readOnly=e,this.control_input.readOnly=e,this.setLocked()}destroy(){var e=this,t=e.revertSettings;e.trigger("destroy"),e.off(),e.wrapper.remove(),e.dropdown.remove(),e.input.innerHTML=t.innerHTML,e.input.tabIndex=t.tabIndex,_e(e.input,"tomselected","ts-hidden-accessible"),e._destroy(),delete e.input.tomselect}render(e,t){var i,n;const r=this;if("function"!=typeof this.settings.render[e])return null;if(!(n=r.settings.render[e].call(this,t,se)))return null;if(n=ge(n),"option"===e||"option_create"===e?t[r.settings.disabledField]?Oe(n,{"aria-disabled":"true"}):Oe(n,{"data-selectable":""}):"optgroup"===e&&(i=t.group[r.settings.optgroupValueField],Oe(n,{"data-group":i}),t.group[r.settings.disabledField]&&Oe(n,{"data-disabled":""})),"option"===e||"item"===e){const i=re(t[r.settings.valueField]);Oe(n,{"data-value":i}),"item"===e?(ye(n,r.settings.itemClass),Oe(n,{"data-ts-item":""})):(ye(n,r.settings.optionClass),Oe(n,{role:"option",id:t.$id}),t.$div=n,r.options[i]=t)}return n}_render(e,t){const i=this.render(e,t);if(null==i)throw"HTMLElement expected";return i}clearCache(){fe(this.options,e=>{e.$div&&(e.$div.remove(),delete e.$div)})}uncacheValue(e){const t=this.getOption(e);t&&t.remove()}canCreate(e){return this.settings.create&&e.length>0&&this.settings.createFilter.call(this,e)}hook(e,t,i){var n=this,r=n[t];n[t]=function(){var t,s;return"after"===e&&(t=r.apply(n,arguments)),s=i.apply(n,arguments),"instead"===e?s:("before"===e&&(t=r.apply(n,arguments)),t)}}};const Fe=e=>"boolean"==typeof e?e?"1":"0":e+"",Ne=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},je=e=>"string"==typeof e&&e.indexOf("<")>-1;const Pe=e=>"string"==typeof e&&e.indexOf("<")>-1;const $e=(e,t,i,n)=>{e.addEventListener(t,i,n)},He=e=>"string"==typeof e&&e.indexOf("<")>-1,qe=(e,t)=>{((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(t,(t,i)=>{null==t?e.removeAttribute(i):e.setAttribute(i,""+t)})};const Re=e=>"string"==typeof e&&e.indexOf("<")>-1;const Be=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ve=e=>(Array.isArray(e)||(e=[e]),e);const ze=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(We(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},We=e=>"string"==typeof e&&e.indexOf("<")>-1,Ye=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ke=e=>(Array.isArray(e)||(e=[e]),e);const Ue=(e,t,i,n)=>{e.addEventListener(t,i,n)};const Xe=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},Qe=(e,t,i,n)=>{e.addEventListener(t,i,n)},Ge=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Je(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},Je=e=>"string"==typeof e&&e.indexOf("<")>-1;const Ze=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},et=e=>(Array.isArray(e)||(e=[e]),e);Me.define("change_listener",function(){var e,t,i,n;e=this.input,t="change",i=()=>{this.sync()},e.addEventListener(t,i,n)}),Me.define("checkbox_options",function(e){var t=this,i=t.onOptionSelect;t.settings.hideSelected=!1;const n=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},e);var r=function(e,t){t?(e.checked=!0,n.uncheckedClassNames&&e.classList.remove(...n.uncheckedClassNames),n.checkedClassNames&&e.classList.add(...n.checkedClassNames)):(e.checked=!1,n.checkedClassNames&&e.classList.remove(...n.checkedClassNames),n.uncheckedClassNames&&e.classList.add(...n.uncheckedClassNames))},s=function(e){setTimeout(()=>{var t=e.querySelector("input."+n.className);t instanceof HTMLInputElement&&r(t,e.classList.contains("selected"))},1)};t.hook("after","setupTemplates",()=>{var e=t.settings.render.option;t.settings.render.option=(i,s)=>{var o=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(je(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(e.call(t,i,s)),a=document.createElement("input");n.className&&a.classList.add(n.className),a.addEventListener("click",function(e){Ne(e)}),a.type="checkbox";const l=null==(c=i[t.settings.valueField])?null:Fe(c);var c;return r(a,!!(l&&t.items.indexOf(l)>-1)),o.prepend(a),o}}),t.on("item_remove",e=>{var i=t.getOption(e);i&&(i.classList.remove("selected"),s(i))}),t.on("item_add",e=>{var i=t.getOption(e);i&&s(i)}),t.hook("instead","onOptionSelect",(e,n)=>{if(n.classList.contains("selected"))return n.classList.remove("selected"),t.removeItem(n.dataset.value),t.refreshOptions(),void Ne(e,!0);i.call(t,e,n),s(n)})}),Me.define("clear_button",function(e){const t=this,i=Object.assign({className:"clear-button",title:"Clear All",html:e=>`<div class="${e.className}" title="${e.title}">&#10799;</div>`},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Pe(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(i.html(i));e.addEventListener("click",e=>{t.isLocked||(t.clear(),"single"===t.settings.mode&&t.settings.allowEmptyOption&&t.addItem(""),e.preventDefault(),e.stopPropagation())}),t.control.appendChild(e)})}),Me.define("drag_drop",function(){var e=this;if("multi"!==e.settings.mode)return;var t=e.lock,i=e.unlock;let n,r=!0;e.hook("after","setupTemplates",()=>{var t=e.settings.render.item;e.settings.render.item=(i,s)=>{const o=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(He(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(t.call(e,i,s));qe(o,{draggable:"true"});const a=e=>{e.preventDefault(),o.classList.add("ts-drag-over"),l(o,n)},l=(e,t)=>{var i,n,r;void 0!==t&&(((e,t)=>{do{var i;if(e==(t=null==(i=t)?void 0:i.previousElementSibling))return!0}while(t&&t.previousElementSibling);return!1})(t,o)?(n=t,null==(r=(i=e).parentNode)||r.insertBefore(n,i.nextSibling)):((e,t)=>{var i;null==(i=e.parentNode)||i.insertBefore(t,e)})(e,t))};return $e(o,"mousedown",e=>{r||((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e),e.stopPropagation()}),$e(o,"dragstart",e=>{n=o,setTimeout(()=>{o.classList.add("ts-dragging")},0)}),$e(o,"dragenter",a),$e(o,"dragover",a),$e(o,"dragleave",()=>{o.classList.remove("ts-drag-over")}),$e(o,"dragend",()=>{var t;document.querySelectorAll(".ts-drag-over").forEach(e=>e.classList.remove("ts-drag-over")),null==(t=n)||t.classList.remove("ts-dragging"),n=void 0;var i=[];e.control.querySelectorAll("[data-value]").forEach(e=>{if(e.dataset.value){let t=e.dataset.value;t&&i.push(t)}}),e.setValue(i)}),o}}),e.hook("instead","lock",()=>(r=!1,t.call(e))),e.hook("instead","unlock",()=>(r=!0,i.call(e)))}),Me.define("dropdown_header",function(e){const t=this,i=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:e=>'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a class="'+e.closeClass+'">&times;</a></div></div>'},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Re(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(i.html(i)),n=e.querySelector("."+i.closeClass);n&&n.addEventListener("click",e=>{((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e,!0),t.close()}),t.dropdown.insertBefore(e,t.dropdown.firstChild)})}),Me.define("caret_position",function(){var e=this;e.hook("instead","setCaret",t=>{"single"!==e.settings.mode&&e.control.contains(e.control_input)?(t=Math.max(0,Math.min(e.items.length,t)))==e.caretPos||e.isPending||e.controlChildren().forEach((i,n)=>{n<t?e.control_input.insertAdjacentElement("beforebegin",i):e.control.appendChild(i)}):t=e.items.length,e.caretPos=t}),e.hook("instead","moveCaret",t=>{if(!e.isFocused)return;const i=e.getLastActive(t);if(i){const n=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i})(i);e.setCaret(t>0?n+1:n),e.setActiveItem(),((e,...t)=>{var i=Be(t);(e=Ve(e)).map(e=>{i.map(t=>{e.classList.remove(t)})})})(i,"last-active")}else e.setCaret(e.caretPos+t)})}),Me.define("dropdown_input",function(){const e=this;e.settings.shouldOpen=!0,e.hook("before","setup",()=>{e.focus_node=e.control,((e,...t)=>{var i=Ye(t);(e=Ke(e)).map(e=>{i.map(t=>{e.classList.add(t)})})})(e.control_input,"dropdown-input");const t=ze('<div class="dropdown-input-wrap">');t.append(e.control_input),e.dropdown.insertBefore(t,e.dropdown.firstChild);const i=ze('<input class="items-placeholder" tabindex="-1" />');i.placeholder=e.settings.placeholder||"",e.control.append(i)}),e.on("initialize",()=>{e.control_input.addEventListener("keydown",t=>{switch(t.keyCode){case 27:return e.isOpen&&(((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(t,!0),e.close()),void e.clearActiveItems();case 9:e.focus_node.tabIndex=-1}return e.onKeyDown.call(e,t)}),e.on("blur",()=>{e.focus_node.tabIndex=e.isDisabled?-1:e.tabIndex}),e.on("dropdown_open",()=>{e.control_input.focus()});const t=e.onBlur;var i,n,r,s;e.hook("instead","onBlur",i=>{if(!i||i.relatedTarget!=e.control_input)return t.call(e)}),i=e.control_input,n="blur",r=()=>e.onBlur(),i.addEventListener(n,r,s),e.hook("before","close",()=>{e.isOpen&&e.focus_node.focus({preventScroll:!0})})})}),Me.define("input_autogrow",function(){var e=this;e.on("initialize",()=>{var t=document.createElement("span"),i=e.control_input;t.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",e.wrapper.appendChild(t);for(const e of["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"])t.style[e]=i.style[e];var n=()=>{t.textContent=i.value,i.style.width=t.clientWidth+"px"};n(),e.on("update item_add item_remove",n),Ue(i,"input",n),Ue(i,"keyup",n),Ue(i,"blur",n),Ue(i,"update",n)})}),Me.define("no_backspace_delete",function(){var e=this,t=e.deleteSelection;this.hook("instead","deleteSelection",i=>!!e.activeItems.length&&t.call(e,i))}),Me.define("no_active_items",function(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}),Me.define("optgroup_columns",function(){var e=this,t=e.onKeyDown;e.hook("instead","onKeyDown",i=>{var n,r,s,o;if(!e.isOpen||37!==i.keyCode&&39!==i.keyCode)return t.call(e,i);e.ignoreHover=!0,o=((e,t)=>{for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}})(e.activeOption,"[data-group]"),n=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i})(e.activeOption,"[data-selectable]"),o&&(o=37===i.keyCode?o.previousSibling:o.nextSibling)&&(r=(s=o.querySelectorAll("[data-selectable]"))[Math.min(s.length-1,n)])&&e.setActiveOption(r)})}),Me.define("remove_button",function(e){const t=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},e);var i=this;if(t.append){var n='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+((t.title+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")+'">')+t.label+"</a>";i.hook("after","setupTemplates",()=>{var e=i.settings.render.item;i.settings.render.item=(t,r)=>{var s=Ge(e.call(i,t,r)),o=Ge(n);return s.appendChild(o),Qe(o,"mousedown",e=>{Xe(e,!0)}),Qe(o,"click",e=>{i.isLocked||(Xe(e,!0),i.isLocked||i.shouldDelete([s],e)&&(i.removeItem(s),i.refreshOptions(!1),i.inputState()))}),s}})}}),Me.define("restore_on_backspace",function(e){const t=this,i=Object.assign({text:e=>e[t.settings.labelField]},e);t.on("item_remove",function(e){if(t.isFocused&&""===t.control_input.value.trim()){var n=t.options[e];n&&t.setTextboxValue(i.text.call(t,n))}})}),Me.define("virtual_scroll",function(){const e=this,t=e.canLoad,i=e.clearActiveOption,n=e.loadCallback;var r,s,o={},a=!1,l=[];if(e.settings.shouldLoadMore||(e.settings.shouldLoadMore=()=>{if(r.clientHeight/(r.scrollHeight-r.scrollTop)>.9)return!0;if(e.activeOption){var t=e.selectable();if(Array.from(t).indexOf(e.activeOption)>=t.length-2)return!0}return!1}),!e.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";e.settings.sortField=[{field:"$order"},{field:"$score"}];const c=t=>!("number"==typeof e.settings.maxOptions&&r.children.length>=e.settings.maxOptions)&&!(!(t in o)||!o[t]),d=(t,i)=>e.items.indexOf(i)>=0||l.indexOf(i)>=0;e.setNextUrl=(e,t)=>{o[e]=t},e.getUrl=t=>{if(t in o){const e=o[t];return o[t]=!1,e}return e.clearPagination(),e.settings.firstUrl.call(e,t)},e.clearPagination=()=>{o={}},e.hook("instead","clearActiveOption",()=>{if(!a)return i.call(e)}),e.hook("instead","canLoad",i=>i in o?c(i):t.call(e,i)),e.hook("instead","loadCallback",(t,i)=>{if(a){if(s){const i=t[0];void 0!==i&&(s.dataset.value=i[e.settings.valueField])}}else e.clearOptions(d);n.call(e,t,i),a=!1}),e.hook("after","refreshOptions",()=>{const t=e.lastValue;var i;c(t)?(i=e.render("loading_more",{query:t}))&&(i.setAttribute("data-selectable",""),s=i):t in o&&!r.querySelector(".no-results")&&(i=e.render("no_more_results",{query:t})),i&&(((e,...t)=>{var i=Ze(t);(e=et(e)).map(e=>{i.map(t=>{e.classList.add(t)})})})(i,e.settings.optionClass),r.append(i))}),e.on("initialize",()=>{l=Object.keys(e.options),r=e.dropdown_content,e.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},e.settings.render),r.addEventListener("scroll",()=>{e.settings.shouldLoadMore.call(e)&&c(e.lastValue)&&(a||(a=!0,e.load.call(e,e.lastValue)))})})});class tt{constructor(e){this.datepicker=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initDatepicker(e)}),this.initDatepicker(e),!0}initDatepicker(e){const t=e.el.querySelectorAll("input[data-provide='datepicker']");t.length>=1&&this.datepicker.initDatepickers(Array.from(t),e)}}class it{constructor(e){this.nette=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initNetteForms(e)}),this.initNetteForms(e),!0}initNetteForms(e){var t,i;const n=null!==(i=null!==(t=this.nette)&&void 0!==t?t:w().Nette)&&void 0!==i?i:null;n&&e.el.querySelectorAll("form").forEach(e=>n.initForm(e))}}class nt{constructor(e){this.selectpicker=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initSelectpicker(e)}),this.initSelectpicker(e),!0}initSelectpicker(e){const t=e.el.querySelectorAll("select.selectpicker");t.length>=1&&this.selectpicker.initSelectpickers(Array.from(t),e)}}class rt{constructor(e){this.sortable=e}onDatagridInit(e){return e.ajax.addEventListener("before",e=>{}),this.sortable.initSortable(e),e.ajax.addEventListener("success",({detail:{payload:t}})=>{if(t._datagrid_sort){for(const i in t._datagrid_sort){const n=t._datagrid_sort[i],r=e.el.querySelector(`#datagrid-sort-${i}`);r&&(r.setAttribute("href",n),r.setAttribute("data-href",n))}this.sortable.initSortable(e)}if(t._datagrid_tree){const i=e.el.querySelector(`.datagrid-tree-item[data-id='${t._datagrid_tree}'] .datagrid-tree-item-children`);if(i&&t.snippets){i.classList.add("loaded");for(const e in t.snippets){const n=t.snippets[e],r=(new DOMParser).parseFromString(n,"text/html").firstElementChild;if(r){const t=document.createElement("div");t.id=e,t.classList.add("datagrid-tree-item"),t.setAttribute("data-id",e),r.hasAttribute("has-children")&&t.classList.add("has-children"),i.append(t)}}}this.sortable.initSortableTree(e)}}),!0}}class st{onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initPerPage(e),this.initChange(e)}),this.initPerPage(e),this.initChange(e),!0}initPerPage(e){e.el.querySelectorAll("select[data-autosubmit-per-page]").forEach(t=>{t.addEventListener("change",()=>{var i,n;let r=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("input[type=submit]");if(r||(r=null===(n=t.parentElement)||void 0===n?void 0:n.querySelector("button[type=submit]")),!(r instanceof HTMLElement))return;const s=r.closest("form");s&&e.ajax.submitForm(s)})})}initChange(e){e.el.querySelectorAll("[data-autosubmit]").forEach(t=>{const i=t.closest("form");i&&"true"!==t.dataset.listenersAttached&&(t.dataset.listenersAttached="true",t instanceof HTMLSelectElement?t.addEventListener("change",()=>e.ajax.submitForm(i)):t instanceof HTMLInputElement&&(t.hasAttribute("data-autosubmit-change")&&t.addEventListener("change",E(()=>e.ajax.submitForm(i))),t.addEventListener("keyup",E(t=>{if(_(t)||!function(e,t,i){const n=1===e.key.length?e.key.charCodeAt(0):0;return n>=t&&n<=i}(t,9,40)&&!function(e){return 2===e.key.length&&e.key.startsWith("F")}(t))return e.ajax.submitForm(i)}))))})}}class ot{onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.init(e)}),this.init(e)}init(e){let t=null;e.el.addEventListener("click",e=>{if(e.target instanceof HTMLElement&&e.target.classList.contains("col-checkbox")&&(t=e.target,e.shiftKey&&t)){const e=t.closest("tr");if(!e)return;const i=t.closest("tr");if(!i)return;const n=i.closest("tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr")),[s,o]=[i.rowIndex,e.rowIndex].sort();r.slice(s,o+1).forEach(e=>{const t=e.querySelector('.col-checkbox input[type="checkbox"]');t&&(t.checked=!0)})}});const i=Array.from(e.el.querySelectorAll(`input[data-check='${e.name}']:not([data-check-all])`)),n=e.el.querySelector(`input[data-check='${e.name}'][data-check-all]`),r=e.el.querySelector("select[name='group_action[group_action]']"),s=document.querySelectorAll(".row-group-actions *[type='submit']"),o=document.querySelector(".datagrid-selected-rows-count");return[...i,n].forEach(t=>{t&&t.addEventListener("change",()=>{if(t.hasAttribute("data-check-all")){if(e.name!==t.getAttribute("data-check-all"))return;if(i.forEach(e=>e.checked=t.checked),s.forEach(e=>e.disabled=!t.checked),r&&(r.disabled=!t.checked),o){const e=i.length;o.innerText=`${t.checked?e:0}/${e}`}return}n&&(n.checked=i.every(e=>e.checked));const a=i.filter(e=>e.checked),l=a.length>=1;s.forEach(e=>e.disabled=!l),r&&(r.disabled=!l),o&&(o.innerText=`${a.length}/${i.length}`)})}),!0}}const at="data-datagrid-confirm";class lt{onDatagridInit(e){return e.el.querySelectorAll(`[${at}]:not(.ajax)`).forEach(t=>t.addEventListener("click",t=>this.confirmEventHandler.bind(e)(t.target,t))),e.ajax.addEventListener("interact",t=>this.confirmEventHandler.bind(e)(t.detail.element,t)),!0}confirmEventHandler(e,t){var i;const n=null===(i=e.closest("a"))||void 0===i?void 0:i.getAttribute(at);n&&(window.confirm.bind(window)(n)||(t.stopPropagation(),t.preventDefault()))}}const ct="data-datagrid-editable-url";class dt{onDatagridInit(e){return e.ajax.addEventListener("success",t=>{this.initEditableCells(e)}),this.initEditableCells(e),!0}initEditableCells(e){e.el.querySelectorAll(`[${ct}]`).forEach(t=>{t.addEventListener("click",i=>{var n,r,s,o;if(!(t instanceof HTMLAnchorElement||t.classList.contains("datagrid-inline-edit")||t.classList.contains("editing"))){t.classList.add("editing");const i=t.innerHTML.replace(/<\/?br>/g,"\n"),a=null!==(n=t.getAttribute("data-datagrid-editable-value"))&&void 0!==n?n:i;t.setAttribute("originalValue",i),t.setAttribute("valueToEdit",a);const l=null!==(r=t.getAttribute("data-datagrid-editable-type"))&&void 0!==r?r:"text";let c;switch(l){case"textarea":t.innerHTML=`<textarea rows="${function(e){var t;const i=e.style.padding?parseInt(e.style.padding.replace(/[^-\d\.]/g,""),10):0,n=e.getBoundingClientRect().height,r=Math.round(parseFloat(null!==(t=e.style.lineHeight)&&void 0!==t?t:"0"));return Math.round((n-2*i)/r)}(t)}">${a}</textarea>`,c=t.querySelector("textarea");break;case"select":c=t.querySelector(null!==(s=t.getAttribute("data-datagrid-editable-element"))&&void 0!==s?s:""),c.querySelectorAll(`option[value='${a}']`).forEach(e=>e.setAttribute("selected","true"));break;default:t.innerHTML=`<input type='${l}' />`,c=t.querySelector("input"),c.setAttribute("value",a.trim())}const d=JSON.parse(null!==(o=t.getAttribute("datagrid-editable-attrs"))&&void 0!==o?o:"{}");for(const e in d){const t=d[e];c.setAttribute(e,t)}t.classList.remove("edited");const u=async n=>{var r,s,o;let c=n.value;if(c!==a)try{const i=await e.ajax.request({url:null!==(r=t.getAttribute(ct))&&void 0!==r?r:"",method:"POST",data:{value:c}});"select"===l?t.innerHTML=null!==(o=null===(s=t.querySelector(`option[value='${c}']`))||void 0===s?void 0:s.innerHTML)&&void 0!==o?o:"":(i._datagrid_editable_new_value&&(c=i._datagrid_editable_new_value),t.innerHTML=c),t.classList.add("edited")}catch(e){t.innerHTML=i,t.classList.add("edited-error")}else t.innerHTML=i;t.classList.remove("editing")};t.querySelectorAll("input, textarea, select").forEach(e=>{e.addEventListener("blur",()=>u(e)),e.addEventListener("keydown",n=>{if(_(n))return n.stopPropagation(),n.preventDefault(),u(e);(function(e){return"Escape"===e.key})(n)&&(n.stopPropagation(),n.preventDefault(),t.classList.remove("editing"),t.innerHTML=i)}),e instanceof HTMLSelectElement&&e.addEventListener("change",()=>u(e))})}})})}}class ut{onInit(e){}onDatagridInit(e){return e.ajax.addEventListener("success",({detail:{payload:t}})=>{var i,n;if(t._datagrid_name&&t._datagrid_name===e.name){if(t._datagrid_inline_edited||t._datagrid_inline_edit_cancel){const i=e.el.querySelector(".datagrid-inline-edit-trigger");if(t._datagrid_inline_edited){e.el.querySelectorAll(`tr[data-id='${t._datagrid_inline_edited}'] > td`).forEach(e=>{e.classList.add("edited")})}return void(null==i||i.classList.remove("hidden"))}if(t._datagrid_inline_adding){const t=e.el.querySelector(".datagrid-row-inline-add");t&&(t.classList.remove("datagrid-row-inline-add-hidden"),null===(i=t.querySelector("input:not([readonly]), textarea:not([readonly])"))||void 0===i||i.focus())}t._datagrid_inline_editing&&(null===(n=e.el.querySelector(".datagrid-inline-edit-trigger"))||void 0===n||n.classList.add("hidden")),e.el.querySelectorAll(".datagrid-inline-edit input").forEach(e=>{e.addEventListener("keydown",t=>{var i,n;if(_(t))return t.stopPropagation(),t.preventDefault(),null===(n=null===(i=e.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_edit[submit]']"))||void 0===n?void 0:n.click()})}),e.el.querySelectorAll(".datagrid-inline-add input").forEach(e=>{e.addEventListener("keydown",t=>{var i,n;if(_(t))return t.stopPropagation(),t.preventDefault(),null===(n=null===(i=e.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_add[submit]']"))||void 0===n?void 0:n.click()})}),e.el.querySelectorAll("[data-datagrid-cancel-inline-add]").forEach(e=>{e.addEventListener("mouseup",t=>{if(0===t.button){t.stopPropagation(),t.preventDefault();const i=e.closest(".datagrid-row-inline-add");i&&i.classList.add("datagrid-row-inline-add-hidden")}})})}}),!0}}class ht{onDatagridInit(e){return e.el.querySelectorAll("[data-toggle-detail-grid]").forEach(t=>{if(t.getAttribute("data-toggle-detail-grid")!==e.name)return;const i=t.getAttribute("data-toggle-detail");t.addEventListener("click",n=>{const r=e.el.querySelector(`.item-detail-${e.name}-id-${i}`);t.closest("tr"),r&&(r.classList.add("datagrid--content-row"),r.classList.toggle("is-active")),e.ajax.addEventListener("before",t=>{t.detail.params.url.includes(`do=${e.name}-getItemDetail`)&&t.detail.params.url.includes(`grid-id=${i}`)&&(t.stopPropagation(),t.preventDefault())})})}),e.ajax.addEventListener("success",({detail:{payload:t}})=>{var i;t._datagrid_redraw_item_id&&t._datagrid_redraw_item_class&&(null===(i=e.el.querySelector(`tr[data-id='${t._datagrid_redraw_item_id}']`))||void 0===i||i.setAttribute("class",t._datagrid_redraw_item_class))}),!0}}class pt{onDatagridInit(e){return e.ajax.addEventListener("before",e=>{}),e.ajax.addEventListener("success",({detail:{payload:e}})=>{var t,i;if(e._datagrid_tree){const n=e._datagrid_tree,r=document.querySelector(`.datagrid-tree-item[data-id="${n}"]`),s=document.querySelector(`.datagrid-tree-item[data-id="${n}"] .datagrid-tree-item-children`);if(s){if(s.classList.contains("showed")){if(s.innerHTML="",s.classList.remove("showed"),r){const e=r.querySelector("a.chevron");e&&(e.style.transform="rotate(0deg)")}return}if(s.classList.add("showed"),r){const e=r.querySelector("a.chevron");e&&(e.style.transform="rotate(90deg)")}const n=e.snippets;for(const e in n){const r=n[e],o=(new DOMParser).parseFromString(r,"text/html").querySelector("[data-id]"),a=null!==(t=null==o?void 0:o.getAttribute("data-id"))&&void 0!==t?t:"",l=`\n<div class="datagrid-tree-item" class='${null!==(i=null==o?void 0:o.hasAttribute("data-has-children"))&&void 0!==i&&i?"has-children":""}' id="${e}" data-id="${a}">${r}</div>`;s.innerHTML=l}}}}),!0}}
8
8
  /**!
9
9
  * Sortable 1.15.6
10
10
  * @author RubaXa <trash@rubaxa.org>
11
11
  * @author owenm <owen23355@gmail.com>
12
12
  * @license MIT
13
- */function pt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function ft(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(i),!0).forEach(function(t){mt(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):pt(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function gt(e){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(e)}function mt(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function vt(){return vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},vt.apply(this,arguments)}function bt(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function yt(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var _t=yt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),wt=yt(/Edge/i),Et=yt(/firefox/i),At=yt(/safari/i)&&!yt(/chrome/i)&&!yt(/android/i),St=yt(/iP(ad|od|hone)/i),kt=yt(/chrome/i)&&yt(/android/i),Ot={capture:!1,passive:!1};function Ct(e,t,i){e.addEventListener(t,i,!_t&&Ot)}function Dt(e,t,i){e.removeEventListener(t,i,!_t&&Ot)}function xt(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Tt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Lt(e,t,i,n){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&xt(e,t):xt(e,t))||n&&e===i)return e;if(e===i)break}while(e=Tt(e))}return null}var It,Mt=/\s+/g;function Ft(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(Mt," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(Mt," ")}}function Nt(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=i+("string"==typeof i?"":"px")}}function jt(e,t){var i="";if("string"==typeof e)i=e;else do{var n=Nt(e,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function Pt(e,t,i){if(e){var n=e.getElementsByTagName(t),r=0,s=n.length;if(i)for(;r<s;r++)i(n[r],r);return n}return[]}function $t(){var e=document.scrollingElement;return e||document.documentElement}function Ht(e,t,i,n,r){if(e.getBoundingClientRect||e===window){var s,o,a,l,c,d,u;if(e!==window&&e.parentNode&&e!==$t()?(o=(s=e.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,u=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||i)&&e!==window&&(r=r||e.parentNode,!_t))do{if(r&&r.getBoundingClientRect&&("none"!==Nt(r,"transform")||i&&"static"!==Nt(r,"position"))){var h=r.getBoundingClientRect();o-=h.top+parseInt(Nt(r,"border-top-width")),a-=h.left+parseInt(Nt(r,"border-left-width")),l=o+s.height,c=a+s.width;break}}while(r=r.parentNode);if(n&&e!==window){var p=jt(r||e),f=p&&p.a,g=p&&p.d;p&&(l=(o/=g)+(d/=g),c=(a/=f)+(u/=f))}return{top:o,left:a,bottom:l,right:c,width:u,height:d}}}function qt(e,t,i){for(var n=Wt(e,!0),r=Ht(e)[t];n;){if(!(r>=Ht(n)[i]))return n;if(n===$t())break;n=Wt(n,!1)}return!1}function Rt(e,t,i,n){for(var r=0,s=0,o=e.children;s<o.length;){if("none"!==o[s].style.display&&o[s]!==Xi.ghost&&(n||o[s]!==Xi.dragged)&&Lt(o[s],i.draggable,e,!1)){if(r===t)return o[s];r++}s++}return null}function Bt(e,t){for(var i=e.lastElementChild;i&&(i===Xi.ghost||"none"===Nt(i,"display")||t&&!xt(i,t));)i=i.previousElementSibling;return i||null}function Vt(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Xi.clone||t&&!xt(e,t)||i++;return i}function zt(e){var t=0,i=0,n=$t();if(e)do{var r=jt(e),s=r.a,o=r.d;t+=e.scrollLeft*s,i+=e.scrollTop*o}while(e!==n&&(e=e.parentNode));return[t,i]}function Wt(e,t){if(!e||!e.getBoundingClientRect)return $t();var i=e,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=Nt(i);if(i.clientWidth<i.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!i.getBoundingClientRect||i===document.body)return $t();if(n||t)return i;n=!0}}}while(i=i.parentNode);return $t()}function Yt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Kt(e,t){return function(){if(!It){var i=arguments;1===i.length?e.call(this,i[0]):e.apply(this,i),It=setTimeout(function(){It=void 0},t)}}}function Ut(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function Xt(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function Qt(e,t,i){var n={};return Array.from(e.children).forEach(function(r){var s,o,a,l;if(Lt(r,t.draggable,e,!1)&&!r.animated&&r!==i){var c=Ht(r);n.left=Math.min(null!==(s=n.left)&&void 0!==s?s:1/0,c.left),n.top=Math.min(null!==(o=n.top)&&void 0!==o?o:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(l=n.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Gt="Sortable"+(new Date).getTime();function Jt(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==Nt(e,"display")&&e!==Xi.ghost){t.push({target:e,rect:Ht(e)});var i=ft({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=jt(e,!0);n&&(i.top-=n.f,i.left-=n.e)}e.fromRect=i}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var i in e)if(e.hasOwnProperty(i))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[i][n])return Number(i);return-1}(t,{target:e}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof i&&i());var r=!1,s=0;t.forEach(function(e){var t=0,i=e.target,o=i.fromRect,a=Ht(i),l=i.prevFromRect,c=i.prevToRect,d=e.rect,u=jt(i,!0);u&&(a.top-=u.f,a.left-=u.e),i.toRect=a,i.thisAnimationDuration&&Yt(l,a)&&!Yt(o,a)&&(d.top-a.top)/(d.left-a.left)===(o.top-a.top)/(o.left-a.left)&&(t=function(e,t,i,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*n.animation}(d,l,c,n.options)),Yt(a,o)||(i.prevFromRect=o,i.prevToRect=a,t||(t=n.options.animation),n.animate(i,d,a,t)),t&&(r=!0,s=Math.max(s,t),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},t),i.thisAnimationDuration=t)}),clearTimeout(e),r?e=setTimeout(function(){"function"==typeof i&&i()},s):"function"==typeof i&&i(),t=[]},animate:function(e,t,i,n){if(n){Nt(e,"transition",""),Nt(e,"transform","");var r=jt(this.el),s=r&&r.a,o=r&&r.d,a=(t.left-i.left)/(s||1),l=(t.top-i.top)/(o||1);e.animatingX=!!a,e.animatingY=!!l,Nt(e,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),Nt(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),Nt(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){Nt(e,"transition",""),Nt(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},n)}}}}var Zt=[],ei={initializeByDefault:!0},ti={mount:function(e){for(var t in ei)ei.hasOwnProperty(t)&&!(t in e)&&(e[t]=ei[t]);Zt.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Zt.push(e)},pluginEvent:function(e,t,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var r=e+"Global";Zt.forEach(function(n){t[n.pluginName]&&(t[n.pluginName][r]&&t[n.pluginName][r](ft({sortable:t},i)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](ft({sortable:t},i)))})},initializePlugins:function(e,t,i,n){for(var r in Zt.forEach(function(n){var r=n.pluginName;if(e.options[r]||n.initializeByDefault){var s=new n(e,t,e.options);s.sortable=e,s.options=e.options,e[r]=s,vt(i,s.defaults)}}),e.options)if(e.options.hasOwnProperty(r)){var s=this.modifyOption(e,r,e.options[r]);void 0!==s&&(e.options[r]=s)}},getEventProperties:function(e,t){var i={};return Zt.forEach(function(n){"function"==typeof n.eventProperties&&vt(i,n.eventProperties.call(t[n.pluginName],e))}),i},modifyOption:function(e,t,i){var n;return Zt.forEach(function(r){e[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[t]&&(n=r.optionListeners[t].call(e[r.pluginName],i))}),n}};var ii=["evt"],ni=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=bt(i,ii);ti.pluginEvent.bind(Xi)(e,t,ft({dragEl:si,parentEl:oi,ghostEl:ai,rootEl:li,nextEl:ci,lastDownEl:di,cloneEl:ui,cloneHidden:hi,dragStarted:ki,putSortable:bi,activeSortable:Xi.active,originalEvent:n,oldIndex:pi,oldDraggableIndex:gi,newIndex:fi,newDraggableIndex:mi,hideGhostForTarget:Wi,unhideGhostForTarget:Yi,cloneNowHidden:function(){hi=!0},cloneNowShown:function(){hi=!1},dispatchSortableEvent:function(e){ri({sortable:t,name:e,originalEvent:n})}},r))};function ri(e){!function(e){var t=e.sortable,i=e.rootEl,n=e.name,r=e.targetEl,s=e.cloneEl,o=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||i&&i[Gt]){var g,m=t.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||_t||wt?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=o||i,g.from=a||i,g.item=r||i,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var b=ft(ft({},f),ti.getEventProperties(n,t));for(var y in b)g[y]=b[y];i&&i.dispatchEvent(g),m[v]&&m[v].call(t,g)}}(ft({putSortable:bi,cloneEl:ui,targetEl:si,rootEl:li,oldIndex:pi,oldDraggableIndex:gi,newIndex:fi,newDraggableIndex:mi},e))}var si,oi,ai,li,ci,di,ui,hi,pi,fi,gi,mi,vi,bi,yi,_i,wi,Ei,Ai,Si,ki,Oi,Ci,Di,xi,Ti=!1,Li=!1,Ii=[],Mi=!1,Fi=!1,Ni=[],ji=!1,Pi=[],$i="undefined"!=typeof document,Hi=St,qi=wt||_t?"cssFloat":"float",Ri=$i&&!kt&&!St&&"draggable"in document.createElement("div"),Bi=function(){if($i){if(_t)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Vi=function(e,t){var i=Nt(e),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Rt(e,0,t),s=Rt(e,1,t),o=r&&Nt(r),a=s&&Nt(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Ht(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ht(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var d="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[qi]||s&&"none"===i[qi]&&l+c>n)?"vertical":"horizontal"},zi=function(e){function t(e,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==e&&(i||a))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"==typeof e)return t(e(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},n=e.group;n&&"object"==gt(n)||(n={name:n}),i.name=n.name,i.checkPull=t(n.pull,!0),i.checkPut=t(n.put),i.revertClone=n.revertClone,e.group=i},Wi=function(){!Bi&&ai&&Nt(ai,"display","none")},Yi=function(){!Bi&&ai&&Nt(ai,"display","")};$i&&!kt&&document.addEventListener("click",function(e){if(Li)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Li=!1,!1},!0);var Ki=function(e){if(si){e=e.touches?e.touches[0]:e;var t=(r=e.clientX,s=e.clientY,Ii.some(function(e){var t=e[Gt].options.emptyInsertThreshold;if(t&&!Bt(e)){var i=Ht(e),n=r>=i.left-t&&r<=i.right+t,a=s>=i.top-t&&s<=i.bottom+t;return n&&a?o=e:void 0}}),o);if(t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[Gt]._onDragOver(i)}}var r,s,o},Ui=function(e){si&&si.parentNode[Gt]._isOutsideThisEl(e.target)};function Xi(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=vt({},t),e[Gt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Vi(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Xi.supportPointer&&"PointerEvent"in window&&(!At||St),emptyInsertThreshold:5};for(var n in ti.initializePlugins(this,e,i),i)!(n in t)&&(t[n]=i[n]);for(var r in zi(t),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&Ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ct(e,"pointerdown",this._onTapStart):(Ct(e,"mousedown",this._onTapStart),Ct(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ct(e,"dragover",this),Ct(e,"dragenter",this)),Ii.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),vt(this,Jt())}function Qi(e,t,i,n,r,s,o,a){var l,c,d=e[Gt],u=d.options.onMove;return!window.CustomEvent||_t||wt?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=n,l.related=r||t,l.relatedRect=s||Ht(t),l.willInsertAfter=a,l.originalEvent=o,e.dispatchEvent(l),u&&(c=u.call(d,l,o)),c}function Gi(e){e.draggable=!1}function Ji(){ji=!1}function Zi(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;i--;)n+=t.charCodeAt(i);return n.toString(36)}function en(e){return setTimeout(e,0)}function tn(e){return clearTimeout(e)}Xi.prototype={constructor:Xi,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Oi=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,si):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,i=this.el,n=this.options,r=n.preventOnFilter,s=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=n.filter;if(function(e){Pi.length=0;var t=e.getElementsByTagName("input"),i=t.length;for(;i--;){var n=t[i];n.checked&&Pi.push(n)}}(i),!si&&!(/mousedown|pointerdown/.test(s)&&0!==e.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!At||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Lt(a,n.draggable,i,!1))&&a.animated||di===a)){if(pi=Vt(a),gi=Vt(a,n.draggable),"function"==typeof c){if(c.call(this,e,a,this))return ri({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),ni("filter",t,{evt:e}),void(r&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=Lt(l,n.trim(),i,!1))return ri({sortable:t,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),ni("filter",t,{evt:e}),!0})))return void(r&&e.preventDefault());n.handle&&!Lt(l,n.handle,i,!1)||this._prepareDragStart(e,o,a)}}},_prepareDragStart:function(e,t,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!si&&i.parentNode===s){var l=Ht(i);if(li=s,oi=(si=i).parentNode,ci=si.nextSibling,di=i,vi=o.group,Xi.dragged=si,yi={target:si,clientX:(t||e).clientX,clientY:(t||e).clientY},Ai=yi.clientX-l.left,Si=yi.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,si.style["will-change"]="all",n=function(){ni("delayEnded",r,{evt:e}),Xi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Et&&r.nativeDraggable&&(si.draggable=!0),r._triggerDragStart(e,t),ri({sortable:r,name:"choose",originalEvent:e}),Ft(si,o.chosenClass,!0))},o.ignore.split(",").forEach(function(e){Pt(si,e.trim(),Gi)}),Ct(a,"dragover",Ki),Ct(a,"mousemove",Ki),Ct(a,"touchmove",Ki),o.supportPointer?(Ct(a,"pointerup",r._onDrop),!this.nativeDraggable&&Ct(a,"pointercancel",r._onDrop)):(Ct(a,"mouseup",r._onDrop),Ct(a,"touchend",r._onDrop),Ct(a,"touchcancel",r._onDrop)),Et&&this.nativeDraggable&&(this.options.touchStartThreshold=4,si.draggable=!0),ni("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(wt||_t))n();else{if(Xi.eventCanceled)return void this._onDrop();o.supportPointer?(Ct(a,"pointerup",r._disableDelayedDrag),Ct(a,"pointercancel",r._disableDelayedDrag)):(Ct(a,"mouseup",r._disableDelayedDrag),Ct(a,"touchend",r._disableDelayedDrag),Ct(a,"touchcancel",r._disableDelayedDrag)),Ct(a,"mousemove",r._delayedDragTouchMoveHandler),Ct(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Ct(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){si&&Gi(si),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Dt(e,"mouseup",this._disableDelayedDrag),Dt(e,"touchend",this._disableDelayedDrag),Dt(e,"touchcancel",this._disableDelayedDrag),Dt(e,"pointerup",this._disableDelayedDrag),Dt(e,"pointercancel",this._disableDelayedDrag),Dt(e,"mousemove",this._delayedDragTouchMoveHandler),Dt(e,"touchmove",this._delayedDragTouchMoveHandler),Dt(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?Ct(document,"pointermove",this._onTouchMove):Ct(document,t?"touchmove":"mousemove",this._onTouchMove):(Ct(si,"dragend",this),Ct(li,"dragstart",this._onDragStart));try{document.selection?en(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(Ti=!1,li&&si){ni("dragStarted",this,{evt:t}),this.nativeDraggable&&Ct(document,"dragover",Ui);var i=this.options;!e&&Ft(si,i.dragClass,!1),Ft(si,i.ghostClass,!0),Xi.active=this,e&&this._appendGhost(),ri({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(_i){this._lastX=_i.clientX,this._lastY=_i.clientY,Wi();for(var e=document.elementFromPoint(_i.clientX,_i.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(_i.clientX,_i.clientY))!==t;)t=e;if(si.parentNode[Gt]._isOutsideThisEl(e),t)do{if(t[Gt]){if(t[Gt]._onDragOver({clientX:_i.clientX,clientY:_i.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=Tt(t));Yi()}},_onTouchMove:function(e){if(yi){var t=this.options,i=t.fallbackTolerance,n=t.fallbackOffset,r=e.touches?e.touches[0]:e,s=ai&&jt(ai,!0),o=ai&&s&&s.a,a=ai&&s&&s.d,l=Hi&&xi&&zt(xi),c=(r.clientX-yi.clientX+n.x)/(o||1)+(l?l[0]-Ni[0]:0)/(o||1),d=(r.clientY-yi.clientY+n.y)/(a||1)+(l?l[1]-Ni[1]:0)/(a||1);if(!Xi.active&&!Ti){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}if(ai){s?(s.e+=c-(wi||0),s.f+=d-(Ei||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");Nt(ai,"webkitTransform",u),Nt(ai,"mozTransform",u),Nt(ai,"msTransform",u),Nt(ai,"transform",u),wi=c,Ei=d,_i=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ai){var e=this.options.fallbackOnBody?document.body:li,t=Ht(si,!0,Hi,!0,e),i=this.options;if(Hi){for(xi=e;"static"===Nt(xi,"position")&&"none"===Nt(xi,"transform")&&xi!==document;)xi=xi.parentNode;xi!==document.body&&xi!==document.documentElement?(xi===document&&(xi=$t()),t.top+=xi.scrollTop,t.left+=xi.scrollLeft):xi=$t(),Ni=zt(xi)}Ft(ai=si.cloneNode(!0),i.ghostClass,!1),Ft(ai,i.fallbackClass,!0),Ft(ai,i.dragClass,!0),Nt(ai,"transition",""),Nt(ai,"transform",""),Nt(ai,"box-sizing","border-box"),Nt(ai,"margin",0),Nt(ai,"top",t.top),Nt(ai,"left",t.left),Nt(ai,"width",t.width),Nt(ai,"height",t.height),Nt(ai,"opacity","0.8"),Nt(ai,"position",Hi?"absolute":"fixed"),Nt(ai,"zIndex","100000"),Nt(ai,"pointerEvents","none"),Xi.ghost=ai,e.appendChild(ai),Nt(ai,"transform-origin",Ai/parseInt(ai.style.width)*100+"% "+Si/parseInt(ai.style.height)*100+"%")}},_onDragStart:function(e,t){var i=this,n=e.dataTransfer,r=i.options;ni("dragStart",this,{evt:e}),Xi.eventCanceled?this._onDrop():(ni("setupClone",this),Xi.eventCanceled||((ui=Xt(si)).removeAttribute("id"),ui.draggable=!1,ui.style["will-change"]="",this._hideClone(),Ft(ui,this.options.chosenClass,!1),Xi.clone=ui),i.cloneId=en(function(){ni("clone",i),Xi.eventCanceled||(i.options.removeCloneOnHide||li.insertBefore(ui,si),i._hideClone(),ri({sortable:i,name:"clone"}))}),!t&&Ft(si,r.dragClass,!0),t?(Li=!0,i._loopId=setInterval(i._emulateDragOver,50)):(Dt(document,"mouseup",i._onDrop),Dt(document,"touchend",i._onDrop),Dt(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(i,n,si)),Ct(document,"drop",i),Nt(si,"transform","translateZ(0)")),Ti=!0,i._dragStartId=en(i._dragStarted.bind(i,t,e)),Ct(document,"selectstart",i),ki=!0,window.getSelection().removeAllRanges(),At&&Nt(document.body,"user-select","none"))},_onDragOver:function(e){var t,i,n,r,s=this.el,o=e.target,a=this.options,l=a.group,c=Xi.active,d=vi===l,u=a.sort,h=bi||c,p=this,f=!1;if(!ji){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),o=Lt(o,a.draggable,s,!0),x("dragOver"),Xi.eventCanceled)return f;if(si.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return L(!1);if(Li=!1,c&&!a.disabled&&(d?u||(n=oi!==li):bi===this||(this.lastPutMode=vi.checkPull(this,c,si,e))&&l.checkPut(this,c,si,e))){if(r="vertical"===this._getDirection(e,o),t=Ht(si),x("dragOverValid"),Xi.eventCanceled)return f;if(n)return oi=li,T(),this._hideClone(),x("revert"),Xi.eventCanceled||(ci?li.insertBefore(si,ci):li.appendChild(si)),L(!0);var g=Bt(s,a.draggable);if(!g||function(e,t,i){var n=Ht(Bt(i.el,i.options.draggable)),r=Qt(i.el,i.options,ai),s=10;return t?e.clientX>r.right+s||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>r.bottom+s||e.clientX>n.right&&e.clientY>n.top}(e,r,this)&&!g.animated){if(g===si)return L(!1);if(g&&s===e.target&&(o=g),o&&(i=Ht(o)),!1!==Qi(li,s,si,t,o,i,e,!!o))return T(),g&&g.nextSibling?s.insertBefore(si,g.nextSibling):s.appendChild(si),oi=s,I(),L(!0)}else if(g&&function(e,t,i){var n=Ht(Rt(i.el,0,i.options,!0)),r=Qt(i.el,i.options,ai),s=10;return t?e.clientX<r.left-s||e.clientY<n.top&&e.clientX<n.right:e.clientY<r.top-s||e.clientY<n.bottom&&e.clientX<n.left}(e,r,this)){var m=Rt(s,0,a,!0);if(m===si)return L(!1);if(i=Ht(o=m),!1!==Qi(li,s,si,t,o,i,e,!1))return T(),s.insertBefore(si,m),oi=s,I(),L(!0)}else if(o.parentNode===s){i=Ht(o);var v,b,y,_=si.parentNode!==s,w=!function(e,t,i){var n=i?e.left:e.top,r=i?e.right:e.bottom,s=i?e.width:e.height,o=i?t.left:t.top,a=i?t.right:t.bottom,l=i?t.width:t.height;return n===o||r===a||n+s/2===o+l/2}(si.animated&&si.toRect||t,o.animated&&o.toRect||i,r),E=r?"top":"left",A=qt(o,"top","top")||qt(si,"top","top"),S=A?A.scrollTop:void 0;if(Oi!==o&&(b=i[E],Mi=!1,Fi=!w&&a.invertSwap||_),v=function(e,t,i,n,r,s,o,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,h=!1;if(!o)if(a&&Di<c*r){if(!Mi&&(1===Ci?l>d+c*s/2:l<u-c*s/2)&&(Mi=!0),Mi)h=!0;else if(1===Ci?l<d+Di:l>u-Di)return-Ci}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return function(e){return Vt(si)<Vt(e)?1:-1}(t);if((h=h||o)&&(l<d+c*s/2||l>u-c*s/2))return l>d+c/2?1:-1;return 0}(e,o,i,r,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Fi,Oi===o),0!==v){var k=Vt(si);do{k-=v,y=oi.children[k]}while(y&&("none"===Nt(y,"display")||y===ai))}if(0===v||y===o)return L(!1);Oi=o,Ci=v;var O=o.nextElementSibling,C=!1,D=Qi(li,s,si,t,o,i,e,C=1===v);if(!1!==D)return 1!==D&&-1!==D||(C=1===D),ji=!0,setTimeout(Ji,30),T(),C&&!O?s.appendChild(si):o.parentNode.insertBefore(si,C?O:o),A&&Ut(A,0,S-A.scrollTop),oi=si.parentNode,void 0===b||Fi||(Di=Math.abs(b-Ht(o)[E])),I(),L(!0)}if(s.contains(si))return L(!1)}return!1}function x(a,l){ni(a,p,ft({evt:e,isOwner:d,axis:r?"vertical":"horizontal",revert:n,dragRect:t,targetRect:i,canSort:u,fromSortable:h,target:o,completed:L,onMove:function(i,n){return Qi(li,s,si,t,i,Ht(i),e,n)},changed:I},l))}function T(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function L(t){return x("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==h&&(Ft(si,bi?bi.options.ghostClass:c.options.ghostClass,!1),Ft(si,a.ghostClass,!0)),bi!==p&&p!==Xi.active?bi=p:p===Xi.active&&bi&&(bi=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===si&&!si.animated||o===s&&!o.animated)&&(Oi=null),a.dragoverBubble||e.rootEl||o===document||(si.parentNode[Gt]._isOutsideThisEl(e.target),!t&&Ki(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function I(){fi=Vt(si),mi=Vt(si,a.draggable),ri({sortable:p,name:"change",toEl:s,newIndex:fi,newDraggableIndex:mi,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Dt(document,"mousemove",this._onTouchMove),Dt(document,"touchmove",this._onTouchMove),Dt(document,"pointermove",this._onTouchMove),Dt(document,"dragover",Ki),Dt(document,"mousemove",Ki),Dt(document,"touchmove",Ki)},_offUpEvents:function(){var e=this.el.ownerDocument;Dt(e,"mouseup",this._onDrop),Dt(e,"touchend",this._onDrop),Dt(e,"pointerup",this._onDrop),Dt(e,"pointercancel",this._onDrop),Dt(e,"touchcancel",this._onDrop),Dt(document,"selectstart",this)},_onDrop:function(e){var t=this.el,i=this.options;fi=Vt(si),mi=Vt(si,i.draggable),ni("drop",this,{evt:e}),oi=si&&si.parentNode,fi=Vt(si),mi=Vt(si,i.draggable),Xi.eventCanceled||(Ti=!1,Fi=!1,Mi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),tn(this.cloneId),tn(this._dragStartId),this.nativeDraggable&&(Dt(document,"drop",this),Dt(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),At&&Nt(document.body,"user-select",""),Nt(si,"transform",""),e&&(ki&&(e.cancelable&&e.preventDefault(),!i.dropBubble&&e.stopPropagation()),ai&&ai.parentNode&&ai.parentNode.removeChild(ai),(li===oi||bi&&"clone"!==bi.lastPutMode)&&ui&&ui.parentNode&&ui.parentNode.removeChild(ui),si&&(this.nativeDraggable&&Dt(si,"dragend",this),Gi(si),si.style["will-change"]="",ki&&!Ti&&Ft(si,bi?bi.options.ghostClass:this.options.ghostClass,!1),Ft(si,this.options.chosenClass,!1),ri({sortable:this,name:"unchoose",toEl:oi,newIndex:null,newDraggableIndex:null,originalEvent:e}),li!==oi?(fi>=0&&(ri({rootEl:oi,name:"add",toEl:oi,fromEl:li,originalEvent:e}),ri({sortable:this,name:"remove",toEl:oi,originalEvent:e}),ri({rootEl:oi,name:"sort",toEl:oi,fromEl:li,originalEvent:e}),ri({sortable:this,name:"sort",toEl:oi,originalEvent:e})),bi&&bi.save()):fi!==pi&&fi>=0&&(ri({sortable:this,name:"update",toEl:oi,originalEvent:e}),ri({sortable:this,name:"sort",toEl:oi,originalEvent:e})),Xi.active&&(null!=fi&&-1!==fi||(fi=pi,mi=gi),ri({sortable:this,name:"end",toEl:oi,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){ni("nulling",this),li=si=oi=ai=ci=ui=di=hi=yi=_i=ki=fi=mi=pi=gi=Oi=Ci=bi=vi=Xi.dragged=Xi.ghost=Xi.clone=Xi.active=null,Pi.forEach(function(e){e.checked=!0}),Pi.length=wi=Ei=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":si&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],i=this.el.children,n=0,r=i.length,s=this.options;n<r;n++)Lt(e=i[n],s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||Zi(e));return t},sort:function(e,t){var i={},n=this.el;this.toArray().forEach(function(e,t){var r=n.children[t];Lt(r,this.options.draggable,n,!1)&&(i[e]=r)},this),t&&this.captureAnimationState(),e.forEach(function(e){i[e]&&(n.removeChild(i[e]),n.appendChild(i[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Lt(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var i=this.options;if(void 0===t)return i[e];var n=ti.modifyOption(this,e,t);i[e]=void 0!==n?n:t,"group"===e&&zi(i)},destroy:function(){ni("destroy",this);var e=this.el;e[Gt]=null,Dt(e,"mousedown",this._onTapStart),Dt(e,"touchstart",this._onTapStart),Dt(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Dt(e,"dragover",this),Dt(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ii.splice(Ii.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!hi){if(ni("hideClone",this),Xi.eventCanceled)return;Nt(ui,"display","none"),this.options.removeCloneOnHide&&ui.parentNode&&ui.parentNode.removeChild(ui),hi=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(hi){if(ni("showClone",this),Xi.eventCanceled)return;si.parentNode!=li||this.options.group.revertClone?ci?li.insertBefore(ui,ci):li.appendChild(ui):li.insertBefore(ui,si),this.options.group.revertClone&&this.animate(si,ui),Nt(ui,"display",""),hi=!1}}else this._hideClone()}},$i&&Ct(document,"touchmove",function(e){(Xi.active||Ti)&&e.cancelable&&e.preventDefault()}),Xi.utils={on:Ct,off:Dt,css:Nt,find:Pt,is:function(e,t){return!!Lt(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},throttle:Kt,closest:Lt,toggleClass:Ft,clone:Xt,index:Vt,nextTick:en,cancelNextTick:tn,detectDirection:Vi,getChild:Rt,expando:Gt},Xi.get=function(e){return e[Gt]},Xi.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Xi.utils=ft(ft({},Xi.utils),e.utils)),ti.mount(e)})},Xi.create=function(e,t){return new Xi(e,t)},Xi.version="1.15.6";var nn,rn,sn,on,an,ln,cn=[],dn=!1;function un(){cn.forEach(function(e){clearInterval(e.pid)}),cn=[]}function hn(){clearInterval(ln)}var pn=Kt(function(e,t,i,n){if(t.scroll){var r,s=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=$t(),d=!1;rn!==i&&(rn=i,un(),nn=t.scroll,r=t.scrollFn,!0===nn&&(nn=Wt(i,!0)));var u=0,h=nn;do{var p=h,f=Ht(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,_=f.height,w=void 0,E=void 0,A=p.scrollWidth,S=p.scrollHeight,k=Nt(p),O=p.scrollLeft,C=p.scrollTop;p===c?(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX||"visible"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY||"visible"===k.overflowY)):(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY));var D=w&&(Math.abs(b-s)<=a&&O+y<A)-(Math.abs(v-s)<=a&&!!O),x=E&&(Math.abs(m-o)<=a&&C+_<S)-(Math.abs(g-o)<=a&&!!C);if(!cn[u])for(var T=0;T<=u;T++)cn[T]||(cn[T]={});cn[u].vx==D&&cn[u].vy==x&&cn[u].el===p||(cn[u].el=p,cn[u].vx=D,cn[u].vy=x,clearInterval(cn[u].pid),0==D&&0==x||(d=!0,cn[u].pid=setInterval(function(){n&&0===this.layer&&Xi.active._onTouchMove(an);var t=cn[this.layer].vy?cn[this.layer].vy*l:0,i=cn[this.layer].vx?cn[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(Xi.dragged.parentNode[Gt],i,t,e,an,cn[this.layer].el)||Ut(cn[this.layer].el,i,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&h!==c&&(h=Wt(h,!1)));dn=d}},30),fn=function(e){var t=e.originalEvent,i=e.putSortable,n=e.dragEl,r=e.activeSortable,s=e.dispatchSortableEvent,o=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=i||r;o();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function gn(){}function mn(){}gn.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,i=e.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=Rt(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),i&&i.animateAll()},drop:fn},vt(gn,{pluginName:"revertOnSpill"}),mn.prototype={onSpill:function(e){var t=e.dragEl,i=e.putSortable||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:fn},vt(mn,{pluginName:"removeOnSpill"}),Xi.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?Ct(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ct(document,"pointermove",this._handleFallbackAutoScroll):t.touches?Ct(document,"touchmove",this._handleFallbackAutoScroll):Ct(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?Dt(document,"dragover",this._handleAutoScroll):(Dt(document,"pointermove",this._handleFallbackAutoScroll),Dt(document,"touchmove",this._handleFallbackAutoScroll),Dt(document,"mousemove",this._handleFallbackAutoScroll)),hn(),un(),clearTimeout(It),It=void 0},nulling:function(){an=rn=nn=dn=ln=sn=on=null,cn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var i=this,n=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=document.elementFromPoint(n,r);if(an=e,t||this.options.forceAutoScrollFallback||wt||_t||At){pn(e,this.options,s,t);var o=Wt(s,!0);!dn||ln&&n===sn&&r===on||(ln&&hn(),ln=setInterval(function(){var s=Wt(document.elementFromPoint(n,r),!0);s!==o&&(o=s,un()),pn(e,i.options,s,t)},10),sn=n,on=r)}else{if(!this.options.bubbleScroll||Wt(s,!0)===$t())return void un();pn(e,this.options,Wt(s,!1),!1)}}},vt(e,{pluginName:"scroll",initializeByDefault:!0})}),Xi.mount(mn,gn);class vn{initSortable(e){const t=e.el.querySelector("[data-sortable]");t&&new Xi(t,{handle:".handle-sort",draggable:"tr",sort:!0,direction:"vertical",async onEnd({item:t}){var i,n,r,s,o,a;const l=t.getAttribute("data-id");if(l){const c=null!==(n=null===(i=t.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-id"))&&void 0!==n?n:null,d=null!==(s=null===(r=t.nextElementSibling)||void 0===r?void 0:r.getAttribute("data-id"))&&void 0!==s?s:null,u=e.el.querySelector("tbody");if(u){let t=null!==(o=u.getAttribute("data-sortable-parent-path"))&&void 0!==o?o:"";t.length&&(t=`${t}-`);const i=null!==(a=u.getAttribute("data-sortable-url"))&&void 0!==a?a:"?do=sort",n={[`${t}item_id`]:l,...c?{[`${t}prev_id`]:c}:{},...d?{[`${t}next_id`]:d}:{}};return await e.ajax.request({method:"GET",url:i,data:n})}}}})}initSortableTree(e){e.el.querySelectorAll(".datagrid-tree-item-children").forEach(e=>{new Xi(e,{handle:".handle-sort",draggable:".datagrid-tree-item:not(.datagrid-tree-header)",async onEnd({item:e}){}})})}}class bn{constructor(e,t={}){this.select=e,this.opts=t}initSelectpickers(e){var t,i,n;const r=null!==(n=null!==(t=this.select)&&void 0!==t?t:null===(i=w())||void 0===i?void 0:i.TomSelect)&&void 0!==n?n:null;r&&e.forEach(e=>{e.hasAttribute("data-Tom-Initialised")||(e.setAttribute("data-Tom-Initialised","true"),new r(e,"function"==typeof this.opts?this.opts(e):this.opts))})}}function yn(e){return e[e.length-1]}function _n(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function wn(e,t){return e?e.split(t):[]}function En(e,t,i){return(void 0===t||e>=t)&&(void 0===i||e<=i)}function An(e,t,i){return e<t?t:e>i?i:e}function Sn(e,t,i={},n=0,r=""){r+=`<${Object.keys(i).reduce((e,t)=>{let r=i[t];return"function"==typeof r&&(r=r(n)),`${e} ${t}="${r}"`},e)}></${e}>`;const s=n+1;return s<t?Sn(e,t,i,s,r):r}function kn(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function On(e){return new Date(e).setHours(0,0,0,0)}function Cn(){return(new Date).setHours(0,0,0,0)}function Dn(...e){switch(e.length){case 0:return Cn();case 1:return On(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function xn(e,t){const i=new Date(e);return i.setDate(i.getDate()+t)}function Tn(e,t){const i=new Date(e),n=i.getMonth()+t;let r=n%12;r<0&&(r+=12);const s=i.setMonth(n);return i.getMonth()!==r?i.setDate(0):s}function Ln(e,t){const i=new Date(e),n=i.getMonth(),r=i.setFullYear(i.getFullYear()+t);return 1===n&&2===i.getMonth()?i.setDate(0):r}function In(e,t){return(e-t+7)%7}function Mn(e,t,i=0){const n=new Date(e).getDay();return xn(e,In(t,i)-In(n,i))}function Fn(e,t){return Math.round((e-t)/6048e5)+1}function Nn(e){const t=Mn(e,4,1);return Fn(t,Mn(new Date(t).setMonth(0,4),4,1))}function jn(e,t){const i=Mn(new Date(e).setMonth(0,1),t,t),n=Mn(e,t,t),r=Fn(n,i);if(r<53)return r;return n===Mn(new Date(e).setDate(32),t,t)?1:r}function Pn(e){return jn(e,0)}function $n(e){return jn(e,6)}function Hn(e,t){const i=new Date(e).getFullYear();return Math.floor(i/t)*t}function qn(e,t,i){if(1!==t&&2!==t)return e;const n=new Date(e);return 1===t?i?n.setMonth(n.getMonth()+1,0):n.setDate(1):i?n.setFullYear(n.getFullYear()+1,0,0):n.setMonth(0,1),n.setHours(0,0,0,0)}const Rn=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Bn=/[\s!-/:-@[-`{-~年月日]+/;let Vn={};const zn={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,i){const n=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),n=t=>t.toLowerCase().startsWith(e);if(r=i.monthsShort.findIndex(n),r<0&&(r=i.months.findIndex(n)),r<0)return NaN}return n.setMonth(r),n.getMonth()!==Yn(r)?n.setDate(0):n.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},Wn={d:e=>e.getDate(),dd:e=>Kn(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>Kn(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>Kn(e.getFullYear(),2).slice(-2),yyyy:e=>Kn(e.getFullYear(),4)};function Yn(e){return e>-1?e%12:Yn(e+12)}function Kn(e,t){return e.toString().padStart(t,"0")}function Un(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in Vn)return Vn[e];const t=e.split(Rn),i=e.match(new RegExp(Rn,"g"));if(0===t.length||!i)throw new Error("Invalid date format.");const n=i.map(e=>Wn[e]),r=Object.keys(zn).reduce((e,t)=>(i.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return Vn[e]={parser(e,t){const n=e.split(Bn).reduce((e,t,n)=>{if(t.length>0&&i[n]){const r=i[n][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,i)=>{const r=zn[i](e,n[i],t);return isNaN(r)?e:r},Cn())},formatter(e,i){let r=n.reduce((n,r,s)=>n+`${t[s]}${r(e,i)}`,"");return r+yn(t)}}}function Xn(e,t,i){if(e instanceof Date||"number"==typeof e){const t=On(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return Cn();if(t&&t.toValue){const n=t.toValue(e,t,i);return isNaN(n)?void 0:On(n)}return Un(t).parser(e,i)}}function Qn(e,t,i){if(isNaN(e)||!e&&0!==e)return"";const n="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(n,t,i):Un(t).formatter(n,i)}const Gn=document.createRange();function Jn(e){return Gn.createContextualFragment(e)}function Zn(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function er(e){return e.getRootNode().activeElement===e}function tr(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function ir(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function nr(e){e.firstChild&&(e.removeChild(e.firstChild),nr(e))}const rr=new WeakMap,{addEventListener:sr,removeEventListener:or}=EventTarget.prototype;function ar(e,t){let i=rr.get(e);i||(i=[],rr.set(e,i)),t.forEach(e=>{sr.call(...e),i.push(e)})}if(!Event.prototype.composedPath){const e=(t,i=[])=>{let n;return i.push(t),t.parentNode?n=t.parentNode:t.host?n=t.host:t.defaultView&&(n=t.defaultView),n?e(n,i):i};Event.prototype.composedPath=function(){return e(this.target)}}function lr(e,t,i){const[n,...r]=e;return t(n)?n:n!==i&&"HTML"!==n.tagName&&0!==r.length?lr(r,t,i):void 0}function cr(e,t){const i="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return lr(e.composedPath(),i,e.currentTarget)}var dr={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ur={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:hr,format:pr,weekStart:fr}=ur;function gr(e,t){return e.length<6&&t>=0&&t<7?_n(e,t):e}function mr(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return Nn;case 2:return Pn;case 3:return $n}}function vr(e,t,i){return t.weekStart=e,t.weekEnd=(e+6)%7,4===i&&(t.getWeekNumber=mr(4,e)),e}function br(e,t,i,n){const r=Xn(e,t,i);return void 0!==r?r:n}function yr(e,t,i=3){const n=parseInt(e,10);return n>=0&&n<=i?n:t}function _r(e,t,i,n=void 0){t in e&&(i in e||(e[i]=n?n(e[t]):e[t]),delete e[t])}function wr(e,t){const i=Object.assign({},e),n={},r=t.constructor.locales,s=!!t.rangeSideIndex;let{datesDisabled:o,format:a,language:l,locale:c,maxDate:d,maxView:u,minDate:h,pickLevel:p,startView:f,weekNumbers:g,weekStart:m}=t.config||{};if(_r(i,"calendarWeeks","weekNumbers",e=>e?1:0),_r(i,"clearBtn","clearButton"),_r(i,"todayBtn","todayButton"),_r(i,"todayBtnMode","todayButtonMode"),i.language){let e;if(i.language!==l&&(r[i.language]?e=i.language:(e=i.language.split("-")[0],r[e]||(e=!1))),delete i.language,e){l=n.language=e;const t=c||r[hr];c=Object.assign({format:pr,weekStart:fr},r[hr]),l!==hr&&Object.assign(c,r[l]),n.locale=c,a===t.format&&(a=n.format=c.format),m===t.weekStart&&(m=vr(c.weekStart,n,g))}}if(i.format){const e="function"==typeof i.format.toDisplay,t="function"==typeof i.format.toValue,r=Rn.test(i.format);(e&&t||r)&&(a=n.format=i.format),delete i.format}let v=p;"pickLevel"in i&&(v=yr(i.pickLevel,p,2),delete i.pickLevel),v!==p&&(v>p&&("minDate"in i||(i.minDate=h),"maxDate"in i||(i.maxDate=d)),o&&!i.datesDisabled&&(i.datesDisabled=[]),p=n.pickLevel=v);let b=h,y=d;if("minDate"in i){const e=Dn(0,0,1);b=null===i.minDate?e:br(i.minDate,a,c,b),b!==e&&(b=qn(b,p,!1)),delete i.minDate}if("maxDate"in i&&(y=null===i.maxDate?void 0:br(i.maxDate,a,c,y),void 0!==y&&(y=qn(y,p,!0)),delete i.maxDate),y<b?(h=n.minDate=y,d=n.maxDate=b):(h!==b&&(h=n.minDate=b),d!==y&&(d=n.maxDate=y)),i.datesDisabled){const e=i.datesDisabled;if("function"==typeof e)n.datesDisabled=null,n.checkDisabled=(t,i)=>e(new Date(t),i,s);else{const t=n.datesDisabled=e.reduce((e,t)=>{const i=Xn(t,a,c);return void 0!==i?_n(e,qn(i,p,s)):e},[]);n.checkDisabled=e=>t.includes(e)}delete i.datesDisabled}if("defaultViewDate"in i){const e=Xn(i.defaultViewDate,a,c);void 0!==e&&(n.defaultViewDate=e),delete i.defaultViewDate}if("weekStart"in i){const e=Number(i.weekStart)%7;isNaN(e)||(m=vr(e,n,g)),delete i.weekStart}if(i.daysOfWeekDisabled&&(n.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(gr,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(n.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(gr,[]),delete i.daysOfWeekHighlighted),"weekNumbers"in i){let e=i.weekNumbers;if(e){const t="function"==typeof e?(t,i)=>e(new Date(t),i):mr(e=parseInt(e,10),m);t&&(g=n.weekNumbers=e,n.getWeekNumber=t)}else g=n.weekNumbers=0,n.getWeekNumber=null;delete i.weekNumbers}if("maxNumberOfDates"in i){const e=parseInt(i.maxNumberOfDates,10);e>=0&&(n.maxNumberOfDates=e,n.multidate=1!==e),delete i.maxNumberOfDates}i.dateDelimiter&&(n.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let _=u;"maxView"in i&&(_=yr(i.maxView,u),delete i.maxView),_=p>_?p:_,_!==u&&(u=n.maxView=_);let w=f;if("startView"in i&&(w=yr(i.startView,w),delete i.startView),w<p?w=p:w>u&&(w=u),w!==f&&(n.startView=w),i.prevArrow){const e=Jn(i.prevArrow);e.childNodes.length>0&&(n.prevArrow=e.childNodes),delete i.prevArrow}if(i.nextArrow){const e=Jn(i.nextArrow);e.childNodes.length>0&&(n.nextArrow=e.childNodes),delete i.nextArrow}if("disableTouchKeyboard"in i&&(n.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const e=i.orientation.toLowerCase().split(/\s+/g);n.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete i.orientation}if("todayButtonMode"in i){switch(i.todayButtonMode){case 0:case 1:n.todayButtonMode=i.todayButtonMode}delete i.todayButtonMode}return Object.entries(i).forEach(([e,t])=>{void 0!==t&&e in ur&&(n[e]=t)}),n}const Er={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};const Ar=e=>e.map(e=>`<button type="button" class="%buttonClass% ${e}" tabindex="-1"></button>`).join("");var Sr=kn(`<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n ${Ar(["prev-button prev-btn","view-switch","next-button next-btn"])}\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n ${Ar(["today-button today-btn","clear-button clear-btn"])}\n </div>\n </div>\n </div>\n</div>`),kr=kn(`<div class="days">\n <div class="days-of-week">${Sn("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${Sn("span",42)}</div>\n</div>`),Or=kn(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${Sn("span",6,{class:"week"})}</div>\n</div>`);class Cr{constructor(e,t){Object.assign(this,t,{picker:e,element:Jn('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,i){this.disabled=[];const n=this.picker;n.setViewSwitchLabel(e),n.setPrevButtonDisabled(t),n.setNextButtonDisabled(i)}setDisabled(e,t){t.add("disabled"),_n(this.disabled,e)}performBeforeHook(e,t){let i=this.beforeShow(new Date(t));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){const n=e.classList;if(!1===i.enabled&&this.setDisabled(t,n),i.classes){const e=i.classes.split(/\s+/);n.add(...e),e.includes("disabled")&&this.setDisabled(t,n)}i.content&&function(e,t){nr(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(Jn(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,i.content)}}renderCell(e,t,i,n,{selected:r,range:s},o,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=n);const l=e.classList;if(e.className=`datepicker-cell ${this.cellClass}`,i<this.first?l.add("prev"):i>this.last&&l.add("next"),l.add(...a),(o||this.checkDisabled(n,this.id))&&this.setDisabled(n,l),s){const[e,t]=s;i>e&&i<t&&l.add("range"),i===e&&l.add("range-start"),i===t&&l.add("range-end")}r.includes(i)&&l.add("selected"),i===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,n)}refreshCell(e,t,i,[n,r]){const s=e.classList;s.remove("range","range-start","range-end","selected","focused"),t>n&&t<r&&s.add("range"),t===n&&s.add("range-start"),t===r&&s.add("range-end"),i.includes(t)&&s.add("selected"),t===this.focused&&s.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class Dr extends Cr{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=Jn(kr).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const i=this.locale=e.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=Jn(Or).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(ir(this.dow),this.weekNumbers&&ir(this.weekNumbers.dow)):(tr(this.dow),this.weekNumbers&&tr(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const i=(this.weekStart+t)%7;e.textContent=this.dayNames[i],e.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),i=e.getMonth(),n=Dn(t,i,1),r=Mn(n,this.weekStart,this.weekStart);this.first=n,this.last=Dn(t,i+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?Cn():void 0,this.prepareForRender(Qn(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=Mn(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((i,n)=>{const r=xn(t,7*n);i.textContent=this.getWeekNumber(r,e),n>3&&i.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const i=xn(this.start,t),n=new Date(i),r=n.getDay(),s=[];this.today===i&&s.push("today"),this.daysOfWeekHighlighted.includes(r)&&s.push("highlighted"),this.renderCell(e,n.getDate(),i,i,this,i<this.minDate||i>this.maxDate||this.daysOfWeekDisabled.includes(r),s)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function xr(e,t){if(!e||!e[0]||!e[1])return;const[[i,n],[r,s]]=e;return i>t||r<t?void 0:[i===t?n:-1,r===t?s:12]}class Tr extends Cr{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(Jn(Sn("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=Dn(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const i=new Date(t),n=i.getFullYear(),r=i.getMonth();return void 0===e[n]?e[n]=[r]:_n(e[n],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,n=this.year===this.maxYear,r=xr(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=qn(new Date(this.year,o,1),1,this.isRangeEnd);this.renderCell(s,this.monthNames[o],o,a,{selected:e,range:r},t||i&&o<this.minMonth||n&&o>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=xr(this.range,this.year)||[];Array.from(this.grid.children).forEach((i,n)=>{this.refreshCell(i,n,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class Lr extends Cr{constructor(e,t){super(e,t)}init(e,t=!0){var i;t&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce((e,t,i)=>e+(i?t:t.toUpperCase()),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(Jn(Sn("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=Hn(e.minDate,this.step),this.minDate=Dn(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=Hn(e.maxDate,this.step),this.maxDate=Dn(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=Hn(e,this.navStep),i=t+9*this.step;this.first=t,this.last=i,this.start=t-this.step,this.focused=Hn(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>_n(e,Hn(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return Hn(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const i=this.start+t*this.step,n=qn(new Date(i,0,1),2,this.isRangeEnd);e.dataset.year=i,this.renderCell(e,i,i,n,this,i<this.minYear||i>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Ir(e,t){const i={bubbles:!0,cancelable:!0,detail:{date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e}};e.element.dispatchEvent(new CustomEvent(t,i))}function Mr(e,t){const{config:i,picker:n}=e,{currentView:r,viewDate:s}=n;let o;switch(r.id){case 0:o=Tn(s,t);break;case 1:o=Ln(s,t);break;default:o=Ln(s,t*r.navStep)}o=An(o,i.minDate,i.maxDate),n.changeFocus(o).render()}function Fr(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Nr(e){e.setDate({clear:!0})}function jr(e){const t=Cn();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function Pr(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},i=e.element;er(i)?i.addEventListener("blur",t,{once:!0}):t()}function $r(e,t){const i=e.picker,n=new Date(i.viewDate),r=i.currentView.id,s=1===r?Tn(n,t-n.getMonth()):Ln(n,t-n.getFullYear());i.changeFocus(s).changeView(r-1).render()}function Hr(e){Fr(e)}function qr(e){Mr(e,-1)}function Rr(e){Mr(e,1)}function Br(e,t){const i=cr(t,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:n,isMinView:r}=e.picker.currentView,s=i.dataset;r?e.setDate(Number(s.date)):$r(e,Number(1===n?s.month:s.year))}function Vr(e){e.preventDefault()}const zr=["left","top","right","bottom"].reduce((e,t)=>(e[t]=`datepicker-orient-${t}`,e),{}),Wr=e=>e?`${e}px`:e;function Yr(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,ir(e.controls.title)):(e.controls.title.textContent="",tr(e.controls.title))),t.prevArrow){const i=e.controls.prevButton;nr(i),t.prevArrow.forEach(e=>{i.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const i=e.controls.nextButton;nr(i),t.nextArrow.forEach(e=>{i.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?ir(e.controls.todayButton):tr(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:i}=e.datepicker.config;e.controls.todayButton.disabled=!En(Cn(),t,i)}"clearButton"in t&&(t.clearButton?ir(e.controls.clearButton):tr(e.controls.clearButton))}function Kr(e){const{dates:t,config:i,rangeSideIndex:n}=e;return An(t.length>0?yn(t):qn(i.defaultViewDate,i.pickLevel,n),i.minDate,i.maxDate)}function Ur(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:i,year:n,first:r,last:s}=e.currentView,o=new Date(t).getFullYear();switch(i){case 0:return t<r||t>s;case 1:return o!==n;default:return o<r||o>s}}function Xr(e){return window.getComputedStyle(e).direction}function Qr(e){const t=Zn(e);if(t!==document.body&&t)return"visible"!==window.getComputedStyle(t).overflow?t:Qr(t)}class Gr{constructor(e){const{config:t,inputField:i}=this.datepicker=e,n=Sr.replace(/%buttonClass%/g,t.buttonClass),r=this.element=Jn(n).firstChild,[s,o,a]=r.firstChild.children,l=s.firstElementChild,[c,d,u]=s.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:d,nextButton:u,todayButton:h,clearButton:p};this.main=o,this.controls=f;const g=i?"dropdown":"inline";r.classList.add(`datepicker-${g}`),Yr(this,t),this.viewDate=Kr(e),ar(e,[[r,"mousedown",Vr],[o,"click",Br.bind(null,e)],[f.viewSwitch,"click",Hr.bind(null,e)],[f.prevButton,"click",qr.bind(null,e)],[f.nextButton,"click",Rr.bind(null,e)],[f.todayButton,"click",jr.bind(null,e)],[f.clearButton,"click",Nr.bind(null,e)]]),this.views=[new Dr(this),new Tr(this),new Lr(this,{id:2,name:"years",cellClass:"year",step:1}),new Lr(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):i.after(this.element)}setOptions(e){Yr(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,i=e.inputField;if(i){const n=Xr(i);n!==Xr(Zn(t))?t.dir=n:t.dir&&t.removeAttribute("dir"),this.place(),t.classList.add("active"),e.config.disableTouchKeyboard&&i.blur()}else t.classList.add("active");this.active=!0,Ir(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Ir(this.datepicker,"hide"))}place(){const{classList:e,style:t}=this.element;t.display="block";const{width:i,height:n}=this.element.getBoundingClientRect(),r=this.element.offsetParent;t.display="";const{config:s,inputField:o}=this.datepicker,{left:a,top:l,right:c,bottom:d,width:u,height:h}=o.getBoundingClientRect();let{x:p,y:f}=s.orientation,g=a,m=l;if(r!==document.body&&r){const e=r.getBoundingClientRect();g-=e.left-r.scrollLeft,m-=e.top-r.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=Qr(o);let b=0,y=0,{clientWidth:_,clientHeight:w}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(y=e.top),e.left>0&&(b=e.left),e.right<_&&(_=e.right),e.bottom<w&&(w=e.bottom)}let E=0;"auto"===p&&(a<b?(p="left",E=b-a):a+i>_?(p="right",_<c&&(E=_-c)):p="rtl"===Xr(o)?c-i<b?"left":"right":"left"),"right"===p&&(g+=u-i),g+=E,"auto"===f&&(f=l-n>y&&d+n>w?"top":"bottom"),"top"===f?m-=n:m+=h,e.remove(...Object.values(zr)),e.add(zr[p],zr[f]),t.left=Wr(g),t.top=Wr(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Ur(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e=void 0){const t=void 0===e?Kr(this.datepicker):e;return this._renderMethod=Ur(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:i,_oldView:n}=this,r=new Date(this._oldViewDate),s=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[s](),n&&(this.main.replaceChild(t.element,n.element),Ir(i,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&Ir(i,"changeYear"),e.getMonth()!==r.getMonth()&&Ir(i,"changeMonth")}}}function Jr(e,t,i,n,r,s){if(En(e,r,s)){if(n(e)){return Jr(t(e,i),t,i,n,r,s)}return e}}function Zr(e,t,i){const n=e.picker,r=n.currentView,s=r.step||1;let o,a=n.viewDate;switch(r.id){case 0:a=xn(a,i?7*t:t),o=xn;break;case 1:a=Tn(a,i?4*t:t),o=Tn;break;default:a=Ln(a,t*(i?4:1)*s),o=Ln}a=Jr(a,o,t<0?-s:s,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&n.changeFocus(a).render()}function es(e,t){const{config:i,picker:n,editMode:r}=e,s=n.active,{key:o,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,d=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===o)return void Pr(e);if("Enter"===o){if(s)if(r)e.exitEditMode({update:!0,autohide:i.autohide});else{const t=n.currentView;t.isMinView?e.setDate(n.viewDate):(n.changeView(t.id-1).render(),d())}else e.update();return}const u=i.shortcutKeys,h={key:o,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(u).find(e=>{const t=u[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):s?"hide"===p?t=p:"prevButton"===p?t=[Mr,[e,-1]]:"nextButton"===p?t=[Mr,[e,1]]:"viewSwitch"===p?t=[Fr,[e]]:i.clearButton&&"clearButton"===p?t=[Nr,[e]]:i.todayButton&&"todayButton"===p&&(t=[jr,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void d()}if(!s||r)return;const f=(i,n)=>{l||c||a?e.enterEditMode():(Zr(e,i,n),t.preventDefault())};"ArrowLeft"===o?f(-1,!1):"ArrowRight"===o?f(1,!1):"ArrowUp"===o?f(-1,!0):"ArrowDown"===o?f(1,!0):("Backspace"===o||"Delete"===o||o&&1===o.length&&!c)&&e.enterEditMode()}function ts(e){e.config.showOnFocus&&!e._showing&&e.show()}function is(e,t){const i=t.target;(e.picker.active||e.config.showOnClick)&&(i._active=er(i),i._clicking=setTimeout(()=>{delete i._active,delete i._clicking},2e3))}function ns(e,t){const i=t.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&e.enterEditMode(),delete i._active,e.config.showOnClick&&e.show())}function rs(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function ss(e,t){const{element:i,picker:n}=e;if(!n.active&&!er(i))return;const r=n.element;cr(t,e=>e===i||e===r)||Pr(e)}function os(e,t){return e.map(e=>Qn(e,t.format,t.locale)).join(t.dateDelimiter)}function as(e,t,i=!1){if(0===t.length)return i?[]:void 0;const{config:n,dates:r,rangeSideIndex:s}=e,{pickLevel:o,maxNumberOfDates:a}=n;let l=t.reduce((e,t)=>{let i=Xn(t,n.format,n.locale);return void 0===i||(i=qn(i,o,s),!En(i,n.minDate,n.maxDate)||e.includes(i)||n.checkDisabled(i,o)||!(o>0)&&n.daysOfWeekDisabled.includes(new Date(i).getDay())||e.push(i)),e},[]);return 0!==l.length?(n.multidate&&!i&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function ls(e,t=3,i=!0,n=void 0){const{config:r,picker:s,inputField:o}=e;if(2&t){const e=s.active?r.pickLevel:r.startView;s.update(n).changeView(e).render(i)}1&t&&o&&(o.value=os(e.dates,r))}function cs(e,t,i){const n=e.config;let{clear:r,render:s,autohide:o,revert:a,forceRefresh:l,viewDate:c}=i;void 0===s&&(s=!0),s?void 0===o&&(o=n.autohide):o=l=!1,c=Xn(c,n.format,n.locale);const d=as(e,t,r);(d||a)&&(d&&d.toString()!==e.dates.toString()?(e.dates=d,ls(e,s?3:1,!0,c),Ir(e,"changeDate")):ls(e,l?3:1,!0,c),o&&e.hide())}function ds(e,t){return t?i=>Qn(i,t,e.config.locale):e=>new Date(e)}class us{constructor(e,t={},i=void 0){e.datepicker=this,this.element=e,this.dates=[];const n=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:Cn(),maxDate:void 0,minDate:void 0},wr(ur,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(n.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):n.container=e,i){const e=i.inputs.indexOf(r),t=i.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=i,this.rangeSideIndex=e}this._options=t,Object.assign(n,wr(t,this)),n.shortcutKeys=function(e){return Object.keys(Er).reduce((t,i)=>{const n=void 0===e[i]?Er[i]:e[i],r=n&&n.key;if(!r||"string"!=typeof r)return t;const s={key:r,ctrlOrMetaKey:!!(n.ctrlOrMetaKey||n.ctrlKey||n.metaKey)};return r.length>1&&(s.altKey=!!n.altKey,s.shiftKey=!!n.shiftKey),t[i]=s,t},{})}(t.shortcutKeys||{});const s=wn(e.value||e.dataset.date,n.dateDelimiter);delete e.dataset.date;const o=as(this,s);o&&o.length>0&&(this.dates=o),r&&(r.value=os(this.dates,n));const a=this.picker=new Gr(this),l=[e,"keydown",es.bind(null,this)];r?ar(this,[l,[r,"focus",ts.bind(null,this)],[r,"mousedown",is.bind(null,this)],[r,"click",ns.bind(null,this)],[r,"paste",rs.bind(null,this)],[document,"mousedown",ss.bind(null,this)],[window,"resize",a.place.bind(a)]]):(ar(this,[l]),this.show())}static formatDate(e,t,i){return Qn(e,t,i&&dr[i]||dr.en)}static parseDate(e,t,i){return Xn(e,t,i&&dr[i]||dr.en)}static get locales(){return dr}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=wr(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),ls(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;er(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),function(e){let t=rr.get(e);t&&(t.forEach(e=>{or.call(...e)}),rr.delete(e))}(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e=void 0){const t=ds(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],i={},n=yn(e);!n||"object"!=typeof n||Array.isArray(n)||n instanceof Date||Object.assign(i,t.pop());cs(this,Array.isArray(t[0])?t[0]:t,i)}update(e=void 0){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});cs(this,wn(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e=void 0){return ds(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:i,picker:n,active:r,rangeSideIndex:s}=this,o=i.pickLevel,a=Xn(e,i.format,i.locale);void 0!==a&&(n.changeFocus(qn(a,o,s)),r&&t&&n.changeView(o),n.render())}refresh(e=void 0,t=!1){let i;e&&"string"!=typeof e&&(t=e,e=void 0),i="picker"===e?2:"input"===e?1:3,ls(this,i,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e=void 0){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}class hs{constructor(e={}){this.opts=e}initDatepickers(e){e.forEach(e=>{const t="function"==typeof this.opts?this.opts(e):this.opts;new us(e,{...t,updateOnBlur:!1}),e.addEventListener("changeDate",()=>{const t=e.closest("form");t&&t.submit()})})}}class ps extends EventTarget{constructor(e,t,i){super(),this.el=e,this.options={...ps.defaultOptions,...i};const n=this.resolveDatagridName();if(!n)throw new Error("Cannot resolve name of a datagrid!");this.name=n,this.ajax="function"==typeof t?t(this):t,this.ajax.addEventListener("success",e=>{var t,i;(null===(t=e.detail.payload)||void 0===t?void 0:t._datagrid_name)===this.name&&(null===(i=e.detail.payload)||void 0===i?void 0:i._datagrid_init)&&this.init()}),this.init()}init(){!this.dispatch("beforeInit",{datagrid:this})||this.options.plugins.forEach(e=>{var t;null===(t=e.onDatagridInit)||void 0===t||t.call(e,this)});const e=this.el.querySelectorAll("input[data-check]:checked");if(1===e.length&&"toggle-all"===e[0].getAttribute("name")){const t=e[0];t&&(t.checked=!1)}this.el.querySelectorAll("input[data-datagrid-manualsubmit]").forEach(e=>{const t=e.closest("form");t&&e.addEventListener("keydown",e=>{if(_(e))return e.stopPropagation(),e.preventDefault(),this.ajax.submitForm(t)})}),this.ajax.addEventListener("success",({detail:{payload:e}})=>{var t;if(e._datagrid_name&&e._datagrid_name===this.name){const i=e=>e.getAttribute("data-datagrid-reset-filter-by-column"),n=Array.from(this.el.querySelectorAll("[data-datagrid-reset-filter-by-column]")),r=e.non_empty_filters?e.non_empty_filters:[];if(n.forEach(e=>{const t=i(e);t&&r.includes(t)?e.classList.remove("hidden"):e.classList.add("hidden")}),r.length>0){const e=null===(t=this.el.querySelector(".reset-filter"))||void 0===t?void 0:t.getAttribute("href");e&&n.forEach(t=>{const n=i(t),r=e.replace("-resetFilter","-resetColumnFilter");t.setAttribute("href",`${r}&${this.name}-key=${n}`)})}}}),this.dispatch("afterInit",{datagrid:this})}confirm(e){return this.options.confirm.bind(this)(e)}resolveDatagridName(){return this.options.resolveDatagridName.bind(this)(this.el)}dispatch(e,t,i){return this.dispatchEvent(new CustomEvent(e,{detail:t}))}}ps.defaultOptions={confirm:confirm,resolveDatagridName:function(e){const t=e.getAttribute("data-datagrid-name");if(t)return t;console.warn("Deprecated name resolution for datagrid",e,": Please add a data-datagrid-name attribute instead!\nCurrently, the Datagrid library relies on matching the name from the 'datagrid-[name]' class, which is unreliable and may cause bugs if the default class names are not used (eg. if you add a datagrid-xx class, or change the name class completely!)\nAlternatively, you can customize the name resolution with the `resolveDatagridName` option. See TBD for more info.");const i=e.classList.value.split(" ");for(const e of i){if(!e.startsWith("datagrid-"))continue;const[,...t]=e.split("-"),i=t.join("-");return i.length<1?(console.error(`Failed to resolve datagrid name - ambigious class name '${e}'`),null):i}return null},plugins:[]};class fs{constructor(e,t={}){this.ajax=e,this.datagrids=[],this.options={selector:"div[data-datagrid-name]",datagrid:{},root:document.body,...t};const i="string"==typeof this.options.root?document.querySelector(this.options.root):this.options.root;if(!(i&&i instanceof HTMLElement))throw new Error("Root element not found or is not an HTMLElement");this.root=i,this.init()}init(){var e,t;this.ajax.onInit(),(null!==(t=null===(e=this.options.datagrid)||void 0===e?void 0:e.plugins)&&void 0!==t?t:[]).forEach(e=>{var t;return null===(t=e.onInit)||void 0===t?void 0:t.call(e,this)}),this.initDatagrids()}initDatagrids(){this.datagrids=Array.from(this.root.querySelectorAll(this.options.selector)).map(e=>new ps(e,this.ajax,this.options.datagrid))}}class gs extends EventTarget{constructor(e){if(!e.VERSION||e.VERSION<2)throw new Error("NajaAjax supports Naja 2 and higher"+(e.VERSION?`(version ${e.VERSION} provided)`:""));super(),this.client=e}onInit(){return this.client.addEventListener("before",e=>this.dispatch("before",{params:e.detail})),this.client.uiHandler.addEventListener("interaction",e=>{if(!(e.detail.element instanceof HTMLElement))throw new Error("Element is not an instanceof HTMLElement");const t=this.dispatch("interact",{...e.detail,element:e.detail.element});return t||(e.stopPropagation(),e.preventDefault()),t}),this.client.addEventListener("success",e=>this.dispatch("success",{...e.detail,params:e.detail.request,payload:e.detail.payload})),this.client.addEventListener("error",e=>this.dispatch("error",{...e.detail,params:e.detail.request,response:e.detail.response})),this.client.addEventListener("complete",e=>this.dispatch("complete",{...e.detail,params:e.detail.request,response:e.detail.response})),this}async request(e){return await this.client.makeRequest(e.method,e.url,e.data)}async submitForm(e){return await this.client.uiHandler.submitForm(e)}dispatch(e,t,i){return this.dispatchEvent(new CustomEvent(e,{detail:t,cancelable:!0}))}}var ms="top",vs="bottom",bs="right",ys="left",_s="auto",ws=[ms,vs,bs,ys],Es="start",As="end",Ss="clippingParents",ks="viewport",Os="popper",Cs="reference",Ds=ws.reduce(function(e,t){return e.concat([t+"-"+Es,t+"-"+As])},[]),xs=[].concat(ws,[_s]).reduce(function(e,t){return e.concat([t,t+"-"+Es,t+"-"+As])},[]),Ts="beforeRead",Ls="read",Is="afterRead",Ms="beforeMain",Fs="main",Ns="afterMain",js="beforeWrite",Ps="write",$s="afterWrite",Hs=[Ts,Ls,Is,Ms,Fs,Ns,js,Ps,$s];function qs(e){return e?(e.nodeName||"").toLowerCase():null}function Rs(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Bs(e){return e instanceof Rs(e).Element||e instanceof Element}function Vs(e){return e instanceof Rs(e).HTMLElement||e instanceof HTMLElement}function zs(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Rs(e).ShadowRoot||e instanceof ShadowRoot)}var Ws={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},r=t.elements[e];Vs(r)&&qs(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});Vs(n)&&qs(n)&&(Object.assign(n.style,s),Object.keys(r).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};function Ys(e){return e.split("-")[0]}var Ks=Math.max,Us=Math.min,Xs=Math.round;function Qs(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Gs(){return!/^((?!chrome|android).)*safari/i.test(Qs())}function Js(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),r=1,s=1;t&&Vs(e)&&(r=e.offsetWidth>0&&Xs(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Xs(n.height)/e.offsetHeight||1);var o=(Bs(e)?Rs(e):window).visualViewport,a=!Gs()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,d=n.width/r,u=n.height/s;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function Zs(e){var t=Js(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function eo(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&zs(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function to(e){return Rs(e).getComputedStyle(e)}function io(e){return["table","td","th"].indexOf(qs(e))>=0}function no(e){return((Bs(e)?e.ownerDocument:e.document)||window.document).documentElement}function ro(e){return"html"===qs(e)?e:e.assignedSlot||e.parentNode||(zs(e)?e.host:null)||no(e)}function so(e){return Vs(e)&&"fixed"!==to(e).position?e.offsetParent:null}function oo(e){for(var t=Rs(e),i=so(e);i&&io(i)&&"static"===to(i).position;)i=so(i);return i&&("html"===qs(i)||"body"===qs(i)&&"static"===to(i).position)?t:i||function(e){var t=/firefox/i.test(Qs());if(/Trident/i.test(Qs())&&Vs(e)&&"fixed"===to(e).position)return null;var i=ro(e);for(zs(i)&&(i=i.host);Vs(i)&&["html","body"].indexOf(qs(i))<0;){var n=to(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function ao(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function lo(e,t,i){return Ks(e,Us(t,i))}function co(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function uo(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var ho={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ys(i.placement),l=ao(a),c=[ys,bs].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(e,t){return co("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:uo(e,ws))}(r.padding,i),u=Zs(s),h="y"===l?ms:ys,p="y"===l?vs:bs,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],g=o[l]-i.rects.reference[l],m=oo(s),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=f/2-g/2,y=d[h],_=v-u[c]-d[p],w=v/2-u[c]/2+b,E=lo(y,w,_),A=l;i.modifiersData[n]=((t={})[A]=E,t.centerOffset=E-w,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&eo(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function po(e){return e.split("-")[1]}var fo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function go(e){var t,i=e.popper,n=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,g=void 0===f?0:f,m="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=ys,_=ms,w=window;if(c){var E=oo(i),A="clientHeight",S="clientWidth";if(E===Rs(i)&&"static"!==to(E=no(i)).position&&"absolute"===a&&(A="scrollHeight",S="scrollWidth"),r===ms||(r===ys||r===bs)&&s===As)_=vs,g-=(u&&E===w&&w.visualViewport?w.visualViewport.height:E[A])-n.height,g*=l?1:-1;if(r===ys||(r===ms||r===vs)&&s===As)y=bs,p-=(u&&E===w&&w.visualViewport?w.visualViewport.width:E[S])-n.width,p*=l?1:-1}var k,O=Object.assign({position:a},c&&fo),C=!0===d?function(e,t){var i=e.x,n=e.y,r=t.devicePixelRatio||1;return{x:Xs(i*r)/r||0,y:Xs(n*r)/r||0}}({x:p,y:g},Rs(i)):{x:p,y:g};return p=C.x,g=C.y,l?Object.assign({},O,((k={})[_]=b?"0":"",k[y]=v?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k)):Object.assign({},O,((t={})[_]=b?g+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var mo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:Ys(t.placement),variation:po(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,go(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,go(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},vo={passive:!0};var bo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=Rs(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(e){e.addEventListener("scroll",i.update,vo)}),a&&l.addEventListener("resize",i.update,vo),function(){s&&c.forEach(function(e){e.removeEventListener("scroll",i.update,vo)}),a&&l.removeEventListener("resize",i.update,vo)}},data:{}},yo={left:"right",right:"left",bottom:"top",top:"bottom"};function _o(e){return e.replace(/left|right|bottom|top/g,function(e){return yo[e]})}var wo={start:"end",end:"start"};function Eo(e){return e.replace(/start|end/g,function(e){return wo[e]})}function Ao(e){var t=Rs(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function So(e){return Js(no(e)).left+Ao(e).scrollLeft}function ko(e){var t=to(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Oo(e){return["html","body","#document"].indexOf(qs(e))>=0?e.ownerDocument.body:Vs(e)&&ko(e)?e:Oo(ro(e))}function Co(e,t){var i;void 0===t&&(t=[]);var n=Oo(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=Rs(n),o=r?[s].concat(s.visualViewport||[],ko(n)?n:[]):n,a=t.concat(o);return r?a:a.concat(Co(ro(o)))}function Do(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function xo(e,t,i){return t===ks?Do(function(e,t){var i=Rs(e),n=no(e),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Gs();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+So(e),y:l}}(e,i)):Bs(t)?function(e,t){var i=Js(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):Do(function(e){var t,i=no(e),n=Ao(e),r=null==(t=e.ownerDocument)?void 0:t.body,s=Ks(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Ks(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+So(e),l=-n.scrollTop;return"rtl"===to(r||i).direction&&(a+=Ks(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(no(e)))}function To(e,t,i,n){var r="clippingParents"===t?function(e){var t=Co(ro(e)),i=["absolute","fixed"].indexOf(to(e).position)>=0&&Vs(e)?oo(e):e;return Bs(i)?t.filter(function(e){return Bs(e)&&eo(e,i)&&"body"!==qs(e)}):[]}(e):[].concat(t),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(t,i){var r=xo(e,i,n);return t.top=Ks(r.top,t.top),t.right=Us(r.right,t.right),t.bottom=Us(r.bottom,t.bottom),t.left=Ks(r.left,t.left),t},xo(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Lo(e){var t,i=e.reference,n=e.element,r=e.placement,s=r?Ys(r):null,o=r?po(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case ms:t={x:a,y:i.y-n.height};break;case vs:t={x:a,y:i.y+i.height};break;case bs:t={x:i.x+i.width,y:l};break;case ys:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=s?ao(s):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case Es:t[c]=t[c]-(i[d]/2-n[d]/2);break;case As:t[c]=t[c]+(i[d]/2-n[d]/2)}}return t}function Io(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=void 0===n?e.placement:n,s=i.strategy,o=void 0===s?e.strategy:s,a=i.boundary,l=void 0===a?Ss:a,c=i.rootBoundary,d=void 0===c?ks:c,u=i.elementContext,h=void 0===u?Os:u,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,m=void 0===g?0:g,v=co("number"!=typeof m?m:uo(m,ws)),b=h===Os?Cs:Os,y=e.rects.popper,_=e.elements[f?b:h],w=To(Bs(_)?_:_.contextElement||no(e.elements.popper),l,d,o),E=Js(e.elements.reference),A=Lo({reference:E,element:y,placement:r}),S=Do(Object.assign({},y,A)),k=h===Os?S:E,O={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},C=e.modifiersData.offset;if(h===Os&&C){var D=C[r];Object.keys(O).forEach(function(e){var t=[bs,vs].indexOf(e)>=0?1:-1,i=[ms,vs].indexOf(e)>=0?"y":"x";O[e]+=D[i]*t})}return O}function Mo(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?xs:l,d=po(n),u=d?a?Ds:Ds.filter(function(e){return po(e)===d}):ws,h=u.filter(function(e){return c.indexOf(e)>=0});0===h.length&&(h=u);var p=h.reduce(function(t,i){return t[i]=Io(e,{placement:i,boundary:r,rootBoundary:s,padding:o})[Ys(i)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}var Fo={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,h=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,m=t.options.placement,v=Ys(m),b=l||(v===m||!f?[_o(m)]:function(e){if(Ys(e)===_s)return[];var t=_o(e);return[Eo(e),t,Eo(t)]}(m)),y=[m].concat(b).reduce(function(e,i){return e.concat(Ys(i)===_s?Mo(t,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:g}):i)},[]),_=t.rects.reference,w=t.rects.popper,E=new Map,A=!0,S=y[0],k=0;k<y.length;k++){var O=y[k],C=Ys(O),D=po(O)===Es,x=[ms,vs].indexOf(C)>=0,T=x?"width":"height",L=Io(t,{placement:O,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=x?D?bs:ys:D?vs:ms;_[T]>w[T]&&(I=_o(I));var M=_o(I),F=[];if(s&&F.push(L[C]<=0),a&&F.push(L[I]<=0,L[M]<=0),F.every(function(e){return e})){S=O,A=!1;break}E.set(O,F)}if(A)for(var N=function(e){var t=y.find(function(t){var i=E.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return S=t,"break"},j=f?3:1;j>0;j--){if("break"===N(j))break}t.placement!==S&&(t.modifiersData[n]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function No(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function jo(e){return[ms,bs,vs,ys].some(function(t){return e[t]>=0})}var Po={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=Io(t,{elementContext:"reference"}),a=Io(t,{altBoundary:!0}),l=No(o,n),c=No(a,r,s),d=jo(l),u=jo(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var $o={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=void 0===r?[0,0]:r,o=xs.reduce(function(e,i){return e[i]=function(e,t,i){var n=Ys(e),r=[ys,ms].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},t,{placement:e})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[ys,bs].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,t.rects,s),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}};var Ho={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=Lo({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var qo={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,h=i.tether,p=void 0===h||h,f=i.tetherOffset,g=void 0===f?0:f,m=Io(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ys(t.placement),b=po(t.placement),y=!b,_=ao(v),w="x"===_?"y":"x",E=t.modifiersData.popperOffsets,A=t.rects.reference,S=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,O="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(E){if(s){var x,T="y"===_?ms:ys,L="y"===_?vs:bs,I="y"===_?"height":"width",M=E[_],F=M+m[T],N=M-m[L],j=p?-S[I]/2:0,P=b===Es?A[I]:S[I],$=b===Es?-S[I]:-A[I],H=t.elements.arrow,q=p&&H?Zs(H):{width:0,height:0},R=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=R[T],V=R[L],z=lo(0,A[I],q[I]),W=y?A[I]/2-j-z-B-O.mainAxis:P-z-B-O.mainAxis,Y=y?-A[I]/2+j+z+V+O.mainAxis:$+z+V+O.mainAxis,K=t.elements.arrow&&oo(t.elements.arrow),U=K?"y"===_?K.clientTop||0:K.clientLeft||0:0,X=null!=(x=null==C?void 0:C[_])?x:0,Q=M+Y-X,G=lo(p?Us(F,M+W-X-U):F,M,p?Ks(N,Q):N);E[_]=G,D[_]=G-M}if(a){var J,Z="x"===_?ms:ys,ee="x"===_?vs:bs,te=E[w],ie="y"===w?"height":"width",ne=te+m[Z],re=te-m[ee],se=-1!==[ms,ys].indexOf(v),oe=null!=(J=null==C?void 0:C[w])?J:0,ae=se?ne:te-A[ie]-S[ie]-oe+O.altAxis,le=se?te+A[ie]+S[ie]-oe-O.altAxis:re,ce=p&&se?function(e,t,i){var n=lo(e,t,i);return n>i?i:n}(ae,te,le):lo(p?ae:ne,te,p?le:re);E[w]=ce,D[w]=ce-te}t.modifiersData[n]=D}},requiresIfExists:["offset"]};function Ro(e,t,i){void 0===i&&(i=!1);var n,r,s=Vs(t),o=Vs(t)&&function(e){var t=e.getBoundingClientRect(),i=Xs(t.width)/e.offsetWidth||1,n=Xs(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),a=no(t),l=Js(e,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!i)&&(("body"!==qs(t)||ko(a))&&(c=(n=t)!==Rs(n)&&Vs(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:Ao(n)),Vs(t)?((d=Js(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=So(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Bo(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||r(e)}),n}var Vo={placement:"bottom",modifiers:[],strategy:"absolute"};function zo(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Wo(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,r=t.defaultOptions,s=void 0===r?Vo:r;return function(e,t,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vo,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:Bs(e)?Co(e):e.contextElement?Co(e.contextElement):[],popper:Co(t)};var o,c,h=function(e){var t=Bo(e);return Hs.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((o=[].concat(n,a.options.modifiers),c=o.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=h.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var s=r({state:a,name:t,instance:d,options:n}),o=function(){};l.push(s||o)}}),d.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,i=e.popper;if(zo(t,i)){a.rects={reference:Ro(t,oo(i),"fixed"===a.options.strategy),popper:Zs(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise(function(e){d.forceUpdate(),e(a)})},function(){return o||(o=new Promise(function(e){Promise.resolve().then(function(){o=void 0,e(r())})})),o}),destroy:function(){u(),c=!0}};if(!zo(e,t))return d;function u(){l.forEach(function(e){return e()}),l=[]}return d.setOptions(i).then(function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)}),d}}var Yo=Wo(),Ko=Wo({defaultModifiers:[bo,Ho,mo,Ws]}),Uo=Wo({defaultModifiers:[bo,Ho,mo,Ws,$o,Fo,qo,ho,Po]}),Xo=Object.freeze({__proto__:null,afterMain:Ns,afterRead:Is,afterWrite:$s,applyStyles:Ws,arrow:ho,auto:_s,basePlacements:ws,beforeMain:Ms,beforeRead:Ts,beforeWrite:js,bottom:vs,clippingParents:Ss,computeStyles:mo,createPopper:Uo,createPopperBase:Yo,createPopperLite:Ko,detectOverflow:Io,end:As,eventListeners:bo,flip:Fo,hide:Po,left:ys,main:Fs,modifierPhases:Hs,offset:$o,placements:xs,popper:Os,popperGenerator:Wo,popperOffsets:Ho,preventOverflow:qo,read:Ls,reference:Cs,right:bs,start:Es,top:ms,variationPlacements:Ds,viewport:ks,write:Ps});
13
+ */function ft(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function gt(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(i),!0).forEach(function(t){vt(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ft(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function mt(e){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mt(e)}function vt(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function bt(){return bt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},bt.apply(this,arguments)}function yt(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function _t(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var wt=_t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Et=_t(/Edge/i),At=_t(/firefox/i),St=_t(/safari/i)&&!_t(/chrome/i)&&!_t(/android/i),kt=_t(/iP(ad|od|hone)/i),Ot=_t(/chrome/i)&&_t(/android/i),Ct={capture:!1,passive:!1};function Dt(e,t,i){e.addEventListener(t,i,!wt&&Ct)}function xt(e,t,i){e.removeEventListener(t,i,!wt&&Ct)}function Tt(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Lt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function It(e,t,i,n){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&Tt(e,t):Tt(e,t))||n&&e===i)return e;if(e===i)break}while(e=Lt(e))}return null}var Mt,Ft=/\s+/g;function Nt(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(Ft," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(Ft," ")}}function jt(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=i+("string"==typeof i?"":"px")}}function Pt(e,t){var i="";if("string"==typeof e)i=e;else do{var n=jt(e,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function $t(e,t,i){if(e){var n=e.getElementsByTagName(t),r=0,s=n.length;if(i)for(;r<s;r++)i(n[r],r);return n}return[]}function Ht(){var e=document.scrollingElement;return e||document.documentElement}function qt(e,t,i,n,r){if(e.getBoundingClientRect||e===window){var s,o,a,l,c,d,u;if(e!==window&&e.parentNode&&e!==Ht()?(o=(s=e.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,u=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||i)&&e!==window&&(r=r||e.parentNode,!wt))do{if(r&&r.getBoundingClientRect&&("none"!==jt(r,"transform")||i&&"static"!==jt(r,"position"))){var h=r.getBoundingClientRect();o-=h.top+parseInt(jt(r,"border-top-width")),a-=h.left+parseInt(jt(r,"border-left-width")),l=o+s.height,c=a+s.width;break}}while(r=r.parentNode);if(n&&e!==window){var p=Pt(r||e),f=p&&p.a,g=p&&p.d;p&&(l=(o/=g)+(d/=g),c=(a/=f)+(u/=f))}return{top:o,left:a,bottom:l,right:c,width:u,height:d}}}function Rt(e,t,i){for(var n=Yt(e,!0),r=qt(e)[t];n;){if(!(r>=qt(n)[i]))return n;if(n===Ht())break;n=Yt(n,!1)}return!1}function Bt(e,t,i,n){for(var r=0,s=0,o=e.children;s<o.length;){if("none"!==o[s].style.display&&o[s]!==Qi.ghost&&(n||o[s]!==Qi.dragged)&&It(o[s],i.draggable,e,!1)){if(r===t)return o[s];r++}s++}return null}function Vt(e,t){for(var i=e.lastElementChild;i&&(i===Qi.ghost||"none"===jt(i,"display")||t&&!Tt(i,t));)i=i.previousElementSibling;return i||null}function zt(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Qi.clone||t&&!Tt(e,t)||i++;return i}function Wt(e){var t=0,i=0,n=Ht();if(e)do{var r=Pt(e),s=r.a,o=r.d;t+=e.scrollLeft*s,i+=e.scrollTop*o}while(e!==n&&(e=e.parentNode));return[t,i]}function Yt(e,t){if(!e||!e.getBoundingClientRect)return Ht();var i=e,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=jt(i);if(i.clientWidth<i.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!i.getBoundingClientRect||i===document.body)return Ht();if(n||t)return i;n=!0}}}while(i=i.parentNode);return Ht()}function Kt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Ut(e,t){return function(){if(!Mt){var i=arguments;1===i.length?e.call(this,i[0]):e.apply(this,i),Mt=setTimeout(function(){Mt=void 0},t)}}}function Xt(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function Qt(e){var t=window.Polymer,$=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):$?$(e).clone(!0)[0]:e.cloneNode(!0)}function Gt(e,t,i){var n={};return Array.from(e.children).forEach(function(r){var s,o,a,l;if(It(r,t.draggable,e,!1)&&!r.animated&&r!==i){var c=qt(r);n.left=Math.min(null!==(s=n.left)&&void 0!==s?s:1/0,c.left),n.top=Math.min(null!==(o=n.top)&&void 0!==o?o:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(l=n.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Jt="Sortable"+(new Date).getTime();function Zt(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==jt(e,"display")&&e!==Qi.ghost){t.push({target:e,rect:qt(e)});var i=gt({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=Pt(e,!0);n&&(i.top-=n.f,i.left-=n.e)}e.fromRect=i}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var i in e)if(e.hasOwnProperty(i))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[i][n])return Number(i);return-1}(t,{target:e}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof i&&i());var r=!1,s=0;t.forEach(function(e){var t=0,i=e.target,o=i.fromRect,a=qt(i),l=i.prevFromRect,c=i.prevToRect,d=e.rect,u=Pt(i,!0);u&&(a.top-=u.f,a.left-=u.e),i.toRect=a,i.thisAnimationDuration&&Kt(l,a)&&!Kt(o,a)&&(d.top-a.top)/(d.left-a.left)===(o.top-a.top)/(o.left-a.left)&&(t=function(e,t,i,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*n.animation}(d,l,c,n.options)),Kt(a,o)||(i.prevFromRect=o,i.prevToRect=a,t||(t=n.options.animation),n.animate(i,d,a,t)),t&&(r=!0,s=Math.max(s,t),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},t),i.thisAnimationDuration=t)}),clearTimeout(e),r?e=setTimeout(function(){"function"==typeof i&&i()},s):"function"==typeof i&&i(),t=[]},animate:function(e,t,i,n){if(n){jt(e,"transition",""),jt(e,"transform","");var r=Pt(this.el),s=r&&r.a,o=r&&r.d,a=(t.left-i.left)/(s||1),l=(t.top-i.top)/(o||1);e.animatingX=!!a,e.animatingY=!!l,jt(e,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),jt(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),jt(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){jt(e,"transition",""),jt(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},n)}}}}var ei=[],ti={initializeByDefault:!0},ii={mount:function(e){for(var t in ti)ti.hasOwnProperty(t)&&!(t in e)&&(e[t]=ti[t]);ei.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ei.push(e)},pluginEvent:function(e,t,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var r=e+"Global";ei.forEach(function(n){t[n.pluginName]&&(t[n.pluginName][r]&&t[n.pluginName][r](gt({sortable:t},i)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](gt({sortable:t},i)))})},initializePlugins:function(e,t,i,n){for(var r in ei.forEach(function(n){var r=n.pluginName;if(e.options[r]||n.initializeByDefault){var s=new n(e,t,e.options);s.sortable=e,s.options=e.options,e[r]=s,bt(i,s.defaults)}}),e.options)if(e.options.hasOwnProperty(r)){var s=this.modifyOption(e,r,e.options[r]);void 0!==s&&(e.options[r]=s)}},getEventProperties:function(e,t){var i={};return ei.forEach(function(n){"function"==typeof n.eventProperties&&bt(i,n.eventProperties.call(t[n.pluginName],e))}),i},modifyOption:function(e,t,i){var n;return ei.forEach(function(r){e[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[t]&&(n=r.optionListeners[t].call(e[r.pluginName],i))}),n}};var ni=["evt"],ri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=yt(i,ni);ii.pluginEvent.bind(Qi)(e,t,gt({dragEl:oi,parentEl:ai,ghostEl:li,rootEl:ci,nextEl:di,lastDownEl:ui,cloneEl:hi,cloneHidden:pi,dragStarted:Oi,putSortable:yi,activeSortable:Qi.active,originalEvent:n,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi,hideGhostForTarget:Yi,unhideGhostForTarget:Ki,cloneNowHidden:function(){pi=!0},cloneNowShown:function(){pi=!1},dispatchSortableEvent:function(e){si({sortable:t,name:e,originalEvent:n})}},r))};function si(e){!function(e){var t=e.sortable,i=e.rootEl,n=e.name,r=e.targetEl,s=e.cloneEl,o=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||i&&i[Jt]){var g,m=t.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||wt||Et?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=o||i,g.from=a||i,g.item=r||i,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var b=gt(gt({},f),ii.getEventProperties(n,t));for(var y in b)g[y]=b[y];i&&i.dispatchEvent(g),m[v]&&m[v].call(t,g)}}(gt({putSortable:yi,cloneEl:hi,targetEl:oi,rootEl:ci,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi},e))}var oi,ai,li,ci,di,ui,hi,pi,fi,gi,mi,vi,bi,yi,_i,wi,Ei,Ai,Si,ki,Oi,Ci,Di,xi,Ti,Li=!1,Ii=!1,Mi=[],Fi=!1,Ni=!1,ji=[],Pi=!1,$i=[],Hi="undefined"!=typeof document,qi=kt,Ri=Et||wt?"cssFloat":"float",Bi=Hi&&!Ot&&!kt&&"draggable"in document.createElement("div"),Vi=function(){if(Hi){if(wt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),zi=function(e,t){var i=jt(e),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Bt(e,0,t),s=Bt(e,1,t),o=r&&jt(r),a=s&&jt(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qt(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qt(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var d="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Ri]||s&&"none"===i[Ri]&&l+c>n)?"vertical":"horizontal"},Wi=function(e){function t(e,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==e&&(i||a))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"==typeof e)return t(e(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},n=e.group;n&&"object"==mt(n)||(n={name:n}),i.name=n.name,i.checkPull=t(n.pull,!0),i.checkPut=t(n.put),i.revertClone=n.revertClone,e.group=i},Yi=function(){!Vi&&li&&jt(li,"display","none")},Ki=function(){!Vi&&li&&jt(li,"display","")};Hi&&!Ot&&document.addEventListener("click",function(e){if(Ii)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ii=!1,!1},!0);var Ui=function(e){if(oi){e=e.touches?e.touches[0]:e;var t=(r=e.clientX,s=e.clientY,Mi.some(function(e){var t=e[Jt].options.emptyInsertThreshold;if(t&&!Vt(e)){var i=qt(e),n=r>=i.left-t&&r<=i.right+t,a=s>=i.top-t&&s<=i.bottom+t;return n&&a?o=e:void 0}}),o);if(t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[Jt]._onDragOver(i)}}var r,s,o},Xi=function(e){oi&&oi.parentNode[Jt]._isOutsideThisEl(e.target)};function Qi(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=bt({},t),e[Jt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qi.supportPointer&&"PointerEvent"in window&&(!St||kt),emptyInsertThreshold:5};for(var n in ii.initializePlugins(this,e,i),i)!(n in t)&&(t[n]=i[n]);for(var r in Wi(t),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&Bi,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Dt(e,"pointerdown",this._onTapStart):(Dt(e,"mousedown",this._onTapStart),Dt(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Dt(e,"dragover",this),Dt(e,"dragenter",this)),Mi.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),bt(this,Zt())}function Gi(e,t,i,n,r,s,o,a){var l,c,d=e[Jt],u=d.options.onMove;return!window.CustomEvent||wt||Et?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=n,l.related=r||t,l.relatedRect=s||qt(t),l.willInsertAfter=a,l.originalEvent=o,e.dispatchEvent(l),u&&(c=u.call(d,l,o)),c}function Ji(e){e.draggable=!1}function Zi(){Pi=!1}function en(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;i--;)n+=t.charCodeAt(i);return n.toString(36)}function tn(e){return setTimeout(e,0)}function nn(e){return clearTimeout(e)}Qi.prototype={constructor:Qi,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ci=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,oi):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,i=this.el,n=this.options,r=n.preventOnFilter,s=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=n.filter;if(function(e){$i.length=0;var t=e.getElementsByTagName("input"),i=t.length;for(;i--;){var n=t[i];n.checked&&$i.push(n)}}(i),!oi&&!(/mousedown|pointerdown/.test(s)&&0!==e.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!St||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=It(a,n.draggable,i,!1))&&a.animated||ui===a)){if(fi=zt(a),mi=zt(a,n.draggable),"function"==typeof c){if(c.call(this,e,a,this))return si({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),ri("filter",t,{evt:e}),void(r&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=It(l,n.trim(),i,!1))return si({sortable:t,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),ri("filter",t,{evt:e}),!0})))return void(r&&e.preventDefault());n.handle&&!It(l,n.handle,i,!1)||this._prepareDragStart(e,o,a)}}},_prepareDragStart:function(e,t,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!oi&&i.parentNode===s){var l=qt(i);if(ci=s,ai=(oi=i).parentNode,di=oi.nextSibling,ui=i,bi=o.group,Qi.dragged=oi,_i={target:oi,clientX:(t||e).clientX,clientY:(t||e).clientY},Si=_i.clientX-l.left,ki=_i.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,oi.style["will-change"]="all",n=function(){ri("delayEnded",r,{evt:e}),Qi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!At&&r.nativeDraggable&&(oi.draggable=!0),r._triggerDragStart(e,t),si({sortable:r,name:"choose",originalEvent:e}),Nt(oi,o.chosenClass,!0))},o.ignore.split(",").forEach(function(e){$t(oi,e.trim(),Ji)}),Dt(a,"dragover",Ui),Dt(a,"mousemove",Ui),Dt(a,"touchmove",Ui),o.supportPointer?(Dt(a,"pointerup",r._onDrop),!this.nativeDraggable&&Dt(a,"pointercancel",r._onDrop)):(Dt(a,"mouseup",r._onDrop),Dt(a,"touchend",r._onDrop),Dt(a,"touchcancel",r._onDrop)),At&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oi.draggable=!0),ri("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(Et||wt))n();else{if(Qi.eventCanceled)return void this._onDrop();o.supportPointer?(Dt(a,"pointerup",r._disableDelayedDrag),Dt(a,"pointercancel",r._disableDelayedDrag)):(Dt(a,"mouseup",r._disableDelayedDrag),Dt(a,"touchend",r._disableDelayedDrag),Dt(a,"touchcancel",r._disableDelayedDrag)),Dt(a,"mousemove",r._delayedDragTouchMoveHandler),Dt(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Dt(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oi&&Ji(oi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;xt(e,"mouseup",this._disableDelayedDrag),xt(e,"touchend",this._disableDelayedDrag),xt(e,"touchcancel",this._disableDelayedDrag),xt(e,"pointerup",this._disableDelayedDrag),xt(e,"pointercancel",this._disableDelayedDrag),xt(e,"mousemove",this._delayedDragTouchMoveHandler),xt(e,"touchmove",this._delayedDragTouchMoveHandler),xt(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?Dt(document,"pointermove",this._onTouchMove):Dt(document,t?"touchmove":"mousemove",this._onTouchMove):(Dt(oi,"dragend",this),Dt(ci,"dragstart",this._onDragStart));try{document.selection?tn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(Li=!1,ci&&oi){ri("dragStarted",this,{evt:t}),this.nativeDraggable&&Dt(document,"dragover",Xi);var i=this.options;!e&&Nt(oi,i.dragClass,!1),Nt(oi,i.ghostClass,!0),Qi.active=this,e&&this._appendGhost(),si({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wi){this._lastX=wi.clientX,this._lastY=wi.clientY,Yi();for(var e=document.elementFromPoint(wi.clientX,wi.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wi.clientX,wi.clientY))!==t;)t=e;if(oi.parentNode[Jt]._isOutsideThisEl(e),t)do{if(t[Jt]){if(t[Jt]._onDragOver({clientX:wi.clientX,clientY:wi.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=Lt(t));Ki()}},_onTouchMove:function(e){if(_i){var t=this.options,i=t.fallbackTolerance,n=t.fallbackOffset,r=e.touches?e.touches[0]:e,s=li&&Pt(li,!0),o=li&&s&&s.a,a=li&&s&&s.d,l=qi&&Ti&&Wt(Ti),c=(r.clientX-_i.clientX+n.x)/(o||1)+(l?l[0]-ji[0]:0)/(o||1),d=(r.clientY-_i.clientY+n.y)/(a||1)+(l?l[1]-ji[1]:0)/(a||1);if(!Qi.active&&!Li){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}if(li){s?(s.e+=c-(Ei||0),s.f+=d-(Ai||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");jt(li,"webkitTransform",u),jt(li,"mozTransform",u),jt(li,"msTransform",u),jt(li,"transform",u),Ei=c,Ai=d,wi=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!li){var e=this.options.fallbackOnBody?document.body:ci,t=qt(oi,!0,qi,!0,e),i=this.options;if(qi){for(Ti=e;"static"===jt(Ti,"position")&&"none"===jt(Ti,"transform")&&Ti!==document;)Ti=Ti.parentNode;Ti!==document.body&&Ti!==document.documentElement?(Ti===document&&(Ti=Ht()),t.top+=Ti.scrollTop,t.left+=Ti.scrollLeft):Ti=Ht(),ji=Wt(Ti)}Nt(li=oi.cloneNode(!0),i.ghostClass,!1),Nt(li,i.fallbackClass,!0),Nt(li,i.dragClass,!0),jt(li,"transition",""),jt(li,"transform",""),jt(li,"box-sizing","border-box"),jt(li,"margin",0),jt(li,"top",t.top),jt(li,"left",t.left),jt(li,"width",t.width),jt(li,"height",t.height),jt(li,"opacity","0.8"),jt(li,"position",qi?"absolute":"fixed"),jt(li,"zIndex","100000"),jt(li,"pointerEvents","none"),Qi.ghost=li,e.appendChild(li),jt(li,"transform-origin",Si/parseInt(li.style.width)*100+"% "+ki/parseInt(li.style.height)*100+"%")}},_onDragStart:function(e,t){var i=this,n=e.dataTransfer,r=i.options;ri("dragStart",this,{evt:e}),Qi.eventCanceled?this._onDrop():(ri("setupClone",this),Qi.eventCanceled||((hi=Qt(oi)).removeAttribute("id"),hi.draggable=!1,hi.style["will-change"]="",this._hideClone(),Nt(hi,this.options.chosenClass,!1),Qi.clone=hi),i.cloneId=tn(function(){ri("clone",i),Qi.eventCanceled||(i.options.removeCloneOnHide||ci.insertBefore(hi,oi),i._hideClone(),si({sortable:i,name:"clone"}))}),!t&&Nt(oi,r.dragClass,!0),t?(Ii=!0,i._loopId=setInterval(i._emulateDragOver,50)):(xt(document,"mouseup",i._onDrop),xt(document,"touchend",i._onDrop),xt(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(i,n,oi)),Dt(document,"drop",i),jt(oi,"transform","translateZ(0)")),Li=!0,i._dragStartId=tn(i._dragStarted.bind(i,t,e)),Dt(document,"selectstart",i),Oi=!0,window.getSelection().removeAllRanges(),St&&jt(document.body,"user-select","none"))},_onDragOver:function(e){var t,i,n,r,s=this.el,o=e.target,a=this.options,l=a.group,c=Qi.active,d=bi===l,u=a.sort,h=yi||c,p=this,f=!1;if(!Pi){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),o=It(o,a.draggable,s,!0),x("dragOver"),Qi.eventCanceled)return f;if(oi.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return L(!1);if(Ii=!1,c&&!a.disabled&&(d?u||(n=ai!==ci):yi===this||(this.lastPutMode=bi.checkPull(this,c,oi,e))&&l.checkPut(this,c,oi,e))){if(r="vertical"===this._getDirection(e,o),t=qt(oi),x("dragOverValid"),Qi.eventCanceled)return f;if(n)return ai=ci,T(),this._hideClone(),x("revert"),Qi.eventCanceled||(di?ci.insertBefore(oi,di):ci.appendChild(oi)),L(!0);var g=Vt(s,a.draggable);if(!g||function(e,t,i){var n=qt(Vt(i.el,i.options.draggable)),r=Gt(i.el,i.options,li),s=10;return t?e.clientX>r.right+s||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>r.bottom+s||e.clientX>n.right&&e.clientY>n.top}(e,r,this)&&!g.animated){if(g===oi)return L(!1);if(g&&s===e.target&&(o=g),o&&(i=qt(o)),!1!==Gi(ci,s,oi,t,o,i,e,!!o))return T(),g&&g.nextSibling?s.insertBefore(oi,g.nextSibling):s.appendChild(oi),ai=s,I(),L(!0)}else if(g&&function(e,t,i){var n=qt(Bt(i.el,0,i.options,!0)),r=Gt(i.el,i.options,li),s=10;return t?e.clientX<r.left-s||e.clientY<n.top&&e.clientX<n.right:e.clientY<r.top-s||e.clientY<n.bottom&&e.clientX<n.left}(e,r,this)){var m=Bt(s,0,a,!0);if(m===oi)return L(!1);if(i=qt(o=m),!1!==Gi(ci,s,oi,t,o,i,e,!1))return T(),s.insertBefore(oi,m),ai=s,I(),L(!0)}else if(o.parentNode===s){i=qt(o);var v,b,y,_=oi.parentNode!==s,w=!function(e,t,i){var n=i?e.left:e.top,r=i?e.right:e.bottom,s=i?e.width:e.height,o=i?t.left:t.top,a=i?t.right:t.bottom,l=i?t.width:t.height;return n===o||r===a||n+s/2===o+l/2}(oi.animated&&oi.toRect||t,o.animated&&o.toRect||i,r),E=r?"top":"left",A=Rt(o,"top","top")||Rt(oi,"top","top"),S=A?A.scrollTop:void 0;if(Ci!==o&&(b=i[E],Fi=!1,Ni=!w&&a.invertSwap||_),v=function(e,t,i,n,r,s,o,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,h=!1;if(!o)if(a&&xi<c*r){if(!Fi&&(1===Di?l>d+c*s/2:l<u-c*s/2)&&(Fi=!0),Fi)h=!0;else if(1===Di?l<d+xi:l>u-xi)return-Di}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return function(e){return zt(oi)<zt(e)?1:-1}(t);if((h=h||o)&&(l<d+c*s/2||l>u-c*s/2))return l>d+c/2?1:-1;return 0}(e,o,i,r,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Ni,Ci===o),0!==v){var k=zt(oi);do{k-=v,y=ai.children[k]}while(y&&("none"===jt(y,"display")||y===li))}if(0===v||y===o)return L(!1);Ci=o,Di=v;var O=o.nextElementSibling,C=!1,D=Gi(ci,s,oi,t,o,i,e,C=1===v);if(!1!==D)return 1!==D&&-1!==D||(C=1===D),Pi=!0,setTimeout(Zi,30),T(),C&&!O?s.appendChild(oi):o.parentNode.insertBefore(oi,C?O:o),A&&Xt(A,0,S-A.scrollTop),ai=oi.parentNode,void 0===b||Ni||(xi=Math.abs(b-qt(o)[E])),I(),L(!0)}if(s.contains(oi))return L(!1)}return!1}function x(a,l){ri(a,p,gt({evt:e,isOwner:d,axis:r?"vertical":"horizontal",revert:n,dragRect:t,targetRect:i,canSort:u,fromSortable:h,target:o,completed:L,onMove:function(i,n){return Gi(ci,s,oi,t,i,qt(i),e,n)},changed:I},l))}function T(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function L(t){return x("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==h&&(Nt(oi,yi?yi.options.ghostClass:c.options.ghostClass,!1),Nt(oi,a.ghostClass,!0)),yi!==p&&p!==Qi.active?yi=p:p===Qi.active&&yi&&(yi=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===oi&&!oi.animated||o===s&&!o.animated)&&(Ci=null),a.dragoverBubble||e.rootEl||o===document||(oi.parentNode[Jt]._isOutsideThisEl(e.target),!t&&Ui(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function I(){gi=zt(oi),vi=zt(oi,a.draggable),si({sortable:p,name:"change",toEl:s,newIndex:gi,newDraggableIndex:vi,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){xt(document,"mousemove",this._onTouchMove),xt(document,"touchmove",this._onTouchMove),xt(document,"pointermove",this._onTouchMove),xt(document,"dragover",Ui),xt(document,"mousemove",Ui),xt(document,"touchmove",Ui)},_offUpEvents:function(){var e=this.el.ownerDocument;xt(e,"mouseup",this._onDrop),xt(e,"touchend",this._onDrop),xt(e,"pointerup",this._onDrop),xt(e,"pointercancel",this._onDrop),xt(e,"touchcancel",this._onDrop),xt(document,"selectstart",this)},_onDrop:function(e){var t=this.el,i=this.options;gi=zt(oi),vi=zt(oi,i.draggable),ri("drop",this,{evt:e}),ai=oi&&oi.parentNode,gi=zt(oi),vi=zt(oi,i.draggable),Qi.eventCanceled||(Li=!1,Ni=!1,Fi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nn(this.cloneId),nn(this._dragStartId),this.nativeDraggable&&(xt(document,"drop",this),xt(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),St&&jt(document.body,"user-select",""),jt(oi,"transform",""),e&&(Oi&&(e.cancelable&&e.preventDefault(),!i.dropBubble&&e.stopPropagation()),li&&li.parentNode&&li.parentNode.removeChild(li),(ci===ai||yi&&"clone"!==yi.lastPutMode)&&hi&&hi.parentNode&&hi.parentNode.removeChild(hi),oi&&(this.nativeDraggable&&xt(oi,"dragend",this),Ji(oi),oi.style["will-change"]="",Oi&&!Li&&Nt(oi,yi?yi.options.ghostClass:this.options.ghostClass,!1),Nt(oi,this.options.chosenClass,!1),si({sortable:this,name:"unchoose",toEl:ai,newIndex:null,newDraggableIndex:null,originalEvent:e}),ci!==ai?(gi>=0&&(si({rootEl:ai,name:"add",toEl:ai,fromEl:ci,originalEvent:e}),si({sortable:this,name:"remove",toEl:ai,originalEvent:e}),si({rootEl:ai,name:"sort",toEl:ai,fromEl:ci,originalEvent:e}),si({sortable:this,name:"sort",toEl:ai,originalEvent:e})),yi&&yi.save()):gi!==fi&&gi>=0&&(si({sortable:this,name:"update",toEl:ai,originalEvent:e}),si({sortable:this,name:"sort",toEl:ai,originalEvent:e})),Qi.active&&(null!=gi&&-1!==gi||(gi=fi,vi=mi),si({sortable:this,name:"end",toEl:ai,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){ri("nulling",this),ci=oi=ai=li=di=hi=ui=pi=_i=wi=Oi=gi=vi=fi=mi=Ci=Di=yi=bi=Qi.dragged=Qi.ghost=Qi.clone=Qi.active=null,$i.forEach(function(e){e.checked=!0}),$i.length=Ei=Ai=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":oi&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],i=this.el.children,n=0,r=i.length,s=this.options;n<r;n++)It(e=i[n],s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||en(e));return t},sort:function(e,t){var i={},n=this.el;this.toArray().forEach(function(e,t){var r=n.children[t];It(r,this.options.draggable,n,!1)&&(i[e]=r)},this),t&&this.captureAnimationState(),e.forEach(function(e){i[e]&&(n.removeChild(i[e]),n.appendChild(i[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return It(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var i=this.options;if(void 0===t)return i[e];var n=ii.modifyOption(this,e,t);i[e]=void 0!==n?n:t,"group"===e&&Wi(i)},destroy:function(){ri("destroy",this);var e=this.el;e[Jt]=null,xt(e,"mousedown",this._onTapStart),xt(e,"touchstart",this._onTapStart),xt(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(xt(e,"dragover",this),xt(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Mi.splice(Mi.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!pi){if(ri("hideClone",this),Qi.eventCanceled)return;jt(hi,"display","none"),this.options.removeCloneOnHide&&hi.parentNode&&hi.parentNode.removeChild(hi),pi=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(pi){if(ri("showClone",this),Qi.eventCanceled)return;oi.parentNode!=ci||this.options.group.revertClone?di?ci.insertBefore(hi,di):ci.appendChild(hi):ci.insertBefore(hi,oi),this.options.group.revertClone&&this.animate(oi,hi),jt(hi,"display",""),pi=!1}}else this._hideClone()}},Hi&&Dt(document,"touchmove",function(e){(Qi.active||Li)&&e.cancelable&&e.preventDefault()}),Qi.utils={on:Dt,off:xt,css:jt,find:$t,is:function(e,t){return!!It(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},throttle:Ut,closest:It,toggleClass:Nt,clone:Qt,index:zt,nextTick:tn,cancelNextTick:nn,detectDirection:zi,getChild:Bt,expando:Jt},Qi.get=function(e){return e[Jt]},Qi.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Qi.utils=gt(gt({},Qi.utils),e.utils)),ii.mount(e)})},Qi.create=function(e,t){return new Qi(e,t)},Qi.version="1.15.6";var rn,sn,on,an,ln,cn,dn=[],un=!1;function hn(){dn.forEach(function(e){clearInterval(e.pid)}),dn=[]}function pn(){clearInterval(cn)}var fn=Ut(function(e,t,i,n){if(t.scroll){var r,s=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=Ht(),d=!1;sn!==i&&(sn=i,hn(),rn=t.scroll,r=t.scrollFn,!0===rn&&(rn=Yt(i,!0)));var u=0,h=rn;do{var p=h,f=qt(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,_=f.height,w=void 0,E=void 0,A=p.scrollWidth,S=p.scrollHeight,k=jt(p),O=p.scrollLeft,C=p.scrollTop;p===c?(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX||"visible"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY||"visible"===k.overflowY)):(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY));var D=w&&(Math.abs(b-s)<=a&&O+y<A)-(Math.abs(v-s)<=a&&!!O),x=E&&(Math.abs(m-o)<=a&&C+_<S)-(Math.abs(g-o)<=a&&!!C);if(!dn[u])for(var T=0;T<=u;T++)dn[T]||(dn[T]={});dn[u].vx==D&&dn[u].vy==x&&dn[u].el===p||(dn[u].el=p,dn[u].vx=D,dn[u].vy=x,clearInterval(dn[u].pid),0==D&&0==x||(d=!0,dn[u].pid=setInterval(function(){n&&0===this.layer&&Qi.active._onTouchMove(ln);var t=dn[this.layer].vy?dn[this.layer].vy*l:0,i=dn[this.layer].vx?dn[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(Qi.dragged.parentNode[Jt],i,t,e,ln,dn[this.layer].el)||Xt(dn[this.layer].el,i,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&h!==c&&(h=Yt(h,!1)));un=d}},30),gn=function(e){var t=e.originalEvent,i=e.putSortable,n=e.dragEl,r=e.activeSortable,s=e.dispatchSortableEvent,o=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=i||r;o();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function mn(){}function vn(){}mn.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,i=e.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=Bt(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),i&&i.animateAll()},drop:gn},bt(mn,{pluginName:"revertOnSpill"}),vn.prototype={onSpill:function(e){var t=e.dragEl,i=e.putSortable||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:gn},bt(vn,{pluginName:"removeOnSpill"}),Qi.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?Dt(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Dt(document,"pointermove",this._handleFallbackAutoScroll):t.touches?Dt(document,"touchmove",this._handleFallbackAutoScroll):Dt(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?xt(document,"dragover",this._handleAutoScroll):(xt(document,"pointermove",this._handleFallbackAutoScroll),xt(document,"touchmove",this._handleFallbackAutoScroll),xt(document,"mousemove",this._handleFallbackAutoScroll)),pn(),hn(),clearTimeout(Mt),Mt=void 0},nulling:function(){ln=sn=rn=un=cn=on=an=null,dn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var i=this,n=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=document.elementFromPoint(n,r);if(ln=e,t||this.options.forceAutoScrollFallback||Et||wt||St){fn(e,this.options,s,t);var o=Yt(s,!0);!un||cn&&n===on&&r===an||(cn&&pn(),cn=setInterval(function(){var s=Yt(document.elementFromPoint(n,r),!0);s!==o&&(o=s,hn()),fn(e,i.options,s,t)},10),on=n,an=r)}else{if(!this.options.bubbleScroll||Yt(s,!0)===Ht())return void hn();fn(e,this.options,Yt(s,!1),!1)}}},bt(e,{pluginName:"scroll",initializeByDefault:!0})}),Qi.mount(vn,mn);class bn{initSortable(e){const t=e.el.querySelector("[data-sortable]");t&&new Qi(t,{handle:".handle-sort",draggable:"tr",sort:!0,direction:"vertical",async onEnd({item:t}){var i,n,r,s,o,a;const l=t.getAttribute("data-id");if(l){const c=null!==(n=null===(i=t.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-id"))&&void 0!==n?n:null,d=null!==(s=null===(r=t.nextElementSibling)||void 0===r?void 0:r.getAttribute("data-id"))&&void 0!==s?s:null,u=e.el.querySelector("tbody");if(u){let t=null!==(o=u.getAttribute("data-sortable-parent-path"))&&void 0!==o?o:"";t.length&&(t=`${t}-`);const i=null!==(a=u.getAttribute("data-sortable-url"))&&void 0!==a?a:"?do=sort",n={[`${t}item_id`]:l,...c?{[`${t}prev_id`]:c}:{},...d?{[`${t}next_id`]:d}:{}};return await e.ajax.request({method:"GET",url:i,data:n})}}}})}initSortableTree(e){e.el.querySelectorAll(".datagrid-tree-item-children").forEach(e=>{new Qi(e,{handle:".handle-sort",draggable:".datagrid-tree-item:not(.datagrid-tree-header)",async onEnd({item:e}){}})})}}class yn{constructor(e,t={}){this.select=e,this.opts=t}initSelectpickers(e){var t,i,n;const r=null!==(n=null!==(t=this.select)&&void 0!==t?t:null===(i=w())||void 0===i?void 0:i.TomSelect)&&void 0!==n?n:null;r&&e.forEach(e=>{e.hasAttribute("data-Tom-Initialised")||(e.setAttribute("data-Tom-Initialised","true"),new r(e,"function"==typeof this.opts?this.opts(e):this.opts))})}}function _n(e){return e[e.length-1]}function wn(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function En(e,t){return e?e.split(t):[]}function An(e,t,i){return(void 0===t||e>=t)&&(void 0===i||e<=i)}function Sn(e,t,i){return e<t?t:e>i?i:e}function kn(e,t,i={},n=0,r=""){r+=`<${Object.keys(i).reduce((e,t)=>{let r=i[t];return"function"==typeof r&&(r=r(n)),`${e} ${t}="${r}"`},e)}></${e}>`;const s=n+1;return s<t?kn(e,t,i,s,r):r}function On(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function Cn(e){return new Date(e).setHours(0,0,0,0)}function Dn(){return(new Date).setHours(0,0,0,0)}function xn(...e){switch(e.length){case 0:return Dn();case 1:return Cn(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function Tn(e,t){const i=new Date(e);return i.setDate(i.getDate()+t)}function Ln(e,t){const i=new Date(e),n=i.getMonth()+t;let r=n%12;r<0&&(r+=12);const s=i.setMonth(n);return i.getMonth()!==r?i.setDate(0):s}function In(e,t){const i=new Date(e),n=i.getMonth(),r=i.setFullYear(i.getFullYear()+t);return 1===n&&2===i.getMonth()?i.setDate(0):r}function Mn(e,t){return(e-t+7)%7}function Fn(e,t,i=0){const n=new Date(e).getDay();return Tn(e,Mn(t,i)-Mn(n,i))}function Nn(e,t){return Math.round((e-t)/6048e5)+1}function jn(e){const t=Fn(e,4,1);return Nn(t,Fn(new Date(t).setMonth(0,4),4,1))}function Pn(e,t){const i=Fn(new Date(e).setMonth(0,1),t,t),n=Fn(e,t,t),r=Nn(n,i);if(r<53)return r;return n===Fn(new Date(e).setDate(32),t,t)?1:r}function $n(e){return Pn(e,0)}function Hn(e){return Pn(e,6)}function qn(e,t){const i=new Date(e).getFullYear();return Math.floor(i/t)*t}function Rn(e,t,i){if(1!==t&&2!==t)return e;const n=new Date(e);return 1===t?i?n.setMonth(n.getMonth()+1,0):n.setDate(1):i?n.setFullYear(n.getFullYear()+1,0,0):n.setMonth(0,1),n.setHours(0,0,0,0)}const Bn=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Vn=/[\s!-/:-@[-`{-~年月日]+/;let zn={};const Wn={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,i){const n=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),n=t=>t.toLowerCase().startsWith(e);if(r=i.monthsShort.findIndex(n),r<0&&(r=i.months.findIndex(n)),r<0)return NaN}return n.setMonth(r),n.getMonth()!==Kn(r)?n.setDate(0):n.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},Yn={d:e=>e.getDate(),dd:e=>Un(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>Un(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>Un(e.getFullYear(),2).slice(-2),yyyy:e=>Un(e.getFullYear(),4)};function Kn(e){return e>-1?e%12:Kn(e+12)}function Un(e,t){return e.toString().padStart(t,"0")}function Xn(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in zn)return zn[e];const t=e.split(Bn),i=e.match(new RegExp(Bn,"g"));if(0===t.length||!i)throw new Error("Invalid date format.");const n=i.map(e=>Yn[e]),r=Object.keys(Wn).reduce((e,t)=>(i.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return zn[e]={parser(e,t){const n=e.split(Vn).reduce((e,t,n)=>{if(t.length>0&&i[n]){const r=i[n][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,i)=>{const r=Wn[i](e,n[i],t);return isNaN(r)?e:r},Dn())},formatter(e,i){let r=n.reduce((n,r,s)=>n+`${t[s]}${r(e,i)}`,"");return r+_n(t)}}}function Qn(e,t,i){if(e instanceof Date||"number"==typeof e){const t=Cn(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return Dn();if(t&&t.toValue){const n=t.toValue(e,t,i);return isNaN(n)?void 0:Cn(n)}return Xn(t).parser(e,i)}}function Gn(e,t,i){if(isNaN(e)||!e&&0!==e)return"";const n="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(n,t,i):Xn(t).formatter(n,i)}const Jn=document.createRange();function Zn(e){return Jn.createContextualFragment(e)}function er(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function tr(e){return e.getRootNode().activeElement===e}function ir(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function nr(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function rr(e){e.firstChild&&(e.removeChild(e.firstChild),rr(e))}const sr=new WeakMap,{addEventListener:or,removeEventListener:ar}=EventTarget.prototype;function lr(e,t){let i=sr.get(e);i||(i=[],sr.set(e,i)),t.forEach(e=>{or.call(...e),i.push(e)})}if(!Event.prototype.composedPath){const e=(t,i=[])=>{let n;return i.push(t),t.parentNode?n=t.parentNode:t.host?n=t.host:t.defaultView&&(n=t.defaultView),n?e(n,i):i};Event.prototype.composedPath=function(){return e(this.target)}}function cr(e,t,i){const[n,...r]=e;return t(n)?n:n!==i&&"HTML"!==n.tagName&&0!==r.length?cr(r,t,i):void 0}function dr(e,t){const i="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return cr(e.composedPath(),i,e.currentTarget)}var ur={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},hr={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:pr,format:fr,weekStart:gr}=hr;function mr(e,t){return e.length<6&&t>=0&&t<7?wn(e,t):e}function vr(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return jn;case 2:return $n;case 3:return Hn}}function br(e,t,i){return t.weekStart=e,t.weekEnd=(e+6)%7,4===i&&(t.getWeekNumber=vr(4,e)),e}function yr(e,t,i,n){const r=Qn(e,t,i);return void 0!==r?r:n}function _r(e,t,i=3){const n=parseInt(e,10);return n>=0&&n<=i?n:t}function wr(e,t,i,n=void 0){t in e&&(i in e||(e[i]=n?n(e[t]):e[t]),delete e[t])}function Er(e,t){const i=Object.assign({},e),n={},r=t.constructor.locales,s=!!t.rangeSideIndex;let{datesDisabled:o,format:a,language:l,locale:c,maxDate:d,maxView:u,minDate:h,pickLevel:p,startView:f,weekNumbers:g,weekStart:m}=t.config||{};if(wr(i,"calendarWeeks","weekNumbers",e=>e?1:0),wr(i,"clearBtn","clearButton"),wr(i,"todayBtn","todayButton"),wr(i,"todayBtnMode","todayButtonMode"),i.language){let e;if(i.language!==l&&(r[i.language]?e=i.language:(e=i.language.split("-")[0],r[e]||(e=!1))),delete i.language,e){l=n.language=e;const t=c||r[pr];c=Object.assign({format:fr,weekStart:gr},r[pr]),l!==pr&&Object.assign(c,r[l]),n.locale=c,a===t.format&&(a=n.format=c.format),m===t.weekStart&&(m=br(c.weekStart,n,g))}}if(i.format){const e="function"==typeof i.format.toDisplay,t="function"==typeof i.format.toValue,r=Bn.test(i.format);(e&&t||r)&&(a=n.format=i.format),delete i.format}let v=p;"pickLevel"in i&&(v=_r(i.pickLevel,p,2),delete i.pickLevel),v!==p&&(v>p&&("minDate"in i||(i.minDate=h),"maxDate"in i||(i.maxDate=d)),o&&!i.datesDisabled&&(i.datesDisabled=[]),p=n.pickLevel=v);let b=h,y=d;if("minDate"in i){const e=xn(0,0,1);b=null===i.minDate?e:yr(i.minDate,a,c,b),b!==e&&(b=Rn(b,p,!1)),delete i.minDate}if("maxDate"in i&&(y=null===i.maxDate?void 0:yr(i.maxDate,a,c,y),void 0!==y&&(y=Rn(y,p,!0)),delete i.maxDate),y<b?(h=n.minDate=y,d=n.maxDate=b):(h!==b&&(h=n.minDate=b),d!==y&&(d=n.maxDate=y)),i.datesDisabled){const e=i.datesDisabled;if("function"==typeof e)n.datesDisabled=null,n.checkDisabled=(t,i)=>e(new Date(t),i,s);else{const t=n.datesDisabled=e.reduce((e,t)=>{const i=Qn(t,a,c);return void 0!==i?wn(e,Rn(i,p,s)):e},[]);n.checkDisabled=e=>t.includes(e)}delete i.datesDisabled}if("defaultViewDate"in i){const e=Qn(i.defaultViewDate,a,c);void 0!==e&&(n.defaultViewDate=e),delete i.defaultViewDate}if("weekStart"in i){const e=Number(i.weekStart)%7;isNaN(e)||(m=br(e,n,g)),delete i.weekStart}if(i.daysOfWeekDisabled&&(n.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(mr,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(n.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(mr,[]),delete i.daysOfWeekHighlighted),"weekNumbers"in i){let e=i.weekNumbers;if(e){const t="function"==typeof e?(t,i)=>e(new Date(t),i):vr(e=parseInt(e,10),m);t&&(g=n.weekNumbers=e,n.getWeekNumber=t)}else g=n.weekNumbers=0,n.getWeekNumber=null;delete i.weekNumbers}if("maxNumberOfDates"in i){const e=parseInt(i.maxNumberOfDates,10);e>=0&&(n.maxNumberOfDates=e,n.multidate=1!==e),delete i.maxNumberOfDates}i.dateDelimiter&&(n.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let _=u;"maxView"in i&&(_=_r(i.maxView,u),delete i.maxView),_=p>_?p:_,_!==u&&(u=n.maxView=_);let w=f;if("startView"in i&&(w=_r(i.startView,w),delete i.startView),w<p?w=p:w>u&&(w=u),w!==f&&(n.startView=w),i.prevArrow){const e=Zn(i.prevArrow);e.childNodes.length>0&&(n.prevArrow=e.childNodes),delete i.prevArrow}if(i.nextArrow){const e=Zn(i.nextArrow);e.childNodes.length>0&&(n.nextArrow=e.childNodes),delete i.nextArrow}if("disableTouchKeyboard"in i&&(n.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const e=i.orientation.toLowerCase().split(/\s+/g);n.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete i.orientation}if("todayButtonMode"in i){switch(i.todayButtonMode){case 0:case 1:n.todayButtonMode=i.todayButtonMode}delete i.todayButtonMode}return Object.entries(i).forEach(([e,t])=>{void 0!==t&&e in hr&&(n[e]=t)}),n}const Ar={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};const Sr=e=>e.map(e=>`<button type="button" class="%buttonClass% ${e}" tabindex="-1"></button>`).join("");var kr=On(`<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n ${Sr(["prev-button prev-btn","view-switch","next-button next-btn"])}\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n ${Sr(["today-button today-btn","clear-button clear-btn"])}\n </div>\n </div>\n </div>\n</div>`),Or=On(`<div class="days">\n <div class="days-of-week">${kn("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${kn("span",42)}</div>\n</div>`),Cr=On(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${kn("span",6,{class:"week"})}</div>\n</div>`);class Dr{constructor(e,t){Object.assign(this,t,{picker:e,element:Zn('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,i){this.disabled=[];const n=this.picker;n.setViewSwitchLabel(e),n.setPrevButtonDisabled(t),n.setNextButtonDisabled(i)}setDisabled(e,t){t.add("disabled"),wn(this.disabled,e)}performBeforeHook(e,t){let i=this.beforeShow(new Date(t));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){const n=e.classList;if(!1===i.enabled&&this.setDisabled(t,n),i.classes){const e=i.classes.split(/\s+/);n.add(...e),e.includes("disabled")&&this.setDisabled(t,n)}i.content&&function(e,t){rr(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(Zn(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,i.content)}}renderCell(e,t,i,n,{selected:r,range:s},o,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=n);const l=e.classList;if(e.className=`datepicker-cell ${this.cellClass}`,i<this.first?l.add("prev"):i>this.last&&l.add("next"),l.add(...a),(o||this.checkDisabled(n,this.id))&&this.setDisabled(n,l),s){const[e,t]=s;i>e&&i<t&&l.add("range"),i===e&&l.add("range-start"),i===t&&l.add("range-end")}r.includes(i)&&l.add("selected"),i===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,n)}refreshCell(e,t,i,[n,r]){const s=e.classList;s.remove("range","range-start","range-end","selected","focused"),t>n&&t<r&&s.add("range"),t===n&&s.add("range-start"),t===r&&s.add("range-end"),i.includes(t)&&s.add("selected"),t===this.focused&&s.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class xr extends Dr{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=Zn(Or).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const i=this.locale=e.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=Zn(Cr).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(nr(this.dow),this.weekNumbers&&nr(this.weekNumbers.dow)):(ir(this.dow),this.weekNumbers&&ir(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const i=(this.weekStart+t)%7;e.textContent=this.dayNames[i],e.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),i=e.getMonth(),n=xn(t,i,1),r=Fn(n,this.weekStart,this.weekStart);this.first=n,this.last=xn(t,i+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?Dn():void 0,this.prepareForRender(Gn(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=Fn(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((i,n)=>{const r=Tn(t,7*n);i.textContent=this.getWeekNumber(r,e),n>3&&i.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const i=Tn(this.start,t),n=new Date(i),r=n.getDay(),s=[];this.today===i&&s.push("today"),this.daysOfWeekHighlighted.includes(r)&&s.push("highlighted"),this.renderCell(e,n.getDate(),i,i,this,i<this.minDate||i>this.maxDate||this.daysOfWeekDisabled.includes(r),s)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function Tr(e,t){if(!e||!e[0]||!e[1])return;const[[i,n],[r,s]]=e;return i>t||r<t?void 0:[i===t?n:-1,r===t?s:12]}class Lr extends Dr{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(Zn(kn("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=xn(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const i=new Date(t),n=i.getFullYear(),r=i.getMonth();return void 0===e[n]?e[n]=[r]:wn(e[n],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,n=this.year===this.maxYear,r=Tr(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=Rn(new Date(this.year,o,1),1,this.isRangeEnd);this.renderCell(s,this.monthNames[o],o,a,{selected:e,range:r},t||i&&o<this.minMonth||n&&o>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=Tr(this.range,this.year)||[];Array.from(this.grid.children).forEach((i,n)=>{this.refreshCell(i,n,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class Ir extends Dr{constructor(e,t){super(e,t)}init(e,t=!0){var i;t&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce((e,t,i)=>e+(i?t:t.toUpperCase()),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(Zn(kn("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=qn(e.minDate,this.step),this.minDate=xn(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=qn(e.maxDate,this.step),this.maxDate=xn(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=qn(e,this.navStep),i=t+9*this.step;this.first=t,this.last=i,this.start=t-this.step,this.focused=qn(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>wn(e,qn(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return qn(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const i=this.start+t*this.step,n=Rn(new Date(i,0,1),2,this.isRangeEnd);e.dataset.year=i,this.renderCell(e,i,i,n,this,i<this.minYear||i>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Mr(e,t){const i={bubbles:!0,cancelable:!0,detail:{date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e}};e.element.dispatchEvent(new CustomEvent(t,i))}function Fr(e,t){const{config:i,picker:n}=e,{currentView:r,viewDate:s}=n;let o;switch(r.id){case 0:o=Ln(s,t);break;case 1:o=In(s,t);break;default:o=In(s,t*r.navStep)}o=Sn(o,i.minDate,i.maxDate),n.changeFocus(o).render()}function Nr(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function jr(e){e.setDate({clear:!0})}function Pr(e){const t=Dn();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $r(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},i=e.element;tr(i)?i.addEventListener("blur",t,{once:!0}):t()}function Hr(e,t){const i=e.picker,n=new Date(i.viewDate),r=i.currentView.id,s=1===r?Ln(n,t-n.getMonth()):In(n,t-n.getFullYear());i.changeFocus(s).changeView(r-1).render()}function qr(e){Nr(e)}function Rr(e){Fr(e,-1)}function Br(e){Fr(e,1)}function Vr(e,t){const i=dr(t,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:n,isMinView:r}=e.picker.currentView,s=i.dataset;r?e.setDate(Number(s.date)):Hr(e,Number(1===n?s.month:s.year))}function zr(e){e.preventDefault()}const Wr=["left","top","right","bottom"].reduce((e,t)=>(e[t]=`datepicker-orient-${t}`,e),{}),Yr=e=>e?`${e}px`:e;function Kr(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,nr(e.controls.title)):(e.controls.title.textContent="",ir(e.controls.title))),t.prevArrow){const i=e.controls.prevButton;rr(i),t.prevArrow.forEach(e=>{i.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const i=e.controls.nextButton;rr(i),t.nextArrow.forEach(e=>{i.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?nr(e.controls.todayButton):ir(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:i}=e.datepicker.config;e.controls.todayButton.disabled=!An(Dn(),t,i)}"clearButton"in t&&(t.clearButton?nr(e.controls.clearButton):ir(e.controls.clearButton))}function Ur(e){const{dates:t,config:i,rangeSideIndex:n}=e;return Sn(t.length>0?_n(t):Rn(i.defaultViewDate,i.pickLevel,n),i.minDate,i.maxDate)}function Xr(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:i,year:n,first:r,last:s}=e.currentView,o=new Date(t).getFullYear();switch(i){case 0:return t<r||t>s;case 1:return o!==n;default:return o<r||o>s}}function Qr(e){return window.getComputedStyle(e).direction}function Gr(e){const t=er(e);if(t!==document.body&&t)return"visible"!==window.getComputedStyle(t).overflow?t:Gr(t)}class Jr{constructor(e){const{config:t,inputField:i}=this.datepicker=e,n=kr.replace(/%buttonClass%/g,t.buttonClass),r=this.element=Zn(n).firstChild,[s,o,a]=r.firstChild.children,l=s.firstElementChild,[c,d,u]=s.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:d,nextButton:u,todayButton:h,clearButton:p};this.main=o,this.controls=f;const g=i?"dropdown":"inline";r.classList.add(`datepicker-${g}`),Kr(this,t),this.viewDate=Ur(e),lr(e,[[r,"mousedown",zr],[o,"click",Vr.bind(null,e)],[f.viewSwitch,"click",qr.bind(null,e)],[f.prevButton,"click",Rr.bind(null,e)],[f.nextButton,"click",Br.bind(null,e)],[f.todayButton,"click",Pr.bind(null,e)],[f.clearButton,"click",jr.bind(null,e)]]),this.views=[new xr(this),new Lr(this),new Ir(this,{id:2,name:"years",cellClass:"year",step:1}),new Ir(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):i.after(this.element)}setOptions(e){Kr(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,i=e.inputField;if(i){const n=Qr(i);n!==Qr(er(t))?t.dir=n:t.dir&&t.removeAttribute("dir"),this.place(),t.classList.add("active"),e.config.disableTouchKeyboard&&i.blur()}else t.classList.add("active");this.active=!0,Mr(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Mr(this.datepicker,"hide"))}place(){const{classList:e,style:t}=this.element;t.display="block";const{width:i,height:n}=this.element.getBoundingClientRect(),r=this.element.offsetParent;t.display="";const{config:s,inputField:o}=this.datepicker,{left:a,top:l,right:c,bottom:d,width:u,height:h}=o.getBoundingClientRect();let{x:p,y:f}=s.orientation,g=a,m=l;if(r!==document.body&&r){const e=r.getBoundingClientRect();g-=e.left-r.scrollLeft,m-=e.top-r.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=Gr(o);let b=0,y=0,{clientWidth:_,clientHeight:w}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(y=e.top),e.left>0&&(b=e.left),e.right<_&&(_=e.right),e.bottom<w&&(w=e.bottom)}let E=0;"auto"===p&&(a<b?(p="left",E=b-a):a+i>_?(p="right",_<c&&(E=_-c)):p="rtl"===Qr(o)?c-i<b?"left":"right":"left"),"right"===p&&(g+=u-i),g+=E,"auto"===f&&(f=l-n>y&&d+n>w?"top":"bottom"),"top"===f?m-=n:m+=h,e.remove(...Object.values(Wr)),e.add(Wr[p],Wr[f]),t.left=Yr(g),t.top=Yr(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Xr(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e=void 0){const t=void 0===e?Ur(this.datepicker):e;return this._renderMethod=Xr(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:i,_oldView:n}=this,r=new Date(this._oldViewDate),s=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[s](),n&&(this.main.replaceChild(t.element,n.element),Mr(i,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&Mr(i,"changeYear"),e.getMonth()!==r.getMonth()&&Mr(i,"changeMonth")}}}function Zr(e,t,i,n,r,s){if(An(e,r,s)){if(n(e)){return Zr(t(e,i),t,i,n,r,s)}return e}}function es(e,t,i){const n=e.picker,r=n.currentView,s=r.step||1;let o,a=n.viewDate;switch(r.id){case 0:a=Tn(a,i?7*t:t),o=Tn;break;case 1:a=Ln(a,i?4*t:t),o=Ln;break;default:a=In(a,t*(i?4:1)*s),o=In}a=Zr(a,o,t<0?-s:s,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&n.changeFocus(a).render()}function ts(e,t){const{config:i,picker:n,editMode:r}=e,s=n.active,{key:o,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,d=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===o)return void $r(e);if("Enter"===o){if(s)if(r)e.exitEditMode({update:!0,autohide:i.autohide});else{const t=n.currentView;t.isMinView?e.setDate(n.viewDate):(n.changeView(t.id-1).render(),d())}else e.update();return}const u=i.shortcutKeys,h={key:o,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(u).find(e=>{const t=u[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):s?"hide"===p?t=p:"prevButton"===p?t=[Fr,[e,-1]]:"nextButton"===p?t=[Fr,[e,1]]:"viewSwitch"===p?t=[Nr,[e]]:i.clearButton&&"clearButton"===p?t=[jr,[e]]:i.todayButton&&"todayButton"===p&&(t=[Pr,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void d()}if(!s||r)return;const f=(i,n)=>{l||c||a?e.enterEditMode():(es(e,i,n),t.preventDefault())};"ArrowLeft"===o?f(-1,!1):"ArrowRight"===o?f(1,!1):"ArrowUp"===o?f(-1,!0):"ArrowDown"===o?f(1,!0):("Backspace"===o||"Delete"===o||o&&1===o.length&&!c)&&e.enterEditMode()}function is(e){e.config.showOnFocus&&!e._showing&&e.show()}function ns(e,t){const i=t.target;(e.picker.active||e.config.showOnClick)&&(i._active=tr(i),i._clicking=setTimeout(()=>{delete i._active,delete i._clicking},2e3))}function rs(e,t){const i=t.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&e.enterEditMode(),delete i._active,e.config.showOnClick&&e.show())}function ss(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function os(e,t){const{element:i,picker:n}=e;if(!n.active&&!tr(i))return;const r=n.element;dr(t,e=>e===i||e===r)||$r(e)}function as(e,t){return e.map(e=>Gn(e,t.format,t.locale)).join(t.dateDelimiter)}function ls(e,t,i=!1){if(0===t.length)return i?[]:void 0;const{config:n,dates:r,rangeSideIndex:s}=e,{pickLevel:o,maxNumberOfDates:a}=n;let l=t.reduce((e,t)=>{let i=Qn(t,n.format,n.locale);return void 0===i||(i=Rn(i,o,s),!An(i,n.minDate,n.maxDate)||e.includes(i)||n.checkDisabled(i,o)||!(o>0)&&n.daysOfWeekDisabled.includes(new Date(i).getDay())||e.push(i)),e},[]);return 0!==l.length?(n.multidate&&!i&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function cs(e,t=3,i=!0,n=void 0){const{config:r,picker:s,inputField:o}=e;if(2&t){const e=s.active?r.pickLevel:r.startView;s.update(n).changeView(e).render(i)}1&t&&o&&(o.value=as(e.dates,r))}function ds(e,t,i){const n=e.config;let{clear:r,render:s,autohide:o,revert:a,forceRefresh:l,viewDate:c}=i;void 0===s&&(s=!0),s?void 0===o&&(o=n.autohide):o=l=!1,c=Qn(c,n.format,n.locale);const d=ls(e,t,r);(d||a)&&(d&&d.toString()!==e.dates.toString()?(e.dates=d,cs(e,s?3:1,!0,c),Mr(e,"changeDate")):cs(e,l?3:1,!0,c),o&&e.hide())}function us(e,t){return t?i=>Gn(i,t,e.config.locale):e=>new Date(e)}class hs{constructor(e,t={},i=void 0){e.datepicker=this,this.element=e,this.dates=[];const n=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:Dn(),maxDate:void 0,minDate:void 0},Er(hr,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(n.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):n.container=e,i){const e=i.inputs.indexOf(r),t=i.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=i,this.rangeSideIndex=e}this._options=t,Object.assign(n,Er(t,this)),n.shortcutKeys=function(e){return Object.keys(Ar).reduce((t,i)=>{const n=void 0===e[i]?Ar[i]:e[i],r=n&&n.key;if(!r||"string"!=typeof r)return t;const s={key:r,ctrlOrMetaKey:!!(n.ctrlOrMetaKey||n.ctrlKey||n.metaKey)};return r.length>1&&(s.altKey=!!n.altKey,s.shiftKey=!!n.shiftKey),t[i]=s,t},{})}(t.shortcutKeys||{});const s=En(e.value||e.dataset.date,n.dateDelimiter);delete e.dataset.date;const o=ls(this,s);o&&o.length>0&&(this.dates=o),r&&(r.value=as(this.dates,n));const a=this.picker=new Jr(this),l=[e,"keydown",ts.bind(null,this)];r?lr(this,[l,[r,"focus",is.bind(null,this)],[r,"mousedown",ns.bind(null,this)],[r,"click",rs.bind(null,this)],[r,"paste",ss.bind(null,this)],[document,"mousedown",os.bind(null,this)],[window,"resize",a.place.bind(a)]]):(lr(this,[l]),this.show())}static formatDate(e,t,i){return Gn(e,t,i&&ur[i]||ur.en)}static parseDate(e,t,i){return Qn(e,t,i&&ur[i]||ur.en)}static get locales(){return ur}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=Er(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),cs(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;tr(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),function(e){let t=sr.get(e);t&&(t.forEach(e=>{ar.call(...e)}),sr.delete(e))}(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e=void 0){const t=us(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],i={},n=_n(e);!n||"object"!=typeof n||Array.isArray(n)||n instanceof Date||Object.assign(i,t.pop());ds(this,Array.isArray(t[0])?t[0]:t,i)}update(e=void 0){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});ds(this,En(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e=void 0){return us(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:i,picker:n,active:r,rangeSideIndex:s}=this,o=i.pickLevel,a=Qn(e,i.format,i.locale);void 0!==a&&(n.changeFocus(Rn(a,o,s)),r&&t&&n.changeView(o),n.render())}refresh(e=void 0,t=!1){let i;e&&"string"!=typeof e&&(t=e,e=void 0),i="picker"===e?2:"input"===e?1:3,cs(this,i,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e=void 0){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}class ps{constructor(e={}){this.opts=e}initDatepickers(e){e.forEach(e=>{const t="function"==typeof this.opts?this.opts(e):this.opts;new hs(e,{...t,updateOnBlur:!1}),e.addEventListener("changeDate",()=>{const t=e.closest("form");t&&t.submit()})})}}class fs extends EventTarget{constructor(e,t,i){super(),this.el=e,this.options={...fs.defaultOptions,...i};const n=this.resolveDatagridName();if(!n)throw new Error("Cannot resolve name of a datagrid!");this.name=n,this.ajax="function"==typeof t?t(this):t,this.ajax.addEventListener("success",e=>{var t,i;(null===(t=e.detail.payload)||void 0===t?void 0:t._datagrid_name)===this.name&&(null===(i=e.detail.payload)||void 0===i?void 0:i._datagrid_init)&&this.init()}),this.init()}init(){!this.dispatch("beforeInit",{datagrid:this})||this.options.plugins.forEach(e=>{var t;null===(t=e.onDatagridInit)||void 0===t||t.call(e,this)});const e=this.el.querySelectorAll("input[data-check]:checked");if(1===e.length&&"toggle-all"===e[0].getAttribute("name")){const t=e[0];t&&(t.checked=!1)}this.el.querySelectorAll("input[data-datagrid-manualsubmit]").forEach(e=>{const t=e.closest("form");t&&e.addEventListener("keydown",e=>{if(_(e))return e.stopPropagation(),e.preventDefault(),this.ajax.submitForm(t)})}),this.ajax.addEventListener("success",({detail:{payload:e}})=>{var t;if(e._datagrid_name&&e._datagrid_name===this.name){const i=e=>e.getAttribute("data-datagrid-reset-filter-by-column"),n=Array.from(this.el.querySelectorAll("[data-datagrid-reset-filter-by-column]")),r=e.non_empty_filters?e.non_empty_filters:[];if(n.forEach(e=>{const t=i(e);t&&r.includes(t)?e.classList.remove("hidden"):e.classList.add("hidden")}),r.length>0){const e=null===(t=this.el.querySelector(".reset-filter"))||void 0===t?void 0:t.getAttribute("href");e&&n.forEach(t=>{const n=i(t),r=e.replace("-resetFilter","-resetColumnFilter");t.setAttribute("href",`${r}&${this.name}-key=${n}`)})}}}),this.dispatch("afterInit",{datagrid:this})}confirm(e){return this.options.confirm.bind(this)(e)}resolveDatagridName(){return this.options.resolveDatagridName.bind(this)(this.el)}dispatch(e,t,i){return this.dispatchEvent(new CustomEvent(e,{detail:t}))}}fs.defaultOptions={confirm:confirm,resolveDatagridName:function(e){const t=e.getAttribute("data-datagrid-name");if(t)return t;console.warn("Deprecated name resolution for datagrid",e,": Please add a data-datagrid-name attribute instead!\nCurrently, the Datagrid library relies on matching the name from the 'datagrid-[name]' class, which is unreliable and may cause bugs if the default class names are not used (eg. if you add a datagrid-xx class, or change the name class completely!)\nAlternatively, you can customize the name resolution with the `resolveDatagridName` option. See TBD for more info.");const i=e.classList.value.split(" ");for(const e of i){if(!e.startsWith("datagrid-"))continue;const[,...t]=e.split("-"),i=t.join("-");return i.length<1?(console.error(`Failed to resolve datagrid name - ambigious class name '${e}'`),null):i}return null},plugins:[]};class gs{constructor(e,t={}){this.ajax=e,this.datagrids=[],this.options={selector:"div[data-datagrid-name]",datagrid:{},root:document.body,...t};const i="string"==typeof this.options.root?document.querySelector(this.options.root):this.options.root;if(!(i&&i instanceof HTMLElement))throw new Error("Root element not found or is not an HTMLElement");this.root=i,this.init()}init(){var e,t;this.ajax.onInit(),(null!==(t=null===(e=this.options.datagrid)||void 0===e?void 0:e.plugins)&&void 0!==t?t:[]).forEach(e=>{var t;return null===(t=e.onInit)||void 0===t?void 0:t.call(e,this)}),this.initDatagrids()}initDatagrids(){this.datagrids=Array.from(this.root.querySelectorAll(this.options.selector)).map(e=>new fs(e,this.ajax,this.options.datagrid))}}class ms extends EventTarget{constructor(e){if(!e.VERSION||e.VERSION<2)throw new Error("NajaAjax supports Naja 2 and higher"+(e.VERSION?`(version ${e.VERSION} provided)`:""));super(),this.client=e}onInit(){return this.client.addEventListener("before",e=>this.dispatch("before",{params:e.detail})),this.client.uiHandler.addEventListener("interaction",e=>{if(!(e.detail.element instanceof HTMLElement))throw new Error("Element is not an instanceof HTMLElement");const t=this.dispatch("interact",{...e.detail,element:e.detail.element});return t||(e.stopPropagation(),e.preventDefault()),t}),this.client.addEventListener("success",e=>this.dispatch("success",{...e.detail,params:e.detail.request,payload:e.detail.payload})),this.client.addEventListener("error",e=>this.dispatch("error",{...e.detail,params:e.detail.request,response:e.detail.response})),this.client.addEventListener("complete",e=>this.dispatch("complete",{...e.detail,params:e.detail.request,response:e.detail.response})),this}async request(e){return await this.client.makeRequest(e.method,e.url,e.data)}async submitForm(e){return await this.client.uiHandler.submitForm(e)}dispatch(e,t,i){return this.dispatchEvent(new CustomEvent(e,{detail:t,cancelable:!0}))}}var vs="top",bs="bottom",ys="right",_s="left",ws="auto",Es=[vs,bs,ys,_s],As="start",Ss="end",ks="clippingParents",Os="viewport",Cs="popper",Ds="reference",xs=Es.reduce(function(e,t){return e.concat([t+"-"+As,t+"-"+Ss])},[]),Ts=[].concat(Es,[ws]).reduce(function(e,t){return e.concat([t,t+"-"+As,t+"-"+Ss])},[]),Ls="beforeRead",Is="read",Ms="afterRead",Fs="beforeMain",Ns="main",js="afterMain",Ps="beforeWrite",$s="write",Hs="afterWrite",qs=[Ls,Is,Ms,Fs,Ns,js,Ps,$s,Hs];function Rs(e){return e?(e.nodeName||"").toLowerCase():null}function Bs(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Vs(e){return e instanceof Bs(e).Element||e instanceof Element}function zs(e){return e instanceof Bs(e).HTMLElement||e instanceof HTMLElement}function Ws(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Bs(e).ShadowRoot||e instanceof ShadowRoot)}var Ys={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},r=t.elements[e];zs(r)&&Rs(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});zs(n)&&Rs(n)&&(Object.assign(n.style,s),Object.keys(r).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};function Ks(e){return e.split("-")[0]}var Us=Math.max,Xs=Math.min,Qs=Math.round;function Gs(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Js(){return!/^((?!chrome|android).)*safari/i.test(Gs())}function Zs(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),r=1,s=1;t&&zs(e)&&(r=e.offsetWidth>0&&Qs(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Qs(n.height)/e.offsetHeight||1);var o=(Vs(e)?Bs(e):window).visualViewport,a=!Js()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,d=n.width/r,u=n.height/s;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function eo(e){var t=Zs(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function to(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Ws(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function io(e){return Bs(e).getComputedStyle(e)}function no(e){return["table","td","th"].indexOf(Rs(e))>=0}function ro(e){return((Vs(e)?e.ownerDocument:e.document)||window.document).documentElement}function so(e){return"html"===Rs(e)?e:e.assignedSlot||e.parentNode||(Ws(e)?e.host:null)||ro(e)}function oo(e){return zs(e)&&"fixed"!==io(e).position?e.offsetParent:null}function ao(e){for(var t=Bs(e),i=oo(e);i&&no(i)&&"static"===io(i).position;)i=oo(i);return i&&("html"===Rs(i)||"body"===Rs(i)&&"static"===io(i).position)?t:i||function(e){var t=/firefox/i.test(Gs());if(/Trident/i.test(Gs())&&zs(e)&&"fixed"===io(e).position)return null;var i=so(e);for(Ws(i)&&(i=i.host);zs(i)&&["html","body"].indexOf(Rs(i))<0;){var n=io(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function lo(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function co(e,t,i){return Us(e,Xs(t,i))}function uo(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ho(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var po={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ks(i.placement),l=lo(a),c=[_s,ys].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(e,t){return uo("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ho(e,Es))}(r.padding,i),u=eo(s),h="y"===l?vs:_s,p="y"===l?bs:ys,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],g=o[l]-i.rects.reference[l],m=ao(s),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=f/2-g/2,y=d[h],_=v-u[c]-d[p],w=v/2-u[c]/2+b,E=co(y,w,_),A=l;i.modifiersData[n]=((t={})[A]=E,t.centerOffset=E-w,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&to(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fo(e){return e.split("-")[1]}var go={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mo(e){var t,i=e.popper,n=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,g=void 0===f?0:f,m="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=_s,_=vs,w=window;if(c){var E=ao(i),A="clientHeight",S="clientWidth";if(E===Bs(i)&&"static"!==io(E=ro(i)).position&&"absolute"===a&&(A="scrollHeight",S="scrollWidth"),r===vs||(r===_s||r===ys)&&s===Ss)_=bs,g-=(u&&E===w&&w.visualViewport?w.visualViewport.height:E[A])-n.height,g*=l?1:-1;if(r===_s||(r===vs||r===bs)&&s===Ss)y=ys,p-=(u&&E===w&&w.visualViewport?w.visualViewport.width:E[S])-n.width,p*=l?1:-1}var k,O=Object.assign({position:a},c&&go),C=!0===d?function(e,t){var i=e.x,n=e.y,r=t.devicePixelRatio||1;return{x:Qs(i*r)/r||0,y:Qs(n*r)/r||0}}({x:p,y:g},Bs(i)):{x:p,y:g};return p=C.x,g=C.y,l?Object.assign({},O,((k={})[_]=b?"0":"",k[y]=v?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k)):Object.assign({},O,((t={})[_]=b?g+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var vo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:Ks(t.placement),variation:fo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,mo(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,mo(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},bo={passive:!0};var yo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=Bs(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(e){e.addEventListener("scroll",i.update,bo)}),a&&l.addEventListener("resize",i.update,bo),function(){s&&c.forEach(function(e){e.removeEventListener("scroll",i.update,bo)}),a&&l.removeEventListener("resize",i.update,bo)}},data:{}},_o={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(e){return e.replace(/left|right|bottom|top/g,function(e){return _o[e]})}var Eo={start:"end",end:"start"};function Ao(e){return e.replace(/start|end/g,function(e){return Eo[e]})}function So(e){var t=Bs(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ko(e){return Zs(ro(e)).left+So(e).scrollLeft}function Oo(e){var t=io(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Co(e){return["html","body","#document"].indexOf(Rs(e))>=0?e.ownerDocument.body:zs(e)&&Oo(e)?e:Co(so(e))}function Do(e,t){var i;void 0===t&&(t=[]);var n=Co(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=Bs(n),o=r?[s].concat(s.visualViewport||[],Oo(n)?n:[]):n,a=t.concat(o);return r?a:a.concat(Do(so(o)))}function xo(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function To(e,t,i){return t===Os?xo(function(e,t){var i=Bs(e),n=ro(e),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Js();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ko(e),y:l}}(e,i)):Vs(t)?function(e,t){var i=Zs(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):xo(function(e){var t,i=ro(e),n=So(e),r=null==(t=e.ownerDocument)?void 0:t.body,s=Us(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Us(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ko(e),l=-n.scrollTop;return"rtl"===io(r||i).direction&&(a+=Us(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(ro(e)))}function Lo(e,t,i,n){var r="clippingParents"===t?function(e){var t=Do(so(e)),i=["absolute","fixed"].indexOf(io(e).position)>=0&&zs(e)?ao(e):e;return Vs(i)?t.filter(function(e){return Vs(e)&&to(e,i)&&"body"!==Rs(e)}):[]}(e):[].concat(t),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(t,i){var r=To(e,i,n);return t.top=Us(r.top,t.top),t.right=Xs(r.right,t.right),t.bottom=Xs(r.bottom,t.bottom),t.left=Us(r.left,t.left),t},To(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Io(e){var t,i=e.reference,n=e.element,r=e.placement,s=r?Ks(r):null,o=r?fo(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case vs:t={x:a,y:i.y-n.height};break;case bs:t={x:a,y:i.y+i.height};break;case ys:t={x:i.x+i.width,y:l};break;case _s:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=s?lo(s):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case As:t[c]=t[c]-(i[d]/2-n[d]/2);break;case Ss:t[c]=t[c]+(i[d]/2-n[d]/2)}}return t}function Mo(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=void 0===n?e.placement:n,s=i.strategy,o=void 0===s?e.strategy:s,a=i.boundary,l=void 0===a?ks:a,c=i.rootBoundary,d=void 0===c?Os:c,u=i.elementContext,h=void 0===u?Cs:u,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,m=void 0===g?0:g,v=uo("number"!=typeof m?m:ho(m,Es)),b=h===Cs?Ds:Cs,y=e.rects.popper,_=e.elements[f?b:h],w=Lo(Vs(_)?_:_.contextElement||ro(e.elements.popper),l,d,o),E=Zs(e.elements.reference),A=Io({reference:E,element:y,placement:r}),S=xo(Object.assign({},y,A)),k=h===Cs?S:E,O={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},C=e.modifiersData.offset;if(h===Cs&&C){var D=C[r];Object.keys(O).forEach(function(e){var t=[ys,bs].indexOf(e)>=0?1:-1,i=[vs,bs].indexOf(e)>=0?"y":"x";O[e]+=D[i]*t})}return O}function Fo(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Ts:l,d=fo(n),u=d?a?xs:xs.filter(function(e){return fo(e)===d}):Es,h=u.filter(function(e){return c.indexOf(e)>=0});0===h.length&&(h=u);var p=h.reduce(function(t,i){return t[i]=Mo(e,{placement:i,boundary:r,rootBoundary:s,padding:o})[Ks(i)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}var No={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,h=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,m=t.options.placement,v=Ks(m),b=l||(v===m||!f?[wo(m)]:function(e){if(Ks(e)===ws)return[];var t=wo(e);return[Ao(e),t,Ao(t)]}(m)),y=[m].concat(b).reduce(function(e,i){return e.concat(Ks(i)===ws?Fo(t,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:g}):i)},[]),_=t.rects.reference,w=t.rects.popper,E=new Map,A=!0,S=y[0],k=0;k<y.length;k++){var O=y[k],C=Ks(O),D=fo(O)===As,x=[vs,bs].indexOf(C)>=0,T=x?"width":"height",L=Mo(t,{placement:O,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=x?D?ys:_s:D?bs:vs;_[T]>w[T]&&(I=wo(I));var M=wo(I),F=[];if(s&&F.push(L[C]<=0),a&&F.push(L[I]<=0,L[M]<=0),F.every(function(e){return e})){S=O,A=!1;break}E.set(O,F)}if(A)for(var N=function(e){var t=y.find(function(t){var i=E.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return S=t,"break"},j=f?3:1;j>0;j--){if("break"===N(j))break}t.placement!==S&&(t.modifiersData[n]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jo(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Po(e){return[vs,ys,bs,_s].some(function(t){return e[t]>=0})}var $o={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=Mo(t,{elementContext:"reference"}),a=Mo(t,{altBoundary:!0}),l=jo(o,n),c=jo(a,r,s),d=Po(l),u=Po(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Ho={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=void 0===r?[0,0]:r,o=Ts.reduce(function(e,i){return e[i]=function(e,t,i){var n=Ks(e),r=[_s,vs].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},t,{placement:e})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[_s,ys].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,t.rects,s),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}};var qo={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=Io({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var Ro={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,h=i.tether,p=void 0===h||h,f=i.tetherOffset,g=void 0===f?0:f,m=Mo(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ks(t.placement),b=fo(t.placement),y=!b,_=lo(v),w="x"===_?"y":"x",E=t.modifiersData.popperOffsets,A=t.rects.reference,S=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,O="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(E){if(s){var x,T="y"===_?vs:_s,L="y"===_?bs:ys,I="y"===_?"height":"width",M=E[_],F=M+m[T],N=M-m[L],j=p?-S[I]/2:0,P=b===As?A[I]:S[I],H=b===As?-S[I]:-A[I],q=t.elements.arrow,R=p&&q?eo(q):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=B[T],z=B[L],W=co(0,A[I],R[I]),Y=y?A[I]/2-j-W-V-O.mainAxis:P-W-V-O.mainAxis,K=y?-A[I]/2+j+W+z+O.mainAxis:H+W+z+O.mainAxis,U=t.elements.arrow&&ao(t.elements.arrow),X=U?"y"===_?U.clientTop||0:U.clientLeft||0:0,Q=null!=(x=null==C?void 0:C[_])?x:0,G=M+K-Q,J=co(p?Xs(F,M+Y-Q-X):F,M,p?Us(N,G):N);E[_]=J,D[_]=J-M}if(a){var Z,ee="x"===_?vs:_s,te="x"===_?bs:ys,ie=E[w],ne="y"===w?"height":"width",re=ie+m[ee],se=ie-m[te],oe=-1!==[vs,_s].indexOf(v),ae=null!=(Z=null==C?void 0:C[w])?Z:0,le=oe?re:ie-A[ne]-S[ne]-ae+O.altAxis,ce=oe?ie+A[ne]+S[ne]-ae-O.altAxis:se,de=p&&oe?function(e,t,i){var n=co(e,t,i);return n>i?i:n}(le,ie,ce):co(p?le:re,ie,p?ce:se);E[w]=de,D[w]=de-ie}t.modifiersData[n]=D}},requiresIfExists:["offset"]};function Bo(e,t,i){void 0===i&&(i=!1);var n,r,s=zs(t),o=zs(t)&&function(e){var t=e.getBoundingClientRect(),i=Qs(t.width)/e.offsetWidth||1,n=Qs(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),a=ro(t),l=Zs(e,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!i)&&(("body"!==Rs(t)||Oo(a))&&(c=(n=t)!==Bs(n)&&zs(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:So(n)),zs(t)?((d=Zs(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=ko(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Vo(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||r(e)}),n}var zo={placement:"bottom",modifiers:[],strategy:"absolute"};function Wo(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Yo(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,r=t.defaultOptions,s=void 0===r?zo:r;return function(e,t,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},zo,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:Vs(e)?Do(e):e.contextElement?Do(e.contextElement):[],popper:Do(t)};var o,c,h=function(e){var t=Vo(e);return qs.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((o=[].concat(n,a.options.modifiers),c=o.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=h.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var s=r({state:a,name:t,instance:d,options:n}),o=function(){};l.push(s||o)}}),d.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,i=e.popper;if(Wo(t,i)){a.rects={reference:Bo(t,ao(i),"fixed"===a.options.strategy),popper:eo(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise(function(e){d.forceUpdate(),e(a)})},function(){return o||(o=new Promise(function(e){Promise.resolve().then(function(){o=void 0,e(r())})})),o}),destroy:function(){u(),c=!0}};if(!Wo(e,t))return d;function u(){l.forEach(function(e){return e()}),l=[]}return d.setOptions(i).then(function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)}),d}}var Ko=Yo(),Uo=Yo({defaultModifiers:[yo,qo,vo,Ys]}),Xo=Yo({defaultModifiers:[yo,qo,vo,Ys,Ho,No,Ro,po,$o]}),Qo=Object.freeze({__proto__:null,afterMain:js,afterRead:Ms,afterWrite:Hs,applyStyles:Ys,arrow:po,auto:ws,basePlacements:Es,beforeMain:Fs,beforeRead:Ls,beforeWrite:Ps,bottom:bs,clippingParents:ks,computeStyles:vo,createPopper:Xo,createPopperBase:Ko,createPopperLite:Uo,detectOverflow:Mo,end:Ss,eventListeners:yo,flip:No,hide:$o,left:_s,main:Ns,modifierPhases:qs,offset:Ho,placements:Ts,popper:Cs,popperGenerator:Yo,popperOffsets:qo,preventOverflow:Ro,read:Is,reference:Ds,right:ys,start:As,top:vs,variationPlacements:xs,viewport:Os,write:$s});
14
14
  /*!
15
15
  * Bootstrap v5.3.7 (https://getbootstrap.com/)
16
16
  * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
17
17
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
18
18
  */
19
- const Qo=new Map,Go={set(e,t,i){Qo.has(e)||Qo.set(e,new Map);const n=Qo.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>Qo.has(e)&&Qo.get(e).get(t)||null,remove(e,t){if(!Qo.has(e))return;const i=Qo.get(e);i.delete(t),0===i.size&&Qo.delete(e)}},Jo="transitionend",Zo=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),ea=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),ta=e=>{e.dispatchEvent(new Event(Jo))},ia=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),na=e=>ia(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(Zo(e)):null,ra=e=>{if(!ia(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},sa=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),oa=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?oa(e.parentNode):null},aa=()=>{},la=e=>{e.offsetHeight},ca=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,da=[],ua=()=>"rtl"===document.documentElement.dir,ha=e=>{var t;t=()=>{const t=ca();if(t){const i=e.NAME,n=t.fn[i];t.fn[i]=e.jQueryInterface,t.fn[i].Constructor=e,t.fn[i].noConflict=()=>(t.fn[i]=n,e.jQueryInterface)}},"loading"===document.readyState?(da.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of da)e()}),da.push(t)):t()},pa=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,fa=(e,t,i=!0)=>{if(!i)return void pa(e);const n=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),r=Number.parseFloat(i);return n||r?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let r=!1;const s=({target:i})=>{i===t&&(r=!0,t.removeEventListener(Jo,s),pa(e))};t.addEventListener(Jo,s),setTimeout(()=>{r||ta(t)},n)},ga=(e,t,i,n)=>{const r=e.length;let s=e.indexOf(t);return-1===s?!i&&n?e[r-1]:e[0]:(s+=i?1:-1,n&&(s=(s+r)%r),e[Math.max(0,Math.min(s,r-1))])},ma=/[^.]*(?=\..*)\.|.*/,va=/\..*/,ba=/::\d+$/,ya={};let _a=1;const wa={mouseenter:"mouseover",mouseleave:"mouseout"},Ea=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Aa(e,t){return t&&`${t}::${_a++}`||e.uidEvent||_a++}function Sa(e){const t=Aa(e);return e.uidEvent=t,ya[t]=ya[t]||{},ya[t]}function ka(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function Oa(e,t,i){const n="string"==typeof t,r=n?i:t||i;let s=Ta(e);return Ea.has(s)||(s=e),[n,r,s]}function Ca(e,t,i,n,r){if("string"!=typeof t||!e)return;let[s,o,a]=Oa(t,i,n);if(t in wa){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};o=e(o)}const l=Sa(e),c=l[a]||(l[a]={}),d=ka(c,o,s?i:null);if(d)return void(d.oneOff=d.oneOff&&r);const u=Aa(o,t.replace(ma,"")),h=s?function(e,t,i){return function n(r){const s=e.querySelectorAll(t);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of s)if(a===o)return Ia(r,{delegateTarget:o}),n.oneOff&&La.off(e,r.type,t,i),i.apply(o,[r])}}(e,i,o):function(e,t){return function i(n){return Ia(n,{delegateTarget:e}),i.oneOff&&La.off(e,n.type,t),t.apply(e,[n])}}(e,o);h.delegationSelector=s?i:null,h.callable=o,h.oneOff=r,h.uidEvent=u,c[u]=h,e.addEventListener(a,h,s)}function Da(e,t,i,n,r){const s=ka(t[i],n,r);s&&(e.removeEventListener(i,s,Boolean(r)),delete t[i][s.uidEvent])}function xa(e,t,i,n){const r=t[i]||{};for(const[s,o]of Object.entries(r))s.includes(n)&&Da(e,t,i,o.callable,o.delegationSelector)}function Ta(e){return e=e.replace(va,""),wa[e]||e}const La={on(e,t,i,n){Ca(e,t,i,n,!1)},one(e,t,i,n){Ca(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[r,s,o]=Oa(t,i,n),a=o!==t,l=Sa(e),c=l[o]||{},d=t.startsWith(".");if(void 0===s){if(d)for(const i of Object.keys(l))xa(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const r=i.replace(ba,"");a&&!t.includes(r)||Da(e,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;Da(e,l,o,s,r?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const n=ca();let r=null,s=!0,o=!0,a=!1;t!==Ta(t)&&n&&(r=n.Event(t,i),n(e).trigger(r),s=!r.isPropagationStopped(),o=!r.isImmediatePropagationStopped(),a=r.isDefaultPrevented());const l=Ia(new Event(t,{bubbles:s,cancelable:!0}),i);return a&&l.preventDefault(),o&&e.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function Ia(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function Ma(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function Fa(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Na={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${Fa(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${Fa(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=Ma(e.dataset[n])}return t},getDataAttribute:(e,t)=>Ma(e.getAttribute(`data-bs-${Fa(t)}`))};class ja{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=ia(t)?Na.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...ia(t)?Na.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],r=ia(t)?"element":ea(t);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${n}".`)}}}class Pa extends ja{constructor(e,t){super(),(e=na(e))&&(this._element=e,this._config=this._getConfig(t),Go.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Go.remove(this._element,this.constructor.DATA_KEY),La.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){fa(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Go.get(na(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.7"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const $a=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map(e=>Zo(e)).join(","):null},Ha={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!sa(e)&&ra(e))},getSelectorFromElement(e){const t=$a(e);return t&&Ha.findOne(t)?t:null},getElementFromSelector(e){const t=$a(e);return t?Ha.findOne(t):null},getMultipleElementsFromSelector(e){const t=$a(e);return t?Ha.find(t):[]}},qa=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;La.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),sa(this))return;const r=Ha.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(r)[t]()})},Ra=".bs.alert",Ba=`close${Ra}`,Va=`closed${Ra}`;class za extends Pa{static get NAME(){return"alert"}close(){if(La.trigger(this._element,Ba).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),La.trigger(this._element,Va),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=za.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}qa(za,"close"),ha(za);const Wa='[data-bs-toggle="button"]';class Ya extends Pa{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Ya.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}La.on(document,"click.bs.button.data-api",Wa,e=>{e.preventDefault();const t=e.target.closest(Wa);Ya.getOrCreateInstance(t).toggle()}),ha(Ya);const Ka=".bs.swipe",Ua=`touchstart${Ka}`,Xa=`touchmove${Ka}`,Qa=`touchend${Ka}`,Ga=`pointerdown${Ka}`,Ja=`pointerup${Ka}`,Za={endCallback:null,leftCallback:null,rightCallback:null},el={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class tl extends ja{constructor(e,t){super(),this._element=e,e&&tl.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Za}static get DefaultType(){return el}static get NAME(){return"swipe"}dispose(){La.off(this._element,Ka)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),pa(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&pa(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(La.on(this._element,Ga,e=>this._start(e)),La.on(this._element,Ja,e=>this._end(e)),this._element.classList.add("pointer-event")):(La.on(this._element,Ua,e=>this._start(e)),La.on(this._element,Xa,e=>this._move(e)),La.on(this._element,Qa,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const il=".bs.carousel",nl=".data-api",rl="ArrowLeft",sl="ArrowRight",ol="next",al="prev",ll="left",cl="right",dl=`slide${il}`,ul=`slid${il}`,hl=`keydown${il}`,pl=`mouseenter${il}`,fl=`mouseleave${il}`,gl=`dragstart${il}`,ml=`load${il}${nl}`,vl=`click${il}${nl}`,bl="carousel",yl="active",_l=".active",wl=".carousel-item",El=_l+wl,Al={[rl]:cl,[sl]:ll},Sl={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},kl={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Ol extends Pa{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Ha.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===bl&&this.cycle()}static get Default(){return Sl}static get DefaultType(){return kl}static get NAME(){return"carousel"}next(){this._slide(ol)}nextWhenVisible(){!document.hidden&&ra(this._element)&&this.next()}prev(){this._slide(al)}pause(){this._isSliding&&ta(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?La.one(this._element,ul,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void La.one(this._element,ul,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?ol:al;this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&La.on(this._element,hl,e=>this._keydown(e)),"hover"===this._config.pause&&(La.on(this._element,pl,()=>this.pause()),La.on(this._element,fl,()=>this._maybeEnableCycle())),this._config.touch&&tl.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of Ha.find(".carousel-item img",this._element))La.on(e,gl,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(ll)),rightCallback:()=>this._slide(this._directionToOrder(cl)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new tl(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Al[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=Ha.findOne(_l,this._indicatorsElement);t.classList.remove(yl),t.removeAttribute("aria-current");const i=Ha.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(yl),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n=e===ol,r=t||ga(this._getItems(),i,n,this._config.wrap);if(r===i)return;const s=this._getItemIndex(r),o=t=>La.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:s});if(o(dl).defaultPrevented)return;if(!i||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";r.classList.add(c),la(r),i.classList.add(l),r.classList.add(l);this._queueCallback(()=>{r.classList.remove(l,c),r.classList.add(yl),i.classList.remove(yl,c,l),this._isSliding=!1,o(ul)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Ha.findOne(El,this._element)}_getItems(){return Ha.find(wl,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return ua()?e===ll?al:ol:e===ll?ol:al}_orderToDirection(e){return ua()?e===al?ll:cl:e===al?cl:ll}static jQueryInterface(e){return this.each(function(){const t=Ol.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}La.on(document,vl,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=Ha.getElementFromSelector(this);if(!t||!t.classList.contains(bl))return;e.preventDefault();const i=Ol.getOrCreateInstance(t),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===Na.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),La.on(window,ml,()=>{const e=Ha.find('[data-bs-ride="carousel"]');for(const t of e)Ol.getOrCreateInstance(t)}),ha(Ol);const Cl=".bs.collapse",Dl=`show${Cl}`,xl=`shown${Cl}`,Tl=`hide${Cl}`,Ll=`hidden${Cl}`,Il=`click${Cl}.data-api`,Ml="show",Fl="collapse",Nl="collapsing",jl=`:scope .${Fl} .${Fl}`,Pl='[data-bs-toggle="collapse"]',$l={parent:null,toggle:!0},Hl={parent:"(null|element)",toggle:"boolean"};class ql extends Pa{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=Ha.find(Pl);for(const e of i){const t=Ha.getSelectorFromElement(e),i=Ha.find(t).filter(e=>e===this._element);null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return $l}static get DefaultType(){return Hl}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>ql.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(La.trigger(this._element,Dl).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(Fl),this._element.classList.add(Nl),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Nl),this._element.classList.add(Fl,Ml),this._element.style[t]="",La.trigger(this._element,xl)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(La.trigger(this._element,Tl).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,la(this._element),this._element.classList.add(Nl),this._element.classList.remove(Fl,Ml);for(const e of this._triggerArray){const t=Ha.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Nl),this._element.classList.add(Fl),La.trigger(this._element,Ll)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(Ml)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=na(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Pl);for(const t of e){const e=Ha.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=Ha.find(jl,this._config.parent);return Ha.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle("collapsed",!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const i=ql.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}La.on(document,Il,Pl,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of Ha.getMultipleElementsFromSelector(this))ql.getOrCreateInstance(e,{toggle:!1}).toggle()}),ha(ql);const Rl="dropdown",Bl=".bs.dropdown",Vl=".data-api",zl="ArrowUp",Wl="ArrowDown",Yl=`hide${Bl}`,Kl=`hidden${Bl}`,Ul=`show${Bl}`,Xl=`shown${Bl}`,Ql=`click${Bl}${Vl}`,Gl=`keydown${Bl}${Vl}`,Jl=`keyup${Bl}${Vl}`,Zl="show",ec='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',tc=`${ec}.${Zl}`,ic=".dropdown-menu",nc=ua()?"top-end":"top-start",rc=ua()?"top-start":"top-end",sc=ua()?"bottom-end":"bottom-start",oc=ua()?"bottom-start":"bottom-end",ac=ua()?"left-start":"right-start",lc=ua()?"right-start":"left-start",cc={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},dc={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class uc extends Pa{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=Ha.next(this._element,ic)[0]||Ha.prev(this._element,ic)[0]||Ha.findOne(ic,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return cc}static get DefaultType(){return dc}static get NAME(){return Rl}toggle(){return this._isShown()?this.hide():this.show()}show(){if(sa(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!La.trigger(this._element,Ul,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))La.on(e,"mouseover",aa);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Zl),this._element.classList.add(Zl),La.trigger(this._element,Xl,e)}}hide(){if(sa(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!La.trigger(this._element,Yl,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))La.off(e,"mouseover",aa);this._popper&&this._popper.destroy(),this._menu.classList.remove(Zl),this._element.classList.remove(Zl),this._element.setAttribute("aria-expanded","false"),Na.removeDataAttribute(this._menu,"popper"),La.trigger(this._element,Kl,e),this._element.focus()}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!ia(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Rl.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Xo)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;"parent"===this._config.reference?e=this._parent:ia(this._config.reference)?e=na(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Uo(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Zl)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return ac;if(e.classList.contains("dropstart"))return lc;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?rc:nc:t?oc:sc}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Na.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...pa(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=Ha.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>ra(e));i.length&&ga(i,t,e===Wl,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=uc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=Ha.find(tc);for(const i of t){const t=uc.getInstance(i);if(!t||!1===t._config.autoClose)continue;const n=e.composedPath(),r=n.includes(t._menu);if(n.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const s={relatedTarget:t._element};"click"===e.type&&(s.clickEvent=e),t._completeHide(s)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[zl,Wl].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const r=this.matches(ec)?this:Ha.prev(this,ec)[0]||Ha.next(this,ec)[0]||Ha.findOne(ec,e.delegateTarget.parentNode),s=uc.getOrCreateInstance(r);if(n)return e.stopPropagation(),s.show(),void s._selectMenuItem(e);s._isShown()&&(e.stopPropagation(),s.hide(),r.focus())}}La.on(document,Gl,ec,uc.dataApiKeydownHandler),La.on(document,Gl,ic,uc.dataApiKeydownHandler),La.on(document,Ql,uc.clearMenus),La.on(document,Jl,uc.clearMenus),La.on(document,Ql,ec,function(e){e.preventDefault(),uc.getOrCreateInstance(this).toggle()}),ha(uc);const hc="backdrop",pc="show",fc=`mousedown.bs.${hc}`,gc={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},mc={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class vc extends ja{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return gc}static get DefaultType(){return mc}static get NAME(){return hc}show(e){if(!this._config.isVisible)return void pa(e);this._append();const t=this._getElement();this._config.isAnimated&&la(t),t.classList.add(pc),this._emulateAnimation(()=>{pa(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(pc),this._emulateAnimation(()=>{this.dispose(),pa(e)})):pa(e)}dispose(){this._isAppended&&(La.off(this._element,fc),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=na(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),La.on(e,fc,()=>{pa(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){fa(e,this._getElement(),this._config.isAnimated)}}const bc=".bs.focustrap",yc=`focusin${bc}`,_c=`keydown.tab${bc}`,wc="backward",Ec={autofocus:!0,trapElement:null},Ac={autofocus:"boolean",trapElement:"element"};class Sc extends ja{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ec}static get DefaultType(){return Ac}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),La.off(document,bc),La.on(document,yc,e=>this._handleFocusin(e)),La.on(document,_c,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,La.off(document,bc))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=Ha.focusableChildren(t);0===i.length?t.focus():this._lastTabNavDirection===wc?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?wc:"forward")}}const kc=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Oc=".sticky-top",Cc="padding-right",Dc="margin-right";class xc{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Cc,t=>t+e),this._setElementAttributes(kc,Cc,t=>t+e),this._setElementAttributes(Oc,Dc,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Cc),this._resetElementAttributes(kc,Cc),this._resetElementAttributes(Oc,Dc)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(r))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&Na.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=Na.getDataAttribute(e,t);null!==i?(Na.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(ia(e))t(e);else for(const i of Ha.find(e,this._element))t(i)}}const Tc=".bs.modal",Lc=`hide${Tc}`,Ic=`hidePrevented${Tc}`,Mc=`hidden${Tc}`,Fc=`show${Tc}`,Nc=`shown${Tc}`,jc=`resize${Tc}`,Pc=`click.dismiss${Tc}`,$c=`mousedown.dismiss${Tc}`,Hc=`keydown.dismiss${Tc}`,qc=`click${Tc}.data-api`,Rc="modal-open",Bc="show",Vc="modal-static",zc={backdrop:!0,focus:!0,keyboard:!0},Wc={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Yc extends Pa{constructor(e,t){super(e,t),this._dialog=Ha.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new xc,this._addEventListeners()}static get Default(){return zc}static get DefaultType(){return Wc}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;La.trigger(this._element,Fc,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Rc),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){if(!this._isShown||this._isTransitioning)return;La.trigger(this._element,Lc).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Bc),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){La.off(window,Tc),La.off(this._dialog,Tc),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new vc({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Sc({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=Ha.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),la(this._element),this._element.classList.add(Bc);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,La.trigger(this._element,Nc,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){La.on(this._element,Hc,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),La.on(window,jc,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),La.on(this._element,$c,e=>{La.one(this._element,Pc,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Rc),this._resetAdjustments(),this._scrollBar.reset(),La.trigger(this._element,Mc)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(La.trigger(this._element,Ic).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Vc)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Vc),this._queueCallback(()=>{this._element.classList.remove(Vc),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=ua()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=ua()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const i=Yc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}})}}La.on(document,qc,'[data-bs-toggle="modal"]',function(e){const t=Ha.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),La.one(t,Fc,e=>{e.defaultPrevented||La.one(t,Mc,()=>{ra(this)&&this.focus()})});const i=Ha.findOne(".modal.show");i&&Yc.getInstance(i).hide();Yc.getOrCreateInstance(t).toggle(this)}),qa(Yc),ha(Yc);const Kc=".bs.offcanvas",Uc=".data-api",Xc=`load${Kc}${Uc}`,Qc="show",Gc="showing",Jc="hiding",Zc=".offcanvas.show",ed=`show${Kc}`,td=`shown${Kc}`,id=`hide${Kc}`,nd=`hidePrevented${Kc}`,rd=`hidden${Kc}`,sd=`resize${Kc}`,od=`click${Kc}${Uc}`,ad=`keydown.dismiss${Kc}`,ld={backdrop:!0,keyboard:!0,scroll:!1},cd={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class dd extends Pa{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return ld}static get DefaultType(){return cd}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(La.trigger(this._element,ed,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new xc).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Gc);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Qc),this._element.classList.remove(Gc),La.trigger(this._element,td,{relatedTarget:e})},this._element,!0)}hide(){if(!this._isShown)return;if(La.trigger(this._element,id).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Jc),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove(Qc,Jc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new xc).reset(),La.trigger(this._element,rd)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new vc({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():La.trigger(this._element,nd)}:null})}_initializeFocusTrap(){return new Sc({trapElement:this._element})}_addEventListeners(){La.on(this._element,ad,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():La.trigger(this._element,nd))})}static jQueryInterface(e){return this.each(function(){const t=dd.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}La.on(document,od,'[data-bs-toggle="offcanvas"]',function(e){const t=Ha.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),sa(this))return;La.one(t,rd,()=>{ra(this)&&this.focus()});const i=Ha.findOne(Zc);i&&i!==t&&dd.getInstance(i).hide();dd.getOrCreateInstance(t).toggle(this)}),La.on(window,Xc,()=>{for(const e of Ha.find(Zc))dd.getOrCreateInstance(e).show()}),La.on(window,sd,()=>{for(const e of Ha.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&dd.getOrCreateInstance(e).hide()}),qa(dd),ha(dd);const ud={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},hd=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),pd=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,fd=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!hd.has(i)||Boolean(pd.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))};const gd={allowList:ud,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},md={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},vd={entry:"(string|element|function|null)",selector:"(string|element)"};class bd extends ja{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return gd}static get DefaultType(){return md}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,i]of Object.entries(this._config.content))this._setContent(e,i,t);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},vd)}_setContent(e,t,i){const n=Ha.findOne(i,e);n&&((t=this._resolvePossibleFunction(t))?ia(t)?this._putElementInTemplate(na(t),n):this._config.html?n.innerHTML=this._maybeSanitize(t):n.textContent=t:n.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),r=[].concat(...n.body.querySelectorAll("*"));for(const e of r){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),r=[].concat(t["*"]||[],t[i]||[]);for(const t of n)fd(t,r)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return pa(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const yd=new Set(["sanitize","allowList","sanitizeFn"]),_d="fade",wd="show",Ed=".tooltip-inner",Ad=".modal",Sd="hide.bs.modal",kd="hover",Od="focus",Cd="click",Dd={AUTO:"auto",TOP:"top",RIGHT:ua()?"left":"right",BOTTOM:"bottom",LEFT:ua()?"right":"left"},xd={allowList:ud,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Td={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Ld extends Pa{constructor(e,t){if(void 0===Xo)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return xd}static get DefaultType(){return Td}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),La.off(this._element.closest(Ad),Sd,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=La.trigger(this._element,this.constructor.eventName("show")),t=(oa(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),La.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(wd),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))La.on(e,"mouseover",aa);this._queueCallback(()=>{La.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(La.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(wd),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))La.off(e,"mouseover",aa);this._activeTrigger[Cd]=!1,this._activeTrigger[Od]=!1,this._activeTrigger[kd]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),La.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(_d,wd),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(_d),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new bd({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Ed]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(_d)}_isShown(){return this.tip&&this.tip.classList.contains(wd)}_createPopper(e){const t=pa(this._config.placement,[this,e,this._element]),i=Dd[t.toUpperCase()];return Uo(this._element,e,this._getPopperConfig(i))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return pa(e,[this._element,this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...pa(this._config.popperConfig,[void 0,t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)La.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger[Cd]=!(t._isShown()&&t._activeTrigger[Cd]),t.toggle()});else if("manual"!==t){const e=t===kd?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=t===kd?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");La.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Od:kd]=!0,t._enter()}),La.on(this._element,i,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Od:kd]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},La.on(this._element.closest(Ad),Sd,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Na.getDataAttributes(this._element);for(const e of Object.keys(t))yd.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:na(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Ld.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}ha(Ld);const Id=".popover-header",Md=".popover-body",Fd={...Ld.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Nd={...Ld.DefaultType,content:"(null|string|element|function)"};class jd extends Ld{static get Default(){return Fd}static get DefaultType(){return Nd}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Id]:this._getTitle(),[Md]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=jd.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}ha(jd);const Pd=".bs.scrollspy",$d=`activate${Pd}`,Hd=`click${Pd}`,qd=`load${Pd}.data-api`,Rd="active",Bd="[href]",Vd=".nav-link",zd=`${Vd}, .nav-item > ${Vd}, .list-group-item`,Wd={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Yd={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Kd extends Pa{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Wd}static get DefaultType(){return Yd}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=na(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(La.off(this._config.target,Hd),La.on(this._config.target,Hd,Bd,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),i=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const e=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(i(s),!n)return}else r||e||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=Ha.find(Bd,this._config.target);for(const t of e){if(!t.hash||sa(t))continue;const e=Ha.findOne(decodeURI(t.hash),this._element);ra(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Rd),this._activateParents(e),La.trigger(this._element,$d,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))Ha.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Rd);else for(const t of Ha.parents(e,".nav, .list-group"))for(const e of Ha.prev(t,zd))e.classList.add(Rd)}_clearActiveClass(e){e.classList.remove(Rd);const t=Ha.find(`${Bd}.${Rd}`,e);for(const e of t)e.classList.remove(Rd)}static jQueryInterface(e){return this.each(function(){const t=Kd.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}La.on(window,qd,()=>{for(const e of Ha.find('[data-bs-spy="scroll"]'))Kd.getOrCreateInstance(e)}),ha(Kd);const Ud=".bs.tab",Xd=`hide${Ud}`,Qd=`hidden${Ud}`,Gd=`show${Ud}`,Jd=`shown${Ud}`,Zd=`click${Ud}`,eu=`keydown${Ud}`,tu=`load${Ud}`,iu="ArrowLeft",nu="ArrowRight",ru="ArrowUp",su="ArrowDown",ou="Home",au="End",lu="active",cu="fade",du="show",uu=".dropdown-toggle",hu=`:not(${uu})`,pu='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',fu=`${`.nav-link${hu}, .list-group-item${hu}, [role="tab"]${hu}`}, ${pu}`,gu=`.${lu}[data-bs-toggle="tab"], .${lu}[data-bs-toggle="pill"], .${lu}[data-bs-toggle="list"]`;class mu extends Pa{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),La.on(this._element,eu,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?La.trigger(t,Xd,{relatedTarget:e}):null;La.trigger(e,Gd,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(lu),this._activate(Ha.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),La.trigger(e,Jd,{relatedTarget:t})):e.classList.add(du)},e,e.classList.contains(cu))}_deactivate(e,t){if(!e)return;e.classList.remove(lu),e.blur(),this._deactivate(Ha.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),La.trigger(e,Qd,{relatedTarget:t})):e.classList.remove(du)},e,e.classList.contains(cu))}_keydown(e){if(![iu,nu,ru,su,ou,au].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!sa(e));let i;if([ou,au].includes(e.key))i=t[e.key===ou?0:t.length-1];else{const n=[nu,su].includes(e.key);i=ga(t,e.target,n,!0)}i&&(i.focus({preventScroll:!0}),mu.getOrCreateInstance(i).show())}_getChildren(){return Ha.find(fu,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=Ha.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains("dropdown"))return;const n=(e,n)=>{const r=Ha.findOne(e,i);r&&r.classList.toggle(n,t)};n(uu,lu),n(".dropdown-menu",du),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(lu)}_getInnerElement(e){return e.matches(fu)?e:Ha.findOne(fu,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=mu.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}La.on(document,Zd,pu,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),sa(this)||mu.getOrCreateInstance(this).show()}),La.on(window,tu,()=>{for(const e of Ha.find(gu))mu.getOrCreateInstance(e)}),ha(mu);const vu=".bs.toast",bu=`mouseover${vu}`,yu=`mouseout${vu}`,_u=`focusin${vu}`,wu=`focusout${vu}`,Eu=`hide${vu}`,Au=`hidden${vu}`,Su=`show${vu}`,ku=`shown${vu}`,Ou="hide",Cu="show",Du="showing",xu={animation:"boolean",autohide:"boolean",delay:"number"},Tu={animation:!0,autohide:!0,delay:5e3};class Lu extends Pa{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Tu}static get DefaultType(){return xu}static get NAME(){return"toast"}show(){if(La.trigger(this._element,Su).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(Ou),la(this._element),this._element.classList.add(Cu,Du),this._queueCallback(()=>{this._element.classList.remove(Du),La.trigger(this._element,ku),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(La.trigger(this._element,Eu).defaultPrevented)return;this._element.classList.add(Du),this._queueCallback(()=>{this._element.classList.add(Ou),this._element.classList.remove(Du,Cu),La.trigger(this._element,Au)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Cu),super.dispose()}isShown(){return this._element.classList.contains(Cu)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){La.on(this._element,bu,e=>this._onInteraction(e,!0)),La.on(this._element,yu,e=>this._onInteraction(e,!1)),La.on(this._element,_u,e=>this._onInteraction(e,!0)),La.on(this._element,wu,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Lu.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}qa(Lu),ha(Lu),document.addEventListener("DOMContentLoaded",()=>{Array.from(document.querySelectorAll(".dropdown")).forEach(e=>new uc(e)),f.formsHandler.netteForms=y,f.initialize(),((e,t={})=>{new fs(e,t)})(new gs(f),{datagrid:{plugins:[new rt,new st,new at,new ct,new dt,new ut,new tt(y),new nt(new vn),new et(new hs({buttonClass:"btn"})),new it(new bn(Ie)),new ht]}})});
19
+ const Go=new Map,Jo={set(e,t,i){Go.has(e)||Go.set(e,new Map);const n=Go.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>Go.has(e)&&Go.get(e).get(t)||null,remove(e,t){if(!Go.has(e))return;const i=Go.get(e);i.delete(t),0===i.size&&Go.delete(e)}},Zo="transitionend",ea=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),ta=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),ia=e=>{e.dispatchEvent(new Event(Zo))},na=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),ra=e=>na(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(ea(e)):null,sa=e=>{if(!na(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},oa=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),aa=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?aa(e.parentNode):null},la=()=>{},ca=e=>{e.offsetHeight},da=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,ua=[],ha=()=>"rtl"===document.documentElement.dir,pa=e=>{var t;t=()=>{const $=da();if($){const t=e.NAME,i=$.fn[t];$.fn[t]=e.jQueryInterface,$.fn[t].Constructor=e,$.fn[t].noConflict=()=>($.fn[t]=i,e.jQueryInterface)}},"loading"===document.readyState?(ua.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of ua)e()}),ua.push(t)):t()},fa=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,ga=(e,t,i=!0)=>{if(!i)return void fa(e);const n=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),r=Number.parseFloat(i);return n||r?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let r=!1;const s=({target:i})=>{i===t&&(r=!0,t.removeEventListener(Zo,s),fa(e))};t.addEventListener(Zo,s),setTimeout(()=>{r||ia(t)},n)},ma=(e,t,i,n)=>{const r=e.length;let s=e.indexOf(t);return-1===s?!i&&n?e[r-1]:e[0]:(s+=i?1:-1,n&&(s=(s+r)%r),e[Math.max(0,Math.min(s,r-1))])},va=/[^.]*(?=\..*)\.|.*/,ba=/\..*/,ya=/::\d+$/,_a={};let wa=1;const Ea={mouseenter:"mouseover",mouseleave:"mouseout"},Aa=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Sa(e,t){return t&&`${t}::${wa++}`||e.uidEvent||wa++}function ka(e){const t=Sa(e);return e.uidEvent=t,_a[t]=_a[t]||{},_a[t]}function Oa(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function Ca(e,t,i){const n="string"==typeof t,r=n?i:t||i;let s=La(e);return Aa.has(s)||(s=e),[n,r,s]}function Da(e,t,i,n,r){if("string"!=typeof t||!e)return;let[s,o,a]=Ca(t,i,n);if(t in Ea){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};o=e(o)}const l=ka(e),c=l[a]||(l[a]={}),d=Oa(c,o,s?i:null);if(d)return void(d.oneOff=d.oneOff&&r);const u=Sa(o,t.replace(va,"")),h=s?function(e,t,i){return function n(r){const s=e.querySelectorAll(t);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of s)if(a===o)return Ma(r,{delegateTarget:o}),n.oneOff&&Ia.off(e,r.type,t,i),i.apply(o,[r])}}(e,i,o):function(e,t){return function i(n){return Ma(n,{delegateTarget:e}),i.oneOff&&Ia.off(e,n.type,t),t.apply(e,[n])}}(e,o);h.delegationSelector=s?i:null,h.callable=o,h.oneOff=r,h.uidEvent=u,c[u]=h,e.addEventListener(a,h,s)}function xa(e,t,i,n,r){const s=Oa(t[i],n,r);s&&(e.removeEventListener(i,s,Boolean(r)),delete t[i][s.uidEvent])}function Ta(e,t,i,n){const r=t[i]||{};for(const[s,o]of Object.entries(r))s.includes(n)&&xa(e,t,i,o.callable,o.delegationSelector)}function La(e){return e=e.replace(ba,""),Ea[e]||e}const Ia={on(e,t,i,n){Da(e,t,i,n,!1)},one(e,t,i,n){Da(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[r,s,o]=Ca(t,i,n),a=o!==t,l=ka(e),c=l[o]||{},d=t.startsWith(".");if(void 0===s){if(d)for(const i of Object.keys(l))Ta(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const r=i.replace(ya,"");a&&!t.includes(r)||xa(e,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;xa(e,l,o,s,r?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const $=da();let n=null,r=!0,s=!0,o=!1;t!==La(t)&&$&&(n=$.Event(t,i),$(e).trigger(n),r=!n.isPropagationStopped(),s=!n.isImmediatePropagationStopped(),o=n.isDefaultPrevented());const a=Ma(new Event(t,{bubbles:r,cancelable:!0}),i);return o&&a.preventDefault(),s&&e.dispatchEvent(a),a.defaultPrevented&&n&&n.preventDefault(),a}};function Ma(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function Fa(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function Na(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const ja={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${Na(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${Na(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=Fa(e.dataset[n])}return t},getDataAttribute:(e,t)=>Fa(e.getAttribute(`data-bs-${Na(t)}`))};class Pa{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=na(t)?ja.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...na(t)?ja.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],r=na(t)?"element":ta(t);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${n}".`)}}}class $a extends Pa{constructor(e,t){super(),(e=ra(e))&&(this._element=e,this._config=this._getConfig(t),Jo.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Jo.remove(this._element,this.constructor.DATA_KEY),Ia.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){ga(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Jo.get(ra(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.7"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Ha=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map(e=>ea(e)).join(","):null},qa={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!oa(e)&&sa(e))},getSelectorFromElement(e){const t=Ha(e);return t&&qa.findOne(t)?t:null},getElementFromSelector(e){const t=Ha(e);return t?qa.findOne(t):null},getMultipleElementsFromSelector(e){const t=Ha(e);return t?qa.find(t):[]}},Ra=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;Ia.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),oa(this))return;const r=qa.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(r)[t]()})},Ba=".bs.alert",Va=`close${Ba}`,za=`closed${Ba}`;class Wa extends $a{static get NAME(){return"alert"}close(){if(Ia.trigger(this._element,Va).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),Ia.trigger(this._element,za),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Wa.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ra(Wa,"close"),pa(Wa);const Ya='[data-bs-toggle="button"]';class Ka extends $a{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Ka.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}Ia.on(document,"click.bs.button.data-api",Ya,e=>{e.preventDefault();const t=e.target.closest(Ya);Ka.getOrCreateInstance(t).toggle()}),pa(Ka);const Ua=".bs.swipe",Xa=`touchstart${Ua}`,Qa=`touchmove${Ua}`,Ga=`touchend${Ua}`,Ja=`pointerdown${Ua}`,Za=`pointerup${Ua}`,el={endCallback:null,leftCallback:null,rightCallback:null},tl={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class il extends Pa{constructor(e,t){super(),this._element=e,e&&il.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return el}static get DefaultType(){return tl}static get NAME(){return"swipe"}dispose(){Ia.off(this._element,Ua)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),fa(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&fa(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Ia.on(this._element,Ja,e=>this._start(e)),Ia.on(this._element,Za,e=>this._end(e)),this._element.classList.add("pointer-event")):(Ia.on(this._element,Xa,e=>this._start(e)),Ia.on(this._element,Qa,e=>this._move(e)),Ia.on(this._element,Ga,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const nl=".bs.carousel",rl=".data-api",sl="ArrowLeft",ol="ArrowRight",al="next",ll="prev",cl="left",dl="right",ul=`slide${nl}`,hl=`slid${nl}`,pl=`keydown${nl}`,fl=`mouseenter${nl}`,gl=`mouseleave${nl}`,ml=`dragstart${nl}`,vl=`load${nl}${rl}`,bl=`click${nl}${rl}`,yl="carousel",_l="active",wl=".active",El=".carousel-item",Al=wl+El,Sl={[sl]:dl,[ol]:cl},kl={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ol={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Cl extends $a{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=qa.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===yl&&this.cycle()}static get Default(){return kl}static get DefaultType(){return Ol}static get NAME(){return"carousel"}next(){this._slide(al)}nextWhenVisible(){!document.hidden&&sa(this._element)&&this.next()}prev(){this._slide(ll)}pause(){this._isSliding&&ia(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?Ia.one(this._element,hl,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void Ia.one(this._element,hl,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?al:ll;this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&Ia.on(this._element,pl,e=>this._keydown(e)),"hover"===this._config.pause&&(Ia.on(this._element,fl,()=>this.pause()),Ia.on(this._element,gl,()=>this._maybeEnableCycle())),this._config.touch&&il.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of qa.find(".carousel-item img",this._element))Ia.on(e,ml,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(cl)),rightCallback:()=>this._slide(this._directionToOrder(dl)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new il(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Sl[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=qa.findOne(wl,this._indicatorsElement);t.classList.remove(_l),t.removeAttribute("aria-current");const i=qa.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(_l),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n=e===al,r=t||ma(this._getItems(),i,n,this._config.wrap);if(r===i)return;const s=this._getItemIndex(r),o=t=>Ia.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:s});if(o(ul).defaultPrevented)return;if(!i||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";r.classList.add(c),ca(r),i.classList.add(l),r.classList.add(l);this._queueCallback(()=>{r.classList.remove(l,c),r.classList.add(_l),i.classList.remove(_l,c,l),this._isSliding=!1,o(hl)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return qa.findOne(Al,this._element)}_getItems(){return qa.find(El,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return ha()?e===cl?ll:al:e===cl?al:ll}_orderToDirection(e){return ha()?e===ll?cl:dl:e===ll?dl:cl}static jQueryInterface(e){return this.each(function(){const t=Cl.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}Ia.on(document,bl,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=qa.getElementFromSelector(this);if(!t||!t.classList.contains(yl))return;e.preventDefault();const i=Cl.getOrCreateInstance(t),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===ja.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),Ia.on(window,vl,()=>{const e=qa.find('[data-bs-ride="carousel"]');for(const t of e)Cl.getOrCreateInstance(t)}),pa(Cl);const Dl=".bs.collapse",xl=`show${Dl}`,Tl=`shown${Dl}`,Ll=`hide${Dl}`,Il=`hidden${Dl}`,Ml=`click${Dl}.data-api`,Fl="show",Nl="collapse",jl="collapsing",Pl=`:scope .${Nl} .${Nl}`,$l='[data-bs-toggle="collapse"]',Hl={parent:null,toggle:!0},ql={parent:"(null|element)",toggle:"boolean"};class Rl extends $a{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=qa.find($l);for(const e of i){const t=qa.getSelectorFromElement(e),i=qa.find(t).filter(e=>e===this._element);null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Hl}static get DefaultType(){return ql}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>Rl.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(Ia.trigger(this._element,xl).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(Nl),this._element.classList.add(jl),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jl),this._element.classList.add(Nl,Fl),this._element.style[t]="",Ia.trigger(this._element,Tl)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(Ia.trigger(this._element,Ll).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,ca(this._element),this._element.classList.add(jl),this._element.classList.remove(Nl,Fl);for(const e of this._triggerArray){const t=qa.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jl),this._element.classList.add(Nl),Ia.trigger(this._element,Il)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(Fl)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=ra(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren($l);for(const t of e){const e=qa.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=qa.find(Pl,this._config.parent);return qa.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle("collapsed",!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const i=Rl.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}Ia.on(document,Ml,$l,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of qa.getMultipleElementsFromSelector(this))Rl.getOrCreateInstance(e,{toggle:!1}).toggle()}),pa(Rl);const Bl="dropdown",Vl=".bs.dropdown",zl=".data-api",Wl="ArrowUp",Yl="ArrowDown",Kl=`hide${Vl}`,Ul=`hidden${Vl}`,Xl=`show${Vl}`,Ql=`shown${Vl}`,Gl=`click${Vl}${zl}`,Jl=`keydown${Vl}${zl}`,Zl=`keyup${Vl}${zl}`,ec="show",tc='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ic=`${tc}.${ec}`,nc=".dropdown-menu",rc=ha()?"top-end":"top-start",sc=ha()?"top-start":"top-end",oc=ha()?"bottom-end":"bottom-start",ac=ha()?"bottom-start":"bottom-end",lc=ha()?"left-start":"right-start",cc=ha()?"right-start":"left-start",dc={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},uc={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class hc extends $a{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=qa.next(this._element,nc)[0]||qa.prev(this._element,nc)[0]||qa.findOne(nc,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return dc}static get DefaultType(){return uc}static get NAME(){return Bl}toggle(){return this._isShown()?this.hide():this.show()}show(){if(oa(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!Ia.trigger(this._element,Xl,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))Ia.on(e,"mouseover",la);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ec),this._element.classList.add(ec),Ia.trigger(this._element,Ql,e)}}hide(){if(oa(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!Ia.trigger(this._element,Kl,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Ia.off(e,"mouseover",la);this._popper&&this._popper.destroy(),this._menu.classList.remove(ec),this._element.classList.remove(ec),this._element.setAttribute("aria-expanded","false"),ja.removeDataAttribute(this._menu,"popper"),Ia.trigger(this._element,Ul,e),this._element.focus()}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!na(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Bl.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Qo)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;"parent"===this._config.reference?e=this._parent:na(this._config.reference)?e=ra(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Xo(e,this._menu,t)}_isShown(){return this._menu.classList.contains(ec)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return lc;if(e.classList.contains("dropstart"))return cc;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?sc:rc:t?ac:oc}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(ja.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...fa(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=qa.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>sa(e));i.length&&ma(i,t,e===Yl,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=hc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=qa.find(ic);for(const i of t){const t=hc.getInstance(i);if(!t||!1===t._config.autoClose)continue;const n=e.composedPath(),r=n.includes(t._menu);if(n.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const s={relatedTarget:t._element};"click"===e.type&&(s.clickEvent=e),t._completeHide(s)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[Wl,Yl].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const r=this.matches(tc)?this:qa.prev(this,tc)[0]||qa.next(this,tc)[0]||qa.findOne(tc,e.delegateTarget.parentNode),s=hc.getOrCreateInstance(r);if(n)return e.stopPropagation(),s.show(),void s._selectMenuItem(e);s._isShown()&&(e.stopPropagation(),s.hide(),r.focus())}}Ia.on(document,Jl,tc,hc.dataApiKeydownHandler),Ia.on(document,Jl,nc,hc.dataApiKeydownHandler),Ia.on(document,Gl,hc.clearMenus),Ia.on(document,Zl,hc.clearMenus),Ia.on(document,Gl,tc,function(e){e.preventDefault(),hc.getOrCreateInstance(this).toggle()}),pa(hc);const pc="backdrop",fc="show",gc=`mousedown.bs.${pc}`,mc={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},vc={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class bc extends Pa{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return mc}static get DefaultType(){return vc}static get NAME(){return pc}show(e){if(!this._config.isVisible)return void fa(e);this._append();const t=this._getElement();this._config.isAnimated&&ca(t),t.classList.add(fc),this._emulateAnimation(()=>{fa(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(fc),this._emulateAnimation(()=>{this.dispose(),fa(e)})):fa(e)}dispose(){this._isAppended&&(Ia.off(this._element,gc),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=ra(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),Ia.on(e,gc,()=>{fa(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){ga(e,this._getElement(),this._config.isAnimated)}}const yc=".bs.focustrap",_c=`focusin${yc}`,wc=`keydown.tab${yc}`,Ec="backward",Ac={autofocus:!0,trapElement:null},Sc={autofocus:"boolean",trapElement:"element"};class kc extends Pa{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ac}static get DefaultType(){return Sc}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Ia.off(document,yc),Ia.on(document,_c,e=>this._handleFocusin(e)),Ia.on(document,wc,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Ia.off(document,yc))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=qa.focusableChildren(t);0===i.length?t.focus():this._lastTabNavDirection===Ec?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?Ec:"forward")}}const Oc=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Cc=".sticky-top",Dc="padding-right",xc="margin-right";class Tc{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Dc,t=>t+e),this._setElementAttributes(Oc,Dc,t=>t+e),this._setElementAttributes(Cc,xc,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Dc),this._resetElementAttributes(Oc,Dc),this._resetElementAttributes(Cc,xc)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(r))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&ja.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=ja.getDataAttribute(e,t);null!==i?(ja.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(na(e))t(e);else for(const i of qa.find(e,this._element))t(i)}}const Lc=".bs.modal",Ic=`hide${Lc}`,Mc=`hidePrevented${Lc}`,Fc=`hidden${Lc}`,Nc=`show${Lc}`,jc=`shown${Lc}`,Pc=`resize${Lc}`,$c=`click.dismiss${Lc}`,Hc=`mousedown.dismiss${Lc}`,qc=`keydown.dismiss${Lc}`,Rc=`click${Lc}.data-api`,Bc="modal-open",Vc="show",zc="modal-static",Wc={backdrop:!0,focus:!0,keyboard:!0},Yc={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Kc extends $a{constructor(e,t){super(e,t),this._dialog=qa.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Tc,this._addEventListeners()}static get Default(){return Wc}static get DefaultType(){return Yc}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;Ia.trigger(this._element,Nc,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Bc),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){if(!this._isShown||this._isTransitioning)return;Ia.trigger(this._element,Ic).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Vc),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Ia.off(window,Lc),Ia.off(this._dialog,Lc),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new bc({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new kc({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=qa.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),ca(this._element),this._element.classList.add(Vc);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Ia.trigger(this._element,jc,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){Ia.on(this._element,qc,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),Ia.on(window,Pc,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Ia.on(this._element,Hc,e=>{Ia.one(this._element,$c,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Bc),this._resetAdjustments(),this._scrollBar.reset(),Ia.trigger(this._element,Fc)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(Ia.trigger(this._element,Mc).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(zc)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(zc),this._queueCallback(()=>{this._element.classList.remove(zc),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=ha()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=ha()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const i=Kc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}})}}Ia.on(document,Rc,'[data-bs-toggle="modal"]',function(e){const t=qa.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ia.one(t,Nc,e=>{e.defaultPrevented||Ia.one(t,Fc,()=>{sa(this)&&this.focus()})});const i=qa.findOne(".modal.show");i&&Kc.getInstance(i).hide();Kc.getOrCreateInstance(t).toggle(this)}),Ra(Kc),pa(Kc);const Uc=".bs.offcanvas",Xc=".data-api",Qc=`load${Uc}${Xc}`,Gc="show",Jc="showing",Zc="hiding",ed=".offcanvas.show",td=`show${Uc}`,id=`shown${Uc}`,nd=`hide${Uc}`,rd=`hidePrevented${Uc}`,sd=`hidden${Uc}`,od=`resize${Uc}`,ad=`click${Uc}${Xc}`,ld=`keydown.dismiss${Uc}`,cd={backdrop:!0,keyboard:!0,scroll:!1},dd={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class ud extends $a{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return cd}static get DefaultType(){return dd}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(Ia.trigger(this._element,td,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Tc).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Jc);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Gc),this._element.classList.remove(Jc),Ia.trigger(this._element,id,{relatedTarget:e})},this._element,!0)}hide(){if(!this._isShown)return;if(Ia.trigger(this._element,nd).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Zc),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove(Gc,Zc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Tc).reset(),Ia.trigger(this._element,sd)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new bc({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():Ia.trigger(this._element,rd)}:null})}_initializeFocusTrap(){return new kc({trapElement:this._element})}_addEventListeners(){Ia.on(this._element,ld,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():Ia.trigger(this._element,rd))})}static jQueryInterface(e){return this.each(function(){const t=ud.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ia.on(document,ad,'[data-bs-toggle="offcanvas"]',function(e){const t=qa.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),oa(this))return;Ia.one(t,sd,()=>{sa(this)&&this.focus()});const i=qa.findOne(ed);i&&i!==t&&ud.getInstance(i).hide();ud.getOrCreateInstance(t).toggle(this)}),Ia.on(window,Qc,()=>{for(const e of qa.find(ed))ud.getOrCreateInstance(e).show()}),Ia.on(window,od,()=>{for(const e of qa.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&ud.getOrCreateInstance(e).hide()}),Ra(ud),pa(ud);const hd={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},pd=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),fd=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,gd=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!pd.has(i)||Boolean(fd.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))};const md={allowList:hd,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},vd={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},bd={entry:"(string|element|function|null)",selector:"(string|element)"};class yd extends Pa{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return md}static get DefaultType(){return vd}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,i]of Object.entries(this._config.content))this._setContent(e,i,t);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},bd)}_setContent(e,t,i){const n=qa.findOne(i,e);n&&((t=this._resolvePossibleFunction(t))?na(t)?this._putElementInTemplate(ra(t),n):this._config.html?n.innerHTML=this._maybeSanitize(t):n.textContent=t:n.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),r=[].concat(...n.body.querySelectorAll("*"));for(const e of r){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),r=[].concat(t["*"]||[],t[i]||[]);for(const t of n)gd(t,r)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return fa(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const _d=new Set(["sanitize","allowList","sanitizeFn"]),wd="fade",Ed="show",Ad=".tooltip-inner",Sd=".modal",kd="hide.bs.modal",Od="hover",Cd="focus",Dd="click",xd={AUTO:"auto",TOP:"top",RIGHT:ha()?"left":"right",BOTTOM:"bottom",LEFT:ha()?"right":"left"},Td={allowList:hd,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Ld={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Id extends $a{constructor(e,t){if(void 0===Qo)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Td}static get DefaultType(){return Ld}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),Ia.off(this._element.closest(Sd),kd,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=Ia.trigger(this._element,this.constructor.eventName("show")),t=(aa(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),Ia.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Ed),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Ia.on(e,"mouseover",la);this._queueCallback(()=>{Ia.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(Ia.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(Ed),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Ia.off(e,"mouseover",la);this._activeTrigger[Dd]=!1,this._activeTrigger[Cd]=!1,this._activeTrigger[Od]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Ia.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(wd,Ed),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(wd),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new yd({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Ad]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(wd)}_isShown(){return this.tip&&this.tip.classList.contains(Ed)}_createPopper(e){const t=fa(this._config.placement,[this,e,this._element]),i=xd[t.toUpperCase()];return Xo(this._element,e,this._getPopperConfig(i))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return fa(e,[this._element,this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...fa(this._config.popperConfig,[void 0,t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)Ia.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger[Dd]=!(t._isShown()&&t._activeTrigger[Dd]),t.toggle()});else if("manual"!==t){const e=t===Od?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=t===Od?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");Ia.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Cd:Od]=!0,t._enter()}),Ia.on(this._element,i,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Cd:Od]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Ia.on(this._element.closest(Sd),kd,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=ja.getDataAttributes(this._element);for(const e of Object.keys(t))_d.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:ra(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Id.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}pa(Id);const Md=".popover-header",Fd=".popover-body",Nd={...Id.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},jd={...Id.DefaultType,content:"(null|string|element|function)"};class Pd extends Id{static get Default(){return Nd}static get DefaultType(){return jd}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Md]:this._getTitle(),[Fd]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=Pd.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}pa(Pd);const $d=".bs.scrollspy",Hd=`activate${$d}`,qd=`click${$d}`,Rd=`load${$d}.data-api`,Bd="active",Vd="[href]",zd=".nav-link",Wd=`${zd}, .nav-item > ${zd}, .list-group-item`,Yd={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Kd={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ud extends $a{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Yd}static get DefaultType(){return Kd}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=ra(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Ia.off(this._config.target,qd),Ia.on(this._config.target,qd,Vd,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),i=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const e=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(i(s),!n)return}else r||e||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=qa.find(Vd,this._config.target);for(const t of e){if(!t.hash||oa(t))continue;const e=qa.findOne(decodeURI(t.hash),this._element);sa(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Bd),this._activateParents(e),Ia.trigger(this._element,Hd,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))qa.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Bd);else for(const t of qa.parents(e,".nav, .list-group"))for(const e of qa.prev(t,Wd))e.classList.add(Bd)}_clearActiveClass(e){e.classList.remove(Bd);const t=qa.find(`${Vd}.${Bd}`,e);for(const e of t)e.classList.remove(Bd)}static jQueryInterface(e){return this.each(function(){const t=Ud.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}Ia.on(window,Rd,()=>{for(const e of qa.find('[data-bs-spy="scroll"]'))Ud.getOrCreateInstance(e)}),pa(Ud);const Xd=".bs.tab",Qd=`hide${Xd}`,Gd=`hidden${Xd}`,Jd=`show${Xd}`,Zd=`shown${Xd}`,eu=`click${Xd}`,tu=`keydown${Xd}`,iu=`load${Xd}`,nu="ArrowLeft",ru="ArrowRight",su="ArrowUp",ou="ArrowDown",au="Home",lu="End",cu="active",du="fade",uu="show",hu=".dropdown-toggle",pu=`:not(${hu})`,fu='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',gu=`${`.nav-link${pu}, .list-group-item${pu}, [role="tab"]${pu}`}, ${fu}`,mu=`.${cu}[data-bs-toggle="tab"], .${cu}[data-bs-toggle="pill"], .${cu}[data-bs-toggle="list"]`;class vu extends $a{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Ia.on(this._element,tu,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?Ia.trigger(t,Qd,{relatedTarget:e}):null;Ia.trigger(e,Jd,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(cu),this._activate(qa.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),Ia.trigger(e,Zd,{relatedTarget:t})):e.classList.add(uu)},e,e.classList.contains(du))}_deactivate(e,t){if(!e)return;e.classList.remove(cu),e.blur(),this._deactivate(qa.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),Ia.trigger(e,Gd,{relatedTarget:t})):e.classList.remove(uu)},e,e.classList.contains(du))}_keydown(e){if(![nu,ru,su,ou,au,lu].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!oa(e));let i;if([au,lu].includes(e.key))i=t[e.key===au?0:t.length-1];else{const n=[ru,ou].includes(e.key);i=ma(t,e.target,n,!0)}i&&(i.focus({preventScroll:!0}),vu.getOrCreateInstance(i).show())}_getChildren(){return qa.find(gu,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=qa.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains("dropdown"))return;const n=(e,n)=>{const r=qa.findOne(e,i);r&&r.classList.toggle(n,t)};n(hu,cu),n(".dropdown-menu",uu),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(cu)}_getInnerElement(e){return e.matches(gu)?e:qa.findOne(gu,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=vu.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}Ia.on(document,eu,fu,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),oa(this)||vu.getOrCreateInstance(this).show()}),Ia.on(window,iu,()=>{for(const e of qa.find(mu))vu.getOrCreateInstance(e)}),pa(vu);const bu=".bs.toast",yu=`mouseover${bu}`,_u=`mouseout${bu}`,wu=`focusin${bu}`,Eu=`focusout${bu}`,Au=`hide${bu}`,Su=`hidden${bu}`,ku=`show${bu}`,Ou=`shown${bu}`,Cu="hide",Du="show",xu="showing",Tu={animation:"boolean",autohide:"boolean",delay:"number"},Lu={animation:!0,autohide:!0,delay:5e3};class Iu extends $a{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Lu}static get DefaultType(){return Tu}static get NAME(){return"toast"}show(){if(Ia.trigger(this._element,ku).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(Cu),ca(this._element),this._element.classList.add(Du,xu),this._queueCallback(()=>{this._element.classList.remove(xu),Ia.trigger(this._element,Ou),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(Ia.trigger(this._element,Au).defaultPrevented)return;this._element.classList.add(xu),this._queueCallback(()=>{this._element.classList.add(Cu),this._element.classList.remove(xu,Du),Ia.trigger(this._element,Su)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Du),super.dispose()}isShown(){return this._element.classList.contains(Du)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){Ia.on(this._element,yu,e=>this._onInteraction(e,!0)),Ia.on(this._element,_u,e=>this._onInteraction(e,!1)),Ia.on(this._element,wu,e=>this._onInteraction(e,!0)),Ia.on(this._element,Eu,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Iu.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ra(Iu),pa(Iu),document.addEventListener("DOMContentLoaded",()=>{Array.from(document.querySelectorAll(".dropdown")).forEach(e=>new hc(e)),f.formsHandler.netteForms=y,f.initialize(),((e,t={})=>{new gs(e,t)})(new ms(f),{datagrid:{plugins:[new st,new ot,new lt,new dt,new ut,new ht,new it(y),new rt(new bn),new tt(new ps({buttonClass:"btn"})),new nt(new yn(Me)),new pt]}})});
20
20
  //# sourceMappingURL=datagrid-full.js.map