@finqu/cool 1.2.28 → 1.3.0

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 (207) hide show
  1. package/README.md +680 -1
  2. package/dist/css/cool.css +23510 -16076
  3. package/dist/css/cool.css.map +1 -154
  4. package/dist/css/cool.min.css +89 -3
  5. package/dist/css/cool.min.css.map +1 -1
  6. package/dist/js/cool.bundle.js +15397 -3775
  7. package/dist/js/cool.bundle.js.map +1 -1
  8. package/dist/js/cool.bundle.min.js +20 -8
  9. package/dist/js/cool.bundle.min.js.map +1 -1
  10. package/dist/js/cool.esm.js +4281 -3352
  11. package/dist/js/cool.esm.js.map +1 -1
  12. package/dist/js/cool.esm.min.js +9 -8
  13. package/dist/js/cool.esm.min.js.map +1 -1
  14. package/dist/js/cool.js +4283 -3354
  15. package/dist/js/cool.js.map +1 -1
  16. package/dist/js/cool.min.js +9 -8
  17. package/dist/js/cool.min.js.map +1 -1
  18. package/package.json +94 -61
  19. package/.babelrc.js +0 -20
  20. package/.browserslistrc +0 -13
  21. package/build/.eslintrc.json +0 -10
  22. package/build/banner.js +0 -14
  23. package/build/build-plugins.js +0 -92
  24. package/build/rollup.config.js +0 -46
  25. package/dist/css/cool-grid.css +0 -3704
  26. package/dist/css/cool-grid.css.map +0 -30
  27. package/dist/css/cool-grid.min.css +0 -7
  28. package/dist/css/cool-grid.min.css.map +0 -1
  29. package/dist/css/cool-reboot.css +0 -285
  30. package/dist/css/cool-reboot.css.map +0 -62
  31. package/dist/css/cool-reboot.min.css +0 -7
  32. package/dist/css/cool-reboot.min.css.map +0 -1
  33. package/html/dropdown-test.html +0 -200
  34. package/html/index.html +0 -2704
  35. package/js/dist/collapse.js +0 -5290
  36. package/js/dist/collapse.js.map +0 -1
  37. package/js/dist/common.js +0 -22152
  38. package/js/dist/common.js.map +0 -1
  39. package/js/dist/cooldropdown.js +0 -467
  40. package/js/dist/cooldropdown.js.map +0 -1
  41. package/js/dist/coolpopover.js +0 -391
  42. package/js/dist/coolpopover.js.map +0 -1
  43. package/js/dist/coolsectiontabs.js +0 -256
  44. package/js/dist/coolsectiontabs.js.map +0 -1
  45. package/js/dist/coolselect.js +0 -796
  46. package/js/dist/coolselect.js.map +0 -1
  47. package/js/dist/cooltooltip.js +0 -360
  48. package/js/dist/cooltooltip.js.map +0 -1
  49. package/js/dist/coolui.js +0 -73
  50. package/js/dist/coolui.js.map +0 -1
  51. package/js/dist/dropdown.js +0 -27421
  52. package/js/dist/dropdown.js.map +0 -1
  53. package/js/dist/popover.js +0 -9298
  54. package/js/dist/popover.js.map +0 -1
  55. package/js/dist/sectiontabs.js +0 -4483
  56. package/js/dist/sectiontabs.js.map +0 -1
  57. package/js/dist/select.js +0 -37052
  58. package/js/dist/select.js.map +0 -1
  59. package/js/dist/tooltip.js +0 -8786
  60. package/js/dist/tooltip.js.map +0 -1
  61. package/js/index.esm.js +0 -21
  62. package/js/index.umd.js +0 -21
  63. package/js/src/abstract-ui-component.js +0 -81
  64. package/js/src/collapse.js +0 -272
  65. package/js/src/common.js +0 -313
  66. package/js/src/dialog.js +0 -578
  67. package/js/src/dropdown.js +0 -525
  68. package/js/src/popover.js +0 -621
  69. package/js/src/section-tabs.js +0 -215
  70. package/js/src/select.js +0 -1341
  71. package/js/src/toast.js +0 -581
  72. package/js/src/tooltip.js +0 -591
  73. package/js/src/util/animate-css.js +0 -22
  74. package/js/src/util/index.js +0 -122
  75. package/js/src/util/perfect-scrollbar.js +0 -1316
  76. package/less/alert.less +0 -345
  77. package/less/badge.less +0 -38
  78. package/less/bootstrap-noconflict.less +0 -23
  79. package/less/bootstrap.less +0 -23
  80. package/less/button-group.less +0 -153
  81. package/less/buttons.less +0 -287
  82. package/less/dialog-noconflict.less +0 -174
  83. package/less/dialog.less +0 -203
  84. package/less/dropdown.less +0 -209
  85. package/less/forms.less +0 -770
  86. package/less/images.less +0 -242
  87. package/less/input-group.less +0 -163
  88. package/less/list-group.less +0 -73
  89. package/less/mixins/aspect-ratio.less +0 -23
  90. package/less/mixins/border-radius.less +0 -24
  91. package/less/mixins/box-shadow.less +0 -4
  92. package/less/mixins/buttons.less +0 -17
  93. package/less/mixins/caret.less +0 -51
  94. package/less/mixins/clearfix.less +0 -10
  95. package/less/mixins/gradients.less +0 -34
  96. package/less/mixins/nav-divider.less +0 -7
  97. package/less/mixins/object-fit.less +0 -13
  98. package/less/mixins/reset-text.less +0 -16
  99. package/less/mixins.less +0 -11
  100. package/less/package.json +0 -11
  101. package/less/pagination.less +0 -69
  102. package/less/popover.less +0 -143
  103. package/less/project.sublime-workspace +0 -774
  104. package/less/reboot.less +0 -235
  105. package/less/section.less +0 -793
  106. package/less/select.less +0 -150
  107. package/less/tables.less +0 -737
  108. package/less/tabs.less +0 -162
  109. package/less/tooltip.less +0 -87
  110. package/less/type.less +0 -71
  111. package/less/utilities/align.less +0 -27
  112. package/less/utilities/animate.less +0 -3512
  113. package/less/utilities/background.less +0 -70
  114. package/less/utilities/borders.less +0 -16
  115. package/less/utilities/color.less +0 -70
  116. package/less/utilities/cursor.less +0 -8
  117. package/less/utilities/display.less +0 -38
  118. package/less/utilities/embed.less +0 -61
  119. package/less/utilities/flex.less +0 -76
  120. package/less/utilities/jquery-ui.less +0 -116
  121. package/less/utilities/lazyload.less +0 -29
  122. package/less/utilities/overflow.less +0 -11
  123. package/less/utilities/pace.less +0 -25
  124. package/less/utilities/placeholder.less +0 -60
  125. package/less/utilities/position.less +0 -42
  126. package/less/utilities/scrollbar.less +0 -152
  127. package/less/utilities/spacing.less +0 -197
  128. package/less/utilities/text.less +0 -68
  129. package/less/utilities/transform.less +0 -7
  130. package/less/utilities.less +0 -21
  131. package/less/variables.less +0 -343
  132. package/scss/LISENCE +0 -15
  133. package/scss/_alert.scss +0 -106
  134. package/scss/_badge.scss +0 -71
  135. package/scss/_button-group.scss +0 -129
  136. package/scss/_buttons.scss +0 -207
  137. package/scss/_custom-forms.scss +0 -429
  138. package/scss/_dialog.scss +0 -161
  139. package/scss/_dropdown.scss +0 -231
  140. package/scss/_forms.scss +0 -257
  141. package/scss/_frame.scss +0 -548
  142. package/scss/_functions.scss +0 -124
  143. package/scss/_grid.scss +0 -35
  144. package/scss/_images.scss +0 -362
  145. package/scss/_input-group.scss +0 -271
  146. package/scss/_list-group.scss +0 -82
  147. package/scss/_mixins.scss +0 -34
  148. package/scss/_navbar.scss +0 -264
  149. package/scss/_notification.scss +0 -13
  150. package/scss/_pagination.scss +0 -79
  151. package/scss/_popover.scss +0 -165
  152. package/scss/_reboot.scss +0 -283
  153. package/scss/_root.scss +0 -15
  154. package/scss/_section.scss +0 -912
  155. package/scss/_select.scss +0 -175
  156. package/scss/_tables.scss +0 -716
  157. package/scss/_tabs.scss +0 -175
  158. package/scss/_toast.scss +0 -182
  159. package/scss/_tooltip.scss +0 -101
  160. package/scss/_type.scss +0 -121
  161. package/scss/_utilities.scss +0 -23
  162. package/scss/_variables.scss +0 -699
  163. package/scss/cool-grid.scss +0 -29
  164. package/scss/cool-reboot.scss +0 -11
  165. package/scss/cool.scss +0 -37
  166. package/scss/mixins/_alert-variant.scss +0 -25
  167. package/scss/mixins/_aspect-ratio.scss +0 -29
  168. package/scss/mixins/_background-variant.scss +0 -25
  169. package/scss/mixins/_badge-variant.scss +0 -36
  170. package/scss/mixins/_breakpoints.scss +0 -102
  171. package/scss/mixins/_buttons.scss +0 -104
  172. package/scss/mixins/_caret.scss +0 -80
  173. package/scss/mixins/_clearfix.scss +0 -10
  174. package/scss/mixins/_float.scss +0 -14
  175. package/scss/mixins/_forms.scss +0 -67
  176. package/scss/mixins/_gradients.scss +0 -40
  177. package/scss/mixins/_grid-framework.scss +0 -72
  178. package/scss/mixins/_grid.scss +0 -60
  179. package/scss/mixins/_nav-divider.scss +0 -9
  180. package/scss/mixins/_notification-variant.scss +0 -7
  181. package/scss/mixins/_object-fit.scss +0 -16
  182. package/scss/mixins/_reset-text.scss +0 -19
  183. package/scss/mixins/_text-emphasis.scss +0 -21
  184. package/scss/mixins/_text-hide.scss +0 -10
  185. package/scss/mixins/_text-truncate.scss +0 -81
  186. package/scss/mixins/_visibility.scss +0 -7
  187. package/scss/project.sublime-workspace +0 -491
  188. package/scss/utilities/_align.scss +0 -41
  189. package/scss/utilities/_animate.scss +0 -3512
  190. package/scss/utilities/_background.scss +0 -14
  191. package/scss/utilities/_borders.scss +0 -146
  192. package/scss/utilities/_clearfix.scss +0 -6
  193. package/scss/utilities/_collapse.scss +0 -33
  194. package/scss/utilities/_cursor.scss +0 -22
  195. package/scss/utilities/_display.scss +0 -16
  196. package/scss/utilities/_embed.scss +0 -78
  197. package/scss/utilities/_flex.scss +0 -52
  198. package/scss/utilities/_lazyload.scss +0 -31
  199. package/scss/utilities/_overflow.scss +0 -6
  200. package/scss/utilities/_perfect-scrollbar.scss +0 -141
  201. package/scss/utilities/_placeholder.scss +0 -76
  202. package/scss/utilities/_position.scss +0 -30
  203. package/scss/utilities/_sizing.scss +0 -32
  204. package/scss/utilities/_spacing.scss +0 -92
  205. package/scss/utilities/_text.scss +0 -99
  206. package/scss/utilities/_user-select.scss +0 -14
  207. package/scss/utilities/_visibility.scss +0 -10
@@ -1,12 +1,13 @@
1
1
  /*!
2
- * Cool UI v1.2.28 (https://finqu.fi)
3
- * Copyright 2011-2020 Finqu Oy
4
- * Licensed under the ISC license - (http://opensource.org/licenses/ISC)
2
+ * Cool v1.3.0 (undefined)
3
+ * Copyright 2020-2026 Finqu Oy
4
+ * Licensed under ISC
5
5
  */
6
- import"jquery";
6
+ import"jquery";function _arrayLikeToArray(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 _createForOfIteratorHelperLoose(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||e){i&&(t=i);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}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 _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,e):void 0}}var Component=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}();Component.instances=[];var Section=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}_inheritsLoose(e,t);var i=e.prototype;return i.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()},i.destroy=function(){this.destroySectionObserver(),this.unbindEvents(),this._updateTimeout&&clearTimeout(this._updateTimeout),this._rafId&&cancelAnimationFrame(this._rafId),this.onDestroy()},i._addEventListener=function(t,e,i,n){t.addEventListener(e,i,n),this._eventHandlers.push({element:t,event:e,handler:i,options:n})},i.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()},i.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)})},i.getVisibleChildren=function(t){var e=this;return Array.from(t.children).filter(function(t){return e.isElementVisible(t)})},i.getVisibleElements=function(t){var e=this;return Array.from(t).filter(function(t){return e.isElementVisible(t)})},i.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},i.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)},i.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)},i.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()}}}})},i.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)}})},i.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"))})},i.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=[]},i.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}(Component);
7
7
  /*!
8
- * perfect-scrollbar v1.4.0
9
- * (c) 2018 Hyunje Jun
10
- * @license MIT
11
- */function get(t){return getComputedStyle(t)}function set(t,e){for(var o in e){var i=e[o];"number"==typeof i&&(i+="px"),t.style[o]=i}return t}function div(t){var e=document.createElement("div");return e.className=t,e}var elMatches="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function matches(t,e){if(!elMatches)throw new Error("No element matching method supported");return elMatches.call(t,e)}function remove(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function queryChildren(t,e){return Array.prototype.filter.call(t.children,function(t){return matches(t,e)})}var cls={main:"ps",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},scrollingClassTimeout={x:null,y:null};function addScrollingClass(t,e){var o=t.element.classList,i=cls.state.scrolling(e);o.contains(i)?clearTimeout(scrollingClassTimeout[e]):o.add(i)}function removeScrollingClass(t,e){scrollingClassTimeout[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(cls.state.scrolling(e))},t.settings.scrollingThreshold)}function setScrollingClassInstantly(t,e){addScrollingClass(t,e),removeScrollingClass(t,e)}var EventElement=function(t){this.element=t,this.handlers={}},prototypeAccessors={isEmpty:{configurable:!0}};EventElement.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},EventElement.prototype.unbind=function(t,e){var o=this;this.handlers[t]=this.handlers[t].filter(function(i){return!(!e||i===e)||(o.element.removeEventListener(t,i,!1),!1)})},EventElement.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},prototypeAccessors.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(EventElement.prototype,prototypeAccessors);var EventManager=function(){this.eventElements=[]};function createEvent(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}EventManager.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new EventElement(t),this.eventElements.push(e)),e},EventManager.prototype.bind=function(t,e,o){this.eventElement(t).bind(e,o)},EventManager.prototype.unbind=function(t,e,o){var i=this.eventElement(t);i.unbind(e,o),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)},EventManager.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},EventManager.prototype.once=function(t,e,o){var i=this.eventElement(t);i.bind(e,function t(n){i.unbind(e,t),o(n)})};var processScrollDiff=function(t,e,o,i,n){var s;if(void 0===i&&(i=!0),void 0===n&&(n=!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"]}processScrollDiff$1(t,o,s,i,n)};function processScrollDiff$1(t,e,o,i,n){var s=o[0],a=o[1],l=o[2],r=o[3],h=o[4],c=o[5];void 0===i&&(i=!0),void 0===n&&(n=!1);var d=t.element;t.reach[r]=null,d[l]<1&&(t.reach[r]="start"),d[l]>t[s]-t[a]-1&&(t.reach[r]="end"),e&&(d.dispatchEvent(createEvent("ps-scroll-"+r)),e<0?d.dispatchEvent(createEvent("ps-scroll-"+h)):e>0&&d.dispatchEvent(createEvent("ps-scroll-"+c)),i&&setScrollingClassInstantly(t,r)),t.reach[r]&&(e||n)&&d.dispatchEvent(createEvent("ps-"+r+"-reach-"+t.reach[r]))}function toInt(t){return parseInt(t,10)||0}function isEditable(t){return matches(t,"input,[contenteditable]")||matches(t,"select,[contenteditable]")||matches(t,"textarea,[contenteditable]")||matches(t,"button,[contenteditable]")}function outerWidth(t){var e=get(t);return toInt(e.width)+toInt(e.paddingLeft)+toInt(e.paddingRight)+toInt(e.borderLeftWidth)+toInt(e.borderRightWidth)}var env={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},updateGeometry=function(t){var e=t.element,o=Math.floor(e.scrollTop);t.containerWidth=e.clientWidth,t.containerHeight=e.clientHeight,t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(queryChildren(e,cls.element.rail("x")).forEach(function(t){return remove(t)}),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(queryChildren(e,cls.element.rail("y")).forEach(function(t){return remove(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=getThumbSize(t,toInt(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=toInt((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=getThumbSize(t,toInt(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=toInt(o*(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),updateCss(e,t),t.scrollbarXActive?e.classList.add(cls.state.active("x")):(e.classList.remove(cls.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=0),t.scrollbarYActive?e.classList.add(cls.state.active("y")):(e.classList.remove(cls.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)};function getThumbSize(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function updateCss(t,e){var o={width:e.railXWidth},i=Math.floor(t.scrollTop);e.isRtl?o.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:o.left=t.scrollLeft,e.isScrollbarXUsingBottom?o.bottom=e.scrollbarXBottom-i:o.top=e.scrollbarXTop+i,set(e.scrollbarXRail,o);var n={top:i,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?n.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:n.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:n.left=e.scrollbarYLeft+t.scrollLeft,set(e.scrollbarYRail,n),set(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),set(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var clickRail=function(t){t.event.bind(t.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarYRail,"mousedown",function(e){var o=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=o*t.containerHeight,updateGeometry(t),e.stopPropagation()}),t.event.bind(t.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarXRail,"mousedown",function(e){var o=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=o*t.containerWidth,updateGeometry(t),e.stopPropagation()})},dragThumb=function(t){bindMouseScrollHandler(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),bindMouseScrollHandler(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])};function bindMouseScrollHandler(t,e){var o=e[0],i=e[1],n=e[2],s=e[3],a=e[4],l=e[5],r=e[6],h=e[7],c=e[8],d=t.element,p=null,u=null,f=null;function g(e){d[r]=p+f*(e[n]-u),addScrollingClass(t,h),updateGeometry(t),e.stopPropagation(),e.preventDefault()}function m(){removeScrollingClass(t,h),t[c].classList.remove(cls.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",g)}t.event.bind(t[a],"mousedown",function(e){p=d[r],u=e[n],f=(t[i]-t[o])/(t[s]-t[l]),t.event.bind(t.ownerDocument,"mousemove",g),t.event.once(t.ownerDocument,"mouseup",m),t[c].classList.add(cls.state.clicking),e.stopPropagation(),e.preventDefault()})}var keyboard=function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",function(o){if(!(o.isDefaultPrevented&&o.isDefaultPrevented()||o.defaultPrevented)&&(matches(e,":hover")||matches(t.scrollbarX,":focus")||matches(t.scrollbarY,":focus"))){var i=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(i){if("IFRAME"===i.tagName)i=i.contentDocument.activeElement;else for(;i.shadowRoot;)i=i.shadowRoot.activeElement;if(isEditable(i))return}var n=0,s=0;switch(o.which){case 37:n=o.metaKey?-t.contentWidth:o.altKey?-t.containerWidth:-30;break;case 38:s=o.metaKey?t.contentHeight:o.altKey?t.containerHeight:30;break;case 39:n=o.metaKey?t.contentWidth:o.altKey?t.containerWidth:30;break;case 40:s=o.metaKey?-t.contentHeight:o.altKey?-t.containerHeight:-30;break;case 32:s=o.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:s=t.containerHeight;break;case 34:s=-t.containerHeight;break;case 36:s=t.contentHeight;break;case 35:s=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==n||t.settings.suppressScrollY&&0!==s||(e.scrollTop-=s,e.scrollLeft+=n,updateGeometry(t),function(o,i){var n=Math.floor(e.scrollTop);if(0===o){if(!t.scrollbarYActive)return!1;if(0===n&&i>0||n>=t.contentHeight-t.containerHeight&&i<0)return!t.settings.wheelPropagation}var s=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===s&&o<0||s>=t.contentWidth-t.containerWidth&&o>0)return!t.settings.wheelPropagation}return!0}(n,s)&&o.preventDefault())}})},wheel=function(t){var e=t.element;function o(o){var i=function(t){var e=t.deltaX,o=-1*t.deltaY;return void 0!==e&&void 0!==o||(e=-1*t.wheelDeltaX/6,o=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,o*=10),e!=e&&o!=o&&(e=0,o=t.wheelDelta),t.shiftKey?[-o,-e]:[e,o]}(o),n=i[0],s=i[1];if(!function(t,o,i){if(!env.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var n=t;n&&n!==e;){if(n.classList.contains(cls.element.consuming))return!0;var s=get(n);if([s.overflow,s.overflowX,s.overflowY].join("").match(/(scroll|auto)/)){var a=n.scrollHeight-n.clientHeight;if(a>0&&!(0===n.scrollTop&&i>0||n.scrollTop===a&&i<0))return!0;var l=n.scrollWidth-n.clientWidth;if(l>0&&!(0===n.scrollLeft&&o<0||n.scrollLeft===l&&o>0))return!0}n=n.parentNode}return!1}(o.target,n,s)){var a=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=n*t.settings.wheelSpeed,a=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(n?e.scrollLeft+=n*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,a=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=n*t.settings.wheelSpeed),updateGeometry(t),(a=a||function(o,i){var n=Math.floor(e.scrollTop),s=0===e.scrollTop,a=n+e.offsetHeight===e.scrollHeight,l=0===e.scrollLeft,r=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(i)>Math.abs(o)?s||a:l||r)||!t.settings.wheelPropagation}(n,s))&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",o):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",o)},touch=function(t){if(env.supportsTouch||env.supportsIePointer){var e=t.element,o={},i=0,n={},s=null;env.supportsTouch?(t.event.bind(e,"touchstart",h),t.event.bind(e,"touchmove",c),t.event.bind(e,"touchend",d)):env.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",h),t.event.bind(e,"pointermove",c),t.event.bind(e,"pointerup",d)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",h),t.event.bind(e,"MSPointerMove",c),t.event.bind(e,"MSPointerUp",d)))}function a(o,i){e.scrollTop-=i,e.scrollLeft-=o,updateGeometry(t)}function l(t){return t.targetTouches?t.targetTouches[0]:t}function r(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function h(t){if(r(t)){var e=l(t);o.pageX=e.pageX,o.pageY=e.pageY,i=(new Date).getTime(),null!==s&&clearInterval(s)}}function c(s){if(r(s)){var h=l(s),c={pageX:h.pageX,pageY:h.pageY},d=c.pageX-o.pageX,p=c.pageY-o.pageY;if(function(t,o,i){if(!e.contains(t))return!1;for(var n=t;n&&n!==e;){if(n.classList.contains(cls.element.consuming))return!0;var s=get(n);if([s.overflow,s.overflowX,s.overflowY].join("").match(/(scroll|auto)/)){var a=n.scrollHeight-n.clientHeight;if(a>0&&!(0===n.scrollTop&&i>0||n.scrollTop===a&&i<0))return!0;var l=n.scrollLeft-n.clientWidth;if(l>0&&!(0===n.scrollLeft&&o<0||n.scrollLeft===l&&o>0))return!0}n=n.parentNode}return!1}(s.target,d,p))return;a(d,p),o=c;var u=(new Date).getTime(),f=u-i;f>0&&(n.x=d/f,n.y=p/f,i=u),function(o,i){var n=Math.floor(e.scrollTop),s=e.scrollLeft,a=Math.abs(o),l=Math.abs(i);if(l>a){if(i<0&&n===t.contentHeight-t.containerHeight||i>0&&0===n)return 0===window.scrollY&&i>0&&env.isChrome}else if(a>l&&(o<0&&s===t.contentWidth-t.containerWidth||o>0&&0===s))return!0;return!0}(d,p)&&s.preventDefault()}}function d(){t.settings.swipeEasing&&(clearInterval(s),s=setInterval(function(){t.isInitialized?clearInterval(s):n.x||n.y?Math.abs(n.x)<.01&&Math.abs(n.y)<.01?clearInterval(s):(a(30*n.x,30*n.y),n.x*=.8,n.y*=.8):clearInterval(s)},10))}},defaultSettings=function(){return{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}},handlers={"click-rail":clickRail,"drag-thumb":dragThumb,keyboard:keyboard,wheel:wheel,touch:touch},PerfectScrollbar=function(t,e){var o=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 i in this.element=t,t.classList.add(cls.main),this.settings=defaultSettings(),e)o.settings[i]=e[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var n,s,a=function(){return t.classList.add(cls.state.focus)},l=function(){return t.classList.remove(cls.state.focus)};this.isRtl="rtl"===get(t).direction,this.isNegativeScroll=(s=t.scrollLeft,t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=s,n),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new EventManager,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=div(cls.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=div(cls.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",a),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var r=get(this.scrollbarXRail);this.scrollbarXBottom=parseInt(r.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=toInt(r.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=toInt(r.borderLeftWidth)+toInt(r.borderRightWidth),set(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=toInt(r.marginLeft)+toInt(r.marginRight),set(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=div(cls.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=div(cls.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",a),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var h=get(this.scrollbarYRail);this.scrollbarYRight=parseInt(h.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=toInt(h.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?outerWidth(this.scrollbarY):null,this.railBorderYWidth=toInt(h.borderTopWidth)+toInt(h.borderBottomWidth),set(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=toInt(h.marginTop)+toInt(h.marginBottom),set(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 handlers[t](o)}),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",function(t){return o.onScroll(t)}),updateGeometry(this)};PerfectScrollbar.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,set(this.scrollbarXRail,{display:"block"}),set(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=toInt(get(this.scrollbarXRail).marginLeft)+toInt(get(this.scrollbarXRail).marginRight),this.railYMarginHeight=toInt(get(this.scrollbarYRail).marginTop)+toInt(get(this.scrollbarYRail).marginBottom),set(this.scrollbarXRail,{display:"none"}),set(this.scrollbarYRail,{display:"none"}),updateGeometry(this),processScrollDiff(this,"top",0,!1,!0),processScrollDiff(this,"left",0,!1,!0),set(this.scrollbarXRail,{display:""}),set(this.scrollbarYRail,{display:""}))},PerfectScrollbar.prototype.onScroll=function(t){this.isAlive&&(updateGeometry(this),processScrollDiff(this,"top",this.element.scrollTop-this.lastScrollTop),processScrollDiff(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},PerfectScrollbar.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),remove(this.scrollbarX),remove(this.scrollbarY),remove(this.scrollbarXRail),remove(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},PerfectScrollbar.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(t){return!t.match(/^ps([-_].+|)$/)}).join(" ")},$.fn.extend({animateCss:function(t,e){var o="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";this.addClass("animated "+t).one(o,function(o){$(this).removeClass("animated "+t),e&&e()}).children().on(o,function(t){t.stopPropagation()})}}),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};var Common=function(){function t(){}return t.initialize=function(t){t=t||{},window.Cool.settings=t,$('[data-toggle="popover"]').coolPopover(t.popover),$('[data-toggle="select"]').coolSelect(t.select),$('[data-toggle="dropdown"]').coolDropdown(t.dropdown),$('[data-toggle="tooltip"]').coolTooltip(t.tooltip),$('[data-toggle="collapse"]').coolCollapse(t.collapse),$('[data-toggle="section-tabs"]').coolSectionTabs(t.sectionTabs),$("body").coolToast(t.toast),$("body").coolDialog(t.dialog),$("html").addClass("dom-ready"),$(document).on("focus",".form-control",function(){if(!$(this).hasClass("disabled")&&$(this).not(":disabled")&&!$(this).attr("readonly")){var t=$(this).closest(".input-group");t.hasClass("input-group-focus")||t.addClass("input-group-focus")}}),$(document).on("blur",".form-control",function(){if(!$(this).hasClass("disabled")&&$(this).not(":disabled")&&!$(this).attr("readonly")){var t=$(this).closest(".input-group");t.hasClass("input-group-focus")&&t.removeClass("input-group-focus")}}),$(".form-label-group").each(function(t,e){$(e).find("input").on("blur input change",function(){$(this).val()?$(e).addClass("label-on-top"):$(e).removeClass("label-on-top")}).trigger("change")}),$.each($(".table"),function(){$(this).find("[data-table-link], [data-table-btn]").length&&!$(this).hasClass("table-hover")&&$(this).addClass("table-hover")}),$(document).on("click","[data-table-link]",function(t){var e=$(this).parents("table, .table"),o=$(this).data("tableLink"),i=$(t.target),n=!1;$.each(["input","button","a","label","td.col-select"],function(t){(i.is(t)||"a"==t&&i.parent().is(t))&&(n=!0)}),e.hasClass("bulk-actions-active")&&(n=!0),i.hasClass("table-link-exclude")&&(n=!0),i.is("td, .td, img")&&!n&&(t.ctrlKey||t.metaKey?window.open(o,"_blank"):window.location.href=o)}),$(document).on("click","[data-table-btn]",function(t){var e=$(this).parents("table, .table"),o=$(this),i=$(this).data("tableButton"),n=$(t.target),s=!1;(i||(i=o.find("button")[0]))&&($.each(["input","button","a","label","td.col-select"],function(t){(n.is(t)||"a"==t&&n.parent().is(t))&&(s=!0)}),e.hasClass("bulk-actions-active")&&(s=!0),n.hasClass("table-btn-exclude")&&(s=!0),n.is("td, .td, img")&&!s&&$(i).click())}),$(document).on("click",".btn-group-toggle .btn > input",function(t){t.stopPropagation()}),$(document).on("click",".btn-group-toggle .btn",function(){$(this).find("input").trigger("click"),$(this).parent().find("input").trigger("change")}),$(document).on("change",".btn-group-toggle .btn > input",function(){$(this).is(":checked")?$(this).parent().addClass("active"):$(this).parent().removeClass("active")}),$("select").on("change",function(){$(this).blur()}),$(".tab-toggler").on("click",function(t){t.stopPropagation(),$(this).parent().toggleClass("open")}),$(document).on("click",function(){$(".tabs-container").removeClass("open")}),$(".sidebar-left-toggler").on("click",function(t){t.stopPropagation(),$(this).toggleClass("open"),$("body").toggleClass("sidebar-left-open")}),$(".sidebar-right-toggler").on("click",function(t){t.stopPropagation(),$(this).toggleClass("open"),$("body").toggleClass("sidebar-right-open")}),$(".sidebar-content .ps__thumb-y").mousedown(function(){$(this).parent().parent().addClass("ps-mousedown-scroll")}),$(document).mouseup(function(){$(".sidebar-content").hasClass("ps-mousedown-scroll")&&$(".sidebar-content").removeClass("ps-mousedown-scroll")});var e=$(".sidebar-left").find(".sidebar-content");if(e.length){var o=new PerfectScrollbar(e[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0});e.find('[data-toggle="collapse"]').on("click",function(){setTimeout(function(){o.update()},300)})}var i=$(document).find(".sidebar-tab");i.length&&($.each(i,function(t,e){var o=$(e).find(".tab-content");new PerfectScrollbar(o[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0})}),$('[name="sidebar-tab-select"]').on("click",function(){var t=$(this).val(),e=$("#sidebar-tab-"+t);i.not(e).removeClass("active"),e.addClass("active"),$('[name="sidebar-tab-select"]').not($(this)).removeClass("active"),$(this).addClass("active"),e[0]==i.first()[0]?i.not(e).find(".tab-content").css({transform:"translate3d(100%, 0px, 0px)"}):e[0]==i.last()[0]?i.not(e).find(".tab-content").css({transform:"translate3d(-100%, 0px, 0px)"}):(i.first().not(e).find(".tab-content").css({transform:"translate3d(-100%, 0px, 0px)"}),i.last().not(e).find(".tab-content").css({transform:"translate3d(100%, 0px, 0px)"})),e.find(".tab-content").css({transform:"none"})}))},t}();function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}window.Cool.initialize=Common.initialize;var debounce=function(t,e,o){var i;return function(){var n=this,s=arguments,a=o&&!i;clearTimeout(i),i=setTimeout(function(){i=null,o||t.apply(n,s)},e),a&&t.apply(n,s)}},touchEvents=function(){var t=!1;return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(t=!0),t};$.event.special.destroyed={remove:function(t){t.handler&&t.handler()}};var AbstractUIComponent=function(){function t(){}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)},e.log=function(){var t;this.debug&&("function"==typeof this.debug?this.debug.apply(this,arguments):(t=console).log.apply(t,arguments))},t}(),NAME="coolPopover",DATA_KEY="plugin_coolPopover",Popover=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.popover?$.extend(!0,i.opts,$.fn[NAME].defaults,window.Cool.settings.popover,o):$.extend(!0,i.opts,$.fn[NAME].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.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-"+this.generateUUID(),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.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.placementChanged=!1,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.containerAutoDetect&&(this.$container=this.$el.offsetParent())},o.bindEvents=function(){var t=this;"click"===this.trigger?this.$el.on("click."+NAME,function(){t.$popover?t.close():t.show()}):"hover"===this.trigger?(this.$el.on("mouseenter."+NAME,function(){t.show()}),this.$el.on("mouseleave."+NAME,function(){t.close()})):"focus"===this.trigger&&(this.$el.on("focusin."+NAME,function(){t.show()}),this.$el.on("focusout."+NAME,function(){t.close()})),$(window).on("resize",debounce(function(){t.$popover&&(t.setPosition(),t.onUpdate())},250))},o.unbindEvents=function(){this.$el.off("."+NAME)},o.generateUUID=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)})},o.buildPopover=function(){var t;t="function"==typeof this.content?this.content():this.content,this.$popover=$('\n \t\t<div class="popover" role="tooltip" id="'+this.id+'">\n\n\t\t\t <div class="arrow"></div>\n\n\t\t\t <h3 class="popover-header">'+this.title+'</h3>\n\n\t\t\t <div class="popover-body">'+t+"</div>\n\n\t\t\t</div>\n \t"),this.$container.append(this.$popover),this.$arrow=!!this.$popover.find(".arrow")&&this.$popover.find(".arrow"),this.log(this.$el),this.log(this.$container),this.log(this.$popover),this.log(this.$arrow),this.log("Id: "+this.id),this.log("Trigger: "+this.trigger),this.log("Placement: "+this.placement),this.log("Animation: "+this.animation),this.log("Animation in: "+this.animationIn),this.log("Animation out: "+this.animationOut),this.log("Animation speed: "+this.animationSpeed),this.log("Title: "+this.title),this.log("Content: "+this.content)},o.setPosition=function(t){null==t&&(t=this.placement),this.$popover.addClass("popover-"+t);var e,o,i,n=this.$container.innerWidth(),s=this.$container.innerHeight(),a=this.$popover.outerWidth(!0),l=this.$popover.outerHeight(!0),r=this.$el.outerWidth(),h=this.$el.outerHeight(),c=this.$el.position().left,d=this.$el.position().top,p=this.$arrow.outerWidth(!0),u=this.$arrow.outerHeight(!0);"top"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d-l),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"right"===t?(o=Math.round(c+r),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d+h),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"left"===t&&(o=Math.round(c-a),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})),this.$popover.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+o+"px, "+i+"px, 0px)","will-change":"transform"});var f=0,g={left:this.$popover.position().left,top:this.$popover.position().top,right:n-(this.$popover.position().left+a),bottom:s-(this.$popover.position().top+l)},m={left:!1,top:!1,right:!1,bottom:!1};if(g.right<0&&(m.right=!0,f++,this.log("Popover overflowing from right")),g.left<0&&(m.left=!0,f++,this.log("Popover overflowing from left")),g.bottom<0&&(m.bottom=!0,f++,this.log("Popover overflowing from bottom")),g.top<0&&(m.top=!0,f++,this.log("Popover overflowing from top")),f>0){if(!this.placementChanged&&m.left&&g.right>a?(this.log("Changing popover placement to right"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("right")):!this.placementChanged&&m.top&&g.top>l?(this.log("Changing popover placement to bottom"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")):!this.placementChanged&&m.right&&g.left>a?(this.log("Changing popover placement to left"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("left")):!this.placementChanged&&m.bottom&&g.top>l?(this.log("Changing popover placement to top"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!m.left&&!m.right?this.fixPopoverPosition=!0:g.top>g.bottom?(this.log("Changing popover placement to top"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):(this.log("Changing popover placement to bottom"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")),this.fixPopoverPosition){if(this.log("Adjusting popover size or position in order to popover fit in the container"),m.left){this.log("Popover overflowing from left");var $=Math.abs(g.left);c>=o+$&&["top","bottom"].indexOf(t)<0?(this.log("Popover adjusting width"),a-=$,o+=$):(this.log("Popover adjusting position x"),o+=$,e-=$)}if(m.top){this.log("Popover overflowing from top");var v=Math.abs(g.top);this.log("Popover adjusting position y"),i+=v,e-=v}if(m.right){this.log("Popover overflowing from right");var b=Math.abs(g.right);c<=o-b&&["top","bottom"].indexOf(t)<0?(this.log("Popover adjusting width"),a-=b):(this.log("Popover adjusting position x"),o-=b,e+=b)}if(m.bottom){this.log("Popover overflowing from bottom");var w=Math.abs(g.bottom);this.log("Popover adjusting position y"),i-=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.$popover.css({width:a,transform:"translate3d("+o+"px, "+i+"px, 0px)"}),this.fixPopoverPosition=!1,this.log("Popover placement changed: "+this.placementChanged),this.log("Popover container inner width: "+n+"px"),this.log("Popover container inner height: "+s+"px"),this.log("Popover trigger width: "+r+"px"),this.log("Popover trigger height: "+h+"px"),this.log("popover trigger position x: "+c+"px"),this.log("Popover trigger position Y: "+d+"px"),this.log("Popover width: "+a+"px"),this.log("Popover height: "+l+"px"),this.log("Popover position x: "+o+"px"),this.log("Popover position y: "+i+"px"),this.log("Popover position left: "+g.left+"px"),this.log("Popover position top: "+g.top+"px"),this.log("Popover position right: "+g.right+"px"),this.log("Popover position bottom: "+g.bottom+"px")}}else this.log("Popover placement changed: "+this.placementChanged),this.log("Popover container inner width: "+n+"px"),this.log("Popover container inner height: "+s+"px"),this.log("Popover trigger width: "+r+"px"),this.log("Popover trigger height: "+h+"px"),this.log("popover trigger position x: "+c+"px"),this.log("Popover trigger position Y: "+d+"px"),this.log("Popover width: "+a+"px"),this.log("Popover height: "+l+"px"),this.log("Popover position x: "+o+"px"),this.log("Popover position y: "+i+"px"),this.log("Popover position left: "+g.left+"px"),this.log("Popover position top: "+g.top+"px"),this.log("Popover position right: "+g.right+"px"),this.log("Popover position bottom: "+g.bottom+"px")},o.show=function(){this.$popover||(this.buildPopover(),this.setPosition(),this.animation?(this.$popover.addClass(this.animationSpeed),this.$popover.animateCss(this.animationIn),this.$popover.addClass("show"),this.$popover.attr("id",this.id),this.$el.attr("data-popover",this.id)):(this.$popover.addClass("show"),this.$popover.attr("id",this.id),this.$el.attr("data-popover",this.id)),this.onShow())},o.close=function(){var t=this;this.$popover&&(this.animation&&!this.$popover.hasClass("animated")?this.$popover.animateCss(this.animationOut,function(){t.$popover.remove(),t.$el.removeAttr("data-popover"),t.$popover=null,t.placementChanged=!1,t.onClose()}):(this.$popover.remove(),this.$el.removeAttr("data-popover"),this.$popover=null,this.placementChanged=!1,this.onClose()))},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT=$.fn[NAME];$.fn[NAME]=Popover._jQueryInterface,$.fn[NAME].Constructor=Popover,$.fn[NAME].noConflict=function(){return $.fn[NAME]=JQUERY_NO_CONFLICT,Popover._jQueryInterface},$.fn[NAME].defaults={container:".content-inner",containerAutoDetect:!1,trigger:"focus",placement:"bottom",animation:!0,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",title:"",content:"",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,debug:!1}}var NAME$1="coolSelect",DATA_KEY$1="plugin_coolSelect",Select=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.select?$.extend(!0,i.opts,$.fn[NAME$1].defaults,window.Cool.settings.select,o):$.extend(!0,i.opts,$.fn[NAME$1].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){var t=this;this.buildCache().then(function(){t.buildScroll(),t.bindEvents(),t.data[t.name].length>0&&t.setData(),t.onInit()})},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$1),this.onDestroy()},o.update=function(){this.buildCache(),this.bindEvents(),this.onUpdate()},o.reset=function(){this.data={},this.data[this.name]=[],this.items=[],this.$select.find(".select-item").remove(),this.$selectItems=[],this.$selectIconContainer.html(this.selectIconDefault),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.html(this.dynamicTitleDefault),0==this.$selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.$selectHeader.css("cursor","default"),this.$selectIconContainer.addClass("d-none"),this.$selectTitle.html(this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchData=[],this.$searchInput.val(""),this.searchString="",this.search.call(this))},o.buildCache=function(){var t=this;return new Promise(function(e,o){var i=t;if(t.$el=$(t.el),t.$container=t.$el.parent(),t.$selectHeader=t.$el.find(".select-header"),t.$selectTitle=t.$el.find(".select-title"),t.$selectIconContainer=t.$selectHeader.find(".select-icon"),t.selectIconDefault=t.$selectHeader.find(".select-icon")?t.$selectHeader.find(".select-icon").html():'<i class="'+(t.opts.faPro?"fal":"fas")+'fa-angle-down icon"></i>',t.name=t.$el.data("name")?t.$el.data("name"):t.opts.name,t.scrollContentHeight=t.$el.data("scrollContentHeight")?t.$el.data("scrollContentHeight"):t.opts.scrollContentHeight,t.items=t.$el.data("items")?t.$el.data("items"):t.opts.items,t.data={},t.data[t.name]=[],t.searchData=[],t.searchApi=t.$el.data("searchApi")?t.$el.data("searchApi"):t.opts.searchApi,t.searchRequest=null,t.type=t.$el.data("type")?t.$el.data("type"):t.opts.type,t.contentOpen=!1,t.searchPlaceholder=t.$el.data("search-placeholder")?t.$el.data("search-placeholder"):t.opts.searchPlaceholder,t.btnCloseText=t.$el.data("btn-close-text")?t.$el.data("btn-close-text"):t.opts.btnCloseText,t.labelTemplate=t.opts.labelTemplate,t.confirmCheck=t.opts.confirmCheck,t.confirmUncheck=t.opts.confirmUncheck,t.preventUncheck=t.opts.preventUncheck,t.dynamicTitle=t.$el.data("dynamicTitle")?t.$el.data("dynamicTitle"):t.opts.dynamicTitle,t.dynamicTitleDefault=t.$el.data("dynamicTitleDefault")?t.$el.data("dynamicTitleDefault"):t.opts.dynamicTitleDefault,t.dynamicTitleEmptyDefault=t.$el.data("dynamicTitleEmptyDefault")?t.$el.data("dynamicTitleEmptyDefault"):t.opts.dynamicTitleEmptyDefault,t.allowNoneOnRadioSelect=t.$el.data("allowNoneOnRadioSelect")?t.$el.data("allowNoneOnRadioSelect"):t.opts.allowNoneOnRadioSelect,t.showValidStateIcon=t.$el.data("showValidStateIcon")?t.$el.data("showValidStateIcon"):t.opts.showValidStateIcon,t.itemsToExclude=t.$el.data("itemsToExclude")?t.$el.data("itemsToExclude").replace(/\s/g,"").split(","):t.opts.itemsToExclude,t.primaryKeyword=t.$el.data("primaryKeyword")?t.$el.data("primaryKeyword"):t.opts.primaryKeyword,t.preventClose=!1,t.itemsToExclude.length>0&&(t.itemsToExclude=t.itemsToExclude.map(String)),t.opts.setData&&(t.data=t.opts.setData),t.$el.data("setData")&&""!=t.$el.data("setData")&&(t.data=t.$el.data("setData")),!Array.isArray(t.data[t.name])&&""!==t.data[t.name]&&t.data[t.name].length>0){var n=t.data[t.name].toString().trim().split(",");t.data[t.name]=n}t.data[t.name].length>0&&(t.data[t.name]=t.data[t.name].map(String)),t.data[t.name].length>0&&t.itemsToExclude.length>0&&(t.data[t.name]=t.data[t.name].filter(function(t){return t[i.primaryKeyword]?-1===i.itemsToExclude.indexOf(t[i.primaryKeyword].toString()):-1===i.itemsToExclude.indexOf(t.toString())})),t.items.length>0&&t.itemsToExclude.length>0&&(t.items=t.items.filter(function(t){return t[i.primaryKeyword]?-1===i.itemsToExclude.indexOf(t[i.primaryKeyword].toString()):-1===i.itemsToExclude.indexOf(t.toString())})),t.$el.find(".select-search").length?t.showSearch=!0:t.showSearch=t.$el.data("showSearch")?t.$el.data("showSearch"):t.opts.showSearch,t.$el.find(".select-footer").length?t.showFooter=!0:t.showFooter=t.$el.data("showFooter")?t.$el.data("showFooter"):t.opts.showFooter,t.$select=t.$el.find(".select-content"),new Promise(function(e,o){if(t.$select.length){var n=t.$select.find(".select-item");n.length>0&&t.itemsToExclude.length>0&&$.each(n,function(t,e){var o=$(e).find(":input").val();i.itemsToExclude.indexOf(o)>-1&&$(e).remove()}),e()}else{var s=t._renderItemList(t.items);t.$select=$('\n <div class="select-content">\n\n '+t._renderSearch()+'\n\n <div class="select-scrollable-content"></div>\n\n '+t._renderFooter()+"\n\n </div>\n "),t.$el.append(t.$select),t.$select.find(".select-scrollable-content").append(s),e()}}).then(function(){t.$scrollableContent=!!t.$select.find(".select-scrollable-content")&&t.$select.find(".select-scrollable-content"),t.$selectItems=t.$select.find(".select-item"),0==t.data[t.name].length&&t.dynamicTitle&&t.dynamicTitleDefault&&0!==t.dynamicTitleDefault&&0==t.$selectTitle.text().trim()&&(t.$selectItems.length>0||t.searchApi)&&t.$selectTitle.html(t.dynamicTitleDefault),0==t.$selectItems.length&&!t.searchApi&&t.dynamicTitle&&t.dynamicTitleEmptyDefault&&0!==t.dynamicTitleEmptyDefault&&(t.$selectHeader.css("cursor","default"),t.$selectIconContainer.addClass("d-none"),t.$selectTitle.html(t.dynamicTitleEmptyDefault)),t.showSearch&&(t.$searchContainer=t.$select.find(".select-search"),t.$searchInput=t.$select.find('[name="select-search"]'),t.$searchIconContainer=t.$select.find(".select-search-icon"),t.$clearSearchButton=t.$select.find("[data-clear-search]"),t.$searchInput[0].tabIndex=-1),t.showFooter&&(t.$footerContainer=t.$select.find(".select-footer"),t.$closeButton=t.$select.find("[data-select-close]"),t.$closeButton[0].tabIndex=-1),t.buildSearchData(),t.log(t.$el),t.log(t.$select),t.log(t.$scrollableContent),t.log("Name: "+t.name),t.log("Show search: "+t.showSearch),t.log("Show footer: "+t.showFooter),t.log("Scroll content height: "+t.scrollContentHeight+"px"),t.log(t.items),t.log(t.searchData),e()})})},o.buildScroll=function(){if(this.$scrollableContent.length>0){var t=this.scrollContentHeight;this.showSearch&&(t-=this.$searchContainer.outerHeight(!0)||0),this.showFooter&&(t-=this.$footerContainer.outerHeight(!0)||0),this.$scrollableContent.css({"max-height":t-parseInt(this.$scrollableContent.css("marginTop"),10)-parseInt(this.$scrollableContent.css("marginBottom"),10)+"px"}),touchEvents()?this.$scrollableContent.css({"overflow-y":"auto"}):(this.$scrollableContent.addClass("ps-dark"),this.scroll=new PerfectScrollbar(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,scrollYMarginOffset:-1,suppressScrollY:!0,suppressScrollX:!0}),this.$scrollableContent.find('[tabindex="0"]').attr("tabindex",-1),this.$scrollableContent[0].offsetHeight<this.$scrollableContent[0].scrollHeight&&(this.$scrollableContent.addClass("ps-show-rail-y"),this.scroll.settings.suppressScrollY=!1))}},o.buildSearchData=function(){var t=this;return new Promise(function(e,o){t.searchData=[];var i=t.$select.find("[data-label]");$.each(i,function(e,o){t.searchData.push({id:e,val:$(o).text().trim()})}),e()})},o.bindEvents=function(){var t=this,e=this;this.$selectHeader.on("click."+NAME$1,function(){t.contentOpen?t.close():(t.$selectItems.length>0||t.searchApi)&&t.show()}),this.$el.on("change."+NAME$1,'input[type="checkbox"]',function(){var t=this,o=$(this).val();e.preventClose=!0,"function"==typeof e.confirmCheck&&t.checked?(t.checked=!1,e.confirmCheck(function(i){"confirmed"==i&&(-1===e.data[e.name].indexOf(o)&&e.data[e.name].push(o),t.checked=!0,e.onSelect(t)),setTimeout(function(){e.preventClose=!1},600)},t)):t.checked?(-1===e.data[e.name].indexOf(o)&&e.data[e.name].push(o),e.onSelect(t),setTimeout(function(){e.preventClose=!1},600)):"function"!=typeof e.confirmUncheck||t.checked?t.checked||e.preventUncheck?!t.checked&&e.preventUncheck&&(t.checked=!0,setTimeout(function(){e.preventClose=!1},600)):(e.data[e.name]=e.data[e.name].filter(function(t){return t!=o}),e.onSelect(t),setTimeout(function(){e.preventClose=!1},600)):(t.checked=!0,e.confirmUncheck(function(i){"confirmed"==i&&(e.data[e.name]=e.data[e.name].filter(function(t){return t!=o}),t.checked=!1,e.onSelect(t)),setTimeout(function(){e.preventClose=!1},600)},t))}),this.$el.on("change."+NAME$1,'input[type="radio"]',function(){var t=$(this).val();this.checked?(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")):e.data[e.name]=[]}),this.$el.on("click."+NAME$1,'input[type="radio"]',function(){$(this).hasClass("checked")&&e.allowNoneOnRadioSelect?(e.data[e.name]=[],$(this).prop("checked",!1),$(this).removeClass("checked"),e.dynamicTitle&&e.$selectTitle.html(e.dynamicTitleDefault)):($(this).addClass("checked"),e.dynamicTitle&&e.$selectTitle.html($(this).parent().find("[data-label]").text())),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."+NAME$1,debounce(function(){e.searchString=$(this).val().trim(),e.search.call(e)},250)),this.$searchInput.on("focusin."+NAME$1,function(){e.$searchContainer.addClass("focused")}),this.$searchInput.on("focusout."+NAME$1,function(){e.$searchContainer.removeClass("focused")}),this.$searchContainer.on("click."+NAME$1,"[data-clear-search]",function(){e.searchString.length&&(e.$searchInput.val(""),e.searchString="",e.search.call(e))})),this.showFooter&&this.$closeButton.on("click."+NAME$1,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)})},o.unbindEvents=function(){this.$el.off("."+NAME$1)},o.getData=function(t){return t?this.data[t]:this.data},o.setData=function(){var t=this,e=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+e+' fa-check text-green icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.searchApi.length){var o=this.searchApi,i=this.data[this.name].length,n=0;this.data[this.name].forEach(function(t){o+=encodeURIComponent("#"+t),++n!==i&&(o+="+")}),$.ajax({method:"GET",url:o}).done(function(e){var o=e.map(function(e){return e.id=e[t.primaryKeyword].toString(),e}),i=o.map(function(t){return t.id.toString()});t.data[t.name]=t.data[t.name].filter(function(t){return i.indexOf(t.toString())>-1}),0==t.data[t.name].length&&t.$selectIconContainer.html(t.selectIconDefault),o=o.filter(function(e){return t.data[t.name].indexOf(e.id)>-1&&-1===t.itemsToExclude.indexOf(e.id)&&0!=e.id});var n=t._renderItemList(o);$.when(t.$scrollableContent.append(n)).then(function(){var e=t.$scrollableContent.find(":input");if(t.$scrollableContent[0].offsetHeight<t.$scrollableContent[0].scrollHeight?(t.scroll.update(),t.scroll.settings.suppressScrollY=!1,t.$scrollableContent.addClass("ps-show-rail-y")):(t.scroll.update(),t.scroll.settings.suppressScrollY=!0,t.$scrollableContent.removeClass("ps-show-rail-y")),t.$scrollableContent.find(':input[type="checkbox"]').length?t.type="checkbox":t.$scrollableContent.find(':input[type="radio"]').length&&(t.type="radio"),"checkbox"==t.type)t.data[t.name].forEach(function(o){var i=e.filter(function(){return this.value==o});i.prop("checked",!0),t.onSelect(i[0])});else if("radio"==t.type){var o=e.filter(function(){return this.value==t.data[t.name][0]});o.prop("checked",!0),o.addClass("checked"),t.dynamicTitle&&t.$selectTitle.html(o.parent().find("[data-label]").text()),t.onSelect(o[0])}})})}else{var s=this.$scrollableContent.find(":input"),a=s.length>0?s.map(function(){return this.value.toString()}).get():[];if(this.data[this.name]=this.data[this.name].filter(function(t){return a.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(e){var o=s.filter(function(){return this.value==e});o.prop("checked",!0),t.onSelect(o[0])});else if("radio"==this.type){var l=s.filter(function(){return this.value==t.data[t.name][0]});l.prop("checked",!0),l.addClass("checked"),this.dynamicTitle&&this.$selectTitle.html(l.parent().find("[data-label]").text()),this.onSelect(l[0])}}},o.search=function(){var t=this,e=this.opts.faPro?"fal":"fas";if(this.searchString.length)if(this.searchApi.length)this.$scrollableContent.find("input:not(:checked)").parents(".select-item").not(".static-item").remove(),null!==this.searchRequest&&this.searchRequest.abort(),this.searchRequest=$.ajax({method:"GET",url:this.searchApi+this.searchString}).done(function(e){t.searchRequest=null;var o=e.map(function(e){return e.id=e[t.primaryKeyword].toString(),e});o=o.filter(function(e){return-1===t.data[t.name].indexOf(e.id)&&-1===t.itemsToExclude.indexOf(e.id)&&0!=e.id});var i=t._renderItemList(o);$.when(t.$scrollableContent.append(i)).then(function(){var e=t.opts.faPro?"fal":"fas";t.$searchIconContainer.html('<i class="'+e+' fa-times icon"></i>'),t.$searchIconContainer.attr("data-clear-search","true"),t.$scrollableContent[0].offsetHeight<t.$scrollableContent[0].scrollHeight?(t.scroll.update(),t.scroll.settings.suppressScrollY=!1,t.$scrollableContent.addClass("ps-show-rail-y")):(t.scroll.update(),t.scroll.settings.suppressScrollY=!0,t.$scrollableContent.removeClass("ps-show-rail-y"))})});else{var o=this.searchData.filter(function(e){return e.val.toLocaleLowerCase().indexOf(t.searchString.toLocaleLowerCase())>-1});this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),o.forEach(function(e){$(t.$selectItems[e.id]).addClass("visible")}),this.$selectItems.not(".visible").addClass("d-none"),this.$searchIconContainer.html('<i class="'+e+' fa-times icon"></i>'),this.$searchIconContainer.attr("data-clear-search","true")}else this.searchApi.length?(this.$scrollableContent.find("input:not(:checked)").parents(".select-item").not(".static-item").remove(),this.$searchIconContainer.html('<i class="'+e+' fa-search icon"></i>'),this.$searchIconContainer.attr("data-clear-search","")):(this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),this.$searchIconContainer.html('<i class="'+e+' fa-search icon"></i>'),this.$searchIconContainer.attr("data-clear-search",""));this.scroll&&this.scroll.update(),this.onUpdate()},o.show=function(){var t=this;if(!this.$el.hasClass("show")){var e=$(".select.show"),o=1,i=this.opts.faPro?"fal":"fas";e.length&&(o=parseInt(e.first().css("z-index"),10)+2),this.$el.css({"max-height":this.scrollContentHeight+this.$selectHeader.outerHeight(!0)+"px"}),this.$el.addClass("show"),e.length||(o=parseInt(this.$el.css("z-index"),10)+1),this.$el.css({"z-index":o}),this.scroll&&this.$scrollableContent.length&&this.$scrollableContent[0].offsetHeight<this.$scrollableContent[0].scrollHeight&&(this.$scrollableContent[0].scrollTop=1,this.$scrollableContent[0].scrollTop=0),this.$selectIconContainer.html('<i class="'+i+' fa-angle-up icon"></i>'),setTimeout(function(){t.$el[0].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},300),this.contentOpen=!0,this.onShow()}},o.close=function(){if(!this.preventClose){var t=this,e=this.opts.faPro?"fal":"fas";this.$el.css("max-height",""),this.$el.removeClass("show"),setTimeout(function(){t.$el.removeAttr("style")},300),this.data[this.name].length>0&&this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+e+' fa-check text-green icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.contentOpen=!1,this.onClose()}},o.onSelect=function(t){var e=this,o=this.opts.onSelect,i=$(t).parents(".select-item").data();this.searchApi.length&&!$.isEmptyObject(i)&&($(t).length&&t.checked?this.items.push(i):this.items=$.grep(this.items,function(t){return t[e.primaryKeyword]!=i.id})),"function"==typeof o&&o.call(t,i,this)},o.appendItems=function(t,e){var o=this;return new Promise(function(e,i){var n=o;if(!$.isArray(t)){var s=[];s.push(t),t=s}(t=t.filter(function(t){return-1===n.itemsToExclude.indexOf(t[n.primaryKeyword].toString())})).forEach(function(t){o.items.push(t)});var a=o._renderItemList(t);o.$scrollableContent.prepend(a),o.$selectItems=o.$select.find(".select-item"),o.buildSearchData().then(function(){if(o.$selectItems.length>0)if(o.$select.find(':input[type="checkbox"]').length?o.type="checkbox":o.$select.find(':input[type="radio"]').length&&(o.type="radio"),"checkbox"==o.type)t.forEach(function(t){var e=o.$select.find(":input").filter(function(){return this.value==t.id}),i=e.val().toString();e.prop("checked",!0),-1===o.data[o.name].indexOf(i)&&o.data[o.name].push(i),o.onSelect(e[0])});else if("radio"==o.type){var i=t[0],n=o.$select.find(":input").filter(function(){return this.value==i.id}),s=n.val().toString();n.prop("checked",!0),n.addClass("checked"),-1===o.data[o.name].indexOf(s)&&(o.data[o.name]=[s]),o.dynamicTitle&&o.$selectTitle.html(n.parent().find("[data-label]").text()),o.$select.find('input[type="radio"]').not(n).prop("checked",!1),o.$select.find('input[type="radio"]').not(n).removeClass("checked"),o.onSelect(n[0])}0==o.data[o.name].length&&o.dynamicTitle&&o.dynamicTitleDefault&&0!==o.dynamicTitleDefault&&0==o.$selectTitle.text().trim()&&(o.$selectItems.length>0||o.searchApi)&&o.$selectTitle.html(o.dynamicTitleDefault),o.$selectHeader.attr("style")&&o.$selectHeader.removeAttr("style"),o.$selectIconContainer.hasClass("d-none")&&o.$selectIconContainer.removeClass("d-none"),e()})})},o.deselectItems=function(t){var e=this;return new Promise(function(o,i){t.forEach(function(t){var o=e.$select.find(":input").filter(function(){return this.value==t});o[0].checked&&o.trigger("click")}),0==e.data[e.name].length&&e.$selectIconContainer.html(e.selectIconDefault)})},o.getItem=function(t,e){var o=$.grep(this.items,function(o){return o[t]==e})[0];return o||null},o.getSelectedItems=function(t){var e=[],o=[],i=this.data[this.name];return $.isArray(i)?e=i:e.push(i),e=e.map(String),this.items.length>0?(o=$.grep(this.items,function(t){return e.indexOf(t.id.toString())>-1}),t&&(o=o.map(function(e){return e[t]}).filter(function(t){return null!=t}))):o=e,o},o.getSelectedItem=function(t){var e=[],o=[],i=this.data[this.name];return $.isArray(i)?e=i:e.push(i),e=e.map(String),this.items.length>0?(o=$.grep(this.items,function(t){return e.indexOf(t.id.toString())>-1}),t&&(o=o.map(function(e){return e[t]}).filter(function(t){return null!=t}))):o=e,null==o[0]?null:o[0]},o._renderItemList=function(t){for(var e=[],o=0;o<t.length;++o){var i=t[o],n="";"function"==typeof this.labelTemplate?n=this.labelTemplate(i):i.name?n=i.name:i.label?n=i.label:i.value&&(n=i.value),e.push($('\n\n <div class="select-item">\n\n <div class="select-item-'+this.type+'">\n\n <div class="styled-'+this.type+'">\n\n <input type="'+this.type+'" id="select-'+this.name+"-"+t[o].id+'" value="'+t[o].id+'" tabindex="-1">\n\n <label for="select-'+this.name+"-"+t[o].id+'">\n\n <span class="radio-inner">\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\n <span class="'+this.type+'-label"'+("function"!=typeof this.labelTemplate?" data-label":"")+">\n "+n+"\n </span>\n\n </label>\n\n </div>\n\n </div>\n\n </div>\n\n ").data(i))}return e},o._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""},o._renderFooter=function(){return this.showFooter?'\n\n <div class="select-footer">\n\n <button class="btn btn-block btn-secondary" type="button" tabindex="-1" data-select-close >\n '+this.btnCloseText+"\n </button>\n\n </div>\n\n ":""},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$1);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$1,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$1=$.fn[NAME$1];$.fn[NAME$1]=Select._jQueryInterface,$.fn[NAME$1].Constructor=Select,$.fn[NAME$1].noConflict=function(){return $.fn[NAME$1]=JQUERY_NO_CONFLICT$1,Select._jQueryInterface},$.fn[NAME$1].defaults={name:"",type:"checkbox",labelTemplate:null,confirmCheck:null,confirmUncheck:null,setData:null,scrollContentHeight:100,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,debug:!1,dynamicTitle:!1,dynamicTitleDefault:"",dynamicTitleEmptyDefault:"",allowNoneOnRadioSelect:!0,preventUncheck:!1,showValidStateIcon:!0,itemsToExclude:[],primaryKeyword:"id"}}var NAME$2="coolDropdown",DATA_KEY$2="plugin_coolDropdown",Dropdown=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.dropdown?$.extend(!0,i.opts,$.fn[NAME$2].defaults,window.Cool.settings.dropdown,o):$.extend(!0,i.opts,$.fn[NAME$2].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){var t=this;$.when(this.buildCache()).then(function(){t.buildScroll(),t.bindEvents(),t.onInit()})},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$2),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){var t=this;if(this.$el=$(this.el),this.$el.addClass("dropdown-trigger"),this.$container=this.$el.parent(".dropdown"),this.id="dropdown-"+this.generateUUID(),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.offset=this.$el.data("offset")?this.$el.data("offset"):this.opts.offset,this.minWidth=this.$el.data("minWidth")?this.$el.data("minWidth"):this.opts.minWidth,this.scroll=this.$el.data("scroll")?this.$el.data("scroll"):this.opts.scroll,this.scrollContentHeight=this.$el.data("scrollContentHeight")?this.$el.data("scrollContentHeight"):this.opts.scrollContentHeight,this.positionObserver=this.$el.attr("data-position-observer")?JSON.parse(this.$el.attr("data-position-observer")):this.opts.positionObserver,this.closeOnItemClick=this.$el.data("closeOnItemClick")?this.$el.data("closeOnItemClick"):this.opts.closeOnItemClick,this.content=this.$el.data("content")?this.$el.data("content"):this.opts.content,this.contentOpen=!1,this.$container.hasClass("dropup")?this.placement="top":this.$container.hasClass("dropright")?this.placement="right":this.$container.hasClass("dropbottom")?this.placement="bottom":this.placement="left","function"!=typeof this.content)return this.$dropdown=!!this.$el.next(".dropdown-menu")&&this.$el.next(".dropdown-menu"),this.$dropdown.hasClass("dropdown-menu-right")?this.align="end":this.align="start",this.$scrollableContent=!!this.$dropdown.find(".dropdown-scrollable-content")&&this.$dropdown.find(".dropdown-scrollable-content"),this.$dropdownItem=this.$dropdown.find(".dropdown-item"),this.minWidth&&this.$dropdown.css("min-width",this.minWidth+"px"),this.log(this.$el),this.log(this.$container),this.log(this.$dropdown),this.log(this.$scrollableContent),this.log("Id: "+this.id),this.log("Animation: "+this.animation),this.log("Animation in: "+this.animationIn),this.log("Animation out: "+this.animationOut),this.log("Animation speed: "+this.animationSpeed),this.log("Offset: "+this.offset),this.log("Min width: "+this.minWidth),this.log("Content: "+this.opts.content),this.log("Scroll: "+this.scroll),this.log("Scroll content height: "+this.scrollContentHeight+"px"),!0;var e="end"===this.opts.align?" dropdown-menu-right":"";this.$dropdown=$('\n <div class="dropdown-menu'+e+'" id="'+this.id+'">\n '+this.content()+"\n </div>\n "),$.when(this.$el.after(this.$dropdown)).then(function(){return t.$scrollableContent=!!t.$dropdown.find(".dropdown-scrollable-content")&&t.$dropdown.find(".dropdown-scrollable-content"),t.$dropdown.hasClass("dropdown-menu-right")?t.align="end":t.align="start",t.$dropdownItem=t.$dropdown.find(".dropdown-item"),t.minWidth&&t.$dropdown.css("min-width",t.minWidth+"px"),t.log(t.$el),t.log(t.$container),t.log(t.$dropdown),t.log(t.$scrollableContent),t.log("Id: "+t.id),t.log("Animation: "+t.animation),t.log("Animation in: "+t.animationIn),t.log("Animation out: "+t.animationOut),t.log("Animation speed: "+t.animationSpeed),t.log("Offset: "+t.offset),t.log("Min width: "+t.minWidth),t.log("Content: "+t.content),t.log("Scroll: "+t.scroll),t.log("Scroll content height: "+t.scrollContentHeight+"px"),!0})},o.buildScroll=function(){this.opts.scroll&&this.$scrollableContent.length&&(this.$scrollableContent.css({"max-height":this.scrollContentHeight+"px"}),touchEvents()?this.$scrollableContent.css({"overflow-y":"auto"}):(this.$scrollableContent.css({"overflow-y":"auto"}),this.scroll=new PerfectScrollbar(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20}),this.$scrollableContent.addClass("ps-show-rail-y")))},o.bindEvents=function(){var t=this,e=this;this.$el.on("click."+NAME$2,function(){t.contentOpen?t.close():t.show()}),this.$dropdownItem.on("click."+NAME$2,function(){e.closeOnItemClick&&e.close(),e.onItemClick(this)}),$(document).on("touchstart click",function(e){t.$el.is(e.target)||t.$dropdown.is(e.target)||0!==t.$dropdown.has(e.target).length||!t.contentOpen||t.close()}),$(window).on("resize",debounce(function(){t.setPosition(),t.onUpdate()},250))},o.unbindEvents=function(){this.$el.off("."+NAME$2)},o.generateUUID=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)})},o.setPosition=function(t){"undefined"!=typeof str&&null!==str||(t=this.placement);var e=this.$dropdown.outerWidth(!0),o=this.$dropdown.outerHeight(!0),i=this.$el.outerWidth(!0),n=this.$el.outerHeight(!0),s=this.$el.position().left,a=this.$el.position().top,l=0,r=0,h=0,c=0;if("top"===t?(l="end"===this.align?i-e:s,r=a-o):"right"===t?(l=s+i,r=a):"bottom"===t?(l="end"===this.align?i-e:s,r=a+n):"left"===t&&(l=s-e,r=a),this.offset){var d=this.offset.split(",");h=d[0],c=d[1],l+=parseInt(h,10),r+=parseInt(c,10)}if(this.positionObserver&&this.$container.length>0){for(var p=this.$container.parent(),u=0;"hidden"!==p.css("overflow-x")&&"hidden"!==p.css("overflow")&&"body"!==(p.prop("tagName")||"").toLowerCase()&&u<100;){if(!(p=p.parent()).get(0))return;++u}if(!p.get(0))return;var f=p.get(0).getBoundingClientRect(),g=this.$container.get(0).getBoundingClientRect();f.width<e?(this.$dropdown.css("max-width",f.width),e=f.width):this.$dropdown.css("max-width",""),f.height<o?(this.$dropdown.css("max-height",f.height),o=f.height):this.$dropdown.css("max-height","");var m=Math.max(Math.abs(f.y-g.y),0),$=Math.max(Math.abs(f.x-g.x),0),v=p.get(0).scrollWidth-(g.x+g.width),b=p.get(0).scrollHeight-(g.y+("dropbottom"===t?g.height:0));$<e&&l<s&&(l=s,a+n>r&&(r=a+n+(c>0?c:0))),v<e&&l+e>s+i&&(l=s+i-e,a+n>r&&(r=a+n+(c>0?c:0))),r<a&&m<o&&(r=a+n+c),r>=a&&b<o&&(r=l>=s+i||s>=l+e?a-(o-b):a-o-c)}this.$dropdown.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+Math.round(l)+"px, "+Math.round(r)+"px, 0px)","will-change":"transform"}),this.log("Dropdown trigger width: "+i+"px"),this.log("Dropdown trigger height: "+n+"px"),this.log("Dropdown trigger position x: "+s+"px"),this.log("Dropdown trigger position Y: "+a+"px"),this.log("Dropdown width: "+e+"px"),this.log("Dropdown height: "+o+"px"),this.log("Dropdown position x: "+l+"px"),this.log("Dropdown position y: "+r+"px")},o.show=function(){this.$dropdown&&!this.$dropdown.hasClass("show")&&(this.setPosition(),this.animation?(this.$dropdown.attr("x-placement",this.placement+"-"+this.align),this.$dropdown.addClass(this.animationSpeed),this.$dropdown.animateCss(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&&(this.$scrollableContent[0].scrollTop=1,this.$scrollableContent[0].scrollTop=0),this.contentOpen=!0,this.onShow())},o.close=function(){var t=this;this.$dropdown&&(this.animation&&!this.$dropdown.hasClass("animated")?this.$dropdown.animateCss(this.animationOut,function(){t.$dropdown.removeClass("show"),t.$el.removeAttr("data-dropdown")}):(this.$dropdown.removeClass("show"),this.$el.removeAttr("data-dropdown")),this.contentOpen=!1,this.onClose())},o.onItemClick=function(t){var e=this.opts.onItemClick;"function"==typeof e&&e.call(t)},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$2);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$2,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$2=$.fn[NAME$2];$.fn[NAME$2]=Dropdown._jQueryInterface,$.fn[NAME$2].Constructor=Dropdown,$.fn[NAME$2].noConflict=function(){return $.fn[NAME$2]=JQUERY_NO_CONFLICT$2,Dropdown._jQueryInterface},$.fn[NAME$2].defaults={animation:!0,animationIn:"zoomIn",animationOut:"zoomOut",animationSpeed:"fastest",offset:null,minWidth:null,align:"start",closeOnItemClick:!0,positionObserver:!0,content:!1,scroll:!0,scrollContentHeight:100,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onItemClick:null,debug:!1}}var NAME$3="coolTooltip",DATA_KEY$3="plugin_coolTooltip",Tooltip=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.tooltip?$.extend(!0,i.opts,$.fn[NAME$3].defaults,window.Cool.settings.tooltip,o):$.extend(!0,i.opts,$.fn[NAME$3].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$3),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$container=this.$el.data("container")?$(this.$el.data("container")):$(this.opts.container),this.id="tooltip-"+this.generateUUID(),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},o.bindEvents=function(){var t=this;"auto"===this.trigger&&(this.$el.on("mouseenter."+NAME$3,function(){t.show()}),this.$el.on("mouseleave."+NAME$3,function(){t.close()}),this.$el.on("blur."+NAME$3,function(){t.close()})),this.$el.on("destroyed."+NAME$3,function(){t.close()}),$(window).on("resize",debounce(function(){t.$tooltip&&(t.setPosition(),t.onUpdate())},250))},o.unbindEvents=function(){this.$el.off("."+NAME$3)},o.generateUUID=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)})},o.buildTooltip=function(){this.$tooltip=$('\n\n <div class="tooltip" role="tooltip" id="'+this.id+'">\n\n <div class="arrow"></div>\n\n <div class="tooltip-inner">'+this.content+"</div>\n\n </div>\n\n "),this.$container.append(this.$tooltip),this.$arrow=this.$tooltip.find(".arrow"),this.log(this.$el),this.log(this.$container),this.log(this.$tooltip),this.log(this.$arrow),this.log("Id: "+this.id),this.log("Animation: "+this.animation),this.log("Animation in: "+this.animationIn),this.log("Animation out: "+this.animationOut),this.log("Animation speed: "+this.animationSpeed),this.log("Placement: "+this.placement),this.log("Content: "+this.content),this.log("Trigger: "+this.trigger)},o.setPosition=function(t){null==t&&(t=this.placement),this.$tooltip.addClass("tooltip-"+t);var e,o,i,n=this.$container.innerWidth(),s=this.$container.innerHeight(),a=this.$tooltip.outerWidth(!0),l=this.$tooltip.outerHeight(!0),r=this.$el.outerWidth(),h=this.$el.outerHeight(),c=this.$el.offset().left,d=this.$el.offset().top,p=this.$arrow.outerWidth(!0),u=this.$arrow.outerHeight(!0);"top"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d-l),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"right"===t?(o=Math.round(c+r),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d+h),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"left"===t&&(o=Math.round(c-a),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})),this.$tooltip.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+o+"px, "+i+"px, 0px)","will-change":"transform"});var f=0,g={left:this.$tooltip.position().left,top:this.$tooltip.position().top,right:n-(this.$tooltip.position().left+a),bottom:s-(this.$tooltip.position().top+l)},m={left:!1,top:!1,right:!1,bottom:!1};if(g.right<0&&(m.right=!0,f++,this.log("Tooltip overflowing from right")),g.left<0&&(m.left=!0,f++,this.log("Tooltip overflowing from left")),g.bottom<0&&(m.bottom=!0,f++,this.log("Tooltip overflowing from bottom")),g.top<0&&(m.top=!0,f++,this.log("Tooltip overflowing from top")),f>0){if(!this.placementChanged&&m.left&&g.right>a?(this.log("Changing tooltip placement to right"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("right")):!this.placementChanged&&m.top&&g.top>l?(this.log("Changing tooltip placement to bottom"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")):!this.placementChanged&&m.right&&g.left>a?(this.log("Changing tooltip placement to left"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("left")):!this.placementChanged&&m.bottom&&g.top>l?(this.log("Changing tooltip placement to top"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!m.left&&!m.right?this.fixTooltipPosition=!0:g.top>g.bottom?(this.log("Changing tooltip placement to top"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):(this.log("Changing tooltip placement to bottom"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")),this.fixTooltipPosition){if(this.log("Adjusting tooltip size or position in order to tooltip fit in the container"),m.left){this.log("Tooltip overflowing from left");var $=Math.abs(g.left);c>=o+$&&["top","bottom"].indexOf(t)<0?(this.log("Tooltip adjusting width"),a-=$,o+=$):(this.log("Tooltip adjusting position x"),o+=$,e-=$)}if(m.top){this.log("Tooltip overflowing from top");var v=Math.abs(g.top);this.log("Tooltip adjusting position y"),i+=v,e-=v}if(m.right){this.log("Tooltip overflowing from right");var b=Math.abs(g.right);c<=o-b&&["top","bottom"].indexOf(t)<0?(this.log("Tooltip adjusting width"),a-=b):(this.log("Tooltip adjusting position x"),o-=b,e+=b)}if(m.bottom){this.log("Tooltip overflowing from bottom");var w=Math.abs(g.bottom);this.log("Tooltip adjusting position y"),i-=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("+o+"px, "+i+"px, 0px)"}),this.fixTooltipPosition=!1,this.log("Tooltip placement changed: "+this.placementChanged),this.log("Tooltip container inner width: "+n+"px"),this.log("Tooltip container inner height: "+s+"px"),this.log("Tooltip trigger width: "+r+"px"),this.log("Tooltip trigger height: "+h+"px"),this.log("Tooltip trigger position x: "+c+"px"),this.log("Tooltip trigger position Y: "+d+"px"),this.log("Tooltip width: "+a+"px"),this.log("Tooltip height: "+l+"px"),this.log("Tooltip position x: "+o+"px"),this.log("Tooltip position y: "+i+"px"),this.log("Tooltip position left: "+g.left+"px"),this.log("Tooltip position top: "+g.top+"px"),this.log("Tooltip position right: "+g.right+"px"),this.log("Tooltip position bottom: "+g.bottom+"px")}}else this.log("Tooltip placement changed: "+this.placementChanged),this.log("Tooltip container inner width: "+n+"px"),this.log("Tooltip container inner height: "+s+"px"),this.log("Tooltip trigger width: "+r+"px"),this.log("Tooltip trigger height: "+h+"px"),this.log("Tooltip trigger position x: "+c+"px"),this.log("Tooltip trigger position Y: "+d+"px"),this.log("Tooltip width: "+a+"px"),this.log("Tooltip height: "+l+"px"),this.log("Tooltip position x: "+o+"px"),this.log("Tooltip position y: "+i+"px"),this.log("Tooltip position left: "+g.left+"px"),this.log("Tooltip position top: "+g.top+"px"),this.log("Tooltip position right: "+g.right+"px"),this.log("Tooltip position bottom: "+g.bottom+"px")},o.show=function(){this.$tooltip||(this.buildTooltip(),this.setPosition(),this.animation?(this.$tooltip.addClass(this.animationSpeed),this.$tooltip.animateCss(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())},o.close=function(){var t=this;this.$tooltip&&(this.animation&&!this.$tooltip.hasClass("animated")?this.$tooltip.animateCss(this.animationOut,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._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$3);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$3,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$3=$.fn[NAME$3];$.fn[NAME$3]=Tooltip._jQueryInterface,$.fn[NAME$3].Constructor=Tooltip,$.fn[NAME$3].noConflict=function(){return $.fn[NAME$3]=JQUERY_NO_CONFLICT$3,Tooltip._jQueryInterface},$.fn[NAME$3].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,debug:!1}}var NAME$4="coolSectionTabs",DATA_KEY$4="plugin_coolSectionTabs",SectionTabs=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.sectionTabs?$.extend(!0,i.opts,$.fn[NAME$4].defaults,window.Cool.settings.sectionTabs,o):$.extend(!0,i.opts,$.fn[NAME$4].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.checkForChanges(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$4),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$dropdownContainer=this.$el.find(".dropdown-container"),this.$dropdownList=this.$el.find(".dropdown-list"),this.tabsCount=this.$el.find("> .tab-item").length,this.tabs=this.$el.find("> .tab-item:visible"),$.each(this.tabs,function(t,e){$(e).data("width",$(e).outerWidth(!0))}),this.log(this.$el),this.log(this.$dropdownContainer),this.log(this.$dropdownList),this.log(this.tabsCount)},o.bindEvents=function(){var t=this;$(window).on("resize",debounce(function(){t.checkForChanges()},250))},o.unbindEvents=function(){this.$el.off("."+this._name)},o.moveToList=function(t){var e=$(t);e.find(".tab-item-action").removeClass("dropdown-item"),e.insertBefore(this.$dropdownContainer),this.checkForChanges()},o.moveToDropdown=function(t){var e=$(t),o=e.find(".tab-item-action");o.hasClass("dropdown-item")||o.addClass("dropdown-item"),e.appendTo(this.$dropdownList),this.checkForChanges()},o.overflowStatus=function(){return this.$el[0].offsetWidth<this.$el[0].scrollWidth},o.checkForChanges=function(){var t=this.$dropdownList.children(),e=this.$el.find("> .tab-item").not(this.$dropdownContainer),o=this.$el.find("> .tab-item:visible"),i=0;$.each(o,function(t,e){i+=$(e).outerWidth(!0)});var n=this.$el[0].offsetWidth-i;t.length>0?this.$dropdownContainer.hasClass("visible")||this.$dropdownContainer.addClass("visible"):this.$dropdownContainer.hasClass("visible")&&this.$dropdownContainer.removeClass("visible"),1==this.overflowStatus()?e.length>0&&this.moveToDropdown(e.last()):t.length>0&&n>t.last().data("width")&&this.moveToList(t.last())},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$4);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$4,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$4=$.fn[NAME$4];$.fn[NAME$4]=SectionTabs._jQueryInterface,$.fn[NAME$4].Constructor=SectionTabs,$.fn[NAME$4].noConflict=function(){return $.fn[NAME$4]=JQUERY_NO_CONFLICT$4,SectionTabs._jQueryInterface},$.fn[NAME$4].defaults={onInit:null,onUpdate:null,onDestroy:null,debug:!1}}var NAME$5="coolCollapse",DATA_KEY$5="plugin_coolCollapse",Collapse=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.collapse?$.extend(!0,i.opts,$.fn[NAME$5].defaults,window.Cool.settings.dialog,o):$.extend(!0,i.opts,$.fn[NAME$5].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$5),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$target=this.$el.data("target")?$(document).find(this.$el.data("target")):$(document).find(this.opts.target),this.expanded="true"==this.$el.attr("aria-expanded"),this.$target.length?(this.targetHeight=this.$target.height(),this.$container=this.$target.closest(".section-collapse"),this.$indicator=$(document).find('[data-collapse-indicator="'+this.$el.data("target")+'"]')):(this.$target=$(this.$el).parent().find(".collapse"),this.targetHeight=this.$target.height(),this.$container=this.$target.closest(".section-collapse"),this.$indicator=$(this.$el).parent().find("[data-collapse-indicator]")),this.expanded&&this.$target.css("height","auto"),this.log(this.$el),this.log(this.$target),this.log(this.$container),this.log(this.$indicator),this.log("Expanded: "+this.expanded),this.log("Target height: "+this.targetHeight+"px")},o.bindEvents=function(){var t=this;this.$el.on("click."+this.name,function(e){t.expanded?t.close():t.show()}),$(window).on("resize",debounce(function(){t.$target.length&&(t.targetHeight=t.$target.height(),t.log("Target height: "+t.targetHeight+"px"))},250))},o.unbindEvents=function(){this.$el.off("."+this.name)},o.whichTransitionEvent=function(){var t=document.createElement("text-transition"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var o in e)if(void 0!==t.style[o])return e[o]},o.show=function(){var t=this;this.targetHeight!==this.$target.height()&&(this.targetHeight=this.$target.height()),this.$target.removeClass("collapse show"),this.$target.addClass("collapsing"),this.$el.is("button")&&this.$el.attr("disabled",!0),this.$container.length&&this.$container.addClass("show"),this.$target.css("height"),this.$target.css("height",this.targetHeight),this.$indicator.length&&this.$indicator.addClass("show"),this.$target.one(this.whichTransitionEvent(),function(){t.$target.removeClass("collapsing"),t.$el.is("button")&&t.$el.attr("disabled",!1),t.$target.removeAttr("style"),t.$target.addClass("collapse show"),t.$el.attr("aria-expanded",!0),t.$target.css("height","auto"),t.expanded=!0}),this.onShow()},o.close=function(){var t=this;this.$target.removeClass("collapse show"),this.$target.addClass("collapsing"),this.$el.is("button")&&this.$el.attr("disabled",!0),this.$container.length&&this.$container.removeClass("show"),this.$target.css("height",this.$target.height()),setTimeout(function(){t.$target.css("height",0)},10),this.$indicator.length&&this.$indicator.hasClass("show")&&this.$indicator.removeClass("show"),this.$target.one(this.whichTransitionEvent(),function(){t.$target.removeClass("collapsing"),t.$el.is("button")&&t.$el.attr("disabled",!1),t.$target.removeAttr("style"),t.$target.addClass("collapse"),t.$el.attr("aria-expanded",!1),t.expanded=!1,t.targetHeight!==t.$target.height()&&(t.targetHeight=t.$target.height())}),this.onClose()},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$5);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$5,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$5=$.fn[NAME$5];$.fn[NAME$5]=Collapse._jQueryInterface,$.fn[NAME$5].Constructor=Collapse,$.fn[NAME$5].noConflict=function(){return $.fn[NAME$5]=JQUERY_NO_CONFLICT$5,Collapse._jQueryInterface},$.fn[NAME$5].defaults={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,debug:!1}}var NAME$6="coolToast",DATA_KEY$6="plugin_coolToast",Toast=function(){function t(t,e){this.settings={},window.Cool.settings.toast?$.extend(!0,this.settings,$.fn[NAME$6].defaults,window.Cool.settings.toast,e):$.extend(!0,this.settings,$.fn[NAME$6].defaults,e),this.container=t,this.$container=$(this.container),this.debug=this.settings.debug,this.faPro=this.settings.faPro,this.toasts=[],this.queue=[],this.processingQueue=!1,this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}var e=t.prototype;return e.addQueue=function(t){if(this.queue.push(t),!this.processingQueue)return this.processQueue()},e.processQueue=function(){if(this.processingQueue&&this.queue.shift(),this.queue.length)return this.processingQueue=!0,this.show(this.queue[0]);this.processingQueue=!1},e.init=function(t){var e={};$.extend(!0,e,this.settings,t);var o=this.buildToast(e);return this.addQueue(o),this.onInit(o),o},e.destroy=function(){this.$container.removeData(DATA_KEY$6),this.onDestroy()},e.buildToast=function(t){var e={uuid:"toast-"+this.generateUUID(),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.log(e),this.toasts.push(e),e},e.bindEvents=function(t){var e=this,o=this;t.$el.on("click","[data-toast-close]",function(){t.$el&&o.close(t)}),$(window).on("resize",debounce(function(){t.$el&&e.setPosition(t)},250))},e.generateUUID=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)})},e.setPosition=function(t,e,o,i){if(null==o&&(o=t.placementY),null==i&&(i=t.placementX),i&&o||(e=t.placement),t.offset){var n=t.offset.split(",");parseInt(n[0],10),parseInt(n[1],10)}var s,a,l=t.$el.outerWidth(!0),r=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-l/2,a=0,this.log(this.$container.width),t.offset?(s+=offsetX,a+=offsetY):a+=30):"top-right"===e?(s=this.$container.width()-l,a=0,t.offset?(s+=-offsetX,a+=offsetY):(s+=-30,a+=30)):"center-left"===e?(s=0,a=this.$container.height()/2-r/2,t.offset?(s+=offsetX,a+=offsetY):s+=30):"center-center"===e?(s=this.$container.width()/2-l/2,a=this.$container.height()/2-r/2,t.offset&&(s+=offsetX,a+=offsetY)):"center-right"===e?(s=this.$container.width()-l,a=this.$container.height()/2-r/2,t.offset?(s+=-offsetX,a+=offsetY):s+=-30):"bottom-left"===e?(s=0,a=this.$container.height()-r,t.offset?(s+=offsetX,a+=-offsetY):(s+=30,a+=-30)):"bottom-center"===e?(s=this.$container.width()/2-l/2,a=this.$container.height()-r,t.offset?(s+=offsetX,a+=-offsetY):a+=-30):"bottom-right"===e&&(s=this.$container.width()-l,a=this.$container.height()-r,t.offset?(s+=-offsetX,a+=-offsetY):(s+=-30,a+=-30)):(s=i,a=o),t.$el.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+s+"px, "+a+"px, 0px)","will-change":"transform"}),this.log("Toast width: "+l+"px"),this.log("Toast height: "+r+"px"),this.log("Toast position Y: "+s+"px"),this.log("Toast position x: "+a+"px")},e.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),t.$inner.animateCss(t.animationIn)):t.$el.addClass("show"),t.dismiss&&setTimeout(function(){e.close(t)},1e3*t.dismiss),this.onShow(t)},e.close=function(t){var e=this;t.animation&&!t.$inner.hasClass("animated")?(t.$el.removeClass("show"),t.$inner.animateCss(t.animationOut,function(){t.$el.remove(),e.toasts=$.grep(e.toasts,function(e){return e.uuid!=t.uuid}),e.processQueue(),e.onClose(t)})):(t.$el.remove(),this.toasts=$.grep(this.toasts,function(e){return e.uuid!=t.uuid}),this.processQueue(),this.onClose(t))},e.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},e.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},e.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},e.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},e.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},e.log=function(){var t;this.debug&&("function"==typeof this.debug?this.debug.apply(this,arguments):(t=console).log.apply(t,arguments))},e._renderTemplate=function(t){var e,o=this.faPro?"far":"fas",i="",n="",s="";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 <i class="'+o+' fa-times icon"></i>\n </button>\n\n </div>\n ':s='\n <button type="button" data-toast-close>\n\n <i class="'+o+' fa-times icon"></i>\n\n </button>\n ',e='\n <div class="toast-body">\n\n <span>'+i+"</span>\n "+s+"\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 "},t._jQueryInterface=function(e){return this.each(function(){var o=$(this).data(DATA_KEY$6);if(o||(o=new t(this,"object"==typeof e&&e),$(this).data(DATA_KEY$6,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}})},t}();if("undefined"!=typeof $){var _$$fn$NAME$defaults,JQUERY_NO_CONFLICT$6=$.fn[NAME$6];$.fn[NAME$6]=Toast._jQueryInterface,$.fn[NAME$6].Constructor=Toast,$.fn[NAME$6].noConflict=function(){return $.fn[NAME$6]=JQUERY_NO_CONFLICT$6,Toast._jQueryInterface},$.fn[NAME$6].defaults=((_$$fn$NAME$defaults={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,faPro:!1,debug:!1,onInitialize:null,onDestroy:null,onInit:null}).onDestroy=null,_$$fn$NAME$defaults.onShow=null,_$$fn$NAME$defaults.onClose=null,_$$fn$NAME$defaults)}var NAME$7="coolDialog",DATA_KEY$7="plugin_coolDialog",Dialog=function(){function t(t,e){this.settings={},window.Cool.settings.dialog?$.extend(!0,this.settings,$.fn[NAME$7].defaults,window.Cool.settings.dialog,e):$.extend(!0,this.settings,$.fn[NAME$7].defaults,e),this.container=t,this.$container=$(this.container),this.debug=this.settings.debug,this.faPro=this.settings.faPro,this.dialogs=[],this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}var e=t.prototype;return e.init=function(t){var e={};$.extend(!0,e,this.settings,t);var o=this.buildDialog(e);return this.show(o),this.bindEvents(o),this.onInit(o),o},e.destroy=function(){this.$container.removeData(DATA_KEY$7),this.onDestroy()},e.buildDialog=function(t){var e=this,o={uuid:"dialog-"+this.generateUUID(),title:t.title,template:t.template,body:t.body,footer:t.footer,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,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};return null==o.maxBodyHeight&&(o.maxBodyHeight=window.innerHeight-200),"function"==typeof o.template?o.$el=$(o.template()):o.$el=$(this._renderTemplate(o)),o.show=function(){e.show(o)},o.close=function(){e.close(o)},this.log(o),this.dialogs.push(o),o},e.bindEvents=function(t){var e=this;t.$el.on("click","[data-dialog-close]",function(o){t.$el.trigger("dialog.close"),"function"==typeof t.callbacks.close?t.callbacks.close.call(e,function(){e.close(t)},t):e.close(t)}),t.$el.on("click","[data-dialog-remove]",function(o){t.$el.trigger("dialog.remove"),"function"==typeof t.callbacks.remove&&t.callbacks.remove.call(e,function(){e.close(t)},t)}),t.$el.on("click","[data-dialog-confirm]",debounce(function(o){t.$el.trigger("dialog.close"),"function"==typeof t.callbacks.confirm?t.callbacks.confirm.call(e,function(){e.close(t)},t):e.close(t)}))},e.generateUUID=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)})},e.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 o=$(this.dialogs).eq(-2)[0].$el,i=parseInt(o.css("z-index"),10)+1;t.$el.css("z-index",i),o.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 n=setInterval(function(){0==e.dialogs.length&&$(".dialog-backdrop").length&&($(".dialog-backdrop").remove(),clearInterval(n))},100)}this.$container.append(t.$el),t.animation&&t.$el.find(".dialog-content").addClass(t.animationSpeed).animateCss(t.animationIn),this.onShow(t)},e.close=function(t){var e=this,o=null;this.dialogs.length>1&&(o=$(this.dialogs).eq(-2)[0].$el),0===$('.dialog[data-dialog-backdrop="true"]').length&&$(".dialog-backdrop").length&&$(".dialog-backdrop").remove(),t.animation?t.$el.find(".dialog-content").animateCss(t.animationOut,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")):o&&o.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")):o&&o.css("opacity",1)),this.onClose(t)},e.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},e.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},e.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},e.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},e.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},e.log=function(){var t;this.debug&&("function"==typeof this.debug?this.debug.apply(this,arguments):(t=console).log.apply(t,arguments))},e._renderFooter=function(t){var e="";if("function"==typeof t.footer)e=t.footer();else if(""!==t.footer&&!1!==t.footer&&!0!==t.footer)e=t.footer;else{if(!0!==t.footer)return e;var o="",i="",n="";t.actions.close.visible&&(o='\n <button type="button" class="btn '+(t.actions.close.primary?"btn-primary":"btn-secondary")+(t.actions.close.classes?" "+t.actions.close.classes:"")+'"'+(t.actions.close.attrs?" "+t.actions.close.attrs:"")+" data-dialog-close>\n "+t.actions.close.content+"\n </button>\n "),t.actions.remove.visible&&(i='\n <button type="button" class="btn '+(t.actions.remove.primary?"btn-primary":"btn-secondary")+(t.actions.remove.classes?" "+t.actions.remove.classes:"")+'"'+(t.actions.remove.attrs?" "+t.actions.remove.attrs:"")+" data-dialog-remove>\n "+t.actions.remove.content+"\n </button>\n "),t.actions.confirm.visible&&(n='\n <button type="button" class="btn '+(t.actions.confirm.primary?"btn-primary":"btn-secondary")+(t.actions.confirm.classes?" "+t.actions.confirm.classes:"")+'"'+(t.actions.confirm.attrs?" "+t.actions.confirm.attrs:"")+" data-dialog-confirm>\n "+t.actions.confirm.content+"\n </button>\n "),e="\n "+o+"\n "+i+"\n "+n+"\n "}if(e)return'\n <div class="dialog-footer">\n '+e+"\n </div>\n "},e._renderTemplate=function(t){var e=this.faPro?"far":"fas",o=t.classes?" "+t.classes:"",i=t.centered?" dialog-centered":"",n=t.size?" dialog-"+t.size:"",s=t.overflowVisible?" dialog-overflow-visible":"",a=' data-dialog-uuid="'+t.uuid+'"',l=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',r=t.title,h=t.closeBtn?'<button type="button" data-dialog-close><i class="'+e+' fa-times icon"></i></button>':"",c=t.maxBodyHeight?' style="max-height: '+t.maxBodyHeight+'px"':"",d=this._renderFooter(t);return'\n <div class="dialog'+o+i+n+s+'"'+a+l+'>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n <div class="dialog-header">\n\n <span class="dialog-title">\n '+r+"\n </span>\n\n "+h+'\n\n </div>\n\n <div class="dialog-body"'+c+">\n\n "+("function"==typeof t.body?t.body():t.body)+"\n\n </div>\n\n "+d+"\n\n </div>\n\n </div>\n\n </div>\n "},t._jQueryInterface=function(e){var o=$(this).data(DATA_KEY$7);if(o||(o=new t(this,"object"==typeof e&&e),$(this).data(DATA_KEY$7,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}},t}();if("undefined"!=typeof $){var _$$fn$NAME$defaults$1,JQUERY_NO_CONFLICT$7=$.fn[NAME$7];$.fn[NAME$7]=Dialog._jQueryInterface,$.fn[NAME$7].Constructor=Dialog,$.fn[NAME$7].noConflict=function(){return $.fn[NAME$7]=JQUERY_NO_CONFLICT$7,Dialog._jQueryInterface},$.fn[NAME$7].defaults=((_$$fn$NAME$defaults$1={title:"",template:"",body:"",footer:!0,size:"",classes:"",centered:!0,backdrop:!0,preventScroll:!0,closeBtn:!0,animation:!0,animationIn:"zoomIn",animationOut:"fadeOut",animationSpeed:"fastest",callbacks:{},maxBodyHeight:null,overflowVisible:!1,faPro:!1,debug:!0,onInitialize:null,onDestroy:null,onInit:null}).onDestroy=null,_$$fn$NAME$defaults$1.onShow=null,_$$fn$NAME$defaults$1.onClose=null,_$$fn$NAME$defaults$1.actions={close:{primary:!1,visible:!0,content:"Close",classes:"",attrs:""},remove:{primary:!1,visible:!0,content:"Remove",classes:"",attrs:""},confirm:{primary:!0,visible:!0,content:"Confirm",classes:"",attrs:""}},_$$fn$NAME$defaults$1)}var index_esm={Common:Common,Popover:Popover,Select:Select,Dropdown:Dropdown,Tooltip:Tooltip,SectionTabs:SectionTabs,Collapse:Collapse,Toast:Toast,Dialog:Dialog};export default index_esm;
8
+ * perfect-scrollbar v1.5.6
9
+ * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors
10
+ * Licensed under MIT
11
+ */
12
+ function get(t){return getComputedStyle(t)}function set(t,e){for(var i in e){var n=e[i];"number"==typeof n&&(n+="px"),t.style[i]=n}return t}function div(t){var e=document.createElement("div");return e.className=t,e}Section.DEFAULTS={observeSections:!0,initFormControls:!0,initTableHandlers:!0,initButtonGroups:!0,initTabs:!0,onInit:null,onDestroy:null};var elMatches="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function matches(t,e){if(!elMatches)throw new Error("No element matching method supported");return elMatches.call(t,e)}function remove(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function queryChildren(t,e){return Array.prototype.filter.call(t.children,function(t){return matches(t,e)})}var cls={main:"ps",rtl:"ps__rtl",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},scrollingClassTimeout={x:null,y:null};function addScrollingClass(t,e){var i=t.element.classList,n=cls.state.scrolling(e);i.contains(n)?clearTimeout(scrollingClassTimeout[e]):i.add(n)}function removeScrollingClass(t,e){scrollingClassTimeout[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(cls.state.scrolling(e))},t.settings.scrollingThreshold)}function setScrollingClassInstantly(t,e){addScrollingClass(t,e),removeScrollingClass(t,e)}var EventElement=function(t){this.element=t,this.handlers={}},prototypeAccessors={isEmpty:{configurable:!0}};EventElement.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},EventElement.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)})},EventElement.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},prototypeAccessors.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(EventElement.prototype,prototypeAccessors);var EventManager=function(){this.eventElements=[]};function createEvent(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 processScrollDiff(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"]}processScrollDiff$1(t,i,s,n,o)}function processScrollDiff$1(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(createEvent("ps-scroll-"+l)),e<0?d.dispatchEvent(createEvent("ps-scroll-"+c)):e>0&&d.dispatchEvent(createEvent("ps-scroll-"+h)),n&&setScrollingClassInstantly(t,l)),t.reach[l]&&(e||o)&&d.dispatchEvent(createEvent("ps-"+l+"-reach-"+t.reach[l]))}function toInt(t){return parseInt(t,10)||0}function isEditable(t){return matches(t,"input,[contenteditable]")||matches(t,"select,[contenteditable]")||matches(t,"textarea,[contenteditable]")||matches(t,"button,[contenteditable]")}function outerWidth(t){var e=get(t);return toInt(e.width)+toInt(e.paddingLeft)+toInt(e.paddingRight)+toInt(e.borderLeftWidth)+toInt(e.borderRightWidth)}EventManager.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new EventElement(t),this.eventElements.push(e)),e},EventManager.prototype.bind=function(t,e,i){this.eventElement(t).bind(e,i)},EventManager.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)},EventManager.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},EventManager.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 env={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 updateGeometry(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)||(queryChildren(e,cls.element.rail("x")).forEach(function(t){return remove(t)}),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(queryChildren(e,cls.element.rail("y")).forEach(function(t){return remove(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=getThumbSize(t,toInt(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=toInt((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=getThumbSize(t,toInt(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=toInt(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),updateCss(e,t),t.scrollbarXActive?e.classList.add(cls.state.active("x")):(e.classList.remove(cls.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(cls.state.active("y")):(e.classList.remove(cls.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function getThumbSize(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function updateCss(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,set(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,set(e.scrollbarYRail,o),set(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),set(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}function clickRail(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,updateGeometry(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,updateGeometry(t),e.stopPropagation()})}var activeSlider=null;function setupScrollHandlers(t){bindMouseScrollHandler(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"]),bindMouseScrollHandler(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"])}function bindMouseScrollHandler(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()]),activeSlider===a&&(d[l]=u+f*(e[o]-p),addScrollingClass(t,c),updateGeometry(t),e.stopPropagation(),e.preventDefault())}function v(){removeScrollingClass(t,c),t[h].classList.remove(cls.state.clicking),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",v),activeSlider=null}function g(e){null===activeSlider&&(activeSlider=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",v)):(document.addEventListener("mousemove",m),document.addEventListener("mouseup",v)),t[h].classList.add(cls.state.clicking)),e.stopPropagation(),e.cancelable&&e.preventDefault()}t[a].addEventListener("mousedown",g),t[a].addEventListener("touchstart",g)}function keyboard(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",function(i){if(!(i.isDefaultPrevented&&i.isDefaultPrevented()||i.defaultPrevented)&&(matches(e,":hover")||matches(t.scrollbarX,":focus")||matches(t.scrollbarY,":focus"))){var n=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(n){if("IFRAME"===n.tagName)n=n.contentDocument.activeElement;else for(;n.shadowRoot;)n=n.shadowRoot.activeElement;if(isEditable(n))return}var o=0,s=0;switch(i.which){case 37:o=i.metaKey?-t.contentWidth:i.altKey?-t.containerWidth:-30;break;case 38:s=i.metaKey?t.contentHeight:i.altKey?t.containerHeight:30;break;case 39:o=i.metaKey?t.contentWidth:i.altKey?t.containerWidth:30;break;case 40:s=i.metaKey?-t.contentHeight:i.altKey?-t.containerHeight:-30;break;case 32:s=i.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:s=t.containerHeight;break;case 34:s=-t.containerHeight;break;case 36:s=t.contentHeight;break;case 35:s=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==o||t.settings.suppressScrollY&&0!==s||(e.scrollTop-=s,e.scrollLeft+=o,updateGeometry(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}(o,s)&&i.preventDefault())}})}function wheel(t){var e=t.element;function i(i){var n=function(t){var e=t.deltaX,i=-1*t.deltaY;return void 0!==e&&void 0!==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(!env.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var o=t;o&&o!==e;){if(o.classList.contains(cls.element.consuming))return!0;var s=get(o);if(n&&s.overflowY.match(/(scroll|auto)/)){var a=o.scrollHeight-o.clientHeight;if(a>0&&(o.scrollTop>0&&n<0||o.scrollTop<a&&n>0))return!0}if(i&&s.overflowX.match(/(scroll|auto)/)){var r=o.scrollWidth-o.clientWidth;if(r>0&&(o.scrollLeft>0&&i<0||o.scrollLeft<r&&i>0))return!0}o=o.parentNode}return!1}(i.target,o,s)){var a=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=o*t.settings.wheelSpeed,a=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(o?e.scrollLeft+=o*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,a=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=o*t.settings.wheelSpeed),updateGeometry(t),a=a||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),a&&!i.ctrlKey&&(i.stopPropagation(),i.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",i):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",i)}function touch(t){if(env.supportsTouch||env.supportsIePointer){var e=t.element,i={startOffset:{},startTime:0,speed:{},easingLoop:null};env.supportsTouch?(t.event.bind(e,"touchstart",a),t.event.bind(e,"touchmove",r),t.event.bind(e,"touchend",l)):env.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",a),t.event.bind(e,"pointermove",r),t.event.bind(e,"pointerup",l)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",a),t.event.bind(e,"MSPointerMove",r),t.event.bind(e,"MSPointerUp",l)))}function n(i,n){e.scrollTop-=n,e.scrollLeft-=i,updateGeometry(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 a(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 r(a){if(s(a)){var r=o(a),l={pageX:r.pageX,pageY:r.pageY},c=l.pageX-i.startOffset.pageX,h=l.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(cls.element.consuming))return!0;var s=get(o);if(n&&s.overflowY.match(/(scroll|auto)/)){var a=o.scrollHeight-o.clientHeight;if(a>0&&(o.scrollTop>0&&n<0||o.scrollTop<a&&n>0))return!0}if(i&&s.overflowX.match(/(scroll|auto)/)){var r=o.scrollWidth-o.clientWidth;if(r>0&&(o.scrollLeft>0&&i<0||o.scrollLeft<r&&i>0))return!0}o=o.parentNode}return!1}(a.target,c,h))return;n(c,h),i.startOffset=l;var d=(new Date).getTime(),u=d-i.startTime;u>0&&(i.speed.x=c/u,i.speed.y=h/u,i.startTime=d),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&&env.isChrome}else if(a>r&&(i<0&&s===t.contentWidth-t.containerWidth||i>0&&0===s))return!0;return!0}(c,h)&&a.cancelable&&a.preventDefault()}}function l(){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))}}var defaultSettings=function(){return{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}},handlers={"click-rail":clickRail,"drag-thumb":setupScrollHandlers,keyboard:keyboard,wheel:wheel,touch:touch},PerfectScrollbar=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(cls.main),this.settings=defaultSettings(),e)this.settings[n]=e[n];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var o,s,a=function(){return t.classList.add(cls.state.focus)},r=function(){return t.classList.remove(cls.state.focus)};this.isRtl="rtl"===get(t).direction,!0===this.isRtl&&t.classList.add(cls.rtl),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 EventManager,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=div(cls.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=div(cls.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",a),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var l=get(this.scrollbarXRail);this.scrollbarXBottom=parseInt(l.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=toInt(l.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=toInt(l.borderLeftWidth)+toInt(l.borderRightWidth),set(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=toInt(l.marginLeft)+toInt(l.marginRight),set(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=div(cls.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=div(cls.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",a),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var c=get(this.scrollbarYRail);this.scrollbarYRight=parseInt(c.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=toInt(c.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?outerWidth(this.scrollbarY):null,this.railBorderYWidth=toInt(c.borderTopWidth)+toInt(c.borderBottomWidth),set(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=toInt(c.marginTop)+toInt(c.marginBottom),set(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 handlers[t](i)}),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",function(t){return i.onScroll(t)}),updateGeometry(this)};PerfectScrollbar.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,set(this.scrollbarXRail,{display:"block"}),set(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=toInt(get(this.scrollbarXRail).marginLeft)+toInt(get(this.scrollbarXRail).marginRight),this.railYMarginHeight=toInt(get(this.scrollbarYRail).marginTop)+toInt(get(this.scrollbarYRail).marginBottom),set(this.scrollbarXRail,{display:"none"}),set(this.scrollbarYRail,{display:"none"}),updateGeometry(this),processScrollDiff(this,"top",0,!1,!0),processScrollDiff(this,"left",0,!1,!0),set(this.scrollbarXRail,{display:""}),set(this.scrollbarYRail,{display:""}))},PerfectScrollbar.prototype.onScroll=function(t){this.isAlive&&(updateGeometry(this),processScrollDiff(this,"top",this.element.scrollTop-this.lastScrollTop),processScrollDiff(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},PerfectScrollbar.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),remove(this.scrollbarX),remove(this.scrollbarY),remove(this.scrollbarXRail),remove(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},PerfectScrollbar.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=PerfectScrollbar);var Sidebar=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}_inheritsLoose(e,t);var i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.initializeScrollbars(),this.initializeTabs(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.destroyScrollbars(),this.onDestroy()},i.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"]')},i.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)},i.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)},i.initializeScrollbars=function(){this.content&&(this.scrollbar=new PerfectScrollbar(this.content,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX}))},i.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 PerfectScrollbar(n,{wheelSpeed:t.opts.wheelSpeed,wheelPropagation:t.opts.wheelPropagation,minScrollbarLength:t.opts.minScrollbarLength,suppressScrollX:t.opts.suppressScrollX});t.tabScrollbars.set(i,o)}})},i.destroyScrollbars=function(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.tabScrollbars.forEach(function(t){return t.destroy()}),this.tabScrollbars.clear()},i.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)},i.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")}))}},i.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))},i.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()}},i.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)})}},i.toggle=function(){var t=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(t?"close":"open")},i.open=function(){document.body.classList.contains("sidebar-left-open")||this.toggleWithTransition("open")},i.close=function(){document.body.classList.contains("sidebar-left-open")&&this.toggleWithTransition("close")},e}(Component);Sidebar.DEFAULTS={floating:!0,breakpoint:1046,wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0,onInit:null,onDestroy:null,onShow:null,onClose:null};var ResizeManager=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}(),ScrollManager=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}(),resizeManager=new ResizeManager,scrollManager=new ScrollManager,debounce=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)}},touchEvents=function(){var t=!1;return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(t=!0),t},generateUUID=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)})},escapeHtml=function(t){var e=document.createTextNode(t),i=document.createElement("p");return i.appendChild(e),i.innerHTML},playAnimation=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()},escapeChar=function(t){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"}[t]},escape=function(t){if("string"!=typeof t){if(null===t)return"";if(!t)return String(t);t=String(t)}return/[&<>"'`=]/.test(t)?t.replace(/[&<>"'`=]/g,escapeChar):t},Popover=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}_inheritsLoose(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 i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$popover&&(this.$popover.remove(),this.$popover=null),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},i.update=function(){this.buildCache(),this.$popover&&this.setPosition(),this.onUpdate()},i.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-"+generateUUID(),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())},i.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()})},resizeManager.observe(this.el,this._resizeCallback))},i.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this._resizeCallback&&(resizeManager.unobserve(this.el),this._resizeCallback=null)},i.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))})},i.setPosition=function(t){var e=this;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 S=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},E=S(C);"bottom"===t&&E.bottom&&!E.top?(w="top",C=$("top",y)):"top"===t&&E.top&&!E.bottom?(w="bottom",C=$("bottom",y)):"right"===t&&E.right&&!E.left?(w="left",C=$("left",y)):"left"===t&&E.left&&!E.right&&(w="right",C=$("right",y));var T=S(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 I=S(C);I.left?C.x+=5-(h.left+C.x):I.right&&(C.x-=h.left+C.x+a-(o-5)),I.top?C.y+=5-(h.top+C.y):I.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)},i.show=function(){this.$popover||(this.buildPopover(),this.setPosition(),this.$popover.addClass("show"),this.$el.attr("data-popover",this.id),this.onShow())},i.close=function(){this.$popover&&(this.$popover.remove(),this.$el.removeAttr("data-popover"),this.$popover=null,this.onClose())},e}(Component);Popover.NAME="coolPopover",Popover.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},Popover._jQueryInit(),"undefined"==typeof window||window.PerfectScrollbar||(window.PerfectScrollbar=PerfectScrollbar);var Select=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}_inheritsLoose(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 i=e.prototype;return i.init=function(){this.buildCache(),this.buildScroll(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},i.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()})},i.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))},i.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()},i._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()}},i._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">'+escape(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()},i.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"}),touchEvents()?this.$scrollableContent.css({"overflow-y":"auto"}):(!1===this.useNativeScroll&&(this.$scrollableContent.addClass("ps-dark"),this.scroll=new PerfectScrollbar(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))}},i.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()})})},i.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(escape($(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,debounce(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()})})},resizeManager.observe(document.body,this._resizeCallback)))},i.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),$(document).off("touchstart click."+this.constructor.NAME),"fixed"===this.opts.position&&(this._scrollCallback&&(scrollManager.remove("select-"+this.name),this._scrollCallback=null),this._resizeCallback&&(resizeManager.unobserve(document.body),this._resizeCallback=null))},i.getData=function(t){return t?this.data[t]:this.data},i.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))}},i._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">'+escape(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)},i.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()},i._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 S=p-r-l;e.css({height:p+"px"}),this.$scrollableContent&&this.$scrollableContent.length&&this.$scrollableContent.css({"max-height":S+"px"}),this.opts.position,e.css({top:u}),this.scroll&&setTimeout(function(){t._updateScrollbarVisibility()},0)},i.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,S=e-50;(v=C<d&&S>C)?g=e-(b=Math.min(d,S))-w:(b=Math.min(d,C),g=e+r+y)}else{var E=this.$container.offset(),T=c-(E.top-h)-r-50,I=E.top-h-50;(v=T<d&&I>T)?g=-(b=Math.min(d,I))-w:(b=Math.min(d,T),g=r+y)}var x=b-u-p;a.css({height:b+"px"}),this.$scrollableContent&&this.$scrollableContent.length&&this.$scrollableContent.css({"max-height":x+"px"}),this.$el.toggleClass("select-dropup",v),this.$el.toggleClass("select-dropdown",!v);var A=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)":A>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&&scrollManager.add("select-"+this.name,this._scrollCallback),this.onShow()}},i.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&&scrollManager.remove("select-"+this.name),this.onClose()}},i.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)},i.getItem=function(t,e){var i=$.grep(this.items,function(i){return i[t]==e})[0];return i||null},i.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},i.getSelectedItem=function(t){return this.getSelectedItems(t)[0]},i._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},i._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?escape(i):i)+"\n </span>\n </label>\n </div>\n </div>\n </div>"},i._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""},i._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 ":""},i.isSearchApiEnabled=function(){return this.searchApi&&this.searchApi.length},i._showSpinner=function(){var t=this.opts.faPro?"fal":"fas";this.$searchIconContainer.html('<i class="'+t+' fa-spinner-third fa-spin icon"></i>')},i._hideSpinner=function(){var t=this.opts.faPro?"fal":"fas";this.$searchIconContainer.html('<i class="'+t+' fa-search icon"></i>')},i.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},i.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}(Component);Select.NAME="coolSelect",Select.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},Select._jQueryInit(),"undefined"==typeof window||window.PerfectScrollbar||(window.PerfectScrollbar=PerfectScrollbar);var Dropdown=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}_inheritsLoose(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 i=e.prototype;return i.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()}))},resizeManager.observe(this.$el[0],this._resizeCallback),resizeManager.observe(document.body,this._resizeCallback),this.$container.length&&resizeManager.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}))},i.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()}))},scrollManager.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()}}},i.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]))},i.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")})},i.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()},i.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")})},i.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-"+generateUUID(),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()})})},i.buildScroll=function(){this.opts.scroll&&this.$scrollableContent.length&&(this.$scrollableContent.css({"max-height":this.scrollContentHeight+"px"}),touchEvents()?this.$scrollableContent.css({"overflow-y":"auto"}):this.scroll=new PerfectScrollbar(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,suppressScrollX:!0,scrollYMarginOffset:2}))},i.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()},i.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&&(resizeManager.unobserve(this.$el[0]),resizeManager.unobserve(document.body),this.$container.length&&resizeManager.unobserve(this.$container[0]),this._resizeCallback=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._scrollCallback&&(scrollManager.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)},i.setPosition=function(t){var e=this;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,S=w(t);if(this.positionObserver){var E=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=E(S,0,this.align);"bottom"===t&&T.bottom&&!T.top?(y="top",S=w("top",C)):"top"===t&&T.top&&!T.bottom?(y="bottom",S=w("bottom",C)):"right"===t&&T.right&&!T.left?(y="left",S=w("left",C)):"left"===t&&T.left&&!T.right&&(y="right",S=w("right",C));var I=E(S,0,C);if("top"!==y&&"bottom"!==y||("end"===C&&I.left&&!I.right?S=w(y,C="start"):"start"===C&&I.right&&!I.left&&(S=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)S.x=Math.max(5,Math.min(S.x,s-r-5)),S.y=Math.max(5,Math.min(S.y,a-l-5));else{var x=o.left+(S.x-i),A=o.top+(S.y-n);x<5?S.x+=5-x:x+r>s-5&&(S.x-=x+r-s+5),A<5?S.y+=5-A:A+l>a-5&&(S.y-=A+l-a+5)}}if(f=S.x,m=S.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 k=this.$el.closest(".dropdown, .dropup, .dropleft, .dropright");if(k.length){var _=k.offset(),L=this.$el.offset(),M=L.left-_.left,D=L.top-_.top;switch(y){case"bottom":D+=h+$,"end"===C&&(M=M+c-r);break;case"top":D-=l+$,"end"===C&&(M=M+c-r);break;case"left":M-=r+$;break;case"right":M+=c+$}M+=v,D+=g,this.$dropdown.css({position:"absolute",top:Math.round(D)+"px",left:Math.round(M)+"px",right:"auto",bottom:"auto",transform:"none","will-change":"auto"})}}},i.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),playAnimation(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()}},i.close=function(){var t=this;this.$dropdown&&!this.preventClose&&(this.animation&&!this.$dropdown.hasClass("animation")?playAnimation(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())},i.onItemClick=function(t,e){var i=this.opts.onItemClick;"function"==typeof i&&i.call(t,e,this)},e}(Component);Dropdown.NAME="coolDropdown",Dropdown.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"},Dropdown._jQueryInit();var Tooltip=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}_inheritsLoose(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 i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$tooltip&&(this.$tooltip.remove(),this.$tooltip=null),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},i.update=function(){this.buildCache(),this.$tooltip&&this.setPosition(),this.onUpdate()},i.buildCache=function(){this.$el=$(this.el),this.$container=this.$el.data("container")?$(this.$el.data("container")):$(this.opts.container),this.id="tooltip-"+generateUUID(),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},i.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()})},resizeManager.observe(this.el,this._resizeCallback))},i.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this._resizeCallback&&(resizeManager.unobserve(this.el),this._resizeCallback=null)},i.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")},i.setPosition=function(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}},i.show=function(){this.$tooltip||(this.buildTooltip(),this.setPosition(),this.animation?(this.$tooltip.addClass(this.animationSpeed),playAnimation(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())},i.close=function(){var t=this;this.$tooltip&&(this.animation&&!this.$tooltip.hasClass("animation")?playAnimation(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}(Component);Tooltip.NAME="coolTooltip",Tooltip.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},Tooltip._jQueryInit();var Collapse=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}_inheritsLoose(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 i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},i.update=function(){this.buildCache(),this.onUpdate()},i.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]}},i.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)},i.unbindEvents=function(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this.$el.off("."+this.constructor.NAME)},i.toggle=function(){this.expanded?this.close():this.show()},i.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())},i.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}(Component);Collapse.NAME="coolCollapse",Collapse.DEFAULTS={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null},Collapse._jQueryInit();var _Toast$DEFAULTS,SectionTabs=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}_inheritsLoose(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 i=e.prototype;return i.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()})},i.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()},i.update=function(){this.buildCache(),this.onUpdate()},i.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},i.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=debounce(function(){t.checkForChanges()},50),window.addEventListener("resize",this._resizeHandler,{passive:!0}))},i.unbindEvents=function(){this.$el.off("."+this.constructor.NAME),this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler)},i.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())},i.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)}},i.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},i.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)},i.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}(Component);SectionTabs.NAME="coolSectionTabs",SectionTabs.DEFAULTS={onInit:null,onUpdate:null,onDestroy:null},SectionTabs._jQueryInit();var _Dialog$DEFAULTS,Toast=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}_inheritsLoose(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 i=e.prototype;return i.isSimilarToast=function(t){return!!this.lastToastContent&&this.lastToastContent===t.content},i.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()},i.processQueue=function(){if(this.processingQueue&&this.queue.shift(),this.queue.length)return this.processingQueue=!0,this.show(this.queue[0]);this.processingQueue=!1},i.init=function(t){var e={};$.extend(!0,e,this.settings,t);var i=this.buildToast(e);return this.addQueue(i),this.onInit(i),i},i.destroy=function(){this.$container.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},i.buildToast=function(t){var e={uuid:"toast-"+generateUUID(),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},i.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}))},i.setPosition=function(t,e,i,n){if(null==i&&(i=t.placementY),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"})},i.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),playAnimation(t.$inner,t.animationIn)):t.$el.addClass("show"),t.dismiss&&setTimeout(function(){e.close(t)},1e3*t.dismiss),this.onShow(t)},i.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"),playAnimation(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))},i.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},i.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},i.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},i.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},i.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},i._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}(Component);Toast.NAME="coolToast",Toast.DEFAULTS=((_Toast$DEFAULTS={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,_Toast$DEFAULTS.onShow=null,_Toast$DEFAULTS.onClose=null,_Toast$DEFAULTS),Toast._jQueryInit();var Dialog=function(t){function e(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}_inheritsLoose(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 i=e.prototype;return i.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},i.destroy=function(){this.$container.removeData("plugin_"+this.constructor.NAME),this.onDestroy()},i.buildDialog=function(t){var e=this,i={uuid:"dialog-"+generateUUID(),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},i.bindEvents=function(t){var e=this;if(t.$el.on("click","[data-dialog-action], [data-dialog-confirm], [data-dialog-close], [data-dialog-remove]",function(i){if(i.preventDefault(),t.actionInProgress)i.stopPropagation();else{t.actionInProgress=!0;var n=["confirm","close","remove"],o=$(this).data("dialogAction");if(!o)for(var s,a=_createForOfIteratorHelperLoose(n);!(s=a()).done;){var r=s.value;if($(this).is("[data-dialog-"+r+"]")){o=r;break}}var l=t.actions[o]||{};t.$el.trigger("dialog."+o);var c="function"==typeof l.callback?l.callback:"function"==typeof t.callbacks[o]?t.callbacks[o]:null,h=function(e){void 0===e&&(e=!1),e?t.actionInProgress=!1:setTimeout(function(){t.actionInProgress=!1},t.actionThreshold)};if("function"==typeof c)try{var d=c.call(e,function(){n.includes(o)&&e.close(t),h()},t);d&&"function"==typeof d.then?d.then(function(t){!1===t&&h()}).catch(function(t){console.error("Dialog action error:",t),h()}):h()}catch(t){console.error("Dialog action error:",t),h()}else n.includes(o)?(e.close(t),h()):h()}}),null!==t.maxBodyHeight&&"full"!==t.size){var i=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=i();t.$el.find(".dialog-body").css("--cool-dialog-body-height",e+"px")})}),t.resizeObserver.observe(document.body);else{var n,o=window.orientation;t.resizeHandler=function(){clearTimeout(n);var e=performance.now(),s=window.orientation!==o;if(s&&(o=window.orientation),!t.lastResizeTime||e-t.lastResizeTime>100||s){var a=i();t.$el.find(".dialog-body").css("--cool-dialog-body-height",a+"px"),t.lastResizeTime=e}else n=setTimeout(function(){var e=i();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})}}},i.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");playAnimation(s,t.animationIn)}this.onShow(t)},i.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?playAnimation(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)},i.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},i.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},i.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},i.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},i.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},i._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&&(void 0===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""},i._renderHeader=function(t){var e='\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 '+escapeHtml(t.title)+"\n </span>\n "+e+"\n </div>\n ":'<div class="dialog-header">'+e+"</div>"},i._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 "},e}(Component);Dialog.NAME="coolDialog",Dialog.DEFAULTS=((_Dialog$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}).onDestroy=null,_Dialog$DEFAULTS.onShow=null,_Dialog$DEFAULTS.onClose=null,_Dialog$DEFAULTS.callbacks={},_Dialog$DEFAULTS.actions={},_Dialog$DEFAULTS),Dialog._jQueryInit(),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};var Common=function(){function t(){}return t.refresh=function(){this._sectionInstance&&this._sectionInstance.refresh&&this._sectionInstance.refresh(),Popover.initializeElements('[data-toggle="popover"]',window.Cool.settings.popover),Select.initializeElements('[data-toggle="select"]',window.Cool.settings.select),Dropdown.initializeElements('[data-toggle="dropdown"]',window.Cool.settings.dropdown),Tooltip.initializeElements('[data-toggle="tooltip"]',window.Cool.settings.tooltip),Collapse.initializeElements('[data-toggle="collapse"]',window.Cool.settings.collapse),SectionTabs.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 Section(t.section)),Popover.initializeElements('[data-toggle="popover"]',t.popover),Select.initializeElements('[data-toggle="select"]',t.select),Dropdown.initializeElements('[data-toggle="dropdown"]',t.dropdown),Tooltip.initializeElements('[data-toggle="tooltip"]',t.tooltip),Collapse.initializeElements('[data-toggle="collapse"]',t.collapse),SectionTabs.initializeElements('[data-toggle="section-tabs"]',t.sectionTabs);var e=document.querySelector(".sidebar-left");e&&(this._sidebarInstance=new Sidebar(e,t.sidebar)),new Toast(document.body,t.toast),new Dialog(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=Popover.initializeElement(t,window.Cool.settings.popover);break;case"select":e=Select.initializeElement(t,window.Cool.settings.select);break;case"dropdown":e=Dropdown.initializeElement(t,window.Cool.settings.dropdown);break;case"tooltip":e=Tooltip.initializeElement(t,window.Cool.settings.tooltip);break;case"collapse":e=Collapse.initializeElement(t,window.Cool.settings.collapse);break;case"section-tabs":e=SectionTabs.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 resizeManager.observe(t,e);console.warn("Cool.observeResize requires an element and a callback function")},t.unobserveResize=function(t){t?resizeManager.unobserve(t):console.warn("Cool.unobserveResize requires an element")},t.addScrollListener=function(t,e){t&&"function"==typeof e?scrollManager.add(t,e):console.warn("Cool.addScrollListener requires an id and a callback function")},t.removeScrollListener=function(t){t?scrollManager.remove(t):console.warn("Cool.removeScrollListener requires an id")},t.getSidebar=function(){return this._sidebarInstance},t.getSection=function(){return this._sectionInstance},t}();Common._sidebarInstance=null,Common._sectionInstance=null,window.Cool.initialize=Common.initialize.bind(Common),window.Cool.initComponent=Common.initComponent.bind(Common),window.Cool.refresh=Common.refresh.bind(Common),window.Cool.destroy=Common.destroy.bind(Common),window.Cool.observeResize=Common.observeResize.bind(Common),window.Cool.unobserveResize=Common.unobserveResize.bind(Common),window.Cool.addScrollListener=Common.addScrollListener.bind(Common),window.Cool.removeScrollListener=Common.removeScrollListener.bind(Common),window.Cool.getSidebar=Common.getSidebar.bind(Common),window.Cool.getSection=Common.getSection.bind(Common);const index_esm={Common:Common,Sidebar:Sidebar,Popover:Popover,Select:Select,Dropdown:Dropdown,Tooltip:Tooltip,SectionTabs:SectionTabs,Collapse:Collapse,Toast:Toast,Dialog:Dialog};export{index_esm as default};
12
13
  //# sourceMappingURL=cool.esm.min.js.map