netbox/netbox/project-static/dist/netbox.js
2025-05-13 15:44:10 -04:00

36 lines
373 KiB
JavaScript

"use strict";(()=>{var eu=Object.create;var Mi=Object.defineProperty,tu=Object.defineProperties,nu=Object.getOwnPropertyDescriptor,iu=Object.getOwnPropertyDescriptors,ru=Object.getOwnPropertyNames,hs=Object.getOwnPropertySymbols,ou=Object.getPrototypeOf,ps=Object.prototype.hasOwnProperty,su=Object.prototype.propertyIsEnumerable;var qr=(n,e,t)=>e in n?Mi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,O=(n,e)=>{for(var t in e||(e={}))ps.call(e,t)&&qr(n,t,e[t]);if(hs)for(var t of hs(e))su.call(e,t)&&qr(n,t,e[t]);return n},ae=(n,e)=>tu(n,iu(e));var au=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ms=(n,e)=>{for(var t in e)Mi(n,t,{get:e[t],enumerable:!0})},lu=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ru(e))!ps.call(n,r)&&r!==t&&Mi(n,r,{get:()=>e[r],enumerable:!(i=nu(e,r))||i.enumerable});return n};var cu=(n,e,t)=>(t=n!=null?eu(ou(n)):{},lu(e||!n||!n.__esModule?Mi(t,"default",{value:n,enumerable:!0}):t,n));var ee=(n,e,t)=>qr(n,typeof e!="symbol"?e+"":e,t);var at=(n,e,t)=>new Promise((i,r)=>{var o=l=>{try{a(t.next(l))}catch(c){r(c)}},s=l=>{try{a(t.throw(l))}catch(c){r(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(n,e)).next())});var mc=au((vi,es)=>{(function(e,t){typeof vi=="object"&&typeof es=="object"?es.exports=t():typeof define=="function"&&define.amd?define([],t):typeof vi=="object"?vi.ClipboardJS=t():e.ClipboardJS=t()})(vi,function(){return function(){var n={686:function(i,r,o){"use strict";o.d(r,{default:function(){return He}});var s=o(279),a=o.n(s),l=o(370),c=o.n(l),u=o(817),d=o.n(u);function p(W){try{return document.execCommand(W)}catch(k){return!1}}var v=function(k){var S=d()(k);return p("cut"),S},g=v;function y(W){var k=document.documentElement.getAttribute("dir")==="rtl",S=document.createElement("textarea");S.style.fontSize="12pt",S.style.border="0",S.style.padding="0",S.style.margin="0",S.style.position="absolute",S.style[k?"right":"left"]="-9999px";var V=window.pageYOffset||document.documentElement.scrollTop;return S.style.top="".concat(V,"px"),S.setAttribute("readonly",""),S.value=W,S}var x=function(k,S){var V=y(k);S.container.appendChild(V);var z=d()(V);return p("copy"),V.remove(),z},T=function(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},V="";return typeof k=="string"?V=x(k,S):k instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(k==null?void 0:k.type)?V=x(k.value,S):(V=d()(k),p("copy")),V},_=T;function A(W){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(S){return typeof S}:A=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},A(W)}var M=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=k.action,V=S===void 0?"copy":S,z=k.container,q=k.target,U=k.text;if(V!=="copy"&&V!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(q!==void 0)if(q&&A(q)==="object"&&q.nodeType===1){if(V==="copy"&&q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(V==="cut"&&(q.hasAttribute("readonly")||q.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(U)return _(U,{container:z});if(q)return V==="cut"?g(q):_(q,{container:z})},G=M;function F(W){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F=function(S){return typeof S}:F=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},F(W)}function D(W,k){if(!(W instanceof k))throw new TypeError("Cannot call a class as a function")}function L(W,k){for(var S=0;S<k.length;S++){var V=k[S];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(W,V.key,V)}}function N(W,k,S){return k&&L(W.prototype,k),S&&L(W,S),W}function Y(W,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");W.prototype=Object.create(k&&k.prototype,{constructor:{value:W,writable:!0,configurable:!0}}),k&&B(W,k)}function B(W,k){return B=Object.setPrototypeOf||function(V,z){return V.__proto__=z,V},B(W,k)}function ie(W){var k=Ce();return function(){var V=se(W),z;if(k){var q=se(this).constructor;z=Reflect.construct(V,arguments,q)}else z=V.apply(this,arguments);return J(this,z)}}function J(W,k){return k&&(F(k)==="object"||typeof k=="function")?k:Te(W)}function Te(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W}function Ce(){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(W){return!1}}function se(W){return se=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},se(W)}function ne(W,k){var S="data-clipboard-".concat(W);if(k.hasAttribute(S))return k.getAttribute(S)}var qe=function(W){Y(S,W);var k=ie(S);function S(V,z){var q;return D(this,S),q=k.call(this),q.resolveOptions(z),q.listenClick(V),q}return N(S,[{key:"resolveOptions",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof z.action=="function"?z.action:this.defaultAction,this.target=typeof z.target=="function"?z.target:this.defaultTarget,this.text=typeof z.text=="function"?z.text:this.defaultText,this.container=F(z.container)==="object"?z.container:document.body}},{key:"listenClick",value:function(z){var q=this;this.listener=c()(z,"click",function(U){return q.onClick(U)})}},{key:"onClick",value:function(z){var q=z.delegateTarget||z.currentTarget,U=this.action(q)||"copy",Z=G({action:U,container:this.container,target:this.target(q),text:this.text(q)});this.emit(Z?"success":"error",{action:U,text:Z,trigger:q,clearSelection:function(){q&&q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(z){return ne("action",z)}},{key:"defaultTarget",value:function(z){var q=ne("target",z);if(q)return document.querySelector(q)}},{key:"defaultText",value:function(z){return ne("text",z)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(z){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return _(z,q)}},{key:"cut",value:function(z){return g(z)}},{key:"isSupported",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],q=typeof z=="string"?[z]:z,U=!!document.queryCommandSupported;return q.forEach(function(Z){U=U&&!!document.queryCommandSupported(Z)}),U}}]),S}(a()),He=qe},828:function(i){var r=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}function s(a,l){for(;a&&a.nodeType!==r;){if(typeof a.matches=="function"&&a.matches(l))return a;a=a.parentNode}}i.exports=s},438:function(i,r,o){var s=o(828);function a(u,d,p,v,g){var y=c.apply(this,arguments);return u.addEventListener(p,y,g),{destroy:function(){u.removeEventListener(p,y,g)}}}function l(u,d,p,v,g){return typeof u.addEventListener=="function"?a.apply(null,arguments):typeof p=="function"?a.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(y){return a(y,d,p,v,g)}))}function c(u,d,p,v){return function(g){g.delegateTarget=s(g.target,d),g.delegateTarget&&v.call(u,g)}}i.exports=l},879:function(i,r){r.node=function(o){return o!==void 0&&o instanceof HTMLElement&&o.nodeType===1},r.nodeList=function(o){var s=Object.prototype.toString.call(o);return o!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in o&&(o.length===0||r.node(o[0]))},r.string=function(o){return typeof o=="string"||o instanceof String},r.fn=function(o){var s=Object.prototype.toString.call(o);return s==="[object Function]"}},370:function(i,r,o){var s=o(879),a=o(438);function l(p,v,g){if(!p&&!v&&!g)throw new Error("Missing required arguments");if(!s.string(v))throw new TypeError("Second argument must be a String");if(!s.fn(g))throw new TypeError("Third argument must be a Function");if(s.node(p))return c(p,v,g);if(s.nodeList(p))return u(p,v,g);if(s.string(p))return d(p,v,g);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(p,v,g){return p.addEventListener(v,g),{destroy:function(){p.removeEventListener(v,g)}}}function u(p,v,g){return Array.prototype.forEach.call(p,function(y){y.addEventListener(v,g)}),{destroy:function(){Array.prototype.forEach.call(p,function(y){y.removeEventListener(v,g)})}}}function d(p,v,g){return a(document.body,p,v,g)}i.exports=l},817:function(i){function r(o){var s;if(o.nodeName==="SELECT")o.focus(),s=o.value;else if(o.nodeName==="INPUT"||o.nodeName==="TEXTAREA"){var a=o.hasAttribute("readonly");a||o.setAttribute("readonly",""),o.select(),o.setSelectionRange(0,o.value.length),a||o.removeAttribute("readonly"),s=o.value}else{o.hasAttribute("contenteditable")&&o.focus();var l=window.getSelection(),c=document.createRange();c.selectNodeContents(o),l.removeAllRanges(),l.addRange(c),s=l.toString()}return s}i.exports=r},279:function(i){function r(){}r.prototype={on:function(o,s,a){var l=this.e||(this.e={});return(l[o]||(l[o]=[])).push({fn:s,ctx:a}),this},once:function(o,s,a){var l=this;function c(){l.off(o,c),s.apply(a,arguments)}return c._=s,this.on(o,c,a)},emit:function(o){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[o]||[]).slice(),l=0,c=a.length;for(l;l<c;l++)a[l].fn.apply(a[l].ctx,s);return this},off:function(o,s){var a=this.e||(this.e={}),l=a[o],c=[];if(l&&s)for(var u=0,d=l.length;u<d;u++)l[u].fn!==s&&l[u].fn._!==s&&c.push(l[u]);return c.length?a[o]=c:delete a[o],this}},i.exports=r,i.exports.TinyEmitter=r}},e={};function t(i){if(e[i])return e[i].exports;var r=e[i]={exports:{}};return n[i](r,r.exports,t),r.exports}return function(){t.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return t.d(r,{a:r}),r}}(),function(){t.d=function(i,r){for(var o in r)t.o(r,o)&&!t.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:r[o]})}}(),function(){t.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)}}(),t(686)}().default})});var Vi={};ms(Vi,{afterMain:()=>_s,afterRead:()=>ys,afterWrite:()=>Ts,applyStyles:()=>hn,arrow:()=>Ni,auto:()=>jn,basePlacements:()=>lt,beforeMain:()=>Es,beforeRead:()=>gs,beforeWrite:()=>ws,bottom:()=>ge,clippingParents:()=>Ur,computeStyles:()=>mn,createPopper:()=>Jn,createPopperBase:()=>Ns,createPopperLite:()=>Rs,detectOverflow:()=>ke,end:()=>_t,eventListeners:()=>gn,flip:()=>Pi,hide:()=>Fi,left:()=>he,main:()=>bs,modifierPhases:()=>Gr,offset:()=>$i,placements:()=>qn,popper:()=>Bt,popperGenerator:()=>Gt,popperOffsets:()=>En,preventOverflow:()=>Bi,read:()=>vs,reference:()=>Yr,right:()=>me,start:()=>rt,top:()=>de,variationPlacements:()=>ki,viewport:()=>Wn,write:()=>xs});var de="top",ge="bottom",me="right",he="left",jn="auto",lt=[de,ge,me,he],rt="start",_t="end",Ur="clippingParents",Wn="viewport",Bt="popper",Yr="reference",ki=lt.reduce(function(n,e){return n.concat([e+"-"+rt,e+"-"+_t])},[]),qn=[].concat(lt,[jn]).reduce(function(n,e){return n.concat([e,e+"-"+rt,e+"-"+_t])},[]),gs="beforeRead",vs="read",ys="afterRead",Es="beforeMain",bs="main",_s="afterMain",ws="beforeWrite",xs="write",Ts="afterWrite",Gr=[gs,vs,ys,Es,bs,_s,ws,xs,Ts];function we(n){return n?(n.nodeName||"").toLowerCase():null}function ce(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Ue(n){var e=ce(n).Element;return n instanceof e||n instanceof Element}function be(n){var e=ce(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function fn(n){if(typeof ShadowRoot=="undefined")return!1;var e=ce(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function uu(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];!be(o)||!we(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function du(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=s.reduce(function(l,c){return l[c]="",l},{});!be(r)||!we(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}var hn={name:"applyStyles",enabled:!0,phase:"write",fn:uu,effect:du,requires:["computeStyles"]};function xe(n){return n.split("-")[0]}var Ze=Math.max,Vt=Math.min,ct=Math.round;function pn(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Un(){return!/^((?!chrome|android).)*safari/i.test(pn())}function Ye(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),r=1,o=1;e&&be(n)&&(r=n.offsetWidth>0&&ct(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&ct(i.height)/n.offsetHeight||1);var s=Ue(n)?ce(n):window,a=s.visualViewport,l=!Un()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/r,u=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,p=i.height/o;return{width:d,height:p,top:u,right:c+d,bottom:u+p,left:c,x:c,y:u}}function zt(n){var e=Ye(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function Yn(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&fn(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Me(n){return ce(n).getComputedStyle(n)}function Kr(n){return["table","td","th"].indexOf(we(n))>=0}function Ae(n){return((Ue(n)?n.ownerDocument:n.document)||window.document).documentElement}function ut(n){return we(n)==="html"?n:n.assignedSlot||n.parentNode||(fn(n)?n.host:null)||Ae(n)}function Cs(n){return!be(n)||Me(n).position==="fixed"?null:n.offsetParent}function fu(n){var e=/firefox/i.test(pn()),t=/Trident/i.test(pn());if(t&&be(n)){var i=Me(n);if(i.position==="fixed")return null}var r=ut(n);for(fn(r)&&(r=r.host);be(r)&&["html","body"].indexOf(we(r))<0;){var o=Me(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function et(n){for(var e=ce(n),t=Cs(n);t&&Kr(t)&&Me(t).position==="static";)t=Cs(t);return t&&(we(t)==="html"||we(t)==="body"&&Me(t).position==="static")?e:t||fu(n)||e}function jt(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Wt(n,e,t){return Ze(n,Vt(e,t))}function As(n,e,t){var i=Wt(n,e,t);return i>t?t:i}function Gn(){return{top:0,right:0,bottom:0,left:0}}function Kn(n){return Object.assign({},Gn(),n)}function Xn(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var hu=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Kn(typeof e!="number"?e:Xn(e,lt))};function pu(n){var e,t=n.state,i=n.name,r=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=xe(t.placement),l=jt(a),c=[he,me].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=hu(r.padding,t),p=zt(o),v=l==="y"?de:he,g=l==="y"?ge:me,y=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],x=s[l]-t.rects.reference[l],T=et(o),_=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,A=y/2-x/2,M=d[v],G=_-p[u]-d[g],F=_/2-p[u]/2+A,D=Wt(M,F,G),L=l;t.modifiersData[i]=(e={},e[L]=D,e.centerOffset=D-F,e)}}function mu(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Yn(e.elements.popper,r)&&(e.elements.arrow=r))}var Ni={name:"arrow",enabled:!0,phase:"main",fn:pu,effect:mu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ge(n){return n.split("-")[1]}var gu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vu(n,e){var t=n.x,i=n.y,r=e.devicePixelRatio||1;return{x:ct(t*r)/r||0,y:ct(i*r)/r||0}}function Ss(n){var e,t=n.popper,i=n.popperRect,r=n.placement,o=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,p=s.x,v=p===void 0?0:p,g=s.y,y=g===void 0?0:g,x=typeof u=="function"?u({x:v,y}):{x:v,y};v=x.x,y=x.y;var T=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),A=he,M=de,G=window;if(c){var F=et(t),D="clientHeight",L="clientWidth";if(F===ce(t)&&(F=Ae(t),Me(F).position!=="static"&&a==="absolute"&&(D="scrollHeight",L="scrollWidth")),F=F,r===de||(r===he||r===me)&&o===_t){M=ge;var N=d&&F===G&&G.visualViewport?G.visualViewport.height:F[D];y-=N-i.height,y*=l?1:-1}if(r===he||(r===de||r===ge)&&o===_t){A=me;var Y=d&&F===G&&G.visualViewport?G.visualViewport.width:F[L];v-=Y-i.width,v*=l?1:-1}}var B=Object.assign({position:a},c&&gu),ie=u===!0?vu({x:v,y},ce(t)):{x:v,y};if(v=ie.x,y=ie.y,l){var J;return Object.assign({},B,(J={},J[M]=_?"0":"",J[A]=T?"0":"",J.transform=(G.devicePixelRatio||1)<=1?"translate("+v+"px, "+y+"px)":"translate3d("+v+"px, "+y+"px, 0)",J))}return Object.assign({},B,(e={},e[M]=_?y+"px":"",e[A]=T?v+"px":"",e.transform="",e))}function yu(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,o=t.adaptive,s=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:xe(e.placement),variation:Ge(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ss(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ss(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var mn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:yu,data:{}};var Ri={passive:!0};function Eu(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=ce(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,Ri)}),a&&l.addEventListener("resize",t.update,Ri),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,Ri)}),a&&l.removeEventListener("resize",t.update,Ri)}}var gn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Eu,data:{}};var bu={left:"right",right:"left",bottom:"top",top:"bottom"};function vn(n){return n.replace(/left|right|bottom|top/g,function(e){return bu[e]})}var _u={start:"end",end:"start"};function Hi(n){return n.replace(/start|end/g,function(e){return _u[e]})}function qt(n){var e=ce(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Ut(n){return Ye(Ae(n)).left+qt(n).scrollLeft}function Xr(n,e){var t=ce(n),i=Ae(n),r=t.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=Un();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Ut(n),y:l}}function Qr(n){var e,t=Ae(n),i=qt(n),r=(e=n.ownerDocument)==null?void 0:e.body,o=Ze(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=Ze(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Ut(n),l=-i.scrollTop;return Me(r||t).direction==="rtl"&&(a+=Ze(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Yt(n){var e=Me(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Ii(n){return["html","body","#document"].indexOf(we(n))>=0?n.ownerDocument.body:be(n)&&Yt(n)?n:Ii(ut(n))}function wt(n,e){var t;e===void 0&&(e=[]);var i=Ii(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),o=ce(i),s=r?[o].concat(o.visualViewport||[],Yt(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(wt(ut(s)))}function yn(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function wu(n,e){var t=Ye(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Ds(n,e,t){return e===Wn?yn(Xr(n,t)):Ue(e)?wu(e,t):yn(Qr(Ae(n)))}function xu(n){var e=wt(ut(n)),t=["absolute","fixed"].indexOf(Me(n).position)>=0,i=t&&be(n)?et(n):n;return Ue(i)?e.filter(function(r){return Ue(r)&&Yn(r,i)&&we(r)!=="body"}):[]}function Jr(n,e,t,i){var r=e==="clippingParents"?xu(n):[].concat(e),o=[].concat(r,[t]),s=o[0],a=o.reduce(function(l,c){var u=Ds(n,c,i);return l.top=Ze(u.top,l.top),l.right=Vt(u.right,l.right),l.bottom=Vt(u.bottom,l.bottom),l.left=Ze(u.left,l.left),l},Ds(n,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Qn(n){var e=n.reference,t=n.element,i=n.placement,r=i?xe(i):null,o=i?Ge(i):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(r){case de:l={x:s,y:e.y-t.height};break;case ge:l={x:s,y:e.y+e.height};break;case me:l={x:e.x+e.width,y:a};break;case he:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=r?jt(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case rt:l[c]=l[c]-(e[u]/2-t[u]/2);break;case _t:l[c]=l[c]+(e[u]/2-t[u]/2);break;default:}}return l}function ke(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,o=t.strategy,s=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?Ur:a,c=t.rootBoundary,u=c===void 0?Wn:c,d=t.elementContext,p=d===void 0?Bt:d,v=t.altBoundary,g=v===void 0?!1:v,y=t.padding,x=y===void 0?0:y,T=Kn(typeof x!="number"?x:Xn(x,lt)),_=p===Bt?Yr:Bt,A=n.rects.popper,M=n.elements[g?_:p],G=Jr(Ue(M)?M:M.contextElement||Ae(n.elements.popper),l,u,s),F=Ye(n.elements.reference),D=Qn({reference:F,element:A,strategy:"absolute",placement:r}),L=yn(Object.assign({},A,D)),N=p===Bt?L:F,Y={top:G.top-N.top+T.top,bottom:N.bottom-G.bottom+T.bottom,left:G.left-N.left+T.left,right:N.right-G.right+T.right},B=n.modifiersData.offset;if(p===Bt&&B){var ie=B[r];Object.keys(Y).forEach(function(J){var Te=[me,ge].indexOf(J)>=0?1:-1,Ce=[de,ge].indexOf(J)>=0?"y":"x";Y[J]+=ie[Ce]*Te})}return Y}function Zr(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,o=t.rootBoundary,s=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?qn:l,u=Ge(i),d=u?a?ki:ki.filter(function(g){return Ge(g)===u}):lt,p=d.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=d);var v=p.reduce(function(g,y){return g[y]=ke(n,{placement:y,boundary:r,rootBoundary:o,padding:s})[xe(y)],g},{});return Object.keys(v).sort(function(g,y){return v[g]-v[y]})}function Tu(n){if(xe(n)===jn)return[];var e=vn(n);return[Hi(n),e,Hi(e)]}function Cu(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!0:s,l=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,p=t.altBoundary,v=t.flipVariations,g=v===void 0?!0:v,y=t.allowedAutoPlacements,x=e.options.placement,T=xe(x),_=T===x,A=l||(_||!g?[vn(x)]:Tu(x)),M=[x].concat(A).reduce(function(z,q){return z.concat(xe(q)===jn?Zr(e,{placement:q,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:y}):q)},[]),G=e.rects.reference,F=e.rects.popper,D=new Map,L=!0,N=M[0],Y=0;Y<M.length;Y++){var B=M[Y],ie=xe(B),J=Ge(B)===rt,Te=[de,ge].indexOf(ie)>=0,Ce=Te?"width":"height",se=ke(e,{placement:B,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),ne=Te?J?me:he:J?ge:de;G[Ce]>F[Ce]&&(ne=vn(ne));var qe=vn(ne),He=[];if(o&&He.push(se[ie]<=0),a&&He.push(se[ne]<=0,se[qe]<=0),He.every(function(z){return z})){N=B,L=!1;break}D.set(B,He)}if(L)for(var W=g?3:1,k=function(q){var U=M.find(function(Z){var oe=D.get(Z);if(oe)return oe.slice(0,q).every(function(bt){return bt})});if(U)return N=U,"break"},S=W;S>0;S--){var V=k(S);if(V==="break")break}e.placement!==N&&(e.modifiersData[i]._skip=!0,e.placement=N,e.reset=!0)}}var Pi={name:"flip",enabled:!0,phase:"main",fn:Cu,requiresIfExists:["offset"],data:{_skip:!1}};function Os(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Ls(n){return[de,me,ge,he].some(function(e){return n[e]>=0})}function Au(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=ke(e,{elementContext:"reference"}),a=ke(e,{altBoundary:!0}),l=Os(s,i),c=Os(a,r,o),u=Ls(l),d=Ls(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var Fi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Au};function Su(n,e,t){var i=xe(n),r=[he,de].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[he,me].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Du(n){var e=n.state,t=n.options,i=n.name,r=t.offset,o=r===void 0?[0,0]:r,s=qn.reduce(function(u,d){return u[d]=Su(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}var $i={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Du};function Ou(n){var e=n.state,t=n.name;e.modifiersData[t]=Qn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var En={name:"popperOffsets",enabled:!0,phase:"read",fn:Ou,data:{}};function eo(n){return n==="x"?"y":"x"}function Lu(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!1:s,l=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,p=t.tether,v=p===void 0?!0:p,g=t.tetherOffset,y=g===void 0?0:g,x=ke(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),T=xe(e.placement),_=Ge(e.placement),A=!_,M=jt(T),G=eo(M),F=e.modifiersData.popperOffsets,D=e.rects.reference,L=e.rects.popper,N=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,Y=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ie={x:0,y:0};if(F){if(o){var J,Te=M==="y"?de:he,Ce=M==="y"?ge:me,se=M==="y"?"height":"width",ne=F[M],qe=ne+x[Te],He=ne-x[Ce],W=v?-L[se]/2:0,k=_===rt?D[se]:L[se],S=_===rt?-L[se]:-D[se],V=e.elements.arrow,z=v&&V?zt(V):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Gn(),U=q[Te],Z=q[Ce],oe=Wt(0,D[se],z[se]),bt=A?D[se]/2-W-oe-U-Y.mainAxis:k-oe-U-Y.mainAxis,$r=A?-D[se]/2+W+oe+Z+Y.mainAxis:S+oe+Z+Y.mainAxis,on=e.elements.arrow&&et(e.elements.arrow),sn=on?M==="y"?on.clientTop||0:on.clientLeft||0:0,Ti=(J=B==null?void 0:B[M])!=null?J:0,Br=ne+bt-Ti-sn,Ci=ne+$r-Ti,Ai=Wt(v?Vt(qe,Br):qe,ne,v?Ze(He,Ci):He);F[M]=Ai,ie[M]=Ai-ne}if(a){var $n,Si=M==="x"?de:he,an=M==="x"?ge:me,ot=F[G],ln=G==="y"?"height":"width",Bn=ot+x[Si],cn=ot-x[an],un=[de,he].indexOf(T)!==-1,$t=($n=B==null?void 0:B[G])!=null?$n:0,Di=un?Bn:ot-D[ln]-L[ln]-$t+Y.altAxis,Vn=un?ot+D[ln]+L[ln]-$t-Y.altAxis:cn,Oi=v&&un?As(Di,ot,Vn):Wt(v?Di:Bn,ot,v?Vn:cn);F[G]=Oi,ie[G]=Oi-ot}e.modifiersData[i]=ie}}var Bi={name:"preventOverflow",enabled:!0,phase:"main",fn:Lu,requiresIfExists:["offset"]};function to(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function no(n){return n===ce(n)||!be(n)?qt(n):to(n)}function Mu(n){var e=n.getBoundingClientRect(),t=ct(e.width)/n.offsetWidth||1,i=ct(e.height)/n.offsetHeight||1;return t!==1||i!==1}function io(n,e,t){t===void 0&&(t=!1);var i=be(e),r=be(e)&&Mu(e),o=Ae(e),s=Ye(n,r,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((we(e)!=="body"||Yt(o))&&(a=no(e)),be(e)?(l=Ye(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Ut(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function ku(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function r(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||r(o)}),i}function ro(n){var e=ku(n);return Gr.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function oo(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function so(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Ms={placement:"bottom",modifiers:[],strategy:"absolute"};function ks(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Gt(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,o=r===void 0?Ms:r;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ms,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],p=!1,v={state:u,setOptions:function(T){var _=typeof T=="function"?T(u.options):T;y(),u.options=Object.assign({},o,u.options,_),u.scrollParents={reference:Ue(a)?wt(a):a.contextElement?wt(a.contextElement):[],popper:wt(l)};var A=ro(so([].concat(i,u.options.modifiers)));return u.orderedModifiers=A.filter(function(M){return M.enabled}),g(),v.update()},forceUpdate:function(){if(!p){var T=u.elements,_=T.reference,A=T.popper;if(ks(_,A)){u.rects={reference:io(_,et(A),u.options.strategy==="fixed"),popper:zt(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(Y){return u.modifiersData[Y.name]=Object.assign({},Y.data)});for(var M=0;M<u.orderedModifiers.length;M++){if(u.reset===!0){u.reset=!1,M=-1;continue}var G=u.orderedModifiers[M],F=G.fn,D=G.options,L=D===void 0?{}:D,N=G.name;typeof F=="function"&&(u=F({state:u,options:L,name:N,instance:v})||u)}}}},update:oo(function(){return new Promise(function(x){v.forceUpdate(),x(u)})}),destroy:function(){y(),p=!0}};if(!ks(a,l))return v;v.setOptions(c).then(function(x){!p&&c.onFirstUpdate&&c.onFirstUpdate(x)});function g(){u.orderedModifiers.forEach(function(x){var T=x.name,_=x.options,A=_===void 0?{}:_,M=x.effect;if(typeof M=="function"){var G=M({state:u,name:T,instance:v,options:A}),F=function(){};d.push(G||F)}})}function y(){d.forEach(function(x){return x()}),d=[]}return v}}var Ns=Gt();var Nu=[gn,En,mn,hn],Rs=Gt({defaultModifiers:Nu});var Ru=[gn,En,mn,hn,$i,Pi,Bi,Ni,Fi],Jn=Gt({defaultModifiers:Ru});var xt=new Map,ao={set(n,e,t){xt.has(n)||xt.set(n,new Map);let i=xt.get(n);if(!i.has(e)&&i.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`);return}i.set(e,t)},get(n,e){return xt.has(n)&&xt.get(n).get(e)||null},remove(n,e){if(!xt.has(n))return;let t=xt.get(n);t.delete(e),t.size===0&&xt.delete(n)}},Hu=1e6,Iu=1e3,xo="transitionend",ca=n=>(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),n),Pu=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),Fu=n=>{do n+=Math.floor(Math.random()*Hu);while(document.getElementById(n));return n},$u=n=>{if(!n)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(n),i=Number.parseFloat(e),r=Number.parseFloat(t);return!i&&!r?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*Iu)},ua=n=>{n.dispatchEvent(new Event(xo))},dt=n=>!n||typeof n!="object"?!1:(typeof n.jquery!="undefined"&&(n=n[0]),typeof n.nodeType!="undefined"),Tt=n=>dt(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(ca(n)):null,An=n=>{if(!dt(n)||n.getClientRects().length===0)return!1;let e=getComputedStyle(n).getPropertyValue("visibility")==="visible",t=n.closest("details:not([open])");if(!t)return e;if(t!==n){let i=n.closest("summary");if(i&&i.parentNode!==t||i===null)return!1}return e},Ct=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled!="undefined"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",da=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){let e=n.getRootNode();return e instanceof ShadowRoot?e:null}return n instanceof ShadowRoot?n:n.parentNode?da(n.parentNode):null},Xi=()=>{},ii=n=>{n.offsetHeight},fa=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,lo=[],Bu=n=>{document.readyState==="loading"?(lo.length||document.addEventListener("DOMContentLoaded",()=>{for(let e of lo)e()}),lo.push(n)):n()},Ke=()=>document.documentElement.dir==="rtl",Qe=n=>{Bu(()=>{let e=fa();if(e){let t=n.NAME,i=e.fn[t];e.fn[t]=n.jQueryInterface,e.fn[t].Constructor=n,e.fn[t].noConflict=()=>(e.fn[t]=i,n.jQueryInterface)}})},Ie=(n,e=[],t=n)=>typeof n=="function"?n.call(...e):t,ha=(n,e,t=!0)=>{if(!t){Ie(n);return}let r=$u(e)+5,o=!1,s=({target:a})=>{a===e&&(o=!0,e.removeEventListener(xo,s),Ie(n))};e.addEventListener(xo,s),setTimeout(()=>{o||ua(e)},r)},So=(n,e,t,i)=>{let r=n.length,o=n.indexOf(e);return o===-1?!t&&i?n[r-1]:n[0]:(o+=t?1:-1,i&&(o=(o+r)%r),n[Math.max(0,Math.min(o,r-1))])},Vu=/[^.]*(?=\..*)\.|.*/,zu=/\..*/,ju=/::\d+$/,co={},Hs=1,pa={mouseenter:"mouseover",mouseleave:"mouseout"},Wu=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 ma(n,e){return e&&`${e}::${Hs++}`||n.uidEvent||Hs++}function ga(n){let e=ma(n);return n.uidEvent=e,co[e]=co[e]||{},co[e]}function qu(n,e){return function t(i){return Do(i,{delegateTarget:n}),t.oneOff&&w.off(n,i.type,e),e.apply(n,[i])}}function Uu(n,e,t){return function i(r){let o=n.querySelectorAll(e);for(let{target:s}=r;s&&s!==this;s=s.parentNode)for(let a of o)if(a===s)return Do(r,{delegateTarget:s}),i.oneOff&&w.off(n,r.type,e,t),t.apply(s,[r])}}function va(n,e,t=null){return Object.values(n).find(i=>i.callable===e&&i.delegationSelector===t)}function ya(n,e,t){let i=typeof e=="string",r=i?t:e||t,o=Ea(n);return Wu.has(o)||(o=n),[i,r,o]}function Is(n,e,t,i,r){if(typeof e!="string"||!n)return;let[o,s,a]=ya(e,t,i);e in pa&&(s=(g=>function(y){if(!y.relatedTarget||y.relatedTarget!==y.delegateTarget&&!y.delegateTarget.contains(y.relatedTarget))return g.call(this,y)})(s));let l=ga(n),c=l[a]||(l[a]={}),u=va(c,s,o?t:null);if(u){u.oneOff=u.oneOff&&r;return}let d=ma(s,e.replace(Vu,"")),p=o?Uu(n,t,s):qu(n,s);p.delegationSelector=o?t:null,p.callable=s,p.oneOff=r,p.uidEvent=d,c[d]=p,n.addEventListener(a,p,o)}function To(n,e,t,i,r){let o=va(e[t],i,r);o&&(n.removeEventListener(t,o,!!r),delete e[t][o.uidEvent])}function Yu(n,e,t,i){let r=e[t]||{};for(let[o,s]of Object.entries(r))o.includes(i)&&To(n,e,t,s.callable,s.delegationSelector)}function Ea(n){return n=n.replace(zu,""),pa[n]||n}var w={on(n,e,t,i){Is(n,e,t,i,!1)},one(n,e,t,i){Is(n,e,t,i,!0)},off(n,e,t,i){if(typeof e!="string"||!n)return;let[r,o,s]=ya(e,t,i),a=s!==e,l=ga(n),c=l[s]||{},u=e.startsWith(".");if(typeof o!="undefined"){if(!Object.keys(c).length)return;To(n,l,s,o,r?t:null);return}if(u)for(let d of Object.keys(l))Yu(n,l,d,e.slice(1));for(let[d,p]of Object.entries(c)){let v=d.replace(ju,"");(!a||e.includes(v))&&To(n,l,s,p.callable,p.delegationSelector)}},trigger(n,e,t){if(typeof e!="string"||!n)return null;let i=fa(),r=Ea(e),o=e!==r,s=null,a=!0,l=!0,c=!1;o&&i&&(s=i.Event(e,t),i(n).trigger(s),a=!s.isPropagationStopped(),l=!s.isImmediatePropagationStopped(),c=s.isDefaultPrevented());let u=Do(new Event(e,{bubbles:a,cancelable:!0}),t);return c&&u.preventDefault(),l&&n.dispatchEvent(u),u.defaultPrevented&&s&&s.preventDefault(),u}};function Do(n,e={}){for(let[t,i]of Object.entries(e))try{n[t]=i}catch(r){Object.defineProperty(n,t,{configurable:!0,get(){return i}})}return n}function Ps(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch(e){return n}}function uo(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var ft={setDataAttribute(n,e,t){n.setAttribute(`data-bs-${uo(e)}`,t)},removeDataAttribute(n,e){n.removeAttribute(`data-bs-${uo(e)}`)},getDataAttributes(n){if(!n)return{};let e={},t=Object.keys(n.dataset).filter(i=>i.startsWith("bs")&&!i.startsWith("bsConfig"));for(let i of t){let r=i.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1),e[r]=Ps(n.dataset[i])}return e},getDataAttribute(n,e){return Ps(n.getAttribute(`data-bs-${uo(e)}`))}},Qt=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(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){let i=dt(t)?ft.getDataAttribute(t,"config"):{};return O(O(O(O({},this.constructor.Default),typeof i=="object"?i:{}),dt(t)?ft.getDataAttributes(t):{}),typeof e=="object"?e:{})}_typeCheckConfig(e,t=this.constructor.DefaultType){for(let[i,r]of Object.entries(t)){let o=e[i],s=dt(o)?"element":Pu(o);if(!new RegExp(r).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${r}".`)}}},Gu="5.3.6",je=class extends Qt{constructor(e,t){super(),e=Tt(e),e&&(this._element=e,this._config=this._getConfig(t),ao.set(this._element,this.constructor.DATA_KEY,this))}dispose(){ao.remove(this._element,this.constructor.DATA_KEY),w.off(this._element,this.constructor.EVENT_KEY);for(let e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){ha(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return ao.get(Tt(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return Gu}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}},fo=n=>{let e=n.getAttribute("data-bs-target");if(!e||e==="#"){let t=n.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return e?e.split(",").map(t=>ca(t)).join(","):null},j={find(n,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,n))},findOne(n,e=document.documentElement){return Element.prototype.querySelector.call(e,n)},children(n,e){return[].concat(...n.children).filter(t=>t.matches(e))},parents(n,e){let t=[],i=n.parentNode.closest(e);for(;i;)t.push(i),i=i.parentNode.closest(e);return t},prev(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(n){let e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,n).filter(t=>!Ct(t)&&An(t))},getSelectorFromElement(n){let e=fo(n);return e&&j.findOne(e)?e:null},getElementFromSelector(n){let e=fo(n);return e?j.findOne(e):null},getMultipleElementsFromSelector(n){let e=fo(n);return e?j.find(e):[]}},rr=(n,e="hide")=>{let t=`click.dismiss${n.EVENT_KEY}`,i=n.NAME;w.on(document,t,`[data-bs-dismiss="${i}"]`,function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),Ct(this))return;let o=j.getElementFromSelector(this)||this.closest(`.${i}`);n.getOrCreateInstance(o)[e]()})},Ku="alert",Xu="bs.alert",ba=`.${Xu}`,Qu=`close${ba}`,Ju=`closed${ba}`,Zu="fade",ed="show",Qi=class n extends je{static get NAME(){return Ku}close(){if(w.trigger(this._element,Qu).defaultPrevented)return;this._element.classList.remove(ed);let t=this._element.classList.contains(Zu);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),w.trigger(this._element,Ju),this.dispose()}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}};rr(Qi,"close");Qe(Qi);var td="button",nd="bs.button",id=`.${nd}`,rd=".data-api",od="active",Fs='[data-bs-toggle="button"]',sd=`click${id}${rd}`,Ji=class n extends je{static get NAME(){return td}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(od))}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this);e==="toggle"&&t[e]()})}};w.on(document,sd,Fs,n=>{n.preventDefault();let e=n.target.closest(Fs);Ji.getOrCreateInstance(e).toggle()});Qe(Ji);var ad="swipe",Sn=".bs.swipe",ld=`touchstart${Sn}`,cd=`touchmove${Sn}`,ud=`touchend${Sn}`,dd=`pointerdown${Sn}`,fd=`pointerup${Sn}`,hd="touch",pd="pen",md="pointer-event",gd=40,vd={endCallback:null,leftCallback:null,rightCallback:null},yd={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},Zi=class n extends Qt{constructor(e,t){super(),this._element=e,!(!e||!n.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return vd}static get DefaultType(){return yd}static get NAME(){return ad}dispose(){w.off(this._element,Sn)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Ie(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){let e=Math.abs(this._deltaX);if(e<=gd)return;let t=e/this._deltaX;this._deltaX=0,t&&Ie(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(w.on(this._element,dd,e=>this._start(e)),w.on(this._element,fd,e=>this._end(e)),this._element.classList.add(md)):(w.on(this._element,ld,e=>this._start(e)),w.on(this._element,cd,e=>this._move(e)),w.on(this._element,ud,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===pd||e.pointerType===hd)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},Ed="carousel",bd="bs.carousel",Ot=`.${bd}`,_a=".data-api",_d="ArrowLeft",wd="ArrowRight",xd=500,Zn="next",bn="prev",wn="left",Gi="right",Td=`slide${Ot}`,ho=`slid${Ot}`,Cd=`keydown${Ot}`,Ad=`mouseenter${Ot}`,Sd=`mouseleave${Ot}`,Dd=`dragstart${Ot}`,Od=`load${Ot}${_a}`,Ld=`click${Ot}${_a}`,wa="carousel",zi="active",Md="slide",kd="carousel-item-end",Nd="carousel-item-start",Rd="carousel-item-next",Hd="carousel-item-prev",xa=".active",Ta=".carousel-item",Id=xa+Ta,Pd=".carousel-item img",Fd=".carousel-indicators",$d="[data-bs-slide], [data-bs-slide-to]",Bd='[data-bs-ride="carousel"]',Vd={[_d]:Gi,[wd]:wn},zd={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},jd={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},ti=class n extends je{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=j.findOne(Fd,this._element),this._addEventListeners(),this._config.ride===wa&&this.cycle()}static get Default(){return zd}static get DefaultType(){return jd}static get NAME(){return Ed}next(){this._slide(Zn)}nextWhenVisible(){!document.hidden&&An(this._element)&&this.next()}prev(){this._slide(bn)}pause(){this._isSliding&&ua(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){w.one(this._element,ho,()=>this.cycle());return}this.cycle()}}to(e){let t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){w.one(this._element,ho,()=>this.to(e));return}let i=this._getItemIndex(this._getActive());if(i===e)return;let r=e>i?Zn:bn;this._slide(r,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&w.on(this._element,Cd,e=>this._keydown(e)),this._config.pause==="hover"&&(w.on(this._element,Ad,()=>this.pause()),w.on(this._element,Sd,()=>this._maybeEnableCycle())),this._config.touch&&Zi.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let i of j.find(Pd,this._element))w.on(i,Dd,r=>r.preventDefault());let t={leftCallback:()=>this._slide(this._directionToOrder(wn)),rightCallback:()=>this._slide(this._directionToOrder(Gi)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),xd+this._config.interval))}};this._swipeHelper=new Zi(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;let t=Vd[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;let t=j.findOne(xa,this._indicatorsElement);t.classList.remove(zi),t.removeAttribute("aria-current");let i=j.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(zi),i.setAttribute("aria-current","true"))}_updateInterval(){let e=this._activeElement||this._getActive();if(!e)return;let t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;let i=this._getActive(),r=e===Zn,o=t||So(this._getItems(),i,r,this._config.wrap);if(o===i)return;let s=this._getItemIndex(o),a=v=>w.trigger(this._element,v,{relatedTarget:o,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:s});if(a(Td).defaultPrevented||!i||!o)return;let c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;let u=r?Nd:kd,d=r?Rd:Hd;o.classList.add(d),ii(o),i.classList.add(u),o.classList.add(u);let p=()=>{o.classList.remove(u,d),o.classList.add(zi),i.classList.remove(zi,d,u),this._isSliding=!1,a(ho)};this._queueCallback(p,i,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(Md)}_getActive(){return j.findOne(Id,this._element)}_getItems(){return j.find(Ta,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Ke()?e===wn?bn:Zn:e===wn?Zn:bn}_orderToDirection(e){return Ke()?e===bn?wn:Gi:e===bn?Gi:wn}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}};w.on(document,Ld,$d,function(n){let e=j.getElementFromSelector(this);if(!e||!e.classList.contains(wa))return;n.preventDefault();let t=ti.getOrCreateInstance(e),i=this.getAttribute("data-bs-slide-to");if(i){t.to(i),t._maybeEnableCycle();return}if(ft.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});w.on(window,Od,()=>{let n=j.find(Bd);for(let e of n)ti.getOrCreateInstance(e)});Qe(ti);var Wd="collapse",qd="bs.collapse",ri=`.${qd}`,Ud=".data-api",Yd=`show${ri}`,Gd=`shown${ri}`,Kd=`hide${ri}`,Xd=`hidden${ri}`,Qd=`click${ri}${Ud}`,po="show",Tn="collapse",ji="collapsing",Jd="collapsed",Zd=`:scope .${Tn} .${Tn}`,ef="collapse-horizontal",tf="width",nf="height",rf=".collapse.show, .collapse.collapsing",Co='[data-bs-toggle="collapse"]',of={parent:null,toggle:!0},sf={parent:"(null|element)",toggle:"boolean"},At=class n extends je{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];let i=j.find(Co);for(let r of i){let o=j.getSelectorFromElement(r),s=j.find(o).filter(a=>a===this._element);o!==null&&s.length&&this._triggerArray.push(r)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return of}static get DefaultType(){return sf}static get NAME(){return Wd}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(rf).filter(a=>a!==this._element).map(a=>n.getOrCreateInstance(a,{toggle:!1}))),e.length&&e[0]._isTransitioning||w.trigger(this._element,Yd).defaultPrevented)return;for(let a of e)a.hide();let i=this._getDimension();this._element.classList.remove(Tn),this._element.classList.add(ji),this._element.style[i]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let r=()=>{this._isTransitioning=!1,this._element.classList.remove(ji),this._element.classList.add(Tn,po),this._element.style[i]="",w.trigger(this._element,Gd)},s=`scroll${i[0].toUpperCase()+i.slice(1)}`;this._queueCallback(r,this._element,!0),this._element.style[i]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||w.trigger(this._element,Kd).defaultPrevented)return;let t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,ii(this._element),this._element.classList.add(ji),this._element.classList.remove(Tn,po);for(let r of this._triggerArray){let o=j.getElementFromSelector(r);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([r],!1)}this._isTransitioning=!0;let i=()=>{this._isTransitioning=!1,this._element.classList.remove(ji),this._element.classList.add(Tn),w.trigger(this._element,Xd)};this._element.style[t]="",this._queueCallback(i,this._element,!0)}_isShown(e=this._element){return e.classList.contains(po)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=Tt(e.parent),e}_getDimension(){return this._element.classList.contains(ef)?tf:nf}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(Co);for(let t of e){let i=j.getElementFromSelector(t);i&&this._addAriaAndCollapsedClass([t],this._isShown(i))}}_getFirstLevelChildren(e){let t=j.find(Zd,this._config.parent);return j.find(e,this._config.parent).filter(i=>!t.includes(i))}_addAriaAndCollapsedClass(e,t){if(e.length)for(let i of e)i.classList.toggle(Jd,!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){let t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){let i=n.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof i[e]=="undefined")throw new TypeError(`No method named "${e}"`);i[e]()}})}};w.on(document,Qd,Co,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(let e of j.getMultipleElementsFromSelector(this))At.getOrCreateInstance(e,{toggle:!1}).toggle()});Qe(At);var $s="dropdown",af="bs.dropdown",Zt=`.${af}`,Oo=".data-api",lf="Escape",Bs="Tab",cf="ArrowUp",Vs="ArrowDown",uf=2,df=`hide${Zt}`,ff=`hidden${Zt}`,hf=`show${Zt}`,pf=`shown${Zt}`,Ca=`click${Zt}${Oo}`,Aa=`keydown${Zt}${Oo}`,mf=`keyup${Zt}${Oo}`,xn="show",gf="dropup",vf="dropend",yf="dropstart",Ef="dropup-center",bf="dropdown-center",Kt='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',_f=`${Kt}.${xn}`,Ki=".dropdown-menu",wf=".navbar",xf=".navbar-nav",Tf=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Cf=Ke()?"top-end":"top-start",Af=Ke()?"top-start":"top-end",Sf=Ke()?"bottom-end":"bottom-start",Df=Ke()?"bottom-start":"bottom-end",Of=Ke()?"left-start":"right-start",Lf=Ke()?"right-start":"left-start",Mf="top",kf="bottom",Nf={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Rf={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},St=class n extends je{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=j.next(this._element,Ki)[0]||j.prev(this._element,Ki)[0]||j.findOne(Ki,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Nf}static get DefaultType(){return Rf}static get NAME(){return $s}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ct(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!w.trigger(this._element,hf,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(xf))for(let i of[].concat(...document.body.children))w.on(i,"mouseover",Xi);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(xn),this._element.classList.add(xn),w.trigger(this._element,pf,e)}}hide(){if(Ct(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!w.trigger(this._element,df,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(let i of[].concat(...document.body.children))w.off(i,"mouseover",Xi);this._popper&&this._popper.destroy(),this._menu.classList.remove(xn),this._element.classList.remove(xn),this._element.setAttribute("aria-expanded","false"),ft.removeDataAttribute(this._menu,"popper"),w.trigger(this._element,ff,e),this._element.focus()}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!dt(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${$s.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Vi=="undefined")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;this._config.reference==="parent"?e=this._parent:dt(this._config.reference)?e=Tt(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);let t=this._getPopperConfig();this._popper=Jn(e,this._menu,t)}_isShown(){return this._menu.classList.contains(xn)}_getPlacement(){let e=this._parent;if(e.classList.contains(vf))return Of;if(e.classList.contains(yf))return Lf;if(e.classList.contains(Ef))return Mf;if(e.classList.contains(bf))return kf;let t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(gf)?t?Af:Cf:t?Df:Sf}_detectNavbar(){return this._element.closest(wf)!==null}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){let e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(ft.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),O(O({},e),Ie(this._config.popperConfig,[void 0,e]))}_selectMenuItem({key:e,target:t}){let i=j.find(Tf,this._menu).filter(r=>An(r));i.length&&So(i,t,e===Vs,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===uf||e.type==="keyup"&&e.key!==Bs)return;let t=j.find(_f);for(let i of t){let r=n.getInstance(i);if(!r||r._config.autoClose===!1)continue;let o=e.composedPath(),s=o.includes(r._menu);if(o.includes(r._element)||r._config.autoClose==="inside"&&!s||r._config.autoClose==="outside"&&s||r._menu.contains(e.target)&&(e.type==="keyup"&&e.key===Bs||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;let a={relatedTarget:r._element};e.type==="click"&&(a.clickEvent=e),r._completeHide(a)}}static dataApiKeydownHandler(e){let t=/input|textarea/i.test(e.target.tagName),i=e.key===lf,r=[cf,Vs].includes(e.key);if(!r&&!i||t&&!i)return;e.preventDefault();let o=this.matches(Kt)?this:j.prev(this,Kt)[0]||j.next(this,Kt)[0]||j.findOne(Kt,e.delegateTarget.parentNode),s=n.getOrCreateInstance(o);if(r){e.stopPropagation(),s.show(),s._selectMenuItem(e);return}s._isShown()&&(e.stopPropagation(),s.hide(),o.focus())}};w.on(document,Aa,Kt,St.dataApiKeydownHandler);w.on(document,Aa,Ki,St.dataApiKeydownHandler);w.on(document,Ca,St.clearMenus);w.on(document,mf,St.clearMenus);w.on(document,Ca,Kt,function(n){n.preventDefault(),St.getOrCreateInstance(this).toggle()});Qe(St);var Sa="backdrop",Hf="fade",zs="show",js=`mousedown.bs.${Sa}`,If={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Pf={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},er=class extends Qt{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return If}static get DefaultType(){return Pf}static get NAME(){return Sa}show(e){if(!this._config.isVisible){Ie(e);return}this._append();let t=this._getElement();this._config.isAnimated&&ii(t),t.classList.add(zs),this._emulateAnimation(()=>{Ie(e)})}hide(e){if(!this._config.isVisible){Ie(e);return}this._getElement().classList.remove(zs),this._emulateAnimation(()=>{this.dispose(),Ie(e)})}dispose(){this._isAppended&&(w.off(this._element,js),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(Hf),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=Tt(e.rootElement),e}_append(){if(this._isAppended)return;let e=this._getElement();this._config.rootElement.append(e),w.on(e,js,()=>{Ie(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){ha(e,this._getElement(),this._config.isAnimated)}},Ff="focustrap",$f="bs.focustrap",tr=`.${$f}`,Bf=`focusin${tr}`,Vf=`keydown.tab${tr}`,zf="Tab",jf="forward",Ws="backward",Wf={autofocus:!0,trapElement:null},qf={autofocus:"boolean",trapElement:"element"},nr=class extends Qt{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Wf}static get DefaultType(){return qf}static get NAME(){return Ff}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),w.off(document,tr),w.on(document,Bf,e=>this._handleFocusin(e)),w.on(document,Vf,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,w.off(document,tr))}_handleFocusin(e){let{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;let i=j.focusableChildren(t);i.length===0?t.focus():this._lastTabNavDirection===Ws?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){e.key===zf&&(this._lastTabNavDirection=e.shiftKey?Ws:jf)}},qs=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Us=".sticky-top",Wi="padding-right",Ys="margin-right",ni=class{constructor(){this._element=document.body}getWidth(){let e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){let e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Wi,t=>t+e),this._setElementAttributes(qs,Wi,t=>t+e),this._setElementAttributes(Us,Ys,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Wi),this._resetElementAttributes(qs,Wi),this._resetElementAttributes(Us,Ys)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){let r=this.getWidth(),o=s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+r)return;this._saveInitialAttribute(s,t);let a=window.getComputedStyle(s).getPropertyValue(t);s.style.setProperty(t,`${i(Number.parseFloat(a))}px`)};this._applyManipulationCallback(e,o)}_saveInitialAttribute(e,t){let i=e.style.getPropertyValue(t);i&&ft.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){let i=r=>{let o=ft.getDataAttribute(r,t);if(o===null){r.style.removeProperty(t);return}ft.removeDataAttribute(r,t),r.style.setProperty(t,o)};this._applyManipulationCallback(e,i)}_applyManipulationCallback(e,t){if(dt(e)){t(e);return}for(let i of j.find(e,this._element))t(i)}},Uf="modal",Yf="bs.modal",Xe=`.${Yf}`,Gf=".data-api",Kf="Escape",Xf=`hide${Xe}`,Qf=`hidePrevented${Xe}`,Da=`hidden${Xe}`,Oa=`show${Xe}`,Jf=`shown${Xe}`,Zf=`resize${Xe}`,eh=`click.dismiss${Xe}`,th=`mousedown.dismiss${Xe}`,nh=`keydown.dismiss${Xe}`,ih=`click${Xe}${Gf}`,Gs="modal-open",rh="fade",Ks="show",mo="modal-static",oh=".modal.show",sh=".modal-dialog",ah=".modal-body",lh='[data-bs-toggle="modal"]',ch={backdrop:!0,focus:!0,keyboard:!0},uh={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},tt=class n extends je{constructor(e,t){super(e,t),this._dialog=j.findOne(sh,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ni,this._addEventListeners()}static get Default(){return ch}static get DefaultType(){return uh}static get NAME(){return Uf}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||w.trigger(this._element,Oa,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Gs),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||w.trigger(this._element,Xf).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ks),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){w.off(window,Xe),w.off(this._dialog,Xe),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new er({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new nr({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;let t=j.findOne(ah,this._dialog);t&&(t.scrollTop=0),ii(this._element),this._element.classList.add(Ks);let i=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,w.trigger(this._element,Jf,{relatedTarget:e})};this._queueCallback(i,this._dialog,this._isAnimated())}_addEventListeners(){w.on(this._element,nh,e=>{if(e.key===Kf){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),w.on(window,Zf,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),w.on(this._element,th,e=>{w.one(this._element,eh,t=>{if(!(this._element!==e.target||this._element!==t.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(Gs),this._resetAdjustments(),this._scrollBar.reset(),w.trigger(this._element,Da)})}_isAnimated(){return this._element.classList.contains(rh)}_triggerBackdropTransition(){if(w.trigger(this._element,Qf).defaultPrevented)return;let t=this._element.scrollHeight>document.documentElement.clientHeight,i=this._element.style.overflowY;i==="hidden"||this._element.classList.contains(mo)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(mo),this._queueCallback(()=>{this._element.classList.remove(mo),this._queueCallback(()=>{this._element.style.overflowY=i},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){let r=Ke()?"paddingLeft":"paddingRight";this._element.style[r]=`${t}px`}if(!i&&e){let r=Ke()?"paddingRight":"paddingLeft";this._element.style[r]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){let i=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof i[e]=="undefined")throw new TypeError(`No method named "${e}"`);i[e](t)}})}};w.on(document,ih,lh,function(n){let e=j.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),w.one(e,Oa,r=>{r.defaultPrevented||w.one(e,Da,()=>{An(this)&&this.focus()})});let t=j.findOne(oh);t&&tt.getInstance(t).hide(),tt.getOrCreateInstance(e).toggle(this)});rr(tt);Qe(tt);var dh="offcanvas",fh="bs.offcanvas",mt=`.${fh}`,La=".data-api",hh=`load${mt}${La}`,ph="Escape",Xs="show",Qs="showing",Js="hiding",mh="offcanvas-backdrop",Ma=".offcanvas.show",gh=`show${mt}`,vh=`shown${mt}`,yh=`hide${mt}`,Zs=`hidePrevented${mt}`,ka=`hidden${mt}`,Eh=`resize${mt}`,bh=`click${mt}${La}`,_h=`keydown.dismiss${mt}`,wh='[data-bs-toggle="offcanvas"]',xh={backdrop:!0,keyboard:!0,scroll:!1},Th={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},Dt=class n extends je{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return xh}static get DefaultType(){return Th}static get NAME(){return dh}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||w.trigger(this._element,gh,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new ni().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Qs);let i=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(Xs),this._element.classList.remove(Qs),w.trigger(this._element,vh,{relatedTarget:e})};this._queueCallback(i,this._element,!0)}hide(){if(!this._isShown||w.trigger(this._element,yh).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Js),this._backdrop.hide();let t=()=>{this._element.classList.remove(Xs,Js),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new ni().reset(),w.trigger(this._element,ka)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let e=()=>{if(this._config.backdrop==="static"){w.trigger(this._element,Zs);return}this.hide()},t=!!this._config.backdrop;return new er({className:mh,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new nr({trapElement:this._element})}_addEventListeners(){w.on(this._element,_h,e=>{if(e.key===ph){if(this._config.keyboard){this.hide();return}w.trigger(this._element,Zs)}})}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}};w.on(document,bh,wh,function(n){let e=j.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Ct(this))return;w.one(e,ka,()=>{An(this)&&this.focus()});let t=j.findOne(Ma);t&&t!==e&&Dt.getInstance(t).hide(),Dt.getOrCreateInstance(e).toggle(this)});w.on(window,hh,()=>{for(let n of j.find(Ma))Dt.getOrCreateInstance(n).show()});w.on(window,Eh,()=>{for(let n of j.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&Dt.getOrCreateInstance(n).hide()});rr(Dt);Qe(Dt);var Ch=/^aria-[\w-]*$/i,Na={"*":["class","dir","id","lang","role",Ch],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:[]},Ah=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Sh=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Dh=(n,e)=>{let t=n.nodeName.toLowerCase();return e.includes(t)?Ah.has(t)?!!Sh.test(n.nodeValue):!0:e.filter(i=>i instanceof RegExp).some(i=>i.test(t))};function Oh(n,e,t){if(!n.length)return n;if(t&&typeof t=="function")return t(n);let r=new window.DOMParser().parseFromString(n,"text/html"),o=[].concat(...r.body.querySelectorAll("*"));for(let s of o){let a=s.nodeName.toLowerCase();if(!Object.keys(e).includes(a)){s.remove();continue}let l=[].concat(...s.attributes),c=[].concat(e["*"]||[],e[a]||[]);for(let u of l)Dh(u,c)||s.removeAttribute(u.nodeName)}return r.body.innerHTML}var Lh="TemplateFactory",Mh={allowList:Na,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},kh={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Nh={entry:"(string|element|function|null)",selector:"(string|element)"},Ao=class extends Qt{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Mh}static get DefaultType(){return kh}static get NAME(){return Lh}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content=O(O({},this._config.content),e),this}toHtml(){let e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(let[r,o]of Object.entries(this._config.content))this._setContent(e,o,r);let t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(let[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},Nh)}_setContent(e,t,i){let r=j.findOne(i,e);if(r){if(t=this._resolvePossibleFunction(t),!t){r.remove();return}if(dt(t)){this._putElementInTemplate(Tt(t),r);return}if(this._config.html){r.innerHTML=this._maybeSanitize(t);return}r.textContent=t}}_maybeSanitize(e){return this._config.sanitize?Oh(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Ie(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}},Rh="tooltip",Hh=new Set(["sanitize","allowList","sanitizeFn"]),go="fade",Ih="modal",qi="show",Ph=".tooltip-inner",ea=`.${Ih}`,ta="hide.bs.modal",ei="hover",vo="focus",Fh="click",$h="manual",Bh="hide",Vh="hidden",zh="show",jh="shown",Wh="inserted",qh="click",Uh="focusin",Yh="focusout",Gh="mouseenter",Kh="mouseleave",Xh={AUTO:"auto",TOP:"top",RIGHT:Ke()?"left":"right",BOTTOM:"bottom",LEFT:Ke()?"right":"left"},Qh={allowList:Na,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"},Jh={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"},ht=class n extends je{constructor(e,t){if(typeof Vi=="undefined")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Qh}static get DefaultType(){return Jh}static get NAME(){return Rh}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),w.off(this._element.closest(ea),ta,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 e=w.trigger(this._element,this.constructor.eventName(zh)),i=(da(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!i)return;this._disposePopper();let r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));let{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(r),w.trigger(this._element,this.constructor.eventName(Wh))),this._popper=this._createPopper(r),r.classList.add(qi),"ontouchstart"in document.documentElement)for(let a of[].concat(...document.body.children))w.on(a,"mouseover",Xi);let s=()=>{w.trigger(this._element,this.constructor.eventName(jh)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(s,this.tip,this._isAnimated())}hide(){if(!this._isShown()||w.trigger(this._element,this.constructor.eventName(Bh)).defaultPrevented)return;if(this._getTipElement().classList.remove(qi),"ontouchstart"in document.documentElement)for(let r of[].concat(...document.body.children))w.off(r,"mouseover",Xi);this._activeTrigger[Fh]=!1,this._activeTrigger[vo]=!1,this._activeTrigger[ei]=!1,this._isHovered=null;let i=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),w.trigger(this._element,this.constructor.eventName(Vh)))};this._queueCallback(i,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(e){let t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(go,qi),t.classList.add(`bs-${this.constructor.NAME}-auto`);let i=Fu(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(go),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Ao(ae(O({},this._config),{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}_getContentForTemplate(){return{[Ph]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(go)}_isShown(){return this.tip&&this.tip.classList.contains(qi)}_createPopper(e){let t=Ie(this._config.placement,[this,e,this._element]),i=Xh[t.toUpperCase()];return Jn(this._element,e,this._getPopperConfig(i))}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Ie(e,[this._element,this._element])}_getPopperConfig(e){let t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:i=>{this._getTipElement().setAttribute("data-popper-placement",i.state.placement)}}]};return O(O({},t),Ie(this._config.popperConfig,[void 0,t]))}_setListeners(){let e=this._config.trigger.split(" ");for(let t of e)if(t==="click")w.on(this._element,this.constructor.eventName(qh),this._config.selector,i=>{this._initializeOnDelegatedTarget(i).toggle()});else if(t!==$h){let i=t===ei?this.constructor.eventName(Gh):this.constructor.eventName(Uh),r=t===ei?this.constructor.eventName(Kh):this.constructor.eventName(Yh);w.on(this._element,i,this._config.selector,o=>{let s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusin"?vo:ei]=!0,s._enter()}),w.on(this._element,r,this._config.selector,o=>{let s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusout"?vo:ei]=s._element.contains(o.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},w.on(this._element.closest(ea),ta,this._hideModalHandler)}_fixTitle(){let e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){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(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){let t=ft.getDataAttributes(this._element);for(let i of Object.keys(t))Hh.has(i)&&delete t[i];return e=O(O({},t),typeof e=="object"&&e?e:{}),e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:Tt(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){let e={};for(let[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}};Qe(ht);var Zh="popover",ep=".popover-header",tp=".popover-body",np=ae(O({},ht.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"}),ip=ae(O({},ht.DefaultType),{content:"(null|string|element|function)"}),Cn=class n extends ht{static get Default(){return np}static get DefaultType(){return ip}static get NAME(){return Zh}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[ep]:this._getTitle(),[tp]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}};Qe(Cn);var rp="scrollspy",op="bs.scrollspy",Lo=`.${op}`,sp=".data-api",ap=`activate${Lo}`,na=`click${Lo}`,lp=`load${Lo}${sp}`,cp="dropdown-item",_n="active",up='[data-bs-spy="scroll"]',yo="[href]",dp=".nav, .list-group",ia=".nav-link",fp=".nav-item",hp=".list-group-item",pp=`${ia}, ${fp} > ${ia}, ${hp}`,mp=".dropdown",gp=".dropdown-toggle",vp={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},yp={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},ir=class n extends je{constructor(e,t){super(e,t),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 vp}static get DefaultType(){return yp}static get NAME(){return rp}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=Tt(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(w.off(this._config.target,na),w.on(this._config.target,na,yo,e=>{let t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();let i=this._rootElement||window,r=t.offsetTop-this._element.offsetTop;if(i.scrollTo){i.scrollTo({top:r,behavior:"smooth"});return}i.scrollTop=r}}))}_getNewObserver(){let e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){let t=s=>this._targetLinks.get(`#${s.target.id}`),i=s=>{this._previousScrollData.visibleEntryTop=s.target.offsetTop,this._process(t(s))},r=(this._rootElement||document.documentElement).scrollTop,o=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;for(let s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}let a=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(i(s),!r)return;continue}!o&&!a&&i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let e=j.find(yo,this._config.target);for(let t of e){if(!t.hash||Ct(t))continue;let i=j.findOne(decodeURI(t.hash),this._element);An(i)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,i))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(_n),this._activateParents(e),w.trigger(this._element,ap,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(cp)){j.findOne(gp,e.closest(mp)).classList.add(_n);return}for(let t of j.parents(e,dp))for(let i of j.prev(t,pp))i.classList.add(_n)}_clearActiveClass(e){e.classList.remove(_n);let t=j.find(`${yo}.${_n}`,e);for(let i of t)i.classList.remove(_n)}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}};w.on(window,lp,()=>{for(let n of j.find(up))ir.getOrCreateInstance(n)});Qe(ir);var Ep="tab",bp="bs.tab",en=`.${bp}`,_p=`hide${en}`,wp=`hidden${en}`,xp=`show${en}`,Tp=`shown${en}`,Cp=`click${en}`,Ap=`keydown${en}`,Sp=`load${en}`,Dp="ArrowLeft",ra="ArrowRight",Op="ArrowUp",oa="ArrowDown",Eo="Home",sa="End",Xt="active",aa="fade",bo="show",Lp="dropdown",Ra=".dropdown-toggle",Mp=".dropdown-menu",_o=`:not(${Ra})`,kp='.list-group, .nav, [role="tablist"]',Np=".nav-item, .list-group-item",Rp=`.nav-link${_o}, .list-group-item${_o}, [role="tab"]${_o}`,Ha='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',wo=`${Rp}, ${Ha}`,Hp=`.${Xt}[data-bs-toggle="tab"], .${Xt}[data-bs-toggle="pill"], .${Xt}[data-bs-toggle="list"]`,Jt=class n extends je{constructor(e){super(e),this._parent=this._element.closest(kp),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),w.on(this._element,Ap,t=>this._keydown(t)))}static get NAME(){return Ep}show(){let e=this._element;if(this._elemIsActive(e))return;let t=this._getActiveElem(),i=t?w.trigger(t,_p,{relatedTarget:e}):null;w.trigger(e,xp,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(Xt),this._activate(j.getElementFromSelector(e));let i=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(bo);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),w.trigger(e,Tp,{relatedTarget:t})};this._queueCallback(i,e,e.classList.contains(aa))}_deactivate(e,t){if(!e)return;e.classList.remove(Xt),e.blur(),this._deactivate(j.getElementFromSelector(e));let i=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(bo);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),w.trigger(e,wp,{relatedTarget:t})};this._queueCallback(i,e,e.classList.contains(aa))}_keydown(e){if(![Dp,ra,Op,oa,Eo,sa].includes(e.key))return;e.stopPropagation(),e.preventDefault();let t=this._getChildren().filter(r=>!Ct(r)),i;if([Eo,sa].includes(e.key))i=t[e.key===Eo?0:t.length-1];else{let r=[ra,oa].includes(e.key);i=So(t,e.target,r,!0)}i&&(i.focus({preventScroll:!0}),n.getOrCreateInstance(i).show())}_getChildren(){return j.find(wo,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(let i of t)this._setInitialAttributesOnChild(i)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);let t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){let t=j.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){let i=this._getOuterElement(e);if(!i.classList.contains(Lp))return;let r=(o,s)=>{let a=j.findOne(o,i);a&&a.classList.toggle(s,t)};r(Ra,Xt),r(Mp,bo),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(Xt)}_getInnerElement(e){return e.matches(wo)?e:j.findOne(wo,e)}_getOuterElement(e){return e.closest(Np)||e}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}};w.on(document,Cp,Ha,function(n){["A","AREA"].includes(this.tagName)&&n.preventDefault(),!Ct(this)&&Jt.getOrCreateInstance(this).show()});w.on(window,Sp,()=>{for(let n of j.find(Hp))Jt.getOrCreateInstance(n)});Qe(Jt);var Ip="toast",Pp="bs.toast",Lt=`.${Pp}`,Fp=`mouseover${Lt}`,$p=`mouseout${Lt}`,Bp=`focusin${Lt}`,Vp=`focusout${Lt}`,zp=`hide${Lt}`,jp=`hidden${Lt}`,Wp=`show${Lt}`,qp=`shown${Lt}`,Up="fade",la="hide",Ui="show",Yi="showing",Yp={animation:"boolean",autohide:"boolean",delay:"number"},Gp={animation:!0,autohide:!0,delay:5e3},pt=class n extends je{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Gp}static get DefaultType(){return Yp}static get NAME(){return Ip}show(){if(w.trigger(this._element,Wp).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Up);let t=()=>{this._element.classList.remove(Yi),w.trigger(this._element,qp),this._maybeScheduleHide()};this._element.classList.remove(la),ii(this._element),this._element.classList.add(Ui,Yi),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||w.trigger(this._element,zp).defaultPrevented)return;let t=()=>{this._element.classList.add(la),this._element.classList.remove(Yi,Ui),w.trigger(this._element,jp)};this._element.classList.add(Yi),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ui),super.dispose()}isShown(){return this._element.classList.contains(Ui)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}let i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){w.on(this._element,Fp,e=>this._onInteraction(e,!0)),w.on(this._element,$p,e=>this._onInteraction(e,!1)),w.on(this._element,Bp,e=>this._onInteraction(e,!0)),w.on(this._element,Vp,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e](this)}})}};rr(pt);Qe(pt);var Kp=function(){"use strict";let htmx={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(n,e){return getInputValues(n,e||"post").values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,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:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:!0,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null,disableInheritance:!1,responseHandling:[{code:"204",swap:!1},{code:"[23]..",swap:!0},{code:"[45]..",swap:!1,error:!0}],allowNestedOobSwaps:!0},parseInterval:null,_:null,version:"2.0.4"};htmx.onLoad=onLoadHelper,htmx.process=processNode,htmx.on=addEventListenerImpl,htmx.off=removeEventListenerImpl,htmx.trigger=triggerEvent,htmx.ajax=ajaxHelper,htmx.find=find,htmx.findAll=findAll,htmx.closest=closest,htmx.remove=removeElement,htmx.addClass=addClassToElement,htmx.removeClass=removeClassFromElement,htmx.toggleClass=toggleClassOnElement,htmx.takeClass=takeClassForElement,htmx.swap=swap,htmx.defineExtension=defineExtension,htmx.removeExtension=removeExtension,htmx.logAll=logAll,htmx.logNone=logNone,htmx.parseInterval=parseInterval,htmx._=internalEval;let internalAPI={addTriggerHandler,bodyContains,canAccessLocalStorage,findThisElement,filterValues,swap,hasAttribute,getAttributeValue,getClosestAttributeValue,getClosestMatch,getExpressionVars,getHeaders,getInputValues,getInternalData,getSwapSpecification,getTriggerSpecs,getTarget,makeFragment,mergeObjects,makeSettleInfo,oobSwap,querySelectorExt,settleImmediately,shouldCancel,triggerEvent,triggerErrorEvent,withExtensions},VERBS=["get","post","put","delete","patch"],VERB_SELECTOR=VERBS.map(function(n){return"[hx-"+n+"], [data-hx-"+n+"]"}).join(", ");function parseInterval(n){if(n==null)return;let e=NaN;return n.slice(-2)=="ms"?e=parseFloat(n.slice(0,-2)):n.slice(-1)=="s"?e=parseFloat(n.slice(0,-1))*1e3:n.slice(-1)=="m"?e=parseFloat(n.slice(0,-1))*1e3*60:e=parseFloat(n),isNaN(e)?void 0:e}function getRawAttribute(n,e){return n instanceof Element&&n.getAttribute(e)}function hasAttribute(n,e){return!!n.hasAttribute&&(n.hasAttribute(e)||n.hasAttribute("data-"+e))}function getAttributeValue(n,e){return getRawAttribute(n,e)||getRawAttribute(n,"data-"+e)}function parentElt(n){let e=n.parentElement;return!e&&n.parentNode instanceof ShadowRoot?n.parentNode:e}function getDocument(){return document}function getRootNode(n,e){return n.getRootNode?n.getRootNode({composed:e}):getDocument()}function getClosestMatch(n,e){for(;n&&!e(n);)n=parentElt(n);return n||null}function getAttributeValueWithDisinheritance(n,e,t){let i=getAttributeValue(e,t),r=getAttributeValue(e,"hx-disinherit");var o=getAttributeValue(e,"hx-inherit");if(n!==e){if(htmx.config.disableInheritance)return o&&(o==="*"||o.split(" ").indexOf(t)>=0)?i:null;if(r&&(r==="*"||r.split(" ").indexOf(t)>=0))return"unset"}return i}function getClosestAttributeValue(n,e){let t=null;if(getClosestMatch(n,function(i){return!!(t=getAttributeValueWithDisinheritance(n,asElement(i),e))}),t!=="unset")return t}function matches(n,e){let t=n instanceof Element&&(n.matches||n.matchesSelector||n.msMatchesSelector||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector);return!!t&&t.call(n,e)}function getStartTag(n){let t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(n);return t?t[1].toLowerCase():""}function parseHTML(n){return new DOMParser().parseFromString(n,"text/html")}function takeChildrenFor(n,e){for(;e.childNodes.length>0;)n.append(e.childNodes[0])}function duplicateScript(n){let e=getDocument().createElement("script");return forEach(n.attributes,function(t){e.setAttribute(t.name,t.value)}),e.textContent=n.textContent,e.async=!1,htmx.config.inlineScriptNonce&&(e.nonce=htmx.config.inlineScriptNonce),e}function isJavaScriptScriptNode(n){return n.matches("script")&&(n.type==="text/javascript"||n.type==="module"||n.type==="")}function normalizeScriptTags(n){Array.from(n.querySelectorAll("script")).forEach(e=>{if(isJavaScriptScriptNode(e)){let t=duplicateScript(e),i=e.parentNode;try{i.insertBefore(t,e)}catch(r){logError(r)}finally{e.remove()}}})}function makeFragment(n){let e=n.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,""),t=getStartTag(e),i;if(t==="html"){i=new DocumentFragment;let o=parseHTML(n);takeChildrenFor(i,o.body),i.title=o.title}else if(t==="body"){i=new DocumentFragment;let o=parseHTML(e);takeChildrenFor(i,o.body),i.title=o.title}else{let o=parseHTML('<body><template class="internal-htmx-wrapper">'+e+"</template></body>");i=o.querySelector("template").content,i.title=o.title;var r=i.querySelector("title");r&&r.parentNode===i&&(r.remove(),i.title=r.innerText)}return i&&(htmx.config.allowScriptTags?normalizeScriptTags(i):i.querySelectorAll("script").forEach(o=>o.remove())),i}function maybeCall(n){n&&n()}function isType(n,e){return Object.prototype.toString.call(n)==="[object "+e+"]"}function isFunction(n){return typeof n=="function"}function isRawObject(n){return isType(n,"Object")}function getInternalData(n){let e="htmx-internal-data",t=n[e];return t||(t=n[e]={}),t}function toArray(n){let e=[];if(n)for(let t=0;t<n.length;t++)e.push(n[t]);return e}function forEach(n,e){if(n)for(let t=0;t<n.length;t++)e(n[t])}function isScrolledIntoView(n){let e=n.getBoundingClientRect(),t=e.top,i=e.bottom;return t<window.innerHeight&&i>=0}function bodyContains(n){return n.getRootNode({composed:!0})===document}function splitOnWhitespace(n){return n.trim().split(/\s+/)}function mergeObjects(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function parseJSON(n){try{return JSON.parse(n)}catch(e){return logError(e),null}}function canAccessLocalStorage(){let n="htmx:localStorageTest";try{return localStorage.setItem(n,n),localStorage.removeItem(n),!0}catch(e){return!1}}function normalizePath(n){try{let e=new URL(n);return e&&(n=e.pathname+e.search),/^\/$/.test(n)||(n=n.replace(/\/+$/,"")),n}catch(e){return n}}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(n){return htmx.on("htmx:load",function(t){n(t.detail.elt)})}function logAll(){htmx.logger=function(n,e,t){console&&console.log(e,n,t)}}function logNone(){htmx.logger=null}function find(n,e){return typeof n!="string"?n.querySelector(e):find(getDocument(),n)}function findAll(n,e){return typeof n!="string"?n.querySelectorAll(e):findAll(getDocument(),n)}function getWindow(){return window}function removeElement(n,e){n=resolveTarget(n),e?getWindow().setTimeout(function(){removeElement(n),n=null},e):parentElt(n).removeChild(n)}function asElement(n){return n instanceof Element?n:null}function asHtmlElement(n){return n instanceof HTMLElement?n:null}function asString(n){return typeof n=="string"?n:null}function asParentNode(n){return n instanceof Element||n instanceof Document||n instanceof DocumentFragment?n:null}function addClassToElement(n,e,t){n=asElement(resolveTarget(n)),n&&(t?getWindow().setTimeout(function(){addClassToElement(n,e),n=null},t):n.classList&&n.classList.add(e))}function removeClassFromElement(n,e,t){let i=asElement(resolveTarget(n));i&&(t?getWindow().setTimeout(function(){removeClassFromElement(i,e),i=null},t):i.classList&&(i.classList.remove(e),i.classList.length===0&&i.removeAttribute("class")))}function toggleClassOnElement(n,e){n=resolveTarget(n),n.classList.toggle(e)}function takeClassForElement(n,e){n=resolveTarget(n),forEach(n.parentElement.children,function(t){removeClassFromElement(t,e)}),addClassToElement(asElement(n),e)}function closest(n,e){if(n=asElement(resolveTarget(n)),n&&n.closest)return n.closest(e);do if(n==null||matches(n,e))return n;while(n=n&&asElement(parentElt(n)));return null}function startsWith(n,e){return n.substring(0,e.length)===e}function endsWith(n,e){return n.substring(n.length-e.length)===e}function normalizeSelector(n){let e=n.trim();return startsWith(e,"<")&&endsWith(e,"/>")?e.substring(1,e.length-2):e}function querySelectorAllExt(n,e,t){if(e.indexOf("global ")===0)return querySelectorAllExt(n,e.slice(7),!0);n=resolveTarget(n);let i=[];{let s=0,a=0;for(let l=0;l<e.length;l++){let c=e[l];if(c===","&&s===0){i.push(e.substring(a,l)),a=l+1;continue}c==="<"?s++:c==="/"&&l<e.length-1&&e[l+1]===">"&&s--}a<e.length&&i.push(e.substring(a))}let r=[],o=[];for(;i.length>0;){let s=normalizeSelector(i.shift()),a;s.indexOf("closest ")===0?a=closest(asElement(n),normalizeSelector(s.substr(8))):s.indexOf("find ")===0?a=find(asParentNode(n),normalizeSelector(s.substr(5))):s==="next"||s==="nextElementSibling"?a=asElement(n).nextElementSibling:s.indexOf("next ")===0?a=scanForwardQuery(n,normalizeSelector(s.substr(5)),!!t):s==="previous"||s==="previousElementSibling"?a=asElement(n).previousElementSibling:s.indexOf("previous ")===0?a=scanBackwardsQuery(n,normalizeSelector(s.substr(9)),!!t):s==="document"?a=document:s==="window"?a=window:s==="body"?a=document.body:s==="root"?a=getRootNode(n,!!t):s==="host"?a=n.getRootNode().host:o.push(s),a&&r.push(a)}if(o.length>0){let s=o.join(","),a=asParentNode(getRootNode(n,!!t));r.push(...toArray(a.querySelectorAll(s)))}return r}var scanForwardQuery=function(n,e,t){let i=asParentNode(getRootNode(n,t)).querySelectorAll(e);for(let r=0;r<i.length;r++){let o=i[r];if(o.compareDocumentPosition(n)===Node.DOCUMENT_POSITION_PRECEDING)return o}},scanBackwardsQuery=function(n,e,t){let i=asParentNode(getRootNode(n,t)).querySelectorAll(e);for(let r=i.length-1;r>=0;r--){let o=i[r];if(o.compareDocumentPosition(n)===Node.DOCUMENT_POSITION_FOLLOWING)return o}};function querySelectorExt(n,e){return typeof n!="string"?querySelectorAllExt(n,e)[0]:querySelectorAllExt(getDocument().body,n)[0]}function resolveTarget(n,e){return typeof n=="string"?find(asParentNode(e)||document,n):n}function processEventArgs(n,e,t,i){return isFunction(e)?{target:getDocument().body,event:asString(n),listener:e,options:t}:{target:resolveTarget(n),event:asString(e),listener:t,options:i}}function addEventListenerImpl(n,e,t,i){return ready(function(){let o=processEventArgs(n,e,t,i);o.target.addEventListener(o.event,o.listener,o.options)}),isFunction(e)?e:t}function removeEventListenerImpl(n,e,t){return ready(function(){let i=processEventArgs(n,e,t);i.target.removeEventListener(i.event,i.listener)}),isFunction(e)?e:t}let DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(n,e){let t=getClosestAttributeValue(n,e);if(t){if(t==="this")return[findThisElement(n,e)];{let i=querySelectorAllExt(n,t);return i.length===0?(logError('The selector "'+t+'" on '+e+" returned no matches!"),[DUMMY_ELT]):i}}}function findThisElement(n,e){return asElement(getClosestMatch(n,function(t){return getAttributeValue(asElement(t),e)!=null}))}function getTarget(n){let e=getClosestAttributeValue(n,"hx-target");return e?e==="this"?findThisElement(n,"hx-target"):querySelectorExt(n,e):getInternalData(n).boosted?getDocument().body:n}function shouldSettleAttribute(n){let e=htmx.config.attributesToSettle;for(let t=0;t<e.length;t++)if(n===e[t])return!0;return!1}function cloneAttributes(n,e){forEach(n.attributes,function(t){!e.hasAttribute(t.name)&&shouldSettleAttribute(t.name)&&n.removeAttribute(t.name)}),forEach(e.attributes,function(t){shouldSettleAttribute(t.name)&&n.setAttribute(t.name,t.value)})}function isInlineSwap(n,e){let t=getExtensions(e);for(let i=0;i<t.length;i++){let r=t[i];try{if(r.isInlineSwap(n))return!0}catch(o){logError(o)}}return n==="outerHTML"}function oobSwap(n,e,t,i){i=i||getDocument();let r="#"+getRawAttribute(e,"id"),o="outerHTML";n==="true"||(n.indexOf(":")>0?(o=n.substring(0,n.indexOf(":")),r=n.substring(n.indexOf(":")+1)):o=n),e.removeAttribute("hx-swap-oob"),e.removeAttribute("data-hx-swap-oob");let s=querySelectorAllExt(i,r,!1);return s?(forEach(s,function(a){let l,c=e.cloneNode(!0);l=getDocument().createDocumentFragment(),l.appendChild(c),isInlineSwap(o,a)||(l=asParentNode(c));let u={shouldSwap:!0,target:a,fragment:l};triggerEvent(a,"htmx:oobBeforeSwap",u)&&(a=u.target,u.shouldSwap&&(handlePreservedElements(l),swapWithStyle(o,a,a,l,t),restorePreservedElements()),forEach(t.elts,function(d){triggerEvent(d,"htmx:oobAfterSwap",u)}))}),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:e})),n}function restorePreservedElements(){let n=find("#--htmx-preserve-pantry--");if(n){for(let e of[...n.children]){let t=find("#"+e.id);t.parentNode.moveBefore(e,t),t.remove()}n.remove()}}function handlePreservedElements(n){forEach(findAll(n,"[hx-preserve], [data-hx-preserve]"),function(e){let t=getAttributeValue(e,"id"),i=getDocument().getElementById(t);if(i!=null)if(e.moveBefore){let r=find("#--htmx-preserve-pantry--");r==null&&(getDocument().body.insertAdjacentHTML("afterend","<div id='--htmx-preserve-pantry--'></div>"),r=find("#--htmx-preserve-pantry--")),r.moveBefore(i,null)}else e.parentNode.replaceChild(i,e)})}function handleAttributes(n,e,t){forEach(e.querySelectorAll("[id]"),function(i){let r=getRawAttribute(i,"id");if(r&&r.length>0){let o=r.replace("'","\\'"),s=i.tagName.replace(":","\\:"),a=asParentNode(n),l=a&&a.querySelector(s+"[id='"+o+"']");if(l&&l!==a){let c=i.cloneNode();cloneAttributes(i,l),t.tasks.push(function(){cloneAttributes(i,c)})}}})}function makeAjaxLoadTask(n){return function(){removeClassFromElement(n,htmx.config.addedClass),processNode(asElement(n)),processFocus(asParentNode(n)),triggerEvent(n,"htmx:load")}}function processFocus(n){let e="[autofocus]",t=asHtmlElement(matches(n,e)?n:n.querySelector(e));t!=null&&t.focus()}function insertNodesBefore(n,e,t,i){for(handleAttributes(n,t,i);t.childNodes.length>0;){let r=t.firstChild;addClassToElement(asElement(r),htmx.config.addedClass),n.insertBefore(r,e),r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE&&i.tasks.push(makeAjaxLoadTask(r))}}function stringHash(n,e){let t=0;for(;t<n.length;)e=(e<<5)-e+n.charCodeAt(t++)|0;return e}function attributeHash(n){let e=0;if(n.attributes)for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];i.value&&(e=stringHash(i.name,e),e=stringHash(i.value,e))}return e}function deInitOnHandlers(n){let e=getInternalData(n);if(e.onHandlers){for(let t=0;t<e.onHandlers.length;t++){let i=e.onHandlers[t];removeEventListenerImpl(n,i.event,i.listener)}delete e.onHandlers}}function deInitNode(n){let e=getInternalData(n);e.timeout&&clearTimeout(e.timeout),e.listenerInfos&&forEach(e.listenerInfos,function(t){t.on&&removeEventListenerImpl(t.on,t.trigger,t.listener)}),deInitOnHandlers(n),forEach(Object.keys(e),function(t){t!=="firstInitCompleted"&&delete e[t]})}function cleanUpElement(n){triggerEvent(n,"htmx:beforeCleanupElement"),deInitNode(n),n.children&&forEach(n.children,function(e){cleanUpElement(e)})}function swapOuterHTML(n,e,t){if(n instanceof Element&&n.tagName==="BODY")return swapInnerHTML(n,e,t);let i,r=n.previousSibling,o=parentElt(n);if(o){for(insertNodesBefore(o,n,e,t),r==null?i=o.firstChild:i=r.nextSibling,t.elts=t.elts.filter(function(s){return s!==n});i&&i!==n;)i instanceof Element&&t.elts.push(i),i=i.nextSibling;cleanUpElement(n),n instanceof Element?n.remove():n.parentNode.removeChild(n)}}function swapAfterBegin(n,e,t){return insertNodesBefore(n,n.firstChild,e,t)}function swapBeforeBegin(n,e,t){return insertNodesBefore(parentElt(n),n,e,t)}function swapBeforeEnd(n,e,t){return insertNodesBefore(n,null,e,t)}function swapAfterEnd(n,e,t){return insertNodesBefore(parentElt(n),n.nextSibling,e,t)}function swapDelete(n){cleanUpElement(n);let e=parentElt(n);if(e)return e.removeChild(n)}function swapInnerHTML(n,e,t){let i=n.firstChild;if(insertNodesBefore(n,i,e,t),i){for(;i.nextSibling;)cleanUpElement(i.nextSibling),n.removeChild(i.nextSibling);cleanUpElement(i),n.removeChild(i)}}function swapWithStyle(n,e,t,i,r){switch(n){case"none":return;case"outerHTML":swapOuterHTML(t,i,r);return;case"afterbegin":swapAfterBegin(t,i,r);return;case"beforebegin":swapBeforeBegin(t,i,r);return;case"beforeend":swapBeforeEnd(t,i,r);return;case"afterend":swapAfterEnd(t,i,r);return;case"delete":swapDelete(t);return;default:var o=getExtensions(e);for(let s=0;s<o.length;s++){let a=o[s];try{let l=a.handleSwap(n,t,i,r);if(l){if(Array.isArray(l))for(let c=0;c<l.length;c++){let u=l[c];u.nodeType!==Node.TEXT_NODE&&u.nodeType!==Node.COMMENT_NODE&&r.tasks.push(makeAjaxLoadTask(u))}return}}catch(l){logError(l)}}n==="innerHTML"?swapInnerHTML(t,i,r):swapWithStyle(htmx.config.defaultSwapStyle,e,t,i,r)}}function findAndSwapOobElements(n,e,t){var i=findAll(n,"[hx-swap-oob], [data-hx-swap-oob]");return forEach(i,function(r){if(htmx.config.allowNestedOobSwaps||r.parentElement===null){let o=getAttributeValue(r,"hx-swap-oob");o!=null&&oobSwap(o,r,e,t)}else r.removeAttribute("hx-swap-oob"),r.removeAttribute("data-hx-swap-oob")}),i.length>0}function swap(n,e,t,i){i||(i={}),n=resolveTarget(n);let r=i.contextElement?getRootNode(i.contextElement,!1):getDocument(),o=document.activeElement,s={};try{s={elt:o,start:o?o.selectionStart:null,end:o?o.selectionEnd:null}}catch(c){}let a=makeSettleInfo(n);if(t.swapStyle==="textContent")n.textContent=e;else{let c=makeFragment(e);if(a.title=c.title,i.selectOOB){let u=i.selectOOB.split(",");for(let d=0;d<u.length;d++){let p=u[d].split(":",2),v=p[0].trim();v.indexOf("#")===0&&(v=v.substring(1));let g=p[1]||"true",y=c.querySelector("#"+v);y&&oobSwap(g,y,a,r)}}if(findAndSwapOobElements(c,a,r),forEach(findAll(c,"template"),function(u){u.content&&findAndSwapOobElements(u.content,a,r)&&u.remove()}),i.select){let u=getDocument().createDocumentFragment();forEach(c.querySelectorAll(i.select),function(d){u.appendChild(d)}),c=u}handlePreservedElements(c),swapWithStyle(t.swapStyle,i.contextElement,n,c,a),restorePreservedElements()}if(s.elt&&!bodyContains(s.elt)&&getRawAttribute(s.elt,"id")){let c=document.getElementById(getRawAttribute(s.elt,"id")),u={preventScroll:t.focusScroll!==void 0?!t.focusScroll:!htmx.config.defaultFocusScroll};if(c){if(s.start&&c.setSelectionRange)try{c.setSelectionRange(s.start,s.end)}catch(d){}c.focus(u)}}n.classList.remove(htmx.config.swappingClass),forEach(a.elts,function(c){c.classList&&c.classList.add(htmx.config.settlingClass),triggerEvent(c,"htmx:afterSwap",i.eventInfo)}),i.afterSwapCallback&&i.afterSwapCallback(),t.ignoreTitle||handleTitle(a.title);let l=function(){if(forEach(a.tasks,function(c){c.call()}),forEach(a.elts,function(c){c.classList&&c.classList.remove(htmx.config.settlingClass),triggerEvent(c,"htmx:afterSettle",i.eventInfo)}),i.anchor){let c=asElement(resolveTarget("#"+i.anchor));c&&c.scrollIntoView({block:"start",behavior:"auto"})}updateScrollState(a.elts,t),i.afterSettleCallback&&i.afterSettleCallback()};t.settleDelay>0?getWindow().setTimeout(l,t.settleDelay):l()}function handleTriggerHeader(n,e,t){let i=n.getResponseHeader(e);if(i.indexOf("{")===0){let r=parseJSON(i);for(let o in r)if(r.hasOwnProperty(o)){let s=r[o];isRawObject(s)?t=s.target!==void 0?s.target:t:s={value:s},triggerEvent(t,o,s)}}else{let r=i.split(",");for(let o=0;o<r.length;o++)triggerEvent(t,r[o].trim(),[])}}let WHITESPACE=/\s/,WHITESPACE_OR_COMMA=/[\s,]/,SYMBOL_START=/[_$a-zA-Z]/,SYMBOL_CONT=/[_$a-zA-Z0-9]/,STRINGISH_START=['"',"'","/"],NOT_WHITESPACE=/[^\s]/,COMBINED_SELECTOR_START=/[{(]/,COMBINED_SELECTOR_END=/[})]/;function tokenizeString(n){let e=[],t=0;for(;t<n.length;){if(SYMBOL_START.exec(n.charAt(t))){for(var i=t;SYMBOL_CONT.exec(n.charAt(t+1));)t++;e.push(n.substring(i,t+1))}else if(STRINGISH_START.indexOf(n.charAt(t))!==-1){let r=n.charAt(t);var i=t;for(t++;t<n.length&&n.charAt(t)!==r;)n.charAt(t)==="\\"&&t++,t++;e.push(n.substring(i,t+1))}else{let r=n.charAt(t);e.push(r)}t++}return e}function isPossibleRelativeReference(n,e,t){return SYMBOL_START.exec(n.charAt(0))&&n!=="true"&&n!=="false"&&n!=="this"&&n!==t&&e!=="."}function maybeGenerateConditional(n,e,t){if(e[0]==="["){e.shift();let i=1,r=" return (function("+t+"){ return (",o=null;for(;e.length>0;){let s=e[0];if(s==="]"){if(i--,i===0){o===null&&(r=r+"true"),e.shift(),r+=")})";try{let a=maybeEval(n,function(){return Function(r)()},function(){return!0});return a.source=r,a}catch(a){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:a,source:r}),null}}}else s==="["&&i++;isPossibleRelativeReference(s,o,t)?r+="(("+t+"."+s+") ? ("+t+"."+s+") : (window."+s+"))":r=r+s,o=e.shift()}}}function consumeUntil(n,e){let t="";for(;n.length>0&&!e.test(n[0]);)t+=n.shift();return t}function consumeCSSSelector(n){let e;return n.length>0&&COMBINED_SELECTOR_START.test(n[0])?(n.shift(),e=consumeUntil(n,COMBINED_SELECTOR_END).trim(),n.shift()):e=consumeUntil(n,WHITESPACE_OR_COMMA),e}let INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(n,e,t){let i=[],r=tokenizeString(e);do{consumeUntil(r,NOT_WHITESPACE);let a=r.length,l=consumeUntil(r,/[,\[\s]/);if(l!=="")if(l==="every"){let c={trigger:"every"};consumeUntil(r,NOT_WHITESPACE),c.pollInterval=parseInterval(consumeUntil(r,/[,\[\s]/)),consumeUntil(r,NOT_WHITESPACE);var o=maybeGenerateConditional(n,r,"event");o&&(c.eventFilter=o),i.push(c)}else{let c={trigger:l};var o=maybeGenerateConditional(n,r,"event");for(o&&(c.eventFilter=o),consumeUntil(r,NOT_WHITESPACE);r.length>0&&r[0]!==",";){let d=r.shift();if(d==="changed")c.changed=!0;else if(d==="once")c.once=!0;else if(d==="consume")c.consume=!0;else if(d==="delay"&&r[0]===":")r.shift(),c.delay=parseInterval(consumeUntil(r,WHITESPACE_OR_COMMA));else if(d==="from"&&r[0]===":"){if(r.shift(),COMBINED_SELECTOR_START.test(r[0]))var s=consumeCSSSelector(r);else{var s=consumeUntil(r,WHITESPACE_OR_COMMA);if(s==="closest"||s==="find"||s==="next"||s==="previous"){r.shift();let v=consumeCSSSelector(r);v.length>0&&(s+=" "+v)}}c.from=s}else d==="target"&&r[0]===":"?(r.shift(),c.target=consumeCSSSelector(r)):d==="throttle"&&r[0]===":"?(r.shift(),c.throttle=parseInterval(consumeUntil(r,WHITESPACE_OR_COMMA))):d==="queue"&&r[0]===":"?(r.shift(),c.queue=consumeUntil(r,WHITESPACE_OR_COMMA)):d==="root"&&r[0]===":"?(r.shift(),c[d]=consumeCSSSelector(r)):d==="threshold"&&r[0]===":"?(r.shift(),c[d]=consumeUntil(r,WHITESPACE_OR_COMMA)):triggerErrorEvent(n,"htmx:syntax:error",{token:r.shift()});consumeUntil(r,NOT_WHITESPACE)}i.push(c)}r.length===a&&triggerErrorEvent(n,"htmx:syntax:error",{token:r.shift()}),consumeUntil(r,NOT_WHITESPACE)}while(r[0]===","&&r.shift());return t&&(t[e]=i),i}function getTriggerSpecs(n){let e=getAttributeValue(n,"hx-trigger"),t=[];if(e){let i=htmx.config.triggerSpecsCache;t=i&&i[e]||parseAndCacheTrigger(n,e,i)}return t.length>0?t:matches(n,"form")?[{trigger:"submit"}]:matches(n,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:matches(n,INPUT_SELECTOR)?[{trigger:"change"}]:[{trigger:"click"}]}function cancelPolling(n){getInternalData(n).cancelled=!0}function processPolling(n,e,t){let i=getInternalData(n);i.timeout=getWindow().setTimeout(function(){bodyContains(n)&&i.cancelled!==!0&&(maybeFilterEvent(t,n,makeEvent("hx:poll:trigger",{triggerSpec:t,target:n}))||e(n),processPolling(n,e,t))},t.pollInterval)}function isLocalLink(n){return location.hostname===n.hostname&&getRawAttribute(n,"href")&&getRawAttribute(n,"href").indexOf("#")!==0}function eltIsDisabled(n){return closest(n,htmx.config.disableSelector)}function boostElement(n,e,t){if(n instanceof HTMLAnchorElement&&isLocalLink(n)&&(n.target===""||n.target==="_self")||n.tagName==="FORM"&&String(getRawAttribute(n,"method")).toLowerCase()!=="dialog"){e.boosted=!0;let i,r;if(n.tagName==="A")i="get",r=getRawAttribute(n,"href");else{let o=getRawAttribute(n,"method");i=o?o.toLowerCase():"get",r=getRawAttribute(n,"action"),(r==null||r==="")&&(r=getDocument().location.href),i==="get"&&r.includes("?")&&(r=r.replace(/\?[^#]+/,""))}t.forEach(function(o){addEventListener(n,function(s,a){let l=asElement(s);if(eltIsDisabled(l)){cleanUpElement(l);return}issueAjaxRequest(i,r,l,a)},e,o,!0)})}}function shouldCancel(n,e){let t=asElement(e);return t?!!((n.type==="submit"||n.type==="click")&&(t.tagName==="FORM"||matches(t,'input[type="submit"], button')&&(matches(t,"[form]")||closest(t,"form")!==null)||t instanceof HTMLAnchorElement&&t.href&&(t.getAttribute("href")==="#"||t.getAttribute("href").indexOf("#")!==0))):!1}function ignoreBoostedAnchorCtrlClick(n,e){return getInternalData(n).boosted&&n instanceof HTMLAnchorElement&&e.type==="click"&&(e.ctrlKey||e.metaKey)}function maybeFilterEvent(n,e,t){let i=n.eventFilter;if(i)try{return i.call(e,t)!==!0}catch(r){let o=i.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:r,source:o}),!0}return!1}function addEventListener(n,e,t,i,r){let o=getInternalData(n),s;i.from?s=querySelectorAllExt(n,i.from):s=[n],i.changed&&("lastValue"in o||(o.lastValue=new WeakMap),s.forEach(function(a){o.lastValue.has(i)||o.lastValue.set(i,new WeakMap),o.lastValue.get(i).set(a,a.value)})),forEach(s,function(a){let l=function(c){if(!bodyContains(n)){a.removeEventListener(i.trigger,l);return}if(ignoreBoostedAnchorCtrlClick(n,c)||((r||shouldCancel(c,n))&&c.preventDefault(),maybeFilterEvent(i,n,c)))return;let u=getInternalData(c);if(u.triggerSpec=i,u.handledFor==null&&(u.handledFor=[]),u.handledFor.indexOf(n)<0){if(u.handledFor.push(n),i.consume&&c.stopPropagation(),i.target&&c.target&&!matches(asElement(c.target),i.target))return;if(i.once){if(o.triggeredOnce)return;o.triggeredOnce=!0}if(i.changed){let d=event.target,p=d.value,v=o.lastValue.get(i);if(v.has(d)&&v.get(d)===p)return;v.set(d,p)}if(o.delayed&&clearTimeout(o.delayed),o.throttle)return;i.throttle>0?o.throttle||(triggerEvent(n,"htmx:trigger"),e(n,c),o.throttle=getWindow().setTimeout(function(){o.throttle=null},i.throttle)):i.delay>0?o.delayed=getWindow().setTimeout(function(){triggerEvent(n,"htmx:trigger"),e(n,c)},i.delay):(triggerEvent(n,"htmx:trigger"),e(n,c))}};t.listenerInfos==null&&(t.listenerInfos=[]),t.listenerInfos.push({trigger:i.trigger,listener:l,on:a}),a.addEventListener(i.trigger,l)})}let windowIsScrolling=!1,scrollHandler=null;function initScrollHandler(){scrollHandler||(scrollHandler=function(){windowIsScrolling=!0},window.addEventListener("scroll",scrollHandler),window.addEventListener("resize",scrollHandler),setInterval(function(){windowIsScrolling&&(windowIsScrolling=!1,forEach(getDocument().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(n){maybeReveal(n)}))},200))}function maybeReveal(n){!hasAttribute(n,"data-hx-revealed")&&isScrolledIntoView(n)&&(n.setAttribute("data-hx-revealed","true"),getInternalData(n).initHash?triggerEvent(n,"revealed"):n.addEventListener("htmx:afterProcessNode",function(){triggerEvent(n,"revealed")},{once:!0}))}function loadImmediately(n,e,t,i){let r=function(){t.loaded||(t.loaded=!0,triggerEvent(n,"htmx:trigger"),e(n))};i>0?getWindow().setTimeout(r,i):r()}function processVerbs(n,e,t){let i=!1;return forEach(VERBS,function(r){if(hasAttribute(n,"hx-"+r)){let o=getAttributeValue(n,"hx-"+r);i=!0,e.path=o,e.verb=r,t.forEach(function(s){addTriggerHandler(n,s,e,function(a,l){let c=asElement(a);if(closest(c,htmx.config.disableSelector)){cleanUpElement(c);return}issueAjaxRequest(r,o,c,l)})})}}),i}function addTriggerHandler(n,e,t,i){if(e.trigger==="revealed")initScrollHandler(),addEventListener(n,i,t,e),maybeReveal(asElement(n));else if(e.trigger==="intersect"){let r={};e.root&&(r.root=querySelectorExt(n,e.root)),e.threshold&&(r.threshold=parseFloat(e.threshold)),new IntersectionObserver(function(s){for(let a=0;a<s.length;a++)if(s[a].isIntersecting){triggerEvent(n,"intersect");break}},r).observe(asElement(n)),addEventListener(asElement(n),i,t,e)}else!t.firstInitCompleted&&e.trigger==="load"?maybeFilterEvent(e,n,makeEvent("load",{elt:n}))||loadImmediately(asElement(n),i,t,e.delay):e.pollInterval>0?(t.polling=!0,processPolling(asElement(n),i,e)):addEventListener(n,i,t,e)}function shouldProcessHxOn(n){let e=asElement(n);if(!e)return!1;let t=e.attributes;for(let i=0;i<t.length;i++){let r=t[i].name;if(startsWith(r,"hx-on:")||startsWith(r,"data-hx-on:")||startsWith(r,"hx-on-")||startsWith(r,"data-hx-on-"))return!0}return!1}let HX_ON_QUERY=new XPathEvaluator().createExpression('.//*[@*[ 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-") ]]');function processHXOnRoot(n,e){shouldProcessHxOn(n)&&e.push(asElement(n));let t=HX_ON_QUERY.evaluate(n),i=null;for(;i=t.iterateNext();)e.push(asElement(i))}function findHxOnWildcardElements(n){let e=[];if(n instanceof DocumentFragment)for(let t of n.childNodes)processHXOnRoot(t,e);else processHXOnRoot(n,e);return e}function findElementsToProcess(n){if(n.querySelectorAll){let t=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]",i=[];for(let o in extensions){let s=extensions[o];if(s.getSelectors){var e=s.getSelectors();e&&i.push(e)}}return n.querySelectorAll(VERB_SELECTOR+t+", form, [type='submit'], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+i.flat().map(o=>", "+o).join(""))}else return[]}function maybeSetLastButtonClicked(n){let e=closest(asElement(n.target),"button, input[type='submit']"),t=getRelatedFormData(n);t&&(t.lastButtonClicked=e)}function maybeUnsetLastButtonClicked(n){let e=getRelatedFormData(n);e&&(e.lastButtonClicked=null)}function getRelatedFormData(n){let e=closest(asElement(n.target),"button, input[type='submit']");if(!e)return;let t=resolveTarget("#"+getRawAttribute(e,"form"),e.getRootNode())||closest(e,"form");if(t)return getInternalData(t)}function initButtonTracking(n){n.addEventListener("click",maybeSetLastButtonClicked),n.addEventListener("focusin",maybeSetLastButtonClicked),n.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(n,e,t){let i=getInternalData(n);Array.isArray(i.onHandlers)||(i.onHandlers=[]);let r,o=function(s){maybeEval(n,function(){eltIsDisabled(n)||(r||(r=new Function("event",t)),r.call(n,s))})};n.addEventListener(e,o),i.onHandlers.push({event:e,listener:o})}function processHxOnWildcard(n){deInitOnHandlers(n);for(let e=0;e<n.attributes.length;e++){let t=n.attributes[e].name,i=n.attributes[e].value;if(startsWith(t,"hx-on")||startsWith(t,"data-hx-on")){let r=t.indexOf("-on")+3,o=t.slice(r,r+1);if(o==="-"||o===":"){let s=t.slice(r+1);startsWith(s,":")?s="htmx"+s:startsWith(s,"-")?s="htmx:"+s.slice(1):startsWith(s,"htmx-")&&(s="htmx:"+s.slice(5)),addHxOnEventHandler(n,s,i)}}}}function initNode(n){if(closest(n,htmx.config.disableSelector)){cleanUpElement(n);return}let e=getInternalData(n),t=attributeHash(n);if(e.initHash!==t){deInitNode(n),e.initHash=t,triggerEvent(n,"htmx:beforeProcessNode");let i=getTriggerSpecs(n);processVerbs(n,e,i)||(getClosestAttributeValue(n,"hx-boost")==="true"?boostElement(n,e,i):hasAttribute(n,"hx-trigger")&&i.forEach(function(o){addTriggerHandler(n,o,e,function(){})})),(n.tagName==="FORM"||getRawAttribute(n,"type")==="submit"&&hasAttribute(n,"form"))&&initButtonTracking(n),e.firstInitCompleted=!0,triggerEvent(n,"htmx:afterProcessNode")}}function processNode(n){if(n=resolveTarget(n),closest(n,htmx.config.disableSelector)){cleanUpElement(n);return}initNode(n),forEach(findElementsToProcess(n),function(e){initNode(e)}),forEach(findHxOnWildcardElements(n),processHxOnWildcard)}function kebabEventName(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function makeEvent(n,e){let t;return window.CustomEvent&&typeof window.CustomEvent=="function"?t=new CustomEvent(n,{bubbles:!0,cancelable:!0,composed:!0,detail:e}):(t=getDocument().createEvent("CustomEvent"),t.initCustomEvent(n,!0,!0,e)),t}function triggerErrorEvent(n,e,t){triggerEvent(n,e,mergeObjects({error:e},t))}function ignoreEventForLogging(n){return n==="htmx:afterProcessNode"}function withExtensions(n,e){forEach(getExtensions(n),function(t){try{e(t)}catch(i){logError(i)}})}function logError(n){console.error?console.error(n):console.log&&console.log("ERROR: ",n)}function triggerEvent(n,e,t){n=resolveTarget(n),t==null&&(t={}),t.elt=n;let i=makeEvent(e,t);htmx.logger&&!ignoreEventForLogging(e)&&htmx.logger(n,e,t),t.error&&(logError(t.error),triggerEvent(n,"htmx:error",{errorInfo:t}));let r=n.dispatchEvent(i),o=kebabEventName(e);if(r&&o!==e){let s=makeEvent(o,i.detail);r=r&&n.dispatchEvent(s)}return withExtensions(asElement(n),function(s){r=r&&s.onEvent(e,i)!==!1&&!i.defaultPrevented}),r}let currentPathForHistory=location.pathname+location.search;function getHistoryElement(){return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]")||getDocument().body}function saveToHistoryCache(n,e){if(!canAccessLocalStorage())return;let t=cleanInnerHtmlForHistory(e),i=getDocument().title,r=window.scrollY;if(htmx.config.historyCacheSize<=0){localStorage.removeItem("htmx-history-cache");return}n=normalizePath(n);let o=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let a=0;a<o.length;a++)if(o[a].url===n){o.splice(a,1);break}let s={url:n,content:t,title:i,scroll:r};for(triggerEvent(getDocument().body,"htmx:historyItemCreated",{item:s,cache:o}),o.push(s);o.length>htmx.config.historyCacheSize;)o.shift();for(;o.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(o));break}catch(a){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:a,cache:o}),o.shift()}}function getCachedHistory(n){if(!canAccessLocalStorage())return null;n=normalizePath(n);let e=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let t=0;t<e.length;t++)if(e[t].url===n)return e[t];return null}function cleanInnerHtmlForHistory(n){let e=htmx.config.requestClass,t=n.cloneNode(!0);return forEach(findAll(t,"."+e),function(i){removeClassFromElement(i,e)}),forEach(findAll(t,"[data-disabled-by-htmx]"),function(i){i.removeAttribute("disabled")}),t.innerHTML}function saveCurrentPageToHistory(){let n=getHistoryElement(),e=currentPathForHistory||location.pathname+location.search,t;try{t=getDocument().querySelector('[hx-history="false" i],[data-hx-history="false" i]')}catch(i){t=getDocument().querySelector('[hx-history="false"],[data-hx-history="false"]')}t||(triggerEvent(getDocument().body,"htmx:beforeHistorySave",{path:e,historyElt:n}),saveToHistoryCache(e,n)),htmx.config.historyEnabled&&history.replaceState({htmx:!0},getDocument().title,window.location.href)}function pushUrlIntoHistory(n){htmx.config.getCacheBusterParam&&(n=n.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),(endsWith(n,"&")||endsWith(n,"?"))&&(n=n.slice(0,-1))),htmx.config.historyEnabled&&history.pushState({htmx:!0},"",n),currentPathForHistory=n}function replaceUrlInHistory(n){htmx.config.historyEnabled&&history.replaceState({htmx:!0},"",n),currentPathForHistory=n}function settleImmediately(n){forEach(n,function(e){e.call(void 0)})}function loadHistoryFromServer(n){let e=new XMLHttpRequest,t={path:n,xhr:e};triggerEvent(getDocument().body,"htmx:historyCacheMiss",t),e.open("GET",n,!0),e.setRequestHeader("HX-Request","true"),e.setRequestHeader("HX-History-Restore-Request","true"),e.setRequestHeader("HX-Current-URL",getDocument().location.href),e.onload=function(){if(this.status>=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",t);let i=makeFragment(this.response),r=i.querySelector("[hx-history-elt],[data-hx-history-elt]")||i,o=getHistoryElement(),s=makeSettleInfo(o);handleTitle(i.title),handlePreservedElements(i),swapInnerHTML(o,r,s),restorePreservedElements(),settleImmediately(s.tasks),currentPathForHistory=n,triggerEvent(getDocument().body,"htmx:historyRestore",{path:n,cacheMiss:!0,serverResponse:this.response})}else triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",t)},e.send()}function restoreHistory(n){saveCurrentPageToHistory(),n=n||location.pathname+location.search;let e=getCachedHistory(n);if(e){let t=makeFragment(e.content),i=getHistoryElement(),r=makeSettleInfo(i);handleTitle(e.title),handlePreservedElements(t),swapInnerHTML(i,t,r),restorePreservedElements(),settleImmediately(r.tasks),getWindow().setTimeout(function(){window.scrollTo(0,e.scroll)},0),currentPathForHistory=n,triggerEvent(getDocument().body,"htmx:historyRestore",{path:n,item:e})}else htmx.config.refreshOnHistoryMiss?window.location.reload(!0):loadHistoryFromServer(n)}function addRequestIndicatorClasses(n){let e=findAttributeTargets(n,"hx-indicator");return e==null&&(e=[n]),forEach(e,function(t){let i=getInternalData(t);i.requestCount=(i.requestCount||0)+1,t.classList.add.call(t.classList,htmx.config.requestClass)}),e}function disableElements(n){let e=findAttributeTargets(n,"hx-disabled-elt");return e==null&&(e=[]),forEach(e,function(t){let i=getInternalData(t);i.requestCount=(i.requestCount||0)+1,t.setAttribute("disabled",""),t.setAttribute("data-disabled-by-htmx","")}),e}function removeRequestIndicators(n,e){forEach(n.concat(e),function(t){let i=getInternalData(t);i.requestCount=(i.requestCount||1)-1}),forEach(n,function(t){getInternalData(t).requestCount===0&&t.classList.remove.call(t.classList,htmx.config.requestClass)}),forEach(e,function(t){getInternalData(t).requestCount===0&&(t.removeAttribute("disabled"),t.removeAttribute("data-disabled-by-htmx"))})}function haveSeenNode(n,e){for(let t=0;t<n.length;t++)if(n[t].isSameNode(e))return!0;return!1}function shouldInclude(n){let e=n;return e.name===""||e.name==null||e.disabled||closest(e,"fieldset[disabled]")||e.type==="button"||e.type==="submit"||e.tagName==="image"||e.tagName==="reset"||e.tagName==="file"?!1:e.type==="checkbox"||e.type==="radio"?e.checked:!0}function addValueToFormData(n,e,t){n!=null&&e!=null&&(Array.isArray(e)?e.forEach(function(i){t.append(n,i)}):t.append(n,e))}function removeValueFromFormData(n,e,t){if(n!=null&&e!=null){let i=t.getAll(n);Array.isArray(e)?i=i.filter(r=>e.indexOf(r)<0):i=i.filter(r=>r!==e),t.delete(n),forEach(i,r=>t.append(n,r))}}function processInputValue(n,e,t,i,r){if(!(i==null||haveSeenNode(n,i))){if(n.push(i),shouldInclude(i)){let o=getRawAttribute(i,"name"),s=i.value;i instanceof HTMLSelectElement&&i.multiple&&(s=toArray(i.querySelectorAll("option:checked")).map(function(a){return a.value})),i instanceof HTMLInputElement&&i.files&&(s=toArray(i.files)),addValueToFormData(o,s,e),r&&validateElement(i,t)}i instanceof HTMLFormElement&&(forEach(i.elements,function(o){n.indexOf(o)>=0?removeValueFromFormData(o.name,o.value,e):n.push(o),r&&validateElement(o,t)}),new FormData(i).forEach(function(o,s){o instanceof File&&o.name===""||addValueToFormData(s,o,e)}))}}function validateElement(n,e){let t=n;t.willValidate&&(triggerEvent(t,"htmx:validation:validate"),t.checkValidity()||(e.push({elt:t,message:t.validationMessage,validity:t.validity}),triggerEvent(t,"htmx:validation:failed",{message:t.validationMessage,validity:t.validity})))}function overrideFormData(n,e){for(let t of e.keys())n.delete(t);return e.forEach(function(t,i){n.append(i,t)}),n}function getInputValues(n,e){let t=[],i=new FormData,r=new FormData,o=[],s=getInternalData(n);s.lastButtonClicked&&!bodyContains(s.lastButtonClicked)&&(s.lastButtonClicked=null);let a=n instanceof HTMLFormElement&&n.noValidate!==!0||getAttributeValue(n,"hx-validate")==="true";if(s.lastButtonClicked&&(a=a&&s.lastButtonClicked.formNoValidate!==!0),e!=="get"&&processInputValue(t,r,o,closest(n,"form"),a),processInputValue(t,i,o,n,a),s.lastButtonClicked||n.tagName==="BUTTON"||n.tagName==="INPUT"&&getRawAttribute(n,"type")==="submit"){let c=s.lastButtonClicked||n,u=getRawAttribute(c,"name");addValueToFormData(u,c.value,r)}let l=findAttributeTargets(n,"hx-include");return forEach(l,function(c){processInputValue(t,i,o,asElement(c),a),matches(c,"form")||forEach(asParentNode(c).querySelectorAll(INPUT_SELECTOR),function(u){processInputValue(t,i,o,u,a)})}),overrideFormData(i,r),{errors:o,formData:i,values:formDataProxy(i)}}function appendParam(n,e,t){n!==""&&(n+="&"),String(t)==="[object Object]"&&(t=JSON.stringify(t));let i=encodeURIComponent(t);return n+=encodeURIComponent(e)+"="+i,n}function urlEncode(n){n=formDataFromObject(n);let e="";return n.forEach(function(t,i){e=appendParam(e,i,t)}),e}function getHeaders(n,e,t){let i={"HX-Request":"true","HX-Trigger":getRawAttribute(n,"id"),"HX-Trigger-Name":getRawAttribute(n,"name"),"HX-Target":getAttributeValue(e,"id"),"HX-Current-URL":getDocument().location.href};return getValuesForElement(n,"hx-headers",!1,i),t!==void 0&&(i["HX-Prompt"]=t),getInternalData(n).boosted&&(i["HX-Boosted"]="true"),i}function filterValues(n,e){let t=getClosestAttributeValue(e,"hx-params");if(t){if(t==="none")return new FormData;if(t==="*")return n;if(t.indexOf("not ")===0)return forEach(t.slice(4).split(","),function(i){i=i.trim(),n.delete(i)}),n;{let i=new FormData;return forEach(t.split(","),function(r){r=r.trim(),n.has(r)&&n.getAll(r).forEach(function(o){i.append(r,o)})}),i}}else return n}function isAnchorLink(n){return!!getRawAttribute(n,"href")&&getRawAttribute(n,"href").indexOf("#")>=0}function getSwapSpecification(n,e){let t=e||getClosestAttributeValue(n,"hx-swap"),i={swapStyle:getInternalData(n).boosted?"innerHTML":htmx.config.defaultSwapStyle,swapDelay:htmx.config.defaultSwapDelay,settleDelay:htmx.config.defaultSettleDelay};if(htmx.config.scrollIntoViewOnBoost&&getInternalData(n).boosted&&!isAnchorLink(n)&&(i.show="top"),t){let s=splitOnWhitespace(t);if(s.length>0)for(let a=0;a<s.length;a++){let l=s[a];if(l.indexOf("swap:")===0)i.swapDelay=parseInterval(l.slice(5));else if(l.indexOf("settle:")===0)i.settleDelay=parseInterval(l.slice(7));else if(l.indexOf("transition:")===0)i.transition=l.slice(11)==="true";else if(l.indexOf("ignoreTitle:")===0)i.ignoreTitle=l.slice(12)==="true";else if(l.indexOf("scroll:")===0){var r=l.slice(7).split(":");let u=r.pop();var o=r.length>0?r.join(":"):null;i.scroll=u,i.scrollTarget=o}else if(l.indexOf("show:")===0){var r=l.slice(5).split(":");let d=r.pop();var o=r.length>0?r.join(":"):null;i.show=d,i.showTarget=o}else if(l.indexOf("focus-scroll:")===0){let c=l.slice(13);i.focusScroll=c=="true"}else a==0?i.swapStyle=l:logError("Unknown modifier in hx-swap: "+l)}}return i}function usesFormData(n){return getClosestAttributeValue(n,"hx-encoding")==="multipart/form-data"||matches(n,"form")&&getRawAttribute(n,"enctype")==="multipart/form-data"}function encodeParamsForBody(n,e,t){let i=null;return withExtensions(e,function(r){i==null&&(i=r.encodeParameters(n,t,e))}),i!=null?i:usesFormData(e)?overrideFormData(new FormData,formDataFromObject(t)):urlEncode(t)}function makeSettleInfo(n){return{tasks:[],elts:[n]}}function updateScrollState(n,e){let t=n[0],i=n[n.length-1];if(e.scroll){var r=null;e.scrollTarget&&(r=asElement(querySelectorExt(t,e.scrollTarget))),e.scroll==="top"&&(t||r)&&(r=r||t,r.scrollTop=0),e.scroll==="bottom"&&(i||r)&&(r=r||i,r.scrollTop=r.scrollHeight)}if(e.show){var r=null;if(e.showTarget){let s=e.showTarget;e.showTarget==="window"&&(s="body"),r=asElement(querySelectorExt(t,s))}e.show==="top"&&(t||r)&&(r=r||t,r.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})),e.show==="bottom"&&(i||r)&&(r=r||i,r.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(n,e,t,i){if(i==null&&(i={}),n==null)return i;let r=getAttributeValue(n,e);if(r){let o=r.trim(),s=t;if(o==="unset")return null;o.indexOf("javascript:")===0?(o=o.slice(11),s=!0):o.indexOf("js:")===0&&(o=o.slice(3),s=!0),o.indexOf("{")!==0&&(o="{"+o+"}");let a;s?a=maybeEval(n,function(){return Function("return ("+o+")")()},{}):a=parseJSON(o);for(let l in a)a.hasOwnProperty(l)&&i[l]==null&&(i[l]=a[l])}return getValuesForElement(asElement(parentElt(n)),e,t,i)}function maybeEval(n,e,t){return htmx.config.allowEval?e():(triggerErrorEvent(n,"htmx:evalDisallowedError"),t)}function getHXVarsForElement(n,e){return getValuesForElement(n,"hx-vars",!0,e)}function getHXValsForElement(n,e){return getValuesForElement(n,"hx-vals",!1,e)}function getExpressionVars(n){return mergeObjects(getHXVarsForElement(n),getHXValsForElement(n))}function safelySetHeaderValue(n,e,t){if(t!==null)try{n.setRequestHeader(e,t)}catch(i){n.setRequestHeader(e,encodeURIComponent(t)),n.setRequestHeader(e+"-URI-AutoEncoded","true")}}function getPathFromResponse(n){if(n.responseURL&&typeof URL!="undefined")try{let e=new URL(n.responseURL);return e.pathname+e.search}catch(e){triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:n.responseURL})}}function hasHeader(n,e){return e.test(n.getAllResponseHeaders())}function ajaxHelper(n,e,t){if(n=n.toLowerCase(),t){if(t instanceof Element||typeof t=="string")return issueAjaxRequest(n,e,null,null,{targetOverride:resolveTarget(t)||DUMMY_ELT,returnPromise:!0});{let i=resolveTarget(t.target);return(t.target&&!i||t.source&&!i&&!resolveTarget(t.source))&&(i=DUMMY_ELT),issueAjaxRequest(n,e,resolveTarget(t.source),t.event,{handler:t.handler,headers:t.headers,values:t.values,targetOverride:i,swapOverride:t.swap,select:t.select,returnPromise:!0})}}else return issueAjaxRequest(n,e,null,null,{returnPromise:!0})}function hierarchyForElt(n){let e=[];for(;n;)e.push(n),n=n.parentElement;return e}function verifyPath(n,e,t){let i,r;return typeof URL=="function"?(r=new URL(e,document.location.href),i=document.location.origin===r.origin):(r=e,i=startsWith(e,document.location.origin)),htmx.config.selfRequestsOnly&&!i?!1:triggerEvent(n,"htmx:validateUrl",mergeObjects({url:r,sameHost:i},t))}function formDataFromObject(n){if(n instanceof FormData)return n;let e=new FormData;for(let t in n)n.hasOwnProperty(t)&&(n[t]&&typeof n[t].forEach=="function"?n[t].forEach(function(i){e.append(t,i)}):typeof n[t]=="object"&&!(n[t]instanceof Blob)?e.append(t,JSON.stringify(n[t])):e.append(t,n[t]));return e}function formDataArrayProxy(n,e,t){return new Proxy(t,{get:function(i,r){return typeof r=="number"?i[r]:r==="length"?i.length:r==="push"?function(o){i.push(o),n.append(e,o)}:typeof i[r]=="function"?function(){i[r].apply(i,arguments),n.delete(e),i.forEach(function(o){n.append(e,o)})}:i[r]&&i[r].length===1?i[r][0]:i[r]},set:function(i,r,o){return i[r]=o,n.delete(e),i.forEach(function(s){n.append(e,s)}),!0}})}function formDataProxy(n){return new Proxy(n,{get:function(e,t){if(typeof t=="symbol"){let r=Reflect.get(e,t);return typeof r=="function"?function(){return r.apply(n,arguments)}:r}if(t==="toJSON")return()=>Object.fromEntries(n);if(t in e)return typeof e[t]=="function"?function(){return n[t].apply(n,arguments)}:e[t];let i=n.getAll(t);if(i.length!==0)return i.length===1?i[0]:formDataArrayProxy(e,t,i)},set:function(e,t,i){return typeof t!="string"?!1:(e.delete(t),i&&typeof i.forEach=="function"?i.forEach(function(r){e.append(t,r)}):typeof i=="object"&&!(i instanceof Blob)?e.append(t,JSON.stringify(i)):e.append(t,i),!0)},deleteProperty:function(e,t){return typeof t=="string"&&e.delete(t),!0},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function issueAjaxRequest(n,e,t,i,r,o){let s=null,a=null;if(r=r!=null?r:{},r.returnPromise&&typeof Promise!="undefined")var l=new Promise(function(U,Z){s=U,a=Z});t==null&&(t=getDocument().body);let c=r.handler||handleAjaxResponse,u=r.select||null;if(!bodyContains(t))return maybeCall(s),l;let d=r.targetOverride||asElement(getTarget(t));if(d==null||d==DUMMY_ELT)return triggerErrorEvent(t,"htmx:targetError",{target:getAttributeValue(t,"hx-target")}),maybeCall(a),l;let p=getInternalData(t),v=p.lastButtonClicked;if(v){let U=getRawAttribute(v,"formaction");U!=null&&(e=U);let Z=getRawAttribute(v,"formmethod");Z!=null&&Z.toLowerCase()!=="dialog"&&(n=Z)}let g=getClosestAttributeValue(t,"hx-confirm");if(o===void 0&&triggerEvent(t,"htmx:confirm",{target:d,elt:t,path:e,verb:n,triggeringEvent:i,etc:r,issueRequest:function(oe){return issueAjaxRequest(n,e,t,i,r,!!oe)},question:g})===!1)return maybeCall(s),l;let y=t,x=getClosestAttributeValue(t,"hx-sync"),T=null,_=!1;if(x){let U=x.split(":"),Z=U[0].trim();if(Z==="this"?y=findThisElement(t,"hx-sync"):y=asElement(querySelectorExt(t,Z)),x=(U[1]||"drop").trim(),p=getInternalData(y),x==="drop"&&p.xhr&&p.abortable!==!0)return maybeCall(s),l;if(x==="abort"){if(p.xhr)return maybeCall(s),l;_=!0}else x==="replace"?triggerEvent(y,"htmx:abort"):x.indexOf("queue")===0&&(T=(x.split(" ")[1]||"last").trim())}if(p.xhr)if(p.abortable)triggerEvent(y,"htmx:abort");else{if(T==null){if(i){let U=getInternalData(i);U&&U.triggerSpec&&U.triggerSpec.queue&&(T=U.triggerSpec.queue)}T==null&&(T="last")}return p.queuedRequests==null&&(p.queuedRequests=[]),T==="first"&&p.queuedRequests.length===0?p.queuedRequests.push(function(){issueAjaxRequest(n,e,t,i,r)}):T==="all"?p.queuedRequests.push(function(){issueAjaxRequest(n,e,t,i,r)}):T==="last"&&(p.queuedRequests=[],p.queuedRequests.push(function(){issueAjaxRequest(n,e,t,i,r)})),maybeCall(s),l}let A=new XMLHttpRequest;p.xhr=A,p.abortable=_;let M=function(){p.xhr=null,p.abortable=!1,p.queuedRequests!=null&&p.queuedRequests.length>0&&p.queuedRequests.shift()()},G=getClosestAttributeValue(t,"hx-prompt");if(G){var F=prompt(G);if(F===null||!triggerEvent(t,"htmx:prompt",{prompt:F,target:d}))return maybeCall(s),M(),l}if(g&&!o&&!confirm(g))return maybeCall(s),M(),l;let D=getHeaders(t,d,F);n!=="get"&&!usesFormData(t)&&(D["Content-Type"]="application/x-www-form-urlencoded"),r.headers&&(D=mergeObjects(D,r.headers));let L=getInputValues(t,n),N=L.errors,Y=L.formData;r.values&&overrideFormData(Y,formDataFromObject(r.values));let B=formDataFromObject(getExpressionVars(t)),ie=overrideFormData(Y,B),J=filterValues(ie,t);htmx.config.getCacheBusterParam&&n==="get"&&J.set("org.htmx.cache-buster",getRawAttribute(d,"id")||"true"),(e==null||e==="")&&(e=getDocument().location.href);let Te=getValuesForElement(t,"hx-request"),Ce=getInternalData(t).boosted,se=htmx.config.methodsThatUseUrlParams.indexOf(n)>=0,ne={boosted:Ce,useUrlParams:se,formData:J,parameters:formDataProxy(J),unfilteredFormData:ie,unfilteredParameters:formDataProxy(ie),headers:D,target:d,verb:n,errors:N,withCredentials:r.credentials||Te.credentials||htmx.config.withCredentials,timeout:r.timeout||Te.timeout||htmx.config.timeout,path:e,triggeringEvent:i};if(!triggerEvent(t,"htmx:configRequest",ne))return maybeCall(s),M(),l;if(e=ne.path,n=ne.verb,D=ne.headers,J=formDataFromObject(ne.parameters),N=ne.errors,se=ne.useUrlParams,N&&N.length>0)return triggerEvent(t,"htmx:validation:halted",ne),maybeCall(s),M(),l;let qe=e.split("#"),He=qe[0],W=qe[1],k=e;if(se&&(k=He,!J.keys().next().done&&(k.indexOf("?")<0?k+="?":k+="&",k+=urlEncode(J),W&&(k+="#"+W))),!verifyPath(t,k,ne))return triggerErrorEvent(t,"htmx:invalidPath",ne),maybeCall(a),l;if(A.open(n.toUpperCase(),k,!0),A.overrideMimeType("text/html"),A.withCredentials=ne.withCredentials,A.timeout=ne.timeout,!Te.noHeaders){for(let U in D)if(D.hasOwnProperty(U)){let Z=D[U];safelySetHeaderValue(A,U,Z)}}let S={xhr:A,target:d,requestConfig:ne,etc:r,boosted:Ce,select:u,pathInfo:{requestPath:e,finalRequestPath:k,responsePath:null,anchor:W}};if(A.onload=function(){try{let U=hierarchyForElt(t);if(S.pathInfo.responsePath=getPathFromResponse(A),c(t,S),S.keepIndicators!==!0&&removeRequestIndicators(V,z),triggerEvent(t,"htmx:afterRequest",S),triggerEvent(t,"htmx:afterOnLoad",S),!bodyContains(t)){let Z=null;for(;U.length>0&&Z==null;){let oe=U.shift();bodyContains(oe)&&(Z=oe)}Z&&(triggerEvent(Z,"htmx:afterRequest",S),triggerEvent(Z,"htmx:afterOnLoad",S))}maybeCall(s),M()}catch(U){throw triggerErrorEvent(t,"htmx:onLoadError",mergeObjects({error:U},S)),U}},A.onerror=function(){removeRequestIndicators(V,z),triggerErrorEvent(t,"htmx:afterRequest",S),triggerErrorEvent(t,"htmx:sendError",S),maybeCall(a),M()},A.onabort=function(){removeRequestIndicators(V,z),triggerErrorEvent(t,"htmx:afterRequest",S),triggerErrorEvent(t,"htmx:sendAbort",S),maybeCall(a),M()},A.ontimeout=function(){removeRequestIndicators(V,z),triggerErrorEvent(t,"htmx:afterRequest",S),triggerErrorEvent(t,"htmx:timeout",S),maybeCall(a),M()},!triggerEvent(t,"htmx:beforeRequest",S))return maybeCall(s),M(),l;var V=addRequestIndicatorClasses(t),z=disableElements(t);forEach(["loadstart","loadend","progress","abort"],function(U){forEach([A,A.upload],function(Z){Z.addEventListener(U,function(oe){triggerEvent(t,"htmx:xhr:"+U,{lengthComputable:oe.lengthComputable,loaded:oe.loaded,total:oe.total})})})}),triggerEvent(t,"htmx:beforeSend",S);let q=se?null:encodeParamsForBody(A,t,J);return A.send(q),l}function determineHistoryUpdates(n,e){let t=e.xhr,i=null,r=null;if(hasHeader(t,/HX-Push:/i)?(i=t.getResponseHeader("HX-Push"),r="push"):hasHeader(t,/HX-Push-Url:/i)?(i=t.getResponseHeader("HX-Push-Url"),r="push"):hasHeader(t,/HX-Replace-Url:/i)&&(i=t.getResponseHeader("HX-Replace-Url"),r="replace"),i)return i==="false"?{}:{type:r,path:i};let o=e.pathInfo.finalRequestPath,s=e.pathInfo.responsePath,a=getClosestAttributeValue(n,"hx-push-url"),l=getClosestAttributeValue(n,"hx-replace-url"),c=getInternalData(n).boosted,u=null,d=null;return a?(u="push",d=a):l?(u="replace",d=l):c&&(u="push",d=s||o),d?d==="false"?{}:(d==="true"&&(d=s||o),e.pathInfo.anchor&&d.indexOf("#")===-1&&(d=d+"#"+e.pathInfo.anchor),{type:u,path:d}):{}}function codeMatches(n,e){var t=new RegExp(n.code);return t.test(e.toString(10))}function resolveResponseHandling(n){for(var e=0;e<htmx.config.responseHandling.length;e++){var t=htmx.config.responseHandling[e];if(codeMatches(t,n.status))return t}return{swap:!1}}function handleTitle(n){if(n){let e=find("title");e?e.innerHTML=n:window.document.title=n}}function handleAjaxResponse(n,e){let t=e.xhr,i=e.target,r=e.etc,o=e.select;if(!triggerEvent(n,"htmx:beforeOnLoad",e))return;if(hasHeader(t,/HX-Trigger:/i)&&handleTriggerHeader(t,"HX-Trigger",n),hasHeader(t,/HX-Location:/i)){saveCurrentPageToHistory();let _=t.getResponseHeader("HX-Location");var s;_.indexOf("{")===0&&(s=parseJSON(_),_=s.path,delete s.path),ajaxHelper("get",_,s).then(function(){pushUrlIntoHistory(_)});return}let a=hasHeader(t,/HX-Refresh:/i)&&t.getResponseHeader("HX-Refresh")==="true";if(hasHeader(t,/HX-Redirect:/i)){e.keepIndicators=!0,location.href=t.getResponseHeader("HX-Redirect"),a&&location.reload();return}if(a){e.keepIndicators=!0,location.reload();return}hasHeader(t,/HX-Retarget:/i)&&(t.getResponseHeader("HX-Retarget")==="this"?e.target=n:e.target=asElement(querySelectorExt(n,t.getResponseHeader("HX-Retarget"))));let l=determineHistoryUpdates(n,e),c=resolveResponseHandling(t),u=c.swap,d=!!c.error,p=htmx.config.ignoreTitle||c.ignoreTitle,v=c.select;c.target&&(e.target=asElement(querySelectorExt(n,c.target)));var g=r.swapOverride;g==null&&c.swapOverride&&(g=c.swapOverride),hasHeader(t,/HX-Retarget:/i)&&(t.getResponseHeader("HX-Retarget")==="this"?e.target=n:e.target=asElement(querySelectorExt(n,t.getResponseHeader("HX-Retarget")))),hasHeader(t,/HX-Reswap:/i)&&(g=t.getResponseHeader("HX-Reswap"));var y=t.response,x=mergeObjects({shouldSwap:u,serverResponse:y,isError:d,ignoreTitle:p,selectOverride:v,swapOverride:g},e);if(!(c.event&&!triggerEvent(i,c.event,x))&&triggerEvent(i,"htmx:beforeSwap",x)){if(i=x.target,y=x.serverResponse,d=x.isError,p=x.ignoreTitle,v=x.selectOverride,g=x.swapOverride,e.target=i,e.failed=d,e.successful=!d,x.shouldSwap){t.status===286&&cancelPolling(n),withExtensions(n,function(L){y=L.transformResponse(y,t,n)}),l.type&&saveCurrentPageToHistory();var T=getSwapSpecification(n,g);T.hasOwnProperty("ignoreTitle")||(T.ignoreTitle=p),i.classList.add(htmx.config.swappingClass);let _=null,A=null;o&&(v=o),hasHeader(t,/HX-Reselect:/i)&&(v=t.getResponseHeader("HX-Reselect"));let M=getClosestAttributeValue(n,"hx-select-oob"),G=getClosestAttributeValue(n,"hx-select"),F=function(){try{l.type&&(triggerEvent(getDocument().body,"htmx:beforeHistoryUpdate",mergeObjects({history:l},e)),l.type==="push"?(pushUrlIntoHistory(l.path),triggerEvent(getDocument().body,"htmx:pushedIntoHistory",{path:l.path})):(replaceUrlInHistory(l.path),triggerEvent(getDocument().body,"htmx:replacedInHistory",{path:l.path}))),swap(i,y,T,{select:v||G,selectOOB:M,eventInfo:e,anchor:e.pathInfo.anchor,contextElement:n,afterSwapCallback:function(){if(hasHeader(t,/HX-Trigger-After-Swap:/i)){let L=n;bodyContains(n)||(L=getDocument().body),handleTriggerHeader(t,"HX-Trigger-After-Swap",L)}},afterSettleCallback:function(){if(hasHeader(t,/HX-Trigger-After-Settle:/i)){let L=n;bodyContains(n)||(L=getDocument().body),handleTriggerHeader(t,"HX-Trigger-After-Settle",L)}maybeCall(_)}})}catch(L){throw triggerErrorEvent(n,"htmx:swapError",e),maybeCall(A),L}},D=htmx.config.globalViewTransitions;if(T.hasOwnProperty("transition")&&(D=T.transition),D&&triggerEvent(n,"htmx:beforeTransition",e)&&typeof Promise!="undefined"&&document.startViewTransition){let L=new Promise(function(Y,B){_=Y,A=B}),N=F;F=function(){document.startViewTransition(function(){return N(),L})}}T.swapDelay>0?getWindow().setTimeout(F,T.swapDelay):F()}d&&triggerErrorEvent(n,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+t.status+" from "+e.pathInfo.requestPath},e))}}let extensions={};function extensionBase(){return{init:function(n){return null},getSelectors:function(){return null},onEvent:function(n,e){return!0},transformResponse:function(n,e,t){return n},isInlineSwap:function(n){return!1},handleSwap:function(n,e,t,i){return!1},encodeParameters:function(n,e,t){return null}}}function defineExtension(n,e){e.init&&e.init(internalAPI),extensions[n]=mergeObjects(extensionBase(),e)}function removeExtension(n){delete extensions[n]}function getExtensions(n,e,t){if(e==null&&(e=[]),n==null)return e;t==null&&(t=[]);let i=getAttributeValue(n,"hx-ext");return i&&forEach(i.split(","),function(r){if(r=r.replace(/ /g,""),r.slice(0,7)=="ignore:"){t.push(r.slice(7));return}if(t.indexOf(r)<0){let o=extensions[r];o&&e.indexOf(o)<0&&e.push(o)}}),getExtensions(asElement(parentElt(n)),e,t)}var isReady=!1;getDocument().addEventListener("DOMContentLoaded",function(){isReady=!0});function ready(n){isReady||getDocument().readyState==="complete"?n():getDocument().addEventListener("DOMContentLoaded",n)}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==!1){let n=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"";getDocument().head.insertAdjacentHTML("beforeend","<style"+n+"> ."+htmx.config.indicatorClass+"{opacity:0} ."+htmx.config.requestClass+" ."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+htmx.config.requestClass+"."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} </style>")}}function getMetaConfig(){let n=getDocument().querySelector('meta[name="htmx-config"]');return n?parseJSON(n.content):null}function mergeMetaConfig(){let n=getMetaConfig();n&&(htmx.config=mergeObjects(htmx.config,n))}return ready(function(){mergeMetaConfig(),insertIndicatorStyles();let n=getDocument().body;processNode(n);let e=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");n.addEventListener("htmx:abort",function(i){let r=i.target,o=getInternalData(r);o&&o.xhr&&o.xhr.abort()});let t=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(i){i.state&&i.state.htmx?(restoreHistory(),forEach(e,function(r){triggerEvent(r,"htmx:restored",{document:getDocument(),triggerEvent})})):t&&t(i)},getWindow().setTimeout(function(){triggerEvent(n,"htmx:load",{}),n=null},0)}),htmx}(),E_=Kp;function Mo(n,e){n.split(/\s+/).forEach(t=>{e(t)})}var oi=class{constructor(){this._events={}}on(e,t){Mo(e,i=>{let r=this._events[i]||[];r.push(t),this._events[i]=r})}off(e,t){var i=arguments.length;if(i===0){this._events={};return}Mo(e,r=>{if(i===1){delete this._events[r];return}let o=this._events[r];o!==void 0&&(o.splice(o.indexOf(t),1),this._events[r]=o)})}trigger(e,...t){var i=this;Mo(e,r=>{let o=i._events[r];o!==void 0&&o.forEach(s=>{s.apply(i,t)})})}};function ko(n){return n.plugins={},class extends n{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(e,t){n.plugins[e]={name:e,fn:t}}initializePlugins(e){var t,i;let r=this,o=[];if(Array.isArray(e))e.forEach(s=>{typeof s=="string"?o.push(s):(r.plugins.settings[s.name]=s.options,o.push(s.name))});else if(e)for(t in e)e.hasOwnProperty(t)&&(r.plugins.settings[t]=e[t],o.push(t));for(;i=o.shift();)r.require(i)}loadPlugin(e){var t=this,i=t.plugins,r=n.plugins[e];if(!n.plugins.hasOwnProperty(e))throw new Error('Unable to find "'+e+'" plugin');i.requested[e]=!0,i.loaded[e]=r.fn.apply(t,[t.plugins.settings[e]||{}]),i.names.push(e)}require(e){var t=this,i=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(i.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return i.loaded[e]}}}var si=n=>(n=n.filter(Boolean),n.length<2?n[0]||"":Qp(n)==1?"["+n.join("")+"]":"(?:"+n.join("|")+")"),No=n=>{if(!Xp(n))return n.join("");let e="",t=0,i=()=>{t>1&&(e+="{"+t+"}")};return n.forEach((r,o)=>{if(r===n[o-1]){t++;return}i(),e+=r,t=1}),i(),e},Ro=n=>{let e=Array.from(n);return si(e)},Xp=n=>new Set(n).size!==n.length,Mt=n=>(n+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),Qp=n=>n.reduce((e,t)=>Math.max(e,Jp(t)),0),Jp=n=>Array.from(n).length;var Ho=n=>{if(n.length===1)return[[n]];let e=[],t=n.substring(1);return Ho(t).forEach(function(r){let o=r.slice(0);o[0]=n.charAt(0)+o[0],e.push(o),o=r.slice(0),o.unshift(n.charAt(0)),e.push(o)}),e};var Zp=[[0,65535]],em="[\u0300-\u036F\xB7\u02BE\u02BC]",or,$a,tm=3,Io={},Ia={"/":"\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 n in Ia){let e=Ia[n]||"";for(let t=0;t<e.length;t++){let i=e.substring(t,t+1);Io[i]=n}}var nm=new RegExp(Object.keys(Io).join("|")+"|"+em,"gu"),im=n=>{or===void 0&&(or=am(n||Zp))},Pa=(n,e="NFKD")=>n.normalize(e),ai=n=>Array.from(n).reduce((e,t)=>e+rm(t),""),rm=n=>(n=Pa(n).toLowerCase().replace(nm,e=>Io[e]||""),Pa(n,"NFC"));function*om(n){for(let[e,t]of n)for(let i=e;i<=t;i++){let r=String.fromCharCode(i),o=ai(r);o!=r.toLowerCase()&&(o.length>tm||o.length!=0&&(yield{folded:o,composed:r,code_point:i}))}}var sm=n=>{let e={},t=(i,r)=>{let o=e[i]||new Set,s=new RegExp("^"+Ro(o)+"$","iu");r.match(s)||(o.add(Mt(r)),e[i]=o)};for(let i of om(n))t(i.folded,i.folded),t(i.folded,i.composed);return e},am=n=>{let e=sm(n),t={},i=[];for(let o in e){let s=e[o];s&&(t[o]=Ro(s)),o.length>1&&i.push(Mt(o))}i.sort((o,s)=>s.length-o.length);let r=si(i);return $a=new RegExp("^"+r,"u"),t},lm=(n,e=1)=>{let t=0;return n=n.map(i=>(or[i]&&(t+=i.length),or[i]||i)),t>=e?No(n):""},cm=(n,e=1)=>(e=Math.max(e,n.length-1),si(Ho(n).map(t=>lm(t,e)))),Fa=(n,e=!0)=>{let t=n.length>1?1:0;return si(n.map(i=>{let r=[],o=e?i.length():i.length()-1;for(let s=0;s<o;s++)r.push(cm(i.substrs[s]||"",t));return No(r)}))},um=(n,e)=>{for(let t of e){if(t.start!=n.start||t.end!=n.end||t.substrs.join("")!==n.substrs.join(""))continue;let i=n.parts,r=s=>{for(let a of i){if(a.start===s.start&&a.substr===s.substr)return!1;if(!(s.length==1||a.length==1)&&(s.start<a.start&&s.end>a.start||a.start<s.start&&a.end>s.start))return!0}return!1};if(!(t.parts.filter(r).length>0))return!0}return!1},sr=class n{constructor(){ee(this,"parts");ee(this,"substrs");ee(this,"start");ee(this,"end");this.parts=[],this.substrs=[],this.start=0,this.end=0}add(e){e&&(this.parts.push(e),this.substrs.push(e.substr),this.start=Math.min(e.start,this.start),this.end=Math.max(e.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(e,t){let i=new n,r=JSON.parse(JSON.stringify(this.parts)),o=r.pop();for(let l of r)i.add(l);let s=t.substr.substring(0,e-o.start),a=s.length;return i.add({start:o.start,end:o.start+a,length:a,substr:s}),i}},Ba=n=>{im(),n=ai(n);let e="",t=[new sr];for(let i=0;i<n.length;i++){let o=n.substring(i).match($a),s=n.substring(i,i+1),a=o?o[0]:null,l=[],c=new Set;for(let u of t){let d=u.last();if(!d||d.length==1||d.end<=i)if(a){let p=a.length;u.add({start:i,end:i+p,length:p,substr:a}),c.add("1")}else u.add({start:i,end:i+1,length:1,substr:s}),c.add("2");else if(a){let p=u.clone(i,d),v=a.length;p.add({start:i,end:i+v,length:v,substr:a}),l.push(p)}else c.add("3")}if(l.length>0){l=l.sort((u,d)=>u.length()-d.length());for(let u of l)um(u,t)||t.push(u);continue}if(i>0&&c.size==1&&!c.has("3")){e+=Fa(t,!1);let u=new sr,d=t[0];d&&u.add(d.last()),t=[u]}}return e+=Fa(t,!0),e};var Va=(n,e)=>{if(n)return n[e]},za=(n,e)=>{if(n){for(var t,i=e.split(".");(t=i.shift())&&(n=n[t]););return n}},ar=(n,e,t)=>{var i,r;return!n||(n=n+"",e.regex==null)||(r=n.search(e.regex),r===-1)?0:(i=e.string.length/n.length,r===0&&(i+=.5),i*t)},lr=(n,e)=>{var t=n[e];if(typeof t=="function")return t;t&&!Array.isArray(t)&&(n[e]=[t])},li=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},ja=(n,e)=>typeof n=="number"&&typeof e=="number"?n>e?1:n<e?-1:0:(n=ai(n+"").toLowerCase(),e=ai(e+"").toLowerCase(),n>e?1:e>n?-1:0);var cr=class{constructor(e,t){ee(this,"items");ee(this,"settings");this.items=e,this.settings=t||{diacritics:!0}}tokenize(e,t,i){if(!e||!e.length)return[];let r=[],o=e.split(/\s+/);var s;return i&&(s=new RegExp("^("+Object.keys(i).map(Mt).join("|")+"):(.*)$")),o.forEach(a=>{let l,c=null,u=null;s&&(l=a.match(s))&&(c=l[1],a=l[2]),a.length>0&&(this.settings.diacritics?u=Ba(a)||null:u=Mt(a),u&&t&&(u="\\b"+u)),r.push({string:a,regex:u?new RegExp(u,"iu"):null,field:c})}),r}getScoreFunction(e,t){var i=this.prepareSearch(e,t);return this._getScoreFunction(i)}_getScoreFunction(e){let t=e.tokens,i=t.length;if(!i)return function(){return 0};let r=e.options.fields,o=e.weights,s=r.length,a=e.getAttrFn;if(!s)return function(){return 1};let l=function(){return s===1?function(c,u){let d=r[0].field;return ar(a(u,d),c,o[d]||1)}:function(c,u){var d=0;if(c.field){let p=a(u,c.field);!c.regex&&p?d+=1/s:d+=ar(p,c,1)}else li(o,(p,v)=>{d+=ar(a(u,v),c,p)});return d/s}}();return i===1?function(c){return l(t[0],c)}:e.options.conjunction==="and"?function(c){var u,d=0;for(let p of t){if(u=l(p,c),u<=0)return 0;d+=u}return d/i}:function(c){var u=0;return li(t,d=>{u+=l(d,c)}),u/i}}getSortFunction(e,t){var i=this.prepareSearch(e,t);return this._getSortFunction(i)}_getSortFunction(e){var t,i=[];let r=this,o=e.options,s=!e.query&&o.sort_empty?o.sort_empty:o.sort;if(typeof s=="function")return s.bind(this);let a=function(c,u){return c==="$score"?u.score:e.getAttrFn(r.items[u.id],c)};if(s)for(let c of s)(e.query||c.field!=="$score")&&i.push(c);if(e.query){t=!0;for(let c of i)if(c.field==="$score"){t=!1;break}t&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter(c=>c.field!=="$score");return i.length?function(c,u){var d,p;for(let v of i)if(p=v.field,d=(v.direction==="desc"?-1:1)*ja(a(p,c),a(p,u)),d)return d;return 0}:null}prepareSearch(e,t){let i={};var r=Object.assign({},t);if(lr(r,"sort"),lr(r,"sort_empty"),r.fields){lr(r,"fields");let o=[];r.fields.forEach(s=>{typeof s=="string"&&(s={field:s,weight:1}),o.push(s),i[s.field]="weight"in s?s.weight:1}),r.fields=o}return{options:r,query:e.toLowerCase().trim(),tokens:this.tokenize(e,r.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:r.nesting?za:Va}}search(e,t){var i=this,r,o;o=this.prepareSearch(e,t),t=o.options,e=o.query;let s=t.score||i._getScoreFunction(o);e.length?li(i.items,(l,c)=>{r=s(l),(t.filter===!1||r>0)&&o.items.push({score:r,id:c})}):li(i.items,(l,c)=>{o.items.push({score:1,id:c})});let a=i._getSortFunction(o);return a&&o.items.sort(a),o.total=o.items.length,typeof t.limit=="number"&&(o.items=o.items.slice(0,t.limit)),o}};var We=n=>typeof n=="undefined"||n===null?null:ci(n),ci=n=>typeof n=="boolean"?n?"1":"0":n+"",ur=n=>(n+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Wa=(n,e)=>e>0?window.setTimeout(n,e):(n.call(null),null),qa=(n,e)=>{var t;return function(i,r){var o=this;t&&(o.loading=Math.max(o.loading-1,0),clearTimeout(t)),t=setTimeout(function(){t=null,o.loadedSearches[i]=!0,n.call(o,i,r)},e)}},Po=(n,e,t)=>{var i,r=n.trigger,o={};n.trigger=function(){var s=arguments[0];if(e.indexOf(s)!==-1)o[s]=arguments;else return r.apply(n,arguments)},t.apply(n,[]),n.trigger=r;for(i of e)i in o&&r.apply(n,o[i])},Ua=n=>({start:n.selectionStart||0,length:(n.selectionEnd||0)-(n.selectionStart||0)}),fe=(n,e=!1)=>{n&&(n.preventDefault(),e&&n.stopPropagation())},Se=(n,e,t,i)=>{n.addEventListener(e,t,i)},kt=(n,e)=>{if(!e||!e[n])return!1;var t=(e.altKey?1:0)+(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.metaKey?1:0);return t===1},dr=(n,e)=>{let t=n.getAttribute("id");return t||(n.setAttribute("id",e),e)},Fo=n=>n.replace(/[\\"']/g,"\\$&"),Nt=(n,e)=>{e&&n.append(e)},ve=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)};var nt=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if($o(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},$o=n=>typeof n=="string"&&n.indexOf("<")>-1,Ya=n=>n.replace(/['"\\]/g,"\\$&"),fr=(n,e)=>{var t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!1),n.dispatchEvent(t)},ui=(n,e)=>{Object.assign(n.style,e)},Pe=(n,...e)=>{var t=Ga(e);n=Ka(n),n.map(i=>{t.map(r=>{i.classList.add(r)})})},gt=(n,...e)=>{var t=Ga(e);n=Ka(n),n.map(i=>{t.map(r=>{i.classList.remove(r)})})},Ga=n=>{var e=[];return ve(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},Ka=n=>(Array.isArray(n)||(n=[n]),n),hr=(n,e,t)=>{if(!(t&&!t.contains(n)))for(;n&&n.matches;){if(n.matches(e))return n;n=n.parentNode}},Bo=(n,e=0)=>e>0?n[n.length-1]:n[0],Xa=n=>Object.keys(n).length===0,Vo=(n,e)=>{if(!n)return-1;e=e||n.nodeName;for(var t=0;n=n.previousElementSibling;)n.matches(e)&&t++;return t},le=(n,e)=>{ve(e,(t,i)=>{t==null?n.removeAttribute(i):n.setAttribute(i,""+t)})},di=(n,e)=>{n.parentNode&&n.parentNode.replaceChild(e,n)};var Qa=(n,e)=>{if(e===null)return;if(typeof e=="string"){if(!e.length)return;e=new RegExp(e,"i")}let t=o=>{var s=o.data.match(e);if(s&&o.data.length>0){var a=document.createElement("span");a.className="highlight";var l=o.splitText(s.index);l.splitText(s[0].length);var c=l.cloneNode(!0);return a.appendChild(c),di(l,a),1}return 0},i=o=>{o.nodeType===1&&o.childNodes&&!/(script|style)/i.test(o.tagName)&&(o.className!=="highlight"||o.tagName!=="SPAN")&&Array.from(o.childNodes).forEach(s=>{r(s)})},r=o=>o.nodeType===3?t(o):(i(o),0);r(n)},Ja=n=>{var e=n.querySelectorAll("span.highlight");Array.prototype.forEach.call(e,function(t){var i=t.parentNode;i.replaceChild(t.firstChild,t),i.normalize()})};var dm=typeof navigator=="undefined"?!1:/Mac/.test(navigator.userAgent),fi=dm?"metaKey":"ctrlKey";var zo={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(n){return n.length>0},render:{}};function pr(n,e){var t=Object.assign({},zo,e),i=t.dataAttr,r=t.labelField,o=t.valueField,s=t.disabledField,a=t.optgroupField,l=t.optgroupLabelField,c=t.optgroupValueField,u=n.tagName.toLowerCase(),d=n.getAttribute("placeholder")||n.getAttribute("data-placeholder");if(!d&&!t.allowEmptyOption){let y=n.querySelector('option[value=""]');y&&(d=y.textContent)}var p={placeholder:d,options:[],optgroups:[],items:[],maxItems:null},v=()=>{var y,x=p.options,T={},_=1;let A=0;var M=D=>{var L=Object.assign({},D.dataset),N=i&&L[i];return typeof N=="string"&&N.length&&(L=Object.assign(L,JSON.parse(N))),L},G=(D,L)=>{var N=We(D.value);if(N!=null&&!(!N&&!t.allowEmptyOption)){if(T.hasOwnProperty(N)){if(L){var Y=T[N][a];Y?Array.isArray(Y)?Y.push(L):T[N][a]=[Y,L]:T[N][a]=L}}else{var B=M(D);B[r]=B[r]||D.textContent,B[o]=B[o]||N,B[s]=B[s]||D.disabled,B[a]=B[a]||L,B.$option=D,B.$order=B.$order||++A,T[N]=B,x.push(B)}D.selected&&p.items.push(N)}},F=D=>{var L,N;N=M(D),N[l]=N[l]||D.getAttribute("label")||"",N[c]=N[c]||_++,N[s]=N[s]||D.disabled,N.$order=N.$order||++A,p.optgroups.push(N),L=N[c],ve(D.children,Y=>{G(Y,L)})};p.maxItems=n.hasAttribute("multiple")?null:1,ve(n.children,D=>{y=D.tagName.toLowerCase(),y==="optgroup"?F(D):y==="option"&&G(D)})},g=()=>{let y=n.getAttribute(i);if(y)p.options=JSON.parse(y),ve(p.options,T=>{p.items.push(T[o])});else{var x=n.value.trim()||"";if(!t.allowEmptyOption&&!x.length)return;let T=x.split(t.delimiter);ve(T,_=>{let A={};A[r]=_,A[o]=_,p.options.push(A)}),p.items=T}};return u==="select"?v():g(),Object.assign({},zo,p,e)}var tl=0,_e=class extends ko(oi){constructor(e,t){super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,tl++;var i,r=nt(e);if(r.tomselect)throw new Error("Tom Select already initialized on this element");r.tomselect=this;var o=window.getComputedStyle&&window.getComputedStyle(r,null);i=o.getPropertyValue("direction");let s=pr(r,t);this.settings=s,this.input=r,this.tabIndex=r.tabIndex||0,this.is_select_tag=r.tagName.toLowerCase()==="select",this.rtl=/rtl/i.test(i),this.inputId=dr(r,"tomselect-"+tl),this.isRequired=r.required,this.sifter=new cr(this.options,{diacritics:s.diacritics}),s.mode=s.mode||(s.maxItems===1?"single":"multi"),typeof s.hideSelected!="boolean"&&(s.hideSelected=s.mode==="multi"),typeof s.hidePlaceholder!="boolean"&&(s.hidePlaceholder=s.mode!=="multi");var a=s.createFilter;typeof a!="function"&&(typeof a=="string"&&(a=new RegExp(a)),a instanceof RegExp?s.createFilter=x=>a.test(x):s.createFilter=x=>this.settings.duplicates||!this.options[x]),this.initializePlugins(s.plugins),this.setupCallbacks(),this.setupTemplates();let l=nt("<div>"),c=nt("<div>"),u=this._render("dropdown"),d=nt('<div role="listbox" tabindex="-1">'),p=this.input.getAttribute("class")||"",v=s.mode;var g;if(Pe(l,s.wrapperClass,p,v),Pe(c,s.controlClass),Nt(l,c),Pe(u,s.dropdownClass,v),s.copyClassesToDropdown&&Pe(u,p),Pe(d,s.dropdownContentClass),Nt(u,d),nt(s.dropdownParent||l).appendChild(u),$o(s.controlInput)){g=nt(s.controlInput);var y=["autocorrect","autocapitalize","autocomplete","spellcheck"];ve(y,x=>{r.getAttribute(x)&&le(g,{[x]:r.getAttribute(x)})}),g.tabIndex=-1,c.appendChild(g),this.focus_node=g}else s.controlInput?(g=nt(s.controlInput),this.focus_node=g):(g=nt("<input/>"),this.focus_node=c);this.wrapper=l,this.dropdown=u,this.dropdown_content=d,this.control=c,this.control_input=g,this.setup()}setup(){let e=this,t=e.settings,i=e.control_input,r=e.dropdown,o=e.dropdown_content,s=e.wrapper,a=e.control,l=e.input,c=e.focus_node,u={passive:!0},d=e.inputId+"-ts-dropdown";le(o,{id:d}),le(c,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":d});let p=dr(c,e.inputId+"-ts-control"),v="label[for='"+Ya(e.inputId)+"']",g=document.querySelector(v),y=e.focus.bind(e);if(g){Se(g,"click",y),le(g,{for:p});let _=dr(g,e.inputId+"-ts-label");le(c,{"aria-labelledby":_}),le(o,{"aria-labelledby":_})}if(s.style.width=l.style.width,e.plugins.names.length){let _="plugin-"+e.plugins.names.join(" plugin-");Pe([s,r],_)}(t.maxItems===null||t.maxItems>1)&&e.is_select_tag&&le(l,{multiple:"multiple"}),t.placeholder&&le(i,{placeholder:t.placeholder}),!t.splitOn&&t.delimiter&&(t.splitOn=new RegExp("\\s*"+Mt(t.delimiter)+"+\\s*")),t.load&&t.loadThrottle&&(t.load=qa(t.load,t.loadThrottle)),Se(r,"mousemove",()=>{e.ignoreHover=!1}),Se(r,"mouseenter",_=>{var A=hr(_.target,"[data-selectable]",r);A&&e.onOptionHover(_,A)},{capture:!0}),Se(r,"click",_=>{let A=hr(_.target,"[data-selectable]");A&&(e.onOptionSelect(_,A),fe(_,!0))}),Se(a,"click",_=>{var A=hr(_.target,"[data-ts-item]",a);if(A&&e.onItemSelect(_,A)){fe(_,!0);return}i.value==""&&(e.onClick(),fe(_,!0))}),Se(c,"keydown",_=>e.onKeyDown(_)),Se(i,"keypress",_=>e.onKeyPress(_)),Se(i,"input",_=>e.onInput(_)),Se(c,"blur",_=>e.onBlur(_)),Se(c,"focus",_=>e.onFocus(_)),Se(i,"paste",_=>e.onPaste(_));let x=_=>{let A=_.composedPath()[0];if(!s.contains(A)&&!r.contains(A)){e.isFocused&&e.blur(),e.inputState();return}A==i&&e.isOpen?_.stopPropagation():fe(_,!0)},T=()=>{e.isOpen&&e.positionDropdown()};Se(document,"mousedown",x),Se(window,"scroll",T,u),Se(window,"resize",T,u),this._destroy=()=>{document.removeEventListener("mousedown",x),window.removeEventListener("scroll",T),window.removeEventListener("resize",T),g&&g.removeEventListener("click",y)},this.revertSettings={innerHTML:l.innerHTML,tabIndex:l.tabIndex},l.tabIndex=-1,l.insertAdjacentElement("afterend",e.wrapper),e.sync(!1),t.items=[],delete t.optgroups,delete t.options,Se(l,"invalid",()=>{e.isValid&&(e.isValid=!1,e.isInvalid=!0,e.refreshState())}),e.updateOriginalInput(),e.refreshItems(),e.close(!1),e.inputState(),e.isSetup=!0,l.disabled?e.disable():l.readOnly?e.setReadOnly(!0):e.enable(),e.on("change",this.onChange),Pe(l,"tomselected","ts-hidden-accessible"),e.trigger("initialize"),t.preload===!0&&e.preload()}setupOptions(e=[],t=[]){this.addOptions(e),ve(t,i=>{this.registerOptionGroup(i)})}setupTemplates(){var e=this,t=e.settings.labelField,i=e.settings.optgroupLabelField,r={optgroup:o=>{let s=document.createElement("div");return s.className="optgroup",s.appendChild(o.options),s},optgroup_header:(o,s)=>'<div class="optgroup-header">'+s(o[i])+"</div>",option:(o,s)=>"<div>"+s(o[t])+"</div>",item:(o,s)=>"<div>"+s(o[t])+"</div>",option_create:(o,s)=>'<div class="create">Add <strong>'+s(o.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};e.settings.render=Object.assign({},r,e.settings.render)}setupCallbacks(){var e,t,i={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in i)t=this.settings[i[e]],t&&this.on(e,t)}sync(e=!0){let t=this,i=e?pr(t.input,{delimiter:t.settings.delimiter}):t.settings;t.setupOptions(i.options,i.optgroups),t.setValue(i.items||[],!0),t.lastQuery=null}onClick(){var e=this;if(e.activeItems.length>0){e.clearActiveItems(),e.focus();return}e.isFocused&&e.isOpen?e.blur():e.focus()}onMouseDown(){}onChange(){fr(this.input,"input"),fr(this.input,"change")}onPaste(e){var t=this;if(t.isInputHidden||t.isLocked){fe(e);return}t.settings.splitOn&&setTimeout(()=>{var i=t.inputValue();if(i.match(t.settings.splitOn)){var r=i.trim().split(t.settings.splitOn);ve(r,o=>{We(o)&&(this.options[o]?t.addItem(o):t.createItem(o))})}},0)}onKeyPress(e){var t=this;if(t.isLocked){fe(e);return}var i=String.fromCharCode(e.keyCode||e.which);if(t.settings.create&&t.settings.mode==="multi"&&i===t.settings.delimiter){t.createItem(),fe(e);return}}onKeyDown(e){var t=this;if(t.ignoreHover=!0,t.isLocked){e.keyCode!==9&&fe(e);return}switch(e.keyCode){case 65:if(kt(fi,e)&&t.control_input.value==""){fe(e),t.selectAll();return}break;case 27:t.isOpen&&(fe(e,!0),t.close()),t.clearActiveItems();return;case 40:if(!t.isOpen&&t.hasOptions)t.open();else if(t.activeOption){let i=t.getAdjacent(t.activeOption,1);i&&t.setActiveOption(i)}fe(e);return;case 38:if(t.activeOption){let i=t.getAdjacent(t.activeOption,-1);i&&t.setActiveOption(i)}fe(e);return;case 13:t.canSelect(t.activeOption)?(t.onOptionSelect(e,t.activeOption),fe(e)):t.settings.create&&t.createItem()?fe(e):document.activeElement==t.control_input&&t.isOpen&&fe(e);return;case 37:t.advanceSelection(-1,e);return;case 39:t.advanceSelection(1,e);return;case 9:t.settings.selectOnTab&&(t.canSelect(t.activeOption)&&(t.onOptionSelect(e,t.activeOption),fe(e)),t.settings.create&&t.createItem()&&fe(e));return;case 8:case 46:t.deleteSelection(e);return}t.isInputHidden&&!kt(fi,e)&&fe(e)}onInput(e){if(this.isLocked)return;let t=this.inputValue();if(this.lastValue!==t){if(this.lastValue=t,t==""){this._onInput();return}this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=Wa(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)}}_onInput(){let e=this.lastValue;this.settings.shouldLoad.call(this,e)&&this.load(e),this.refreshOptions(),this.trigger("type",e)}onOptionHover(e,t){this.ignoreHover||this.setActiveOption(t,!1)}onFocus(e){var t=this,i=t.isFocused;if(t.isDisabled||t.isReadOnly){t.blur(),fe(e);return}t.ignoreFocus||(t.isFocused=!0,t.settings.preload==="focus"&&t.preload(),i||t.trigger("focus"),t.activeItems.length||(t.inputState(),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())}onBlur(e){if(document.hasFocus()!==!1){var t=this;if(t.isFocused){t.isFocused=!1,t.ignoreFocus=!1;var i=()=>{t.close(),t.setActiveItem(),t.setCaret(t.items.length),t.trigger("blur")};t.settings.create&&t.settings.createOnBlur?t.createItem(null,i):i()}}}onOptionSelect(e,t){var i,r=this;t.parentElement&&t.parentElement.matches("[data-disabled]")||(t.classList.contains("create")?r.createItem(null,()=>{r.settings.closeAfterSelect&&r.close()}):(i=t.dataset.value,typeof i!="undefined"&&(r.lastQuery=null,r.addItem(i),r.settings.closeAfterSelect&&r.close(),!r.settings.hideSelected&&e.type&&/click/.test(e.type)&&r.setActiveOption(t))))}canSelect(e){return!!(this.isOpen&&e&&this.dropdown_content.contains(e))}onItemSelect(e,t){var i=this;return!i.isLocked&&i.settings.mode==="multi"?(fe(e),i.setActiveItem(t,e),!0):!1}canLoad(e){return!(!this.settings.load||this.loadedSearches.hasOwnProperty(e))}load(e){let t=this;if(!t.canLoad(e))return;Pe(t.wrapper,t.settings.loadingClass),t.loading++;let i=t.loadCallback.bind(t);t.settings.load.call(t,e,i)}loadCallback(e,t){let i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(e,t),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||gt(i.wrapper,i.settings.loadingClass),i.trigger("load",e,t)}preload(){var e=this.wrapper.classList;e.contains("preloaded")||(e.add("preloaded"),this.load(""))}setTextboxValue(e=""){var t=this.control_input,i=t.value!==e;i&&(t.value=e,fr(t,"update"),this.lastValue=e)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(e,t){var i=t?[]:["change"];Po(this,i,()=>{this.clear(t),this.addItems(e,t)})}setMaxItems(e){e===0&&(e=null),this.settings.maxItems=e,this.refreshState()}setActiveItem(e,t){var i=this,r,o,s,a,l,c;if(i.settings.mode!=="single"){if(!e){i.clearActiveItems(),i.isFocused&&i.inputState();return}if(r=t&&t.type.toLowerCase(),r==="click"&&kt("shiftKey",t)&&i.activeItems.length){for(c=i.getLastActive(),s=Array.prototype.indexOf.call(i.control.children,c),a=Array.prototype.indexOf.call(i.control.children,e),s>a&&(l=s,s=a,a=l),o=s;o<=a;o++)e=i.control.children[o],i.activeItems.indexOf(e)===-1&&i.setActiveItemClass(e);fe(t)}else r==="click"&&kt(fi,t)||r==="keydown"&&kt("shiftKey",t)?e.classList.contains("active")?i.removeActiveItem(e):i.setActiveItemClass(e):(i.clearActiveItems(),i.setActiveItemClass(e));i.inputState(),i.isFocused||i.focus()}}setActiveItemClass(e){let t=this,i=t.control.querySelector(".last-active");i&&gt(i,"last-active"),Pe(e,"active last-active"),t.trigger("item_select",e),t.activeItems.indexOf(e)==-1&&t.activeItems.push(e)}removeActiveItem(e){var t=this.activeItems.indexOf(e);this.activeItems.splice(t,1),gt(e,"active")}clearActiveItems(){gt(this.activeItems,"active"),this.activeItems=[]}setActiveOption(e,t=!0){e!==this.activeOption&&(this.clearActiveOption(),e&&(this.activeOption=e,le(this.focus_node,{"aria-activedescendant":e.getAttribute("id")}),le(e,{"aria-selected":"true"}),Pe(e,"active"),t&&this.scrollToOption(e)))}scrollToOption(e,t){if(!e)return;let i=this.dropdown_content,r=i.clientHeight,o=i.scrollTop||0,s=e.offsetHeight,a=e.getBoundingClientRect().top-i.getBoundingClientRect().top+o;a+s>r+o?this.scroll(a-r+s,t):a<o&&this.scroll(a,t)}scroll(e,t){let i=this.dropdown_content;t&&(i.style.scrollBehavior=t),i.scrollTop=e,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(gt(this.activeOption,"active"),le(this.activeOption,{"aria-selected":null})),this.activeOption=null,le(this.focus_node,{"aria-activedescendant":null})}selectAll(){let e=this;if(e.settings.mode==="single")return;let t=e.controlChildren();t.length&&(e.inputState(),e.close(),e.activeItems=t,ve(t,i=>{e.setActiveItemClass(i)}))}inputState(){var e=this;e.control.contains(e.control_input)&&(le(e.control_input,{placeholder:e.settings.placeholder}),e.activeItems.length>0||!e.isFocused&&e.settings.hidePlaceholder&&e.items.length>0?(e.setTextboxValue(),e.isInputHidden=!0):(e.settings.hidePlaceholder&&e.items.length>0&&le(e.control_input,{placeholder:""}),e.isInputHidden=!1),e.wrapper.classList.toggle("input-hidden",e.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var e=this;e.isDisabled||e.isReadOnly||(e.ignoreFocus=!0,e.control_input.offsetWidth?e.control_input.focus():e.focus_node.focus(),setTimeout(()=>{e.ignoreFocus=!1,e.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())}getSearchOptions(){var e=this.settings,t=e.sortField;return typeof e.sortField=="string"&&(t=[{field:e.sortField}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}}search(e){var t,i,r=this,o=this.getSearchOptions();if(r.settings.score&&(i=r.settings.score.call(r,e),typeof i!="function"))throw new Error('Tom Select "score" setting must be a function that returns a function');return e!==r.lastQuery?(r.lastQuery=e,t=r.sifter.search(e,Object.assign(o,{score:i})),r.currentResults=t):t=Object.assign({},r.currentResults),r.settings.hideSelected&&(t.items=t.items.filter(s=>{let a=We(s.id);return!(a&&r.items.indexOf(a)!==-1)})),t}refreshOptions(e=!0){var t,i,r,o,s,a,l,c,u,d;let p={},v=[];var g=this,y=g.inputValue();let x=y===g.lastQuery||y==""&&g.lastQuery==null;var T=g.search(y),_=null,A=g.settings.shouldOpen||!1,M=g.dropdown_content;x&&(_=g.activeOption,_&&(u=_.closest("[data-group]"))),o=T.items.length,typeof g.settings.maxOptions=="number"&&(o=Math.min(o,g.settings.maxOptions)),o>0&&(A=!0);let G=(D,L)=>{let N=p[D];if(N!==void 0){let B=v[N];if(B!==void 0)return[N,B.fragment]}let Y=document.createDocumentFragment();return N=v.length,v.push({fragment:Y,order:L,optgroup:D}),[N,Y]};for(t=0;t<o;t++){let D=T.items[t];if(!D)continue;let L=D.id,N=g.options[L];if(N===void 0)continue;let Y=ci(L),B=g.getOption(Y,!0);for(g.settings.hideSelected||B.classList.toggle("selected",g.items.includes(Y)),s=N[g.settings.optgroupField]||"",a=Array.isArray(s)?s:[s],i=0,r=a&&a.length;i<r;i++){s=a[i];let ie=N.$order,J=g.optgroups[s];J===void 0?s="":ie=J.$order;let[Te,Ce]=G(s,ie);i>0&&(B=B.cloneNode(!0),le(B,{id:N.$id+"-clone-"+i,"aria-selected":null}),B.classList.add("ts-cloned"),gt(B,"active"),g.activeOption&&g.activeOption.dataset.value==L&&u&&u.dataset.group===s.toString()&&(_=B)),Ce.appendChild(B),s!=""&&(p[s]=Te)}}g.settings.lockOptgroupOrder&&v.sort((D,L)=>D.order-L.order),l=document.createDocumentFragment(),ve(v,D=>{let L=D.fragment,N=D.optgroup;if(!L||!L.children.length)return;let Y=g.optgroups[N];if(Y!==void 0){let B=document.createDocumentFragment(),ie=g.render("optgroup_header",Y);Nt(B,ie),Nt(B,L);let J=g.render("optgroup",{group:Y,options:B});Nt(l,J)}else Nt(l,L)}),M.innerHTML="",Nt(M,l),g.settings.highlight&&(Ja(M),T.query.length&&T.tokens.length&&ve(T.tokens,D=>{Qa(M,D.regex)}));var F=D=>{let L=g.render(D,{input:y});return L&&(A=!0,M.insertBefore(L,M.firstChild)),L};if(g.loading?F("loading"):g.settings.shouldLoad.call(g,y)?T.items.length===0&&F("no_results"):F("not_loading"),c=g.canCreate(y),c&&(d=F("option_create")),g.hasOptions=T.items.length>0||c,A){if(T.items.length>0){if(!_&&g.settings.mode==="single"&&g.items[0]!=null&&(_=g.getOption(g.items[0])),!M.contains(_)){let D=0;d&&!g.settings.addPrecedence&&(D=1),_=g.selectable()[D]}}else d&&(_=d);e&&!g.isOpen&&(g.open(),g.scrollToOption(_,"auto")),g.setActiveOption(_)}else g.clearActiveOption(),e&&g.isOpen&&g.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(e,t=!1){let i=this;if(Array.isArray(e))return i.addOptions(e,t),!1;let r=We(e[i.settings.valueField]);return r===null||i.options.hasOwnProperty(r)?!1:(e.$order=e.$order||++i.order,e.$id=i.inputId+"-opt-"+e.$order,i.options[r]=e,i.lastQuery=null,t&&(i.userOptions[r]=t,i.trigger("option_add",r,e)),r)}addOptions(e,t=!1){ve(e,i=>{this.addOption(i,t)})}registerOption(e){return this.addOption(e)}registerOptionGroup(e){var t=We(e[this.settings.optgroupValueField]);return t===null?!1:(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)}addOptionGroup(e,t){var i;t[this.settings.optgroupValueField]=e,(i=this.registerOptionGroup(t))&&this.trigger("optgroup_add",i,t)}removeOptionGroup(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.clearCache(),this.trigger("optgroup_remove",e))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(e,t){let i=this;var r,o;let s=We(e),a=We(t[i.settings.valueField]);if(s===null)return;let l=i.options[s];if(l==null)return;if(typeof a!="string")throw new Error("Value must be set in option data");let c=i.getOption(s),u=i.getItem(s);if(t.$order=t.$order||l.$order,delete i.options[s],i.uncacheValue(a),i.options[a]=t,c){if(i.dropdown_content.contains(c)){let d=i._render("option",t);di(c,d),i.activeOption===c&&i.setActiveOption(d)}c.remove()}u&&(o=i.items.indexOf(s),o!==-1&&i.items.splice(o,1,a),r=i._render("item",t),u.classList.contains("active")&&Pe(r,"active"),di(u,r)),i.lastQuery=null}removeOption(e,t){let i=this;e=ci(e),i.uncacheValue(e),delete i.userOptions[e],delete i.options[e],i.lastQuery=null,i.trigger("option_remove",e),i.removeItem(e,t)}clearOptions(e){let t=(e||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();let i={};ve(this.options,(r,o)=>{t(r,o)&&(i[o]=r)}),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(e,t){return this.items.indexOf(t)>=0}getOption(e,t=!1){let i=We(e);if(i===null)return null;let r=this.options[i];if(r!=null){if(r.$div)return r.$div;if(t)return this._render("option",r)}return null}getAdjacent(e,t,i="option"){var r=this,o;if(!e)return null;i=="item"?o=r.controlChildren():o=r.dropdown_content.querySelectorAll("[data-selectable]");for(let s=0;s<o.length;s++)if(o[s]==e)return t>0?o[s+1]:o[s-1];return null}getItem(e){if(typeof e=="object")return e;var t=We(e);return t!==null?this.control.querySelector(`[data-value="${Fo(t)}"]`):null}addItems(e,t){var i=this,r=Array.isArray(e)?e:[e];r=r.filter(s=>i.items.indexOf(s)===-1);let o=r[r.length-1];r.forEach(s=>{i.isPending=s!==o,i.addItem(s,t)})}addItem(e,t){var i=t?[]:["change","dropdown_close"];Po(this,i,()=>{var r,o;let s=this,a=s.settings.mode,l=We(e);if(!(l&&s.items.indexOf(l)!==-1&&(a==="single"&&s.close(),a==="single"||!s.settings.duplicates))&&!(l===null||!s.options.hasOwnProperty(l))&&(a==="single"&&s.clear(t),!(a==="multi"&&s.isFull()))){if(r=s._render("item",s.options[l]),s.control.contains(r)&&(r=r.cloneNode(!0)),o=s.isFull(),s.items.splice(s.caretPos,0,l),s.insertAtCaret(r),s.isSetup){if(!s.isPending&&s.settings.hideSelected){let c=s.getOption(l),u=s.getAdjacent(c,1);u&&s.setActiveOption(u)}!s.isPending&&!s.settings.closeAfterSelect&&s.refreshOptions(s.isFocused&&a!=="single"),s.settings.closeAfterSelect!=!1&&s.isFull()?s.close():s.isPending||s.positionDropdown(),s.trigger("item_add",l,r),s.isPending||s.updateOriginalInput({silent:t})}(!s.isPending||!o&&s.isFull())&&(s.inputState(),s.refreshState())}})}removeItem(e=null,t){let i=this;if(e=i.getItem(e),!e)return;var r,o;let s=e.dataset.value;r=Vo(e),e.remove(),e.classList.contains("active")&&(o=i.activeItems.indexOf(e),i.activeItems.splice(o,1),gt(e,"active")),i.items.splice(r,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(s)&&i.removeOption(s,t),r<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:t}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",s,e)}createItem(e=null,t=()=>{}){arguments.length===3&&(t=arguments[2]),typeof t!="function"&&(t=()=>{});var i=this,r=i.caretPos,o;if(e=e||i.inputValue(),!i.canCreate(e))return t(),!1;i.lock();var s=!1,a=l=>{if(i.unlock(),!l||typeof l!="object")return t();var c=We(l[i.settings.valueField]);if(typeof c!="string")return t();i.setTextboxValue(),i.addOption(l,!0),i.setCaret(r),i.addItem(c),t(l),s=!0};return typeof i.settings.create=="function"?o=i.settings.create.call(this,e,a):o={[i.settings.labelField]:e,[i.settings.valueField]:e},s||a(o),!0}refreshItems(){var e=this;e.lastQuery=null,e.isSetup&&e.addItems(e.items),e.updateOriginalInput(),e.refreshState()}refreshState(){let e=this;e.refreshValidityState();let t=e.isFull(),i=e.isLocked;e.wrapper.classList.toggle("rtl",e.rtl);let r=e.wrapper.classList;r.toggle("focus",e.isFocused),r.toggle("disabled",e.isDisabled),r.toggle("readonly",e.isReadOnly),r.toggle("required",e.isRequired),r.toggle("invalid",!e.isValid),r.toggle("locked",i),r.toggle("full",t),r.toggle("input-active",e.isFocused&&!e.isInputHidden),r.toggle("dropdown-active",e.isOpen),r.toggle("has-options",Xa(e.options)),r.toggle("has-items",e.items.length>0)}refreshValidityState(){var e=this;e.input.validity&&(e.isValid=e.input.validity.valid,e.isInvalid=!e.isValid)}isFull(){return this.settings.maxItems!==null&&this.items.length>=this.settings.maxItems}updateOriginalInput(e={}){let t=this;var i,r;let o=t.input.querySelector('option[value=""]');if(t.is_select_tag){let l=function(c,u,d){return c||(c=nt('<option value="'+ur(u)+'">'+ur(d)+"</option>")),c!=o&&t.input.append(c),s.push(c),(c!=o||a>0)&&(c.selected=!0),c},s=[],a=t.input.querySelectorAll("option:checked").length;t.input.querySelectorAll("option:checked").forEach(c=>{c.selected=!1}),t.items.length==0&&t.settings.mode=="single"?l(o,"",""):t.items.forEach(c=>{if(i=t.options[c],r=i[t.settings.labelField]||"",s.includes(i.$option)){let u=t.input.querySelector(`option[value="${Fo(c)}"]:not(:checked)`);l(u,c,r)}else i.$option=l(i.$option,c,r)})}else t.input.value=t.getValue();t.isSetup&&(e.silent||t.trigger("change",t.getValue()))}open(){var e=this;e.isLocked||e.isOpen||e.settings.mode==="multi"&&e.isFull()||(e.isOpen=!0,le(e.focus_node,{"aria-expanded":"true"}),e.refreshState(),ui(e.dropdown,{visibility:"hidden",display:"block"}),e.positionDropdown(),ui(e.dropdown,{visibility:"visible",display:"block"}),e.focus(),e.trigger("dropdown_open",e.dropdown))}close(e=!0){var t=this,i=t.isOpen;e&&(t.setTextboxValue(),t.settings.mode==="single"&&t.items.length&&t.inputState()),t.isOpen=!1,le(t.focus_node,{"aria-expanded":"false"}),ui(t.dropdown,{display:"none"}),t.settings.hideSelected&&t.clearActiveOption(),t.refreshState(),i&&t.trigger("dropdown_close",t.dropdown)}positionDropdown(){if(this.settings.dropdownParent==="body"){var e=this.control,t=e.getBoundingClientRect(),i=e.offsetHeight+t.top+window.scrollY,r=t.left+window.scrollX;ui(this.dropdown,{width:t.width+"px",top:i+"px",left:r+"px"})}}clear(e){var t=this;if(t.items.length){var i=t.controlChildren();ve(i,r=>{t.removeItem(r,!0)}),t.inputState(),e||t.updateOriginalInput(),t.trigger("clear")}}insertAtCaret(e){let t=this,i=t.caretPos,r=t.control;r.insertBefore(e,r.children[i]||null),t.setCaret(i+1)}deleteSelection(e){var t,i,r,o,s=this;t=e&&e.keyCode===8?-1:1,i=Ua(s.control_input);let a=[];if(s.activeItems.length)o=Bo(s.activeItems,t),r=Vo(o),t>0&&r++,ve(s.activeItems,l=>a.push(l));else if((s.isFocused||s.settings.mode==="single")&&s.items.length){let l=s.controlChildren(),c;t<0&&i.start===0&&i.length===0?c=l[s.caretPos-1]:t>0&&i.start===s.inputValue().length&&(c=l[s.caretPos]),c!==void 0&&a.push(c)}if(!s.shouldDelete(a,e))return!1;for(fe(e,!0),typeof r!="undefined"&&s.setCaret(r);a.length;)s.removeItem(a.pop());return s.inputState(),s.positionDropdown(),s.refreshOptions(!1),!0}shouldDelete(e,t){let i=e.map(r=>r.dataset.value);return!(!i.length||typeof this.settings.onDelete=="function"&&this.settings.onDelete(i,t)===!1)}advanceSelection(e,t){var i,r,o=this;o.rtl&&(e*=-1),!o.inputValue().length&&(kt(fi,t)||kt("shiftKey",t)?(i=o.getLastActive(e),i?i.classList.contains("active")?r=o.getAdjacent(i,e,"item"):r=i:e>0?r=o.control_input.nextElementSibling:r=o.control_input.previousElementSibling,r&&(r.classList.contains("active")&&o.removeActiveItem(i),o.setActiveItemClass(r))):o.moveCaret(e))}moveCaret(e){}getLastActive(e){let t=this.control.querySelector(".last-active");if(t)return t;var i=this.control.querySelectorAll(".active");if(i)return Bo(i,e)}setCaret(e){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(e=this.isReadOnly||this.isDisabled){this.isLocked=e,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(e){this.focus_node.tabIndex=e?-1:this.tabIndex,this.isDisabled=e,this.input.disabled=e,this.control_input.disabled=e,this.setLocked()}setReadOnly(e){this.isReadOnly=e,this.input.readOnly=e,this.control_input.readOnly=e,this.setLocked()}destroy(){var e=this,t=e.revertSettings;e.trigger("destroy"),e.off(),e.wrapper.remove(),e.dropdown.remove(),e.input.innerHTML=t.innerHTML,e.input.tabIndex=t.tabIndex,gt(e.input,"tomselected","ts-hidden-accessible"),e._destroy(),delete e.input.tomselect}render(e,t){var i,r;let o=this;if(typeof this.settings.render[e]!="function"||(r=o.settings.render[e].call(this,t,ur),!r))return null;if(r=nt(r),e==="option"||e==="option_create"?t[o.settings.disabledField]?le(r,{"aria-disabled":"true"}):le(r,{"data-selectable":""}):e==="optgroup"&&(i=t.group[o.settings.optgroupValueField],le(r,{"data-group":i}),t.group[o.settings.disabledField]&&le(r,{"data-disabled":""})),e==="option"||e==="item"){let s=ci(t[o.settings.valueField]);le(r,{"data-value":s}),e==="item"?(Pe(r,o.settings.itemClass),le(r,{"data-ts-item":""})):(Pe(r,o.settings.optionClass),le(r,{role:"option",id:t.$id}),t.$div=r,o.options[s]=t)}return r}_render(e,t){let i=this.render(e,t);if(i==null)throw"HTMLElement expected";return i}clearCache(){ve(this.options,e=>{e.$div&&(e.$div.remove(),delete e.$div)})}uncacheValue(e){let t=this.getOption(e);t&&t.remove()}canCreate(e){return this.settings.create&&e.length>0&&this.settings.createFilter.call(this,e)}hook(e,t,i){var r=this,o=r[t];r[t]=function(){var s,a;return e==="after"&&(s=o.apply(r,arguments)),a=i.apply(r,arguments),e==="instead"?a:(e==="before"&&(s=o.apply(r,arguments)),s)}}};var _m=(n,e,t,i)=>{n.addEventListener(e,t,i)};function nl(){_m(this.input,"change",()=>{this.sync()})}var wm=n=>typeof n=="undefined"||n===null?null:xm(n),xm=n=>typeof n=="boolean"?n?"1":"0":n+"",il=(n,e=!1)=>{n&&(n.preventDefault(),e&&n.stopPropagation())},Tm=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if(Cm(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},Cm=n=>typeof n=="string"&&n.indexOf("<")>-1;function rl(n){var e=this,t=e.onOptionSelect;e.settings.hideSelected=!1;let i=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},n);var r=function(a,l){l?(a.checked=!0,i.uncheckedClassNames&&a.classList.remove(...i.uncheckedClassNames),i.checkedClassNames&&a.classList.add(...i.checkedClassNames)):(a.checked=!1,i.checkedClassNames&&a.classList.remove(...i.checkedClassNames),i.uncheckedClassNames&&a.classList.add(...i.uncheckedClassNames))},o=function(a){setTimeout(()=>{var l=a.querySelector("input."+i.className);l instanceof HTMLInputElement&&r(l,a.classList.contains("selected"))},1)};e.hook("after","setupTemplates",()=>{var s=e.settings.render.option;e.settings.render.option=(a,l)=>{var c=Tm(s.call(e,a,l)),u=document.createElement("input");i.className&&u.classList.add(i.className),u.addEventListener("click",function(p){il(p)}),u.type="checkbox";let d=wm(a[e.settings.valueField]);return r(u,!!(d&&e.items.indexOf(d)>-1)),c.prepend(u),c}}),e.on("item_remove",s=>{var a=e.getOption(s);a&&(a.classList.remove("selected"),o(a))}),e.on("item_add",s=>{var a=e.getOption(s);a&&o(a)}),e.hook("instead","onOptionSelect",(s,a)=>{if(a.classList.contains("selected")){a.classList.remove("selected"),e.removeItem(a.dataset.value),e.refreshOptions(),il(s,!0);return}t.call(e,s,a),o(a)})}var Am=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if(Sm(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},Sm=n=>typeof n=="string"&&n.indexOf("<")>-1;function ol(n){let e=this,t=Object.assign({className:"clear-button",title:"Clear All",html:i=>`<div class="${i.className}" title="${i.title}">&#10799;</div>`},n);e.on("initialize",()=>{var i=Am(t.html(t));i.addEventListener("click",r=>{e.isLocked||(e.clear(),e.settings.mode==="single"&&e.settings.allowEmptyOption&&e.addItem(""),r.preventDefault(),r.stopPropagation())}),e.control.appendChild(i)})}var Dm=(n,e=!1)=>{n&&(n.preventDefault(),e&&n.stopPropagation())},Dn=(n,e,t,i)=>{n.addEventListener(e,t,i)},Om=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},Lm=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if(Mm(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},Mm=n=>typeof n=="string"&&n.indexOf("<")>-1,km=(n,e)=>{Om(e,(t,i)=>{t==null?n.removeAttribute(i):n.setAttribute(i,""+t)})},Nm=(n,e)=>{var t;(t=n.parentNode)==null||t.insertBefore(e,n.nextSibling)},Rm=(n,e)=>{var t;(t=n.parentNode)==null||t.insertBefore(e,n)},Hm=(n,e)=>{do{var t;if(e=(t=e)==null?void 0:t.previousElementSibling,n==e)return!0}while(e&&e.previousElementSibling);return!1};function sl(){var n=this;if(n.settings.mode!=="multi")return;var e=n.lock,t=n.unlock;let i=!0,r;n.hook("after","setupTemplates",()=>{var o=n.settings.render.item;n.settings.render.item=(s,a)=>{let l=Lm(o.call(n,s,a));km(l,{draggable:"true"});let c=y=>{i||Dm(y),y.stopPropagation()},u=y=>{r=l,setTimeout(()=>{l.classList.add("ts-dragging")},0)},d=y=>{y.preventDefault(),l.classList.add("ts-drag-over"),v(l,r)},p=()=>{l.classList.remove("ts-drag-over")},v=(y,x)=>{x!==void 0&&(Hm(x,l)?Nm(y,x):Rm(y,x))},g=()=>{var y;document.querySelectorAll(".ts-drag-over").forEach(T=>T.classList.remove("ts-drag-over")),(y=r)==null||y.classList.remove("ts-dragging"),r=void 0;var x=[];n.control.querySelectorAll("[data-value]").forEach(T=>{if(T.dataset.value){let _=T.dataset.value;_&&x.push(_)}}),n.setValue(x)};return Dn(l,"mousedown",c),Dn(l,"dragstart",u),Dn(l,"dragenter",d),Dn(l,"dragover",d),Dn(l,"dragleave",p),Dn(l,"dragend",g),l}}),n.hook("instead","lock",()=>(i=!1,e.call(n))),n.hook("instead","unlock",()=>(i=!0,t.call(n)))}var Im=(n,e=!1)=>{n&&(n.preventDefault(),e&&n.stopPropagation())},Pm=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if(Fm(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},Fm=n=>typeof n=="string"&&n.indexOf("<")>-1;function al(n){let e=this,t=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:i=>'<div class="'+i.headerClass+'"><div class="'+i.titleRowClass+'"><span class="'+i.labelClass+'">'+i.title+'</span><a class="'+i.closeClass+'">&times;</a></div></div>'},n);e.on("initialize",()=>{var i=Pm(t.html(t)),r=i.querySelector("."+t.closeClass);r&&r.addEventListener("click",o=>{Im(o,!0),e.close()}),e.dropdown.insertBefore(i,e.dropdown.firstChild)})}var $m=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},Bm=(n,...e)=>{var t=Vm(e);n=zm(n),n.map(i=>{t.map(r=>{i.classList.remove(r)})})},Vm=n=>{var e=[];return $m(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},zm=n=>(Array.isArray(n)||(n=[n]),n),jm=(n,e)=>{if(!n)return-1;e=e||n.nodeName;for(var t=0;n=n.previousElementSibling;)n.matches(e)&&t++;return t};function ll(){var n=this;n.hook("instead","setCaret",e=>{n.settings.mode==="single"||!n.control.contains(n.control_input)?e=n.items.length:(e=Math.max(0,Math.min(n.items.length,e)),e!=n.caretPos&&!n.isPending&&n.controlChildren().forEach((t,i)=>{i<e?n.control_input.insertAdjacentElement("beforebegin",t):n.control.appendChild(t)})),n.caretPos=e}),n.hook("instead","moveCaret",e=>{if(!n.isFocused)return;let t=n.getLastActive(e);if(t){let i=jm(t);n.setCaret(e>0?i+1:i),n.setActiveItem(),Bm(t,"last-active")}else n.setCaret(n.caretPos+e)})}var Wm=(n,e=!1)=>{n&&(n.preventDefault(),e&&n.stopPropagation())},qm=(n,e,t,i)=>{n.addEventListener(e,t,i)},Um=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},cl=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if(Ym(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},Ym=n=>typeof n=="string"&&n.indexOf("<")>-1,Gm=(n,...e)=>{var t=Km(e);n=Xm(n),n.map(i=>{t.map(r=>{i.classList.add(r)})})},Km=n=>{var e=[];return Um(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},Xm=n=>(Array.isArray(n)||(n=[n]),n);function ul(){let n=this;n.settings.shouldOpen=!0,n.hook("before","setup",()=>{n.focus_node=n.control,Gm(n.control_input,"dropdown-input");let e=cl('<div class="dropdown-input-wrap">');e.append(n.control_input),n.dropdown.insertBefore(e,n.dropdown.firstChild);let t=cl('<input class="items-placeholder" tabindex="-1" />');t.placeholder=n.settings.placeholder||"",n.control.append(t)}),n.on("initialize",()=>{n.control_input.addEventListener("keydown",t=>{switch(t.keyCode){case 27:n.isOpen&&(Wm(t,!0),n.close()),n.clearActiveItems();return;case 9:n.focus_node.tabIndex=-1;break}return n.onKeyDown.call(n,t)}),n.on("blur",()=>{n.focus_node.tabIndex=n.isDisabled?-1:n.tabIndex}),n.on("dropdown_open",()=>{n.control_input.focus()});let e=n.onBlur;n.hook("instead","onBlur",t=>{if(!(t&&t.relatedTarget==n.control_input))return e.call(n)}),qm(n.control_input,"blur",()=>n.onBlur()),n.hook("before","close",()=>{n.isOpen&&n.focus_node.focus({preventScroll:!0})})})}var mr=(n,e,t,i)=>{n.addEventListener(e,t,i)};function dl(){var n=this;n.on("initialize",()=>{var e=document.createElement("span"),t=n.control_input;e.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",n.wrapper.appendChild(e);var i=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(let o of i)e.style[o]=t.style[o];var r=()=>{e.textContent=t.value,t.style.width=e.clientWidth+"px"};r(),n.on("update item_add item_remove",r),mr(t,"input",r),mr(t,"keyup",r),mr(t,"blur",r),mr(t,"update",r)})}function fl(){var n=this,e=n.deleteSelection;this.hook("instead","deleteSelection",t=>n.activeItems.length?e.call(n,t):!1)}function hl(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}var Qm=(n,e,t)=>{for(;n&&n.matches;){if(n.matches(e))return n;n=n.parentNode}},Jm=(n,e)=>{if(!n)return-1;e=e||n.nodeName;for(var t=0;n=n.previousElementSibling;)n.matches(e)&&t++;return t};function pl(){var n=this,e=n.onKeyDown;n.hook("instead","onKeyDown",t=>{var i,r,o,s;if(!n.isOpen||!(t.keyCode===37||t.keyCode===39))return e.call(n,t);n.ignoreHover=!0,s=Qm(n.activeOption,"[data-group]"),i=Jm(n.activeOption,"[data-selectable]"),s&&(t.keyCode===37?s=s.previousSibling:s=s.nextSibling,s&&(o=s.querySelectorAll("[data-selectable]"),r=o[Math.min(o.length-1,i)],r&&n.setActiveOption(r)))})}var Zm=n=>(n+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),ml=(n,e=!1)=>{n&&(n.preventDefault(),e&&n.stopPropagation())},gl=(n,e,t,i)=>{n.addEventListener(e,t,i)},vl=n=>{if(n.jquery)return n[0];if(n instanceof HTMLElement)return n;if(eg(n)){var e=document.createElement("template");return e.innerHTML=n.trim(),e.content.firstChild}return document.querySelector(n)},eg=n=>typeof n=="string"&&n.indexOf("<")>-1;function yl(n){let e=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},n);var t=this;if(e.append){var i='<a href="javascript:void(0)" class="'+e.className+'" tabindex="-1" title="'+Zm(e.title)+'">'+e.label+"</a>";t.hook("after","setupTemplates",()=>{var r=t.settings.render.item;t.settings.render.item=(o,s)=>{var a=vl(r.call(t,o,s)),l=vl(i);return a.appendChild(l),gl(l,"mousedown",c=>{ml(c,!0)}),gl(l,"click",c=>{t.isLocked||(ml(c,!0),!t.isLocked&&t.shouldDelete([a],c)&&(t.removeItem(a),t.refreshOptions(!1),t.inputState()))}),a}})}}function El(n){let e=this,t=Object.assign({text:i=>i[e.settings.labelField]},n);e.on("item_remove",function(i){if(e.isFocused&&e.control_input.value.trim()===""){var r=e.options[i];r&&e.setTextboxValue(t.text.call(e,r))}})}var tg=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},ng=(n,...e)=>{var t=ig(e);n=rg(n),n.map(i=>{t.map(r=>{i.classList.add(r)})})},ig=n=>{var e=[];return tg(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},rg=n=>(Array.isArray(n)||(n=[n]),n);function bl(){let n=this,e=n.canLoad,t=n.clearActiveOption,i=n.loadCallback;var r={},o,s=!1,a,l=[];if(n.settings.shouldLoadMore||(n.settings.shouldLoadMore=()=>{if(o.clientHeight/(o.scrollHeight-o.scrollTop)>.9)return!0;if(n.activeOption){var p=n.selectable(),v=Array.from(p).indexOf(n.activeOption);if(v>=p.length-2)return!0}return!1}),!n.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";n.settings.sortField=[{field:"$order"},{field:"$score"}];let c=d=>typeof n.settings.maxOptions=="number"&&o.children.length>=n.settings.maxOptions?!1:!!(d in r&&r[d]),u=(d,p)=>n.items.indexOf(p)>=0||l.indexOf(p)>=0;n.setNextUrl=(d,p)=>{r[d]=p},n.getUrl=d=>{if(d in r){let p=r[d];return r[d]=!1,p}return n.clearPagination(),n.settings.firstUrl.call(n,d)},n.clearPagination=()=>{r={}},n.hook("instead","clearActiveOption",()=>{if(!s)return t.call(n)}),n.hook("instead","canLoad",d=>d in r?c(d):e.call(n,d)),n.hook("instead","loadCallback",(d,p)=>{if(!s)n.clearOptions(u);else if(a){let v=d[0];v!==void 0&&(a.dataset.value=v[n.settings.valueField])}i.call(n,d,p),s=!1}),n.hook("after","refreshOptions",()=>{let d=n.lastValue;var p;c(d)?(p=n.render("loading_more",{query:d}),p&&(p.setAttribute("data-selectable",""),a=p)):d in r&&!o.querySelector(".no-results")&&(p=n.render("no_more_results",{query:d})),p&&(ng(p,n.settings.optionClass),o.append(p))}),n.on("initialize",()=>{l=Object.keys(n.options),o=n.dropdown_content,n.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>'},n.settings.render),o.addEventListener("scroll",()=>{n.settings.shouldLoadMore.call(n)&&c(n.lastValue)&&(s||(s=!0,n.load.call(n,n.lastValue)))})})}_e.define("change_listener",nl);_e.define("checkbox_options",rl);_e.define("clear_button",ol);_e.define("drag_drop",sl);_e.define("dropdown_header",al);_e.define("caret_position",ll);_e.define("dropdown_input",ul);_e.define("input_autogrow",dl);_e.define("no_backspace_delete",fl);_e.define("no_active_items",hl);_e.define("optgroup_columns",pl);_e.define("remove_button",yl);_e.define("restore_on_backspace",El);_e.define("virtual_scroll",bl);var hi=_e;function tn(n){return"error"in n}function pe(n){let e=["","null","undefined"];return Array.isArray(n)?n.length>0:typeof n=="string"&&!e.includes(n)||typeof n=="number"||typeof n=="boolean"?!0:typeof n=="object"&&n!==null}function gr(n){return typeof n!==null&&typeof n!="undefined"}function og(n,e,t){return at(this,null,function*(){let i=window.CSRF_TOKEN,r=new Headers({"X-CSRFToken":i}),o;typeof t!="undefined"&&(o=JSON.stringify(t),r.set("content-type","application/json"));let s=yield fetch(n,{method:e,body:o,headers:r,credentials:"same-origin"}),a=s.headers.get("Content-Type");if(typeof a=="string"&&a.includes("text"))return{error:yield s.text()};let l=yield s.json();return!s.ok&&Array.isArray(l)?{error:l.join(`
`)}:!s.ok&&"detail"in l?{error:l.detail}:l})}function On(n,e){return at(this,null,function*(){return yield og(n,"PATCH",e)})}function*H(...n){for(let e of n)for(let t of document.querySelectorAll(e))t!==null&&(yield t)}function pi(n){return document.getElementById(n)}function _l(n,e=0){let t=e,i=document.getElementById("content-title");i!==null&&(t+=i.getBoundingClientRect().bottom);let r=n.getBoundingClientRect().top+window.pageYOffset+t;window.scrollTo({top:r,behavior:"smooth"})}function wl(n,e="select"){let t=[];for(let i of n.querySelectorAll(e))if(i!==null){let r={name:i.name,options:[]};for(let o of i.options)o.selected&&r.options.push(o.value);t=[...t,r]}return t}function nn(n,e,t){function i(o){return!!(typeof t=="string"&&o!==null&&o.matches(t))}function r(o){if(o!==null&&o.parentElement!==null&&!i(o)){for(let s of o.parentElement.querySelectorAll(e))if(s!==null)return s;return r(o.parentElement.parentElement)}return null}return r(n)}function jo(n,e,t=null,i=[]){let r=document.createElement(n);if(e!==null)for(let o of Object.keys(e)){let s=o,a=e[s];s in r&&(r[s]=a)}t!==null&&t.length>0&&r.classList.add(...t);for(let o of i)r.appendChild(o);return r}function Ln(n,e,t){if(typeof n!="string")throw new TypeError("replaceAll 'input' argument must be a string");if(typeof e!="string"&&!(e instanceof RegExp))throw new TypeError("replaceAll 'pattern' argument must be a string or RegExp instance");switch(typeof t){case"boolean":t=String(t);break;case"number":t=String(t);break;case"string":break;default:throw new TypeError("replaceAll 'replacement' argument must be stringifyable")}if(e instanceof RegExp){let i=Array.from(new Set([...e.flags.split(""),"g"])).join("");e=new RegExp(e.source,i)}else e=new RegExp(e,"g");return n.replace(e,t)}function sg(n,e){for(let i of H("select.select-all option"))i.selected=!0;let t=new Set;for(let i of e.querySelectorAll("*[name]"))i.validity.valid?i.classList.contains("is-invalid")&&i.classList.remove("is-invalid"):(t.add(i.name),i.classList.contains("is-invalid")||i.classList.add("is-invalid"));if(t.size!==0){let i=e.elements.namedItem(Array.from(t)[0]);_l(i),n.preventDefault()}}function xl(){for(let n of H("form")){let e=n.querySelectorAll("button[type=submit]");for(let i of e)i.addEventListener("click",r=>sg(r,n));let t=document.querySelector("button[data-reset-select]");t!==null&&t.addEventListener("click",()=>{window.location.assign(window.location.origin+window.location.pathname)})}}function Tl(){for(let e of H("a.set_field_value"))if(e!==null){let t=function(i){i.preventDefault();let r=e.getAttribute("data"),o=document.getElementById(e.target);o!==null&&r!==null&&(o.value=r)};var n=t;e.addEventListener("click",t)}}function vr(){for(let n of[xl,Tl])n()}window.Collapse=At;window.Modal=tt;window.Popover=Cn;window.Toast=pt;window.Tooltip=ht;function ag(){for(let n of H('[data-bs-toggle="tooltip"]'))new ht(n,{container:"body"})}function lg(){for(let n of H('[data-bs-toggle="modal"]'))new tt(n)}function Rt(n,e,t,i){let r="mdi-alert";switch(n){case"warning":r="mdi-alert";break;case"success":r="mdi-check-circle";break;case"info":r="mdi-information";break;case"danger":r="mdi-alert";break}let o=document.createElement("div");o.setAttribute("class","toast-container position-fixed bottom-0 end-0 m-3");let s=document.createElement("div");s.setAttribute("class",`toast bg-${n}`),s.setAttribute("role","alert"),s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true");let a=document.createElement("div");a.setAttribute("class",`toast-header bg-${n} text-body`);let l=document.createElement("i");l.setAttribute("class",`mdi ${r}`);let c=document.createElement("strong");c.setAttribute("class","me-auto ms-1"),c.innerText=e;let u=document.createElement("button");u.setAttribute("type","button"),u.setAttribute("class","btn-close"),u.setAttribute("data-bs-dismiss","toast"),u.setAttribute("aria-label","Close");let d=document.createElement("div");if(d.setAttribute("class","toast-body"),a.appendChild(l),a.appendChild(c),typeof i!="undefined"){let v=document.createElement("small");v.setAttribute("class","text-muted"),a.appendChild(v)}return a.appendChild(u),d.innerText=t.trim(),s.appendChild(a),s.appendChild(d),o.appendChild(s),document.body.appendChild(o),new pt(s)}function cg(){let{hash:n}=location;if(n&&n.match(/^#tab_.+$/)){let e=n.replace("tab_","");for(let t of H(`ul.nav.nav-tabs .nav-link[data-bs-target="${e}"]`))new Jt(t).show()}}function ug(){let n=document.querySelectorAll(".sidebar .accordion-item");function e(t){for(let i of n)i!==t?i.classList.remove("is-open"):i.classList.toggle("is-open")}for(let t of n)for(let i of t.querySelectorAll(".accordion-button"))i.addEventListener("click",()=>{e(t)})}function dg(){for(let n of H("a.image-preview")){let e=`${Math.round(window.innerWidth/4)}px`,t=jo("img",{src:n.href});t.style.maxWidth=e;let i=jo("div",null,null,[t]);new Cn(n,{customClass:"image-preview-popover",trigger:"hover",html:!0,content:i})}}function yr(){for(let n of[ag,lg,cg,dg,ug])n()}function Cl(n){let e=n.currentTarget,t=document.getElementById("quicksearch_clear");pe(t)&&(e.value===""?t.classList.add("invisible"):t.classList.remove("invisible"))}function Al(){let n=document.getElementById("export_current_view"),e=n==null?void 0:n.href.split("&")[0];n.setAttribute("href",e)}function fg(n){let e=n.currentTarget;if(Al(),e!=null){let t=document.getElementById("export_current_view"),i=`q=${e.value}`,r=(t==null?void 0:t.href)+"&"+i;t.setAttribute("href",r)}}function Sl(){let n=document.getElementById("quicksearch"),e=document.getElementById("quicksearch_clear");pe(n)&&(n.addEventListener("keyup",Cl,{passive:!0}),n.addEventListener("search",Cl,{passive:!0}),n.addEventListener("change",fg,{passive:!0}),pe(e)&&e.addEventListener("click",()=>at(null,null,function*(){let t=new Event("search");n.value="",yield new Promise(i=>setTimeout(i,100)),n.dispatchEvent(t),Al()}),{passive:!0}))}function mi(n){let e={};return n.required||(e.clear_button={html:t=>`<i class="mdi mdi-close-circle ${t.className}" title="${t.title}"></i>`}),n.hasAttribute("multiple")&&(e.remove_button={title:"Remove"}),{plugins:e}}function Dl(){for(let n of H("select:not(.tomselected):not(.no-ts):not([size]):not(.api-select):not(.color-select)"))new hi(n,ae(O({},mi(n)),{maxOptions:void 0}))}function Ol(){function n(e,t){return`<div><span class="dropdown-item-indicator color-label" style="background-color: #${t(e.value)}"></span> ${t(e.text)}</div>`}for(let e of H("select.color-select:not(.tomselected)"))new hi(e,ae(O({},mi(e)),{maxOptions:void 0,render:{option:n,item:n}}))}var Ll=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)};var Ml=(n,...e)=>{var t=hg(e);n=pg(n),n.map(i=>{t.map(r=>{i.classList.add(r)})})};var hg=n=>{var e=[];return Ll(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},pg=n=>(Array.isArray(n)||(n=[n]),n);var Ko={};ms(Ko,{exclude:()=>wg,extract:()=>Yo,parse:()=>Go,parseUrl:()=>Vl,pick:()=>jl,stringify:()=>Bl,stringifyUrl:()=>zl});var Rl="%[a-f0-9]{2}",kl=new RegExp("("+Rl+")|([^%]+?)","gi"),Nl=new RegExp("("+Rl+")+","gi");function Wo(n,e){try{return[decodeURIComponent(n.join(""))]}catch(r){}if(n.length===1)return n;e=e||1;let t=n.slice(0,e),i=n.slice(e);return Array.prototype.concat.call([],Wo(t),Wo(i))}function mg(n){try{return decodeURIComponent(n)}catch(e){let t=n.match(kl)||[];for(let i=1;i<t.length;i++)n=Wo(t,i).join(""),t=n.match(kl)||[];return n}}function gg(n){let e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=Nl.exec(n);for(;t;){try{e[t[0]]=decodeURIComponent(t[0])}catch(r){let o=mg(t[0]);o!==t[0]&&(e[t[0]]=o)}t=Nl.exec(n)}e["%C2"]="\uFFFD";let i=Object.keys(e);for(let r of i)n=n.replace(new RegExp(r,"g"),e[r]);return n}function qo(n){if(typeof n!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof n+"`");try{return decodeURIComponent(n)}catch(e){return gg(n)}}function Hl(n,e){let t={};if(Array.isArray(e))for(let i of e){let r=Object.getOwnPropertyDescriptor(n,i);r!=null&&r.enumerable&&Object.defineProperty(t,i,r)}else for(let i of Reflect.ownKeys(n)){let r=Object.getOwnPropertyDescriptor(n,i);if(r.enumerable){let o=n[i];e(i,o,n)&&Object.defineProperty(t,i,r)}}return t}function Er(n,e){if(!(typeof n=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n===""||e==="")return[];let t=n.indexOf(e);return t===-1?[]:[n.slice(0,t),n.slice(t+e.length)]}var vg=n=>n==null,yg=n=>encodeURIComponent(n).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Uo=Symbol("encodeFragmentIdentifier");function Eg(n){switch(n.arrayFormat){case"index":return e=>(t,i)=>{let r=t.length;return i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?[...t,[ye(e,n),"[",r,"]"].join("")]:[...t,[ye(e,n),"[",ye(r,n),"]=",ye(i,n)].join("")]};case"bracket":return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?[...t,[ye(e,n),"[]"].join("")]:[...t,[ye(e,n),"[]=",ye(i,n)].join("")];case"colon-list-separator":return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?[...t,[ye(e,n),":list="].join("")]:[...t,[ye(e,n),":list=",ye(i,n)].join("")];case"comma":case"separator":case"bracket-separator":{let e=n.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(i,r)=>r===void 0||n.skipNull&&r===null||n.skipEmptyString&&r===""?i:(r=r===null?"":r,i.length===0?[[ye(t,n),e,ye(r,n)].join("")]:[[i,ye(r,n)].join(n.arrayFormatSeparator)])}default:return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?[...t,ye(e,n)]:[...t,[ye(e,n),"=",ye(i,n)].join("")]}}function bg(n){let e;switch(n.arrayFormat){case"index":return(t,i,r)=>{if(e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!e){r[t]=i;return}r[t]===void 0&&(r[t]={}),r[t][e[1]]=i};case"bracket":return(t,i,r)=>{if(e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!e){r[t]=i;return}if(r[t]===void 0){r[t]=[i];return}r[t]=[...r[t],i]};case"colon-list-separator":return(t,i,r)=>{if(e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!e){r[t]=i;return}if(r[t]===void 0){r[t]=[i];return}r[t]=[...r[t],i]};case"comma":case"separator":return(t,i,r)=>{let o=typeof i=="string"&&i.includes(n.arrayFormatSeparator),s=typeof i=="string"&&!o&&vt(i,n).includes(n.arrayFormatSeparator);i=s?vt(i,n):i;let a=o||s?i.split(n.arrayFormatSeparator).map(l=>vt(l,n)):i===null?i:vt(i,n);r[t]=a};case"bracket-separator":return(t,i,r)=>{let o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o){r[t]=i&&vt(i,n);return}let s=i===null?[]:vt(i,n).split(n.arrayFormatSeparator);if(r[t]===void 0){r[t]=s;return}r[t]=[...r[t],...s]};default:return(t,i,r)=>{if(r[t]===void 0){r[t]=i;return}r[t]=[...[r[t]].flat(),i]}}}function Pl(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ye(n,e){return e.encode?e.strict?yg(n):encodeURIComponent(n):n}function vt(n,e){return e.decode?qo(n):n}function Fl(n){return Array.isArray(n)?n.sort():typeof n=="object"?Fl(Object.keys(n)).sort((e,t)=>Number(e)-Number(t)).map(e=>n[e]):n}function $l(n){let e=n.indexOf("#");return e!==-1&&(n=n.slice(0,e)),n}function _g(n){let e="",t=n.indexOf("#");return t!==-1&&(e=n.slice(t)),e}function Il(n,e,t){return t==="string"&&typeof n=="string"?n:typeof t=="function"&&typeof n=="string"?t(n):t==="string[]"&&e.arrayFormat!=="none"&&typeof n=="string"?[n]:t==="number[]"&&e.arrayFormat!=="none"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?[Number(n)]:t==="number"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):e.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":e.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):n}function Yo(n){n=$l(n);let e=n.indexOf("?");return e===-1?"":n.slice(e+1)}function Go(n,e){e=O({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null)},e),Pl(e.arrayFormatSeparator);let t=bg(e),i=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return i;for(let r of n.split("&")){if(r==="")continue;let o=e.decode?r.replaceAll("+"," "):r,[s,a]=Er(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:vt(a,e),t(vt(s,e),a,i)}for(let[r,o]of Object.entries(i))if(typeof o=="object"&&o!==null&&e.types[r]!=="string")for(let[s,a]of Object.entries(o)){let l=e.types[r]?e.types[r].replace("[]",""):void 0;o[s]=Il(a,e,l)}else typeof o=="object"&&o!==null&&e.types[r]==="string"?i[r]=Object.values(o).join(e.arrayFormatSeparator):i[r]=Il(o,e,e.types[r]);return e.sort===!1?i:(e.sort===!0?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce((r,o)=>{let s=i[o];return r[o]=s&&typeof s=="object"&&!Array.isArray(s)?Fl(s):s,r},Object.create(null))}function Bl(n,e){if(!n)return"";e=O({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),Pl(e.arrayFormatSeparator);let t=s=>e.skipNull&&vg(n[s])||e.skipEmptyString&&n[s]==="",i=Eg(e),r={};for(let[s,a]of Object.entries(n))t(s)||(r[s]=a);let o=Object.keys(r);return e.sort!==!1&&o.sort(e.sort),o.map(s=>{let a=n[s];return a===void 0?"":a===null?ye(s,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?ye(s,e)+"[]":a.reduce(i(s),[]).join("&"):ye(s,e)+"="+ye(a,e)}).filter(s=>s.length>0).join("&")}function Vl(n,e){var r,o;e=O({decode:!0},e);let[t,i]=Er(n,"#");return t===void 0&&(t=n),O({url:(o=(r=t==null?void 0:t.split("?"))==null?void 0:r[0])!=null?o:"",query:Go(Yo(n),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:vt(i,e)}:{})}function zl(n,e){e=O({encode:!0,strict:!0,[Uo]:!0},e);let t=$l(n.url).split("?")[0]||"",i=Yo(n.url),r=O(O({},Go(i,{sort:!1})),n.query),o=Bl(r,e);o&&(o=`?${o}`);let s=_g(n.url);if(typeof n.fragmentIdentifier=="string"){let a=new URL(t);a.hash=n.fragmentIdentifier,s=e[Uo]?a.hash:`#${n.fragmentIdentifier}`}return`${t}${o}${s}`}function jl(n,e,t){t=O({parseFragmentIdentifier:!0,[Uo]:!1},t);let{url:i,query:r,fragmentIdentifier:o}=Vl(n,t);return zl({url:i,query:Hl(r,e),fragmentIdentifier:o},t)}function wg(n,e,t){let i=Array.isArray(e)?r=>!e.includes(r):(r,o)=>!e(r,o);return jl(n,i,t)}var Wl=Ko;function ql(n){if(Array.isArray(n)){for(let e of n)if(typeof e=="object"&&e!==null&&"fieldName"in e&&"queryParam"in e)return typeof e.fieldName=="string"&&typeof e.queryParam=="string"}return!1}var br=class extends Map{queryParam(e){let t=this.get(e);return typeof t!="undefined"?t.queryParam:null}queryValue(e){let t=this.get(e);return typeof t!="undefined"?t.queryValue:[]}updateValue(e,t){let i=this.get(e);if(pe(i)){let{queryParam:r}=i;return this.set(e,{queryParam:r,queryValue:t}),!0}return!1}addFromJson(e){if(pe(e)){let t=JSON.parse(e);if(ql(t))for(let{queryParam:i,fieldName:r}of t)this.set(r,{queryParam:i,queryValue:[]});else throw new Error(`Data from 'data-dynamic-params' attribute is improperly formatted: '${e}'`)}}};var _r=class extends hi{constructor(t,i){super(t,i);ee(this,"nullOption",null);ee(this,"queryParams",new Map);ee(this,"staticParams",new Map);ee(this,"dynamicParams",new br);ee(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 r=this.input.getAttribute("data-null-option");if(r){let o=this.settings.valueField,s=this.settings.labelField;this.nullOption={},this.nullOption[o]="null",this.nullOption[s]=r}this.getStaticParams();for(let[o,s]of this.staticParams.entries())this.queryParams.set(o,s);this.getDynamicParams();for(let o of this.dynamicParams.keys())this.updateQueryParams(o);this.getPathKeys();for(let o of this.pathValues.keys())this.updatePathValues(o);this.addEventListeners()}load(t){let i=this;i.clearOptions(),i.nullOption&&!t&&i.addOption(i.nullOption);let r=i.getRequestUrl(t);r&&(Ml(i.wrapper,i.settings.loadingClass),i.loading++,fetch(r).then(o=>o.json()).then(o=>{let s=o.results,a=[];for(let l of s){let c=i.getOptionFromData(l);a.push(c)}return a}).then(o=>{i.loadCallback(o,[])}).catch(()=>{i.loadCallback([],[])}))}getRequestUrl(t){let i=this.api_url,r={};for(let[o,s]of this.queryParams.entries())r[o]=s;for(let[o,s]of this.pathValues.entries())for(let a of this.api_url.matchAll(new RegExp(`({{${o}}})`,"g")))if(s)i=Ln(i,a[1],s.toString());else return"";return t&&(r.q=[t]),r.brief=[!0],r.limit=[this.settings.maxOptions],Wl.stringifyUrl({url:i,query:r})}getOptionFromData(t){let i={id:t[this.valueField],display:t[this.labelField],depth:t[this.depthField]||null,description:t[this.descriptionField]||null};if(t[this.parentField]){let r=t[this.parentField];i.parent=r[this.labelField]}return t[this.countField]&&(i.count=t[this.countField]),t[this.disabledField]&&(i.disabled=t[this.disabledField]),i}getStaticParams(){let t=this.input.getAttribute("data-static-params");try{if(t){let i=JSON.parse(t);if(i)for(let{queryParam:r,queryValue:o}of i)Array.isArray(o)?this.staticParams.set(r,o):this.staticParams.set(r,[o])}}catch(i){console.group(`Unable to determine static query parameters for select field '${this.name}'`),console.warn(i),console.groupEnd()}}getDynamicParams(){let t=this.input.getAttribute("data-dynamic-params");try{this.dynamicParams.addFromJson(t)}catch(i){console.group(`Unable to determine dynamic query parameters for select field '${this.name}'`),console.warn(i),console.groupEnd()}}getPathKeys(){for(let t of this.api_url.matchAll(new RegExp("{{(.+)}}","g")))this.pathValues.set(t[1],"")}updateQueryParams(t){let i=document.querySelector(`[name="${t}"]`);if(i!==null){let r=[];if(i.multiple?r=Array.from(i.options).filter(o=>o.selected).map(o=>o.value):i.value!==""&&(r=[i.value]),r.length>0){this.dynamicParams.updateValue(t,r);let o=this.dynamicParams.get(t);if(typeof o!="undefined"){let{queryParam:s,queryValue:a}=o,l=[];if(this.staticParams.has(s)){let c=this.staticParams.get(s);typeof c!="undefined"&&(l=[...c,...a])}else l=a;l.length>0?this.queryParams.set(s,l):this.queryParams.delete(s)}}else{let o=this.dynamicParams.queryParam(t);o!==null&&this.queryParams.delete(o)}}}updatePathValues(t){let i=Ln(t,/^id_/i,""),r=pi(`id_${i}`);r!==null&&this.api_url.includes("{{")&&this.api_url.match(new RegExp(`({{(${t})}})`,"g"))&&(r.value?this.pathValues.set(t,r.value):this.pathValues.set(t,""))}addEventListeners(){let t=new Set([...this.dynamicParams.keys(),...this.pathValues.keys()]);for(let i of t){let r=document.querySelector(`[name="${i}"]`);r!==null&&r.addEventListener("change",o=>this.handleEvent(o)),this.input.addEventListener(`netbox.select.onload.${i}`,o=>this.handleEvent(o))}}handleEvent(t){let i=t.target;this.updateQueryParams(i.name),this.updatePathValues(i.name),this.clear(),this.load(this.lastValue)}};var xg="id",wr="display",Tg=100;function Cg(n,e){let t="<div>";return typeof n.depth=="number"&&n.depth>0&&(t=`${t}${"\u2500".repeat(n.depth)} `),t=`${t}${e(n[wr])}`,n.parent&&(t=`${t} <span class="text-secondary">${e(n.parent)}</span>`),n.count&&(t=`${t} <span class="badge">${e(n.count)}</span>`),n.description&&(t=`${t}<br /><small class="text-secondary">${e(n.description)}</small>`),t=`${t}</div>`,t}function Ag(n,e){return n.parent?`<div>${e(n.parent)} > ${e(n[wr])}</div>`:`<div>${e(n[wr])}<div>`}function Ul(){for(let n of H("select.api-select:not(.tomselected)"))new _r(n,ae(O({},mi(n)),{valueField:xg,labelField:wr,maxOptions:Tg,searchField:[],preload:"focus",render:{option:Cg,item:Ag},shouldLoad:function(){return!0}}))}function xr(){Dl(),Ul(),Ol()}function Yl(n,e){var r;let t=(r=n.parentElement)==null?void 0:r.parentElement,i=n.getAttribute("data-url");pe(i)&&On(i,{status:e}).then(o=>{if(tn(o)){Rt("danger","Error",o.error).show();return}else t.setAttribute("data-cable-status",e)})}function Gl(){for(let n of H("button.mark-planned"))n.addEventListener("click",()=>Yl(n,"planned"));for(let n of H("button.mark-installed"))n.addEventListener("click",()=>Yl(n,"connected"))}var Xo=class{set(e,t,i){return e[t]=i,!0}get(e,t){return e[t]}has(e,t){return t in e}},gi=class{constructor(e,t){ee(this,"handlers");ee(this,"proxy");ee(this,"options");ee(this,"key","");if(this.options=t,typeof this.options.key=="string"?this.key=this.options.key:this.key=this.generateStateKey(e),this.options.persist){let i=this.retrieve();i!==null&&(e=O(O({},e),i))}this.handlers=new Xo,this.proxy=new Proxy(e,this.handlers),this.options.persist&&this.save()}generateStateKey(e){return`netbox-${window.btoa(Object.keys(e).join("---"))}`}get(e){return this.handlers.get(this.proxy,e)}set(e,t){this.handlers.set(this.proxy,e,t),this.options.persist&&this.save()}all(){return this.proxy}keys(){return Object.keys(this.proxy)}values(){return Object.values(this.proxy)}save(){let e=JSON.stringify(this.proxy);localStorage.setItem(this.key,e)}retrieve(){let e=localStorage.getItem(this.key);return e!==null?JSON.parse(e):null}};function Ht(n,e={}){return new gi(n,e)}var Qo=Ht({hidden:!1},{persist:!0,key:"netbox-object-depth"});var Jo=Ht({view:"images-and-labels"},{persist:!0});var Kl=Ht({element:null},{persist:!1});var Xl=Ht({hidden:!0},{persist:!0,key:"netbox-secret"});function Ql(n,e){e.setAttribute("data-depth-indicators",n?"hidden":"shown"),e.innerText=n?"Show Depth Indicators":"Hide Depth Indicators"}function Jl(){for(let n of H(".record-depth"))n.style.display=""}function Zl(){for(let n of H(".record-depth"))n.style.display="none"}function Sg(n,e){let t=n.get("hidden");n.set("hidden",!t);let i=n.get("hidden");i?Zl():Jl(),Ql(i,e)}function ec(){let n=Qo.get("hidden");for(let e of H("button.toggle-depth"))Ql(n,e),e.addEventListener("click",t=>{Sg(Qo,t.currentTarget)},!1);n?Zl():n||Jl()}function Dg(n){let e=Array.from(n.options);for(let t=1;t<e.length;t++){let i=e[t];i.selected&&(n.removeChild(i),n.insertBefore(i,n.options[t-1]))}}function Og(n){let e=Array.from(n.options);for(let t=e.length-2;t>=0;t--){let i=e[t];if(i.selected){let r=n.options[t+1];i=n.removeChild(i),r=n.replaceChild(i,r),n.insertBefore(r,i)}}}function tc(){for(let n of H("#move-option-up")){let e=n.getAttribute("data-target");if(e!==null)for(let t of H(`#${e}`))n.addEventListener("click",()=>Dg(t))}for(let n of H("#move-option-down")){let e=n.getAttribute("data-target");if(e!==null)for(let t of H(`#${e}`))n.addEventListener("click",()=>Og(t))}}function nc(n,e){return n.replace(/[^\-.\w\s]/g,"").replace(/^[\s.]+|[\s.]+$/g,"").replace(/[-.\s]+/g,"-").toLowerCase().substring(0,e)}function ic(){for(let n of H("button#reslug")){let e=n.form;if(e==null)continue;let t=e.querySelector("#id_slug");if(t==null)continue;let i=t.getAttribute("slug-source"),r=e.querySelector(`#id_${i}`),o=t.getAttribute("maxlength"),s=50;o&&(s=Number(o)),r.addEventListener("blur",()=>{t.value||(t.value=nc(r.value,s))}),n.addEventListener("click",()=>{t.value=nc(r.value,s)})}}function Lg(n){if(!n.currentTarget.checked)for(let t of H('input[type="checkbox"].toggle',"input#select-all"))t.checked=!1}function Mg(n){let e=n.currentTarget,t=nn(e,"table"),i=document.getElementById("select-all-box"),r=document.getElementById("select-all");if(t!==null){for(let o of t.querySelectorAll('tr:not(.d-none) input[type="checkbox"][name="pk"]'))e.checked?o.checked=!0:o.checked=!1;i!==null&&(e.checked?i.classList.remove("d-none"):(i.classList.add("d-none"),r!==null&&(r.checked=!1)))}}function rc(){for(let n of H('table tr th > input[type="checkbox"].toggle'))n.addEventListener("change",Mg);for(let n of H('input[type="checkbox"][name="pk"]'))n.addEventListener("change",Lg)}function oc(){let n=document.querySelector('input[type="checkbox"][name="pk"]:checked'),e=document.querySelector("div.form.form-horizontal div.btn-list");if(!e)return;let t=e.classList.contains("btn-float-group-left");n!==null&&!t?e.classList.add("btn-float-group-left"):n===null&&t&&e.classList.remove("btn-float-group-left")}function sc(){for(let n of H('input[type="checkbox"][name="pk"]'))n.addEventListener("change",()=>{oc()});for(let n of H('table tr th > input[type="checkbox"].toggle'))n.addEventListener("change",()=>{oc()})}function lc(){var n;(n=window.getSelection())==null||n.removeAllRanges()}function ac(n,e){e.set("element",n)}function kg(n,e,t){var r,o;let i=!1;for(let s of t){let a=s;if(i===!0&&((r=a.closest("tr"))!=null&&r.classList.contains("d-none")||(a.checked=n.checked)),s===e){if(i===!0){i=!1;return}i=!0,(o=a.closest("tr"))!=null&&o.classList.contains("d-none")||(a.checked=n.checked)}if(s===n){if(i===!0){i=!1;return}i=!0}}}function Ng(n,e){let t=n.target,i=e.get("element");if(ac(t,e),!n.shiftKey)return;if(lc(),i===null)return ac(t,e);let r=H('input[type="checkbox"][name="pk"]');kg(t,i,r)}function cc(){let n=H('input[type="checkbox"][name="pk"]');for(let e of n)e.addEventListener("click",t=>{lc(),t.stopPropagation(),Ng(t,Kl)})}function Rg(n){let e=n.querySelector("button.preview-button"),t=n.querySelector("textarea"),i=n.querySelector("div.preview");if(!pe(t.style.height)){let{height:r}=t.getBoundingClientRect();t.style.height=`${r}px`}e.addEventListener("htmx:configRequest",r=>{r.detail.parameters={text:t.value||""},r.detail.headers["X-CSRFToken"]=window.CSRF_TOKEN,i.style.minHeight=t.style.height,i.innerHTML=""})}function uc(){for(let n of document.querySelectorAll(".markdown-widget"))Rg(n)}function Hg(n,e){e.setAttribute("data-secret-visibility",n?"hidden":"shown"),e.innerText=n?"Show Secret":"Hide Secret"}function Ig(){let n=pi("secret");if(pe(n)){let e=n.getAttribute("data-secret");pe(e)&&(n.innerText=e)}}function fc(){let n=pi("secret");if(pe(n)){let e=n.getAttribute("data-secret");pe(e)&&(n.innerText="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022")}}function Pg(n,e){n.set("hidden",!n.get("hidden"));let t=n.get("hidden");t?fc():Ig(),Hg(t,e)}function dc(n){Pg(Xl,n.currentTarget)}function hc(){fc();for(let n of H("button.toggle-secret"))n.removeEventListener("click",dc),n.addEventListener("click",dc)}function Tr(){for(let n of[ec,Gl,ic,rc,cc,sc,tc,uc,hc])n()}var Zo="netbox-color-mode";function Fg(n){return n==="dark"||n==="light"}function $g(n){return localStorage.setItem(Zo,n)}function Bg(n){var t,i;let e=document.querySelector("body");e&&n=="dark"?e.setAttribute("data-bs-theme","dark"):e&&e.setAttribute("data-bs-theme","light");for(let r of H(".rack_elevation")){let o=(i=(t=r.contentDocument)==null?void 0:t.querySelector("svg"))!=null?i:null;o!==null&&o.setAttribute("data-bs-theme",n)}}function It(n){$g(n),Bg(n)}function Vg(){let n=localStorage.getItem(Zo);n==="light"?It("dark"):n==="dark"?It("light"):console.warn("Unable to determine the current color mode")}function zg(){let n=localStorage.getItem(Zo);if(pe(n))return It(n);let e="none";for(let t of["dark","light"])if(window.matchMedia(`(prefers-color-scheme: ${t})`).matches){e=t;break}if(pe(n)&&Fg(n))return It(n);switch(e){case"dark":return It("dark");case"light":return It("light");case"none":return It("light");default:return It("light")}}function jg(){for(let n of H("button.color-mode-toggle"))n.addEventListener("click",Vg)}function pc(){window.addEventListener("load",zg);for(let n of[jg])n()}function Cr(){let n=document.querySelectorAll("body > div#django-messages > div.toast");for(let e of n)if(e!==null){let t=new pt(e);t.isShown()||t.show()}}var gc=cu(mc());function Ar(){for(let n of H(".copy-content"))new gc.default(n)}var Sr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Pt={_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(n){return typeof console!="undefined"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.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 Dr={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(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%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},Or=Dr;var De=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Fe=function(n){return n===!0?1:0};function ts(n,e){var t;return function(){var i=this,r=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,r)},e)}}var Lr=function(n){return n instanceof Array?n:[n]};function Oe(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function te(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function yi(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function ns(n,e){if(e(n))return n;if(n.parentNode)return ns(n.parentNode,e)}function Ei(n,e){var t=te("div","numInputWrapper"),i=te("input","numInput "+n),r=te("span","arrowUp"),o=te("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var s in e)i.setAttribute(s,e[s]);return t.appendChild(i),t.appendChild(r),t.appendChild(o),t}function $e(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch(t){return n.target}}var is=function(){},bi=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},vc={D:is,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Fe(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),r=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return r.setDate(r.getDate()-r.getDay()+t.firstDayOfWeek),r},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:is,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:is,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},yt={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})"},Mn={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[Mn.w(n,e,t)]},F:function(n,e,t){return bi(Mn.n(n,e,t)-1,!1,e)},G:function(n,e,t){return De(Mn.h(n,e,t))},H:function(n){return De(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Fe(n.getHours()>11)]},M:function(n,e){return bi(n.getMonth(),!0,e)},S:function(n){return De(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return De(n.getFullYear(),4)},d:function(n){return De(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return De(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return De(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}};var rs=function(n){var e=n.config,t=e===void 0?Pt:e,i=n.l10n,r=i===void 0?Dr:i,o=n.isMobile,s=o===void 0?!1:o;return function(a,l,c){var u=c||r;return t.formatDate!==void 0&&!s?t.formatDate(a,l,u):l.split("").map(function(d,p,v){return Mn[d]&&v[p-1]!=="\\"?Mn[d](a,u,t):d!=="\\"?d:""}).join("")}},Mr=function(n){var e=n.config,t=e===void 0?Pt:e,i=n.l10n,r=i===void 0?Dr:i;return function(o,s,a,l){if(!(o!==0&&!o)){var c=l||r,u,d=o;if(o instanceof Date)u=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)u=new Date(o);else if(typeof o=="string"){var p=s||(t||Pt).dateFormat,v=String(o).trim();if(v==="today")u=new Date,a=!0;else if(t&&t.parseDate)u=t.parseDate(o,p);else if(/Z$/.test(v)||/GMT$/.test(v))u=new Date(o);else{for(var g=void 0,y=[],x=0,T=0,_="";x<p.length;x++){var A=p[x],M=A==="\\",G=p[x-1]==="\\"||M;if(yt[A]&&!G){_+=yt[A];var F=new RegExp(_).exec(o);F&&(g=!0)&&y[A!=="Y"?"push":"unshift"]({fn:vc[A],val:F[++T]})}else M||(_+=".")}u=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),y.forEach(function(D){var L=D.fn,N=D.val;return u=L(u,N,c)||u}),u=g?u:void 0}}if(!(u instanceof Date&&!isNaN(u.getTime()))){t.errorHandler(new Error("Invalid date provided: "+d));return}return a===!0&&u.setHours(0,0,0,0),u}}};function Be(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var yc=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},kr=function(n,e,t){return n*3600+e*60+t},Ec=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},bc={DAY:864e5};function Nr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var r=n.minDate.getHours(),o=n.minDate.getMinutes(),s=n.minDate.getSeconds();e<r&&(e=r),e===r&&t<o&&(t=o),e===r&&t===o&&i<s&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var a=n.maxDate.getHours(),l=n.maxDate.getMinutes();e=Math.min(e,a),e===a&&(t=Math.min(l,t)),e===a&&t===l&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(a){a&&Object.keys(a).forEach(function(l){return n[l]=a[l]})},r=0,o=e;r<o.length;r++){var s=o[r];i(s)}return n});var Le=function(){return Le=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Le.apply(this,arguments)},_c=function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),r=0,e=0;e<t;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i},Wg=300;function qg(n,e){var t={config:Le(Le({},Pt),Ee.defaultConfig),l10n:Or};t.parseDate=Mr({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=y,t._setHoursFromDate=p,t._positionCalendar=an,t.changeMonth=k,t.changeYear=Z,t.clear=S,t.close=V,t.onMouseOver=sn,t._createElement=te,t.createDay=F,t.destroy=z,t.isEnabled=oe,t.jumpToDate=_,t.updateValue=st,t.open=Br,t.redraw=Bn,t.set=Di,t.setDate=Oi,t.toggle=Vc;function i(){t.utils={getDaysInMonth:function(f,h){return f===void 0&&(f=t.currentMonth),h===void 0&&(h=t.currentYear),f===1&&(h%4===0&&h%100!==0||h%400===0)?29:t.l10n.daysInMonth[f]}}}function r(){t.element=t.input=n,t.isOpen=!1,Ai(),Si(),$c(),Fc(),i(),t.isMobile||G(),T(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&p(t.config.noCalendar?t.latestSelectedDateObj:void 0),st(!1)),a();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&f&&an(),ue("onReady")}function o(){var f;return((f=t.calendarContainer)===null||f===void 0?void 0:f.getRootNode()).activeElement||document.activeElement}function s(f){return f.bind(t)}function a(){var f=t.config;f.weekNumbers===!1&&f.showMonths===1||f.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var h=(t.days.offsetWidth+1)*f.showMonths;t.daysContainer.style.width=h+"px",t.calendarContainer.style.width=h+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function l(f){if(t.selectedDates.length===0){var h=t.config.minDate===void 0||Be(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),m=Nr(t.config);h.setHours(m.hours,m.minutes,m.seconds,h.getMilliseconds()),t.selectedDates=[h],t.latestSelectedDateObj=h}f!==void 0&&f.type!=="blur"&&Wc(f);var b=t._input.value;d(),st(),t._input.value!==b&&t._debouncedChange()}function c(f,h){return f%12+12*Fe(h===t.l10n.amPM[1])}function u(f){switch(f%24){case 0:case 12:return 12;default:return f%12}}function d(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var f=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,h=(parseInt(t.minuteElement.value,10)||0)%60,m=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(f=c(f,t.amPM.textContent));var b=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Be(t.latestSelectedDateObj,t.config.minDate,!0)===0,C=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Be(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var R=kr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),X=kr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),P=kr(f,h,m);if(P>X&&P<R){var Q=Ec(R);f=Q[0],h=Q[1],m=Q[2]}}else{if(C){var I=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;f=Math.min(f,I.getHours()),f===I.getHours()&&(h=Math.min(h,I.getMinutes())),h===I.getMinutes()&&(m=Math.min(m,I.getSeconds()))}if(b){var K=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;f=Math.max(f,K.getHours()),f===K.getHours()&&h<K.getMinutes()&&(h=K.getMinutes()),h===K.getMinutes()&&(m=Math.max(m,K.getSeconds()))}}v(f,h,m)}}function p(f){var h=f||t.latestSelectedDateObj;h&&h instanceof Date&&v(h.getHours(),h.getMinutes(),h.getSeconds())}function v(f,h,m){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(f%24,h,m||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=De(t.config.time_24hr?f:(12+f)%12+12*Fe(f%12===0)),t.minuteElement.value=De(h),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Fe(f>=12)]),t.secondElement!==void 0&&(t.secondElement.value=De(m)))}function g(f){var h=$e(f),m=parseInt(h.value)+(f.delta||0);(m/1e3>1||f.key==="Enter"&&!/[^\d]/.test(m.toString()))&&Z(m)}function y(f,h,m,b){if(h instanceof Array)return h.forEach(function(C){return y(f,C,m,b)});if(f instanceof Array)return f.forEach(function(C){return y(C,h,m,b)});f.addEventListener(h,m,b),t._handlers.push({remove:function(){return f.removeEventListener(h,m,b)}})}function x(){ue("onChange")}function T(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(m){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+m+"]"),function(b){return y(b,"click",t[m])})}),t.isMobile){Bc();return}var f=ts(Ti,50);if(t._debouncedChange=ts(x,Wg),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&y(t.daysContainer,"mouseover",function(m){t.config.mode==="range"&&sn($e(m))}),y(t._input,"keydown",on),t.calendarContainer!==void 0&&y(t.calendarContainer,"keydown",on),!t.config.inline&&!t.config.static&&y(window,"resize",f),window.ontouchstart!==void 0?y(window.document,"touchstart",U):y(window.document,"mousedown",U),y(window.document,"focus",U,{capture:!0}),t.config.clickOpens===!0&&(y(t._input,"focus",t.open),y(t._input,"click",t.open)),t.daysContainer!==void 0&&(y(t.monthNav,"click",jc),y(t.monthNav,["keyup","increment"],g),y(t.daysContainer,"click",un)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var h=function(m){return $e(m).select()};y(t.timeContainer,["increment"],l),y(t.timeContainer,"blur",l,{capture:!0}),y(t.timeContainer,"click",A),y([t.hourElement,t.minuteElement],["focus","click"],h),t.secondElement!==void 0&&y(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&y(t.amPM,"click",function(m){l(m)})}t.config.allowInput&&y(t._input,"blur",$r)}function _(f,h){var m=f!==void 0?t.parseDate(f):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),b=t.currentYear,C=t.currentMonth;try{m!==void 0&&(t.currentYear=m.getFullYear(),t.currentMonth=m.getMonth())}catch(R){R.message="Invalid date supplied: "+m,t.config.errorHandler(R)}h&&t.currentYear!==b&&(ue("onYearChange"),J()),h&&(t.currentYear!==b||t.currentMonth!==C)&&ue("onMonthChange"),t.redraw()}function A(f){var h=$e(f);~h.className.indexOf("arrow")&&M(f,h.classList.contains("arrowUp")?1:-1)}function M(f,h,m){var b=f&&$e(f),C=m||b&&b.parentNode&&b.parentNode.firstChild,R=Vr("increment");R.delta=h,C&&C.dispatchEvent(R)}function G(){var f=window.document.createDocumentFragment();if(t.calendarContainer=te("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(f.appendChild(se()),t.innerContainer=te("div","flatpickr-innerContainer"),t.config.weekNumbers){var h=W(),m=h.weekWrapper,b=h.weekNumbers;t.innerContainer.appendChild(m),t.weekNumbers=b,t.weekWrapper=m}t.rContainer=te("div","flatpickr-rContainer"),t.rContainer.appendChild(qe()),t.daysContainer||(t.daysContainer=te("div","flatpickr-days"),t.daysContainer.tabIndex=-1),ie(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),f.appendChild(t.innerContainer)}t.config.enableTime&&f.appendChild(ne()),Oe(t.calendarContainer,"rangeMode",t.config.mode==="range"),Oe(t.calendarContainer,"animate",t.config.animate===!0),Oe(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(f);var C=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!C&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var R=te("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(R,t.element),R.appendChild(t.element),t.altInput&&R.appendChild(t.altInput),R.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function F(f,h,m,b){var C=oe(h,!0),R=te("span",f,h.getDate().toString());return R.dateObj=h,R.$i=b,R.setAttribute("aria-label",t.formatDate(h,t.config.ariaDateFormat)),f.indexOf("hidden")===-1&&Be(h,t.now)===0&&(t.todayDateElem=R,R.classList.add("today"),R.setAttribute("aria-current","date")),C?(R.tabIndex=-1,zr(h)&&(R.classList.add("selected"),t.selectedDateElem=R,t.config.mode==="range"&&(Oe(R,"startRange",t.selectedDates[0]&&Be(h,t.selectedDates[0],!0)===0),Oe(R,"endRange",t.selectedDates[1]&&Be(h,t.selectedDates[1],!0)===0),f==="nextMonthDay"&&R.classList.add("inRange")))):R.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zc(h)&&!zr(h)&&R.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&f!=="prevMonthDay"&&b%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(h)+"</span>"),ue("onDayCreate",R),R}function D(f){f.focus(),t.config.mode==="range"&&sn(f)}function L(f){for(var h=f>0?0:t.config.showMonths-1,m=f>0?t.config.showMonths:-1,b=h;b!=m;b+=f)for(var C=t.daysContainer.children[b],R=f>0?0:C.children.length-1,X=f>0?C.children.length:-1,P=R;P!=X;P+=f){var Q=C.children[P];if(Q.className.indexOf("hidden")===-1&&oe(Q.dateObj))return Q}}function N(f,h){for(var m=f.className.indexOf("Month")===-1?f.dateObj.getMonth():t.currentMonth,b=h>0?t.config.showMonths:-1,C=h>0?1:-1,R=m-t.currentMonth;R!=b;R+=C)for(var X=t.daysContainer.children[R],P=m-t.currentMonth===R?f.$i+h:h<0?X.children.length-1:0,Q=X.children.length,I=P;I>=0&&I<Q&&I!=(h>0?Q:-1);I+=C){var K=X.children[I];if(K.className.indexOf("hidden")===-1&&oe(K.dateObj)&&Math.abs(f.$i-I)>=Math.abs(h))return D(K)}t.changeMonth(C),Y(L(C),0)}function Y(f,h){var m=o(),b=bt(m||document.body),C=f!==void 0?f:b?m:t.selectedDateElem!==void 0&&bt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&bt(t.todayDateElem)?t.todayDateElem:L(h>0?1:-1);C===void 0?t._input.focus():b?N(C,h):D(C)}function B(f,h){for(var m=(new Date(f,h,1).getDay()-t.l10n.firstDayOfWeek+7)%7,b=t.utils.getDaysInMonth((h-1+12)%12,f),C=t.utils.getDaysInMonth(h,f),R=window.document.createDocumentFragment(),X=t.config.showMonths>1,P=X?"prevMonthDay hidden":"prevMonthDay",Q=X?"nextMonthDay hidden":"nextMonthDay",I=b+1-m,K=0;I<=b;I++,K++)R.appendChild(F("flatpickr-day "+P,new Date(f,h-1,I),I,K));for(I=1;I<=C;I++,K++)R.appendChild(F("flatpickr-day",new Date(f,h,I),I,K));for(var re=C+1;re<=42-m&&(t.config.showMonths===1||K%7!==0);re++,K++)R.appendChild(F("flatpickr-day "+Q,new Date(f,h+1,re%C),re,K));var it=te("div","dayContainer");return it.appendChild(R),it}function ie(){if(t.daysContainer!==void 0){yi(t.daysContainer),t.weekNumbers&&yi(t.weekNumbers);for(var f=document.createDocumentFragment(),h=0;h<t.config.showMonths;h++){var m=new Date(t.currentYear,t.currentMonth,1);m.setMonth(t.currentMonth+h),f.appendChild(B(m.getFullYear(),m.getMonth()))}t.daysContainer.appendChild(f),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&sn()}}function J(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var f=function(b){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&b<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&b>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var h=0;h<12;h++)if(f(h)){var m=te("option","flatpickr-monthDropdown-month");m.value=new Date(t.currentYear,h).getMonth().toString(),m.textContent=bi(h,t.config.shorthandCurrentMonth,t.l10n),m.tabIndex=-1,t.currentMonth===h&&(m.selected=!0),t.monthsDropdownContainer.appendChild(m)}}}function Te(){var f=te("div","flatpickr-month"),h=window.document.createDocumentFragment(),m;t.config.showMonths>1||t.config.monthSelectorType==="static"?m=te("span","cur-month"):(t.monthsDropdownContainer=te("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),y(t.monthsDropdownContainer,"change",function(X){var P=$e(X),Q=parseInt(P.value,10);t.changeMonth(Q-t.currentMonth),ue("onMonthChange")}),J(),m=t.monthsDropdownContainer);var b=Ei("cur-year",{tabindex:"-1"}),C=b.getElementsByTagName("input")[0];C.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&C.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(C.setAttribute("max",t.config.maxDate.getFullYear().toString()),C.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var R=te("div","flatpickr-current-month");return R.appendChild(m),R.appendChild(b),h.appendChild(R),f.appendChild(h),{container:f,yearElement:C,monthElement:m}}function Ce(){yi(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var f=t.config.showMonths;f--;){var h=Te();t.yearElements.push(h.yearElement),t.monthElements.push(h.monthElement),t.monthNav.appendChild(h.container)}t.monthNav.appendChild(t.nextMonthNav)}function se(){return t.monthNav=te("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=te("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=te("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,Ce(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(f){t.__hidePrevMonthArrow!==f&&(Oe(t.prevMonthNav,"flatpickr-disabled",f),t.__hidePrevMonthArrow=f)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(f){t.__hideNextMonthArrow!==f&&(Oe(t.nextMonthNav,"flatpickr-disabled",f),t.__hideNextMonthArrow=f)}}),t.currentYearElement=t.yearElements[0],Li(),t.monthNav}function ne(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var f=Nr(t.config);t.timeContainer=te("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var h=te("span","flatpickr-time-separator",":"),m=Ei("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=m.getElementsByTagName("input")[0];var b=Ei("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=b.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=De(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?f.hours:u(f.hours)),t.minuteElement.value=De(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():f.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(m),t.timeContainer.appendChild(h),t.timeContainer.appendChild(b),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var C=Ei("flatpickr-second");t.secondElement=C.getElementsByTagName("input")[0],t.secondElement.value=De(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():f.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(te("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(C)}return t.config.time_24hr||(t.amPM=te("span","flatpickr-am-pm",t.l10n.amPM[Fe((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function qe(){t.weekdayContainer?yi(t.weekdayContainer):t.weekdayContainer=te("div","flatpickr-weekdays");for(var f=t.config.showMonths;f--;){var h=te("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(h)}return He(),t.weekdayContainer}function He(){if(t.weekdayContainer){var f=t.l10n.firstDayOfWeek,h=_c(t.l10n.weekdays.shorthand);f>0&&f<h.length&&(h=_c(h.splice(f,h.length),h.splice(0,f)));for(var m=t.config.showMonths;m--;)t.weekdayContainer.children[m].innerHTML=`
<span class='flatpickr-weekday'>
`+h.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function W(){t.calendarContainer.classList.add("hasWeeks");var f=te("div","flatpickr-weekwrapper");f.appendChild(te("span","flatpickr-weekday",t.l10n.weekAbbreviation));var h=te("div","flatpickr-weeks");return f.appendChild(h),{weekWrapper:f,weekNumbers:h}}function k(f,h){h===void 0&&(h=!0);var m=h?f:f-t.currentMonth;m<0&&t._hidePrevMonthArrow===!0||m>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=m,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ue("onYearChange"),J()),ie(),ue("onMonthChange"),Li())}function S(f,h){if(f===void 0&&(f=!0),h===void 0&&(h=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,h===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var m=Nr(t.config),b=m.hours,C=m.minutes,R=m.seconds;v(b,C,R)}t.redraw(),f&&ue("onChange")}function V(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ue("onClose")}function z(){t.config!==void 0&&ue("onDestroy");for(var f=t._handlers.length;f--;)t._handlers[f].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var h=t.calendarContainer.parentNode;if(h.lastChild&&h.removeChild(h.lastChild),h.parentNode){for(;h.firstChild;)h.parentNode.insertBefore(h.firstChild,h);h.parentNode.removeChild(h)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.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(m){try{delete t[m]}catch(b){}})}function q(f){return t.calendarContainer.contains(f)}function U(f){if(t.isOpen&&!t.config.inline){var h=$e(f),m=q(h),b=h===t.input||h===t.altInput||t.element.contains(h)||f.path&&f.path.indexOf&&(~f.path.indexOf(t.input)||~f.path.indexOf(t.altInput)),C=!b&&!m&&!q(f.relatedTarget),R=!t.config.ignoredFocusElements.some(function(X){return X.contains(h)});C&&R&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&l(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function Z(f){if(!(!f||t.config.minDate&&f<t.config.minDate.getFullYear()||t.config.maxDate&&f>t.config.maxDate.getFullYear())){var h=f,m=t.currentYear!==h;t.currentYear=h||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),m&&(t.redraw(),ue("onYearChange"),J())}}function oe(f,h){var m;h===void 0&&(h=!0);var b=t.parseDate(f,void 0,h);if(t.config.minDate&&b&&Be(b,t.config.minDate,h!==void 0?h:!t.minDateHasTime)<0||t.config.maxDate&&b&&Be(b,t.config.maxDate,h!==void 0?h:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(b===void 0)return!1;for(var C=!!t.config.enable,R=(m=t.config.enable)!==null&&m!==void 0?m:t.config.disable,X=0,P=void 0;X<R.length;X++){if(P=R[X],typeof P=="function"&&P(b))return C;if(P instanceof Date&&b!==void 0&&P.getTime()===b.getTime())return C;if(typeof P=="string"){var Q=t.parseDate(P,void 0,!0);return Q&&Q.getTime()===b.getTime()?C:!C}else if(typeof P=="object"&&b!==void 0&&P.from&&P.to&&b.getTime()>=P.from.getTime()&&b.getTime()<=P.to.getTime())return C}return!C}function bt(f){return t.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(f):!1}function $r(f){var h=f.target===t._input,m=t._input.value.trimEnd()!==jr();h&&m&&!(f.relatedTarget&&q(f.relatedTarget))&&t.setDate(t._input.value,!0,f.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function on(f){var h=$e(f),m=t.config.wrap?n.contains(h):h===t._input,b=t.config.allowInput,C=t.isOpen&&(!b||!m),R=t.config.inline&&m&&!b;if(f.keyCode===13&&m){if(b)return t.setDate(t._input.value,!0,h===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),h.blur();t.open()}else if(q(h)||C||R){var X=!!t.timeContainer&&t.timeContainer.contains(h);switch(f.keyCode){case 13:X?(f.preventDefault(),l(),cn()):un(f);break;case 27:f.preventDefault(),cn();break;case 8:case 46:m&&!t.config.allowInput&&(f.preventDefault(),t.clear());break;case 37:case 39:if(!X&&!m){f.preventDefault();var P=o();if(t.daysContainer!==void 0&&(b===!1||P&&bt(P))){var Q=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),k(Q),Y(L(1),0)):Y(void 0,Q)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:f.preventDefault();var I=f.keyCode===40?1:-1;t.daysContainer&&h.$i!==void 0||h===t.input||h===t.altInput?f.ctrlKey?(f.stopPropagation(),Z(t.currentYear-I),Y(L(1),0)):X||Y(void 0,I*7):h===t.currentYearElement?Z(t.currentYear-I):t.config.enableTime&&(!X&&t.hourElement&&t.hourElement.focus(),l(f),t._debouncedChange());break;case 9:if(X){var K=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(ze){return ze}),re=K.indexOf(h);if(re!==-1){var it=K[re+(f.shiftKey?-1:1)];f.preventDefault(),(it||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(h)&&f.shiftKey&&(f.preventDefault(),t._input.focus());break;default:break}}if(t.amPM!==void 0&&h===t.amPM)switch(f.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),st();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),st();break}(m||q(h))&&ue("onKeyDown",f)}function sn(f,h){if(h===void 0&&(h="flatpickr-day"),!(t.selectedDates.length!==1||f&&(!f.classList.contains(h)||f.classList.contains("flatpickr-disabled")))){for(var m=f?f.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),b=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),C=Math.min(m,t.selectedDates[0].getTime()),R=Math.max(m,t.selectedDates[0].getTime()),X=!1,P=0,Q=0,I=C;I<R;I+=bc.DAY)oe(new Date(I),!0)||(X=X||I>C&&I<R,I<b&&(!P||I>P)?P=I:I>b&&(!Q||I<Q)&&(Q=I));var K=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+h));K.forEach(function(re){var it=re.dateObj,ze=it.getTime(),zn=P>0&&ze<P||Q>0&&ze>Q;if(zn){re.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(dn){re.classList.remove(dn)});return}else if(X&&!zn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(dn){re.classList.remove(dn)}),f!==void 0&&(f.classList.add(m<=t.selectedDates[0].getTime()?"startRange":"endRange"),b<m&&ze===b?re.classList.add("startRange"):b>m&&ze===b&&re.classList.add("endRange"),ze>=P&&(Q===0||ze<=Q)&&yc(ze,b,m)&&re.classList.add("inRange"))})}}function Ti(){t.isOpen&&!t.config.static&&!t.config.inline&&an()}function Br(f,h){if(h===void 0&&(h=t._positionElement),t.isMobile===!0){if(f){f.preventDefault();var m=$e(f);m&&m.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),ue("onOpen");return}else if(t._input.disabled||t.config.inline)return;var b=t.isOpen;t.isOpen=!0,b||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),ue("onOpen"),an(h)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(f===void 0||!t.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Ci(f){return function(h){var m=t.config["_"+f+"Date"]=t.parseDate(h,t.config.dateFormat),b=t.config["_"+(f==="min"?"max":"min")+"Date"];m!==void 0&&(t[f==="min"?"minDateHasTime":"maxDateHasTime"]=m.getHours()>0||m.getMinutes()>0||m.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(C){return oe(C)}),!t.selectedDates.length&&f==="min"&&p(m),st()),t.daysContainer&&(Bn(),m!==void 0?t.currentYearElement[f]=m.getFullYear().toString():t.currentYearElement.removeAttribute(f),t.currentYearElement.disabled=!!b&&m!==void 0&&b.getFullYear()===m.getFullYear())}}function Ai(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],h=Le(Le({},JSON.parse(JSON.stringify(n.dataset||{}))),e),m={};t.config.parseDate=h.parseDate,t.config.formatDate=h.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(K){t.config._enable=ds(K)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(K){t.config._disable=ds(K)}});var b=h.mode==="time";if(!h.dateFormat&&(h.enableTime||b)){var C=Ee.defaultConfig.dateFormat||Pt.dateFormat;m.dateFormat=h.noCalendar||b?"H:i"+(h.enableSeconds?":S":""):C+" H:i"+(h.enableSeconds?":S":"")}if(h.altInput&&(h.enableTime||b)&&!h.altFormat){var R=Ee.defaultConfig.altFormat||Pt.altFormat;m.altFormat=h.noCalendar||b?"h:i"+(h.enableSeconds?":S K":" K"):R+(" h:i"+(h.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Ci("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Ci("max")});var X=function(K){return function(re){t.config[K==="min"?"_minTime":"_maxTime"]=t.parseDate(re,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:X("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:X("max")}),h.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,m,h);for(var P=0;P<f.length;P++)t.config[f[P]]=t.config[f[P]]===!0||t.config[f[P]]==="true";Sr.filter(function(K){return t.config[K]!==void 0}).forEach(function(K){t.config[K]=Lr(t.config[K]||[]).map(s)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var P=0;P<t.config.plugins.length;P++){var Q=t.config.plugins[P](t)||{};for(var I in Q)Sr.indexOf(I)>-1?t.config[I]=Lr(Q[I]).map(s).concat(t.config[I]):typeof h[I]=="undefined"&&(t.config[I]=Q[I])}h.altInputClass||(t.config.altInputClass=$n().className+" "+t.config.altInputClass),ue("onParseConfig")}function $n(){return t.config.wrap?n.querySelector("[data-input]"):n}function Si(){typeof t.config.locale!="object"&&typeof Ee.l10ns[t.config.locale]=="undefined"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Le(Le({},Ee.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Ee.l10ns[t.config.locale]:void 0),yt.D="("+t.l10n.weekdays.shorthand.join("|")+")",yt.l="("+t.l10n.weekdays.longhand.join("|")+")",yt.M="("+t.l10n.months.shorthand.join("|")+")",yt.F="("+t.l10n.months.longhand.join("|")+")",yt.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var f=Le(Le({},e),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&Ee.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=rs(t),t.parseDate=Mr({config:t.config,l10n:t.l10n})}function an(f){if(typeof t.config.position=="function")return void t.config.position(t,f);if(t.calendarContainer!==void 0){ue("onPreCalendarPosition");var h=f||t._positionElement,m=Array.prototype.reduce.call(t.calendarContainer.children,function(Jc,Zc){return Jc+Zc.offsetHeight},0),b=t.calendarContainer.offsetWidth,C=t.config.position.split(" "),R=C[0],X=C.length>1?C[1]:null,P=h.getBoundingClientRect(),Q=window.innerHeight-P.bottom,I=R==="above"||R!=="below"&&Q<m&&P.top>m,K=window.pageYOffset+P.top+(I?-m-2:h.offsetHeight+2);if(Oe(t.calendarContainer,"arrowTop",!I),Oe(t.calendarContainer,"arrowBottom",I),!t.config.inline){var re=window.pageXOffset+P.left,it=!1,ze=!1;X==="center"?(re-=(b-P.width)/2,it=!0):X==="right"&&(re-=b-P.width,ze=!0),Oe(t.calendarContainer,"arrowLeft",!it&&!ze),Oe(t.calendarContainer,"arrowCenter",it),Oe(t.calendarContainer,"arrowRight",ze);var zn=window.document.body.offsetWidth-(window.pageXOffset+P.right),dn=re+b>window.document.body.offsetWidth,qc=zn+b>window.document.body.offsetWidth;if(Oe(t.calendarContainer,"rightMost",dn),!t.config.static)if(t.calendarContainer.style.top=K+"px",!dn)t.calendarContainer.style.left=re+"px",t.calendarContainer.style.right="auto";else if(!qc)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=zn+"px";else{var Wr=ot();if(Wr===void 0)return;var Uc=window.document.body.offsetWidth,Yc=Math.max(0,Uc/2-b/2),Gc=".flatpickr-calendar.centerMost:before",Kc=".flatpickr-calendar.centerMost:after",Xc=Wr.cssRules.length,Qc="{left:"+P.left+"px;right:auto;}";Oe(t.calendarContainer,"rightMost",!1),Oe(t.calendarContainer,"centerMost",!0),Wr.insertRule(Gc+","+Kc+Qc,Xc),t.calendarContainer.style.left=Yc+"px",t.calendarContainer.style.right="auto"}}}}function ot(){for(var f=null,h=0;h<document.styleSheets.length;h++){var m=document.styleSheets[h];if(m.cssRules){try{m.cssRules}catch(b){continue}f=m;break}}return f!=null?f:ln()}function ln(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function Bn(){t.config.noCalendar||t.isMobile||(J(),Li(),ie())}function cn(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function un(f){f.preventDefault(),f.stopPropagation();var h=function(K){return K.classList&&K.classList.contains("flatpickr-day")&&!K.classList.contains("flatpickr-disabled")&&!K.classList.contains("notAllowed")},m=ns($e(f),h);if(m!==void 0){var b=m,C=t.latestSelectedDateObj=new Date(b.dateObj.getTime()),R=(C.getMonth()<t.currentMonth||C.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=b,t.config.mode==="single")t.selectedDates=[C];else if(t.config.mode==="multiple"){var X=zr(C);X?t.selectedDates.splice(parseInt(X),1):t.selectedDates.push(C)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=C,t.selectedDates.push(C),Be(C,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(K,re){return K.getTime()-re.getTime()}));if(d(),R){var P=t.currentYear!==C.getFullYear();t.currentYear=C.getFullYear(),t.currentMonth=C.getMonth(),P&&(ue("onYearChange"),J()),ue("onMonthChange")}if(Li(),ie(),st(),!R&&t.config.mode!=="range"&&t.config.showMonths===1?D(b):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Q=t.config.mode==="single"&&!t.config.enableTime,I=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Q||I)&&cn()}x()}}var $t={locale:[Si,He],showMonths:[Ce,a,qe],minDate:[_],maxDate:[_],positionElement:[fs],clickOpens:[function(){t.config.clickOpens===!0?(y(t._input,"focus",t.open),y(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Di(f,h){if(f!==null&&typeof f=="object"){Object.assign(t.config,f);for(var m in f)$t[m]!==void 0&&$t[m].forEach(function(b){return b()})}else t.config[f]=h,$t[f]!==void 0?$t[f].forEach(function(b){return b()}):Sr.indexOf(f)>-1&&(t.config[f]=Lr(h));t.redraw(),st(!0)}function Vn(f,h){var m=[];if(f instanceof Array)m=f.map(function(b){return t.parseDate(b,h)});else if(f instanceof Date||typeof f=="number")m=[t.parseDate(f,h)];else if(typeof f=="string")switch(t.config.mode){case"single":case"time":m=[t.parseDate(f,h)];break;case"multiple":m=f.split(t.config.conjunction).map(function(b){return t.parseDate(b,h)});break;case"range":m=f.split(t.l10n.rangeSeparator).map(function(b){return t.parseDate(b,h)});break;default:break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));t.selectedDates=t.config.allowInvalidPreload?m:m.filter(function(b){return b instanceof Date&&oe(b,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(b,C){return b.getTime()-C.getTime()})}function Oi(f,h,m){if(h===void 0&&(h=!1),m===void 0&&(m=t.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return t.clear(h);Vn(f,m),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),_(void 0,h),p(),t.selectedDates.length===0&&t.clear(!1),st(h),h&&ue("onChange")}function ds(f){return f.slice().map(function(h){return typeof h=="string"||typeof h=="number"||h instanceof Date?t.parseDate(h,void 0,!0):h&&typeof h=="object"&&h.from&&h.to?{from:t.parseDate(h.from,void 0),to:t.parseDate(h.to,void 0)}:h}).filter(function(h){return h})}function Fc(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var f=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);f&&Vn(f,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function $c(){if(t.input=$n(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=te(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),fs()}function fs(){t._positionElement=t.config.positionElement||t._input}function Bc(){var f=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=te("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=f,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch(h){}y(t.mobileInput,"change",function(h){t.setDate($e(h).value,!1,t.mobileFormatStr),ue("onChange"),ue("onClose")})}function Vc(f){if(t.isOpen===!0)return t.close();t.open(f)}function ue(f,h){if(t.config!==void 0){var m=t.config[f];if(m!==void 0&&m.length>0)for(var b=0;m[b]&&b<m.length;b++)m[b](t.selectedDates,t.input.value,t,h);f==="onChange"&&(t.input.dispatchEvent(Vr("change")),t.input.dispatchEvent(Vr("input")))}}function Vr(f){var h=document.createEvent("Event");return h.initEvent(f,!0,!0),h}function zr(f){for(var h=0;h<t.selectedDates.length;h++){var m=t.selectedDates[h];if(m instanceof Date&&Be(m,f)===0)return""+h}return!1}function zc(f){return t.config.mode!=="range"||t.selectedDates.length<2?!1:Be(f,t.selectedDates[0])>=0&&Be(f,t.selectedDates[1])<=0}function Li(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(f,h){var m=new Date(t.currentYear,t.currentMonth,1);m.setMonth(t.currentMonth+h),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[h].textContent=bi(m.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=m.getMonth().toString(),f.value=m.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function jr(f){var h=f||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(m){return t.formatDate(m,h)}).filter(function(m,b,C){return t.config.mode!=="range"||t.config.enableTime||C.indexOf(m)===b}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function st(f){f===void 0&&(f=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=jr(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=jr(t.config.altFormat)),f!==!1&&ue("onValueUpdate")}function jc(f){var h=$e(f),m=t.prevMonthNav.contains(h),b=t.nextMonthNav.contains(h);m||b?k(m?-1:1):t.yearElements.indexOf(h)>=0?h.select():h.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):h.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Wc(f){f.preventDefault();var h=f.type==="keydown",m=$e(f),b=m;t.amPM!==void 0&&m===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Fe(t.amPM.textContent===t.l10n.amPM[0])]);var C=parseFloat(b.getAttribute("min")),R=parseFloat(b.getAttribute("max")),X=parseFloat(b.getAttribute("step")),P=parseInt(b.value,10),Q=f.delta||(h?f.which===38?1:-1:0),I=P+X*Q;if(typeof b.value!="undefined"&&b.value.length===2){var K=b===t.hourElement,re=b===t.minuteElement;I<C?(I=R+I+Fe(!K)+(Fe(K)&&Fe(!t.amPM)),re&&M(void 0,-1,t.hourElement)):I>R&&(I=b===t.hourElement?I-R-Fe(!t.amPM):C,re&&M(void 0,1,t.hourElement)),t.amPM&&K&&(X===1?I+P===23:Math.abs(I-P)>X)&&(t.amPM.textContent=t.l10n.amPM[Fe(t.amPM.textContent===t.l10n.amPM[0])]),b.value=De(I)}}return r(),t}function kn(n,e){for(var t=Array.prototype.slice.call(n).filter(function(s){return s instanceof HTMLElement}),i=[],r=0;r<t.length;r++){var o=t[r];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=qg(o,e||{}),i.push(o._flatpickr)}catch(s){console.error(s)}}return i.length===1?i[0]:i}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return kn(this,n)},HTMLElement.prototype.flatpickr=function(n){return kn([this],n)});var Ee=function(n,e){return typeof n=="string"?kn(window.document.querySelectorAll(n),e):n instanceof Node?kn([n],e):kn(n,e)};Ee.defaultConfig={};Ee.l10ns={en:Le({},Or),default:Le({},Or)};Ee.localize=function(n){Ee.l10ns.default=Le(Le({},Ee.l10ns.default),n)};Ee.setDefaults=function(n){Ee.defaultConfig=Le(Le({},Ee.defaultConfig),n)};Ee.parseDate=Mr({});Ee.formatDate=rs({});Ee.compareDates=Be;typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(n){return kn(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window!="undefined"&&(window.flatpickr=Ee);var Rr=Ee;function wc(){Rr(".date-picker",{allowInput:!0}),Rr(".datetime-picker",{allowInput:!0,enableSeconds:!0,enableTime:!0,time_24hr:!0}),Rr(".time-picker",{allowInput:!0,enableSeconds:!0,enableTime:!0,noCalendar:!0,time_24hr:!0})}function Ug(n){for(let e of H("#id_available_columns > option"))if(e.selected){for(let t of H("#id_columns"))t.appendChild(e.cloneNode(!0));e.remove()}n.preventDefault()}function Yg(n){for(let e of H("#id_columns > option"))if(e.selected){for(let t of H("#id_available_columns"))t.appendChild(e.cloneNode(!0));e.remove()}n.preventDefault()}function xc(n,e){return at(this,null,function*(){return yield On(n,e)})}function Gg(n){var l,c,u;n.preventDefault();let e=n.currentTarget,t=e.getAttribute("data-url");if(t==null){Rt("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let i=((l=document.activeElement)==null?void 0:l.getAttribute("value"))==="Reset",r=(u=(c=e.getAttribute("data-config-root"))==null?void 0:c.split("."))!=null?u:[];if(i){let d=r.reduceRight((p,v)=>({[v]:p}),{});xc(t,d).then(p=>{tn(p)?Rt("danger","Error Resetting Table Configuration",p.error).show():window.location.href=window.location.origin+window.location.pathname});return}let o=wl(e,"select[name=columns]"),s=Object.assign({},...o.map(d=>({[d.name]:d.options}))),a=r.reduceRight((d,p)=>({[p]:d}),s);xc(t,a).then(d=>{tn(d)?Rt("danger","Error Updating Table Configuration",d.error).show():window.location.href=window.location.origin+window.location.pathname})}function Tc(){for(let n of H("#add_columns"))n.addEventListener("click",Ug);for(let n of H("#remove_columns"))n.addEventListener("click",Yg);for(let n of H("form.userconfigform"))n.addEventListener("submit",Gg)}function Cc(n){return typeof n=="string"&&["show","hide"].includes(n)}var rn=class extends Error{constructor(t,i){super(t);ee(this,"table");this.table=i}},Nn=class{constructor(e,t){ee(this,"button");ee(this,"rows");this.button=e,this.rows=t}hideRows(){for(let e of this.rows)e.classList.add("d-none")}set buttonState(e){Cc(e)&&this.button.setAttribute("data-state",e)}get buttonState(){let e=this.button.getAttribute("data-state");return Cc(e)?e:null}toggleButton(){this.buttonState==="show"?this.button.innerText=Ln(this.button.innerText,"Show","Hide"):this.buttonState==="hide"&&(this.button.innerText=Ln(this.button.innerHTML,"Hide","Show"))}toggleState(){this.buttonState==="show"?this.buttonState="hide":this.buttonState==="hide"&&(this.buttonState="show")}toggle(){this.toggleState(),this.toggleButton()}handleClick(e){e.currentTarget.isEqualNode(this.button)&&this.toggle(),this.buttonState==="hide"&&this.hideRows()}},os=class{constructor(e){ee(this,"table");ee(this,"enabledButton");ee(this,"disabledButton");ee(this,"virtualButton");ee(this,"disconnectedButton");ee(this,"rows");this.table=e,this.rows=this.table.querySelectorAll("tr");try{let t=nn(this.table,"button.toggle-enabled"),i=nn(this.table,"button.toggle-disabled"),r=nn(this.table,"button.toggle-virtual"),o=nn(this.table,"button.toggle-disconnected");if(t===null)throw new rn("Table is missing a 'toggle-enabled' button.",e);if(i===null)throw new rn("Table is missing a 'toggle-disabled' button.",e);if(r===null)throw new rn("Table is missing a 'toggle-virtual' button.",e);if(o===null)throw new rn("Table is missing a 'toggle-disconnected' button.",e);t.addEventListener("click",s=>this.handleClick(s,this)),i.addEventListener("click",s=>this.handleClick(s,this)),r.addEventListener("click",s=>this.handleClick(s,this)),o.addEventListener("click",s=>this.handleClick(s,this)),this.enabledButton=new Nn(t,e.querySelectorAll('tr[data-enabled="enabled"]')),this.disabledButton=new Nn(i,e.querySelectorAll('tr[data-enabled="disabled"]')),this.virtualButton=new Nn(r,e.querySelectorAll('tr[data-type="virtual"]')),this.disconnectedButton=new Nn(o,e.querySelectorAll('tr[data-connected="disconnected"]'))}catch(t){if(t instanceof rn){console.debug("Table does not contain enable/disable toggle buttons");return}else throw t}}handleClick(e,t){for(let i of this.rows)i.classList.remove("d-none");t.enabledButton.handleClick(e),t.disabledButton.handleClick(e),t.virtualButton.handleClick(e),t.disconnectedButton.handleClick(e)}};function Ac(){for(let n of H("table"))new os(n)}var ss=class{constructor(e){ee(this,"base");ee(this,"state");ee(this,"activeLink",null);ee(this,"sections",[]);this.base=e,this.state=new gi({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initSectionLinks(),this.initLinks()}bodyHas(e){return document.body.hasAttribute(`data-sidenav-${e}`)}bodyRemove(...e){for(let t of e)document.body.removeAttribute(`data-sidenav-${t}`)}bodyAdd(...e){for(let t of e)document.body.setAttribute(`data-sidenav-${t}`,"")}init(){for(let e of this.base.querySelectorAll(".sidenav-toggle"))e.addEventListener("click",t=>this.onToggle(t));for(let e of H(".sidenav-toggle-mobile"))e.addEventListener("click",t=>this.onMobileToggle(t));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 e of this.getActiveLinks())this.bodyHas("show")?this.activateLink(e,"expand"):this.bodyHas("hidden")&&this.activateLink(e,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let e of this.base.querySelectorAll(".collapse"))e.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 e of this.base.querySelectorAll(".collapse"))e.classList.remove("show");this.state.set("pinned",!1)}handleSectionClick(e){e.preventDefault();let t=e.target;this.activeLink=t,this.closeInactiveSections()}closeInactiveSections(){for(let[e,t]of this.sections)e!==this.activeLink&&(e.classList.add("collapsed"),e.setAttribute("aria-expanded","false"),t.hide())}initSectionLinks(){for(let e of H(".navbar-nav .nav-item .nav-link[data-bs-toggle]"))if(e.parentElement!==null){let t=e.parentElement.querySelector(".collapse");if(t!==null){let i=new At(t,{toggle:!1});this.sections.push([e,i]),e.addEventListener("click",r=>this.handleSectionClick(r))}}}activateLink(e,t){var r;let i=e.closest(".dropdown-menu");if(gr(i)){let o=i.parentElement,s=(r=i.parentElement)==null?void 0:r.querySelector(".nav-link");if(gr(s)&&gr(o))switch(t){case"expand":s.setAttribute("aria-expanded","true"),o.classList.add("active"),i.classList.add("show"),e.classList.add("active");break;case"collapse":s.setAttribute("aria-expanded","false"),o.classList.remove("active"),i.classList.remove("show"),e.classList.remove("active");break}}}*getActiveLinks(){for(let e of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let t=e.querySelector("a");if(t){let i=new RegExp(t.href,"gi");window.location.href.match(i)&&(yield e)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let e of this.getActiveLinks())this.activateLink(e,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let e of this.getActiveLinks())this.activateLink(e,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(e){e.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(e){e.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function Sc(){for(let n of H(".navbar"))new ss(n)}function Dc(n,e,t,i,r){let o=(...s)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+r+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(n,s));return o.prototype=e.prototype,o}var E=class n{static getElements(e,t=document){if(typeof e=="string"){let i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){let o=i.getElementById(e);return o?[o]:[]}let r=t.querySelectorAll(e);return!r.length&&e[0]!=="."&&e[0]!=="#"&&(r=t.querySelectorAll("."+e),r.length||(r=t.querySelectorAll("#"+e))),Array.from(r)}return[e]}static getElement(e,t=document){if(typeof e=="string"){let i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let r=t.querySelector(e);return i&&!r&&(r=i.getElementById(e)),r||(r=t.querySelector("."+e)),r}return e}static lazyLoad(e){var t,i;return e.lazyLoad||((i=(t=e.grid)==null?void 0:t.opts)==null?void 0:i.lazyLoad)&&e.lazyLoad!==!1}static createDiv(e,t){let i=document.createElement("div");return e.forEach(r=>{r&&i.classList.add(r)}),t==null||t.appendChild(i),i}static shouldSizeToContent(e,t=!1){return(e==null?void 0:e.grid)&&(t?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return n.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){let i=e.x>t.x?e.x:t.x,r=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(r<=i)return 0;let o=e.y>t.y?e.y:t.y,s=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return s<=o?0:(r-i)*(s-o)}static area(e){return e.w*e.h}static sort(e,t=1){return e.sort((r,o)=>{var a,l,c,u;let s=t*(((a=r.y)!=null?a:1e4)-((l=o.y)!=null?l:1e4));return s===0?t*(((c=r.x)!=null?c:1e4)-((u=o.x)!=null?u:1e4)):s})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{let r=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!r)throw new Error(`Invalid height val = ${e}`);i=r[2]||"px",t=parseFloat(r[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(let r in i){if(!i.hasOwnProperty(r))return;e[r]===null||e[r]===void 0?e[r]=i[r]:typeof i[r]=="object"&&typeof e[r]=="object"&&this.defaults(e[r],i[r])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object"))for(let i in e){let r=e[i],o=t[i];i[0]==="_"||r===o?delete e[i]:r&&typeof r=="object"&&o!==void 0&&(n.removeInternalAndSame(r,o),Object.keys(r).length||delete e[i])}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...r)=>{i||(i=!0,setTimeout(()=>{e(...r),i=!1},t))}}static removePositioningStyles(e){let t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;let t=getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowY)?e:this.getScrollElement(e.parentElement)}static updateScrollPosition(e,t,i){let r=e.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(r.top<0||r.bottom>o){let s=r.bottom-o,a=r.top,l=this.getScrollElement(e);if(l!==null){let c=l.scrollTop;r.top<0&&i<0?e.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=Math.abs(a)>Math.abs(i)?i:a:i>0&&(e.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=s>i?i:s),t.top+=l.scrollTop-c}}}static updateScrollResize(e,t,i){let r=this.getScrollElement(t),o=r.clientHeight,s=r===this.getScrollElement()?0:r.getBoundingClientRect().top,a=e.clientY-s,l=a<i,c=a>o-i;l?r.scrollBy({behavior:"smooth",top:a-i}):c&&r.scrollBy({behavior:"smooth",top:i-(o-a)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:O({},e)}static cloneDeep(e){let t=["parentGrid","el","grid","subGrid","engine"],i=n.clone(e);for(let r in i)i.hasOwnProperty(r)&&typeof i[r]=="object"&&r.substring(0,2)!=="__"&&!t.find(o=>o===r)&&(i[r]=n.cloneDeep(e[r]));return i}static cloneNode(e){let t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=n.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(let i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(r=>{e.style[i]=r}):e.style[i]=t[i])}static initEvent(e,t){let i={type:t.type},r={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>i[o]=e[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>i[o]=e[o]),O(O({},i),r)}static simulateMouseEvent(e,t,i){var s,a,l,c;let r=e,o=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:(s=r.ctrlKey)!=null?s:!1,altKey:(a=r.altKey)!=null?a:!1,shiftKey:(l=r.shiftKey)!=null?l:!1,metaKey:(c=r.metaKey)!=null?c:!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(o)}static getValuesFromTransformedElement(e){let t=document.createElement("div");n.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);let i=t.getBoundingClientRect();return e.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}static swap(e,t,i){if(!e)return;let r=e[t];e[t]=e[i],e[i]=r}static canBeRotated(e){var t;return!(!e||e.w===e.h||e.locked||e.noResize||(t=e.grid)!=null&&t.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}};var Rn=class n{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,r={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!r.nested&&!this.float&&this.swap(e,i))return!0;let o=t;!this._loading&&this._useEntireRowArea(e,t)&&(o={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,o,r.skip));let s=!1,a={nested:!0,pack:!1},l=0;for(;i=i||this.collide(e,o,r.skip);){if(l++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,ae(O({},i),{y:e.y}),e)||!this.collide(i,ae(O({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;let u=O(ae(O({},t),{y:i.y+i.h}),a);c=this._loading&&E.samePos(e,u)?!0:this.moveNode(e,u),(i.locked||this._loading)&&c?E.copyPos(t,e):!i.locked&&c&&r.pack&&(this._packNodes(),t.y=i.y+i.h,E.copyPos(e,t)),s=s||c}else c=this.moveNode(i,O(ae(O({},i),{y:t.y+t.h,skip:e}),a));if(!c)return s;i=void 0}return s}collide(e,t=e,i){let r=e._id,o=i==null?void 0:i._id;return this.nodes.find(s=>s._id!==r&&s._id!==o&&E.isIntercepted(s,t))}collideAll(e,t=e,i){let r=e._id,o=i==null?void 0:i._id;return this.nodes.filter(s=>s._id!==r&&s._id!==o&&E.isIntercepted(s,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let r=e._rect,o=O({},t.rect);o.y>r.y?(o.h+=o.y-r.y,o.y=r.y):o.h+=r.y-o.y,o.x>r.x?(o.w+=o.x-r.x,o.x=r.x):o.w+=r.x-o.x;let s,a=.5;for(let l of i){if(l.locked||!l._rect)break;let c=l._rect,u=Number.MAX_VALUE,d=Number.MAX_VALUE;r.y<c.y?u=(o.y+o.h-c.y)/c.h:r.y+r.h>c.y+c.h&&(u=(c.y+c.h-o.y)/c.h),r.x<c.x?d=(o.x+o.w-c.x)/c.w:r.x+r.w>c.x+c.w&&(d=(c.x+c.w-o.x)/c.w);let p=Math.min(d,u);p>a&&(a=p,s=l)}return t.collide=s,s}cacheRects(e,t,i,r,o,s){return this.nodes.forEach(a=>a._rect={y:a.y*t+i,x:a.x*e+s,w:a.w*e-s-r,h:a.h*t-i-o}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let o=t.x,s=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=o,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=s):(e.x=o,e.y=s),e._dirty=t._dirty=!0,!0}let r;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(r=E.isTouching(e,t)))return i();if(r!==!1){if(e.w===t.w&&e.x===t.x&&(r||(r=E.isTouching(e,t)))){if(t.y<e.y){let o=e;e=t,t=o}return i()}if(r!==!1){if(e.h===t.h&&e.y===t.y&&(r||(r=E.isTouching(e,t)))){if(t.x<e.x){let o=e;e=t,t=o}return i()}return!1}}}isAreaEmpty(e,t,i,r){let o={x:e||0,y:t||0,w:i||1,h:r||1};return!this.collide(o)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let r=this._inColumnResize;r||(this._inColumnResize=!0);let o=this.nodes;return this.nodes=[],o.forEach((s,a,l)=>{let c;s.locked||(s.autoPosition=!0,e==="list"&&a&&(c=l[a-1])),this.addNode(s,!1,c)}),r||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=E.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){var o;e._id=(o=e._id)!=null?o:n._idSeq++;let i=e.id;if(i){let s=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+s++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let r={x:0,y:0,w:1,h:1};return E.defaults(e,r),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,E.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=r.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=r.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=r.w),isNaN(e.h)&&(e.h=r.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||E.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id&&this.findCacheLayout(e,this.defaultColumn)===-1){let o=O({},e);o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),E.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!E.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=E.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||E.samePos(e,e._orig)||(E.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,r){let o=r?r.y*i+(r.x+r.w):0,s=!1;for(let a=o;!s;++a){let l=a%i,c=Math.floor(a/i);if(l+e.w>i)continue;let u={x:l,y:c,w:e.w,h:e.h};t.find(d=>E.isIntercepted(u,d))||((e.x!==l||e.y!==c)&&(e._dirty=!0),e.x=l,e.y=c,delete e.autoPosition,s=!0)}return s}addNode(e,t=!1,i){let r=this.nodes.find(s=>s._id===e._id);if(r)return r;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let o;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,o=!0),this.nodes.push(e),t&&this.addedNodes.push(e),o||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(r=>r._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(r=>r._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(r=>r._removeDOM=!0);let i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,r=new n({column:this.column,float:this.float,nodes:this.nodes.map(s=>s._id===e._id?(i=O({},s),i):O({},s))});if(!i)return!1;let o=r.moveNode(i,t)&&r.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!t.resizing&&t.collide){let s=t.collide.el.gridstackNode;if(this.swap(e,s))return this._notify(),!0}return o?(r.nodes.filter(s=>s._dirty).forEach(s=>{let a=this.nodes.find(l=>l._id===s._id);a&&(E.copyPos(a,s),a._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new n({column:this.column,float:this.float,nodes:this.nodes.map(r=>O({},r))}),i=O({},e);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=E.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){var c,u;if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let r=e.w!==t.w||e.h!==t.h,o=E.copyPos({},e,!0);if(E.copyPos(o,t),this.nodeBoundFix(o,r),E.copyPos(t,o),!t.forceCollide&&E.samePos(e,t))return!1;let s=E.copyPos({},e),a=this.collideAll(e,o,t.skip),l=!0;if(a.length){let d=e._moving&&!t.nested,p=d?this.directionCollideCoverage(e,t,a):a[0];if(d&&p&&((u=(c=e.grid)==null?void 0:c.opts)!=null&&u.subGridDynamic)&&!e.grid._isTemp){let v=E.areaIntercept(t.rect,p._rect),g=E.area(t.rect),y=E.area(p._rect);v/(g<y?g:y)>.8&&(p.grid.makeSubGrid(p.el,void 0,e),p=void 0)}p?l=!this._fixCollisions(e,o,p,t):(l=!1,i&&delete t.pack)}return l&&!E.samePos(e,o)&&(e._dirty=!0,E.copyPos(e,o)),t.pack&&this._packNodes()._notify(),!E.samePos(e,s)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){var s;let i=(s=this._layouts)==null?void 0:s.length,r=i&&this.column!==i-1?this._layouts[i-1]:null,o=[];return this.sortNodes(),this.nodes.forEach(a=>{let l=r==null?void 0:r.find(u=>u._id===a._id),c=O(O({},a),l||{});E.removeInternalForSave(c,!e),t&&t(a,c),o.push(c)}),o}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let r=i/this.column;e.forEach(o=>{if(!o._orig)return;let s=t.find(a=>a._id===o._id);s&&(s.y>=0&&o.y!==o._orig.y&&(s.y+=o.y-o._orig.y),o.x!==o._orig.x&&(s.x=Math.round(o.x*r)),o.w!==o._orig.w&&(s.w=Math.round(o.w*r)))})}}),this)}columnChanged(e,t,i="moveScale"){var a;if(!this.nodes.length||!t||e===t)return this;let r=i==="compact"||i==="list";r&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let o=[],s=r?this.nodes:E.sort(this.nodes,-1);if(t>e&&this._layouts){let l=this._layouts[t]||[],c=this._layouts.length-1;!l.length&&e!==c&&((a=this._layouts[c])!=null&&a.length)&&(e=c,this._layouts[c].forEach(u=>{var p,v,g;let d=s.find(y=>y._id===u._id);d&&(!r&&!u.autoPosition&&(d.x=(p=u.x)!=null?p:d.x,d.y=(v=u.y)!=null?v:d.y),d.w=(g=u.w)!=null?g:d.w,(u.x==null||u.y===void 0)&&(d.autoPosition=!0))})),l.forEach(u=>{var p,v,g;let d=s.findIndex(y=>y._id===u._id);if(d!==-1){let y=s[d];if(r){y.w=u.w;return}(u.autoPosition||isNaN(u.x)||isNaN(u.y))&&this.findEmptyPosition(u,o),u.autoPosition||(y.x=(p=u.x)!=null?p:y.x,y.y=(v=u.y)!=null?v:y.y,y.w=(g=u.w)!=null?g:y.w,o.push(y)),s.splice(d,1)}})}if(r)this.compact(i,!1);else{if(s.length)if(typeof i=="function")i(t,e,o,s);else{let l=r||i==="none"?1:t/e,c=i==="move"||i==="moveScale",u=i==="scale"||i==="moveScale";s.forEach(d=>{d.x=t===1?0:c?Math.round(d.x*l):Math.min(d.x,t-1),d.w=t===1||e===1?1:u?Math.round(d.w*l)||1:Math.min(d.w,t),o.push(d)}),s=[]}o=E.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let r=[];return e.forEach((o,s)=>{var a;if(o._id===void 0){let l=o.id?this.nodes.find(c=>c.id===o.id):void 0;o._id=(a=l==null?void 0:l._id)!=null?a:n._idSeq++}r[s]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=r,this}cacheOneLayout(e,t){var o;e._id=(o=e._id)!=null?o:n._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let r=this.findCacheLayout(e,t);return r===-1?this._layouts[t].push(i):this._layouts[t][r]=i,this}findCacheLayout(e,t){var i,r,o;return(o=(r=(i=this._layouts)==null?void 0:i[t])==null?void 0:r.findIndex(s=>s._id===e._id))!=null?o:-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){let i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(let t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}};Rn._idSeq=0;var Ve={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"};var $=class{};var Ne=typeof window!="undefined"&&typeof document!="undefined"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),Je=class{};function Hr(n,e){n.touches.length>1||(n.cancelable&&n.preventDefault(),E.simulateMouseEvent(n.changedTouches[0],e))}function Oc(n,e){n.cancelable&&n.preventDefault(),E.simulateMouseEvent(n,e)}function Hn(n){Je.touchHandled||(Je.touchHandled=!0,Hr(n,"mousedown"))}function In(n){Je.touchHandled&&Hr(n,"mousemove")}function Pn(n){if(!Je.touchHandled)return;Je.pointerLeaveTimeout&&(window.clearTimeout(Je.pointerLeaveTimeout),delete Je.pointerLeaveTimeout);let e=!!$.dragElement;Hr(n,"mouseup"),e||Hr(n,"click"),Je.touchHandled=!1}function Fn(n){n.pointerType!=="mouse"&&n.target.releasePointerCapture(n.pointerId)}function as(n){$.dragElement&&n.pointerType!=="mouse"&&Oc(n,"mouseenter")}function ls(n){$.dragElement&&n.pointerType!=="mouse"&&(Je.pointerLeaveTimeout=window.setTimeout(()=>{delete Je.pointerLeaveTimeout,Oc(n,"mouseleave")},10))}var _i=class n{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,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 e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${n.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Ne&&(this.el.addEventListener("touchstart",Hn),this.el.addEventListener("pointerdown",Fn)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Ne&&(this.el.removeEventListener("touchstart",Hn),this.el.removeEventListener("pointerdown",Fn)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Ne&&(this.el.addEventListener("touchmove",In),this.el.addEventListener("touchend",Pn)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Ne&&(this.el.removeEventListener("touchmove",In),this.el.removeEventListener("touchend",Pn)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){var t,i;e.key==="Escape"&&((i=(t=this.host.gridstackNode)==null?void 0:t.grid)==null||i.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}};_i.prefix="ui-resizable-";var Ft=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}};var wi=class n extends Ft{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{let r=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},s=this.temporalRect||o;return{position:{left:(s.left-r.left)*this.rectScale.x,top:(s.top-r.top)*this.rectScale.y},size:{width:s.width*this.rectScale.x,height:s.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(e,t){super.on(e,t)}off(e){super.off(e)}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(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(r=>this.option[r]=e[r]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(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),$.overResizeElement===this&&delete $.overResizeElement),this}_mouseOver(e){$.overResizeElement||$.dragElement||($.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){$.overResizeElement===this&&(delete $.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new _i(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=E.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=E.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();let t=E.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();let i=E.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){let t=E.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=n._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let e=this.el.parentElement,t=E.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.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 n._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){let i=this.startEvent,r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=e.clientX-i.clientX,s=this.sizeToContent?0:e.clientY-i.clientY,a,l;t.indexOf("e")>-1?r.width+=o:t.indexOf("w")>-1&&(r.width-=o,r.left+=o,a=!0),t.indexOf("s")>-1?r.height+=s:t.indexOf("n")>-1&&(r.height-=s,r.top+=s,l=!0);let c=this._constrainSize(r.width,r.height,a,l);return Math.round(r.width)!==Math.round(c.width)&&(t.indexOf("w")>-1&&(r.left+=r.width-c.width),r.width=c.width),Math.round(r.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(r.top+=r.height-c.height),r.height=c.height),r}_constrainSize(e,t,i,r){let o=this.option,s=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,a=o.minWidth/this.rectScale.x||e,l=(r?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||t,u=Math.min(s,Math.max(a,e)),d=Math.min(l,Math.max(c,t));return{width:u,height:d}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let t=this.el.parentElement,{left:i,top:r}=t.getBoundingClientRect();e={left:i,top:r,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{let i=this.temporalRect[t],r=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*r+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}};wi._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var Kg='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',xi=class n extends Ft{constructor(e,t={}){var o;super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=(o=t==null?void 0:t.handle)==null?void 0:o.substring(1),r=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:r!=null&&r.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),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(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),Ne&&(e.addEventListener("touchstart",Hn),e.addEventListener("pointerdown",Fn))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),Ne&&(t.removeEventListener("touchstart",Hn),t.removeEventListener("pointerdown",Fn))}),e||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(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(!$.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(Kg)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete $.dragElement,delete $.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Ne&&(e.currentTarget.addEventListener("touchmove",In),e.currentTarget.addEventListener("touchend",Pn)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),$.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;let t=E.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;let t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),$.pauseDrag){let r=Number.isInteger($.pauseDrag)?$.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),r)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,$.dragElement=this;let r=(i=this.el.gridstackNode)==null?void 0:i.grid;r?$.dropElement=r.el.ddElement.ddDroppable:delete $.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=E.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);let o=E.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){var t,i;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Ne&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",In,!0),e.currentTarget.removeEventListener("touchend",Pn,!0)),this.dragging){delete this.dragging,(t=this.el.gridstackNode)==null||delete t._origRotate,document.removeEventListener("keydown",this._keyEvent),((i=$.dropElement)==null?void 0:i.el)===this.el.parentElement&&delete $.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let r=E.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(r),this.triggerEvent("dragstop",r),$.dropElement&&$.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete $.dragElement,delete $.dropElement,delete $.mouseHandled,e.preventDefault()}_keyEvent(e){var r,o;let t=this.el.gridstackNode,i=(t==null?void 0:t.grid)||((o=(r=$.dropElement)==null?void 0:r.el)==null?void 0:o.gridstack);if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i==null||i.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!E.canBeRotated(t))return;t._origRotate=t._origRotate||O({},t._orig),delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",E.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=E.cloneNode(this.el)),e.parentElement||E.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=n.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging");let t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){var t;this.helper.classList.remove("ui-draggable-dragging");let e=(t=this.helper)==null?void 0:t.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){let i=this.helper,r=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",n.originStyleProp.forEach(o=>i.style[o]=this.dragElementOriginStyle[o]||null),setTimeout(()=>i.style.transition=r,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0},i=this.helper.style,r=this.dragOffset;i.left=(e.clientX+r.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+r.offsetTop-t.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(e,t,i){let r=0,o=0;i&&(r=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let s=t.getBoundingClientRect();return{left:s.left,top:s.top,offsetLeft:-e.clientX+s.left-r,offsetTop:-e.clientY+s.top-o,width:s.width*this.dragTransform.xScale,height:s.height*this.dragTransform.yScale}}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}};xi.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var Ir=class extends Ft{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}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),Ne&&(this.el.addEventListener("pointerenter",as),this.el.addEventListener("pointerleave",ls)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Ne&&(this.el.removeEventListener("pointerenter",as),this.el.removeEventListener("pointerleave",ls)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!$.dragElement||!this._canDrop($.dragElement.el))return;e.preventDefault(),e.stopPropagation(),$.dropElement&&$.dropElement!==this&&$.dropElement._mouseLeave(e,!0),$.dropElement=this;let t=E.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui($.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){var r;if(!$.dragElement||$.dropElement!==this)return;e.preventDefault(),e.stopPropagation();let i=E.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui($.dragElement)),this.triggerEvent("dropout",i),$.dropElement===this&&(delete $.dropElement,!t)){let o,s=this.el.parentElement;for(;!o&&s;)o=(r=s.ddElement)==null?void 0:r.ddDroppable,s=s.parentElement;o&&o._mouseEnter(e)}}drop(e){e.preventDefault();let t=E.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui($.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return O({draggable:e.el},e.ui())}};var Pr=class n{static init(e){return e.ddElement||(e.ddElement=new n(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new xi(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new wi(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new Ir(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Fr=class{resizable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddResizable&&o.ddResizable[t]();else if(t==="destroy")o.ddResizable&&o.cleanResizable();else if(t==="option")o.setupResizable({[i]:r});else{let a=o.el.gridstackNode.grid,l=o.el.getAttribute("gs-resize-handles")||a.opts.resizable.handles||"e,s,se";l==="all"&&(l="n,e,s,w,se,sw,ne,nw");let c=!a.opts.alwaysShowResizeHandle;o.setupResizable(ae(O({},a.opts.resizable),{handles:l,autoHide:c,start:t.start,stop:t.stop,resize:t.resize}))}}),this}draggable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddDraggable&&o.ddDraggable[t]();else if(t==="destroy")o.ddDraggable&&o.cleanDraggable();else if(t==="option")o.setupDraggable({[i]:r});else{let s=o.el.gridstackNode.grid;o.setupDraggable(ae(O({},s.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag}))}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,r){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=o=>t._accept(o)),this._getDDElements(e,t).forEach(o=>{t==="disable"||t==="enable"?o.ddDroppable&&o.ddDroppable[t]():t==="destroy"?o.ddDroppable&&o.cleanDroppable():t==="option"?o.setupDroppable({[i]:r}):o.setupDroppable(t)}),this}isDroppable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(r=>r.on(t,o=>{i(o,$.dragElement?$.dragElement.el:o.target,$.dragElement?$.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){let i=e.gridstack||t!=="destroy"&&t!=="disable",r=E.getElements(e);return r.length?r.map(s=>s.ddElement||(i?Pr.init(s):null)).filter(s=>s):[]}};var Re=new Fr,Et=class n{static init(e={},t=".grid-stack"){if(typeof document=="undefined")return null;let i=n.getGridElement(t);return i?(i.gridstack||(i.gridstack=new n(i,E.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - 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(e={},t=".grid-stack"){let i=[];return typeof document=="undefined"||(n.getGridElements(t).forEach(r=>{r.gridstack||(r.gridstack=new n(r,E.cloneDeep(e))),i.push(r.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){let s=i.gridstack;return t&&(s.opts=O(O({},s.opts),t)),t.children!==void 0&&s.load(t.children),s}return(!e.classList.contains("grid-stack")||n.addRemoveCB)&&(n.addRemoveCB?i=n.addRemoveCB(e,t,!0,!0):i=E.createDiv(["grid-stack",t.class],e)),n.init(t,i)}static registerEngine(e){n.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=E.createDiv([this.opts.placeholderClass,Ve.itemClass,this.opts.itemClass]);let e=E.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){var c;this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);let i=E.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let r=t.columnOpts;if(r){let u=r.breakpoints;!r.columnWidth&&!(u!=null&&u.length)?delete t.columnOpts:(r.columnMax=r.columnMax||12,(u==null?void 0:u.length)>1&&u.sort((d,p)=>(p.w||0)-(d.w||0)))}let o=ae(O({},E.cloneDeep(Ve)),{column:E.toNumber(e.getAttribute("gs-column"))||Ve.column,minRow:i||E.toNumber(e.getAttribute("gs-min-row"))||Ve.minRow,maxRow:i||E.toNumber(e.getAttribute("gs-max-row"))||Ve.maxRow,staticGrid:E.toBool(e.getAttribute("gs-static"))||Ve.staticGrid,sizeToContent:E.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||Ve.draggable.handle},removableOptions:{accept:t.itemClass||Ve.removableOptions.accept,decline:Ve.removableOptions.decline}});e.getAttribute("gs-animate")&&(o.animate=E.toBool(e.getAttribute("gs-animate"))),t=E.defaults(t,o),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(t),t.rtl==="auto"&&(t.rtl=e.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");let s=this.el.closest("."+Ve.itemClass),a=s==null?void 0:s.gridstackNode;if(a&&(a.subGrid=this,this.parentGridNode=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial")this.cellHeight(void 0);else{typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==Ve.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit);let u=t.cellHeight;delete t.cellHeight,this.cellHeight(u)}t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=Ne),this._setStaticClass();let l=t.engineClass||n.engineClass||Rn;if(this.engine=new l({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:u=>{u.forEach(d=>{let p=d.el;p&&(d._removeDOM?(p&&p.remove(),delete d._removeDOM):this._writePosAttr(p,d))}),this._updateContainerHeight()}}),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(u=>this._prepareElement(u)),delete this.engine._loading,this.batchUpdate(!1)),t.children){let u=t.children;delete t.children,u.length&&this.load(u)}this.setAnimation(),t.subGridDynamic&&!$.pauseDrag&&($.pauseDrag=!0),((c=t.draggable)==null?void 0:c.pause)!==void 0&&($.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i!=null&&i.el?t=i.el:n.addRemoveCB?t=n.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return t;let r=this._readAttr(t);return E.defaults(e,r),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){let t=E.createDiv(["grid-stack-item",this.opts.itemClass]),i=E.createDiv(["grid-stack-item-content"],t);return E.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([r])=>{var o,s;r.isIntersecting&&((o=e.visibleObservable)==null||o.disconnect(),delete e.visibleObservable,n.renderCB(i,e),(s=e.grid)==null||s.prepareDragDrop(e.el))}),window.setTimeout(()=>{var r;return(r=e.visibleObservable)==null?void 0:r.observe(t)})):n.renderCB(i,e),t}makeSubGrid(e,t,i,r=!0){var v,g,y;let o=e.gridstackNode;if(o||(o=this.makeWidget(e).gridstackNode),(v=o.subGrid)!=null&&v.el)return o.subGrid;let s,a=this;for(;a&&!s;)s=(g=a.opts)==null?void 0:g.subGridOpts,a=(y=a.parentGridNode)==null?void 0:y.grid;t=E.cloneDeep(O(O(ae(O({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),s||{}),t||o.subGridOpts||{})),o.subGridOpts=t;let l;t.column==="auto"&&(l=!0,t.column=Math.max(o.w||1,(i==null?void 0:i.w)||1),delete t.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),u,d;if(r&&(this._removeDD(o.el),d=ae(O({},o),{x:0,y:0}),E.removeInternalForSave(d),delete d.subGridOpts,o.content&&(d.content=o.content,delete o.content),n.addRemoveCB?u=n.addRemoveCB(this.el,d,!0,!1):(u=E.createDiv(["grid-stack-item"]),u.appendChild(c),c=E.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){let x=l?t.column:o.w,T=o.h+i.h,_=o.el.style;_.transition="none",this.update(o.el,{w:x,h:T}),setTimeout(()=>_.transition=null)}let p=o.subGrid=n.addGrid(c,t);return i!=null&&i._moving&&(p._isTemp=!0),l&&(p._autoColumn=!0),r&&p.makeWidget(u,d),i&&(i._moving?window.setTimeout(()=>E.simulateMouseEvent(i._event,"mouseenter",p.el),0):p.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),p}removeAsSubGrid(e){var i;let t=(i=this.parentGridNode)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(r=>{r.x+=this.parentGridNode.x,r.y+=this.parentGridNode.y,t.makeWidget(r.el,r)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>E.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=n.saveCB){let r=this.engine.save(e,i);if(r.forEach(o=>{var s;if(e&&o.el&&!o.subGrid&&!i){let a=o.el.querySelector(".grid-stack-item-content");o.content=a==null?void 0:a.innerHTML,o.content||delete o.content}else if(!e&&!i&&delete o.content,(s=o.subGrid)!=null&&s.el){let a=o.subGrid.save(e,t,i);o.subGridOpts=t?a:{children:a},delete o.subGrid}delete o.el}),t){let o=E.cloneDeep(this.opts);o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===(this.el.style.direction==="rtl")&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto");let s=o._alwaysShowResizeHandle;return delete o._alwaysShowResizeHandle,s!==void 0?o.alwaysShowResizeHandle=s:delete o.alwaysShowResizeHandle,E.removeInternalAndSame(o,Ve),o.children=r,o}return r}load(e,t=n.addRemoveCB||!0){e=E.cloneDeep(e);let i=this.getColumn();e.forEach(u=>{u.w=u.w||1,u.h=u.h||1}),e=E.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let r=0;e.forEach(u=>{r=Math.max(r,(u.x||0)+u.w)}),r>this.engine.defaultColumn&&(this.engine.defaultColumn=r),r>i&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(r,i,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,r,!0));let o=n.addRemoveCB;typeof t=="function"&&(n.addRemoveCB=t);let s=[];this.batchUpdate();let a=!this.engine.nodes.length,l=a&&this.opts.animate;l&&this.setAnimation(!1),!a&&t&&[...this.engine.nodes].forEach(d=>{if(!d.id)return;E.find(e,d.id)||(n.addRemoveCB&&n.addRemoveCB(this.el,d,!1,!1),s.push(d),this.removeWidget(d.el,!0,!1))}),this.engine._loading=!0;let c=[];return this.engine.nodes=this.engine.nodes.filter(u=>E.find(e,u.id)?(c.push(u),!1):!0),e.forEach(u=>{var p;let d=E.find(c,u.id);if(d){if(E.shouldSizeToContent(d)&&(u.h=d.h),this.engine.nodeBoundFix(u),(u.autoPosition||u.x===void 0||u.y===void 0)&&(u.w=u.w||d.w,u.h=u.h||d.h,this.engine.findEmptyPosition(u)),this.engine.nodes.push(d),E.samePos(d,u)&&this.engine.nodes.length>1&&(this.moveNode(d,ae(O({},u),{forceCollide:!0})),E.copyPos(u,d)),this.update(d.el,u),(p=u.subGridOpts)!=null&&p.children){let v=d.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(u.subGridOpts.children)}}else t&&this.addWidget(u)}),delete this.engine._loading,this.engine.removedNodes=s,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?n.addRemoveCB=o:delete n.addRemoveCB,l&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!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 t=this.el.querySelector("."+this.opts.itemClass);if(t){let r=E.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/r)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){let i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+i}let t=E.parseHeight(e);return this.opts.cellHeightUnit===t.unit&&this.opts.cellHeight===t.h?this:(this.opts.cellHeightUnit=t.unit,this.opts.cellHeight=t.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){var t;return e&&((t=this.opts.columnOpts)!=null&&t.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var o,s;let e=this.opts.columnOpts;if(!e||!e.columnWidth&&!((o=e.breakpoints)!=null&&o.length))return!1;let t=this.getColumn(),i=t,r=this._widthOrContainer(!0);if(e.columnWidth)i=Math.min(Math.round(r/e.columnWidth)||1,e.columnMax);else{i=e.columnMax;let a=0;for(;a<e.breakpoints.length&&r<=e.breakpoints[a].w;)i=e.breakpoints[a++].c||t}if(i!==t){let a=(s=e.breakpoints)==null?void 0:s.find(l=>l.c===i);return this.column(i,(a==null?void 0:a.layout)||e.layout),!0}return!1}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;let i=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,e,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=t,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){var t;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(t=this._placeholder)==null||delete t.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){let i=this.el.getBoundingClientRect(),r;t?r={top:i.top+document.documentElement.scrollTop,left:i.left}:r={top:this.el.offsetTop,left:this.el.offsetLeft};let o=e.left-r.left,s=e.top-r.top,a=i.width/this.getColumn(),l=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/a),y:Math.floor(s/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,t,i,r){return this.engine.isAreaEmpty(e,t,i,r)}makeWidget(e,t){let i=n.getElement(e);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);let r=i.gridstackNode;this._updateContainerHeight(),r.subGridOpts&&this.makeSubGrid(i,r.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(r=>this.on(r,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=r=>t(r):this._gsEventHandler[e]=r=>{r.detail&&t(r,r.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return e?(n.getElements(e).forEach(r=>{if(r.parentElement&&r.parentElement!==this.el)return;let o=r.gridstackNode;o||(o=this.engine.nodes.find(s=>r===s.el)),o&&(t&&n.addRemoveCB&&n.addRemoveCB(this.el,o,!1,!1),delete r.gridstackNode,this._removeDD(r),this.engine.removeNode(o,t,i),t&&r.parentElement&&r.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&n.addRemoveCB&&n.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(e,t),t&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&i&&r.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){var i;let t=this.opts;return e===t?this:(e.acceptWidgets!==void 0&&(t.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),e.class&&this.el.classList.add(e.class)),e.columnOpts?(this.opts.columnOpts=e.columnOpts,this.checkDynamicColumn()):e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?t.minRow=t.maxRow=t.row=e.row:(e.minRow!==void 0&&(t.minRow=e.minRow),e.maxRow!==void 0&&(t.maxRow=e.maxRow)),(i=e.children)!=null&&i.length&&this.load(e.children),this)}update(e,t){return n.getElements(e).forEach(i=>{var u;let r=i==null?void 0:i.gridstackNode;if(!r)return;let o=O(O({},E.copyPos({},r)),E.cloneDeep(t));this.engine.nodeBoundFix(o),delete o.autoPosition;let s=["x","y","w","h"],a;if(s.some(d=>o[d]!==void 0&&o[d]!==r[d])&&(a={},s.forEach(d=>{a[d]=o[d]!==void 0?o[d]:r[d],delete o[d]})),!a&&(o.minW||o.minH||o.maxW||o.maxH)&&(a={}),o.content!==void 0){let d=i.querySelector(".grid-stack-item-content");d&&d.textContent!==o.content&&(r.content=o.content,n.renderCB(d,o),(u=r.subGrid)!=null&&u.el&&(d.appendChild(r.subGrid.el),r.subGrid._updateContainerHeight())),delete o.content}let l=!1,c=!1;for(let d in o)d[0]!=="_"&&r[d]!==o[d]&&(r[d]=o[d],l=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(E.sanitizeMinMax(r),a){let d=a.w!==void 0&&a.w!==r.w;this.moveNode(r,a),d&&r.subGrid?r.subGrid.onResize(this.hasAnimationCSS()?r.w:void 0):this.resizeToContentCheck(d,r),delete r._orig}(a||l)&&this._writeAttr(i,r),c&&this.prepareDragDrop(r.el)}),this}moveNode(e,t){let i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){var p,v;if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;let t=e.gridstackNode;if(!t)return;let i=t.grid;if(!i||e.parentElement!==i.el)return;let r=i.getCellHeight(!0);if(!r)return;let o=t.h?t.h*r:e.clientHeight,s;if(t.resizeToContentParent&&(s=e.querySelector(t.resizeToContentParent)),s||(s=e.querySelector(n.resizeToContentParent)),!s)return;let a=e.clientHeight-s.clientHeight,l=t.h?t.h*r-a:s.clientHeight,c;if(t.subGrid){c=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);let g=t.subGrid.el.getBoundingClientRect(),y=e.getBoundingClientRect();c+=g.top-y.top}else{if((v=(p=t.subGridOpts)==null?void 0:p.children)!=null&&v.length)return;{let g=s.firstElementChild;if(!g){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${n.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=g.getBoundingClientRect().height||l}}if(l===c)return;o+=c-l;let u=Math.ceil(o/r),d=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;d&&u>d&&(u=d,e.classList.add("size-to-content-max")),t.minH&&u<t.minH?u=t.minH:t.maxH&&u>t.maxH&&(u=t.maxH),u!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:u}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){n.resizeToContentCB?n.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return n.getElements(e).forEach(i=>{let r=i.gridstackNode;if(!E.canBeRotated(r))return;let o={w:r.h,h:r.w,minH:r.minW,minW:r.minH,maxH:r.maxW,maxW:r.maxH};if(t){let a=t.left>0?Math.floor(t.left/this.cellWidth()):0,l=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;o.x=r.x+a-(r.h-(l+1)),o.y=r.y+l-a}Object.keys(o).forEach(a=>{o[a]===void 0&&delete o[a]});let s=r._orig;this.update(i,o),r._orig=s}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=E.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){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 t=arguments,i=0,r={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(r)}return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.addedNodes)!=null&&e.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.removedNodes)!=null&&e.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(e,t){let i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e),r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;return r.el.dispatchEvent(i),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let e=this.parentGridNode,t=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,r=this.opts.cellHeightUnit;if(!i)return this;if(!e){let o=E.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===r){let s=Math.floor(o.h/i);t<s&&(t=s)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[e?"minHeight":"height"]=t*i+r),e&&E.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,t=!1,i){i=i||this._readAttr(e),e.gridstackNode=i,i.el=e,i.grid=this,i=this.engine.addNode(i,t),this._writeAttr(e,i),e.classList.add(Ve.itemClass,this.opts.itemClass);let r=E.shouldSizeToContent(i);return r?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),r&&this.resizeToContentCheck(!1,i),E.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(e,t){return(!t._moving&&!t._resizing||this._placeholder===e)&&(e.style.top=t.y?t.y===1?"var(--gs-cell-height)":`calc(${t.y} * var(--gs-cell-height))`:null,e.style.left=t.x?t.x===1?"var(--gs-column-width)":`calc(${t.x} * var(--gs-column-width))`:null,e.style.width=t.w>1?`calc(${t.w} * var(--gs-column-width))`:null,e.style.height=t.h>1?`calc(${t.h} * var(--gs-cell-height))`:null),t.x>0?e.setAttribute("gs-x",String(t.x)):e.removeAttribute("gs-x"),t.y>0?e.setAttribute("gs-y",String(t.y)):e.removeAttribute("gs-y"),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);let i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let r in i)t[r]?e.setAttribute(i[r],String(t[r])):e.removeAttribute(i[r]);return this}_readAttr(e,t=!0){let i={};i.x=E.toNumber(e.getAttribute("gs-x")),i.y=E.toNumber(e.getAttribute("gs-y")),i.w=E.toNumber(e.getAttribute("gs-w")),i.h=E.toNumber(e.getAttribute("gs-h")),i.autoPosition=E.toBool(e.getAttribute("gs-auto-position")),i.noResize=E.toBool(e.getAttribute("gs-no-resize")),i.noMove=E.toBool(e.getAttribute("gs-no-move")),i.locked=E.toBool(e.getAttribute("gs-locked"));let r=e.getAttribute("gs-size-to-content");r&&(r==="true"||r==="false"?i.sizeToContent=E.toBool(r):i.sizeToContent=parseInt(r,10)),i.id=e.getAttribute("gs-id"),i.maxW=E.toNumber(e.getAttribute("gs-max-w")),i.minW=E.toNumber(e.getAttribute("gs-min-w")),i.maxH=E.toNumber(e.getAttribute("gs-max-h")),i.minH=E.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(let o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="gs-size-to-content"&&delete i[o]}return i}_setStaticClass(){let e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=(t=>(t=this.el)==null?void 0:t.clientWidth)()){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(r=>{r.subGrid&&r.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,t=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),this.animationDelay);if(t)E.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>E.shouldSizeToContent(i))){let i=[...this.engine.nodes];this.batchUpdate(),i.forEach(r=>{E.shouldSizeToContent(r)&&this.resizeToContentCBCheck(r.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,t?[t]:this.engine.nodes)}}_updateResizeEvent(e=!1){let t=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=E.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return E.getElement(e)}static getElements(e=".grid-stack-item"){return E.getElements(e)}static getGridElement(e){return n.getElement(e)}static getGridElements(e){return E.getElements(e)}_initMargin(){let e,t=0,i=[];typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(e=E.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(s=>{this.opts[s]===void 0?this.opts[s]=t:(e=E.parseHeight(this.opts[s]),this.opts[s]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.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);let o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Re}static setupDragIn(e,t,i,r=document){(t==null?void 0:t.pause)!==void 0&&($.pauseDrag=t.pause),t=O({appendTo:"body",helper:"clone"},t||{}),(typeof e=="string"?E.getElements(e,r):e).forEach((s,a)=>{Re.isDraggable(s)||Re.dragIn(s,t),i!=null&&i[a]&&(s.gridstackNode=i[a])})}movable(e,t){return this.opts.staticGrid?this:(n.getElements(e).forEach(i=>{let r=i.gridstackNode;r&&(t?delete r.noMove:r.noMove=!0,this.prepareDragDrop(r.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(n.getElements(e).forEach(i=>{let r=i.gridstackNode;r&&(t?delete r.noResize:r.noResize=!0,this.prepareDragDrop(r.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){var t;let e=(t=this._placeholder)==null?void 0:t.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&n._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Re.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Re.droppable(this.el,"destroy"),this;let e,t,i=(r,o,s)=>{var p;s=s||o;let a=s.gridstackNode;if(!a)return;if(!((p=a.grid)!=null&&p.el)){s.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let v=s.getBoundingClientRect();s.style.left=v.x+(this.dragTransform.xScale-1)*(r.clientX-v.x)/this.dragTransform.xScale+"px",s.style.top=v.y+(this.dragTransform.yScale-1)*(r.clientY-v.y)/this.dragTransform.yScale+"px",s.style.transformOrigin="0px 0px"}let{top:l,left:c}=s.getBoundingClientRect(),u=this.el.getBoundingClientRect();c-=u.left,l-=u.top;let d={position:{top:l*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(a._temporaryRemoved){if(a.x=Math.max(0,Math.round(c/t)),a.y=Math.max(0,Math.round(l/e)),delete a.autoPosition,this.engine.nodeBoundFix(a),!this.engine.willItFit(a)){if(a.autoPosition=!0,!this.engine.willItFit(a)){Re.off(o,"drag");return}a._willFitPos&&(E.copyPos(a,a._willFitPos),delete a._willFitPos)}this._onStartMoving(s,r,d,a,t,e)}else this._dragOrResize(s,r,d,a,t,e)};return Re.droppable(this.el,{accept:r=>{let o=r.gridstackNode||this._readAttr(r,!1);if((o==null?void 0:o.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let s=!0;if(typeof this.opts.acceptWidgets=="function")s=this.opts.acceptWidgets(r);else{let a=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;s=r.matches(a)}if(s&&o&&this.opts.maxRow){let a={w:o.w,h:o.h,minW:o.minW,minH:o.minH};s=this.engine.willItFit(a)}return s}}).on(this.el,"dropover",(r,o,s)=>{let a=(s==null?void 0:s.gridstackNode)||o.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._temporaryRemoved)return!1;if(a!=null&&a._sidebarOrig&&(a.w=a._sidebarOrig.w,a.h=a._sidebarOrig.h),a!=null&&a.grid&&a.grid!==this&&!a._temporaryRemoved&&a.grid._leave(o,s),s=s||o,t=this.cellWidth(),e=this.getCellHeight(!0),!a){let u=s.getAttribute("data-gs-widget")||s.getAttribute("gridstacknode");if(u){try{a=JSON.parse(u)}catch(d){console.error("Gridstack dropover: Bad JSON format: ",u)}s.removeAttribute("data-gs-widget"),s.removeAttribute("gridstacknode")}a||(a=this._readAttr(s)),a._sidebarOrig={w:a.w,h:a.h}}a.grid||(a.el||(a=O({},a)),a._isExternal=!0,s.gridstackNode=a);let l=a.w||Math.round(s.offsetWidth/t)||1,c=a.h||Math.round(s.offsetHeight/e)||1;return a.grid&&a.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=a),o.gridstackNode=a=ae(O({},a),{w:l,h:c,grid:this}),delete a.x,delete a.y,this.engine.cleanupNode(a).nodeBoundFix(a),a._initDD=a._isExternal=a._temporaryRemoved=!0):(a.w=l,a.h=c,a._temporaryRemoved=!0),n._itemRemoving(a.el,!1),Re.on(o,"drag",i),i(r,o,s),!1}).on(this.el,"dropout",(r,o,s)=>{let a=(s==null?void 0:s.gridstackNode)||o.gridstackNode;return a&&(!a.grid||a.grid===this)&&(this._leave(o,s),this._isTemp&&this.removeAsSubGrid(a)),!1}).on(this.el,"drop",(r,o,s)=>{var p,v,g;let a=(s==null?void 0:s.gridstackNode)||o.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;let l=!!this.placeholder.parentElement,c=o!==s;this.placeholder.remove(),delete this.placeholder.gridstackNode,l&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let u=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,l&&(u!=null&&u.grid)&&u.grid!==this){let y=u.grid;y.engine.removeNodeFromLayoutCache(u),y.engine.removedNodes.push(u),y._triggerRemoveEvent()._triggerChangeEvent(),y.parentGridNode&&!y.engine.nodes.length&&y.opts.subGridDynamic&&y.removeAsSubGrid()}if(!a||(l&&(this.engine.cleanupNode(a),a.grid=this),(p=a.grid)==null||delete p._isTemp,Re.off(o,"drag"),s!==o?(s.remove(),o=s):o.remove(),this._removeDD(o),!l))return!1;let d=(g=(v=a.subGrid)==null?void 0:v.el)==null?void 0:g.gridstack;return E.copyPos(a,this._readAttr(this.placeholder)),E.removePositioningStyles(o),c&&(a.content||a.subGridOpts||n.addRemoveCB)?(delete a.el,o=this.addWidget(a)):(this._prepareElement(o,!0,a),this.el.appendChild(o),this.resizeToContentCheck(!1,a),d&&(d.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(ae(O({},r),{type:"dropped"}),u&&u.grid?u:void 0,a),!1}),this}static _itemRemoving(e,t){if(!e)return;let i=e?e.gridstackNode:void 0;!(i!=null&&i.grid)||e.classList.contains(i.grid.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Re.isDroppable(e)&&Re.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>n._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>n._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){let i=e==null?void 0:e.gridstackNode;if(!i)return;let r=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,s=this.opts.staticGrid||r&&o;if((t||s)&&(i._initDD&&(this._removeDD(e),delete i._initDD),s&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!i._initDD){let a,l,c=(p,v)=>{this.triggerEvent(p,p.target),a=this.cellWidth(),l=this.getCellHeight(!0),this._onStartMoving(e,p,v,i,a,l)},u=(p,v)=>{this._dragOrResize(e,p,v,i,a,l)},d=p=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let v=i.w!==i._orig.w,g=p.target;if(!(!g.gridstackNode||g.gridstackNode.grid!==this)){if(i.el=g,i._isAboutToRemove){let y=e.gridstackNode.grid;y._gsEventHandler[p.type]&&y._gsEventHandler[p.type](p,g),y.engine.nodes.push(i),y.removeWidget(e,!0,!0)}else E.removePositioningStyles(g),i._temporaryRemoved?(E.copyPos(i,i._orig),this._writePosAttr(g,i),this.engine.addNode(i)):this._writePosAttr(g,i),this.triggerEvent(p,g);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),p.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(v,i))}};Re.draggable(e,{start:c,stop:d,drag:u}).resizable(e,{start:c,stop:d,resize:u}),i._initDD=!0}return Re.draggable(e,r?"disable":"enable").resizable(e,o?"disable":"enable"),this}_onStartMoving(e,t,i,r,o,s){var a;if(this.engine.cleanNodes().beginUpdate(r),this._writePosAttr(this.placeholder,r),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=r,(a=r.grid)!=null&&a.el)this.dragTransform=E.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let l=this.placeholder.closest(".grid-stack");this.dragTransform=E.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(r.el=this.placeholder,r._lastUiPosition=i.position,r._prevYPix=i.position.top,r._moving=t.type==="dragstart",r._resizing=t.type==="resizestart",delete r._lastTried,t.type==="dropover"&&r._temporaryRemoved&&(this.engine.addNode(r),r._moving=!0),this.engine.cacheRects(o,s,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){let l=this.getColumn()-r.x,c=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-r.y;Re.resizable(e,"option","minWidth",o*Math.min(r.minW||1,l)).resizable(e,"option","minHeight",s*Math.min(r.minH||1,c)).resizable(e,"option","maxWidth",o*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",o*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,r.x+r.w)).resizable(e,"option","maxHeight",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,c)).resizable(e,"option","maxHeightMoveUp",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,r.y+r.h))}}_dragOrResize(e,t,i,r,o,s){let a=O({},r._orig),l,c=this.opts.marginLeft,u=this.opts.marginRight,d=this.opts.marginTop,p=this.opts.marginBottom,v=Math.round(s*.1),g=Math.round(o*.1);if(c=Math.min(c,g),u=Math.min(u,g),d=Math.min(d,v),p=Math.min(p,v),t.type==="drag"){if(r._temporaryRemoved)return;let x=i.position.top-r._prevYPix;r._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&E.updateScrollPosition(e,i.position,x);let T=i.position.left+(i.position.left>r._lastUiPosition.left?-u:c),_=i.position.top+(i.position.top>r._lastUiPosition.top?-p:d);a.x=Math.round(T/o),a.y=Math.round(_/s);let A=this._extraDragRow;if(this.engine.collide(r,a)){let M=this.getRow(),G=Math.max(0,a.y+r.h-M);this.opts.maxRow&&M+G>this.opts.maxRow&&(G=Math.max(0,this.opts.maxRow-M)),this._extraDragRow=G}else this._extraDragRow=0;if(this._extraDragRow!==A&&this._updateContainerHeight(),r.x===a.x&&r.y===a.y)return}else if(t.type==="resize"){if(a.x<0||(E.updateScrollResize(t,e,s),a.w=Math.round((i.size.width-c)/o),a.h=Math.round((i.size.height-d)/s),r.w===a.w&&r.h===a.h)||r._lastTried&&r._lastTried.w===a.w&&r._lastTried.h===a.h)return;let x=i.position.left+c,T=i.position.top+d;a.x=Math.round(x/o),a.y=Math.round(T/s),l=!0}r._event=t,r._lastTried=a;let y={x:i.position.left+c,y:i.position.top+d,w:(i.size?i.size.width:r.w*o)-c-u,h:(i.size?i.size.height:r.h*s)-d-p};if(this.engine.moveNodeCheck(r,ae(O({},a),{cellWidth:o,cellHeight:s,rect:y,resizing:l}))){r._lastUiPosition=i.position,this.engine.cacheRects(o,s,d,u,p,c),delete r._skipDown,l&&r.subGrid&&r.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let x=t.target;r._sidebarOrig||this._writePosAttr(x,r),this.triggerEvent(t,x)}}triggerEvent(e,t){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[e.type]&&i._gsEventHandler[e.type](e,t)}_leave(e,t){t=t||e;let i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,Re.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;let r=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=r,this.opts.removable===!0&&n._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return Dc(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}};Et.renderCB=(n,e)=>{n&&(e!=null&&e.content)&&(n.textContent=e.content)};Et.resizeToContentParent=".grid-stack-item-content";Et.Utils=E;Et.Engine=Rn;Et.GDRev="12.1.2";function Xg(){let n=document.getElementById("dashboard");n&&n.gridstack.disable()}function Qg(){let n=document.getElementById("dashboard");n&&n.gridstack.enable()}function Jg(n,e){return at(this,null,function*(){return yield On(n,{layout:e})})}function Lc(){if(document.getElementById("dashboard")==null)return;let e=Et.init({cellHeight:100,disableDrag:!0,disableResize:!0,draggable:{handle:".grid-stack-item-content .card-header",appendTo:"body",scroll:!0}}),t=document.getElementById("lock_dashboard");t&&t.addEventListener("click",()=>{Xg()});let i=document.getElementById("unlock_dashboard");i&&i.addEventListener("click",()=>{Qg()});let r=document.getElementById("save_dashboard");r!==null&&r.addEventListener("click",()=>{let o=r.getAttribute("data-url");if(o==null)return;let s=e.save(!1);Jg(o,s).then(a=>{tn(a)?Rt("danger","Error Saving Dashboard Config",a.error).show():location.reload()})})}function Mc(n,e){switch(n){case"images-and-labels":{cs("image.device-image",e),cs("text.device-image-label",e);break}case"images-only":{cs("image.device-image",e),us("text.device-image-label",e);break}case"labels-only":{us("image.device-image",e),us("text.device-image-label",e);break}}}function cs(n,e){var i,r;let t=(r=(i=e.contentDocument)==null?void 0:i.querySelectorAll(n))!=null?r:[];for(let o of t)o.classList.remove("hidden")}function us(n,e){var i,r;let t=(r=(i=e.contentDocument)==null?void 0:i.querySelectorAll(n))!=null?r:[];for(let o of t)o.classList.add("hidden")}function Zg(n,e){e.set("view",n);for(let t of H(".rack_elevation"))Mc(n,t)}function kc(){let n=Jo.get("view");for(let e of H("select.rack-view"))e.selectedIndex=[...e.options].findIndex(t=>t.value==n),e.addEventListener("change",t=>{Zg(t.currentTarget.value,Jo)},!1);for(let e of H(".rack_elevation"))e.addEventListener("load",()=>{Mc(n,e)})}function ev(n){let e=document.getElementById("selector_results");if(e==null)return;let t=e.getAttribute("data-selector-target");if(t==null)return;let i=document.getElementById(t);if(i==null)return;let r=n.getAttribute("data-label"),o=n.getAttribute("data-value");i.tomselect.addOption({id:o,display:r}),i.tomselect.addItem(o)}function Nc(){for(let n of H("#selector_results a"))n.addEventListener("click",()=>ev(n))}function tv(){let n=document.getElementById("quick-add-object");if(n==null)return;let e=n.getAttribute("data-object-id");if(e==null)return;let t=n.getAttribute("data-object-repr");if(t==null)return;let i=n.getAttribute("data-target-id");if(i==null)return;let r=document.getElementById(i);if(r==null)return;r.tomselect.addOption({id:e,display:t}),r.tomselect.addItem(e);let o=document.getElementById("htmx-modal");if(o){let s=tt.getInstance(o);s&&s.hide()}}function Rc(){let n=document.getElementById("htmx-modal-content");n&&n.addEventListener("htmx:afterSwap",()=>tv())}function nv(){Tr(),Ar(),vr(),xr(),Nc(),Rc(),yr(),Cr()}function Hc(){document.addEventListener("htmx:afterSettle",nv)}function iv(n){let e=n.currentTarget,t=e.baseURI.split("?")[0],i="?",r=Array.from(e.options).filter(o=>o.selected).map(o=>`filter_id=${o.value}`).join("&");t+=`${i}${r}`,document.location.href=t}function Ic(){let n=document.getElementById("results");if(pe(n)){let e=document.getElementById("id_filter_id");pe(e)&&e.addEventListener("change",iv)}}function Pc(){for(let n of[yr,pc,Cr,vr,Sl,xr,wc,Tr,Ar,Tc,Ac,Sc,Lc,kc,Hc,Ic])n()}function rv(){let n=document.forms;for(let t of n)t.method.toUpperCase()=="GET"&&t.addEventListener("formdata",function(i){let r=i.formData;for(let[o,s]of Array.from(r.entries()))s===""&&r.delete(o)});let e=document.querySelector(".content-container");e!==null&&e.focus()}window.addEventListener("load",rv);document.readyState!=="loading"?Pc():document.addEventListener("DOMContentLoaded",Pc);})();
/*! Bundled license information:
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.6 (https://getbootstrap.com/)
* Copyright 2011-2025 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 12.1.2
* https://gridstackjs.com/
*
* Copyright (c) 2021-2024 Alain Dumesny
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
*)
*/
//# sourceMappingURL=netbox.js.map