@finqu/cool 1.3.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +23 -9
  2. package/dist/css/cool.css +13391 -7742
  3. package/dist/css/cool.css.map +1 -1
  4. package/dist/css/cool.min.css +2 -93
  5. package/dist/css/cool.min.css.map +1 -1
  6. package/dist/js/cool.bundle.js +16051 -17050
  7. package/dist/js/cool.bundle.js.map +1 -1
  8. package/dist/js/cool.bundle.min.js +11 -18
  9. package/dist/js/cool.bundle.min.js.map +1 -1
  10. package/dist/js/cool.esm.js +3469 -4468
  11. package/dist/js/cool.esm.js.map +1 -1
  12. package/dist/js/cool.esm.min.js +2 -8
  13. package/dist/js/cool.esm.min.js.map +1 -1
  14. package/dist/js/cool.js +5083 -6089
  15. package/dist/js/cool.js.map +1 -1
  16. package/dist/js/cool.min.js +2 -8
  17. package/dist/js/cool.min.js.map +1 -1
  18. package/package.json +48 -16
  19. package/scss/LISENCE +15 -0
  20. package/scss/_badge.scss +134 -0
  21. package/scss/_button-group.scss +80 -0
  22. package/scss/_buttons.scss +304 -0
  23. package/scss/_dark.scss +637 -0
  24. package/scss/_dialog.scss +351 -0
  25. package/scss/_dropdown.scss +165 -0
  26. package/scss/_forms.scss +613 -0
  27. package/scss/_frame.scss +948 -0
  28. package/scss/_grid.scss +215 -0
  29. package/scss/_input-group.scss +326 -0
  30. package/scss/_list-group.scss +127 -0
  31. package/scss/_media.scss +439 -0
  32. package/scss/_navbar.scss +122 -0
  33. package/scss/_notification.scss +115 -0
  34. package/scss/_pagination.scss +82 -0
  35. package/scss/_popover.scss +61 -0
  36. package/scss/_reboot.scss +306 -0
  37. package/scss/_root.scss +848 -0
  38. package/scss/_section.scss +735 -0
  39. package/scss/_select.scss +559 -0
  40. package/scss/_tables.scss +611 -0
  41. package/scss/_tabs.scss +50 -0
  42. package/scss/_toast.scss +277 -0
  43. package/scss/_tooltip.scss +130 -0
  44. package/scss/_typography.scss +166 -0
  45. package/scss/_variables.scss +1229 -0
  46. package/scss/cool.scss +69 -0
  47. package/scss/utilities/_align.scss +51 -0
  48. package/scss/utilities/_animation.scss +165 -0
  49. package/scss/utilities/_background.scss +72 -0
  50. package/scss/utilities/_borders.scss +205 -0
  51. package/scss/utilities/_collapse.scss +28 -0
  52. package/scss/utilities/_cursor.scss +160 -0
  53. package/scss/utilities/_display.scss +116 -0
  54. package/scss/utilities/_embed.scss +89 -0
  55. package/scss/utilities/_fill.scss +79 -0
  56. package/scss/utilities/_filters.scss +233 -0
  57. package/scss/utilities/_flex.scss +216 -0
  58. package/scss/utilities/_grid.scss +136 -0
  59. package/scss/utilities/_opacity.scss +131 -0
  60. package/scss/utilities/_overflow.scss +242 -0
  61. package/scss/utilities/_perfect-scrollbar.scss +147 -0
  62. package/scss/utilities/_pointer-events.scss +125 -0
  63. package/scss/utilities/_position.scss +130 -0
  64. package/scss/utilities/_screen-readers.scss +95 -0
  65. package/scss/utilities/_shadows.scss +195 -0
  66. package/scss/utilities/_sizing.scss +288 -0
  67. package/scss/utilities/_spacing.scss +168 -0
  68. package/scss/utilities/_stroke.scss +124 -0
  69. package/scss/utilities/_text.scss +420 -0
  70. package/scss/utilities/_transform.scss +232 -0
  71. package/scss/utilities/_transitions.scss +147 -0
  72. package/scss/utilities/_user-select.scss +93 -0
  73. package/scss/utilities/_visibility.scss +66 -0
  74. package/scss/utilities/_z-index.scss +169 -0
@@ -1,13 +1,7 @@
1
1
  /*!
2
- * Cool v1.3.0 (undefined)
2
+ * Cool v2.0.2 (https://github.com/finqu/cool#readme)
3
3
  * Copyright 2020-2026 Finqu Oy
4
4
  * Licensed under ISC
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cool=e()}(this,function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function e(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}(e))||i){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}var o=function(){function t(){}t.initializeElement=function(t,e){void 0===e&&(e={});var i="string"==typeof t?document.querySelector(t):t;if(!i)return!1;var n=$(i);if(!n.data("plugin_"+this.NAME)){var o=new this(i,e);return n.data("plugin_"+this.NAME,o),this.instances.push(o),o}return!1},t.initializeElements=function(t,e){var i=this;return void 0===e&&(e={}),document.querySelectorAll(t).forEach(function(t){i.initializeElement(t,e)}),this.instances};var e=t.prototype;return e.onInit=function(){var t=this.opts.onInit;"function"==typeof t&&t.call(this)},e.onUpdate=function(){var t=this.opts.onUpdate;"function"==typeof t&&t.call(this)},e.onDestroy=function(){var t=this.opts.onDestroy;"function"==typeof t&&t.call(this)},e.onShow=function(){var t=this.opts.onShow;"function"==typeof t&&t.call(this)},e.onClose=function(){var t=this.opts.onClose;"function"==typeof t&&t.call(this)},e.onReset=function(){var t=this.opts.onReset;"function"==typeof t&&t.call(this)},t}();o.instances=[];var s=function(t){function e(i){var n;return(n=t.call(this)||this).opts={},window.Cool&&window.Cool.settings&&window.Cool.settings.section?$.extend(!0,n.opts,e.DEFAULTS,window.Cool.settings.section,i):$.extend(!0,n.opts,e.DEFAULTS,i),n._eventHandlers=[],n._updateTimeout=null,n._rafId=null,n.init(),n}i(e,t);var n=e.prototype;return n.init=function(){this.opts.observeSections&&this.initializeSectionObserver(),this.opts.initFormControls&&this.initializeFormControls(),this.opts.initTableHandlers&&this.initializeTableHandlers(),this.opts.initButtonGroups&&this.initializeButtonGroups(),this.opts.initTabs&&this.initializeTabs(),this.onInit()},n.destroy=function(){this.destroySectionObserver(),this.unbindEvents(),this._updateTimeout&&clearTimeout(this._updateTimeout),this._rafId&&cancelAnimationFrame(this._rafId),this.onDestroy()},n._addEventListener=function(t,e,i,n){t.addEventListener(e,i,n),this._eventHandlers.push({element:t,event:e,handler:i,options:n})},n.initializeSectionObserver=function(){var t=this;this._isUpdating=!1,this.sectionObserver=new MutationObserver(function(e){t._isUpdating||(e.every(function(t){if("attributes"===t.type&&"class"===t.attributeName){var e=t.target,i=t.oldValue?t.oldValue.split(" "):[],n=Array.from(e.classList),o=n.filter(function(t){return!i.includes(t)}),s=i.filter(function(t){return!n.includes(t)});return[].concat(o,s).every(function(t){return"is-last-visible"===t||"is-last-visible-row"===t||"is-last-visible-cell"===t})}return!1})||(t._updateTimeout&&clearTimeout(t._updateTimeout),t._updateTimeout=setTimeout(function(){t._rafId&&cancelAnimationFrame(t._rafId),t._rafId=requestAnimationFrame(function(){t.updateLastVisibleElements()})},50)))}),this.sectionObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["class","style","hidden"],attributeOldValue:!0,subtreeFilter:function(t){return t.classList&&(t.classList.contains("section")||t.classList.contains("select")||"TABLE"===t.nodeName||"TR"===t.nodeName||"TD"===t.nodeName||"TH"===t.nodeName)}}),this.updateLastVisibleElements()},n.updateLastVisibleElements=function(){var t=this;this._isUpdating=!0;var e={sections:[],tables:[],rows:[]};document.querySelectorAll(".section").forEach(function(i){var n=t.getVisibleChildren(i);n.length&&e.sections.push({section:i,lastVisible:n[n.length-1]})}),document.querySelectorAll("table").forEach(function(i){var n=i.querySelector("tbody")||i,o=t.getVisibleElements(n.querySelectorAll("tr"));o.length&&e.tables.push({tbody:n,lastVisibleRow:o[o.length-1]})}),document.querySelectorAll("table tr").forEach(function(i){var n=t.getVisibleElements(i.querySelectorAll("td, th"));n.length&&e.rows.push({row:i,lastVisibleCell:n[n.length-1]})}),requestAnimationFrame(function(){document.querySelectorAll(".is-last-visible, .is-last-visible-row, .is-last-visible-cell").forEach(function(t){t.classList.remove("is-last-visible","is-last-visible-row","is-last-visible-cell")}),e.sections.forEach(function(t){t.lastVisible.classList.add("is-last-visible")}),e.tables.forEach(function(t){t.lastVisibleRow.classList.add("is-last-visible-row")}),e.rows.forEach(function(t){t.lastVisibleCell.classList.add("is-last-visible-cell")}),setTimeout(function(){t._isUpdating=!1},0)})},n.getVisibleChildren=function(t){var e=this;return Array.from(t.children).filter(function(t){return e.isElementVisible(t)})},n.getVisibleElements=function(t){var e=this;return Array.from(t).filter(function(t){return e.isElementVisible(t)})},n.isElementVisible=function(t){return t._computedStyle&&!t._styleInvalidated||(t._computedStyle=window.getComputedStyle(t),t._styleInvalidated=!1),!t.classList.contains("d-none")&&!t.classList.contains("d-md-none")&&null!==t.offsetParent&&t.offsetHeight>0&&"none"!==t._computedStyle.display},n.destroySectionObserver=function(){this.sectionObserver&&(this.sectionObserver.disconnect(),this.sectionObserver=null),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=null),this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)},n.initializeFormControls=function(){this._addEventListener(document,"focusin",function(t){var e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){var i=e.closest(".input-group");null==i||i.classList.add("input-group-focus")}}),this._addEventListener(document,"focusout",function(t){var e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){var i=e.closest(".input-group");null==i||i.classList.remove("input-group-focus")}});var t=function(t){var e=t.querySelector("input, select"),i=!(null==e||!e.value);t.classList.toggle("label-on-top",i)};this._addEventListener(document,"input",function(e){var i=e.target.closest(".form-label-group");i&&t(i)}),this._addEventListener(document,"change",function(e){var i=e.target.closest(".form-label-group");i&&t(i),e.target.matches("select")&&e.target.blur()}),document.querySelectorAll(".form-label-group").forEach(t)},n.initializeTableHandlers=function(){document.querySelectorAll(".table").forEach(function(t){t.querySelector("[data-table-link], [data-table-btn]")&&!t.classList.contains("table-hover")&&t.classList.add("table-hover")}),this._addEventListener(document,"click",function(t){if(t.target.closest("[data-table-link] .table-link-exclude, [data-table-link] input, [data-table-link] button, [data-table-link] a, [data-table-link] label, [data-table-link] .td-col-select"))t.stopPropagation();else{var e=t.target.closest("[data-table-link]");if(e){var i=e.closest("table, .table"),n=e.dataset.tableLink;if(null!=i&&i.classList.contains("bulk-actions-active"))return;t.ctrlKey||t.metaKey?window.open(n,"_blank"):window.location.href=n}if(t.target.closest("[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select"))t.stopPropagation();else{var o=t.target.closest("[data-table-btn]");if(o){var s=o.closest("tr, .tr"),a=o.querySelector("button");if(!a||null!=s&&s.classList.contains("bulk-actions-active"))return;a.click()}}}})},n.initializeButtonGroups=function(){this._addEventListener(document,"click",function(t){var e=t.target.closest(".btn-group-toggle .btn");if(e&&!t.target.matches("input")){var i=e.querySelector("input");i&&(i.click(),i.dispatchEvent(new Event("change",{bubbles:!0})))}t.target.matches(".btn-group-toggle .btn > input")&&t.stopPropagation()}),this._addEventListener(document,"change",function(t){if(t.target.matches('.btn-group-toggle .btn > input[type="radio"]')){var e=t.target.parentElement.closest(".btn-group-toggle");e&&e.querySelectorAll(".btn").forEach(function(t){var e;t.classList.toggle("active",null==(e=t.querySelector("input"))?void 0:e.checked)})}else if(t.target.matches('.btn-group-toggle .btn > input[type="checkbox"]')){t.target.parentElement.classList.toggle("active",t.target.checked)}})},n.initializeTabs=function(){this._addEventListener(document,"click",function(t){var e=t.target.closest(".tabs .tab-item");e&&(t.stopPropagation(),e.closest(".tabs").querySelectorAll(".tab-item").forEach(function(t){return t.classList.remove("active")}),e.classList.add("active"))})},n.unbindEvents=function(){this._eventHandlers.forEach(function(t){var e=t.element,i=t.event,n=t.handler,o=t.options;e.removeEventListener(i,n,o)}),this._eventHandlers=[]},n.refresh=function(){document.querySelectorAll(".form-label-group").forEach(function(t){var e=t.querySelector("input, select"),i=null==e?void 0:e.value;t.classList.toggle("label-on-top",!!i)})},e}(o);
7
- /*!
8
- * perfect-scrollbar v1.5.6
9
- * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors
10
- * Licensed under MIT
11
- */
12
- function a(t){return getComputedStyle(t)}function r(t,e){for(var i in e){var n=e[i];"number"==typeof n&&(n+="px"),t.style[i]=n}return t}function l(t){var e=document.createElement("div");return e.className=t,e}s.DEFAULTS={observeSections:!0,initFormControls:!0,initTableHandlers:!0,initButtonGroups:!0,initTabs:!0,onInit:null,onDestroy:null};var c="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function h(t,e){if(!c)throw new Error("No element matching method supported");return c.call(t,e)}function d(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function u(t,e){return Array.prototype.filter.call(t.children,function(t){return h(t,e)})}var p="ps",f="ps__rtl",m={thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},v={focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}},g={x:null,y:null};function b(t,e){var i=t.element.classList,n=v.scrolling(e);i.contains(n)?clearTimeout(g[e]):i.add(n)}function w(t,e){g[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(v.scrolling(e))},t.settings.scrollingThreshold)}var y=function(t){this.element=t,this.handlers={}},C={isEmpty:{configurable:!0}};y.prototype.bind=function(t,e){"undefined"==typeof this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},y.prototype.unbind=function(t,e){var i=this;this.handlers[t]=this.handlers[t].filter(function(n){return!(!e||n===e)||(i.element.removeEventListener(t,n,!1),!1)})},y.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},C.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(y.prototype,C);var E=function(){this.eventElements=[]};function S(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}function T(t,e,i,n,o){var s;if(void 0===n&&(n=!0),void 0===o&&(o=!1),"top"===e)s=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");s=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(t,e,i,n,o){var s=i[0],a=i[1],r=i[2],l=i[3],c=i[4],h=i[5];void 0===n&&(n=!0);void 0===o&&(o=!1);var d=t.element;t.reach[l]=null,d[r]<1&&(t.reach[l]="start");d[r]>t[s]-t[a]-1&&(t.reach[l]="end");e&&(d.dispatchEvent(S("ps-scroll-"+l)),e<0?d.dispatchEvent(S("ps-scroll-"+c)):e>0&&d.dispatchEvent(S("ps-scroll-"+h)),n&&function(t,e){b(t,e),w(t,e)}(t,l));t.reach[l]&&(e||o)&&d.dispatchEvent(S("ps-"+l+"-reach-"+t.reach[l]))}(t,i,s,n,o)}function x(t){return parseInt(t,10)||0}E.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new y(t),this.eventElements.push(e)),e},E.prototype.bind=function(t,e,i){this.eventElement(t).bind(e,i)},E.prototype.unbind=function(t,e,i){var n=this.eventElement(t);n.unbind(e,i),n.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(n),1)},E.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},E.prototype.once=function(t,e,i){var n=this.eventElement(t),o=function(t){n.unbind(e,o),i(t)};n.bind(e,o)};var I={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function k(t){var e=t.element,i=Math.floor(e.scrollTop),n=e.getBoundingClientRect();t.containerWidth=Math.floor(n.width),t.containerHeight=Math.floor(n.height),t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(u(e,m.rail("x")).forEach(function(t){return d(t)}),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(u(e,m.rail("y")).forEach(function(t){return d(t)}),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=A(t,x(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=x((t.negativeScrollAdjustment+e.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1,!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=A(t,x(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=x(i*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1,t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),function(t,e){var i={width:e.railXWidth},n=Math.floor(t.scrollTop);e.isRtl?i.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:i.left=t.scrollLeft;e.isScrollbarXUsingBottom?i.bottom=e.scrollbarXBottom-n:i.top=e.scrollbarXTop+n;r(e.scrollbarXRail,i);var o={top:n,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?o.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:o.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?o.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:o.left=e.scrollbarYLeft+t.scrollLeft;r(e.scrollbarYRail,o),r(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),r(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}(e,t),t.scrollbarXActive?e.classList.add(v.active("x")):(e.classList.remove(v.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(v.active("y")):(e.classList.remove(v.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function A(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}var _=null;function L(t,e){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],r=e[5],l=e[6],c=e[7],h=e[8],d=t.element,u=null,p=null,f=null;function m(e){e.touches&&e.touches[0]&&(e[o]=e.touches[0]["page"+c.toUpperCase()]),_===a&&(d[l]=u+f*(e[o]-p),b(t,c),k(t),e.stopPropagation(),e.preventDefault())}function g(){w(t,c),t[h].classList.remove(v.clicking),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",g),_=null}function $(e){null===_&&(_=a,u=d[l],e.touches&&(e[o]=e.touches[0]["page"+c.toUpperCase()]),p=e[o],f=(t[n]-t[i])/(t[s]-t[r]),e.touches?(document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",g)):(document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)),t[h].classList.add(v.clicking)),e.stopPropagation(),e.cancelable&&e.preventDefault()}t[a].addEventListener("mousedown",$),t[a].addEventListener("touchstart",$)}var M={"click-rail":function(t){t.event.bind(t.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarYRail,"mousedown",function(e){var i=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=i*t.containerHeight,k(t),e.stopPropagation()}),t.event.bind(t.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarXRail,"mousedown",function(e){var i=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=i*t.containerWidth,k(t),e.stopPropagation()})},"drag-thumb":function(t){L(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"]),L(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",function(i){if(!(i.isDefaultPrevented&&i.isDefaultPrevented()||i.defaultPrevented)&&(h(e,":hover")||h(t.scrollbarX,":focus")||h(t.scrollbarY,":focus"))){var n,o=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(o){if("IFRAME"===o.tagName)o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(h(n=o,"input,[contenteditable]")||h(n,"select,[contenteditable]")||h(n,"textarea,[contenteditable]")||h(n,"button,[contenteditable]"))return}var s=0,a=0;switch(i.which){case 37:s=i.metaKey?-t.contentWidth:i.altKey?-t.containerWidth:-30;break;case 38:a=i.metaKey?t.contentHeight:i.altKey?t.containerHeight:30;break;case 39:s=i.metaKey?t.contentWidth:i.altKey?t.containerWidth:30;break;case 40:a=i.metaKey?-t.contentHeight:i.altKey?-t.containerHeight:-30;break;case 32:a=i.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:a=t.containerHeight;break;case 34:a=-t.containerHeight;break;case 36:a=t.contentHeight;break;case 35:a=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==s||t.settings.suppressScrollY&&0!==a||(e.scrollTop-=a,e.scrollLeft+=s,k(t),function(i,n){var o=Math.floor(e.scrollTop);if(0===i){if(!t.scrollbarYActive)return!1;if(0===o&&n>0||o>=t.contentHeight-t.containerHeight&&n<0)return!t.settings.wheelPropagation}var s=e.scrollLeft;if(0===n){if(!t.scrollbarXActive)return!1;if(0===s&&i<0||s>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}(s,a)&&i.preventDefault())}})},wheel:function(t){var e=t.element;function i(i){var n=function(t){var e=t.deltaX,i=-1*t.deltaY;return"undefined"!=typeof e&&"undefined"!=typeof i||(e=-1*t.wheelDeltaX/6,i=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,i*=10),e!=e&&i!=i&&(e=0,i=t.wheelDelta),t.shiftKey?[-i,-e]:[e,i]}(i),o=n[0],s=n[1];if(!function(t,i,n){if(!I.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var o=t;o&&o!==e;){if(o.classList.contains(m.consuming))return!0;var s=a(o);if(n&&s.overflowY.match(/(scroll|auto)/)){var r=o.scrollHeight-o.clientHeight;if(r>0&&(o.scrollTop>0&&n<0||o.scrollTop<r&&n>0))return!0}if(i&&s.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&i<0||o.scrollLeft<l&&i>0))return!0}o=o.parentNode}return!1}(i.target,o,s)){var r=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=o*t.settings.wheelSpeed,r=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(o?e.scrollLeft+=o*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,r=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=o*t.settings.wheelSpeed),k(t),r=r||function(i,n){var o=Math.floor(e.scrollTop),s=0===e.scrollTop,a=o+e.offsetHeight===e.scrollHeight,r=0===e.scrollLeft,l=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(n)>Math.abs(i)?s||a:r||l)||!t.settings.wheelPropagation}(o,s),r&&!i.ctrlKey&&(i.stopPropagation(),i.preventDefault())}}"undefined"!=typeof window.onwheel?t.event.bind(e,"wheel",i):"undefined"!=typeof window.onmousewheel&&t.event.bind(e,"mousewheel",i)},touch:function(t){if(I.supportsTouch||I.supportsIePointer){var e=t.element,i={startOffset:{},startTime:0,speed:{},easingLoop:null};I.supportsTouch?(t.event.bind(e,"touchstart",r),t.event.bind(e,"touchmove",l),t.event.bind(e,"touchend",c)):I.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",r),t.event.bind(e,"pointermove",l),t.event.bind(e,"pointerup",c)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",r),t.event.bind(e,"MSPointerMove",l),t.event.bind(e,"MSPointerUp",c)))}function n(i,n){e.scrollTop-=n,e.scrollLeft-=i,k(t)}function o(t){return t.targetTouches?t.targetTouches[0]:t}function s(e){return e.target!==t.scrollbarX&&e.target!==t.scrollbarY&&((!e.pointerType||"pen"!==e.pointerType||0!==e.buttons)&&(!(!e.targetTouches||1!==e.targetTouches.length)||!(!e.pointerType||"mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE)))}function r(t){if(s(t)){var e=o(t);i.startOffset.pageX=e.pageX,i.startOffset.pageY=e.pageY,i.startTime=(new Date).getTime(),null!==i.easingLoop&&clearInterval(i.easingLoop)}}function l(r){if(s(r)){var l=o(r),c={pageX:l.pageX,pageY:l.pageY},h=c.pageX-i.startOffset.pageX,d=c.pageY-i.startOffset.pageY;if(function(t,i,n){if(!e.contains(t))return!1;for(var o=t;o&&o!==e;){if(o.classList.contains(m.consuming))return!0;var s=a(o);if(n&&s.overflowY.match(/(scroll|auto)/)){var r=o.scrollHeight-o.clientHeight;if(r>0&&(o.scrollTop>0&&n<0||o.scrollTop<r&&n>0))return!0}if(i&&s.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&i<0||o.scrollLeft<l&&i>0))return!0}o=o.parentNode}return!1}(r.target,h,d))return;n(h,d),i.startOffset=c;var u=(new Date).getTime(),p=u-i.startTime;p>0&&(i.speed.x=h/p,i.speed.y=d/p,i.startTime=u),function(i,n){var o=Math.floor(e.scrollTop),s=e.scrollLeft,a=Math.abs(i),r=Math.abs(n);if(r>a){if(n<0&&o===t.contentHeight-t.containerHeight||n>0&&0===o)return 0===window.scrollY&&n>0&&I.isChrome}else if(a>r&&(i<0&&s===t.contentWidth-t.containerWidth||i>0&&0===s))return!0;return!0}(h,d)&&r.cancelable&&r.preventDefault()}}function c(){t.settings.swipeEasing&&(clearInterval(i.easingLoop),i.easingLoop=setInterval(function(){t.isInitialized?clearInterval(i.easingLoop):i.speed.x||i.speed.y?Math.abs(i.speed.x)<.01&&Math.abs(i.speed.y)<.01?clearInterval(i.easingLoop):(n(30*i.speed.x,30*i.speed.y),i.speed.x*=.8,i.speed.y*=.8):clearInterval(i.easingLoop)},10))}}},H=function(t,e){var i=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var n in this.element=t,t.classList.add(p),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},e)this.settings[n]=e[n];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var o,s,c=function(){return t.classList.add(v.focus)},h=function(){return t.classList.remove(v.focus)};this.isRtl="rtl"===a(t).direction,!0===this.isRtl&&t.classList.add(f),this.isNegativeScroll=(s=t.scrollLeft,t.scrollLeft=-1,o=t.scrollLeft<0,t.scrollLeft=s,o),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new E,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=l(m.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=l(m.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",c),this.event.bind(this.scrollbarX,"blur",h),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var d=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(d.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=x(d.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=x(d.borderLeftWidth)+x(d.borderRightWidth),r(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=x(d.marginLeft)+x(d.marginRight),r(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=l(m.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=l(m.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",c),this.event.bind(this.scrollbarY,"blur",h),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var u=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(u.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=x(u.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(t){var e=a(t);return x(e.width)+x(e.paddingLeft)+x(e.paddingRight)+x(e.borderLeftWidth)+x(e.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=x(u.borderTopWidth)+x(u.borderBottomWidth),r(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=x(u.marginTop)+x(u.marginBottom),r(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(t){return M[t](i)}),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",function(t){return i.onScroll(t)}),k(this)};H.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,r(this.scrollbarXRail,{display:"block"}),r(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=x(a(this.scrollbarXRail).marginLeft)+x(a(this.scrollbarXRail).marginRight),this.railYMarginHeight=x(a(this.scrollbarYRail).marginTop)+x(a(this.scrollbarYRail).marginBottom),r(this.scrollbarXRail,{display:"none"}),r(this.scrollbarYRail,{display:"none"}),k(this),T(this,"top",0,!1,!0),T(this,"left",0,!1,!0),r(this.scrollbarXRail,{display:""}),r(this.scrollbarYRail,{display:""}))},H.prototype.onScroll=function(t){this.isAlive&&(k(this),T(this,"top",this.element.scrollTop-this.lastScrollTop),T(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},H.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),d(this.scrollbarX),d(this.scrollbarY),d(this.scrollbarXRail),d(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},H.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(t){return!t.match(/^ps([-_].+|)$/)}).join(" ")},"undefined"==typeof window||window.PerfectScrollbar||(window.PerfectScrollbar=H);var z=function(t){function e(i,n){var o;return(o=t.call(this)||this).opts={},window.Cool&&window.Cool.settings&&window.Cool.settings.sidebar?$.extend(!0,o.opts,e.DEFAULTS,window.Cool.settings.sidebar,n):$.extend(!0,o.opts,e.DEFAULTS,n),o.el=i,o.init(),o}i(e,t);var n=e.prototype;return n.init=function(){this.buildCache(),this.bindEvents(),this.initializeScrollbars(),this.initializeTabs(),this.onInit()},n.destroy=function(){this.unbindEvents(),this.destroyScrollbars(),this.onDestroy()},n.buildCache=function(){this.$el=$(this.el),this.el=this.$el[0],this.$content=this.$el.find(".sidebar-content"),this.content=this.$content[0],this.$toggler=$(".sidebar-left-toggler"),this.toggler=this.$toggler[0],this.isFloating=this.$el.hasClass("sidebar-floating"),this.isOpen=document.body.classList.contains("sidebar-left-open"),this.$tabs=this.$el.find(".sidebar-tab"),this.$tabSelectors=$('[name="sidebar-tab-select"]')},n.bindEvents=function(){var t,e=this;(this._toggleHandler=function(t){var i=t.target.closest(".sidebar-left-toggler");i&&e.handleToggle(t,i)},this._mousedownHandler=function(t){if(t.target.matches(".sidebar-content .ps__thumb-y")){var i=t.target.closest(".sidebar-content");null==i||i.classList.add("ps-mousedown-scroll"),e.mousedownScrollbar=!0}},this._mouseupHandler=function(){e.mousedownScrollbar&&(document.querySelectorAll(".sidebar-content.ps-mousedown-scroll").forEach(function(t){return t.classList.remove("ps-mousedown-scroll")}),e.mousedownScrollbar=!1)},this._tabSelectHandler=function(t){t.target.matches('[name="sidebar-tab-select"]')&&e.switchTab(t.target.value)},this._collapseClickHandler=function(t){var i=t.target.closest('[data-toggle="collapse"]');if(i){var n=i.dataset.breakpoint;if(n&&window.matchMedia("(min-width: "+n+"px)").matches){var o,s,a=(null==(o=i.nextElementSibling)?void 0:o.querySelector("li a"))||(null==(s=i.parentElement.nextElementSibling)?void 0:s.querySelector("li a"));a&&(t.metaKey||t.ctrlKey?window.open(a.href,"_blank").focus():window.location.href=a.href)}else setTimeout(function(){var t;return null==(t=e.scrollbar)?void 0:t.update()},300)}},window.ResizeObserver)?(this.resizeObserver=new ResizeObserver(function(t){e.rafId&&cancelAnimationFrame(e.rafId),e.rafId=requestAnimationFrame(function(){window.innerWidth>e.opts.breakpoint&&e.removeBackdrop()})}),this.resizeObserver.observe(document.body)):(this._resizeHandler=function(){clearTimeout(t);var i=performance.now();!e.lastResizeTime||i-e.lastResizeTime>100?(window.innerWidth>e.opts.breakpoint&&e.removeBackdrop(),e.lastResizeTime=i):t=setTimeout(function(){window.innerWidth>e.opts.breakpoint&&e.removeBackdrop()},16)},window.addEventListener("resize",this._resizeHandler,{passive:!0}));document.addEventListener("click",this._toggleHandler),document.addEventListener("click",this._tabSelectHandler),document.addEventListener("mousedown",this._mousedownHandler),document.addEventListener("mouseup",this._mouseupHandler),this.content&&this.content.addEventListener("click",this._collapseClickHandler)},n.unbindEvents=function(){document.removeEventListener("click",this._toggleHandler),document.removeEventListener("click",this._tabSelectHandler),document.removeEventListener("mousedown",this._mousedownHandler),document.removeEventListener("mouseup",this._mouseupHandler),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this.content&&this.content.removeEventListener("click",this._collapseClickHandler)},n.initializeScrollbars=function(){this.content&&(this.scrollbar=new H(this.content,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX}))},n.initializeTabs=function(){var t=this;this.tabScrollbars=new Map,this.$tabs.each(function(e,i){var n=i.querySelector(".tab-content");if(n){var o=new H(n,{wheelSpeed:t.opts.wheelSpeed,wheelPropagation:t.opts.wheelPropagation,minScrollbarLength:t.opts.minScrollbarLength,suppressScrollX:t.opts.suppressScrollX});t.tabScrollbars.set(i,o)}})},n.destroyScrollbars=function(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.tabScrollbars.forEach(function(t){return t.destroy()}),this.tabScrollbars.clear()},n.toggleWithTransition=function(t){var e=document.documentElement;e.classList.add("sidebar-transitioning"),"open"===t?(document.body.classList.add("sidebar-left-open"),this.isFloating&&window.innerWidth<=this.opts.breakpoint&&this.createBackdrop()):(document.body.classList.remove("sidebar-left-open"),this.removeBackdrop()),setTimeout(function(){e.classList.remove("sidebar-transitioning")},330)},n.createBackdrop=function(){var t=this;if(!document.querySelector(".sidebar-backdrop")){var e=document.createElement("div");e.className="sidebar-backdrop",e.addEventListener("click",function(){t.toggleWithTransition("close"),t.toggler&&(t.toggler.classList.remove("open"),null!==t.toggler.ariaExpanded&&(t.toggler.ariaExpanded="false"))});var i=document.querySelector(".site-main");i&&(i.appendChild(e),requestAnimationFrame(function(){e.classList.add("show")}))}},n.removeBackdrop=function(){var t=document.querySelector(".sidebar-backdrop");t&&(t.classList.remove("show"),t.addEventListener("transitionend",function(){t.remove()},{once:!0}),setTimeout(function(){null==t||t.remove()},330))},n.handleToggle=function(t,e){if(t.stopPropagation(),e){null!==e.ariaExpanded&&(e.ariaExpanded="true"!==e.ariaExpanded),e.classList.toggle("open");var i=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(i?"close":"open"),i?this.onClose():this.onShow()}},n.switchTab=function(t){var e=document.getElementById("sidebar-tab-"+t);if(e){var i=this.$tabs.toArray();i.forEach(function(t){if(t.classList.toggle("active",t===e),t!==e){var n=t.querySelector(".tab-content");if(n)if(t===i[0])n.style.transform="translate3d(100%, 0px, 0px)";else if(t===i[i.length-1])n.style.transform="translate3d(-100%, 0px, 0px)";else{var o=i.indexOf(t)<i.indexOf(e);n.style.transform="translate3d("+(o?"-100%":"100%")+", 0px, 0px)"}}});var n=e.querySelector(".tab-content");n&&(n.style.transform="none"),this.$tabSelectors.each(function(){$(this).toggleClass("active",this.value===t)})}},n.toggle=function(){var t=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(t?"close":"open")},n.open=function(){document.body.classList.contains("sidebar-left-open")||this.toggleWithTransition("open")},n.close=function(){document.body.classList.contains("sidebar-left-open")&&this.toggleWithTransition("close")},e}(o);z.DEFAULTS={floating:!0,breakpoint:1046,wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0,onInit:null,onDestroy:null,onShow:null,onClose:null};var O=function(){function t(){var t=this;this.handleWindowResize=function(){t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(function(){t.windowCallbacks.forEach(function(t){t({target:window,contentRect:{width:window.innerWidth,height:window.innerHeight}})})})},this.callbacks=new WeakMap,this.observer=null,this.rafId=null,this.windowCallbacks=new Set,this.isWindowListening=!1}var e=t.prototype;return e.observe=function(t,e){var i=this;this.observer||(this.observer=new ResizeObserver(function(t){i.rafId&&cancelAnimationFrame(i.rafId),i.rafId=requestAnimationFrame(function(){t.forEach(function(t){var e=i.callbacks.get(t.target);e&&e(t)})})})),this.callbacks.set(t,e),this.observer.observe(t),this.windowCallbacks.add(e),this.isWindowListening||this.startWindowListening()},e.unobserve=function(t){if(this.observer){this.observer.unobserve(t);var e=this.callbacks.get(t);e&&this.windowCallbacks.delete(e),this.callbacks.delete(t),0===this.windowCallbacks.size&&this.stopWindowListening()}},e.startWindowListening=function(){this.isWindowListening=!0,window.addEventListener("resize",this.handleWindowResize,{passive:!0})},e.stopWindowListening=function(){this.isWindowListening=!1,window.removeEventListener("resize",this.handleWindowResize)},e.disconnect=function(){this.observer&&(this.observer.disconnect(),this.callbacks=new WeakMap),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.windowCallbacks.clear(),this.stopWindowListening()},t}(),D=function(){function t(){var t=this;this.handleScroll=function(){t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(function(){t.callbacks.forEach(function(t){return t()})})},this.callbacks=new Map,this.rafId=null,this.isListening=!1}var e=t.prototype;return e.add=function(t,e){this.callbacks.set(t,e),this.isListening||this.startListening()},e.remove=function(t){this.callbacks.delete(t),0===this.callbacks.size&&this.stopListening()},e.startListening=function(){this.isListening=!0;var t=document.querySelector(".site-main .content");t?(this.scrollElement=t,this.scrollElement.addEventListener("scroll",this.handleScroll,{passive:!0})):(this.scrollElement=window,window.addEventListener("scroll",this.handleScroll,{passive:!0}))},e.stopListening=function(){this.isListening=!1,this.scrollElement&&(this.scrollElement.removeEventListener("scroll",this.handleScroll),this.scrollElement=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)},t}(),N=new O,W=new D,R=function(t,e,i){var n;return function(){var i=this,o=arguments;clearTimeout(n),n=setTimeout(function(){n=null,t.apply(i,o)},e)}},P=function(){var t=!1;return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(t=!0),t},Y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},X=function(t,e){var i=t&&t.jquery?t[0]:t;return i?new Promise(function(t){var n,o=["animation",e];(n=i.classList).add.apply(n,o),i.addEventListener("animationend",function e(n){var s;n.stopPropagation(),(s=i.classList).remove.apply(s,o),i.removeEventListener("animationend",e),t()},{once:!0})}):Promise.resolve()},F=function(t){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"}[t]},j=function(t){if("string"!=typeof t){if(null===t)return"";if(!t)return String(t);t=String(t)}return/[&<>"'`=]/.test(t)?t.replace(/[&<>"'`=]/g,F):t},q=function(t){function e(e,i){var n;return(n=t.call(this)||this).opts={},window.Cool.settings.popover?$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,window.Cool.settings.popover,i):$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,i),n.el=e,n.init(),n}i(e,t),e._jQueryInterface=function(t){return this.each(function(){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()})},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},n.destroy=function(){this.unbindEvents(),this.$popover&&(this.$popover.remove(),this.$popover=null),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.update=function(){this.buildCache(),this.$popover&&this.setPosition(),this.onUpdate()},n.buildCache=function(){this.$el=$(this.el),this.$container=this.$el.data("container")?$(this.$el.data("container")):$(this.opts.container),this.containerAutoDetect=this.$el.data("containerAutoDetect")?this.$el.data("containerAutoDetect"):this.opts.containerAutoDetect,this.id="popover-"+Y(),this.trigger=this.$el.data("trigger")?this.$el.data("trigger"):this.opts.trigger,this.placement=this.$el.data("placement")?this.$el.data("placement"):this.opts.placement,this.align=this.$el.data("align")?this.$el.data("align"):this.opts.align,this.title=this.$el.data("title")?this.$el.data("title"):this.opts.title,this.content=this.$el.data("content")?this.$el.data("content"):this.opts.content,this.offset=this.$el.data("offset")?this.$el.data("offset"):this.opts.offset,this.collisionDetection=!1!==this.$el.data("collisionDetection")?this.$el.data("collisionDetection"):this.opts.collisionDetection,this.containerAutoDetect&&(this.$container=this.$el.offsetParent())},n.bindEvents=function(){var t=this;"click"===this.trigger?this.$el.on("click."+this.constructor.NAME,function(){t.$popover?t.close():t.show()}):"hover"===this.trigger?(this.$el.on("mouseenter."+this.constructor.NAME,function(){clearTimeout(t.hoverTimeout),t.show()}),this.$el.on("mouseleave."+this.constructor.NAME,function(){t.hoverTimeout=setTimeout(function(){t.popupHasFocus||t.close()},100)})):"focus"===this.trigger&&(this.$el.on("focusin."+this.constructor.NAME,function(){t.show()}),this.$el.on("focusout."+this.constructor.NAME,function(){t.close()})),window.ResizeObserver&&(this._resizeCallback=function(){t.$popover&&t.$popover.hasClass("show")&&requestAnimationFrame(function(){t.setPosition()})},N.observe(this.el,this._resizeCallback))},n.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this._resizeCallback&&(N.unobserve(this.el),this._resizeCallback=null)},n.buildPopover=function(){var t,e=this;t="function"==typeof this.content?this.content():this.content,this.$popover=$('\n <div class="popover" role="tooltip" id="'+this.id+'">\n <h3 class="popover-header">'+this.title+'</h3>\n <div class="popover-body">'+t+"</div>\n </div>\n "),this.$container.append(this.$popover),this.$container.find("#"+this.id).on("mouseenter",function(){e.popupHasFocus=!0,"hover"===e.trigger&&e.hoverTimeout&&clearTimeout(e.hoverTimeout)}),this.$container.find("#"+this.id).on("mouseleave",function(){e.popupHasFocus=!1,"hover"===e.trigger&&(e.hoverTimeout=setTimeout(function(){e.close()},100))})},n.setPosition=function(t){var e=this;"undefined"!=typeof t&&null!==t||(t=this.placement);var i,n,o=window.innerWidth,s=window.innerHeight,a=this.$popover.outerWidth(!0),r=this.$popover.outerHeight(!0),l=this.$el.outerWidth(!0),c=this.$el.outerHeight(!0),h=this.$container.offset()||{left:0,top:0},d=this.$el.offset();i=d.left-h.left,n=d.top-h.top;var u,p,f=0,m=0;if(this.offset){var v=this.offset.split(",");f=parseInt(v[0],10)||0,m=parseInt(v[1],10)||0}var g=getComputedStyle(this.$popover[0]),b=parseInt(g.getPropertyValue("--cool-popover-spacer"))||8,$=function(t,o){void 0===o&&(o=e.align);var s=0,h=0;switch(t){case"top":s="end"===o?i+l-a:"center"===o?i+(l-a)/2:i,h=n-r-b;break;case"bottom":s="end"===o?i+l-a:"center"===o?i+(l-a)/2:i,h=n+c+b;break;case"left":s=i-a-b,h="end"===o?n+c-r:"center"===o?n+(c-r)/2:n;break;case"right":s=i+l+b,h="end"===o?n+c-r:"center"===o?n+(c-r)/2:n}return{x:s+f,y:h+m}},w=t,y=this.align,C=$(t);if(this.collisionDetection){var E=function(t){var e={top:!1,bottom:!1,left:!1,right:!1},i=h.left+t.x,n=h.top+t.y,l=i+a,c=n+r;return e.top=n<5,e.bottom=c>s-5,e.left=i<5,e.right=l>o-5,e},S=E(C);"bottom"===t&&S.bottom&&!S.top?(w="top",C=$("top",y)):"top"===t&&S.top&&!S.bottom?(w="bottom",C=$("bottom",y)):"right"===t&&S.right&&!S.left?(w="left",C=$("left",y)):"left"===t&&S.left&&!S.right&&(w="right",C=$("right",y));var T=E(C);"top"!==w&&"bottom"!==w||("end"===y&&T.left&&!T.right?C=$(w,y="start"):"start"===y&&T.right&&!T.left&&(C=$(w,y="end")));var x=E(C);x.left?C.x+=5-(h.left+C.x):x.right&&(C.x-=h.left+C.x+a-(o-5)),x.top?C.y+=5-(h.top+C.y):x.bottom&&(C.y-=h.top+C.y+r-(s-5))}u=C.x,p=C.y,this.$popover.css({transform:"translate3d("+Math.round(u)+"px, "+Math.round(p)+"px, 0px)","will-change":"transform"}),this.$popover.attr("x-placement",w+"-"+y)},n.show=function(){this.$popover||(this.buildPopover(),this.setPosition(),this.$popover.addClass("show"),this.$el.attr("data-popover",this.id),this.onShow())},n.close=function(){this.$popover&&(this.$popover.remove(),this.$el.removeAttr("data-popover"),this.$popover=null,this.onClose())},e}(o);q.NAME="coolPopover",q.DEFAULTS={container:"body",containerAutoDetect:!1,trigger:"focus",placement:"bottom",align:"center",offset:null,collisionDetection:!0,title:"",content:"",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null},q._jQueryInit(),"undefined"==typeof window||window.PerfectScrollbar||(window.PerfectScrollbar=H);var U=function(t){function e(e,i){var n;return(n=t.call(this)||this).opts={},window.Cool.settings.select?$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,window.Cool.settings.select,i):$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,i),n.el=e,n.useChips=!1,n.cachedTitle="",n.lastSearchQuery="",n._resizeCallback=null,n._scrollCallback=null,n.init(),n}i(e,t),e._jQueryInterface=function(t){return this.each(function(){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()})},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.init=function(){this.buildCache(),this.buildScroll(),this.bindEvents(),this.onInit()},n.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.update=function(){var t=this;this.buildCache(),this.bindEvents();var e=Promise.resolve();return this.searchApi&&this.searchApi.length&&(e=this._performInitialSearch()),e.then(function(){t.onUpdate()})},n.reset=function(){this.data={},this.data[this.name]=[],this.items=[],this.$select.find(".select-item").remove(),this.$selectItems=[],this.$selectIconContainer.html(this.selectIconDefault),this.$selectHeader.removeClass("select-placeholder"),"function"==typeof this.dynamicTitle?this.$selectTitle.text(this.dynamicTitle.call(this)):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.$selectTitle.text().trim()&&(this.$selectItems.length>0||this.searchApi)&&this.$selectTitle.text(this.dynamicTitleDefault),0==this.$selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.$selectHeader.addClass("select-placeholder"),this.$selectIconContainer.addClass("d-none"),this.$selectTitle.text(this.dynamicTitleEmptyDefault))),this.showSearch&&(this.searchData=[],this.$searchInput.val(""),this.searchString="",this.search.call(this))},n.buildCache=function(){var t=this;if(this.$el=$(this.el),this.$container=this.$el.parent(),this.$selectHeader=this.$el.find(".select-header"),this.$selectTitle=this.$el.find(".select-title"),this.cachedTitle=this.$selectTitle.text(),this.$selectIconContainer=this.$selectHeader.find(".select-icon"),this.$searchIconContainer=this.$el.find(".select-search-icon"),this.selectIconDefault=this.$selectHeader.find(".select-icon")?this.$selectHeader.find(".select-icon").html():'<i class="'+(this.opts.faPro?"fal":"fas")+'fa-angle-down icon"></i>',this.name=this.$el.data("name")?this.$el.data("name"):this.opts.name,this.scroll=null,this.scrollContentHeight=this.$el.data("scrollContentHeight")?this.$el.data("scrollContentHeight"):this.opts.scrollContentHeight,this.useNativeScroll=this.$el.data("useNativeScroll")?this.$el.data("useNativeScroll"):this.opts.useNativeScroll,this.contentWidth=this.$el.data("contentWidth")?this.$el.data("contentWidth"):this.opts.contentWidth,this.items=this.$el.data("items")?this.$el.data("items"):this.opts.items,this.data={},this.data[this.name]=[],this.searchData=[],this.searchApi=this.$el.data("searchApi")?this.$el.data("searchApi"):this.opts.searchApi,this.searchRequest=null,this.type=this.$el.data("type")?this.$el.data("type"):this.opts.type,this.contentOpen=!1,this.searchPlaceholder=this.$el.data("search-placeholder")?this.$el.data("search-placeholder"):this.opts.searchPlaceholder,this.btnCloseText=this.$el.data("btn-close-text")?this.$el.data("btn-close-text"):this.opts.btnCloseText,this.labelTemplate=this.opts.labelTemplate,this.confirmCheck=this.opts.confirmCheck,this.confirmUncheck=this.opts.confirmUncheck,this.preventUncheck=this.opts.preventUncheck,this.dynamicTitle=this.$el.data("dynamicTitle")?this.$el.data("dynamicTitle"):this.opts.dynamicTitle,this.dynamicTitleDefault=this.$el.data("dynamicTitleDefault")?this.$el.data("dynamicTitleDefault"):this.opts.dynamicTitleDefault,this.dynamicTitleEmptyDefault=this.$el.data("dynamicTitleEmptyDefault")?this.$el.data("dynamicTitleEmptyDefault"):this.opts.dynamicTitleEmptyDefault,this.allowNoneOnRadioSelect=this.$el.data("allowNoneOnRadioSelect")?this.$el.data("allowNoneOnRadioSelect"):this.opts.allowNoneOnRadioSelect,this.showValidStateIcon=this.$el.data("showValidStateIcon")?this.$el.data("showValidStateIcon"):this.opts.showValidStateIcon,this.itemsToExclude=this.$el.data("itemsToExclude")?this.$el.data("itemsToExclude").replace(/\s/g,"").split(","):this.opts.itemsToExclude,this.primaryKeyword=this.$el.data("primaryKeyword")?this.$el.data("primaryKeyword"):this.opts.primaryKeyword,this.useChips=this.$el.data("useChips")?this.$el.data("useChips"):this.opts.useChips,this.useChips&&(this.showValidStateIcon=!1),this.preventClose=!1,this.itemsToExclude.length>0&&(this.itemsToExclude=this.itemsToExclude.map(String)),this.opts.setData&&(this.data=this.opts.setData),this.$el.data("setData")&&""!=this.$el.data("setData")&&(this.data=this.$el.data("setData")),!Array.isArray(this.data[this.name])&&""!==this.data[this.name]&&this.data[this.name].length>0){var e=this.data[this.name].toString().trim().split(",");this.data[this.name]=e}if(this.data[this.name].length>0&&!this.useChips&&(this.data[this.name]=this.data[this.name].map(String)),this.data[this.name].length>0&&this.itemsToExclude.length>0&&(this.data[this.name]=this.data[this.name].filter(function(e){return e[t.primaryKeyword]?-1===t.itemsToExclude.indexOf(e[t.primaryKeyword].toString()):-1===t.itemsToExclude.indexOf(e.toString())})),this.data&&this.useChips&&this._renderChips(),this.items.length>0&&this.itemsToExclude.length>0&&(this.items=this.items.filter(function(e){return e[t.primaryKeyword]?-1===t.itemsToExclude.indexOf(e[t.primaryKeyword].toString()):-1===t.itemsToExclude.indexOf(e.toString())})),this.$el.find(".select-search").length?this.showSearch=!0:this.showSearch=this.$el.data("showSearch")?this.$el.data("showSearch"):this.opts.showSearch,this.$el.find(".select-footer").length?this.showFooter=!0:this.showFooter=this.$el.data("showFooter")?this.$el.data("showFooter"):this.opts.showFooter,this.$select=this.$el.find(".select-content"),this.$select.length){var i=this.$select.find(".select-item");i.length>0&&this.itemsToExclude.length>0&&$.each(i,function(e,i){var n=$(i).find(":input").val();t.itemsToExclude.indexOf(n)>-1&&$(i).remove()})}else{var n=this._renderItemList(this.items);this.$select=$('\n <div class="select-content">\n\n '+this._renderSearch()+'\n\n <div class="select-scrollable-content"></div>\n\n '+this._renderFooter()+"\n\n </div>\n "),this.$el.append(this.$select),this.$select.find(".select-scrollable-content").append(n)}if(this.data[this.name].length>0){var o=this.useChips?this.data[this.name].map(function(e){return e[t.primaryKeyword].toString()}):this.data[this.name].map(String);if(this.$select.find(":input").each(function(e,i){var n=$(i);o.includes(n.val())&&(n.prop("checked",!0),"radio"===t.type&&n.addClass("checked"))}),this.useChips)this._renderChips();else if("radio"===this.type&&"function"!=typeof this.dynamicTitle){var s=this.$select.find(":input:checked");s.length&&this.$selectTitle.text(s.parent().find("[data-label]").text())}}this.$scrollableContent=!!this.$select.find(".select-scrollable-content")&&this.$select.find(".select-scrollable-content"),this.$selectItems=this.$select.find(".select-item"),this.$selectHeader.removeClass("select-placeholder"),this.searchApi&&this.searchApi.length&&this._performInitialSearch(),"function"==typeof this.dynamicTitle?this.$selectTitle.text(this.dynamicTitle.call(this)):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.$selectTitle.text().trim()&&(this.$selectItems.length>0||this.searchApi)&&this.$selectTitle.text(this.dynamicTitleDefault),0==this.$selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.$selectHeader.addClass("select-placeholder"),this.$selectIconContainer.addClass("d-none"),this.$selectTitle.text(this.dynamicTitleEmptyDefault))),this.showSearch&&(this.$searchContainer=this.$select.find(".select-search"),this.$searchInput=this.$select.find('[name="select-search"]'),this.$clearSearchButton=this.$select.find("[data-clear-search]"),this.$searchInput[0].tabIndex=-1),this.showFooter&&(this.$footerContainer=this.$select.find(".select-footer"),this.$closeButton=this.$select.find("[data-select-close]"),this.$closeButton.length&&(this.$closeButton[0].tabIndex=-1)),this.buildSearchData()},n._updateScrollbarVisibility=function(){if(this.scroll&&this.$scrollableContent[0]){var t=this.$scrollableContent[0];t.scrollHeight>t.clientHeight?(this.scroll.settings.suppressScrollY=!1,this.$scrollableContent.addClass("ps-show-rail-y")):(this.scroll.settings.suppressScrollY=!0,this.$scrollableContent.removeClass("ps-show-rail-y")),this.scroll.update()}},n._performInitialSearch=function(){var t=this;return this.isSearchApiEnabled()?(this._showSpinner(),new Promise(function(e,i){$.ajax({method:"GET",url:t.searchApi,timeout:1e4,success:function(i){var n=i.filter(function(e){return-1===t.itemsToExclude.indexOf(e[t.primaryKeyword].toString())&&0!=e[t.primaryKeyword]});t.useChips&&t.data[t.name].length>0&&(t.data[t.name].forEach(function(e){var i=n.find(function(i){return i[t.primaryKeyword].toString()===e[t.primaryKeyword].toString()});i&&(e.label=i.label||i.name||i.value)}),t.$selectTitle.empty(),t.data[t.name].forEach(function(e){var i=$('\n <span class="chip" data-value="'+e[t.primaryKeyword]+'">\n <span class="chip-title">'+j(e.label)+"</span>\n </span>\n ");i.on("click",function(i){i.stopPropagation(),t.$select.find('input[value="'+e[t.primaryKeyword]+'"]').prop("checked",!1).trigger("change")}),t.$selectTitle.append(i)}));var o=t._renderItemList(n);t.$scrollableContent.html(o),t.data[t.name].length>0&&t.data[t.name].forEach(function(e){var i=t.useChips?e[t.primaryKeyword].toString():e.toString(),n=t.$scrollableContent.find('input[value="'+i+'"]');n.length&&(n.prop("checked",!0),"radio"===t.type&&n.addClass("checked"))}),t._updateScrollbarVisibility(),t._hideSpinner(),t.useChips&&t.data[t.name].length>0&&t._renderChips(),t.contentOpen&&t._recalculateContentHeight(),e()},error:function(i,n,o){t._hideSpinner(),console.error("Search API error:",n,o),t.$scrollableContent.html('<div class="p-3 text-danger">Error loading items</div>'),e()}})})):Promise.resolve()},n.buildScroll=function(){var t=this;if(this.$scrollableContent.length>0){var e=this.scrollContentHeight;this.showSearch&&(e-=this.$searchContainer.outerHeight(!0)||0),this.showFooter&&(e-=this.$footerContainer.outerHeight(!0)||0);var i=(parseInt(this.$scrollableContent.css("marginTop"),10)||0)+(parseInt(this.$scrollableContent.css("marginBottom"),10)||0),n=this.$scrollableContent[0].scrollHeight,o=Math.min(n,e+i);this.$scrollableContent.css({"max-height":o+"px"}),P()?this.$scrollableContent.css({"overflow-y":"auto"}):(!1===this.useNativeScroll&&(this.$scrollableContent.addClass("ps-dark"),this.scroll=new H(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,scrollYMarginOffset:-1,suppressScrollY:!0,suppressScrollX:!0}),setTimeout(function(){t._updateScrollbarVisibility()},0)),this.$scrollableContent.find('[tabindex="0"]').attr("tabindex",-1))}},n.buildSearchData=function(){var t=this;this.searchData=[];var e=this.$select.find("[data-label]");$.each(e,function(e,i){t.searchData.push({id:e,val:$(i).text().trim()})})},n.bindEvents=function(){var t=this,e=this;this.$selectHeader.on("click."+this.constructor.NAME,function(){t.contentOpen?t.close():(t.$selectItems.length>0||t.searchApi)&&t.show()}),this.$el.on("change."+this.constructor.NAME,'input[type="checkbox"]',function(){var t=this,i=$(this).val(),n=600;if(e.preventClose=!0,"function"==typeof e.confirmCheck&&t.checked)t.checked=!1,e.confirmCheck(function(o){if("confirmed"==o){var s;if(e.useChips){if(!e.data[e.name].find(function(t){return t[e.primaryKeyword]===i}))e.data[e.name].push(((s={})[e.primaryKeyword]=i,s.label=$(t).parent().find("[data-label]").text(),s))}else-1===e.data[e.name].indexOf(i)&&e.data[e.name].push(i);t.checked=!0,e.onSelect(t)}setTimeout(function(){e.preventClose=!1},n)},t);else if(t.checked){var o;if(e.useChips){if(!e.data[e.name].find(function(t){return t[e.primaryKeyword]===i}))e.data[e.name].push(((o={})[e.primaryKeyword]=i,o.label=$(t).parent().find("[data-label]").text(),o))}else-1===e.data[e.name].indexOf(i)&&e.data[e.name].push(i);e.onSelect(t),setTimeout(function(){e.preventClose=!1},n)}else"function"!=typeof e.confirmUncheck||t.checked?t.checked||e.preventUncheck?!t.checked&&e.preventUncheck&&(t.checked=!0,setTimeout(function(){e.preventClose=!1},n)):(e.useChips?e.data[e.name]=e.data[e.name].filter(function(t){return t[e.primaryKeyword]!=i}):e.data[e.name]=e.data[e.name].filter(function(t){return t!=i}),e.onSelect(t),setTimeout(function(){e.preventClose=!1},n)):(t.checked=!0,e.confirmUncheck(function(o){"confirmed"==o&&(e.useChips?e.data[e.name]=e.data[e.name].filter(function(t){return t[e.primaryKeyword]!=i}):e.data[e.name]=e.data[e.name].filter(function(t){return t!=i}),t.checked=!1,e.onSelect(t)),setTimeout(function(){e.preventClose=!1},n)},t))}),this.$el.on("change."+this.constructor.NAME,'input[type="radio"]',function(){var t=$(this).val();if(this.checked){var i;if(e.useChips)e.data[e.name]=[(i={},i[e.primaryKeyword]=t,i.label=$(this).parent().find("[data-label]").text(),i)];else e.data[e.name]=[t];e.data[e.name]=[t],e.$select.find('input[type="radio"]').not($(this)).prop("checked",!1),e.$select.find('input[type="radio"]').not($(this)).removeClass("checked")}else e.data[e.name]=[]}),this.$el.on("click."+this.constructor.NAME,'input[type="radio"]',function(){$(this).hasClass("checked")&&e.allowNoneOnRadioSelect?(e.data[e.name]=[],$(this).prop("checked",!1),$(this).removeClass("checked"),e.dynamicTitle&&"function"!=typeof e.dynamicTitle&&e.$selectTitle.text(e.dynamicTitleDefault)):($(this).addClass("checked"),e.dynamicTitle&&"function"!=typeof e.dynamicTitle&&e.$selectTitle.text(j($(this).parent().find("[data-label]").text()))),"function"==typeof e.dynamicTitle&&e.$selectTitle.text(e.dynamicTitle.call(this)),e.onSelect(this)}),this.scroll&&(this.$scrollableContent.find(".ps__thumb-y").mousedown(function(){e.$scrollableContent.addClass("ps-mousedown-scroll")}),$(document).mouseup(function(){e.$scrollableContent.hasClass("ps-mousedown-scroll")&&e.$scrollableContent.removeClass("ps-mousedown-scroll")})),this.showSearch&&(this.$searchInput.on("keydown."+this.constructor.NAME,R(function(){e.searchString=$(this).val().trim(),e.search.call(e)},250)),this.$searchInput.on("focusin."+this.constructor.NAME,function(){e.$searchContainer.addClass("focused")}),this.$searchInput.on("focusout."+this.constructor.NAME,function(){e.$searchContainer.removeClass("focused")}),this.$searchContainer.on("click."+this.constructor.NAME,"[data-clear-search]",function(){e.searchString.length&&(e.$searchInput.val(""),e.searchString="",e.search.call(e))})),this.showFooter&&this.$closeButton.on("click."+this.constructor.NAME,function(){t.close()}),$(document).on("touchstart click",function(t){e.$el.is(t.target)||e.$el.has(t.target).length||!e.contentOpen||e.preventClose||e.close.call(e)}),"fixed"===this.opts.position&&(this._scrollCallback=function(){t.$el&&t.$el.hasClass("show")&&requestAnimationFrame(function(){t.$el.find(".select-content").css({top:t.$container.offset().top-$(window).scrollTop(),left:t.$container.offset().left-$(window).scrollLeft(),width:t.contentWidth?"var(--cool-select-content-width, "+t.contentWidth+"px)":t.$container.outerWidth()})})},window.ResizeObserver&&(this._resizeCallback=function(e){t.$el&&t.$el.hasClass("show")&&requestAnimationFrame(function(){t.$el.find(".select-content").css({top:t.$container.offset().top-$(window).scrollTop(),left:t.$container.offset().left-$(window).scrollLeft(),width:t.contentWidth?"var(--cool-select-content-width, "+t.contentWidth+"px)":t.$container.outerWidth()})})},N.observe(document.body,this._resizeCallback)))},n.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),$(document).off("touchstart click."+this.constructor.NAME),"fixed"===this.opts.position&&(this._scrollCallback&&(W.remove("select-"+this.name),this._scrollCallback=null),this._resizeCallback&&(N.unobserve(document.body),this._resizeCallback=null))},n.getData=function(t){return t?this.data[t]:this.data},n.setData=function(){var t=this,e=this,i=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+i+' fa-check text-success icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.useChips&&this.$selectTitle.empty(),this.searchApi.length){var n=this.searchApi,o=this.data[this.name].length,s=0;this.data[e.name].forEach(function(t){n+=encodeURIComponent("#"+t),++s!==o&&(n+="+")}),$.ajax({method:"GET",url:n}).done(function(i){var n=i.map(function(t){return t.id.toString()});e.data[e.name]=e.data[e.name].filter(function(t){return e.useObjects?n.indexOf(t[e.primaryKeyword].toString())>-1:n.indexOf(t.toString())>-1}),0==e.data[e.name].length&&e.$selectIconContainer.html(e.selectIconDefault);var o=i.filter(function(t){return e.useObjects?e.data[e.name].findIndex(function(i){return i[e.primaryKeyword]==t.id})>-1&&-1===e.itemsToExclude.indexOf(t.id)&&0!=t.id:e.data[e.name].indexOf(t.id)>-1&&-1===e.itemsToExclude.indexOf(t.id)&&0!=t.id}),s=e._renderItemList(o);e.$scrollableContent.append(s);var a=e.$scrollableContent.find(":input");if(e._updateScrollbarVisibility(),e.$scrollableContent.find(':input[type="checkbox"]').length?e.type="checkbox":e.$scrollableContent.find(':input[type="radio"]').length&&(e.type="radio"),"checkbox"==e.type)e.data[e.name].forEach(function(t){var i=e.useObjects?t[e.primaryKeyword].toString():t.toString(),n=a.filter(function(){return this.value==i});n.prop("checked",!0),e.useChips&&e._renderChips(),e.onSelect(n[0])});else if("radio"==e.type){var r=t,l=t.data[t.name][0],c=a.filter(function(){return this.value==l});c.prop("checked",!0),c.addClass("checked"),r.useChips?r._renderChips():r.dynamicTitle&&"function"!=typeof r.dynamicTitle&&r.$selectTitle.text(c.parent().find("[data-label]").text()),r.onSelect(c[0])}"function"==typeof e.dynamicTitle&&e.$selectTitle.text(e.dynamicTitle.call(t))})}else{var a=this.$scrollableContent.find(":input"),r=a.length>0?a.map(function(){return this.value.toString()}).get():[];if(this.data[this.name]=this.data[this.name].filter(function(t){return r.indexOf(t.toString())>-1}),0==this.data[this.name].length&&this.$selectIconContainer.html(this.selectIconDefault),this.$scrollableContent.find(':input[type="checkbox"]').length?this.type="checkbox":this.$scrollableContent.find(':input[type="radio"]').length&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(function(t){var i=a.filter(function(){return this.value==t});i.prop("checked",!0),e.useChips&&e._renderChips(),e.onSelect(i[0])});else if("radio"==this.type){var l=a.filter(function(){return this.value==this.data[this.name][0]});l.prop("checked",!0),l.addClass("checked"),this.useChips?this._renderChips():this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&this.$selectTitle.text(l.parent().find("[data-label]").text()),this.onSelect(l[0])}"function"==typeof this.dynamicTitle&&this.$selectTitle.text(this.dynamicTitle.call(this))}},n._renderChips=function(){var t=this;this.$selectTitle.empty(),0!==this.data[this.name].length?(this.data[this.name].forEach(function(e){var i=t.useChips?e[t.primaryKeyword]:e,n=t.$select?t.$select.find('input[value="'+i+'"]'):[],o=n.length?n.parent().find("[data-label]").text():e.label||e.name||e.value||i,s=$('\n <span class="chip" data-value="'+i+'">\n <span class="chip-title">'+j(o)+"</span>\n </span>\n ");s.on("click",function(n){n.stopPropagation();var o=t.$select.find('input[value="'+i+'"]');o.length?o.prop("checked",!1).trigger("change"):(t.useChips?t.data[t.name]=t.data[t.name].filter(function(e){return e[t.primaryKeyword].toString()!==i.toString()}):t.data[t.name]=t.data[t.name].filter(function(t){return t.toString()!==i.toString()}),t.searchApi.length&&(t.items=t.items.filter(function(e){return e[t.primaryKeyword].toString()!==i.toString()})),t._renderChips(),"function"==typeof t.opts.onSelect&&t.opts.onSelect.call(t,e,t,!1))}),t.$selectTitle.append(s)}),this.contentOpen&&setTimeout(function(){t._updateScrollbarVisibility()},0)):this.dynamicTitle&&this.dynamicTitleDefault?this.$selectTitle.text(this.dynamicTitleDefault):this.$selectTitle.text(this.cachedTitle)},n.search=function(){var t=this,e=this,i=this.opts.faPro?"fal":"fas";if(this.searchString.length)if(this.isSearchApiEnabled()){if(this.searchString===this.lastSearchQuery)return;this.lastSearchQuery=this.searchString,this._showSpinner(),null!==this.searchRequest&&this.searchRequest.abort(),clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=setTimeout(function(){t.searchRequest=$.ajax({method:"GET",url:t.searchApi+t.searchString}).done(function(t){e.searchRequest=null,e.$scrollableContent.find("input:not(:checked)").parents(".select-item").not(".static-item").remove();var n=t.filter(function(t){return e.useObjects?-1===e.data[e.name].findIndex(function(i){return i[e.primaryKeyword]==t.id})&&-1===e.itemsToExclude.indexOf(t.id)&&0!=t.id:-1===e.data[e.name].indexOf(t.id)&&-1===e.itemsToExclude.indexOf(t.id)&&0!=t.id}),o=e._renderItemList(n);e.$scrollableContent.append(o),e.$searchIconContainer.html('<i class="'+i+' fa-times icon"></i>'),e.$searchIconContainer.attr("data-clear-search","true"),e._updateScrollbarVisibility(),e.contentOpen&&e._recalculateContentHeight()})},300)}else{var n=this.searchString.toLowerCase(),o=this.searchData.filter(function(t){return t.val.toLowerCase().indexOf(n)>-1});this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),o.forEach(function(t){$(e.$selectItems[t.id]).addClass("visible")}),this.$selectItems.not(".visible").addClass("d-none"),this.$searchIconContainer.html('<i class="'+i+' fa-times icon"></i>'),this.$searchIconContainer.attr("data-clear-search","true")}else this.lastSearchQuery="",this.isSearchApiEnabled()?(this.$scrollableContent.find("input:not(:checked)").parents(".select-item").not(".static-item").remove(),this._hideSpinner(),this.$searchIconContainer.attr("data-clear-search",""),this._performInitialSearch()):(this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),this.$searchIconContainer.html('<i class="'+i+' fa-search icon"></i>'),this.$searchIconContainer.attr("data-clear-search",""));this.scroll&&this.scroll.update(),this.onUpdate()},n._recalculateContentHeight=function(){var t=this,e=this.$el.find(".select-content"),i=this.$selectHeader.outerHeight(!0),n=this.scrollContentHeight,o=$(window).height(),s=$(window).scrollTop(),a=n,r=0,l=0;if(this.$searchContainer&&this.$searchContainer.length&&(r=this.$searchContainer.outerHeight(!0)||0),this.$footerContainer&&this.$footerContainer.length&&(l=this.$footerContainer.outerHeight(!0)||0),this.$scrollableContent&&this.$scrollableContent.length){var c=this.$scrollableContent[0].scrollHeight,h=this.$scrollableContent[0].clientHeight;a=Math.min(Math.max(c,h)+r+l,n)}var d=this.$el.hasClass("select-dropup"),u=0,p=a,f=parseInt(e.css("margin-bottom")||0,10),m=parseInt(e.css("margin-top")||0,10);if("fixed"===this.opts.position){var v=this.$container.offset().top-$(window).scrollTop(),g=o-v-i-50,b=v-50;d?u=v-(p=Math.min(a,b))-f:(p=Math.min(a,g),u=v+i+m)}else{var w=this.$container.offset(),y=o-(w.top-s)-i-50,C=w.top-s-50;d?u=-(p=Math.min(a,C))-f:(p=Math.min(a,y),u=i+m)}var E=p-r-l;e.css({height:p+"px"}),this.$scrollableContent&&this.$scrollableContent.length&&this.$scrollableContent.css({"max-height":E+"px"}),this.opts.position,e.css({top:u}),this.scroll&&setTimeout(function(){t._updateScrollbarVisibility()},0)},n.show=function(){var t=this;if(!this.$el.hasClass("show")){var e=0,i=0;"fixed"===this.opts.position&&(e=this.$container.offset().top-$(window).scrollTop(),i=this.$container.offset().left-$(window).scrollLeft());var n=$(".select.show"),o=1,s=this.opts.faPro?"fal":"fas";n.length&&(o=parseInt(n.first().css("z-index"),10)+2),this.$el.addClass("show"),n.length||(o=parseInt(this.$el.css("z-index"),10)+1);var a=this.$el.find(".select-content"),r=this.$selectHeader.outerHeight(!0),l=this.scrollContentHeight,c=$(window).height(),h=$(window).scrollTop(),d=l,u=0,p=0;if(this.$searchContainer&&this.$searchContainer.length&&(u=this.$searchContainer.outerHeight(!0)||0),this.$footerContainer&&this.$footerContainer.length&&(p=this.$footerContainer.outerHeight(!0)||0),this.$scrollableContent&&this.$scrollableContent.length){var f=this.$scrollableContent[0].scrollHeight,m=this.$scrollableContent[0].clientHeight;d=Math.min(Math.max(f,m)+u+p,l)}var v=!1,g=0,b=d,w=parseInt(a.css("margin-bottom")||0,10),y=parseInt(a.css("margin-top")||0,10);if("fixed"===this.opts.position){var C=c-e-r-50,E=e-50;(v=C<d&&E>C)?g=e-(b=Math.min(d,E))-w:(b=Math.min(d,C),g=e+r+y)}else{var S=this.$container.offset(),T=c-(S.top-h)-r-50,x=S.top-h-50;(v=T<d&&x>T)?g=-(b=Math.min(d,x))-w:(b=Math.min(d,T),g=r+y)}var I=b-u-p;a.css({height:b+"px"}),this.$scrollableContent&&this.$scrollableContent.length&&this.$scrollableContent.css({"max-height":I+"px"}),this.$el.toggleClass("select-dropup",v),this.$el.toggleClass("select-dropdown",!v);var k=a.outerWidth();a.css({"z-index":o,position:"fixed"===this.opts.position?"fixed":"absolute"}),"fixed"===this.opts.position?a.css({top:g,left:i,width:this.contentWidth?"var(--cool-select-content-width, "+this.contentWidth+"px)":this.$container.outerWidth()}):a.css({top:g,width:this.contentWidth?"var(--cool-select-content-width, "+this.contentWidth+"px)":k>this.$container.outerWidth()?"var(--cool-select-content-width, auto)":this.$container.outerWidth()}),a.css({"min-width":this.$container.outerWidth()}),this.$scrollableContent.length&&this.$scrollableContent[0].offsetHeight<this.$scrollableContent[0].scrollHeight&&(this.$scrollableContent[0].scrollTop=1,this.$scrollableContent[0].scrollTop=0),v?this.$selectIconContainer.html('<i class="'+s+' fa-angle-down icon"></i>'):this.$selectIconContainer.html('<i class="'+s+' fa-angle-up icon"></i>'),setTimeout(function(){t.$el[0].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),t.scroll&&t._updateScrollbarVisibility()},300),this.contentOpen=!0,"fixed"===this.opts.position&&this._scrollCallback&&W.add("select-"+this.name,this._scrollCallback),this.onShow()}},n.close=function(){if(!this.preventClose){var t=this,e=this.opts.faPro?"fal":"fas";this.$el.removeClass("show"),this.$el.removeClass("select-dropup select-dropdown"),setTimeout(function(){t.$el.removeAttr("style")},300),this.data[this.name].length>0&&this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+e+' fa-check text-success icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.contentOpen=!1,"fixed"===this.opts.position&&this._scrollCallback&&W.remove("select-"+this.name),this.onClose()}},n.onSelect=function(t){var e,i=this,n=$(t).parents(".select-item").data(),o=$(t).val();this.searchApi.length&&!$.isEmptyObject(n)&&($(t).length&&t.checked?(this.items.push(n),this.useChips?this.data[this.name].find(function(t){return t[i.primaryKeyword].toString()===o.toString()})||this.data[this.name].push(((e={})[this.primaryKeyword]=o,e.label=$(t).parent().find("[data-label]").text(),e)):-1===this.data[this.name].indexOf(o)&&this.data[this.name].push(o)):(this.items=$.grep(this.items,function(t){return t[i.primaryKeyword].toString()!==o.toString()}),this.useChips?this.data[this.name]=this.data[this.name].filter(function(t){return t[i.primaryKeyword].toString()!==o.toString()}):this.data[this.name]=this.data[this.name].filter(function(t){return t.toString()!==o.toString()})));this.useChips&&this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,n,this,t.checked)},n.getItem=function(t,e){var i=$.grep(this.items,function(i){return i[t]==e})[0];return i||null},n.getSelectedItems=function(t){var e=this,i=[],n=[],o=this.data[this.name];return $.isArray(o)?i=o:i.push(o),i=this.useChips?i.map(function(t){return t[e.primaryKeyword].toString()}):i.map(String),this.items.length>0?(n=$.grep(this.items,function(t){return i.indexOf(t.id.toString())>-1}),t&&(n=n.map(function(e){return e[t]}).filter(function(t){return null!=t}))):n=i,n},n.getSelectedItem=function(t){return this.getSelectedItems(t)[0]},n._renderItemList=function(t){var e=this;if(!t||!t.length)return[];var i=this.data[this.name].map(function(t){return e.useChips?t[e.primaryKeyword].toString():t.toString()});document.createDocumentFragment();for(var n=[],o=0;o<t.length;++o){var s=t[o],a="";"function"==typeof this.labelTemplate?a=this.labelTemplate(s):s.name?a=s.name:s.label?a=s.label:s.value&&(a=s.value);var r=this.useChips?s[this.primaryKeyword]:s.id,l=i.indexOf(r.toString())>-1,c=$(this._getItemTemplate(s,o,a,l)).data(s);n.push(c)}return n},n._getItemTemplate=function(t,e,i,n){return'\n <div class="select-item">\n <div class="select-item-'+this.type+'">\n <div class="form-check">\n <input type="'+this.type+'"\n id="select-'+this.name+"-"+t.id+'"\n value="'+t.id+'"\n tabindex="-1"\n '+(n?"checked":"")+'>\n <label for="select-'+this.name+"-"+t.id+'">\n <span class="form-check-icon">\n <svg viewBox="0 0 18 18">\n <polyline points="1.5 6 4.5 9 10.5 1"></polyline>\n </svg>\n </span>\n <span class="form-check-label"'+("function"!=typeof this.labelTemplate?" data-label":"")+">\n "+("function"!=typeof this.labelTemplate?j(i):i)+"\n </span>\n </label>\n </div>\n </div>\n </div>"},n._renderSearch=function(){if(this.showSearch){var t=this.opts.faPro?"fal":"fas";return'\n\n <div class="select-search">\n\n <div class="select-search-input">\n\n <input type="text" name="select-search" value="" placeholder="'+this.searchPlaceholder+'" tabindex="-1">\n\n </div>\n\n <div class="select-search-icon">\n\n <i class="'+t+' fa-search icon"></i>\n\n </div>\n\n </div>\n\n '}return""},n._renderFooter=function(){return this.showFooter?'\n\n <div class="select-footer">\n\n <button class="btn btn-block btn-light btn-sm" type="button" tabindex="-1" data-select-close >\n '+this.btnCloseText+"\n </button>\n\n </div>\n\n ":""},n.isSearchApiEnabled=function(){return this.searchApi&&this.searchApi.length},n._showSpinner=function(){var t=this.opts.faPro?"fal":"fas";this.$searchIconContainer.html('<i class="'+t+' fa-spinner-third fa-spin icon"></i>')},n._hideSpinner=function(){var t=this.opts.faPro?"fal":"fas";this.$searchIconContainer.html('<i class="'+t+' fa-search icon"></i>')},n.selectItem=function(t){var e=this,i=this.$select.find(':input[value="'+t+'"]');if(i.length){if("radio"===this.type)if(this.$select.find('input[type="radio"]').prop("checked",!1).removeClass("checked"),this.useChips){var n,o=i.parent().find("[data-label]").text();this.data[this.name]=[(n={},n[this.primaryKeyword]=t,n.label=o,n)]}else this.data[this.name]=[t];else if(this.useChips){if(!this.data[this.name].find(function(i){return i[e.primaryKeyword].toString()===t.toString()})){var s,a=i.parent().find("[data-label]").text();this.data[this.name].push(((s={})[this.primaryKeyword]=t,s.label=a,s))}}else-1===this.data[this.name].indexOf(t)&&this.data[this.name].push(t);return i.prop("checked",!0).addClass("checked").trigger("change"),!0}return!1},n.clear=function(){var t=this,e=this.$select.find(":input:checked");this.$select.find(":input").prop("checked",!1).removeClass("checked"),this.data[this.name]=[],this.useChips?this._renderChips():this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&this.$selectTitle.text(this.dynamicTitleDefault||this.cachedTitle),this.showValidStateIcon&&this.$selectIconContainer.html(this.selectIconDefault),e.each(function(e,i){var n=$(i).parents(".select-item").data();"function"==typeof t.opts.onSelect&&t.opts.onSelect.call(i,n,t,!1)})},e}(o);U.NAME="coolSelect",U.DEFAULTS={name:"",type:"checkbox",labelTemplate:null,confirmCheck:null,confirmUncheck:null,setData:null,scrollContentHeight:300,useNativeScroll:!1,contentWidth:null,faPro:!1,items:[],showSearch:!1,showFooter:!1,searchApi:!1,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onReset:null,onSearch:null,onSelect:null,buildScroll:null,searchPlaceholder:null,btnCloseText:null,dynamicTitle:!1,dynamicTitleDefault:"",dynamicTitleEmptyDefault:"",allowNoneOnRadioSelect:!0,preventUncheck:!1,showValidStateIcon:!0,itemsToExclude:[],primaryKeyword:"id",position:"absolute",scrollEl:".content",useChips:!1},U._jQueryInit(),"undefined"==typeof window||window.PerfectScrollbar||(window.PerfectScrollbar=H);var B=function(t){function e(e,i){var n;return(n=t.call(this)||this).opts={},window.Cool.settings.dropdown?$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,window.Cool.settings.dropdown,i):$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,i),n.el=e,n._resizeCallback=null,n._scrollCallback=null,n.init(),n}i(e,t),e._jQueryInterface=function(t){return this.each(function(){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()})},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.setupResizeHandling=function(){var t,e=this;window.ResizeObserver?(this._resizeCallback=function(t){e.contentOpen&&(e.rafId&&cancelAnimationFrame(e.rafId),e.rafId=requestAnimationFrame(function(){e.setPosition(),e.onUpdate()}))},N.observe(this.$el[0],this._resizeCallback),N.observe(document.body,this._resizeCallback),this.$container.length&&N.observe(this.$container[0],this._resizeCallback)):(this.resizeHandler=function(){if(e.contentOpen){clearTimeout(t);var i=performance.now();!e.lastResizeTime||i-e.lastResizeTime>100?(e.setPosition(),e.onUpdate(),e.lastResizeTime=i):t=setTimeout(function(){e.setPosition(),e.onUpdate()},16)}},window.addEventListener("resize",this.resizeHandler,{passive:!0}))},n.setupScrollHandling=function(){var t=this;if("fixed"===this.position){this._scrollCallback=function(){t.contentOpen&&t.$dropdown.hasClass("show")&&(t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(function(){t.setPosition(),t.onUpdate()}))},W.add("dropdown-"+this.id,this._scrollCallback);var e=this.$el.parent();for(this.scrollableParents=[];e.length&&e[0]!==document.body;){var i=e.css("overflow-y");if("scroll"===i||"auto"===i){var n=function(){return t._scrollCallback()};e[0].addEventListener("scroll",n,{passive:!0}),this.scrollableParents.push({element:e[0],handler:n})}e=e.parent()}}},n.setupVisibilityDetection=function(){var t=this;window.IntersectionObserver&&(this.intersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){!e.isIntersecting&&t.contentOpen&&(t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(function(){t.setPosition()}))})},{threshold:.1,rootMargin:"50px"}),this.intersectionObserver.observe(this.$el[0]))},n.init=function(){var t=this;this.buildCache().then(function(){t.buildScroll(),t.setupVisibilityDetection(),t.bindEvents(),t.onInit()}).catch(function(){console.error("Failed to build Dropdown")})},n.destroy=function(){this.unbindEvents(),this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.$dropdown&&this.$dropdown.remove(),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.update=function(){var t=this,e=this.$scrollableContent&&this.$scrollableContent.hasClass("ps-dark");this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.unbindEvents(),this.buildCache().then(function(){e&&t.$scrollableContent&&t.$scrollableContent.addClass("ps-dark"),t.buildScroll(),t.setupVisibilityDetection(),t.bindEvents(),t.onUpdate()}).catch(function(){console.error("Failed to build Dropdown")})},n.buildCache=function(){var t=this;return new Promise(function(e,i){t.$el=$(t.el),t.$el.addClass("dropdown-trigger"),t.$container=t.$el.parent(".dropdown").length?t.$el.parent(".dropdown"):t.$el.parentsUntil(".dropdown").parent(),t.$container.length||(t.$container=t.$el.parent()),t.id="dropdown-"+Y(),t.animation=t.$el.data("animation")?t.$el.data("animation"):t.opts.animation,t.animationIn=t.$el.data("animationIn")?t.$el.data("animationIn"):t.opts.animationIn,t.animationOut=t.$el.data("animationOut")?t.$el.data("animationOut"):t.opts.animationOut,t.animationSpeed=t.$el.data("animationSpeed")?t.$el.data("animationSpeed"):t.opts.animationSpeed,t.position=t.$el.data("position")?t.$el.data("position"):t.opts.position,t.placement=t.$el.data("placement")?t.$el.data("placement"):t.opts.placement,t.offset=t.$el.data("offset")?t.$el.data("offset"):t.opts.offset,t.minWidth=t.$el.data("minWidth")?t.$el.data("minWidth"):t.opts.minWidth,t.scroll=t.$el.data("scroll")?t.$el.data("scroll"):t.opts.scroll,t.scrollContentHeight=t.$el.data("scrollContentHeight")?t.$el.data("scrollContentHeight"):t.opts.scrollContentHeight,t.positionObserver=t.$el.attr("data-position-observer")?JSON.parse(t.$el.attr("data-position-observer")):t.opts.positionObserver,t.closeOnItemClick=t.$el.data("closeOnItemClick")?t.$el.data("closeOnItemClick"):t.opts.closeOnItemClick,t.preventClose=!!t.$el.data("preventClose")&&t.$el.data("preventClose"),t.content=t.$el.data("content")?t.$el.data("content"):t.opts.content,t.contentOpen=!1,t.$container.hasClass("dropup")?t.placement="top":t.$container.hasClass("dropright")?t.placement="right":t.$container.hasClass("dropbottom")?t.placement="bottom":t.$container.hasClass("dropleft")&&(t.placement="left");var n=t.$container.find(".dropdown-menu").first();if("fixed"===t.position&&n.length){t.$dropdown=n.clone(!0,!0),t.$dropdown.attr("id",t.id),t.$dropdown.removeClass("show"),t.align=n.hasClass("dropdown-menu-right")?"end":"start",$("body").append(t.$dropdown),n.remove(),t.$dropdown.find(".dropdown").each(function(e,i){var n=$(i),o=n.find('[data-toggle="dropdown"]').first(),s=n.find(".dropdown-menu").first();o.length&&s.length&&!o.data("plugin_"+t.constructor.NAME)&&o[t.constructor.NAME]({position:"absolute",closeOnItemClick:!1,positionObserver:!0,onShow:function(){var t=parseInt(this.$dropdown.css("z-index")||9999,10);s.css("z-index",t+1)}.bind(t)})});var o=t.$dropdown[0];return t.$dropdownItems=t.$dropdown.find("a, button, .dropdown-item").filter(function(){return $(this).closest(".dropdown-menu")[0]===o}),t.$scrollableContent=t.$dropdown.find(".dropdown-scrollable-content"),t.$dropdown.css({"min-width":t.minWidth?t.minWidth+"px":""}),e()}if("function"!=typeof t.content){if(t.$dropdown=!!t.$container.find(".dropdown-menu").length&&t.$container.find(".dropdown-menu").first(),!t.$dropdown.length)return i();t.$dropdown.hasClass("dropdown-menu-right")?t.align="end":t.align="start",t.$scrollableContent=!!t.$dropdown.find(".dropdown-scrollable-content").length&&t.$dropdown.find(".dropdown-scrollable-content").first();var s=t.$dropdown[0];return t.$dropdownItems=t.$dropdown.find("a, button, .dropdown-item").filter(function(){return $(this).closest(".dropdown-menu")[0]===s}),t.minWidth&&t.$dropdown.css("min-width",t.minWidth+"px"),e()}var a="end"===t.opts.align?" dropdown-menu-right":"";t.$dropdown=$('\n <div class="dropdown-menu'+a+'" id="'+t.id+'">\n '+t.content()+"\n </div>\n ");var r={fixed:function(){return $("body").append(t.$dropdown)},absolute:function(){return t.$el.after(t.$dropdown)}};$.when(r[t.position]()).then(function(){t.$scrollableContent=!!t.$dropdown.find(".dropdown-scrollable-content")&&t.$dropdown.find(".dropdown-scrollable-content").first(),t.$dropdown.hasClass("dropdown-menu-right")?t.align="end":t.align="start";var i=t.$dropdown[0];return t.$dropdownItems=t.$dropdown.find("a, button, .dropdown-item").filter(function(){return $(this).closest(".dropdown-menu")[0]===i}),t.minWidth&&t.$dropdown.css("min-width",t.minWidth+"px"),e()})})},n.buildScroll=function(){this.opts.scroll&&this.$scrollableContent.length&&(this.$scrollableContent.css({"max-height":this.scrollContentHeight+"px"}),P()?this.$scrollableContent.css({"overflow-y":"auto"}):this.scroll=new H(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,suppressScrollX:!0,scrollYMarginOffset:2}))},n.bindEvents=function(){var t=this,e=this;this.$el.on("click."+this.constructor.NAME,function(){t.contentOpen?t.close():t.show()}),"fixed"===this.position?this.$dropdown.on("click."+this.constructor.NAME,"a, button, .dropdown-item",function(t){var i=$(this);i.closest(".dropdown-menu")[0]===e.$dropdown[0]&&(i.hasClass("dropdown-trigger")||i.data("toggle")||(e.closeOnItemClick&&e.close(),e.onItemClick(this,t)))}):this.$dropdownItems.on("click."+this.constructor.NAME,function(t){var i=$(this);i.hasClass("dropdown-trigger")||i.data("toggle")||(e.closeOnItemClick&&e.close(),e.onItemClick(this,t))}),this._documentClickHandler=function(e){if(t.contentOpen){var i=t.$el.is(e.target)||t.$el.has(e.target).length>0||t.$dropdown.is(e.target)||t.$dropdown.has(e.target).length>0,n=t.$dropdown.find(e.target).closest('[data-toggle="dropdown"]').length>0;i||n||t.close()}},document.addEventListener("click",this._documentClickHandler,{passive:!0}),document.addEventListener("touchstart",this._documentClickHandler,{passive:!0}),this.setupResizeHandling(),this.setupScrollHandling()},n.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this.$dropdown&&this.$dropdown.off("."+this.constructor.NAME),this.$dropdownItems&&"fixed"!==this.position&&this.$dropdownItems.off("."+this.constructor.NAME),this._resizeCallback&&(N.unobserve(this.$el[0]),N.unobserve(document.body),this.$container.length&&N.unobserve(this.$container[0]),this._resizeCallback=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._scrollCallback&&(W.remove("dropdown-"+this.id),this._scrollCallback=null),this.scrollableParents&&(this.scrollableParents.forEach(function(t){var e=t.element,i=t.handler;e.removeEventListener("scroll",i)}),this.scrollableParents=[]),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this._documentClickHandler&&(document.removeEventListener("click",this._documentClickHandler),document.removeEventListener("touchstart",this._documentClickHandler),this._documentClickHandler=null)},n.setPosition=function(t){var e=this;"undefined"!=typeof t&&null!==t||(t=this.placement);var i,n,o=this.$el[0].getBoundingClientRect(),s=window.innerWidth,a=window.innerHeight,r=this.$dropdown.outerWidth(!0),l=this.$dropdown.outerHeight(!0),c=this.$el.outerWidth(!0),h=this.$el.outerHeight(!0);if("fixed"===this.position){var d=this.$el.offset();i=d.left,n=d.top}else{var u=this.$dropdown.offsetParent().offset()||{left:0,top:0},p=this.$el.offset();i=p.left-u.left,n=p.top-u.top}var f,m,v=0,g=0;if(this.offset){var b=this.offset.split(",");v=parseInt(b[0],10)||0,g=parseInt(b[1],10)||0}var $=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cool-dropdown-spacer"))||2,w=function(t,o){void 0===o&&(o=e.align);var s=0,a=0;switch(t){case"top":s="end"===o?i+c-r:i,a=n-l-$;break;case"bottom":s="end"===o?i+c-r:i,a=n+h+$;break;case"left":s=i-r-$,a=n;break;case"right":s=i+c+$,a=n}return{x:s+v,y:a+g}},y=t,C=this.align,E=w(t);if(this.positionObserver){var S=function(t,c,h){void 0===h&&(h=e.align);var d={top:!1,bottom:!1,left:!1,right:!1};if("fixed"===e.position)d.top=t.y<5,d.bottom=t.y+l>a-5,d.left=t.x<5,d.right=t.x+r>s-5;else{var u="fixed"===e.position?t.x:o.left+(t.x-i),p="fixed"===e.position?t.y:o.top+(t.y-n),f=u+r,m=p+l;d.top=p<5,d.bottom=m>a-5,d.left=u<5,d.right=f>s-5}return d},T=S(E,0,this.align);"bottom"===t&&T.bottom&&!T.top?(y="top",E=w("top",C)):"top"===t&&T.top&&!T.bottom?(y="bottom",E=w("bottom",C)):"right"===t&&T.right&&!T.left?(y="left",E=w("left",C)):"left"===t&&T.left&&!T.right&&(y="right",E=w("right",C));var x=S(E,0,C);if("top"!==y&&"bottom"!==y||("end"===C&&x.left&&!x.right?E=w(y,C="start"):"start"===C&&x.right&&!x.left&&(E=w(y,C="end"))),this.$container.removeClass("dropup dropbottom dropleft dropright"),"top"===y?this.$container.addClass("dropup"):"left"===y?this.$container.addClass("dropleft"):"right"===y?this.$container.addClass("dropright"):this.$container.addClass("dropbottom"),this.$dropdown.attr("x-placement",y+"-"+C),"fixed"===this.position)E.x=Math.max(5,Math.min(E.x,s-r-5)),E.y=Math.max(5,Math.min(E.y,a-l-5));else{var I=o.left+(E.x-i),k=o.top+(E.y-n);I<5?E.x+=5-I:I+r>s-5&&(E.x-=I+r-s+5),k<5?E.y+=5-k:k+l>a-5&&(E.y-=k+l-a+5)}}if(f=E.x,m=E.y,"fixed"===this.position)this.$dropdown.css({position:"fixed",top:Math.round(m)+"px",left:Math.round(f)+"px",right:"auto",bottom:"auto",transform:"none","will-change":"auto","z-index":9999});else{var A=this.$el.closest(".dropdown, .dropup, .dropleft, .dropright");if(A.length){var _=A.offset(),L=this.$el.offset(),M=L.left-_.left,H=L.top-_.top;switch(y){case"bottom":H+=h+$,"end"===C&&(M=M+c-r);break;case"top":H-=l+$,"end"===C&&(M=M+c-r);break;case"left":M-=r+$;break;case"right":M+=c+$}M+=v,H+=g,this.$dropdown.css({position:"absolute",top:Math.round(H)+"px",left:Math.round(M)+"px",right:"auto",bottom:"auto",transform:"none","will-change":"auto"})}}},n.show=function(){var t=this;if(this.$dropdown&&!this.$dropdown.hasClass("show")){if(this.setPosition(),this.animation?(this.$dropdown.attr("x-placement",this.placement+"-"+this.align),this.$dropdown.addClass(this.animationSpeed),X(this.$dropdown,this.animationIn),this.$dropdown.addClass("show"),this.$dropdown.attr("id",this.id),this.$el.attr("data-dropdown",this.id)):(this.$dropdown.attr("x-placement",this.placement+"-"+this.align),this.$dropdown.addClass("show"),this.$dropdown.attr("id",this.id),this.$el.attr("data-dropdown",this.id)),this.opts.scroll&&this.scroll&&this.$scrollableContent.length)if(this.$scrollableContent[0].offsetHeight,this.animation){var e=this.$dropdown.css("animation-duration"),i=e?1e3*parseFloat(e):300;setTimeout(function(){t.scroll&&"function"==typeof t.scroll.update&&t.scroll.update()},i)}else requestAnimationFrame(function(){t.scroll&&"function"==typeof t.scroll.update&&t.scroll.update()});this.contentOpen=!0,this.onShow()}},n.close=function(){var t=this;this.$dropdown&&!this.preventClose&&(this.animation&&!this.$dropdown.hasClass("animation")?X(this.$dropdown,this.animationOut).then(function(){t.$dropdown.removeClass("show"),t.$el.removeAttr("data-dropdown")}):(this.$dropdown.removeClass("show"),this.$el.removeAttr("data-dropdown")),this.contentOpen=!1,this.onClose())},n.onItemClick=function(t,e){var i=this.opts.onItemClick;"function"==typeof i&&i.call(t,e,this)},e}(o);B.NAME="coolDropdown",B.DEFAULTS={animation:!0,animationIn:"zoomIn",animationOut:"zoomOut",animationSpeed:"fastest",offset:null,minWidth:null,closeOnItemClick:!0,positionObserver:!0,content:!1,scroll:!0,scrollContentHeight:100,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onItemClick:null,position:"absolute",placement:"bottom",align:"start"},B._jQueryInit();var K=function(t){function e(e,i){var n;return(n=t.call(this)||this).opts={},window.Cool.settings.tooltip?$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,window.Cool.settings.tooltip,i):$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,i),n.el=e,n.init(),n}i(e,t),e._jQueryInterface=function(t){return this.each(function(){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()})},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},n.destroy=function(){this.unbindEvents(),this.$tooltip&&(this.$tooltip.remove(),this.$tooltip=null),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.update=function(){this.buildCache(),this.$tooltip&&this.setPosition(),this.onUpdate()},n.buildCache=function(){this.$el=$(this.el),this.$container=this.$el.data("container")?$(this.$el.data("container")):$(this.opts.container),this.id="tooltip-"+Y(),this.animation=this.$el.data("animation")?this.$el.data("animation"):this.opts.animation,this.animationIn=this.$el.data("animationIn")?this.$el.data("animationIn"):this.opts.animationIn,this.animationOut=this.$el.data("animationOut")?this.$el.data("animationOut"):this.opts.animationOut,this.animationSpeed=this.$el.data("animationSpeed")?this.$el.data("animationSpeed"):this.opts.animationSpeed,this.placement=this.$el.data("placement")?this.$el.data("placement"):this.opts.placement,this.placementChanged=!1,this.content=this.$el.data("content")?this.$el.data("content"):this.opts.content,this.trigger=this.$el.data("trigger")?this.$el.data("trigger"):this.opts.trigger},n.bindEvents=function(){var t=this;"auto"===this.trigger&&(this.$el.on("mouseenter."+this.constructor.NAME,function(){t.show()}),this.$el.on("mouseleave."+this.constructor.NAME,function(){t.close()}),this.$el.on("blur."+this.constructor.NAME,function(){t.close()}),this.$el.on("click."+this.constructor.NAME,function(){t.close()})),window.ResizeObserver&&(this._resizeCallback=function(){t.$tooltip&&t.$tooltip.hasClass("show")&&requestAnimationFrame(function(){t.setPosition()})},N.observe(this.el,this._resizeCallback))},n.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this._resizeCallback&&(N.unobserve(this.el),this._resizeCallback=null)},n.buildTooltip=function(){this.$tooltip=$('\n <div class="tooltip" role="tooltip" id="'+this.id+'">\n <div class="arrow"></div>\n <div class="tooltip-inner">'+this.content+"</div>\n </div>\n "),this.$container.append(this.$tooltip),this.$arrow=this.$tooltip.find(".arrow")},n.setPosition=function(t){"undefined"!=typeof t&&null!==t||(t=this.placement),this.$tooltip.addClass("tooltip-"+t);var e,i,n,o=this.$container.innerWidth(),s=this.$container.innerHeight(),a=this.$tooltip.outerWidth(!0),r=this.$tooltip.outerHeight(!0),l=this.$el.outerWidth(),c=this.$el.outerHeight(),h=this.$el.offset().left,d=this.$el.offset().top,u=this.$arrow.outerWidth(!0),p=this.$arrow.outerHeight(!0);"top"===t?(i=Math.round(h-(a-l)/2),n=Math.round(d-r),e=Math.round(a/2-u/2),this.$arrow.css({left:e+"px"})):"right"===t?(i=Math.round(h+l),n=Math.round(d-(r-c)/2),e=Math.round(r/2-p/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(i=Math.round(h-(a-l)/2),n=Math.round(d+c),e=Math.round(a/2-u/2),this.$arrow.css({left:e+"px"})):"left"===t&&(i=Math.round(h-a),n=Math.round(d-(r-c)/2),e=Math.round(r/2-p/2),this.$arrow.css({top:e+"px"})),this.$tooltip.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+i+"px, "+n+"px, 0px)","will-change":"transform"});var f=0,m={left:this.$tooltip.position().left,top:this.$tooltip.position().top,right:o-(this.$tooltip.position().left+a),bottom:s-(this.$tooltip.position().top+r)},v={left:!1,top:!1,right:!1,bottom:!1};if(m.right<0&&(v.right=!0,f++),m.left<0&&(v.left=!0,f++),m.bottom<0&&(v.bottom=!0,f++),m.top<0&&(v.top=!0,f++),f>0&&(!this.placementChanged&&v.left&&m.right>a?(this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("right")):!this.placementChanged&&v.top&&m.top>r?(this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")):!this.placementChanged&&v.right&&m.left>a?(this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("left")):!this.placementChanged&&v.bottom&&m.top>r?(this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!v.left&&!v.right?this.fixTooltipPosition=!0:m.top>m.bottom?(this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):(this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")),this.fixTooltipPosition)){if(v.left){var g=Math.abs(m.left);h>=i+g&&["top","bottom"].indexOf(t)<0?(a-=g,i+=g):(i+=g,e-=g)}if(v.top){var b=Math.abs(m.top);n+=b,e-=b}if(v.right){var $=Math.abs(m.right);h<=i-$&&["top","bottom"].indexOf(t)<0?a-=$:(i-=$,e+=$)}if(v.bottom){var w=Math.abs(m.bottom);n-=w,e+=w}"top"===t?this.$arrow.css({left:e+"px"}):"right"===t?this.$arrow.css({top:e+"px"}):"bottom"===t?this.$arrow.css({left:e+"px"}):"left"===t&&this.$arrow.css({top:e+"px"}),this.$tooltip.css({width:a,transform:"translate3d("+i+"px, "+n+"px, 0px)"}),this.fixTooltipPosition=!1}},n.show=function(){this.$tooltip||(this.buildTooltip(),this.setPosition(),this.animation?(this.$tooltip.addClass(this.animationSpeed),X(this.$tooltip,this.animationIn),this.$tooltip.addClass("show"),this.$tooltip.attr("id",this.id),this.$el.attr("data-tooltip",this.id)):(this.$tooltip.addClass("show"),this.$tooltip.attr("id",this.id),this.$el.attr("data-tooltip",this.id)),this.onShow())},n.close=function(){var t=this;this.$tooltip&&(this.animation&&!this.$tooltip.hasClass("animation")?X(this.$tooltip,this.animationOut).then(function(){t.$tooltip.remove(),t.$el.removeAttr("data-tooltip"),t.$tooltip=null,t.placementChanged=!1,t.onClose()}):(this.$tooltip.remove(),this.$el.removeAttr("data-tooltip"),this.$tooltip=null,this.placementChanged=!1,this.onClose()))},e}(o);K.NAME="coolTooltip",K.DEFAULTS={container:"body",animation:!1,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",placement:"bottom",content:"",trigger:"auto",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null},K._jQueryInit();var Q=function(t){function e(e,i){var n;return(n=t.call(this)||this).opts={},window.Cool.settings.collapse?$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,window.Cool.settings.collapse,i):$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,i),n.el=e,n.init(),n}i(e,t),e._jQueryInterface=function(t){return this.each(function(){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()})},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},n.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.update=function(){this.buildCache(),this.onUpdate()},n.buildCache=function(){this.$el=$(this.el),this.el=this.$el[0];var t=this.$el.data("target")||this.opts.target;if(this.$target=t?$(t):this.$el.parent().find(".collapse"),this.target=this.$target[0],this.breakpoint=this.$el.data("breakpoint"),this.expanded="true"===this.$el.attr("aria-expanded"),this.target){this.$container=this.$target.closest(".section-collapse"),this.container=this.$container[0];var e=this.$el.data("target")?'[data-collapse-indicator="'+this.$el.data("target")+'"]':null;this.$indicator=e?$(e):this.$el.parent().find("[data-collapse-indicator]"),this.indicator=this.$indicator[0]}},n.bindEvents=function(){var t=this;this._clickHandler=function(e){t.breakpoint&&window.matchMedia("(min-width: "+t.breakpoint+"px)").matches||(e.preventDefault(),t.toggle())},this.el.addEventListener("click",this._clickHandler)},n.unbindEvents=function(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this.$el.off("."+this.constructor.NAME)},n.toggle=function(){this.expanded?this.close():this.show()},n.show=function(){this.expanded||(this.target.classList.add("show"),this.container&&this.container.classList.add("show"),this.indicator&&this.indicator.classList.add("show"),this.el.setAttribute("aria-expanded","true"),this.expanded=!0,this.onShow())},n.close=function(){this.expanded&&(this.target.classList.remove("show"),this.container&&this.container.classList.remove("show"),this.indicator&&this.indicator.classList.remove("show"),this.el.setAttribute("aria-expanded","false"),this.expanded=!1,this.onClose())},e}(o);Q.NAME="coolCollapse",Q.DEFAULTS={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null},Q._jQueryInit();var V,G=function(t){function e(e,i){var n;return(n=t.call(this)||this).opts={},window.Cool.settings.sectionTabs?$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,window.Cool.settings.sectionTabs,i):$.extend(!0,n.opts,$.fn[n.constructor.NAME].defaults,i),n.el=e,n._tabsCache=new WeakMap,n._resizeObserver=null,n._isProcessing=!1,n._rafId=null,n.init(),n}i(e,t),e._jQueryInterface=function(t){return this.each(function(){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()})},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.init=function(){var t=this;this.buildCache(),this.bindEvents(),this._rafId=requestAnimationFrame(function(){t.dropdownContainer&&t.dropdownContainer.classList.add("js-ready"),t.el.classList.add("js-initialized"),t.checkForChanges(),t.onInit()})},n.destroy=function(){this.unbindEvents(),this._rafId&&cancelAnimationFrame(this._rafId),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.update=function(){this.buildCache(),this.onUpdate()},n.buildCache=function(){this.$el=$(this.el),this.el=this.$el[0];var t=this.el.closest(".section-tabs");this.$dropdownContainer=t?$(t).find(".dropdown-container"):this.$el.find(".dropdown-container"),this.$dropdownList=t?$(t).find(".dropdown-list"):this.$el.find(".dropdown-list"),this.dropdownContainer=this.$dropdownContainer.length?this.$dropdownContainer[0]:null,this.dropdownList=this.$dropdownList.length?this.$dropdownList[0]:null},n.bindEvents=function(){var t=this,e=this.el.closest(".section-tabs"),i=(e?e.closest(".section-header"):null)||e||this.el;window.ResizeObserver?(this._resizeObserver=new ResizeObserver(function(e){t._isProcessing||(t._isProcessing=!0,t._rafId&&cancelAnimationFrame(t._rafId),t._rafId=requestAnimationFrame(function(){t.checkForChanges(),t._isProcessing=!1}))}),this._resizeObserver.observe(i)):(this._resizeHandler=R(function(){t.checkForChanges()},50),window.addEventListener("resize",this._resizeHandler,{passive:!0}))},n.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler)},n.moveToList=function(t){var e=t.getAttribute("data-uuid"),i=this.el.querySelector(':scope > .tab-item[data-related-dropdown-item="'+e+'"]');i&&(i.removeAttribute("data-related-dropdown-item"),t.remove())},n.moveToDropdown=function(t){if(!t.hasAttribute("data-related-dropdown-item")&&this.dropdownList){var e=crypto.randomUUID(),i=t.cloneNode(!0),n=i.querySelector(".tab-item-action");n&&n.classList.add("dropdown-item"),i.setAttribute("data-uuid",e),this.dropdownList.appendChild(i),t.setAttribute("data-related-dropdown-item",e)}},n.getTabDimensions=function(t){if(this._tabsCache.has(t))return this._tabsCache.get(t);var e=t.classList.contains("invisible");e&&t.classList.remove("invisible");var i=this.el.closest(".section-tabs")||this.el,n=i.style.overflow;i.style.overflow="visible",i.offsetHeight;var o=t.offsetWidth,s=o+(parseInt(getComputedStyle(t).marginLeft,10)||0)+(parseInt(getComputedStyle(t).marginRight,10)||0);i.style.overflow=n,e&&t.classList.add("invisible");var a={width:o,totalWidth:s};return this._tabsCache.set(t,a),a},n.availableSpace=function(){var t,e,i,n=this.el.closest(".section-tabs"),o=n?n.closest(".section-header"):null;if(o){var s=getComputedStyle(o);if("column"===s.flexDirection){var a=n||this.el,r=getComputedStyle(a);t=a.offsetWidth,e=parseInt(r.paddingLeft,10)||0,i=parseInt(r.paddingRight,10)||0}else{t=o.offsetWidth,e=parseInt(s.paddingLeft,10)||0,i=parseInt(s.paddingRight,10)||0;var l=o.querySelector(".section-search");if(l)t-=l.offsetWidth,t-=parseInt(s.gap,10)||0}}else{var c=n||this.el,h=getComputedStyle(c);t=c.offsetWidth,e=parseInt(h.paddingLeft,10)||0,i=parseInt(h.paddingRight,10)||0}return t-e-i-(this.dropdownContainer?this.dropdownContainer.classList.contains("visible")?this.dropdownContainer.offsetWidth:40:0)},n.checkForChanges=function(){var t=this;if(this.dropdownList){this._tabsCache=new WeakMap;var e=Array.from(this.el.querySelectorAll(":scope > .tab-item")),i=Array.from(this.dropdownList.children),n=this.availableSpace(),o=parseInt(getComputedStyle(this.el).gap,10)||0;if(window.innerWidth<768&&n<200)return e.forEach(function(t){t.classList.remove("invisible"),t.removeAttribute("data-related-dropdown-item")}),void(this.dropdownContainer&&this.dropdownContainer.classList.remove("visible"));for(var s=0,a=[],r=[],l=0;l<e.length;l++){var c=e[l],h=s+this.getTabDimensions(c).totalWidth+(l>0?o:0);if(h<=n){s=h,a.push(c);var d=c.getAttribute("data-related-dropdown-item");if(d){var u=this.dropdownList.querySelector('[data-uuid="'+d+'"]');u&&this.moveToList(u)}}else r.push(c)}if(r.forEach(function(e,i){e.hasAttribute("data-related-dropdown-item")||t.moveToDropdown(e)}),i.length>0&&0===r.length)for(var p=n-s,f=i.length-1;f>=0;f--){var m=i[f],v=m.getAttribute("data-uuid"),g=this.el.querySelector('[data-related-dropdown-item="'+v+'"]');if(g){var b=this.getTabDimensions(g).totalWidth+(s>0?o:0);if(!(b<=p))break;this.moveToList(m),a.push(g),s+=b}}e.forEach(function(t){a.includes(t)?t.classList.remove("invisible"):t.classList.add("invisible")});var $=this.dropdownList&&this.dropdownList.children.length>0;this.dropdownContainer&&this.dropdownContainer.classList.toggle("visible",$)}},e}(o);G.NAME="coolSectionTabs",G.DEFAULTS={onInit:null,onUpdate:null,onDestroy:null},G._jQueryInit();var J,Z=function(t){function e(e,i){var n;return(n=t.call(this)||this).settings={},window.Cool.settings.toast?$.extend(!0,n.settings,$.fn[n.constructor.NAME].defaults,window.Cool.settings.toast,i):$.extend(!0,n.settings,$.fn[n.constructor.NAME].defaults,i),n.container=e,n.$container=$(n.container),n.toasts=[],n.queue=[],n.processingQueue=!1,n.onInitialize=n.settings.onInitialize,n.onDestroy=n.settings.onDestroy,n.lastToastContent=null,n.$container.data("plugin_"+n.constructor.NAME,n),n}i(e,t),e._jQueryInterface=function(t){var i=$(this),n=i.data("plugin_"+e.NAME);n||(n=new e(this,"object"==typeof t&&t),i.data("plugin_"+e.NAME,n)),"string"==typeof t&&n[t]()},e._jQueryInit=function(){if($.fn){var t=$.fn[e.NAME];$.fn[e.NAME]=e._jQueryInterface,$.fn[e.NAME].Constructor=e,$.fn[e.NAME].defaults=e.DEFAULTS||{},$.fn[e.NAME].noConflict=function(){return $.fn[e.NAME]=t,e._jQueryInterface}}};var n=e.prototype;return n.isSimilarToast=function(t){return!!this.lastToastContent&&this.lastToastContent===t.content},n.addQueue=function(t){if(this.isSimilarToast(t)&&(this.queue=this.queue.filter(function(e){return e.content!==t.content})),this.queue.push(t),this.lastToastContent=t.content,!this.processingQueue)return this.processQueue()},n.processQueue=function(){if(this.processingQueue&&this.queue.shift(),this.queue.length)return this.processingQueue=!0,this.show(this.queue[0]);this.processingQueue=!1},n.init=function(t){var e={};$.extend(!0,e,this.settings,t);var i=this.buildToast(e);return this.addQueue(i),this.onInit(i),i},n.destroy=function(){this.$container.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},n.buildToast=function(t){var e={uuid:"toast-"+Y(),placement:t.placement,placementX:t.placementX,placementY:t.placementY,offset:t.offset,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,dismiss:t.dismiss,size:t.size,header:t.header,theme:t.theme,title:t.title,content:t.content,template:t.template,maxBodyHeight:t.maxBodyHeight,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};return"function"==typeof e.content?e.$el=$(e.template()):e.$el=$(this._renderTemplate(e)),e.$inner=e.$el.find(".toast-inner"),e.$closeBtn=e.$el.find("[data-toast-close]"),this.toasts.push(e),e},n.bindEvents=function(t){var e,i=this,n=this;(t.$el.on("click","[data-toast-close]",function(){t.$el&&n.close(t)}),window.ResizeObserver)?(t.resizeObserver=new ResizeObserver(function(e){t.$el&&(t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(function(){t.$el&&i.setPosition(t)}))}),t.resizeObserver.observe(document.body)):(t.resizeHandler=function(){if(t.$el){clearTimeout(e);var n=performance.now();!t.lastResizeTime||n-t.lastResizeTime>100?(i.setPosition(t),t.lastResizeTime=n):e=setTimeout(function(){t.$el&&i.setPosition(t)},16)}},window.addEventListener("resize",t.resizeHandler,{passive:!0}))},n.setPosition=function(t,e,i,n){if("undefined"!=typeof i&&null!==i||(i=t.placementY),"undefined"!=typeof n&&null!==n||(n=t.placementX),n&&i||(e=t.placement),t.offset){var o=t.offset.split(",");parseInt(o[0],10),parseInt(o[1],10)}var s,a,r=t.$el.outerWidth(!0),l=t.$el.outerHeight(!0);e?"top-left"===e?(s=0,a=0,t.offset?(s+=offsetX,a+=offsetY):(s+=30,a+=30)):"top-center"===e?(s=this.$container.width()/2-r/2,a=0,t.offset?(s+=offsetX,a+=offsetY):a+=30):"top-right"===e?(s=this.$container.width()-r,a=0,t.offset?(s+=-offsetX,a+=offsetY):(s+=-30,a+=30)):"center-left"===e?(s=0,a=this.$container.height()/2-l/2,t.offset?(s+=offsetX,a+=offsetY):s+=30):"center-center"===e?(s=this.$container.width()/2-r/2,a=this.$container.height()/2-l/2,t.offset&&(s+=offsetX,a+=offsetY)):"center-right"===e?(s=this.$container.width()-r,a=this.$container.height()/2-l/2,t.offset?(s+=-offsetX,a+=offsetY):s+=-30):"bottom-left"===e?(s=0,a=this.$container.height()-l,t.offset?(s+=offsetX,a+=-offsetY):(s+=30,a+=-30)):"bottom-center"===e?(s=this.$container.width()/2-r/2,a=this.$container.height()-l,t.offset?(s+=offsetX,a+=-offsetY):a+=-30):"bottom-right"===e&&(s=this.$container.width()-r,a=this.$container.height()-l,t.offset?(s+=-offsetX,a+=-offsetY):(s+=-30,a+=-30)):(s=n,a=i),t.$el.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+s+"px, "+a+"px, 0px)","will-change":"transform"})},n.show=function(t){var e=this;this.$container.append(t.$el),this.bindEvents(t),this.setPosition(t),t.animation?(t.$el.addClass("show"),t.$inner.addClass(t.animationSpeed),X(t.$inner,t.animationIn)):t.$el.addClass("show"),t.dismiss&&setTimeout(function(){e.close(t)},1e3*t.dismiss),this.onShow(t)},n.close=function(t){var e=this;t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null),t.rafId&&(cancelAnimationFrame(t.rafId),t.rafId=null),t.resizeHandler&&(window.removeEventListener("resize",t.resizeHandler),t.resizeHandler=null),t.animation&&!t.$inner.hasClass("animation")?(t.$el.removeClass("show"),X(t.$inner,t.animationOut).then(function(){t.$el.remove(),e.lastToastContent=null,e.toasts=$.grep(e.toasts,function(e){return e.uuid!=t.uuid}),e.processQueue(),e.onClose(t)})):(t.$el.remove(),this.lastToastContent=null,this.toasts=$.grep(this.toasts,function(e){return e.uuid!=t.uuid}),this.processQueue(),this.onClose(t))},n.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},n.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},n.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},n.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},n.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},n._renderTemplate=function(t){var e,i="",n="",o="";return i="function"==typeof t.content?t.content():t.content,t.header?n='\n <div class="toast-header">\n\n <span>'+t.title+'</span>\n\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n\n </div>\n ':o='\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ',e='\n <div class="toast-body">\n\n <span>'+i+"</span>\n "+o+"\n\n </div>\n ",'\n <div class="toast toast-'+t.size+" toast-"+t.theme+'" role="alert" id="'+t.uuid+'">\n\n <div class="toast-inner">\n\n '+n+"\n "+e+"\n\n </div>\n\n </div>\n "},e}(o);Z.NAME="coolToast",Z.DEFAULTS=((V={title:"",content:"",template:"",theme:"dark",placement:"bottom-center",placementX:null,placementY:null,animation:!0,animationIn:"slideInUp",animationOut:"slideOutDown",animationSpeed:"faster",offset:null,size:null,dismiss:3,header:!1,onInitialize:null,onDestroy:null,onInit:null}).onDestroy=null,V.onShow=null,V.onClose=null,V),Z._jQueryInit();var tt=function(t){function n(e,i){var n;return(n=t.call(this)||this).settings={},window.Cool.settings.dialog?$.extend(!0,n.settings,$.fn[n.constructor.NAME].defaults,window.Cool.settings.dialog,i):$.extend(!0,n.settings,$.fn[n.constructor.NAME].defaults,i),n.container=e,n.$container=$(n.container),n.dialogs=[],n.onInitialize=n.settings.onInitialize,n.onDestroy=n.settings.onDestroy,n.$container.data("plugin_"+n.constructor.NAME,n),n}i(n,t),n._jQueryInterface=function(t){var e=$(this),i=e.data("plugin_"+n.NAME);i||(i=new n(this,"object"==typeof t&&t),e.data("plugin_"+n.NAME,i)),"string"==typeof t&&i[t]()},n._jQueryInit=function(){if($.fn){var t=$.fn[n.NAME];$.fn[n.NAME]=n._jQueryInterface,$.fn[n.NAME].Constructor=n,$.fn[n.NAME].defaults=n.DEFAULTS||{},$.fn[n.NAME].noConflict=function(){return $.fn[n.NAME]=t,n._jQueryInterface}}};var o=n.prototype;return o.init=function(t){var e=this,i={};$.extend(!0,i,this.settings,t),t&&t.actions&&(i.actions=t.actions||{}),t&&t.callbacks&&(i.callbacks=t.callbacks||{}),i.callbacks&&"object"==typeof i.callbacks&&Object.keys(i.callbacks).forEach(function(t){i.actions.hasOwnProperty(t)?"object"!=typeof i.actions[t]||i.actions[t].hasOwnProperty("content")||e.settings.actions&&e.settings.actions[t]&&"object"==typeof e.settings.actions[t]&&e.settings.actions[t].hasOwnProperty("content")&&(i.actions[t].content=e.settings.actions[t].content):e.settings.actions&&e.settings.actions[t]?i.actions[t]=$.extend(!0,{},e.settings.actions[t]):i.actions[t]={}});var n=this.buildDialog(i);return this.show(n),this.bindEvents(n),this.onInit(n),n},o.destroy=function(){this.$container.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},o.buildDialog=function(t){var e=this,i={uuid:"dialog-"+Y(),title:t.title,template:t.template,body:t.body,footer:t.footer,header:t.header,size:t.size,classes:t.classes,centered:t.centered,backdrop:t.backdrop,preventScroll:t.preventScroll,closeBtn:t.closeBtn,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,callbacks:t.callbacks,maxBodyHeight:t.maxBodyHeight,overflowVisible:t.overflowVisible,actions:t.actions,actionInProgress:!1,actionThreshold:300,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};return null==i.maxBodyHeight&&"full"!==i.size&&(i.maxBodyHeight=window.innerHeight-200),"function"==typeof i.template?i.$el=$(i.template()):i.$el=$(this._renderTemplate(i)),i.show=function(){e.show(i)},i.close=function(){e.close(i)},this.dialogs.push(i),i},o.bindEvents=function(t){var i=this;if(t.$el.on("click","[data-dialog-action], [data-dialog-confirm], [data-dialog-close], [data-dialog-remove]",function(n){if(n.preventDefault(),t.actionInProgress)n.stopPropagation();else{t.actionInProgress=!0;var o=["confirm","close","remove"],s=$(this).data("dialogAction");if(!s)for(var a,r=e(o);!(a=r()).done;){var l=a.value;if($(this).is("[data-dialog-"+l+"]")){s=l;break}}var c=t.actions[s]||{};t.$el.trigger("dialog."+s);var h="function"==typeof c.callback?c.callback:"function"==typeof t.callbacks[s]?t.callbacks[s]:null,d=function(e){void 0===e&&(e=!1),e?t.actionInProgress=!1:setTimeout(function(){t.actionInProgress=!1},t.actionThreshold)};if("function"==typeof h)try{var u=h.call(i,function(){o.includes(s)&&i.close(t),d()},t);u&&"function"==typeof u.then?u.then(function(t){!1===t&&d()}).catch(function(t){console.error("Dialog action error:",t),d()}):d()}catch(t){console.error("Dialog action error:",t),d()}else o.includes(s)?(i.close(t),d()):d()}}),null!==t.maxBodyHeight&&"full"!==t.size){var n=function(){return t.maxBodyHeight=window.innerHeight-200,t.maxBodyHeight};if(window.ResizeObserver)t.resizeObserver=new ResizeObserver(function(e){t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(function(){var e=n();t.$el.find(".dialog-body").css("--cool-dialog-body-height",e+"px")})}),t.resizeObserver.observe(document.body);else{var o,s=window.orientation;t.resizeHandler=function(){clearTimeout(o);var e=performance.now(),i=window.orientation!==s;if(i&&(s=window.orientation),!t.lastResizeTime||e-t.lastResizeTime>100||i){var a=n();t.$el.find(".dialog-body").css("--cool-dialog-body-height",a+"px"),t.lastResizeTime=e}else o=setTimeout(function(){var e=n();t.$el.find(".dialog-body").css("--cool-dialog-body-height",e+"px")},16)},window.addEventListener("resize",t.resizeHandler,{passive:!0}),window.addEventListener("orientationchange",t.resizeHandler,{passive:!0})}}},o.show=function(t){var e=this;if(this.$container.hasClass("has-dialogs")||this.$container.addClass("has-dialogs"),t.preventScroll&&!this.$container.hasClass("dialog-prevent-scroll")&&this.$container.addClass("dialog-prevent-scroll"),this.dialogs.length>1){var i=$(this.dialogs).eq(-2)[0].$el,n=parseInt(i.css("z-index"),10)+1;t.$el.css("z-index",n),i.css({transition:"opacity 0.3s",opacity:0,visibility:"visible"})}if(t.backdrop&&$(".dialog-backdrop").length<1){this.$container.append('<div class="dialog-backdrop"></div>');var o=setInterval(function(){0==e.dialogs.length&&$(".dialog-backdrop").length&&($(".dialog-backdrop").remove(),clearInterval(o))},100)}if(this.$container.append(t.$el),t.animation){var s=t.$el.find(".dialog-content");X(s,t.animationIn)}this.onShow(t)},o.close=function(t){var e=this,i=null;t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null),t.rafId&&(cancelAnimationFrame(t.rafId),t.rafId=null),t.resizeHandler&&(window.removeEventListener("resize",t.resizeHandler),window.removeEventListener("orientationchange",t.resizeHandler),t.resizeHandler=null),this.dialogs.length>1&&(i=$(this.dialogs).eq(-2)[0].$el),0===$('.dialog[data-dialog-backdrop="true"]').length&&$(".dialog-backdrop").length&&$(".dialog-backdrop").remove(),t.animation?X(t.$el.find(".dialog-content"),t.animationOut).then(function(){t.$el.remove(),e.dialogs=$.grep(e.dialogs,function(e){return e.uuid!=t.uuid}),0==e.dialogs.length?(e.$container.removeClass("has-dialogs"),e.$container.hasClass("dialog-prevent-scroll")&&e.$container.removeClass("dialog-prevent-scroll")):i&&i.css("opacity",1)}):(t.$el.remove(),this.dialogs=$.grep(this.dialogs,function(e){return e.uuid!=t.uuid}),0==this.dialogs.length?(this.$container.removeClass("has-dialogs"),this.$container.hasClass("dialog-prevent-scroll")&&this.$container.removeClass("dialog-prevent-scroll")):i&&i.css("opacity",1)),this.onClose(t)},o.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},o.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},o.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},o.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},o.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},o._renderFooter=function(t){if("function"==typeof t.footer)return t.footer();if(""!==t.footer&&!1!==t.footer&&!0!==t.footer)return t.footer;if(!0===t.footer){if(!t.actions||"object"!=typeof t.actions)return"";var e=Object.entries(t.actions).filter(function(t){t[0];var e=t[1];return!1!==e&&("undefined"==typeof e.visible||!!e.visible)}).map(function(t,e){return{key:t[0],action:t[1],idx:e}});e.sort(function(t,i){if(2===e.length&&e.some(function(t){return"close"===t.key})&&e.some(function(t){return"remove"===t.key})){if("close"===t.key)return-1;if("close"===i.key)return 1;if("remove"===t.key)return 1;if("remove"===i.key)return-1}return"remove"===t.key?-1:"remove"===i.key||"confirm"===t.key?1:"confirm"===i.key?-1:t.idx-i.idx});var i=e.map(function(t){var e=t.key,i=t.action,n=i.style?i.style:i.primary?"btn-primary":"btn-secondary";"remove"===e&&(n="btn-remove"),"confirm"!==e||"undefined"!==i.primary&&!1===i.primary||(n="btn-primary");var o=i.content||e.charAt(0).toUpperCase()+e.slice(1);return'\n <button type="button" class="btn '+n+(i.classes?" "+i.classes:"")+'"'+(i.attrs?" "+i.attrs:"")+' data-dialog-action="'+e+'"'+(["confirm","close","remove"].includes(e)?" data-dialog-"+e:"")+">\n "+o+"\n </button>\n "});return'\n <div class="dialog-footer">\n '+(i.length>2?"\n "+i[0]+'\n <div class="spacer"></div>\n '+i[1]+"\n "+i.slice(2).join("\n")+"\n ":i.join("\n"))+"\n </div>\n "}return""},o._renderHeader=function(t){var e,i,n,o='\n <button type="button" data-dialog-action="close" class="dialog-header-close">\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ';return"function"==typeof t.header?t.header():""!==t.header&&!1!==t.header&&!0!==t.header?t.header:!0===t.header?'\n <div class="dialog-header">\n <span class="dialog-title">\n '+(e=t.title,i=document.createTextNode(e),(n=document.createElement("p")).appendChild(i),n.innerHTML+"\n </span>\n ")+o+"\n </div>\n ":'<div class="dialog-header">'+o+"</div>"},o._renderTemplate=function(t){var e=t.classes?" "+t.classes:"",i=t.centered?" dialog-centered":"",n=t.size?" dialog-"+t.size:"",o=t.overflowVisible?" dialog-overflow-visible":"",s=' data-dialog-uuid="'+t.uuid+'"',a=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',r=t.maxBodyHeight?' style="--cool-dialog-body-height: '+t.maxBodyHeight+'px"':"",l="function"==typeof t.body?t.body():t.body,c=this._renderFooter(t);return'\n <div class="dialog'+e+i+n+o+'"'+s+a+'>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n '+this._renderHeader(t)+'\n\n <div class="dialog-body"'+r+">\n\n "+l+"\n\n </div>\n\n "+c+"\n\n </div>\n\n </div>\n\n </div>\n "},n}(o);tt.NAME="coolDialog",tt.DEFAULTS=((J={title:"",template:"",body:"",footer:!0,header:!0,size:"",classes:"",centered:!0,backdrop:!0,preventScroll:!0,closeBtn:!0,animation:!0,animationIn:"zoomIn",animationOut:"fadeOut",animationSpeed:"fastest",maxBodyHeight:null,overflowVisible:!1,onInitialize:null,onDestroy:null,onInit:null}).onDestroy=null,J.onShow=null,J.onClose=null,J.callbacks={},J.actions={},J),tt._jQueryInit(),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};var et=function(){function t(){}return t.refresh=function(){this._sectionInstance&&this._sectionInstance.refresh&&this._sectionInstance.refresh(),q.initializeElements('[data-toggle="popover"]',window.Cool.settings.popover),U.initializeElements('[data-toggle="select"]',window.Cool.settings.select),B.initializeElements('[data-toggle="dropdown"]',window.Cool.settings.dropdown),K.initializeElements('[data-toggle="tooltip"]',window.Cool.settings.tooltip),Q.initializeElements('[data-toggle="collapse"]',window.Cool.settings.collapse),G.initializeElements('[data-toggle="section-tabs"]',window.Cool.settings.sectionTabs)},t.initialize=function(t){void 0===t&&(t={}),window.Cool.settings=t,this._sectionInstance||(this._sectionInstance=new s(t.section)),q.initializeElements('[data-toggle="popover"]',t.popover),U.initializeElements('[data-toggle="select"]',t.select),B.initializeElements('[data-toggle="dropdown"]',t.dropdown),K.initializeElements('[data-toggle="tooltip"]',t.tooltip),Q.initializeElements('[data-toggle="collapse"]',t.collapse),G.initializeElements('[data-toggle="section-tabs"]',t.sectionTabs);var e=document.querySelector(".sidebar-left");e&&(this._sidebarInstance=new z(e,t.sidebar)),new Z(document.body,t.toast),new tt(document.body,t.dialog)},t.initComponent=function(t){if(t){var e=Array.isArray(t)?t:[t],i=[],n=[];e.forEach(function(t){var e="string"==typeof t?document.querySelector(t):t;if(e){var i=e.querySelectorAll("[data-toggle]");(e.hasAttribute("data-toggle")?[e].concat(Array.from(i)):Array.from(i)).forEach(function(t){n.push(t)})}});var o=[],s=[];n.forEach(function(t){var e=t.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0?o.push(t):s.push(t)});var a=[].concat(o,s),r=0,l=function(){a.slice(r,r+10).forEach(function(t){var e=null;switch(t.getAttribute("data-toggle")){case"popover":e=q.initializeElement(t,window.Cool.settings.popover);break;case"select":e=U.initializeElement(t,window.Cool.settings.select);break;case"dropdown":e=B.initializeElement(t,window.Cool.settings.dropdown);break;case"tooltip":e=K.initializeElement(t,window.Cool.settings.tooltip);break;case"collapse":e=Q.initializeElement(t,window.Cool.settings.collapse);break;case"section-tabs":e=G.initializeElement(t,window.Cool.settings.sectionTabs)}e&&i.push(e)}),(r+=10)<a.length&&("requestIdleCallback"in window?requestIdleCallback(l,{timeout:50}):setTimeout(l,0))};return o.length>0?l():"requestIdleCallback"in window?requestIdleCallback(l,{timeout:100}):l(),i}},t.destroy=function(){this._sidebarInstance&&(this._sidebarInstance.destroy(),this._sidebarInstance=null),this._sectionInstance&&(this._sectionInstance.destroy(),this._sectionInstance=null)},t.observeResize=function(t,e){if(t&&"function"==typeof e)return N.observe(t,e);console.warn("Cool.observeResize requires an element and a callback function")},t.unobserveResize=function(t){t?N.unobserve(t):console.warn("Cool.unobserveResize requires an element")},t.addScrollListener=function(t,e){t&&"function"==typeof e?W.add(t,e):console.warn("Cool.addScrollListener requires an id and a callback function")},t.removeScrollListener=function(t){t?W.remove(t):console.warn("Cool.removeScrollListener requires an id")},t.getSidebar=function(){return this._sidebarInstance},t.getSection=function(){return this._sectionInstance},t}();et._sidebarInstance=null,et._sectionInstance=null,window.Cool.initialize=et.initialize.bind(et),window.Cool.initComponent=et.initComponent.bind(et),window.Cool.refresh=et.refresh.bind(et),window.Cool.destroy=et.destroy.bind(et),window.Cool.observeResize=et.observeResize.bind(et),window.Cool.unobserveResize=et.unobserveResize.bind(et),window.Cool.addScrollListener=et.addScrollListener.bind(et),window.Cool.removeScrollListener=et.removeScrollListener.bind(et),window.Cool.getSidebar=et.getSidebar.bind(et),window.Cool.getSection=et.getSection.bind(et);return{Common:et,Sidebar:z,Popover:q,Select:U,Dropdown:B,Tooltip:K,SectionTabs:G,Collapse:Q,Toast:Z,Dialog:tt}});
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cool=e(t.jQuery)}(this,function(t){"use strict";const e=new WeakMap;class i{static instances=[];static initializeElement(t,i={}){const s="string"==typeof t?document.querySelector(t):t;if(!s)return!1;const n=`plugin_${this.NAME}`;let o=e.has(s)&&e.get(s)[n];if(!o&&"undefined"!=typeof $&&$.fn&&(o=$(s).data(n)),!o){const t=new this(s,i);return e.has(s)||e.set(s,{}),e.get(s)[n]=t,"undefined"!=typeof $&&$.fn&&$(s).data(n,t),this.instances.push(t),t}return!1}static initializeElements(t,e={}){return document.querySelectorAll(t).forEach(t=>{this.initializeElement(t,e)}),this.instances}static getInstance(t){const i=`plugin_${this.NAME}`,s=e.get(t);if(s&&s[i])return s[i];if("undefined"!=typeof $&&$.fn&&$(t).data(i)){const s=$(t).data(i);return e.has(t)||e.set(t,{}),e.get(t)[i]=s,s}return null}static removeInstance(t){const i=`plugin_${this.NAME}`,s=e.get(t);s&&(delete s[i],0===Object.keys(s).length&&e.delete(t)),"undefined"!=typeof $&&$.fn&&$(t).removeData(i)}onInit(){let t=this.opts.onInit;"function"==typeof t&&t.call(this)}onUpdate(){let t=this.opts.onUpdate;"function"==typeof t&&t.call(this)}onDestroy(){let t=this.opts.onDestroy;"function"==typeof t&&t.call(this)}onShow(){let t=this.opts.onShow;"function"==typeof t&&t.call(this)}onClose(){let t=this.opts.onClose;"function"==typeof t&&t.call(this)}onReset(){let t=this.opts.onReset;"function"==typeof t&&t.call(this)}}const s=new class{constructor(){this.callbacks=new WeakMap,this.observer=null,this.rafId=null,this.windowCallbacks=new Set,this.isWindowListening=!1}observe(t,e){this.observer||(this.observer=new ResizeObserver(t=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{t.forEach(t=>{const e=this.callbacks.get(t.target);e&&e(t)})})})),this.callbacks.set(t,e),this.observer.observe(t),this.windowCallbacks.add(e),this.isWindowListening||this.startWindowListening()}unobserve(t){if(this.observer){this.observer.unobserve(t);const e=this.callbacks.get(t);e&&this.windowCallbacks.delete(e),this.callbacks.delete(t),0===this.windowCallbacks.size&&this.stopWindowListening()}}startWindowListening(){this.isWindowListening=!0,window.addEventListener("resize",this.handleWindowResize,{passive:!0})}stopWindowListening(){this.isWindowListening=!1,window.removeEventListener("resize",this.handleWindowResize)}handleWindowResize=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.windowCallbacks.forEach(t=>{t({target:window,contentRect:{width:window.innerWidth,height:window.innerHeight}})})})};disconnect(){this.observer&&(this.observer.disconnect(),this.callbacks=new WeakMap),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.windowCallbacks.clear(),this.stopWindowListening()}},n=new class{constructor(){this.callbacks=new Map,this.rafId=null,this.isListening=!1}add(t,e){this.callbacks.set(t,e),this.isListening||this.startListening()}remove(t){this.callbacks.delete(t),0===this.callbacks.size&&this.stopListening()}startListening(){this.isListening=!0;const t=document.querySelector(".site-main .content");t?(this.scrollElement=t,this.scrollElement.addEventListener("scroll",this.handleScroll,{passive:!0})):(this.scrollElement=window,window.addEventListener("scroll",this.handleScroll,{passive:!0}))}stopListening(){this.isListening=!1,this.scrollElement&&(this.scrollElement.removeEventListener("scroll",this.handleScroll),this.scrollElement=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}handleScroll=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.callbacks.forEach(t=>t())})}},o=function(t,e,i){let s;return function(){let i=this,n=arguments;clearTimeout(s),s=setTimeout(function(){s=null,t.apply(i,n)},e)}},l=function(){let t=!1;return("ontouchstart"in window||navigator.maxTouchPoints>0)&&(t=!0),t},a=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},r=function(t,e){const i=t&&t.jquery?t[0]:t;return i?new Promise(t=>{const s=["animation",e];i.classList.add(...s),i.addEventListener("animationend",function e(n){n.stopPropagation(),i.classList.remove(...s),i.removeEventListener("animationend",e),t()},{once:!0})}):Promise.resolve()},h=t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"}[t]),c=t=>{if("string"!=typeof t){if(null===t)return"";if(!t)return String(t);t=String(t)}return/[&<>"'`=]/.test(t)?t.replace(/[&<>"'`=]/g,h):t};function d(t,...e){for(const i of e)if(i&&"object"==typeof i)for(const e of Object.keys(i)){const s=i[e],n=t[e];s&&"object"==typeof s&&!Array.isArray(s)&&n&&"object"==typeof n&&!Array.isArray(n)?t[e]=d({},n,s):t[e]=s}return t}class u extends i{static NAME="coolSection";static DEFAULTS={observeSections:!0,initFormControls:!0,initTableHandlers:!0,initButtonGroups:!0,initTabs:!0,onInit:null,onDestroy:null};constructor(t){super(),this.opts=d({},u.DEFAULTS,window.Cool?.settings?.section||{},t||{}),this._eventHandlers=[],this._updateTimeout=null,this._rafId=null,this.init()}init(){this.opts.observeSections&&this.initializeSectionObserver(),this.opts.initFormControls&&this.initializeFormControls(),this.opts.initTableHandlers&&this.initializeTableHandlers(),this.opts.initButtonGroups&&this.initializeButtonGroups(),this.opts.initTabs&&this.initializeTabs(),this.onInit()}destroy(){this.destroySectionObserver(),this.unbindEvents(),this._updateTimeout&&clearTimeout(this._updateTimeout),this._rafId&&cancelAnimationFrame(this._rafId),this.onDestroy()}_addEventListener(t,e,i,s){t.addEventListener(e,i,s),this._eventHandlers.push({element:t,event:e,handler:i,options:s})}initializeSectionObserver(){this._isUpdating=!1,this.sectionObserver=new MutationObserver(t=>{if(this._isUpdating)return;t.every(t=>{if("attributes"===t.type&&"class"===t.attributeName){const e=t.target,i=t.oldValue?t.oldValue.split(" "):[],s=Array.from(e.classList);return[...s.filter(t=>!i.includes(t)),...i.filter(t=>!s.includes(t))].every(t=>"is-last-visible"===t||"is-last-visible-row"===t||"is-last-visible-cell"===t)}return!1})||(this._updateTimeout&&clearTimeout(this._updateTimeout),this._updateTimeout=setTimeout(()=>{this._rafId&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this.updateLastVisibleElements()})},50))}),this.sectionObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["class","style","hidden"],attributeOldValue:!0,subtreeFilter:t=>t.classList&&(t.classList.contains("section")||t.classList.contains("select")||"TABLE"===t.nodeName||"TR"===t.nodeName||"TD"===t.nodeName||"TH"===t.nodeName)}),this.updateLastVisibleElements()}updateLastVisibleElements(){this._isUpdating=!0;const t={sections:[],tables:[],rows:[]};document.querySelectorAll(".section").forEach(e=>{const i=this.getVisibleChildren(e);i.length&&t.sections.push({section:e,lastVisible:i[i.length-1]})}),document.querySelectorAll("table").forEach(e=>{const i=e.querySelector("tbody")||e,s=this.getVisibleElements(i.querySelectorAll("tr"));s.length&&t.tables.push({tbody:i,lastVisibleRow:s[s.length-1]})}),document.querySelectorAll("table tr").forEach(e=>{const i=this.getVisibleElements(e.querySelectorAll("td, th"));i.length&&t.rows.push({row:e,lastVisibleCell:i[i.length-1]})}),requestAnimationFrame(()=>{document.querySelectorAll(".is-last-visible, .is-last-visible-row, .is-last-visible-cell").forEach(t=>{t.classList.remove("is-last-visible","is-last-visible-row","is-last-visible-cell")}),t.sections.forEach(({lastVisible:t})=>{t.classList.add("is-last-visible")}),t.tables.forEach(({lastVisibleRow:t})=>{t.classList.add("is-last-visible-row")}),t.rows.forEach(({lastVisibleCell:t})=>{t.classList.add("is-last-visible-cell")}),setTimeout(()=>{this._isUpdating=!1},0)})}getVisibleChildren(t){return Array.from(t.children).filter(t=>this.isElementVisible(t))}getVisibleElements(t){return Array.from(t).filter(t=>this.isElementVisible(t))}isElementVisible(t){return t._computedStyle&&!t._styleInvalidated||(t._computedStyle=window.getComputedStyle(t),t._styleInvalidated=!1),!t.classList.contains("d-none")&&!t.classList.contains("d-md-none")&&null!==t.offsetParent&&t.offsetHeight>0&&"none"!==t._computedStyle.display}destroySectionObserver(){this.sectionObserver&&(this.sectionObserver.disconnect(),this.sectionObserver=null),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=null),this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}initializeFormControls(){this._addEventListener(document,"focusin",t=>{const e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){const t=e.closest(".input-group");t?.classList.add("input-group-focus")}}),this._addEventListener(document,"focusout",t=>{const e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){const t=e.closest(".input-group");t?.classList.remove("input-group-focus")}});const t=t=>{const e=t.querySelector("input, select"),i=!!e?.value;t.classList.toggle("label-on-top",i)};this._addEventListener(document,"input",e=>{const i=e.target.closest(".form-label-group");i&&t(i)}),this._addEventListener(document,"change",e=>{const i=e.target.closest(".form-label-group");i&&t(i),e.target.matches("select")&&e.target.blur()}),document.querySelectorAll(".form-label-group").forEach(t)}initializeTableHandlers(){document.querySelectorAll(".table").forEach(t=>{t.querySelector("[data-table-link], [data-table-btn]")&&!t.classList.contains("table-hover")&&t.classList.add("table-hover")}),this._addEventListener(document,"click",t=>{if(t.target.closest("[data-table-link] .table-link-exclude, [data-table-link] input, [data-table-link] button, [data-table-link] a, [data-table-link] label, [data-table-link] .td-col-select"))return void t.stopPropagation();const e=t.target.closest("[data-table-link]");if(e){const i=e.closest("table, .table"),s=e.dataset.tableLink;if(i?.classList.contains("bulk-actions-active"))return;t.ctrlKey||t.metaKey?window.open(s,"_blank"):window.location.href=s}if(t.target.closest("[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select"))return void t.stopPropagation();const i=t.target.closest("[data-table-btn]");if(i){const t=i.closest("tr, .tr"),e=i.querySelector("button");if(!e||t?.classList.contains("bulk-actions-active"))return;e.click()}})}initializeButtonGroups(){this._addEventListener(document,"click",t=>{const e=t.target.closest(".btn-group-toggle .btn");if(e&&!t.target.matches("input")){const t=e.querySelector("input");t&&(t.click(),t.dispatchEvent(new Event("change",{bubbles:!0})))}t.target.matches(".btn-group-toggle .btn > input")&&t.stopPropagation()}),this._addEventListener(document,"change",t=>{if(t.target.matches('.btn-group-toggle .btn > input[type="radio"]')){const e=t.target.parentElement.closest(".btn-group-toggle");e&&e.querySelectorAll(".btn").forEach(t=>{t.classList.toggle("active",t.querySelector("input")?.checked)})}else if(t.target.matches('.btn-group-toggle .btn > input[type="checkbox"]')){t.target.parentElement.classList.toggle("active",t.target.checked)}})}initializeTabs(){this._addEventListener(document,"click",t=>{const e=t.target.closest(".tabs .tab-item");if(e){t.stopPropagation();e.closest(".tabs").querySelectorAll(".tab-item").forEach(t=>t.classList.remove("active")),e.classList.add("active")}})}unbindEvents(){this._eventHandlers.forEach(({element:t,event:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._eventHandlers=[]}refresh(){document.querySelectorAll(".form-label-group").forEach(t=>{const e=t.querySelector("input, select"),i=e?.value;t.classList.toggle("label-on-top",!!i)})}}let p=null;try{p=require("perfect-scrollbar"),p&&p.default&&(p=p.default)}catch(t){}"undefined"!=typeof window&&p&&!window.PerfectScrollbar&&(window.PerfectScrollbar=p);class m extends i{static NAME="coolSidebar";static DEFAULTS={floating:!0,breakpoint:1046,wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0,onInit:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${m.NAME}`);i||(i=new m(this,"object"==typeof t&&t),e.data(`plugin_${m.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[m.NAME];$.fn[m.NAME]=m._jQueryInterface,$.fn[m.NAME].Constructor=m,$.fn[m.NAME].defaults=m.DEFAULTS||{},$.fn[m.NAME].noConflict=()=>($.fn[m.NAME]=t,m._jQueryInterface)}constructor(t,e){super(),this.opts=d({},m.DEFAULTS,window.Cool?.settings?.sidebar||{},e||{}),this.el=t,t&&t.jquery&&(this.el=t[0]),this.init()}init(){this.buildCache(),this.bindEvents(),this.initializeScrollbars(),this.initializeTabs(),this.onInit()}destroy(){this.unbindEvents(),this.destroyScrollbars(),this.onDestroy()}buildCache(){this.content=this.el.querySelector(".sidebar-content"),this.toggler=document.querySelector(".sidebar-left-toggler"),this.isFloating=this.el.classList.contains("sidebar-floating"),this.isOpen=document.body.classList.contains("sidebar-left-open"),this.tabs=Array.from(this.el.querySelectorAll(".sidebar-tab")),this.tabSelectors=Array.from(document.querySelectorAll('[name="sidebar-tab-select"]'))}bindEvents(){if(this._toggleHandler=t=>{const e=t.target.closest(".sidebar-left-toggler");e&&this.handleToggle(t,e)},this._mousedownHandler=t=>{if(t.target.matches(".sidebar-content .ps__thumb-y")){const e=t.target.closest(".sidebar-content");e?.classList.add("ps-mousedown-scroll"),this.mousedownScrollbar=!0}},this._mouseupHandler=()=>{this.mousedownScrollbar&&(document.querySelectorAll(".sidebar-content.ps-mousedown-scroll").forEach(t=>t.classList.remove("ps-mousedown-scroll")),this.mousedownScrollbar=!1)},this._tabSelectHandler=t=>{t.target.matches('[name="sidebar-tab-select"]')&&this.switchTab(t.target.value)},this._collapseClickHandler=t=>{const e=t.target.closest('[data-toggle="collapse"]');if(!e)return;const i=e.dataset.breakpoint;if(i&&window.matchMedia(`(min-width: ${i}px)`).matches){let i=e.nextElementSibling?.querySelector("li a")||e.parentElement.nextElementSibling?.querySelector("li a");i&&(t.metaKey||t.ctrlKey?window.open(i.href,"_blank").focus():window.location.href=i.href)}else setTimeout(()=>this.scrollbar?.update(),300)},window.ResizeObserver)this.resizeObserver=new ResizeObserver(t=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{window.innerWidth>this.opts.breakpoint&&this.removeBackdrop()})}),this.resizeObserver.observe(document.body);else{let t;this._resizeHandler=()=>{clearTimeout(t);const e=performance.now();!this.lastResizeTime||e-this.lastResizeTime>100?(window.innerWidth>this.opts.breakpoint&&this.removeBackdrop(),this.lastResizeTime=e):t=setTimeout(()=>{window.innerWidth>this.opts.breakpoint&&this.removeBackdrop()},16)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}document.addEventListener("click",this._toggleHandler),document.addEventListener("click",this._tabSelectHandler),document.addEventListener("mousedown",this._mousedownHandler),document.addEventListener("mouseup",this._mouseupHandler),this.content&&this.content.addEventListener("click",this._collapseClickHandler)}unbindEvents(){document.removeEventListener("click",this._toggleHandler),document.removeEventListener("click",this._tabSelectHandler),document.removeEventListener("mousedown",this._mousedownHandler),document.removeEventListener("mouseup",this._mouseupHandler),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this.content&&this.content.removeEventListener("click",this._collapseClickHandler)}initializeScrollbars(){this.content&&(p?this.scrollbar=new p(this.content,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX}):this.content.style.overflowY="auto")}initializeTabs(){this.tabScrollbars=new Map,this.tabs.forEach(t=>{const e=t.querySelector(".tab-content");if(e)if(p){const i=new p(e,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX});this.tabScrollbars.set(t,i)}else e.style.overflowY="auto"})}destroyScrollbars(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.tabScrollbars.forEach(t=>t.destroy()),this.tabScrollbars.clear()}toggleWithTransition(t){const e=document.documentElement;e.classList.add("sidebar-transitioning"),"open"===t?(document.body.classList.add("sidebar-left-open"),this.isFloating&&window.innerWidth<=this.opts.breakpoint&&this.createBackdrop()):(document.body.classList.remove("sidebar-left-open"),this.removeBackdrop()),setTimeout(()=>{e.classList.remove("sidebar-transitioning")},330)}createBackdrop(){if(document.querySelector(".sidebar-backdrop"))return;const t=document.createElement("div");t.className="sidebar-backdrop",t.addEventListener("click",()=>{this.toggleWithTransition("close"),this.toggler&&(this.toggler.classList.remove("open"),null!==this.toggler.ariaExpanded&&(this.toggler.ariaExpanded="false"))});const e=document.querySelector(".site-main");e&&(e.appendChild(t),requestAnimationFrame(()=>{t.classList.add("show")}))}removeBackdrop(){const t=document.querySelector(".sidebar-backdrop");t&&(t.classList.remove("show"),t.addEventListener("transitionend",()=>{t.remove()},{once:!0}),setTimeout(()=>{t?.remove()},330))}handleToggle(t,e){if(t.stopPropagation(),!e)return;null!==e.ariaExpanded&&(e.ariaExpanded="true"!==e.ariaExpanded),e.classList.toggle("open");const i=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(i?"close":"open"),i?this.onClose():this.onShow()}switchTab(t){const e=document.getElementById(`sidebar-tab-${t}`);if(!e)return;const i=this.tabs;i.forEach(t=>{if(t.classList.toggle("active",t===e),t!==e){const s=t.querySelector(".tab-content");if(s)if(t===i[0])s.style.transform="translate3d(100%, 0px, 0px)";else if(t===i[i.length-1])s.style.transform="translate3d(-100%, 0px, 0px)";else{const n=i.indexOf(t)<i.indexOf(e);s.style.transform=`translate3d(${n?"-100%":"100%"}, 0px, 0px)`}}});const s=e.querySelector(".tab-content");s&&(s.style.transform="none"),this.tabSelectors.forEach(e=>{e.classList.toggle("active",e.value===t)})}toggle(){const t=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(t?"close":"open")}open(){document.body.classList.contains("sidebar-left-open")||this.toggleWithTransition("open")}close(){document.body.classList.contains("sidebar-left-open")&&this.toggleWithTransition("close")}}m._jQueryInit();class f extends i{static NAME="coolPopover";static DEFAULTS={container:"body",containerAutoDetect:!1,trigger:"focus",placement:"bottom",align:"center",offset:null,collisionDetection:!0,title:"",content:"",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${f.NAME}`);i||(i=new f(this,"object"==typeof t&&t),e.data(`plugin_${f.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[f.NAME];$.fn[f.NAME]=f._jQueryInterface,$.fn[f.NAME].Constructor=f,$.fn[f.NAME].defaults=f.DEFAULTS||{},$.fn[f.NAME].noConflict=()=>($.fn[f.NAME]=t,f._jQueryInterface)}constructor(t,e){super(),this.opts=d({},f.DEFAULTS,window.Cool?.settings?.popover||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.popoverEl&&(this.popoverEl.remove(),this.popoverEl=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.popoverEl&&this.setPosition(),this.onUpdate()}buildCache(){this.containerEl=this.el.dataset.container?document.querySelector(this.el.dataset.container):document.querySelector(this.opts.container),this.containerAutoDetect=void 0!==this.el.dataset.containerAutoDetect?this.el.dataset.containerAutoDetect:void 0!==this.el.dataset.containerautodetect?this.el.dataset.containerautodetect:this.opts.containerAutoDetect,this.id="popover-"+a(),this.trigger=this.el.dataset.trigger||this.opts.trigger,this.placement=this.el.dataset.placement||this.opts.placement,this.align=this.el.dataset.align||this.opts.align,this.title=this.el.dataset.title||this.opts.title,this.content=this.el.dataset.content||this.opts.content,this.offset=this.el.dataset.offset||this.opts.offset,this.collisionDetection="false"!==(this.el.dataset.collisionDetection||this.el.dataset.collisiondetection)&&(this.el.dataset.collisionDetection||this.el.dataset.collisiondetection||this.opts.collisionDetection),this.containerAutoDetect&&(this.containerEl=this.el.offsetParent||document.body)}bindEvents(){"click"===this.trigger?(this._clickHandler=()=>{this.popoverEl?this.close():this.show()},this.el.addEventListener("click",this._clickHandler)):"hover"===this.trigger?(this._mouseenterHandler=()=>{clearTimeout(this.hoverTimeout),this.show()},this._mouseleaveHandler=()=>{this.hoverTimeout=setTimeout(()=>{this.popupHasFocus||this.close()},100)},this.el.addEventListener("mouseenter",this._mouseenterHandler),this.el.addEventListener("mouseleave",this._mouseleaveHandler)):"focus"===this.trigger&&(this._focusinHandler=()=>this.show(),this._focusoutHandler=()=>this.close(),this.el.addEventListener("focusin",this._focusinHandler),this.el.addEventListener("focusout",this._focusoutHandler)),window.ResizeObserver&&(this._resizeCallback=()=>{this.popoverEl&&this.popoverEl.classList.contains("show")&&requestAnimationFrame(()=>{this.setPosition()})},s.observe(this.el,this._resizeCallback))}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this._mouseenterHandler&&this.el.removeEventListener("mouseenter",this._mouseenterHandler),this._mouseleaveHandler&&this.el.removeEventListener("mouseleave",this._mouseleaveHandler),this._focusinHandler&&this.el.removeEventListener("focusin",this._focusinHandler),this._focusoutHandler&&this.el.removeEventListener("focusout",this._focusoutHandler),this._resizeCallback&&(s.unobserve(this.el),this._resizeCallback=null)}buildPopover(){let t;t="function"==typeof this.content?this.content():this.content,this.popoverEl=document.createElement("div"),this.popoverEl.className="popover",this.popoverEl.setAttribute("role","tooltip"),this.popoverEl.id=this.id,this.popoverEl.innerHTML=`\n <h3 class="popover-header">${this.title}</h3>\n <div class="popover-body">${t}</div>\n `,this.containerEl.appendChild(this.popoverEl),this.popoverEl.addEventListener("mouseenter",()=>{this.popupHasFocus=!0,"hover"===this.trigger&&this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),this.popoverEl.addEventListener("mouseleave",()=>{this.popupHasFocus=!1,"hover"===this.trigger&&(this.hoverTimeout=setTimeout(()=>{this.close()},100))})}setPosition(t){"undefined"!=typeof t&&null!==t||(t=this.placement);const e=window.innerWidth,i=window.innerHeight,s=this.popoverEl.offsetWidth,n=this.popoverEl.offsetHeight,o=this.el.offsetWidth,l=this.el.offsetHeight;let a,r;const h=this.containerEl.getBoundingClientRect(),c=h.left+window.scrollX,d=h.top+window.scrollY,u=this.el.getBoundingClientRect(),p=u.left+window.scrollX,m=u.top+window.scrollY;a=p-c,r=m-d;let f=0,b=0,g=0,y=0;if(this.offset){const t=this.offset.split(",");g=parseInt(t[0],10)||0,y=parseInt(t[1],10)||0}const E=getComputedStyle(this.popoverEl),w=parseInt(E.getPropertyValue("--cool-popover-spacer"))||8,v=(t,e=this.align)=>{let i=0,h=0;switch(t){case"top":i="end"===e?a+o-s:"center"===e?a+(o-s)/2:a,h=r-n-w;break;case"bottom":i="end"===e?a+o-s:"center"===e?a+(o-s)/2:a,h=r+l+w;break;case"left":i=a-s-w,h="end"===e?r+l-n:"center"===e?r+(l-n)/2:r;break;case"right":i=a+o+w,h="end"===e?r+l-n:"center"===e?r+(l-n)/2:r}return{x:i+g,y:h+y}};let C=t,_=this.align,S=v(t);if(this.collisionDetection){const o=5,l=t=>{const l={top:!1,bottom:!1,left:!1,right:!1},a=c+t.x,r=d+t.y,h=a+s,u=r+n;return l.top=r<o,l.bottom=u>i-o,l.left=a<o,l.right=h>e-o,l},a=l(S);"bottom"===t&&a.bottom&&!a.top?(C="top",S=v("top",_)):"top"===t&&a.top&&!a.bottom?(C="bottom",S=v("bottom",_)):"right"===t&&a.right&&!a.left?(C="left",S=v("left",_)):"left"===t&&a.left&&!a.right&&(C="right",S=v("right",_));const r=l(S);"top"!==C&&"bottom"!==C||("end"===_&&r.left&&!r.right?(_="start",S=v(C,_)):"start"===_&&r.right&&!r.left&&(_="end",S=v(C,_)));const h=l(S);h.left?S.x+=o-(c+S.x):h.right&&(S.x-=c+S.x+s-(e-o)),h.top?S.y+=o-(d+S.y):h.bottom&&(S.y-=d+S.y+n-(i-o))}f=S.x,b=S.y,Object.assign(this.popoverEl.style,{transform:`translate3d(${Math.round(f)}px, ${Math.round(b)}px, 0px)`,willChange:"transform"}),this.popoverEl.setAttribute("x-placement",C+"-"+_)}show(){this.popoverEl||(this.buildPopover(),this.setPosition(),this.popoverEl.classList.add("show"),this.el.setAttribute("data-popover",this.id),this.onShow())}close(){this.popoverEl&&(this.popoverEl.remove(),this.el.removeAttribute("data-popover"),this.popoverEl=null,this.onClose())}}f._jQueryInit();let b=null;try{b=require("perfect-scrollbar"),b&&b.default&&(b=b.default)}catch(t){}"undefined"!=typeof window&&b&&!window.PerfectScrollbar&&(window.PerfectScrollbar=b);const g=new WeakMap;function y(t){if(!t)return 0;const e=getComputedStyle(t);return t.offsetHeight+parseInt(e.marginTop,10)+parseInt(e.marginBottom,10)}class E extends i{static NAME="coolSelect";static DEFAULTS={name:"",type:"checkbox",labelTemplate:null,confirmCheck:null,confirmUncheck:null,setData:null,scrollContentHeight:300,useNativeScroll:!1,contentWidth:null,faPro:!1,items:[],showSearch:!1,showFooter:!1,searchApi:!1,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onReset:null,onSearch:null,onSelect:null,buildScroll:null,searchPlaceholder:null,btnCloseText:null,dynamicTitle:!1,dynamicTitleDefault:"",dynamicTitleEmptyDefault:"",allowNoneOnRadioSelect:!0,preventUncheck:!1,showValidStateIcon:!0,itemsToExclude:[],primaryKeyword:"id",position:"absolute",scrollEl:".content",useChips:!1};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${E.NAME}`);i||(i=new E(this,"object"==typeof t&&t),e.data(`plugin_${E.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[E.NAME];$.fn[E.NAME]=E._jQueryInterface,$.fn[E.NAME].Constructor=E,$.fn[E.NAME].defaults=E.DEFAULTS||{},$.fn[E.NAME].noConflict=()=>($.fn[E.NAME]=t,E._jQueryInterface)}constructor(t,e){super(),this.opts=d({},E.DEFAULTS,window.Cool?.settings?.select||{},e||{}),this.el=t,this.useChips=!1,this.cachedTitle="",this.lastSearchQuery="",this._resizeCallback=null,this._scrollCallback=null,this.init()}init(){this.buildCache(),this.buildScroll(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.bindEvents();let t=Promise.resolve();return this.searchApi&&this.searchApi.length&&(t=this._performInitialSearch()),t.then(()=>{this.onUpdate()})}reset(){this.data={},this.data[this.name]=[],this.items=[],this.selectEl.querySelectorAll(".select-item").forEach(t=>t.remove()),this.selectItems=[],this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.selectHeaderEl.classList.remove("select-placeholder"),"function"==typeof this.dynamicTitle?this.selectTitleEl.textContent=this.dynamicTitle.call(this):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.selectTitleEl.textContent.trim()&&(this.selectItems.length>0||this.searchApi)&&(this.selectTitleEl.textContent=this.dynamicTitleDefault),0==this.selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.selectHeaderEl.classList.add("select-placeholder"),this.selectIconContainerEl&&this.selectIconContainerEl.classList.add("d-none"),this.selectTitleEl.textContent=this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchData=[],this.searchInputEl.value="",this.searchString="",this.search.call(this))}buildCache(){if(this.containerEl=this.el.parentElement,this.selectHeaderEl=this.el.querySelector(".select-header"),this.selectTitleEl=this.el.querySelector(".select-title"),this.cachedTitle=this.selectTitleEl?this.selectTitleEl.textContent:"",this.selectIconContainerEl=this.selectHeaderEl?this.selectHeaderEl.querySelector(".select-icon"):null,this.searchIconContainerEl=this.el.querySelector(".select-search-icon"),this.selectIconDefault=this.selectIconContainerEl?this.selectIconContainerEl.innerHTML:'<i class="'+(this.opts.faPro?"fal":"fas")+'fa-angle-down icon"></i>',this.name=this.el.dataset.name||this.opts.name,this.scroll=null,this.scrollContentHeight=this.el.dataset.scrollContentHeight||this.el.dataset.scrollcontentheight||this.opts.scrollContentHeight,this.useNativeScroll=this.el.dataset.useNativeScroll||this.el.dataset.usenativescroll||this.opts.useNativeScroll,this.contentWidth=this.el.dataset.contentWidth||this.el.dataset.contentwidth||this.opts.contentWidth,this.items=this.el.dataset.items?JSON.parse(this.el.dataset.items):this.opts.items,this.data={},this.data[this.name]=[],this.searchData=[],this.searchApi=this.el.dataset.searchApi||this.el.dataset.searchapi||this.opts.searchApi,this.searchRequest=null,this.type=this.el.dataset.type||this.opts.type,this.contentOpen=this.el.classList.contains("show"),this.searchPlaceholder=this.el.dataset.searchPlaceholder||this.opts.searchPlaceholder,this.btnCloseText=this.el.dataset.btnCloseText||this.opts.btnCloseText,this.labelTemplate=this.opts.labelTemplate,this.confirmCheck=this.opts.confirmCheck,this.confirmUncheck=this.opts.confirmUncheck,this.preventUncheck=this.el.dataset.preventUncheck||this.el.dataset.preventuncheck||this.opts.preventUncheck,this.dynamicTitle=this.el.dataset.dynamicTitle||this.el.dataset.dynamictitle||this.opts.dynamicTitle,this.dynamicTitleDefault=this.el.dataset.dynamicTitleDefault||this.el.dataset.dynamictitledefault||this.opts.dynamicTitleDefault,this.dynamicTitleEmptyDefault=this.el.dataset.dynamicTitleEmptyDefault||this.el.dataset.dynamictitleemptydefault||this.opts.dynamicTitleEmptyDefault,this.allowNoneOnRadioSelect=this.el.dataset.allowNoneOnRadioSelect||this.el.dataset.allowneonradioselect||this.opts.allowNoneOnRadioSelect,this.showValidStateIcon=this.el.dataset.showValidStateIcon||this.el.dataset.showvalidstateicon||this.opts.showValidStateIcon,this.itemsToExclude=this.el.dataset.itemsToExclude||this.el.dataset.itemstoexclude?(this.el.dataset.itemsToExclude||this.el.dataset.itemstoexclude).replace(/\s/g,"").split(","):this.opts.itemsToExclude,this.primaryKeyword=this.el.dataset.primaryKeyword||this.el.dataset.primarykeyword||this.opts.primaryKeyword,this.useChips=this.el.dataset.useChips||this.el.dataset.usechips||this.opts.useChips,this.position=this.el.dataset.position||this.opts.position,this.useChips&&(this.showValidStateIcon=!1),this.preventClose=!1,this.itemsToExclude.length>0&&(this.itemsToExclude=this.itemsToExclude.map(String)),this.opts.setData&&(this.data=this.opts.setData),(this.el.dataset.setData||this.el.dataset.setdata)&&""!=(this.el.dataset.setData||this.el.dataset.setdata))try{this.data=JSON.parse(this.el.dataset.setData||this.el.dataset.setdata)}catch(t){this.data=this.el.dataset.setData||this.el.dataset.setdata}if(!Array.isArray(this.data[this.name])&&""!==this.data[this.name]&&this.data[this.name].length>0){const t=this.data[this.name].toString().trim().split(",");this.data[this.name]=t}if(this.data[this.name].length>0&&!this.useChips&&(this.data[this.name]=this.data[this.name].map(String)),this.data[this.name].length>0&&this.itemsToExclude.length>0&&(this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]?-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString()):-1===this.itemsToExclude.indexOf(t.toString()))),this.data&&this.useChips&&this._renderChips(),this.items.length>0&&this.itemsToExclude.length>0&&(this.items=this.items.filter(t=>t[this.primaryKeyword]?-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString()):-1===this.itemsToExclude.indexOf(t.toString()))),this.el.querySelector(".select-search")?this.showSearch=!0:this.showSearch=this.el.dataset.showSearch||this.el.dataset.showsearch||this.opts.showSearch,this.el.querySelector(".select-footer")?this.showFooter=!0:this.showFooter=this.el.dataset.showFooter||this.el.dataset.showfooter||this.opts.showFooter,this.selectEl=this.el.querySelector(".select-content"),this.selectEl){const t=this.selectEl.querySelectorAll(".select-item");t.length>0&&this.itemsToExclude.length>0&&t.forEach(t=>{const e=t.querySelector("input");e&&this.itemsToExclude.indexOf(e.value)>-1&&t.remove()})}else{let t=this._renderItemList(this.items);const e=document.createElement("div");e.innerHTML=`\n <div class="select-content">\n ${this._renderSearch()}\n <div class="select-scrollable-content"></div>\n ${this._renderFooter()}\n </div>\n `,this.selectEl=e.firstElementChild,this.el.appendChild(this.selectEl);const i=this.selectEl.querySelector(".select-scrollable-content");t.forEach(t=>i.appendChild(t))}if(this.data[this.name].length>0){const t=this.useChips?this.data[this.name].map(t=>t[this.primaryKeyword].toString()):this.data[this.name].map(String);if(this.selectEl.querySelectorAll("input").forEach(e=>{t.includes(e.value)&&(e.checked=!0,"radio"===this.type&&e.classList.add("checked"))}),this.useChips)this._renderChips();else if("radio"===this.type&&"function"!=typeof this.dynamicTitle){const t=this.selectEl.querySelector("input:checked");if(t){const e=t.parentElement.querySelector("[data-label]");e&&(this.selectTitleEl.textContent=e.textContent)}}}this.scrollableContentEl=this.selectEl.querySelector(".select-scrollable-content")||null,this.selectItems=Array.from(this.selectEl.querySelectorAll(".select-item")),this.selectHeaderEl.classList.remove("select-placeholder"),this.searchApi&&this.searchApi.length&&this._performInitialSearch(),"function"==typeof this.dynamicTitle?this.selectTitleEl.textContent=this.dynamicTitle.call(this):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.selectTitleEl.textContent.trim()&&(this.selectItems.length>0||this.searchApi)&&(this.selectTitleEl.textContent=this.dynamicTitleDefault),0==this.selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.selectHeaderEl.classList.add("select-placeholder"),this.selectIconContainerEl&&this.selectIconContainerEl.classList.add("d-none"),this.selectTitleEl.textContent=this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchContainerEl=this.selectEl.querySelector(".select-search"),this.searchInputEl=this.selectEl.querySelector('[name="select-search"]'),this.clearSearchButtonEl=this.selectEl.querySelector("[data-clear-search]"),this.searchInputEl&&(this.searchInputEl.tabIndex=-1)),this.showFooter&&(this.footerContainerEl=this.selectEl.querySelector(".select-footer"),this.closeButtonEl=this.selectEl.querySelector("[data-select-close]"),this.closeButtonEl&&(this.closeButtonEl.tabIndex=-1)),this.buildSearchData()}_updateScrollbarVisibility(){if(this.scroll&&this.scrollableContentEl){const t=this.scrollableContentEl;t.scrollHeight>t.clientHeight?(this.scroll.settings.suppressScrollY=!1,this.scrollableContentEl.classList.add("ps-show-rail-y")):(this.scroll.settings.suppressScrollY=!0,this.scrollableContentEl.classList.remove("ps-show-rail-y")),this.scroll.update()}}_performInitialSearch(){return this.isSearchApiEnabled()?(this._showSpinner(),fetch(this.searchApi).then(t=>t.json()).then(t=>{let e=t.filter(t=>-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString())&&0!=t[this.primaryKeyword]);this.useChips&&this.data[this.name].length>0&&(this.data[this.name].forEach(t=>{const i=e.find(e=>e[this.primaryKeyword].toString()===t[this.primaryKeyword].toString());i&&(t.label=i.label||i.name||i.value)}),this.selectTitleEl.innerHTML="",this.data[this.name].forEach(t=>{const e=document.createElement("span");e.className="chip",e.dataset.value=t[this.primaryKeyword],e.innerHTML=`<span class="chip-title">${c(t.label)}</span>`,e.addEventListener("click",e=>{e.stopPropagation();const i=this.selectEl.querySelector(`input[value="${t[this.primaryKeyword]}"]`);i&&(i.checked=!1,i.dispatchEvent(new Event("change",{bubbles:!0})))}),this.selectTitleEl.appendChild(e)}));let i=this._renderItemList(e);this.scrollableContentEl.innerHTML="",i.forEach(t=>this.scrollableContentEl.appendChild(t)),this.data[this.name].length>0&&this.data[this.name].forEach(t=>{const e=this.useChips?t[this.primaryKeyword].toString():t.toString(),i=this.scrollableContentEl.querySelector(`input[value="${e}"]`);i&&(i.checked=!0,"radio"===this.type&&i.classList.add("checked"))}),this._updateScrollbarVisibility(),this._hideSpinner(),this.useChips&&this.data[this.name].length>0&&this._renderChips(),this.contentOpen&&this._recalculateContentHeight()}).catch(t=>{this._hideSpinner(),this.scrollableContentEl.innerHTML='<div class="p-3 text-danger">Error loading items</div>'})):Promise.resolve()}buildScroll(){if(this.scrollableContentEl){let t=this.scrollContentHeight;this.showSearch&&this.searchContainerEl&&(t-=y(this.searchContainerEl)||0),this.showFooter&&this.footerContainerEl&&(t-=y(this.footerContainerEl)||0);const e=(parseInt(getComputedStyle(this.scrollableContentEl).marginTop,10)||0)+(parseInt(getComputedStyle(this.scrollableContentEl).marginBottom,10)||0),i=this.scrollableContentEl.scrollHeight,s=Math.min(i,t+e);this.scrollableContentEl.style.maxHeight=s+"px",l()?this.scrollableContentEl.style.overflowY="auto":(!1===this.useNativeScroll&&b?(this.scrollableContentEl.classList.add("ps-dark"),this.scroll=new b(this.scrollableContentEl,{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,scrollYMarginOffset:-1,suppressScrollY:!0,suppressScrollX:!0}),setTimeout(()=>{this._updateScrollbarVisibility()},0)):this.scrollableContentEl.style.overflowY="auto",this.scrollableContentEl.querySelectorAll('[tabindex="0"]').forEach(t=>{t.tabIndex=-1}))}}buildSearchData(){this.searchData=[];this.selectEl.querySelectorAll("[data-label]").forEach((t,e)=>{this.searchData.push({id:e,val:t.textContent.trim()})})}bindEvents(){if(this._headerClickHandler=()=>{this.contentOpen?this.close():(this.selectItems.length>0||this.searchApi)&&this.show()},this.selectHeaderEl.addEventListener("click",this._headerClickHandler),this._checkboxChangeHandler=t=>{if(!t.target.matches('input[type="checkbox"]'))return;const e=t.target,i=e.value,s=600;if(this.preventClose=!0,"function"==typeof this.confirmCheck&&e.checked)e.checked=!1,this.confirmCheck(t=>{if("confirmed"==t){if(this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword]===i)){const t=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:i,label:t?t.textContent:i})}}else-1===this.data[this.name].indexOf(i)&&this.data[this.name].push(i);e.checked=!0,this.onSelect(e)}setTimeout(()=>{this.preventClose=!1},s)},e);else if(e.checked){if(this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword]===i)){const t=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:i,label:t?t.textContent:i})}}else-1===this.data[this.name].indexOf(i)&&this.data[this.name].push(i);this.onSelect(e),setTimeout(()=>{this.preventClose=!1},s)}else"function"!=typeof this.confirmUncheck||e.checked?e.checked||this.preventUncheck?!e.checked&&this.preventUncheck&&(e.checked=!0,setTimeout(()=>{this.preventClose=!1},s)):(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]!=i):this.data[this.name]=this.data[this.name].filter(t=>t!=i),this.onSelect(e),setTimeout(()=>{this.preventClose=!1},s)):(e.checked=!0,this.confirmUncheck(t=>{"confirmed"==t&&(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]!=i):this.data[this.name]=this.data[this.name].filter(t=>t!=i),e.checked=!1,this.onSelect(e)),setTimeout(()=>{this.preventClose=!1},s)},e))},this.el.addEventListener("change",this._checkboxChangeHandler),this._radioChangeHandler=t=>{if(!t.target.matches('input[type="radio"]'))return;const e=t.target,i=e.value;if(e.checked){if(this.useChips){const t=e.parentElement.querySelector("[data-label]");this.data[this.name]=[{[this.primaryKeyword]:i,label:t?t.textContent:i}]}else this.data[this.name]=[i];this.data[this.name]=[i],this.selectEl.querySelectorAll('input[type="radio"]').forEach(t=>{t!==e&&(t.checked=!1,t.classList.remove("checked"))})}else this.data[this.name]=[]},this.el.addEventListener("change",this._radioChangeHandler),this._radioClickHandler=t=>{if(!t.target.matches('input[type="radio"]'))return;const e=t.target;if(e.classList.contains("checked")&&this.allowNoneOnRadioSelect&&!this.preventUncheck)this.data[this.name]=[],e.checked=!1,e.classList.remove("checked"),this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitleDefault);else if(e.classList.add("checked"),this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");this.selectTitleEl.textContent=c(t?t.textContent:"")}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(e)),this.onSelect(e)},this.el.addEventListener("click",this._radioClickHandler),this.scroll){const t=this.scrollableContentEl?this.scrollableContentEl.querySelector(".ps__thumb-y"):null;t&&(this._thumbMousedownHandler=()=>{this.scrollableContentEl.classList.add("ps-mousedown-scroll")},t.addEventListener("mousedown",this._thumbMousedownHandler)),this._documentMouseupHandler=()=>{this.scrollableContentEl&&this.scrollableContentEl.classList.contains("ps-mousedown-scroll")&&this.scrollableContentEl.classList.remove("ps-mousedown-scroll")},document.addEventListener("mouseup",this._documentMouseupHandler)}this.showSearch&&(this._searchKeydownHandler=o(()=>{this.searchString=this.searchInputEl.value.trim(),this.search.call(this)},250),this.searchInputEl.addEventListener("keydown",this._searchKeydownHandler),this._searchFocusinHandler=()=>{this.searchContainerEl.classList.add("focused")},this.searchInputEl.addEventListener("focusin",this._searchFocusinHandler),this._searchFocusoutHandler=()=>{this.searchContainerEl.classList.remove("focused")},this.searchInputEl.addEventListener("focusout",this._searchFocusoutHandler),this._clearSearchHandler=t=>{t.target.closest("[data-clear-search]")&&this.searchString.length&&(this.searchInputEl.value="",this.searchString="",this.search.call(this))},this.searchContainerEl.addEventListener("click",this._clearSearchHandler)),this.showFooter&&this.closeButtonEl&&(this._footerCloseHandler=()=>{this.close()},this.closeButtonEl.addEventListener("click",this._footerCloseHandler)),this._documentClickHandler=t=>{this.el.contains(t.target)||!this.contentOpen||this.preventClose||this.close.call(this)},document.addEventListener("touchstart",this._documentClickHandler),document.addEventListener("click",this._documentClickHandler),"fixed"===this.position&&(this._scrollCallback=()=>{this.el&&this.el.classList.contains("show")&&requestAnimationFrame(()=>{const t=this.el.querySelector(".select-content"),e=this.containerEl.getBoundingClientRect();t&&Object.assign(t.style,{top:e.top+"px",left:e.left+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:this.containerEl.offsetWidth+"px"})})},window.ResizeObserver&&(this._resizeCallback=()=>{this.el&&this.el.classList.contains("show")&&requestAnimationFrame(()=>{const t=this.el.querySelector(".select-content"),e=this.containerEl.getBoundingClientRect();t&&Object.assign(t.style,{top:e.top+"px",left:e.left+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:this.containerEl.offsetWidth+"px"})})},s.observe(document.body,this._resizeCallback)))}unbindEvents(){if(this._headerClickHandler&&(this.selectHeaderEl.removeEventListener("click",this._headerClickHandler),this._headerClickHandler=null),this._checkboxChangeHandler&&(this.el.removeEventListener("change",this._checkboxChangeHandler),this._checkboxChangeHandler=null),this._radioChangeHandler&&(this.el.removeEventListener("change",this._radioChangeHandler),this._radioChangeHandler=null),this._radioClickHandler&&(this.el.removeEventListener("click",this._radioClickHandler),this._radioClickHandler=null),this._thumbMousedownHandler){const t=this.scrollableContentEl?this.scrollableContentEl.querySelector(".ps__thumb-y"):null;t&&t.removeEventListener("mousedown",this._thumbMousedownHandler),this._thumbMousedownHandler=null}this._documentMouseupHandler&&(document.removeEventListener("mouseup",this._documentMouseupHandler),this._documentMouseupHandler=null),this._searchKeydownHandler&&(this.searchInputEl.removeEventListener("keydown",this._searchKeydownHandler),this._searchKeydownHandler=null),this._searchFocusinHandler&&(this.searchInputEl.removeEventListener("focusin",this._searchFocusinHandler),this._searchFocusinHandler=null),this._searchFocusoutHandler&&(this.searchInputEl.removeEventListener("focusout",this._searchFocusoutHandler),this._searchFocusoutHandler=null),this._clearSearchHandler&&this.searchContainerEl&&(this.searchContainerEl.removeEventListener("click",this._clearSearchHandler),this._clearSearchHandler=null),this._footerCloseHandler&&this.closeButtonEl&&(this.closeButtonEl.removeEventListener("click",this._footerCloseHandler),this._footerCloseHandler=null),this._documentClickHandler&&(document.removeEventListener("touchstart",this._documentClickHandler),document.removeEventListener("click",this._documentClickHandler),this._documentClickHandler=null),"fixed"===this.position&&(this._scrollCallback&&(n.remove(`select-${this.name}`),this._scrollCallback=null),this._resizeCallback&&(s.unobserve(document.body),this._resizeCallback=null))}getData(t){return t?this.data[t]:this.data}setData(){let t=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${t} fa-check text-success icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.useChips&&(this.selectTitleEl.innerHTML=""),this.searchApi.length){let t=this.searchApi,e=this.data[this.name].length,i=0;this.data[this.name].forEach(s=>{t+=encodeURIComponent("#"+s),i++,i!==e&&(t+="+")}),fetch(t).then(t=>t.json()).then(t=>{let e=t.map(t=>t.id.toString());this.data[this.name]=this.data[this.name].filter(t=>this.useObjects?e.indexOf(t[this.primaryKeyword].toString())>-1:e.indexOf(t.toString())>-1),0==this.data[this.name].length&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault);const i=t.filter(t=>this.useObjects?this.data[this.name].findIndex(e=>e[this.primaryKeyword]==t.id)>-1&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id:this.data[this.name].indexOf(t.id)>-1&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id);this._renderItemList(i).forEach(t=>this.scrollableContentEl.appendChild(t));let s=Array.from(this.scrollableContentEl.querySelectorAll("input"));if(this._updateScrollbarVisibility(),this.scrollableContentEl.querySelector('input[type="checkbox"]')?this.type="checkbox":this.scrollableContentEl.querySelector('input[type="radio"]')&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(t=>{let e=this.useObjects?t[this.primaryKeyword].toString():t.toString(),i=s.find(t=>t.value==e);i&&(i.checked=!0,this.useChips&&this._renderChips(),this.onSelect(i))});else if("radio"==this.type){const t=this.data[this.name][0];let e=s.find(e=>e.value==t);if(e){if(e.checked=!0,e.classList.add("checked"),this.useChips)this._renderChips();else if(this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");t&&(this.selectTitleEl.textContent=t.textContent)}this.onSelect(e)}}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(this))})}else{let t=Array.from(this.scrollableContentEl.querySelectorAll("input")),e=t.map(t=>t.value.toString());if(this.data[this.name]=this.data[this.name].filter(t=>e.indexOf(t.toString())>-1),0==this.data[this.name].length&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.scrollableContentEl.querySelector('input[type="checkbox"]')?this.type="checkbox":this.scrollableContentEl.querySelector('input[type="radio"]')&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(e=>{let i=t.find(t=>t.value==e);i&&(i.checked=!0,this.useChips&&this._renderChips(),this.onSelect(i))});else if("radio"==this.type){let e=t.find(t=>t.value==this.data[this.name][0]);if(e){if(e.checked=!0,e.classList.add("checked"),this.useChips)this._renderChips();else if(this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");t&&(this.selectTitleEl.textContent=t.textContent)}this.onSelect(e)}}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(this))}}_renderChips(){this.selectTitleEl.innerHTML="",0!==this.data[this.name].length?(this.data[this.name].forEach(t=>{const e=this.useChips?t[this.primaryKeyword]:t,i=this.selectEl?this.selectEl.querySelector(`input[value="${e}"]`):null,s=i?i.parentElement.querySelector("[data-label]"):null,n=s?s.textContent:t.label||t.name||t.value||e,o=document.createElement("span");o.className="chip",o.dataset.value=e,o.innerHTML=`<span class="chip-title">${c(n)}</span>`,o.addEventListener("click",i=>{i.stopPropagation();const s=this.selectEl.querySelector(`input[value="${e}"]`);s?(s.checked=!1,s.dispatchEvent(new Event("change",{bubbles:!0}))):(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==e.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==e.toString()),this.searchApi.length&&(this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==e.toString())),this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(this,t,this,!1))}),this.selectTitleEl.appendChild(o)}),this.contentOpen&&setTimeout(()=>{this._updateScrollbarVisibility()},0)):this.dynamicTitle&&this.dynamicTitleDefault?this.selectTitleEl.textContent=this.dynamicTitleDefault:this.selectTitleEl.textContent=this.cachedTitle}search(){let t=this.opts.faPro?"fal":"fas";if(this.searchString.length)if(this.isSearchApiEnabled()){if(this.searchString===this.lastSearchQuery)return;this.lastSearchQuery=this.searchString,this._showSpinner(),this._searchAbortController&&this._searchAbortController.abort(),clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=setTimeout(()=>{this._searchAbortController=new AbortController,fetch(this.searchApi+this.searchString,{signal:this._searchAbortController.signal}).then(t=>t.json()).then(e=>{this._searchAbortController=null,this.scrollableContentEl.querySelectorAll("input:not(:checked)").forEach(t=>{const e=t.closest(".select-item");e&&!e.classList.contains("static-item")&&e.remove()});const i=e.filter(t=>this.useObjects?-1===this.data[this.name].findIndex(e=>e[this.primaryKeyword]==t.id)&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id:-1===this.data[this.name].indexOf(t.id)&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id);this._renderItemList(i).forEach(t=>this.scrollableContentEl.appendChild(t)),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-times icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search","true"),this._updateScrollbarVisibility(),this.contentOpen&&this._recalculateContentHeight()}).catch(t=>{"AbortError"!==t.name&&this._hideSpinner()})},300)}else{const e=this.searchString.toLowerCase();let i=this.searchData.filter(t=>t.val.toLowerCase().indexOf(e)>-1);this.selectItems.forEach(t=>{t.classList.remove("d-none"),t.classList.remove("visible")}),i.forEach(t=>{this.selectItems[t.id]&&this.selectItems[t.id].classList.add("visible")}),this.selectItems.filter(t=>!t.classList.contains("visible")).forEach(t=>t.classList.add("d-none")),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-times icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search","true")}else this.lastSearchQuery="",this.isSearchApiEnabled()?(this.scrollableContentEl.querySelectorAll("input:not(:checked)").forEach(t=>{const e=t.closest(".select-item");e&&!e.classList.contains("static-item")&&e.remove()}),this._hideSpinner(),this.searchIconContainerEl.setAttribute("data-clear-search",""),this._performInitialSearch()):(this.selectItems.forEach(t=>{t.classList.remove("d-none"),t.classList.remove("visible")}),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-search icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search",""));this.scroll&&this.scroll.update(),this.onUpdate()}_recalculateContentHeight(){const t=this.el.querySelector(".select-content"),e=y(this.selectHeaderEl),i=this.scrollContentHeight,s=window.innerHeight,n=window.scrollY;let o=i,l=0,a=0;if(this.searchContainerEl&&(l=y(this.searchContainerEl)||0),this.footerContainerEl&&(a=y(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;o=Math.min(Math.max(t,e)+l+a,i)}let r=this.el.classList.contains("select-dropup"),h=0,c=o;const d=parseInt(getComputedStyle(t).marginBottom||0,10),u=parseInt(getComputedStyle(t).marginTop||0,10);if("fixed"===this.position){const t=this.containerEl.getBoundingClientRect().top,i=s-t-e-50,n=t-50;r?(c=Math.min(o,n),h=t-c-d):(c=Math.min(o,i),h=t+e+u)}else{const t=this.containerEl.getBoundingClientRect().top+n,i=s-(t-n)-e-50,l=t-n-50;r?(c=Math.min(o,l),h=-c-d):(c=Math.min(o,i),h=e+u)}const p=c-l-a;t.style.height=c+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=p+"px"),t.style.top=h+"px",this.scroll&&setTimeout(()=>{this._updateScrollbarVisibility()},0)}show(){if(this.el.classList.contains("show"))return;let t=0,e=0;if("fixed"===this.position){const i=this.containerEl.getBoundingClientRect();t=i.top,e=i.left}const i=document.querySelectorAll(".select.show");let s=1,o=this.opts.faPro?"fal":"fas";i.length&&(s=parseInt(getComputedStyle(i[0]).zIndex,10)+2),this.el.classList.add("show"),i.length||(s=parseInt(getComputedStyle(this.el).zIndex,10)+1);const l=this.el.querySelector(".select-content"),a=y(this.selectHeaderEl),r=this.scrollContentHeight,h=window.innerHeight,c=window.scrollY;let d=r,u=0,p=0;if(this.searchContainerEl&&(u=y(this.searchContainerEl)||0),this.footerContainerEl&&(p=y(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;d=Math.min(Math.max(t,e)+u+p,r)}let m=!1,f=0,b=d;const g=parseInt(getComputedStyle(l).marginBottom||0,10),E=parseInt(getComputedStyle(l).marginTop||0,10);if("fixed"===this.position){const e=h-t-a-50,i=t-50;m=e<d&&i>e,m?(b=Math.min(d,i),f=t-b-g):(b=Math.min(d,e),f=t+a+E)}else{const t=this.containerEl.getBoundingClientRect().top+c,e=h-(t-c)-a-50,i=t-c-50;m=e<d&&i>e,m?(b=Math.min(d,i),f=-b-g):(b=Math.min(d,e),f=a+E)}const w=b-u-p;l.style.height=b+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=w+"px"),this.el.classList.toggle("select-dropup",m),this.el.classList.toggle("select-dropdown",!m);const v=l.offsetWidth;Object.assign(l.style,{zIndex:s,position:"fixed"===this.position?"fixed":"absolute"});const C=this.containerEl.offsetWidth;"fixed"===this.position?Object.assign(l.style,{top:f+"px",left:e+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:C+"px"}):Object.assign(l.style,{top:f+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:v>C?"var(--cool-select-content-width, auto)":C+"px"}),l.style.minWidth=C+"px",this.scrollableContentEl&&this.scrollableContentEl.offsetHeight<this.scrollableContentEl.scrollHeight&&(this.scrollableContentEl.scrollTop=1,this.scrollableContentEl.scrollTop=0),m?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${o} fa-angle-down icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${o} fa-angle-up icon"></i>`),setTimeout(()=>{this.el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),this.scroll&&this._updateScrollbarVisibility()},300),this.contentOpen=!0,"fixed"===this.position&&this._scrollCallback&&n.add(`select-${this.name}`,this._scrollCallback),this.onShow()}close(){if(!this.preventClose){let t=this.opts.faPro?"fal":"fas";this.el.classList.remove("show"),this.el.classList.remove("select-dropup","select-dropdown"),setTimeout(()=>{this.el.removeAttribute("style")},300),this.data[this.name].length>0&&this.showValidStateIcon?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${t} fa-check text-success icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.contentOpen=!1,"fixed"===this.position&&this._scrollCallback&&n.remove(`select-${this.name}`),this.onClose()}}onSelect(t){const e=t.closest(".select-item"),i=e&&g.get(e)||{},s=t.value;if(this.searchApi.length&&Object.keys(i).length>0)if(t.checked)if(this.items.push(i),this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword].toString()===s.toString())){const e=t.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:s,label:e?e.textContent:s})}}else-1===this.data[this.name].indexOf(s)&&this.data[this.name].push(s);else this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==s.toString()),this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==s.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==s.toString());this.useChips&&this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,t.checked)}getItem(t,e){let i=this.items.filter(i=>i[t]==e)[0];return i||null}getSelectedItems(t){let e=[],i=[],s=this.data[this.name];return Array.isArray(s)?e=s:e.push(s),e=this.useChips?e.map(t=>t[this.primaryKeyword].toString()):e.map(String),this.items.length>0?(i=this.items.filter(t=>e.indexOf(t.id.toString())>-1),t&&(i=i.map(e=>e[t]).filter(t=>null!=t))):i=e,i}getSelectedItem(t){return this.getSelectedItems(t)[0]}_renderItemList(t){if(!t||!t.length)return[];const e=this.data[this.name].map(t=>this.useChips?t[this.primaryKeyword].toString():t.toString()),i=[];for(let s=0;s<t.length;++s){const n=t[s];let o="";"function"==typeof this.labelTemplate?o=this.labelTemplate(n):n.name?o=n.name:n.label?o=n.label:n.value&&(o=n.value);const l=this.useChips?n[this.primaryKeyword]:n.id,a=e.indexOf(l.toString())>-1,r=document.createElement("div");r.innerHTML=this._getItemTemplate(n,s,o,a).trim();const h=r.firstElementChild;g.set(h,n),i.push(h)}return i}_getItemTemplate(t,e,i,s){return`\n <div class="select-item">\n <div class="select-item-${this.type}">\n <div class="form-check">\n <input type="${this.type}"\n id="select-${this.name}-${t.id}"\n value="${t.id}"\n tabindex="-1"\n ${s?"checked":""}>\n <label for="select-${this.name}-${t.id}">\n <span class="form-check-icon">\n <svg viewBox="0 0 18 18">\n <polyline points="1.5 6 4.5 9 10.5 1"></polyline>\n </svg>\n </span>\n <span class="form-check-label"${"function"!=typeof this.labelTemplate?" data-label":""}>\n ${"function"!=typeof this.labelTemplate?c(i):i}\n </span>\n </label>\n </div>\n </div>\n </div>`}_renderSearch(){if(this.showSearch){const t=this.opts.faPro?"fal":"fas";return`\n\n <div class="select-search">\n\n <div class="select-search-input">\n\n <input type="text" name="select-search" value="" placeholder="${this.searchPlaceholder}" tabindex="-1">\n\n </div>\n\n <div class="select-search-icon">\n\n <i class="${t} fa-search icon"></i>\n\n </div>\n\n </div>\n\n `}return""}_renderFooter(){return this.showFooter?`\n\n <div class="select-footer">\n\n <button class="btn btn-block btn-light btn-sm" type="button" tabindex="-1" data-select-close >\n ${this.btnCloseText}\n </button>\n\n </div>\n\n `:""}isSearchApiEnabled(){return this.searchApi&&this.searchApi.length}_showSpinner(){let t=this.opts.faPro?"fal":"fas";this.searchIconContainerEl.innerHTML=`<i class="${t} fa-spinner-third fa-spin icon"></i>`}_hideSpinner(){let t=this.opts.faPro?"fal":"fas";this.searchIconContainerEl.innerHTML=`<i class="${t} fa-search icon"></i>`}selectItem(t){const e=this.selectEl.querySelector(`input[value="${t}"]`);if(e){if("radio"===this.type)if(this.selectEl.querySelectorAll('input[type="radio"]').forEach(t=>{t.checked=!1,t.classList.remove("checked")}),this.useChips){const i=e.parentElement.querySelector("[data-label]");this.data[this.name]=[{[this.primaryKeyword]:t,label:i?i.textContent:t}]}else this.data[this.name]=[t];else if(this.useChips){if(!this.data[this.name].find(e=>e[this.primaryKeyword].toString()===t.toString())){const i=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:t,label:i?i.textContent:t})}}else-1===this.data[this.name].indexOf(t)&&this.data[this.name].push(t);return e.checked=!0,e.classList.add("checked"),e.dispatchEvent(new Event("change",{bubbles:!0})),!0}return!1}clear(){const t=Array.from(this.selectEl.querySelectorAll("input:checked"));this.selectEl.querySelectorAll("input").forEach(t=>{t.checked=!1,t.classList.remove("checked")}),this.data[this.name]=[],this.useChips?this._renderChips():this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitleDefault||this.cachedTitle),this.showValidStateIcon&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),t.forEach(t=>{const e=t.closest(".select-item"),i=e&&g.get(e)||{};"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,!1)})}}E._jQueryInit();let w=null;try{w=require("perfect-scrollbar"),w&&w.default&&(w=w.default)}catch(t){}"undefined"!=typeof window&&w&&!window.PerfectScrollbar&&(window.PerfectScrollbar=w);class v extends i{static NAME="coolDropdown";static DEFAULTS={animation:!0,animationIn:"zoomIn",animationOut:"zoomOut",animationSpeed:"fastest",offset:null,minWidth:null,closeOnItemClick:!0,positionObserver:!0,content:!1,scroll:!0,scrollContentHeight:100,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onItemClick:null,position:"absolute",placement:"bottom",align:"start"};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${v.NAME}`);i||(i=new v(this,"object"==typeof t&&t),e.data(`plugin_${v.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[v.NAME];$.fn[v.NAME]=v._jQueryInterface,$.fn[v.NAME].Constructor=v,$.fn[v.NAME].defaults=v.DEFAULTS||{},$.fn[v.NAME].noConflict=()=>($.fn[v.NAME]=t,v._jQueryInterface)}constructor(t,e){super(),this.opts=d({},v.DEFAULTS,window.Cool?.settings?.dropdown||{},e||{}),this.el=t,this._resizeCallback=null,this._scrollCallback=null,this.init()}setupResizeHandling(){if(window.ResizeObserver)this._resizeCallback=()=>{this.contentOpen&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition(),this.onUpdate()}))},s.observe(this.el,this._resizeCallback),s.observe(document.body,this._resizeCallback),this.containerEl&&s.observe(this.containerEl,this._resizeCallback);else{let t;this.resizeHandler=()=>{if(!this.contentOpen)return;clearTimeout(t);const e=performance.now();!this.lastResizeTime||e-this.lastResizeTime>100?(this.setPosition(),this.onUpdate(),this.lastResizeTime=e):t=setTimeout(()=>{this.setPosition(),this.onUpdate()},16)},window.addEventListener("resize",this.resizeHandler,{passive:!0})}}setupScrollHandling(){if("fixed"===this.position){this._scrollCallback=()=>{this.contentOpen&&this.dropdownEl.classList.contains("show")&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition(),this.onUpdate()}))},n.add(`dropdown-${this.id}`,this._scrollCallback);let t=this.el.parentElement;for(this.scrollableParents=[];t&&t!==document.body;){const e=getComputedStyle(t).overflowY;if("scroll"===e||"auto"===e){const e=()=>this._scrollCallback();t.addEventListener("scroll",e,{passive:!0}),this.scrollableParents.push({element:t,handler:e})}t=t.parentElement}}}setupVisibilityDetection(){window.IntersectionObserver&&(this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(t=>{!t.isIntersecting&&this.contentOpen&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition()}))})},{threshold:.1,rootMargin:"50px"}),this.intersectionObserver.observe(this.el))}init(){this.buildCache().then(()=>{this.buildScroll(),this.setupVisibilityDetection(),this.bindEvents(),this.onInit()}).catch(()=>{})}destroy(){this.unbindEvents(),this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.dropdownEl&&this.dropdownEl.remove(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){const t=this.scrollableContentEl&&this.scrollableContentEl.classList.contains("ps-dark");this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.unbindEvents(),this.buildCache().then(()=>{t&&this.scrollableContentEl&&this.scrollableContentEl.classList.add("ps-dark"),this.buildScroll(),this.setupVisibilityDetection(),this.bindEvents(),this.onUpdate()}).catch(()=>{})}buildCache(){return new Promise((t,e)=>{this.el.classList.add("dropdown-trigger"),this.containerEl=this.el.closest(".dropdown")||this.el.parentElement,this.id="dropdown-"+a(),this.animation=this.el.dataset.animation||this.opts.animation,this.animationIn=this.el.dataset.animationIn||this.el.dataset.animationin||this.opts.animationIn,this.animationOut=this.el.dataset.animationOut||this.el.dataset.animationout||this.opts.animationOut,this.animationSpeed=this.el.dataset.animationSpeed||this.el.dataset.animationspeed||this.opts.animationSpeed,this.position=this.el.dataset.position||this.opts.position,this.placement=this.el.dataset.placement||this.opts.placement,this.align=this.el.dataset.align||this.opts.align,this.offset=this.el.dataset.offset||this.opts.offset,this.minWidth=this.el.dataset.minWidth||this.el.dataset.minwidth||this.opts.minWidth,this.scroll=this.el.dataset.scroll||this.opts.scroll,this.scrollContentHeight=this.el.dataset.scrollContentHeight||this.opts.scrollContentHeight,this.positionObserver=this.el.hasAttribute("data-position-observer")?JSON.parse(this.el.getAttribute("data-position-observer")):this.opts.positionObserver,this.closeOnItemClick=this.el.dataset.closeOnItemClick||this.el.dataset.closeonitemclick||this.opts.closeOnItemClick,this.preventClose=this.el.dataset.preventClose||this.el.dataset.preventclose||!1,this.content=this.el.dataset.content||this.opts.content,this.contentOpen=!1,this.containerEl.classList.contains("dropup")?this.placement="top":this.containerEl.classList.contains("dropright")?this.placement="right":this.containerEl.classList.contains("dropbottom")?this.placement="bottom":this.containerEl.classList.contains("dropleft")&&(this.placement="left");const i=this.containerEl.querySelector(".dropdown-menu");if("fixed"===this.position&&i){this.dropdownEl=i.cloneNode(!0),this.dropdownEl.id=this.id,this.dropdownEl.classList.remove("show"),this.align=i.classList.contains("dropdown-menu-right")?"end":this.align,document.body.appendChild(this.dropdownEl),i.remove();return this.dropdownEl.querySelectorAll(".dropdown").forEach(t=>{const e=t.querySelector('[data-toggle="dropdown"]'),i=t.querySelector(".dropdown-menu");e&&i&&!v.getInstance(e)&&new v(e,{position:"absolute",closeOnItemClick:!1,positionObserver:!0,onShow:()=>{const t=parseInt(getComputedStyle(this.dropdownEl).zIndex||9999,10);i.style.zIndex=t+1}})}),this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content"),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()}if("function"==typeof this.content){let e="end"===this.opts.align?" dropdown-menu-right":"";const i=document.createElement("div");return i.innerHTML=`<div class="dropdown-menu${e}" id="${this.id}">${this.content()}</div>`,this.dropdownEl=i.firstElementChild,"fixed"===this.position?document.body.appendChild(this.dropdownEl):this.el.insertAdjacentElement("afterend",this.dropdownEl),this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content")||null,this.align=this.dropdownEl.classList.contains("dropdown-menu-right")?"end":this.align,this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()}return this.dropdownEl=this.containerEl.querySelector(".dropdown-menu")||null,this.dropdownEl?(this.align=this.dropdownEl.classList.contains("dropdown-menu-right")?"end":this.align,this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content")||null,this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()):e()})}buildScroll(){this.opts.scroll&&this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=this.scrollContentHeight+"px",l()?this.scrollableContentEl.style.overflowY="auto":w?this.scroll=new w(this.scrollableContentEl,{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,suppressScrollX:!0,scrollYMarginOffset:2}):this.scrollableContentEl.style.overflowY="auto")}bindEvents(){this._triggerClickHandler=()=>{this.contentOpen?this.close():this.show()},this.el.addEventListener("click",this._triggerClickHandler),"fixed"===this.position?(this._dropdownItemHandler=t=>{const e=t.target.closest("a, button, .dropdown-item");e&&e.closest(".dropdown-menu")===this.dropdownEl&&(e.classList.contains("dropdown-trigger")||e.dataset.toggle||(this.closeOnItemClick&&this.close(),this.onItemClick(e,t)))},this.dropdownEl.addEventListener("click",this._dropdownItemHandler)):(this._itemHandlers=[],this.dropdownItems.forEach(t=>{const e=e=>{t.classList.contains("dropdown-trigger")||t.dataset.toggle||(this.closeOnItemClick&&this.close(),this.onItemClick(t,e))};t.addEventListener("click",e),this._itemHandlers.push({el:t,handler:e})})),this._documentClickHandler=t=>{if(!this.contentOpen)return;const e=this.el===t.target||this.el.contains(t.target)||this.dropdownEl===t.target||this.dropdownEl.contains(t.target),i=this.dropdownEl.contains(t.target)&&t.target.closest('[data-toggle="dropdown"]');e||i||this.close()},document.addEventListener("click",this._documentClickHandler,{passive:!0}),document.addEventListener("touchstart",this._documentClickHandler,{passive:!0}),this.setupResizeHandling(),this.setupScrollHandling()}unbindEvents(){this._triggerClickHandler&&(this.el.removeEventListener("click",this._triggerClickHandler),this._triggerClickHandler=null),this._dropdownItemHandler&&this.dropdownEl&&(this.dropdownEl.removeEventListener("click",this._dropdownItemHandler),this._dropdownItemHandler=null),this._itemHandlers&&(this._itemHandlers.forEach(({el:t,handler:e})=>{t.removeEventListener("click",e)}),this._itemHandlers=null),this._resizeCallback&&(s.unobserve(this.el),s.unobserve(document.body),this.containerEl&&s.unobserve(this.containerEl),this._resizeCallback=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._scrollCallback&&(n.remove(`dropdown-${this.id}`),this._scrollCallback=null),this.scrollableParents&&(this.scrollableParents.forEach(({element:t,handler:e})=>{t.removeEventListener("scroll",e)}),this.scrollableParents=[]),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this._documentClickHandler&&(document.removeEventListener("click",this._documentClickHandler),document.removeEventListener("touchstart",this._documentClickHandler),this._documentClickHandler=null)}setPosition(t){"undefined"!=typeof t&&null!==t||(t=this.placement);const e=this.el.getBoundingClientRect(),i=window.innerWidth,s=window.innerHeight,n=!this.dropdownEl.classList.contains("show")&&0===this.dropdownEl.offsetWidth;n&&(this.dropdownEl.style.display="block",this.dropdownEl.style.visibility="hidden");let o,l,a=this.dropdownEl.offsetWidth,r=this.dropdownEl.offsetHeight,h=this.el.offsetWidth,c=this.el.offsetHeight;if("fixed"===this.position)o=e.left+window.scrollX,l=e.top+window.scrollY;else{const t=this.dropdownEl.offsetParent||document.body,i=t.getBoundingClientRect();o=e.left-i.left+t.scrollLeft,l=e.top-i.top+t.scrollTop}let d=0,u=0,p=0,m=0;if(this.offset){const t=this.offset.split(",");p=parseInt(t[0],10)||0,m=parseInt(t[1],10)||0}const f=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cool-dropdown-spacer"))||2,b=(t,e=this.align)=>{let i=0,s=0;switch(t){case"top":i="end"===e?o+h-a:o,s=l-r-f;break;case"bottom":i="end"===e?o+h-a:o,s=l+c+f;break;case"left":i=o-a-f,s=l;break;case"right":i=o+h+f,s=l}return{x:i+p,y:s+m}};let g=t,y=this.align,E=b(t);if(this.positionObserver){const n=5,h=t=>{const h={top:!1,bottom:!1,left:!1,right:!1};if("fixed"===this.position)h.top=t.y<n,h.bottom=t.y+r>s-n,h.left=t.x<n,h.right=t.x+a>i-n;else{const c=e.left+(t.x-o),d=e.top+(t.y-l),u=c+a,p=d+r;h.top=d<n,h.bottom=p>s-n,h.left=c<n,h.right=u>i-n}return h},c=h(E);"bottom"===t&&c.bottom&&!c.top?(g="top",E=b("top",y)):"top"===t&&c.top&&!c.bottom?(g="bottom",E=b("bottom",y)):"right"===t&&c.right&&!c.left?(g="left",E=b("left",y)):"left"===t&&c.left&&!c.right&&(g="right",E=b("right",y));const d=h(E);if("top"!==g&&"bottom"!==g||("end"===y&&d.left&&!d.right?(y="start",E=b(g,y)):"start"===y&&d.right&&!d.left&&(y="end",E=b(g,y))),this.containerEl.classList.remove("dropup","dropbottom","dropleft","dropright"),"top"===g?this.containerEl.classList.add("dropup"):"left"===g?this.containerEl.classList.add("dropleft"):"right"===g?this.containerEl.classList.add("dropright"):this.containerEl.classList.add("dropbottom"),this.dropdownEl.setAttribute("x-placement",g+"-"+y),"fixed"===this.position)E.x=Math.max(n,Math.min(E.x,i-a-n)),E.y=Math.max(n,Math.min(E.y,s-r-n));else{const t=e.left+(E.x-o),h=e.top+(E.y-l);t<n?E.x+=n-t:t+a>i-n&&(E.x-=t+a-i+n),h<n?E.y+=n-h:h+r>s-n&&(E.y-=h+r-s+n)}}if(d=E.x,u=E.y,n&&(this.dropdownEl.style.display="",this.dropdownEl.style.visibility=""),"fixed"===this.position)Object.assign(this.dropdownEl.style,{position:"fixed",top:Math.round(u)+"px",left:Math.round(d)+"px",right:"auto",bottom:"auto",transform:"none",willChange:"auto",zIndex:"9999"});else{const t=this.el.closest(".dropdown, .dropup, .dropleft, .dropright");if(t){const i=t.getBoundingClientRect();let s=e.left-i.left,n=e.top-i.top;switch(g){case"bottom":n+=c+f,"end"===y&&(s=s+h-a);break;case"top":n-=r+f,"end"===y&&(s=s+h-a);break;case"left":s-=a+f;break;case"right":s+=h+f}s+=p,n+=m,Object.assign(this.dropdownEl.style,{position:"absolute",top:Math.round(n)+"px",left:Math.round(s)+"px",right:"auto",bottom:"auto",transform:"none",willChange:"auto"})}}}show(){if(this.dropdownEl&&!this.dropdownEl.classList.contains("show")){if(this.setPosition(),this.animation?(this.dropdownEl.setAttribute("x-placement",this.placement+"-"+this.align),this.dropdownEl.classList.add(this.animationSpeed),r(this.dropdownEl,this.animationIn),this.dropdownEl.classList.add("show"),this.dropdownEl.id=this.id,this.el.setAttribute("data-dropdown",this.id)):(this.dropdownEl.setAttribute("x-placement",this.placement+"-"+this.align),this.dropdownEl.classList.add("show"),this.dropdownEl.id=this.id,this.el.setAttribute("data-dropdown",this.id)),this.opts.scroll&&this.scroll&&this.scrollableContentEl)if(this.scrollableContentEl.offsetHeight,this.animation){const t=getComputedStyle(this.dropdownEl).animationDuration,e=t?1e3*parseFloat(t):300;setTimeout(()=>{this.scroll&&"function"==typeof this.scroll.update&&this.scroll.update()},e)}else requestAnimationFrame(()=>{this.scroll&&"function"==typeof this.scroll.update&&this.scroll.update()});this.contentOpen=!0,this.onShow()}}close(){this.dropdownEl&&!this.preventClose&&(this.animation&&!this.dropdownEl.classList.contains("animation")?r(this.dropdownEl,this.animationOut).then(()=>{this.dropdownEl.classList.remove("show"),this.el.removeAttribute("data-dropdown")}):(this.dropdownEl.classList.remove("show"),this.el.removeAttribute("data-dropdown")),this.contentOpen=!1,this.onClose())}onItemClick(t,e){let i=this.opts.onItemClick;"function"==typeof i&&i.call(t,e,this)}}v._jQueryInit();class C extends i{static NAME="coolTooltip";static DEFAULTS={container:"body",animation:!1,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",placement:"bottom",content:"",trigger:"auto",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${C.NAME}`);i||(i=new C(this,"object"==typeof t&&t),e.data(`plugin_${C.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[C.NAME];$.fn[C.NAME]=C._jQueryInterface,$.fn[C.NAME].Constructor=C,$.fn[C.NAME].defaults=C.DEFAULTS||{},$.fn[C.NAME].noConflict=()=>($.fn[C.NAME]=t,C._jQueryInterface)}constructor(t,e){super(),this.opts=d({},C.DEFAULTS,window.Cool?.settings?.tooltip||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.tooltipEl&&(this.tooltipEl.remove(),this.tooltipEl=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.tooltipEl&&this.setPosition(),this.onUpdate()}buildCache(){this.containerEl=this.el.dataset.container?document.querySelector(this.el.dataset.container):document.querySelector(this.opts.container),this.id="tooltip-"+a(),this.animation=void 0!==this.el.dataset.animation?this.el.dataset.animation:this.opts.animation,this.animationIn=this.el.dataset.animationIn||this.el.dataset.animationin||this.opts.animationIn,this.animationOut=this.el.dataset.animationOut||this.el.dataset.animationout||this.opts.animationOut,this.animationSpeed=this.el.dataset.animationSpeed||this.el.dataset.animationspeed||this.opts.animationSpeed,this.placement=this.el.dataset.placement||this.opts.placement,this.placementChanged=!1,this.content=this.el.dataset.content||this.opts.content,this.trigger=this.el.dataset.trigger||this.opts.trigger}bindEvents(){"auto"===this.trigger&&(this._mouseenterHandler=()=>this.show(),this._mouseleaveHandler=()=>this.close(),this._blurHandler=()=>this.close(),this._clickHandler=()=>this.close(),this.el.addEventListener("mouseenter",this._mouseenterHandler),this.el.addEventListener("mouseleave",this._mouseleaveHandler),this.el.addEventListener("blur",this._blurHandler),this.el.addEventListener("click",this._clickHandler)),window.ResizeObserver&&(this._resizeCallback=()=>{this.tooltipEl&&this.tooltipEl.classList.contains("show")&&requestAnimationFrame(()=>{this.setPosition()})},s.observe(this.el,this._resizeCallback))}unbindEvents(){this._mouseenterHandler&&(this.el.removeEventListener("mouseenter",this._mouseenterHandler),this.el.removeEventListener("mouseleave",this._mouseleaveHandler),this.el.removeEventListener("blur",this._blurHandler),this.el.removeEventListener("click",this._clickHandler)),this._resizeCallback&&(s.unobserve(this.el),this._resizeCallback=null)}buildTooltip(){this.tooltipEl=document.createElement("div"),this.tooltipEl.className="tooltip",this.tooltipEl.setAttribute("role","tooltip"),this.tooltipEl.id=this.id,this.tooltipEl.innerHTML=`\n <div class="arrow"></div>\n <div class="tooltip-inner">${this.content}</div>\n `,this.containerEl.appendChild(this.tooltipEl),this.arrowEl=this.tooltipEl.querySelector(".arrow")}setPosition(t){"undefined"!=typeof t&&null!==t||(t=this.placement),this.tooltipEl.classList.add("tooltip-"+t);const e=this.containerEl.clientWidth,i=this.containerEl.clientHeight,s=this.tooltipEl.offsetWidth,n=this.tooltipEl.offsetHeight,o=this.el.getBoundingClientRect(),l=this.el.offsetWidth,a=this.el.offsetHeight,r=o.left+window.scrollX,h=o.top+window.scrollY,c=this.arrowEl.offsetWidth,d=this.arrowEl.offsetHeight;let u,p,m;"top"===t?(p=Math.round(r-(s-l)/2),m=Math.round(h-n),u=Math.round(s/2-c/2),this.arrowEl.style.left=u+"px"):"right"===t?(p=Math.round(r+l),m=Math.round(h-(n-a)/2),u=Math.round(n/2-d/2),this.arrowEl.style.top=u+"px"):"bottom"===t?(p=Math.round(r-(s-l)/2),m=Math.round(h+a),u=Math.round(s/2-c/2),this.arrowEl.style.left=u+"px"):"left"===t&&(p=Math.round(r-s),m=Math.round(h-(n-a)/2),u=Math.round(n/2-d/2),this.arrowEl.style.top=u+"px"),Object.assign(this.tooltipEl.style,{position:"absolute",top:"0px",left:"0px",transform:`translate3d(${p}px, ${m}px, 0px)`,willChange:"transform"});let f=0;const b={left:this.tooltipEl.offsetLeft,top:this.tooltipEl.offsetTop,right:e-(this.tooltipEl.offsetLeft+s),bottom:i-(this.tooltipEl.offsetTop+n)};let g={left:!1,top:!1,right:!1,bottom:!1};if(b.right<0&&(g.right=!0,f++),b.left<0&&(g.left=!0,f++),b.bottom<0&&(g.bottom=!0,f++),b.top<0&&(g.top=!0,f++),f>0&&(!this.placementChanged&&g.left&&b.right>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("right")):!this.placementChanged&&g.top&&b.top>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")):!this.placementChanged&&g.right&&b.left>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("left")):!this.placementChanged&&g.bottom&&b.top>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!g.left&&!g.right?this.fixTooltipPosition=!0:b.top>b.bottom?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")),this.fixTooltipPosition)){if(g.left){let e=Math.abs(b.left);r>=p+e&&["top","bottom"].indexOf(t)<0?p+=e:(p+=e,u-=e)}if(g.top){let t=Math.abs(b.top);m+=t,u-=t}if(g.right){let e=Math.abs(b.right);r<=p-e&&["top","bottom"].indexOf(t)<0||(p-=e,u+=e)}if(g.bottom){let t=Math.abs(b.bottom);m-=t,u+=t}"top"===t||"bottom"===t?this.arrowEl.style.left=u+"px":this.arrowEl.style.top=u+"px",Object.assign(this.tooltipEl.style,{width:s+"px",transform:`translate3d(${p}px, ${m}px, 0px)`}),this.fixTooltipPosition=!1}}show(){this.tooltipEl||(this.buildTooltip(),this.setPosition(),this.animation?(this.tooltipEl.classList.add(this.animationSpeed),r(this.tooltipEl,this.animationIn),this.tooltipEl.classList.add("show"),this.tooltipEl.id=this.id,this.el.setAttribute("data-tooltip",this.id)):(this.tooltipEl.classList.add("show"),this.tooltipEl.id=this.id,this.el.setAttribute("data-tooltip",this.id)),this.onShow())}close(){this.tooltipEl&&(this.animation&&!this.tooltipEl.classList.contains("animation")?r(this.tooltipEl,this.animationOut).then(()=>{this.tooltipEl&&(this.tooltipEl.remove(),this.el.removeAttribute("data-tooltip"),this.tooltipEl=null,this.placementChanged=!1),this.onClose()}):(this.tooltipEl.remove(),this.el.removeAttribute("data-tooltip"),this.tooltipEl=null,this.placementChanged=!1,this.onClose()))}}C._jQueryInit();class _ extends i{static NAME="coolCollapse";static DEFAULTS={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${_.NAME}`);i||(i=new _(this,"object"==typeof t&&t),e.data(`plugin_${_.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[_.NAME];$.fn[_.NAME]=_._jQueryInterface,$.fn[_.NAME].Constructor=_,$.fn[_.NAME].defaults=_.DEFAULTS||{},$.fn[_.NAME].noConflict=()=>($.fn[_.NAME]=t,_._jQueryInterface)}constructor(t,e){super(),this.opts=d({},_.DEFAULTS,window.Cool?.settings?.collapse||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){const t=this.el.dataset.target||this.opts.target;if(this.target=t?document.querySelector(t):this.el.parentElement?.querySelector(".collapse"),this.breakpoint=this.el.dataset.breakpoint,this.expanded="true"===this.el.getAttribute("aria-expanded"),this.target){this.container=this.target.closest(".section-collapse");const t=this.el.dataset.target?`[data-collapse-indicator="${this.el.dataset.target}"]`:null;this.indicator=t?document.querySelector(t):this.el.parentElement?.querySelector("[data-collapse-indicator]")}}bindEvents(){this._clickHandler=t=>{this.breakpoint&&window.matchMedia(`(min-width: ${this.breakpoint}px)`).matches||(t.preventDefault(),this.toggle())},this.el.addEventListener("click",this._clickHandler)}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler)}toggle(){this.expanded?this.close():this.show()}show(){this.expanded||(this.target.classList.add("show"),this.container&&this.container.classList.add("show"),this.indicator&&this.indicator.classList.add("show"),this.el.setAttribute("aria-expanded","true"),this.expanded=!0,this.onShow())}close(){this.expanded&&(this.target.classList.remove("show"),this.container&&this.container.classList.remove("show"),this.indicator&&this.indicator.classList.remove("show"),this.el.setAttribute("aria-expanded","false"),this.expanded=!1,this.onClose())}}_._jQueryInit();class S extends i{static NAME="coolSectionTabs";static DEFAULTS={onInit:null,onUpdate:null,onDestroy:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${S.NAME}`);i||(i=new S(this,"object"==typeof t&&t),e.data(`plugin_${S.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[S.NAME];$.fn[S.NAME]=S._jQueryInterface,$.fn[S.NAME].Constructor=S,$.fn[S.NAME].defaults=S.DEFAULTS||{},$.fn[S.NAME].noConflict=()=>($.fn[S.NAME]=t,S._jQueryInterface)}constructor(t,e){super(),this.opts=d({},S.DEFAULTS,window.Cool?.settings?.sectionTabs||{},e||{}),this.el=t,this._tabsCache=new WeakMap,this._resizeObserver=null,this._isProcessing=!1,this._rafId=null,this.init()}init(){this.buildCache(),this.bindEvents(),this._rafId=requestAnimationFrame(()=>{this.dropdownContainer&&this.dropdownContainer.classList.add("js-ready"),this.el.classList.add("js-initialized"),this.checkForChanges(),this.onInit()})}destroy(){this.unbindEvents(),this._rafId&&cancelAnimationFrame(this._rafId),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){const t=this.el.closest(".section-tabs");this.dropdownContainer=t?t.querySelector(".dropdown-container"):this.el.querySelector(".dropdown-container"),this.dropdownList=t?t.querySelector(".dropdown-list"):this.el.querySelector(".dropdown-list")}bindEvents(){const t=this.el.closest(".section-tabs"),e=(t?t.closest(".section-header"):null)||t||this.el;window.ResizeObserver?(this._resizeObserver=new ResizeObserver(t=>{this._isProcessing||(this._isProcessing=!0,this._rafId&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this.checkForChanges(),this._isProcessing=!1}))}),this._resizeObserver.observe(e)):(this._resizeHandler=o(()=>{this.checkForChanges()},50),window.addEventListener("resize",this._resizeHandler,{passive:!0}))}unbindEvents(){this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler)}moveToList(t){const e=t.getAttribute("data-uuid"),i=this.el.querySelector(`:scope > .tab-item[data-related-dropdown-item="${e}"]`);i&&(i.removeAttribute("data-related-dropdown-item"),t.remove())}moveToDropdown(t){if(t.hasAttribute("data-related-dropdown-item"))return;if(!this.dropdownList)return;const e=crypto.randomUUID(),i=t.cloneNode(!0),s=i.querySelector(".tab-item-action");s&&s.classList.add("dropdown-item"),i.setAttribute("data-uuid",e),this.dropdownList.appendChild(i),t.setAttribute("data-related-dropdown-item",e)}getTabDimensions(t){if(this._tabsCache.has(t)){return this._tabsCache.get(t)}const e=t.classList.contains("invisible");e&&t.classList.remove("invisible");const i=this.el.closest(".section-tabs")||this.el,s=i.style.overflow;i.style.overflow="visible",i.offsetHeight;const n=t.offsetWidth,o=n+(parseInt(getComputedStyle(t).marginLeft,10)||0)+(parseInt(getComputedStyle(t).marginRight,10)||0);i.style.overflow=s,e&&t.classList.add("invisible");const l={width:n,totalWidth:o};return this._tabsCache.set(t,l),l}availableSpace(){const t=this.el.closest(".section-tabs"),e=t?t.closest(".section-header"):null;let i,s,n;if(e){const o=getComputedStyle(e);if("column"===o.flexDirection){const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0}else{i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0;const t=e.querySelector(".section-search");if(t){i-=t.offsetWidth;i-=parseInt(o.gap,10)||0}}}else{const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0}return i-s-n-(this.dropdownContainer?this.dropdownContainer.classList.contains("visible")?this.dropdownContainer.offsetWidth:40:0)}checkForChanges(){if(!this.dropdownList)return;this._tabsCache=new WeakMap;const t=Array.from(this.el.querySelectorAll(":scope > .tab-item")),e=Array.from(this.dropdownList.children),i=this.availableSpace(),s=parseInt(getComputedStyle(this.el).gap,10)||0;if(window.innerWidth<768&&i<200)return t.forEach(t=>{t.classList.remove("invisible"),t.removeAttribute("data-related-dropdown-item")}),void(this.dropdownContainer&&this.dropdownContainer.classList.remove("visible"));let n=0,o=[],l=[];for(let e=0;e<t.length;e++){const a=t[e],{totalWidth:r}=this.getTabDimensions(a),h=n+r+(e>0?s:0);if(h<=i){n=h,o.push(a);const t=a.getAttribute("data-related-dropdown-item");if(t){const e=this.dropdownList.querySelector(`[data-uuid="${t}"]`);e&&this.moveToList(e)}}else l.push(a)}if(l.forEach((t,e)=>{t.hasAttribute("data-related-dropdown-item")||this.moveToDropdown(t)}),e.length>0&&0===l.length){const t=i-n;for(let i=e.length-1;i>=0;i--){const l=e[i],a=l.getAttribute("data-uuid"),r=this.el.querySelector(`[data-related-dropdown-item="${a}"]`);if(r){const{totalWidth:e}=this.getTabDimensions(r),i=e+(n>0?s:0);if(!(i<=t))break;this.moveToList(l),o.push(r),n+=i}}}t.forEach(t=>{o.includes(t)?t.classList.remove("invisible"):t.classList.add("invisible")});const a=this.dropdownList&&this.dropdownList.children.length>0;this.dropdownContainer&&this.dropdownContainer.classList.toggle("visible",a)}}S._jQueryInit();class L extends i{static NAME="coolToast";static DEFAULTS={title:"",content:"",icon:"",action:null,template:"",placement:"top-right",animation:!0,animationIn:null,animationOut:null,animationSpeed:"faster",offsetX:null,offsetY:null,dismiss:3,header:!1,maxVisible:3,onInitialize:null,onDestroy:null,onInit:null,onShow:null,onClose:null,onClick:null};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${L.NAME}`);i||(i=new L(this,"object"==typeof t&&t),e.data(`plugin_${L.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[L.NAME];$.fn[L.NAME]=L._jQueryInterface,$.fn[L.NAME].Constructor=L,$.fn[L.NAME].defaults=L.DEFAULTS||{},$.fn[L.NAME].noConflict=()=>($.fn[L.NAME]=t,L._jQueryInterface)}constructor(t,e){super(),this.settings=d({},L.DEFAULTS,window.Cool?.settings?.toast||{},e||{}),this.container="string"==typeof t?document.querySelector(t):t,t&&t.jquery&&(this.container=t[0]),this.containers=new Map,this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}_getContainer(t,e,i,s){if(this.containers.has(t))return this.containers.get(t);const n=document.createElement("div");n.className="toast-container",n.setAttribute("data-placement",t),null!=e&&n.style.setProperty("--_toast-offset-x","number"==typeof e?`${e}px`:e),null!=i&&n.style.setProperty("--_toast-offset-y","number"==typeof i?`${i}px`:i),null!=s&&n.style.setProperty("--_toast-max-visible",String(s)),this.container.appendChild(n),n.addEventListener("mouseenter",()=>{this._pauseTimers(o)}),n.addEventListener("mouseleave",()=>{this._resumeTimers(o)});const o={el:n,toasts:[],queue:[]};return this.containers.set(t,o),o}_cleanupContainer(t){const e=this.containers.get(t);e&&0===e.toasts.length&&0===e.queue.length&&(e.el.remove(),this.containers.delete(t))}_updateStack(t){const e=t.toasts,i=parseInt(t.el.style.getPropertyValue("--_toast-max-visible")||this.settings.maxVisible,10);for(let t=0;t<e.length;t++){const s=e[t],n=e.length-1-t;s.el.style.setProperty("--_toast-index",String(n));const o=s.el.offsetHeight;s.el.style.setProperty("--_toast-collapse-height",`${o}px`),n>=i?s.el.setAttribute("data-toast-hidden","true"):s.el.removeAttribute("data-toast-hidden")}}_pauseTimers(t){const e=Date.now();for(const i of t.toasts)i._dismissTimer&&(clearTimeout(i._dismissTimer),i._dismissTimer=null,i._dismissRemaining=Math.max(0,(i._dismissEnd||e)-e))}_resumeTimers(t){for(const e of t.toasts)null!=e._dismissRemaining&&e._dismissRemaining>0&&this._startDismissTimer(e,e._dismissRemaining),e._dismissRemaining=null}_startDismissTimer(t,e){t._dismissEnd=Date.now()+e,t._dismissTimer=setTimeout(()=>{t._dismissTimer=null,t._dismissRemaining=null,this.close(t)},e)}init(t){const e=d({},this.settings,t||{}),i=this._buildToast(e),s=this._getContainer(i.placement,e.offsetX,e.offsetY,e.maxVisible);return s.toasts.push(i),i._containerEntry=s,this._showToast(i,s),this.onInit(i),i}destroy(){for(const[,t]of this.containers){const e=[...t.toasts];for(const i of e)this._removeToast(i,t,!1);t.queue.length=0}for(const[,t]of this.containers)t.el.remove();this.containers.clear(),this.onDestroy()}_buildToast(t){let e=t.animationIn,i=t.animationOut;if(!e||!i){const s=t.placement.startsWith("top-");e||(e=s?"slideInDown":"slideInUp"),i||(i=s?"slideOutUp":"slideOutDown")}const s={uuid:"toast-"+a(),placement:t.placement,animation:t.animation,animationIn:e,animationOut:i,animationSpeed:t.animationSpeed,dismiss:t.dismiss,title:t.title,content:t.content,icon:t.icon,action:t.action,template:t.template,maxBodyHeight:t.maxBodyHeight,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose,onClick:t.onClick,_dismissTimer:null,_dismissEnd:null,_dismissRemaining:null,_containerEntry:null};let n;n="function"==typeof s.template?s.template(s):this._renderTemplate(s);const o=document.createElement("div");return o.innerHTML=n.trim(),s.el=o.firstElementChild,s.innerEl=s.el.querySelector(".toast-inner"),s.closeBtn=s.el.querySelector("[data-toast-close]"),s}_showToast(t,e){e.el.appendChild(t.el),t._closeHandler=e=>{if(e.target.closest("[data-toast-close]"))return e.preventDefault(),e.stopPropagation(),void this.close(t);if("function"==typeof t.onClick&&t.onClick.call(t,e),t.action){const e="object"==typeof t.action?t.action.uri:t.action;e&&(window.location.href=e)}this.close(t)},t.el.addEventListener("click",t._closeHandler),this._updateStack(e),t.el.offsetHeight,t.el.classList.add("show"),requestAnimationFrame(()=>{t.animation&&(t.innerEl.classList.add(t.animationSpeed),r(t.innerEl,t.animationIn))}),t.dismiss&&this._startDismissTimer(t,1e3*t.dismiss),this.onShow(t)}close(t){const e=t._containerEntry;e&&(t._dismissTimer&&(clearTimeout(t._dismissTimer),t._dismissTimer=null),t.animation&&t.innerEl&&!t.innerEl.classList.contains("animation")?r(t.innerEl,t.animationOut).then(()=>{this._removeToast(t,e,!0)}):this._removeToast(t,e,!0))}_removeToast(t,e,i){if(t.el&&t.el.parentNode&&t.el.remove(),t._closeHandler&&(t.el.removeEventListener("click",t._closeHandler),t._closeHandler=null),e.toasts=e.toasts.filter(e=>e.uuid!==t.uuid),this._updateStack(e),i&&e.queue.length>0){const t=parseInt(e.el.style.getPropertyValue("--_toast-max-visible")||this.settings.maxVisible,10);if(e.toasts.length<t){const t=e.queue.shift();e.toasts.push(t),t._containerEntry=e,this._showToast(t,e)}}this._cleanupContainer(t.placement),this.onClose(t)}onInitialize(){const t=this.onInitialize;"function"==typeof t&&t.call(this.container)}onDestroy(){const t=this.onDestroy;"function"==typeof t&&t.call(this.container)}onInit(t){const e=t.onInit;"function"==typeof e&&e.call(t)}onShow(t){const e=t.onShow;"function"==typeof e&&e.call(t)}onClose(t){const e=t.onClose;"function"==typeof e&&e.call(t)}_renderTemplate(t){let e="",i="",s="",n="",o="";e="function"==typeof t.content?t.content():t.content,t.icon&&(o="string"==typeof t.icon&&t.icon.trimStart().startsWith("<")?`<div class="toast-icon">${t.icon}</div>`:`<div class="toast-icon"><img src="${t.icon}" alt=""></div>`),o||t.title?i=`\n <div class="toast-header">\n ${o}\n\n <span class="mr-auto">${t.title}</span>\n\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n\n </div>\n `:n='\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ',s=`\n <div class="toast-body"><div>${e}</div>${n}</div>\n `;const l=t.action?' role="button" style="cursor: pointer;"':"";return`\n <div class="toast${t.action?" toast-actionable":""}" role="alert" id="${t.uuid}"${l}>\n\n <div class="toast-inner">\n\n ${i}\n ${s}\n\n </div>\n\n </div>\n `}}L._jQueryInit();class I extends i{static NAME="coolDialog";static DEFAULTS={title:"",template:"",body:"",footer:!0,header:!0,size:"",classes:"",centered:!0,backdrop:!0,preventScroll:!0,closeBtn:!0,animation:!0,animationIn:"zoomIn",animationOut:"fadeOut",animationSpeed:"fastest",maxBodyHeight:null,overflowVisible:!1,onInitialize:null,onDestroy:null,onInit:null,onShow:null,onClose:null,callbacks:{},actions:{}};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${I.NAME}`);i||(i=new I(this,"object"==typeof t&&t),e.data(`plugin_${I.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[I.NAME];$.fn[I.NAME]=I._jQueryInterface,$.fn[I.NAME].Constructor=I,$.fn[I.NAME].defaults=I.DEFAULTS||{},$.fn[I.NAME].noConflict=()=>($.fn[I.NAME]=t,I._jQueryInterface)}constructor(t,e){super(),this.settings=d({},I.DEFAULTS,window.Cool?.settings?.dialog||{},e||{}),this.container="string"==typeof t?document.querySelector(t):t,t&&t.jquery&&(this.container=t[0]),this.dialogs=[],this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}init(t){let e=d({},this.settings,t||{});t&&t.actions&&(e.actions=t.actions||{}),t&&t.callbacks&&(e.callbacks=t.callbacks||{}),e.callbacks&&"object"==typeof e.callbacks&&Object.keys(e.callbacks).forEach(t=>{Object.prototype.hasOwnProperty.call(e.actions,t)?"object"!=typeof e.actions[t]||Object.prototype.hasOwnProperty.call(e.actions[t],"content")||this.settings.actions&&this.settings.actions[t]&&"object"==typeof this.settings.actions[t]&&Object.prototype.hasOwnProperty.call(this.settings.actions[t],"content")&&(e.actions[t].content=this.settings.actions[t].content):this.settings.actions&&this.settings.actions[t]?e.actions[t]=d({},this.settings.actions[t]):e.actions[t]={}});const i=this.buildDialog(e);return this.show(i),this.bindEvents(i),this.onInit(i),i}destroy(){this.onDestroy()}buildDialog(t){const e=this,i={uuid:"dialog-"+a(),title:t.title,template:t.template,body:t.body,footer:t.footer,header:t.header,size:t.size,classes:t.classes,centered:t.centered,backdrop:t.backdrop,preventScroll:t.preventScroll,closeBtn:t.closeBtn,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,callbacks:t.callbacks,maxBodyHeight:t.maxBodyHeight,overflowVisible:t.overflowVisible,actions:t.actions,actionInProgress:!1,actionThreshold:300,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};let s;null==i.maxBodyHeight&&"full"!==i.size&&(i.maxBodyHeight=window.innerHeight-200),s="function"==typeof i.template?i.template():this._renderTemplate(i);const n=document.createElement("div");return n.innerHTML=s.trim(),i.el=n.firstElementChild,"undefined"!=typeof $&&$.fn&&(i.$el=$(i.el)),i.show=function(){e.show(i)},i.close=function(){e.close(i)},this.dialogs.push(i),i}bindEvents(t){const e=this;if(t._actionHandler=i=>{const s=i.target.closest("[data-dialog-action], [data-dialog-confirm], [data-dialog-close], [data-dialog-remove]");if(!s)return;if(i.preventDefault(),t.actionInProgress)return void i.stopPropagation();t.actionInProgress=!0;const n=["confirm","close","remove"];let o=s.dataset.dialogAction;if(!o)for(const t of n)if(s.hasAttribute(`data-dialog-${t}`)){o=t;break}const l=t.actions[o]||{};t.el.dispatchEvent(new CustomEvent(`dialog.${o}`,{bubbles:!0}));const a="function"==typeof l.callback?l.callback:"function"==typeof t.callbacks[o]?t.callbacks[o]:null,r=(e=!1)=>{e?t.actionInProgress=!1:setTimeout(()=>{t.actionInProgress=!1},t.actionThreshold)};if("function"==typeof a)try{const i=a.call(e,function(){n.includes(o)&&e.close(t),r()},t);i&&"function"==typeof i.then?i.then(t=>{!1===t&&r()}).catch(()=>{r()}):r()}catch(t){r()}else n.includes(o)?(e.close(t),r()):r()},t.el.addEventListener("click",t._actionHandler),null!==t.maxBodyHeight&&"full"!==t.size){const e=()=>(t.maxBodyHeight=window.innerHeight-200,t.maxBodyHeight);if(window.ResizeObserver)t.resizeObserver=new ResizeObserver(()=>{t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px")})}),t.resizeObserver.observe(document.body);else{let i,s=window.orientation;t.resizeHandler=()=>{clearTimeout(i);const n=performance.now(),o=window.orientation!==s;if(o&&(s=window.orientation),!t.lastResizeTime||n-t.lastResizeTime>100||o){const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px"),t.lastResizeTime=n}else i=setTimeout(()=>{const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px")},16)},window.addEventListener("resize",t.resizeHandler,{passive:!0}),window.addEventListener("orientationchange",t.resizeHandler,{passive:!0})}}}show(t){if(this.container.classList.contains("has-dialogs")||this.container.classList.add("has-dialogs"),t.preventScroll&&!this.container.classList.contains("dialog-prevent-scroll")&&this.container.classList.add("dialog-prevent-scroll"),this.dialogs.length>1){let e=this.dialogs[this.dialogs.length-2].el,i=parseInt(getComputedStyle(e).zIndex,10)||0;i+=1,t.el.style.zIndex=i,Object.assign(e.style,{transition:"opacity 0.3s",opacity:"0",visibility:"visible"})}if(t.backdrop&&!this.container.querySelector(".dialog-backdrop")){const t=document.createElement("div");t.className="dialog-backdrop",this.container.appendChild(t);let e=setInterval(()=>{const t=this.container.querySelector(".dialog-backdrop");0==this.dialogs.length&&t&&(t.remove(),clearInterval(e))},100)}if(this.container.appendChild(t.el),t.animation){const e=t.el.querySelector(".dialog-content");r(e,t.animationIn)}this.onShow(t)}close(t){let e=null;t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null),t.rafId&&(cancelAnimationFrame(t.rafId),t.rafId=null),t.resizeHandler&&(window.removeEventListener("resize",t.resizeHandler),window.removeEventListener("orientationchange",t.resizeHandler),t.resizeHandler=null),t._actionHandler&&(t.el.removeEventListener("click",t._actionHandler),t._actionHandler=null),this.dialogs.length>1&&(e=this.dialogs[this.dialogs.length-2].el);const i=this.container.querySelectorAll('.dialog[data-dialog-backdrop="true"]'),s=this.container.querySelector(".dialog-backdrop");0===i.length&&s&&s.remove();const n=()=>{t.el.remove(),this.dialogs=this.dialogs.filter(e=>e.uuid!==t.uuid),0==this.dialogs.length?(this.container.classList.remove("has-dialogs"),this.container.classList.remove("dialog-prevent-scroll")):e&&(e.style.opacity="1")};if(t.animation){const e=t.el.querySelector(".dialog-content");r(e,t.animationOut).then(()=>{n()})}else n();this.onClose(t)}onInitialize(){let t=this.onInitialize;"function"==typeof t&&t.call(this.container)}onDestroy(){let t=this.onDestroy;"function"==typeof t&&t.call(this.container)}onInit(t){let e=t.onInit;"function"==typeof e&&e.call(t)}onShow(t){let e=t.onShow;"function"==typeof e&&e.call(t)}onClose(t){let e=t.onClose;"function"==typeof e&&e.call(t)}_renderFooter(t){if("function"==typeof t.footer)return t.footer();if(""!==t.footer&&!1!==t.footer&&!0!==t.footer)return t.footer;if(!0===t.footer){if(!t.actions||"object"!=typeof t.actions)return"";const e=Object.entries(t.actions).filter(([,t])=>!1!==t&&("undefined"==typeof t.visible||!!t.visible)).map(([t,e],i)=>({key:t,action:e,idx:i}));e.sort((t,i)=>{if(2===e.length&&e.some(t=>"close"===t.key)&&e.some(t=>"remove"===t.key)){if("close"===t.key)return-1;if("close"===i.key)return 1;if("remove"===t.key)return 1;if("remove"===i.key)return-1}return"remove"===t.key?-1:"remove"===i.key||"confirm"===t.key?1:"confirm"===i.key?-1:t.idx-i.idx});const i=e.map(({key:t,action:e})=>{let i=e.style?e.style:e.primary?"btn-primary":"btn-secondary";"remove"===t&&(i="btn-remove"),"confirm"!==t||"undefined"!==e.primary&&!1===e.primary||(i="btn-primary");let s=e.content||t.charAt(0).toUpperCase()+t.slice(1);return`\n <button type="button" class="btn ${i}${e.classes?" "+e.classes:""}"${e.attrs?" "+e.attrs:""} data-dialog-action="${t}"${["confirm","close","remove"].includes(t)?` data-dialog-${t}`:""}>\n ${s}\n </button>\n `});let s="";return s=i.length>2?`\n ${i[0]}\n <div class="spacer"></div>\n ${i[1]}\n ${i.slice(2).join("\n")}\n `:i.join("\n"),`\n <div class="dialog-footer">\n ${s}\n </div>\n `}return""}_renderHeader(t){let e="";const i='\n <button type="button" data-dialog-action="close" class="dialog-header-close">\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ';return e="function"==typeof t.header?t.header():""!==t.header&&!1!==t.header&&!0!==t.header?t.header:!0===t.header?`\n <div class="dialog-header">\n <span class="dialog-title">\n ${function(t){const e=document.createTextNode(t),i=document.createElement("p");return i.appendChild(e),i.innerHTML}(t.title)}\n </span>\n ${i}\n </div>\n `:`<div class="dialog-header">${i}</div>`,e}_renderTemplate(t){const e=t.classes?" "+t.classes:"",i=t.centered?" dialog-centered":"",s=t.size?" dialog-"+t.size:"",n=t.overflowVisible?" dialog-overflow-visible":"",o=' data-dialog-uuid="'+t.uuid+'"',l=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',a=t.maxBodyHeight?' style="--cool-dialog-body-height: '+t.maxBodyHeight+'px"':"",r="function"==typeof t.body?t.body():t.body,h=this._renderFooter(t);return`\n <div class="dialog${e}${i}${s}${n}"${o}${l}>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n ${this._renderHeader(t)}\n\n <div class="dialog-body"${a}>\n\n ${r}\n\n </div>\n\n ${h}\n\n </div>\n\n </div>\n\n </div>\n `}}I._jQueryInit();class k extends i{static NAME="coolThemeSwitcher";static DEFAULTS={theme:"auto",storageKey:"cool-theme",target:null,onInit:null,onUpdate:null,onDestroy:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${k.NAME}`);i||(i=new k(this,"object"==typeof t&&t),e.data(`plugin_${k.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[k.NAME];$.fn[k.NAME]=k._jQueryInterface,$.fn[k.NAME].Constructor=k,$.fn[k.NAME].defaults=k.DEFAULTS||{},$.fn[k.NAME].noConflict=()=>($.fn[k.NAME]=t,k._jQueryInterface)}constructor(t,e){super(),this.opts=d({},k.DEFAULTS,window.Cool?.settings?.themeSwitcher||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents();const t=this._getStoredTheme();if(t)this._applyTheme(t);else{const t=this.el.dataset.theme;t&&["light","dark","auto"].includes(t)?this._applyTheme(t):this._applyTheme(this.opts.theme)}this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){this.target=this.opts.target?"string"==typeof this.opts.target?document.querySelector(this.opts.target):this.opts.target:document.documentElement,this._mediaQuery=window.matchMedia("(prefers-color-scheme: dark)")}bindEvents(){this._clickHandler=t=>{t.preventDefault();const e=this.el.dataset.theme;e&&["light","dark","auto"].includes(e)?this.setTheme(e):this.toggle()},this._mediaChangeHandler=()=>{"auto"===this._currentTheme&&this._dispatchEvent()},this.el.addEventListener("click",this._clickHandler),this._mediaQuery.addEventListener("change",this._mediaChangeHandler)}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this._mediaChangeHandler&&this._mediaQuery&&this._mediaQuery.removeEventListener("change",this._mediaChangeHandler)}setTheme(t){["light","dark","auto"].includes(t)&&this._applyTheme(t)}getTheme(){return this._currentTheme||"auto"}getResolvedTheme(){return"dark"===this._currentTheme?"dark":"light"===this._currentTheme?"light":this._mediaQuery.matches?"dark":"light"}toggle(){const t=this.getTheme(),e=["light","dark","auto"],i=(e.indexOf(t)+1)%e.length;this.setTheme(e[i])}_applyTheme(t){this._currentTheme=t,this.target.classList.remove("dark","light"),"dark"===t?this.target.classList.add("dark"):"light"===t&&this.target.classList.add("light"),this.el.setAttribute("data-active-theme",t),this._storeTheme(t),this._dispatchEvent()}_dispatchEvent(){const t=new CustomEvent("cool.theme.change",{bubbles:!0,detail:{theme:this.getTheme(),resolvedTheme:this.getResolvedTheme()}});this.target.dispatchEvent(t)}_getStoredTheme(){try{return localStorage.getItem(this.opts.storageKey)}catch{return null}}_storeTheme(t){try{localStorage.setItem(this.opts.storageKey,t)}catch{}}}k._jQueryInit(),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};class T{static _sidebarInstance=null;static _sectionInstance=null;static _toastInstance=null;static refresh(){this._sectionInstance&&this._sectionInstance.refresh&&this._sectionInstance.refresh(),f.initializeElements('[data-toggle="popover"]',window.Cool.settings.popover),E.initializeElements('[data-toggle="select"]',window.Cool.settings.select),v.initializeElements('[data-toggle="dropdown"]',window.Cool.settings.dropdown),C.initializeElements('[data-toggle="tooltip"]',window.Cool.settings.tooltip),_.initializeElements('[data-toggle="collapse"]',window.Cool.settings.collapse),S.initializeElements('[data-toggle="section-tabs"]',window.Cool.settings.sectionTabs),k.initializeElements('[data-toggle="theme-switcher"]',window.Cool.settings.themeSwitcher)}static initialize(t={}){window.Cool.settings=t,this._sectionInstance||(this._sectionInstance=new u(t.section)),f.initializeElements('[data-toggle="popover"]',t.popover),E.initializeElements('[data-toggle="select"]',t.select),v.initializeElements('[data-toggle="dropdown"]',t.dropdown),C.initializeElements('[data-toggle="tooltip"]',t.tooltip),_.initializeElements('[data-toggle="collapse"]',t.collapse),S.initializeElements('[data-toggle="section-tabs"]',t.sectionTabs),k.initializeElements('[data-toggle="theme-switcher"]',t.themeSwitcher);const e=document.querySelector(".sidebar-left");e&&(this._sidebarInstance=m.initializeElement(e,t.sidebar)||m.getInstance(e)),this._toastInstance=L.initializeElement(document.body,t.toast)||L.getInstance(document.body),window.Cool.toast=this._toastInstance,I.initializeElement(document.body,t.dialog)}static initComponent(t){if(!t)return;const e=Array.isArray(t)?t:[t],i=[],s=[];e.forEach(t=>{const e="string"==typeof t?document.querySelector(t):t;if(!e)return;const i=e.querySelectorAll("[data-toggle]");(e.hasAttribute("data-toggle")?[e,...Array.from(i)]:Array.from(i)).forEach(t=>{s.push(t)})});const n=[],o=[];s.forEach(t=>{const e=t.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0?n.push(t):o.push(t)});const l=[...n,...o];let a=0;const r=()=>{l.slice(a,a+10).forEach(t=>{let e=null;switch(t.getAttribute("data-toggle")){case"popover":e=f.initializeElement(t,window.Cool.settings.popover);break;case"select":e=E.initializeElement(t,window.Cool.settings.select);break;case"dropdown":e=v.initializeElement(t,window.Cool.settings.dropdown);break;case"tooltip":e=C.initializeElement(t,window.Cool.settings.tooltip);break;case"collapse":e=_.initializeElement(t,window.Cool.settings.collapse);break;case"section-tabs":e=S.initializeElement(t,window.Cool.settings.sectionTabs);break;case"theme-switcher":e=k.initializeElement(t,window.Cool.settings.themeSwitcher)}e&&i.push(e)}),a+=10,a<l.length&&("requestIdleCallback"in window?requestIdleCallback(r,{timeout:50}):setTimeout(r,0))};return n.length>0?r():"requestIdleCallback"in window?requestIdleCallback(r,{timeout:100}):r(),i}static destroy(){this._sidebarInstance&&(this._sidebarInstance.destroy(),this._sidebarInstance=null),this._sectionInstance&&(this._sectionInstance.destroy(),this._sectionInstance=null)}static observeResize(t,e){if(t&&"function"==typeof e)return s.observe(t,e)}static unobserveResize(t){t&&s.unobserve(t)}static addScrollListener(t,e){t&&"function"==typeof e&&n.add(t,e)}static removeScrollListener(t){t&&n.remove(t)}static getSidebar(){return this._sidebarInstance}static getSection(){return this._sectionInstance}static getToast(){return this._toastInstance}static initjQuery(){f._jQueryInit(),E._jQueryInit(),v._jQueryInit(),C._jQueryInit(),_._jQueryInit(),S._jQueryInit(),L._jQueryInit(),I._jQueryInit(),m._jQueryInit(),k._jQueryInit()}}window.Cool.initialize=T.initialize.bind(T),window.Cool.initComponent=T.initComponent.bind(T),window.Cool.refresh=T.refresh.bind(T),window.Cool.destroy=T.destroy.bind(T),window.Cool.observeResize=T.observeResize.bind(T),window.Cool.unobserveResize=T.unobserveResize.bind(T),window.Cool.addScrollListener=T.addScrollListener.bind(T),window.Cool.removeScrollListener=T.removeScrollListener.bind(T),window.Cool.getSidebar=T.getSidebar.bind(T),window.Cool.getSection=T.getSection.bind(T),window.Cool.getToast=T.getToast.bind(T),window.Cool.initjQuery=T.initjQuery.bind(T),"undefined"!=typeof window&&(window.jQuery=window.$=t);return{Common:T,Sidebar:m,Popover:f,Select:E,Dropdown:v,Tooltip:C,SectionTabs:S,Collapse:_,Toast:L,Dialog:I,ThemeSwitcher:k}});
13
7
  //# sourceMappingURL=cool.min.js.map