"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),window.NJStore=window.NJStore||[];const e=(()=>{const e=window.NJStore;return{set(t,n,i){void 0===t.key&&(t.key={key:n,id:e.length}),e[t.key.id]=i},get:(t,n)=>(t.key&&n&&void 0===n.id&&(n=t.key),n&&void 0!==n.id?e[n.id]:null),delete(t,n){if(void 0===t.key)return;const i=t.key;i.key===n&&(delete e[i.id],delete t.key)}}})(),t={setData(t,n,i){e.set(t,n,i)},getData:(t,n)=>e.get(t,n),removeData(t,n){e.delete(t,n)}};class AbstractComponent{constructor(e,t,n={}){!t||t instanceof Element||console.error(Error(`${t} is not an HTML Element`)),this.options=n,this.element=t}static init(e,n={},i){const s=[],r=document.querySelectorAll(i);for(let i=0;i(EventHandler.fixEvent(i,e),n.oneOff&&EventHandler.off(e,i.type,t),t.apply(e,[i]));return n}static njDelegationHandler(e,t,n){const i=s=>{const r=e.querySelectorAll(t);for(let t=s.target;t&&t!==this;t=t.parentNode)for(let o=r.length;o>=0;o--)if(r[o]===t)return EventHandler.fixEvent(s,t),i.oneOff&&EventHandler.off(e,s.type,n),n.apply(t,[s]);return null};return i}static findHandler(e,t,n=null){for(const i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;const s=e[i];if(s.originalHandler===t&&s.delegationSelector===n)return e[i]}return null}static normalizeParams(e,t,n){const s="string"==typeof t,o=s?n:t;let a=e.replace(EventHandler.STRIPNAME_REGEX,"");const l=i[a];l&&(a=l);return"string"==typeof r[a]||(a=e),[s,o,a]}static addHandler(e,t,n,i,s){if("string"!=typeof t||null==e)return;n||(n=i,i=null);const r=EventHandler.getEvent(e);for(const o of t.split(" ")){const[t,a,l]=EventHandler.normalizeParams(o,n,i),c=r[l]||(r[l]={}),d=EventHandler.findHandler(c,a,t?n:null);if(d)return void(d.oneOff=d.oneOff&&s);const u=EventHandler.getUidEvent(a,o.replace(EventHandler.NAMESPACE_REGEX,"")),h=t?EventHandler.njDelegationHandler(e,n,i):EventHandler.njHandler(e,n);h.delegationSelector=t?n:null,h.originalHandler=a,h.oneOff=s,h.uidEvent=u,c[u]=h,e.addEventListener(l,h,t)}}static removeHandler(e,t,n,i,s){const r=EventHandler.findHandler(t[n],i,s);null!==r&&(e.removeEventListener(n,r,Boolean(s)),delete t[n][r.uidEvent])}static removeNamespacedHandlers(e,t,n,i){const s=t[n]||{};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)&&r.indexOf(i)>-1){const i=s[r];EventHandler.removeHandler(e,t,n,i.originalHandler,i.delegationSelector)}}static on(e,t,n,i){EventHandler.addHandler(e,t,n,i,!1)}static one(e,t,n,i){EventHandler.addHandler(e,t,n,i,!0)}static off(e,t,n,i){if("string"!=typeof t||null==e)return;const[s,r,o]=EventHandler.normalizeParams(t,n,i),a=o!==t,l=EventHandler.getEvent(e);if(void 0!==r){if(!l||!l[o])return;return void EventHandler.removeHandler(e,l,o,r,s?n:null)}if("."===t.charAt(0))for(const n in l)Object.prototype.hasOwnProperty.call(l,n)&&EventHandler.removeNamespacedHandlers(e,l,n,t.substr(1));const c=l[o]||{};for(const n in c){if(!Object.prototype.hasOwnProperty.call(c,n))continue;const i=n.replace(EventHandler.STRIPUID_REGEX,"");if(!a||t.indexOf(i)>-1){const t=c[n];EventHandler.removeHandler(e,l,o,t.originalHandler,t.delegationSelector)}}}static trigger(e,t,n){if("string"!=typeof t||null==e)return null;const i=t.replace(EventHandler.STRIPNAME_REGEX,""),s="string"==typeof r[i],o=!0;let a=null;return s?(a=document.createEvent("HTMLEvents"),a.initEvent(i,o,!0)):a=new window.CustomEvent(t,{bubbles:o,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(a,e,{get:()=>n[e]})})),e.dispatchEvent(a),a}}class Accordion extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-accordion`;static DATA_KEY=`${n.KEY_PREFIX}.accordion`;static EVENT_KEY=`.${Accordion.DATA_KEY}`;static ACTIONS={expand:"accordion-expand",collapse:"accordion-collapse"};static SELECTOR={default:`.${Accordion.NAME}`,details:`details.${Accordion.NAME}-item`,expandAllBtn:`.${Accordion.NAME}__action[data-${Accordion.ACTIONS.expand}]`,collapseAllBtn:`.${Accordion.NAME}__action[data-${Accordion.ACTIONS.collapse}]`};constructor(e){super(Accordion,e),t.setData(e,Accordion.DATA_KEY,this),this.root=e,this.details=this.root.querySelectorAll(Accordion.SELECTOR.details),this.expandAllBtn=this.root.querySelector(Accordion.SELECTOR.expandAllBtn),this.collapseAllBtn=this.root.querySelector(Accordion.SELECTOR.collapseAllBtn),this.setListeners()}static init(e={}){return super.init(this,e,Accordion.SELECTOR.default)}dispose(){t.removeData(this.element,Accordion.DATA_KEY);for(let e=0,t=this.details.length;e{const n=e.getAttribute("name");"open"===t.newState&&this.root.querySelectorAll(`${Accordion.SELECTOR.details}[name=${n}][open]`).forEach((t=>{t!==e&&t.removeAttribute("open")}))}}clickOnAction(e){return()=>{this.details.forEach((t=>{e===Accordion.ACTIONS.expand?t.setAttribute("open",""):t.removeAttribute("open")}))}}}a={},function(e,t){function n(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=h}function i(){return e.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function s(t,i,s){var r=new n;return i&&(r.fill="both",r.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.getOwnPropertyNames(t).forEach((function(n){if("auto"!=t[n]){if(("number"==typeof r[n]||"duration"==n)&&("number"!=typeof t[n]||isNaN(t[n])))return;if("fill"==n&&-1==d.indexOf(t[n]))return;if("direction"==n&&-1==u.indexOf(t[n]))return;if("playbackRate"==n&&1!==t[n]&&e.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;r[n]=t[n]}})):r.duration=t,r}function r(e,t,n,i){return e<0||e>1||n<0||n>1?h:function(s){function r(e,t,n){return 3*e*(1-n)*(1-n)*n+3*t*(1-n)*n*n+n*n*n}if(s<=0){var o=0;return e>0?o=t/e:!t&&n>0&&(o=i/n),o*s}if(s>=1){var a=0;return n<1?a=(i-1)/(n-1):1==n&&e<1&&(a=(t-1)/(e-1)),1+a*(s-1)}for(var l=0,c=1;l=1)return 1;var i=1/e;return(n+=t*i)-n%i}}function a(e){g||(g=document.createElement("div").style),g.animationTimingFunction="",g.animationTimingFunction=e;var t=g.animationTimingFunction;if(""==t&&i())throw new TypeError(e+" is not a valid value for easing");return t}function l(e){if("linear"==e)return h;var t=v.exec(e);if(t)return r.apply(this,t.slice(1).map(Number));var n=T.exec(e);if(n)return o(Number(n[1]),E);var i=S.exec(e);return i?o(Number(i[1]),{start:m,middle:p,end:E}[i[2]]):f[e]||h}function c(e,t,n){if(null==t)return b;var i=n.delay+e+n.endDelay;return t=Math.min(n.delay+e,i)?y:N}var d="backwards|forwards|both|none".split("|"),u="reverse|alternate|alternate-reverse".split("|"),h=function(e){return e};n.prototype={_setMember:function(t,n){this["_"+t]=n,this._effect&&(this._effect._timingInput[t]=n,this._effect._timing=e.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=e.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(e){this._setMember("delay",e)},get delay(){return this._delay},set endDelay(e){this._setMember("endDelay",e)},get endDelay(){return this._endDelay},set fill(e){this._setMember("fill",e)},get fill(){return this._fill},set iterationStart(e){if((isNaN(e)||e<0)&&i())throw new TypeError("iterationStart must be a non-negative number, received: "+e);this._setMember("iterationStart",e)},get iterationStart(){return this._iterationStart},set duration(e){if("auto"!=e&&(isNaN(e)||e<0)&&i())throw new TypeError("duration must be non-negative or auto, received: "+e);this._setMember("duration",e)},get duration(){return this._duration},set direction(e){this._setMember("direction",e)},get direction(){return this._direction},set easing(e){this._easingFunction=l(a(e)),this._setMember("easing",e)},get easing(){return this._easing},set iterations(e){if((isNaN(e)||e<0)&&i())throw new TypeError("iterations must be non-negative, received: "+e);this._setMember("iterations",e)},get iterations(){return this._iterations}};var m=1,p=.5,E=0,f={ease:r(.25,.1,.25,1),"ease-in":r(.42,0,1,1),"ease-out":r(0,0,.58,1),"ease-in-out":r(.42,0,.58,1),"step-start":o(1,m),"step-middle":o(1,p),"step-end":o(1,E)},g=null,A="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",v=new RegExp("cubic-bezier\\("+A+","+A+","+A+","+A+"\\)"),T=/steps\(\s*(\d+)\s*\)/,S=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,b=0,_=1,y=2,N=3;e.cloneTimingInput=function(e){if("number"==typeof e)return e;var t={};for(var n in e)t[n]=e[n];return t},e.makeTiming=s,e.numericTimingToObject=function(e){return"number"==typeof e&&(e=isNaN(e)?{duration:0}:{duration:e}),e},e.normalizeTimingInput=function(t,n){return s(t=e.numericTimingToObject(t),n)},e.calculateActiveDuration=function(e){return Math.abs(function(e){return 0===e.duration||0===e.iterations?0:e.duration*e.iterations}(e)/e.playbackRate)},e.calculateIterationProgress=function(e,t,n){var i=c(e,t,n),s=function(e,t,n,i,s){switch(i){case _:return"backwards"==t||"both"==t?0:null;case N:return n-s;case y:return"forwards"==t||"both"==t?e:null;case b:return null}}(e,n.fill,t,i,n.delay);if(null===s)return null;var r=function(e,t,n,i,s){var r=s;return 0===e?t!==_&&(r+=n):r+=i/e,r}(n.duration,i,n.iterations,s,n.iterationStart),o=function(e,t,n,i,s,r){var o=e===1/0?t%1:e%1;return 0!==o||n!==y||0===i||0===s&&0!==r||(o=1),o}(r,n.iterationStart,i,n.iterations,s,n.duration),a=function(e,t,n,i){return e===y&&t===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,o,r),l=function(e,t,n){var i=e;if("normal"!==e&&"reverse"!==e){var s=t;"alternate-reverse"===e&&(s+=1),i="normal",s!==1/0&&s%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,a,o);return n._easingFunction(l)},e.calculatePhase=c,e.normalizeEasing=a,e.parseEasingFunction=l}(o={}),function(e,t){function n(e,t){return e in l&&l[e][t]||t}function i(e,t,i){if(!function(e){return"display"===e||0===e.lastIndexOf("animation",0)||0===e.lastIndexOf("transition",0)}(e)){var s=r[e];if(s)for(var a in o.style[e]=t,s){var l=s[a],c=o.style[l];i[l]=n(l,c)}else i[e]=n(e,t)}}function s(e){var t=[];for(var n in e)if(!(n in["easing","offset","composite"])){var i=e[n];Array.isArray(i)||(i=[i]);for(var s,r=i.length,o=0;o1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==s){if("add"==r||"accumulate"==r)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=r)throw new TypeError("Invalid composite mode "+r+".")}else r="easing"==s?e.normalizeEasing(r):""+r;i(s,r,n)}return null==n.offset&&(n.offset=null),null==n.easing&&(n.easing="linear"),n})),r=!0,o=-1/0,a=0;a=0&&e.offset<=1})),r||function(){var e=n.length;null==n[e-1].offset&&(n[e-1].offset=1),e>1&&null==n[0].offset&&(n[0].offset=0);for(var t=0,i=n[0].offset,s=1;s=e.applyFrom&&nthis._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(t,n){this._style[t]=n,this._isAnimatedProperty[t]=!0,this._updateSvgTransformAttr&&"transform"==e.unprefixedPropertyName(t)&&(null==this._savedTransformAttr&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",e.transformToSvgMatrix(n)))},_clear:function(t){this._style[t]=this._surrogateStyle[t],this._updateSvgTransformAttr&&"transform"==e.unprefixedPropertyName(t)&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[t]}},a)i.prototype[c]=function(e,t){return function(){var n=this._surrogateStyle[e].apply(this._surrogateStyle,arguments);return t&&(this._isAnimatedProperty[arguments[0]]||this._style[e].apply(this._style,arguments),this._updateIndices()),n}}(c,c in l);for(var d in document.documentElement.style)d in o||d in a||function(e){n(i.prototype,e,{get:function(){return this._surrogateStyle[e]},set:function(t){this._surrogateStyle[e]=t,this._updateIndices(),this._isAnimatedProperty&&!this._isAnimatedProperty[e]&&(this._style[e]=t)}})}(d);e.apply=function(t,n,i){s(t),t.style._set(e.propertyName(n),i)},e.clear=function(t,n){t._webAnimationsPatchedStyle&&t.style._clear(e.propertyName(n))}}(a),function(e){window.Element.prototype.animate=function(t,n){var i="";return n&&n.id&&(i=n.id),e.timeline._play(e.KeyframeEffect(this,t,n,i))}}(a),function(e,t){function n(e,t,i){if("number"==typeof e&&"number"==typeof t)return e*(1-i)+t*i;if("boolean"==typeof e&&"boolean"==typeof t)return i<.5?e:t;if(e.length==t.length){for(var s=[],r=0;r0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(e){e=+e,isNaN(e)||(t.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-e/this._playbackRate),this._currentTimePending=!1,this._currentTime!=e&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(e,!0),t.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(e){e=+e,isNaN(e)||this._paused||this._idle||(this._startTime=e,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),t.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(e){if(e!=this._playbackRate){var n=this.currentTime;this._playbackRate=e,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),t.applyDirtiedAnimation(this)),null!=n&&(this.currentTime=n)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),t.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,t.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),t.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(e,t){"function"==typeof t&&"finish"==e&&this._finishHandlers.push(t)},removeEventListener:function(e,t){if("finish"==e){var n=this._finishHandlers.indexOf(t);n>=0&&this._finishHandlers.splice(n,1)}},_fireEvents:function(e){if(this._isFinished){if(!this._finishedFlag){var t=new i(this,this._currentTime,e),n=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout((function(){n.forEach((function(e){e.call(t.target,t)}))}),0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(e,t){this._idle||this._paused||(null==this._startTime?t&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((e-this._startTime)*this.playbackRate)),t&&(this._currentTimePending=!1,this._fireEvents(e))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var e=this._effect._target;return e._activeAnimations||(e._activeAnimations=[]),e._activeAnimations},_markTarget:function(){var e=this._targetAnimations();-1===e.indexOf(this)&&e.push(this)},_unmarkTarget:function(){var e=this._targetAnimations(),t=e.indexOf(this);-1!==t&&e.splice(t,1)}}}(o,a),function(e,t,n){function i(e){var t=c;c=[],e1e-4?(f=.5/Math.sqrt(A),g=[(h[2][1]-h[1][2])*f,(h[0][2]-h[2][0])*f,(h[1][0]-h[0][1])*f,.25/f]):h[0][0]>h[1][1]&&h[0][0]>h[2][2]?g=[.25*(f=2*Math.sqrt(1+h[0][0]-h[1][1]-h[2][2])),(h[0][1]+h[1][0])/f,(h[0][2]+h[2][0])/f,(h[2][1]-h[1][2])/f]:h[1][1]>h[2][2]?(f=2*Math.sqrt(1+h[1][1]-h[0][0]-h[2][2]),g=[(h[0][1]+h[1][0])/f,.25*f,(h[1][2]+h[2][1])/f,(h[0][2]-h[2][0])/f]):(f=2*Math.sqrt(1+h[2][2]-h[0][0]-h[1][1]),g=[(h[0][2]+h[2][0])/f,(h[1][2]+h[2][1])/f,.25*f,(h[1][0]-h[0][1])/f]),[u,m,p,g,c]}}();e.dot=n,e.makeMatrixDecomposition=function(e){return[a(o(e))]},e.transformListToMatrix=o}(a),function(e){function t(e,t){var n=e.exec(t);if(n)return[n=e.ignoreCase?n[0].toLowerCase():n[0],t.substr(n.length)]}function n(e,t){var n=e(t=t.replace(/^\s*/,""));if(n)return[n[0],n[1].replace(/^\s*/,"")]}function i(e,t,n,i,s){for(var r=[],o=[],a=[],l=function(e,t){for(var n=e,i=t;n&&i;)n>i?n%=i:i%=n;return e*t/(n+i)}(i.length,s.length),c=0;c=1?t:"visible"}]}),["visibility"])}(a),function(e,t){function n(e){e=e.trim(),r.fillStyle="#000",r.fillStyle=e;var t=r.fillStyle;if(r.fillStyle="#fff",r.fillStyle=e,t==r.fillStyle){r.fillRect(0,0,1,1);var n=r.getImageData(0,0,1,1).data;r.clearRect(0,0,1,1);var i=n[3]/255;return[n[0]*i,n[1]*i,n[2]*i,i]}}function i(t,n){return[t,n,function(t){function n(e){return Math.max(0,Math.min(255,e))}if(t[3])for(var i=0;i<3;i++)t[i]=Math.round(n(t[i]/t[3]));return t[3]=e.numberToString(e.clamp(0,1,t[3])),"rgba("+t.join(",")+")"}]}var s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");s.width=s.height=1;var r=s.getContext("2d");e.addPropertiesHandler(n,i,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),e.consumeColor=e.consumeParenthesised.bind(null,n),e.mergeColors=i}(a),function(e,t){function n(e){function t(){var t=o.exec(e);r=t?t[0]:void 0}function n(){if("("!==r)return function(){var e=Number(r);return t(),e}();t();var e=s();return")"!==r?NaN:(t(),e)}function i(){for(var e=n();"*"===r||"/"===r;){var i=r;t();var s=n();"*"===i?e*=s:e/=s}return e}function s(){for(var e=i();"+"===r||"-"===r;){var n=r;t();var s=i();"+"===n?e+=s:e-=s}return e}var r,o=/([\+\-\w\.]+|[\(\)\*\/])/g;return t(),s()}function i(e,t){if("0"==(t=t.trim().toLowerCase())&&"px".search(e)>=0)return{px:0};if(/^[^(]*$|^calc/.test(t)){t=t.replace(/calc\(/g,"(");var i={};t=t.replace(e,(function(e){return i[e]=null,"U"+e}));for(var s="U("+e.source+")",r=t.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+s,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),o=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],a=0;a1?"calc("+n+")":n}]}var o="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",a=i.bind(null,new RegExp(o,"g")),l=i.bind(null,new RegExp(o+"|%","g")),c=i.bind(null,/deg|rad|grad|turn/g);e.parseLength=a,e.parseLengthOrPercent=l,e.consumeLengthOrPercent=e.consumeParenthesised.bind(null,l),e.parseAngle=c,e.mergeDimensions=r;var d=e.consumeParenthesised.bind(null,a),u=e.consumeRepeated.bind(void 0,d,/^/),h=e.consumeRepeated.bind(void 0,u,/^,/);e.consumeSizePairList=h;var m=e.mergeNestedRepeated.bind(void 0,s," "),p=e.mergeNestedRepeated.bind(void 0,m,",");e.mergeNonNegativeSizePair=m,e.addPropertiesHandler((function(e){var t=h(e);if(t&&""==t[1])return t[0]}),p,["background-size"]),e.addPropertiesHandler(l,s,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),e.addPropertiesHandler(l,r,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(a),function(e,t){function n(t){return e.consumeLengthOrPercent(t)||e.consumeToken(/^auto/,t)}function i(t){var i=e.consumeList([e.ignore(e.consumeToken.bind(null,/^rect/)),e.ignore(e.consumeToken.bind(null,/^\(/)),e.consumeRepeated.bind(null,n,/^,/),e.ignore(e.consumeToken.bind(null,/^\)/))],t);if(i&&4==i[0].length)return i[0]}var s=e.mergeWrappedNestedRepeated.bind(null,(function(e){return"rect("+e+")"}),(function(t,n){return"auto"==t||"auto"==n?[!0,!1,function(i){var s=i?t:n;if("auto"==s)return"auto";var r=e.mergeDimensions(s,s);return r[2](r[0])}]:e.mergeDimensions(t,n)}),", ");e.parseBox=i,e.mergeBoxes=s,e.addPropertiesHandler(i,s,["clip"])}(a),function(e,t){function n(e){return function(t){var n=0;return e.map((function(e){return e===c?t[n++]:e}))}}function i(e){return e}function s(t){if("none"==(t=t.toLowerCase().trim()))return[];for(var n,i=/\s*(\w+)\(([^)]*)\)/g,s=[],r=0;n=i.exec(t);){if(n.index!=r)return;r=n.index+n[0].length;var o=n[1],a=h[o];if(!a)return;var l=n[2].split(","),c=a[0];if(c.length900||t%100!=0))return t}),(function(e,n){return[e,n,t]}),["font-weight"])}(a),function(e){function t(e){var t={};for(var n in e)t[n]=-e[n];return t}function n(t){return e.consumeToken(/^(left|center|right|top|bottom)\b/i,t)||e.consumeLengthOrPercent(t)}function i(t,i){var s=e.consumeRepeated(n,/^/,i);if(s&&""==s[1]){var o=s[0];if(o[0]=o[0]||"center",o[1]=o[1]||"center",3==t&&(o[2]=o[2]||{px:0}),o.length==t){if(/top|bottom/.test(o[0])||/left|right/.test(o[1])){var a=o[0];o[0]=o[1],o[1]=a}if(/left|right|center|Object/.test(o[0])&&/top|bottom|center|Object/.test(o[1]))return o.map((function(e){return"object"==typeof e?e:r[e]}))}}}function s(i){var s=e.consumeRepeated(n,/^/,i);if(s){for(var o=s[0],a=[{"%":50},{"%":50}],l=0,c=!1,d=0;d=0&&this._cancelHandlers.splice(n,1)}else l.call(this,e,t)},r}}}(),function(e){var t=document.documentElement,n=null,i=!1;try{var s="0"==getComputedStyle(t).getPropertyValue("opacity")?"1":"0";(n=t.animate({opacity:[s,s]},{duration:1})).currentTime=0,i=getComputedStyle(t).getPropertyValue("opacity")==s}catch(e){}finally{n&&n.cancel()}if(!i){var r=window.Element.prototype.animate;window.Element.prototype.animate=function(t,n){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&t[Symbol.iterator]&&(t=Array.from(t)),Array.isArray(t)||null===t||(t=e.convertToArrayForm(t)),r.call(this,t,n)}}}(o);class Alert extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-alert`;static DATA_KEY=`${n.KEY_PREFIX}.alert`;static EVENT_KEY=`.${Alert.DATA_KEY}`;static SELECTOR={default:`.${Alert.NAME}`,dismiss:`.${Alert.NAME}__close`};static KEY_FRAMES=[{transform:"translateY(0)",opacity:1},{transform:"translateY(-16px)",opacity:0}];static EVENT={click:`${s.click}${Alert.EVENT_KEY}`,close:`${s.close}${Alert.EVENT_KEY}`,closed:`${s.closed}${Alert.EVENT_KEY}`};constructor(e){super(Alert,e),t.setData(e,Alert.DATA_KEY,this),this.setListeners()}closeAndDestroy(){EventHandler.trigger(this.element,Alert.EVENT.close),this.element.animate&&(this.element.animate(Alert.KEY_FRAMES,{duration:250,delay:100,easing:"ease-out"}).onfinish=()=>{this.destroyElement()})}async close(e){EventHandler.trigger(this.element,Alert.EVENT.close);this.element.animate&&this.element.animate(Alert.KEY_FRAMES,{duration:250,delay:100,easing:"ease-out"}),await new Promise((e=>setTimeout(e,350))),e()}dispose(){const e=this.element.querySelector(Alert.SELECTOR.dismiss);EventHandler.off(e,Alert.EVENT.click),t.removeData(this.element,Alert.DATA_KEY),this.element=null}destroyElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),EventHandler.trigger(this.element,Alert.EVENT.closed)}setListeners(){const e=this.element.querySelector(Alert.SELECTOR.dismiss);EventHandler.on(e,Alert.EVENT.click,(()=>{this.closeAndDestroy()}))}static init(e={}){return super.init(this,e,Alert.SELECTOR.default)}static getInstance(e){return t.getData(e,Alert.DATA_KEY)}}class AutocompleteInput extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-form-item--autocomplete`;static DATA_KEY=`${n.KEY_PREFIX}.autocomplete`;static SELECTOR={default:`.${AutocompleteInput.NAME}`,input:`.${n.KEY_PREFIX}-form-item__field`,list:`.${n.KEY_PREFIX}-form-item__list`};static EVENT={open:`${s.show}${AutocompleteInput.EVENT_KEY}`,onchange:`${s.onchange}${AutocompleteInput.EVENT_KEY}`,close:`${s.hide}${AutocompleteInput.EVENT_KEY}`};static CLASS_NAME={isOpen:`${n.KEY_PREFIX}-form-item--open`,hint:`${n.KEY_PREFIX}-form-item__list-item-hint`,active:"active"};static HIGHLIGHT_OPENING_TAG='';static HIGHLIGHT_CLOSING_TAG="";options={noResultMessage:"No results",singularResultsMessage:"{x} result",pluralResultsMessage:"{x} results",showResultNumber:!1};currentItemElements=[];isFiltered=!1;constructor(e){super(AutocompleteInput,e),this.dataList=JSON.parse(this.element.dataset.list),this.element.dataset.options&&(this.options={...this.options,...JSON.parse(this.element.dataset.options)}),this.listEl=this.element.querySelector(AutocompleteInput.SELECTOR.list),this.fieldEl=this.element.querySelector(AutocompleteInput.SELECTOR.input),this.itemTemplateEl=this.listEl.firstElementChild,this.itemElements=this.createItemElements(),this.hintEl=this.createHintElement(),this.liveZone=AutocompleteInput.createLiveResultElement(),this.element.prepend(this.liveZone),EventHandler.on(e,"keydown",this.onKeydown.bind(this)),EventHandler.on(e,"focusout",this.onFocusOut.bind(this)),EventHandler.on(this.fieldEl,"click",(()=>{this.isFiltered=!1,this.isOpen=!this.isOpen})),EventHandler.on(this.fieldEl,"input",(()=>{this.updateList()})),t.setData(e,AutocompleteInput.DATA_KEY,this)}get isOpen(){return!this.listEl.hasAttribute("hidden")}set isOpen(e){e?(this.element.classList.add(AutocompleteInput.CLASS_NAME.isOpen),this.listEl.removeAttribute("hidden"),this.fieldEl.setAttribute("aria-expanded","true"),this.updateList(),this.setActiveOption(),EventHandler.trigger(this.element,AutocompleteInput.EVENT.open)):(this.element.classList.remove(AutocompleteInput.CLASS_NAME.isOpen),this.listEl.setAttribute("hidden","hidden"),this.fieldEl.setAttribute("aria-expanded","false"),this.fieldEl.removeAttribute("aria-activedescendant"),this.unselectOption(),EventHandler.trigger(this.element,AutocompleteInput.EVENT.close))}selectMatchingOption(){const e=this.matchingId??this.currentItemElements[0]?.id;this.currentItemElements.forEach((t=>{t.setAttribute("aria-selected",t.id===e?"true":"false"),t.id===e&&this.fieldEl.setAttribute("aria-activedescendant",t.id)}))}getFilteredItemElements(){return this.itemElements.filter((e=>!this.isFiltered||AutocompleteInput.compareText(e.dataset.name,this.fieldEl.value))).slice(0,this.options.limit)}updateList(){this.currentItemElements=this.getFilteredItemElements(),this.currentItemElements.length?(this.currentItemElements.forEach((e=>{e.innerHTML=AutocompleteInput.getElementInnerHtml(e.dataset.name,this.isFiltered?this.fieldEl.value:"")})),this.options.showResultNumber&&this.isFiltered?(this.hintEl.innerHTML=this.createResultsMessageContent(),this.listEl.replaceChildren(this.hintEl,...this.currentItemElements)):this.listEl.replaceChildren(...this.currentItemElements),this.liveZone.innerHTML=this.createResultsMessageContent(!0)):(this.hintEl.innerHTML=this.createResultsMessageContent(),this.listEl.replaceChildren(this.hintEl),this.liveZone.innerHTML=this.createResultsMessageContent(!0))}getNextOptionIndex(e,t){return e>=t-1?0:e+1}getPreviousOptionIndex(e,t){return e<=0?t-1:e-1}selectOption(e){const t=this.currentItemElements;if(t.length){const n=this.matchingId;let i=-1;const s=t.findIndex(((e,t)=>(e.id===n&&(i=t),"true"===e.getAttribute("aria-selected")))),r=e(s>=0?s:i,t.length);t.forEach(((e,t)=>{e.setAttribute("aria-selected",t===r?"true":"false"),t===r&&(e.scrollIntoView({block:"nearest"}),this.fieldEl.setAttribute("aria-activedescendant",e.id))}))}}get matchingId(){return this.itemElements.find((e=>e.dataset.name===this.fieldEl.value))?.id??null}setActiveOption(){this.itemElements.forEach((e=>{this.matchingId===e.id?(e.classList.add(AutocompleteInput.CLASS_NAME.active),e.scrollIntoView({block:"nearest"})):e.classList.remove(AutocompleteInput.CLASS_NAME.active)}))}unselectOption(){this.currentItemElements.forEach((e=>e.setAttribute("aria-selected","false")))}onKeydown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this.isOpen?this.selectOption(this.getNextOptionIndex):(this.isFiltered=!1,this.updateList(),this.isOpen=!0,this.selectMatchingOption());break;case"ArrowUp":e.preventDefault(),this.isOpen&&this.selectOption(this.getPreviousOptionIndex);break;case"Escape":e.preventDefault(),this.isOpen&&(this.isOpen=!1,this.fieldEl.focus());break;case"Enter":this.selectCurrentSuggestion(),this.isOpen=!1;break;default:!("Backspace"!==e.key&&1!==e.key.length||e.metaKey||e.altKey||e.ctrlKey)&&(this.isFiltered=!0,this.unselectOption(),setTimeout((()=>{this.setActiveOption()})),this.isOpen||(this.isOpen=!0))}}selectCurrentSuggestion(){const e=this.fieldEl.getAttribute("aria-activedescendant");if(!e)return;const t=this.currentItemElements.find((t=>t.id===e)),n=t.dataset.name,i=t.dataset.value;this.fieldEl.value=n,EventHandler.trigger(this.element,AutocompleteInput.EVENT.onchange,{name:n,value:i})}onFocusOut(e){this.element.contains(e.relatedTarget)||(this.isOpen=!1)}static createLiveResultElement(){const e=document.createElement("div");return e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.classList.add("nj-sr-only"),e}createItemElements(){return this.dataList.map(((e,t)=>{const n=this.itemTemplateEl.cloneNode();return n.innerHTML=e.name,n.dataset.name=e.name,n.dataset.value=e.value,n.setAttribute("id",`${this.fieldEl.getAttribute("id")}-option-${t}`),EventHandler.on(n,"click",(()=>{this.isOpen=!1,this.fieldEl.value=e.name,EventHandler.trigger(this.element,AutocompleteInput.EVENT.onchange,{name:e.name,value:e.value})})),n}))}createHintElement(){const e=this.itemTemplateEl.cloneNode();return e.className=AutocompleteInput.CLASS_NAME.hint,e.innerHTML=this.options.noResultMessage,e.setAttribute("aria-hidden","true"),e}createResultsMessageContent(e=!1){const t=this.currentItemElements;let n;return n=0===t.length?this.options.noResultMessage:`${1===t.length?this.options.singularResultsMessage.replace("{x}",t.length.toString()):this.options.pluralResultsMessage.replace("{x}",t.length.toString())}`,e?`

${n}

`:n}static init(e={}){return super.init(this,e,AutocompleteInput.SELECTOR.default)}dispose(){t.removeData(this.element,AutocompleteInput.DATA_KEY)}static getElementInnerHtml(e,t){if(void 0===t||""===t?.trim())return e;const n=new RegExp(AutocompleteInput.normalizeString(t),"gi"),i=AutocompleteInput.normalizeString(e).matchAll(n);let s=e,r=0;if(i)for(const e of i){const n=r+e.index,i=s.slice(0,n),o=s.slice(n,n+t.length),a=s.slice(n+t.length,s.length);s=`${i}${this.HIGHLIGHT_OPENING_TAG}${o}${this.HIGHLIGHT_CLOSING_TAG}${a}`,r=r+AutocompleteInput.HIGHLIGHT_OPENING_TAG.length+AutocompleteInput.HIGHLIGHT_CLOSING_TAG.length}return`${s}`}static compareText(e,t){e=AutocompleteInput.normalizeString(e),t=(t=AutocompleteInput.normalizeString(t)).replace(/\(|\)|\\/gi,"");const n=new RegExp(t,"gi");return-1!==e.search(n)}static normalizeString(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}static getInstance(e){return t.getData(e,AutocompleteInput.DATA_KEY)}setOptions(e){this.dataList=e,this.itemElements=this.createItemElements(),this.updateList(),this.selectMatchingOption()}}const l={getDataAttributes(e){if(null==e)return{};let t={};if(Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset"))t={...e.dataset};else for(let n=0;ne.charAt(1).toUpperCase()));t[e]=i.nodeValue}}return Object.keys(t).forEach((e=>{var n;t[e]="true"===(n=t[e])||"false"!==n&&("null"===n?null:n===Number(n).toString()?Number(n):""===n?null:n)})),t},toggleClass(e,t){null!=e&&(e.classList.contains(t)?e.classList.remove(t):e.classList.add(t))},mergeExtended(e,t,n){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n&&"[object Object]"===Object.prototype.toString.call(t[i])?e[i]=l.extend(e[i],t[i]):e[i]=t[i]);return e},extend(...e){let t={},n=!1,i=0;for("[object Boolean]"===Object.prototype.toString.call(e[0])&&(n=e[0],i++);i(new DOMParser).parseFromString(e,"text/html").body.firstChild};const c={TRANSITION_END:"transitionend",getUID(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},getSelectorFromElement(e){let t=e.getAttribute("data-target");if(!t||"#"===t){const n=e.getAttribute("href");t=n&&"#"!==n?n.trim():""}try{return document.querySelector(t)?t:null}catch(e){return null}},getTransitionDurationFromElement(e){if(!e)return 0;let t=window.getComputedStyle(e).transitionDuration,n=window.getComputedStyle(e).transitionDelay;const i=parseFloat(t),s=parseFloat(n);return i||s?(t=t.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(t)+parseFloat(n))):0},reflow:e=>e.offsetHeight,triggerTransitionEnd(e){const t=new CustomEvent(c.TRANSITION_END,{});e.dispatchEvent(t)},isElement:e=>(e[0]||e).nodeType,emulateTransitionEnd(e,t){let n=!1;const i=t+5;e.addEventListener(c.TRANSITION_END,(function t(){n=!0,e.removeEventListener(c.TRANSITION_END,t)})),setTimeout((()=>{n||c.triggerTransitionEnd(e)}),i)},typeCheckConfig(e,t,n){for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)){const r=n[s],o=t[s],a=o&&c.isElement(o)?"element":(i=o,{}.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(r).test(a))throw new Error(`${e.toUpperCase()}: Option "${s}" provided type "${a}" but expected type "${r}".`)}var i},makeArray:e=>null==e?[]:[].slice.call(e),findShadowRoot(e){if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?c.findShadowRoot(e.parentElement):null},throttle(e,t,n,i,s){let r,o,a,l=null,c=0;const d=()=>{c=Date.now(),l=null,a=e.apply(o,r)};return()=>{const u=Date.now();c||n||(c=u);const h=t-(u-c);return o=s||this,r=arguments,h<=0?(clearTimeout(l),l=null,c=u,a=e.apply(o,r)):!l&&i&&(l=setTimeout(d,h)),a}},coerceBool:e=>Boolean(e)};class Collapse extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-collapse`;static DATA_KEY=`${n.KEY_PREFIX}.collapse`;static EVENT_KEY=`.${Collapse.DATA_KEY}`;static DATA_API_KEY=n.KEY_PREFIX;static hasInit=!1;static CLASS_NAME={show:"show",collapse:`${n.KEY_PREFIX}-collapse`,collapsing:`${n.KEY_PREFIX}-collapsing`,collapsed:`${n.KEY_PREFIX}-collapsed`};static EVENT={show:`${s.show}${Collapse.EVENT_KEY}`,shown:`${s.shown}${Collapse.EVENT_KEY}`,hide:`${s.hide}${Collapse.EVENT_KEY}`,hidden:`${s.hidden}${Collapse.EVENT_KEY}`,clickDataApi:`${s.click}${Collapse.EVENT_KEY}${Collapse.DATA_API_KEY}`};static DEFAULT_OPTIONS={toggle:!1,parent:""};static DEFAULT_TYPE={toggle:"boolean",parent:"(string|element)"};static DIMENSION={width:"width",height:"height"};static SELECTOR={default:`.${Collapse.CLASS_NAME.collapse}`,actives:`.${Collapse.CLASS_NAME.show}, .${Collapse.CLASS_NAME.collapsing}`,dataToggle:'[data-toggle="collapse"]'};constructor(e,n={}){super(Collapse,e,Collapse.getOptions(n)),this.element=e,this.isTransitioning=!1,this.triggerArray=c.makeArray(document.querySelectorAll(`${Collapse.SELECTOR.dataToggle}[href="#${e.id}"],${Collapse.SELECTOR.dataToggle}[data-target="#${e.id}"]`));const i=c.makeArray(document.querySelectorAll(Collapse.SELECTOR.dataToggle));for(let t=0,n=i.length;tt===e));null!==s&&r.length&&(this.selector=s,this.triggerArray.push(n))}this.parent=this.options.parent?this.getParent():null,this.options.parent||this.addAriaAndCollapsedClass(this.element,this.triggerArray),this.options.toggle&&this.toggle(),t.setData(e,Collapse.DATA_KEY,this),Collapse.hasInit||(Collapse.hasInit=!0,this.registerEvents())}toggle(){this.element.classList.contains(Collapse.CLASS_NAME.show)?this.hide():this.show()}show(){if(this.isTransitioning||this.element.classList.contains(Collapse.CLASS_NAME.show))return;let e,n;this.parent&&(e=c.makeArray(this.parent.querySelectorAll(Collapse.SELECTOR.actives)).filter((e=>"string"==typeof this.options.parent?e.getAttribute("data-parent")===this.options.parent:e.classList.contains(Collapse.CLASS_NAME.collapse))),0===e.length&&(e=null));const i=document.querySelector(this.selector);if(e){const s=e.filter((e=>i!==e));if(n=s[0]?t.getData(s[0],Collapse.DATA_KEY):null,n&&n.isTransitioning)return}if(EventHandler.trigger(this.element,Collapse.EVENT.show).defaultPrevented)return;e&&e.forEach((e=>{i!==e&&Collapse.collapseInterface(e,"hide"),n||t.setData(e,Collapse.DATA_KEY,null)}));const s=this.getDimension();this.element.classList.remove(Collapse.CLASS_NAME.collapse),this.element.classList.add(Collapse.CLASS_NAME.collapsing),this.element.style[s]=0,this.triggerArray.length&&this.triggerArray.forEach((e=>{e.classList.remove(Collapse.CLASS_NAME.collapsed),e.setAttribute("aria-expanded","true")})),this.setTransitioning(!0);const r=`scroll${s[0].toUpperCase()+s.slice(1)}`,o=c.getTransitionDurationFromElement(this.element);EventHandler.one(this.element,c.TRANSITION_END,(()=>{this.element.classList.remove(Collapse.CLASS_NAME.collapsing),this.element.classList.add(Collapse.CLASS_NAME.collapse),this.element.classList.add(Collapse.CLASS_NAME.show),this.element.style[s]="",this.setTransitioning(!1),EventHandler.trigger(this.element,Collapse.EVENT.shown)})),c.emulateTransitionEnd(this.element,o),this.element.style[s]=`${this.element[r]}px`}hide(){if(this.isTransitioning||!this.element.classList.contains(Collapse.CLASS_NAME.show))return;if(EventHandler.trigger(this.element,Collapse.EVENT.hide).defaultPrevented)return;const e=this.getDimension();this.element.style[e]=`${this.element.getBoundingClientRect()[e]}px`,c.reflow(this.element),this.element.classList.add(Collapse.CLASS_NAME.collapsing),this.element.classList.remove(Collapse.CLASS_NAME.collapse),this.element.classList.remove(Collapse.CLASS_NAME.show);const t=this.triggerArray.length;if(t>0)for(let e=0;e{this.setTransitioning(!1),this.element.classList.remove(Collapse.CLASS_NAME.collapsing),this.element.classList.add(Collapse.CLASS_NAME.collapse),EventHandler.trigger(this.element,Collapse.EVENT.hidden)})),c.emulateTransitionEnd(this.element,n)}setTransitioning(e){this.isTransitioning=e}dispose(){t.removeData(this.element,Collapse.DATA_KEY),this.options=null,this.parent=null,this.element=null,this.triggerArray=null,this.isTransitioning=null}getDimension(){return this.element.classList.contains(Collapse.DIMENSION.width)?Collapse.DIMENSION.width:Collapse.DIMENSION.height}getParent(){let e;c.isElement(this.options.parent)?e=this.options.parent:this.options.parent&&(e=document.querySelector(this.options.parent));const t=`[data-toggle="collapse"][data-parent="${this.options.parent}"]`;return c.makeArray(e.querySelectorAll(t)).forEach((e=>{this.addAriaAndCollapsedClass(Collapse.getTargetFromElement(e),[e])})),e}addAriaAndCollapsedClass(e,t){if(e){const n=e.classList.contains(Collapse.CLASS_NAME.show);t.length&&t.forEach((e=>{n?e.classList.remove(Collapse.CLASS_NAME.collapsed):e.classList.add(Collapse.CLASS_NAME.collapsed),e.setAttribute("aria-expanded",n)}))}}static getOptions(e){return(e={...Collapse.DEFAULT_OPTIONS,...e}).toggle=Boolean(e.toggle),c.typeCheckConfig(Collapse.NAME,e,Collapse.DEFAULT_TYPE),e}static getTargetFromElement(e){const t=c.getSelectorFromElement(e);return t?document.querySelector(t):null}static collapseInterface(e,n){let i=t.getData(e,Collapse.DATA_KEY);const s={...Collapse.DEFAULT_OPTIONS,...l.getDataAttributes(e),..."object"==typeof n&&n?n:{}};if(!i&&s.toggle&&/show|hide/.test(n)&&(s.toggle=!1),i||(i=new Collapse(e,s)),"string"==typeof n){if(void 0===i[n])throw new Error(`No method named "${n}"`);i[n]()}}static getInstance(e){return t.getData(e,Collapse.DATA_KEY)}static init(e={}){return super.init(this,e,Collapse.SELECTOR.default)}registerEvents(){EventHandler.on(document,Collapse.EVENT.clickDataApi,Collapse.SELECTOR.dataToggle,(function(e){"A"===e.target.tagName&&e.preventDefault();const t=l.getDataAttributes(this),n=c.getSelectorFromElement(this);c.makeArray(document.querySelectorAll(n)).forEach((e=>{const n=Collapse.getInstance(e);let i;n?(null===n.parent&&"string"==typeof t.parent&&(n.options.parent=t.parent,n.parent=n.getParent()),i="toggle"):i=t,Collapse.collapseInterface(e,i)}))}))}}class Dropdown extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-dropdown`;static DATA_KEY=`${n.KEY_PREFIX}.dropdown`;static EVENT_KEY=`.${Dropdown.DATA_KEY}`;static DATA_API_KEY=n.KEY_PREFIX;static ESCAPE_KEYCODE=27;static ATTRIBUTE={content:"data-content",selectedContent:"data-selected-content",value:"data-value"};static CLASS_NAME={isFilled:`${Dropdown.NAME}__label--is-filled`,shownCollapse:`${Dropdown.NAME}--shown-collapse`};static SELECTOR={default:`.${Dropdown.NAME}`,input:"input",label:`.${Dropdown.NAME}__label`,options:`.${Dropdown.NAME} [${Dropdown.ATTRIBUTE.value}]`};static EVENT={clickDataApi:`${s.mousedown}${Dropdown.EVENT_KEY}${Dropdown.DATA_API_KEY}`,keydownDismiss:`${s.keydown}.dismiss${Dropdown.EVENT_KEY}`,onchange:`${s.onchange}${Dropdown.EVENT_KEY}`};constructor(e){super(Dropdown,e),t.setData(e,Dropdown.DATA_KEY,this),this.addBlurEvent(),this.addTouchEvent(),this.registerEvents()}closeMenu(){this.element.classList.contains(Dropdown.CLASS_NAME.shownCollapse)&&this.element.click()}dispose(){t.removeData(this.element,Dropdown.DATA_KEY),this.element=null}static handleCollapseShow(e){e.target.closest(Dropdown.SELECTOR.default).classList.add(Dropdown.CLASS_NAME.shownCollapse)}static handleCollapseHide(e){e.target.closest(Dropdown.SELECTOR.default).classList.remove(Dropdown.CLASS_NAME.shownCollapse)}static getInstance(e){return t.getData(e,Dropdown.DATA_KEY)}static init(e={}){return super.init(this,e,Dropdown.SELECTOR.default)}addTouchEvent(){EventHandler.on(this.element,Dropdown.EVENT.keydownDismiss,(e=>{e.which===Dropdown.ESCAPE_KEYCODE&&(e.preventDefault(),this.closeMenu())}))}addBlurEvent(){EventHandler.on(this.element,"blur",(()=>{this.closeMenu()}))}registerEvents(){EventHandler.on(document,Collapse.EVENT.show,Dropdown.SELECTOR.default,(e=>{Dropdown.handleCollapseShow(e)})),EventHandler.on(document,Collapse.EVENT.hidden,Dropdown.SELECTOR.default,(e=>{Dropdown.handleCollapseHide(e)})),EventHandler.on(document,Dropdown.EVENT.clickDataApi,Dropdown.SELECTOR.options,(e=>{const t=e.target.closest(`[${Dropdown.ATTRIBUTE.value}]`),n=e.target.closest(Dropdown.SELECTOR.default),i=t.querySelector(`[${Dropdown.ATTRIBUTE.content}]`),s=n.querySelector(Dropdown.SELECTOR.input),r=t.getAttribute(Dropdown.ATTRIBUTE.value),o=i?i.textContent:t.textContent;s.value=r,n.setAttribute(Dropdown.ATTRIBUTE.selectedContent,o),this.value=r,EventHandler.trigger(this.element,Dropdown.EVENT.onchange)}))}}class Fab extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-fab-menu`;static DATA_KEY=`${n.KEY_PREFIX}.fab`;static EVENT_KEY=`.${Fab.DATA_KEY}`;static SELECTOR={default:`.${Fab.NAME}`,button:`.${n.KEY_PREFIX}-fab`,item:`.${n.KEY_PREFIX}-fab__item`};static EVENT={click:`${s.click}${Fab.EVENT_KEY}`,mouseenter:`${s.mouseenter}${Fab.EVENT_KEY}`,mouseleave:`${s.mouseleave}${Fab.EVENT_KEY}`};static DURATION_PER_ITEM=35;static ITEMS_HEIGHT=3.8;static OPEN_CLASS="active";static STAGGER_DELAY=70;constructor(e,n){super(Fab,e),this.buttons=this.element.querySelectorAll(Fab.SELECTOR.button),this.items=this.element.querySelectorAll(Fab.SELECTOR.item),this.button=this.buttons[0],this.setOptions(n),this.element=e,this.setDefaultAriaAttribute(),this.setListeners(),t.setData(e,Fab.DATA_KEY,this)}open(){let e;const t=this.options.menuPosition,n=Fab.DURATION_PER_ITEM*this.items.length;l.toggleClass(this.button,Fab.OPEN_CLASS);const i=this.button.classList.contains(Fab.OPEN_CLASS);this.button.setAttribute("aria-expanded",i.toString());const s="top"===t||"bottom"===t?"translateY":"translateX",r="top"===t||"left"===t?"-":"";for(e=0;ethis.open()))}setOptions(e){const t=this.element.getAttribute("data-placement");this.options={menuPosition:t},this.options=l.extend(this.options,e),["top","right","bottom","left"].indexOf(this.options.menuPosition)<0&&(this.options.menuPosition="top")}getOptions(){return this.options}setDefaultAriaAttribute(){this.button.setAttribute("aria-expanded","false")}dispose(){t.removeData(this.element,Fab.DATA_KEY),this.element=null}static getInstance(e){return t.getData(e,Fab.DATA_KEY)}static init(e={}){return super.init(this,e,Fab.SELECTOR.default)}}class Autocomplete extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-form-autocomplete`;static DATA_KEY=`${n.KEY_PREFIX}.autocomplete`;static SELECTOR={default:`.${Autocomplete.NAME}`,input:"input",list:`.${Autocomplete.NAME}__list`,listGroup:`.${Autocomplete.NAME}__list > :first-child`};options={autocomplete:!0,limit:!1};onUserSelectItem=()=>{};constructor(e,n={}){if(super(Autocomplete,e,n),e.querySelector(Autocomplete.SELECTOR.listGroup)){const t=e.querySelector(`${Autocomplete.SELECTOR.listGroup}`).innerHTML;this.listFragment=document.createRange().createContextualFragment(t),this.root=e.parentElement.dataset.list||e.parentElement.dataset.options?e.parentElement:e,this.root.dataset.list&&(this.dataList=JSON.parse(this.root.dataset.list),this.list=this.dataList),this.root.dataset.options&&(this.options={...this.options,...JSON.parse(this.root.dataset.options)}),this.root[Autocomplete.NAME.replace(/-/g,"_")]=this,e.querySelector(Autocomplete.SELECTOR.list).addEventListener("click",this.onSelectListItem)}e.querySelector(Autocomplete.SELECTOR.input).addEventListener("input",this.onInputChange),e.addEventListener("keydown",this.onKeyDown),t.setData(e,Autocomplete.DATA_KEY,this)}static init(e={}){return super.init(this,e,Autocomplete.SELECTOR.default)}dispose(){this.element&&this.element.querySelector(Autocomplete.SELECTOR.list)&&this.element.querySelector(Autocomplete.SELECTOR.list).removeEventListener("click",this.onSelectListItem),this.element&&this.element.querySelector(Autocomplete.SELECTOR.input)&&this.element.querySelector(Autocomplete.SELECTOR.input).removeEventListener("input",this.onInputChange),this.element.removeEventListener("keydown",this.onKeyDown),t.removeData(this.element,Autocomplete.DATA_KEY),this.dataList=null,this.currentList=null,this.element=null}set data(e){this.dataList=e}get data(){return this.dataList}get list(){return this.currentList}set list(e){const t=this.element.querySelector(Autocomplete.SELECTOR.input).value;if(e&&e.length){const n=document.createDocumentFragment();this.currentList=[],e.forEach((({name:e,value:i})=>{if((!this.options.autocomplete||Autocomplete.compareText(e,t))&&(!this.options.limit||"number"==typeof this.options.limit&&n.children.length{this.list=this.dataList};onKeyDown=e=>{const t=this.element.querySelector(Autocomplete.SELECTOR.list),n=this.element.querySelectorAll(`${Autocomplete.SELECTOR.listGroup}> *`),i=parseInt(t.dataset.index,10),s=this.element.querySelector(Autocomplete.SELECTOR.input),r=()=>{t.style.display="block",s.setAttribute("aria-expanded","true"),this.element.setAttribute("aria-expanded","true")},o=()=>{delete t.dataset.index,t.style.setProperty("display",""),s.setAttribute("aria-expanded","false"),this.element.setAttribute("aria-expanded","false")};switch(e.key){case"ArrowUp":e.preventDefault(),r(),t.dataset.index&&(t.dataset.index=(i-1<0?n.length-1:i-1).toString(),n[t.dataset.index].focus());break;case"ArrowDown":e.preventDefault(),r(),t.dataset.index?t.dataset.index=(i{const{name:t,value:n}=e.target.dataset,i=this.element.querySelector(Autocomplete.SELECTOR.input);t&&(i.value=t),n&&(this.root.dataset.value=n,i.dataset.value=n),this.onUserSelectItem({name:t,value:n})};static getInstance(e){return t.getData(e,Autocomplete.DATA_KEY)}}class PasswordInput extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-form-input-password`;static DATA_KEY=`${n.KEY_PREFIX}.password-input`;static SELECTOR={default:`.${PasswordInput.NAME}`};static INPUT_CLASS=`${n.KEY_PREFIX}-form-control`;static REVEAL_BUTTON_CLASS=`${n.KEY_PREFIX}-form-control__password-off`;static HIDE_BUTTON_CLASS=`${n.KEY_PREFIX}-form-control__password-on`;static DEFAULT_OPTIONS={selector:PasswordInput.SELECTOR};constructor(e,n={}){super(PasswordInput,e,l.extend(!0,PasswordInput.DEFAULT_OPTIONS,n)),this.setListeners(),t.setData(e,PasswordInput.DATA_KEY,this)}static init(e={}){return super.init(this,e,PasswordInput.SELECTOR.default)}static getInstance(e){return t.getData(e,PasswordInput.DATA_KEY)}dispose(){t.removeData(this.element,PasswordInput.DATA_KEY),this.element=null}setListeners(){const e=this.element.getElementsByClassName(PasswordInput.INPUT_CLASS)[0],t=this.element.getElementsByClassName(PasswordInput.REVEAL_BUTTON_CLASS)[0];EventHandler.on(t,"click",(()=>{this.element.classList.add("is-visible"),e.type="text"}));const n=this.element.getElementsByClassName(PasswordInput.HIDE_BUTTON_CLASS)[0];EventHandler.on(n,"click",(()=>{this.element.classList.remove("is-visible"),e.type="password"}))}}const d={describe:e=>void 0===e?"undefined":0===e.length?"(no matching elements)":`${e.outerHTML.split(">")[0]}>`,assert(e,t,n){if(t)throw void 0!==e&&(e.style.border="1px solid red"),console.error(n,e),n},isChar:e=>void 0===e.which||"number"==typeof e.which&&e.which>0&&(!e.ctrlKey&&!e.metaKey&&!e.altKey&&8!==e.which&&9!==e.which&&13!==e.which&&16!==e.which&&17!==e.which&&20!==e.which&&27!==e.which)};class AbstractFormBase extends AbstractComponent{static CLASS_NAME={njFormGroup:"nj-form-group",isFilled:"is-filled",isFocused:"is-focused"};static SELECTOR={formGroup:`.${AbstractFormBase.CLASS_NAME.njFormGroup}`};constructor(e,t,n={},i={}){super(e,t,n);for(const e in i)!{}.hasOwnProperty.call(i,e)?console.error(`${e} does not exist in properties`):this[e]=i[e]}addFormGroupFocus(){this.element&&!0==!this.element.disabled&&this.njFormGroup.classList.add(AbstractFormBase.CLASS_NAME.isFocused)}removeFormGroupFocus(){this.njFormGroup.classList.remove(AbstractFormBase.CLASS_NAME.isFocused)}addIsFilled(){this.njFormGroup.classList.add(AbstractFormBase.CLASS_NAME.isFilled)}removeIsFilled(){this.njFormGroup.classList.remove(AbstractFormBase.CLASS_NAME.isFilled)}findFormGroup(e=!0){const t=this.element.closest(AbstractFormBase.SELECTOR.formGroup);return null===t&&e&&console.error(`Failed to find ${AbstractFormBase.SELECTOR.formGroup} for ${d.describe(this.element)}`),t}}class AbstractFormBaseInput extends AbstractFormBase{static CLASS_NAME={njFormGroup:"nj-form-group",njLabel:"nj-label",njLabelStatic:"nj-label-static",njLabelPlaceholder:"nj-label-placeholder",njLabelFloating:"nj-label-floating",hasDanger:"has-danger",isFilled:"is-filled",isFocused:"is-focused",inputGroup:"input-group"};static INPUT_SELECTOR={njFormGroup:`.${AbstractFormBaseInput.CLASS_NAME.njFormGroup}`,njLabelWildcard:`label[class^='${AbstractFormBaseInput.CLASS_NAME.njLabel}'], label[class*=' ${AbstractFormBaseInput.CLASS_NAME.njLabel}']`};static DEFAULT_OPTIONS={validate:!1,njFormGroup:{template:"span",templateClass:`${AbstractFormBaseInput.CLASS_NAME.njFormGroup}`},label:{required:!1,selectors:[".form-control-label",":scope > label"],className:AbstractFormBaseInput.CLASS_NAME.njLabelStatic},requiredClasses:[],convertInputSizeVariations:!0};static FORM_CONTROL_SIZE_MARKERS={"form-control-lg":"nj-form-group-lg","form-control-sm":"nj-form-group-sm"};constructor(e,t,n={},i={}){super(e,t,l.extend(!0,AbstractFormBaseInput.DEFAULT_OPTIONS,n),i),this.njFormGroup=this.resolveNJFormGroup(),this.njFormGroup&&(this.resolveNJLabel(),this.resolveNJFormGroupSizing(),this.addFocusListener(),this.addChangeListener(),this.isEmpty()?this.removeIsFilled():this.addIsFilled())}dispose(){EventHandler.off(this.element,"focus"),EventHandler.off(this.element,"blur"),EventHandler.off(this.element,"keydown"),EventHandler.off(this.element,"keyup")}addFocusListener(){EventHandler.on(this.element,"focus",(()=>{this.addFormGroupFocus()})),EventHandler.on(this.element,"blur",(()=>{this.removeFormGroupFocus()}))}addChangeListener(){EventHandler.on(this.element,"keydown",(e=>{d.isChar(e)&&this.addIsFilled()})),EventHandler.on(this.element,"keyup",(()=>{if(this.isEmpty()?this.removeIsFilled():this.addIsFilled(),this.options.validate){void 0===this.element[0].checkValidity||this.element[0].checkValidity()?this.removeHasDanger():this.addHasDanger()}}))}addHasDanger(){this.njFormGroup.classList.add(AbstractFormBaseInput.CLASS_NAME.hasDanger)}removeHasDanger(){this.njFormGroup.classList.remove(AbstractFormBaseInput.CLASS_NAME.hasDanger)}isEmpty(){return null===this.element.value||void 0===this.element.value||""===this.element.value}resolveNJFormGroup(){return this.findFormGroup(this.options.njFormGroup.required)}outerElement(){return this.element}resolveNJLabel(){let e=this.njFormGroup.querySelectorAll(AbstractFormBaseInput.INPUT_SELECTOR.njLabelWildcard);0===e.length&&(e=this.findLabel(this.options.label.required),null!==e&&e.length>1&&e.forEach((e=>{e.classList.add(this.options.label.className)})))}findLabel(e=!0){let t,n=null,i=0,s=!1;do{t=this.options.label.selectors[i];try{n=this.njFormGroup.querySelectorAll(t)}catch(e){n=null}s=null!==n&&n.length>0,i++}while(!s&&i{t>0&&e.previousElementSibling.addEventListener("click",this.togglePanelShow.bind(this))})),e.querySelectorAll(`.${Header.CLASS_NAME.backPanel}`).forEach((e=>{e.addEventListener("click",this.closeCurrentPanel.bind(this))}))),"true"===e.dataset.closeOnLinkClick&&(e.querySelectorAll(`.${Header.CLASS_NAME.navLink}`).forEach((e=>{e.addEventListener("click",this.closePanels.bind(this))})),e.querySelectorAll(`.${Header.CLASS_NAME.menuLink}`).forEach((e=>{e.addEventListener("click",this.closePanels.bind(this))}))),this.openSearch&&this.openSearch.addEventListener("click",this.focusSearchInput)}dispose(){t.removeData(this.element,Header.DATA_KEY),this.element.classList.contains(Header.CLASS_NAME.minimize)&&"undefined"!=typeof window&&window.removeEventListener("scroll",this.onScroll),this.element=null}static getInstance(e){return t.getData(e,Header.DATA_KEY)}static init(e={}){return super.init(this,e,Header.SELECTOR.default)}get minimizeThreshold(){return this.minimizeWindowHeightThreshold}set minimizeThreshold(e){this.minimizeWindowHeightThreshold=e}minimize(){this.element.classList.contains(Header.CLASS_NAME.minimize)||this.element.classList.add(Header.CLASS_NAME.minimize)}maximize(){this.element.classList.contains(Header.CLASS_NAME.minimize)&&this.element.classList.remove(Header.CLASS_NAME.minimize)}togglePanelShow(e){if(e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation(),"none"!==window.getComputedStyle(this.menuBurger).display){const t=e.currentTarget.parentElement,n=e.currentTarget.classList.contains(Header.CLASS_NAME.menuBurger),i=t.querySelector(`.${Header.CLASS_NAME.panel}`),s=i.classList.contains(Header.CLASS_NAME.panelShow);s&&n?this.closePanels():!s&&n&&(this.resetPanels(),e.currentTarget.classList.add(Header.CLASS_NAME.closeBurger)),s?i.classList.remove(Header.CLASS_NAME.panelShow):s||i.classList.add(Header.CLASS_NAME.panelShow)}}closePanels(){const e=this.element.querySelector(`.${Header.CLASS_NAME.panel}`);this.menuBurger.classList.remove(Header.CLASS_NAME.closeBurger);const t=()=>{e.removeEventListener("transitionend",t),this.resetPanels()};e.addEventListener("transitionend",t),e.classList.remove(Header.CLASS_NAME.panelShow)}closeCurrentPanel(e){e.currentTarget.closest(`.${Header.CLASS_NAME.panel}`).classList.remove(Header.CLASS_NAME.panelShow)}resetPanels(){this.element.querySelectorAll(`.${Header.CLASS_NAME.panel}`).forEach((e=>{e.classList.remove(Header.CLASS_NAME.panelShow)})),this.menuBurger.classList.remove(Header.CLASS_NAME.closeBurger)}onScroll=c.throttle((()=>{window.scrollY/window.innerHeight>this.minimizeWindowHeightThreshold?this.minimize():this.maximize()}),100,!0,!0,this);focusSearchInput=()=>{this.element.querySelector(`.${Header.CLASS_NAME.search} input`).focus()}}const u="cubic-bezier(0, 0, .2, 1)";class InlineMessage extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-inline-message`;static DATA_KEY=`${n.KEY_PREFIX}.inline-message`;static EVENT_KEY=`.${InlineMessage.DATA_KEY}`;static SELECTOR={default:`.${InlineMessage.NAME}`,dismiss:`.${InlineMessage.NAME}__close`};static KEY_FRAMES=[{transform:"scale3d(1, 1, 1)",opacity:1},{transform:"scale3d(0, 0, 0)",opacity:0}];static EVENT={click:`${s.click}${InlineMessage.EVENT_KEY}`,close:`${s.close}${InlineMessage.EVENT_KEY}`,closed:`${s.closed}${InlineMessage.EVENT_KEY}`};constructor(e){super(InlineMessage,e),t.setData(e,InlineMessage.DATA_KEY,this),this.setListeners()}closeAndDestroy(){EventHandler.trigger(this.element,InlineMessage.EVENT.close),this.element.animate&&(this.element.animate(InlineMessage.KEY_FRAMES,{duration:250,delay:100,easing:u}).onfinish=()=>{this.destroyElement()})}async close(e){EventHandler.trigger(this.element,InlineMessage.EVENT.close);this.element.animate&&this.element.animate(InlineMessage.KEY_FRAMES,{duration:250,delay:100,easing:u}),await new Promise((e=>setTimeout(e,350))),e()}dispose(){const e=this.element.querySelector(InlineMessage.SELECTOR.dismiss);EventHandler.off(e,InlineMessage.EVENT.click),t.removeData(this.element,InlineMessage.DATA_KEY),this.element=null}destroyElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),EventHandler.trigger(this.element,InlineMessage.EVENT.closed)}setListeners(){const e=this.element.querySelector(InlineMessage.SELECTOR.dismiss);EventHandler.on(e,InlineMessage.EVENT.click,(()=>{this.closeAndDestroy()}))}static init(e={}){return super.init(this,e,InlineMessage.SELECTOR.default)}static getInstance(e){return t.getData(e,InlineMessage.DATA_KEY)}}class InputNumber extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-form-item--input-number`;static DATA_KEY=`${n.KEY_PREFIX}.input-number`;static EVENT_KEY=`.${InputNumber.DATA_KEY}`;static LIVEZONE_TIMEOUT=5e3;static SELECTOR={default:`.${InputNumber.NAME}`,field:`.${n.KEY_PREFIX}-form-item__field`,incrementButton:`.${n.KEY_PREFIX}-form-item__increment-button`,decrementButton:`.${n.KEY_PREFIX}-form-item__decrement-button`,liveZone:"[aria-live]"};static EVENT={click:`${s.click}${InputNumber.EVENT_KEY}`,decrement:`${s.decrement}${InputNumber.EVENT_KEY}`,increment:`${s.increment}${InputNumber.EVENT_KEY}`,onchange:`${s.onchange}${InputNumber.EVENT_KEY}`};constructor(e){super(InputNumber,e),t.setData(e,InputNumber.DATA_KEY,this),this.field=e.querySelector(InputNumber.SELECTOR.field),this.incrementButton=e.querySelector(InputNumber.SELECTOR.incrementButton),this.decrementButton=e.querySelector(InputNumber.SELECTOR.decrementButton),this.liveZone=e.querySelector(InputNumber.SELECTOR.liveZone),this.updateFieldSize(),this.disableButtonsIfNeeded(!1),EventHandler.on(this.decrementButton,InputNumber.EVENT.click,this.decrementValue),EventHandler.on(this.incrementButton,InputNumber.EVENT.click,this.incrementValue),EventHandler.on(this.field,"input",(()=>{null!==this.min&&this.valueAsNumberthis.max&&(this.field.value=String(this.max)),this.updateFieldSize(),this.disableButtonsIfNeeded(),this.updateLiveZone(),EventHandler.trigger(this.element,InputNumber.EVENT.onchange,{value:this.valueAsNumber})}))}dispose(){EventHandler.off(this.decrementButton,InputNumber.EVENT.click),EventHandler.off(this.incrementButton,InputNumber.EVENT.click),EventHandler.off(this.field,"input"),t.removeData(this.element,InputNumber.DATA_KEY),this.element=null}get valueAsNumber(){return Number(this.field.value)}get step(){return this.field.step?Number(this.field.step):1}get min(){return this.field.min?Number(this.field.min):null}get max(){return this.field.max?Number(this.field.max):null}updateFieldSize=()=>{this.field.style.setProperty("--nj-fc-field-characters-length",`${this.field.value.length||1}`)};disableButtonsIfNeeded(e=!0){const t=null!==this.max&&this.valueAsNumber>=this.max,n=null!==this.min&&this.valueAsNumber<=this.min;this.incrementButton.disabled=t,this.decrementButton.disabled=n,t&&e&&this.field.focus(),n&&e&&this.field.focus()}updateLiveZone(){this.liveZoneTimeoutId&&clearTimeout(this.liveZoneTimeoutId);const e=this.element.querySelector("label").textContent,t=this.element.dataset.liveZoneFormat??`${e} : {x}`;this.liveZone.innerHTML=`

${t.replace("{x}",this.field.value)}

`,this.liveZoneTimeoutId=setTimeout((()=>{this.liveZone.innerHTML=null}),InputNumber.LIVEZONE_TIMEOUT)}decrementValue=()=>{const e=Number(this.getClampedValue(this.valueAsNumber-this.step).toFixed(2));this.field.value=String(e),this.updateFieldSize(),this.disableButtonsIfNeeded(),this.updateLiveZone(),EventHandler.trigger(this.element,InputNumber.EVENT.decrement,{value:e})};incrementValue=()=>{const e=Number(this.getClampedValue(this.valueAsNumber+this.step).toFixed(2));this.field.value=String(e),this.updateFieldSize(),this.disableButtonsIfNeeded(),this.updateLiveZone(),EventHandler.trigger(this.element,InputNumber.EVENT.increment,{value:e})};getClampedValue(e){return null!==this.min&&ethis.max&&(e=this.max),e}static init(e={}){return super.init(this,e,InputNumber.SELECTOR.default)}}const h=["top","right","bottom","left"],m=Math.min,p=Math.max,E=Math.round,f=Math.floor,g=e=>({x:e,y:e}),A={left:"right",right:"left",bottom:"top",top:"bottom"},v={start:"end",end:"start"};function T(e,t,n){return p(e,m(t,n))}function S(e,t){return"function"==typeof e?e(t):e}function b(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function y(e){return"x"===e?"y":"x"}function N(e){return"y"===e?"height":"width"}function L(e){return["top","bottom"].includes(b(e))?"y":"x"}function C(e){return y(L(e))}function w(e){return e.replace(/start|end/g,(e=>v[e]))}function I(e){return e.replace(/left|right|bottom|top/g,(e=>A[e]))}function x(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function D(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function M(e,t,n){let{reference:i,floating:s}=e;const r=L(t),o=C(t),a=N(o),l=b(t),c="y"===r,d=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,h=i[a]/2-s[a]/2;let m;switch(l){case"top":m={x:d,y:i.y-s.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:u};break;case"left":m={x:i.x-s.width,y:u};break;default:m={x:i.x,y:i.y}}switch(_(t)){case"start":m[o]-=h*(n&&c?-1:1);break;case"end":m[o]+=h*(n&&c?-1:1)}return m}async function O(e,t){var n;void 0===t&&(t={});const{x:i,y:s,platform:r,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=S(t,e),p=x(m),E=a[h?"floating"===u?"reference":"floating":u],f=D(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(E)))||n?E:E.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),g="floating"===u?{x:i,y:s,width:o.floating.width,height:o.floating.height}:o.reference,A=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),v=await(null==r.isElement?void 0:r.isElement(A))&&await(null==r.getScale?void 0:r.getScale(A))||{x:1,y:1},T=D(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:A,strategy:l}):g);return{top:(f.top-T.top+p.top)/v.y,bottom:(T.bottom-f.bottom+p.bottom)/v.y,left:(f.left-T.left+p.left)/v.x,right:(T.right-f.right+p.right)/v.x}}function R(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function F(e){return h.some((t=>e[t]>=0))}const P=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:r,placement:o,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:i,elements:s}=e,r=await(null==i.isRTL?void 0:i.isRTL(s.floating)),o=b(n),a=_(n),l="y"===L(n),c=["left","top"].includes(o)?-1:1,d=r&&l?-1:1,u=S(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof p&&(m="end"===a?-1*p:p),l?{x:m*d,y:h*c}:{x:h*c,y:m*d}}(t,e);return o===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:{...l,placement:o}}}}};function $(e){return K(e)?(e.nodeName||"").toLowerCase():"#document"}function k(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function H(e){var t;return null==(t=(K(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function K(e){return e instanceof Node||e instanceof k(e).Node}function Y(e){return e instanceof Element||e instanceof k(e).Element}function V(e){return e instanceof HTMLElement||e instanceof k(e).HTMLElement}function B(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof k(e).ShadowRoot)}function q(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(s)}function G(e){return["table","td","th"].includes($(e))}function j(e){const t=X(),n=z(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function X(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function U(e){return["html","body","#document"].includes($(e))}function z(e){return k(e).getComputedStyle(e)}function W(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Z(e){if("html"===$(e))return e;const t=e.assignedSlot||e.parentNode||B(e)&&e.host||H(e);return B(t)?t.host:t}function J(e){const t=Z(e);return U(t)?e.ownerDocument?e.ownerDocument.body:e.body:V(t)&&q(t)?t:J(t)}function Q(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const s=J(e),r=s===(null==(i=e.ownerDocument)?void 0:i.body),o=k(s);return r?t.concat(o,o.visualViewport||[],q(s)?s:[],o.frameElement&&n?Q(o.frameElement):[]):t.concat(s,Q(s,[],n))}function ee(e){const t=z(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=V(e),r=s?e.offsetWidth:n,o=s?e.offsetHeight:i,a=E(n)!==r||E(i)!==o;return a&&(n=r,i=o),{width:n,height:i,$:a}}function te(e){return Y(e)?e:e.contextElement}function ne(e){const t=te(e);if(!V(t))return g(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:r}=ee(t);let o=(r?E(n.width):n.width)/i,a=(r?E(n.height):n.height)/s;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}const ie=g(0);function se(e){const t=k(e);return X()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ie}function re(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect(),r=te(e);let o=g(1);t&&(i?Y(i)&&(o=ne(i)):o=ne(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==k(e))&&t}(r,n,i)?se(r):g(0);let l=(s.left+a.x)/o.x,c=(s.top+a.y)/o.y,d=s.width/o.x,u=s.height/o.y;if(r){const e=k(r),t=i&&Y(i)?k(i):i;let n=e,s=n.frameElement;for(;s&&i&&t!==n;){const e=ne(s),t=s.getBoundingClientRect(),i=z(s),r=t.left+(s.clientLeft+parseFloat(i.paddingLeft))*e.x,o=t.top+(s.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=o,n=k(s),s=n.frameElement}}return D({width:d,height:u,x:l,y:c})}const oe=[":popover-open",":modal"];function ae(e){return oe.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function le(e){return re(H(e)).left+W(e).scrollLeft}function ce(e,t,n){let i;if("viewport"===t)i=function(e,t){const n=k(e),i=H(e),s=n.visualViewport;let r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;const e=X();(!e||e&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a,y:l}}(e,n);else if("document"===t)i=function(e){const t=H(e),n=W(e),i=e.ownerDocument.body,s=p(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=p(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+le(e);const a=-n.scrollTop;return"rtl"===z(i).direction&&(o+=p(t.clientWidth,i.clientWidth)-s),{width:s,height:r,x:o,y:a}}(H(e));else if(Y(t))i=function(e,t){const n=re(e,!0,"fixed"===t),i=n.top+e.clientTop,s=n.left+e.clientLeft,r=V(e)?ne(e):g(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:s*r.x,y:i*r.y}}(t,n);else{const n=se(e);i={...t,x:t.x-n.x,y:t.y-n.y}}return D(i)}function de(e,t){const n=Z(e);return!(n===t||!Y(n)||U(n))&&("fixed"===z(n).position||de(n,t))}function ue(e,t,n){const i=V(t),s=H(t),r="fixed"===n,o=re(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=g(0);if(i||!i&&!r)if(("body"!==$(t)||q(s))&&(a=W(t)),i){const e=re(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else s&&(l.x=le(s));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function he(e,t){return V(e)&&"fixed"!==z(e).position?t?t(e):e.offsetParent:null}function me(e,t){const n=k(e);if(!V(e)||ae(e))return n;let i=he(e,t);for(;i&&G(i)&&"static"===z(i).position;)i=he(i,t);return i&&("html"===$(i)||"body"===$(i)&&"static"===z(i).position&&!j(i))?n:i||function(e){let t=Z(e);for(;V(t)&&!U(t);){if(j(t))return t;t=Z(t)}return null}(e)||n}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const r="fixed"===s,o=H(i),a=!!t&&ae(t.floating);if(i===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=g(1);const d=g(0),u=V(i);if((u||!u&&!r)&&(("body"!==$(i)||q(o))&&(l=W(i)),V(i))){const e=re(i);c=ne(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:H,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const r=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let i=Q(e,[],!1).filter((e=>Y(e)&&"body"!==$(e))),s=null;const r="fixed"===z(e).position;let o=r?Z(e):e;for(;Y(o)&&!U(o);){const t=z(o),n=j(o);n||"fixed"!==t.position||(s=null),(r?!n&&!s:!n&&"static"===t.position&&s&&["absolute","fixed"].includes(s.position)||q(o)&&!n&&de(e,o))?i=i.filter((e=>e!==o)):s=t,o=Z(o)}return t.set(e,i),i}(t,this._c):[].concat(n),i],o=r[0],a=r.reduce(((e,n)=>{const i=ce(t,n,s);return e.top=p(i.top,e.top),e.right=m(i.right,e.right),e.bottom=m(i.bottom,e.bottom),e.left=p(i.left,e.left),e}),ce(t,o,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:me,getElementRects:async function(e){const t=this.getOffsetParent||me,n=this.getDimensions;return{reference:ue(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ee(e);return{width:t,height:n}},getScale:ne,isElement:Y,isRTL:function(e){return"rtl"===z(e).direction}};function Ee(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=te(e),d=s||r?[...c?Q(c):[],...Q(t)]:[];d.forEach((e=>{s&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)}));const u=c&&a?function(e,t){let n,i=null;const s=H(e);function r(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null}return function o(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:d,width:u,height:h}=e.getBoundingClientRect();if(a||t(),!u||!h)return;const E={rootMargin:-f(d)+"px "+-f(s.clientWidth-(c+u))+"px "+-f(s.clientHeight-(d+h))+"px "+-f(c)+"px",threshold:p(0,m(1,l))||1};let g=!0;function A(e){const t=e[0].intersectionRatio;if(t!==l){if(!g)return o();t?o(!1,t):n=setTimeout((()=>{o(!1,1e-7)}),100)}g=!1}try{i=new IntersectionObserver(A,{...E,root:s.ownerDocument})}catch(e){i=new IntersectionObserver(A,E)}i.observe(e)}(!0),r}(c,n):null;let h,E=-1,g=null;o&&(g=new ResizeObserver((e=>{let[i]=e;i&&i.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),c&&!l&&g.observe(c),g.observe(t));let A=l?re(e):null;return l&&function t(){const i=re(e);!A||i.x===A.x&&i.y===A.y&&i.width===A.width&&i.height===A.height||n();A=i,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{s&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=g)||e.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const fe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=S(e,t),c={x:n,y:i},d=await O(t,l),u=L(b(s)),h=y(u);let m=c[h],p=c[u];if(r){const e="y"===h?"bottom":"right";m=T(m+d["y"===h?"top":"left"],m,m-d[e])}if(o){const e="y"===u?"bottom":"right";p=T(p+d["y"===u?"top":"left"],p,p-d[e])}const E=a.fn({...t,[h]:m,[u]:p});return{...E,data:{x:E.x-n,y:E.y-i}}}}},ge=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:s,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:E=!0,...f}=S(e,t);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const g=b(s),A=b(a)===a,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),T=h||(A||!E?[I(a)]:function(e){const t=I(e);return[w(e),t,w(t)]}(a));h||"none"===p||T.push(...function(e,t,n,i){const s=_(e);let r=function(e,t,n){const i=["left","right"],s=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:i:t?i:s;case"left":case"right":return t?r:o;default:return[]}}(b(e),"start"===n,i);return s&&(r=r.map((e=>e+"-"+s)),t&&(r=r.concat(r.map(w)))),r}(a,E,p,v));const y=[a,...T],L=await O(t,f),x=[];let D=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&x.push(L[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const i=_(e),s=C(e),r=N(s);let o="x"===s?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=I(o)),[o,I(o)]}(s,o,v);x.push(L[e[0]],L[e[1]])}if(D=[...D,{placement:s,overflows:x}],!x.every((e=>e<=0))){var M,R;const e=((null==(M=r.flip)?void 0:M.index)||0)+1,t=y[e];if(t)return{data:{index:e,overflows:D},reset:{placement:t}};let n=null==(R=D.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:R.placement;if(!n)switch(m){case"bestFit":{var F;const e=null==(F=D.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=a}if(s!==n)return{reset:{placement:n}}}return{}}}},Ae=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:i="referenceHidden",...s}=S(e,t);switch(i){case"referenceHidden":{const e=R(await O(t,{...s,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:F(e)}}}case"escaped":{const e=R(await O(t,{...s,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:F(e)}}}default:return{}}}}},ve=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:s,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=S(e,t)||{};if(null==c)return{};const u=x(d),h={x:n,y:i},p=C(s),E=N(p),f=await o.getDimensions(c),g="y"===p,A=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",y=r.reference[E]+r.reference[p]-h[p]-r.floating[E],L=h[p]-r.reference[p],w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(c));let I=w?w[b]:0;I&&await(null==o.isElement?void 0:o.isElement(w))||(I=a.floating[b]||r.floating[E]);const D=y/2-L/2,M=I/2-f[E]/2-1,O=m(u[A],M),R=m(u[v],M),F=O,P=I-f[E]-R,$=I/2-f[E]/2+D,k=T(F,$,P),H=!l.arrow&&null!=_(s)&&$!==k&&r.reference[E]/2-(${const i=new Map,s={platform:pe,...n},r={...s.platform,_c:i};return(async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:o}=n,a=r.filter(Boolean),l=await(null==o.isRTL?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:u}=M(c,i,l),h=i,m={},p=0;for(let n=0;n({x:e.x,y:e.y,top:e.y,left:e.x,bottom:e.y,right:e.x,width:0,height:0}),parentElement:document.body}:e,be(s)&&(s.ariaExpanded="true");const r=(e=>{const t=document.createElement("div");return t.className="nj-menu",t.style.position="absolute",t.role="menu",t.appendChild(e),t})(t);let o=s.parentElement;"parent"!==n&&(o="string"==typeof n?document.getElementById(n)??o:n),o.appendChild(r);const a=Ee(s,r,(()=>{Te(s,r,{...i,middleware:[i?.offsetOptions&&P(i.offsetOptions),i?.flipOptions&&ge(i.flipOptions),i?.shiftOptions&&fe(i.shiftOptions),i?.hideOptions&&Ae(i.hideOptions)]}).then((({x:e,y:t,middlewareData:n})=>{Object.assign(r.style,{left:`${e}px`,top:`${t}px`}),i?.hideOptions?.strategy&&n.hide&&Object.assign(r.style,{visibility:n.hide[i.hideOptions.strategy]?"hidden":"visible"})}))}));return{menu:r,unmount:()=>{o.removeChild(r),a(),be(s)&&(s.ariaExpanded="false")}}}const be=e=>"tagName"in e,_e=['a[href]:not([tabindex^="-"]):not([data-trap-anchor])','area[href]:not([tabindex^="-"]):not([data-trap-anchor])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"]):not([data-trap-anchor])','input[type="radio"]:not([disabled]):not([tabindex^="-"]):not([data-trap-anchor])','select:not([disabled]):not([tabindex^="-"]):not([data-trap-anchor])','textarea:not([disabled]):not([tabindex^="-"]):not([data-trap-anchor])','button:not([disabled]):not([tabindex^="-"]):not([data-trap-anchor])','iframe:not([tabindex^="-"]):not([data-trap-anchor])','audio[controls]:not([tabindex^="-"]):not([data-trap-anchor])','video[controls]:not([tabindex^="-"]):not([data-trap-anchor])','[contenteditable]:not([tabindex^="-"]):not([data-trap-anchor])','[tabindex]:not([tabindex^="-"]):not([data-trap-anchor])'];class Modal extends AbstractComponent{static LOG_TAG=`${n.LIBRARY_LOG_TAG}[MODAL]`;static NAME=`${n.KEY_PREFIX}-modal`;static DATA_KEY=`${n.KEY_PREFIX}.modal`;static EVENT_KEY=`.${Modal.DATA_KEY}`;static DATA_API_KEY=n.KEY_PREFIX;static ESCAPE_KEYCODE=27;static hasInit=!1;static CLASSNAME={backdrop:`${n.KEY_PREFIX}-modal__backdrop`,backdropFitViewport:`${n.KEY_PREFIX}-modal__backdrop--fit-viewport`,fade:"fade",show:"show",visible:`${Modal.NAME}--visible`,fitViewport:`${Modal.NAME}--fit-viewport`};static SELECTOR={default:`.${Modal.NAME}`,dataDismiss:'[data-dismiss="modal"]',dataToggle:'[data-toggle="modal"]',dataAttributeToggleName:"data-toggle",dataAttributeToggleValue:"modal",modalBody:`.${n.KEY_PREFIX}-modal__body`,dialog:`.${n.KEY_PREFIX}-modal__dialog`};static EVENT={beforehide:`${s.beforehide}${Modal.EVENT_KEY}`,show:`${s.show}${Modal.EVENT_KEY}`,shown:`${s.shown}${Modal.EVENT_KEY}`,focusin:`${s.focusin}${Modal.EVENT_KEY}`,hide:`${s.hide}${Modal.EVENT_KEY}`,hidden:`${s.hidden}${Modal.EVENT_KEY}`,keydownDismiss:`${s.keydown}.dismiss${Modal.EVENT_KEY}`,clickDismiss:`${s.click}.dismiss${Modal.EVENT_KEY}`,clickDataApi:`${s.click}${Modal.EVENT_KEY}${Modal.DATA_API_KEY}`,mouseupDismiss:`${s.mouseup}.dismiss${Modal.EVENT_KEY}`,mousedownDismiss:`${s.mousedown}.dismiss${Modal.EVENT_KEY}`};static CAN_MOVE_ELEMENTS_IN_DOM=!0;static SHOULD_MANAGE_OPENING_STATE=!0;backdrop=null;dialog=null;ignoreBackdropClick=null;isShown=!1;isTransitioning=!1;triggerElement=null;constructor(e){super(Modal,e),this.shouldManageOpeningState=Modal.SHOULD_MANAGE_OPENING_STATE,this.dialog=this.element.querySelector(Modal.SELECTOR.dialog);const{leadingFocusTrap:n,trailingFocusTrap:i}=this.createFocusElements();if(this.leadingFocusTrapAnchorElement=n,this.trailingFocusTrapAnchorElement=i,this.shouldFitViewportArea=this.element.classList.contains(Modal.CLASSNAME.fitViewport),Modal.CAN_MOVE_ELEMENTS_IN_DOM){this.targetedParentElement=this.element.parentElement;const e=this.element.dataset.appendto;if(e&&!this.shouldFitViewportArea){const t=document.querySelector(e);this.isNodeElement(t)?this.targetedParentElement=t:console.error(`${Modal.LOG_TAG} Invalid element: Anchor element '${e}' is not a valid node element. Check your selector for [data-appendto]. Appended to parent element instead.`)}const t=this.isNodeElement(this.targetedParentElement);if(this.shouldFitViewportArea||!t){t||console.error(`${Modal.LOG_TAG} Invalid element: Parent element is not a valid node element. Appended to body instead.`);const e=document.body;if(!this.isNodeElement(e))throw new Error(`${Modal.LOG_TAG} No body element found. Unable to attach modal`);this.targetedParentElement=e}this.targetedParentElement!==this.element.parentElement&&this.targetedParentElement?.appendChild(this.element)}else{const e=this.element.parentElement;if(!this.isNodeElement(e))throw new Error(`${Modal.LOG_TAG} Invalid modal's parent element. Unable to initialize modal`);this.targetedParentElement=e}t.setData(e,Modal.DATA_KEY,this),this.shouldManageOpeningState&&!Modal.hasInit&&(Modal.hasInit=!0,this.registerEvents())}static init(e={}){return super.init(this,e,Modal.SELECTOR.default)}static getInstance(e){return t.getData(e,Modal.DATA_KEY)}isNodeElement(e){return e&&e.nodeType===Node.ELEMENT_NODE}createFocusElements(){function e(e){const t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.setAttribute("data-trap-anchor",""),t.addEventListener("focusin",e),t}return{leadingFocusTrap:e((()=>{const e=this.element.querySelector(_e.join(","));e?.focus()})),trailingFocusTrap:e((()=>{const e=Array.from(this.element.querySelectorAll(_e.join(","))).at(-1);e?.focus()}))}}addFocusTrapElements(){this.element.prepend(this.leadingFocusTrapAnchorElement),this.element.append(this.trailingFocusTrapAnchorElement)}removeFocusTrapElements(){this.element.removeChild(this.trailingFocusTrapAnchorElement),this.element.removeChild(this.leadingFocusTrapAnchorElement)}hideModal(){this.element&&(this.element.classList.remove(Modal.CLASSNAME.visible),this.element.setAttribute("aria-hidden","true"),this.element.removeAttribute("aria-modal"),this.isTransitioning=!1,this.showBackdrop(),this.removeFocusTrapElements(),EventHandler.trigger(this.element,Modal.EVENT.hidden))}removeBackdrop(){this.backdrop&&(this.backdrop.parentNode.removeChild(this.backdrop),this.backdrop=null)}setEscapeEvent(){this.isShown?EventHandler.on(this.element,Modal.EVENT.keydownDismiss,(e=>{e.which===Modal.ESCAPE_KEYCODE&&this.hide(e,"keyboard")})):EventHandler.off(this.element,Modal.EVENT.keydownDismiss)}showBackdrop(e){if(!this.element)return;const t=this.element.classList.contains(Modal.CLASSNAME.fade)?Modal.CLASSNAME.fade:"";if(this.isShown){if(this.backdrop=document.createElement("div"),this.backdrop.className=Modal.CLASSNAME.backdrop,this.shouldFitViewportArea&&this.backdrop.classList.add(Modal.CLASSNAME.backdropFitViewport),t&&this.backdrop.classList.add(t),this.targetedParentElement?.appendChild(this.backdrop),EventHandler.on(this.element,Modal.EVENT.clickDismiss,(e=>{this.ignoreBackdropClick?this.ignoreBackdropClick=!1:e.target===e.currentTarget&&this.hide(null,"backdrop")})),t&&c.reflow(this.backdrop),this.backdrop.classList.add(Modal.CLASSNAME.show),!e)return;if(!t)return void e();const n=c.getTransitionDurationFromElement(this.backdrop);EventHandler.one(this.backdrop,c.TRANSITION_END,e),c.emulateTransitionEnd(this.backdrop,n)}else if(!this.isShown&&this.backdrop){this.backdrop.classList.remove(Modal.CLASSNAME.show);const t=()=>{this.removeBackdrop(),e&&e()};if(this.element.classList.contains(Modal.CLASSNAME.fade)){const e=c.getTransitionDurationFromElement(this.backdrop);EventHandler.one(this.backdrop,c.TRANSITION_END,t),c.emulateTransitionEnd(this.backdrop,e)}else t()}else e&&e()}showElement(){if(!this.element)return;EventHandler.trigger(this.element,Modal.EVENT.show);const e=this.element.classList.contains(Modal.CLASSNAME.fade);this.element.classList.add(Modal.CLASSNAME.visible),this.element.removeAttribute("aria-hidden"),this.element.scrollTop=0,e&&c.reflow(this.element),this.element.classList.add(Modal.CLASSNAME.show),document.activeElement&&(this.triggerElement=document.activeElement),this.addFocusTrapElements(),this.element.setAttribute("aria-modal","true");const t=()=>{const e=this.element.querySelector(_e.join(","));e?.focus(),this.isTransitioning=!1,EventHandler.trigger(this.element,Modal.EVENT.shown)};if(e){const e=c.getTransitionDurationFromElement(this.dialog);EventHandler.one(this.dialog,c.TRANSITION_END,t),c.emulateTransitionEnd(this.dialog,e)}else t()}dispose(){this.removeBackdrop(),t.removeData(this.element,Modal.DATA_KEY),EventHandler.off(document,Modal.EVENT.focusin),this.element=null,this.dialog=null,this.backdrop=null,this.isShown=null,this.ignoreBackdropClick=null,this.isTransitioning=null}hide(e,t){if(e&&e.preventDefault(),!this.isShown||this.isTransitioning||!this.element)return;if(!this.shouldManageOpeningState&&t)return void EventHandler.trigger(this.element,Modal.EVENT.beforehide,{source:t});EventHandler.trigger(this.element,Modal.EVENT.hide),this.isShown=!1;const n=this.element.classList.contains(Modal.CLASSNAME.fade);if(n&&(this.isTransitioning=!0),this.setEscapeEvent(),EventHandler.off(document,Modal.EVENT.focusin),this.element.classList.remove(Modal.CLASSNAME.show),EventHandler.off(this.element,Modal.EVENT.clickDismiss),EventHandler.off(this.dialog,Modal.EVENT.mousedownDismiss),n){const e=c.getTransitionDurationFromElement(this.element);EventHandler.one(this.element,c.TRANSITION_END,(()=>this.hideModal())),c.emulateTransitionEnd(this.element,e)}else this.hideModal();this.triggerElement&&this.triggerElement?.focus()}show(){this.isShown||this.isTransitioning||!this.element||(this.element.classList.contains(Modal.CLASSNAME.fade)&&(this.isTransitioning=!0),this.isShown=!0,this.setEscapeEvent(),EventHandler.on(this.element,Modal.EVENT.clickDismiss,Modal.SELECTOR.dataDismiss,(e=>this.hide(e,"button"))),EventHandler.on(this.dialog,Modal.EVENT.mousedownDismiss,(()=>{EventHandler.one(this.element,Modal.EVENT.mouseupDismiss,(e=>{e.target.isEqualNode(this.element)&&(this.ignoreBackdropClick=!0)}))})),this.showBackdrop((()=>this.showElement())))}toggle(){this.isShown?this.hide():this.show()}registerEvents(){EventHandler.on(document,Modal.EVENT.clickDataApi,Modal.SELECTOR.dataToggle,(e=>{let t;const n=e.currentTarget;let i=e.target;i.getAttribute(Modal.SELECTOR.dataAttributeToggleName)!==Modal.SELECTOR.dataAttributeToggleValue&&(i=i.closest(Modal.SELECTOR.dataToggle));const s=c.getSelectorFromElement(i);s&&(t=document.querySelector(s)),"A"!==n.tagName&&"AREA"!==n.tagName||e.preventDefault();const r=Modal.getInstance(t);r&&r.toggle()}))}}class CollapseSearchBar extends AbstractFormBase{static NAME="collapseSearchBar";static DATA_KEY=`${n.KEY_PREFIX}.${CollapseSearchBar.NAME}`;static SELECTOR={default:`.${n.KEY_PREFIX}-navbar__search`,formGroup:AbstractFormBase.SELECTOR.formGroup,anyInput:"input, select, textarea",target:"data-target"};static DEFAULT_OPTIONS={njFormGroup:{required:!1}};constructor(e,t={}){super(CollapseSearchBar,e,l.extend(!0,CollapseSearchBar.DEFAULT_OPTIONS,t)),this.triggerElement=this.element.parentElement.querySelector(`[data-toggle="collapse"][${CollapseSearchBar.SELECTOR.target}="#${this.element.id}"]`)||this.element.parentElement.querySelector(`[data-toggle="collapse"][href="#${this.element.id}"]`);const n=this.element.querySelector(`[data-dismiss="#${this.element.id}"]`);n&&n.addEventListener("click",this.dismissHandler.bind(this)),d.assert(e,!this.triggerElement,`Cannot find collapse trigger for ${d.describe(e)}`),d.assert(e,!this.element.classList.contains(Collapse.CLASS_NAME.collapse),`${d.describe(e)} is expected to have the '${Collapse.CLASS_NAME.collapse}' class. It is being targeted by ${d.describe(e)}`),this.input=this.element.querySelector(CollapseSearchBar.SELECTOR.anyInput),this.input&&(EventHandler.on(this.element,`${s.shown}.${Collapse.DATA_KEY}`,(()=>{this.input.focus()})),EventHandler.on(this.input,"blur",(e=>{this.dismissHandler(e)})))}getElement(){return this.element}dispose(){t.removeData(this.element,CollapseSearchBar.DATA_KEY),this.element=null}static init(e={}){return super.init(this,e,CollapseSearchBar.SELECTOR.default)}static getInstance(e){const n=t.getData(e,CollapseSearchBar.DATA_KEY);return n||Collapse.getInstance(e)}dismissHandler(e){e.preventDefault(),(e.target.closest(`[data-dismiss="#${this.element.id}"]`)||e.target.closest(`[href="#${this.element.id}"]`))&&EventHandler.trigger(this.triggerElement,s.click)}}class Navbar extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-navbar`;static DATA_KEY=`${n.KEY_PREFIX}.navbar`;static CLASS_NAME={shownCollapse:`${Navbar.NAME}--shown-collapse`};static SELECTOR={default:`.${Navbar.NAME}`};constructor(e){super(Navbar,e),this.collapseSearchBarInstances=CollapseSearchBar.init(),this.registerEvents()}dispose(){this.collapseSearchBarInstances.length>0&&this.collapseSearchBarInstances.forEach((e=>{e.getElement()===this.element.querySelector(CollapseSearchBar.SELECTOR.default)&&e.dispose()})),t.removeData(this.element,Navbar.DATA_KEY),this.element=null}handleCollapseShow(){this.element.classList.add(Navbar.CLASS_NAME.shownCollapse)}handleCollapseHide(){this.element.classList.remove(Navbar.CLASS_NAME.shownCollapse)}static getInstance(e){return t.getData(e,Navbar.DATA_KEY)}static init(e={}){return super.init(this,e,Navbar.SELECTOR.default)}registerEvents(){EventHandler.on(this.element,Collapse.EVENT.show,(()=>{this.handleCollapseShow()})),EventHandler.on(this.element,Collapse.EVENT.hidden,(()=>{this.handleCollapseHide()}))}}class Password extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-form-item--password`;static DATA_KEY=`${n.KEY_PREFIX}.password-input`;static SELECTOR={default:`.${Password.NAME}`};static INPUT_CLASS=`${n.KEY_PREFIX}-form-item__field`;static TOGGLE_BTN_CLASS=`${n.KEY_PREFIX}-form-item__password-button`;static NOTICE_CLASS=`${n.KEY_PREFIX}-form-item__password-notice`;static VISIBILITY_CLASS=`${n.KEY_PREFIX}-form-item--visible`;static DEFAULT_OPTIONS={selector:Password.SELECTOR};constructor(e,n={}){super(Password,e,l.extend(!0,Password.DEFAULT_OPTIONS,n)),this.setListeners(),t.setData(e,Password.DATA_KEY,this)}static init(e={}){return super.init(this,e,Password.SELECTOR.default)}static getInstance(e){return t.getData(e,Password.DATA_KEY)}dispose(){t.removeData(this.element,Password.DATA_KEY),this.element=null}setListeners(){if(!this.element)return;const e=this.element.getElementsByClassName(Password.INPUT_CLASS)[0],t=this.element.getElementsByClassName(Password.TOGGLE_BTN_CLASS)[0],n=t.querySelector("span"),i=this.element.getElementsByClassName(Password.NOTICE_CLASS)[0],s=n.getAttribute("data-password-button-label-show"),r=n.getAttribute("data-password-button-label-hide"),o=i.getAttribute("data-password-notice-is-visible"),a=i.getAttribute("data-password-notice-is-hidden");s&&r&&o&&a||console.warn("[FLUID] Some of these required attributes are missing: [data-password-button-label-show], [data-password-button-label-hide], [data-password-notice-is-visible], [data-password-notice-is-hidden]"),n.innerHTML=s,this.element.classList.contains(Password.VISIBILITY_CLASS)&&(e.type="text",t.setAttribute("aria-pressed","false"),n.innerHTML=r,i.innerHTML=o),t?EventHandler.on(t,"click keydown",(l=>{"keydown"===l.type&&"key"in l&&"Enter"!==l.key&&" "!==l.key||(l.preventDefault(),"text"===e.type?(e.type="password",this.element.classList.remove(Password.VISIBILITY_CLASS),t.setAttribute("aria-pressed","false"),n.innerHTML=s,i.innerHTML=a):"password"===e.type&&(e.type="text",this.element.classList.add(Password.VISIBILITY_CLASS),t.setAttribute("aria-pressed","true"),n.innerHTML=r,i.innerHTML=o))})):console.warn("Toggle password icon not found")}}class Search extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-search`;static DATA_KEY=`${n.KEY_PREFIX}.search`;static EVENT_KEY=`.${Search.DATA_KEY}`;static SELECTOR={default:`.${Search.NAME}`,field:`.${Search.NAME}__field`,clearButton:`.${Search.NAME}__clear-button`};constructor(e){super(Search,e),t.setData(e,Search.DATA_KEY,this),this.root=e,this.field=e.querySelector(Search.SELECTOR.field),this.clearButton=e.querySelector(Search.SELECTOR.clearButton),this.toggleClearButtonIfNeeded(),this.toggleInertAttribute(),this.setListeners()}static init(e={}){return super.init(this,e,Search.SELECTOR.default)}dispose(){EventHandler.off(this.clearButton,"click"),EventHandler.off(this.field,"input"),t.removeData(this.element,Search.DATA_KEY),this.element=null}static getInstance(e){return t.getData(e,Search.DATA_KEY)}setListeners(){EventHandler.on(this.clearButton,"click",(()=>{this.field.value=null,this.toggleClearButtonIfNeeded(),this.field.focus()})),EventHandler.on(this.field,"input",(()=>{this.toggleClearButtonIfNeeded()}))}toggleClearButtonIfNeeded(){const e=`${Search.NAME}__clear-button--hidden`;this.field.value&&0!==this.field.value.length?this.clearButton.classList.remove(e):this.clearButton.classList.add(e)}toggleInertAttribute(){this.root.inert=this.root.classList.contains(`${Search.NAME}--disabled`)||!0===this.field.disabled}}class SegmentedControl extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-segmented-control`;static DATA_KEY=`${n.KEY_PREFIX}.segmented-control`;static EVENT_KEY=`.${SegmentedControl.DATA_KEY}`;static CLASS_NAME={component:`.${SegmentedControl.NAME}`,button:`.${SegmentedControl.NAME}-btn`,buttonSelected:`${SegmentedControl.NAME}-btn--selected`};static SELECTOR={default:`.${SegmentedControl.NAME}`};static EVENT={onchange:`${s.onchange}${SegmentedControl.EVENT_KEY}`};constructor(e,n={}){super(SegmentedControl,e,n),this.element=e,t.setData(e,SegmentedControl.DATA_KEY,this),this.buttons=e.querySelectorAll(SegmentedControl.CLASS_NAME.button),this.value=this.element.getAttribute("data-value"),setTimeout((()=>{this.buttons.forEach(((e,t)=>{const n=e.getAttribute("data-value");this.value&&this.value===n&&this.select(t),e.addEventListener("click",(()=>this.select(t)))}))}),100)}select=e=>{this.buttons.forEach(((t,n)=>{t&&(e===n?(t.classList.add(SegmentedControl.CLASS_NAME.buttonSelected),this.value=t.getAttribute("data-value"),EventHandler.trigger(this.element,SegmentedControl.EVENT.onchange,{value:this.value}),this.element.setAttribute("data-value",this.value),t.setAttribute("aria-pressed","true"),setTimeout((()=>{this.computeSelectedTransition(t)}))):(t.classList.remove(SegmentedControl.CLASS_NAME.buttonSelected),t.setAttribute("aria-pressed","false")))}))};computeSelectedTransition=e=>{const t=e.getBoundingClientRect();if(this.element){const e=this.element.getBoundingClientRect(),n=this.element.style;n.setProperty("--nj-sc-btn-selected-width",`${t.width}px`),n.setProperty("--nj-sc-btn-selected-right",e.right-t.right+"px")}};dispose(){this.buttons.forEach(((e,t)=>{e.removeEventListener("click",(()=>this.select(t)))})),t.removeData(this.element,SegmentedControl.DATA_KEY)}static getInstance(e){return t.getData(e,SegmentedControl.DATA_KEY)}static init(e={}){return super.init(this,e,SegmentedControl.SELECTOR.default)}}class Select extends AbstractFormBaseInput{static NAME=`${n.KEY_PREFIX}-select`;static DATA_KEY=`${n.KEY_PREFIX}.select`;static SELECTOR={default:"select.nj-form-control",formGroup:AbstractFormBaseInput.SELECTOR.formGroup};static DEFAULT_OPTIONS={requiredClasses:["form-control||custom-select"]};constructor(e,n={}){super(Select,e,l.extend(!0,Select.DEFAULT_OPTIONS,n)),this.addIsFilled(),t.setData(e,Select.DATA_KEY,this)}dispose(){t.removeData(this.element,Select.DATA_KEY),this.element=null}static init(e={}){return super.init(this,e,Select.SELECTOR.default)}static getInstance(e){return t.getData(e,Select.DATA_KEY)}static matches(e){return"SELECT"===e.tagName}}class SelectInput extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-form-item--custom-list`;static DATA_KEY=`${n.KEY_PREFIX}.custom-list`;static EVENT_KEY=`.${SelectInput.DATA_KEY}`;static ESCAPE_KEYCODE=27;static ENTER_KEYCODE=13;static UP_KEYCODE=38;static DOWN_KEYCODE=40;static CLASS_NAME={isOpen:`${n.KEY_PREFIX}-form-item--open`};static ATTRIBUTE={value:"data-value"};static SELECTOR={default:`.${SelectInput.NAME}`,label:`.${n.KEY_PREFIX}-form-item__label`,button:`.${n.KEY_PREFIX}-form-item__custom-list-button`,input:`.${n.KEY_PREFIX}-form-item__field`,options:`.${n.KEY_PREFIX}-form-item__list`,option:`.${n.KEY_PREFIX}-list-deprecated__item`};static EVENT={onchange:`${s.onchange}${SelectInput.EVENT_KEY}`,open:`${s.show}${SelectInput.EVENT_KEY}`,close:`${s.hide}${SelectInput.EVENT_KEY}`};static getInstance(e){return t.getData(e,SelectInput.DATA_KEY)}static init(e={}){return super.init(this,e,SelectInput.SELECTOR.default)}constructor(e){super(SelectInput,e),t.setData(e,SelectInput.DATA_KEY,this),this.buttonEl=this.element.querySelector(SelectInput.SELECTOR.button),this.labelEl=this.element.querySelector(SelectInput.SELECTOR.label),this.listEl=this.element.querySelector(SelectInput.SELECTOR.options),this.inputEl=this.element.querySelector(SelectInput.SELECTOR.input),this.optionElements=Array.from(this.element.querySelectorAll(SelectInput.SELECTOR.option)),this.addToggleEvent(),this.addEscapeEvent(),this.addBlurEvent(),this.addUpDownEvent(),this.addClickEvent(),this.addShortcutEvents()}updateOptionsAndListeners(){this.optionElements=Array.from(this.element.querySelectorAll(SelectInput.SELECTOR.option)),this.addClickEvent()}get isOpen(){return!this.listEl.hasAttribute("hidden")}set isOpen(e){e?(this.listEl.removeAttribute("hidden"),this.buttonEl.setAttribute("aria-expanded","true"),this.buttonEl.setAttribute("tabindex","-1"),this.element.classList.add(SelectInput.CLASS_NAME.isOpen),this.listEl.focus(),this.focusedIndex=this.selectedIndex,-1===this.focusedIndex&&this.listEl.scrollTo({top:0}),this.optionElements.forEach(((e,t)=>{const n="nj-list-deprecated__item--active";t===this.focusedIndex?e.classList.add(n):e.classList.remove(n)})),EventHandler.trigger(this.element,SelectInput.EVENT.open)):(this.listEl.setAttribute("hidden","hidden"),this.buttonEl.setAttribute("aria-expanded","false"),this.buttonEl.removeAttribute("tabindex"),this.element.classList.remove(SelectInput.CLASS_NAME.isOpen),this.focusedIndex=-1,EventHandler.trigger(this.element,SelectInput.EVENT.close))}get selectedIndex(){return this.optionElements.findIndex((e=>"true"===e.getAttribute("aria-selected")))}set selectedIndex(e){this.optionElements.forEach(((t,n)=>{t.setAttribute("aria-selected",String(n===e))})),this.inputEl.value=this.selectedOptionLabel,this.buttonEl.setAttribute("aria-label",`${this.labelEl.textContent} - ${this.selectedOptionLabel}`),EventHandler.trigger(this.element,SelectInput.EVENT.onchange,{value:this.selectedOptionLabel,option:this.optionElements[e]})}get focusedIndex(){return this.optionElements.findIndex((e=>document.activeElement===e))}set focusedIndex(e){-1!==e&&this.optionElements[e].focus()}get selectedOptionLabel(){if(-1!==this.selectedIndex){return this.optionElements[this.selectedIndex].textContent}return""}get selectedOptionValue(){if(-1!==this.selectedIndex){const e=this.optionElements[this.selectedIndex];return e.getAttribute(SelectInput.ATTRIBUTE.value)??e.textContent}return""}dispose(){t.removeData(this.element,SelectInput.DATA_KEY),this.element=null}addToggleEvent(){EventHandler.on(this.buttonEl,s.click,(()=>{this.isOpen=!this.isOpen}))}addEscapeEvent(){EventHandler.on(this.listEl,s.keydown,(e=>{e.keyCode===SelectInput.ESCAPE_KEYCODE&&(this.isOpen=!1,this.buttonEl.focus())}))}addBlurEvent(){EventHandler.on(this.element,s.focusout,(e=>{this.element.contains(e.relatedTarget)||(this.isOpen=!1)}))}addUpDownEvent(){EventHandler.on(this.listEl,s.keydown,(e=>{e.keyCode===SelectInput.UP_KEYCODE&&(e.preventDefault(),this.focusedIndex=Math.max(0,this.focusedIndex-1)),e.keyCode===SelectInput.DOWN_KEYCODE&&(e.preventDefault(),this.focusedIndex=Math.min(this.optionElements.length-1,this.focusedIndex+1))}))}addClickEvent(){this.optionElements.forEach(((e,t)=>{EventHandler.on(e,s.click,(()=>{this.selectedIndex=t,this.isOpen=!1,this.buttonEl.focus()})),EventHandler.on(e,s.keydown,(e=>{e.keyCode===SelectInput.ENTER_KEYCODE&&(e.preventDefault(),this.selectedIndex=this.focusedIndex,this.isOpen=!1,this.buttonEl.focus())}))}))}addShortcutEvents(){const e=/^[\d\p{Letter}]$/u;EventHandler.on(this.listEl,s.keydown,(t=>{if(e.test(t.key)){const e=this.optionElements.findIndex((e=>e.textContent[0].toLowerCase()===t.key.toLowerCase()));-1!==e&&(this.focusedIndex=e)}}))}}class Sidebar extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-sidebar`;static DATA_KEY=`${n.KEY_PREFIX}.sidebar`;static EVENT_KEY=`.${Sidebar.DATA_KEY}`;static DATA_API_KEY=n.KEY_PREFIX;static hasInit=!1;static CLASS_NAME={folding:`${n.KEY_PREFIX}-sidebar--folding`,folded:`${n.KEY_PREFIX}-sidebar--folded`};static EVENT={show:`${s.show}${Sidebar.EVENT_KEY}`,shown:`${s.shown}${Sidebar.EVENT_KEY}`,hide:`${s.hide}${Sidebar.EVENT_KEY}`,hidden:`${s.hidden}${Sidebar.EVENT_KEY}`,clickDataApi:`${s.click}${Sidebar.EVENT_KEY}${Sidebar.DATA_API_KEY}`};static DEFAULT_OPTIONS={folded:!1};static DEFAULT_TYPE={folded:"boolean"};static SELECTOR={default:`.${Sidebar.NAME}`,actives:`.${Sidebar.CLASS_NAME.folding}, .${Sidebar.NAME}`,dataToggle:'[data-toggle="sidebar"]'};constructor(e,n={}){super(Sidebar,e,Sidebar.getOptions(n)),this.element=e,this.isTransitioning=!1,this.triggerArray=c.makeArray(document.querySelectorAll(`${Sidebar.SELECTOR.dataToggle}[href="#${e.id}"],${Sidebar.SELECTOR.dataToggle}[data-target="#${e.id}"]`));const i=c.makeArray(document.querySelectorAll(Sidebar.SELECTOR.dataToggle));for(let t=0,n=i.length;tt===e));null!==s&&r.length&&(this.selector=s,this.triggerArray.push(n))}t.setData(e,Sidebar.DATA_KEY,this),this.options.toggle&&this.toggle(),t.setData(e,Sidebar.DATA_KEY,this),Sidebar.hasInit||(Sidebar.hasInit=!0,this.registerEvents()),"true"!==e.dataset.closeOnInteractOut&&e.dataset.closeOnInteractOut||(document.addEventListener("click",this.closeOnInteractOut),document.addEventListener("keydown",this.closeOnInteractOut))}toggle(){this.element.classList.contains(Sidebar.CLASS_NAME.folded)?this.close():this.open()}open(){if(this.isTransitioning||this.element.classList.contains(Sidebar.CLASS_NAME.folded))return;document.querySelector(this.selector);if(EventHandler.trigger(this.element,Sidebar.EVENT.show).defaultPrevented)return;this.element.classList.remove(Sidebar.CLASS_NAME.folded),this.element.classList.add(Sidebar.CLASS_NAME.folding),this.triggerArray.length&&this.triggerArray.forEach((e=>{e.classList.remove(Sidebar.CLASS_NAME.folded),e.setAttribute("aria-folded","true")})),this.setTransitioning(!0);const e=c.getTransitionDurationFromElement(this.element);EventHandler.one(this.element,c.TRANSITION_END,(()=>{this.element.classList.remove(Sidebar.CLASS_NAME.folding),this.element.classList.add(Sidebar.CLASS_NAME.folded),this.element.parentElement&&this.element.parentElement.tagName.toLowerCase()===Sidebar.NAME&&this.element.parentElement.setAttribute("folded",""),this.setTransitioning(!1),EventHandler.trigger(this.element,Sidebar.EVENT.shown)})),c.emulateTransitionEnd(this.element,e)}close(){if(this.isTransitioning||!this.element.classList.contains(Sidebar.CLASS_NAME.folded))return;if(EventHandler.trigger(this.element,Sidebar.EVENT.hide).defaultPrevented)return;c.reflow(this.element),this.element.classList.add(Sidebar.CLASS_NAME.folding),this.element.classList.remove(Sidebar.CLASS_NAME.folded);const e=this.triggerArray.length;if(e>0)for(let t=0;t{this.element.parentElement&&this.element.parentElement.tagName.toLowerCase()===Sidebar.NAME&&this.element.parentElement.removeAttribute("folded"),this.setTransitioning(!1),this.element.classList.remove(Sidebar.CLASS_NAME.folding),EventHandler.trigger(this.element,Sidebar.EVENT.hidden)})),c.emulateTransitionEnd(this.element,t)}setTransitioning(e){this.isTransitioning=e}closeOnInteractOut=e=>{e.key&&"Escape"!==e.key||!e.key&&e.target.closest(Sidebar.SELECTOR.default)||this.open()};dispose(){document.removeEventListener("click",this.closeOnInteractOut),document.removeEventListener("keydown",this.closeOnInteractOut),EventHandler.off(document,Sidebar.EVENT.clickDataApi,Sidebar.SELECTOR.dataToggle),t.removeData(this.element,Sidebar.DATA_KEY),this.options=null,this.element=null,this.triggerArray=null,this.isTransitioning=null}addAriaAndExpandedClass(e,t){if(e){const n=e.classList.contains(Sidebar.CLASS_NAME.folded);t.length&&t.forEach((e=>{n?e.classList.remove(Sidebar.CLASS_NAME.folded):e.classList.add(Sidebar.CLASS_NAME.folded),e.setAttribute("aria-folded",n)}))}}static getOptions(e){return(e={...Sidebar.DEFAULT_OPTIONS,...e}).toggle=Boolean(e.toggle),c.typeCheckConfig(Sidebar.NAME,e,Sidebar.DEFAULT_TYPE),e}static getTargetFromElement(e){const t=c.getSelectorFromElement(e);return t?document.querySelector(t):null}static expandInterface(e,n){let i=t.getData(e,Sidebar.DATA_KEY);const s={...Sidebar.DEFAULT_OPTIONS,...l.getDataAttributes(e),..."object"==typeof n&&n?n:{}};if(!i&&s.toggle&&/show|hide/.test(n)&&(s.toggle=!1),i||(i=new Sidebar(e,s)),"string"==typeof n){if(void 0===i[n])throw new Error(`No method named "${n}"`);i[n]()}}static getInstance(e){return t.getData(e,Sidebar.DATA_KEY)}static init(e={}){return super.init(this,e,Sidebar.SELECTOR.default)}registerEvents(){EventHandler.on(document,Sidebar.EVENT.clickDataApi,Sidebar.SELECTOR.dataToggle,(function(e){"A"===e.target.tagName&&e.preventDefault();const t=l.getDataAttributes(this),n=c.getSelectorFromElement(this);c.makeArray(document.querySelectorAll(n)).forEach((e=>{const n=Sidebar.getInstance(e)?"toggle":t;Sidebar.expandInterface(e,n)}))}))}}const ye={hasArrow:!0,isColorInverse:!1,placement:"top",isContentHtml:!1},Ne={element:"nj-tooltip",modifier:{withoutArrow:"nj-tooltip--without-arrow",inverse:"nj-tooltip--inverse",placed:e=>`nj-tooltip--${e}`}},Le={element:"nj-tooltip__arrow",modifier:{center:"nj-tooltip__arrow--center"}},Ce={element:"nj-tooltip__inner"};class Tooltip{_isDisplayed=!1;constructor(e,t,n){this.anchorElement=e,this.anchorParentElement=e.parentElement,this.createTooltipElement(),Object.defineProperty(this.anchorElement,"_njTooltip",{value:this,writable:!0});const i=t??e.dataset.tooltipContent;this.options=Object.assign({},ye,n??{},e.dataset?this.getOptionsFromDataset(e.dataset):{}),this.updateTooltipModifiers(this.options),this.setContent(i,this.options.isContentHtml),"string"==typeof e.dataset?.tooltipAlways&&this.show()}createTooltipElement(){const e=document.createElement("div");e.className=Ne.element,e.role="tooltip",e.id=c.getUID("tooltip-");const t=document.createElement("div");t.className=`${Le.element} ${Le.modifier.center}`,t.ariaHidden="true";const n=document.createElement("div");n.className=Ce.element,e.appendChild(t),e.appendChild(n),this.tooltipElement=e,this.arrowElement=t,this.innerElement=n}getOptionsFromDataset(e){const t={};return"string"==typeof e.tooltipArrow&&(t.hasArrow="true"===e.tooltipArrow),"string"==typeof e.tooltipInverse&&(t.isColorInverse="true"===e.tooltipInverse),"string"==typeof e.tooltipPlacement&&(t.placement=e.tooltipPlacement),"string"==typeof e.tooltipHtml&&(t.isContentHtml="true"===e.tooltipHtml),t}updateTooltipModifiers(e){"boolean"==typeof e.hasArrow&&(e.hasArrow?this.tooltipElement.classList.remove(Ne.modifier.withoutArrow):this.tooltipElement.classList.add(Ne.modifier.withoutArrow)),"boolean"==typeof e.isColorInverse&&(e.isColorInverse?this.tooltipElement.classList.add(Ne.modifier.inverse):this.tooltipElement.classList.remove(Ne.modifier.inverse)),"string"==typeof e.placement&&(this.tooltipElement.classList.remove(Ne.modifier.placed("top")),this.tooltipElement.classList.remove(Ne.modifier.placed("right")),this.tooltipElement.classList.remove(Ne.modifier.placed("bottom")),this.tooltipElement.classList.remove(Ne.modifier.placed("left")),this.tooltipElement.classList.add(Ne.modifier.placed(e.placement)))}show(){this._isDisplayed||(this.anchorParentElement.appendChild(this.tooltipElement),this.anchorElement.setAttribute("aria-describedby",this.tooltipElement.id),this._isDisplayed=!0,this.cleanupFunction=Ee(this.anchorElement,this.tooltipElement,(()=>{Te(this.anchorElement,this.tooltipElement,{placement:this.options.placement,middleware:[ge(),this.options.hasArrow&&ve({element:this.arrowElement})]}).then((({x:e,y:t,placement:n})=>{Object.assign(this.tooltipElement.style,{left:`${e}px`,top:`${t}px`}),this.updateTooltipModifiers({placement:n})}))})))}hide(){this._isDisplayed&&(this.cleanupFunction?.(),this.cleanupFunction=null,this.anchorElement.parentElement?.removeChild(this.tooltipElement),this.anchorElement.removeAttribute("aria-describedby"),this._isDisplayed=!1)}setContent(e,t=ye.isContentHtml){"string"==typeof e?t?this.innerElement.innerHTML=e:this.innerElement.innerText=e:this.innerElement.appendChild(e)}updateOptions(e){this.options={...this.options,...e},this.updateTooltipModifiers(this.options)}}const we=(e,t,n)=>new Tooltip(e,t,n),Ie=(e,t='[data-toggle="tooltip"]')=>{const n=e??document.body,i=[],s=[];n.querySelectorAll(t).forEach((e=>{const t=e,n=we(t);"true"!==t.dataset.tooltipAlways&&s.push(xe(n)),i.push(n)}));return{tooltips:i,unmount:()=>{s.forEach((e=>e()))}}},xe=(e,t)=>{const n=new AbortController,{signal:i}=n,s=t??e.anchorElement;return s.addEventListener("focusin",(()=>{e.show()}),{signal:i}),s.addEventListener("mouseenter",(()=>{e.show()}),{signal:i}),s.addEventListener("focusout",(()=>{e.hide()}),{signal:i}),s.addEventListener("mouseleave",(()=>{e.hide()}),{signal:i}),()=>{e.hide(),n.abort()}};class Slider extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-slider`;static DATA_KEY=`${n.KEY_PREFIX}.slider`;static CLASS_NAME=`${n.KEY_PREFIX}-slider`;static SELECTOR={default:`.${Slider.CLASS_NAME}`,input:"input",label:"label"};static THUMB_WIDTH=16;static DEFAULT_TYPE={tooltip:"boolean"};static DEFAULT_OPTIONS={tooltip:!1};static PERCENT_CONV=100;static PSEUDO_ELEMS=["webkit-slider-runnable","moz-range","ms"];dataId=Number(String(Math.random()).slice(2))+Date.now();currentProgress=0;constructor(e,n={}){if(super(Slider,e,Slider.getOptions(e,n)),this.input=this.element.querySelector(Slider.SELECTOR.input),this.element.setAttribute("data-id",this.dataId.toString()),this.refreshProgressValue(),this.setListeners(),this.options.tooltip){const e=document.createElement("div");e.className="nj-slider__tooltip-anchor",this.element.appendChild(e);const t={parentElement:this.element,setAttribute:(e,t)=>{this.input.setAttribute(e,t)},removeAttribute:e=>{this.input.removeAttribute(e)},contextElement:e,getBoundingClientRect:()=>{const{x:e,y:t,width:n,height:i,top:s,left:r,right:o,bottom:a}=this.input.getBoundingClientRect(),l=this.currentProgress*(-1*Slider.THUMB_WIDTH);return{x:n*this.currentProgress+l+e,y:t,width:Slider.THUMB_WIDTH,height:i,top:s,left:n*this.currentProgress+l+r,right:o,bottom:a}}};this.tooltip=we(t,this.input.value,{hasArrow:!1,placement:"top"}),this.tooltip.show(),this.setTooltipListeners()}t.setData(e,Slider.DATA_KEY,this)}setListeners(){EventHandler.on(this.element,"input change keyup",(()=>{this.refreshProgressValue()}))}setTooltipListeners(){EventHandler.on(this.element,"input change keyup",(()=>{this.refreshTooltipValue()}));let e=!1;EventHandler.on(document,"resize",(()=>{e||(this.refreshTooltipValue(),e=!0,setTimeout((()=>{e=!1}),100))}))}refreshProgressValue(){const e=document.querySelector(`[data-id='${this.dataId}']`);if(e){const t=parseFloat(this.input.max)||Slider.PERCENT_CONV,n=parseFloat(this.input.min)||0,i=parseFloat(this.input.value);this.currentProgress=(i-n)/(t-n);const s=Slider.PERCENT_CONV*this.currentProgress;e.style.setProperty("--nj-slider-track-position",`${s}% 100%`),e.style.setProperty("--nj-slider-anchor-left",`calc(${s}% + ${this.currentProgress} * -20px + 10px)`)}}refreshTooltipValue(){this.tooltip.setContent(this.input.value)}static getOptions(e,t={}){return t={...Slider.DEFAULT_OPTIONS,...l.getDataAttributes(e),..."object"==typeof t&&t?t:{}},c.typeCheckConfig(Slider.NAME,t,Slider.DEFAULT_TYPE),t}dispose(){this.tooltip?.hide(),EventHandler.off(this.element,"input change keyup"),EventHandler.off(document,"resize"),t.removeData(this.element,Slider.DATA_KEY),this.element=null}static getInstance(e){return t.getData(e,Slider.DATA_KEY)}static init(e={}){return super.init(this,e,Slider.SELECTOR.default)}}class Tab extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-tab`;static DATA_KEY=`${n.KEY_PREFIX}.tab`;static CLASS_NAME={component:`.${Tab.NAME}`,tabItem:`.${Tab.NAME}__item`,tabContent:`.${Tab.NAME}__content`,itemActive:`${Tab.NAME}__item--active`,contentActive:`${Tab.NAME}__content--active`};static SELECTOR={default:`.${Tab.NAME}`};currentIndex=null;constructor(e){super(Tab,e),this.element=e,t.setData(e,Tab.DATA_KEY,this),this.tabs=e.querySelectorAll(Tab.CLASS_NAME.tabItem),this.tabs.forEach(((e,t)=>{e.addEventListener("click",this.show),e.classList.contains(Tab.CLASS_NAME.itemActive)&&(this.currentIndex=t),e.addEventListener("keydown",this.onKeyDown)}))}show=e=>{const t=e.currentTarget;if(!t.getAttribute("disabled")){this.tabs.forEach(((e,n)=>{e===t&&(this.currentIndex=n),e.classList.remove(Tab.CLASS_NAME.itemActive),e.setAttribute("tabindex","-1"),e.setAttribute("aria-selected","false"),this.element.querySelectorAll(Tab.CLASS_NAME.tabContent)[n].classList.remove(Tab.CLASS_NAME.contentActive)})),t.classList.add(Tab.CLASS_NAME.itemActive),t.setAttribute("tabindex","0"),t.setAttribute("aria-selected","true");this.element.querySelectorAll(Tab.CLASS_NAME.tabContent).length>this.currentIndex&&this.element.querySelectorAll(Tab.CLASS_NAME.tabContent)[this.currentIndex].classList.add(Tab.CLASS_NAME.contentActive)}};focusNextFocusableTab(){const e=Array.from(this.tabs).filter((e=>!e.hasAttribute("disabled"))),t=e.findIndex((e=>document.activeElement===e));e.at((t+1)%e.length).focus()}focusPreviousFocusableTab(){const e=Array.from(this.tabs).filter((e=>!e.hasAttribute("disabled"))),t=e.findIndex((e=>document.activeElement===e));e.at(t-1).focus()}onKeyDown=e=>{switch(e.key){case"ArrowRight":e.preventDefault(),this.focusNextFocusableTab();break;case"ArrowLeft":e.preventDefault(),this.focusPreviousFocusableTab();break;case"Tab":const t=e.target;if(!("true"===t.getAttribute("aria-selected")))return;const n=t.getAttribute("aria-controls"),i=this.element.querySelector(`[id=${n}]`);setTimeout((()=>{i.focus()}))}};dispose(){this.tabs.forEach((e=>{e.removeEventListener("click",this.show),e.removeEventListener("keydown",this.onKeyDown)})),t.removeData(this.element,Tab.DATA_KEY)}static getInstance(e){return t.getData(e,Tab.DATA_KEY)}static init(e={}){return super.init(this,e,Tab.SELECTOR.default)}}class Tag extends AbstractComponent{static NAME=`${n.KEY_PREFIX}-tag`;static DATA_KEY=`${n.KEY_PREFIX}.tag`;static KEYFRAMES=[{opacity:1},{opacity:0}];static SELECTOR={default:`.${Tag.NAME}:not(.disabled)`,close:`.${Tag.NAME}__close`};constructor(e,t={}){super(Tag,e,l.extend(!0,{},t)),EventHandler.on(e,s.click,this.handleClick.bind(this))}closeAndDestroy(){this.element.animate(Tag.KEYFRAMES,{duration:200,delay:70,easing:"ease-out"}).onfinish=()=>{this.destroyElement()}}async close(e){this.element.animate(Tag.KEYFRAMES,{duration:200,delay:70,easing:"ease-out"}),await new Promise((e=>setTimeout(e,270))),e()}destroyElement(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispose()}dispose(){t.removeData(this.element,Tag.DATA_KEY),EventHandler.off(this.element,s.click,this.handleClick.bind(this)),this.element=null}handleClick(e){e.target.closest(Tag.SELECTOR.close)&&(e.preventDefault(),this.closeAndDestroy())}static init(e={}){return super.init(this,e,Tag.SELECTOR.default)}static getInstance(e){return t.getData(e,Tag.DATA_KEY)}static getRootElement(e){return e.closest(Tag.SELECTOR.default)}}class NJ{static AUTOINIT_COMPONENTS=[Accordion,Alert,Collapse,Dropdown,Fab,Form,Header,InlineMessage,InputNumber,Search,Modal,Navbar,Select,Sidebar,Slider,Tab,Tag,Password,SelectInput,AutocompleteInput,SegmentedControl];static Accordion=Accordion;static Alert=Alert;static Collapse=Collapse;static Dropdown=Dropdown;static Fab=Fab;static Form=Form;static Header=Header;static InlineMessage=InlineMessage;static InputNumber=InputNumber;static Search=Search;static Modal=Modal;static Navbar=Navbar;static Select=Select;static Sidebar=Sidebar;static Slider=Slider;static Tab=Tab;static Tag=Tag;static njTooltip=we;static initAllTooltips=Ie;static displayTooltipOnHoverAndFocus=xe;static Tooltip=Tooltip;static Password=Password;static SelectInput=SelectInput;static AutocompleteInput=AutocompleteInput;static openMenu=Se;static AutoInit(){try{for(let e=0,t=NJ.AUTOINIT_COMPONENTS.length;e