netbox/netbox/project-static/dist/netbox.js
Jeremy Stretch c2d67fa17e
Closes #17256: Fix translation support in VLAN group scope assignment form (#17270)
* Closes #17256: Fix translation support in VLAN group scope assignment form

* Disable scope field if scope type not selected; update label on type change

* Reset selected scope object when changing scope type
2024-08-27 13:58:56 -04:00

43 lines
381 KiB
JavaScript

"use strict";(()=>{var nh=Object.create;var Ua=Object.defineProperty,rh=Object.defineProperties,sh=Object.getOwnPropertyDescriptor,oh=Object.getOwnPropertyDescriptors,ah=Object.getOwnPropertyNames,du=Object.getOwnPropertySymbols,lh=Object.getPrototypeOf,fu=Object.prototype.hasOwnProperty,ch=Object.prototype.propertyIsEnumerable;var tc=(ii,ti,ei)=>ti in ii?Ua(ii,ti,{enumerable:!0,configurable:!0,writable:!0,value:ei}):ii[ti]=ei,Ui=(ii,ti)=>{for(var ei in ti||(ti={}))fu.call(ti,ei)&&tc(ii,ei,ti[ei]);if(du)for(var ei of du(ti))ch.call(ti,ei)&&tc(ii,ei,ti[ei]);return ii},Hn=(ii,ti)=>rh(ii,oh(ti));var Ya=(ii,ti)=>()=>(ti||ii((ti={exports:{}}).exports,ti),ti.exports),hu=(ii,ti)=>{for(var ei in ti)Ua(ii,ei,{get:ti[ei],enumerable:!0})},uh=(ii,ti,ei,ni)=>{if(ti&&typeof ti=="object"||typeof ti=="function")for(let ri of ah(ti))!fu.call(ii,ri)&&ri!==ei&&Ua(ii,ri,{get:()=>ti[ri],enumerable:!(ni=sh(ti,ri))||ni.enumerable});return ii};var zo=(ii,ti,ei)=>(ei=ii!=null?nh(lh(ii)):{},uh(ti||!ii||!ii.__esModule?Ua(ei,"default",{value:ii,enumerable:!0}):ei,ii));var Rn=(ii,ti,ei)=>tc(ii,typeof ti!="symbol"?ti+"":ti,ei);var ks=(ii,ti,ei)=>new Promise((ni,ri)=>{var si=di=>{try{li(ei.next(di))}catch(mi){ri(mi)}},ai=di=>{try{li(ei.throw(di))}catch(mi){ri(mi)}},li=di=>di.done?ni(di.value):Promise.resolve(di.value).then(si,ai);li((ei=ei.apply(ii,ti)).next())});var Id=Ya((exports,module)=>{(function(ii,ti){typeof define=="function"&&define.amd?define([],ti):typeof module=="object"&&module.exports?module.exports=ti():ii.htmx=ii.htmx||ti()})(typeof self!="undefined"?self:exports,function(){return function(){"use strict";var Q={onLoad:F,process:zt,on:de,off:ge,trigger:ce,ajax:Nr,find:C,findAll:f,closest:v,values:function(ii,ti){var ei=dr(ii,ti||"post");return ei.values},remove:_,addClass:z,removeClass:n,toggleClass:$,takeClass:W,defineExtension:Ur,removeExtension:Br,logAll:V,logNone:j,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:!1,scrollBehavior:"smooth",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get"],selfRequestsOnly:!1,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null},parseInterval:d,_:t,createEventSource:function(ii){return new EventSource(ii,{withCredentials:!0})},createWebSocket:function(ii){var ti=new WebSocket(ii,[]);return ti.binaryType=Q.config.wsBinaryType,ti},version:"1.9.12"},r={addTriggerHandler:Lt,bodyContains:se,canAccessLocalStorage:U,findThisElement:xe,filterValues:yr,hasAttribute:o,getAttributeValue:te,getClosestAttributeValue:ne,getClosestMatch:c,getExpressionVars:Hr,getHeaders:xr,getInputValues:dr,getInternalData:ae,getSwapSpecification:wr,getTriggerSpecs:it,getTarget:ye,makeFragment:l,mergeObjects:le,makeSettleInfo:T,oobSwap:Ee,querySelectorExt:ue,selectAndSwap:je,settleImmediately:nr,shouldCancel:ut,triggerEvent:ce,triggerErrorEvent:fe,withExtensions:R},w=["get","post","put","delete","patch"],i=w.map(function(ii){return"[hx-"+ii+"], [data-hx-"+ii+"]"}).join(", "),S=e("head"),q=e("title"),H=e("svg",!0);function e(ii,ti){return new RegExp("<"+ii+"(\\s[^>]*>|>)([\\s\\S]*?)<\\/"+ii+">",ti?"gim":"im")}function d(ii){if(ii==null)return;let ti=NaN;return ii.slice(-2)=="ms"?ti=parseFloat(ii.slice(0,-2)):ii.slice(-1)=="s"?ti=parseFloat(ii.slice(0,-1))*1e3:ii.slice(-1)=="m"?ti=parseFloat(ii.slice(0,-1))*1e3*60:ti=parseFloat(ii),isNaN(ti)?void 0:ti}function ee(ii,ti){return ii.getAttribute&&ii.getAttribute(ti)}function o(ii,ti){return ii.hasAttribute&&(ii.hasAttribute(ti)||ii.hasAttribute("data-"+ti))}function te(ii,ti){return ee(ii,ti)||ee(ii,"data-"+ti)}function u(ii){return ii.parentElement}function re(){return document}function c(ii,ti){for(;ii&&!ti(ii);)ii=u(ii);return ii||null}function L(ii,ti,ei){var ni=te(ti,ei),ri=te(ti,"hx-disinherit");return ii!==ti&&ri&&(ri==="*"||ri.split(" ").indexOf(ei)>=0)?"unset":ni}function ne(ii,ti){var ei=null;if(c(ii,function(ni){return ei=L(ii,ni,ti)}),ei!=="unset")return ei}function h(ii,ti){var ei=ii.matches||ii.matchesSelector||ii.msMatchesSelector||ii.mozMatchesSelector||ii.webkitMatchesSelector||ii.oMatchesSelector;return ei&&ei.call(ii,ti)}function A(ii){var ti=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ei=ti.exec(ii);return ei?ei[1].toLowerCase():""}function s(ii,ti){for(var ei=new DOMParser,ni=ei.parseFromString(ii,"text/html"),ri=ni.body;ti>0;)ti--,ri=ri.firstChild;return ri==null&&(ri=re().createDocumentFragment()),ri}function N(ii){return/<body/.test(ii)}function l(ii){var ti=!N(ii),ei=A(ii),ni=ii;if(ei==="head"&&(ni=ni.replace(S,"")),Q.config.useTemplateFragments&&ti){var ri=s("<body><template>"+ni+"</template></body>",0),si=ri.querySelector("template").content;return Q.config.allowScriptTags?oe(si.querySelectorAll("script"),function(ai){Q.config.inlineScriptNonce&&(ai.nonce=Q.config.inlineScriptNonce),ai.htmxExecuted=navigator.userAgent.indexOf("Firefox")===-1}):oe(si.querySelectorAll("script"),function(ai){_(ai)}),si}switch(ei){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return s("<table>"+ni+"</table>",1);case"col":return s("<table><colgroup>"+ni+"</colgroup></table>",2);case"tr":return s("<table><tbody>"+ni+"</tbody></table>",2);case"td":case"th":return s("<table><tbody><tr>"+ni+"</tr></tbody></table>",3);case"script":case"style":return s("<div>"+ni+"</div>",1);default:return s(ni,0)}}function ie(ii){ii&&ii()}function I(ii,ti){return Object.prototype.toString.call(ii)==="[object "+ti+"]"}function k(ii){return I(ii,"Function")}function P(ii){return I(ii,"Object")}function ae(ii){var ti="htmx-internal-data",ei=ii[ti];return ei||(ei=ii[ti]={}),ei}function M(ii){var ti=[];if(ii)for(var ei=0;ei<ii.length;ei++)ti.push(ii[ei]);return ti}function oe(ii,ti){if(ii)for(var ei=0;ei<ii.length;ei++)ti(ii[ei])}function X(ii){var ti=ii.getBoundingClientRect(),ei=ti.top,ni=ti.bottom;return ei<window.innerHeight&&ni>=0}function se(ii){return ii.getRootNode&&ii.getRootNode()instanceof window.ShadowRoot?re().body.contains(ii.getRootNode().host):re().body.contains(ii)}function D(ii){return ii.trim().split(/\s+/)}function le(ii,ti){for(var ei in ti)ti.hasOwnProperty(ei)&&(ii[ei]=ti[ei]);return ii}function E(ii){try{return JSON.parse(ii)}catch(ti){return b(ti),null}}function U(){var ii="htmx:localStorageTest";try{return localStorage.setItem(ii,ii),localStorage.removeItem(ii),!0}catch(ti){return!1}}function B(ii){try{var ti=new URL(ii);return ti&&(ii=ti.pathname+ti.search),/^\/$/.test(ii)||(ii=ii.replace(/\/+$/,"")),ii}catch(ei){return ii}}function t(e){return Tr(re().body,function(){return eval(e)})}function F(ii){var ti=Q.on("htmx:load",function(ei){ii(ei.detail.elt)});return ti}function V(){Q.logger=function(ii,ti,ei){console&&console.log(ti,ii,ei)}}function j(){Q.logger=null}function C(ii,ti){return ti?ii.querySelector(ti):C(re(),ii)}function f(ii,ti){return ti?ii.querySelectorAll(ti):f(re(),ii)}function _(ii,ti){ii=p(ii),ti?setTimeout(function(){_(ii),ii=null},ti):ii.parentElement.removeChild(ii)}function z(ii,ti,ei){ii=p(ii),ei?setTimeout(function(){z(ii,ti),ii=null},ei):ii.classList&&ii.classList.add(ti)}function n(ii,ti,ei){ii=p(ii),ei?setTimeout(function(){n(ii,ti),ii=null},ei):ii.classList&&(ii.classList.remove(ti),ii.classList.length===0&&ii.removeAttribute("class"))}function $(ii,ti){ii=p(ii),ii.classList.toggle(ti)}function W(ii,ti){ii=p(ii),oe(ii.parentElement.children,function(ei){n(ei,ti)}),z(ii,ti)}function v(ii,ti){if(ii=p(ii),ii.closest)return ii.closest(ti);do if(ii==null||h(ii,ti))return ii;while(ii=ii&&u(ii));return null}function g(ii,ti){return ii.substring(0,ti.length)===ti}function G(ii,ti){return ii.substring(ii.length-ti.length)===ti}function J(ii){var ti=ii.trim();return g(ti,"<")&&G(ti,"/>")?ti.substring(1,ti.length-2):ti}function Z(ii,ti){return ti.indexOf("closest ")===0?[v(ii,J(ti.substr(8)))]:ti.indexOf("find ")===0?[C(ii,J(ti.substr(5)))]:ti==="next"?[ii.nextElementSibling]:ti.indexOf("next ")===0?[K(ii,J(ti.substr(5)))]:ti==="previous"?[ii.previousElementSibling]:ti.indexOf("previous ")===0?[Y(ii,J(ti.substr(9)))]:ti==="document"?[document]:ti==="window"?[window]:ti==="body"?[document.body]:re().querySelectorAll(J(ti))}var K=function(ii,ti){for(var ei=re().querySelectorAll(ti),ni=0;ni<ei.length;ni++){var ri=ei[ni];if(ri.compareDocumentPosition(ii)===Node.DOCUMENT_POSITION_PRECEDING)return ri}},Y=function(ii,ti){for(var ei=re().querySelectorAll(ti),ni=ei.length-1;ni>=0;ni--){var ri=ei[ni];if(ri.compareDocumentPosition(ii)===Node.DOCUMENT_POSITION_FOLLOWING)return ri}};function ue(ii,ti){return ti?Z(ii,ti)[0]:Z(re().body,ii)[0]}function p(ii){return I(ii,"String")?C(ii):ii}function ve(ii,ti,ei){return k(ti)?{target:re().body,event:ii,listener:ti}:{target:p(ii),event:ti,listener:ei}}function de(ii,ti,ei){jr(function(){var ri=ve(ii,ti,ei);ri.target.addEventListener(ri.event,ri.listener)});var ni=k(ti);return ni?ti:ei}function ge(ii,ti,ei){return jr(function(){var ni=ve(ii,ti,ei);ni.target.removeEventListener(ni.event,ni.listener)}),k(ti)?ti:ei}var pe=re().createElement("output");function me(ii,ti){var ei=ne(ii,ti);if(ei){if(ei==="this")return[xe(ii,ti)];var ni=Z(ii,ei);return ni.length===0?(b('The selector "'+ei+'" on '+ti+" returned no matches!"),[pe]):ni}}function xe(ii,ti){return c(ii,function(ei){return te(ei,ti)!=null})}function ye(ii){var ti=ne(ii,"hx-target");if(ti)return ti==="this"?xe(ii,"hx-target"):ue(ii,ti);var ei=ae(ii);return ei.boosted?re().body:ii}function be(ii){for(var ti=Q.config.attributesToSettle,ei=0;ei<ti.length;ei++)if(ii===ti[ei])return!0;return!1}function we(ii,ti){oe(ii.attributes,function(ei){!ti.hasAttribute(ei.name)&&be(ei.name)&&ii.removeAttribute(ei.name)}),oe(ti.attributes,function(ei){be(ei.name)&&ii.setAttribute(ei.name,ei.value)})}function Se(ii,ti){for(var ei=Fr(ti),ni=0;ni<ei.length;ni++){var ri=ei[ni];try{if(ri.isInlineSwap(ii))return!0}catch(si){b(si)}}return ii==="outerHTML"}function Ee(ii,ti,ei){var ni="#"+ee(ti,"id"),ri="outerHTML";ii==="true"||(ii.indexOf(":")>0?(ri=ii.substr(0,ii.indexOf(":")),ni=ii.substr(ii.indexOf(":")+1,ii.length)):ri=ii);var si=re().querySelectorAll(ni);return si?(oe(si,function(ai){var li,di=ti.cloneNode(!0);li=re().createDocumentFragment(),li.appendChild(di),Se(ri,ai)||(li=di);var mi={shouldSwap:!0,target:ai,fragment:li};ce(ai,"htmx:oobBeforeSwap",mi)&&(ai=mi.target,mi.shouldSwap&&Fe(ri,ai,ai,li,ei),oe(ei.elts,function(hi){ce(hi,"htmx:oobAfterSwap",mi)}))}),ti.parentNode.removeChild(ti)):(ti.parentNode.removeChild(ti),fe(re().body,"htmx:oobErrorNoTarget",{content:ti})),ii}function Ce(ii,ti,ei){var ni=ne(ii,"hx-select-oob");if(ni)for(var ri=ni.split(","),si=0;si<ri.length;si++){var ai=ri[si].split(":",2),li=ai[0].trim();li.indexOf("#")===0&&(li=li.substring(1));var di=ai[1]||"true",mi=ti.querySelector("#"+li);mi&&Ee(di,mi,ei)}oe(f(ti,"[hx-swap-oob], [data-hx-swap-oob]"),function(hi){var _i=te(hi,"hx-swap-oob");_i!=null&&Ee(_i,hi,ei)})}function Re(ii){oe(f(ii,"[hx-preserve], [data-hx-preserve]"),function(ti){var ei=te(ti,"id"),ni=re().getElementById(ei);ni!=null&&ti.parentNode.replaceChild(ni,ti)})}function Te(ii,ti,ei){oe(ti.querySelectorAll("[id]"),function(ni){var ri=ee(ni,"id");if(ri&&ri.length>0){var si=ri.replace("'","\\'"),ai=ni.tagName.replace(":","\\:"),li=ii.querySelector(ai+"[id='"+si+"']");if(li&&li!==ii){var di=ni.cloneNode();we(ni,li),ei.tasks.push(function(){we(ni,di)})}}})}function Oe(ii){return function(){n(ii,Q.config.addedClass),zt(ii),Nt(ii),qe(ii),ce(ii,"htmx:load")}}function qe(ii){var ti="[autofocus]",ei=h(ii,ti)?ii:ii.querySelector(ti);ei!=null&&ei.focus()}function a(ii,ti,ei,ni){for(Te(ii,ei,ni);ei.childNodes.length>0;){var ri=ei.firstChild;z(ri,Q.config.addedClass),ii.insertBefore(ri,ti),ri.nodeType!==Node.TEXT_NODE&&ri.nodeType!==Node.COMMENT_NODE&&ni.tasks.push(Oe(ri))}}function He(ii,ti){for(var ei=0;ei<ii.length;)ti=(ti<<5)-ti+ii.charCodeAt(ei++)|0;return ti}function Le(ii){var ti=0;if(ii.attributes)for(var ei=0;ei<ii.attributes.length;ei++){var ni=ii.attributes[ei];ni.value&&(ti=He(ni.name,ti),ti=He(ni.value,ti))}return ti}function Ae(ii){var ti=ae(ii);if(ti.onHandlers){for(var ei=0;ei<ti.onHandlers.length;ei++){let ni=ti.onHandlers[ei];ii.removeEventListener(ni.event,ni.listener)}delete ti.onHandlers}}function Ne(ii){var ti=ae(ii);ti.timeout&&clearTimeout(ti.timeout),ti.webSocket&&ti.webSocket.close(),ti.sseEventSource&&ti.sseEventSource.close(),ti.listenerInfos&&oe(ti.listenerInfos,function(ei){ei.on&&ei.on.removeEventListener(ei.trigger,ei.listener)}),Ae(ii),oe(Object.keys(ti),function(ei){delete ti[ei]})}function m(ii){ce(ii,"htmx:beforeCleanupElement"),Ne(ii),ii.children&&oe(ii.children,function(ti){m(ti)})}function Ie(ii,ti,ei){if(ii.tagName==="BODY")return Ue(ii,ti,ei);var ni,ri=ii.previousSibling;for(a(u(ii),ii,ti,ei),ri==null?ni=u(ii).firstChild:ni=ri.nextSibling,ei.elts=ei.elts.filter(function(si){return si!=ii});ni&&ni!==ii;)ni.nodeType===Node.ELEMENT_NODE&&ei.elts.push(ni),ni=ni.nextElementSibling;m(ii),u(ii).removeChild(ii)}function ke(ii,ti,ei){return a(ii,ii.firstChild,ti,ei)}function Pe(ii,ti,ei){return a(u(ii),ii,ti,ei)}function Me(ii,ti,ei){return a(ii,null,ti,ei)}function Xe(ii,ti,ei){return a(u(ii),ii.nextSibling,ti,ei)}function De(ii,ti,ei){return m(ii),u(ii).removeChild(ii)}function Ue(ii,ti,ei){var ni=ii.firstChild;if(a(ii,ni,ti,ei),ni){for(;ni.nextSibling;)m(ni.nextSibling),ii.removeChild(ni.nextSibling);m(ni),ii.removeChild(ni)}}function Be(ii,ti,ei){var ni=ei||ne(ii,"hx-select");if(ni){var ri=re().createDocumentFragment();oe(ti.querySelectorAll(ni),function(si){ri.appendChild(si)}),ti=ri}return ti}function Fe(ii,ti,ei,ni,ri){switch(ii){case"none":return;case"outerHTML":Ie(ei,ni,ri);return;case"afterbegin":ke(ei,ni,ri);return;case"beforebegin":Pe(ei,ni,ri);return;case"beforeend":Me(ei,ni,ri);return;case"afterend":Xe(ei,ni,ri);return;case"delete":De(ei,ni,ri);return;default:for(var si=Fr(ti),ai=0;ai<si.length;ai++){var li=si[ai];try{var di=li.handleSwap(ii,ei,ni,ri);if(di){if(typeof di.length!="undefined")for(var mi=0;mi<di.length;mi++){var hi=di[mi];hi.nodeType!==Node.TEXT_NODE&&hi.nodeType!==Node.COMMENT_NODE&&ri.tasks.push(Oe(hi))}return}}catch(_i){b(_i)}}ii==="innerHTML"?Ue(ei,ni,ri):Fe(Q.config.defaultSwapStyle,ti,ei,ni,ri)}}function Ve(ii){if(ii.indexOf("<title")>-1){var ti=ii.replace(H,""),ei=ti.match(q);if(ei)return ei[2]}}function je(ii,ti,ei,ni,ri,si){ri.title=Ve(ni);var ai=l(ni);if(ai)return Ce(ei,ai,ri),ai=Be(ei,ai,si),Re(ai),Fe(ii,ei,ti,ai,ri)}function _e(ii,ti,ei){var ni=ii.getResponseHeader(ti);if(ni.indexOf("{")===0){var ri=E(ni);for(var si in ri)if(ri.hasOwnProperty(si)){var ai=ri[si];P(ai)||(ai={value:ai}),ce(ei,si,ai)}}else for(var li=ni.split(","),di=0;di<li.length;di++)ce(ei,li[di].trim(),[])}var ze=/\s/,x=/[\s,]/,$e=/[_$a-zA-Z]/,We=/[_$a-zA-Z0-9]/,Ge=['"',"'","/"],Je=/[^\s]/,Ze=/[{(]/,Ke=/[})]/;function Ye(ii){for(var ti=[],ei=0;ei<ii.length;){if($e.exec(ii.charAt(ei))){for(var ni=ei;We.exec(ii.charAt(ei+1));)ei++;ti.push(ii.substr(ni,ei-ni+1))}else if(Ge.indexOf(ii.charAt(ei))!==-1){var ri=ii.charAt(ei),ni=ei;for(ei++;ei<ii.length&&ii.charAt(ei)!==ri;)ii.charAt(ei)==="\\"&&ei++,ei++;ti.push(ii.substr(ni,ei-ni+1))}else{var si=ii.charAt(ei);ti.push(si)}ei++}return ti}function Qe(ii,ti,ei){return $e.exec(ii.charAt(0))&&ii!=="true"&&ii!=="false"&&ii!=="this"&&ii!==ei&&ti!=="."}function et(ii,ti,ei){if(ti[0]==="["){ti.shift();for(var ni=1,ri=" return (function("+ei+"){ return (",si=null;ti.length>0;){var ai=ti[0];if(ai==="]"){if(ni--,ni===0){si===null&&(ri=ri+"true"),ti.shift(),ri+=")})";try{var li=Tr(ii,function(){return Function(ri)()},function(){return!0});return li.source=ri,li}catch(di){return fe(re().body,"htmx:syntax:error",{error:di,source:ri}),null}}}else ai==="["&&ni++;Qe(ai,si,ei)?ri+="(("+ei+"."+ai+") ? ("+ei+"."+ai+") : (window."+ai+"))":ri=ri+ai,si=ti.shift()}}}function y(ii,ti){for(var ei="";ii.length>0&&!ti.test(ii[0]);)ei+=ii.shift();return ei}function tt(ii){var ti;return ii.length>0&&Ze.test(ii[0])?(ii.shift(),ti=y(ii,Ke).trim(),ii.shift()):ti=y(ii,x),ti}var rt="input, textarea, select";function nt(ii,ti,ei){var ni=[],ri=Ye(ti);do{y(ri,Je);var si=ri.length,ai=y(ri,/[,\[\s]/);if(ai!=="")if(ai==="every"){var li={trigger:"every"};y(ri,Je),li.pollInterval=d(y(ri,/[,\[\s]/)),y(ri,Je);var di=et(ii,ri,"event");di&&(li.eventFilter=di),ni.push(li)}else if(ai.indexOf("sse:")===0)ni.push({trigger:"sse",sseEvent:ai.substr(4)});else{var mi={trigger:ai},di=et(ii,ri,"event");for(di&&(mi.eventFilter=di);ri.length>0&&ri[0]!==",";){y(ri,Je);var hi=ri.shift();if(hi==="changed")mi.changed=!0;else if(hi==="once")mi.once=!0;else if(hi==="consume")mi.consume=!0;else if(hi==="delay"&&ri[0]===":")ri.shift(),mi.delay=d(y(ri,x));else if(hi==="from"&&ri[0]===":"){if(ri.shift(),Ze.test(ri[0]))var _i=tt(ri);else{var _i=y(ri,x);if(_i==="closest"||_i==="find"||_i==="next"||_i==="previous"){ri.shift();var Ei=tt(ri);Ei.length>0&&(_i+=" "+Ei)}}mi.from=_i}else hi==="target"&&ri[0]===":"?(ri.shift(),mi.target=tt(ri)):hi==="throttle"&&ri[0]===":"?(ri.shift(),mi.throttle=d(y(ri,x))):hi==="queue"&&ri[0]===":"?(ri.shift(),mi.queue=y(ri,x)):hi==="root"&&ri[0]===":"?(ri.shift(),mi[hi]=tt(ri)):hi==="threshold"&&ri[0]===":"?(ri.shift(),mi[hi]=y(ri,x)):fe(ii,"htmx:syntax:error",{token:ri.shift()})}ni.push(mi)}ri.length===si&&fe(ii,"htmx:syntax:error",{token:ri.shift()}),y(ri,Je)}while(ri[0]===","&&ri.shift());return ei&&(ei[ti]=ni),ni}function it(ii){var ti=te(ii,"hx-trigger"),ei=[];if(ti){var ni=Q.config.triggerSpecsCache;ei=ni&&ni[ti]||nt(ii,ti,ni)}return ei.length>0?ei:h(ii,"form")?[{trigger:"submit"}]:h(ii,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:h(ii,rt)?[{trigger:"change"}]:[{trigger:"click"}]}function at(ii){ae(ii).cancelled=!0}function ot(ii,ti,ei){var ni=ae(ii);ni.timeout=setTimeout(function(){se(ii)&&ni.cancelled!==!0&&(ct(ei,ii,Wt("hx:poll:trigger",{triggerSpec:ei,target:ii}))||ti(ii),ot(ii,ti,ei))},ei.pollInterval)}function st(ii){return location.hostname===ii.hostname&&ee(ii,"href")&&ee(ii,"href").indexOf("#")!==0}function lt(ii,ti,ei){if(ii.tagName==="A"&&st(ii)&&(ii.target===""||ii.target==="_self")||ii.tagName==="FORM"){ti.boosted=!0;var ni,ri;if(ii.tagName==="A")ni="get",ri=ee(ii,"href");else{var si=ee(ii,"method");ni=si?si.toLowerCase():"get",ri=ee(ii,"action")}ei.forEach(function(ai){ht(ii,function(li,di){if(v(li,Q.config.disableSelector)){m(li);return}he(ni,ri,li,di)},ti,ai,!0)})}}function ut(ii,ti){return!!((ii.type==="submit"||ii.type==="click")&&(ti.tagName==="FORM"||h(ti,'input[type="submit"], button')&&v(ti,"form")!==null||ti.tagName==="A"&&ti.href&&(ti.getAttribute("href")==="#"||ti.getAttribute("href").indexOf("#")!==0)))}function ft(ii,ti){return ae(ii).boosted&&ii.tagName==="A"&&ti.type==="click"&&(ti.ctrlKey||ti.metaKey)}function ct(ii,ti,ei){var ni=ii.eventFilter;if(ni)try{return ni.call(ti,ei)!==!0}catch(ri){return fe(re().body,"htmx:eventFilter:error",{error:ri,source:ni.source}),!0}return!1}function ht(ii,ti,ei,ni,ri){var si=ae(ii),ai;ni.from?ai=Z(ii,ni.from):ai=[ii],ni.changed&&ai.forEach(function(li){var di=ae(li);di.lastValue=li.value}),oe(ai,function(li){var di=function(mi){if(!se(ii)){li.removeEventListener(ni.trigger,di);return}if(!ft(ii,mi)&&((ri||ut(mi,ii))&&mi.preventDefault(),!ct(ni,ii,mi))){var hi=ae(mi);if(hi.triggerSpec=ni,hi.handledFor==null&&(hi.handledFor=[]),hi.handledFor.indexOf(ii)<0){if(hi.handledFor.push(ii),ni.consume&&mi.stopPropagation(),ni.target&&mi.target&&!h(mi.target,ni.target))return;if(ni.once){if(si.triggeredOnce)return;si.triggeredOnce=!0}if(ni.changed){var _i=ae(li);if(_i.lastValue===li.value)return;_i.lastValue=li.value}if(si.delayed&&clearTimeout(si.delayed),si.throttle)return;ni.throttle>0?si.throttle||(ti(ii,mi),si.throttle=setTimeout(function(){si.throttle=null},ni.throttle)):ni.delay>0?si.delayed=setTimeout(function(){ti(ii,mi)},ni.delay):(ce(ii,"htmx:trigger"),ti(ii,mi))}}};ei.listenerInfos==null&&(ei.listenerInfos=[]),ei.listenerInfos.push({trigger:ni.trigger,listener:di,on:li}),li.addEventListener(ni.trigger,di)})}var vt=!1,dt=null;function gt(){dt||(dt=function(){vt=!0},window.addEventListener("scroll",dt),setInterval(function(){vt&&(vt=!1,oe(re().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(ii){pt(ii)}))},200))}function pt(ii){if(!o(ii,"data-hx-revealed")&&X(ii)){ii.setAttribute("data-hx-revealed","true");var ti=ae(ii);ti.initHash?ce(ii,"revealed"):ii.addEventListener("htmx:afterProcessNode",function(ei){ce(ii,"revealed")},{once:!0})}}function mt(ii,ti,ei){for(var ni=D(ei),ri=0;ri<ni.length;ri++){var si=ni[ri].split(/:(.+)/);si[0]==="connect"&&xt(ii,si[1],0),si[0]==="send"&&bt(ii)}}function xt(ii,ti,ei){if(se(ii)){if(ti.indexOf("/")==0){var ni=location.hostname+(location.port?":"+location.port:"");location.protocol=="https:"?ti="wss://"+ni+ti:location.protocol=="http:"&&(ti="ws://"+ni+ti)}var ri=Q.createWebSocket(ti);ri.onerror=function(si){fe(ii,"htmx:wsError",{error:si,socket:ri}),yt(ii)},ri.onclose=function(si){if([1006,1012,1013].indexOf(si.code)>=0){var ai=wt(ei);setTimeout(function(){xt(ii,ti,ei+1)},ai)}},ri.onopen=function(si){ei=0},ae(ii).webSocket=ri,ri.addEventListener("message",function(si){if(!yt(ii)){var ai=si.data;R(ii,function(Ei){ai=Ei.transformResponse(ai,null,ii)});for(var li=T(ii),di=l(ai),mi=M(di.children),hi=0;hi<mi.length;hi++){var _i=mi[hi];Ee(te(_i,"hx-swap-oob")||"true",_i,li)}nr(li.tasks)}})}}function yt(ii){if(!se(ii))return ae(ii).webSocket.close(),!0}function bt(ii){var ti=c(ii,function(ei){return ae(ei).webSocket!=null});ti?ii.addEventListener(it(ii)[0].trigger,function(ei){var ni=ae(ti).webSocket,ri=xr(ii,ti),si=dr(ii,"post"),ai=si.errors,li=si.values,di=Hr(ii),mi=le(li,di),hi=yr(mi,ii);if(hi.HEADERS=ri,ai&&ai.length>0){ce(ii,"htmx:validation:halted",ai);return}ni.send(JSON.stringify(hi)),ut(ei,ii)&&ei.preventDefault()}):fe(ii,"htmx:noWebSocketSourceError")}function wt(ii){var ti=Q.config.wsReconnectDelay;if(typeof ti=="function")return ti(ii);if(ti==="full-jitter"){var ei=Math.min(ii,6),ni=1e3*Math.pow(2,ei);return ni*Math.random()}b('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function St(ii,ti,ei){for(var ni=D(ei),ri=0;ri<ni.length;ri++){var si=ni[ri].split(/:(.+)/);si[0]==="connect"&&Et(ii,si[1]),si[0]==="swap"&&Ct(ii,si[1])}}function Et(ii,ti){var ei=Q.createEventSource(ti);ei.onerror=function(ni){fe(ii,"htmx:sseError",{error:ni,source:ei}),Tt(ii)},ae(ii).sseEventSource=ei}function Ct(ii,ti){var ei=c(ii,Ot);if(ei){var ni=ae(ei).sseEventSource,ri=function(si){if(!Tt(ei)){if(!se(ii)){ni.removeEventListener(ti,ri);return}var ai=si.data;R(ii,function(hi){ai=hi.transformResponse(ai,null,ii)});var li=wr(ii),di=ye(ii),mi=T(ii);je(li.swapStyle,di,ii,ai,mi),nr(mi.tasks),ce(ii,"htmx:sseMessage",si)}};ae(ii).sseListener=ri,ni.addEventListener(ti,ri)}else fe(ii,"htmx:noSSESourceError")}function Rt(ii,ti,ei){var ni=c(ii,Ot);if(ni){var ri=ae(ni).sseEventSource,si=function(){Tt(ni)||(se(ii)?ti(ii):ri.removeEventListener(ei,si))};ae(ii).sseListener=si,ri.addEventListener(ei,si)}else fe(ii,"htmx:noSSESourceError")}function Tt(ii){if(!se(ii))return ae(ii).sseEventSource.close(),!0}function Ot(ii){return ae(ii).sseEventSource!=null}function qt(ii,ti,ei,ni){var ri=function(){ei.loaded||(ei.loaded=!0,ti(ii))};ni>0?setTimeout(ri,ni):ri()}function Ht(ii,ti,ei){var ni=!1;return oe(w,function(ri){if(o(ii,"hx-"+ri)){var si=te(ii,"hx-"+ri);ni=!0,ti.path=si,ti.verb=ri,ei.forEach(function(ai){Lt(ii,ai,ti,function(li,di){if(v(li,Q.config.disableSelector)){m(li);return}he(ri,si,li,di)})})}}),ni}function Lt(ii,ti,ei,ni){if(ti.sseEvent)Rt(ii,ni,ti.sseEvent);else if(ti.trigger==="revealed")gt(),ht(ii,ni,ei,ti),pt(ii);else if(ti.trigger==="intersect"){var ri={};ti.root&&(ri.root=ue(ii,ti.root)),ti.threshold&&(ri.threshold=parseFloat(ti.threshold));var si=new IntersectionObserver(function(ai){for(var li=0;li<ai.length;li++){var di=ai[li];if(di.isIntersecting){ce(ii,"intersect");break}}},ri);si.observe(ii),ht(ii,ni,ei,ti)}else ti.trigger==="load"?ct(ti,ii,Wt("load",{elt:ii}))||qt(ii,ni,ei,ti.delay):ti.pollInterval>0?(ei.polling=!0,ot(ii,ni,ti)):ht(ii,ni,ei,ti)}function At(ii){if(!ii.htmxExecuted&&Q.config.allowScriptTags&&(ii.type==="text/javascript"||ii.type==="module"||ii.type==="")){var ti=re().createElement("script");oe(ii.attributes,function(ni){ti.setAttribute(ni.name,ni.value)}),ti.textContent=ii.textContent,ti.async=!1,Q.config.inlineScriptNonce&&(ti.nonce=Q.config.inlineScriptNonce);var ei=ii.parentElement;try{ei.insertBefore(ti,ii)}catch(ni){b(ni)}finally{ii.parentElement&&ii.parentElement.removeChild(ii)}}}function Nt(ii){h(ii,"script")&&At(ii),oe(f(ii,"script"),function(ti){At(ti)})}function It(ii){var ti=ii.attributes;if(!ti)return!1;for(var ei=0;ei<ti.length;ei++){var ni=ti[ei].name;if(g(ni,"hx-on:")||g(ni,"data-hx-on:")||g(ni,"hx-on-")||g(ni,"data-hx-on-"))return!0}return!1}function kt(ii){var ti=null,ei=[];if(It(ii)&&ei.push(ii),document.evaluate)for(var ni=document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]',ii);ti=ni.iterateNext();)ei.push(ti);else if(typeof ii.getElementsByTagName=="function")for(var ri=ii.getElementsByTagName("*"),si=0;si<ri.length;si++)It(ri[si])&&ei.push(ri[si]);return ei}function Pt(ii){if(ii.querySelectorAll){var ti=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]",ei=ii.querySelectorAll(i+ti+", form, [type='submit'], [hx-sse], [data-hx-sse], [hx-ws], [data-hx-ws], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger], [hx-on], [data-hx-on]");return ei}else return[]}function Mt(ii){var ti=v(ii.target,"button, input[type='submit']"),ei=Dt(ii);ei&&(ei.lastButtonClicked=ti)}function Xt(ii){var ti=Dt(ii);ti&&(ti.lastButtonClicked=null)}function Dt(ii){var ti=v(ii.target,"button, input[type='submit']");if(ti){var ei=p("#"+ee(ti,"form"))||v(ti,"form");if(ei)return ae(ei)}}function Ut(ii){ii.addEventListener("click",Mt),ii.addEventListener("focusin",Mt),ii.addEventListener("focusout",Xt)}function Bt(ii){for(var ti=Ye(ii),ei=0,ni=0;ni<ti.length;ni++){let ri=ti[ni];ri==="{"?ei++:ri==="}"&&ei--}return ei}function Ft(ii,ti,ei){var ni=ae(ii);Array.isArray(ni.onHandlers)||(ni.onHandlers=[]);var ri,si=function(ai){return Tr(ii,function(){ri||(ri=new Function("event",ei)),ri.call(ii,ai)})};ii.addEventListener(ti,si),ni.onHandlers.push({event:ti,listener:si})}function Vt(ii){var ti=te(ii,"hx-on");if(ti){for(var ei={},ni=ti.split(`
`),ri=null,si=0;ni.length>0;){var ai=ni.shift(),li=ai.match(/^\s*([a-zA-Z:\-\.]+:)(.*)/);si===0&&li?(ai.split(":"),ri=li[1].slice(0,-1),ei[ri]=li[2]):ei[ri]+=ai,si+=Bt(ai)}for(var di in ei)Ft(ii,di,ei[di])}}function jt(ii){Ae(ii);for(var ti=0;ti<ii.attributes.length;ti++){var ei=ii.attributes[ti].name,ni=ii.attributes[ti].value;if(g(ei,"hx-on")||g(ei,"data-hx-on")){var ri=ei.indexOf("-on")+3,si=ei.slice(ri,ri+1);if(si==="-"||si===":"){var ai=ei.slice(ri+1);g(ai,":")?ai="htmx"+ai:g(ai,"-")?ai="htmx:"+ai.slice(1):g(ai,"htmx-")&&(ai="htmx:"+ai.slice(5)),Ft(ii,ai,ni)}}}}function _t(ii){if(v(ii,Q.config.disableSelector)){m(ii);return}var ti=ae(ii);if(ti.initHash!==Le(ii)){Ne(ii),ti.initHash=Le(ii),Vt(ii),ce(ii,"htmx:beforeProcessNode"),ii.value&&(ti.lastValue=ii.value);var ei=it(ii),ni=Ht(ii,ti,ei);ni||(ne(ii,"hx-boost")==="true"?lt(ii,ti,ei):o(ii,"hx-trigger")&&ei.forEach(function(ai){Lt(ii,ai,ti,function(){})})),(ii.tagName==="FORM"||ee(ii,"type")==="submit"&&o(ii,"form"))&&Ut(ii);var ri=te(ii,"hx-sse");ri&&St(ii,ti,ri);var si=te(ii,"hx-ws");si&&mt(ii,ti,si),ce(ii,"htmx:afterProcessNode")}}function zt(ii){if(ii=p(ii),v(ii,Q.config.disableSelector)){m(ii);return}_t(ii),oe(Pt(ii),function(ti){_t(ti)}),oe(kt(ii),jt)}function $t(ii){return ii.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Wt(ii,ti){var ei;return window.CustomEvent&&typeof window.CustomEvent=="function"?ei=new CustomEvent(ii,{bubbles:!0,cancelable:!0,detail:ti}):(ei=re().createEvent("CustomEvent"),ei.initCustomEvent(ii,!0,!0,ti)),ei}function fe(ii,ti,ei){ce(ii,ti,le({error:ti},ei))}function Gt(ii){return ii==="htmx:afterProcessNode"}function R(ii,ti){oe(Fr(ii),function(ei){try{ti(ei)}catch(ni){b(ni)}})}function b(ii){console.error?console.error(ii):console.log&&console.log("ERROR: ",ii)}function ce(ii,ti,ei){ii=p(ii),ei==null&&(ei={}),ei.elt=ii;var ni=Wt(ti,ei);Q.logger&&!Gt(ti)&&Q.logger(ii,ti,ei),ei.error&&(b(ei.error),ce(ii,"htmx:error",{errorInfo:ei}));var ri=ii.dispatchEvent(ni),si=$t(ti);if(ri&&si!==ti){var ai=Wt(si,ni.detail);ri=ri&&ii.dispatchEvent(ai)}return R(ii,function(li){ri=ri&&li.onEvent(ti,ni)!==!1&&!ni.defaultPrevented}),ri}var Jt=location.pathname+location.search;function Zt(){var ii=re().querySelector("[hx-history-elt],[data-hx-history-elt]");return ii||re().body}function Kt(ii,ti,ei,ni){if(U()){if(Q.config.historyCacheSize<=0){localStorage.removeItem("htmx-history-cache");return}ii=B(ii);for(var ri=E(localStorage.getItem("htmx-history-cache"))||[],si=0;si<ri.length;si++)if(ri[si].url===ii){ri.splice(si,1);break}var ai={url:ii,content:ti,title:ei,scroll:ni};for(ce(re().body,"htmx:historyItemCreated",{item:ai,cache:ri}),ri.push(ai);ri.length>Q.config.historyCacheSize;)ri.shift();for(;ri.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(ri));break}catch(li){fe(re().body,"htmx:historyCacheError",{cause:li,cache:ri}),ri.shift()}}}function Yt(ii){if(!U())return null;ii=B(ii);for(var ti=E(localStorage.getItem("htmx-history-cache"))||[],ei=0;ei<ti.length;ei++)if(ti[ei].url===ii)return ti[ei];return null}function Qt(ii){var ti=Q.config.requestClass,ei=ii.cloneNode(!0);return oe(f(ei,"."+ti),function(ni){n(ni,ti)}),ei.innerHTML}function er(){var ii=Zt(),ti=Jt||location.pathname+location.search,ei;try{ei=re().querySelector('[hx-history="false" i],[data-hx-history="false" i]')}catch(ni){ei=re().querySelector('[hx-history="false"],[data-hx-history="false"]')}ei||(ce(re().body,"htmx:beforeHistorySave",{path:ti,historyElt:ii}),Kt(ti,Qt(ii),re().title,window.scrollY)),Q.config.historyEnabled&&history.replaceState({htmx:!0},re().title,window.location.href)}function tr(ii){Q.config.getCacheBusterParam&&(ii=ii.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),(G(ii,"&")||G(ii,"?"))&&(ii=ii.slice(0,-1))),Q.config.historyEnabled&&history.pushState({htmx:!0},"",ii),Jt=ii}function rr(ii){Q.config.historyEnabled&&history.replaceState({htmx:!0},"",ii),Jt=ii}function nr(ii){oe(ii,function(ti){ti.call()})}function ir(ii){var ti=new XMLHttpRequest,ei={path:ii,xhr:ti};ce(re().body,"htmx:historyCacheMiss",ei),ti.open("GET",ii,!0),ti.setRequestHeader("HX-Request","true"),ti.setRequestHeader("HX-History-Restore-Request","true"),ti.setRequestHeader("HX-Current-URL",re().location.href),ti.onload=function(){if(this.status>=200&&this.status<400){ce(re().body,"htmx:historyCacheMissLoad",ei);var ni=l(this.response);ni=ni.querySelector("[hx-history-elt],[data-hx-history-elt]")||ni;var ri=Zt(),si=T(ri),ai=Ve(this.response);if(ai){var li=C("title");li?li.innerHTML=ai:window.document.title=ai}Ue(ri,ni,si),nr(si.tasks),Jt=ii,ce(re().body,"htmx:historyRestore",{path:ii,cacheMiss:!0,serverResponse:this.response})}else fe(re().body,"htmx:historyCacheMissLoadError",ei)},ti.send()}function ar(ii){er(),ii=ii||location.pathname+location.search;var ti=Yt(ii);if(ti){var ei=l(ti.content),ni=Zt(),ri=T(ni);Ue(ni,ei,ri),nr(ri.tasks),document.title=ti.title,setTimeout(function(){window.scrollTo(0,ti.scroll)},0),Jt=ii,ce(re().body,"htmx:historyRestore",{path:ii,item:ti})}else Q.config.refreshOnHistoryMiss?window.location.reload(!0):ir(ii)}function or(ii){var ti=me(ii,"hx-indicator");return ti==null&&(ti=[ii]),oe(ti,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)+1,ei.classList.add.call(ei.classList,Q.config.requestClass)}),ti}function sr(ii){var ti=me(ii,"hx-disabled-elt");return ti==null&&(ti=[]),oe(ti,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)+1,ei.setAttribute("disabled","")}),ti}function lr(ii,ti){oe(ii,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)-1,ni.requestCount===0&&ei.classList.remove.call(ei.classList,Q.config.requestClass)}),oe(ti,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)-1,ni.requestCount===0&&ei.removeAttribute("disabled")})}function ur(ii,ti){for(var ei=0;ei<ii.length;ei++){var ni=ii[ei];if(ni.isSameNode(ti))return!0}return!1}function fr(ii){return ii.name===""||ii.name==null||ii.disabled||v(ii,"fieldset[disabled]")||ii.type==="button"||ii.type==="submit"||ii.tagName==="image"||ii.tagName==="reset"||ii.tagName==="file"?!1:ii.type==="checkbox"||ii.type==="radio"?ii.checked:!0}function cr(ii,ti,ei){if(ii!=null&&ti!=null){var ni=ei[ii];ni===void 0?ei[ii]=ti:Array.isArray(ni)?Array.isArray(ti)?ei[ii]=ni.concat(ti):ni.push(ti):Array.isArray(ti)?ei[ii]=[ni].concat(ti):ei[ii]=[ni,ti]}}function hr(ii,ti,ei,ni,ri){if(!(ni==null||ur(ii,ni))){if(ii.push(ni),fr(ni)){var si=ee(ni,"name"),ai=ni.value;ni.multiple&&ni.tagName==="SELECT"&&(ai=M(ni.querySelectorAll("option:checked")).map(function(di){return di.value})),ni.files&&(ai=M(ni.files)),cr(si,ai,ti),ri&&vr(ni,ei)}if(h(ni,"form")){var li=ni.elements;oe(li,function(di){hr(ii,ti,ei,di,ri)})}}}function vr(ii,ti){ii.willValidate&&(ce(ii,"htmx:validation:validate"),ii.checkValidity()||(ti.push({elt:ii,message:ii.validationMessage,validity:ii.validity}),ce(ii,"htmx:validation:failed",{message:ii.validationMessage,validity:ii.validity})))}function dr(ii,ti){var ei=[],ni={},ri={},si=[],ai=ae(ii);ai.lastButtonClicked&&!se(ai.lastButtonClicked)&&(ai.lastButtonClicked=null);var li=h(ii,"form")&&ii.noValidate!==!0||te(ii,"hx-validate")==="true";if(ai.lastButtonClicked&&(li=li&&ai.lastButtonClicked.formNoValidate!==!0),ti!=="get"&&hr(ei,ri,si,v(ii,"form"),li),hr(ei,ni,si,ii,li),ai.lastButtonClicked||ii.tagName==="BUTTON"||ii.tagName==="INPUT"&&ee(ii,"type")==="submit"){var di=ai.lastButtonClicked||ii,mi=ee(di,"name");cr(mi,di.value,ri)}var hi=me(ii,"hx-include");return oe(hi,function(_i){hr(ei,ni,si,_i,li),h(_i,"form")||oe(_i.querySelectorAll(rt),function(Ei){hr(ei,ni,si,Ei,li)})}),ni=le(ni,ri),{errors:si,values:ni}}function gr(ii,ti,ei){ii!==""&&(ii+="&"),String(ei)==="[object Object]"&&(ei=JSON.stringify(ei));var ni=encodeURIComponent(ei);return ii+=encodeURIComponent(ti)+"="+ni,ii}function pr(ii){var ti="";for(var ei in ii)if(ii.hasOwnProperty(ei)){var ni=ii[ei];Array.isArray(ni)?oe(ni,function(ri){ti=gr(ti,ei,ri)}):ti=gr(ti,ei,ni)}return ti}function mr(ii){var ti=new FormData;for(var ei in ii)if(ii.hasOwnProperty(ei)){var ni=ii[ei];Array.isArray(ni)?oe(ni,function(ri){ti.append(ei,ri)}):ti.append(ei,ni)}return ti}function xr(ii,ti,ei){var ni={"HX-Request":"true","HX-Trigger":ee(ii,"id"),"HX-Trigger-Name":ee(ii,"name"),"HX-Target":te(ti,"id"),"HX-Current-URL":re().location.href};return Rr(ii,"hx-headers",!1,ni),ei!==void 0&&(ni["HX-Prompt"]=ei),ae(ii).boosted&&(ni["HX-Boosted"]="true"),ni}function yr(ii,ti){var ei=ne(ti,"hx-params");if(ei){if(ei==="none")return{};if(ei==="*")return ii;if(ei.indexOf("not ")===0)return oe(ei.substr(4).split(","),function(ri){ri=ri.trim(),delete ii[ri]}),ii;var ni={};return oe(ei.split(","),function(ri){ri=ri.trim(),ni[ri]=ii[ri]}),ni}else return ii}function br(ii){return ee(ii,"href")&&ee(ii,"href").indexOf("#")>=0}function wr(ii,ti){var ei=ti||ne(ii,"hx-swap"),ni={swapStyle:ae(ii).boosted?"innerHTML":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&ae(ii).boosted&&!br(ii)&&(ni.show="top"),ei){var ri=D(ei);if(ri.length>0)for(var si=0;si<ri.length;si++){var ai=ri[si];if(ai.indexOf("swap:")===0)ni.swapDelay=d(ai.substr(5));else if(ai.indexOf("settle:")===0)ni.settleDelay=d(ai.substr(7));else if(ai.indexOf("transition:")===0)ni.transition=ai.substr(11)==="true";else if(ai.indexOf("ignoreTitle:")===0)ni.ignoreTitle=ai.substr(12)==="true";else if(ai.indexOf("scroll:")===0){var li=ai.substr(7),di=li.split(":"),mi=di.pop(),hi=di.length>0?di.join(":"):null;ni.scroll=mi,ni.scrollTarget=hi}else if(ai.indexOf("show:")===0){var _i=ai.substr(5),di=_i.split(":"),Ei=di.pop(),hi=di.length>0?di.join(":"):null;ni.show=Ei,ni.showTarget=hi}else if(ai.indexOf("focus-scroll:")===0){var Ai=ai.substr(13);ni.focusScroll=Ai=="true"}else si==0?ni.swapStyle=ai:b("Unknown modifier in hx-swap: "+ai)}}return ni}function Sr(ii){return ne(ii,"hx-encoding")==="multipart/form-data"||h(ii,"form")&&ee(ii,"enctype")==="multipart/form-data"}function Er(ii,ti,ei){var ni=null;return R(ti,function(ri){ni==null&&(ni=ri.encodeParameters(ii,ei,ti))}),ni!=null?ni:Sr(ti)?mr(ei):pr(ei)}function T(ii){return{tasks:[],elts:[ii]}}function Cr(ii,ti){var ei=ii[0],ni=ii[ii.length-1];if(ti.scroll){var ri=null;ti.scrollTarget&&(ri=ue(ei,ti.scrollTarget)),ti.scroll==="top"&&(ei||ri)&&(ri=ri||ei,ri.scrollTop=0),ti.scroll==="bottom"&&(ni||ri)&&(ri=ri||ni,ri.scrollTop=ri.scrollHeight)}if(ti.show){var ri=null;if(ti.showTarget){var si=ti.showTarget;ti.showTarget==="window"&&(si="body"),ri=ue(ei,si)}ti.show==="top"&&(ei||ri)&&(ri=ri||ei,ri.scrollIntoView({block:"start",behavior:Q.config.scrollBehavior})),ti.show==="bottom"&&(ni||ri)&&(ri=ri||ni,ri.scrollIntoView({block:"end",behavior:Q.config.scrollBehavior}))}}function Rr(ii,ti,ei,ni){if(ni==null&&(ni={}),ii==null)return ni;var ri=te(ii,ti);if(ri){var si=ri.trim(),ai=ei;if(si==="unset")return null;si.indexOf("javascript:")===0?(si=si.substr(11),ai=!0):si.indexOf("js:")===0&&(si=si.substr(3),ai=!0),si.indexOf("{")!==0&&(si="{"+si+"}");var li;ai?li=Tr(ii,function(){return Function("return ("+si+")")()},{}):li=E(si);for(var di in li)li.hasOwnProperty(di)&&ni[di]==null&&(ni[di]=li[di])}return Rr(u(ii),ti,ei,ni)}function Tr(ii,ti,ei){return Q.config.allowEval?ti():(fe(ii,"htmx:evalDisallowedError"),ei)}function Or(ii,ti){return Rr(ii,"hx-vars",!0,ti)}function qr(ii,ti){return Rr(ii,"hx-vals",!1,ti)}function Hr(ii){return le(Or(ii),qr(ii))}function Lr(ii,ti,ei){if(ei!==null)try{ii.setRequestHeader(ti,ei)}catch(ni){ii.setRequestHeader(ti,encodeURIComponent(ei)),ii.setRequestHeader(ti+"-URI-AutoEncoded","true")}}function Ar(ii){if(ii.responseURL&&typeof URL!="undefined")try{var ti=new URL(ii.responseURL);return ti.pathname+ti.search}catch(ei){fe(re().body,"htmx:badResponseUrl",{url:ii.responseURL})}}function O(ii,ti){return ti.test(ii.getAllResponseHeaders())}function Nr(ii,ti,ei){return ii=ii.toLowerCase(),ei?ei instanceof Element||I(ei,"String")?he(ii,ti,null,null,{targetOverride:p(ei),returnPromise:!0}):he(ii,ti,p(ei.source),ei.event,{handler:ei.handler,headers:ei.headers,values:ei.values,targetOverride:p(ei.target),swapOverride:ei.swap,select:ei.select,returnPromise:!0}):he(ii,ti,null,null,{returnPromise:!0})}function Ir(ii){for(var ti=[];ii;)ti.push(ii),ii=ii.parentElement;return ti}function kr(ii,ti,ei){var ni,ri;if(typeof URL=="function"){ri=new URL(ti,document.location.href);var si=document.location.origin;ni=si===ri.origin}else ri=ti,ni=g(ti,document.location.origin);return Q.config.selfRequestsOnly&&!ni?!1:ce(ii,"htmx:validateUrl",le({url:ri,sameHost:ni},ei))}function he(ii,ti,ei,ni,ri,si){var ai=null,li=null;if(ri=ri!=null?ri:{},ri.returnPromise&&typeof Promise!="undefined")var di=new Promise(function(qn,yn){ai=qn,li=yn});ei==null&&(ei=re().body);var mi=ri.handler||Mr,hi=ri.select||null;if(!se(ei))return ie(ai),di;var _i=ri.targetOverride||ye(ei);if(_i==null||_i==pe)return fe(ei,"htmx:targetError",{target:te(ei,"hx-target")}),ie(li),di;var Ei=ae(ei),Ai=Ei.lastButtonClicked;if(Ai){var ki=ee(Ai,"formaction");ki!=null&&(ti=ki);var Ti=ee(Ai,"formmethod");Ti!=null&&Ti.toLowerCase()!=="dialog"&&(ii=Ti)}var Fi=ne(ei,"hx-confirm");if(si===void 0){var en=function(qn){return he(ii,ti,ei,ni,ri,!!qn)},rn={target:_i,elt:ei,path:ti,verb:ii,triggeringEvent:ni,etc:ri,issueRequest:en,question:Fi};if(ce(ei,"htmx:confirm",rn)===!1)return ie(ai),di}var ln=ei,Yi=ne(ei,"hx-sync"),on=null,an=!1;if(Yi){var bn=Yi.split(":"),hn=bn[0].trim();if(hn==="this"?ln=xe(ei,"hx-sync"):ln=ue(ei,hn),Yi=(bn[1]||"drop").trim(),Ei=ae(ln),Yi==="drop"&&Ei.xhr&&Ei.abortable!==!0)return ie(ai),di;if(Yi==="abort"){if(Ei.xhr)return ie(ai),di;an=!0}else if(Yi==="replace")ce(ln,"htmx:abort");else if(Yi.indexOf("queue")===0){var pn=Yi.split(" ");on=(pn[1]||"last").trim()}}if(Ei.xhr)if(Ei.abortable)ce(ln,"htmx:abort");else{if(on==null){if(ni){var gn=ae(ni);gn&&gn.triggerSpec&&gn.triggerSpec.queue&&(on=gn.triggerSpec.queue)}on==null&&(on="last")}return Ei.queuedRequests==null&&(Ei.queuedRequests=[]),on==="first"&&Ei.queuedRequests.length===0?Ei.queuedRequests.push(function(){he(ii,ti,ei,ni,ri)}):on==="all"?Ei.queuedRequests.push(function(){he(ii,ti,ei,ni,ri)}):on==="last"&&(Ei.queuedRequests=[],Ei.queuedRequests.push(function(){he(ii,ti,ei,ni,ri)})),ie(ai),di}var un=new XMLHttpRequest;Ei.xhr=un,Ei.abortable=an;var vn=function(){if(Ei.xhr=null,Ei.abortable=!1,Ei.queuedRequests!=null&&Ei.queuedRequests.length>0){var qn=Ei.queuedRequests.shift();qn()}},Tn=ne(ei,"hx-prompt");if(Tn){var Ni=prompt(Tn);if(Ni===null||!ce(ei,"htmx:prompt",{prompt:Ni,target:_i}))return ie(ai),vn(),di}if(Fi&&!si&&!confirm(Fi))return ie(ai),vn(),di;var Hi=xr(ei,_i,Ni);ii!=="get"&&!Sr(ei)&&(Hi["Content-Type"]="application/x-www-form-urlencoded"),ri.headers&&(Hi=le(Hi,ri.headers));var Pi=dr(ei,ii),$i=Pi.errors,mn=Pi.values;ri.values&&(mn=le(mn,ri.values));var tn=Hr(ei),zi=le(mn,tn),Li=yr(zi,ei);Q.config.getCacheBusterParam&&ii==="get"&&(Li["org.htmx.cache-buster"]=ee(_i,"id")||"true"),(ti==null||ti==="")&&(ti=re().location.href);var ji=Rr(ei,"hx-request"),Ji=ae(ei).boosted,Vi=Q.config.methodsThatUseUrlParams.indexOf(ii)>=0,Ii={boosted:Ji,useUrlParams:Vi,parameters:Li,unfilteredParameters:zi,headers:Hi,target:_i,verb:ii,errors:$i,withCredentials:ri.credentials||ji.credentials||Q.config.withCredentials,timeout:ri.timeout||ji.timeout||Q.config.timeout,path:ti,triggeringEvent:ni};if(!ce(ei,"htmx:configRequest",Ii))return ie(ai),vn(),di;if(ti=Ii.path,ii=Ii.verb,Hi=Ii.headers,Li=Ii.parameters,$i=Ii.errors,Vi=Ii.useUrlParams,$i&&$i.length>0)return ce(ei,"htmx:validation:halted",Ii),ie(ai),vn(),di;var Sn=ti.split("#"),Yn=Sn[0],Fn=Sn[1],Bn=ti;if(Vi){Bn=Yn;var Gn=Object.keys(Li).length!==0;Gn&&(Bn.indexOf("?")<0?Bn+="?":Bn+="&",Bn+=pr(Li),Fn&&(Bn+="#"+Fn))}if(!kr(ei,Bn,Ii))return fe(ei,"htmx:invalidPath",Ii),ie(li),di;if(un.open(ii.toUpperCase(),Bn,!0),un.overrideMimeType("text/html"),un.withCredentials=Ii.withCredentials,un.timeout=Ii.timeout,!ji.noHeaders){for(var Qn in Hi)if(Hi.hasOwnProperty(Qn)){var Ts=Hi[Qn];Lr(un,Qn,Ts)}}var zn={xhr:un,target:_i,requestConfig:Ii,etc:ri,boosted:Ji,select:hi,pathInfo:{requestPath:ti,finalRequestPath:Bn,anchor:Fn}};if(un.onload=function(){try{var qn=Ir(ei);if(zn.pathInfo.responsePath=Ar(un),mi(ei,zn),lr(hs,ms),ce(ei,"htmx:afterRequest",zn),ce(ei,"htmx:afterOnLoad",zn),!se(ei)){for(var yn=null;qn.length>0&&yn==null;){var Kr=qn.shift();se(Kr)&&(yn=Kr)}yn&&(ce(yn,"htmx:afterRequest",zn),ce(yn,"htmx:afterOnLoad",zn))}ie(ai),vn()}catch(as){throw fe(ei,"htmx:onLoadError",le({error:as},zn)),as}},un.onerror=function(){lr(hs,ms),fe(ei,"htmx:afterRequest",zn),fe(ei,"htmx:sendError",zn),ie(li),vn()},un.onabort=function(){lr(hs,ms),fe(ei,"htmx:afterRequest",zn),fe(ei,"htmx:sendAbort",zn),ie(li),vn()},un.ontimeout=function(){lr(hs,ms),fe(ei,"htmx:afterRequest",zn),fe(ei,"htmx:timeout",zn),ie(li),vn()},!ce(ei,"htmx:beforeRequest",zn))return ie(ai),vn(),di;var hs=or(ei),ms=sr(ei);oe(["loadstart","loadend","progress","abort"],function(qn){oe([un,un.upload],function(yn){yn.addEventListener(qn,function(Kr){ce(ei,"htmx:xhr:"+qn,{lengthComputable:Kr.lengthComputable,loaded:Kr.loaded,total:Kr.total})})})}),ce(ei,"htmx:beforeSend",zn);var qs=Vi?null:Er(un,ei,Li);return un.send(qs),di}function Pr(ii,ti){var ei=ti.xhr,ni=null,ri=null;if(O(ei,/HX-Push:/i)?(ni=ei.getResponseHeader("HX-Push"),ri="push"):O(ei,/HX-Push-Url:/i)?(ni=ei.getResponseHeader("HX-Push-Url"),ri="push"):O(ei,/HX-Replace-Url:/i)&&(ni=ei.getResponseHeader("HX-Replace-Url"),ri="replace"),ni)return ni==="false"?{}:{type:ri,path:ni};var si=ti.pathInfo.finalRequestPath,ai=ti.pathInfo.responsePath,li=ne(ii,"hx-push-url"),di=ne(ii,"hx-replace-url"),mi=ae(ii).boosted,hi=null,_i=null;return li?(hi="push",_i=li):di?(hi="replace",_i=di):mi&&(hi="push",_i=ai||si),_i?_i==="false"?{}:(_i==="true"&&(_i=ai||si),ti.pathInfo.anchor&&_i.indexOf("#")===-1&&(_i=_i+"#"+ti.pathInfo.anchor),{type:hi,path:_i}):{}}function Mr(ii,ti){var ei=ti.xhr,ni=ti.target,ri=ti.etc,si=ti.requestConfig,ai=ti.select;if(ce(ii,"htmx:beforeOnLoad",ti)){if(O(ei,/HX-Trigger:/i)&&_e(ei,"HX-Trigger",ii),O(ei,/HX-Location:/i)){er();var li=ei.getResponseHeader("HX-Location"),di;li.indexOf("{")===0&&(di=E(li),li=di.path,delete di.path),Nr("GET",li,di).then(function(){tr(li)});return}var mi=O(ei,/HX-Refresh:/i)&&ei.getResponseHeader("HX-Refresh")==="true";if(O(ei,/HX-Redirect:/i)){location.href=ei.getResponseHeader("HX-Redirect"),mi&&location.reload();return}if(mi){location.reload();return}O(ei,/HX-Retarget:/i)&&(ei.getResponseHeader("HX-Retarget")==="this"?ti.target=ii:ti.target=ue(ii,ei.getResponseHeader("HX-Retarget")));var hi=Pr(ii,ti),_i=ei.status>=200&&ei.status<400&&ei.status!==204,Ei=ei.response,Ai=ei.status>=400,ki=Q.config.ignoreTitle,Ti=le({shouldSwap:_i,serverResponse:Ei,isError:Ai,ignoreTitle:ki},ti);if(ce(ni,"htmx:beforeSwap",Ti)){if(ni=Ti.target,Ei=Ti.serverResponse,Ai=Ti.isError,ki=Ti.ignoreTitle,ti.target=ni,ti.failed=Ai,ti.successful=!Ai,Ti.shouldSwap){ei.status===286&&at(ii),R(ii,function(hn){Ei=hn.transformResponse(Ei,ei,ii)}),hi.type&&er();var Fi=ri.swapOverride;O(ei,/HX-Reswap:/i)&&(Fi=ei.getResponseHeader("HX-Reswap"));var di=wr(ii,Fi);di.hasOwnProperty("ignoreTitle")&&(ki=di.ignoreTitle),ni.classList.add(Q.config.swappingClass);var en=null,rn=null,ln=function(){try{var hn=document.activeElement,pn={};try{pn={elt:hn,start:hn?hn.selectionStart:null,end:hn?hn.selectionEnd:null}}catch(Pi){}var gn;ai&&(gn=ai),O(ei,/HX-Reselect:/i)&&(gn=ei.getResponseHeader("HX-Reselect")),hi.type&&(ce(re().body,"htmx:beforeHistoryUpdate",le({history:hi},ti)),hi.type==="push"?(tr(hi.path),ce(re().body,"htmx:pushedIntoHistory",{path:hi.path})):(rr(hi.path),ce(re().body,"htmx:replacedInHistory",{path:hi.path})));var un=T(ni);if(je(di.swapStyle,ni,ii,Ei,un,gn),pn.elt&&!se(pn.elt)&&ee(pn.elt,"id")){var vn=document.getElementById(ee(pn.elt,"id")),Tn={preventScroll:di.focusScroll!==void 0?!di.focusScroll:!Q.config.defaultFocusScroll};if(vn){if(pn.start&&vn.setSelectionRange)try{vn.setSelectionRange(pn.start,pn.end)}catch(Pi){}vn.focus(Tn)}}if(ni.classList.remove(Q.config.swappingClass),oe(un.elts,function(Pi){Pi.classList&&Pi.classList.add(Q.config.settlingClass),ce(Pi,"htmx:afterSwap",ti)}),O(ei,/HX-Trigger-After-Swap:/i)){var Ni=ii;se(ii)||(Ni=re().body),_e(ei,"HX-Trigger-After-Swap",Ni)}var Hi=function(){if(oe(un.tasks,function(tn){tn.call()}),oe(un.elts,function(tn){tn.classList&&tn.classList.remove(Q.config.settlingClass),ce(tn,"htmx:afterSettle",ti)}),ti.pathInfo.anchor){var Pi=re().getElementById(ti.pathInfo.anchor);Pi&&Pi.scrollIntoView({block:"start",behavior:"auto"})}if(un.title&&!ki){var $i=C("title");$i?$i.innerHTML=un.title:window.document.title=un.title}if(Cr(un.elts,di),O(ei,/HX-Trigger-After-Settle:/i)){var mn=ii;se(ii)||(mn=re().body),_e(ei,"HX-Trigger-After-Settle",mn)}ie(en)};di.settleDelay>0?setTimeout(Hi,di.settleDelay):Hi()}catch(Pi){throw fe(ii,"htmx:swapError",ti),ie(rn),Pi}},Yi=Q.config.globalViewTransitions;if(di.hasOwnProperty("transition")&&(Yi=di.transition),Yi&&ce(ii,"htmx:beforeTransition",ti)&&typeof Promise!="undefined"&&document.startViewTransition){var on=new Promise(function(hn,pn){en=hn,rn=pn}),an=ln;ln=function(){document.startViewTransition(function(){return an(),on})}}di.swapDelay>0?setTimeout(ln,di.swapDelay):ln()}Ai&&fe(ii,"htmx:responseError",le({error:"Response Status Error Code "+ei.status+" from "+ti.pathInfo.requestPath},ti))}}}var Xr={};function Dr(){return{init:function(ii){return null},onEvent:function(ii,ti){return!0},transformResponse:function(ii,ti,ei){return ii},isInlineSwap:function(ii){return!1},handleSwap:function(ii,ti,ei,ni){return!1},encodeParameters:function(ii,ti,ei){return null}}}function Ur(ii,ti){ti.init&&ti.init(r),Xr[ii]=le(Dr(),ti)}function Br(ii){delete Xr[ii]}function Fr(ii,ti,ei){if(ii==null)return ti;ti==null&&(ti=[]),ei==null&&(ei=[]);var ni=te(ii,"hx-ext");return ni&&oe(ni.split(","),function(ri){if(ri=ri.replace(/ /g,""),ri.slice(0,7)=="ignore:"){ei.push(ri.slice(7));return}if(ei.indexOf(ri)<0){var si=Xr[ri];si&&ti.indexOf(si)<0&&ti.push(si)}}),Fr(u(ii),ti,ei)}var Vr=!1;re().addEventListener("DOMContentLoaded",function(){Vr=!0});function jr(ii){Vr||re().readyState==="complete"?ii():re().addEventListener("DOMContentLoaded",ii)}function _r(){Q.config.includeIndicatorStyles!==!1&&re().head.insertAdjacentHTML("beforeend","<style> ."+Q.config.indicatorClass+"{opacity:0} ."+Q.config.requestClass+" ."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+Q.config.requestClass+"."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} </style>")}function zr(){var ii=re().querySelector('meta[name="htmx-config"]');return ii?E(ii.content):null}function $r(){var ii=zr();ii&&(Q.config=le(Q.config,ii))}return jr(function(){$r(),_r();var ii=re().body;zt(ii);var ti=re().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");ii.addEventListener("htmx:abort",function(ni){var ri=ni.target,si=ae(ri);si&&si.xhr&&si.xhr.abort()});let ei=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(ni){ni.state&&ni.state.htmx?(ar(),oe(ti,function(ri){ce(ri,"htmx:restored",{document:re(),triggerEvent:ce})})):ei&&ei(ni)},setTimeout(function(){ce(ii,"htmx:load",{}),ii=null},0)}),Q}()})});var El=Ya((Bc,zc)=>{(function(ii,ti){typeof Bc=="object"&&typeof zc!="undefined"?zc.exports=ti():typeof define=="function"&&define.amd?define(ti):(ii=typeof globalThis!="undefined"?globalThis:ii||self,ii.TomSelect=ti())})(Bc,function(){"use strict";function ii(fi,oi){fi.split(/\s+/).forEach(ci=>{oi(ci)})}class ti{constructor(){this._events=void 0,this._events={}}on(oi,ci){ii(oi,ui=>{let gi=this._events[ui]||[];gi.push(ci),this._events[ui]=gi})}off(oi,ci){var ui=arguments.length;if(ui===0){this._events={};return}ii(oi,gi=>{if(ui===1){delete this._events[gi];return}let bi=this._events[gi];bi!==void 0&&(bi.splice(bi.indexOf(ci),1),this._events[gi]=bi)})}trigger(oi,...ci){var ui=this;ii(oi,gi=>{let bi=ui._events[gi];bi!==void 0&&bi.forEach(yi=>{yi.apply(ui,ci)})})}}function ei(fi){return fi.plugins={},class extends fi{constructor(...oi){super(...oi),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(oi,ci){fi.plugins[oi]={name:oi,fn:ci}}initializePlugins(oi){var ci,ui;let gi=this,bi=[];if(Array.isArray(oi))oi.forEach(yi=>{typeof yi=="string"?bi.push(yi):(gi.plugins.settings[yi.name]=yi.options,bi.push(yi.name))});else if(oi)for(ci in oi)oi.hasOwnProperty(ci)&&(gi.plugins.settings[ci]=oi[ci],bi.push(ci));for(;ui=bi.shift();)gi.require(ui)}loadPlugin(oi){var ci=this,ui=ci.plugins,gi=fi.plugins[oi];if(!fi.plugins.hasOwnProperty(oi))throw new Error('Unable to find "'+oi+'" plugin');ui.requested[oi]=!0,ui.loaded[oi]=gi.fn.apply(ci,[ci.plugins.settings[oi]||{}]),ui.names.push(oi)}require(oi){var ci=this,ui=ci.plugins;if(!ci.plugins.loaded.hasOwnProperty(oi)){if(ui.requested[oi])throw new Error('Plugin has circular dependency ("'+oi+'")');ci.loadPlugin(oi)}return ui.loaded[oi]}}}let ni=fi=>(fi=fi.filter(Boolean),fi.length<2?fi[0]||"":di(fi)==1?"["+fi.join("")+"]":"(?:"+fi.join("|")+")"),ri=fi=>{if(!ai(fi))return fi.join("");let oi="",ci=0,ui=()=>{ci>1&&(oi+="{"+ci+"}")};return fi.forEach((gi,bi)=>{if(gi===fi[bi-1]){ci++;return}ui(),oi+=gi,ci=1}),ui(),oi},si=fi=>{let oi=hi(fi);return ni(oi)},ai=fi=>new Set(fi).size!==fi.length,li=fi=>(fi+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),di=fi=>fi.reduce((oi,ci)=>Math.max(oi,mi(ci)),0),mi=fi=>hi(fi).length,hi=fi=>Array.from(fi);let _i=fi=>{if(fi.length===1)return[[fi]];let oi=[],ci=fi.substring(1);return _i(ci).forEach(function(gi){let bi=gi.slice(0);bi[0]=fi.charAt(0)+bi[0],oi.push(bi),bi=gi.slice(0),bi.unshift(fi.charAt(0)),oi.push(bi)}),oi};let Ei=[[0,65535]],Ai="[\u0300-\u036F\xB7\u02BE\u02BC]",ki,Ti,Fi=3,en={},rn={"/":"\u2044\u2215",0:"\u07C0",a:"\u2C65\u0250\u0251",aa:"\uA733",ae:"\xE6\u01FD\u01E3",ao:"\uA735",au:"\uA737",av:"\uA739\uA73B",ay:"\uA73D",b:"\u0180\u0253\u0183",c:"\uA73F\u0188\u023C\u2184",d:"\u0111\u0257\u0256\u1D05\u018C\uABB7\u0501\u0266",e:"\u025B\u01DD\u1D07\u0247",f:"\uA77C\u0192",g:"\u01E5\u0260\uA7A1\u1D79\uA77F\u0262",h:"\u0127\u2C68\u2C76\u0265",i:"\u0268\u0131",j:"\u0249\u0237",k:"\u0199\u2C6A\uA741\uA743\uA745\uA7A3",l:"\u0142\u019A\u026B\u2C61\uA749\uA747\uA781\u026D",m:"\u0271\u026F\u03FB",n:"\uA7A5\u019E\u0272\uA791\u1D0E\u043B\u0509",o:"\xF8\u01FF\u0254\u0275\uA74B\uA74D\u1D11",oe:"\u0153",oi:"\u01A3",oo:"\uA74F",ou:"\u0223",p:"\u01A5\u1D7D\uA751\uA753\uA755\u03C1",q:"\uA757\uA759\u024B",r:"\u024D\u027D\uA75B\uA7A7\uA783",s:"\xDF\u023F\uA7A9\uA785\u0282",t:"\u0167\u01AD\u0288\u2C66\uA787",th:"\xFE",tz:"\uA729",u:"\u0289",v:"\u028B\uA75F\u028C",vy:"\uA761",w:"\u2C73",y:"\u01B4\u024F\u1EFF",z:"\u01B6\u0225\u0240\u2C6C\uA763",hv:"\u0195"};for(let fi in rn){let oi=rn[fi]||"";for(let ci=0;ci<oi.length;ci++){let ui=oi.substring(ci,ci+1);en[ui]=fi}}let ln=new RegExp(Object.keys(en).join("|")+"|"+Ai,"gu"),Yi=fi=>{ki===void 0&&(ki=gn(fi||Ei))},on=(fi,oi="NFKD")=>fi.normalize(oi),an=fi=>hi(fi).reduce((oi,ci)=>oi+bn(ci),""),bn=fi=>(fi=on(fi).toLowerCase().replace(ln,oi=>en[oi]||""),on(fi,"NFC"));function*hn(fi){for(let[oi,ci]of fi)for(let ui=oi;ui<=ci;ui++){let gi=String.fromCharCode(ui),bi=an(gi);bi!=gi.toLowerCase()&&(bi.length>Fi||bi.length!=0&&(yield{folded:bi,composed:gi,code_point:ui}))}}let pn=fi=>{let oi={},ci=(ui,gi)=>{let bi=oi[ui]||new Set,yi=new RegExp("^"+si(bi)+"$","iu");gi.match(yi)||(bi.add(li(gi)),oi[ui]=bi)};for(let ui of hn(fi))ci(ui.folded,ui.folded),ci(ui.folded,ui.composed);return oi},gn=fi=>{let oi=pn(fi),ci={},ui=[];for(let bi in oi){let yi=oi[bi];yi&&(ci[bi]=si(yi)),bi.length>1&&ui.push(li(bi))}ui.sort((bi,yi)=>yi.length-bi.length);let gi=ni(ui);return Ti=new RegExp("^"+gi,"u"),ci},un=(fi,oi=1)=>{let ci=0;return fi=fi.map(ui=>(ki[ui]&&(ci+=ui.length),ki[ui]||ui)),ci>=oi?ri(fi):""},vn=(fi,oi=1)=>(oi=Math.max(oi,fi.length-1),ni(_i(fi).map(ci=>un(ci,oi)))),Tn=(fi,oi=!0)=>{let ci=fi.length>1?1:0;return ni(fi.map(ui=>{let gi=[],bi=oi?ui.length():ui.length()-1;for(let yi=0;yi<bi;yi++)gi.push(vn(ui.substrs[yi]||"",ci));return ri(gi)}))},Ni=(fi,oi)=>{for(let ci of oi){if(ci.start!=fi.start||ci.end!=fi.end||ci.substrs.join("")!==fi.substrs.join(""))continue;let ui=fi.parts,gi=yi=>{for(let Ci of ui){if(Ci.start===yi.start&&Ci.substr===yi.substr)return!1;if(!(yi.length==1||Ci.length==1)&&(yi.start<Ci.start&&yi.end>Ci.start||Ci.start<yi.start&&Ci.end>yi.start))return!0}return!1};if(!(ci.parts.filter(gi).length>0))return!0}return!1};class Hi{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(oi){oi&&(this.parts.push(oi),this.substrs.push(oi.substr),this.start=Math.min(oi.start,this.start),this.end=Math.max(oi.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(oi,ci){let ui=new Hi,gi=JSON.parse(JSON.stringify(this.parts)),bi=gi.pop();for(let Oi of gi)ui.add(Oi);let yi=ci.substr.substring(0,oi-bi.start),Ci=yi.length;return ui.add({start:bi.start,end:bi.start+Ci,length:Ci,substr:yi}),ui}}let Pi=fi=>{Yi(),fi=an(fi);let oi="",ci=[new Hi];for(let ui=0;ui<fi.length;ui++){let bi=fi.substring(ui).match(Ti),yi=fi.substring(ui,ui+1),Ci=bi?bi[0]:null,Oi=[],Di=new Set;for(let Wi of ci){let Bi=Wi.last();if(!Bi||Bi.length==1||Bi.end<=ui)if(Ci){let Zi=Ci.length;Wi.add({start:ui,end:ui+Zi,length:Zi,substr:Ci}),Di.add("1")}else Wi.add({start:ui,end:ui+1,length:1,substr:yi}),Di.add("2");else if(Ci){let Zi=Wi.clone(ui,Bi),In=Ci.length;Zi.add({start:ui,end:ui+In,length:In,substr:Ci}),Oi.push(Zi)}else Di.add("3")}if(Oi.length>0){Oi=Oi.sort((Wi,Bi)=>Wi.length()-Bi.length());for(let Wi of Oi)Ni(Wi,ci)||ci.push(Wi);continue}if(ui>0&&Di.size==1&&!Di.has("3")){oi+=Tn(ci,!1);let Wi=new Hi,Bi=ci[0];Bi&&Wi.add(Bi.last()),ci=[Wi]}}return oi+=Tn(ci,!0),oi};let $i=(fi,oi)=>{if(fi)return fi[oi]},mn=(fi,oi)=>{if(fi){for(var ci,ui=oi.split(".");(ci=ui.shift())&&(fi=fi[ci]););return fi}},tn=(fi,oi,ci)=>{var ui,gi;return!fi||(fi=fi+"",oi.regex==null)||(gi=fi.search(oi.regex),gi===-1)?0:(ui=oi.string.length/fi.length,gi===0&&(ui+=.5),ui*ci)},zi=(fi,oi)=>{var ci=fi[oi];if(typeof ci=="function")return ci;ci&&!Array.isArray(ci)&&(fi[oi]=[ci])},Li=(fi,oi)=>{if(Array.isArray(fi))fi.forEach(oi);else for(var ci in fi)fi.hasOwnProperty(ci)&&oi(fi[ci],ci)},ji=(fi,oi)=>typeof fi=="number"&&typeof oi=="number"?fi>oi?1:fi<oi?-1:0:(fi=an(fi+"").toLowerCase(),oi=an(oi+"").toLowerCase(),fi>oi?1:oi>fi?-1:0);class Ji{constructor(oi,ci){this.items=void 0,this.settings=void 0,this.items=oi,this.settings=ci||{diacritics:!0}}tokenize(oi,ci,ui){if(!oi||!oi.length)return[];let gi=[],bi=oi.split(/\s+/);var yi;return ui&&(yi=new RegExp("^("+Object.keys(ui).map(li).join("|")+"):(.*)$")),bi.forEach(Ci=>{let Oi,Di=null,Wi=null;yi&&(Oi=Ci.match(yi))&&(Di=Oi[1],Ci=Oi[2]),Ci.length>0&&(this.settings.diacritics?Wi=Pi(Ci)||null:Wi=li(Ci),Wi&&ci&&(Wi="\\b"+Wi)),gi.push({string:Ci,regex:Wi?new RegExp(Wi,"iu"):null,field:Di})}),gi}getScoreFunction(oi,ci){var ui=this.prepareSearch(oi,ci);return this._getScoreFunction(ui)}_getScoreFunction(oi){let ci=oi.tokens,ui=ci.length;if(!ui)return function(){return 0};let gi=oi.options.fields,bi=oi.weights,yi=gi.length,Ci=oi.getAttrFn;if(!yi)return function(){return 1};let Oi=function(){return yi===1?function(Di,Wi){let Bi=gi[0].field;return tn(Ci(Wi,Bi),Di,bi[Bi]||1)}:function(Di,Wi){var Bi=0;if(Di.field){let Zi=Ci(Wi,Di.field);!Di.regex&&Zi?Bi+=1/yi:Bi+=tn(Zi,Di,1)}else Li(bi,(Zi,In)=>{Bi+=tn(Ci(Wi,In),Di,Zi)});return Bi/yi}}();return ui===1?function(Di){return Oi(ci[0],Di)}:oi.options.conjunction==="and"?function(Di){var Wi,Bi=0;for(let Zi of ci){if(Wi=Oi(Zi,Di),Wi<=0)return 0;Bi+=Wi}return Bi/ui}:function(Di){var Wi=0;return Li(ci,Bi=>{Wi+=Oi(Bi,Di)}),Wi/ui}}getSortFunction(oi,ci){var ui=this.prepareSearch(oi,ci);return this._getSortFunction(ui)}_getSortFunction(oi){var ci,ui=[];let gi=this,bi=oi.options,yi=!oi.query&&bi.sort_empty?bi.sort_empty:bi.sort;if(typeof yi=="function")return yi.bind(this);let Ci=function(Wi,Bi){return Wi==="$score"?Bi.score:oi.getAttrFn(gi.items[Bi.id],Wi)};if(yi)for(let Di of yi)(oi.query||Di.field!=="$score")&&ui.push(Di);if(oi.query){ci=!0;for(let Di of ui)if(Di.field==="$score"){ci=!1;break}ci&&ui.unshift({field:"$score",direction:"desc"})}else ui=ui.filter(Di=>Di.field!=="$score");return ui.length?function(Di,Wi){var Bi,Zi;for(let In of ui)if(Zi=In.field,Bi=(In.direction==="desc"?-1:1)*ji(Ci(Zi,Di),Ci(Zi,Wi)),Bi)return Bi;return 0}:null}prepareSearch(oi,ci){let ui={};var gi=Object.assign({},ci);if(zi(gi,"sort"),zi(gi,"sort_empty"),gi.fields){zi(gi,"fields");let bi=[];gi.fields.forEach(yi=>{typeof yi=="string"&&(yi={field:yi,weight:1}),bi.push(yi),ui[yi.field]="weight"in yi?yi.weight:1}),gi.fields=bi}return{options:gi,query:oi.toLowerCase().trim(),tokens:this.tokenize(oi,gi.respect_word_boundaries,ui),total:0,items:[],weights:ui,getAttrFn:gi.nesting?mn:$i}}search(oi,ci){var ui=this,gi,bi;bi=this.prepareSearch(oi,ci),ci=bi.options,oi=bi.query;let yi=ci.score||ui._getScoreFunction(bi);oi.length?Li(ui.items,(Oi,Di)=>{gi=yi(Oi),(ci.filter===!1||gi>0)&&bi.items.push({score:gi,id:Di})}):Li(ui.items,(Oi,Di)=>{bi.items.push({score:1,id:Di})});let Ci=ui._getSortFunction(bi);return Ci&&bi.items.sort(Ci),bi.total=bi.items.length,typeof ci.limit=="number"&&(bi.items=bi.items.slice(0,ci.limit)),bi}}let Vi=(fi,oi)=>{if(Array.isArray(fi))fi.forEach(oi);else for(var ci in fi)fi.hasOwnProperty(ci)&&oi(fi[ci],ci)},Ii=fi=>{if(fi.jquery)return fi[0];if(fi instanceof HTMLElement)return fi;if(Sn(fi)){var oi=document.createElement("template");return oi.innerHTML=fi.trim(),oi.content.firstChild}return document.querySelector(fi)},Sn=fi=>typeof fi=="string"&&fi.indexOf("<")>-1,Yn=fi=>fi.replace(/['"\\]/g,"\\$&"),Fn=(fi,oi)=>{var ci=document.createEvent("HTMLEvents");ci.initEvent(oi,!0,!1),fi.dispatchEvent(ci)},Bn=(fi,oi)=>{Object.assign(fi.style,oi)},Gn=(fi,...oi)=>{var ci=Ts(oi);fi=zn(fi),fi.map(ui=>{ci.map(gi=>{ui.classList.add(gi)})})},Qn=(fi,...oi)=>{var ci=Ts(oi);fi=zn(fi),fi.map(ui=>{ci.map(gi=>{ui.classList.remove(gi)})})},Ts=fi=>{var oi=[];return Vi(fi,ci=>{typeof ci=="string"&&(ci=ci.trim().split(/[\11\12\14\15\40]/)),Array.isArray(ci)&&(oi=oi.concat(ci))}),oi.filter(Boolean)},zn=fi=>(Array.isArray(fi)||(fi=[fi]),fi),hs=(fi,oi,ci)=>{if(!(ci&&!ci.contains(fi)))for(;fi&&fi.matches;){if(fi.matches(oi))return fi;fi=fi.parentNode}},ms=(fi,oi=0)=>oi>0?fi[fi.length-1]:fi[0],qs=fi=>Object.keys(fi).length===0,qn=(fi,oi)=>{if(!fi)return-1;oi=oi||fi.nodeName;for(var ci=0;fi=fi.previousElementSibling;)fi.matches(oi)&&ci++;return ci},yn=(fi,oi)=>{Vi(oi,(ci,ui)=>{ci==null?fi.removeAttribute(ui):fi.setAttribute(ui,""+ci)})},Kr=(fi,oi)=>{fi.parentNode&&fi.parentNode.replaceChild(oi,fi)},as=(fi,oi)=>{if(oi===null)return;if(typeof oi=="string"){if(!oi.length)return;oi=new RegExp(oi,"i")}let ci=bi=>{var yi=bi.data.match(oi);if(yi&&bi.data.length>0){var Ci=document.createElement("span");Ci.className="highlight";var Oi=bi.splitText(yi.index);Oi.splitText(yi[0].length);var Di=Oi.cloneNode(!0);return Ci.appendChild(Di),Kr(Oi,Ci),1}return 0},ui=bi=>{bi.nodeType===1&&bi.childNodes&&!/(script|style)/i.test(bi.tagName)&&(bi.className!=="highlight"||bi.tagName!=="SPAN")&&Array.from(bi.childNodes).forEach(yi=>{gi(yi)})},gi=bi=>bi.nodeType===3?ci(bi):(ui(bi),0);gi(fi)},Ws=fi=>{var oi=fi.querySelectorAll("span.highlight");Array.prototype.forEach.call(oi,function(ci){var ui=ci.parentNode;ui.replaceChild(ci.firstChild,ci),ui.normalize()})},po=65,Us=13,Ms=27,Ss=37,Ro=38,Ys=39,Po=40,ha=8,Wl=46,pa=9,Ho=(typeof navigator=="undefined"?!1:/Mac/.test(navigator.userAgent))?"metaKey":"ctrlKey";var ja={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(fi){return fi.length>0},render:{}};let wn=fi=>typeof fi=="undefined"||fi===null?null:Gs(fi),Gs=fi=>typeof fi=="boolean"?fi?"1":"0":fi+"",Ks=fi=>(fi+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Yl=(fi,oi)=>oi>0?setTimeout(fi,oi):(fi.call(null),null),Fo=(fi,oi)=>{var ci;return function(ui,gi){var bi=this;ci&&(bi.loading=Math.max(bi.loading-1,0),clearTimeout(ci)),ci=setTimeout(function(){ci=null,bi.loadedSearches[ui]=!0,fi.call(bi,ui,gi)},oi)}},$o=(fi,oi,ci)=>{var ui,gi=fi.trigger,bi={};fi.trigger=function(){var yi=arguments[0];if(oi.indexOf(yi)!==-1)bi[yi]=arguments;else return gi.apply(fi,arguments)},ci.apply(fi,[]),fi.trigger=gi;for(ui of oi)ui in bi&&gi.apply(fi,bi[ui])},Cs=fi=>({start:fi.selectionStart||0,length:(fi.selectionEnd||0)-(fi.selectionStart||0)}),Dn=(fi,oi=!1)=>{fi&&(fi.preventDefault(),oi&&fi.stopPropagation())},On=(fi,oi,ci,ui)=>{fi.addEventListener(oi,ci,ui)},pi=(fi,oi)=>{if(!oi||!oi[fi])return!1;var ci=(oi.altKey?1:0)+(oi.ctrlKey?1:0)+(oi.shiftKey?1:0)+(oi.metaKey?1:0);return ci===1},vi=(fi,oi)=>{let ci=fi.getAttribute("id");return ci||(fi.setAttribute("id",oi),oi)},wi=fi=>fi.replace(/[\\"']/g,"\\$&"),Si=(fi,oi)=>{oi&&fi.append(oi)};function Ri(fi,oi){var ci=Object.assign({},ja,oi),ui=ci.dataAttr,gi=ci.labelField,bi=ci.valueField,yi=ci.disabledField,Ci=ci.optgroupField,Oi=ci.optgroupLabelField,Di=ci.optgroupValueField,Wi=fi.tagName.toLowerCase(),Bi=fi.getAttribute("placeholder")||fi.getAttribute("data-placeholder");if(!Bi&&!ci.allowEmptyOption){let Cn=fi.querySelector('option[value=""]');Cn&&(Bi=Cn.textContent)}var Zi={placeholder:Bi,options:[],optgroups:[],items:[],maxItems:null},In=()=>{var Cn,Pn=Zi.options,kn={},dn=1;let jn=0;var Os=xn=>{var Ln=Object.assign({},xn.dataset),En=ui&&Ln[ui];return typeof En=="string"&&En.length&&(Ln=Object.assign(Ln,JSON.parse(En))),Ln},Va=(xn,Ln)=>{var En=wn(xn.value);if(En!=null&&!(!En&&!ci.allowEmptyOption)){if(kn.hasOwnProperty(En)){if(Ln){var Jr=kn[En][Ci];Jr?Array.isArray(Jr)?Jr.push(Ln):kn[En][Ci]=[Jr,Ln]:kn[En][Ci]=Ln}}else{var Nn=Os(xn);Nn[gi]=Nn[gi]||xn.textContent,Nn[bi]=Nn[bi]||En,Nn[yi]=Nn[yi]||xn.disabled,Nn[Ci]=Nn[Ci]||Ln,Nn.$option=xn,Nn.$order=Nn.$order||++jn,kn[En]=Nn,Pn.push(Nn)}xn.selected&&Zi.items.push(En)}},Bo=xn=>{var Ln,En;En=Os(xn),En[Oi]=En[Oi]||xn.getAttribute("label")||"",En[Di]=En[Di]||dn++,En[yi]=En[yi]||xn.disabled,En.$order=En.$order||++jn,Zi.optgroups.push(En),Ln=En[Di],Vi(xn.children,Jr=>{Va(Jr,Ln)})};Zi.maxItems=fi.hasAttribute("multiple")?null:1,Vi(fi.children,xn=>{Cn=xn.tagName.toLowerCase(),Cn==="optgroup"?Bo(xn):Cn==="option"&&Va(xn)})},Ki=()=>{let Cn=fi.getAttribute(ui);if(Cn)Zi.options=JSON.parse(Cn),Vi(Zi.options,kn=>{Zi.items.push(kn[bi])});else{var Pn=fi.value.trim()||"";if(!ci.allowEmptyOption&&!Pn.length)return;let kn=Pn.split(ci.delimiter);Vi(kn,dn=>{let jn={};jn[gi]=dn,jn[bi]=dn,Zi.options.push(jn)}),Zi.items=kn}};return Wi==="select"?In():Ki(),Object.assign({},ja,Zi,oi)}var qi=0;class nn extends ei(ti){constructor(oi,ci){super(),this.control_input=void 0,this.wrapper=void 0,this.dropdown=void 0,this.control=void 0,this.dropdown_content=void 0,this.focus_node=void 0,this.order=0,this.settings=void 0,this.input=void 0,this.tabIndex=void 0,this.is_select_tag=void 0,this.rtl=void 0,this.inputId=void 0,this._destroy=void 0,this.sifter=void 0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isRequired=void 0,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.currentResults=void 0,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,qi++;var ui,gi=Ii(oi);if(gi.tomselect)throw new Error("Tom Select already initialized on this element");gi.tomselect=this;var bi=window.getComputedStyle&&window.getComputedStyle(gi,null);ui=bi.getPropertyValue("direction");let yi=Ri(gi,ci);this.settings=yi,this.input=gi,this.tabIndex=gi.tabIndex||0,this.is_select_tag=gi.tagName.toLowerCase()==="select",this.rtl=/rtl/i.test(ui),this.inputId=vi(gi,"tomselect-"+qi),this.isRequired=gi.required,this.sifter=new Ji(this.options,{diacritics:yi.diacritics}),yi.mode=yi.mode||(yi.maxItems===1?"single":"multi"),typeof yi.hideSelected!="boolean"&&(yi.hideSelected=yi.mode==="multi"),typeof yi.hidePlaceholder!="boolean"&&(yi.hidePlaceholder=yi.mode!=="multi");var Ci=yi.createFilter;typeof Ci!="function"&&(typeof Ci=="string"&&(Ci=new RegExp(Ci)),Ci instanceof RegExp?yi.createFilter=Pn=>Ci.test(Pn):yi.createFilter=Pn=>this.settings.duplicates||!this.options[Pn]),this.initializePlugins(yi.plugins),this.setupCallbacks(),this.setupTemplates();let Oi=Ii("<div>"),Di=Ii("<div>"),Wi=this._render("dropdown"),Bi=Ii('<div role="listbox" tabindex="-1">'),Zi=this.input.getAttribute("class")||"",In=yi.mode;var Ki;if(Gn(Oi,yi.wrapperClass,Zi,In),Gn(Di,yi.controlClass),Si(Oi,Di),Gn(Wi,yi.dropdownClass,In),yi.copyClassesToDropdown&&Gn(Wi,Zi),Gn(Bi,yi.dropdownContentClass),Si(Wi,Bi),Ii(yi.dropdownParent||Oi).appendChild(Wi),Sn(yi.controlInput)){Ki=Ii(yi.controlInput);var Cn=["autocorrect","autocapitalize","autocomplete","spellcheck"];Li(Cn,Pn=>{gi.getAttribute(Pn)&&yn(Ki,{[Pn]:gi.getAttribute(Pn)})}),Ki.tabIndex=-1,Di.appendChild(Ki),this.focus_node=Ki}else yi.controlInput?(Ki=Ii(yi.controlInput),this.focus_node=Ki):(Ki=Ii("<input/>"),this.focus_node=Di);this.wrapper=Oi,this.dropdown=Wi,this.dropdown_content=Bi,this.control=Di,this.control_input=Ki,this.setup()}setup(){let oi=this,ci=oi.settings,ui=oi.control_input,gi=oi.dropdown,bi=oi.dropdown_content,yi=oi.wrapper,Ci=oi.control,Oi=oi.input,Di=oi.focus_node,Wi={passive:!0},Bi=oi.inputId+"-ts-dropdown";yn(bi,{id:Bi}),yn(Di,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":Bi});let Zi=vi(Di,oi.inputId+"-ts-control"),In="label[for='"+Yn(oi.inputId)+"']",Ki=document.querySelector(In),Cn=oi.focus.bind(oi);if(Ki){On(Ki,"click",Cn),yn(Ki,{for:Zi});let dn=vi(Ki,oi.inputId+"-ts-label");yn(Di,{"aria-labelledby":dn}),yn(bi,{"aria-labelledby":dn})}if(yi.style.width=Oi.style.width,oi.plugins.names.length){let dn="plugin-"+oi.plugins.names.join(" plugin-");Gn([yi,gi],dn)}(ci.maxItems===null||ci.maxItems>1)&&oi.is_select_tag&&yn(Oi,{multiple:"multiple"}),ci.placeholder&&yn(ui,{placeholder:ci.placeholder}),!ci.splitOn&&ci.delimiter&&(ci.splitOn=new RegExp("\\s*"+li(ci.delimiter)+"+\\s*")),ci.load&&ci.loadThrottle&&(ci.load=Fo(ci.load,ci.loadThrottle)),On(gi,"mousemove",()=>{oi.ignoreHover=!1}),On(gi,"mouseenter",dn=>{var jn=hs(dn.target,"[data-selectable]",gi);jn&&oi.onOptionHover(dn,jn)},{capture:!0}),On(gi,"click",dn=>{let jn=hs(dn.target,"[data-selectable]");jn&&(oi.onOptionSelect(dn,jn),Dn(dn,!0))}),On(Ci,"click",dn=>{var jn=hs(dn.target,"[data-ts-item]",Ci);if(jn&&oi.onItemSelect(dn,jn)){Dn(dn,!0);return}ui.value==""&&(oi.onClick(),Dn(dn,!0))}),On(Di,"keydown",dn=>oi.onKeyDown(dn)),On(ui,"keypress",dn=>oi.onKeyPress(dn)),On(ui,"input",dn=>oi.onInput(dn)),On(Di,"blur",dn=>oi.onBlur(dn)),On(Di,"focus",dn=>oi.onFocus(dn)),On(ui,"paste",dn=>oi.onPaste(dn));let Pn=dn=>{let jn=dn.composedPath()[0];if(!yi.contains(jn)&&!gi.contains(jn)){oi.isFocused&&oi.blur(),oi.inputState();return}jn==ui&&oi.isOpen?dn.stopPropagation():Dn(dn,!0)},kn=()=>{oi.isOpen&&oi.positionDropdown()};On(document,"mousedown",Pn),On(window,"scroll",kn,Wi),On(window,"resize",kn,Wi),this._destroy=()=>{document.removeEventListener("mousedown",Pn),window.removeEventListener("scroll",kn),window.removeEventListener("resize",kn),Ki&&Ki.removeEventListener("click",Cn)},this.revertSettings={innerHTML:Oi.innerHTML,tabIndex:Oi.tabIndex},Oi.tabIndex=-1,Oi.insertAdjacentElement("afterend",oi.wrapper),oi.sync(!1),ci.items=[],delete ci.optgroups,delete ci.options,On(Oi,"invalid",()=>{oi.isValid&&(oi.isValid=!1,oi.isInvalid=!0,oi.refreshState())}),oi.updateOriginalInput(),oi.refreshItems(),oi.close(!1),oi.inputState(),oi.isSetup=!0,Oi.disabled?oi.disable():Oi.readOnly?oi.setReadOnly(!0):oi.enable(),oi.on("change",this.onChange),Gn(Oi,"tomselected","ts-hidden-accessible"),oi.trigger("initialize"),ci.preload===!0&&oi.preload()}setupOptions(oi=[],ci=[]){this.addOptions(oi),Li(ci,ui=>{this.registerOptionGroup(ui)})}setupTemplates(){var oi=this,ci=oi.settings.labelField,ui=oi.settings.optgroupLabelField,gi={optgroup:bi=>{let yi=document.createElement("div");return yi.className="optgroup",yi.appendChild(bi.options),yi},optgroup_header:(bi,yi)=>'<div class="optgroup-header">'+yi(bi[ui])+"</div>",option:(bi,yi)=>"<div>"+yi(bi[ci])+"</div>",item:(bi,yi)=>"<div>"+yi(bi[ci])+"</div>",option_create:(bi,yi)=>'<div class="create">Add <strong>'+yi(bi.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};oi.settings.render=Object.assign({},gi,oi.settings.render)}setupCallbacks(){var oi,ci,ui={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(oi in ui)ci=this.settings[ui[oi]],ci&&this.on(oi,ci)}sync(oi=!0){let ci=this,ui=oi?Ri(ci.input,{delimiter:ci.settings.delimiter}):ci.settings;ci.setupOptions(ui.options,ui.optgroups),ci.setValue(ui.items||[],!0),ci.lastQuery=null}onClick(){var oi=this;if(oi.activeItems.length>0){oi.clearActiveItems(),oi.focus();return}oi.isFocused&&oi.isOpen?oi.blur():oi.focus()}onMouseDown(){}onChange(){Fn(this.input,"input"),Fn(this.input,"change")}onPaste(oi){var ci=this;if(ci.isInputHidden||ci.isLocked){Dn(oi);return}ci.settings.splitOn&&setTimeout(()=>{var ui=ci.inputValue();if(ui.match(ci.settings.splitOn)){var gi=ui.trim().split(ci.settings.splitOn);Li(gi,bi=>{wn(bi)&&(this.options[bi]?ci.addItem(bi):ci.createItem(bi))})}},0)}onKeyPress(oi){var ci=this;if(ci.isLocked){Dn(oi);return}var ui=String.fromCharCode(oi.keyCode||oi.which);if(ci.settings.create&&ci.settings.mode==="multi"&&ui===ci.settings.delimiter){ci.createItem(),Dn(oi);return}}onKeyDown(oi){var ci=this;if(ci.ignoreHover=!0,ci.isLocked){oi.keyCode!==pa&&Dn(oi);return}switch(oi.keyCode){case po:if(pi(Ho,oi)&&ci.control_input.value==""){Dn(oi),ci.selectAll();return}break;case Ms:ci.isOpen&&(Dn(oi,!0),ci.close()),ci.clearActiveItems();return;case Po:if(!ci.isOpen&&ci.hasOptions)ci.open();else if(ci.activeOption){let ui=ci.getAdjacent(ci.activeOption,1);ui&&ci.setActiveOption(ui)}Dn(oi);return;case Ro:if(ci.activeOption){let ui=ci.getAdjacent(ci.activeOption,-1);ui&&ci.setActiveOption(ui)}Dn(oi);return;case Us:ci.canSelect(ci.activeOption)?(ci.onOptionSelect(oi,ci.activeOption),Dn(oi)):(ci.settings.create&&ci.createItem()||document.activeElement==ci.control_input&&ci.isOpen)&&Dn(oi);return;case Ss:ci.advanceSelection(-1,oi);return;case Ys:ci.advanceSelection(1,oi);return;case pa:ci.settings.selectOnTab&&(ci.canSelect(ci.activeOption)&&(ci.onOptionSelect(oi,ci.activeOption),Dn(oi)),ci.settings.create&&ci.createItem()&&Dn(oi));return;case ha:case Wl:ci.deleteSelection(oi);return}ci.isInputHidden&&!pi(Ho,oi)&&Dn(oi)}onInput(oi){if(this.isLocked)return;let ci=this.inputValue();if(this.lastValue!==ci){if(this.lastValue=ci,ci==""){this._onInput();return}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshTimeout=Yl(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)}}_onInput(){let oi=this.lastValue;this.settings.shouldLoad.call(this,oi)&&this.load(oi),this.refreshOptions(),this.trigger("type",oi)}onOptionHover(oi,ci){this.ignoreHover||this.setActiveOption(ci,!1)}onFocus(oi){var ci=this,ui=ci.isFocused;if(ci.isDisabled||ci.isReadOnly){ci.blur(),Dn(oi);return}ci.ignoreFocus||(ci.isFocused=!0,ci.settings.preload==="focus"&&ci.preload(),ui||ci.trigger("focus"),ci.activeItems.length||(ci.inputState(),ci.refreshOptions(!!ci.settings.openOnFocus)),ci.refreshState())}onBlur(oi){if(document.hasFocus()!==!1){var ci=this;if(ci.isFocused){ci.isFocused=!1,ci.ignoreFocus=!1;var ui=()=>{ci.close(),ci.setActiveItem(),ci.setCaret(ci.items.length),ci.trigger("blur")};ci.settings.create&&ci.settings.createOnBlur?ci.createItem(null,ui):ui()}}}onOptionSelect(oi,ci){var ui,gi=this;ci.parentElement&&ci.parentElement.matches("[data-disabled]")||(ci.classList.contains("create")?gi.createItem(null,()=>{gi.settings.closeAfterSelect&&gi.close()}):(ui=ci.dataset.value,typeof ui!="undefined"&&(gi.lastQuery=null,gi.addItem(ui),gi.settings.closeAfterSelect&&gi.close(),!gi.settings.hideSelected&&oi.type&&/click/.test(oi.type)&&gi.setActiveOption(ci))))}canSelect(oi){return!!(this.isOpen&&oi&&this.dropdown_content.contains(oi))}onItemSelect(oi,ci){var ui=this;return!ui.isLocked&&ui.settings.mode==="multi"?(Dn(oi),ui.setActiveItem(ci,oi),!0):!1}canLoad(oi){return!(!this.settings.load||this.loadedSearches.hasOwnProperty(oi))}load(oi){let ci=this;if(!ci.canLoad(oi))return;Gn(ci.wrapper,ci.settings.loadingClass),ci.loading++;let ui=ci.loadCallback.bind(ci);ci.settings.load.call(ci,oi,ui)}loadCallback(oi,ci){let ui=this;ui.loading=Math.max(ui.loading-1,0),ui.lastQuery=null,ui.clearActiveOption(),ui.setupOptions(oi,ci),ui.refreshOptions(ui.isFocused&&!ui.isInputHidden),ui.loading||Qn(ui.wrapper,ui.settings.loadingClass),ui.trigger("load",oi,ci)}preload(){var oi=this.wrapper.classList;oi.contains("preloaded")||(oi.add("preloaded"),this.load(""))}setTextboxValue(oi=""){var ci=this.control_input,ui=ci.value!==oi;ui&&(ci.value=oi,Fn(ci,"update"),this.lastValue=oi)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(oi,ci){var ui=ci?[]:["change"];$o(this,ui,()=>{this.clear(ci),this.addItems(oi,ci)})}setMaxItems(oi){oi===0&&(oi=null),this.settings.maxItems=oi,this.refreshState()}setActiveItem(oi,ci){var ui=this,gi,bi,yi,Ci,Oi,Di;if(ui.settings.mode!=="single"){if(!oi){ui.clearActiveItems(),ui.isFocused&&ui.inputState();return}if(gi=ci&&ci.type.toLowerCase(),gi==="click"&&pi("shiftKey",ci)&&ui.activeItems.length){for(Di=ui.getLastActive(),yi=Array.prototype.indexOf.call(ui.control.children,Di),Ci=Array.prototype.indexOf.call(ui.control.children,oi),yi>Ci&&(Oi=yi,yi=Ci,Ci=Oi),bi=yi;bi<=Ci;bi++)oi=ui.control.children[bi],ui.activeItems.indexOf(oi)===-1&&ui.setActiveItemClass(oi);Dn(ci)}else gi==="click"&&pi(Ho,ci)||gi==="keydown"&&pi("shiftKey",ci)?oi.classList.contains("active")?ui.removeActiveItem(oi):ui.setActiveItemClass(oi):(ui.clearActiveItems(),ui.setActiveItemClass(oi));ui.inputState(),ui.isFocused||ui.focus()}}setActiveItemClass(oi){let ci=this,ui=ci.control.querySelector(".last-active");ui&&Qn(ui,"last-active"),Gn(oi,"active last-active"),ci.trigger("item_select",oi),ci.activeItems.indexOf(oi)==-1&&ci.activeItems.push(oi)}removeActiveItem(oi){var ci=this.activeItems.indexOf(oi);this.activeItems.splice(ci,1),Qn(oi,"active")}clearActiveItems(){Qn(this.activeItems,"active"),this.activeItems=[]}setActiveOption(oi,ci=!0){oi!==this.activeOption&&(this.clearActiveOption(),oi&&(this.activeOption=oi,yn(this.focus_node,{"aria-activedescendant":oi.getAttribute("id")}),yn(oi,{"aria-selected":"true"}),Gn(oi,"active"),ci&&this.scrollToOption(oi)))}scrollToOption(oi,ci){if(!oi)return;let ui=this.dropdown_content,gi=ui.clientHeight,bi=ui.scrollTop||0,yi=oi.offsetHeight,Ci=oi.getBoundingClientRect().top-ui.getBoundingClientRect().top+bi;Ci+yi>gi+bi?this.scroll(Ci-gi+yi,ci):Ci<bi&&this.scroll(Ci,ci)}scroll(oi,ci){let ui=this.dropdown_content;ci&&(ui.style.scrollBehavior=ci),ui.scrollTop=oi,ui.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(Qn(this.activeOption,"active"),yn(this.activeOption,{"aria-selected":null})),this.activeOption=null,yn(this.focus_node,{"aria-activedescendant":null})}selectAll(){let oi=this;if(oi.settings.mode==="single")return;let ci=oi.controlChildren();ci.length&&(oi.inputState(),oi.close(),oi.activeItems=ci,Li(ci,ui=>{oi.setActiveItemClass(ui)}))}inputState(){var oi=this;oi.control.contains(oi.control_input)&&(yn(oi.control_input,{placeholder:oi.settings.placeholder}),oi.activeItems.length>0||!oi.isFocused&&oi.settings.hidePlaceholder&&oi.items.length>0?(oi.setTextboxValue(),oi.isInputHidden=!0):(oi.settings.hidePlaceholder&&oi.items.length>0&&yn(oi.control_input,{placeholder:""}),oi.isInputHidden=!1),oi.wrapper.classList.toggle("input-hidden",oi.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var oi=this;oi.isDisabled||oi.isReadOnly||(oi.ignoreFocus=!0,oi.control_input.offsetWidth?oi.control_input.focus():oi.focus_node.focus(),setTimeout(()=>{oi.ignoreFocus=!1,oi.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(oi){return this.sifter.getScoreFunction(oi,this.getSearchOptions())}getSearchOptions(){var oi=this.settings,ci=oi.sortField;return typeof oi.sortField=="string"&&(ci=[{field:oi.sortField}]),{fields:oi.searchField,conjunction:oi.searchConjunction,sort:ci,nesting:oi.nesting}}search(oi){var ci,ui,gi=this,bi=this.getSearchOptions();if(gi.settings.score&&(ui=gi.settings.score.call(gi,oi),typeof ui!="function"))throw new Error('Tom Select "score" setting must be a function that returns a function');return oi!==gi.lastQuery?(gi.lastQuery=oi,ci=gi.sifter.search(oi,Object.assign(bi,{score:ui})),gi.currentResults=ci):ci=Object.assign({},gi.currentResults),gi.settings.hideSelected&&(ci.items=ci.items.filter(yi=>{let Ci=wn(yi.id);return!(Ci&&gi.items.indexOf(Ci)!==-1)})),ci}refreshOptions(oi=!0){var ci,ui,gi,bi,yi,Ci,Oi,Di,Wi,Bi;let Zi={},In=[];var Ki=this,Cn=Ki.inputValue();let Pn=Cn===Ki.lastQuery||Cn==""&&Ki.lastQuery==null;var kn=Ki.search(Cn),dn=null,jn=Ki.settings.shouldOpen||!1,Os=Ki.dropdown_content;Pn&&(dn=Ki.activeOption,dn&&(Wi=dn.closest("[data-group]"))),bi=kn.items.length,typeof Ki.settings.maxOptions=="number"&&(bi=Math.min(bi,Ki.settings.maxOptions)),bi>0&&(jn=!0);let Va=(xn,Ln)=>{let En=Zi[xn];if(En!==void 0){let Nn=In[En];if(Nn!==void 0)return[En,Nn.fragment]}let Jr=document.createDocumentFragment();return En=In.length,In.push({fragment:Jr,order:Ln,optgroup:xn}),[En,Jr]};for(ci=0;ci<bi;ci++){let xn=kn.items[ci];if(!xn)continue;let Ln=xn.id,En=Ki.options[Ln];if(En===void 0)continue;let Jr=Gs(Ln),Nn=Ki.getOption(Jr,!0);for(Ki.settings.hideSelected||Nn.classList.toggle("selected",Ki.items.includes(Jr)),yi=En[Ki.settings.optgroupField]||"",Ci=Array.isArray(yi)?yi:[yi],ui=0,gi=Ci&&Ci.length;ui<gi;ui++){yi=Ci[ui];let qa=En.$order,Wa=Ki.optgroups[yi];Wa===void 0?yi="":qa=Wa.$order;let[th,ih]=Va(yi,qa);ui>0&&(Nn=Nn.cloneNode(!0),yn(Nn,{id:En.$id+"-clone-"+ui,"aria-selected":null}),Nn.classList.add("ts-cloned"),Qn(Nn,"active"),Ki.activeOption&&Ki.activeOption.dataset.value==Ln&&Wi&&Wi.dataset.group===yi.toString()&&(dn=Nn)),ih.appendChild(Nn),yi!=""&&(Zi[yi]=th)}}Ki.settings.lockOptgroupOrder&&In.sort((xn,Ln)=>xn.order-Ln.order),Oi=document.createDocumentFragment(),Li(In,xn=>{let Ln=xn.fragment,En=xn.optgroup;if(!Ln||!Ln.children.length)return;let Jr=Ki.optgroups[En];if(Jr!==void 0){let Nn=document.createDocumentFragment(),qa=Ki.render("optgroup_header",Jr);Si(Nn,qa),Si(Nn,Ln);let Wa=Ki.render("optgroup",{group:Jr,options:Nn});Si(Oi,Wa)}else Si(Oi,Ln)}),Os.innerHTML="",Si(Os,Oi),Ki.settings.highlight&&(Ws(Os),kn.query.length&&kn.tokens.length&&Li(kn.tokens,xn=>{as(Os,xn.regex)}));var Bo=xn=>{let Ln=Ki.render(xn,{input:Cn});return Ln&&(jn=!0,Os.insertBefore(Ln,Os.firstChild)),Ln};if(Ki.loading?Bo("loading"):Ki.settings.shouldLoad.call(Ki,Cn)?kn.items.length===0&&Bo("no_results"):Bo("not_loading"),Di=Ki.canCreate(Cn),Di&&(Bi=Bo("option_create")),Ki.hasOptions=kn.items.length>0||Di,jn){if(kn.items.length>0){if(!dn&&Ki.settings.mode==="single"&&Ki.items[0]!=null&&(dn=Ki.getOption(Ki.items[0])),!Os.contains(dn)){let xn=0;Bi&&!Ki.settings.addPrecedence&&(xn=1),dn=Ki.selectable()[xn]}}else Bi&&(dn=Bi);oi&&!Ki.isOpen&&(Ki.open(),Ki.scrollToOption(dn,"auto")),Ki.setActiveOption(dn)}else Ki.clearActiveOption(),oi&&Ki.isOpen&&Ki.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(oi,ci=!1){let ui=this;if(Array.isArray(oi))return ui.addOptions(oi,ci),!1;let gi=wn(oi[ui.settings.valueField]);return gi===null||ui.options.hasOwnProperty(gi)?!1:(oi.$order=oi.$order||++ui.order,oi.$id=ui.inputId+"-opt-"+oi.$order,ui.options[gi]=oi,ui.lastQuery=null,ci&&(ui.userOptions[gi]=ci,ui.trigger("option_add",gi,oi)),gi)}addOptions(oi,ci=!1){Li(oi,ui=>{this.addOption(ui,ci)})}registerOption(oi){return this.addOption(oi)}registerOptionGroup(oi){var ci=wn(oi[this.settings.optgroupValueField]);return ci===null?!1:(oi.$order=oi.$order||++this.order,this.optgroups[ci]=oi,ci)}addOptionGroup(oi,ci){var ui;ci[this.settings.optgroupValueField]=oi,(ui=this.registerOptionGroup(ci))&&this.trigger("optgroup_add",ui,ci)}removeOptionGroup(oi){this.optgroups.hasOwnProperty(oi)&&(delete this.optgroups[oi],this.clearCache(),this.trigger("optgroup_remove",oi))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(oi,ci){let ui=this;var gi,bi;let yi=wn(oi),Ci=wn(ci[ui.settings.valueField]);if(yi===null)return;let Oi=ui.options[yi];if(Oi==null)return;if(typeof Ci!="string")throw new Error("Value must be set in option data");let Di=ui.getOption(yi),Wi=ui.getItem(yi);if(ci.$order=ci.$order||Oi.$order,delete ui.options[yi],ui.uncacheValue(Ci),ui.options[Ci]=ci,Di){if(ui.dropdown_content.contains(Di)){let Bi=ui._render("option",ci);Kr(Di,Bi),ui.activeOption===Di&&ui.setActiveOption(Bi)}Di.remove()}Wi&&(bi=ui.items.indexOf(yi),bi!==-1&&ui.items.splice(bi,1,Ci),gi=ui._render("item",ci),Wi.classList.contains("active")&&Gn(gi,"active"),Kr(Wi,gi)),ui.lastQuery=null}removeOption(oi,ci){let ui=this;oi=Gs(oi),ui.uncacheValue(oi),delete ui.userOptions[oi],delete ui.options[oi],ui.lastQuery=null,ui.trigger("option_remove",oi),ui.removeItem(oi,ci)}clearOptions(oi){let ci=(oi||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();let ui={};Li(this.options,(gi,bi)=>{ci(gi,bi)&&(ui[bi]=gi)}),this.options=this.sifter.items=ui,this.lastQuery=null,this.trigger("option_clear")}clearFilter(oi,ci){return this.items.indexOf(ci)>=0}getOption(oi,ci=!1){let ui=wn(oi);if(ui===null)return null;let gi=this.options[ui];if(gi!=null){if(gi.$div)return gi.$div;if(ci)return this._render("option",gi)}return null}getAdjacent(oi,ci,ui="option"){var gi=this,bi;if(!oi)return null;ui=="item"?bi=gi.controlChildren():bi=gi.dropdown_content.querySelectorAll("[data-selectable]");for(let yi=0;yi<bi.length;yi++)if(bi[yi]==oi)return ci>0?bi[yi+1]:bi[yi-1];return null}getItem(oi){if(typeof oi=="object")return oi;var ci=wn(oi);return ci!==null?this.control.querySelector(`[data-value="${wi(ci)}"]`):null}addItems(oi,ci){var ui=this,gi=Array.isArray(oi)?oi:[oi];gi=gi.filter(yi=>ui.items.indexOf(yi)===-1);let bi=gi[gi.length-1];gi.forEach(yi=>{ui.isPending=yi!==bi,ui.addItem(yi,ci)})}addItem(oi,ci){var ui=ci?[]:["change","dropdown_close"];$o(this,ui,()=>{var gi,bi;let yi=this,Ci=yi.settings.mode,Oi=wn(oi);if(!(Oi&&yi.items.indexOf(Oi)!==-1&&(Ci==="single"&&yi.close(),Ci==="single"||!yi.settings.duplicates))&&!(Oi===null||!yi.options.hasOwnProperty(Oi))&&(Ci==="single"&&yi.clear(ci),!(Ci==="multi"&&yi.isFull()))){if(gi=yi._render("item",yi.options[Oi]),yi.control.contains(gi)&&(gi=gi.cloneNode(!0)),bi=yi.isFull(),yi.items.splice(yi.caretPos,0,Oi),yi.insertAtCaret(gi),yi.isSetup){if(!yi.isPending&&yi.settings.hideSelected){let Di=yi.getOption(Oi),Wi=yi.getAdjacent(Di,1);Wi&&yi.setActiveOption(Wi)}!yi.isPending&&!yi.settings.closeAfterSelect&&yi.refreshOptions(yi.isFocused&&Ci!=="single"),yi.settings.closeAfterSelect!=!1&&yi.isFull()?yi.close():yi.isPending||yi.positionDropdown(),yi.trigger("item_add",Oi,gi),yi.isPending||yi.updateOriginalInput({silent:ci})}(!yi.isPending||!bi&&yi.isFull())&&(yi.inputState(),yi.refreshState())}})}removeItem(oi=null,ci){let ui=this;if(oi=ui.getItem(oi),!oi)return;var gi,bi;let yi=oi.dataset.value;gi=qn(oi),oi.remove(),oi.classList.contains("active")&&(bi=ui.activeItems.indexOf(oi),ui.activeItems.splice(bi,1),Qn(oi,"active")),ui.items.splice(gi,1),ui.lastQuery=null,!ui.settings.persist&&ui.userOptions.hasOwnProperty(yi)&&ui.removeOption(yi,ci),gi<ui.caretPos&&ui.setCaret(ui.caretPos-1),ui.updateOriginalInput({silent:ci}),ui.refreshState(),ui.positionDropdown(),ui.trigger("item_remove",yi,oi)}createItem(oi=null,ci=()=>{}){arguments.length===3&&(ci=arguments[2]),typeof ci!="function"&&(ci=()=>{});var ui=this,gi=ui.caretPos,bi;if(oi=oi||ui.inputValue(),!ui.canCreate(oi))return ci(),!1;ui.lock();var yi=!1,Ci=Oi=>{if(ui.unlock(),!Oi||typeof Oi!="object")return ci();var Di=wn(Oi[ui.settings.valueField]);if(typeof Di!="string")return ci();ui.setTextboxValue(),ui.addOption(Oi,!0),ui.setCaret(gi),ui.addItem(Di),ci(Oi),yi=!0};return typeof ui.settings.create=="function"?bi=ui.settings.create.call(this,oi,Ci):bi={[ui.settings.labelField]:oi,[ui.settings.valueField]:oi},yi||Ci(bi),!0}refreshItems(){var oi=this;oi.lastQuery=null,oi.isSetup&&oi.addItems(oi.items),oi.updateOriginalInput(),oi.refreshState()}refreshState(){let oi=this;oi.refreshValidityState();let ci=oi.isFull(),ui=oi.isLocked;oi.wrapper.classList.toggle("rtl",oi.rtl);let gi=oi.wrapper.classList;gi.toggle("focus",oi.isFocused),gi.toggle("disabled",oi.isDisabled),gi.toggle("readonly",oi.isReadOnly),gi.toggle("required",oi.isRequired),gi.toggle("invalid",!oi.isValid),gi.toggle("locked",ui),gi.toggle("full",ci),gi.toggle("input-active",oi.isFocused&&!oi.isInputHidden),gi.toggle("dropdown-active",oi.isOpen),gi.toggle("has-options",qs(oi.options)),gi.toggle("has-items",oi.items.length>0)}refreshValidityState(){var oi=this;oi.input.validity&&(oi.isValid=oi.input.validity.valid,oi.isInvalid=!oi.isValid)}isFull(){return this.settings.maxItems!==null&&this.items.length>=this.settings.maxItems}updateOriginalInput(oi={}){let ci=this;var ui,gi;let bi=ci.input.querySelector('option[value=""]');if(ci.is_select_tag){let Oi=function(Di,Wi,Bi){return Di||(Di=Ii('<option value="'+Ks(Wi)+'">'+Ks(Bi)+"</option>")),Di!=bi&&ci.input.append(Di),yi.push(Di),(Di!=bi||Ci>0)&&(Di.selected=!0),Di},yi=[],Ci=ci.input.querySelectorAll("option:checked").length;ci.input.querySelectorAll("option:checked").forEach(Di=>{Di.selected=!1}),ci.items.length==0&&ci.settings.mode=="single"?Oi(bi,"",""):ci.items.forEach(Di=>{if(ui=ci.options[Di],gi=ui[ci.settings.labelField]||"",yi.includes(ui.$option)){let Wi=ci.input.querySelector(`option[value="${wi(Di)}"]:not(:checked)`);Oi(Wi,Di,gi)}else ui.$option=Oi(ui.$option,Di,gi)})}else ci.input.value=ci.getValue();ci.isSetup&&(oi.silent||ci.trigger("change",ci.getValue()))}open(){var oi=this;oi.isLocked||oi.isOpen||oi.settings.mode==="multi"&&oi.isFull()||(oi.isOpen=!0,yn(oi.focus_node,{"aria-expanded":"true"}),oi.refreshState(),Bn(oi.dropdown,{visibility:"hidden",display:"block"}),oi.positionDropdown(),Bn(oi.dropdown,{visibility:"visible",display:"block"}),oi.focus(),oi.trigger("dropdown_open",oi.dropdown))}close(oi=!0){var ci=this,ui=ci.isOpen;oi&&(ci.setTextboxValue(),ci.settings.mode==="single"&&ci.items.length&&ci.inputState()),ci.isOpen=!1,yn(ci.focus_node,{"aria-expanded":"false"}),Bn(ci.dropdown,{display:"none"}),ci.settings.hideSelected&&ci.clearActiveOption(),ci.refreshState(),ui&&ci.trigger("dropdown_close",ci.dropdown)}positionDropdown(){if(this.settings.dropdownParent==="body"){var oi=this.control,ci=oi.getBoundingClientRect(),ui=oi.offsetHeight+ci.top+window.scrollY,gi=ci.left+window.scrollX;Bn(this.dropdown,{width:ci.width+"px",top:ui+"px",left:gi+"px"})}}clear(oi){var ci=this;if(ci.items.length){var ui=ci.controlChildren();Li(ui,gi=>{ci.removeItem(gi,!0)}),ci.inputState(),oi||ci.updateOriginalInput(),ci.trigger("clear")}}insertAtCaret(oi){let ci=this,ui=ci.caretPos,gi=ci.control;gi.insertBefore(oi,gi.children[ui]||null),ci.setCaret(ui+1)}deleteSelection(oi){var ci,ui,gi,bi,yi=this;ci=oi&&oi.keyCode===ha?-1:1,ui=Cs(yi.control_input);let Ci=[];if(yi.activeItems.length)bi=ms(yi.activeItems,ci),gi=qn(bi),ci>0&&gi++,Li(yi.activeItems,Oi=>Ci.push(Oi));else if((yi.isFocused||yi.settings.mode==="single")&&yi.items.length){let Oi=yi.controlChildren(),Di;ci<0&&ui.start===0&&ui.length===0?Di=Oi[yi.caretPos-1]:ci>0&&ui.start===yi.inputValue().length&&(Di=Oi[yi.caretPos]),Di!==void 0&&Ci.push(Di)}if(!yi.shouldDelete(Ci,oi))return!1;for(Dn(oi,!0),typeof gi!="undefined"&&yi.setCaret(gi);Ci.length;)yi.removeItem(Ci.pop());return yi.inputState(),yi.positionDropdown(),yi.refreshOptions(!1),!0}shouldDelete(oi,ci){let ui=oi.map(gi=>gi.dataset.value);return!(!ui.length||typeof this.settings.onDelete=="function"&&this.settings.onDelete(ui,ci)===!1)}advanceSelection(oi,ci){var ui,gi,bi=this;bi.rtl&&(oi*=-1),!bi.inputValue().length&&(pi(Ho,ci)||pi("shiftKey",ci)?(ui=bi.getLastActive(oi),ui?ui.classList.contains("active")?gi=bi.getAdjacent(ui,oi,"item"):gi=ui:oi>0?gi=bi.control_input.nextElementSibling:gi=bi.control_input.previousElementSibling,gi&&(gi.classList.contains("active")&&bi.removeActiveItem(ui),bi.setActiveItemClass(gi))):bi.moveCaret(oi))}moveCaret(oi){}getLastActive(oi){let ci=this.control.querySelector(".last-active");if(ci)return ci;var ui=this.control.querySelectorAll(".active");if(ui)return ms(ui,oi)}setCaret(oi){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(oi=this.isReadOnly||this.isDisabled){this.isLocked=oi,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(oi){this.focus_node.tabIndex=oi?-1:this.tabIndex,this.isDisabled=oi,this.input.disabled=oi,this.control_input.disabled=oi,this.setLocked()}setReadOnly(oi){this.isReadOnly=oi,this.input.readOnly=oi,this.control_input.readOnly=oi,this.setLocked()}destroy(){var oi=this,ci=oi.revertSettings;oi.trigger("destroy"),oi.off(),oi.wrapper.remove(),oi.dropdown.remove(),oi.input.innerHTML=ci.innerHTML,oi.input.tabIndex=ci.tabIndex,Qn(oi.input,"tomselected","ts-hidden-accessible"),oi._destroy(),delete oi.input.tomselect}render(oi,ci){var ui,gi;let bi=this;if(typeof this.settings.render[oi]!="function"||(gi=bi.settings.render[oi].call(this,ci,Ks),!gi))return null;if(gi=Ii(gi),oi==="option"||oi==="option_create"?ci[bi.settings.disabledField]?yn(gi,{"aria-disabled":"true"}):yn(gi,{"data-selectable":""}):oi==="optgroup"&&(ui=ci.group[bi.settings.optgroupValueField],yn(gi,{"data-group":ui}),ci.group[bi.settings.disabledField]&&yn(gi,{"data-disabled":""})),oi==="option"||oi==="item"){let yi=Gs(ci[bi.settings.valueField]);yn(gi,{"data-value":yi}),oi==="item"?(Gn(gi,bi.settings.itemClass),yn(gi,{"data-ts-item":""})):(Gn(gi,bi.settings.optionClass),yn(gi,{role:"option",id:ci.$id}),ci.$div=gi,bi.options[yi]=ci)}return gi}_render(oi,ci){let ui=this.render(oi,ci);if(ui==null)throw"HTMLElement expected";return ui}clearCache(){Li(this.options,oi=>{oi.$div&&(oi.$div.remove(),delete oi.$div)})}uncacheValue(oi){let ci=this.getOption(oi);ci&&ci.remove()}canCreate(oi){return this.settings.create&&oi.length>0&&this.settings.createFilter.call(this,oi)}hook(oi,ci,ui){var gi=this,bi=gi[ci];gi[ci]=function(){var yi,Ci;return oi==="after"&&(yi=bi.apply(gi,arguments)),Ci=ui.apply(gi,arguments),oi==="instead"?Ci:(oi==="before"&&(yi=bi.apply(gi,arguments)),yi)}}}function Qi(){On(this.input,"change",()=>{this.sync()})}function _n(fi){var oi=this,ci=oi.onOptionSelect;oi.settings.hideSelected=!1;let ui=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},fi);var gi=function(Ci,Oi){Oi?(Ci.checked=!0,ui.uncheckedClassNames&&Ci.classList.remove(...ui.uncheckedClassNames),ui.checkedClassNames&&Ci.classList.add(...ui.checkedClassNames)):(Ci.checked=!1,ui.checkedClassNames&&Ci.classList.remove(...ui.checkedClassNames),ui.uncheckedClassNames&&Ci.classList.add(...ui.uncheckedClassNames))},bi=function(Ci){setTimeout(()=>{var Oi=Ci.querySelector("input."+ui.className);Oi instanceof HTMLInputElement&&gi(Oi,Ci.classList.contains("selected"))},1)};oi.hook("after","setupTemplates",()=>{var yi=oi.settings.render.option;oi.settings.render.option=(Ci,Oi)=>{var Di=Ii(yi.call(oi,Ci,Oi)),Wi=document.createElement("input");ui.className&&Wi.classList.add(ui.className),Wi.addEventListener("click",function(Zi){Dn(Zi)}),Wi.type="checkbox";let Bi=wn(Ci[oi.settings.valueField]);return gi(Wi,!!(Bi&&oi.items.indexOf(Bi)>-1)),Di.prepend(Wi),Di}}),oi.on("item_remove",yi=>{var Ci=oi.getOption(yi);Ci&&(Ci.classList.remove("selected"),bi(Ci))}),oi.on("item_add",yi=>{var Ci=oi.getOption(yi);Ci&&bi(Ci)}),oi.hook("instead","onOptionSelect",(yi,Ci)=>{if(Ci.classList.contains("selected")){Ci.classList.remove("selected"),oi.removeItem(Ci.dataset.value),oi.refreshOptions(),Dn(yi,!0);return}ci.call(oi,yi,Ci),bi(Ci)})}function Gi(fi){let oi=this,ci=Object.assign({className:"clear-button",title:"Clear All",html:ui=>`<div class="${ui.className}" title="${ui.title}">&#10799;</div>`},fi);oi.on("initialize",()=>{var ui=Ii(ci.html(ci));ui.addEventListener("click",gi=>{oi.isLocked||(oi.clear(),oi.settings.mode==="single"&&oi.settings.allowEmptyOption&&oi.addItem(""),gi.preventDefault(),gi.stopPropagation())}),oi.control.appendChild(ui)})}let fn=(fi,oi)=>{var ci;(ci=fi.parentNode)==null||ci.insertBefore(oi,fi.nextSibling)},Mn=(fi,oi)=>{var ci;(ci=fi.parentNode)==null||ci.insertBefore(oi,fi)},gs=(fi,oi)=>{do{var ci;if(oi=(ci=oi)==null?void 0:ci.previousElementSibling,fi==oi)return!0}while(oi&&oi.previousElementSibling);return!1};function is(){var fi=this;if(fi.settings.mode!=="multi")return;var oi=fi.lock,ci=fi.unlock;let ui=!0,gi;fi.hook("after","setupTemplates",()=>{var bi=fi.settings.render.item;fi.settings.render.item=(yi,Ci)=>{let Oi=Ii(bi.call(fi,yi,Ci));yn(Oi,{draggable:"true"});let Di=Cn=>{ui||Dn(Cn),Cn.stopPropagation()},Wi=Cn=>{gi=Oi,setTimeout(()=>{Oi.classList.add("ts-dragging")},0)},Bi=Cn=>{Cn.preventDefault(),Oi.classList.add("ts-drag-over"),In(Oi,gi)},Zi=()=>{Oi.classList.remove("ts-drag-over")},In=(Cn,Pn)=>{Pn!==void 0&&(gs(Pn,Oi)?fn(Cn,Pn):Mn(Cn,Pn))},Ki=()=>{var Cn;document.querySelectorAll(".ts-drag-over").forEach(kn=>kn.classList.remove("ts-drag-over")),(Cn=gi)==null||Cn.classList.remove("ts-dragging"),gi=void 0;var Pn=[];fi.control.querySelectorAll("[data-value]").forEach(kn=>{if(kn.dataset.value){let dn=kn.dataset.value;dn&&Pn.push(dn)}}),fi.setValue(Pn)};return On(Oi,"mousedown",Di),On(Oi,"dragstart",Wi),On(Oi,"dragenter",Bi),On(Oi,"dragover",Bi),On(Oi,"dragleave",Zi),On(Oi,"dragend",Ki),Oi}}),fi.hook("instead","lock",()=>(ui=!1,oi.call(fi))),fi.hook("instead","unlock",()=>(ui=!0,ci.call(fi)))}function mo(fi){let oi=this,ci=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:ui=>'<div class="'+ui.headerClass+'"><div class="'+ui.titleRowClass+'"><span class="'+ui.labelClass+'">'+ui.title+'</span><a class="'+ui.closeClass+'">&times;</a></div></div>'},fi);oi.on("initialize",()=>{var ui=Ii(ci.html(ci)),gi=ui.querySelector("."+ci.closeClass);gi&&gi.addEventListener("click",bi=>{Dn(bi,!0),oi.close()}),oi.dropdown.insertBefore(ui,oi.dropdown.firstChild)})}function Qs(){var fi=this;fi.hook("instead","setCaret",oi=>{fi.settings.mode==="single"||!fi.control.contains(fi.control_input)?oi=fi.items.length:(oi=Math.max(0,Math.min(fi.items.length,oi)),oi!=fi.caretPos&&!fi.isPending&&fi.controlChildren().forEach((ci,ui)=>{ui<oi?fi.control_input.insertAdjacentElement("beforebegin",ci):fi.control.appendChild(ci)})),fi.caretPos=oi}),fi.hook("instead","moveCaret",oi=>{if(!fi.isFocused)return;let ci=fi.getLastActive(oi);if(ci){let ui=qn(ci);fi.setCaret(oi>0?ui+1:ui),fi.setActiveItem(),Qn(ci,"last-active")}else fi.setCaret(fi.caretPos+oi)})}function Gl(){let fi=this;fi.settings.shouldOpen=!0,fi.hook("before","setup",()=>{fi.focus_node=fi.control,Gn(fi.control_input,"dropdown-input");let oi=Ii('<div class="dropdown-input-wrap">');oi.append(fi.control_input),fi.dropdown.insertBefore(oi,fi.dropdown.firstChild);let ci=Ii('<input class="items-placeholder" tabindex="-1" />');ci.placeholder=fi.settings.placeholder||"",fi.control.append(ci)}),fi.on("initialize",()=>{fi.control_input.addEventListener("keydown",ci=>{switch(ci.keyCode){case Ms:fi.isOpen&&(Dn(ci,!0),fi.close()),fi.clearActiveItems();return;case pa:fi.focus_node.tabIndex=-1;break}return fi.onKeyDown.call(fi,ci)}),fi.on("blur",()=>{fi.focus_node.tabIndex=fi.isDisabled?-1:fi.tabIndex}),fi.on("dropdown_open",()=>{fi.control_input.focus()});let oi=fi.onBlur;fi.hook("instead","onBlur",ci=>{if(!(ci&&ci.relatedTarget==fi.control_input))return oi.call(fi)}),On(fi.control_input,"blur",()=>fi.onBlur()),fi.hook("before","close",()=>{fi.isOpen&&fi.focus_node.focus({preventScroll:!0})})})}function ma(){var fi=this;fi.on("initialize",()=>{var oi=document.createElement("span"),ci=fi.control_input;oi.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",fi.wrapper.appendChild(oi);var ui=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(let bi of ui)oi.style[bi]=ci.style[bi];var gi=()=>{oi.textContent=ci.value,ci.style.width=oi.clientWidth+"px"};gi(),fi.on("update item_add item_remove",gi),On(ci,"input",gi),On(ci,"keyup",gi),On(ci,"blur",gi),On(ci,"update",gi)})}function Kl(){var fi=this,oi=fi.deleteSelection;this.hook("instead","deleteSelection",ci=>fi.activeItems.length?oi.call(fi,ci):!1)}function Ql(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}function Xl(){var fi=this,oi=fi.onKeyDown;fi.hook("instead","onKeyDown",ci=>{var ui,gi,bi,yi;if(!fi.isOpen||!(ci.keyCode===Ss||ci.keyCode===Ys))return oi.call(fi,ci);fi.ignoreHover=!0,yi=hs(fi.activeOption,"[data-group]"),ui=qn(fi.activeOption,"[data-selectable]"),yi&&(ci.keyCode===Ss?yi=yi.previousSibling:yi=yi.nextSibling,yi&&(bi=yi.querySelectorAll("[data-selectable]"),gi=bi[Math.min(bi.length-1,ui)],gi&&fi.setActiveOption(gi)))})}function Jl(fi){let oi=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},fi);var ci=this;if(oi.append){var ui='<a href="javascript:void(0)" class="'+oi.className+'" tabindex="-1" title="'+Ks(oi.title)+'">'+oi.label+"</a>";ci.hook("after","setupTemplates",()=>{var gi=ci.settings.render.item;ci.settings.render.item=(bi,yi)=>{var Ci=Ii(gi.call(ci,bi,yi)),Oi=Ii(ui);return Ci.appendChild(Oi),On(Oi,"mousedown",Di=>{Dn(Di,!0)}),On(Oi,"click",Di=>{ci.isLocked||(Dn(Di,!0),!ci.isLocked&&ci.shouldDelete([Ci],Di)&&(ci.removeItem(Ci),ci.refreshOptions(!1),ci.inputState()))}),Ci}})}}function Zl(fi){let oi=this,ci=Object.assign({text:ui=>ui[oi.settings.labelField]},fi);oi.on("item_remove",function(ui){if(oi.isFocused&&oi.control_input.value.trim()===""){var gi=oi.options[ui];gi&&oi.setTextboxValue(ci.text.call(oi,gi))}})}function ec(){let fi=this,oi=fi.canLoad,ci=fi.clearActiveOption,ui=fi.loadCallback;var gi={},bi,yi=!1,Ci,Oi=[];if(fi.settings.shouldLoadMore||(fi.settings.shouldLoadMore=()=>{if(bi.clientHeight/(bi.scrollHeight-bi.scrollTop)>.9)return!0;if(fi.activeOption){var Zi=fi.selectable(),In=Array.from(Zi).indexOf(fi.activeOption);if(In>=Zi.length-2)return!0}return!1}),!fi.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";fi.settings.sortField=[{field:"$order"},{field:"$score"}];let Di=Bi=>typeof fi.settings.maxOptions=="number"&&bi.children.length>=fi.settings.maxOptions?!1:!!(Bi in gi&&gi[Bi]),Wi=(Bi,Zi)=>fi.items.indexOf(Zi)>=0||Oi.indexOf(Zi)>=0;fi.setNextUrl=(Bi,Zi)=>{gi[Bi]=Zi},fi.getUrl=Bi=>{if(Bi in gi){let Zi=gi[Bi];return gi[Bi]=!1,Zi}return fi.clearPagination(),fi.settings.firstUrl.call(fi,Bi)},fi.clearPagination=()=>{gi={}},fi.hook("instead","clearActiveOption",()=>{if(!yi)return ci.call(fi)}),fi.hook("instead","canLoad",Bi=>Bi in gi?Di(Bi):oi.call(fi,Bi)),fi.hook("instead","loadCallback",(Bi,Zi)=>{if(!yi)fi.clearOptions(Wi);else if(Ci){let In=Bi[0];In!==void 0&&(Ci.dataset.value=In[fi.settings.valueField])}ui.call(fi,Bi,Zi),yi=!1}),fi.hook("after","refreshOptions",()=>{let Bi=fi.lastValue;var Zi;Di(Bi)?(Zi=fi.render("loading_more",{query:Bi}),Zi&&(Zi.setAttribute("data-selectable",""),Ci=Zi)):Bi in gi&&!bi.querySelector(".no-results")&&(Zi=fi.render("no_more_results",{query:Bi})),Zi&&(Gn(Zi,fi.settings.optionClass),bi.append(Zi))}),fi.on("initialize",()=>{Oi=Object.keys(fi.options),bi=fi.dropdown_content,fi.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>'},fi.settings.render),bi.addEventListener("scroll",()=>{fi.settings.shouldLoadMore.call(fi)&&Di(fi.lastValue)&&(yi||(yi=!0,fi.load.call(fi,fi.lastValue)))})})}return nn.define("change_listener",Qi),nn.define("checkbox_options",_n),nn.define("clear_button",Gi),nn.define("drag_drop",is),nn.define("dropdown_header",mo),nn.define("caret_position",Qs),nn.define("dropdown_input",Gl),nn.define("input_autogrow",ma),nn.define("no_backspace_delete",Kl),nn.define("no_active_items",Ql),nn.define("optgroup_columns",Xl),nn.define("remove_button",Jl),nn.define("restore_on_backspace",Zl),nn.define("virtual_scroll",ec),nn})});var Ud=Ya((Tl,Wd)=>{(function(ii,ti){typeof Tl=="object"&&typeof Wd!="undefined"?ti(Tl):typeof define=="function"&&define.amd?define(["exports"],ti):(ii=typeof globalThis!="undefined"?globalThis:ii||self,ti(ii.diacritics={}))})(Tl,function(ii){"use strict";let ti=Ni=>(Ni=Ni.filter(Boolean),Ni.length<2?Ni[0]||"":ai(Ni)==1?"["+Ni.join("")+"]":"(?:"+Ni.join("|")+")"),ei=Ni=>{if(!ri(Ni))return Ni.join("");let Hi="",Pi=0,$i=()=>{Pi>1&&(Hi+="{"+Pi+"}")};return Ni.forEach((mn,tn)=>{if(mn===Ni[tn-1]){Pi++;return}$i(),Hi+=mn,Pi=1}),$i(),Hi},ni=Ni=>{let Hi=di(Ni);return ti(Hi)},ri=Ni=>new Set(Ni).size!==Ni.length,si=Ni=>(Ni+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),ai=Ni=>Ni.reduce((Hi,Pi)=>Math.max(Hi,li(Pi)),0),li=Ni=>di(Ni).length,di=Ni=>Array.from(Ni),mi=Ni=>{if(Ni.length===1)return[[Ni]];let Hi=[],Pi=Ni.substring(1);return mi(Pi).forEach(function(mn){let tn=mn.slice(0);tn[0]=Ni.charAt(0)+tn[0],Hi.push(tn),tn=mn.slice(0),tn.unshift(Ni.charAt(0)),Hi.push(tn)}),Hi},hi=[[0,65535]],_i="[\u0300-\u036F\xB7\u02BE\u02BC]";ii.unicode_map=void 0;let Ei,Ai=3,ki={},Ti={"/":"\u2044\u2215",0:"\u07C0",a:"\u2C65\u0250\u0251",aa:"\uA733",ae:"\xE6\u01FD\u01E3",ao:"\uA735",au:"\uA737",av:"\uA739\uA73B",ay:"\uA73D",b:"\u0180\u0253\u0183",c:"\uA73F\u0188\u023C\u2184",d:"\u0111\u0257\u0256\u1D05\u018C\uABB7\u0501\u0266",e:"\u025B\u01DD\u1D07\u0247",f:"\uA77C\u0192",g:"\u01E5\u0260\uA7A1\u1D79\uA77F\u0262",h:"\u0127\u2C68\u2C76\u0265",i:"\u0268\u0131",j:"\u0249\u0237",k:"\u0199\u2C6A\uA741\uA743\uA745\uA7A3",l:"\u0142\u019A\u026B\u2C61\uA749\uA747\uA781\u026D",m:"\u0271\u026F\u03FB",n:"\uA7A5\u019E\u0272\uA791\u1D0E\u043B\u0509",o:"\xF8\u01FF\u0254\u0275\uA74B\uA74D\u1D11",oe:"\u0153",oi:"\u01A3",oo:"\uA74F",ou:"\u0223",p:"\u01A5\u1D7D\uA751\uA753\uA755\u03C1",q:"\uA757\uA759\u024B",r:"\u024D\u027D\uA75B\uA7A7\uA783",s:"\xDF\u023F\uA7A9\uA785\u0282",t:"\u0167\u01AD\u0288\u2C66\uA787",th:"\xFE",tz:"\uA729",u:"\u0289",v:"\u028B\uA75F\u028C",vy:"\uA761",w:"\u2C73",y:"\u01B4\u024F\u1EFF",z:"\u01B6\u0225\u0240\u2C6C\uA763",hv:"\u0195"};for(let Ni in Ti){let Hi=Ti[Ni]||"";for(let Pi=0;Pi<Hi.length;Pi++){let $i=Hi.substring(Pi,Pi+1);ki[$i]=Ni}}let Fi=new RegExp(Object.keys(ki).join("|")+"|"+_i,"gu"),en=Ni=>{ii.unicode_map===void 0&&(ii.unicode_map=bn(Ni||hi))},rn=(Ni,Hi="NFKD")=>Ni.normalize(Hi),ln=Ni=>di(Ni).reduce((Hi,Pi)=>Hi+Yi(Pi),""),Yi=Ni=>(Ni=rn(Ni).toLowerCase().replace(Fi,Hi=>ki[Hi]||""),rn(Ni,"NFC"));function*on(Ni){for(let[Hi,Pi]of Ni)for(let $i=Hi;$i<=Pi;$i++){let mn=String.fromCharCode($i),tn=ln(mn);tn!=mn.toLowerCase()&&(tn.length>Ai||tn.length!=0&&(yield{folded:tn,composed:mn,code_point:$i}))}}let an=Ni=>{let Hi={},Pi=($i,mn)=>{let tn=Hi[$i]||new Set,zi=new RegExp("^"+ni(tn)+"$","iu");mn.match(zi)||(tn.add(si(mn)),Hi[$i]=tn)};for(let $i of on(Ni))Pi($i.folded,$i.folded),Pi($i.folded,$i.composed);return Hi},bn=Ni=>{let Hi=an(Ni),Pi={},$i=[];for(let tn in Hi){let zi=Hi[tn];zi&&(Pi[tn]=ni(zi)),tn.length>1&&$i.push(si(tn))}$i.sort((tn,zi)=>zi.length-tn.length);let mn=ti($i);return Ei=new RegExp("^"+mn,"u"),Pi},hn=(Ni,Hi=1)=>{let Pi=0;return Ni=Ni.map($i=>(ii.unicode_map[$i]&&(Pi+=$i.length),ii.unicode_map[$i]||$i)),Pi>=Hi?ei(Ni):""},pn=(Ni,Hi=1)=>(Hi=Math.max(Hi,Ni.length-1),ti(mi(Ni).map(Pi=>hn(Pi,Hi)))),gn=(Ni,Hi=!0)=>{let Pi=Ni.length>1?1:0;return ti(Ni.map($i=>{let mn=[],tn=Hi?$i.length():$i.length()-1;for(let zi=0;zi<tn;zi++)mn.push(pn($i.substrs[zi]||"",Pi));return ei(mn)}))},un=(Ni,Hi)=>{for(let Pi of Hi){if(Pi.start!=Ni.start||Pi.end!=Ni.end||Pi.substrs.join("")!==Ni.substrs.join(""))continue;let $i=Ni.parts,mn=zi=>{for(let Li of $i){if(Li.start===zi.start&&Li.substr===zi.substr)return!1;if(!(zi.length==1||Li.length==1)&&(zi.start<Li.start&&zi.end>Li.start||Li.start<zi.start&&Li.end>zi.start))return!0}return!1};if(!(Pi.parts.filter(mn).length>0))return!0}return!1};class vn{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(Hi){Hi&&(this.parts.push(Hi),this.substrs.push(Hi.substr),this.start=Math.min(Hi.start,this.start),this.end=Math.max(Hi.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(Hi,Pi){let $i=new vn,mn=JSON.parse(JSON.stringify(this.parts)),tn=mn.pop();for(let ji of mn)$i.add(ji);let zi=Pi.substr.substring(0,Hi-tn.start),Li=zi.length;return $i.add({start:tn.start,end:tn.start+Li,length:Li,substr:zi}),$i}}let Tn=Ni=>{en(),Ni=ln(Ni);let Hi="",Pi=[new vn];for(let $i=0;$i<Ni.length;$i++){let tn=Ni.substring($i).match(Ei),zi=Ni.substring($i,$i+1),Li=tn?tn[0]:null,ji=[],Ji=new Set;for(let Vi of Pi){let Ii=Vi.last();if(!Ii||Ii.length==1||Ii.end<=$i)if(Li){let Sn=Li.length;Vi.add({start:$i,end:$i+Sn,length:Sn,substr:Li}),Ji.add("1")}else Vi.add({start:$i,end:$i+1,length:1,substr:zi}),Ji.add("2");else if(Li){let Sn=Vi.clone($i,Ii),Yn=Li.length;Sn.add({start:$i,end:$i+Yn,length:Yn,substr:Li}),ji.push(Sn)}else Ji.add("3")}if(ji.length>0){ji=ji.sort((Vi,Ii)=>Vi.length()-Ii.length());for(let Vi of ji)un(Vi,Pi)||Pi.push(Vi);continue}if($i>0&&Ji.size==1&&!Ji.has("3")){Hi+=gn(Pi,!1);let Vi=new vn,Ii=Pi[0];Ii&&Vi.add(Ii.last()),Pi=[Vi]}}return Hi+=gn(Pi,!0),Hi};ii._asciifold=Yi,ii.asciifold=ln,ii.code_points=hi,ii.escape_regex=si,ii.generateMap=bn,ii.generateSets=an,ii.generator=on,ii.getPattern=Tn,ii.initialize=en,ii.mapSequence=hn,ii.normalize=rn,ii.substringsToPattern=pn,Object.defineProperty(ii,"__esModule",{value:!0})})});var kf=Ya((Ra,eu)=>{(function(ti,ei){typeof Ra=="object"&&typeof eu=="object"?eu.exports=ei():typeof define=="function"&&define.amd?define([],ei):typeof Ra=="object"?Ra.ClipboardJS=ei():ti.ClipboardJS=ei()})(Ra,function(){return function(){var ii={686:function(ni,ri,si){"use strict";si.d(ri,{default:function(){return tn}});var ai=si(279),li=si.n(ai),di=si(370),mi=si.n(di),hi=si(817),_i=si.n(hi);function Ei(zi){try{return document.execCommand(zi)}catch(Li){return!1}}var Ai=function(Li){var ji=_i()(Li);return Ei("cut"),ji},ki=Ai;function Ti(zi){var Li=document.documentElement.getAttribute("dir")==="rtl",ji=document.createElement("textarea");ji.style.fontSize="12pt",ji.style.border="0",ji.style.padding="0",ji.style.margin="0",ji.style.position="absolute",ji.style[Li?"right":"left"]="-9999px";var Ji=window.pageYOffset||document.documentElement.scrollTop;return ji.style.top="".concat(Ji,"px"),ji.setAttribute("readonly",""),ji.value=zi,ji}var Fi=function(Li,ji){var Ji=Ti(Li);ji.container.appendChild(Ji);var Vi=_i()(Ji);return Ei("copy"),Ji.remove(),Vi},en=function(Li){var ji=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},Ji="";return typeof Li=="string"?Ji=Fi(Li,ji):Li instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(Li==null?void 0:Li.type)?Ji=Fi(Li.value,ji):(Ji=_i()(Li),Ei("copy")),Ji},rn=en;function ln(zi){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ln=function(ji){return typeof ji}:ln=function(ji){return ji&&typeof Symbol=="function"&&ji.constructor===Symbol&&ji!==Symbol.prototype?"symbol":typeof ji},ln(zi)}var Yi=function(){var Li=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ji=Li.action,Ji=ji===void 0?"copy":ji,Vi=Li.container,Ii=Li.target,Sn=Li.text;if(Ji!=="copy"&&Ji!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Ii!==void 0)if(Ii&&ln(Ii)==="object"&&Ii.nodeType===1){if(Ji==="copy"&&Ii.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(Ji==="cut"&&(Ii.hasAttribute("readonly")||Ii.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Sn)return rn(Sn,{container:Vi});if(Ii)return Ji==="cut"?ki(Ii):rn(Ii,{container:Vi})},on=Yi;function an(zi){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?an=function(ji){return typeof ji}:an=function(ji){return ji&&typeof Symbol=="function"&&ji.constructor===Symbol&&ji!==Symbol.prototype?"symbol":typeof ji},an(zi)}function bn(zi,Li){if(!(zi instanceof Li))throw new TypeError("Cannot call a class as a function")}function hn(zi,Li){for(var ji=0;ji<Li.length;ji++){var Ji=Li[ji];Ji.enumerable=Ji.enumerable||!1,Ji.configurable=!0,"value"in Ji&&(Ji.writable=!0),Object.defineProperty(zi,Ji.key,Ji)}}function pn(zi,Li,ji){return Li&&hn(zi.prototype,Li),ji&&hn(zi,ji),zi}function gn(zi,Li){if(typeof Li!="function"&&Li!==null)throw new TypeError("Super expression must either be null or a function");zi.prototype=Object.create(Li&&Li.prototype,{constructor:{value:zi,writable:!0,configurable:!0}}),Li&&un(zi,Li)}function un(zi,Li){return un=Object.setPrototypeOf||function(Ji,Vi){return Ji.__proto__=Vi,Ji},un(zi,Li)}function vn(zi){var Li=Hi();return function(){var Ji=Pi(zi),Vi;if(Li){var Ii=Pi(this).constructor;Vi=Reflect.construct(Ji,arguments,Ii)}else Vi=Ji.apply(this,arguments);return Tn(this,Vi)}}function Tn(zi,Li){return Li&&(an(Li)==="object"||typeof Li=="function")?Li:Ni(zi)}function Ni(zi){if(zi===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return zi}function Hi(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(zi){return!1}}function Pi(zi){return Pi=Object.setPrototypeOf?Object.getPrototypeOf:function(ji){return ji.__proto__||Object.getPrototypeOf(ji)},Pi(zi)}function $i(zi,Li){var ji="data-clipboard-".concat(zi);if(Li.hasAttribute(ji))return Li.getAttribute(ji)}var mn=function(zi){gn(ji,zi);var Li=vn(ji);function ji(Ji,Vi){var Ii;return bn(this,ji),Ii=Li.call(this),Ii.resolveOptions(Vi),Ii.listenClick(Ji),Ii}return pn(ji,[{key:"resolveOptions",value:function(){var Vi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof Vi.action=="function"?Vi.action:this.defaultAction,this.target=typeof Vi.target=="function"?Vi.target:this.defaultTarget,this.text=typeof Vi.text=="function"?Vi.text:this.defaultText,this.container=an(Vi.container)==="object"?Vi.container:document.body}},{key:"listenClick",value:function(Vi){var Ii=this;this.listener=mi()(Vi,"click",function(Sn){return Ii.onClick(Sn)})}},{key:"onClick",value:function(Vi){var Ii=Vi.delegateTarget||Vi.currentTarget,Sn=this.action(Ii)||"copy",Yn=on({action:Sn,container:this.container,target:this.target(Ii),text:this.text(Ii)});this.emit(Yn?"success":"error",{action:Sn,text:Yn,trigger:Ii,clearSelection:function(){Ii&&Ii.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(Vi){return $i("action",Vi)}},{key:"defaultTarget",value:function(Vi){var Ii=$i("target",Vi);if(Ii)return document.querySelector(Ii)}},{key:"defaultText",value:function(Vi){return $i("text",Vi)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(Vi){var Ii=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return rn(Vi,Ii)}},{key:"cut",value:function(Vi){return ki(Vi)}},{key:"isSupported",value:function(){var Vi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Ii=typeof Vi=="string"?[Vi]:Vi,Sn=!!document.queryCommandSupported;return Ii.forEach(function(Yn){Sn=Sn&&!!document.queryCommandSupported(Yn)}),Sn}}]),ji}(li()),tn=mn},828:function(ni){var ri=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var si=Element.prototype;si.matches=si.matchesSelector||si.mozMatchesSelector||si.msMatchesSelector||si.oMatchesSelector||si.webkitMatchesSelector}function ai(li,di){for(;li&&li.nodeType!==ri;){if(typeof li.matches=="function"&&li.matches(di))return li;li=li.parentNode}}ni.exports=ai},438:function(ni,ri,si){var ai=si(828);function li(hi,_i,Ei,Ai,ki){var Ti=mi.apply(this,arguments);return hi.addEventListener(Ei,Ti,ki),{destroy:function(){hi.removeEventListener(Ei,Ti,ki)}}}function di(hi,_i,Ei,Ai,ki){return typeof hi.addEventListener=="function"?li.apply(null,arguments):typeof Ei=="function"?li.bind(null,document).apply(null,arguments):(typeof hi=="string"&&(hi=document.querySelectorAll(hi)),Array.prototype.map.call(hi,function(Ti){return li(Ti,_i,Ei,Ai,ki)}))}function mi(hi,_i,Ei,Ai){return function(ki){ki.delegateTarget=ai(ki.target,_i),ki.delegateTarget&&Ai.call(hi,ki)}}ni.exports=di},879:function(ni,ri){ri.node=function(si){return si!==void 0&&si instanceof HTMLElement&&si.nodeType===1},ri.nodeList=function(si){var ai=Object.prototype.toString.call(si);return si!==void 0&&(ai==="[object NodeList]"||ai==="[object HTMLCollection]")&&"length"in si&&(si.length===0||ri.node(si[0]))},ri.string=function(si){return typeof si=="string"||si instanceof String},ri.fn=function(si){var ai=Object.prototype.toString.call(si);return ai==="[object Function]"}},370:function(ni,ri,si){var ai=si(879),li=si(438);function di(Ei,Ai,ki){if(!Ei&&!Ai&&!ki)throw new Error("Missing required arguments");if(!ai.string(Ai))throw new TypeError("Second argument must be a String");if(!ai.fn(ki))throw new TypeError("Third argument must be a Function");if(ai.node(Ei))return mi(Ei,Ai,ki);if(ai.nodeList(Ei))return hi(Ei,Ai,ki);if(ai.string(Ei))return _i(Ei,Ai,ki);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function mi(Ei,Ai,ki){return Ei.addEventListener(Ai,ki),{destroy:function(){Ei.removeEventListener(Ai,ki)}}}function hi(Ei,Ai,ki){return Array.prototype.forEach.call(Ei,function(Ti){Ti.addEventListener(Ai,ki)}),{destroy:function(){Array.prototype.forEach.call(Ei,function(Ti){Ti.removeEventListener(Ai,ki)})}}}function _i(Ei,Ai,ki){return li(document.body,Ei,Ai,ki)}ni.exports=di},817:function(ni){function ri(si){var ai;if(si.nodeName==="SELECT")si.focus(),ai=si.value;else if(si.nodeName==="INPUT"||si.nodeName==="TEXTAREA"){var li=si.hasAttribute("readonly");li||si.setAttribute("readonly",""),si.select(),si.setSelectionRange(0,si.value.length),li||si.removeAttribute("readonly"),ai=si.value}else{si.hasAttribute("contenteditable")&&si.focus();var di=window.getSelection(),mi=document.createRange();mi.selectNodeContents(si),di.removeAllRanges(),di.addRange(mi),ai=di.toString()}return ai}ni.exports=ri},279:function(ni){function ri(){}ri.prototype={on:function(si,ai,li){var di=this.e||(this.e={});return(di[si]||(di[si]=[])).push({fn:ai,ctx:li}),this},once:function(si,ai,li){var di=this;function mi(){di.off(si,mi),ai.apply(li,arguments)}return mi._=ai,this.on(si,mi,li)},emit:function(si){var ai=[].slice.call(arguments,1),li=((this.e||(this.e={}))[si]||[]).slice(),di=0,mi=li.length;for(di;di<mi;di++)li[di].fn.apply(li[di].ctx,ai);return this},off:function(si,ai){var li=this.e||(this.e={}),di=li[si],mi=[];if(di&&ai)for(var hi=0,_i=di.length;hi<_i;hi++)di[hi].fn!==ai&&di[hi].fn._!==ai&&mi.push(di[hi]);return mi.length?li[si]=mi:delete li[si],this}},ni.exports=ri,ni.exports.TinyEmitter=ri}},ti={};function ei(ni){if(ti[ni])return ti[ni].exports;var ri=ti[ni]={exports:{}};return ii[ni](ri,ri.exports,ei),ri.exports}return function(){ei.n=function(ni){var ri=ni&&ni.__esModule?function(){return ni.default}:function(){return ni};return ei.d(ri,{a:ri}),ri}}(),function(){ei.d=function(ni,ri){for(var si in ri)ei.o(ri,si)&&!ei.o(ni,si)&&Object.defineProperty(ni,si,{enumerable:!0,get:ri[si]})}}(),function(){ei.o=function(ni,ri){return Object.prototype.hasOwnProperty.call(ni,ri)}}(),ei(686)}().default})});var nl={};hu(nl,{afterMain:()=>_u,afterRead:()=>gu,afterWrite:()=>wu,applyStyles:()=>Vo,arrow:()=>Ka,auto:()=>ga,basePlacements:()=>Ns,beforeMain:()=>vu,beforeRead:()=>pu,beforeWrite:()=>bu,bottom:()=>Xn,clippingParents:()=>ic,computeStyles:()=>Wo,createPopper:()=>Sa,createPopperBase:()=>Mu,createPopperLite:()=>ku,detectOverflow:()=>rs,end:()=>Xs,eventListeners:()=>Uo,flip:()=>Za,hide:()=>el,left:()=>Wn,main:()=>yu,modifierPhases:()=>rc,offset:()=>tl,placements:()=>ya,popper:()=>go,popperGenerator:()=>To,popperOffsets:()=>Ko,preventOverflow:()=>il,read:()=>mu,reference:()=>nc,right:()=>Kn,start:()=>Ls,top:()=>Vn,variationPlacements:()=>Ga,viewport:()=>va,write:()=>Eu});var Vn="top",Xn="bottom",Kn="right",Wn="left",ga="auto",Ns=[Vn,Xn,Kn,Wn],Ls="start",Xs="end",ic="clippingParents",va="viewport",go="popper",nc="reference",Ga=Ns.reduce(function(ii,ti){return ii.concat([ti+"-"+Ls,ti+"-"+Xs])},[]),ya=[].concat(Ns,[ga]).reduce(function(ii,ti){return ii.concat([ti,ti+"-"+Ls,ti+"-"+Xs])},[]),pu="beforeRead",mu="read",gu="afterRead",vu="beforeMain",yu="main",_u="afterMain",bu="beforeWrite",Eu="write",wu="afterWrite",rc=[pu,mu,gu,vu,yu,_u,bu,Eu,wu];function Yr(ii){return ii?(ii.nodeName||"").toLowerCase():null}function $n(ii){if(ii==null)return window;if(ii.toString()!=="[object Window]"){var ti=ii.ownerDocument;return ti&&ti.defaultView||window}return ii}function vs(ii){var ti=$n(ii).Element;return ii instanceof ti||ii instanceof Element}function Wr(ii){var ti=$n(ii).HTMLElement;return ii instanceof ti||ii instanceof HTMLElement}function jo(ii){if(typeof ShadowRoot=="undefined")return!1;var ti=$n(ii).ShadowRoot;return ii instanceof ti||ii instanceof ShadowRoot}function dh(ii){var ti=ii.state;Object.keys(ti.elements).forEach(function(ei){var ni=ti.styles[ei]||{},ri=ti.attributes[ei]||{},si=ti.elements[ei];!Wr(si)||!Yr(si)||(Object.assign(si.style,ni),Object.keys(ri).forEach(function(ai){var li=ri[ai];li===!1?si.removeAttribute(ai):si.setAttribute(ai,li===!0?"":li)}))})}function fh(ii){var ti=ii.state,ei={popper:{position:ti.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(ti.elements.popper.style,ei.popper),ti.styles=ei,ti.elements.arrow&&Object.assign(ti.elements.arrow.style,ei.arrow),function(){Object.keys(ti.elements).forEach(function(ni){var ri=ti.elements[ni],si=ti.attributes[ni]||{},ai=Object.keys(ti.styles.hasOwnProperty(ni)?ti.styles[ni]:ei[ni]),li=ai.reduce(function(di,mi){return di[mi]="",di},{});!Wr(ri)||!Yr(ri)||(Object.assign(ri.style,li),Object.keys(si).forEach(function(di){ri.removeAttribute(di)}))})}}var Vo={name:"applyStyles",enabled:!0,phase:"write",fn:dh,effect:fh,requires:["computeStyles"]};function Gr(ii){return ii.split("-")[0]}var As=Math.max,vo=Math.min,Is=Math.round;function qo(){var ii=navigator.userAgentData;return ii!=null&&ii.brands&&Array.isArray(ii.brands)?ii.brands.map(function(ti){return ti.brand+"/"+ti.version}).join(" "):navigator.userAgent}function _a(){return!/^((?!chrome|android).)*safari/i.test(qo())}function ys(ii,ti,ei){ti===void 0&&(ti=!1),ei===void 0&&(ei=!1);var ni=ii.getBoundingClientRect(),ri=1,si=1;ti&&Wr(ii)&&(ri=ii.offsetWidth>0&&Is(ni.width)/ii.offsetWidth||1,si=ii.offsetHeight>0&&Is(ni.height)/ii.offsetHeight||1);var ai=vs(ii)?$n(ii):window,li=ai.visualViewport,di=!_a()&&ei,mi=(ni.left+(di&&li?li.offsetLeft:0))/ri,hi=(ni.top+(di&&li?li.offsetTop:0))/si,_i=ni.width/ri,Ei=ni.height/si;return{width:_i,height:Ei,top:hi,right:mi+_i,bottom:hi+Ei,left:mi,x:mi,y:hi}}function yo(ii){var ti=ys(ii),ei=ii.offsetWidth,ni=ii.offsetHeight;return Math.abs(ti.width-ei)<=1&&(ei=ti.width),Math.abs(ti.height-ni)<=1&&(ni=ti.height),{x:ii.offsetLeft,y:ii.offsetTop,width:ei,height:ni}}function ba(ii,ti){var ei=ti.getRootNode&&ti.getRootNode();if(ii.contains(ti))return!0;if(ei&&jo(ei)){var ni=ti;do{if(ni&&ii.isSameNode(ni))return!0;ni=ni.parentNode||ni.host}while(ni)}return!1}function ns(ii){return $n(ii).getComputedStyle(ii)}function sc(ii){return["table","td","th"].indexOf(Yr(ii))>=0}function Qr(ii){return((vs(ii)?ii.ownerDocument:ii.document)||window.document).documentElement}function Rs(ii){return Yr(ii)==="html"?ii:ii.assignedSlot||ii.parentNode||(jo(ii)?ii.host:null)||Qr(ii)}function xu(ii){return!Wr(ii)||ns(ii).position==="fixed"?null:ii.offsetParent}function hh(ii){var ti=/firefox/i.test(qo()),ei=/Trident/i.test(qo());if(ei&&Wr(ii)){var ni=ns(ii);if(ni.position==="fixed")return null}var ri=Rs(ii);for(jo(ri)&&(ri=ri.host);Wr(ri)&&["html","body"].indexOf(Yr(ri))<0;){var si=ns(ri);if(si.transform!=="none"||si.perspective!=="none"||si.contain==="paint"||["transform","perspective"].indexOf(si.willChange)!==-1||ti&&si.willChange==="filter"||ti&&si.filter&&si.filter!=="none")return ri;ri=ri.parentNode}return null}function Ds(ii){for(var ti=$n(ii),ei=xu(ii);ei&&sc(ei)&&ns(ei).position==="static";)ei=xu(ei);return ei&&(Yr(ei)==="html"||Yr(ei)==="body"&&ns(ei).position==="static")?ti:ei||hh(ii)||ti}function _o(ii){return["top","bottom"].indexOf(ii)>=0?"x":"y"}function bo(ii,ti,ei){return As(ii,vo(ti,ei))}function Tu(ii,ti,ei){var ni=bo(ii,ti,ei);return ni>ei?ei:ni}function Ea(){return{top:0,right:0,bottom:0,left:0}}function wa(ii){return Object.assign({},Ea(),ii)}function xa(ii,ti){return ti.reduce(function(ei,ni){return ei[ni]=ii,ei},{})}var ph=function(ti,ei){return ti=typeof ti=="function"?ti(Object.assign({},ei.rects,{placement:ei.placement})):ti,wa(typeof ti!="number"?ti:xa(ti,Ns))};function mh(ii){var ti,ei=ii.state,ni=ii.name,ri=ii.options,si=ei.elements.arrow,ai=ei.modifiersData.popperOffsets,li=Gr(ei.placement),di=_o(li),mi=[Wn,Kn].indexOf(li)>=0,hi=mi?"height":"width";if(!(!si||!ai)){var _i=ph(ri.padding,ei),Ei=yo(si),Ai=di==="y"?Vn:Wn,ki=di==="y"?Xn:Kn,Ti=ei.rects.reference[hi]+ei.rects.reference[di]-ai[di]-ei.rects.popper[hi],Fi=ai[di]-ei.rects.reference[di],en=Ds(si),rn=en?di==="y"?en.clientHeight||0:en.clientWidth||0:0,ln=Ti/2-Fi/2,Yi=_i[Ai],on=rn-Ei[hi]-_i[ki],an=rn/2-Ei[hi]/2+ln,bn=bo(Yi,an,on),hn=di;ei.modifiersData[ni]=(ti={},ti[hn]=bn,ti.centerOffset=bn-an,ti)}}function gh(ii){var ti=ii.state,ei=ii.options,ni=ei.element,ri=ni===void 0?"[data-popper-arrow]":ni;ri!=null&&(typeof ri=="string"&&(ri=ti.elements.popper.querySelector(ri),!ri)||ba(ti.elements.popper,ri)&&(ti.elements.arrow=ri))}var Ka={name:"arrow",enabled:!0,phase:"main",fn:mh,effect:gh,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _s(ii){return ii.split("-")[1]}var vh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yh(ii,ti){var ei=ii.x,ni=ii.y,ri=ti.devicePixelRatio||1;return{x:Is(ei*ri)/ri||0,y:Is(ni*ri)/ri||0}}function Su(ii){var ti,ei=ii.popper,ni=ii.popperRect,ri=ii.placement,si=ii.variation,ai=ii.offsets,li=ii.position,di=ii.gpuAcceleration,mi=ii.adaptive,hi=ii.roundOffsets,_i=ii.isFixed,Ei=ai.x,Ai=Ei===void 0?0:Ei,ki=ai.y,Ti=ki===void 0?0:ki,Fi=typeof hi=="function"?hi({x:Ai,y:Ti}):{x:Ai,y:Ti};Ai=Fi.x,Ti=Fi.y;var en=ai.hasOwnProperty("x"),rn=ai.hasOwnProperty("y"),ln=Wn,Yi=Vn,on=window;if(mi){var an=Ds(ei),bn="clientHeight",hn="clientWidth";if(an===$n(ei)&&(an=Qr(ei),ns(an).position!=="static"&&li==="absolute"&&(bn="scrollHeight",hn="scrollWidth")),an=an,ri===Vn||(ri===Wn||ri===Kn)&&si===Xs){Yi=Xn;var pn=_i&&an===on&&on.visualViewport?on.visualViewport.height:an[bn];Ti-=pn-ni.height,Ti*=di?1:-1}if(ri===Wn||(ri===Vn||ri===Xn)&&si===Xs){ln=Kn;var gn=_i&&an===on&&on.visualViewport?on.visualViewport.width:an[hn];Ai-=gn-ni.width,Ai*=di?1:-1}}var un=Object.assign({position:li},mi&&vh),vn=hi===!0?yh({x:Ai,y:Ti},$n(ei)):{x:Ai,y:Ti};if(Ai=vn.x,Ti=vn.y,di){var Tn;return Object.assign({},un,(Tn={},Tn[Yi]=rn?"0":"",Tn[ln]=en?"0":"",Tn.transform=(on.devicePixelRatio||1)<=1?"translate("+Ai+"px, "+Ti+"px)":"translate3d("+Ai+"px, "+Ti+"px, 0)",Tn))}return Object.assign({},un,(ti={},ti[Yi]=rn?Ti+"px":"",ti[ln]=en?Ai+"px":"",ti.transform="",ti))}function _h(ii){var ti=ii.state,ei=ii.options,ni=ei.gpuAcceleration,ri=ni===void 0?!0:ni,si=ei.adaptive,ai=si===void 0?!0:si,li=ei.roundOffsets,di=li===void 0?!0:li,mi={placement:Gr(ti.placement),variation:_s(ti.placement),popper:ti.elements.popper,popperRect:ti.rects.popper,gpuAcceleration:ri,isFixed:ti.options.strategy==="fixed"};ti.modifiersData.popperOffsets!=null&&(ti.styles.popper=Object.assign({},ti.styles.popper,Su(Object.assign({},mi,{offsets:ti.modifiersData.popperOffsets,position:ti.options.strategy,adaptive:ai,roundOffsets:di})))),ti.modifiersData.arrow!=null&&(ti.styles.arrow=Object.assign({},ti.styles.arrow,Su(Object.assign({},mi,{offsets:ti.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:di})))),ti.attributes.popper=Object.assign({},ti.attributes.popper,{"data-popper-placement":ti.placement})}var Wo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_h,data:{}};var Qa={passive:!0};function bh(ii){var ti=ii.state,ei=ii.instance,ni=ii.options,ri=ni.scroll,si=ri===void 0?!0:ri,ai=ni.resize,li=ai===void 0?!0:ai,di=$n(ti.elements.popper),mi=[].concat(ti.scrollParents.reference,ti.scrollParents.popper);return si&&mi.forEach(function(hi){hi.addEventListener("scroll",ei.update,Qa)}),li&&di.addEventListener("resize",ei.update,Qa),function(){si&&mi.forEach(function(hi){hi.removeEventListener("scroll",ei.update,Qa)}),li&&di.removeEventListener("resize",ei.update,Qa)}}var Uo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:bh,data:{}};var Eh={left:"right",right:"left",bottom:"top",top:"bottom"};function Yo(ii){return ii.replace(/left|right|bottom|top/g,function(ti){return Eh[ti]})}var wh={start:"end",end:"start"};function Xa(ii){return ii.replace(/start|end/g,function(ti){return wh[ti]})}function Eo(ii){var ti=$n(ii),ei=ti.pageXOffset,ni=ti.pageYOffset;return{scrollLeft:ei,scrollTop:ni}}function wo(ii){return ys(Qr(ii)).left+Eo(ii).scrollLeft}function oc(ii,ti){var ei=$n(ii),ni=Qr(ii),ri=ei.visualViewport,si=ni.clientWidth,ai=ni.clientHeight,li=0,di=0;if(ri){si=ri.width,ai=ri.height;var mi=_a();(mi||!mi&&ti==="fixed")&&(li=ri.offsetLeft,di=ri.offsetTop)}return{width:si,height:ai,x:li+wo(ii),y:di}}function ac(ii){var ti,ei=Qr(ii),ni=Eo(ii),ri=(ti=ii.ownerDocument)==null?void 0:ti.body,si=As(ei.scrollWidth,ei.clientWidth,ri?ri.scrollWidth:0,ri?ri.clientWidth:0),ai=As(ei.scrollHeight,ei.clientHeight,ri?ri.scrollHeight:0,ri?ri.clientHeight:0),li=-ni.scrollLeft+wo(ii),di=-ni.scrollTop;return ns(ri||ei).direction==="rtl"&&(li+=As(ei.clientWidth,ri?ri.clientWidth:0)-si),{width:si,height:ai,x:li,y:di}}function xo(ii){var ti=ns(ii),ei=ti.overflow,ni=ti.overflowX,ri=ti.overflowY;return/auto|scroll|overlay|hidden/.test(ei+ri+ni)}function Ja(ii){return["html","body","#document"].indexOf(Yr(ii))>=0?ii.ownerDocument.body:Wr(ii)&&xo(ii)?ii:Ja(Rs(ii))}function Js(ii,ti){var ei;ti===void 0&&(ti=[]);var ni=Ja(ii),ri=ni===((ei=ii.ownerDocument)==null?void 0:ei.body),si=$n(ni),ai=ri?[si].concat(si.visualViewport||[],xo(ni)?ni:[]):ni,li=ti.concat(ai);return ri?li:li.concat(Js(Rs(ai)))}function Go(ii){return Object.assign({},ii,{left:ii.x,top:ii.y,right:ii.x+ii.width,bottom:ii.y+ii.height})}function xh(ii,ti){var ei=ys(ii,!1,ti==="fixed");return ei.top=ei.top+ii.clientTop,ei.left=ei.left+ii.clientLeft,ei.bottom=ei.top+ii.clientHeight,ei.right=ei.left+ii.clientWidth,ei.width=ii.clientWidth,ei.height=ii.clientHeight,ei.x=ei.left,ei.y=ei.top,ei}function Cu(ii,ti,ei){return ti===va?Go(oc(ii,ei)):vs(ti)?xh(ti,ei):Go(ac(Qr(ii)))}function Th(ii){var ti=Js(Rs(ii)),ei=["absolute","fixed"].indexOf(ns(ii).position)>=0,ni=ei&&Wr(ii)?Ds(ii):ii;return vs(ni)?ti.filter(function(ri){return vs(ri)&&ba(ri,ni)&&Yr(ri)!=="body"}):[]}function lc(ii,ti,ei,ni){var ri=ti==="clippingParents"?Th(ii):[].concat(ti),si=[].concat(ri,[ei]),ai=si[0],li=si.reduce(function(di,mi){var hi=Cu(ii,mi,ni);return di.top=As(hi.top,di.top),di.right=vo(hi.right,di.right),di.bottom=vo(hi.bottom,di.bottom),di.left=As(hi.left,di.left),di},Cu(ii,ai,ni));return li.width=li.right-li.left,li.height=li.bottom-li.top,li.x=li.left,li.y=li.top,li}function Ta(ii){var ti=ii.reference,ei=ii.element,ni=ii.placement,ri=ni?Gr(ni):null,si=ni?_s(ni):null,ai=ti.x+ti.width/2-ei.width/2,li=ti.y+ti.height/2-ei.height/2,di;switch(ri){case Vn:di={x:ai,y:ti.y-ei.height};break;case Xn:di={x:ai,y:ti.y+ti.height};break;case Kn:di={x:ti.x+ti.width,y:li};break;case Wn:di={x:ti.x-ei.width,y:li};break;default:di={x:ti.x,y:ti.y}}var mi=ri?_o(ri):null;if(mi!=null){var hi=mi==="y"?"height":"width";switch(si){case Ls:di[mi]=di[mi]-(ti[hi]/2-ei[hi]/2);break;case Xs:di[mi]=di[mi]+(ti[hi]/2-ei[hi]/2);break;default:}}return di}function rs(ii,ti){ti===void 0&&(ti={});var ei=ti,ni=ei.placement,ri=ni===void 0?ii.placement:ni,si=ei.strategy,ai=si===void 0?ii.strategy:si,li=ei.boundary,di=li===void 0?ic:li,mi=ei.rootBoundary,hi=mi===void 0?va:mi,_i=ei.elementContext,Ei=_i===void 0?go:_i,Ai=ei.altBoundary,ki=Ai===void 0?!1:Ai,Ti=ei.padding,Fi=Ti===void 0?0:Ti,en=wa(typeof Fi!="number"?Fi:xa(Fi,Ns)),rn=Ei===go?nc:go,ln=ii.rects.popper,Yi=ii.elements[ki?rn:Ei],on=lc(vs(Yi)?Yi:Yi.contextElement||Qr(ii.elements.popper),di,hi,ai),an=ys(ii.elements.reference),bn=Ta({reference:an,element:ln,strategy:"absolute",placement:ri}),hn=Go(Object.assign({},ln,bn)),pn=Ei===go?hn:an,gn={top:on.top-pn.top+en.top,bottom:pn.bottom-on.bottom+en.bottom,left:on.left-pn.left+en.left,right:pn.right-on.right+en.right},un=ii.modifiersData.offset;if(Ei===go&&un){var vn=un[ri];Object.keys(gn).forEach(function(Tn){var Ni=[Kn,Xn].indexOf(Tn)>=0?1:-1,Hi=[Vn,Xn].indexOf(Tn)>=0?"y":"x";gn[Tn]+=vn[Hi]*Ni})}return gn}function cc(ii,ti){ti===void 0&&(ti={});var ei=ti,ni=ei.placement,ri=ei.boundary,si=ei.rootBoundary,ai=ei.padding,li=ei.flipVariations,di=ei.allowedAutoPlacements,mi=di===void 0?ya:di,hi=_s(ni),_i=hi?li?Ga:Ga.filter(function(ki){return _s(ki)===hi}):Ns,Ei=_i.filter(function(ki){return mi.indexOf(ki)>=0});Ei.length===0&&(Ei=_i);var Ai=Ei.reduce(function(ki,Ti){return ki[Ti]=rs(ii,{placement:Ti,boundary:ri,rootBoundary:si,padding:ai})[Gr(Ti)],ki},{});return Object.keys(Ai).sort(function(ki,Ti){return Ai[ki]-Ai[Ti]})}function Sh(ii){if(Gr(ii)===ga)return[];var ti=Yo(ii);return[Xa(ii),ti,Xa(ti)]}function Ch(ii){var ti=ii.state,ei=ii.options,ni=ii.name;if(!ti.modifiersData[ni]._skip){for(var ri=ei.mainAxis,si=ri===void 0?!0:ri,ai=ei.altAxis,li=ai===void 0?!0:ai,di=ei.fallbackPlacements,mi=ei.padding,hi=ei.boundary,_i=ei.rootBoundary,Ei=ei.altBoundary,Ai=ei.flipVariations,ki=Ai===void 0?!0:Ai,Ti=ei.allowedAutoPlacements,Fi=ti.options.placement,en=Gr(Fi),rn=en===Fi,ln=di||(rn||!ki?[Yo(Fi)]:Sh(Fi)),Yi=[Fi].concat(ln).reduce(function(Vi,Ii){return Vi.concat(Gr(Ii)===ga?cc(ti,{placement:Ii,boundary:hi,rootBoundary:_i,padding:mi,flipVariations:ki,allowedAutoPlacements:Ti}):Ii)},[]),on=ti.rects.reference,an=ti.rects.popper,bn=new Map,hn=!0,pn=Yi[0],gn=0;gn<Yi.length;gn++){var un=Yi[gn],vn=Gr(un),Tn=_s(un)===Ls,Ni=[Vn,Xn].indexOf(vn)>=0,Hi=Ni?"width":"height",Pi=rs(ti,{placement:un,boundary:hi,rootBoundary:_i,altBoundary:Ei,padding:mi}),$i=Ni?Tn?Kn:Wn:Tn?Xn:Vn;on[Hi]>an[Hi]&&($i=Yo($i));var mn=Yo($i),tn=[];if(si&&tn.push(Pi[vn]<=0),li&&tn.push(Pi[$i]<=0,Pi[mn]<=0),tn.every(function(Vi){return Vi})){pn=un,hn=!1;break}bn.set(un,tn)}if(hn)for(var zi=ki?3:1,Li=function(Ii){var Sn=Yi.find(function(Yn){var Fn=bn.get(Yn);if(Fn)return Fn.slice(0,Ii).every(function(Bn){return Bn})});if(Sn)return pn=Sn,"break"},ji=zi;ji>0;ji--){var Ji=Li(ji);if(Ji==="break")break}ti.placement!==pn&&(ti.modifiersData[ni]._skip=!0,ti.placement=pn,ti.reset=!0)}}var Za={name:"flip",enabled:!0,phase:"main",fn:Ch,requiresIfExists:["offset"],data:{_skip:!1}};function Au(ii,ti,ei){return ei===void 0&&(ei={x:0,y:0}),{top:ii.top-ti.height-ei.y,right:ii.right-ti.width+ei.x,bottom:ii.bottom-ti.height+ei.y,left:ii.left-ti.width-ei.x}}function Du(ii){return[Vn,Kn,Xn,Wn].some(function(ti){return ii[ti]>=0})}function Ah(ii){var ti=ii.state,ei=ii.name,ni=ti.rects.reference,ri=ti.rects.popper,si=ti.modifiersData.preventOverflow,ai=rs(ti,{elementContext:"reference"}),li=rs(ti,{altBoundary:!0}),di=Au(ai,ni),mi=Au(li,ri,si),hi=Du(di),_i=Du(mi);ti.modifiersData[ei]={referenceClippingOffsets:di,popperEscapeOffsets:mi,isReferenceHidden:hi,hasPopperEscaped:_i},ti.attributes.popper=Object.assign({},ti.attributes.popper,{"data-popper-reference-hidden":hi,"data-popper-escaped":_i})}var el={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ah};function Dh(ii,ti,ei){var ni=Gr(ii),ri=[Wn,Vn].indexOf(ni)>=0?-1:1,si=typeof ei=="function"?ei(Object.assign({},ti,{placement:ii})):ei,ai=si[0],li=si[1];return ai=ai||0,li=(li||0)*ri,[Wn,Kn].indexOf(ni)>=0?{x:li,y:ai}:{x:ai,y:li}}function Oh(ii){var ti=ii.state,ei=ii.options,ni=ii.name,ri=ei.offset,si=ri===void 0?[0,0]:ri,ai=ya.reduce(function(hi,_i){return hi[_i]=Dh(_i,ti.rects,si),hi},{}),li=ai[ti.placement],di=li.x,mi=li.y;ti.modifiersData.popperOffsets!=null&&(ti.modifiersData.popperOffsets.x+=di,ti.modifiersData.popperOffsets.y+=mi),ti.modifiersData[ni]=ai}var tl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Oh};function Lh(ii){var ti=ii.state,ei=ii.name;ti.modifiersData[ei]=Ta({reference:ti.rects.reference,element:ti.rects.popper,strategy:"absolute",placement:ti.placement})}var Ko={name:"popperOffsets",enabled:!0,phase:"read",fn:Lh,data:{}};function uc(ii){return ii==="x"?"y":"x"}function Mh(ii){var ti=ii.state,ei=ii.options,ni=ii.name,ri=ei.mainAxis,si=ri===void 0?!0:ri,ai=ei.altAxis,li=ai===void 0?!1:ai,di=ei.boundary,mi=ei.rootBoundary,hi=ei.altBoundary,_i=ei.padding,Ei=ei.tether,Ai=Ei===void 0?!0:Ei,ki=ei.tetherOffset,Ti=ki===void 0?0:ki,Fi=rs(ti,{boundary:di,rootBoundary:mi,padding:_i,altBoundary:hi}),en=Gr(ti.placement),rn=_s(ti.placement),ln=!rn,Yi=_o(en),on=uc(Yi),an=ti.modifiersData.popperOffsets,bn=ti.rects.reference,hn=ti.rects.popper,pn=typeof Ti=="function"?Ti(Object.assign({},ti.rects,{placement:ti.placement})):Ti,gn=typeof pn=="number"?{mainAxis:pn,altAxis:pn}:Object.assign({mainAxis:0,altAxis:0},pn),un=ti.modifiersData.offset?ti.modifiersData.offset[ti.placement]:null,vn={x:0,y:0};if(an){if(si){var Tn,Ni=Yi==="y"?Vn:Wn,Hi=Yi==="y"?Xn:Kn,Pi=Yi==="y"?"height":"width",$i=an[Yi],mn=$i+Fi[Ni],tn=$i-Fi[Hi],zi=Ai?-hn[Pi]/2:0,Li=rn===Ls?bn[Pi]:hn[Pi],ji=rn===Ls?-hn[Pi]:-bn[Pi],Ji=ti.elements.arrow,Vi=Ai&&Ji?yo(Ji):{width:0,height:0},Ii=ti.modifiersData["arrow#persistent"]?ti.modifiersData["arrow#persistent"].padding:Ea(),Sn=Ii[Ni],Yn=Ii[Hi],Fn=bo(0,bn[Pi],Vi[Pi]),Bn=ln?bn[Pi]/2-zi-Fn-Sn-gn.mainAxis:Li-Fn-Sn-gn.mainAxis,Gn=ln?-bn[Pi]/2+zi+Fn+Yn+gn.mainAxis:ji+Fn+Yn+gn.mainAxis,Qn=ti.elements.arrow&&Ds(ti.elements.arrow),Ts=Qn?Yi==="y"?Qn.clientTop||0:Qn.clientLeft||0:0,zn=(Tn=un==null?void 0:un[Yi])!=null?Tn:0,hs=$i+Bn-zn-Ts,ms=$i+Gn-zn,qs=bo(Ai?vo(mn,hs):mn,$i,Ai?As(tn,ms):tn);an[Yi]=qs,vn[Yi]=qs-$i}if(li){var qn,yn=Yi==="x"?Vn:Wn,Kr=Yi==="x"?Xn:Kn,as=an[on],Ws=on==="y"?"height":"width",po=as+Fi[yn],Us=as-Fi[Kr],Ms=[Vn,Wn].indexOf(en)!==-1,Ss=(qn=un==null?void 0:un[on])!=null?qn:0,Ro=Ms?po:as-bn[Ws]-hn[Ws]-Ss+gn.altAxis,Ys=Ms?as+bn[Ws]+hn[Ws]-Ss-gn.altAxis:Us,Po=Ai&&Ms?Tu(Ro,as,Ys):bo(Ai?Ro:po,as,Ai?Ys:Us);an[on]=Po,vn[on]=Po-as}ti.modifiersData[ni]=vn}}var il={name:"preventOverflow",enabled:!0,phase:"main",fn:Mh,requiresIfExists:["offset"]};function dc(ii){return{scrollLeft:ii.scrollLeft,scrollTop:ii.scrollTop}}function fc(ii){return ii===$n(ii)||!Wr(ii)?Eo(ii):dc(ii)}function kh(ii){var ti=ii.getBoundingClientRect(),ei=Is(ti.width)/ii.offsetWidth||1,ni=Is(ti.height)/ii.offsetHeight||1;return ei!==1||ni!==1}function hc(ii,ti,ei){ei===void 0&&(ei=!1);var ni=Wr(ti),ri=Wr(ti)&&kh(ti),si=Qr(ti),ai=ys(ii,ri,ei),li={scrollLeft:0,scrollTop:0},di={x:0,y:0};return(ni||!ni&&!ei)&&((Yr(ti)!=="body"||xo(si))&&(li=fc(ti)),Wr(ti)?(di=ys(ti,!0),di.x+=ti.clientLeft,di.y+=ti.clientTop):si&&(di.x=wo(si))),{x:ai.left+li.scrollLeft-di.x,y:ai.top+li.scrollTop-di.y,width:ai.width,height:ai.height}}function Nh(ii){var ti=new Map,ei=new Set,ni=[];ii.forEach(function(si){ti.set(si.name,si)});function ri(si){ei.add(si.name);var ai=[].concat(si.requires||[],si.requiresIfExists||[]);ai.forEach(function(li){if(!ei.has(li)){var di=ti.get(li);di&&ri(di)}}),ni.push(si)}return ii.forEach(function(si){ei.has(si.name)||ri(si)}),ni}function pc(ii){var ti=Nh(ii);return rc.reduce(function(ei,ni){return ei.concat(ti.filter(function(ri){return ri.phase===ni}))},[])}function mc(ii){var ti;return function(){return ti||(ti=new Promise(function(ei){Promise.resolve().then(function(){ti=void 0,ei(ii())})})),ti}}function gc(ii){var ti=ii.reduce(function(ei,ni){var ri=ei[ni.name];return ei[ni.name]=ri?Object.assign({},ri,ni,{options:Object.assign({},ri.options,ni.options),data:Object.assign({},ri.data,ni.data)}):ni,ei},{});return Object.keys(ti).map(function(ei){return ti[ei]})}var Ou={placement:"bottom",modifiers:[],strategy:"absolute"};function Lu(){for(var ii=arguments.length,ti=new Array(ii),ei=0;ei<ii;ei++)ti[ei]=arguments[ei];return!ti.some(function(ni){return!(ni&&typeof ni.getBoundingClientRect=="function")})}function To(ii){ii===void 0&&(ii={});var ti=ii,ei=ti.defaultModifiers,ni=ei===void 0?[]:ei,ri=ti.defaultOptions,si=ri===void 0?Ou:ri;return function(li,di,mi){mi===void 0&&(mi=si);var hi={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ou,si),modifiersData:{},elements:{reference:li,popper:di},attributes:{},styles:{}},_i=[],Ei=!1,Ai={state:hi,setOptions:function(en){var rn=typeof en=="function"?en(hi.options):en;Ti(),hi.options=Object.assign({},si,hi.options,rn),hi.scrollParents={reference:vs(li)?Js(li):li.contextElement?Js(li.contextElement):[],popper:Js(di)};var ln=pc(gc([].concat(ni,hi.options.modifiers)));return hi.orderedModifiers=ln.filter(function(Yi){return Yi.enabled}),ki(),Ai.update()},forceUpdate:function(){if(!Ei){var en=hi.elements,rn=en.reference,ln=en.popper;if(Lu(rn,ln)){hi.rects={reference:hc(rn,Ds(ln),hi.options.strategy==="fixed"),popper:yo(ln)},hi.reset=!1,hi.placement=hi.options.placement,hi.orderedModifiers.forEach(function(gn){return hi.modifiersData[gn.name]=Object.assign({},gn.data)});for(var Yi=0;Yi<hi.orderedModifiers.length;Yi++){if(hi.reset===!0){hi.reset=!1,Yi=-1;continue}var on=hi.orderedModifiers[Yi],an=on.fn,bn=on.options,hn=bn===void 0?{}:bn,pn=on.name;typeof an=="function"&&(hi=an({state:hi,options:hn,name:pn,instance:Ai})||hi)}}}},update:mc(function(){return new Promise(function(Fi){Ai.forceUpdate(),Fi(hi)})}),destroy:function(){Ti(),Ei=!0}};if(!Lu(li,di))return Ai;Ai.setOptions(mi).then(function(Fi){!Ei&&mi.onFirstUpdate&&mi.onFirstUpdate(Fi)});function ki(){hi.orderedModifiers.forEach(function(Fi){var en=Fi.name,rn=Fi.options,ln=rn===void 0?{}:rn,Yi=Fi.effect;if(typeof Yi=="function"){var on=Yi({state:hi,name:en,instance:Ai,options:ln}),an=function(){};_i.push(on||an)}})}function Ti(){_i.forEach(function(Fi){return Fi()}),_i=[]}return Ai}}var Mu=To();var Ih=[Uo,Ko,Wo,Vo],ku=To({defaultModifiers:Ih});var Rh=[Uo,Ko,Wo,Vo,tl,Za,il,Ka,el],Sa=To({defaultModifiers:Rh});var Zs=new Map,vc={set(ii,ti,ei){Zs.has(ii)||Zs.set(ii,new Map);let ni=Zs.get(ii);if(!ni.has(ti)&&ni.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(ni.keys())[0]}.`);return}ni.set(ti,ei)},get(ii,ti){return Zs.has(ii)&&Zs.get(ii).get(ti)||null},remove(ii,ti){if(!Zs.has(ii))return;let ei=Zs.get(ii);ei.delete(ti),ei.size===0&&Zs.delete(ii)}},Ph=1e6,Hh=1e3,kc="transitionend",ad=ii=>(ii&&window.CSS&&window.CSS.escape&&(ii=ii.replace(/#([^\s"#']+)/g,(ti,ei)=>`#${CSS.escape(ei)}`)),ii),Fh=ii=>ii==null?`${ii}`:Object.prototype.toString.call(ii).match(/\s([a-z]+)/i)[1].toLowerCase(),$h=ii=>{do ii+=Math.floor(Math.random()*Ph);while(document.getElementById(ii));return ii},Bh=ii=>{if(!ii)return 0;let{transitionDuration:ti,transitionDelay:ei}=window.getComputedStyle(ii),ni=Number.parseFloat(ti),ri=Number.parseFloat(ei);return!ni&&!ri?0:(ti=ti.split(",")[0],ei=ei.split(",")[0],(Number.parseFloat(ti)+Number.parseFloat(ei))*Hh)},ld=ii=>{ii.dispatchEvent(new Event(kc))},Ps=ii=>!ii||typeof ii!="object"?!1:(typeof ii.jquery!="undefined"&&(ii=ii[0]),typeof ii.nodeType!="undefined"),eo=ii=>Ps(ii)?ii.jquery?ii[0]:ii:typeof ii=="string"&&ii.length>0?document.querySelector(ad(ii)):null,ia=ii=>{if(!Ps(ii)||ii.getClientRects().length===0)return!1;let ti=getComputedStyle(ii).getPropertyValue("visibility")==="visible",ei=ii.closest("details:not([open])");if(!ei)return ti;if(ei!==ii){let ni=ii.closest("summary");if(ni&&ni.parentNode!==ei||ni===null)return!1}return ti},to=ii=>!ii||ii.nodeType!==Node.ELEMENT_NODE||ii.classList.contains("disabled")?!0:typeof ii.disabled!="undefined"?ii.disabled:ii.hasAttribute("disabled")&&ii.getAttribute("disabled")!=="false",cd=ii=>{if(!document.documentElement.attachShadow)return null;if(typeof ii.getRootNode=="function"){let ti=ii.getRootNode();return ti instanceof ShadowRoot?ti:null}return ii instanceof ShadowRoot?ii:ii.parentNode?cd(ii.parentNode):null},fl=()=>{},La=ii=>{ii.offsetHeight},ud=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,yc=[],zh=ii=>{document.readyState==="loading"?(yc.length||document.addEventListener("DOMContentLoaded",()=>{for(let ti of yc)ti()}),yc.push(ii)):ii()},bs=()=>document.documentElement.dir==="rtl",ws=ii=>{zh(()=>{let ti=ud();if(ti){let ei=ii.NAME,ni=ti.fn[ei];ti.fn[ei]=ii.jQueryInterface,ti.fn[ei].Constructor=ii,ti.fn[ei].noConflict=()=>(ti.fn[ei]=ni,ii.jQueryInterface)}})},ls=(ii,ti=[],ei=ii)=>typeof ii=="function"?ii(...ti):ei,dd=(ii,ti,ei=!0)=>{if(!ei){ls(ii);return}let ri=Bh(ti)+5,si=!1,ai=({target:li})=>{li===ti&&(si=!0,ti.removeEventListener(kc,ai),ls(ii))};ti.addEventListener(kc,ai),setTimeout(()=>{si||ld(ti)},ri)},Pc=(ii,ti,ei,ni)=>{let ri=ii.length,si=ii.indexOf(ti);return si===-1?!ei&&ni?ii[ri-1]:ii[0]:(si+=ei?1:-1,ni&&(si=(si+ri)%ri),ii[Math.max(0,Math.min(si,ri-1))])},jh=/[^.]*(?=\..*)\.|.*/,Vh=/\..*/,qh=/::\d+$/,_c={},Nu=1,fd={mouseenter:"mouseover",mouseleave:"mouseout"},Wh=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 hd(ii,ti){return ti&&`${ti}::${Nu++}`||ii.uidEvent||Nu++}function pd(ii){let ti=hd(ii);return ii.uidEvent=ti,_c[ti]=_c[ti]||{},_c[ti]}function Uh(ii,ti){return function ei(ni){return Hc(ni,{delegateTarget:ii}),ei.oneOff&&Mi.off(ii,ni.type,ti),ti.apply(ii,[ni])}}function Yh(ii,ti,ei){return function ni(ri){let si=ii.querySelectorAll(ti);for(let{target:ai}=ri;ai&&ai!==this;ai=ai.parentNode)for(let li of si)if(li===ai)return Hc(ri,{delegateTarget:ai}),ni.oneOff&&Mi.off(ii,ri.type,ti,ei),ei.apply(ai,[ri])}}function md(ii,ti,ei=null){return Object.values(ii).find(ni=>ni.callable===ti&&ni.delegationSelector===ei)}function gd(ii,ti,ei){let ni=typeof ti=="string",ri=ni?ei:ti||ei,si=vd(ii);return Wh.has(si)||(si=ii),[ni,ri,si]}function Iu(ii,ti,ei,ni,ri){if(typeof ti!="string"||!ii)return;let[si,ai,li]=gd(ti,ei,ni);ti in fd&&(ai=(ki=>function(Ti){if(!Ti.relatedTarget||Ti.relatedTarget!==Ti.delegateTarget&&!Ti.delegateTarget.contains(Ti.relatedTarget))return ki.call(this,Ti)})(ai));let di=pd(ii),mi=di[li]||(di[li]={}),hi=md(mi,ai,si?ei:null);if(hi){hi.oneOff=hi.oneOff&&ri;return}let _i=hd(ai,ti.replace(jh,"")),Ei=si?Yh(ii,ei,ai):Uh(ii,ai);Ei.delegationSelector=si?ei:null,Ei.callable=ai,Ei.oneOff=ri,Ei.uidEvent=_i,mi[_i]=Ei,ii.addEventListener(li,Ei,si)}function Nc(ii,ti,ei,ni,ri){let si=md(ti[ei],ni,ri);si&&(ii.removeEventListener(ei,si,!!ri),delete ti[ei][si.uidEvent])}function Gh(ii,ti,ei,ni){let ri=ti[ei]||{};for(let[si,ai]of Object.entries(ri))si.includes(ni)&&Nc(ii,ti,ei,ai.callable,ai.delegationSelector)}function vd(ii){return ii=ii.replace(Vh,""),fd[ii]||ii}var Mi={on(ii,ti,ei,ni){Iu(ii,ti,ei,ni,!1)},one(ii,ti,ei,ni){Iu(ii,ti,ei,ni,!0)},off(ii,ti,ei,ni){if(typeof ti!="string"||!ii)return;let[ri,si,ai]=gd(ti,ei,ni),li=ai!==ti,di=pd(ii),mi=di[ai]||{},hi=ti.startsWith(".");if(typeof si!="undefined"){if(!Object.keys(mi).length)return;Nc(ii,di,ai,si,ri?ei:null);return}if(hi)for(let _i of Object.keys(di))Gh(ii,di,_i,ti.slice(1));for(let[_i,Ei]of Object.entries(mi)){let Ai=_i.replace(qh,"");(!li||ti.includes(Ai))&&Nc(ii,di,ai,Ei.callable,Ei.delegationSelector)}},trigger(ii,ti,ei){if(typeof ti!="string"||!ii)return null;let ni=ud(),ri=vd(ti),si=ti!==ri,ai=null,li=!0,di=!0,mi=!1;si&&ni&&(ai=ni.Event(ti,ei),ni(ii).trigger(ai),li=!ai.isPropagationStopped(),di=!ai.isImmediatePropagationStopped(),mi=ai.isDefaultPrevented());let hi=Hc(new Event(ti,{bubbles:li,cancelable:!0}),ei);return mi&&hi.preventDefault(),di&&ii.dispatchEvent(hi),hi.defaultPrevented&&ai&&ai.preventDefault(),hi}};function Hc(ii,ti={}){for(let[ei,ni]of Object.entries(ti))try{ii[ei]=ni}catch(ri){Object.defineProperty(ii,ei,{configurable:!0,get(){return ni}})}return ii}function Ru(ii){if(ii==="true")return!0;if(ii==="false")return!1;if(ii===Number(ii).toString())return Number(ii);if(ii===""||ii==="null")return null;if(typeof ii!="string")return ii;try{return JSON.parse(decodeURIComponent(ii))}catch(ti){return ii}}function bc(ii){return ii.replace(/[A-Z]/g,ti=>`-${ti.toLowerCase()}`)}var Hs={setDataAttribute(ii,ti,ei){ii.setAttribute(`data-bs-${bc(ti)}`,ei)},removeDataAttribute(ii,ti){ii.removeAttribute(`data-bs-${bc(ti)}`)},getDataAttributes(ii){if(!ii)return{};let ti={},ei=Object.keys(ii.dataset).filter(ni=>ni.startsWith("bs")&&!ni.startsWith("bsConfig"));for(let ni of ei){let ri=ni.replace(/^bs/,"");ri=ri.charAt(0).toLowerCase()+ri.slice(1,ri.length),ti[ri]=Ru(ii.dataset[ni])}return ti},getDataAttribute(ii,ti){return Ru(ii.getAttribute(`data-bs-${bc(ti)}`))}},Ao=class{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(ti){return ti=this._mergeConfigObj(ti),ti=this._configAfterMerge(ti),this._typeCheckConfig(ti),ti}_configAfterMerge(ti){return ti}_mergeConfigObj(ti,ei){let ni=Ps(ei)?Hs.getDataAttribute(ei,"config"):{};return Ui(Ui(Ui(Ui({},this.constructor.Default),typeof ni=="object"?ni:{}),Ps(ei)?Hs.getDataAttributes(ei):{}),typeof ti=="object"?ti:{})}_typeCheckConfig(ti,ei=this.constructor.DefaultType){for(let[ni,ri]of Object.entries(ei)){let si=ti[ni],ai=Ps(si)?"element":Fh(si);if(!new RegExp(ri).test(ai))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${ni}" provided type "${ai}" but expected type "${ri}".`)}}},Kh="5.3.3",ps=class extends Ao{constructor(ti,ei){super(),ti=eo(ti),ti&&(this._element=ti,this._config=this._getConfig(ei),vc.set(this._element,this.constructor.DATA_KEY,this))}dispose(){vc.remove(this._element,this.constructor.DATA_KEY),Mi.off(this._element,this.constructor.EVENT_KEY);for(let ti of Object.getOwnPropertyNames(this))this[ti]=null}_queueCallback(ti,ei,ni=!0){dd(ti,ei,ni)}_getConfig(ti){return ti=this._mergeConfigObj(ti,this._element),ti=this._configAfterMerge(ti),this._typeCheckConfig(ti),ti}static getInstance(ti){return vc.get(eo(ti),this.DATA_KEY)}static getOrCreateInstance(ti,ei={}){return this.getInstance(ti)||new this(ti,typeof ei=="object"?ei:null)}static get VERSION(){return Kh}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(ti){return`${ti}${this.EVENT_KEY}`}},Ec=ii=>{let ti=ii.getAttribute("data-bs-target");if(!ti||ti==="#"){let ei=ii.getAttribute("href");if(!ei||!ei.includes("#")&&!ei.startsWith("."))return null;ei.includes("#")&&!ei.startsWith("#")&&(ei=`#${ei.split("#")[1]}`),ti=ei&&ei!=="#"?ei.trim():null}return ti?ti.split(",").map(ei=>ad(ei)).join(","):null},cn={find(ii,ti=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(ti,ii))},findOne(ii,ti=document.documentElement){return Element.prototype.querySelector.call(ti,ii)},children(ii,ti){return[].concat(...ii.children).filter(ei=>ei.matches(ti))},parents(ii,ti){let ei=[],ni=ii.parentNode.closest(ti);for(;ni;)ei.push(ni),ni=ni.parentNode.closest(ti);return ei},prev(ii,ti){let ei=ii.previousElementSibling;for(;ei;){if(ei.matches(ti))return[ei];ei=ei.previousElementSibling}return[]},next(ii,ti){let ei=ii.nextElementSibling;for(;ei;){if(ei.matches(ti))return[ei];ei=ei.nextElementSibling}return[]},focusableChildren(ii){let ti=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(ei=>`${ei}:not([tabindex^="-"])`).join(",");return this.find(ti,ii).filter(ei=>!to(ei)&&ia(ei))},getSelectorFromElement(ii){let ti=Ec(ii);return ti&&cn.findOne(ti)?ti:null},getElementFromSelector(ii){let ti=Ec(ii);return ti?cn.findOne(ti):null},getMultipleElementsFromSelector(ii){let ti=Ec(ii);return ti?cn.find(ti):[]}},bl=(ii,ti="hide")=>{let ei=`click.dismiss${ii.EVENT_KEY}`,ni=ii.NAME;Mi.on(document,ei,`[data-bs-dismiss="${ni}"]`,function(ri){if(["A","AREA"].includes(this.tagName)&&ri.preventDefault(),to(this))return;let si=cn.getElementFromSelector(this)||this.closest(`.${ni}`);ii.getOrCreateInstance(si)[ti]()})},Qh="alert",Xh="bs.alert",yd=`.${Xh}`,Jh=`close${yd}`,Zh=`closed${yd}`,ep="fade",tp="show",hl=class ii extends ps{static get NAME(){return Qh}close(){if(Mi.trigger(this._element,Jh).defaultPrevented)return;this._element.classList.remove(tp);let ei=this._element.classList.contains(ep);this._queueCallback(()=>this._destroyElement(),this._element,ei)}_destroyElement(){this._element.remove(),Mi.trigger(this._element,Zh),this.dispose()}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti](this)}})}};bl(hl,"close");ws(hl);var ip="button",np="bs.button",rp=`.${np}`,sp=".data-api",op="active",Pu='[data-bs-toggle="button"]',ap=`click${rp}${sp}`,pl=class ii extends ps{static get NAME(){return ip}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(op))}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this);ti==="toggle"&&ei[ti]()})}};Mi.on(document,ap,Pu,ii=>{ii.preventDefault();let ti=ii.target.closest(Pu);pl.getOrCreateInstance(ti).toggle()});ws(pl);var lp="swipe",na=".bs.swipe",cp=`touchstart${na}`,up=`touchmove${na}`,dp=`touchend${na}`,fp=`pointerdown${na}`,hp=`pointerup${na}`,pp="touch",mp="pen",gp="pointer-event",vp=40,yp={endCallback:null,leftCallback:null,rightCallback:null},_p={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},ml=class ii extends Ao{constructor(ti,ei){super(),this._element=ti,!(!ti||!ii.isSupported())&&(this._config=this._getConfig(ei),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return yp}static get DefaultType(){return _p}static get NAME(){return lp}dispose(){Mi.off(this._element,na)}_start(ti){if(!this._supportPointerEvents){this._deltaX=ti.touches[0].clientX;return}this._eventIsPointerPenTouch(ti)&&(this._deltaX=ti.clientX)}_end(ti){this._eventIsPointerPenTouch(ti)&&(this._deltaX=ti.clientX-this._deltaX),this._handleSwipe(),ls(this._config.endCallback)}_move(ti){this._deltaX=ti.touches&&ti.touches.length>1?0:ti.touches[0].clientX-this._deltaX}_handleSwipe(){let ti=Math.abs(this._deltaX);if(ti<=vp)return;let ei=ti/this._deltaX;this._deltaX=0,ei&&ls(ei>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Mi.on(this._element,fp,ti=>this._start(ti)),Mi.on(this._element,hp,ti=>this._end(ti)),this._element.classList.add(gp)):(Mi.on(this._element,cp,ti=>this._start(ti)),Mi.on(this._element,up,ti=>this._move(ti)),Mi.on(this._element,dp,ti=>this._end(ti)))}_eventIsPointerPenTouch(ti){return this._supportPointerEvents&&(ti.pointerType===mp||ti.pointerType===pp)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},bp="carousel",Ep="bs.carousel",so=`.${Ep}`,_d=".data-api",wp="ArrowLeft",xp="ArrowRight",Tp=500,Ca="next",Qo="prev",Jo="left",ul="right",Sp=`slide${so}`,wc=`slid${so}`,Cp=`keydown${so}`,Ap=`mouseenter${so}`,Dp=`mouseleave${so}`,Op=`dragstart${so}`,Lp=`load${so}${_d}`,Mp=`click${so}${_d}`,bd="carousel",rl="active",kp="slide",Np="carousel-item-end",Ip="carousel-item-start",Rp="carousel-item-next",Pp="carousel-item-prev",Ed=".active",wd=".carousel-item",Hp=Ed+wd,Fp=".carousel-item img",$p=".carousel-indicators",Bp="[data-bs-slide], [data-bs-slide-to]",zp='[data-bs-ride="carousel"]',jp={[wp]:ul,[xp]:Jo},Vp={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},qp={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},Da=class ii extends ps{constructor(ti,ei){super(ti,ei),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=cn.findOne($p,this._element),this._addEventListeners(),this._config.ride===bd&&this.cycle()}static get Default(){return Vp}static get DefaultType(){return qp}static get NAME(){return bp}next(){this._slide(Ca)}nextWhenVisible(){!document.hidden&&ia(this._element)&&this.next()}prev(){this._slide(Qo)}pause(){this._isSliding&&ld(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){Mi.one(this._element,wc,()=>this.cycle());return}this.cycle()}}to(ti){let ei=this._getItems();if(ti>ei.length-1||ti<0)return;if(this._isSliding){Mi.one(this._element,wc,()=>this.to(ti));return}let ni=this._getItemIndex(this._getActive());if(ni===ti)return;let ri=ti>ni?Ca:Qo;this._slide(ri,ei[ti])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(ti){return ti.defaultInterval=ti.interval,ti}_addEventListeners(){this._config.keyboard&&Mi.on(this._element,Cp,ti=>this._keydown(ti)),this._config.pause==="hover"&&(Mi.on(this._element,Ap,()=>this.pause()),Mi.on(this._element,Dp,()=>this._maybeEnableCycle())),this._config.touch&&ml.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let ni of cn.find(Fp,this._element))Mi.on(ni,Op,ri=>ri.preventDefault());let ei={leftCallback:()=>this._slide(this._directionToOrder(Jo)),rightCallback:()=>this._slide(this._directionToOrder(ul)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),Tp+this._config.interval))}};this._swipeHelper=new ml(this._element,ei)}_keydown(ti){if(/input|textarea/i.test(ti.target.tagName))return;let ei=jp[ti.key];ei&&(ti.preventDefault(),this._slide(this._directionToOrder(ei)))}_getItemIndex(ti){return this._getItems().indexOf(ti)}_setActiveIndicatorElement(ti){if(!this._indicatorsElement)return;let ei=cn.findOne(Ed,this._indicatorsElement);ei.classList.remove(rl),ei.removeAttribute("aria-current");let ni=cn.findOne(`[data-bs-slide-to="${ti}"]`,this._indicatorsElement);ni&&(ni.classList.add(rl),ni.setAttribute("aria-current","true"))}_updateInterval(){let ti=this._activeElement||this._getActive();if(!ti)return;let ei=Number.parseInt(ti.getAttribute("data-bs-interval"),10);this._config.interval=ei||this._config.defaultInterval}_slide(ti,ei=null){if(this._isSliding)return;let ni=this._getActive(),ri=ti===Ca,si=ei||Pc(this._getItems(),ni,ri,this._config.wrap);if(si===ni)return;let ai=this._getItemIndex(si),li=Ai=>Mi.trigger(this._element,Ai,{relatedTarget:si,direction:this._orderToDirection(ti),from:this._getItemIndex(ni),to:ai});if(li(Sp).defaultPrevented||!ni||!si)return;let mi=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(ai),this._activeElement=si;let hi=ri?Ip:Np,_i=ri?Rp:Pp;si.classList.add(_i),La(si),ni.classList.add(hi),si.classList.add(hi);let Ei=()=>{si.classList.remove(hi,_i),si.classList.add(rl),ni.classList.remove(rl,_i,hi),this._isSliding=!1,li(wc)};this._queueCallback(Ei,ni,this._isAnimated()),mi&&this.cycle()}_isAnimated(){return this._element.classList.contains(kp)}_getActive(){return cn.findOne(Hp,this._element)}_getItems(){return cn.find(wd,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(ti){return bs()?ti===Jo?Qo:Ca:ti===Jo?Ca:Qo}_orderToDirection(ti){return bs()?ti===Qo?Jo:ul:ti===Qo?ul:Jo}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="number"){ei.to(ti);return}if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Mi.on(document,Mp,Bp,function(ii){let ti=cn.getElementFromSelector(this);if(!ti||!ti.classList.contains(bd))return;ii.preventDefault();let ei=Da.getOrCreateInstance(ti),ni=this.getAttribute("data-bs-slide-to");if(ni){ei.to(ni),ei._maybeEnableCycle();return}if(Hs.getDataAttribute(this,"slide")==="next"){ei.next(),ei._maybeEnableCycle();return}ei.prev(),ei._maybeEnableCycle()});Mi.on(window,Lp,()=>{let ii=cn.find(zp);for(let ti of ii)Da.getOrCreateInstance(ti)});ws(Da);var Wp="collapse",Up="bs.collapse",Ma=`.${Up}`,Yp=".data-api",Gp=`show${Ma}`,Kp=`shown${Ma}`,Qp=`hide${Ma}`,Xp=`hidden${Ma}`,Jp=`click${Ma}${Yp}`,xc="show",ea="collapse",sl="collapsing",Zp="collapsed",em=`:scope .${ea} .${ea}`,tm="collapse-horizontal",im="width",nm="height",rm=".collapse.show, .collapse.collapsing",Ic='[data-bs-toggle="collapse"]',sm={parent:null,toggle:!0},om={parent:"(null|element)",toggle:"boolean"},io=class ii extends ps{constructor(ti,ei){super(ti,ei),this._isTransitioning=!1,this._triggerArray=[];let ni=cn.find(Ic);for(let ri of ni){let si=cn.getSelectorFromElement(ri),ai=cn.find(si).filter(li=>li===this._element);si!==null&&ai.length&&this._triggerArray.push(ri)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return sm}static get DefaultType(){return om}static get NAME(){return Wp}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let ti=[];if(this._config.parent&&(ti=this._getFirstLevelChildren(rm).filter(li=>li!==this._element).map(li=>ii.getOrCreateInstance(li,{toggle:!1}))),ti.length&&ti[0]._isTransitioning||Mi.trigger(this._element,Gp).defaultPrevented)return;for(let li of ti)li.hide();let ni=this._getDimension();this._element.classList.remove(ea),this._element.classList.add(sl),this._element.style[ni]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let ri=()=>{this._isTransitioning=!1,this._element.classList.remove(sl),this._element.classList.add(ea,xc),this._element.style[ni]="",Mi.trigger(this._element,Kp)},ai=`scroll${ni[0].toUpperCase()+ni.slice(1)}`;this._queueCallback(ri,this._element,!0),this._element.style[ni]=`${this._element[ai]}px`}hide(){if(this._isTransitioning||!this._isShown()||Mi.trigger(this._element,Qp).defaultPrevented)return;let ei=this._getDimension();this._element.style[ei]=`${this._element.getBoundingClientRect()[ei]}px`,La(this._element),this._element.classList.add(sl),this._element.classList.remove(ea,xc);for(let ri of this._triggerArray){let si=cn.getElementFromSelector(ri);si&&!this._isShown(si)&&this._addAriaAndCollapsedClass([ri],!1)}this._isTransitioning=!0;let ni=()=>{this._isTransitioning=!1,this._element.classList.remove(sl),this._element.classList.add(ea),Mi.trigger(this._element,Xp)};this._element.style[ei]="",this._queueCallback(ni,this._element,!0)}_isShown(ti=this._element){return ti.classList.contains(xc)}_configAfterMerge(ti){return ti.toggle=!!ti.toggle,ti.parent=eo(ti.parent),ti}_getDimension(){return this._element.classList.contains(tm)?im:nm}_initializeChildren(){if(!this._config.parent)return;let ti=this._getFirstLevelChildren(Ic);for(let ei of ti){let ni=cn.getElementFromSelector(ei);ni&&this._addAriaAndCollapsedClass([ei],this._isShown(ni))}}_getFirstLevelChildren(ti){let ei=cn.find(em,this._config.parent);return cn.find(ti,this._config.parent).filter(ni=>!ei.includes(ni))}_addAriaAndCollapsedClass(ti,ei){if(ti.length)for(let ni of ti)ni.classList.toggle(Zp,!ei),ni.setAttribute("aria-expanded",ei)}static jQueryInterface(ti){let ei={};return typeof ti=="string"&&/show|hide/.test(ti)&&(ei.toggle=!1),this.each(function(){let ni=ii.getOrCreateInstance(this,ei);if(typeof ti=="string"){if(typeof ni[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ni[ti]()}})}};Mi.on(document,Jp,Ic,function(ii){(ii.target.tagName==="A"||ii.delegateTarget&&ii.delegateTarget.tagName==="A")&&ii.preventDefault();for(let ti of cn.getMultipleElementsFromSelector(this))io.getOrCreateInstance(ti,{toggle:!1}).toggle()});ws(io);var Hu="dropdown",am="bs.dropdown",Oo=`.${am}`,Fc=".data-api",lm="Escape",Fu="Tab",cm="ArrowUp",$u="ArrowDown",um=2,dm=`hide${Oo}`,fm=`hidden${Oo}`,hm=`show${Oo}`,pm=`shown${Oo}`,xd=`click${Oo}${Fc}`,Td=`keydown${Oo}${Fc}`,mm=`keyup${Oo}${Fc}`,Zo="show",gm="dropup",vm="dropend",ym="dropstart",_m="dropup-center",bm="dropdown-center",So='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Em=`${So}.${Zo}`,dl=".dropdown-menu",wm=".navbar",xm=".navbar-nav",Tm=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Sm=bs()?"top-end":"top-start",Cm=bs()?"top-start":"top-end",Am=bs()?"bottom-end":"bottom-start",Dm=bs()?"bottom-start":"bottom-end",Om=bs()?"left-start":"right-start",Lm=bs()?"right-start":"left-start",Mm="top",km="bottom",Nm={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Im={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},no=class ii extends ps{constructor(ti,ei){super(ti,ei),this._popper=null,this._parent=this._element.parentNode,this._menu=cn.next(this._element,dl)[0]||cn.prev(this._element,dl)[0]||cn.findOne(dl,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Nm}static get DefaultType(){return Im}static get NAME(){return Hu}toggle(){return this._isShown()?this.hide():this.show()}show(){if(to(this._element)||this._isShown())return;let ti={relatedTarget:this._element};if(!Mi.trigger(this._element,hm,ti).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(xm))for(let ni of[].concat(...document.body.children))Mi.on(ni,"mouseover",fl);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Zo),this._element.classList.add(Zo),Mi.trigger(this._element,pm,ti)}}hide(){if(to(this._element)||!this._isShown())return;let ti={relatedTarget:this._element};this._completeHide(ti)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(ti){if(!Mi.trigger(this._element,dm,ti).defaultPrevented){if("ontouchstart"in document.documentElement)for(let ni of[].concat(...document.body.children))Mi.off(ni,"mouseover",fl);this._popper&&this._popper.destroy(),this._menu.classList.remove(Zo),this._element.classList.remove(Zo),this._element.setAttribute("aria-expanded","false"),Hs.removeDataAttribute(this._menu,"popper"),Mi.trigger(this._element,fm,ti)}}_getConfig(ti){if(ti=super._getConfig(ti),typeof ti.reference=="object"&&!Ps(ti.reference)&&typeof ti.reference.getBoundingClientRect!="function")throw new TypeError(`${Hu.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return ti}_createPopper(){if(typeof nl=="undefined")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let ti=this._element;this._config.reference==="parent"?ti=this._parent:Ps(this._config.reference)?ti=eo(this._config.reference):typeof this._config.reference=="object"&&(ti=this._config.reference);let ei=this._getPopperConfig();this._popper=Sa(ti,this._menu,ei)}_isShown(){return this._menu.classList.contains(Zo)}_getPlacement(){let ti=this._parent;if(ti.classList.contains(vm))return Om;if(ti.classList.contains(ym))return Lm;if(ti.classList.contains(_m))return Mm;if(ti.classList.contains(bm))return km;let ei=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return ti.classList.contains(gm)?ei?Cm:Sm:ei?Dm:Am}_detectNavbar(){return this._element.closest(wm)!==null}_getOffset(){let{offset:ti}=this._config;return typeof ti=="string"?ti.split(",").map(ei=>Number.parseInt(ei,10)):typeof ti=="function"?ei=>ti(ei,this._element):ti}_getPopperConfig(){let ti={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Hs.setDataAttribute(this._menu,"popper","static"),ti.modifiers=[{name:"applyStyles",enabled:!1}]),Ui(Ui({},ti),ls(this._config.popperConfig,[ti]))}_selectMenuItem({key:ti,target:ei}){let ni=cn.find(Tm,this._menu).filter(ri=>ia(ri));ni.length&&Pc(ni,ei,ti===$u,!ni.includes(ei)).focus()}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}static clearMenus(ti){if(ti.button===um||ti.type==="keyup"&&ti.key!==Fu)return;let ei=cn.find(Em);for(let ni of ei){let ri=ii.getInstance(ni);if(!ri||ri._config.autoClose===!1)continue;let si=ti.composedPath(),ai=si.includes(ri._menu);if(si.includes(ri._element)||ri._config.autoClose==="inside"&&!ai||ri._config.autoClose==="outside"&&ai||ri._menu.contains(ti.target)&&(ti.type==="keyup"&&ti.key===Fu||/input|select|option|textarea|form/i.test(ti.target.tagName)))continue;let li={relatedTarget:ri._element};ti.type==="click"&&(li.clickEvent=ti),ri._completeHide(li)}}static dataApiKeydownHandler(ti){let ei=/input|textarea/i.test(ti.target.tagName),ni=ti.key===lm,ri=[cm,$u].includes(ti.key);if(!ri&&!ni||ei&&!ni)return;ti.preventDefault();let si=this.matches(So)?this:cn.prev(this,So)[0]||cn.next(this,So)[0]||cn.findOne(So,ti.delegateTarget.parentNode),ai=ii.getOrCreateInstance(si);if(ri){ti.stopPropagation(),ai.show(),ai._selectMenuItem(ti);return}ai._isShown()&&(ti.stopPropagation(),ai.hide(),si.focus())}};Mi.on(document,Td,So,no.dataApiKeydownHandler);Mi.on(document,Td,dl,no.dataApiKeydownHandler);Mi.on(document,xd,no.clearMenus);Mi.on(document,mm,no.clearMenus);Mi.on(document,xd,So,function(ii){ii.preventDefault(),no.getOrCreateInstance(this).toggle()});ws(no);var Sd="backdrop",Rm="fade",Bu="show",zu=`mousedown.bs.${Sd}`,Pm={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Hm={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},gl=class extends Ao{constructor(ti){super(),this._config=this._getConfig(ti),this._isAppended=!1,this._element=null}static get Default(){return Pm}static get DefaultType(){return Hm}static get NAME(){return Sd}show(ti){if(!this._config.isVisible){ls(ti);return}this._append();let ei=this._getElement();this._config.isAnimated&&La(ei),ei.classList.add(Bu),this._emulateAnimation(()=>{ls(ti)})}hide(ti){if(!this._config.isVisible){ls(ti);return}this._getElement().classList.remove(Bu),this._emulateAnimation(()=>{this.dispose(),ls(ti)})}dispose(){this._isAppended&&(Mi.off(this._element,zu),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let ti=document.createElement("div");ti.className=this._config.className,this._config.isAnimated&&ti.classList.add(Rm),this._element=ti}return this._element}_configAfterMerge(ti){return ti.rootElement=eo(ti.rootElement),ti}_append(){if(this._isAppended)return;let ti=this._getElement();this._config.rootElement.append(ti),Mi.on(ti,zu,()=>{ls(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(ti){dd(ti,this._getElement(),this._config.isAnimated)}},Fm="focustrap",$m="bs.focustrap",vl=`.${$m}`,Bm=`focusin${vl}`,zm=`keydown.tab${vl}`,jm="Tab",Vm="forward",ju="backward",qm={autofocus:!0,trapElement:null},Wm={autofocus:"boolean",trapElement:"element"},yl=class extends Ao{constructor(ti){super(),this._config=this._getConfig(ti),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return qm}static get DefaultType(){return Wm}static get NAME(){return Fm}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Mi.off(document,vl),Mi.on(document,Bm,ti=>this._handleFocusin(ti)),Mi.on(document,zm,ti=>this._handleKeydown(ti)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Mi.off(document,vl))}_handleFocusin(ti){let{trapElement:ei}=this._config;if(ti.target===document||ti.target===ei||ei.contains(ti.target))return;let ni=cn.focusableChildren(ei);ni.length===0?ei.focus():this._lastTabNavDirection===ju?ni[ni.length-1].focus():ni[0].focus()}_handleKeydown(ti){ti.key===jm&&(this._lastTabNavDirection=ti.shiftKey?ju:Vm)}},Vu=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",qu=".sticky-top",ol="padding-right",Wu="margin-right",Oa=class{constructor(){this._element=document.body}getWidth(){let ti=document.documentElement.clientWidth;return Math.abs(window.innerWidth-ti)}hide(){let ti=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,ol,ei=>ei+ti),this._setElementAttributes(Vu,ol,ei=>ei+ti),this._setElementAttributes(qu,Wu,ei=>ei-ti)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,ol),this._resetElementAttributes(Vu,ol),this._resetElementAttributes(qu,Wu)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(ti,ei,ni){let ri=this.getWidth(),si=ai=>{if(ai!==this._element&&window.innerWidth>ai.clientWidth+ri)return;this._saveInitialAttribute(ai,ei);let li=window.getComputedStyle(ai).getPropertyValue(ei);ai.style.setProperty(ei,`${ni(Number.parseFloat(li))}px`)};this._applyManipulationCallback(ti,si)}_saveInitialAttribute(ti,ei){let ni=ti.style.getPropertyValue(ei);ni&&Hs.setDataAttribute(ti,ei,ni)}_resetElementAttributes(ti,ei){let ni=ri=>{let si=Hs.getDataAttribute(ri,ei);if(si===null){ri.style.removeProperty(ei);return}Hs.removeDataAttribute(ri,ei),ri.style.setProperty(ei,si)};this._applyManipulationCallback(ti,ni)}_applyManipulationCallback(ti,ei){if(Ps(ti)){ei(ti);return}for(let ni of cn.find(ti,this._element))ei(ni)}},Um="modal",Ym="bs.modal",Es=`.${Ym}`,Gm=".data-api",Km="Escape",Qm=`hide${Es}`,Xm=`hidePrevented${Es}`,Cd=`hidden${Es}`,Ad=`show${Es}`,Jm=`shown${Es}`,Zm=`resize${Es}`,eg=`click.dismiss${Es}`,tg=`mousedown.dismiss${Es}`,ig=`keydown.dismiss${Es}`,ng=`click${Es}${Gm}`,Uu="modal-open",rg="fade",Yu="show",Tc="modal-static",sg=".modal.show",og=".modal-dialog",ag=".modal-body",lg='[data-bs-toggle="modal"]',cg={backdrop:!0,focus:!0,keyboard:!0},ug={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},Fs=class ii extends ps{constructor(ti,ei){super(ti,ei),this._dialog=cn.findOne(og,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Oa,this._addEventListeners()}static get Default(){return cg}static get DefaultType(){return ug}static get NAME(){return Um}toggle(ti){return this._isShown?this.hide():this.show(ti)}show(ti){this._isShown||this._isTransitioning||Mi.trigger(this._element,Ad,{relatedTarget:ti}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Uu),this._adjustDialog(),this._backdrop.show(()=>this._showElement(ti)))}hide(){!this._isShown||this._isTransitioning||Mi.trigger(this._element,Qm).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Yu),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Mi.off(window,Es),Mi.off(this._dialog,Es),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new gl({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new yl({trapElement:this._element})}_showElement(ti){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;let ei=cn.findOne(ag,this._dialog);ei&&(ei.scrollTop=0),La(this._element),this._element.classList.add(Yu);let ni=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Mi.trigger(this._element,Jm,{relatedTarget:ti})};this._queueCallback(ni,this._dialog,this._isAnimated())}_addEventListeners(){Mi.on(this._element,ig,ti=>{if(ti.key===Km){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),Mi.on(window,Zm,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Mi.on(this._element,tg,ti=>{Mi.one(this._element,eg,ei=>{if(!(this._element!==ti.target||this._element!==ei.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_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(Uu),this._resetAdjustments(),this._scrollBar.reset(),Mi.trigger(this._element,Cd)})}_isAnimated(){return this._element.classList.contains(rg)}_triggerBackdropTransition(){if(Mi.trigger(this._element,Xm).defaultPrevented)return;let ei=this._element.scrollHeight>document.documentElement.clientHeight,ni=this._element.style.overflowY;ni==="hidden"||this._element.classList.contains(Tc)||(ei||(this._element.style.overflowY="hidden"),this._element.classList.add(Tc),this._queueCallback(()=>{this._element.classList.remove(Tc),this._queueCallback(()=>{this._element.style.overflowY=ni},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let ti=this._element.scrollHeight>document.documentElement.clientHeight,ei=this._scrollBar.getWidth(),ni=ei>0;if(ni&&!ti){let ri=bs()?"paddingLeft":"paddingRight";this._element.style[ri]=`${ei}px`}if(!ni&&ti){let ri=bs()?"paddingRight":"paddingLeft";this._element.style[ri]=`${ei}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(ti,ei){return this.each(function(){let ni=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ni[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ni[ti](ei)}})}};Mi.on(document,ng,lg,function(ii){let ti=cn.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&ii.preventDefault(),Mi.one(ti,Ad,ri=>{ri.defaultPrevented||Mi.one(ti,Cd,()=>{ia(this)&&this.focus()})});let ei=cn.findOne(sg);ei&&Fs.getInstance(ei).hide(),Fs.getOrCreateInstance(ti).toggle(this)});bl(Fs);ws(Fs);var dg="offcanvas",fg="bs.offcanvas",zs=`.${fg}`,Dd=".data-api",hg=`load${zs}${Dd}`,pg="Escape",Gu="show",Ku="showing",Qu="hiding",mg="offcanvas-backdrop",Od=".offcanvas.show",gg=`show${zs}`,vg=`shown${zs}`,yg=`hide${zs}`,Xu=`hidePrevented${zs}`,Ld=`hidden${zs}`,_g=`resize${zs}`,bg=`click${zs}${Dd}`,Eg=`keydown.dismiss${zs}`,wg='[data-bs-toggle="offcanvas"]',xg={backdrop:!0,keyboard:!0,scroll:!1},Tg={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},ro=class ii extends ps{constructor(ti,ei){super(ti,ei),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return xg}static get DefaultType(){return Tg}static get NAME(){return dg}toggle(ti){return this._isShown?this.hide():this.show(ti)}show(ti){if(this._isShown||Mi.trigger(this._element,gg,{relatedTarget:ti}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Oa().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Ku);let ni=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(Gu),this._element.classList.remove(Ku),Mi.trigger(this._element,vg,{relatedTarget:ti})};this._queueCallback(ni,this._element,!0)}hide(){if(!this._isShown||Mi.trigger(this._element,yg).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Qu),this._backdrop.hide();let ei=()=>{this._element.classList.remove(Gu,Qu),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Oa().reset(),Mi.trigger(this._element,Ld)};this._queueCallback(ei,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let ti=()=>{if(this._config.backdrop==="static"){Mi.trigger(this._element,Xu);return}this.hide()},ei=!!this._config.backdrop;return new gl({className:mg,isVisible:ei,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:ei?ti:null})}_initializeFocusTrap(){return new yl({trapElement:this._element})}_addEventListeners(){Mi.on(this._element,Eg,ti=>{if(ti.key===pg){if(this._config.keyboard){this.hide();return}Mi.trigger(this._element,Xu)}})}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti](this)}})}};Mi.on(document,bg,wg,function(ii){let ti=cn.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&ii.preventDefault(),to(this))return;Mi.one(ti,Ld,()=>{ia(this)&&this.focus()});let ei=cn.findOne(Od);ei&&ei!==ti&&ro.getInstance(ei).hide(),ro.getOrCreateInstance(ti).toggle(this)});Mi.on(window,hg,()=>{for(let ii of cn.find(Od))ro.getOrCreateInstance(ii).show()});Mi.on(window,_g,()=>{for(let ii of cn.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(ii).position!=="fixed"&&ro.getOrCreateInstance(ii).hide()});bl(ro);ws(ro);var Sg=/^aria-[\w-]*$/i,Md={"*":["class","dir","id","lang","role",Sg],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:[]},Cg=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Ag=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Dg=(ii,ti)=>{let ei=ii.nodeName.toLowerCase();return ti.includes(ei)?Cg.has(ei)?!!Ag.test(ii.nodeValue):!0:ti.filter(ni=>ni instanceof RegExp).some(ni=>ni.test(ei))};function Og(ii,ti,ei){if(!ii.length)return ii;if(ei&&typeof ei=="function")return ei(ii);let ri=new window.DOMParser().parseFromString(ii,"text/html"),si=[].concat(...ri.body.querySelectorAll("*"));for(let ai of si){let li=ai.nodeName.toLowerCase();if(!Object.keys(ti).includes(li)){ai.remove();continue}let di=[].concat(...ai.attributes),mi=[].concat(ti["*"]||[],ti[li]||[]);for(let hi of di)Dg(hi,mi)||ai.removeAttribute(hi.nodeName)}return ri.body.innerHTML}var Lg="TemplateFactory",Mg={allowList:Md,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},kg={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Ng={entry:"(string|element|function|null)",selector:"(string|element)"},Rc=class extends Ao{constructor(ti){super(),this._config=this._getConfig(ti)}static get Default(){return Mg}static get DefaultType(){return kg}static get NAME(){return Lg}getContent(){return Object.values(this._config.content).map(ti=>this._resolvePossibleFunction(ti)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(ti){return this._checkContent(ti),this._config.content=Ui(Ui({},this._config.content),ti),this}toHtml(){let ti=document.createElement("div");ti.innerHTML=this._maybeSanitize(this._config.template);for(let[ri,si]of Object.entries(this._config.content))this._setContent(ti,si,ri);let ei=ti.children[0],ni=this._resolvePossibleFunction(this._config.extraClass);return ni&&ei.classList.add(...ni.split(" ")),ei}_typeCheckConfig(ti){super._typeCheckConfig(ti),this._checkContent(ti.content)}_checkContent(ti){for(let[ei,ni]of Object.entries(ti))super._typeCheckConfig({selector:ei,entry:ni},Ng)}_setContent(ti,ei,ni){let ri=cn.findOne(ni,ti);if(ri){if(ei=this._resolvePossibleFunction(ei),!ei){ri.remove();return}if(Ps(ei)){this._putElementInTemplate(eo(ei),ri);return}if(this._config.html){ri.innerHTML=this._maybeSanitize(ei);return}ri.textContent=ei}}_maybeSanitize(ti){return this._config.sanitize?Og(ti,this._config.allowList,this._config.sanitizeFn):ti}_resolvePossibleFunction(ti){return ls(ti,[this])}_putElementInTemplate(ti,ei){if(this._config.html){ei.innerHTML="",ei.append(ti);return}ei.textContent=ti.textContent}},Ig="tooltip",Rg=new Set(["sanitize","allowList","sanitizeFn"]),Sc="fade",Pg="modal",al="show",Hg=".tooltip-inner",Ju=`.${Pg}`,Zu="hide.bs.modal",Aa="hover",Cc="focus",Fg="click",$g="manual",Bg="hide",zg="hidden",jg="show",Vg="shown",qg="inserted",Wg="click",Ug="focusin",Yg="focusout",Gg="mouseenter",Kg="mouseleave",Qg={AUTO:"auto",TOP:"top",RIGHT:bs()?"left":"right",BOTTOM:"bottom",LEFT:bs()?"right":"left"},Xg={allowList:Md,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"},Jg={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"},$s=class ii extends ps{constructor(ti,ei){if(typeof nl=="undefined")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(ti,ei),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 Xg}static get DefaultType(){return Jg}static get NAME(){return Ig}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),Mi.off(this._element.closest(Ju),Zu,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(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;let ti=Mi.trigger(this._element,this.constructor.eventName(jg)),ni=(cd(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(ti.defaultPrevented||!ni)return;this._disposePopper();let ri=this._getTipElement();this._element.setAttribute("aria-describedby",ri.getAttribute("id"));let{container:si}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(si.append(ri),Mi.trigger(this._element,this.constructor.eventName(qg))),this._popper=this._createPopper(ri),ri.classList.add(al),"ontouchstart"in document.documentElement)for(let li of[].concat(...document.body.children))Mi.on(li,"mouseover",fl);let ai=()=>{Mi.trigger(this._element,this.constructor.eventName(Vg)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(ai,this.tip,this._isAnimated())}hide(){if(!this._isShown()||Mi.trigger(this._element,this.constructor.eventName(Bg)).defaultPrevented)return;if(this._getTipElement().classList.remove(al),"ontouchstart"in document.documentElement)for(let ri of[].concat(...document.body.children))Mi.off(ri,"mouseover",fl);this._activeTrigger[Fg]=!1,this._activeTrigger[Cc]=!1,this._activeTrigger[Aa]=!1,this._isHovered=null;let ni=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Mi.trigger(this._element,this.constructor.eventName(zg)))};this._queueCallback(ni,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(ti){let ei=this._getTemplateFactory(ti).toHtml();if(!ei)return null;ei.classList.remove(Sc,al),ei.classList.add(`bs-${this.constructor.NAME}-auto`);let ni=$h(this.constructor.NAME).toString();return ei.setAttribute("id",ni),this._isAnimated()&&ei.classList.add(Sc),ei}setContent(ti){this._newContent=ti,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(ti){return this._templateFactory?this._templateFactory.changeContent(ti):this._templateFactory=new Rc(Hn(Ui({},this._config),{content:ti,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}_getContentForTemplate(){return{[Hg]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(ti){return this.constructor.getOrCreateInstance(ti.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Sc)}_isShown(){return this.tip&&this.tip.classList.contains(al)}_createPopper(ti){let ei=ls(this._config.placement,[this,ti,this._element]),ni=Qg[ei.toUpperCase()];return Sa(this._element,ti,this._getPopperConfig(ni))}_getOffset(){let{offset:ti}=this._config;return typeof ti=="string"?ti.split(",").map(ei=>Number.parseInt(ei,10)):typeof ti=="function"?ei=>ti(ei,this._element):ti}_resolvePossibleFunction(ti){return ls(ti,[this._element])}_getPopperConfig(ti){let ei={placement:ti,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:ni=>{this._getTipElement().setAttribute("data-popper-placement",ni.state.placement)}}]};return Ui(Ui({},ei),ls(this._config.popperConfig,[ei]))}_setListeners(){let ti=this._config.trigger.split(" ");for(let ei of ti)if(ei==="click")Mi.on(this._element,this.constructor.eventName(Wg),this._config.selector,ni=>{this._initializeOnDelegatedTarget(ni).toggle()});else if(ei!==$g){let ni=ei===Aa?this.constructor.eventName(Gg):this.constructor.eventName(Ug),ri=ei===Aa?this.constructor.eventName(Kg):this.constructor.eventName(Yg);Mi.on(this._element,ni,this._config.selector,si=>{let ai=this._initializeOnDelegatedTarget(si);ai._activeTrigger[si.type==="focusin"?Cc:Aa]=!0,ai._enter()}),Mi.on(this._element,ri,this._config.selector,si=>{let ai=this._initializeOnDelegatedTarget(si);ai._activeTrigger[si.type==="focusout"?Cc:Aa]=ai._element.contains(si.relatedTarget),ai._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Mi.on(this._element.closest(Ju),Zu,this._hideModalHandler)}_fixTitle(){let ti=this._element.getAttribute("title");ti&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",ti),this._element.setAttribute("data-bs-original-title",ti),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}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(ti,ei){clearTimeout(this._timeout),this._timeout=setTimeout(ti,ei)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(ti){let ei=Hs.getDataAttributes(this._element);for(let ni of Object.keys(ei))Rg.has(ni)&&delete ei[ni];return ti=Ui(Ui({},ei),typeof ti=="object"&&ti?ti:{}),ti=this._mergeConfigObj(ti),ti=this._configAfterMerge(ti),this._typeCheckConfig(ti),ti}_configAfterMerge(ti){return ti.container=ti.container===!1?document.body:eo(ti.container),typeof ti.delay=="number"&&(ti.delay={show:ti.delay,hide:ti.delay}),typeof ti.title=="number"&&(ti.title=ti.title.toString()),typeof ti.content=="number"&&(ti.content=ti.content.toString()),ti}_getDelegateConfig(){let ti={};for(let[ei,ni]of Object.entries(this._config))this.constructor.Default[ei]!==ni&&(ti[ei]=ni);return ti.selector=!1,ti.trigger="manual",ti}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};ws($s);var Zg="popover",ev=".popover-header",tv=".popover-body",iv=Hn(Ui({},$s.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"}),nv=Hn(Ui({},$s.DefaultType),{content:"(null|string|element|function)"}),ta=class ii extends $s{static get Default(){return iv}static get DefaultType(){return nv}static get NAME(){return Zg}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[ev]:this._getTitle(),[tv]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};ws(ta);var rv="scrollspy",sv="bs.scrollspy",$c=`.${sv}`,ov=".data-api",av=`activate${$c}`,ed=`click${$c}`,lv=`load${$c}${ov}`,cv="dropdown-item",Xo="active",uv='[data-bs-spy="scroll"]',Ac="[href]",dv=".nav, .list-group",td=".nav-link",fv=".nav-item",hv=".list-group-item",pv=`${td}, ${fv} > ${td}, ${hv}`,mv=".dropdown",gv=".dropdown-toggle",vv={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},yv={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},_l=class ii extends ps{constructor(ti,ei){super(ti,ei),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return vv}static get DefaultType(){return yv}static get NAME(){return rv}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let ti of this._observableSections.values())this._observer.observe(ti)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(ti){return ti.target=eo(ti.target)||document.body,ti.rootMargin=ti.offset?`${ti.offset}px 0px -30%`:ti.rootMargin,typeof ti.threshold=="string"&&(ti.threshold=ti.threshold.split(",").map(ei=>Number.parseFloat(ei))),ti}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Mi.off(this._config.target,ed),Mi.on(this._config.target,ed,Ac,ti=>{let ei=this._observableSections.get(ti.target.hash);if(ei){ti.preventDefault();let ni=this._rootElement||window,ri=ei.offsetTop-this._element.offsetTop;if(ni.scrollTo){ni.scrollTo({top:ri,behavior:"smooth"});return}ni.scrollTop=ri}}))}_getNewObserver(){let ti={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(ei=>this._observerCallback(ei),ti)}_observerCallback(ti){let ei=ai=>this._targetLinks.get(`#${ai.target.id}`),ni=ai=>{this._previousScrollData.visibleEntryTop=ai.target.offsetTop,this._process(ei(ai))},ri=(this._rootElement||document.documentElement).scrollTop,si=ri>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=ri;for(let ai of ti){if(!ai.isIntersecting){this._activeTarget=null,this._clearActiveClass(ei(ai));continue}let li=ai.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(si&&li){if(ni(ai),!ri)return;continue}!si&&!li&&ni(ai)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let ti=cn.find(Ac,this._config.target);for(let ei of ti){if(!ei.hash||to(ei))continue;let ni=cn.findOne(decodeURI(ei.hash),this._element);ia(ni)&&(this._targetLinks.set(decodeURI(ei.hash),ei),this._observableSections.set(ei.hash,ni))}}_process(ti){this._activeTarget!==ti&&(this._clearActiveClass(this._config.target),this._activeTarget=ti,ti.classList.add(Xo),this._activateParents(ti),Mi.trigger(this._element,av,{relatedTarget:ti}))}_activateParents(ti){if(ti.classList.contains(cv)){cn.findOne(gv,ti.closest(mv)).classList.add(Xo);return}for(let ei of cn.parents(ti,dv))for(let ni of cn.prev(ei,pv))ni.classList.add(Xo)}_clearActiveClass(ti){ti.classList.remove(Xo);let ei=cn.find(`${Ac}.${Xo}`,ti);for(let ni of ei)ni.classList.remove(Xo)}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Mi.on(window,lv,()=>{for(let ii of cn.find(uv))_l.getOrCreateInstance(ii)});ws(_l);var _v="tab",bv="bs.tab",Lo=`.${bv}`,Ev=`hide${Lo}`,wv=`hidden${Lo}`,xv=`show${Lo}`,Tv=`shown${Lo}`,Sv=`click${Lo}`,Cv=`keydown${Lo}`,Av=`load${Lo}`,Dv="ArrowLeft",id="ArrowRight",Ov="ArrowUp",nd="ArrowDown",Dc="Home",rd="End",Co="active",sd="fade",Oc="show",Lv="dropdown",kd=".dropdown-toggle",Mv=".dropdown-menu",Lc=`:not(${kd})`,kv='.list-group, .nav, [role="tablist"]',Nv=".nav-item, .list-group-item",Iv=`.nav-link${Lc}, .list-group-item${Lc}, [role="tab"]${Lc}`,Nd='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Mc=`${Iv}, ${Nd}`,Rv=`.${Co}[data-bs-toggle="tab"], .${Co}[data-bs-toggle="pill"], .${Co}[data-bs-toggle="list"]`,Do=class ii extends ps{constructor(ti){super(ti),this._parent=this._element.closest(kv),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Mi.on(this._element,Cv,ei=>this._keydown(ei)))}static get NAME(){return _v}show(){let ti=this._element;if(this._elemIsActive(ti))return;let ei=this._getActiveElem(),ni=ei?Mi.trigger(ei,Ev,{relatedTarget:ti}):null;Mi.trigger(ti,xv,{relatedTarget:ei}).defaultPrevented||ni&&ni.defaultPrevented||(this._deactivate(ei,ti),this._activate(ti,ei))}_activate(ti,ei){if(!ti)return;ti.classList.add(Co),this._activate(cn.getElementFromSelector(ti));let ni=()=>{if(ti.getAttribute("role")!=="tab"){ti.classList.add(Oc);return}ti.removeAttribute("tabindex"),ti.setAttribute("aria-selected",!0),this._toggleDropDown(ti,!0),Mi.trigger(ti,Tv,{relatedTarget:ei})};this._queueCallback(ni,ti,ti.classList.contains(sd))}_deactivate(ti,ei){if(!ti)return;ti.classList.remove(Co),ti.blur(),this._deactivate(cn.getElementFromSelector(ti));let ni=()=>{if(ti.getAttribute("role")!=="tab"){ti.classList.remove(Oc);return}ti.setAttribute("aria-selected",!1),ti.setAttribute("tabindex","-1"),this._toggleDropDown(ti,!1),Mi.trigger(ti,wv,{relatedTarget:ei})};this._queueCallback(ni,ti,ti.classList.contains(sd))}_keydown(ti){if(![Dv,id,Ov,nd,Dc,rd].includes(ti.key))return;ti.stopPropagation(),ti.preventDefault();let ei=this._getChildren().filter(ri=>!to(ri)),ni;if([Dc,rd].includes(ti.key))ni=ei[ti.key===Dc?0:ei.length-1];else{let ri=[id,nd].includes(ti.key);ni=Pc(ei,ti.target,ri,!0)}ni&&(ni.focus({preventScroll:!0}),ii.getOrCreateInstance(ni).show())}_getChildren(){return cn.find(Mc,this._parent)}_getActiveElem(){return this._getChildren().find(ti=>this._elemIsActive(ti))||null}_setInitialAttributes(ti,ei){this._setAttributeIfNotExists(ti,"role","tablist");for(let ni of ei)this._setInitialAttributesOnChild(ni)}_setInitialAttributesOnChild(ti){ti=this._getInnerElement(ti);let ei=this._elemIsActive(ti),ni=this._getOuterElement(ti);ti.setAttribute("aria-selected",ei),ni!==ti&&this._setAttributeIfNotExists(ni,"role","presentation"),ei||ti.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(ti,"role","tab"),this._setInitialAttributesOnTargetPanel(ti)}_setInitialAttributesOnTargetPanel(ti){let ei=cn.getElementFromSelector(ti);ei&&(this._setAttributeIfNotExists(ei,"role","tabpanel"),ti.id&&this._setAttributeIfNotExists(ei,"aria-labelledby",`${ti.id}`))}_toggleDropDown(ti,ei){let ni=this._getOuterElement(ti);if(!ni.classList.contains(Lv))return;let ri=(si,ai)=>{let li=cn.findOne(si,ni);li&&li.classList.toggle(ai,ei)};ri(kd,Co),ri(Mv,Oc),ni.setAttribute("aria-expanded",ei)}_setAttributeIfNotExists(ti,ei,ni){ti.hasAttribute(ei)||ti.setAttribute(ei,ni)}_elemIsActive(ti){return ti.classList.contains(Co)}_getInnerElement(ti){return ti.matches(Mc)?ti:cn.findOne(Mc,ti)}_getOuterElement(ti){return ti.closest(Nv)||ti}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Mi.on(document,Sv,Nd,function(ii){["A","AREA"].includes(this.tagName)&&ii.preventDefault(),!to(this)&&Do.getOrCreateInstance(this).show()});Mi.on(window,Av,()=>{for(let ii of cn.find(Rv))Do.getOrCreateInstance(ii)});ws(Do);var Pv="toast",Hv="bs.toast",oo=`.${Hv}`,Fv=`mouseover${oo}`,$v=`mouseout${oo}`,Bv=`focusin${oo}`,zv=`focusout${oo}`,jv=`hide${oo}`,Vv=`hidden${oo}`,qv=`show${oo}`,Wv=`shown${oo}`,Uv="fade",od="hide",ll="show",cl="showing",Yv={animation:"boolean",autohide:"boolean",delay:"number"},Gv={animation:!0,autohide:!0,delay:5e3},Bs=class ii extends ps{constructor(ti,ei){super(ti,ei),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Gv}static get DefaultType(){return Yv}static get NAME(){return Pv}show(){if(Mi.trigger(this._element,qv).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Uv);let ei=()=>{this._element.classList.remove(cl),Mi.trigger(this._element,Wv),this._maybeScheduleHide()};this._element.classList.remove(od),La(this._element),this._element.classList.add(ll,cl),this._queueCallback(ei,this._element,this._config.animation)}hide(){if(!this.isShown()||Mi.trigger(this._element,jv).defaultPrevented)return;let ei=()=>{this._element.classList.add(od),this._element.classList.remove(cl,ll),Mi.trigger(this._element,Vv)};this._element.classList.add(cl),this._queueCallback(ei,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(ll),super.dispose()}isShown(){return this._element.classList.contains(ll)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(ti,ei){switch(ti.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=ei;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=ei;break}}if(ei){this._clearTimeout();return}let ni=ti.relatedTarget;this._element===ni||this._element.contains(ni)||this._maybeScheduleHide()}_setListeners(){Mi.on(this._element,Fv,ti=>this._onInteraction(ti,!0)),Mi.on(this._element,$v,ti=>this._onInteraction(ti,!1)),Mi.on(this._element,Bv,ti=>this._onInteraction(ti,!0)),Mi.on(this._element,zv,ti=>this._onInteraction(ti,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(ti){return this.each(function(){let ei=ii.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti](this)}})}};bl(Bs);ws(Bs);var gA=zo(Id()),vA=zo(El());function Mo(ii){return"error"in ii}function Un(ii){let ti=["","null","undefined"];return Array.isArray(ii)?ii.length>0:typeof ii=="string"&&!ti.includes(ii)||typeof ii=="number"||typeof ii=="boolean"?!0:typeof ii=="object"&&ii!==null}function wl(ii){return typeof ii!==null&&typeof ii!="undefined"}function Kv(ii,ti,ei){return ks(this,null,function*(){let ni=window.CSRF_TOKEN,ri=new Headers({"X-CSRFToken":ni}),si;typeof ei!="undefined"&&(si=JSON.stringify(ei),ri.set("content-type","application/json"));let ai=yield fetch(ii,{method:ti,body:si,headers:ri,credentials:"same-origin"}),li=ai.headers.get("Content-Type");if(typeof li=="string"&&li.includes("text"))return{error:yield ai.text()};let di=yield ai.json();return!ai.ok&&Array.isArray(di)?{error:di.join(`
`)}:!ai.ok&&"detail"in di?{error:di.detail}:di})}function ra(ii,ti){return ks(this,null,function*(){return yield Kv(ii,"PATCH",ti)})}function*Xi(...ii){for(let ti of ii)for(let ei of document.querySelectorAll(ti))ei!==null&&(yield ei)}function ka(ii){return document.getElementById(ii)}function Rd(ii,ti=0){let ei=ti,ni=document.getElementById("content-title");ni!==null&&(ei+=ni.getBoundingClientRect().bottom);let ri=ii.getBoundingClientRect().top+window.pageYOffset+ei;window.scrollTo({top:ri,behavior:"smooth"})}function Pd(ii,ti="select"){let ei=[];for(let ni of ii.querySelectorAll(ti))if(ni!==null){let ri={name:ni.name,options:[]};for(let si of ni.options)si.selected&&ri.options.push(si.value);ei=[...ei,ri]}return ei}function ko(ii,ti,ei){function ni(si){return!!(typeof ei=="string"&&si!==null&&si.matches(ei))}function ri(si){if(si!==null&&si.parentElement!==null&&!ni(si)){for(let ai of si.parentElement.querySelectorAll(ti))if(ai!==null)return ai;return ri(si.parentElement.parentElement)}return null}return ri(ii)}function jc(ii,ti,ei=null,ni=[]){let ri=document.createElement(ii);if(ti!==null)for(let si of Object.keys(ti)){let ai=si,li=ti[ai];ai in ri&&(ri[ai]=li)}ei!==null&&ei.length>0&&ri.classList.add(...ei);for(let si of ni)ri.appendChild(si);return ri}function sa(ii,ti,ei){if(typeof ii!="string")throw new TypeError("replaceAll 'input' argument must be a string");if(typeof ti!="string"&&!(ti instanceof RegExp))throw new TypeError("replaceAll 'pattern' argument must be a string or RegExp instance");switch(typeof ei){case"boolean":ei=String(ei);break;case"number":ei=String(ei);break;case"string":break;default:throw new TypeError("replaceAll 'replacement' argument must be stringifyable")}if(ti instanceof RegExp){let ni=Array.from(new Set([...ti.flags.split(""),"g"])).join("");ti=new RegExp(ti.source,ni)}else ti=new RegExp(ti,"g");return ii.replace(ti,ei)}function Qv(ii,ti){let ei=new Set;for(let ni of ti.querySelectorAll("*[name]"))ni.validity.valid?ni.classList.contains("is-invalid")&&ni.classList.remove("is-invalid"):(ei.add(ni.name),ni.classList.contains("is-invalid")||ni.classList.add("is-invalid"));if(ei.size!==0){let ni=ti.elements.namedItem(Array.from(ei)[0]);Rd(ni),ii.preventDefault()}}function Hd(){for(let ii of Xi("form")){let ti=ii.querySelectorAll("button[type=submit]");for(let ni of ti)ni.addEventListener("click",ri=>Qv(ri,ii));let ei=document.querySelector("button[data-reset-select]");ei!==null&&ei.addEventListener("click",()=>{window.location.assign(window.location.origin+window.location.pathname)})}}function Fd(){for(let ti of Xi("a.set_field_value"))if(ti!==null){let ei=function(ni){ni.preventDefault();let ri=ti.getAttribute("data"),si=document.getElementById(ti.target);si!==null&&ri!==null&&(si.value=ri)};var ii=ei;ti.addEventListener("click",ei)}}function $d(){for(let ii of[Hd,Fd])ii()}window.Collapse=io;window.Modal=Fs;window.Popover=ta;window.Toast=Bs;window.Tooltip=$s;function Xv(){for(let ii of Xi('[data-bs-toggle="tooltip"]'))new $s(ii,{container:"body"})}function Jv(){for(let ii of Xi('[data-bs-toggle="modal"]'))new Fs(ii)}function ao(ii,ti,ei,ni){let ri="mdi-alert";switch(ii){case"warning":ri="mdi-alert";break;case"success":ri="mdi-check-circle";break;case"info":ri="mdi-information";break;case"danger":ri="mdi-alert";break}let si=document.createElement("div");si.setAttribute("class","toast-container position-fixed bottom-0 end-0 m-3");let ai=document.createElement("div");ai.setAttribute("class",`toast bg-${ii}`),ai.setAttribute("role","alert"),ai.setAttribute("aria-live","assertive"),ai.setAttribute("aria-atomic","true");let li=document.createElement("div");li.setAttribute("class",`toast-header bg-${ii} text-body`);let di=document.createElement("i");di.setAttribute("class",`mdi ${ri}`);let mi=document.createElement("strong");mi.setAttribute("class","me-auto ms-1"),mi.innerText=ti;let hi=document.createElement("button");hi.setAttribute("type","button"),hi.setAttribute("class","btn-close"),hi.setAttribute("data-bs-dismiss","toast"),hi.setAttribute("aria-label","Close");let _i=document.createElement("div");if(_i.setAttribute("class","toast-body"),li.appendChild(di),li.appendChild(mi),typeof ni!="undefined"){let Ai=document.createElement("small");Ai.setAttribute("class","text-muted"),li.appendChild(Ai)}return li.appendChild(hi),_i.innerText=ei.trim(),ai.appendChild(li),ai.appendChild(_i),si.appendChild(ai),document.body.appendChild(si),new Bs(ai)}function Zv(){let{hash:ii}=location;if(ii&&ii.match(/^#tab_.+$/)){let ti=ii.replace("tab_","");for(let ei of Xi(`ul.nav.nav-tabs .nav-link[data-bs-target="${ti}"]`))new Do(ei).show()}}function ey(){let ii=document.querySelectorAll(".sidebar .accordion-item");function ti(ei){for(let ni of ii)ni!==ei?ni.classList.remove("is-open"):ni.classList.toggle("is-open")}for(let ei of ii)for(let ni of ei.querySelectorAll(".accordion-button"))ni.addEventListener("click",()=>{ti(ei)})}function ty(){for(let ii of Xi("a.image-preview")){let ti=`${Math.round(window.innerWidth/4)}px`,ei=jc("img",{src:ii.href});ei.style.maxWidth=ti;let ni=jc("div",null,null,[ei]);new ta(ii,{customClass:"image-preview-popover",trigger:"hover",html:!0,content:ni})}}function xl(){for(let ii of[Xv,Jv,Zv,ty,ey])ii()}function Bd(ii){let ti=ii.currentTarget,ei=document.getElementById("quicksearch_clear");Un(ei)&&(ti.value===""?ei.classList.add("invisible"):ei.classList.remove("invisible"))}function zd(){let ii=document.getElementById("export_current_view"),ti=ii==null?void 0:ii.href.split("&")[0];ii.setAttribute("href",ti)}function iy(ii){let ti=ii.currentTarget;if(zd(),ti!=null){let ei=document.getElementById("export_current_view"),ni=`q=${ti.value}`,ri=(ei==null?void 0:ei.href)+"&"+ni;ei.setAttribute("href",ri)}}function jd(){let ii=document.getElementById("quicksearch"),ti=document.getElementById("quicksearch_clear");Un(ii)&&(ii.addEventListener("keyup",Bd,{passive:!0}),ii.addEventListener("search",Bd,{passive:!0}),ii.addEventListener("change",iy,{passive:!0}),Un(ti)&&ti.addEventListener("click",()=>ks(this,null,function*(){let ei=new Event("search");ii.value="",yield new Promise(ni=>setTimeout(ni,100)),ii.dispatchEvent(ei),zd()}),{passive:!0}))}var Vc=zo(El());function Na(ii){let ti={};return ti.clear_button={html:ei=>`<i class="mdi mdi-close-circle ${ei.className}" title="${ei.title}"></i>`},ii.hasAttribute("multiple")&&(ti.remove_button={title:"Remove"}),{plugins:ti}}function Vd(){for(let ii of Xi("select:not(.tomselected):not(.no-ts):not([size]):not(.api-select):not(.color-select)"))new Vc.default(ii,Hn(Ui({},Na(ii)),{maxOptions:void 0}))}function qd(){function ii(ti,ei){return`<div><span class="dropdown-item-indicator color-label" style="background-color: #${ei(ti.value)}"></span> ${ei(ti.text)}</div>`}for(let ti of Xi("select.color-select:not(.tomselected)"))new Vc.default(ti,Hn(Ui({},Na(ti)),{maxOptions:void 0,render:{option:ii,item:ii}}))}var ny=zo(Ud());var Yd=(ii,ti)=>{if(Array.isArray(ii))ii.forEach(ti);else for(var ei in ii)ii.hasOwnProperty(ei)&&ti(ii[ei],ei)};var Gd=(ii,...ti)=>{var ei=ry(ti);ii=sy(ii),ii.map(ni=>{ei.map(ri=>{ni.classList.add(ri)})})};var ry=ii=>{var ti=[];return Yd(ii,ei=>{typeof ei=="string"&&(ei=ei.trim().split(/[\11\12\14\15\40]/)),Array.isArray(ei)&&(ti=ti.concat(ei))}),ti.filter(Boolean)},sy=ii=>(Array.isArray(ii)||(ii=[ii]),ii);var Kc={};hu(Kc,{exclude:()=>hy,extract:()=>Yc,parse:()=>Gc,parseUrl:()=>sf,pick:()=>af,stringify:()=>rf,stringifyUrl:()=>of});var Xd="%[a-f0-9]{2}",Kd=new RegExp("("+Xd+")|([^%]+?)","gi"),Qd=new RegExp("("+Xd+")+","gi");function qc(ii,ti){try{return[decodeURIComponent(ii.join(""))]}catch(ri){}if(ii.length===1)return ii;ti=ti||1;let ei=ii.slice(0,ti),ni=ii.slice(ti);return Array.prototype.concat.call([],qc(ei),qc(ni))}function oy(ii){try{return decodeURIComponent(ii)}catch(ti){let ei=ii.match(Kd)||[];for(let ni=1;ni<ei.length;ni++)ii=qc(ei,ni).join(""),ei=ii.match(Kd)||[];return ii}}function ay(ii){let ti={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},ei=Qd.exec(ii);for(;ei;){try{ti[ei[0]]=decodeURIComponent(ei[0])}catch(ri){let si=oy(ei[0]);si!==ei[0]&&(ti[ei[0]]=si)}ei=Qd.exec(ii)}ti["%C2"]="\uFFFD";let ni=Object.keys(ti);for(let ri of ni)ii=ii.replace(new RegExp(ri,"g"),ti[ri]);return ii}function Wc(ii){if(typeof ii!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof ii+"`");try{return decodeURIComponent(ii)}catch(ti){return ay(ii)}}function Jd(ii,ti){let ei={};if(Array.isArray(ti))for(let ni of ti){let ri=Object.getOwnPropertyDescriptor(ii,ni);ri!=null&&ri.enumerable&&Object.defineProperty(ei,ni,ri)}else for(let ni of Reflect.ownKeys(ii)){let ri=Object.getOwnPropertyDescriptor(ii,ni);if(ri.enumerable){let si=ii[ni];ti(ni,si,ii)&&Object.defineProperty(ei,ni,ri)}}return ei}function Sl(ii,ti){if(!(typeof ii=="string"&&typeof ti=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(ii===""||ti==="")return[];let ei=ii.indexOf(ti);return ei===-1?[]:[ii.slice(0,ei),ii.slice(ei+ti.length)]}var ly=ii=>ii==null,cy=ii=>encodeURIComponent(ii).replaceAll(/[!'()*]/g,ti=>`%${ti.charCodeAt(0).toString(16).toUpperCase()}`),Uc=Symbol("encodeFragmentIdentifier");function uy(ii){switch(ii.arrayFormat){case"index":return ti=>(ei,ni)=>{let ri=ei.length;return ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,[Jn(ti,ii),"[",ri,"]"].join("")]:[...ei,[Jn(ti,ii),"[",Jn(ri,ii),"]=",Jn(ni,ii)].join("")]};case"bracket":return ti=>(ei,ni)=>ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,[Jn(ti,ii),"[]"].join("")]:[...ei,[Jn(ti,ii),"[]=",Jn(ni,ii)].join("")];case"colon-list-separator":return ti=>(ei,ni)=>ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,[Jn(ti,ii),":list="].join("")]:[...ei,[Jn(ti,ii),":list=",Jn(ni,ii)].join("")];case"comma":case"separator":case"bracket-separator":{let ti=ii.arrayFormat==="bracket-separator"?"[]=":"=";return ei=>(ni,ri)=>ri===void 0||ii.skipNull&&ri===null||ii.skipEmptyString&&ri===""?ni:(ri=ri===null?"":ri,ni.length===0?[[Jn(ei,ii),ti,Jn(ri,ii)].join("")]:[[ni,Jn(ri,ii)].join(ii.arrayFormatSeparator)])}default:return ti=>(ei,ni)=>ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,Jn(ti,ii)]:[...ei,[Jn(ti,ii),"=",Jn(ni,ii)].join("")]}}function dy(ii){let ti;switch(ii.arrayFormat){case"index":return(ei,ni,ri)=>{if(ti=/\[(\d*)]$/.exec(ei),ei=ei.replace(/\[\d*]$/,""),!ti){ri[ei]=ni;return}ri[ei]===void 0&&(ri[ei]={}),ri[ei][ti[1]]=ni};case"bracket":return(ei,ni,ri)=>{if(ti=/(\[])$/.exec(ei),ei=ei.replace(/\[]$/,""),!ti){ri[ei]=ni;return}if(ri[ei]===void 0){ri[ei]=[ni];return}ri[ei]=[...ri[ei],ni]};case"colon-list-separator":return(ei,ni,ri)=>{if(ti=/(:list)$/.exec(ei),ei=ei.replace(/:list$/,""),!ti){ri[ei]=ni;return}if(ri[ei]===void 0){ri[ei]=[ni];return}ri[ei]=[...ri[ei],ni]};case"comma":case"separator":return(ei,ni,ri)=>{let si=typeof ni=="string"&&ni.includes(ii.arrayFormatSeparator),ai=typeof ni=="string"&&!si&&js(ni,ii).includes(ii.arrayFormatSeparator);ni=ai?js(ni,ii):ni;let li=si||ai?ni.split(ii.arrayFormatSeparator).map(di=>js(di,ii)):ni===null?ni:js(ni,ii);ri[ei]=li};case"bracket-separator":return(ei,ni,ri)=>{let si=/(\[])$/.test(ei);if(ei=ei.replace(/\[]$/,""),!si){ri[ei]=ni&&js(ni,ii);return}let ai=ni===null?[]:ni.split(ii.arrayFormatSeparator).map(li=>js(li,ii));if(ri[ei]===void 0){ri[ei]=ai;return}ri[ei]=[...ri[ei],...ai]};default:return(ei,ni,ri)=>{if(ri[ei]===void 0){ri[ei]=ni;return}ri[ei]=[...[ri[ei]].flat(),ni]}}}function ef(ii){if(typeof ii!="string"||ii.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Jn(ii,ti){return ti.encode?ti.strict?cy(ii):encodeURIComponent(ii):ii}function js(ii,ti){return ti.decode?Wc(ii):ii}function tf(ii){return Array.isArray(ii)?ii.sort():typeof ii=="object"?tf(Object.keys(ii)).sort((ti,ei)=>Number(ti)-Number(ei)).map(ti=>ii[ti]):ii}function nf(ii){let ti=ii.indexOf("#");return ti!==-1&&(ii=ii.slice(0,ti)),ii}function fy(ii){let ti="",ei=ii.indexOf("#");return ei!==-1&&(ti=ii.slice(ei)),ti}function Zd(ii,ti,ei){return ei==="string"&&typeof ii=="string"?ii:typeof ei=="function"&&typeof ii=="string"?ei(ii):ti.parseBooleans&&ii!==null&&(ii.toLowerCase()==="true"||ii.toLowerCase()==="false")?ii.toLowerCase()==="true":ei==="number"&&!Number.isNaN(Number(ii))&&typeof ii=="string"&&ii.trim()!==""||ti.parseNumbers&&!Number.isNaN(Number(ii))&&typeof ii=="string"&&ii.trim()!==""?Number(ii):ii}function Yc(ii){ii=nf(ii);let ti=ii.indexOf("?");return ti===-1?"":ii.slice(ti+1)}function Gc(ii,ti){ti=Ui({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null)},ti),ef(ti.arrayFormatSeparator);let ei=dy(ti),ni=Object.create(null);if(typeof ii!="string"||(ii=ii.trim().replace(/^[?#&]/,""),!ii))return ni;for(let ri of ii.split("&")){if(ri==="")continue;let si=ti.decode?ri.replaceAll("+"," "):ri,[ai,li]=Sl(si,"=");ai===void 0&&(ai=si),li=li===void 0?null:["comma","separator","bracket-separator"].includes(ti.arrayFormat)?li:js(li,ti),ei(js(ai,ti),li,ni)}for(let[ri,si]of Object.entries(ni))if(typeof si=="object"&&si!==null&&ti.types[ri]!=="string")for(let[ai,li]of Object.entries(si)){let di=ti.types[ri]?ti.types[ri].replace("[]",""):void 0;si[ai]=Zd(li,ti,di)}else typeof si=="object"&&si!==null&&ti.types[ri]==="string"?ni[ri]=Object.values(si).join(ti.arrayFormatSeparator):ni[ri]=Zd(si,ti,ti.types[ri]);return ti.sort===!1?ni:(ti.sort===!0?Object.keys(ni).sort():Object.keys(ni).sort(ti.sort)).reduce((ri,si)=>{let ai=ni[si];return ri[si]=ai&&typeof ai=="object"&&!Array.isArray(ai)?tf(ai):ai,ri},Object.create(null))}function rf(ii,ti){if(!ii)return"";ti=Ui({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},ti),ef(ti.arrayFormatSeparator);let ei=ai=>ti.skipNull&&ly(ii[ai])||ti.skipEmptyString&&ii[ai]==="",ni=uy(ti),ri={};for(let[ai,li]of Object.entries(ii))ei(ai)||(ri[ai]=li);let si=Object.keys(ri);return ti.sort!==!1&&si.sort(ti.sort),si.map(ai=>{let li=ii[ai];return li===void 0?"":li===null?Jn(ai,ti):Array.isArray(li)?li.length===0&&ti.arrayFormat==="bracket-separator"?Jn(ai,ti)+"[]":li.reduce(ni(ai),[]).join("&"):Jn(ai,ti)+"="+Jn(li,ti)}).filter(ai=>ai.length>0).join("&")}function sf(ii,ti){var ri,si;ti=Ui({decode:!0},ti);let[ei,ni]=Sl(ii,"#");return ei===void 0&&(ei=ii),Ui({url:(si=(ri=ei==null?void 0:ei.split("?"))==null?void 0:ri[0])!=null?si:"",query:Gc(Yc(ii),ti)},ti&&ti.parseFragmentIdentifier&&ni?{fragmentIdentifier:js(ni,ti)}:{})}function of(ii,ti){ti=Ui({encode:!0,strict:!0,[Uc]:!0},ti);let ei=nf(ii.url).split("?")[0]||"",ni=Yc(ii.url),ri=Ui(Ui({},Gc(ni,{sort:!1})),ii.query),si=rf(ri,ti);si&&(si=`?${si}`);let ai=fy(ii.url);if(typeof ii.fragmentIdentifier=="string"){let li=new URL(ei);li.hash=ii.fragmentIdentifier,ai=ti[Uc]?li.hash:`#${ii.fragmentIdentifier}`}return`${ei}${si}${ai}`}function af(ii,ti,ei){ei=Ui({parseFragmentIdentifier:!0,[Uc]:!1},ei);let{url:ni,query:ri,fragmentIdentifier:si}=sf(ii,ei);return of({url:ni,query:Jd(ri,ti),fragmentIdentifier:si},ei)}function hy(ii,ti,ei){let ni=Array.isArray(ti)?ri=>!ti.includes(ri):(ri,si)=>!ti(ri,si);return af(ii,ni,ei)}var lf=Kc;var uf=zo(El());function cf(ii){if(Array.isArray(ii)){for(let ti of ii)if(typeof ti=="object"&&ti!==null&&"fieldName"in ti&&"queryParam"in ti)return typeof ti.fieldName=="string"&&typeof ti.queryParam=="string"}return!1}var Cl=class extends Map{queryParam(ti){let ei=this.get(ti);return typeof ei!="undefined"?ei.queryParam:null}queryValue(ti){let ei=this.get(ti);return typeof ei!="undefined"?ei.queryValue:[]}updateValue(ti,ei){let ni=this.get(ti);if(Un(ni)){let{queryParam:ri}=ni;return this.set(ti,{queryParam:ri,queryValue:ei}),!0}return!1}addFromJson(ti){if(Un(ti)){let ei=JSON.parse(ti);if(cf(ei))for(let{queryParam:ni,fieldName:ri}of ei)this.set(ri,{queryParam:ni,queryValue:[]});else throw new Error(`Data from 'data-dynamic-params' attribute is improperly formatted: '${ti}'`)}}};var Al=class extends uf.default{constructor(ei,ni){super(ei,ni);Rn(this,"nullOption",null);Rn(this,"queryParams",new Map);Rn(this,"staticParams",new Map);Rn(this,"dynamicParams",new Cl);Rn(this,"pathValues",new Map);this.api_url=this.input.getAttribute("data-url"),this.valueField=this.input.getAttribute("ts-value-field")||this.settings.valueField,this.labelField=this.input.getAttribute("ts-label-field")||this.settings.labelField,this.disabledField=this.input.getAttribute("ts-disabled-field")||this.settings.disabledField,this.descriptionField=this.input.getAttribute("ts-description-field")||"description",this.depthField=this.input.getAttribute("ts-depth-field")||"_depth",this.parentField=this.input.getAttribute("ts-parent-field")||null,this.countField=this.input.getAttribute("ts-count-field")||null;let ri=this.input.getAttribute("data-null-option");if(ri){let si=this.settings.valueField,ai=this.settings.labelField;this.nullOption={},this.nullOption[si]="null",this.nullOption[ai]=ri}this.getStaticParams();for(let[si,ai]of this.staticParams.entries())this.queryParams.set(si,ai);this.getDynamicParams();for(let si of this.dynamicParams.keys())this.updateQueryParams(si);this.getPathKeys();for(let si of this.pathValues.keys())this.updatePathValues(si);this.addEventListeners()}load(ei){let ni=this;ni.clearOptions(),ni.nullOption&&!ei&&ni.addOption(ni.nullOption);let ri=ni.getRequestUrl(ei);ri&&(Gd(ni.wrapper,ni.settings.loadingClass),ni.loading++,fetch(ri).then(si=>si.json()).then(si=>{let ai=si.results,li=[];for(let di of ai){let mi=ni.getOptionFromData(di);li.push(mi)}return li}).then(si=>{ni.loadCallback(si,[])}).catch(()=>{ni.loadCallback([],[])}))}getRequestUrl(ei){let ni=this.api_url,ri={};for(let[si,ai]of this.queryParams.entries())ri[si]=ai;for(let[si,ai]of this.pathValues.entries())for(let li of this.api_url.matchAll(new RegExp(`({{${si}}})`,"g")))if(ai)ni=sa(ni,li[1],ai.toString());else return"";return ei&&(ri.q=[ei]),ri.brief=[!0],ri.limit=[this.settings.maxOptions],lf.stringifyUrl({url:ni,query:ri})}getOptionFromData(ei){let ni={id:ei[this.valueField],display:ei[this.labelField],depth:ei[this.depthField]||null,description:ei[this.descriptionField]||null};if(ei[this.parentField]){let ri=ei[this.parentField];ni.parent=ri[this.labelField]}return ei[this.countField]&&(ni.count=ei[this.countField]),ei[this.disabledField]&&(ni.disabled=ei[this.disabledField]),ni}getStaticParams(){let ei=this.input.getAttribute("data-static-params");try{if(ei){let ni=JSON.parse(ei);if(ni)for(let{queryParam:ri,queryValue:si}of ni)Array.isArray(si)?this.staticParams.set(ri,si):this.staticParams.set(ri,[si])}}catch(ni){console.group(`Unable to determine static query parameters for select field '${this.name}'`),console.warn(ni),console.groupEnd()}}getDynamicParams(){let ei=this.input.getAttribute("data-dynamic-params");try{this.dynamicParams.addFromJson(ei)}catch(ni){console.group(`Unable to determine dynamic query parameters for select field '${this.name}'`),console.warn(ni),console.groupEnd()}}getPathKeys(){for(let ei of this.api_url.matchAll(new RegExp("{{(.+)}}","g")))this.pathValues.set(ei[1],"")}updateQueryParams(ei){let ni=document.querySelector(`[name="${ei}"]`);if(ni!==null){let ri=[];if(ni.multiple?ri=Array.from(ni.options).filter(si=>si.selected).map(si=>si.value):ni.value!==""&&(ri=[ni.value]),ri.length>0){this.dynamicParams.updateValue(ei,ri);let si=this.dynamicParams.get(ei);if(typeof si!="undefined"){let{queryParam:ai,queryValue:li}=si,di=[];if(this.staticParams.has(ai)){let mi=this.staticParams.get(ai);typeof mi!="undefined"&&(di=[...mi,...li])}else di=li;di.length>0?this.queryParams.set(ai,di):this.queryParams.delete(ai)}}else{let si=this.dynamicParams.queryParam(ei);si!==null&&this.queryParams.delete(si)}}}updatePathValues(ei){let ni=sa(ei,/^id_/i,""),ri=ka(`id_${ni}`);ri!==null&&this.api_url.includes("{{")&&this.api_url.match(new RegExp(`({{(${ei})}})`,"g"))&&(ri.value?this.pathValues.set(ei,ri.value):this.pathValues.set(ei,""))}addEventListeners(){let ei=new Set([...this.dynamicParams.keys(),...this.pathValues.keys()]);for(let ni of ei){let ri=document.querySelector(`[name="${ni}"]`);ri!==null&&ri.addEventListener("change",si=>this.handleEvent(si)),this.input.addEventListener(`netbox.select.onload.${ni}`,si=>this.handleEvent(si))}}handleEvent(ei){let ni=ei.target;this.updateQueryParams(ni.name),this.updatePathValues(ni.name),this.clear(),this.load(this.lastValue)}};var py="id",Dl="display",my=100;function gy(ii,ti){let ei="<div>";return typeof ii.depth=="number"&&ii.depth>0&&(ei=`${ei}${"\u2500".repeat(ii.depth)} `),ei=`${ei}${ti(ii[Dl])}`,ii.parent&&(ei=`${ei} <span class="text-secondary">${ti(ii.parent)}</span>`),ii.count&&(ei=`${ei} <span class="badge">${ti(ii.count)}</span>`),ii.description&&(ei=`${ei}<br /><small class="text-secondary">${ti(ii.description)}</small>`),ei=`${ei}</div>`,ei}function vy(ii,ti){return ii.parent?`<div>${ti(ii.parent)} > ${ti(ii[Dl])}</div>`:`<div>${ti(ii[Dl])}<div>`}function df(){for(let ii of Xi("select.api-select:not(.tomselected)"))new Al(ii,Hn(Ui({},Na(ii)),{valueField:py,labelField:Dl,maxOptions:my,searchField:[],preload:"focus",render:{option:gy,item:vy},shouldLoad:function(){return!0}}))}function Ol(){Vd(),df(),qd()}function ff(ii,ti){var ri;let ei=(ri=ii.parentElement)==null?void 0:ri.parentElement,ni=ii.getAttribute("data-url");Un(ni)&&ra(ni,{status:ti}).then(si=>{if(Mo(si)){ao("danger","Error",si.error).show();return}else ei.setAttribute("data-cable-status",ti)})}function hf(){for(let ii of Xi("button.mark-planned"))ii.addEventListener("click",()=>ff(ii,"planned"));for(let ii of Xi("button.mark-installed"))ii.addEventListener("click",()=>ff(ii,"connected"))}var Qc=class{set(ti,ei,ni){return ti[ei]=ni,!0}get(ti,ei){return ti[ei]}has(ti,ei){return ei in ti}},Ia=class{constructor(ti,ei){Rn(this,"handlers");Rn(this,"proxy");Rn(this,"options");Rn(this,"key","");if(this.options=ei,typeof this.options.key=="string"?this.key=this.options.key:this.key=this.generateStateKey(ti),this.options.persist){let ni=this.retrieve();ni!==null&&(ti=Ui(Ui({},ti),ni))}this.handlers=new Qc,this.proxy=new Proxy(ti,this.handlers),this.options.persist&&this.save()}generateStateKey(ti){return`netbox-${window.btoa(Object.keys(ti).join("---"))}`}get(ti){return this.handlers.get(this.proxy,ti)}set(ti,ei){this.handlers.set(this.proxy,ti,ei),this.options.persist&&this.save()}all(){return this.proxy}keys(){return Object.keys(this.proxy)}values(){return Object.values(this.proxy)}save(){let ti=JSON.stringify(this.proxy);localStorage.setItem(this.key,ti)}retrieve(){let ti=localStorage.getItem(this.key);return ti!==null?JSON.parse(ti):null}};function lo(ii,ti={}){return new Ia(ii,ti)}var Xc=lo({hidden:!1},{persist:!0,key:"netbox-object-depth"});var Jc=lo({view:"images-and-labels"},{persist:!0});var pf=lo({element:null},{persist:!1});var mf=lo({hidden:!0},{persist:!0,key:"netbox-secret"});function gf(ii,ti){ti.setAttribute("data-depth-indicators",ii?"hidden":"shown"),ti.innerText=ii?"Show Depth Indicators":"Hide Depth Indicators"}function vf(){for(let ii of Xi(".record-depth"))ii.style.display=""}function yf(){for(let ii of Xi(".record-depth"))ii.style.display="none"}function yy(ii,ti){let ei=ii.get("hidden");ii.set("hidden",!ei);let ni=ii.get("hidden");ni?yf():vf(),gf(ni,ti)}function _f(){let ii=Xc.get("hidden");for(let ti of Xi("button.toggle-depth"))gf(ii,ti),ti.addEventListener("click",ei=>{yy(Xc,ei.currentTarget)},!1);ii?yf():ii||vf()}function _y(ii){let ti=Array.from(ii.options);for(let ei=1;ei<ti.length;ei++){let ni=ti[ei];ni.selected&&(ii.removeChild(ni),ii.insertBefore(ni,ii.options[ei-1]))}}function by(ii){let ti=Array.from(ii.options);for(let ei=ti.length-2;ei>=0;ei--){let ni=ti[ei];if(ni.selected){let ri=ii.options[ei+1];ni=ii.removeChild(ni),ri=ii.replaceChild(ni,ri),ii.insertBefore(ri,ni)}}}function bf(){for(let ii of Xi("#move-option-up")){let ti=ii.getAttribute("data-target");if(ti!==null)for(let ei of Xi(`#${ti}`))ii.addEventListener("click",()=>_y(ei))}for(let ii of Xi("#move-option-down")){let ti=ii.getAttribute("data-target");if(ti!==null)for(let ei of Xi(`#${ti}`))ii.addEventListener("click",()=>by(ei))}}function Ef(ii,ti){return ii.replace(/[^\-.\w\s]/g,"").replace(/^[\s.]+|[\s.]+$/g,"").replace(/[-.\s]+/g,"-").toLowerCase().substring(0,ti)}function wf(){let ii=document.getElementById("id_slug"),ti=document.getElementById("reslug");if(ii===null||ti===null)return;let ei=ii.getAttribute("slug-source"),ni=document.getElementById(`id_${ei}`);if(ni===null){console.error("Unable to find field for slug field.");return}let ri=ii.getAttribute("maxlength"),si=50;ri&&(si=Number(ri)),ni.addEventListener("blur",()=>{ii.value||(ii.value=Ef(ni.value,si))}),ti.addEventListener("click",()=>{ii.value=Ef(ni.value,si)})}function Ey(ii){if(!ii.currentTarget.checked)for(let ei of Xi('input[type="checkbox"].toggle',"input#select-all"))ei.checked=!1}function wy(ii){let ti=ii.currentTarget,ei=ko(ti,"table"),ni=document.getElementById("select-all-box"),ri=document.getElementById("select-all");if(ei!==null){for(let si of ei.querySelectorAll('tr:not(.d-none) input[type="checkbox"][name="pk"]'))ti.checked?si.checked=!0:si.checked=!1;ni!==null&&(ti.checked?ni.classList.remove("d-none"):(ni.classList.add("d-none"),ri!==null&&(ri.checked=!1)))}}function xf(){for(let ii of Xi('table tr th > input[type="checkbox"].toggle'))ii.addEventListener("change",wy);for(let ii of Xi('input[type="checkbox"][name="pk"]'))ii.addEventListener("change",Ey)}function Sf(){var ii;(ii=window.getSelection())==null||ii.removeAllRanges()}function Tf(ii,ti){ti.set("element",ii)}function xy(ii,ti,ei){let ni=!1;for(let ri of ei){let si=ri;if(ni===!0&&(si.checked=ii.checked),ri===ti){if(ni===!0){ni=!1;return}ni=!0,si.checked=ii.checked}if(ri===ii){if(ni===!0){ni=!1;return}ni=!0}}}function Ty(ii,ti){let ei=ii.target,ni=ti.get("element");if(Tf(ei,ti),!ii.shiftKey)return;if(Sf(),ni===null)return Tf(ei,ti);let ri=Xi('input[type="checkbox"][name="pk"]');xy(ei,ni,ri)}function Cf(){let ii=Xi('input[type="checkbox"][name="pk"]');for(let ti of ii)ti.addEventListener("click",ei=>{Sf(),ei.stopPropagation(),Ty(ei,pf)})}function Sy(ii){let ti=ii.querySelector("button.preview-button"),ei=ii.querySelector("textarea"),ni=ii.querySelector("div.preview");if(!Un(ei.style.height)){let{height:ri}=ei.getBoundingClientRect();ei.style.height=`${ri}px`}ti.addEventListener("htmx:configRequest",ri=>{ri.detail.parameters={text:ei.value||""},ri.detail.headers["X-CSRFToken"]=window.CSRF_TOKEN,ni.style.minHeight=ei.style.height,ni.innerHTML=""})}function Af(){for(let ii of document.querySelectorAll(".markdown-widget"))Sy(ii)}function Cy(ii,ti){ti.setAttribute("data-secret-visibility",ii?"hidden":"shown"),ti.innerText=ii?"Show Secret":"Hide Secret"}function Ay(){let ii=ka("secret");if(Un(ii)){let ti=ii.getAttribute("data-secret");Un(ti)&&(ii.innerText=ti)}}function Of(){let ii=ka("secret");if(Un(ii)){let ti=ii.getAttribute("data-secret");Un(ti)&&(ii.innerText="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022")}}function Dy(ii,ti){ii.set("hidden",!ii.get("hidden"));let ei=ii.get("hidden");ei?Of():Ay(),Cy(ei,ti)}function Df(ii){Dy(mf,ii.currentTarget)}function Lf(){Of();for(let ii of Xi("button.toggle-secret"))ii.removeEventListener("click",Df),ii.addEventListener("click",Df)}function Ll(){for(let ii of[_f,hf,wf,xf,Cf,bf,Af,Lf])ii()}var Zc="netbox-color-mode";function Oy(ii){return ii==="dark"||ii==="light"}function Ly(ii){return localStorage.setItem(Zc,ii)}function My(ii){var ei,ni;let ti=document.querySelector("body");ti&&ii=="dark"?ti.setAttribute("data-bs-theme","dark"):ti&&ti.setAttribute("data-bs-theme","light");for(let ri of Xi(".rack_elevation")){let si=(ni=(ei=ri.contentDocument)==null?void 0:ei.querySelector("svg"))!=null?ni:null;si!==null&&si.setAttribute("data-bs-theme",ii)}}function co(ii){Ly(ii),My(ii)}function ky(){let ii=localStorage.getItem(Zc);ii==="light"?co("dark"):ii==="dark"?co("light"):console.warn("Unable to determine the current color mode")}function Ny(){let ii=localStorage.getItem(Zc);if(Un(ii))return co(ii);let ti="none";for(let ei of["dark","light"])if(window.matchMedia(`(prefers-color-scheme: ${ei})`).matches){ti=ei;break}if(Un(ii)&&Oy(ii))return co(ii);switch(ti){case"dark":return co("dark");case"light":return co("light");case"none":return co("light");default:return co("light")}}function Iy(){for(let ii of Xi("button.color-mode-toggle"))ii.addEventListener("click",ky)}function Mf(){window.addEventListener("load",Ny);for(let ii of[Iy])ii()}function Ml(){let ii=document.querySelectorAll("body > div#django-messages > div.toast");for(let ti of ii)if(ti!==null){let ei=new Bs(ti);ei.isShown()||ei.show()}}var Nf=zo(kf());function kl(){for(let ii of Xi(".copy-content"))new Nf.default(ii)}var Nl=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],uo={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(ii){return typeof console!="undefined"&&console.warn(ii)},getWeek:function(ii){var ti=new Date(ii.getTime());ti.setHours(0,0,0,0),ti.setDate(ti.getDate()+3-(ti.getDay()+6)%7);var ei=new Date(ti.getFullYear(),0,4);return 1+Math.round(((ti.getTime()-ei.getTime())/864e5-3+(ei.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var Il={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(ii){var ti=ii%100;if(ti>3&&ti<21)return"th";switch(ti%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Rl=Il;var Zr=function(ii,ti){return ti===void 0&&(ti=2),("000"+ii).slice(ti*-1)},cs=function(ii){return ii===!0?1:0};function tu(ii,ti){var ei;return function(){var ni=this,ri=arguments;clearTimeout(ei),ei=setTimeout(function(){return ii.apply(ni,ri)},ti)}}var Pl=function(ii){return ii instanceof Array?ii:[ii]};function es(ii,ti,ei){if(ei===!0)return ii.classList.add(ti);ii.classList.remove(ti)}function An(ii,ti,ei){var ni=window.document.createElement(ii);return ti=ti||"",ei=ei||"",ni.className=ti,ei!==void 0&&(ni.textContent=ei),ni}function Pa(ii){for(;ii.firstChild;)ii.removeChild(ii.firstChild)}function iu(ii,ti){if(ti(ii))return ii;if(ii.parentNode)return iu(ii.parentNode,ti)}function Ha(ii,ti){var ei=An("div","numInputWrapper"),ni=An("input","numInput "+ii),ri=An("span","arrowUp"),si=An("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?ni.type="number":(ni.type="text",ni.pattern="\\d*"),ti!==void 0)for(var ai in ti)ni.setAttribute(ai,ti[ai]);return ei.appendChild(ni),ei.appendChild(ri),ei.appendChild(si),ei}function us(ii){try{if(typeof ii.composedPath=="function"){var ti=ii.composedPath();return ti[0]}return ii.target}catch(ei){return ii.target}}var nu=function(){},Fa=function(ii,ti,ei){return ei.months[ti?"shorthand":"longhand"][ii]},If={D:nu,F:function(ii,ti,ei){ii.setMonth(ei.months.longhand.indexOf(ti))},G:function(ii,ti){ii.setHours((ii.getHours()>=12?12:0)+parseFloat(ti))},H:function(ii,ti){ii.setHours(parseFloat(ti))},J:function(ii,ti){ii.setDate(parseFloat(ti))},K:function(ii,ti,ei){ii.setHours(ii.getHours()%12+12*cs(new RegExp(ei.amPM[1],"i").test(ti)))},M:function(ii,ti,ei){ii.setMonth(ei.months.shorthand.indexOf(ti))},S:function(ii,ti){ii.setSeconds(parseFloat(ti))},U:function(ii,ti){return new Date(parseFloat(ti)*1e3)},W:function(ii,ti,ei){var ni=parseInt(ti),ri=new Date(ii.getFullYear(),0,2+(ni-1)*7,0,0,0,0);return ri.setDate(ri.getDate()-ri.getDay()+ei.firstDayOfWeek),ri},Y:function(ii,ti){ii.setFullYear(parseFloat(ti))},Z:function(ii,ti){return new Date(ti)},d:function(ii,ti){ii.setDate(parseFloat(ti))},h:function(ii,ti){ii.setHours((ii.getHours()>=12?12:0)+parseFloat(ti))},i:function(ii,ti){ii.setMinutes(parseFloat(ti))},j:function(ii,ti){ii.setDate(parseFloat(ti))},l:nu,m:function(ii,ti){ii.setMonth(parseFloat(ti)-1)},n:function(ii,ti){ii.setMonth(parseFloat(ti)-1)},s:function(ii,ti){ii.setSeconds(parseFloat(ti))},u:function(ii,ti){return new Date(parseFloat(ti))},w:nu,y:function(ii,ti){ii.setFullYear(2e3+parseFloat(ti))}},Vs={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},oa={Z:function(ii){return ii.toISOString()},D:function(ii,ti,ei){return ti.weekdays.shorthand[oa.w(ii,ti,ei)]},F:function(ii,ti,ei){return Fa(oa.n(ii,ti,ei)-1,!1,ti)},G:function(ii,ti,ei){return Zr(oa.h(ii,ti,ei))},H:function(ii){return Zr(ii.getHours())},J:function(ii,ti){return ti.ordinal!==void 0?ii.getDate()+ti.ordinal(ii.getDate()):ii.getDate()},K:function(ii,ti){return ti.amPM[cs(ii.getHours()>11)]},M:function(ii,ti){return Fa(ii.getMonth(),!0,ti)},S:function(ii){return Zr(ii.getSeconds())},U:function(ii){return ii.getTime()/1e3},W:function(ii,ti,ei){return ei.getWeek(ii)},Y:function(ii){return Zr(ii.getFullYear(),4)},d:function(ii){return Zr(ii.getDate())},h:function(ii){return ii.getHours()%12?ii.getHours()%12:12},i:function(ii){return Zr(ii.getMinutes())},j:function(ii){return ii.getDate()},l:function(ii,ti){return ti.weekdays.longhand[ii.getDay()]},m:function(ii){return Zr(ii.getMonth()+1)},n:function(ii){return ii.getMonth()+1},s:function(ii){return ii.getSeconds()},u:function(ii){return ii.getTime()},w:function(ii){return ii.getDay()},y:function(ii){return String(ii.getFullYear()).substring(2)}};var ru=function(ii){var ti=ii.config,ei=ti===void 0?uo:ti,ni=ii.l10n,ri=ni===void 0?Il:ni,si=ii.isMobile,ai=si===void 0?!1:si;return function(li,di,mi){var hi=mi||ri;return ei.formatDate!==void 0&&!ai?ei.formatDate(li,di,hi):di.split("").map(function(_i,Ei,Ai){return oa[_i]&&Ai[Ei-1]!=="\\"?oa[_i](li,hi,ei):_i!=="\\"?_i:""}).join("")}},Hl=function(ii){var ti=ii.config,ei=ti===void 0?uo:ti,ni=ii.l10n,ri=ni===void 0?Il:ni;return function(si,ai,li,di){if(!(si!==0&&!si)){var mi=di||ri,hi,_i=si;if(si instanceof Date)hi=new Date(si.getTime());else if(typeof si!="string"&&si.toFixed!==void 0)hi=new Date(si);else if(typeof si=="string"){var Ei=ai||(ei||uo).dateFormat,Ai=String(si).trim();if(Ai==="today")hi=new Date,li=!0;else if(ei&&ei.parseDate)hi=ei.parseDate(si,Ei);else if(/Z$/.test(Ai)||/GMT$/.test(Ai))hi=new Date(si);else{for(var ki=void 0,Ti=[],Fi=0,en=0,rn="";Fi<Ei.length;Fi++){var ln=Ei[Fi],Yi=ln==="\\",on=Ei[Fi-1]==="\\"||Yi;if(Vs[ln]&&!on){rn+=Vs[ln];var an=new RegExp(rn).exec(si);an&&(ki=!0)&&Ti[ln!=="Y"?"push":"unshift"]({fn:If[ln],val:an[++en]})}else Yi||(rn+=".")}hi=!ei||!ei.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),Ti.forEach(function(bn){var hn=bn.fn,pn=bn.val;return hi=hn(hi,pn,mi)||hi}),hi=ki?hi:void 0}}if(!(hi instanceof Date&&!isNaN(hi.getTime()))){ei.errorHandler(new Error("Invalid date provided: "+_i));return}return li===!0&&hi.setHours(0,0,0,0),hi}}};function ds(ii,ti,ei){return ei===void 0&&(ei=!0),ei!==!1?new Date(ii.getTime()).setHours(0,0,0,0)-new Date(ti.getTime()).setHours(0,0,0,0):ii.getTime()-ti.getTime()}var Rf=function(ii,ti,ei){return ii>Math.min(ti,ei)&&ii<Math.max(ti,ei)},Fl=function(ii,ti,ei){return ii*3600+ti*60+ei},Pf=function(ii){var ti=Math.floor(ii/3600),ei=(ii-ti*3600)/60;return[ti,ei,ii-ti*3600-ei*60]},Hf={DAY:864e5};function $l(ii){var ti=ii.defaultHour,ei=ii.defaultMinute,ni=ii.defaultSeconds;if(ii.minDate!==void 0){var ri=ii.minDate.getHours(),si=ii.minDate.getMinutes(),ai=ii.minDate.getSeconds();ti<ri&&(ti=ri),ti===ri&&ei<si&&(ei=si),ti===ri&&ei===si&&ni<ai&&(ni=ii.minDate.getSeconds())}if(ii.maxDate!==void 0){var li=ii.maxDate.getHours(),di=ii.maxDate.getMinutes();ti=Math.min(ti,li),ti===li&&(ei=Math.min(di,ei)),ti===li&&ei===di&&(ni=ii.maxDate.getSeconds())}return{hours:ti,minutes:ei,seconds:ni}}typeof Object.assign!="function"&&(Object.assign=function(ii){for(var ti=[],ei=1;ei<arguments.length;ei++)ti[ei-1]=arguments[ei];if(!ii)throw TypeError("Cannot convert undefined or null to object");for(var ni=function(li){li&&Object.keys(li).forEach(function(di){return ii[di]=li[di]})},ri=0,si=ti;ri<si.length;ri++){var ai=si[ri];ni(ai)}return ii});var ts=function(){return ts=Object.assign||function(ii){for(var ti,ei=1,ni=arguments.length;ei<ni;ei++){ti=arguments[ei];for(var ri in ti)Object.prototype.hasOwnProperty.call(ti,ri)&&(ii[ri]=ti[ri])}return ii},ts.apply(this,arguments)},Ff=function(){for(var ii=0,ti=0,ei=arguments.length;ti<ei;ti++)ii+=arguments[ti].length;for(var ni=Array(ii),ri=0,ti=0;ti<ei;ti++)for(var si=arguments[ti],ai=0,li=si.length;ai<li;ai++,ri++)ni[ri]=si[ai];return ni},Ry=300;function Py(ii,ti){var ei={config:ts(ts({},uo),Zn.defaultConfig),l10n:Rl};ei.parseDate=Hl({config:ei.config,l10n:ei.l10n}),ei._handlers=[],ei.pluginElements=[],ei.loadedPlugins=[],ei._bind=Ti,ei._setHoursFromDate=Ei,ei._positionCalendar=Kr,ei.changeMonth=Li,ei.changeYear=Yn,ei.clear=ji,ei.close=Ji,ei.onMouseOver=Ts,ei._createElement=An,ei.createDay=an,ei.destroy=Vi,ei.isEnabled=Fn,ei.jumpToDate=rn,ei.updateValue=Cs,ei.open=hs,ei.redraw=po,ei.set=Ro,ei.setDate=Po,ei.toggle=ja;function ni(){ei.utils={getDaysInMonth:function(pi,vi){return pi===void 0&&(pi=ei.currentMonth),vi===void 0&&(vi=ei.currentYear),pi===1&&(vi%4===0&&vi%100!==0||vi%400===0)?29:ei.l10n.daysInMonth[pi]}}}function ri(){ei.element=ei.input=ii,ei.isOpen=!1,qs(),yn(),pa(),Wl(),ni(),ei.isMobile||on(),en(),(ei.selectedDates.length||ei.config.noCalendar)&&(ei.config.enableTime&&Ei(ei.config.noCalendar?ei.latestSelectedDateObj:void 0),Cs(!1)),li();var pi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!ei.isMobile&&pi&&Kr(),wn("onReady")}function si(){var pi;return((pi=ei.calendarContainer)===null||pi===void 0?void 0:pi.getRootNode()).activeElement||document.activeElement}function ai(pi){return pi.bind(ei)}function li(){var pi=ei.config;pi.weekNumbers===!1&&pi.showMonths===1||pi.noCalendar!==!0&&window.requestAnimationFrame(function(){if(ei.calendarContainer!==void 0&&(ei.calendarContainer.style.visibility="hidden",ei.calendarContainer.style.display="block"),ei.daysContainer!==void 0){var vi=(ei.days.offsetWidth+1)*pi.showMonths;ei.daysContainer.style.width=vi+"px",ei.calendarContainer.style.width=vi+(ei.weekWrapper!==void 0?ei.weekWrapper.offsetWidth:0)+"px",ei.calendarContainer.style.removeProperty("visibility"),ei.calendarContainer.style.removeProperty("display")}})}function di(pi){if(ei.selectedDates.length===0){var vi=ei.config.minDate===void 0||ds(new Date,ei.config.minDate)>=0?new Date:new Date(ei.config.minDate.getTime()),wi=$l(ei.config);vi.setHours(wi.hours,wi.minutes,wi.seconds,vi.getMilliseconds()),ei.selectedDates=[vi],ei.latestSelectedDateObj=vi}pi!==void 0&&pi.type!=="blur"&&On(pi);var Si=ei._input.value;_i(),Cs(),ei._input.value!==Si&&ei._debouncedChange()}function mi(pi,vi){return pi%12+12*cs(vi===ei.l10n.amPM[1])}function hi(pi){switch(pi%24){case 0:case 12:return 12;default:return pi%12}}function _i(){if(!(ei.hourElement===void 0||ei.minuteElement===void 0)){var pi=(parseInt(ei.hourElement.value.slice(-2),10)||0)%24,vi=(parseInt(ei.minuteElement.value,10)||0)%60,wi=ei.secondElement!==void 0?(parseInt(ei.secondElement.value,10)||0)%60:0;ei.amPM!==void 0&&(pi=mi(pi,ei.amPM.textContent));var Si=ei.config.minTime!==void 0||ei.config.minDate&&ei.minDateHasTime&&ei.latestSelectedDateObj&&ds(ei.latestSelectedDateObj,ei.config.minDate,!0)===0,Ri=ei.config.maxTime!==void 0||ei.config.maxDate&&ei.maxDateHasTime&&ei.latestSelectedDateObj&&ds(ei.latestSelectedDateObj,ei.config.maxDate,!0)===0;if(ei.config.maxTime!==void 0&&ei.config.minTime!==void 0&&ei.config.minTime>ei.config.maxTime){var qi=Fl(ei.config.minTime.getHours(),ei.config.minTime.getMinutes(),ei.config.minTime.getSeconds()),nn=Fl(ei.config.maxTime.getHours(),ei.config.maxTime.getMinutes(),ei.config.maxTime.getSeconds()),Qi=Fl(pi,vi,wi);if(Qi>nn&&Qi<qi){var _n=Pf(qi);pi=_n[0],vi=_n[1],wi=_n[2]}}else{if(Ri){var Gi=ei.config.maxTime!==void 0?ei.config.maxTime:ei.config.maxDate;pi=Math.min(pi,Gi.getHours()),pi===Gi.getHours()&&(vi=Math.min(vi,Gi.getMinutes())),vi===Gi.getMinutes()&&(wi=Math.min(wi,Gi.getSeconds()))}if(Si){var fn=ei.config.minTime!==void 0?ei.config.minTime:ei.config.minDate;pi=Math.max(pi,fn.getHours()),pi===fn.getHours()&&vi<fn.getMinutes()&&(vi=fn.getMinutes()),vi===fn.getMinutes()&&(wi=Math.max(wi,fn.getSeconds()))}}Ai(pi,vi,wi)}}function Ei(pi){var vi=pi||ei.latestSelectedDateObj;vi&&vi instanceof Date&&Ai(vi.getHours(),vi.getMinutes(),vi.getSeconds())}function Ai(pi,vi,wi){ei.latestSelectedDateObj!==void 0&&ei.latestSelectedDateObj.setHours(pi%24,vi,wi||0,0),!(!ei.hourElement||!ei.minuteElement||ei.isMobile)&&(ei.hourElement.value=Zr(ei.config.time_24hr?pi:(12+pi)%12+12*cs(pi%12===0)),ei.minuteElement.value=Zr(vi),ei.amPM!==void 0&&(ei.amPM.textContent=ei.l10n.amPM[cs(pi>=12)]),ei.secondElement!==void 0&&(ei.secondElement.value=Zr(wi)))}function ki(pi){var vi=us(pi),wi=parseInt(vi.value)+(pi.delta||0);(wi/1e3>1||pi.key==="Enter"&&!/[^\d]/.test(wi.toString()))&&Yn(wi)}function Ti(pi,vi,wi,Si){if(vi instanceof Array)return vi.forEach(function(Ri){return Ti(pi,Ri,wi,Si)});if(pi instanceof Array)return pi.forEach(function(Ri){return Ti(Ri,vi,wi,Si)});pi.addEventListener(vi,wi,Si),ei._handlers.push({remove:function(){return pi.removeEventListener(vi,wi,Si)}})}function Fi(){wn("onChange")}function en(){if(ei.config.wrap&&["open","close","toggle","clear"].forEach(function(wi){Array.prototype.forEach.call(ei.element.querySelectorAll("[data-"+wi+"]"),function(Si){return Ti(Si,"click",ei[wi])})}),ei.isMobile){Ho();return}var pi=tu(zn,50);if(ei._debouncedChange=tu(Fi,Ry),ei.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&Ti(ei.daysContainer,"mouseover",function(wi){ei.config.mode==="range"&&Ts(us(wi))}),Ti(ei._input,"keydown",Qn),ei.calendarContainer!==void 0&&Ti(ei.calendarContainer,"keydown",Qn),!ei.config.inline&&!ei.config.static&&Ti(window,"resize",pi),window.ontouchstart!==void 0?Ti(window.document,"touchstart",Sn):Ti(window.document,"mousedown",Sn),Ti(window.document,"focus",Sn,{capture:!0}),ei.config.clickOpens===!0&&(Ti(ei._input,"focus",ei.open),Ti(ei._input,"click",ei.open)),ei.daysContainer!==void 0&&(Ti(ei.monthNav,"click",Dn),Ti(ei.monthNav,["keyup","increment"],ki),Ti(ei.daysContainer,"click",Ms)),ei.timeContainer!==void 0&&ei.minuteElement!==void 0&&ei.hourElement!==void 0){var vi=function(wi){return us(wi).select()};Ti(ei.timeContainer,["increment"],di),Ti(ei.timeContainer,"blur",di,{capture:!0}),Ti(ei.timeContainer,"click",ln),Ti([ei.hourElement,ei.minuteElement],["focus","click"],vi),ei.secondElement!==void 0&&Ti(ei.secondElement,"focus",function(){return ei.secondElement&&ei.secondElement.select()}),ei.amPM!==void 0&&Ti(ei.amPM,"click",function(wi){di(wi)})}ei.config.allowInput&&Ti(ei._input,"blur",Gn)}function rn(pi,vi){var wi=pi!==void 0?ei.parseDate(pi):ei.latestSelectedDateObj||(ei.config.minDate&&ei.config.minDate>ei.now?ei.config.minDate:ei.config.maxDate&&ei.config.maxDate<ei.now?ei.config.maxDate:ei.now),Si=ei.currentYear,Ri=ei.currentMonth;try{wi!==void 0&&(ei.currentYear=wi.getFullYear(),ei.currentMonth=wi.getMonth())}catch(qi){qi.message="Invalid date supplied: "+wi,ei.config.errorHandler(qi)}vi&&ei.currentYear!==Si&&(wn("onYearChange"),Tn()),vi&&(ei.currentYear!==Si||ei.currentMonth!==Ri)&&wn("onMonthChange"),ei.redraw()}function ln(pi){var vi=us(pi);~vi.className.indexOf("arrow")&&Yi(pi,vi.classList.contains("arrowUp")?1:-1)}function Yi(pi,vi,wi){var Si=pi&&us(pi),Ri=wi||Si&&Si.parentNode&&Si.parentNode.firstChild,qi=Gs("increment");qi.delta=vi,Ri&&Ri.dispatchEvent(qi)}function on(){var pi=window.document.createDocumentFragment();if(ei.calendarContainer=An("div","flatpickr-calendar"),ei.calendarContainer.tabIndex=-1,!ei.config.noCalendar){if(pi.appendChild(Pi()),ei.innerContainer=An("div","flatpickr-innerContainer"),ei.config.weekNumbers){var vi=zi(),wi=vi.weekWrapper,Si=vi.weekNumbers;ei.innerContainer.appendChild(wi),ei.weekNumbers=Si,ei.weekWrapper=wi}ei.rContainer=An("div","flatpickr-rContainer"),ei.rContainer.appendChild(mn()),ei.daysContainer||(ei.daysContainer=An("div","flatpickr-days"),ei.daysContainer.tabIndex=-1),vn(),ei.rContainer.appendChild(ei.daysContainer),ei.innerContainer.appendChild(ei.rContainer),pi.appendChild(ei.innerContainer)}ei.config.enableTime&&pi.appendChild($i()),es(ei.calendarContainer,"rangeMode",ei.config.mode==="range"),es(ei.calendarContainer,"animate",ei.config.animate===!0),es(ei.calendarContainer,"multiMonth",ei.config.showMonths>1),ei.calendarContainer.appendChild(pi);var Ri=ei.config.appendTo!==void 0&&ei.config.appendTo.nodeType!==void 0;if((ei.config.inline||ei.config.static)&&(ei.calendarContainer.classList.add(ei.config.inline?"inline":"static"),ei.config.inline&&(!Ri&&ei.element.parentNode?ei.element.parentNode.insertBefore(ei.calendarContainer,ei._input.nextSibling):ei.config.appendTo!==void 0&&ei.config.appendTo.appendChild(ei.calendarContainer)),ei.config.static)){var qi=An("div","flatpickr-wrapper");ei.element.parentNode&&ei.element.parentNode.insertBefore(qi,ei.element),qi.appendChild(ei.element),ei.altInput&&qi.appendChild(ei.altInput),qi.appendChild(ei.calendarContainer)}!ei.config.static&&!ei.config.inline&&(ei.config.appendTo!==void 0?ei.config.appendTo:window.document.body).appendChild(ei.calendarContainer)}function an(pi,vi,wi,Si){var Ri=Fn(vi,!0),qi=An("span",pi,vi.getDate().toString());return qi.dateObj=vi,qi.$i=Si,qi.setAttribute("aria-label",ei.formatDate(vi,ei.config.ariaDateFormat)),pi.indexOf("hidden")===-1&&ds(vi,ei.now)===0&&(ei.todayDateElem=qi,qi.classList.add("today"),qi.setAttribute("aria-current","date")),Ri?(qi.tabIndex=-1,Ks(vi)&&(qi.classList.add("selected"),ei.selectedDateElem=qi,ei.config.mode==="range"&&(es(qi,"startRange",ei.selectedDates[0]&&ds(vi,ei.selectedDates[0],!0)===0),es(qi,"endRange",ei.selectedDates[1]&&ds(vi,ei.selectedDates[1],!0)===0),pi==="nextMonthDay"&&qi.classList.add("inRange")))):qi.classList.add("flatpickr-disabled"),ei.config.mode==="range"&&Yl(vi)&&!Ks(vi)&&qi.classList.add("inRange"),ei.weekNumbers&&ei.config.showMonths===1&&pi!=="prevMonthDay"&&Si%7===6&&ei.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+ei.config.getWeek(vi)+"</span>"),wn("onDayCreate",qi),qi}function bn(pi){pi.focus(),ei.config.mode==="range"&&Ts(pi)}function hn(pi){for(var vi=pi>0?0:ei.config.showMonths-1,wi=pi>0?ei.config.showMonths:-1,Si=vi;Si!=wi;Si+=pi)for(var Ri=ei.daysContainer.children[Si],qi=pi>0?0:Ri.children.length-1,nn=pi>0?Ri.children.length:-1,Qi=qi;Qi!=nn;Qi+=pi){var _n=Ri.children[Qi];if(_n.className.indexOf("hidden")===-1&&Fn(_n.dateObj))return _n}}function pn(pi,vi){for(var wi=pi.className.indexOf("Month")===-1?pi.dateObj.getMonth():ei.currentMonth,Si=vi>0?ei.config.showMonths:-1,Ri=vi>0?1:-1,qi=wi-ei.currentMonth;qi!=Si;qi+=Ri)for(var nn=ei.daysContainer.children[qi],Qi=wi-ei.currentMonth===qi?pi.$i+vi:vi<0?nn.children.length-1:0,_n=nn.children.length,Gi=Qi;Gi>=0&&Gi<_n&&Gi!=(vi>0?_n:-1);Gi+=Ri){var fn=nn.children[Gi];if(fn.className.indexOf("hidden")===-1&&Fn(fn.dateObj)&&Math.abs(pi.$i-Gi)>=Math.abs(vi))return bn(fn)}ei.changeMonth(Ri),gn(hn(Ri),0)}function gn(pi,vi){var wi=si(),Si=Bn(wi||document.body),Ri=pi!==void 0?pi:Si?wi:ei.selectedDateElem!==void 0&&Bn(ei.selectedDateElem)?ei.selectedDateElem:ei.todayDateElem!==void 0&&Bn(ei.todayDateElem)?ei.todayDateElem:hn(vi>0?1:-1);Ri===void 0?ei._input.focus():Si?pn(Ri,vi):bn(Ri)}function un(pi,vi){for(var wi=(new Date(pi,vi,1).getDay()-ei.l10n.firstDayOfWeek+7)%7,Si=ei.utils.getDaysInMonth((vi-1+12)%12,pi),Ri=ei.utils.getDaysInMonth(vi,pi),qi=window.document.createDocumentFragment(),nn=ei.config.showMonths>1,Qi=nn?"prevMonthDay hidden":"prevMonthDay",_n=nn?"nextMonthDay hidden":"nextMonthDay",Gi=Si+1-wi,fn=0;Gi<=Si;Gi++,fn++)qi.appendChild(an("flatpickr-day "+Qi,new Date(pi,vi-1,Gi),Gi,fn));for(Gi=1;Gi<=Ri;Gi++,fn++)qi.appendChild(an("flatpickr-day",new Date(pi,vi,Gi),Gi,fn));for(var Mn=Ri+1;Mn<=42-wi&&(ei.config.showMonths===1||fn%7!==0);Mn++,fn++)qi.appendChild(an("flatpickr-day "+_n,new Date(pi,vi+1,Mn%Ri),Mn,fn));var gs=An("div","dayContainer");return gs.appendChild(qi),gs}function vn(){if(ei.daysContainer!==void 0){Pa(ei.daysContainer),ei.weekNumbers&&Pa(ei.weekNumbers);for(var pi=document.createDocumentFragment(),vi=0;vi<ei.config.showMonths;vi++){var wi=new Date(ei.currentYear,ei.currentMonth,1);wi.setMonth(ei.currentMonth+vi),pi.appendChild(un(wi.getFullYear(),wi.getMonth()))}ei.daysContainer.appendChild(pi),ei.days=ei.daysContainer.firstChild,ei.config.mode==="range"&&ei.selectedDates.length===1&&Ts()}}function Tn(){if(!(ei.config.showMonths>1||ei.config.monthSelectorType!=="dropdown")){var pi=function(Si){return ei.config.minDate!==void 0&&ei.currentYear===ei.config.minDate.getFullYear()&&Si<ei.config.minDate.getMonth()?!1:!(ei.config.maxDate!==void 0&&ei.currentYear===ei.config.maxDate.getFullYear()&&Si>ei.config.maxDate.getMonth())};ei.monthsDropdownContainer.tabIndex=-1,ei.monthsDropdownContainer.innerHTML="";for(var vi=0;vi<12;vi++)if(pi(vi)){var wi=An("option","flatpickr-monthDropdown-month");wi.value=new Date(ei.currentYear,vi).getMonth().toString(),wi.textContent=Fa(vi,ei.config.shorthandCurrentMonth,ei.l10n),wi.tabIndex=-1,ei.currentMonth===vi&&(wi.selected=!0),ei.monthsDropdownContainer.appendChild(wi)}}}function Ni(){var pi=An("div","flatpickr-month"),vi=window.document.createDocumentFragment(),wi;ei.config.showMonths>1||ei.config.monthSelectorType==="static"?wi=An("span","cur-month"):(ei.monthsDropdownContainer=An("select","flatpickr-monthDropdown-months"),ei.monthsDropdownContainer.setAttribute("aria-label",ei.l10n.monthAriaLabel),Ti(ei.monthsDropdownContainer,"change",function(nn){var Qi=us(nn),_n=parseInt(Qi.value,10);ei.changeMonth(_n-ei.currentMonth),wn("onMonthChange")}),Tn(),wi=ei.monthsDropdownContainer);var Si=Ha("cur-year",{tabindex:"-1"}),Ri=Si.getElementsByTagName("input")[0];Ri.setAttribute("aria-label",ei.l10n.yearAriaLabel),ei.config.minDate&&Ri.setAttribute("min",ei.config.minDate.getFullYear().toString()),ei.config.maxDate&&(Ri.setAttribute("max",ei.config.maxDate.getFullYear().toString()),Ri.disabled=!!ei.config.minDate&&ei.config.minDate.getFullYear()===ei.config.maxDate.getFullYear());var qi=An("div","flatpickr-current-month");return qi.appendChild(wi),qi.appendChild(Si),vi.appendChild(qi),pi.appendChild(vi),{container:pi,yearElement:Ri,monthElement:wi}}function Hi(){Pa(ei.monthNav),ei.monthNav.appendChild(ei.prevMonthNav),ei.config.showMonths&&(ei.yearElements=[],ei.monthElements=[]);for(var pi=ei.config.showMonths;pi--;){var vi=Ni();ei.yearElements.push(vi.yearElement),ei.monthElements.push(vi.monthElement),ei.monthNav.appendChild(vi.container)}ei.monthNav.appendChild(ei.nextMonthNav)}function Pi(){return ei.monthNav=An("div","flatpickr-months"),ei.yearElements=[],ei.monthElements=[],ei.prevMonthNav=An("span","flatpickr-prev-month"),ei.prevMonthNav.innerHTML=ei.config.prevArrow,ei.nextMonthNav=An("span","flatpickr-next-month"),ei.nextMonthNav.innerHTML=ei.config.nextArrow,Hi(),Object.defineProperty(ei,"_hidePrevMonthArrow",{get:function(){return ei.__hidePrevMonthArrow},set:function(pi){ei.__hidePrevMonthArrow!==pi&&(es(ei.prevMonthNav,"flatpickr-disabled",pi),ei.__hidePrevMonthArrow=pi)}}),Object.defineProperty(ei,"_hideNextMonthArrow",{get:function(){return ei.__hideNextMonthArrow},set:function(pi){ei.__hideNextMonthArrow!==pi&&(es(ei.nextMonthNav,"flatpickr-disabled",pi),ei.__hideNextMonthArrow=pi)}}),ei.currentYearElement=ei.yearElements[0],Fo(),ei.monthNav}function $i(){ei.calendarContainer.classList.add("hasTime"),ei.config.noCalendar&&ei.calendarContainer.classList.add("noCalendar");var pi=$l(ei.config);ei.timeContainer=An("div","flatpickr-time"),ei.timeContainer.tabIndex=-1;var vi=An("span","flatpickr-time-separator",":"),wi=Ha("flatpickr-hour",{"aria-label":ei.l10n.hourAriaLabel});ei.hourElement=wi.getElementsByTagName("input")[0];var Si=Ha("flatpickr-minute",{"aria-label":ei.l10n.minuteAriaLabel});if(ei.minuteElement=Si.getElementsByTagName("input")[0],ei.hourElement.tabIndex=ei.minuteElement.tabIndex=-1,ei.hourElement.value=Zr(ei.latestSelectedDateObj?ei.latestSelectedDateObj.getHours():ei.config.time_24hr?pi.hours:hi(pi.hours)),ei.minuteElement.value=Zr(ei.latestSelectedDateObj?ei.latestSelectedDateObj.getMinutes():pi.minutes),ei.hourElement.setAttribute("step",ei.config.hourIncrement.toString()),ei.minuteElement.setAttribute("step",ei.config.minuteIncrement.toString()),ei.hourElement.setAttribute("min",ei.config.time_24hr?"0":"1"),ei.hourElement.setAttribute("max",ei.config.time_24hr?"23":"12"),ei.hourElement.setAttribute("maxlength","2"),ei.minuteElement.setAttribute("min","0"),ei.minuteElement.setAttribute("max","59"),ei.minuteElement.setAttribute("maxlength","2"),ei.timeContainer.appendChild(wi),ei.timeContainer.appendChild(vi),ei.timeContainer.appendChild(Si),ei.config.time_24hr&&ei.timeContainer.classList.add("time24hr"),ei.config.enableSeconds){ei.timeContainer.classList.add("hasSeconds");var Ri=Ha("flatpickr-second");ei.secondElement=Ri.getElementsByTagName("input")[0],ei.secondElement.value=Zr(ei.latestSelectedDateObj?ei.latestSelectedDateObj.getSeconds():pi.seconds),ei.secondElement.setAttribute("step",ei.minuteElement.getAttribute("step")),ei.secondElement.setAttribute("min","0"),ei.secondElement.setAttribute("max","59"),ei.secondElement.setAttribute("maxlength","2"),ei.timeContainer.appendChild(An("span","flatpickr-time-separator",":")),ei.timeContainer.appendChild(Ri)}return ei.config.time_24hr||(ei.amPM=An("span","flatpickr-am-pm",ei.l10n.amPM[cs((ei.latestSelectedDateObj?ei.hourElement.value:ei.config.defaultHour)>11)]),ei.amPM.title=ei.l10n.toggleTitle,ei.amPM.tabIndex=-1,ei.timeContainer.appendChild(ei.amPM)),ei.timeContainer}function mn(){ei.weekdayContainer?Pa(ei.weekdayContainer):ei.weekdayContainer=An("div","flatpickr-weekdays");for(var pi=ei.config.showMonths;pi--;){var vi=An("div","flatpickr-weekdaycontainer");ei.weekdayContainer.appendChild(vi)}return tn(),ei.weekdayContainer}function tn(){if(ei.weekdayContainer){var pi=ei.l10n.firstDayOfWeek,vi=Ff(ei.l10n.weekdays.shorthand);pi>0&&pi<vi.length&&(vi=Ff(vi.splice(pi,vi.length),vi.splice(0,pi)));for(var wi=ei.config.showMonths;wi--;)ei.weekdayContainer.children[wi].innerHTML=`
<span class='flatpickr-weekday'>
`+vi.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function zi(){ei.calendarContainer.classList.add("hasWeeks");var pi=An("div","flatpickr-weekwrapper");pi.appendChild(An("span","flatpickr-weekday",ei.l10n.weekAbbreviation));var vi=An("div","flatpickr-weeks");return pi.appendChild(vi),{weekWrapper:pi,weekNumbers:vi}}function Li(pi,vi){vi===void 0&&(vi=!0);var wi=vi?pi:pi-ei.currentMonth;wi<0&&ei._hidePrevMonthArrow===!0||wi>0&&ei._hideNextMonthArrow===!0||(ei.currentMonth+=wi,(ei.currentMonth<0||ei.currentMonth>11)&&(ei.currentYear+=ei.currentMonth>11?1:-1,ei.currentMonth=(ei.currentMonth+12)%12,wn("onYearChange"),Tn()),vn(),wn("onMonthChange"),Fo())}function ji(pi,vi){if(pi===void 0&&(pi=!0),vi===void 0&&(vi=!0),ei.input.value="",ei.altInput!==void 0&&(ei.altInput.value=""),ei.mobileInput!==void 0&&(ei.mobileInput.value=""),ei.selectedDates=[],ei.latestSelectedDateObj=void 0,vi===!0&&(ei.currentYear=ei._initialDate.getFullYear(),ei.currentMonth=ei._initialDate.getMonth()),ei.config.enableTime===!0){var wi=$l(ei.config),Si=wi.hours,Ri=wi.minutes,qi=wi.seconds;Ai(Si,Ri,qi)}ei.redraw(),pi&&wn("onChange")}function Ji(){ei.isOpen=!1,ei.isMobile||(ei.calendarContainer!==void 0&&ei.calendarContainer.classList.remove("open"),ei._input!==void 0&&ei._input.classList.remove("active")),wn("onClose")}function Vi(){ei.config!==void 0&&wn("onDestroy");for(var pi=ei._handlers.length;pi--;)ei._handlers[pi].remove();if(ei._handlers=[],ei.mobileInput)ei.mobileInput.parentNode&&ei.mobileInput.parentNode.removeChild(ei.mobileInput),ei.mobileInput=void 0;else if(ei.calendarContainer&&ei.calendarContainer.parentNode)if(ei.config.static&&ei.calendarContainer.parentNode){var vi=ei.calendarContainer.parentNode;if(vi.lastChild&&vi.removeChild(vi.lastChild),vi.parentNode){for(;vi.firstChild;)vi.parentNode.insertBefore(vi.firstChild,vi);vi.parentNode.removeChild(vi)}}else ei.calendarContainer.parentNode.removeChild(ei.calendarContainer);ei.altInput&&(ei.input.type="text",ei.altInput.parentNode&&ei.altInput.parentNode.removeChild(ei.altInput),delete ei.altInput),ei.input&&(ei.input.type=ei.input._type,ei.input.classList.remove("flatpickr-input"),ei.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(wi){try{delete ei[wi]}catch(Si){}})}function Ii(pi){return ei.calendarContainer.contains(pi)}function Sn(pi){if(ei.isOpen&&!ei.config.inline){var vi=us(pi),wi=Ii(vi),Si=vi===ei.input||vi===ei.altInput||ei.element.contains(vi)||pi.path&&pi.path.indexOf&&(~pi.path.indexOf(ei.input)||~pi.path.indexOf(ei.altInput)),Ri=!Si&&!wi&&!Ii(pi.relatedTarget),qi=!ei.config.ignoredFocusElements.some(function(nn){return nn.contains(vi)});Ri&&qi&&(ei.config.allowInput&&ei.setDate(ei._input.value,!1,ei.config.altInput?ei.config.altFormat:ei.config.dateFormat),ei.timeContainer!==void 0&&ei.minuteElement!==void 0&&ei.hourElement!==void 0&&ei.input.value!==""&&ei.input.value!==void 0&&di(),ei.close(),ei.config&&ei.config.mode==="range"&&ei.selectedDates.length===1&&ei.clear(!1))}}function Yn(pi){if(!(!pi||ei.config.minDate&&pi<ei.config.minDate.getFullYear()||ei.config.maxDate&&pi>ei.config.maxDate.getFullYear())){var vi=pi,wi=ei.currentYear!==vi;ei.currentYear=vi||ei.currentYear,ei.config.maxDate&&ei.currentYear===ei.config.maxDate.getFullYear()?ei.currentMonth=Math.min(ei.config.maxDate.getMonth(),ei.currentMonth):ei.config.minDate&&ei.currentYear===ei.config.minDate.getFullYear()&&(ei.currentMonth=Math.max(ei.config.minDate.getMonth(),ei.currentMonth)),wi&&(ei.redraw(),wn("onYearChange"),Tn())}}function Fn(pi,vi){var wi;vi===void 0&&(vi=!0);var Si=ei.parseDate(pi,void 0,vi);if(ei.config.minDate&&Si&&ds(Si,ei.config.minDate,vi!==void 0?vi:!ei.minDateHasTime)<0||ei.config.maxDate&&Si&&ds(Si,ei.config.maxDate,vi!==void 0?vi:!ei.maxDateHasTime)>0)return!1;if(!ei.config.enable&&ei.config.disable.length===0)return!0;if(Si===void 0)return!1;for(var Ri=!!ei.config.enable,qi=(wi=ei.config.enable)!==null&&wi!==void 0?wi:ei.config.disable,nn=0,Qi=void 0;nn<qi.length;nn++){if(Qi=qi[nn],typeof Qi=="function"&&Qi(Si))return Ri;if(Qi instanceof Date&&Si!==void 0&&Qi.getTime()===Si.getTime())return Ri;if(typeof Qi=="string"){var _n=ei.parseDate(Qi,void 0,!0);return _n&&_n.getTime()===Si.getTime()?Ri:!Ri}else if(typeof Qi=="object"&&Si!==void 0&&Qi.from&&Qi.to&&Si.getTime()>=Qi.from.getTime()&&Si.getTime()<=Qi.to.getTime())return Ri}return!Ri}function Bn(pi){return ei.daysContainer!==void 0?pi.className.indexOf("hidden")===-1&&pi.className.indexOf("flatpickr-disabled")===-1&&ei.daysContainer.contains(pi):!1}function Gn(pi){var vi=pi.target===ei._input,wi=ei._input.value.trimEnd()!==$o();vi&&wi&&!(pi.relatedTarget&&Ii(pi.relatedTarget))&&ei.setDate(ei._input.value,!0,pi.target===ei.altInput?ei.config.altFormat:ei.config.dateFormat)}function Qn(pi){var vi=us(pi),wi=ei.config.wrap?ii.contains(vi):vi===ei._input,Si=ei.config.allowInput,Ri=ei.isOpen&&(!Si||!wi),qi=ei.config.inline&&wi&&!Si;if(pi.keyCode===13&&wi){if(Si)return ei.setDate(ei._input.value,!0,vi===ei.altInput?ei.config.altFormat:ei.config.dateFormat),ei.close(),vi.blur();ei.open()}else if(Ii(vi)||Ri||qi){var nn=!!ei.timeContainer&&ei.timeContainer.contains(vi);switch(pi.keyCode){case 13:nn?(pi.preventDefault(),di(),Us()):Ms(pi);break;case 27:pi.preventDefault(),Us();break;case 8:case 46:wi&&!ei.config.allowInput&&(pi.preventDefault(),ei.clear());break;case 37:case 39:if(!nn&&!wi){pi.preventDefault();var Qi=si();if(ei.daysContainer!==void 0&&(Si===!1||Qi&&Bn(Qi))){var _n=pi.keyCode===39?1:-1;pi.ctrlKey?(pi.stopPropagation(),Li(_n),gn(hn(1),0)):gn(void 0,_n)}}else ei.hourElement&&ei.hourElement.focus();break;case 38:case 40:pi.preventDefault();var Gi=pi.keyCode===40?1:-1;ei.daysContainer&&vi.$i!==void 0||vi===ei.input||vi===ei.altInput?pi.ctrlKey?(pi.stopPropagation(),Yn(ei.currentYear-Gi),gn(hn(1),0)):nn||gn(void 0,Gi*7):vi===ei.currentYearElement?Yn(ei.currentYear-Gi):ei.config.enableTime&&(!nn&&ei.hourElement&&ei.hourElement.focus(),di(pi),ei._debouncedChange());break;case 9:if(nn){var fn=[ei.hourElement,ei.minuteElement,ei.secondElement,ei.amPM].concat(ei.pluginElements).filter(function(is){return is}),Mn=fn.indexOf(vi);if(Mn!==-1){var gs=fn[Mn+(pi.shiftKey?-1:1)];pi.preventDefault(),(gs||ei._input).focus()}}else!ei.config.noCalendar&&ei.daysContainer&&ei.daysContainer.contains(vi)&&pi.shiftKey&&(pi.preventDefault(),ei._input.focus());break;default:break}}if(ei.amPM!==void 0&&vi===ei.amPM)switch(pi.key){case ei.l10n.amPM[0].charAt(0):case ei.l10n.amPM[0].charAt(0).toLowerCase():ei.amPM.textContent=ei.l10n.amPM[0],_i(),Cs();break;case ei.l10n.amPM[1].charAt(0):case ei.l10n.amPM[1].charAt(0).toLowerCase():ei.amPM.textContent=ei.l10n.amPM[1],_i(),Cs();break}(wi||Ii(vi))&&wn("onKeyDown",pi)}function Ts(pi,vi){if(vi===void 0&&(vi="flatpickr-day"),!(ei.selectedDates.length!==1||pi&&(!pi.classList.contains(vi)||pi.classList.contains("flatpickr-disabled")))){for(var wi=pi?pi.dateObj.getTime():ei.days.firstElementChild.dateObj.getTime(),Si=ei.parseDate(ei.selectedDates[0],void 0,!0).getTime(),Ri=Math.min(wi,ei.selectedDates[0].getTime()),qi=Math.max(wi,ei.selectedDates[0].getTime()),nn=!1,Qi=0,_n=0,Gi=Ri;Gi<qi;Gi+=Hf.DAY)Fn(new Date(Gi),!0)||(nn=nn||Gi>Ri&&Gi<qi,Gi<Si&&(!Qi||Gi>Qi)?Qi=Gi:Gi>Si&&(!_n||Gi<_n)&&(_n=Gi));var fn=Array.from(ei.rContainer.querySelectorAll("*:nth-child(-n+"+ei.config.showMonths+") > ."+vi));fn.forEach(function(Mn){var gs=Mn.dateObj,is=gs.getTime(),mo=Qi>0&&is<Qi||_n>0&&is>_n;if(mo){Mn.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Qs){Mn.classList.remove(Qs)});return}else if(nn&&!mo)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Qs){Mn.classList.remove(Qs)}),pi!==void 0&&(pi.classList.add(wi<=ei.selectedDates[0].getTime()?"startRange":"endRange"),Si<wi&&is===Si?Mn.classList.add("startRange"):Si>wi&&is===Si&&Mn.classList.add("endRange"),is>=Qi&&(_n===0||is<=_n)&&Rf(is,Si,wi)&&Mn.classList.add("inRange"))})}}function zn(){ei.isOpen&&!ei.config.static&&!ei.config.inline&&Kr()}function hs(pi,vi){if(vi===void 0&&(vi=ei._positionElement),ei.isMobile===!0){if(pi){pi.preventDefault();var wi=us(pi);wi&&wi.blur()}ei.mobileInput!==void 0&&(ei.mobileInput.focus(),ei.mobileInput.click()),wn("onOpen");return}else if(ei._input.disabled||ei.config.inline)return;var Si=ei.isOpen;ei.isOpen=!0,Si||(ei.calendarContainer.classList.add("open"),ei._input.classList.add("active"),wn("onOpen"),Kr(vi)),ei.config.enableTime===!0&&ei.config.noCalendar===!0&&ei.config.allowInput===!1&&(pi===void 0||!ei.timeContainer.contains(pi.relatedTarget))&&setTimeout(function(){return ei.hourElement.select()},50)}function ms(pi){return function(vi){var wi=ei.config["_"+pi+"Date"]=ei.parseDate(vi,ei.config.dateFormat),Si=ei.config["_"+(pi==="min"?"max":"min")+"Date"];wi!==void 0&&(ei[pi==="min"?"minDateHasTime":"maxDateHasTime"]=wi.getHours()>0||wi.getMinutes()>0||wi.getSeconds()>0),ei.selectedDates&&(ei.selectedDates=ei.selectedDates.filter(function(Ri){return Fn(Ri)}),!ei.selectedDates.length&&pi==="min"&&Ei(wi),Cs()),ei.daysContainer&&(po(),wi!==void 0?ei.currentYearElement[pi]=wi.getFullYear().toString():ei.currentYearElement.removeAttribute(pi),ei.currentYearElement.disabled=!!Si&&wi!==void 0&&Si.getFullYear()===wi.getFullYear())}}function qs(){var pi=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],vi=ts(ts({},JSON.parse(JSON.stringify(ii.dataset||{}))),ti),wi={};ei.config.parseDate=vi.parseDate,ei.config.formatDate=vi.formatDate,Object.defineProperty(ei.config,"enable",{get:function(){return ei.config._enable},set:function(fn){ei.config._enable=ha(fn)}}),Object.defineProperty(ei.config,"disable",{get:function(){return ei.config._disable},set:function(fn){ei.config._disable=ha(fn)}});var Si=vi.mode==="time";if(!vi.dateFormat&&(vi.enableTime||Si)){var Ri=Zn.defaultConfig.dateFormat||uo.dateFormat;wi.dateFormat=vi.noCalendar||Si?"H:i"+(vi.enableSeconds?":S":""):Ri+" H:i"+(vi.enableSeconds?":S":"")}if(vi.altInput&&(vi.enableTime||Si)&&!vi.altFormat){var qi=Zn.defaultConfig.altFormat||uo.altFormat;wi.altFormat=vi.noCalendar||Si?"h:i"+(vi.enableSeconds?":S K":" K"):qi+(" h:i"+(vi.enableSeconds?":S":"")+" K")}Object.defineProperty(ei.config,"minDate",{get:function(){return ei.config._minDate},set:ms("min")}),Object.defineProperty(ei.config,"maxDate",{get:function(){return ei.config._maxDate},set:ms("max")});var nn=function(fn){return function(Mn){ei.config[fn==="min"?"_minTime":"_maxTime"]=ei.parseDate(Mn,"H:i:S")}};Object.defineProperty(ei.config,"minTime",{get:function(){return ei.config._minTime},set:nn("min")}),Object.defineProperty(ei.config,"maxTime",{get:function(){return ei.config._maxTime},set:nn("max")}),vi.mode==="time"&&(ei.config.noCalendar=!0,ei.config.enableTime=!0),Object.assign(ei.config,wi,vi);for(var Qi=0;Qi<pi.length;Qi++)ei.config[pi[Qi]]=ei.config[pi[Qi]]===!0||ei.config[pi[Qi]]==="true";Nl.filter(function(fn){return ei.config[fn]!==void 0}).forEach(function(fn){ei.config[fn]=Pl(ei.config[fn]||[]).map(ai)}),ei.isMobile=!ei.config.disableMobile&&!ei.config.inline&&ei.config.mode==="single"&&!ei.config.disable.length&&!ei.config.enable&&!ei.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Qi=0;Qi<ei.config.plugins.length;Qi++){var _n=ei.config.plugins[Qi](ei)||{};for(var Gi in _n)Nl.indexOf(Gi)>-1?ei.config[Gi]=Pl(_n[Gi]).map(ai).concat(ei.config[Gi]):typeof vi[Gi]=="undefined"&&(ei.config[Gi]=_n[Gi])}vi.altInputClass||(ei.config.altInputClass=qn().className+" "+ei.config.altInputClass),wn("onParseConfig")}function qn(){return ei.config.wrap?ii.querySelector("[data-input]"):ii}function yn(){typeof ei.config.locale!="object"&&typeof Zn.l10ns[ei.config.locale]=="undefined"&&ei.config.errorHandler(new Error("flatpickr: invalid locale "+ei.config.locale)),ei.l10n=ts(ts({},Zn.l10ns.default),typeof ei.config.locale=="object"?ei.config.locale:ei.config.locale!=="default"?Zn.l10ns[ei.config.locale]:void 0),Vs.D="("+ei.l10n.weekdays.shorthand.join("|")+")",Vs.l="("+ei.l10n.weekdays.longhand.join("|")+")",Vs.M="("+ei.l10n.months.shorthand.join("|")+")",Vs.F="("+ei.l10n.months.longhand.join("|")+")",Vs.K="("+ei.l10n.amPM[0]+"|"+ei.l10n.amPM[1]+"|"+ei.l10n.amPM[0].toLowerCase()+"|"+ei.l10n.amPM[1].toLowerCase()+")";var pi=ts(ts({},ti),JSON.parse(JSON.stringify(ii.dataset||{})));pi.time_24hr===void 0&&Zn.defaultConfig.time_24hr===void 0&&(ei.config.time_24hr=ei.l10n.time_24hr),ei.formatDate=ru(ei),ei.parseDate=Hl({config:ei.config,l10n:ei.l10n})}function Kr(pi){if(typeof ei.config.position=="function")return void ei.config.position(ei,pi);if(ei.calendarContainer!==void 0){wn("onPreCalendarPosition");var vi=pi||ei._positionElement,wi=Array.prototype.reduce.call(ei.calendarContainer.children,function(fi,oi){return fi+oi.offsetHeight},0),Si=ei.calendarContainer.offsetWidth,Ri=ei.config.position.split(" "),qi=Ri[0],nn=Ri.length>1?Ri[1]:null,Qi=vi.getBoundingClientRect(),_n=window.innerHeight-Qi.bottom,Gi=qi==="above"||qi!=="below"&&_n<wi&&Qi.top>wi,fn=window.pageYOffset+Qi.top+(Gi?-wi-2:vi.offsetHeight+2);if(es(ei.calendarContainer,"arrowTop",!Gi),es(ei.calendarContainer,"arrowBottom",Gi),!ei.config.inline){var Mn=window.pageXOffset+Qi.left,gs=!1,is=!1;nn==="center"?(Mn-=(Si-Qi.width)/2,gs=!0):nn==="right"&&(Mn-=Si-Qi.width,is=!0),es(ei.calendarContainer,"arrowLeft",!gs&&!is),es(ei.calendarContainer,"arrowCenter",gs),es(ei.calendarContainer,"arrowRight",is);var mo=window.document.body.offsetWidth-(window.pageXOffset+Qi.right),Qs=Mn+Si>window.document.body.offsetWidth,Gl=mo+Si>window.document.body.offsetWidth;if(es(ei.calendarContainer,"rightMost",Qs),!ei.config.static)if(ei.calendarContainer.style.top=fn+"px",!Qs)ei.calendarContainer.style.left=Mn+"px",ei.calendarContainer.style.right="auto";else if(!Gl)ei.calendarContainer.style.left="auto",ei.calendarContainer.style.right=mo+"px";else{var ma=as();if(ma===void 0)return;var Kl=window.document.body.offsetWidth,Ql=Math.max(0,Kl/2-Si/2),Xl=".flatpickr-calendar.centerMost:before",Jl=".flatpickr-calendar.centerMost:after",Zl=ma.cssRules.length,ec="{left:"+Qi.left+"px;right:auto;}";es(ei.calendarContainer,"rightMost",!1),es(ei.calendarContainer,"centerMost",!0),ma.insertRule(Xl+","+Jl+ec,Zl),ei.calendarContainer.style.left=Ql+"px",ei.calendarContainer.style.right="auto"}}}}function as(){for(var pi=null,vi=0;vi<document.styleSheets.length;vi++){var wi=document.styleSheets[vi];if(wi.cssRules){try{wi.cssRules}catch(Si){continue}pi=wi;break}}return pi!=null?pi:Ws()}function Ws(){var pi=document.createElement("style");return document.head.appendChild(pi),pi.sheet}function po(){ei.config.noCalendar||ei.isMobile||(Tn(),Fo(),vn())}function Us(){ei._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(ei.close,0):ei.close()}function Ms(pi){pi.preventDefault(),pi.stopPropagation();var vi=function(fn){return fn.classList&&fn.classList.contains("flatpickr-day")&&!fn.classList.contains("flatpickr-disabled")&&!fn.classList.contains("notAllowed")},wi=iu(us(pi),vi);if(wi!==void 0){var Si=wi,Ri=ei.latestSelectedDateObj=new Date(Si.dateObj.getTime()),qi=(Ri.getMonth()<ei.currentMonth||Ri.getMonth()>ei.currentMonth+ei.config.showMonths-1)&&ei.config.mode!=="range";if(ei.selectedDateElem=Si,ei.config.mode==="single")ei.selectedDates=[Ri];else if(ei.config.mode==="multiple"){var nn=Ks(Ri);nn?ei.selectedDates.splice(parseInt(nn),1):ei.selectedDates.push(Ri)}else ei.config.mode==="range"&&(ei.selectedDates.length===2&&ei.clear(!1,!1),ei.latestSelectedDateObj=Ri,ei.selectedDates.push(Ri),ds(Ri,ei.selectedDates[0],!0)!==0&&ei.selectedDates.sort(function(fn,Mn){return fn.getTime()-Mn.getTime()}));if(_i(),qi){var Qi=ei.currentYear!==Ri.getFullYear();ei.currentYear=Ri.getFullYear(),ei.currentMonth=Ri.getMonth(),Qi&&(wn("onYearChange"),Tn()),wn("onMonthChange")}if(Fo(),vn(),Cs(),!qi&&ei.config.mode!=="range"&&ei.config.showMonths===1?bn(Si):ei.selectedDateElem!==void 0&&ei.hourElement===void 0&&ei.selectedDateElem&&ei.selectedDateElem.focus(),ei.hourElement!==void 0&&ei.hourElement!==void 0&&ei.hourElement.focus(),ei.config.closeOnSelect){var _n=ei.config.mode==="single"&&!ei.config.enableTime,Gi=ei.config.mode==="range"&&ei.selectedDates.length===2&&!ei.config.enableTime;(_n||Gi)&&Us()}Fi()}}var Ss={locale:[yn,tn],showMonths:[Hi,li,mn],minDate:[rn],maxDate:[rn],positionElement:[Ul],clickOpens:[function(){ei.config.clickOpens===!0?(Ti(ei._input,"focus",ei.open),Ti(ei._input,"click",ei.open)):(ei._input.removeEventListener("focus",ei.open),ei._input.removeEventListener("click",ei.open))}]};function Ro(pi,vi){if(pi!==null&&typeof pi=="object"){Object.assign(ei.config,pi);for(var wi in pi)Ss[wi]!==void 0&&Ss[wi].forEach(function(Si){return Si()})}else ei.config[pi]=vi,Ss[pi]!==void 0?Ss[pi].forEach(function(Si){return Si()}):Nl.indexOf(pi)>-1&&(ei.config[pi]=Pl(vi));ei.redraw(),Cs(!0)}function Ys(pi,vi){var wi=[];if(pi instanceof Array)wi=pi.map(function(Si){return ei.parseDate(Si,vi)});else if(pi instanceof Date||typeof pi=="number")wi=[ei.parseDate(pi,vi)];else if(typeof pi=="string")switch(ei.config.mode){case"single":case"time":wi=[ei.parseDate(pi,vi)];break;case"multiple":wi=pi.split(ei.config.conjunction).map(function(Si){return ei.parseDate(Si,vi)});break;case"range":wi=pi.split(ei.l10n.rangeSeparator).map(function(Si){return ei.parseDate(Si,vi)});break;default:break}else ei.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(pi)));ei.selectedDates=ei.config.allowInvalidPreload?wi:wi.filter(function(Si){return Si instanceof Date&&Fn(Si,!1)}),ei.config.mode==="range"&&ei.selectedDates.sort(function(Si,Ri){return Si.getTime()-Ri.getTime()})}function Po(pi,vi,wi){if(vi===void 0&&(vi=!1),wi===void 0&&(wi=ei.config.dateFormat),pi!==0&&!pi||pi instanceof Array&&pi.length===0)return ei.clear(vi);Ys(pi,wi),ei.latestSelectedDateObj=ei.selectedDates[ei.selectedDates.length-1],ei.redraw(),rn(void 0,vi),Ei(),ei.selectedDates.length===0&&ei.clear(!1),Cs(vi),vi&&wn("onChange")}function ha(pi){return pi.slice().map(function(vi){return typeof vi=="string"||typeof vi=="number"||vi instanceof Date?ei.parseDate(vi,void 0,!0):vi&&typeof vi=="object"&&vi.from&&vi.to?{from:ei.parseDate(vi.from,void 0),to:ei.parseDate(vi.to,void 0)}:vi}).filter(function(vi){return vi})}function Wl(){ei.selectedDates=[],ei.now=ei.parseDate(ei.config.now)||new Date;var pi=ei.config.defaultDate||((ei.input.nodeName==="INPUT"||ei.input.nodeName==="TEXTAREA")&&ei.input.placeholder&&ei.input.value===ei.input.placeholder?null:ei.input.value);pi&&Ys(pi,ei.config.dateFormat),ei._initialDate=ei.selectedDates.length>0?ei.selectedDates[0]:ei.config.minDate&&ei.config.minDate.getTime()>ei.now.getTime()?ei.config.minDate:ei.config.maxDate&&ei.config.maxDate.getTime()<ei.now.getTime()?ei.config.maxDate:ei.now,ei.currentYear=ei._initialDate.getFullYear(),ei.currentMonth=ei._initialDate.getMonth(),ei.selectedDates.length>0&&(ei.latestSelectedDateObj=ei.selectedDates[0]),ei.config.minTime!==void 0&&(ei.config.minTime=ei.parseDate(ei.config.minTime,"H:i")),ei.config.maxTime!==void 0&&(ei.config.maxTime=ei.parseDate(ei.config.maxTime,"H:i")),ei.minDateHasTime=!!ei.config.minDate&&(ei.config.minDate.getHours()>0||ei.config.minDate.getMinutes()>0||ei.config.minDate.getSeconds()>0),ei.maxDateHasTime=!!ei.config.maxDate&&(ei.config.maxDate.getHours()>0||ei.config.maxDate.getMinutes()>0||ei.config.maxDate.getSeconds()>0)}function pa(){if(ei.input=qn(),!ei.input){ei.config.errorHandler(new Error("Invalid input element specified"));return}ei.input._type=ei.input.type,ei.input.type="text",ei.input.classList.add("flatpickr-input"),ei._input=ei.input,ei.config.altInput&&(ei.altInput=An(ei.input.nodeName,ei.config.altInputClass),ei._input=ei.altInput,ei.altInput.placeholder=ei.input.placeholder,ei.altInput.disabled=ei.input.disabled,ei.altInput.required=ei.input.required,ei.altInput.tabIndex=ei.input.tabIndex,ei.altInput.type="text",ei.input.setAttribute("type","hidden"),!ei.config.static&&ei.input.parentNode&&ei.input.parentNode.insertBefore(ei.altInput,ei.input.nextSibling)),ei.config.allowInput||ei._input.setAttribute("readonly","readonly"),Ul()}function Ul(){ei._positionElement=ei.config.positionElement||ei._input}function Ho(){var pi=ei.config.enableTime?ei.config.noCalendar?"time":"datetime-local":"date";ei.mobileInput=An("input",ei.input.className+" flatpickr-mobile"),ei.mobileInput.tabIndex=1,ei.mobileInput.type=pi,ei.mobileInput.disabled=ei.input.disabled,ei.mobileInput.required=ei.input.required,ei.mobileInput.placeholder=ei.input.placeholder,ei.mobileFormatStr=pi==="datetime-local"?"Y-m-d\\TH:i:S":pi==="date"?"Y-m-d":"H:i:S",ei.selectedDates.length>0&&(ei.mobileInput.defaultValue=ei.mobileInput.value=ei.formatDate(ei.selectedDates[0],ei.mobileFormatStr)),ei.config.minDate&&(ei.mobileInput.min=ei.formatDate(ei.config.minDate,"Y-m-d")),ei.config.maxDate&&(ei.mobileInput.max=ei.formatDate(ei.config.maxDate,"Y-m-d")),ei.input.getAttribute("step")&&(ei.mobileInput.step=String(ei.input.getAttribute("step"))),ei.input.type="hidden",ei.altInput!==void 0&&(ei.altInput.type="hidden");try{ei.input.parentNode&&ei.input.parentNode.insertBefore(ei.mobileInput,ei.input.nextSibling)}catch(vi){}Ti(ei.mobileInput,"change",function(vi){ei.setDate(us(vi).value,!1,ei.mobileFormatStr),wn("onChange"),wn("onClose")})}function ja(pi){if(ei.isOpen===!0)return ei.close();ei.open(pi)}function wn(pi,vi){if(ei.config!==void 0){var wi=ei.config[pi];if(wi!==void 0&&wi.length>0)for(var Si=0;wi[Si]&&Si<wi.length;Si++)wi[Si](ei.selectedDates,ei.input.value,ei,vi);pi==="onChange"&&(ei.input.dispatchEvent(Gs("change")),ei.input.dispatchEvent(Gs("input")))}}function Gs(pi){var vi=document.createEvent("Event");return vi.initEvent(pi,!0,!0),vi}function Ks(pi){for(var vi=0;vi<ei.selectedDates.length;vi++){var wi=ei.selectedDates[vi];if(wi instanceof Date&&ds(wi,pi)===0)return""+vi}return!1}function Yl(pi){return ei.config.mode!=="range"||ei.selectedDates.length<2?!1:ds(pi,ei.selectedDates[0])>=0&&ds(pi,ei.selectedDates[1])<=0}function Fo(){ei.config.noCalendar||ei.isMobile||!ei.monthNav||(ei.yearElements.forEach(function(pi,vi){var wi=new Date(ei.currentYear,ei.currentMonth,1);wi.setMonth(ei.currentMonth+vi),ei.config.showMonths>1||ei.config.monthSelectorType==="static"?ei.monthElements[vi].textContent=Fa(wi.getMonth(),ei.config.shorthandCurrentMonth,ei.l10n)+" ":ei.monthsDropdownContainer.value=wi.getMonth().toString(),pi.value=wi.getFullYear().toString()}),ei._hidePrevMonthArrow=ei.config.minDate!==void 0&&(ei.currentYear===ei.config.minDate.getFullYear()?ei.currentMonth<=ei.config.minDate.getMonth():ei.currentYear<ei.config.minDate.getFullYear()),ei._hideNextMonthArrow=ei.config.maxDate!==void 0&&(ei.currentYear===ei.config.maxDate.getFullYear()?ei.currentMonth+1>ei.config.maxDate.getMonth():ei.currentYear>ei.config.maxDate.getFullYear()))}function $o(pi){var vi=pi||(ei.config.altInput?ei.config.altFormat:ei.config.dateFormat);return ei.selectedDates.map(function(wi){return ei.formatDate(wi,vi)}).filter(function(wi,Si,Ri){return ei.config.mode!=="range"||ei.config.enableTime||Ri.indexOf(wi)===Si}).join(ei.config.mode!=="range"?ei.config.conjunction:ei.l10n.rangeSeparator)}function Cs(pi){pi===void 0&&(pi=!0),ei.mobileInput!==void 0&&ei.mobileFormatStr&&(ei.mobileInput.value=ei.latestSelectedDateObj!==void 0?ei.formatDate(ei.latestSelectedDateObj,ei.mobileFormatStr):""),ei.input.value=$o(ei.config.dateFormat),ei.altInput!==void 0&&(ei.altInput.value=$o(ei.config.altFormat)),pi!==!1&&wn("onValueUpdate")}function Dn(pi){var vi=us(pi),wi=ei.prevMonthNav.contains(vi),Si=ei.nextMonthNav.contains(vi);wi||Si?Li(wi?-1:1):ei.yearElements.indexOf(vi)>=0?vi.select():vi.classList.contains("arrowUp")?ei.changeYear(ei.currentYear+1):vi.classList.contains("arrowDown")&&ei.changeYear(ei.currentYear-1)}function On(pi){pi.preventDefault();var vi=pi.type==="keydown",wi=us(pi),Si=wi;ei.amPM!==void 0&&wi===ei.amPM&&(ei.amPM.textContent=ei.l10n.amPM[cs(ei.amPM.textContent===ei.l10n.amPM[0])]);var Ri=parseFloat(Si.getAttribute("min")),qi=parseFloat(Si.getAttribute("max")),nn=parseFloat(Si.getAttribute("step")),Qi=parseInt(Si.value,10),_n=pi.delta||(vi?pi.which===38?1:-1:0),Gi=Qi+nn*_n;if(typeof Si.value!="undefined"&&Si.value.length===2){var fn=Si===ei.hourElement,Mn=Si===ei.minuteElement;Gi<Ri?(Gi=qi+Gi+cs(!fn)+(cs(fn)&&cs(!ei.amPM)),Mn&&Yi(void 0,-1,ei.hourElement)):Gi>qi&&(Gi=Si===ei.hourElement?Gi-qi-cs(!ei.amPM):Ri,Mn&&Yi(void 0,1,ei.hourElement)),ei.amPM&&fn&&(nn===1?Gi+Qi===23:Math.abs(Gi-Qi)>nn)&&(ei.amPM.textContent=ei.l10n.amPM[cs(ei.amPM.textContent===ei.l10n.amPM[0])]),Si.value=Zr(Gi)}}return ri(),ei}function aa(ii,ti){for(var ei=Array.prototype.slice.call(ii).filter(function(ai){return ai instanceof HTMLElement}),ni=[],ri=0;ri<ei.length;ri++){var si=ei[ri];try{if(si.getAttribute("data-fp-omit")!==null)continue;si._flatpickr!==void 0&&(si._flatpickr.destroy(),si._flatpickr=void 0),si._flatpickr=Py(si,ti||{}),ni.push(si._flatpickr)}catch(ai){console.error(ai)}}return ni.length===1?ni[0]:ni}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(ii){return aa(this,ii)},HTMLElement.prototype.flatpickr=function(ii){return aa([this],ii)});var Zn=function(ii,ti){return typeof ii=="string"?aa(window.document.querySelectorAll(ii),ti):ii instanceof Node?aa([ii],ti):aa(ii,ti)};Zn.defaultConfig={};Zn.l10ns={en:ts({},Rl),default:ts({},Rl)};Zn.localize=function(ii){Zn.l10ns.default=ts(ts({},Zn.l10ns.default),ii)};Zn.setDefaults=function(ii){Zn.defaultConfig=ts(ts({},Zn.defaultConfig),ii)};Zn.parseDate=Hl({});Zn.formatDate=ru({});Zn.compareDates=ds;typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(ii){return aa(this,ii)});Date.prototype.fp_incr=function(ii){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof ii=="string"?parseInt(ii,10):ii))};typeof window!="undefined"&&(window.flatpickr=Zn);var Bl=Zn;function $f(){Bl(".date-picker",{allowInput:!0}),Bl(".datetime-picker",{allowInput:!0,enableSeconds:!0,enableTime:!0,time_24hr:!0}),Bl(".time-picker",{allowInput:!0,enableSeconds:!0,enableTime:!0,noCalendar:!0,time_24hr:!0})}function Hy(){for(let ii of Xi('select[name="columns"] option'))ii.selected=!0}function Fy(ii){for(let ti of Xi("#id_available_columns > option"))if(ti.selected){for(let ei of Xi("#id_columns"))ei.appendChild(ti.cloneNode(!0));ti.remove()}ii.preventDefault()}function $y(ii){for(let ti of Xi("#id_columns > option"))if(ti.selected){for(let ei of Xi("#id_available_columns"))ei.appendChild(ti.cloneNode(!0));ti.remove()}ii.preventDefault()}function Bf(ii,ti){return ks(this,null,function*(){return yield ra(ii,ti)})}function By(ii){var di,mi,hi;ii.preventDefault();let ti=ii.currentTarget,ei=ti.getAttribute("data-url");if(ei==null){ao("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let ni=((di=document.activeElement)==null?void 0:di.getAttribute("value"))==="Reset",ri=(hi=(mi=ti.getAttribute("data-config-root"))==null?void 0:mi.split("."))!=null?hi:[];if(ni){let _i=ri.reduceRight((Ei,Ai)=>({[Ai]:Ei}),{});Bf(ei,_i).then(Ei=>{Mo(Ei)?ao("danger","Error Resetting Table Configuration",Ei.error).show():location.reload()});return}let si=Pd(ti,"select[name=columns]"),ai=Object.assign({},...si.map(_i=>({[_i.name]:_i.options}))),li=ri.reduceRight((_i,Ei)=>({[Ei]:_i}),ai);Bf(ei,li).then(_i=>{Mo(_i)?ao("danger","Error Updating Table Configuration",_i.error).show():location.reload()})}function zf(){for(let ii of Xi("#save_tableconfig"))ii.addEventListener("click",Hy);for(let ii of Xi("#add_columns"))ii.addEventListener("click",Fy);for(let ii of Xi("#remove_columns"))ii.addEventListener("click",$y);for(let ii of Xi("form.userconfigform"))ii.addEventListener("submit",By)}function jf(ii){return typeof ii=="string"&&["show","hide"].includes(ii)}var No=class extends Error{constructor(ei,ni){super(ei);Rn(this,"table");this.table=ni}},la=class{constructor(ti,ei){Rn(this,"button");Rn(this,"rows");this.button=ti,this.rows=ei}hideRows(){for(let ti of this.rows)ti.classList.add("d-none")}set buttonState(ti){jf(ti)&&this.button.setAttribute("data-state",ti)}get buttonState(){let ti=this.button.getAttribute("data-state");return jf(ti)?ti:null}toggleButton(){this.buttonState==="show"?this.button.innerText=sa(this.button.innerText,"Show","Hide"):this.buttonState==="hide"&&(this.button.innerText=sa(this.button.innerHTML,"Hide","Show"))}toggleState(){this.buttonState==="show"?this.buttonState="hide":this.buttonState==="hide"&&(this.buttonState="show")}toggle(){this.toggleState(),this.toggleButton()}handleClick(ti){ti.currentTarget.isEqualNode(this.button)&&this.toggle(),this.buttonState==="hide"&&this.hideRows()}},su=class{constructor(ti){Rn(this,"table");Rn(this,"enabledButton");Rn(this,"disabledButton");Rn(this,"virtualButton");Rn(this,"disconnectedButton");Rn(this,"rows");this.table=ti,this.rows=this.table.querySelectorAll("tr");try{let ei=ko(this.table,"button.toggle-enabled"),ni=ko(this.table,"button.toggle-disabled"),ri=ko(this.table,"button.toggle-virtual"),si=ko(this.table,"button.toggle-disconnected");if(ei===null)throw new No("Table is missing a 'toggle-enabled' button.",ti);if(ni===null)throw new No("Table is missing a 'toggle-disabled' button.",ti);if(ri===null)throw new No("Table is missing a 'toggle-virtual' button.",ti);if(si===null)throw new No("Table is missing a 'toggle-disconnected' button.",ti);ei.addEventListener("click",ai=>this.handleClick(ai,this)),ni.addEventListener("click",ai=>this.handleClick(ai,this)),ri.addEventListener("click",ai=>this.handleClick(ai,this)),si.addEventListener("click",ai=>this.handleClick(ai,this)),this.enabledButton=new la(ei,ti.querySelectorAll('tr[data-enabled="enabled"]')),this.disabledButton=new la(ni,ti.querySelectorAll('tr[data-enabled="disabled"]')),this.virtualButton=new la(ri,ti.querySelectorAll('tr[data-type="virtual"]')),this.disconnectedButton=new la(si,ti.querySelectorAll('tr[data-connected="disconnected"]'))}catch(ei){if(ei instanceof No){console.debug("Table does not contain enable/disable toggle buttons");return}else throw ei}}handleClick(ti,ei){for(let ni of this.rows)ni.classList.remove("d-none");ei.enabledButton.handleClick(ti),ei.disabledButton.handleClick(ti),ei.virtualButton.handleClick(ti),ei.disconnectedButton.handleClick(ti)}};function Vf(){for(let ii of Xi("table"))new su(ii)}var ou=class{constructor(ti){Rn(this,"base");Rn(this,"state");Rn(this,"activeLink",null);Rn(this,"sections",[]);this.base=ti,this.state=new Ia({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initSectionLinks(),this.initLinks()}bodyHas(ti){return document.body.hasAttribute(`data-sidenav-${ti}`)}bodyRemove(...ti){for(let ei of ti)document.body.removeAttribute(`data-sidenav-${ei}`)}bodyAdd(...ti){for(let ei of ti)document.body.setAttribute(`data-sidenav-${ei}`,"")}init(){for(let ti of this.base.querySelectorAll(".sidenav-toggle"))ti.addEventListener("click",ei=>this.onToggle(ei));for(let ti of Xi(".sidenav-toggle-mobile"))ti.addEventListener("click",ei=>this.onMobileToggle(ei));window.innerWidth>1200&&(this.state.get("pinned")&&this.pin(),this.state.get("pinned")||this.unpin(),window.addEventListener("resize",()=>this.onResize())),window.innerWidth<1200&&(this.bodyRemove("hide"),this.bodyAdd("hidden"),window.addEventListener("resize",()=>this.onResize())),this.base.addEventListener("mouseenter",()=>this.onEnter()),this.base.addEventListener("mouseleave",()=>this.onLeave())}initLinks(){for(let ti of this.getActiveLinks())this.bodyHas("show")?this.activateLink(ti,"expand"):this.bodyHas("hidden")&&this.activateLink(ti,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let ti of this.base.querySelectorAll(".collapse"))ti.classList.remove("show")}pin(){this.bodyAdd("show","pinned"),this.bodyRemove("hidden"),this.state.set("pinned",!0)}unpin(){this.bodyRemove("pinned","show"),this.bodyAdd("hidden");for(let ti of this.base.querySelectorAll(".collapse"))ti.classList.remove("show");this.state.set("pinned",!1)}handleSectionClick(ti){ti.preventDefault();let ei=ti.target;this.activeLink=ei,this.closeInactiveSections()}closeInactiveSections(){for(let[ti,ei]of this.sections)ti!==this.activeLink&&(ti.classList.add("collapsed"),ti.setAttribute("aria-expanded","false"),ei.hide())}initSectionLinks(){for(let ti of Xi(".navbar-nav .nav-item .nav-link[data-bs-toggle]"))if(ti.parentElement!==null){let ei=ti.parentElement.querySelector(".collapse");if(ei!==null){let ni=new io(ei,{toggle:!1});this.sections.push([ti,ni]),ti.addEventListener("click",ri=>this.handleSectionClick(ri))}}}activateLink(ti,ei){var ri;let ni=ti.closest(".dropdown-menu");if(wl(ni)){let si=ni.parentElement,ai=(ri=ni.parentElement)==null?void 0:ri.querySelector(".nav-link");if(wl(ai)&&wl(si))switch(ei){case"expand":ai.setAttribute("aria-expanded","true"),si.classList.add("active"),ni.classList.add("show"),ti.classList.add("active");break;case"collapse":ai.setAttribute("aria-expanded","false"),si.classList.remove("active"),ni.classList.remove("show"),ti.classList.remove("active");break}}}*getActiveLinks(){for(let ti of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let ei=ti.querySelector("a");if(ei){let ni=new RegExp(ei.href,"gi");window.location.href.match(ni)&&(yield ti)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let ti of this.getActiveLinks())this.activateLink(ti,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let ti of this.getActiveLinks())this.activateLink(ti,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(ti){ti.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(ti){ti.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function qf(){for(let ii of Xi(".navbar"))new ou(ii)}function Wf(ii,ti,ei,ni,ri){let si=(...ai)=>(console.warn("gridstack.js: Function `"+ei+"` is deprecated in "+ri+" and has been replaced with `"+ni+"`. It will be **removed** in a future release"),ti.apply(ii,ai));return si.prototype=ti.prototype,si}var xi=class ii{static getElements(ti,ei=document){if(typeof ti=="string"){let ni="getElementById"in ei?ei:void 0;if(ni&&!isNaN(+ti[0])){let si=ni.getElementById(ti);return si?[si]:[]}let ri=ei.querySelectorAll(ti);return!ri.length&&ti[0]!=="."&&ti[0]!=="#"&&(ri=ei.querySelectorAll("."+ti),ri.length||(ri=ei.querySelectorAll("#"+ti))),Array.from(ri)}return[ti]}static getElement(ti,ei=document){if(typeof ti=="string"){let ni="getElementById"in ei?ei:void 0;if(!ti.length)return null;if(ni&&ti[0]==="#")return ni.getElementById(ti.substring(1));if(ti[0]==="#"||ti[0]==="."||ti[0]==="[")return ei.querySelector(ti);if(ni&&!isNaN(+ti[0]))return ni.getElementById(ti);let ri=ei.querySelector(ti);return ni&&!ri&&(ri=ni.getElementById(ti)),ri||(ri=ei.querySelector("."+ti)),ri}return ti}static shouldSizeToContent(ti,ei=!1){return(ti==null?void 0:ti.grid)&&(ei?ti.sizeToContent===!0||ti.grid.opts.sizeToContent===!0&&ti.sizeToContent===void 0:!!ti.sizeToContent||ti.grid.opts.sizeToContent&&ti.sizeToContent!==!1)}static isIntercepted(ti,ei){return!(ti.y>=ei.y+ei.h||ti.y+ti.h<=ei.y||ti.x+ti.w<=ei.x||ti.x>=ei.x+ei.w)}static isTouching(ti,ei){return ii.isIntercepted(ti,{x:ei.x-.5,y:ei.y-.5,w:ei.w+1,h:ei.h+1})}static areaIntercept(ti,ei){let ni=ti.x>ei.x?ti.x:ei.x,ri=ti.x+ti.w<ei.x+ei.w?ti.x+ti.w:ei.x+ei.w;if(ri<=ni)return 0;let si=ti.y>ei.y?ti.y:ei.y,ai=ti.y+ti.h<ei.y+ei.h?ti.y+ti.h:ei.y+ei.h;return ai<=si?0:(ri-ni)*(ai-si)}static area(ti){return ti.w*ti.h}static sort(ti,ei=1){return ti.sort((ri,si)=>{var li,di,mi,hi;let ai=ei*(((li=ri.y)!=null?li:1e4)-((di=si.y)!=null?di:1e4));return ai===0?ei*(((mi=ri.x)!=null?mi:1e4)-((hi=si.x)!=null?hi:1e4)):ai})}static find(ti,ei){return ei?ti.find(ni=>ni.id===ei):void 0}static createStylesheet(ti,ei,ni){let ri=document.createElement("style"),si=ni==null?void 0:ni.nonce;return si&&(ri.nonce=si),ri.setAttribute("type","text/css"),ri.setAttribute("gs-style-id",ti),ri.styleSheet?ri.styleSheet.cssText="":ri.appendChild(document.createTextNode("")),ei?ei.insertBefore(ri,ei.firstChild):(ei=document.getElementsByTagName("head")[0],ei.appendChild(ri)),ri.sheet}static removeStylesheet(ti,ei){let ri=(ei||document).querySelector("STYLE[gs-style-id="+ti+"]");ri&&ri.parentNode&&ri.remove()}static addCSSRule(ti,ei,ni){typeof ti.addRule=="function"?ti.addRule(ei,ni):typeof ti.insertRule=="function"&&ti.insertRule(`${ei}{${ni}}`)}static toBool(ti){return typeof ti=="boolean"?ti:typeof ti=="string"?(ti=ti.toLowerCase(),!(ti===""||ti==="no"||ti==="false"||ti==="0")):!!ti}static toNumber(ti){return ti===null||ti.length===0?void 0:Number(ti)}static parseHeight(ti){let ei,ni="px";if(typeof ti=="string")if(ti==="auto"||ti==="")ei=0;else{let ri=ti.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!ri)throw new Error(`Invalid height val = ${ti}`);ni=ri[2]||"px",ei=parseFloat(ri[1])}else ei=ti;return{h:ei,unit:ni}}static defaults(ti,...ei){return ei.forEach(ni=>{for(let ri in ni){if(!ni.hasOwnProperty(ri))return;ti[ri]===null||ti[ri]===void 0?ti[ri]=ni[ri]:typeof ni[ri]=="object"&&typeof ti[ri]=="object"&&this.defaults(ti[ri],ni[ri])}}),ti}static same(ti,ei){if(typeof ti!="object")return ti==ei;if(typeof ti!=typeof ei||Object.keys(ti).length!==Object.keys(ei).length)return!1;for(let ni in ti)if(ti[ni]!==ei[ni])return!1;return!0}static copyPos(ti,ei,ni=!1){return ei.x!==void 0&&(ti.x=ei.x),ei.y!==void 0&&(ti.y=ei.y),ei.w!==void 0&&(ti.w=ei.w),ei.h!==void 0&&(ti.h=ei.h),ni&&(ei.minW&&(ti.minW=ei.minW),ei.minH&&(ti.minH=ei.minH),ei.maxW&&(ti.maxW=ei.maxW),ei.maxH&&(ti.maxH=ei.maxH)),ti}static samePos(ti,ei){return ti&&ei&&ti.x===ei.x&&ti.y===ei.y&&(ti.w||1)===(ei.w||1)&&(ti.h||1)===(ei.h||1)}static sanitizeMinMax(ti){ti.minW||delete ti.minW,ti.minH||delete ti.minH,ti.maxW||delete ti.maxW,ti.maxH||delete ti.maxH}static removeInternalAndSame(ti,ei){if(!(typeof ti!="object"||typeof ei!="object"))for(let ni in ti){let ri=ti[ni],si=ei[ni];ni[0]==="_"||ri===si?delete ti[ni]:ri&&typeof ri=="object"&&si!==void 0&&(ii.removeInternalAndSame(ri,si),Object.keys(ri).length||delete ti[ni])}}static removeInternalForSave(ti,ei=!0){for(let ni in ti)(ni[0]==="_"||ti[ni]===null||ti[ni]===void 0)&&delete ti[ni];delete ti.grid,ei&&delete ti.el,ti.autoPosition||delete ti.autoPosition,ti.noResize||delete ti.noResize,ti.noMove||delete ti.noMove,ti.locked||delete ti.locked,(ti.w===1||ti.w===ti.minW)&&delete ti.w,(ti.h===1||ti.h===ti.minH)&&delete ti.h}static throttle(ti,ei){let ni=!1;return(...ri)=>{ni||(ni=!0,setTimeout(()=>{ti(...ri),ni=!1},ei))}}static removePositioningStyles(ti){let ei=ti.style;ei.position&&ei.removeProperty("position"),ei.left&&ei.removeProperty("left"),ei.top&&ei.removeProperty("top"),ei.width&&ei.removeProperty("width"),ei.height&&ei.removeProperty("height")}static getScrollElement(ti){if(!ti)return document.scrollingElement||document.documentElement;let ei=getComputedStyle(ti);return/(auto|scroll)/.test(ei.overflow+ei.overflowY)?ti:this.getScrollElement(ti.parentElement)}static updateScrollPosition(ti,ei,ni){let ri=ti.getBoundingClientRect(),si=window.innerHeight||document.documentElement.clientHeight;if(ri.top<0||ri.bottom>si){let ai=ri.bottom-si,li=ri.top,di=this.getScrollElement(ti);if(di!==null){let mi=di.scrollTop;ri.top<0&&ni<0?ti.offsetHeight>si?di.scrollTop+=ni:di.scrollTop+=Math.abs(li)>Math.abs(ni)?ni:li:ni>0&&(ti.offsetHeight>si?di.scrollTop+=ni:di.scrollTop+=ai>ni?ni:ai),ei.top+=di.scrollTop-mi}}}static updateScrollResize(ti,ei,ni){let ri=this.getScrollElement(ei),si=ri.clientHeight,ai=ri===this.getScrollElement()?0:ri.getBoundingClientRect().top,li=ti.clientY-ai,di=li<ni,mi=li>si-ni;di?ri.scrollBy({behavior:"smooth",top:li-ni}):mi&&ri.scrollBy({behavior:"smooth",top:ni-(si-li)})}static clone(ti){return ti==null||typeof ti!="object"?ti:ti instanceof Array?[...ti]:Ui({},ti)}static cloneDeep(ti){let ei=["parentGrid","el","grid","subGrid","engine"],ni=ii.clone(ti);for(let ri in ni)ni.hasOwnProperty(ri)&&typeof ni[ri]=="object"&&ri.substring(0,2)!=="__"&&!ei.find(si=>si===ri)&&(ni[ri]=ii.cloneDeep(ti[ri]));return ni}static cloneNode(ti){let ei=ti.cloneNode(!0);return ei.removeAttribute("id"),ei}static appendTo(ti,ei){let ni;typeof ei=="string"?ni=ii.getElement(ei):ni=ei,ni&&ni.appendChild(ti)}static addElStyles(ti,ei){if(ei instanceof Object)for(let ni in ei)ei.hasOwnProperty(ni)&&(Array.isArray(ei[ni])?ei[ni].forEach(ri=>{ti.style[ni]=ri}):ti.style[ni]=ei[ni])}static initEvent(ti,ei){let ni={type:ei.type},ri={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:ei.target?ei.target:ti.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(si=>ni[si]=ti[si]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(si=>ni[si]=ti[si]),Ui(Ui({},ni),ri)}static simulateMouseEvent(ti,ei,ni){let ri=document.createEvent("MouseEvents");ri.initMouseEvent(ei,!0,!0,window,1,ti.screenX,ti.screenY,ti.clientX,ti.clientY,ti.ctrlKey,ti.altKey,ti.shiftKey,ti.metaKey,0,ti.target),(ni||ti.target).dispatchEvent(ri)}static getValuesFromTransformedElement(ti){let ei=document.createElement("div");ii.addElStyles(ei,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),ti.appendChild(ei);let ni=ei.getBoundingClientRect();return ti.removeChild(ei),ei.remove(),{xScale:1/ni.width,yScale:1/ni.height,xOffset:ni.left,yOffset:ni.top}}static swap(ti,ei,ni){if(!ti)return;let ri=ti[ei];ti[ei]=ti[ni],ti[ni]=ri}static canBeRotated(ti){var ei;return!(!ti||ti.w===ti.h||ti.locked||ti.noResize||(ei=ti.grid)!=null&&ei.opts.disableResize||ti.minW&&ti.minW===ti.maxW||ti.minH&&ti.minH===ti.maxH)}};var Io=class ii{constructor(ti={}){this.addedNodes=[],this.removedNodes=[],this.column=ti.column||12,this.maxRow=ti.maxRow,this._float=ti.float,this.nodes=ti.nodes||[],this.onChange=ti.onChange}batchUpdate(ti=!0,ei=!0){return!!this.batchMode===ti?this:(this.batchMode=ti,ti?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,ei&&this._packNodes(),this._notify()),this)}_useEntireRowArea(ti,ei){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!ti._moving||ti._skipDown||ei.y<=ti.y)}_fixCollisions(ti,ei=ti,ni,ri={}){if(this.sortNodes(-1),ni=ni||this.collide(ti,ei),!ni)return!1;if(ti._moving&&!ri.nested&&!this.float&&this.swap(ti,ni))return!0;let si=ei;!this._loading&&this._useEntireRowArea(ti,ei)&&(si={x:0,w:this.column,y:ei.y,h:ei.h},ni=this.collide(ti,si,ri.skip));let ai=!1,li={nested:!0,pack:!1};for(;ni=ni||this.collide(ti,si,ri.skip);){let di;if(ni.locked||this._loading||ti._moving&&!ti._skipDown&&ei.y>ti.y&&!this.float&&(!this.collide(ni,Hn(Ui({},ni),{y:ti.y}),ti)||!this.collide(ni,Hn(Ui({},ni),{y:ei.y-ni.h}),ti))?(ti._skipDown=ti._skipDown||ei.y>ti.y,di=this.moveNode(ti,Ui(Hn(Ui({},ei),{y:ni.y+ni.h}),li)),(ni.locked||this._loading)&&di?xi.copyPos(ei,ti):!ni.locked&&di&&ri.pack&&(this._packNodes(),ei.y=ni.y+ni.h,xi.copyPos(ti,ei)),ai=ai||di):di=this.moveNode(ni,Ui(Hn(Ui({},ni),{y:ei.y+ei.h,skip:ti}),li)),!di)return ai;ni=void 0}return ai}collide(ti,ei=ti,ni){let ri=ti._id,si=ni==null?void 0:ni._id;return this.nodes.find(ai=>ai._id!==ri&&ai._id!==si&&xi.isIntercepted(ai,ei))}collideAll(ti,ei=ti,ni){let ri=ti._id,si=ni==null?void 0:ni._id;return this.nodes.filter(ai=>ai._id!==ri&&ai._id!==si&&xi.isIntercepted(ai,ei))}directionCollideCoverage(ti,ei,ni){if(!ei.rect||!ti._rect)return;let ri=ti._rect,si=Ui({},ei.rect);si.y>ri.y?(si.h+=si.y-ri.y,si.y=ri.y):si.h+=ri.y-si.y,si.x>ri.x?(si.w+=si.x-ri.x,si.x=ri.x):si.w+=ri.x-si.x;let ai,li=.5;for(let di of ni){if(di.locked||!di._rect)break;let mi=di._rect,hi=Number.MAX_VALUE,_i=Number.MAX_VALUE;ri.y<mi.y?hi=(si.y+si.h-mi.y)/mi.h:ri.y+ri.h>mi.y+mi.h&&(hi=(mi.y+mi.h-si.y)/mi.h),ri.x<mi.x?_i=(si.x+si.w-mi.x)/mi.w:ri.x+ri.w>mi.x+mi.w&&(_i=(mi.x+mi.w-si.x)/mi.w);let Ei=Math.min(_i,hi);Ei>li&&(li=Ei,ai=di)}return ei.collide=ai,ai}cacheRects(ti,ei,ni,ri,si,ai){return this.nodes.forEach(li=>li._rect={y:li.y*ei+ni,x:li.x*ti+ai,w:li.w*ti-ai-ri,h:li.h*ei-ni-si}),this}swap(ti,ei){if(!ei||ei.locked||!ti||ti.locked)return!1;function ni(){let si=ei.x,ai=ei.y;return ei.x=ti.x,ei.y=ti.y,ti.h!=ei.h?(ti.x=si,ti.y=ei.y+ei.h):ti.w!=ei.w?(ti.x=ei.x+ei.w,ti.y=ai):(ti.x=si,ti.y=ai),ti._dirty=ei._dirty=!0,!0}let ri;if(ti.w===ei.w&&ti.h===ei.h&&(ti.x===ei.x||ti.y===ei.y)&&(ri=xi.isTouching(ti,ei)))return ni();if(ri!==!1){if(ti.w===ei.w&&ti.x===ei.x&&(ri||(ri=xi.isTouching(ti,ei)))){if(ei.y<ti.y){let si=ti;ti=ei,ei=si}return ni()}if(ri!==!1){if(ti.h===ei.h&&ti.y===ei.y&&(ri||(ri=xi.isTouching(ti,ei)))){if(ei.x<ti.x){let si=ti;ti=ei,ei=si}return ni()}return!1}}}isAreaEmpty(ti,ei,ni,ri){let si={x:ti||0,y:ei||0,w:ni||1,h:ri||1};return!this.collide(si)}compact(ti="compact",ei=!0){if(this.nodes.length===0)return this;ei&&this.sortNodes();let ni=this.batchMode;ni||this.batchUpdate();let ri=this._inColumnResize;ri||(this._inColumnResize=!0);let si=this.nodes;return this.nodes=[],si.forEach((ai,li,di)=>{let mi;ai.locked||(ai.autoPosition=!0,ti==="list"&&li&&(mi=di[li-1])),this.addNode(ai,!1,mi)}),ri||delete this._inColumnResize,ni||this.batchUpdate(!1),this}set float(ti){this._float!==ti&&(this._float=ti||!1,ti||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(ti=1){return this.nodes=xi.sort(this.nodes,ti),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(ti=>{if(ti._updating||ti._orig===void 0||ti.y===ti._orig.y)return;let ei=ti.y;for(;ei>ti._orig.y;)--ei,this.collide(ti,{x:ti.x,y:ei,w:ti.w,h:ti.h})||(ti._dirty=!0,ti.y=ei)}):this.nodes.forEach((ti,ei)=>{if(!ti.locked)for(;ti.y>0;){let ni=ei===0?0:ti.y-1;if(!(ei===0||!this.collide(ti,{x:ti.x,y:ni,w:ti.w,h:ti.h})))break;ti._dirty=ti.y!==ni,ti.y=ni}}),this)}prepareNode(ti,ei){var ri;ti._id=(ri=ti._id)!=null?ri:ii._idSeq++,(ti.x===void 0||ti.y===void 0||ti.x===null||ti.y===null)&&(ti.autoPosition=!0);let ni={x:0,y:0,w:1,h:1};return xi.defaults(ti,ni),ti.autoPosition||delete ti.autoPosition,ti.noResize||delete ti.noResize,ti.noMove||delete ti.noMove,xi.sanitizeMinMax(ti),typeof ti.x=="string"&&(ti.x=Number(ti.x)),typeof ti.y=="string"&&(ti.y=Number(ti.y)),typeof ti.w=="string"&&(ti.w=Number(ti.w)),typeof ti.h=="string"&&(ti.h=Number(ti.h)),isNaN(ti.x)&&(ti.x=ni.x,ti.autoPosition=!0),isNaN(ti.y)&&(ti.y=ni.y,ti.autoPosition=!0),isNaN(ti.w)&&(ti.w=ni.w),isNaN(ti.h)&&(ti.h=ni.h),this.nodeBoundFix(ti,ei),ti}nodeBoundFix(ti,ei){let ni=ti._orig||xi.copyPos({},ti);if(ti.maxW&&(ti.w=Math.min(ti.w,ti.maxW)),ti.maxH&&(ti.h=Math.min(ti.h,ti.maxH)),ti.minW&&ti.minW<=this.column&&(ti.w=Math.max(ti.w,ti.minW)),ti.minH&&(ti.h=Math.max(ti.h,ti.minH)),(ti.x||0)+(ti.w||1)>this.column&&this.column<12&&!this._inColumnResize&&ti._id&&this.findCacheLayout(ti,12)===-1){let si=Ui({},ti);si.autoPosition||si.x===void 0?(delete si.x,delete si.y):si.x=Math.min(11,si.x),si.w=Math.min(12,si.w||1),this.cacheOneLayout(si,12)}return ti.w>this.column?ti.w=this.column:ti.w<1&&(ti.w=1),this.maxRow&&ti.h>this.maxRow?ti.h=this.maxRow:ti.h<1&&(ti.h=1),ti.x<0&&(ti.x=0),ti.y<0&&(ti.y=0),ti.x+ti.w>this.column&&(ei?ti.w=this.column-ti.x:ti.x=this.column-ti.w),this.maxRow&&ti.y+ti.h>this.maxRow&&(ei?ti.h=this.maxRow-ti.y:ti.y=this.maxRow-ti.h),xi.samePos(ti,ni)||(ti._dirty=!0),this}getDirtyNodes(ti){return ti?this.nodes.filter(ei=>ei._dirty&&!xi.samePos(ei,ei._orig)):this.nodes.filter(ei=>ei._dirty)}_notify(ti){if(this.batchMode||!this.onChange)return this;let ei=(ti||[]).concat(this.getDirtyNodes());return this.onChange(ei),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(ti=>{delete ti._dirty,delete ti._lastTried}),this)}saveInitial(){return this.nodes.forEach(ti=>{ti._orig=xi.copyPos({},ti),delete ti._dirty}),this._hasLocked=this.nodes.some(ti=>ti.locked),this}restoreInitial(){return this.nodes.forEach(ti=>{xi.samePos(ti,ti._orig)||(xi.copyPos(ti,ti._orig),ti._dirty=!0)}),this._notify(),this}findEmptyPosition(ti,ei=this.nodes,ni=this.column,ri){let si=ri?ri.y*ni+(ri.x+ri.w):0,ai=!1;for(let li=si;!ai;++li){let di=li%ni,mi=Math.floor(li/ni);if(di+ti.w>ni)continue;let hi={x:di,y:mi,w:ti.w,h:ti.h};ei.find(_i=>xi.isIntercepted(hi,_i))||((ti.x!==di||ti.y!==mi)&&(ti._dirty=!0),ti.x=di,ti.y=mi,delete ti.autoPosition,ai=!0)}return ai}addNode(ti,ei=!1,ni){let ri=this.nodes.find(ai=>ai._id===ti._id);if(ri)return ri;this._inColumnResize?this.nodeBoundFix(ti):this.prepareNode(ti),delete ti._temporaryRemoved,delete ti._removeDOM;let si;return ti.autoPosition&&this.findEmptyPosition(ti,this.nodes,this.column,ni)&&(delete ti.autoPosition,si=!0),this.nodes.push(ti),ei&&this.addedNodes.push(ti),si||this._fixCollisions(ti),this.batchMode||this._packNodes()._notify(),ti}removeNode(ti,ei=!0,ni=!1){return this.nodes.find(ri=>ri._id===ti._id)?(ni&&this.removedNodes.push(ti),ei&&(ti._removeDOM=!0),this.nodes=this.nodes.filter(ri=>ri._id!==ti._id),ti._isAboutToRemove||this._packNodes(),this._notify([ti]),this):this}removeAll(ti=!0,ei=!0){if(delete this._layouts,!this.nodes.length)return this;ti&&this.nodes.forEach(ri=>ri._removeDOM=!0);let ni=this.nodes;return this.removedNodes=ei?ni:[],this.nodes=[],this._notify(ni)}moveNodeCheck(ti,ei){if(!this.changedPosConstrain(ti,ei))return!1;if(ei.pack=!0,!this.maxRow)return this.moveNode(ti,ei);let ni,ri=new ii({column:this.column,float:this.float,nodes:this.nodes.map(ai=>ai._id===ti._id?(ni=Ui({},ai),ni):Ui({},ai))});if(!ni)return!1;let si=ri.moveNode(ni,ei)&&ri.getRow()<=Math.max(this.getRow(),this.maxRow);if(!si&&!ei.resizing&&ei.collide){let ai=ei.collide.el.gridstackNode;if(this.swap(ti,ai))return this._notify(),!0}return si?(ri.nodes.filter(ai=>ai._dirty).forEach(ai=>{let li=this.nodes.find(di=>di._id===ai._id);li&&(xi.copyPos(li,ai),li._dirty=!0)}),this._notify(),!0):!1}willItFit(ti){if(delete ti._willFitPos,!this.maxRow)return!0;let ei=new ii({column:this.column,float:this.float,nodes:this.nodes.map(ri=>Ui({},ri))}),ni=Ui({},ti);return this.cleanupNode(ni),delete ni.el,delete ni._id,delete ni.content,delete ni.grid,ei.addNode(ni),ei.getRow()<=this.maxRow?(ti._willFitPos=xi.copyPos({},ni),!0):!1}changedPosConstrain(ti,ei){return ei.w=ei.w||ti.w,ei.h=ei.h||ti.h,ti.x!==ei.x||ti.y!==ei.y?!0:(ti.maxW&&(ei.w=Math.min(ei.w,ti.maxW)),ti.maxH&&(ei.h=Math.min(ei.h,ti.maxH)),ti.minW&&(ei.w=Math.max(ei.w,ti.minW)),ti.minH&&(ei.h=Math.max(ei.h,ti.minH)),ti.w!==ei.w||ti.h!==ei.h)}moveNode(ti,ei){var mi,hi;if(!ti||!ei)return!1;let ni;ei.pack===void 0&&!this.batchMode&&(ni=ei.pack=!0),typeof ei.x!="number"&&(ei.x=ti.x),typeof ei.y!="number"&&(ei.y=ti.y),typeof ei.w!="number"&&(ei.w=ti.w),typeof ei.h!="number"&&(ei.h=ti.h);let ri=ti.w!==ei.w||ti.h!==ei.h,si=xi.copyPos({},ti,!0);if(xi.copyPos(si,ei),this.nodeBoundFix(si,ri),xi.copyPos(ei,si),!ei.forceCollide&&xi.samePos(ti,ei))return!1;let ai=xi.copyPos({},ti),li=this.collideAll(ti,si,ei.skip),di=!0;if(li.length){let _i=ti._moving&&!ei.nested,Ei=_i?this.directionCollideCoverage(ti,ei,li):li[0];if(_i&&Ei&&((hi=(mi=ti.grid)==null?void 0:mi.opts)!=null&&hi.subGridDynamic)&&!ti.grid._isTemp){let Ai=xi.areaIntercept(ei.rect,Ei._rect),ki=xi.area(ei.rect),Ti=xi.area(Ei._rect);Ai/(ki<Ti?ki:Ti)>.8&&(Ei.grid.makeSubGrid(Ei.el,void 0,ti),Ei=void 0)}Ei?di=!this._fixCollisions(ti,si,Ei,ei):(di=!1,ni&&delete ei.pack)}return di&&(ti._dirty=!0,xi.copyPos(ti,si)),ei.pack&&this._packNodes()._notify(),!xi.samePos(ti,ai)}getRow(){return this.nodes.reduce((ti,ei)=>Math.max(ti,ei.y+ei.h),0)}beginUpdate(ti){return ti._updating||(ti._updating=!0,delete ti._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let ti=this.nodes.find(ei=>ei._updating);return ti&&(delete ti._updating,delete ti._skipDown),this}save(ti=!0,ei){var ai;let ni=(ai=this._layouts)==null?void 0:ai.length,ri=ni&&this.column!==ni-1?this._layouts[ni-1]:null,si=[];return this.sortNodes(),this.nodes.forEach(li=>{let di=ri==null?void 0:ri.find(hi=>hi._id===li._id),mi=Ui(Ui({},li),di||{});xi.removeInternalForSave(mi,!ti),ei&&ei(li,mi),si.push(mi)}),si}layoutsNodesChange(ti){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((ei,ni)=>{if(!ei||ni===this.column)return this;if(ni<this.column)this._layouts[ni]=void 0;else{let ri=ni/this.column;ti.forEach(si=>{if(!si._orig)return;let ai=ei.find(li=>li._id===si._id);ai&&(ai.y>=0&&si.y!==si._orig.y&&(ai.y+=si.y-si._orig.y),si.x!==si._orig.x&&(ai.x=Math.round(si.x*ri)),si.w!==si._orig.w&&(ai.w=Math.round(si.w*ri)))})}}),this)}columnChanged(ti,ei,ni="moveScale"){var li;if(!this.nodes.length||!ei||ti===ei)return this;if(ni==="none")return this;let ri=ni==="compact"||ni==="list";ri&&this.sortNodes(1),ei<ti&&this.cacheLayout(this.nodes,ti),this.batchUpdate();let si=[],ai=ri?this.nodes:xi.sort(this.nodes,-1);if(ei>ti&&this._layouts){let di=this._layouts[ei]||[],mi=this._layouts.length-1;!di.length&&ti!==mi&&((li=this._layouts[mi])!=null&&li.length)&&(ti=mi,this._layouts[mi].forEach(hi=>{var Ei,Ai,ki;let _i=ai.find(Ti=>Ti._id===hi._id);_i&&(!ri&&!hi.autoPosition&&(_i.x=(Ei=hi.x)!=null?Ei:_i.x,_i.y=(Ai=hi.y)!=null?Ai:_i.y),_i.w=(ki=hi.w)!=null?ki:_i.w,(hi.x==null||hi.y===void 0)&&(_i.autoPosition=!0))})),di.forEach(hi=>{var Ei,Ai,ki;let _i=ai.findIndex(Ti=>Ti._id===hi._id);if(_i!==-1){let Ti=ai[_i];if(ri){Ti.w=hi.w;return}(hi.autoPosition||isNaN(hi.x)||isNaN(hi.y))&&this.findEmptyPosition(hi,si),hi.autoPosition||(Ti.x=(Ei=hi.x)!=null?Ei:Ti.x,Ti.y=(Ai=hi.y)!=null?Ai:Ti.y,Ti.w=(ki=hi.w)!=null?ki:Ti.w,si.push(Ti)),ai.splice(_i,1)}})}if(ri)this.compact(ni,!1);else{if(ai.length)if(typeof ni=="function")ni(ei,ti,si,ai);else{let di=ri?1:ei/ti,mi=ni==="move"||ni==="moveScale",hi=ni==="scale"||ni==="moveScale";ai.forEach(_i=>{_i.x=ei===1?0:mi?Math.round(_i.x*di):Math.min(_i.x,ei-1),_i.w=ei===1||ti===1?1:hi?Math.round(_i.w*di)||1:Math.min(_i.w,ei),si.push(_i)}),ai=[]}si=xi.sort(si,-1),this._inColumnResize=!0,this.nodes=[],si.forEach(di=>{this.addNode(di,!1),delete di._orig})}return this.nodes.forEach(di=>delete di._orig),this.batchUpdate(!1,!ri),delete this._inColumnResize,this}cacheLayout(ti,ei,ni=!1){let ri=[];return ti.forEach((si,ai)=>{var li;if(si._id===void 0){let di=si.id?this.nodes.find(mi=>mi.id===si.id):void 0;si._id=(li=di==null?void 0:di._id)!=null?li:ii._idSeq++}ri[ai]={x:si.x,y:si.y,w:si.w,_id:si._id}}),this._layouts=ni?[]:this._layouts||[],this._layouts[ei]=ri,this}cacheOneLayout(ti,ei){var si;ti._id=(si=ti._id)!=null?si:ii._idSeq++;let ni={x:ti.x,y:ti.y,w:ti.w,_id:ti._id};(ti.autoPosition||ti.x===void 0)&&(delete ni.x,delete ni.y,ti.autoPosition&&(ni.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[ei]=this._layouts[ei]||[];let ri=this.findCacheLayout(ti,ei);return ri===-1?this._layouts[ei].push(ni):this._layouts[ei][ri]=ni,this}findCacheLayout(ti,ei){var ni,ri,si;return(si=(ri=(ni=this._layouts)==null?void 0:ni[ei])==null?void 0:ri.findIndex(ai=>ai._id===ti._id))!=null?si:-1}removeNodeFromLayoutCache(ti){if(this._layouts)for(let ei=0;ei<this._layouts.length;ei++){let ni=this.findCacheLayout(ti,ei);ni!==-1&&this._layouts[ei].splice(ni,1)}}cleanupNode(ti){for(let ei in ti)ei[0]==="_"&&ei!=="_id"&&delete ti[ei];return this}};Io._idSeq=0;var fs={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},Uf={handle:".grid-stack-item-content",appendTo:"body"};var sn=class{};var ss=typeof window!="undefined"&&typeof document!="undefined"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),xs=class{};function zl(ii,ti){if(ii.touches.length>1)return;ii.cancelable&&ii.preventDefault();let ei=ii.changedTouches[0],ni=document.createEvent("MouseEvents");ni.initMouseEvent(ti,!0,!0,window,1,ei.screenX,ei.screenY,ei.clientX,ei.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ni)}function Yf(ii,ti){ii.cancelable&&ii.preventDefault();let ei=document.createEvent("MouseEvents");ei.initMouseEvent(ti,!0,!0,window,1,ii.screenX,ii.screenY,ii.clientX,ii.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ei)}function ca(ii){xs.touchHandled||(xs.touchHandled=!0,zl(ii,"mousedown"))}function ua(ii){xs.touchHandled&&zl(ii,"mousemove")}function da(ii){if(!xs.touchHandled)return;xs.pointerLeaveTimeout&&(window.clearTimeout(xs.pointerLeaveTimeout),delete xs.pointerLeaveTimeout);let ti=!!sn.dragElement;zl(ii,"mouseup"),ti||zl(ii,"click"),xs.touchHandled=!1}function fa(ii){ii.pointerType!=="mouse"&&ii.target.releasePointerCapture(ii.pointerId)}function au(ii){sn.dragElement&&ii.pointerType!=="mouse"&&Yf(ii,"mouseenter")}function lu(ii){sn.dragElement&&ii.pointerType!=="mouse"&&(xs.pointerLeaveTimeout=window.setTimeout(()=>{delete xs.pointerLeaveTimeout,Yf(ii,"mouseleave")},10))}var $a=class ii{constructor(ti,ei,ni){this.host=ti,this.dir=ei,this.option=ni,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){let ti=this.el=document.createElement("div");return ti.classList.add("ui-resizable-handle"),ti.classList.add(`${ii.prefix}${this.dir}`),ti.style.zIndex="100",ti.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),ss&&(this.el.addEventListener("touchstart",ca),this.el.addEventListener("pointerdown",fa)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),ss&&(this.el.removeEventListener("touchstart",ca),this.el.removeEventListener("pointerdown",fa)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(ti){this.mouseDownEvent=ti,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),ss&&(this.el.addEventListener("touchmove",ua),this.el.addEventListener("touchend",da)),ti.stopPropagation(),ti.preventDefault()}_mouseMove(ti){let ei=this.mouseDownEvent;this.moving?this._triggerEvent("move",ti):Math.abs(ti.x-ei.x)+Math.abs(ti.y-ei.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",ti),document.addEventListener("keydown",this._keyEvent)),ti.stopPropagation()}_mouseUp(ti){this.moving&&(this._triggerEvent("stop",ti),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ss&&(this.el.removeEventListener("touchmove",ua),this.el.removeEventListener("touchend",da)),delete this.moving,delete this.mouseDownEvent,ti.stopPropagation(),ti.preventDefault()}_keyEvent(ti){var ei,ni;ti.key==="Escape"&&((ni=(ei=this.host.gridstackNode)==null?void 0:ei.grid)==null||ni.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(ti,ei){return this.option[ti]&&this.option[ti](ei),this}};$a.prefix="ui-resizable-";var fo=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(ti,ei){this._eventRegister[ti]=ei}off(ti){delete this._eventRegister[ti]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(ti,ei){if(!this.disabled&&this._eventRegister&&this._eventRegister[ti])return this._eventRegister[ti](ei)}};var Ba=class ii extends fo{constructor(ti,ei={}){super(),this.el=ti,this.option=ei,this.rectScale={x:1,y:1},this._ui=()=>{let ri=this.el.parentElement.getBoundingClientRect(),si={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},ai=this.temporalRect||si;return{position:{left:(ai.left-ri.left)*this.rectScale.x,top:(ai.top-ri.top)*this.rectScale.y},size:{width:ai.width*this.rectScale.x,height:ai.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(ti,ei){super.on(ti,ei)}off(ti){super.off(ti)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(ti){let ei=ti.handles&&ti.handles!==this.option.handles,ni=ti.autoHide&&ti.autoHide!==this.option.autoHide;return Object.keys(ti).forEach(ri=>this.option[ri]=ti[ri]),ei&&(this._removeHandlers(),this._setupHandlers()),ni&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(ti){return ti?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),sn.overResizeElement===this&&delete sn.overResizeElement),this}_mouseOver(ti){sn.overResizeElement||sn.dragElement||(sn.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(ti){sn.overResizeElement===this&&(delete sn.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(ti=>ti.trim()).map(ti=>new $a(this.el,ti,{start:ei=>{this._resizeStart(ei)},stop:ei=>{this._resizeStop(ei)},move:ei=>{this._resizing(ei,ti)}})),this}_resizeStart(ti){this.sizeToContent=xi.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=xi.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=ti,this._setupHelper(),this._applyChange();let ei=xi.initEvent(ti,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(ei,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",ei),this}_resizing(ti,ei){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(ti,ei),this._applyChange();let ni=xi.initEvent(ti,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(ni,this._ui()),this.triggerEvent("resize",ni),this}_resizeStop(ti){let ei=xi.initEvent(ti,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(ei),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",ei),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=ii._originStyleProp.map(ni=>this.el.style[ni]),this.parentOriginStylePosition=this.el.parentElement.style.position;let ti=this.el.parentElement,ei=xi.getValuesFromTransformedElement(ti);return this.rectScale={x:ei.xScale,y:ei.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return ii._originStyleProp.forEach((ti,ei)=>{this.el.style[ti]=this.elOriginStyleVal[ei]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(ti,ei){let ni=this.startEvent,ri={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},si=ti.clientX-ni.clientX,ai=this.sizeToContent?0:ti.clientY-ni.clientY,li,di;ei.indexOf("e")>-1?ri.width+=si:ei.indexOf("w")>-1&&(ri.width-=si,ri.left+=si,li=!0),ei.indexOf("s")>-1?ri.height+=ai:ei.indexOf("n")>-1&&(ri.height-=ai,ri.top+=ai,di=!0);let mi=this._constrainSize(ri.width,ri.height,li,di);return Math.round(ri.width)!==Math.round(mi.width)&&(ei.indexOf("w")>-1&&(ri.left+=ri.width-mi.width),ri.width=mi.width),Math.round(ri.height)!==Math.round(mi.height)&&(ei.indexOf("n")>-1&&(ri.top+=ri.height-mi.height),ri.height=mi.height),ri}_constrainSize(ti,ei,ni,ri){let si=this.option,ai=(ni?si.maxWidthMoveLeft:si.maxWidth)||Number.MAX_SAFE_INTEGER,li=si.minWidth/this.rectScale.x||ti,di=(ri?si.maxHeightMoveUp:si.maxHeight)||Number.MAX_SAFE_INTEGER,mi=si.minHeight/this.rectScale.y||ei,hi=Math.min(ai,Math.max(li,ti)),_i=Math.min(di,Math.max(mi,ei));return{width:hi,height:_i}}_applyChange(){let ti={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let ei=this.el.parentElement,{left:ni,top:ri}=ei.getBoundingClientRect();ti={left:ni,top:ri,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(ei=>{let ni=this.temporalRect[ei],ri=ei==="width"||ei==="left"?this.rectScale.x:ei==="height"||ei==="top"?this.rectScale.y:1;this.el.style[ei]=(ni-ti[ei])*ri+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(ti=>ti.destroy()),delete this.handlers,this}};Ba._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var zy='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',za=class ii extends fo{constructor(ti,ei={}){super(),this.el=ti,this.option=ei,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let ni=ei.handle.substring(1),ri=ti.gridstackNode;this.dragEls=ti.classList.contains(ni)?[ti]:ri!=null&&ri.subGrid?[ti.querySelector(ei.handle)||ti]:Array.from(ti.querySelectorAll(ei.handle)),this.dragEls.length===0&&(this.dragEls=[ti]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(ti,ei){super.on(ti,ei)}off(ti){super.off(ti)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(ti=>{ti.addEventListener("mousedown",this._mouseDown),ss&&(ti.addEventListener("touchstart",ca),ti.addEventListener("pointerdown",fa))}),this.el.classList.remove("ui-draggable-disabled"))}disable(ti=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(ei=>{ei.removeEventListener("mousedown",this._mouseDown),ss&&(ei.removeEventListener("touchstart",ca),ei.removeEventListener("pointerdown",fa))}),ti||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(ti){return Object.keys(ti).forEach(ei=>this.option[ei]=ti[ei]),this}_mouseDown(ti){if(!sn.mouseHandled)return ti.button!==0||!this.dragEls.find(ei=>ei===ti.target)&&ti.target.closest(zy)||this.option.cancel&&ti.target.closest(this.option.cancel)||(this.mouseDownEvent=ti,delete this.dragging,delete sn.dragElement,delete sn.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),ss&&(ti.target.addEventListener("touchmove",ua),ti.target.addEventListener("touchend",da)),ti.preventDefault(),document.activeElement&&document.activeElement.blur(),sn.mouseHandled=!0),!0}_callDrag(ti){if(!this.dragging)return;let ei=xi.initEvent(ti,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(ei,this.ui()),this.triggerEvent("drag",ei)}_mouseMove(ti){var ni;let ei=this.mouseDownEvent;if(this.lastDrag=ti,this.dragging)if(this._dragFollow(ti),sn.pauseDrag){let ri=Number.isInteger(sn.pauseDrag)?sn.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(ti),ri)}else this._callDrag(ti);else if(Math.abs(ti.x-ei.x)+Math.abs(ti.y-ei.y)>3){this.dragging=!0,sn.dragElement=this;let ri=(ni=this.el.gridstackNode)==null?void 0:ni.grid;ri?sn.dropElement=ri.el.ddElement.ddDroppable:delete sn.dropElement,this.helper=this._createHelper(ti),this._setupHelperContainmentStyle(),this.dragTransform=xi.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(ti,this.el,this.helperContainment),this._setupHelperStyle(ti);let si=xi.initEvent(ti,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(si,this.ui()),this.triggerEvent("dragstart",si),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(ti){var ei,ni;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ss&&(ti.target.removeEventListener("touchmove",ua,!0),ti.target.removeEventListener("touchend",da,!0)),this.dragging){delete this.dragging,(ei=this.el.gridstackNode)==null||delete ei._origRotate,document.removeEventListener("keydown",this._keyEvent),((ni=sn.dropElement)==null?void 0:ni.el)===this.el.parentElement&&delete sn.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();let ri=xi.initEvent(ti,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(ri),this.triggerEvent("dragstop",ri),sn.dropElement&&sn.dropElement.drop(ti)}delete this.helper,delete this.mouseDownEvent,delete sn.dragElement,delete sn.dropElement,delete sn.mouseHandled,ti.preventDefault()}_keyEvent(ti){let ei=this.el.gridstackNode;if(!(ei!=null&&ei.grid))return;let ni=ei.grid;if(ti.key==="Escape")ei._origRotate&&(ei._orig=ei._origRotate,delete ei._origRotate),ni.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent);else if(ti.key==="r"||ti.key==="R"){if(!xi.canBeRotated(ei))return;ei._origRotate=ei._origRotate||Ui({},ei._orig),delete ei._moving,ni.setAnimation(!1).rotate(ei.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),ei._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,ei.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",xi.swap(ei._orig,"w","h"),delete ei._rect,this._mouseMove(this.lastDrag)}}_createHelper(ti){let ei=this.el;return typeof this.option.helper=="function"?ei=this.option.helper(ti):this.option.helper==="clone"&&(ei=xi.cloneNode(this.el)),document.body.contains(ei)||xi.appendTo(ei,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),ei===this.el&&(this.dragElementOriginStyle=ii.originStyleProp.map(ni=>this.el.style[ni])),ei}_setupHelperStyle(ti){this.helper.classList.add("ui-draggable-dragging");let ei=this.helper.style;return ei.pointerEvents="none",ei.width=this.dragOffset.width+"px",ei.height=this.dragOffset.height+"px",ei.willChange="left, top",ei.position="fixed",this._dragFollow(ti),ei.transition="none",setTimeout(()=>{this.helper&&(ei.transition=null)},0),this}_removeHelperStyle(){var ei;this.helper.classList.remove("ui-draggable-dragging");let ti=(ei=this.helper)==null?void 0:ei.gridstackNode;if(!(ti!=null&&ti._isAboutToRemove)&&this.dragElementOriginStyle){let ni=this.helper,ri=this.dragElementOriginStyle.transition||null;ni.style.transition=this.dragElementOriginStyle.transition="none",ii.originStyleProp.forEach(si=>ni.style[si]=this.dragElementOriginStyle[si]||null),setTimeout(()=>ni.style.transition=ri,50)}return delete this.dragElementOriginStyle,this}_dragFollow(ti){let ei={left:0,top:0},ni=this.helper.style,ri=this.dragOffset;ni.left=(ti.clientX+ri.offsetLeft-ei.left)*this.dragTransform.xScale+"px",ni.top=(ti.clientY+ri.offsetTop-ei.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(ti,ei,ni){let ri=0,si=0;ni&&(ri=this.dragTransform.xOffset,si=this.dragTransform.yOffset);let ai=ei.getBoundingClientRect();return{left:ai.left,top:ai.top,offsetLeft:-ti.clientX+ai.left-ri,offsetTop:-ti.clientY+ai.top-si,width:ai.width*this.dragTransform.xScale,height:ai.height*this.dragTransform.yScale}}ui(){let ei=this.el.parentElement.getBoundingClientRect(),ni=this.helper.getBoundingClientRect();return{position:{top:(ni.top-ei.top)*this.dragTransform.yScale,left:(ni.left-ei.left)*this.dragTransform.xScale}}}};za.originStyleProp=["transition","pointerEvents","position","left","top","minWidth","willChange"];var jl=class extends fo{constructor(ti,ei={}){super(),this.el=ti,this.option=ei,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(ti,ei){super.on(ti,ei)}off(ti){super.off(ti)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),ss&&(this.el.addEventListener("pointerenter",au),this.el.addEventListener("pointerleave",lu)))}disable(ti=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),ti||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),ss&&(this.el.removeEventListener("pointerenter",au),this.el.removeEventListener("pointerleave",lu)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(ti){return Object.keys(ti).forEach(ei=>this.option[ei]=ti[ei]),this._setupAccept(),this}_mouseEnter(ti){if(!sn.dragElement||!this._canDrop(sn.dragElement.el))return;ti.preventDefault(),ti.stopPropagation(),sn.dropElement&&sn.dropElement!==this&&sn.dropElement._mouseLeave(ti,!0),sn.dropElement=this;let ei=xi.initEvent(ti,{target:this.el,type:"dropover"});this.option.over&&this.option.over(ei,this._ui(sn.dragElement)),this.triggerEvent("dropover",ei),this.el.classList.add("ui-droppable-over")}_mouseLeave(ti,ei=!1){var ri;if(!sn.dragElement||sn.dropElement!==this)return;ti.preventDefault(),ti.stopPropagation();let ni=xi.initEvent(ti,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(ni,this._ui(sn.dragElement)),this.triggerEvent("dropout",ni),sn.dropElement===this&&(delete sn.dropElement,!ei)){let si,ai=this.el.parentElement;for(;!si&&ai;)si=(ri=ai.ddElement)==null?void 0:ri.ddDroppable,ai=ai.parentElement;si&&si._mouseEnter(ti)}}drop(ti){ti.preventDefault();let ei=xi.initEvent(ti,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(ei,this._ui(sn.dragElement)),this.triggerEvent("drop",ei)}_canDrop(ti){return ti&&(!this.accept||this.accept(ti))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=ti=>ti.classList.contains(this.option.accept)||ti.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(ti){return Ui({draggable:ti.el},ti.ui())}};var Vl=class ii{static init(ti){return ti.ddElement||(ti.ddElement=new ii(ti)),ti.ddElement}constructor(ti){this.el=ti}on(ti,ei){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ti)>-1?this.ddDraggable.on(ti,ei):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ti)>-1?this.ddDroppable.on(ti,ei):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ti)>-1&&this.ddResizable.on(ti,ei),this}off(ti){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ti)>-1?this.ddDraggable.off(ti):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ti)>-1?this.ddDroppable.off(ti):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ti)>-1&&this.ddResizable.off(ti),this}setupDraggable(ti){return this.ddDraggable?this.ddDraggable.updateOption(ti):this.ddDraggable=new za(this.el,ti),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(ti){return this.ddResizable?this.ddResizable.updateOption(ti):this.ddResizable=new Ba(this.el,ti),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(ti){return this.ddDroppable?this.ddDroppable.updateOption(ti):this.ddDroppable=new jl(this.el,ti),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var ql=class{resizable(ti,ei,ni,ri){return this._getDDElements(ti).forEach(si=>{if(ei==="disable"||ei==="enable")si.ddResizable&&si.ddResizable[ei]();else if(ei==="destroy")si.ddResizable&&si.cleanResizable();else if(ei==="option")si.setupResizable({[ni]:ri});else{let li=si.el.gridstackNode.grid,di=si.el.getAttribute("gs-resize-handles")||li.opts.resizable.handles||"e,s,se";di==="all"&&(di="n,e,s,w,se,sw,ne,nw");let mi=!li.opts.alwaysShowResizeHandle;si.setupResizable(Hn(Ui({},li.opts.resizable),{handles:di,autoHide:mi,start:ei.start,stop:ei.stop,resize:ei.resize}))}}),this}draggable(ti,ei,ni,ri){return this._getDDElements(ti).forEach(si=>{if(ei==="disable"||ei==="enable")si.ddDraggable&&si.ddDraggable[ei]();else if(ei==="destroy")si.ddDraggable&&si.cleanDraggable();else if(ei==="option")si.setupDraggable({[ni]:ri});else{let ai=si.el.gridstackNode.grid;si.setupDraggable(Hn(Ui({},ai.opts.draggable),{start:ei.start,stop:ei.stop,drag:ei.drag}))}}),this}dragIn(ti,ei){return this._getDDElements(ti).forEach(ni=>ni.setupDraggable(ei)),this}droppable(ti,ei,ni,ri){return typeof ei.accept=="function"&&!ei._accept&&(ei._accept=ei.accept,ei.accept=si=>ei._accept(si)),this._getDDElements(ti).forEach(si=>{ei==="disable"||ei==="enable"?si.ddDroppable&&si.ddDroppable[ei]():ei==="destroy"?si.ddDroppable&&si.cleanDroppable():ei==="option"?si.setupDroppable({[ni]:ri}):si.setupDroppable(ei)}),this}isDroppable(ti){return!!(ti&&ti.ddElement&&ti.ddElement.ddDroppable&&!ti.ddElement.ddDroppable.disabled)}isDraggable(ti){return!!(ti&&ti.ddElement&&ti.ddElement.ddDraggable&&!ti.ddElement.ddDraggable.disabled)}isResizable(ti){return!!(ti&&ti.ddElement&&ti.ddElement.ddResizable&&!ti.ddElement.ddResizable.disabled)}on(ti,ei,ni){return this._getDDElements(ti).forEach(ri=>ri.on(ei,si=>{ni(si,sn.dragElement?sn.dragElement.el:si.target,sn.dragElement?sn.dragElement.helper:null)})),this}off(ti,ei){return this._getDDElements(ti).forEach(ni=>ni.off(ei)),this}_getDDElements(ti,ei=!0){let ni=xi.getElements(ti);if(!ni.length)return[];let ri=ni.map(si=>si.ddElement||(ei?Vl.init(si):null));return ei||ri.filter(si=>si),ri}};var os=new ql,ho=class ii{static init(ti={},ei=".grid-stack"){if(typeof document=="undefined")return null;let ni=ii.getGridElement(ei);return ni?(ni.gridstack||(ni.gridstack=new ii(ni,xi.cloneDeep(ti))),ni.gridstack):(console.error(typeof ei=="string"?'GridStack.initAll() no grid was found with selector "'+ei+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(ti={},ei=".grid-stack"){let ni=[];return typeof document=="undefined"||(ii.getGridElements(ei).forEach(ri=>{ri.gridstack||(ri.gridstack=new ii(ri,xi.cloneDeep(ti))),ni.push(ri.gridstack)}),ni.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+ei+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),ni}static addGrid(ti,ei={}){if(!ti)return null;let ni=ti;if(ni.gridstack){let ai=ni.gridstack;return ei&&(ai.opts=Ui(Ui({},ai.opts),ei)),ei.children!==void 0&&ai.load(ei.children),ai}if(!ti.classList.contains("grid-stack")||ii.addRemoveCB)if(ii.addRemoveCB)ni=ii.addRemoveCB(ti,ei,!0,!0);else{let ai=document.implementation.createHTMLDocument("");ai.body.innerHTML=`<div class="grid-stack ${ei.class||""}"></div>`,ni=ai.body.children[0],ti.appendChild(ni)}return ii.init(ei,ni)}static registerEngine(ti){ii.engineClass=ti}get placeholder(){if(!this._placeholder){let ti=document.createElement("div");ti.className="placeholder-content",this.opts.placeholderText&&(ti.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,fs.itemClass,this.opts.itemClass),this.placeholder.appendChild(ti)}return this._placeholder}constructor(ti,ei={}){var _i,Ei,Ai,ki;this.el=ti,this.opts=ei,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},ti.gridstack=this,ei=ei||{},ti.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),ei.row&&(ei.minRow=ei.maxRow=ei.row,delete ei.row);let ni=xi.toNumber(ti.getAttribute("gs-row"));ei.column==="auto"&&delete ei.column,ei.alwaysShowResizeHandle!==void 0&&(ei._alwaysShowResizeHandle=ei.alwaysShowResizeHandle);let ri=(_i=ei.columnOpts)==null?void 0:_i.breakpoints,si=ei;if(si.oneColumnModeDomSort&&(delete si.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),si.oneColumnSize||si.disableOneColumnMode===!1){let Ti=si.oneColumnSize||768;delete si.oneColumnSize,delete si.disableOneColumnMode,ei.columnOpts=ei.columnOpts||{},ri=ei.columnOpts.breakpoints=ei.columnOpts.breakpoints||[];let Fi=ri.find(en=>en.c===1);Fi?Fi.w=Ti:(Fi={c:1,w:Ti},ri.push(Fi,{c:12,w:Ti+1}))}let ai=ei.columnOpts;ai&&(!ai.columnWidth&&!((Ei=ai.breakpoints)!=null&&Ei.length)?(delete ei.columnOpts,ri=void 0):ai.columnMax=ai.columnMax||12),(ri==null?void 0:ri.length)>1&&ri.sort((Ti,Fi)=>(Fi.w||0)-(Ti.w||0));let li=Hn(Ui({},xi.cloneDeep(fs)),{column:xi.toNumber(ti.getAttribute("gs-column"))||fs.column,minRow:ni||xi.toNumber(ti.getAttribute("gs-min-row"))||fs.minRow,maxRow:ni||xi.toNumber(ti.getAttribute("gs-max-row"))||fs.maxRow,staticGrid:xi.toBool(ti.getAttribute("gs-static"))||fs.staticGrid,draggable:{handle:(ei.handleClass?"."+ei.handleClass:ei.handle?ei.handle:"")||fs.draggable.handle},removableOptions:{accept:ei.itemClass||fs.removableOptions.accept,decline:fs.removableOptions.decline}});ti.getAttribute("gs-animate")&&(li.animate=xi.toBool(ti.getAttribute("gs-animate"))),ei=xi.defaults(ei,li),this._initMargin(),this.checkDynamicColumn(),this.el.classList.add("gs-"+ei.column),ei.rtl==="auto"&&(ei.rtl=ti.style.direction==="rtl"),ei.rtl&&this.el.classList.add("grid-stack-rtl");let di=(Ai=this.el.parentElement)==null?void 0:Ai.parentElement,mi=di!=null&&di.classList.contains(fs.itemClass)?di.gridstackNode:void 0;mi&&(mi.subGrid=this,this.parentGridItem=mi,this.el.classList.add("grid-stack-nested"),mi.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=ei.cellHeight==="auto",this._isAutoCellHeight||ei.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof ei.cellHeight=="number"&&ei.cellHeightUnit&&ei.cellHeightUnit!==fs.cellHeightUnit&&(ei.cellHeight=ei.cellHeight+ei.cellHeightUnit,delete ei.cellHeightUnit),this.cellHeight(ei.cellHeight,!1)),ei.alwaysShowResizeHandle==="mobile"&&(ei.alwaysShowResizeHandle=ss),this._styleSheetClass="gs-id-"+Io._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let hi=ei.engineClass||ii.engineClass||Io;if(this.engine=new hi({column:this.getColumn(),float:ei.float,maxRow:ei.maxRow,onChange:Ti=>{let Fi=0;this.engine.nodes.forEach(en=>{Fi=Math.max(Fi,en.y+en.h)}),Ti.forEach(en=>{let rn=en.el;rn&&(en._removeDOM?(rn&&rn.remove(),delete en._removeDOM):this._writePosAttr(rn,en))}),this._updateStyles(!1,Fi)}}),this._updateStyles(!1,0),ei.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(Ti=>this._prepareElement(Ti)),delete this.engine._loading,this.batchUpdate(!1)),ei.children){let Ti=ei.children;delete ei.children,Ti.length&&this.load(Ti)}this.setAnimation(),ei.subGridDynamic&&!sn.pauseDrag&&(sn.pauseDrag=!0),((ki=ei.draggable)==null?void 0:ki.pause)!==void 0&&(sn.pauseDrag=ei.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(ti,ei){function ni(li){return li.el!==void 0||li.x!==void 0||li.y!==void 0||li.w!==void 0||li.h!==void 0||li.content!==void 0}let ri,si;if(typeof ti=="string"){let li=document.implementation.createHTMLDocument("");li.body.innerHTML=ti,ri=li.body.children[0]}else if(arguments.length===0||arguments.length===1&&ni(ti))if(si=ei=ti,si!=null&&si.el)ri=si.el;else if(ii.addRemoveCB)ri=ii.addRemoveCB(this.el,ei,!0,!1);else{let li=(ei==null?void 0:ei.content)||"",di=document.implementation.createHTMLDocument("");di.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${li}</div></div>`,ri=di.body.children[0]}else ri=ti;if(!ri)return;if(si=ri.gridstackNode,si&&ri.parentElement===this.el&&this.engine.nodes.find(li=>li._id===si._id))return ri;let ai=this._readAttr(ri);return ei=xi.cloneDeep(ei)||{},xi.defaults(ei,ai),si=this.engine.prepareNode(ei),this._writeAttr(ri,ei),this.el.appendChild(ri),this.makeWidget(ri,ei),ri}makeSubGrid(ti,ei,ni,ri=!0){var Ai,ki,Ti;let si=ti.gridstackNode;if(si||(si=this.makeWidget(ti).gridstackNode),(Ai=si.subGrid)!=null&&Ai.el)return si.subGrid;let ai,li=this;for(;li&&!ai;)ai=(ki=li.opts)==null?void 0:ki.subGridOpts,li=(Ti=li.parentGridItem)==null?void 0:Ti.grid;ei=xi.cloneDeep(Ui(Hn(Ui({},ai||{}),{children:void 0}),ei||si.subGridOpts||{})),si.subGridOpts=ei;let di;ei.column==="auto"&&(di=!0,ei.column=Math.max(si.w||1,(ni==null?void 0:ni.w)||1),delete ei.columnOpts);let mi=si.el.querySelector(".grid-stack-item-content"),hi,_i;if(ri){if(this._removeDD(si.el),_i=Hn(Ui({},si),{x:0,y:0}),xi.removeInternalForSave(_i),delete _i.subGridOpts,si.content&&(_i.content=si.content,delete si.content),ii.addRemoveCB)hi=ii.addRemoveCB(this.el,_i,!0,!1);else{let Fi=document.implementation.createHTMLDocument("");Fi.body.innerHTML='<div class="grid-stack-item"></div>',hi=Fi.body.children[0],hi.appendChild(mi),Fi.body.innerHTML='<div class="grid-stack-item-content"></div>',mi=Fi.body.children[0],si.el.appendChild(mi)}this._prepareDragDropByNode(si)}if(ni){let Fi=di?ei.column:si.w,en=si.h+ni.h,rn=si.el.style;rn.transition="none",this.update(si.el,{w:Fi,h:en}),setTimeout(()=>rn.transition=null)}let Ei=si.subGrid=ii.addGrid(mi,ei);return ni!=null&&ni._moving&&(Ei._isTemp=!0),di&&(Ei._autoColumn=!0),ri&&Ei.addWidget(hi,_i),ni&&(ni._moving?window.setTimeout(()=>xi.simulateMouseEvent(ni._event,"mouseenter",Ei.el),0):Ei.addWidget(si.el,si)),Ei}removeAsSubGrid(ti){var ni;let ei=(ni=this.parentGridItem)==null?void 0:ni.grid;ei&&(ei.batchUpdate(),ei.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(ri=>{ri.x+=this.parentGridItem.x,ri.y+=this.parentGridItem.y,ei.addWidget(ri.el,ri)}),ei.batchUpdate(!1),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,ti&&window.setTimeout(()=>xi.simulateMouseEvent(ti._event,"mouseenter",ei.el),0))}save(ti=!0,ei=!1,ni=ii.saveCB){let ri=this.engine.save(ti,ni);if(ri.forEach(si=>{var ai;if(ti&&si.el&&!si.subGrid&&!ni){let li=si.el.querySelector(".grid-stack-item-content");si.content=li?li.innerHTML:void 0,si.content||delete si.content}else if(!ti&&!ni&&delete si.content,(ai=si.subGrid)!=null&&ai.el){let li=si.subGrid.save(ti,ei,ni);si.subGridOpts=ei?li:{children:li},delete si.subGrid}delete si.el}),ei){let si=xi.cloneDeep(this.opts);si.marginBottom===si.marginTop&&si.marginRight===si.marginLeft&&si.marginTop===si.marginRight&&(si.margin=si.marginTop,delete si.marginTop,delete si.marginRight,delete si.marginBottom,delete si.marginLeft),si.rtl===(this.el.style.direction==="rtl")&&(si.rtl="auto"),this._isAutoCellHeight&&(si.cellHeight="auto"),this._autoColumn&&(si.column="auto");let ai=si._alwaysShowResizeHandle;return delete si._alwaysShowResizeHandle,ai!==void 0?si.alwaysShowResizeHandle=ai:delete si.alwaysShowResizeHandle,xi.removeInternalAndSame(si,fs),si.children=ri,si}return ri}load(ti,ei=ii.addRemoveCB||!0){var mi;ti=xi.cloneDeep(ti);let ni=this.getColumn();ti.forEach(hi=>{hi.w=hi.w||1,hi.h=hi.h||1}),ti=xi.sort(ti);let ri=0;ti.forEach(hi=>{ri=Math.max(ri,(hi.x||0)+hi.w)}),ri>ni&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(ti,ri,!0));let si=ii.addRemoveCB;typeof ei=="function"&&(ii.addRemoveCB=ei);let ai=[];this.batchUpdate();let li=!this.engine.nodes.length;li&&this.setAnimation(!1),!li&&ei&&[...this.engine.nodes].forEach(_i=>{if(!_i.id)return;xi.find(ti,_i.id)||(ii.addRemoveCB&&ii.addRemoveCB(this.el,_i,!1,!1),ai.push(_i),this.removeWidget(_i.el,!0,!1))}),this.engine._loading=!0;let di=[];return this.engine.nodes=this.engine.nodes.filter(hi=>xi.find(ti,hi.id)?(di.push(hi),!1):!0),ti.forEach(hi=>{var Ei;let _i=xi.find(di,hi.id);if(_i){if(xi.shouldSizeToContent(_i)&&(hi.h=_i.h),this.engine.nodeBoundFix(hi),(hi.autoPosition||hi.x===void 0||hi.y===void 0)&&(hi.w=hi.w||_i.w,hi.h=hi.h||_i.h,this.engine.findEmptyPosition(hi)),this.engine.nodes.push(_i),xi.samePos(_i,hi)&&this.moveNode(_i,Hn(Ui({},hi),{forceCollide:!0})),this.update(_i.el,hi),(Ei=hi.subGridOpts)!=null&&Ei.children){let Ai=_i.el.querySelector(".grid-stack");Ai&&Ai.gridstack&&Ai.gridstack.load(hi.subGridOpts.children)}}else ei&&this.addWidget(hi)}),delete this.engine._loading,this.engine.removedNodes=ai,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,si?ii.addRemoveCB=si:delete ii.addRemoveCB,li&&((mi=this.opts)!=null&&mi.animate)&&this.setAnimation(this.opts.animate,!0),this}batchUpdate(ti=!0){return this.engine.batchUpdate(ti),ti||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(ti=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!ti||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let ei=this.el.querySelector("."+this.opts.itemClass);if(ei){let ri=xi.toNumber(ei.getAttribute("gs-h"))||1;return Math.round(ei.offsetHeight/ri)}let ni=parseInt(this.el.getAttribute("gs-current-row"));return ni?Math.round(this.el.getBoundingClientRect().height/ni):this.opts.cellHeight}cellHeight(ti,ei=!0){if(ei&&ti!==void 0&&this._isAutoCellHeight!==(ti==="auto")&&(this._isAutoCellHeight=ti==="auto",this._updateResizeEvent()),(ti==="initial"||ti==="auto")&&(ti=void 0),ti===void 0){let ri=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;ti=this.cellWidth()+ri}let ni=xi.parseHeight(ti);return this.opts.cellHeightUnit===ni.unit&&this.opts.cellHeight===ni.h?this:(this.opts.cellHeightUnit=ni.unit,this.opts.cellHeight=ni.h,this.resizeToContentCheck(),ei&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(ti=!1){var ei;return ti&&((ei=this.opts.columnOpts)!=null&&ei.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var si,ai;let ti=this.opts.columnOpts;if(!ti||!ti.columnWidth&&!((si=ti.breakpoints)!=null&&si.length))return!1;let ei=this.getColumn(),ni=ei,ri=this._widthOrContainer(!0);if(ti.columnWidth)ni=Math.min(Math.round(ri/ti.columnWidth)||1,ti.columnMax);else{ni=ti.columnMax;let li=0;for(;li<ti.breakpoints.length&&ri<=ti.breakpoints[li].w;)ni=ti.breakpoints[li++].c||ei}if(ni!==ei){let li=(ai=ti.breakpoints)==null?void 0:ai.find(di=>di.c===ni);return this.column(ni,(li==null?void 0:li.layout)||ti.layout),!0}return!1}compact(ti="compact",ei=!0){return this.engine.compact(ti,ei),this._triggerChangeEvent(),this}column(ti,ei="moveScale"){if(!ti||ti<1||this.opts.column===ti)return this;let ni=this.getColumn();return this.opts.column=ti,this.engine?(this.engine.column=ti,this.el.classList.remove("gs-"+ni),this.el.classList.add("gs-"+ti),this.engine.columnChanged(ni,ti,ei),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(ti=>ti.matches("."+this.opts.itemClass)&&!ti.matches("."+this.opts.placeholderClass))}destroy(ti=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),ti?this.el.parentNode.removeChild(this.el):(this.removeAll(ti),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(ti){return this.opts.float!==ti&&(this.opts.float=this.engine.float=ti,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(ti,ei=!1){let ni=this.el.getBoundingClientRect(),ri;ei?ri={top:ni.top+document.documentElement.scrollTop,left:ni.left}:ri={top:this.el.offsetTop,left:this.el.offsetLeft};let si=ti.left-ri.left,ai=ti.top-ri.top,li=ni.width/this.getColumn(),di=ni.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(si/li),y:Math.floor(ai/di)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(ti,ei,ni,ri){return this.engine.isAreaEmpty(ti,ei,ni,ri)}makeWidget(ti,ei){let ni=ii.getElement(ti);this._prepareElement(ni,!0,ei);let ri=ni.gridstackNode;return this._updateContainerHeight(),ri.subGridOpts&&this.makeSubGrid(ni,ri.subGridOpts,void 0,!1),this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,ni}on(ti,ei){return ti.indexOf(" ")!==-1?(ti.split(" ").forEach(ri=>this.on(ri,ei)),this):(ti==="change"||ti==="added"||ti==="removed"||ti==="enable"||ti==="disable"?(ti==="enable"||ti==="disable"?this._gsEventHandler[ti]=ri=>ei(ri):this._gsEventHandler[ti]=ri=>ei(ri,ri.detail),this.el.addEventListener(ti,this._gsEventHandler[ti])):ti==="drag"||ti==="dragstart"||ti==="dragstop"||ti==="resizestart"||ti==="resize"||ti==="resizestop"||ti==="dropped"||ti==="resizecontent"?this._gsEventHandler[ti]=ei:console.error("GridStack.on("+ti+") event not supported"),this)}off(ti){return ti.indexOf(" ")!==-1?(ti.split(" ").forEach(ni=>this.off(ni)),this):((ti==="change"||ti==="added"||ti==="removed"||ti==="enable"||ti==="disable")&&this._gsEventHandler[ti]&&this.el.removeEventListener(ti,this._gsEventHandler[ti]),delete this._gsEventHandler[ti],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(ti=>this.off(ti)),this}removeWidget(ti,ei=!0,ni=!0){return ii.getElements(ti).forEach(ri=>{if(ri.parentElement&&ri.parentElement!==this.el)return;let si=ri.gridstackNode;si||(si=this.engine.nodes.find(ai=>ri===ai.el)),si&&(ei&&ii.addRemoveCB&&ii.addRemoveCB(this.el,si,!1,!1),delete ri.gridstackNode,this._removeDD(ri),this.engine.removeNode(si,ei,ni),ei&&ri.parentElement&&ri.remove())}),ni&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(ti=!0,ei=!0){return this.engine.nodes.forEach(ni=>{ti&&ii.addRemoveCB&&ii.addRemoveCB(this.el,ni,!1,!1),delete ni.el.gridstackNode,this.opts.staticGrid||this._removeDD(ni.el)}),this.engine.removeAll(ti,ei),ei&&this._triggerRemoveEvent(),this}setAnimation(ti=this.opts.animate,ei){return ei?setTimeout(()=>{this.opts&&this.setAnimation(ti)}):ti?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(ti,ei=!0,ni=!0){return!!this.opts.staticGrid===ti?this:(ti?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(ri=>{this._prepareDragDropByNode(ri),ri.subGrid&&ni&&ri.subGrid.setStatic(ti,ei,ni)}),ei&&this._setStaticClass(),this)}update(ti,ei){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let ni=arguments,ri=1;return ei={x:ni[ri++],y:ni[ri++],w:ni[ri++],h:ni[ri++]},this.update(ti,ei)}return ii.getElements(ti).forEach(ni=>{var hi;let ri=ni==null?void 0:ni.gridstackNode;if(!ri)return;let si=xi.cloneDeep(ei);this.engine.nodeBoundFix(si),delete si.autoPosition,delete si.id;let ai=["x","y","w","h"],li;if(ai.some(_i=>si[_i]!==void 0&&si[_i]!==ri[_i])&&(li={},ai.forEach(_i=>{li[_i]=si[_i]!==void 0?si[_i]:ri[_i],delete si[_i]})),!li&&(si.minW||si.minH||si.maxW||si.maxH)&&(li={}),si.content!==void 0){let _i=ni.querySelector(".grid-stack-item-content");_i&&_i.innerHTML!==si.content&&(_i.innerHTML=si.content,(hi=ri.subGrid)!=null&&hi.el&&(_i.appendChild(ri.subGrid.el),ri.subGrid.opts.styleInHead||ri.subGrid._updateStyles(!0))),delete si.content}let di=!1,mi=!1;for(let _i in si)_i[0]!=="_"&&ri[_i]!==si[_i]&&(ri[_i]=si[_i],di=!0,mi=mi||!this.opts.staticGrid&&(_i==="noResize"||_i==="noMove"||_i==="locked"));if(xi.sanitizeMinMax(ri),li){let _i=li.w!==void 0&&li.w!==ri.w;this.moveNode(ri,li),this.resizeToContentCheck(_i,ri),delete ri._orig}(li||di)&&this._writeAttr(ni,ri),mi&&this._prepareDragDropByNode(ri)}),this}moveNode(ti,ei){let ni=ti._updating;ni||this.engine.cleanNodes().beginUpdate(ti),this.engine.moveNode(ti,ei),this._updateContainerHeight(),ni||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(ti){var Ei,Ai;if(!ti||(ti.classList.remove("size-to-content-max"),!ti.clientHeight))return;let ei=ti.gridstackNode;if(!ei)return;let ni=ei.grid;if(!ni||ti.parentElement!==ni.el)return;let ri=ni.getCellHeight(!0);if(!ri)return;let si=ei.h?ei.h*ri:ti.clientHeight,ai;if(ei.resizeToContentParent&&(ai=ti.querySelector(ei.resizeToContentParent)),ai||(ai=ti.querySelector(ii.resizeToContentParent)),!ai)return;let li=ti.clientHeight-ai.clientHeight,di=ei.h?ei.h*ri-li:ai.clientHeight,mi;if(ei.subGrid)mi=ei.subGrid.getRow()*ei.subGrid.getCellHeight(!0);else{if((Ai=(Ei=ei.subGridOpts)==null?void 0:Ei.children)!=null&&Ai.length)return;{let ki=ai.firstElementChild;if(!ki){console.error(`Error: GridStack.resizeToContent() widget id:${ei.id} '${ii.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}mi=ki.getBoundingClientRect().height||di}}if(di===mi)return;si+=mi-di;let hi=Math.ceil(si/ri),_i=Number.isInteger(ei.sizeToContent)?ei.sizeToContent:0;_i&&hi>_i&&(hi=_i,ti.classList.add("size-to-content-max")),ei.minH&&hi<ei.minH?hi=ei.minH:ei.maxH&&hi>ei.maxH&&(hi=ei.maxH),hi!==ei.h&&(ni._ignoreLayoutsNodeChange=!0,ni.moveNode(ei,{h:hi}),delete ni._ignoreLayoutsNodeChange)}resizeToContentCBCheck(ti){ii.resizeToContentCB?ii.resizeToContentCB(ti):this.resizeToContent(ti)}rotate(ti,ei){return ii.getElements(ti).forEach(ni=>{let ri=ni.gridstackNode;if(!xi.canBeRotated(ri))return;let si={w:ri.h,h:ri.w,minH:ri.minW,minW:ri.minH,maxH:ri.maxW,maxW:ri.maxH};if(ei){let li=ei.left>0?Math.floor(ei.left/this.cellWidth()):0,di=ei.top>0?Math.floor(ei.top/this.opts.cellHeight):0;si.x=ri.x+li-(ri.h-(di+1)),si.y=ri.y+di-li}Object.keys(si).forEach(li=>{si[li]===void 0&&delete si[li]});let ai=ri._orig;this.update(ni,si),ri._orig=ai}),this}margin(ti){if(!(typeof ti=="string"&&ti.split(" ").length>1)){let ni=xi.parseHeight(ti);if(this.opts.marginUnit===ni.unit&&this.opts.margin===ni.h)return}return this.opts.margin=ti,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(ti){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let ei=arguments,ni=0,ri={x:ei[ni++],y:ei[ni++],w:ei[ni++],h:ei[ni++],autoPosition:ei[ni++]};return this.willItFit(ri)}return this.engine.willItFit(ti)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let ti=this.engine.getDirtyNodes(!0);return ti&&ti.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(ti),this._triggerEvent("change",ti)),this.engine.saveInitial(),this}_triggerAddEvent(){var ti;if(this.engine.batchMode)return this;if((ti=this.engine.addedNodes)!=null&&ti.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(ni=>{delete ni._dirty});let ei=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",ei)}return this}_triggerRemoveEvent(){var ti;if(this.engine.batchMode)return this;if((ti=this.engine.removedNodes)!=null&&ti.length){let ei=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",ei)}return this}_triggerEvent(ti,ei){let ni=ei?new CustomEvent(ti,{bubbles:!1,detail:ei}):new Event(ti);return this.el.dispatchEvent(ni),this}_removeStylesheet(){if(this._styles){let ti=this.opts.styleInHead?void 0:this.el.parentNode;xi.removeStylesheet(this._styleSheetClass,ti),delete this._styles}return this}_updateStyles(ti=!1,ei){if(ti&&this._removeStylesheet(),ei===void 0&&(ei=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;let ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit,si=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let ai=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=xi.createStylesheet(this._styleSheetClass,ai,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,xi.addCSSRule(this._styles,si,`height: ${ni}${ri}`);let li=this.opts.marginTop+this.opts.marginUnit,di=this.opts.marginBottom+this.opts.marginUnit,mi=this.opts.marginRight+this.opts.marginUnit,hi=this.opts.marginLeft+this.opts.marginUnit,_i=`${si} > .grid-stack-item-content`,Ei=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;xi.addCSSRule(this._styles,_i,`top: ${li}; right: ${mi}; bottom: ${di}; left: ${hi};`),xi.addCSSRule(this._styles,Ei,`top: ${li}; right: ${mi}; bottom: ${di}; left: ${hi};`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-n`,`top: ${li};`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-s`,`bottom: ${di}`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-ne`,`right: ${mi}`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-e`,`right: ${mi}`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-se`,`right: ${mi}; bottom: ${di}`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-nw`,`left: ${hi}`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-w`,`left: ${hi}`),xi.addCSSRule(this._styles,`${si} > .ui-resizable-sw`,`left: ${hi}; bottom: ${di}`)}if(ei=ei||this._styles._max,ei>this._styles._max){let ai=li=>ni*li+ri;for(let li=this._styles._max+1;li<=ei;li++)xi.addCSSRule(this._styles,`${si}[gs-y="${li}"]`,`top: ${ai(li)}`),xi.addCSSRule(this._styles,`${si}[gs-h="${li+1}"]`,`height: ${ai(li+1)}`);this._styles._max=ei}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let ti=this.parentGridItem,ei=this.getRow()+this._extraDragRow,ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit;if(!ni)return this;if(!ti){let si=xi.parseHeight(getComputedStyle(this.el).minHeight);if(si.h>0&&si.unit===ri){let ai=Math.floor(si.h/ni);ei<ai&&(ei=ai)}}return this.el.setAttribute("gs-current-row",String(ei)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),ei&&(this.el.style[ti?"minHeight":"height"]=ei*ni+ri),ti&&!ti.grid.engine.batchMode&&xi.shouldSizeToContent(ti)&&ti.grid.resizeToContentCBCheck(ti.el),this}_prepareElement(ti,ei=!1,ni){ni=ni||this._readAttr(ti),ti.gridstackNode=ni,ni.el=ti,ni.grid=this,ni=this.engine.addNode(ni,ei),this._writeAttr(ti,ni),ti.classList.add(fs.itemClass,this.opts.itemClass);let ri=xi.shouldSizeToContent(ni);return ri?ti.classList.add("size-to-content"):ti.classList.remove("size-to-content"),ri&&this.resizeToContentCheck(!1,ni),this._prepareDragDropByNode(ni),this}_writePosAttr(ti,ei){return ei.x!==void 0&&ei.x!==null&&ti.setAttribute("gs-x",String(ei.x)),ei.y!==void 0&&ei.y!==null&&ti.setAttribute("gs-y",String(ei.y)),ei.w>1?ti.setAttribute("gs-w",String(ei.w)):ti.removeAttribute("gs-w"),ei.h>1?ti.setAttribute("gs-h",String(ei.h)):ti.removeAttribute("gs-h"),this}_writeAttr(ti,ei){if(!ei)return this;this._writePosAttr(ti,ei);let ni={autoPosition:"gs-auto-position",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id"};for(let ri in ni)ei[ri]?ti.setAttribute(ni[ri],String(ei[ri])):ti.removeAttribute(ni[ri]);return this}_readAttr(ti,ei=!0){let ni={};ni.x=xi.toNumber(ti.getAttribute("gs-x")),ni.y=xi.toNumber(ti.getAttribute("gs-y")),ni.w=xi.toNumber(ti.getAttribute("gs-w")),ni.h=xi.toNumber(ti.getAttribute("gs-h")),ni.autoPosition=xi.toBool(ti.getAttribute("gs-auto-position")),ni.noResize=xi.toBool(ti.getAttribute("gs-no-resize")),ni.noMove=xi.toBool(ti.getAttribute("gs-no-move")),ni.locked=xi.toBool(ti.getAttribute("gs-locked")),ni.id=ti.getAttribute("gs-id"),ni.maxW=xi.toNumber(ti.getAttribute("gs-max-w")),ni.minW=xi.toNumber(ti.getAttribute("gs-min-w")),ni.maxH=xi.toNumber(ti.getAttribute("gs-max-h")),ni.minH=xi.toNumber(ti.getAttribute("gs-min-h")),ei&&(ni.w===1&&ti.removeAttribute("gs-w"),ni.h===1&&ti.removeAttribute("gs-h"),ni.maxW&&ti.removeAttribute("gs-max-w"),ni.minW&&ti.removeAttribute("gs-min-w"),ni.maxH&&ti.removeAttribute("gs-max-h"),ni.minH&&ti.removeAttribute("gs-min-h"));for(let ri in ni){if(!ni.hasOwnProperty(ri))return;!ni[ri]&&ni[ri]!==0&&delete ni[ri]}return ni}_setStaticClass(){let ti=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...ti),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...ti),this.el.removeAttribute("gs-static")),this}onResize(){var ei;if(!((ei=this.el)!=null&&ei.clientWidth)||this.prevWidth===this.el.clientWidth)return;this.prevWidth=this.el.clientWidth,this.batchUpdate();let ti=!1;return this._autoColumn&&this.parentGridItem?this.opts.column!==this.parentGridItem.w&&(this.column(this.parentGridItem.w,"none"),ti=!0):ti=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(ni=>{ni.subGrid&&ni.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(ti),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(ti=!1,ei=void 0){if(this.engine){if(ti&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,ei),310);if(ei)xi.shouldSizeToContent(ei)&&this.resizeToContentCBCheck(ei.el);else if(this.engine.nodes.some(ni=>xi.shouldSizeToContent(ni))){let ni=[...this.engine.nodes];this.batchUpdate(),ni.forEach(ri=>{xi.shouldSizeToContent(ri)&&this.resizeToContentCBCheck(ri.el)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,ei?[ei]:this.engine.nodes)}}_updateResizeEvent(ti=!1){let ei=!this.parentGridItem&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(ni=>ni.sizeToContent));return!ti&&ei&&!this.resizeObserver?(this._sizeThrottle=xi.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(ti||!ei)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(ti=".grid-stack-item"){return xi.getElement(ti)}static getElements(ti=".grid-stack-item"){return xi.getElements(ti)}static getGridElement(ti){return ii.getElement(ti)}static getGridElements(ti){return xi.getElements(ti)}_initMargin(){let ti,ei=0,ni=[];return typeof this.opts.margin=="string"&&(ni=this.opts.margin.split(" ")),ni.length===2?(this.opts.marginTop=this.opts.marginBottom=ni[0],this.opts.marginLeft=this.opts.marginRight=ni[1]):ni.length===4?(this.opts.marginTop=ni[0],this.opts.marginRight=ni[1],this.opts.marginBottom=ni[2],this.opts.marginLeft=ni[3]):(ti=xi.parseHeight(this.opts.margin),this.opts.marginUnit=ti.unit,ei=this.opts.margin=ti.h),this.opts.marginTop===void 0?this.opts.marginTop=ei:(ti=xi.parseHeight(this.opts.marginTop),this.opts.marginTop=ti.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=ei:(ti=xi.parseHeight(this.opts.marginBottom),this.opts.marginBottom=ti.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=ei:(ti=xi.parseHeight(this.opts.marginRight),this.opts.marginRight=ti.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=ei:(ti=xi.parseHeight(this.opts.marginLeft),this.opts.marginLeft=ti.h,delete this.opts.margin),this.opts.marginUnit=ti.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return os}static setupDragIn(ti,ei,ni=document){(ei==null?void 0:ei.pause)!==void 0&&(sn.pauseDrag=ei.pause),ei=Ui(Ui({},Uf),ei||{});let ri=typeof ti=="string"?xi.getElements(ti,ni):ti;ri.length&&(ri==null||ri.forEach(si=>{os.isDraggable(si)||os.dragIn(si,ei)}))}movable(ti,ei){return this.opts.staticGrid?this:(ii.getElements(ti).forEach(ni=>{let ri=ni.gridstackNode;ri&&(ei?delete ri.noMove:ri.noMove=!0,this._prepareDragDropByNode(ri))}),this)}resizable(ti,ei){return this.opts.staticGrid?this:(ii.getElements(ti).forEach(ni=>{let ri=ni.gridstackNode;ri&&(ei?delete ri.noResize:ri.noResize=!0,this._prepareDragDropByNode(ri))}),this)}disable(ti=!0){if(!this.opts.staticGrid)return this.enableMove(!1,ti),this.enableResize(!1,ti),this._triggerEvent("disable"),this}enable(ti=!0){if(!this.opts.staticGrid)return this.enableMove(!0,ti),this.enableResize(!0,ti),this._triggerEvent("enable"),this}enableMove(ti,ei=!0){return this.opts.staticGrid?this:(ti?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(ni=>{this._prepareDragDropByNode(ni),ni.subGrid&&ei&&ni.subGrid.enableMove(ti,ei)}),this)}enableResize(ti,ei=!0){return this.opts.staticGrid?this:(ti?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(ni=>{this._prepareDragDropByNode(ni),ni.subGrid&&ei&&ni.subGrid.enableResize(ti,ei)}),this)}_removeDD(ti){return os.draggable(ti,"destroy").resizable(ti,"destroy"),ti.gridstackNode&&delete ti.gridstackNode._initDD,delete ti.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return os.droppable(this.el,"destroy"),this;let ti,ei,ni=(ri,si,ai)=>{var Ei;let li=si.gridstackNode;if(!li)return;if(ai=ai||si,!((Ei=li.grid)!=null&&Ei.el)){ai.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let Ai=ai.getBoundingClientRect();ai.style.left=Ai.x+(this.dragTransform.xScale-1)*(ri.clientX-Ai.x)/this.dragTransform.xScale+"px",ai.style.top=Ai.y+(this.dragTransform.yScale-1)*(ri.clientY-Ai.y)/this.dragTransform.yScale+"px",ai.style.transformOrigin="0px 0px"}let di=this.el.getBoundingClientRect(),{top:mi,left:hi}=ai.getBoundingClientRect();hi-=di.left,mi-=di.top;let _i={position:{top:mi*this.dragTransform.xScale,left:hi*this.dragTransform.yScale}};if(li._temporaryRemoved){if(li.x=Math.max(0,Math.round(hi/ei)),li.y=Math.max(0,Math.round(mi/ti)),delete li.autoPosition,this.engine.nodeBoundFix(li),!this.engine.willItFit(li)){if(li.autoPosition=!0,!this.engine.willItFit(li)){os.off(si,"drag");return}li._willFitPos&&(xi.copyPos(li,li._willFitPos),delete li._willFitPos)}this._onStartMoving(ai,ri,_i,li,ei,ti)}else this._dragOrResize(ai,ri,_i,li,ei,ti)};return os.droppable(this.el,{accept:ri=>{let si=ri.gridstackNode||this._readAttr(ri,!1);if((si==null?void 0:si.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let ai=!0;if(typeof this.opts.acceptWidgets=="function")ai=this.opts.acceptWidgets(ri);else{let li=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;ai=ri.matches(li)}if(ai&&si&&this.opts.maxRow){let li={w:si.w,h:si.h,minW:si.minW,minH:si.minH};ai=this.engine.willItFit(li)}return ai}}).on(this.el,"dropover",(ri,si,ai)=>{let li=si.gridstackNode;if((li==null?void 0:li.grid)===this&&!li._temporaryRemoved)return!1;li!=null&&li.grid&&li.grid!==this&&!li._temporaryRemoved&&li.grid._leave(si,ai),ei=this.cellWidth(),ti=this.getCellHeight(!0),li||(li=this._readAttr(si,!1)),li.grid||(li._isExternal=!0,si.gridstackNode=li),ai=ai||si;let di=li.w||Math.round(ai.offsetWidth/ei)||1,mi=li.h||Math.round(ai.offsetHeight/ti)||1;return li.grid&&li.grid!==this?(si._gridstackNodeOrig||(si._gridstackNodeOrig=li),si.gridstackNode=li=Hn(Ui({},li),{w:di,h:mi,grid:this}),delete li.x,delete li.y,this.engine.cleanupNode(li).nodeBoundFix(li),li._initDD=li._isExternal=li._temporaryRemoved=!0):(li.w=di,li.h=mi,li._temporaryRemoved=!0),ii._itemRemoving(li.el,!1),os.on(si,"drag",ni),ni(ri,si,ai),!1}).on(this.el,"dropout",(ri,si,ai)=>{let li=si.gridstackNode;return li&&(!li.grid||li.grid===this)&&(this._leave(si,ai),this._isTemp&&this.removeAsSubGrid(li)),!1}).on(this.el,"drop",(ri,si,ai)=>{var Ei,Ai,ki;let li=si.gridstackNode;if((li==null?void 0:li.grid)===this&&!li._isExternal)return!1;let di=!!this.placeholder.parentElement;this.placeholder.remove();let mi=di&&this.opts.animate;mi&&this.setAnimation(!1);let hi=si._gridstackNodeOrig;if(delete si._gridstackNodeOrig,di&&(hi!=null&&hi.grid)&&hi.grid!==this){let Ti=hi.grid;Ti.engine.removeNodeFromLayoutCache(hi),Ti.engine.removedNodes.push(hi),Ti._triggerRemoveEvent()._triggerChangeEvent(),Ti.parentGridItem&&!Ti.engine.nodes.length&&Ti.opts.subGridDynamic&&Ti.removeAsSubGrid()}if(!li||(di&&(this.engine.cleanupNode(li),li.grid=this),(Ei=li.grid)==null||delete Ei._isTemp,os.off(si,"drag"),ai!==si?(ai.remove(),si.gridstackNode=hi,di&&(si=si.cloneNode(!0))):(si.remove(),this._removeDD(si)),!di))return!1;si.gridstackNode=li,li.el=si;let _i=(ki=(Ai=li.subGrid)==null?void 0:Ai.el)==null?void 0:ki.gridstack;return xi.copyPos(li,this._readAttr(this.placeholder)),xi.removePositioningStyles(si),this.el.appendChild(si),this._prepareElement(si,!0,li),_i&&(_i.parentGridItem=li,_i.opts.styleInHead||_i._updateStyles(!0)),this._updateContainerHeight(),this.engine.addedNodes.push(li),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(Hn(Ui({},ri),{type:"dropped"}),hi&&hi.grid?hi:void 0,li),mi&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(ti,ei){let ni=ti?ti.gridstackNode:void 0;!(ni!=null&&ni.grid)||ti.classList.contains(ni.grid.opts.removableOptions.decline)||(ei?ni._isAboutToRemove=!0:delete ni._isAboutToRemove,ei?ti.classList.add("grid-stack-item-removing"):ti.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let ti=document.querySelector(this.opts.removable);return ti?(!this.opts.staticGrid&&!os.isDroppable(ti)&&os.droppable(ti,this.opts.removableOptions).on(ti,"dropover",(ei,ni)=>ii._itemRemoving(ni,!0)).on(ti,"dropout",(ei,ni)=>ii._itemRemoving(ni,!1)),this):this}_prepareDragDropByNode(ti){let ei=ti.el,ni=ti.noMove||this.opts.disableDrag,ri=ti.noResize||this.opts.disableResize;if(this.opts.staticGrid||ni&&ri)return ti._initDD&&(this._removeDD(ei),delete ti._initDD),ei.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!ti._initDD){let si,ai,li=(hi,_i)=>{this._gsEventHandler[hi.type]&&this._gsEventHandler[hi.type](hi,hi.target),si=this.cellWidth(),ai=this.getCellHeight(!0),this._onStartMoving(ei,hi,_i,ti,si,ai)},di=(hi,_i)=>{this._dragOrResize(ei,hi,_i,ti,si,ai)},mi=hi=>{this.placeholder.remove(),delete ti._moving,delete ti._event,delete ti._lastTried;let _i=ti.w!==ti._orig.w,Ei=hi.target;if(!(!Ei.gridstackNode||Ei.gridstackNode.grid!==this)){if(ti.el=Ei,ti._isAboutToRemove){let Ai=ei.gridstackNode.grid;Ai._gsEventHandler[hi.type]&&Ai._gsEventHandler[hi.type](hi,Ei),Ai.engine.nodes.push(ti),Ai.removeWidget(ei,!0,!0)}else xi.removePositioningStyles(Ei),ti._temporaryRemoved?(xi.copyPos(ti,ti._orig),this._writePosAttr(Ei,ti),this.engine.addNode(ti)):this._writePosAttr(Ei,ti),this._gsEventHandler[hi.type]&&this._gsEventHandler[hi.type](hi,Ei);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),hi.type==="resizestop"&&(Number.isInteger(ti.sizeToContent)&&(ti.sizeToContent=ti.h),this.resizeToContentCheck(_i,ti))}};os.draggable(ei,{start:li,stop:mi,drag:di}).resizable(ei,{start:li,stop:mi,resize:di}),ti._initDD=!0}return os.draggable(ei,ni?"disable":"enable").resizable(ei,ri?"disable":"enable"),this}_onStartMoving(ti,ei,ni,ri,si,ai){var li;if(this.engine.cleanNodes().beginUpdate(ri),this._writePosAttr(this.placeholder,ri),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=ri,(li=ri.grid)!=null&&li.el)this.dragTransform=xi.getValuesFromTransformedElement(ti);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let di=this.placeholder.closest(".grid-stack");this.dragTransform=xi.getValuesFromTransformedElement(di)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(ri.el=this.placeholder,ri._lastUiPosition=ni.position,ri._prevYPix=ni.position.top,ri._moving=ei.type==="dragstart",delete ri._lastTried,ei.type==="dropover"&&ri._temporaryRemoved&&(this.engine.addNode(ri),ri._moving=!0),this.engine.cacheRects(si,ai,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),ei.type==="resizestart"){let di=this.getColumn()-ri.x,mi=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-ri.y;os.resizable(ti,"option","minWidth",si*Math.min(ri.minW||1,di)).resizable(ti,"option","minHeight",ai*Math.min(ri.minH||1,mi)).resizable(ti,"option","maxWidth",si*Math.min(ri.maxW||Number.MAX_SAFE_INTEGER,di)).resizable(ti,"option","maxWidthMoveLeft",si*Math.min(ri.maxW||Number.MAX_SAFE_INTEGER,ri.x+ri.w)).resizable(ti,"option","maxHeight",ai*Math.min(ri.maxH||Number.MAX_SAFE_INTEGER,mi)).resizable(ti,"option","maxHeightMoveUp",ai*Math.min(ri.maxH||Number.MAX_SAFE_INTEGER,ri.y+ri.h))}}_dragOrResize(ti,ei,ni,ri,si,ai){let li=Ui({},ri._orig),di,mi=this.opts.marginLeft,hi=this.opts.marginRight,_i=this.opts.marginTop,Ei=this.opts.marginBottom,Ai=Math.round(ai*.1),ki=Math.round(si*.1);if(mi=Math.min(mi,ki),hi=Math.min(hi,ki),_i=Math.min(_i,Ai),Ei=Math.min(Ei,Ai),ei.type==="drag"){if(ri._temporaryRemoved)return;let Fi=ni.position.top-ri._prevYPix;ri._prevYPix=ni.position.top,this.opts.draggable.scroll!==!1&&xi.updateScrollPosition(ti,ni.position,Fi);let en=ni.position.left+(ni.position.left>ri._lastUiPosition.left?-hi:mi),rn=ni.position.top+(ni.position.top>ri._lastUiPosition.top?-Ei:_i);li.x=Math.round(en/si),li.y=Math.round(rn/ai);let ln=this._extraDragRow;if(this.engine.collide(ri,li)){let Yi=this.getRow(),on=Math.max(0,li.y+ri.h-Yi);this.opts.maxRow&&Yi+on>this.opts.maxRow&&(on=Math.max(0,this.opts.maxRow-Yi)),this._extraDragRow=on}else this._extraDragRow=0;if(this._extraDragRow!==ln&&this._updateContainerHeight(),ri.x===li.x&&ri.y===li.y)return}else if(ei.type==="resize"){if(li.x<0||(xi.updateScrollResize(ei,ti,ai),li.w=Math.round((ni.size.width-mi)/si),li.h=Math.round((ni.size.height-_i)/ai),ri.w===li.w&&ri.h===li.h)||ri._lastTried&&ri._lastTried.w===li.w&&ri._lastTried.h===li.h)return;let Fi=ni.position.left+mi,en=ni.position.top+_i;li.x=Math.round(Fi/si),li.y=Math.round(en/ai),di=!0}ri._event=ei,ri._lastTried=li;let Ti={x:ni.position.left+mi,y:ni.position.top+_i,w:(ni.size?ni.size.width:ri.w*si)-mi-hi,h:(ni.size?ni.size.height:ri.h*ai)-_i-Ei};if(this.engine.moveNodeCheck(ri,Hn(Ui({},li),{cellWidth:si,cellHeight:ai,rect:Ti,resizing:di}))){ri._lastUiPosition=ni.position,this.engine.cacheRects(si,ai,_i,hi,Ei,mi),delete ri._skipDown,di&&ri.subGrid&&ri.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let Fi=ei.target;this._writePosAttr(Fi,ri),this._gsEventHandler[ei.type]&&this._gsEventHandler[ei.type](ei,Fi)}}_leave(ti,ei){let ni=ti.gridstackNode;ni&&(ei=ei||ti,ei.style.transform="scale(1)",os.off(ti,"drag"),!ni._temporaryRemoved&&(ni._temporaryRemoved=!0,this.engine.removeNode(ni),ni.el=ni._isExternal&&ei?ei:ti,this.opts.removable===!0&&ii._itemRemoving(ti,!0),ti._gridstackNodeOrig?(ti.gridstackNode=ti._gridstackNodeOrig,delete ti._gridstackNodeOrig):ni._isExternal&&(delete ni.el,delete ti.gridstackNode,this.engine.restoreInitial())))}commit(){return Wf(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}};ho.resizeToContentParent=".grid-stack-item-content";ho.Utils=xi;ho.Engine=Io;ho.GDRev="10.3.1";function jy(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.disable()}function Vy(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.enable()}function qy(ii,ti){return ks(this,null,function*(){return yield ra(ii,{layout:ti})})}function Gf(){if(document.getElementById("dashboard")==null)return;let ti=ho.init({cellHeight:100,disableDrag:!0,disableResize:!0,draggable:{handle:".grid-stack-item-content .card-header",appendTo:"body",scroll:!0}}),ei=document.getElementById("lock_dashboard");ei&&ei.addEventListener("click",()=>{jy()});let ni=document.getElementById("unlock_dashboard");ni&&ni.addEventListener("click",()=>{Vy()});let ri=document.getElementById("save_dashboard");ri!==null&&ri.addEventListener("click",()=>{let si=ri.getAttribute("data-url");if(si==null)return;let ai=ti.save(!1);qy(si,ai).then(li=>{Mo(li)?ao("danger","Error Saving Dashboard Config",li.error).show():location.reload()})})}function Kf(ii,ti){switch(ii){case"images-and-labels":{cu("image.device-image",ti),cu("text.device-image-label",ti);break}case"images-only":{cu("image.device-image",ti),uu("text.device-image-label",ti);break}case"labels-only":{uu("image.device-image",ti),uu("text.device-image-label",ti);break}}}function cu(ii,ti){var ni,ri;let ei=(ri=(ni=ti.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let si of ei)si.classList.remove("hidden")}function uu(ii,ti){var ni,ri;let ei=(ri=(ni=ti.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let si of ei)si.classList.add("hidden")}function Wy(ii,ti){ti.set("view",ii);for(let ei of Xi(".rack_elevation"))Kf(ii,ei)}function Qf(){let ii=Jc.get("view");for(let ti of Xi("select.rack-view"))ti.selectedIndex=[...ti.options].findIndex(ei=>ei.value==ii),ti.addEventListener("change",ei=>{Wy(ei.currentTarget.value,Jc)},!1);for(let ti of Xi(".rack_elevation"))ti.addEventListener("load",()=>{Kf(ii,ti)})}function Uy(ii){let ti=document.getElementById("selector_results");if(ti==null)return;let ei=ti.getAttribute("data-selector-target");if(ei==null)return;let ni=document.getElementById(ei);if(ni==null)return;let ri=ii.getAttribute("data-label"),si=ii.getAttribute("data-value");ni.tomselect.addOption({id:si,display:ri}),ni.tomselect.addItem(si)}function Xf(){for(let ii of Xi("#selector_results a"))ii.addEventListener("click",()=>Uy(ii))}function Yy(){for(let ii of[Ll,kl,Ol,Xf,xl,Ml])ii()}function Jf(){document.addEventListener("htmx:afterSettle",Yy)}function Gy(ii){let ti=ii.currentTarget,ei=ti.baseURI.split("?")[0],ni="?",ri=Array.from(ti.options).filter(si=>si.selected).map(si=>`filter_id=${si.value}`).join("&");ei+=`${ni}${ri}`,document.location.href=ei}function Zf(){let ii=document.getElementById("results");if(Un(ii)){let ti=document.getElementById("id_filter_id");Un(ti)&&ti.addEventListener("change",Gy)}}function eh(){for(let ii of[xl,Mf,Ml,$d,jd,Ol,$f,Ll,kl,zf,Vf,qf,Gf,Qf,Jf,Zf])ii()}function Ky(){let ii=document.forms;for(let ei of ii)ei.method.toUpperCase()=="GET"&&ei.addEventListener("formdata",function(ni){let ri=ni.formData;for(let[si,ai]of Array.from(ri.entries()))ai===""&&ri.delete(si)});let ti=document.querySelector(".content-container");ti!==null&&ti.focus()}window.addEventListener("load",Ky);document.readyState!=="loading"?eh():document.addEventListener("DOMContentLoaded",eh);})();
/*! Bundled license information:
tom-select/dist/js/tom-select.complete.js:
(*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) *)
(*! sifter.js | https://github.com/orchidjs/sifter.js | Apache License (v2) *)
@orchidjs/unicode-variants/dist/umd/index.js:
(*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) *)
clipboard/dist/clipboard.js:
(*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*)
bootstrap/dist/js/bootstrap.esm.js:
(*!
* Bootstrap v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*)
gridstack/dist/gridstack.js:
(*!
* GridStack 10.3.1
* https://gridstackjs.com/
*
* Copyright (c) 2021-2022 Alain Dumesny
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
*)
*/