@finqu/cool 1.2.29 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +694 -1
  2. package/dist/css/cool.css +26902 -14322
  3. package/dist/css/cool.css.map +1 -154
  4. package/dist/css/cool.min.css +2 -7
  5. package/dist/css/cool.min.css.map +1 -1
  6. package/dist/js/cool.bundle.js +16191 -5588
  7. package/dist/js/cool.bundle.js.map +1 -1
  8. package/dist/js/cool.bundle.min.js +13 -8
  9. package/dist/js/cool.bundle.min.js.map +1 -1
  10. package/dist/js/cool.esm.js +4722 -4812
  11. package/dist/js/cool.esm.js.map +1 -1
  12. package/dist/js/cool.esm.min.js +4 -9
  13. package/dist/js/cool.esm.min.js.map +1 -1
  14. package/dist/js/cool.js +5143 -5240
  15. package/dist/js/cool.js.map +1 -1
  16. package/dist/js/cool.min.js +4 -9
  17. package/dist/js/cool.min.js.map +1 -1
  18. package/package.json +125 -60
  19. package/scss/LISENCE +1 -1
  20. package/scss/_badge.scss +134 -102
  21. package/scss/_button-group.scss +80 -129
  22. package/scss/_buttons.scss +257 -201
  23. package/scss/_dark.scss +637 -0
  24. package/scss/_dialog.scss +314 -123
  25. package/scss/_dropdown.scss +165 -233
  26. package/scss/_forms.scss +555 -200
  27. package/scss/_frame.scss +945 -624
  28. package/scss/_grid.scss +215 -35
  29. package/scss/_input-group.scss +326 -285
  30. package/scss/_list-group.scss +127 -82
  31. package/scss/_media.scss +439 -0
  32. package/scss/_navbar.scss +116 -284
  33. package/scss/_notification.scss +111 -9
  34. package/scss/_pagination.scss +82 -88
  35. package/scss/_popover.scss +61 -167
  36. package/scss/_reboot.scss +306 -284
  37. package/scss/_root.scss +848 -15
  38. package/scss/_section.scss +735 -977
  39. package/scss/_select.scss +559 -187
  40. package/scss/_tables.scss +471 -595
  41. package/scss/_tabs.scss +50 -178
  42. package/scss/_toast.scss +242 -147
  43. package/scss/_tooltip.scss +130 -101
  44. package/scss/_typography.scss +166 -0
  45. package/scss/_variables.scss +1154 -748
  46. package/scss/cool.scss +64 -32
  47. package/scss/utilities/_align.scss +51 -41
  48. package/scss/utilities/_animation.scss +165 -0
  49. package/scss/utilities/_background.scss +72 -14
  50. package/scss/utilities/_borders.scss +205 -146
  51. package/scss/utilities/_collapse.scss +20 -25
  52. package/scss/utilities/_cursor.scss +160 -22
  53. package/scss/utilities/_display.scss +116 -16
  54. package/scss/utilities/_embed.scss +89 -78
  55. package/scss/utilities/_fill.scss +79 -0
  56. package/scss/utilities/_filters.scss +233 -0
  57. package/scss/utilities/_flex.scss +216 -52
  58. package/scss/utilities/_grid.scss +136 -0
  59. package/scss/utilities/_opacity.scss +131 -0
  60. package/scss/utilities/_overflow.scss +242 -6
  61. package/scss/utilities/_perfect-scrollbar.scss +147 -141
  62. package/scss/utilities/_pointer-events.scss +125 -0
  63. package/scss/utilities/_position.scss +130 -30
  64. package/scss/utilities/_screen-readers.scss +95 -0
  65. package/scss/utilities/_shadows.scss +195 -0
  66. package/scss/utilities/_sizing.scss +288 -32
  67. package/scss/utilities/_spacing.scss +168 -92
  68. package/scss/utilities/_stroke.scss +124 -0
  69. package/scss/utilities/_text.scss +420 -99
  70. package/scss/utilities/_transform.scss +232 -0
  71. package/scss/utilities/_transitions.scss +147 -0
  72. package/scss/utilities/_user-select.scss +89 -10
  73. package/scss/utilities/_visibility.scss +62 -6
  74. package/scss/utilities/_z-index.scss +169 -0
  75. package/.babelrc.js +0 -20
  76. package/.browserslistrc +0 -13
  77. package/build/.eslintrc.json +0 -10
  78. package/build/banner.js +0 -14
  79. package/build/build-plugins.js +0 -92
  80. package/build/rollup.config.js +0 -46
  81. package/dist/css/cool-grid.css +0 -4390
  82. package/dist/css/cool-grid.css.map +0 -30
  83. package/dist/css/cool-grid.min.css +0 -7
  84. package/dist/css/cool-grid.min.css.map +0 -1
  85. package/dist/css/cool-reboot.css +0 -286
  86. package/dist/css/cool-reboot.css.map +0 -62
  87. package/dist/css/cool-reboot.min.css +0 -7
  88. package/dist/css/cool-reboot.min.css.map +0 -1
  89. package/html/index.html +0 -2703
  90. package/js/dist/collapse.js +0 -5535
  91. package/js/dist/collapse.js.map +0 -1
  92. package/js/dist/common.js +0 -21996
  93. package/js/dist/common.js.map +0 -1
  94. package/js/dist/cooldropdown.js +0 -467
  95. package/js/dist/cooldropdown.js.map +0 -1
  96. package/js/dist/coolpopover.js +0 -391
  97. package/js/dist/coolpopover.js.map +0 -1
  98. package/js/dist/coolsectiontabs.js +0 -256
  99. package/js/dist/coolsectiontabs.js.map +0 -1
  100. package/js/dist/coolselect.js +0 -796
  101. package/js/dist/coolselect.js.map +0 -1
  102. package/js/dist/cooltooltip.js +0 -360
  103. package/js/dist/cooltooltip.js.map +0 -1
  104. package/js/dist/coolui.js +0 -73
  105. package/js/dist/coolui.js.map +0 -1
  106. package/js/dist/dropdown.js +0 -27421
  107. package/js/dist/dropdown.js.map +0 -1
  108. package/js/dist/popover.js +0 -9472
  109. package/js/dist/popover.js.map +0 -1
  110. package/js/dist/sectiontabs.js +0 -4483
  111. package/js/dist/sectiontabs.js.map +0 -1
  112. package/js/dist/select.js +0 -37080
  113. package/js/dist/select.js.map +0 -1
  114. package/js/dist/tooltip.js +0 -8786
  115. package/js/dist/tooltip.js.map +0 -1
  116. package/js/index.esm.js +0 -21
  117. package/js/index.umd.js +0 -21
  118. package/js/src/abstract-ui-component.js +0 -81
  119. package/js/src/collapse.js +0 -286
  120. package/js/src/common.js +0 -296
  121. package/js/src/dialog.js +0 -579
  122. package/js/src/dropdown.js +0 -525
  123. package/js/src/popover.js +0 -632
  124. package/js/src/section-tabs.js +0 -215
  125. package/js/src/select.js +0 -1342
  126. package/js/src/toast.js +0 -581
  127. package/js/src/tooltip.js +0 -591
  128. package/js/src/util/animate-css.js +0 -22
  129. package/js/src/util/index.js +0 -122
  130. package/js/src/util/perfect-scrollbar.js +0 -1316
  131. package/less/alert.less +0 -345
  132. package/less/badge.less +0 -38
  133. package/less/bootstrap-noconflict.less +0 -23
  134. package/less/bootstrap.less +0 -23
  135. package/less/button-group.less +0 -153
  136. package/less/buttons.less +0 -287
  137. package/less/dialog-noconflict.less +0 -174
  138. package/less/dialog.less +0 -203
  139. package/less/dropdown.less +0 -209
  140. package/less/forms.less +0 -770
  141. package/less/images.less +0 -242
  142. package/less/input-group.less +0 -163
  143. package/less/list-group.less +0 -73
  144. package/less/mixins/aspect-ratio.less +0 -23
  145. package/less/mixins/border-radius.less +0 -24
  146. package/less/mixins/box-shadow.less +0 -4
  147. package/less/mixins/buttons.less +0 -17
  148. package/less/mixins/caret.less +0 -51
  149. package/less/mixins/clearfix.less +0 -10
  150. package/less/mixins/gradients.less +0 -34
  151. package/less/mixins/nav-divider.less +0 -7
  152. package/less/mixins/object-fit.less +0 -13
  153. package/less/mixins/reset-text.less +0 -16
  154. package/less/mixins.less +0 -11
  155. package/less/package.json +0 -11
  156. package/less/pagination.less +0 -69
  157. package/less/popover.less +0 -143
  158. package/less/project.sublime-workspace +0 -774
  159. package/less/reboot.less +0 -235
  160. package/less/section.less +0 -793
  161. package/less/select.less +0 -150
  162. package/less/tables.less +0 -737
  163. package/less/tabs.less +0 -162
  164. package/less/tooltip.less +0 -87
  165. package/less/type.less +0 -71
  166. package/less/utilities/align.less +0 -27
  167. package/less/utilities/animate.less +0 -3512
  168. package/less/utilities/background.less +0 -70
  169. package/less/utilities/borders.less +0 -16
  170. package/less/utilities/color.less +0 -70
  171. package/less/utilities/cursor.less +0 -8
  172. package/less/utilities/display.less +0 -38
  173. package/less/utilities/embed.less +0 -61
  174. package/less/utilities/flex.less +0 -76
  175. package/less/utilities/jquery-ui.less +0 -116
  176. package/less/utilities/lazyload.less +0 -29
  177. package/less/utilities/overflow.less +0 -11
  178. package/less/utilities/pace.less +0 -25
  179. package/less/utilities/placeholder.less +0 -60
  180. package/less/utilities/position.less +0 -42
  181. package/less/utilities/scrollbar.less +0 -152
  182. package/less/utilities/spacing.less +0 -197
  183. package/less/utilities/text.less +0 -68
  184. package/less/utilities/transform.less +0 -7
  185. package/less/utilities.less +0 -21
  186. package/less/variables.less +0 -343
  187. package/scss/_alert.scss +0 -102
  188. package/scss/_custom-forms.scss +0 -444
  189. package/scss/_functions.scss +0 -124
  190. package/scss/_images.scss +0 -361
  191. package/scss/_mixins.scss +0 -34
  192. package/scss/_type.scss +0 -129
  193. package/scss/_utilities.scss +0 -23
  194. package/scss/cool-grid.scss +0 -29
  195. package/scss/cool-reboot.scss +0 -11
  196. package/scss/mixins/_alert-variant.scss +0 -20
  197. package/scss/mixins/_aspect-ratio.scss +0 -29
  198. package/scss/mixins/_background-variant.scss +0 -25
  199. package/scss/mixins/_badge-variant.scss +0 -36
  200. package/scss/mixins/_breakpoints.scss +0 -102
  201. package/scss/mixins/_buttons.scss +0 -104
  202. package/scss/mixins/_caret.scss +0 -80
  203. package/scss/mixins/_clearfix.scss +0 -10
  204. package/scss/mixins/_float.scss +0 -14
  205. package/scss/mixins/_forms.scss +0 -67
  206. package/scss/mixins/_gradients.scss +0 -40
  207. package/scss/mixins/_grid-framework.scss +0 -72
  208. package/scss/mixins/_grid.scss +0 -60
  209. package/scss/mixins/_nav-divider.scss +0 -9
  210. package/scss/mixins/_notification-variant.scss +0 -7
  211. package/scss/mixins/_object-fit.scss +0 -16
  212. package/scss/mixins/_reset-text.scss +0 -19
  213. package/scss/mixins/_text-emphasis.scss +0 -21
  214. package/scss/mixins/_text-hide.scss +0 -10
  215. package/scss/mixins/_text-truncate.scss +0 -81
  216. package/scss/mixins/_visibility.scss +0 -7
  217. package/scss/project.sublime-workspace +0 -491
  218. package/scss/utilities/_animate.scss +0 -3512
  219. package/scss/utilities/_clearfix.scss +0 -6
  220. package/scss/utilities/_lazyload.scss +0 -31
  221. package/scss/utilities/_placeholder.scss +0 -77
@@ -1,12 +1,7 @@
1
1
  /*!
2
- * Cool UI v1.2.29 (https://finqu.fi)
3
- * Copyright 2011-2021 Finqu Oy
4
- * Licensed under the ISC license - (http://opensource.org/licenses/ISC)
2
+ * Cool v2.0.2 (https://github.com/finqu/cool#readme)
3
+ * Copyright 2020-2026 Finqu Oy
4
+ * Licensed under ISC
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t=t||self).cool=e()}(this,function(){"use strict";
7
- /*!
8
- * perfect-scrollbar v1.4.0
9
- * (c) 2018 Hyunje Jun
10
- * @license MIT
11
- */function t(t){return getComputedStyle(t)}function e(t,e){for(var i in e){var o=e[i];"number"==typeof o&&(o+="px"),t.style[i]=o}return t}function i(t){var e=document.createElement("div");return e.className=t,e}var o="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function n(t,e){if(!o)throw new Error("No element matching method supported");return o.call(t,e)}function s(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function a(t,e){return Array.prototype.filter.call(t.children,function(t){return n(t,e)})}var l={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}}},r={x:null,y:null};function h(t,e){var i=t.element.classList,o=l.state.scrolling(e);i.contains(o)?clearTimeout(r[e]):i.add(o)}function c(t,e){r[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(l.state.scrolling(e))},t.settings.scrollingThreshold)}var d=function(t){this.element=t,this.handlers={}},p={isEmpty:{configurable:!0}};d.prototype.bind=function(t,e){"undefined"==typeof this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},d.prototype.unbind=function(t,e){var i=this;this.handlers[t]=this.handlers[t].filter(function(o){return!(!e||o===e)||(i.element.removeEventListener(t,o,!1),!1)})},d.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},p.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(d.prototype,p);var u=function(){this.eventElements=[]};function f(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}u.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new d(t),this.eventElements.push(e)),e},u.prototype.bind=function(t,e,i){this.eventElement(t).bind(e,i)},u.prototype.unbind=function(t,e,i){var o=this.eventElement(t);o.unbind(e,i),o.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(o),1)},u.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},u.prototype.once=function(t,e,i){var o=this.eventElement(t);o.bind(e,function t(n){o.unbind(e,t),i(n)})};var g=function(t,e,i,o,n){var s;if(void 0===o&&(o=!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"]}!function(t,e,i,o,n){var s=i[0],a=i[1],l=i[2],r=i[3],d=i[4],p=i[5];void 0===o&&(o=!0);void 0===n&&(n=!1);var u=t.element;t.reach[r]=null,u[l]<1&&(t.reach[r]="start");u[l]>t[s]-t[a]-1&&(t.reach[r]="end");e&&(u.dispatchEvent(f("ps-scroll-"+r)),e<0?u.dispatchEvent(f("ps-scroll-"+d)):e>0&&u.dispatchEvent(f("ps-scroll-"+p)),o&&function(t,e){h(t,e),c(t,e)}(t,r));t.reach[r]&&(e||n)&&u.dispatchEvent(f("ps-"+r+"-reach-"+t.reach[r]))}(t,i,s,o,n)};function m(t){return parseInt(t,10)||0}var v={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)},b=function(t){var i=t.element,o=Math.floor(i.scrollTop);t.containerWidth=i.clientWidth,t.containerHeight=i.clientHeight,t.contentWidth=i.scrollWidth,t.contentHeight=i.scrollHeight,i.contains(t.scrollbarXRail)||(a(i,l.element.rail("x")).forEach(function(t){return s(t)}),i.appendChild(t.scrollbarXRail)),i.contains(t.scrollbarYRail)||(a(i,l.element.rail("y")).forEach(function(t){return s(t)}),i.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=w(t,m(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=m((t.negativeScrollAdjustment+i.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=w(t,m(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=m(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),function(t,i){var o={width:i.railXWidth},n=Math.floor(t.scrollTop);i.isRtl?o.left=i.negativeScrollAdjustment+t.scrollLeft+i.containerWidth-i.contentWidth:o.left=t.scrollLeft;i.isScrollbarXUsingBottom?o.bottom=i.scrollbarXBottom-n:o.top=i.scrollbarXTop+n;e(i.scrollbarXRail,o);var s={top:n,height:i.railYHeight};i.isScrollbarYUsingRight?i.isRtl?s.right=i.contentWidth-(i.negativeScrollAdjustment+t.scrollLeft)-i.scrollbarYRight-i.scrollbarYOuterWidth:s.right=i.scrollbarYRight-t.scrollLeft:i.isRtl?s.left=i.negativeScrollAdjustment+t.scrollLeft+2*i.containerWidth-i.contentWidth-i.scrollbarYLeft-i.scrollbarYOuterWidth:s.left=i.scrollbarYLeft+t.scrollLeft;e(i.scrollbarYRail,s),e(i.scrollbarX,{left:i.scrollbarXLeft,width:i.scrollbarXWidth-i.railBorderXWidth}),e(i.scrollbarY,{top:i.scrollbarYTop,height:i.scrollbarYHeight-i.railBorderYWidth})}(i,t),t.scrollbarXActive?i.classList.add(l.state.active("x")):(i.classList.remove(l.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,i.scrollLeft=0),t.scrollbarYActive?i.classList.add(l.state.active("y")):(i.classList.remove(l.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,i.scrollTop=0)};function w(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 x(t,e){var i=e[0],o=e[1],n=e[2],s=e[3],a=e[4],r=e[5],d=e[6],p=e[7],u=e[8],f=t.element,g=null,m=null,$=null;function v(e){f[d]=g+$*(e[n]-m),h(t,p),b(t),e.stopPropagation(),e.preventDefault()}function w(){c(t,p),t[u].classList.remove(l.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",v)}t.event.bind(t[a],"mousedown",function(e){g=f[d],m=e[n],$=(t[o]-t[i])/(t[s]-t[r]),t.event.bind(t.ownerDocument,"mousemove",v),t.event.once(t.ownerDocument,"mouseup",w),t[u].classList.add(l.state.clicking),e.stopPropagation(),e.preventDefault()})}var y={"click-rail":function(t){t.event.bind(t.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarYRail,"mousedown",function(e){var i=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=i*t.containerHeight,b(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,b(t),e.stopPropagation()})},"drag-thumb":function(t){x(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),x(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",function(i){if(!(i.isDefaultPrevented&&i.isDefaultPrevented()||i.defaultPrevented)&&(n(e,":hover")||n(t.scrollbarX,":focus")||n(t.scrollbarY,":focus"))){var o,s=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(s){if("IFRAME"===s.tagName)s=s.contentDocument.activeElement;else for(;s.shadowRoot;)s=s.shadowRoot.activeElement;if(n(o=s,"input,[contenteditable]")||n(o,"select,[contenteditable]")||n(o,"textarea,[contenteditable]")||n(o,"button,[contenteditable]"))return}var a=0,l=0;switch(i.which){case 37:a=i.metaKey?-t.contentWidth:i.altKey?-t.containerWidth:-30;break;case 38:l=i.metaKey?t.contentHeight:i.altKey?t.containerHeight:30;break;case 39:a=i.metaKey?t.contentWidth:i.altKey?t.containerWidth:30;break;case 40:l=i.metaKey?-t.contentHeight:i.altKey?-t.containerHeight:-30;break;case 32:l=i.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:l=t.containerHeight;break;case 34:l=-t.containerHeight;break;case 36:l=t.contentHeight;break;case 35:l=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==a||t.settings.suppressScrollY&&0!==l||(e.scrollTop-=l,e.scrollLeft+=a,b(t),function(i,o){var n=Math.floor(e.scrollTop);if(0===i){if(!t.scrollbarYActive)return!1;if(0===n&&o>0||n>=t.contentHeight-t.containerHeight&&o<0)return!t.settings.wheelPropagation}var s=e.scrollLeft;if(0===o){if(!t.scrollbarXActive)return!1;if(0===s&&i<0||s>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}(a,l)&&i.preventDefault())}})},wheel:function(e){var i=e.element;function o(o){var n=function(t){var e=t.deltaX,i=-1*t.deltaY;return"undefined"!=typeof e&&"undefined"!=typeof i||(e=-1*t.wheelDeltaX/6,i=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,i*=10),e!=e&&i!=i&&(e=0,i=t.wheelDelta),t.shiftKey?[-i,-e]:[e,i]}(o),s=n[0],a=n[1];if(!function(e,o,n){if(!v.isWebKit&&i.querySelector("select:focus"))return!0;if(!i.contains(e))return!1;for(var s=e;s&&s!==i;){if(s.classList.contains(l.element.consuming))return!0;var a=t(s);if([a.overflow,a.overflowX,a.overflowY].join("").match(/(scroll|auto)/)){var r=s.scrollHeight-s.clientHeight;if(r>0&&!(0===s.scrollTop&&n>0||s.scrollTop===r&&n<0))return!0;var h=s.scrollWidth-s.clientWidth;if(h>0&&!(0===s.scrollLeft&&o<0||s.scrollLeft===h&&o>0))return!0}s=s.parentNode}return!1}(o.target,s,a)){var r=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(a?i.scrollTop-=a*e.settings.wheelSpeed:i.scrollTop+=s*e.settings.wheelSpeed,r=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(s?i.scrollLeft+=s*e.settings.wheelSpeed:i.scrollLeft-=a*e.settings.wheelSpeed,r=!0):(i.scrollTop-=a*e.settings.wheelSpeed,i.scrollLeft+=s*e.settings.wheelSpeed),b(e),(r=r||function(t,o){var n=Math.floor(i.scrollTop),s=0===i.scrollTop,a=n+i.offsetHeight===i.scrollHeight,l=0===i.scrollLeft,r=i.scrollLeft+i.offsetWidth===i.scrollWidth;return!(Math.abs(o)>Math.abs(t)?s||a:l||r)||!e.settings.wheelPropagation}(s,a))&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}"undefined"!=typeof window.onwheel?e.event.bind(i,"wheel",o):"undefined"!=typeof window.onmousewheel&&e.event.bind(i,"mousewheel",o)},touch:function(e){if(v.supportsTouch||v.supportsIePointer){var i=e.element,o={},n=0,s={},a=null;v.supportsTouch?(e.event.bind(i,"touchstart",d),e.event.bind(i,"touchmove",p),e.event.bind(i,"touchend",u)):v.supportsIePointer&&(window.PointerEvent?(e.event.bind(i,"pointerdown",d),e.event.bind(i,"pointermove",p),e.event.bind(i,"pointerup",u)):window.MSPointerEvent&&(e.event.bind(i,"MSPointerDown",d),e.event.bind(i,"MSPointerMove",p),e.event.bind(i,"MSPointerUp",u)))}function r(t,o){i.scrollTop-=o,i.scrollLeft-=t,b(e)}function h(t){return t.targetTouches?t.targetTouches[0]:t}function c(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 d(t){if(c(t)){var e=h(t);o.pageX=e.pageX,o.pageY=e.pageY,n=(new Date).getTime(),null!==a&&clearInterval(a)}}function p(a){if(c(a)){var d=h(a),p={pageX:d.pageX,pageY:d.pageY},u=p.pageX-o.pageX,f=p.pageY-o.pageY;if(function(e,o,n){if(!i.contains(e))return!1;for(var s=e;s&&s!==i;){if(s.classList.contains(l.element.consuming))return!0;var a=t(s);if([a.overflow,a.overflowX,a.overflowY].join("").match(/(scroll|auto)/)){var r=s.scrollHeight-s.clientHeight;if(r>0&&!(0===s.scrollTop&&n>0||s.scrollTop===r&&n<0))return!0;var h=s.scrollLeft-s.clientWidth;if(h>0&&!(0===s.scrollLeft&&o<0||s.scrollLeft===h&&o>0))return!0}s=s.parentNode}return!1}(a.target,u,f))return;r(u,f),o=p;var g=(new Date).getTime(),m=g-n;m>0&&(s.x=u/m,s.y=f/m,n=g),function(t,o){var n=Math.floor(i.scrollTop),s=i.scrollLeft,a=Math.abs(t),l=Math.abs(o);if(l>a){if(o<0&&n===e.contentHeight-e.containerHeight||o>0&&0===n)return 0===window.scrollY&&o>0&&v.isChrome}else if(a>l&&(t<0&&s===e.contentWidth-e.containerWidth||t>0&&0===s))return!0;return!0}(u,f)&&a.preventDefault()}}function u(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){e.isInitialized?clearInterval(a):s.x||s.y?Math.abs(s.x)<.01&&Math.abs(s.y)<.01?clearInterval(a):(r(30*s.x,30*s.y),s.x*=.8,s.y*=.8):clearInterval(a)},10))}}},C=function(o,n){var s=this;if(void 0===n&&(n={}),"string"==typeof o&&(o=document.querySelector(o)),!o||!o.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var a in this.element=o,o.classList.add(l.main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},n)s.settings[a]=n[a];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var r,h,c=function(){return o.classList.add(l.state.focus)},d=function(){return o.classList.remove(l.state.focus)};this.isRtl="rtl"===t(o).direction,this.isNegativeScroll=(h=o.scrollLeft,o.scrollLeft=-1,r=o.scrollLeft<0,o.scrollLeft=h,r),this.negativeScrollAdjustment=this.isNegativeScroll?o.scrollWidth-o.clientWidth:0,this.event=new u,this.ownerDocument=o.ownerDocument||document,this.scrollbarXRail=i(l.element.rail("x")),o.appendChild(this.scrollbarXRail),this.scrollbarX=i(l.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",c),this.event.bind(this.scrollbarX,"blur",d),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var p=t(this.scrollbarXRail);this.scrollbarXBottom=parseInt(p.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=m(p.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=m(p.borderLeftWidth)+m(p.borderRightWidth),e(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=m(p.marginLeft)+m(p.marginRight),e(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=i(l.element.rail("y")),o.appendChild(this.scrollbarYRail),this.scrollbarY=i(l.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",c),this.event.bind(this.scrollbarY,"blur",d),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var f=t(this.scrollbarYRail);this.scrollbarYRight=parseInt(f.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=m(f.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(e){var i=t(e);return m(i.width)+m(i.paddingLeft)+m(i.paddingRight)+m(i.borderLeftWidth)+m(i.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=m(f.borderTopWidth)+m(f.borderBottomWidth),e(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=m(f.marginTop)+m(f.marginBottom),e(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:o.scrollLeft<=0?"start":o.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:o.scrollTop<=0?"start":o.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(t){return y[t](s)}),this.lastScrollTop=Math.floor(o.scrollTop),this.lastScrollLeft=o.scrollLeft,this.event.bind(this.element,"scroll",function(t){return s.onScroll(t)}),b(this)};C.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,e(this.scrollbarXRail,{display:"block"}),e(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=m(t(this.scrollbarXRail).marginLeft)+m(t(this.scrollbarXRail).marginRight),this.railYMarginHeight=m(t(this.scrollbarYRail).marginTop)+m(t(this.scrollbarYRail).marginBottom),e(this.scrollbarXRail,{display:"none"}),e(this.scrollbarYRail,{display:"none"}),b(this),g(this,"top",0,!1,!0),g(this,"left",0,!1,!0),e(this.scrollbarXRail,{display:""}),e(this.scrollbarYRail,{display:""}))},C.prototype.onScroll=function(t){this.isAlive&&(b(this),g(this,"top",this.element.scrollTop-this.lastScrollTop),g(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},C.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),s(this.scrollbarX),s(this.scrollbarY),s(this.scrollbarXRail),s(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},C.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 i="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";this.addClass("animated "+t).one(i,function(i){$(this).removeClass("animated "+t),e&&e()}).children().on(i,function(t){t.stopPropagation()})}}),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};var T=function(){function t(){}return t.refresh=function(){$(".form-label-group").each(function(t,e){$(e).find("input, select").val()?$(e).addClass("label-on-top"):$(e).removeClass("label-on-top")})},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")}}),$(document).on("blur input change",".form-label-group",function(){$(this).find("input, select").val()?$(this).addClass("label-on-top"):$(this).removeClass("label-on-top")}),$(".form-label-group").each(function(t,e){$(e).find("input, select").val()?$(e).addClass("label-on-top"):$(e).removeClass("label-on-top")}),$.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] .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",function(t){t.stopPropagation()}),$(document).on("click","[data-table-link]",function(t){var e=$(this).parents("table, .table"),i=$(this).data("tableLink");e.hasClass("bulk-actions-active")||(t.ctrlKey||t.metaKey?window.open(i,"_blank"):window.location.href=i)}),$(document).on("click","[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",function(t){t.stopPropagation()}),$(document).on("click","[data-table-btn]",function(t){var e=$(this).parents("table, .table"),i=$(this).data("tableButton");(i||(i=e.find("button")[0]))&&(e.hasClass("bulk-actions-active")||$(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 i=new C(e[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0});e.find('[data-toggle="collapse"]').on("click",function(t){if($(this).data("breakpoint")&&window.matchMedia("(min-width: "+$(this).data("breakpoint")+"px)").matches){var e=$(this).next().find("li").first().children("a").first();e&&(window.location.href=e.attr("href"))}else setTimeout(function(){i.update()},300)})}var o=$(document).find(".sidebar-tab");o.length&&($.each(o,function(t,e){var i=$(e).find(".tab-content");new C(i[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0})}),$('[name="sidebar-tab-select"]').on("click",function(){var t=$(this).val(),e=$("#sidebar-tab-"+t);o.not(e).removeClass("active"),e.addClass("active"),$('[name="sidebar-tab-select"]').not($(this)).removeClass("active"),$(this).addClass("active"),e[0]==o.first()[0]?o.not(e).find(".tab-content").css({transform:"translate3d(100%, 0px, 0px)"}):e[0]==o.last()[0]?o.not(e).find(".tab-content").css({transform:"translate3d(-100%, 0px, 0px)"}):(o.first().not(e).find(".tab-content").css({transform:"translate3d(-100%, 0px, 0px)"}),o.last().not(e).find(".tab-content").css({transform:"translate3d(100%, 0px, 0px)"})),e.find(".tab-content").css({transform:"none"})}))},t}();function S(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}window.Cool.initialize=T.initialize,window.Cool.refresh=T.refresh;var I=function(t,e,i){var o;return function(){var n=this,s=arguments,a=i&&!o;clearTimeout(o),o=setTimeout(function(){o=null,i||t.apply(n,s)},e),a&&t.apply(n,s)}},k=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 D=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}(),P="coolPopover",E="plugin_coolPopover",H=function(t){function e(e,i){var o;return(o=t.call(this)||this).opts={},window.Cool.settings.popover?$.extend(!0,o.opts,$.fn[P].defaults,window.Cool.settings.popover,i):$.extend(!0,o.opts,$.fn[P].defaults,i),o.el=e,o.debug=o.opts.debug,o.init(),o}S(e,t);var i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$el.removeData(E),this.onDestroy()},i.update=function(){this.buildCache(),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-"+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())},i.bindEvents=function(){var t=this;"click"===this.trigger?this.$el.on("click."+P,function(){t.$popover?t.close():t.show()}):"hover"===this.trigger?(this.$el.on("mouseenter."+P,function(){t.show()}),this.$el.on("mouseleave."+P,I(function(){t.popupHasFocus||t.close()},500))):"focus"===this.trigger&&(this.$el.on("focusin."+P,function(){t.show()}),this.$el.on("focusout."+P,function(){t.close()})),$(window).on("resize",I(function(){t.$popover&&(t.setPosition(),t.onUpdate())},250))},i.unbindEvents=function(){this.$el.off("."+P)},i.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)})},i.buildPopover=function(){var t,e=this;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.$container.find("#"+this.id).on("mouseenter",function(){e.popupHasFocus=!0}),this.$container.find("#"+this.id).on("mouseleave",function(){e.popupHasFocus=!1,e.close()}),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)},i.setPosition=function(t){"undefined"!=typeof t&&null!==t||(t=this.placement),this.$popover.addClass("popover-"+t);var e,i,o,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?(i=Math.round(c-(a-r)/2),o=Math.round(d-l),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"right"===t?(i=Math.round(c+r),o=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(i=Math.round(c-(a-r)/2),o=Math.round(d+h),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"left"===t&&(i=Math.round(c-a),o=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("+i+"px, "+o+"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>=i+$&&["top","bottom"].indexOf(t)<0?(this.log("Popover adjusting width"),a-=$,i+=$):(this.log("Popover adjusting position x"),i+=$,e-=$)}if(m.top){this.log("Popover overflowing from top");var v=Math.abs(g.top);this.log("Popover adjusting position y"),o+=v,e-=v}if(m.right){this.log("Popover overflowing from right");var b=Math.abs(g.right);c<=i-b&&["top","bottom"].indexOf(t)<0?(this.log("Popover adjusting width"),a-=b):(this.log("Popover adjusting position x"),i-=b,e+=b)}if(m.bottom){this.log("Popover overflowing from bottom");var w=Math.abs(g.bottom);this.log("Popover adjusting position y"),o-=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("+i+"px, "+o+"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: "+i+"px"),this.log("Popover position y: "+o+"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: "+i+"px"),this.log("Popover position y: "+o+"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")},i.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())},i.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 i=$(this).data(E);if(i||(i=new e(this,"object"==typeof t&&t),$(this).data(E,i)),"string"==typeof t){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e}(D);if("undefined"!=typeof $){var Y=$.fn[P];$.fn[P]=H._jQueryInterface,$.fn[P].Constructor=H,$.fn[P].noConflict=function(){return $.fn[P]=Y,H._jQueryInterface},$.fn[P].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 A="coolSelect",W=function(t){function e(e,i){var o;return(o=t.call(this)||this).opts={},window.Cool.settings.select?$.extend(!0,o.opts,$.fn[A].defaults,window.Cool.settings.select,i):$.extend(!0,o.opts,$.fn[A].defaults,i),o.el=e,o.debug=o.opts.debug,o.init(),o}S(e,t);var i=e.prototype;return i.init=function(){var t=this;this.buildCache().then(function(){t.buildScroll(),t.bindEvents(),t.data[t.name].length>0&&t.setData(),t.onInit()})},i.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_coolSelect"),this.onDestroy()},i.update=function(){this.buildCache(),this.bindEvents(),this.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"),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.addClass("select-placeholder"),this.$selectIconContainer.addClass("d-none"),this.$selectTitle.html(this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchData=[],this.$searchInput.val(""),this.searchString="",this.search.call(this))},i.buildCache=function(){var t=this;return new Promise(function(e,i){var o=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[o.primaryKeyword]?-1===o.itemsToExclude.indexOf(t[o.primaryKeyword].toString()):-1===o.itemsToExclude.indexOf(t.toString())})),t.items.length>0&&t.itemsToExclude.length>0&&(t.items=t.items.filter(function(t){return t[o.primaryKeyword]?-1===o.itemsToExclude.indexOf(t[o.primaryKeyword].toString()):-1===o.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,i){if(t.$select.length){var n=t.$select.find(".select-item");n.length>0&&t.itemsToExclude.length>0&&$.each(n,function(t,e){var i=$(e).find(":input").val();o.itemsToExclude.indexOf(i)>-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"),t.$selectHeader.removeClass("select-placeholder"),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.addClass("select-placeholder"),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()})})},i.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"}),k()?this.$scrollableContent.css({"overflow-y":"auto"}):(this.$scrollableContent.addClass("ps-dark"),this.scroll=new C(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))}},i.buildSearchData=function(){var t=this;return new Promise(function(e,i){t.searchData=[];var o=t.$select.find("[data-label]");$.each(o,function(e,i){t.searchData.push({id:e,val:$(i).text().trim()})}),e()})},i.bindEvents=function(){var t=this,e=this;this.$selectHeader.on("click."+A,function(){t.contentOpen?t.close():(t.$selectItems.length>0||t.searchApi)&&t.show()}),this.$el.on("change."+A,'input[type="checkbox"]',function(){var t=this,i=$(this).val();e.preventClose=!0,"function"==typeof e.confirmCheck&&t.checked?(t.checked=!1,e.confirmCheck(function(o){"confirmed"==o&&(-1===e.data[e.name].indexOf(i)&&e.data[e.name].push(i),t.checked=!0,e.onSelect(t)),setTimeout(function(){e.preventClose=!1},600)},t)):t.checked?(-1===e.data[e.name].indexOf(i)&&e.data[e.name].push(i),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!=i}),e.onSelect(t),setTimeout(function(){e.preventClose=!1},600)):(t.checked=!0,e.confirmUncheck(function(o){"confirmed"==o&&(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},600)},t))}),this.$el.on("change."+A,'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."+A,'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."+A,I(function(){e.searchString=$(this).val().trim(),e.search.call(e)},250)),this.$searchInput.on("focusin."+A,function(){e.$searchContainer.addClass("focused")}),this.$searchInput.on("focusout."+A,function(){e.$searchContainer.removeClass("focused")}),this.$searchContainer.on("click."+A,"[data-clear-search]",function(){e.searchString.length&&(e.$searchInput.val(""),e.searchString="",e.search.call(e))})),this.showFooter&&this.$closeButton.on("click."+A,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)})},i.unbindEvents=function(){this.$el.off("."+A)},i.getData=function(t){return t?this.data[t]:this.data},i.setData=function(){var t=this,e=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+e+' fa-check text-success icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.searchApi.length){var i=this.searchApi,o=this.data[this.name].length,n=0;this.data[this.name].forEach(function(t){i+=encodeURIComponent("#"+t),++n!==o&&(i+="+")}),$.ajax({method:"GET",url:i}).done(function(e){var i=e.map(function(e){return e.id=e[t.primaryKeyword].toString(),e}),o=i.map(function(t){return t.id.toString()});t.data[t.name]=t.data[t.name].filter(function(t){return o.indexOf(t.toString())>-1}),0==t.data[t.name].length&&t.$selectIconContainer.html(t.selectIconDefault),i=i.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(i);$.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(i){var o=e.filter(function(){return this.value==i});o.prop("checked",!0),t.onSelect(o[0])});else if("radio"==t.type){var i=e.filter(function(){return this.value==t.data[t.name][0]});i.prop("checked",!0),i.addClass("checked"),t.dynamicTitle&&t.$selectTitle.html(i.parent().find("[data-label]").text()),t.onSelect(i[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 i=s.filter(function(){return this.value==e});i.prop("checked",!0),t.onSelect(i[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])}}},i.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 i=e.map(function(e){return e.id=e[t.primaryKeyword].toString(),e});i=i.filter(function(e){return-1===t.data[t.name].indexOf(e.id)&&-1===t.itemsToExclude.indexOf(e.id)&&0!=e.id});var o=t._renderItemList(i);$.when(t.$scrollableContent.append(o)).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 i=this.searchData.filter(function(e){return e.val.toLocaleLowerCase().indexOf(t.searchString.toLocaleLowerCase())>-1});this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),i.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()},i.show=function(){var t=this;if(!this.$el.hasClass("show")){var e=$(".select.show"),i=1,o=this.opts.faPro?"fal":"fas";e.length&&(i=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||(i=parseInt(this.$el.css("z-index"),10)+1),this.$el.css({"z-index":i}),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="'+o+' fa-angle-up icon"></i>'),setTimeout(function(){t.$el[0].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},300),this.contentOpen=!0,this.onShow()}},i.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-success icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.contentOpen=!1,this.onClose()}},i.onSelect=function(t){var e=this,i=this.opts.onSelect,o=$(t).parents(".select-item").data();this.searchApi.length&&!$.isEmptyObject(o)&&($(t).length&&t.checked?this.items.push(o):this.items=$.grep(this.items,function(t){return t[e.primaryKeyword]!=o.id})),"function"==typeof i&&i.call(t,o,this)},i.appendItems=function(t,e){var i=this;return new Promise(function(e,o){var n=i;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){i.items.push(t)});var a=i._renderItemList(t);i.$scrollableContent.prepend(a),i.$selectItems=i.$select.find(".select-item"),i.buildSearchData().then(function(){if(i.$selectItems.length>0)if(i.$select.find(':input[type="checkbox"]').length?i.type="checkbox":i.$select.find(':input[type="radio"]').length&&(i.type="radio"),"checkbox"==i.type)t.forEach(function(t){var e=i.$select.find(":input").filter(function(){return this.value==t.id}),o=e.val().toString();e.prop("checked",!0),-1===i.data[i.name].indexOf(o)&&i.data[i.name].push(o),i.onSelect(e[0])});else if("radio"==i.type){var o=t[0],n=i.$select.find(":input").filter(function(){return this.value==o.id}),s=n.val().toString();n.prop("checked",!0),n.addClass("checked"),-1===i.data[i.name].indexOf(s)&&(i.data[i.name]=[s]),i.dynamicTitle&&i.$selectTitle.html(n.parent().find("[data-label]").text()),i.$select.find('input[type="radio"]').not(n).prop("checked",!1),i.$select.find('input[type="radio"]').not(n).removeClass("checked"),i.onSelect(n[0])}0==i.data[i.name].length&&i.dynamicTitle&&i.dynamicTitleDefault&&0!==i.dynamicTitleDefault&&0==i.$selectTitle.text().trim()&&(i.$selectItems.length>0||i.searchApi)&&i.$selectTitle.html(i.dynamicTitleDefault),i.$selectHeader.attr("style")&&i.$selectHeader.removeAttr("style"),i.$selectIconContainer.hasClass("d-none")&&i.$selectIconContainer.removeClass("d-none"),e()})})},i.deselectItems=function(t){var e=this;return new Promise(function(i,o){t.forEach(function(t){var i=e.$select.find(":input").filter(function(){return this.value==t});i[0].checked&&i.trigger("click")}),0==e.data[e.name].length&&e.$selectIconContainer.html(e.selectIconDefault)})},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=[],i=[],o=this.data[this.name];return $.isArray(o)?e=o:e.push(o),e=e.map(String),this.items.length>0?(i=$.grep(this.items,function(t){return e.indexOf(t.id.toString())>-1}),t&&(i=i.map(function(e){return e[t]}).filter(function(t){return null!=t}))):i=e,i},i.getSelectedItem=function(t){var e=[],i=[],o=this.data[this.name];return $.isArray(o)?e=o:e.push(o),e=e.map(String),this.items.length>0?(i=$.grep(this.items,function(t){return e.indexOf(t.id.toString())>-1}),t&&(i=i.map(function(e){return e[t]}).filter(function(t){return null!=t}))):i=e,null==i[0]?null:i[0]},i._renderItemList=function(t){for(var e=[],i=0;i<t.length;++i){var o=t[i],n="";"function"==typeof this.labelTemplate?n=this.labelTemplate(o):o.name?n=o.name:o.label?n=o.label:o.value&&(n=o.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[i].id+'" value="'+t[i].id+'" tabindex="-1">\n\n <label for="select-'+this.name+"-"+t[i].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(o))}return e},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 ":""},e._jQueryInterface=function(t){return this.each(function(){var i=$(this).data("plugin_coolSelect");if(i||(i=new e(this,"object"==typeof t&&t),$(this).data("plugin_coolSelect",i)),"string"==typeof t){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e}(D);if("undefined"!=typeof $){var X=$.fn[A];$.fn[A]=W._jQueryInterface,$.fn[A].Constructor=W,$.fn[A].noConflict=function(){return $.fn[A]=X,W._jQueryInterface},$.fn[A].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 O="coolDropdown",L=function(t){function e(e,i){var o;return(o=t.call(this)||this).opts={},window.Cool.settings.dropdown?$.extend(!0,o.opts,$.fn[O].defaults,window.Cool.settings.dropdown,i):$.extend(!0,o.opts,$.fn[O].defaults,i),o.el=e,o.debug=o.opts.debug,o.init(),o}S(e,t);var i=e.prototype;return i.init=function(){var t=this;$.when(this.buildCache()).then(function(){t.buildScroll(),t.bindEvents(),t.onInit()})},i.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_coolDropdown"),this.onDestroy()},i.update=function(){this.buildCache(),this.onUpdate()},i.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})},i.buildScroll=function(){this.opts.scroll&&this.$scrollableContent.length&&(this.$scrollableContent.css({"max-height":this.scrollContentHeight+"px"}),k()?this.$scrollableContent.css({"overflow-y":"auto"}):(this.$scrollableContent.css({"overflow-y":"auto"}),this.scroll=new C(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20}),this.$scrollableContent.addClass("ps-show-rail-y")))},i.bindEvents=function(){var t=this,e=this;this.$el.on("click."+O,function(){t.contentOpen?t.close():t.show()}),this.$dropdownItem.on("click."+O,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",I(function(){t.setPosition(),t.onUpdate()},250))},i.unbindEvents=function(){this.$el.off("."+O)},i.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)})},i.setPosition=function(t){"undefined"!=typeof str&&null!==str||(t=this.placement);var e=this.$dropdown.outerWidth(!0),i=this.$dropdown.outerHeight(!0),o=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?o-e:s,r=a-i):"right"===t?(l=s+o,r=a):"bottom"===t?(l="end"===this.align?o-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<i?(this.$dropdown.css("max-height",f.height),i=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+o&&(l=s+o-e,a+n>r&&(r=a+n+(c>0?c:0))),r<a&&m<i&&(r=a+n+c),r>=a&&b<i&&(r=l>=s+o||s>=l+e?a-(i-b):a-i-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: "+o+"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: "+i+"px"),this.log("Dropdown position x: "+l+"px"),this.log("Dropdown position y: "+r+"px")},i.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())},i.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())},i.onItemClick=function(t){var e=this.opts.onItemClick;"function"==typeof e&&e.call(t)},e._jQueryInterface=function(t){return this.each(function(){var i=$(this).data("plugin_coolDropdown");if(i||(i=new e(this,"object"==typeof t&&t),$(this).data("plugin_coolDropdown",i)),"string"==typeof t){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e}(D);if("undefined"!=typeof $){var M=$.fn[O];$.fn[O]=L._jQueryInterface,$.fn[O].Constructor=L,$.fn[O].noConflict=function(){return $.fn[O]=M,L._jQueryInterface},$.fn[O].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 R="coolTooltip",_=function(t){function e(e,i){var o;return(o=t.call(this)||this).opts={},window.Cool.settings.tooltip?$.extend(!0,o.opts,$.fn[R].defaults,window.Cool.settings.tooltip,i):$.extend(!0,o.opts,$.fn[R].defaults,i),o.el=e,o.debug=o.opts.debug,o.init(),o}S(e,t);var i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_coolTooltip"),this.onDestroy()},i.update=function(){this.buildCache(),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-"+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},i.bindEvents=function(){var t=this;"auto"===this.trigger&&(this.$el.on("mouseenter."+R,function(){t.show()}),this.$el.on("mouseleave."+R,function(){t.close()}),this.$el.on("blur."+R,function(){t.close()})),this.$el.on("destroyed."+R,function(){t.close()}),$(window).on("resize",I(function(){t.$tooltip&&(t.setPosition(),t.onUpdate())},250))},i.unbindEvents=function(){this.$el.off("."+R)},i.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)})},i.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)},i.setPosition=function(t){"undefined"!=typeof t&&null!==t||(t=this.placement),this.$tooltip.addClass("tooltip-"+t);var e,i,o,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?(i=Math.round(c-(a-r)/2),o=Math.round(d-l),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"right"===t?(i=Math.round(c+r),o=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(i=Math.round(c-(a-r)/2),o=Math.round(d+h),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"left"===t&&(i=Math.round(c-a),o=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("+i+"px, "+o+"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>=i+$&&["top","bottom"].indexOf(t)<0?(this.log("Tooltip adjusting width"),a-=$,i+=$):(this.log("Tooltip adjusting position x"),i+=$,e-=$)}if(m.top){this.log("Tooltip overflowing from top");var v=Math.abs(g.top);this.log("Tooltip adjusting position y"),o+=v,e-=v}if(m.right){this.log("Tooltip overflowing from right");var b=Math.abs(g.right);c<=i-b&&["top","bottom"].indexOf(t)<0?(this.log("Tooltip adjusting width"),a-=b):(this.log("Tooltip adjusting position x"),i-=b,e+=b)}if(m.bottom){this.log("Tooltip overflowing from bottom");var w=Math.abs(g.bottom);this.log("Tooltip adjusting position y"),o-=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, "+o+"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: "+i+"px"),this.log("Tooltip position y: "+o+"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: "+i+"px"),this.log("Tooltip position y: "+o+"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")},i.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())},i.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 i=$(this).data("plugin_coolTooltip");if(i||(i=new e(this,"object"==typeof t&&t),$(this).data("plugin_coolTooltip",i)),"string"==typeof t){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e}(D);if("undefined"!=typeof $){var j=$.fn[R];$.fn[R]=_._jQueryInterface,$.fn[R].Constructor=_,$.fn[R].noConflict=function(){return $.fn[R]=j,_._jQueryInterface},$.fn[R].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 U="coolSectionTabs",z="plugin_coolSectionTabs",B=function(t){function e(e,i){var o;return(o=t.call(this)||this).opts={},window.Cool.settings.sectionTabs?$.extend(!0,o.opts,$.fn[U].defaults,window.Cool.settings.sectionTabs,i):$.extend(!0,o.opts,$.fn[U].defaults,i),o.el=e,o.debug=o.opts.debug,o.init(),o}S(e,t);var i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.checkForChanges(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$el.removeData(z),this.onDestroy()},i.update=function(){this.buildCache(),this.onUpdate()},i.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)},i.bindEvents=function(){var t=this;$(window).on("resize",I(function(){t.checkForChanges()},250))},i.unbindEvents=function(){this.$el.off("."+this._name)},i.moveToList=function(t){var e=$(t);e.find(".tab-item-action").removeClass("dropdown-item"),e.insertBefore(this.$dropdownContainer),this.checkForChanges()},i.moveToDropdown=function(t){var e=$(t),i=e.find(".tab-item-action");i.hasClass("dropdown-item")||i.addClass("dropdown-item"),e.appendTo(this.$dropdownList),this.checkForChanges()},i.overflowStatus=function(){return this.$el[0].offsetWidth<this.$el[0].scrollWidth},i.checkForChanges=function(){var t=this.$dropdownList.children(),e=this.$el.find("> .tab-item").not(this.$dropdownContainer),i=this.$el.find("> .tab-item:visible"),o=0;$.each(i,function(t,e){o+=$(e).outerWidth(!0)});var n=this.$el[0].offsetWidth-o;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 i=$(this).data(z);if(i||(i=new e(this,"object"==typeof t&&t),$(this).data(z,i)),"string"==typeof t){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e}(D);if("undefined"!=typeof $){var N=$.fn[U];$.fn[U]=B._jQueryInterface,$.fn[U].Constructor=B,$.fn[U].noConflict=function(){return $.fn[U]=N,B._jQueryInterface},$.fn[U].defaults={onInit:null,onUpdate:null,onDestroy:null,debug:!1}}var Q="coolCollapse",K=function(t){function e(e,i){var o;return(o=t.call(this)||this).opts={},window.Cool.settings.collapse?$.extend(!0,o.opts,$.fn[Q].defaults,window.Cool.settings.dialog,i):$.extend(!0,o.opts,$.fn[Q].defaults,i),o.el=e,o.debug=o.opts.debug,o.init(),o}S(e,t);var i=e.prototype;return i.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},i.destroy=function(){this.unbindEvents(),this.$el.removeData("plugin_coolCollapse"),this.onDestroy()},i.update=function(){this.buildCache(),this.onUpdate()},i.buildCache=function(){this.$el=$(this.el),this.$target=this.$el.data("target")?$(document).find(this.$el.data("target")):$(document).find(this.opts.target),this.breakpoint=this.$el.data("breakpoint"),this.expanded="true"==this.$el.attr("aria-expanded"),this.transitionendEvent=this.whichTransitionEvent(),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")},i.bindEvents=function(){var t=this;this.$el.on("click."+this.name,function(e){t.breakpoint&&window.matchMedia("(min-width: "+t.breakpoint+"px)").matches||(t.expanded?t.close():t.show())}),$(window).on("resize",I(function(){t.$target.length&&(t.targetHeight=t.$target.height(),t.log("Target height: "+t.targetHeight+"px"))},250))},i.unbindEvents=function(){this.$el.off("."+this.name)},i.whichTransitionEvent=function(){var t=document.createElement("text-transition"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return e[i]},i.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.on(this.transitionendEvent,function(e){$(e.target).is(this)&&(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).off(t.transitionendEvent))}),this.onShow()},i.close=function(){var t=this,e=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.on(this.transitionendEvent,function(t){$(t.target).is(this)&&(e.$target.removeClass("collapsing"),e.$el.is("button")&&e.$el.attr("disabled",!1),e.$target.removeAttr("style"),e.$target.addClass("collapse"),e.$el.attr("aria-expanded",!1),e.expanded=!1,e.targetHeight!==e.$target.height()&&(e.targetHeight=e.$target.height()),$(this).off(e.transitionendEvent))}),this.onClose()},e._jQueryInterface=function(t){return this.each(function(){var i=$(this).data("plugin_coolCollapse");if(i||(i=new e(this,"object"==typeof t&&t),$(this).data("plugin_coolCollapse",i)),"string"==typeof t){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e}(D);if("undefined"!=typeof $){var F=$.fn[Q];$.fn[Q]=K._jQueryInterface,$.fn[Q].Constructor=K,$.fn[Q].noConflict=function(){return $.fn[Q]=F,K._jQueryInterface},$.fn[Q].defaults={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,debug:!1}}var q="coolToast",V=function(){function t(t,e){this.settings={},window.Cool.settings.toast?$.extend(!0,this.settings,$.fn[q].defaults,window.Cool.settings.toast,e):$.extend(!0,this.settings,$.fn[q].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 i=this.buildToast(e);return this.addQueue(i),this.onInit(i),i},e.destroy=function(){this.$container.removeData("plugin_coolToast"),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,i=this;t.$el.on("click","[data-toast-close]",function(){t.$el&&i.close(t)}),$(window).on("resize",I(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,i,o){if("undefined"!=typeof i&&null!==i||(i=t.placementY),"undefined"!=typeof o&&null!==o||(o=t.placementX),o&&i||(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=o,a=i),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,i=this.faPro?"far":"fas",o="",n="",s="";return o="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="'+i+' fa-times icon"></i>\n </button>\n\n </div>\n ':s='\n <button type="button" data-toast-close>\n\n <i class="'+i+' fa-times icon"></i>\n\n </button>\n ',e='\n <div class="toast-body">\n\n <span>'+o+"</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 i=$(this).data("plugin_coolToast");if(i||(i=new t(this,"object"==typeof e&&e),$(this).data("plugin_coolToast",i)),"string"==typeof e){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},t}();if("undefined"!=typeof $){var G,J=$.fn[q];$.fn[q]=V._jQueryInterface,$.fn[q].Constructor=V,$.fn[q].noConflict=function(){return $.fn[q]=J,V._jQueryInterface},$.fn[q].defaults=((G={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,G.onShow=null,G.onClose=null,G)}var Z="coolDialog",tt=function(){function t(t,e){this.settings={},window.Cool.settings.dialog?$.extend(!0,this.settings,$.fn[Z].defaults,window.Cool.settings.dialog,e):$.extend(!0,this.settings,$.fn[Z].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 i=this.buildDialog(e);return this.show(i),this.bindEvents(i),this.onInit(i),i},e.destroy=function(){this.$container.removeData("plugin_coolDialog"),this.onDestroy()},e.buildDialog=function(t){var e=this,i={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==i.maxBodyHeight&&(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.log(i),this.dialogs.push(i),i},e.bindEvents=function(t){var e=this;t.$el.on("click","[data-dialog-close]",function(i){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(i){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]",I(function(i){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 i=$(this.dialogs).eq(-2)[0].$el,o=parseInt(i.css("z-index"),10)+1;t.$el.css("z-index",o),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 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,i=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?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")):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)},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 i="",o="",n="";t.actions.close.visible&&(i='\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&&(o='\n <button type="button" class="btn '+"btn-remove"+(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 <div class="spacer"></div>\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",i=t.classes?" "+t.classes:"",o=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'+i+o+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 i=$(this).data("plugin_coolDialog");if(i||(i=new t(this,"object"==typeof e&&e),$(this).data("plugin_coolDialog",i)),"string"==typeof e){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}},t}();if("undefined"!=typeof $){var et,it=$.fn[Z];$.fn[Z]=tt._jQueryInterface,$.fn[Z].Constructor=tt,$.fn[Z].noConflict=function(){return $.fn[Z]=it,tt._jQueryInterface},$.fn[Z].defaults=((et={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,et.onShow=null,et.onClose=null,et.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:""}},et)}return{Common:T,Popover:H,Select:W,Dropdown:L,Tooltip:_,SectionTabs:B,Collapse:K,Toast:V,Dialog:tt}});
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cool=e(t.jQuery)}(this,function(t){"use strict";const e=new WeakMap;class i{static instances=[];static initializeElement(t,i={}){const s="string"==typeof t?document.querySelector(t):t;if(!s)return!1;const n=`plugin_${this.NAME}`;let o=e.has(s)&&e.get(s)[n];if(!o&&"undefined"!=typeof $&&$.fn&&(o=$(s).data(n)),!o){const t=new this(s,i);return e.has(s)||e.set(s,{}),e.get(s)[n]=t,"undefined"!=typeof $&&$.fn&&$(s).data(n,t),this.instances.push(t),t}return!1}static initializeElements(t,e={}){return document.querySelectorAll(t).forEach(t=>{this.initializeElement(t,e)}),this.instances}static getInstance(t){const i=`plugin_${this.NAME}`,s=e.get(t);if(s&&s[i])return s[i];if("undefined"!=typeof $&&$.fn&&$(t).data(i)){const s=$(t).data(i);return e.has(t)||e.set(t,{}),e.get(t)[i]=s,s}return null}static removeInstance(t){const i=`plugin_${this.NAME}`,s=e.get(t);s&&(delete s[i],0===Object.keys(s).length&&e.delete(t)),"undefined"!=typeof $&&$.fn&&$(t).removeData(i)}onInit(){let t=this.opts.onInit;"function"==typeof t&&t.call(this)}onUpdate(){let t=this.opts.onUpdate;"function"==typeof t&&t.call(this)}onDestroy(){let t=this.opts.onDestroy;"function"==typeof t&&t.call(this)}onShow(){let t=this.opts.onShow;"function"==typeof t&&t.call(this)}onClose(){let t=this.opts.onClose;"function"==typeof t&&t.call(this)}onReset(){let t=this.opts.onReset;"function"==typeof t&&t.call(this)}}const s=new class{constructor(){this.callbacks=new WeakMap,this.observer=null,this.rafId=null,this.windowCallbacks=new Set,this.isWindowListening=!1}observe(t,e){this.observer||(this.observer=new ResizeObserver(t=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{t.forEach(t=>{const e=this.callbacks.get(t.target);e&&e(t)})})})),this.callbacks.set(t,e),this.observer.observe(t),this.windowCallbacks.add(e),this.isWindowListening||this.startWindowListening()}unobserve(t){if(this.observer){this.observer.unobserve(t);const e=this.callbacks.get(t);e&&this.windowCallbacks.delete(e),this.callbacks.delete(t),0===this.windowCallbacks.size&&this.stopWindowListening()}}startWindowListening(){this.isWindowListening=!0,window.addEventListener("resize",this.handleWindowResize,{passive:!0})}stopWindowListening(){this.isWindowListening=!1,window.removeEventListener("resize",this.handleWindowResize)}handleWindowResize=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.windowCallbacks.forEach(t=>{t({target:window,contentRect:{width:window.innerWidth,height:window.innerHeight}})})})};disconnect(){this.observer&&(this.observer.disconnect(),this.callbacks=new WeakMap),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.windowCallbacks.clear(),this.stopWindowListening()}},n=new class{constructor(){this.callbacks=new Map,this.rafId=null,this.isListening=!1}add(t,e){this.callbacks.set(t,e),this.isListening||this.startListening()}remove(t){this.callbacks.delete(t),0===this.callbacks.size&&this.stopListening()}startListening(){this.isListening=!0;const t=document.querySelector(".site-main .content");t?(this.scrollElement=t,this.scrollElement.addEventListener("scroll",this.handleScroll,{passive:!0})):(this.scrollElement=window,window.addEventListener("scroll",this.handleScroll,{passive:!0}))}stopListening(){this.isListening=!1,this.scrollElement&&(this.scrollElement.removeEventListener("scroll",this.handleScroll),this.scrollElement=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}handleScroll=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.callbacks.forEach(t=>t())})}},o=function(t,e,i){let s;return function(){let i=this,n=arguments;clearTimeout(s),s=setTimeout(function(){s=null,t.apply(i,n)},e)}},l=function(){let t=!1;return("ontouchstart"in window||navigator.maxTouchPoints>0)&&(t=!0),t},a=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},r=function(t,e){const i=t&&t.jquery?t[0]:t;return i?new Promise(t=>{const s=["animation",e];i.classList.add(...s),i.addEventListener("animationend",function e(n){n.stopPropagation(),i.classList.remove(...s),i.removeEventListener("animationend",e),t()},{once:!0})}):Promise.resolve()},h=t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"}[t]),c=t=>{if("string"!=typeof t){if(null===t)return"";if(!t)return String(t);t=String(t)}return/[&<>"'`=]/.test(t)?t.replace(/[&<>"'`=]/g,h):t};function d(t,...e){for(const i of e)if(i&&"object"==typeof i)for(const e of Object.keys(i)){const s=i[e],n=t[e];s&&"object"==typeof s&&!Array.isArray(s)&&n&&"object"==typeof n&&!Array.isArray(n)?t[e]=d({},n,s):t[e]=s}return t}class u extends i{static NAME="coolSection";static DEFAULTS={observeSections:!0,initFormControls:!0,initTableHandlers:!0,initButtonGroups:!0,initTabs:!0,onInit:null,onDestroy:null};constructor(t){super(),this.opts=d({},u.DEFAULTS,window.Cool?.settings?.section||{},t||{}),this._eventHandlers=[],this._updateTimeout=null,this._rafId=null,this.init()}init(){this.opts.observeSections&&this.initializeSectionObserver(),this.opts.initFormControls&&this.initializeFormControls(),this.opts.initTableHandlers&&this.initializeTableHandlers(),this.opts.initButtonGroups&&this.initializeButtonGroups(),this.opts.initTabs&&this.initializeTabs(),this.onInit()}destroy(){this.destroySectionObserver(),this.unbindEvents(),this._updateTimeout&&clearTimeout(this._updateTimeout),this._rafId&&cancelAnimationFrame(this._rafId),this.onDestroy()}_addEventListener(t,e,i,s){t.addEventListener(e,i,s),this._eventHandlers.push({element:t,event:e,handler:i,options:s})}initializeSectionObserver(){this._isUpdating=!1,this.sectionObserver=new MutationObserver(t=>{if(this._isUpdating)return;t.every(t=>{if("attributes"===t.type&&"class"===t.attributeName){const e=t.target,i=t.oldValue?t.oldValue.split(" "):[],s=Array.from(e.classList);return[...s.filter(t=>!i.includes(t)),...i.filter(t=>!s.includes(t))].every(t=>"is-last-visible"===t||"is-last-visible-row"===t||"is-last-visible-cell"===t)}return!1})||(this._updateTimeout&&clearTimeout(this._updateTimeout),this._updateTimeout=setTimeout(()=>{this._rafId&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this.updateLastVisibleElements()})},50))}),this.sectionObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["class","style","hidden"],attributeOldValue:!0,subtreeFilter:t=>t.classList&&(t.classList.contains("section")||t.classList.contains("select")||"TABLE"===t.nodeName||"TR"===t.nodeName||"TD"===t.nodeName||"TH"===t.nodeName)}),this.updateLastVisibleElements()}updateLastVisibleElements(){this._isUpdating=!0;const t={sections:[],tables:[],rows:[]};document.querySelectorAll(".section").forEach(e=>{const i=this.getVisibleChildren(e);i.length&&t.sections.push({section:e,lastVisible:i[i.length-1]})}),document.querySelectorAll("table").forEach(e=>{const i=e.querySelector("tbody")||e,s=this.getVisibleElements(i.querySelectorAll("tr"));s.length&&t.tables.push({tbody:i,lastVisibleRow:s[s.length-1]})}),document.querySelectorAll("table tr").forEach(e=>{const i=this.getVisibleElements(e.querySelectorAll("td, th"));i.length&&t.rows.push({row:e,lastVisibleCell:i[i.length-1]})}),requestAnimationFrame(()=>{document.querySelectorAll(".is-last-visible, .is-last-visible-row, .is-last-visible-cell").forEach(t=>{t.classList.remove("is-last-visible","is-last-visible-row","is-last-visible-cell")}),t.sections.forEach(({lastVisible:t})=>{t.classList.add("is-last-visible")}),t.tables.forEach(({lastVisibleRow:t})=>{t.classList.add("is-last-visible-row")}),t.rows.forEach(({lastVisibleCell:t})=>{t.classList.add("is-last-visible-cell")}),setTimeout(()=>{this._isUpdating=!1},0)})}getVisibleChildren(t){return Array.from(t.children).filter(t=>this.isElementVisible(t))}getVisibleElements(t){return Array.from(t).filter(t=>this.isElementVisible(t))}isElementVisible(t){return t._computedStyle&&!t._styleInvalidated||(t._computedStyle=window.getComputedStyle(t),t._styleInvalidated=!1),!t.classList.contains("d-none")&&!t.classList.contains("d-md-none")&&null!==t.offsetParent&&t.offsetHeight>0&&"none"!==t._computedStyle.display}destroySectionObserver(){this.sectionObserver&&(this.sectionObserver.disconnect(),this.sectionObserver=null),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=null),this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}initializeFormControls(){this._addEventListener(document,"focusin",t=>{const e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){const t=e.closest(".input-group");t?.classList.add("input-group-focus")}}),this._addEventListener(document,"focusout",t=>{const e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){const t=e.closest(".input-group");t?.classList.remove("input-group-focus")}});const t=t=>{const e=t.querySelector("input, select"),i=!!e?.value;t.classList.toggle("label-on-top",i)};this._addEventListener(document,"input",e=>{const i=e.target.closest(".form-label-group");i&&t(i)}),this._addEventListener(document,"change",e=>{const i=e.target.closest(".form-label-group");i&&t(i),e.target.matches("select")&&e.target.blur()}),document.querySelectorAll(".form-label-group").forEach(t)}initializeTableHandlers(){document.querySelectorAll(".table").forEach(t=>{t.querySelector("[data-table-link], [data-table-btn]")&&!t.classList.contains("table-hover")&&t.classList.add("table-hover")}),this._addEventListener(document,"click",t=>{if(t.target.closest("[data-table-link] .table-link-exclude, [data-table-link] input, [data-table-link] button, [data-table-link] a, [data-table-link] label, [data-table-link] .td-col-select"))return void t.stopPropagation();const e=t.target.closest("[data-table-link]");if(e){const i=e.closest("table, .table"),s=e.dataset.tableLink;if(i?.classList.contains("bulk-actions-active"))return;t.ctrlKey||t.metaKey?window.open(s,"_blank"):window.location.href=s}if(t.target.closest("[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select"))return void t.stopPropagation();const i=t.target.closest("[data-table-btn]");if(i){const t=i.closest("tr, .tr"),e=i.querySelector("button");if(!e||t?.classList.contains("bulk-actions-active"))return;e.click()}})}initializeButtonGroups(){this._addEventListener(document,"click",t=>{const e=t.target.closest(".btn-group-toggle .btn");if(e&&!t.target.matches("input")){const t=e.querySelector("input");t&&(t.click(),t.dispatchEvent(new Event("change",{bubbles:!0})))}t.target.matches(".btn-group-toggle .btn > input")&&t.stopPropagation()}),this._addEventListener(document,"change",t=>{if(t.target.matches('.btn-group-toggle .btn > input[type="radio"]')){const e=t.target.parentElement.closest(".btn-group-toggle");e&&e.querySelectorAll(".btn").forEach(t=>{t.classList.toggle("active",t.querySelector("input")?.checked)})}else if(t.target.matches('.btn-group-toggle .btn > input[type="checkbox"]')){t.target.parentElement.classList.toggle("active",t.target.checked)}})}initializeTabs(){this._addEventListener(document,"click",t=>{const e=t.target.closest(".tabs .tab-item");if(e){t.stopPropagation();e.closest(".tabs").querySelectorAll(".tab-item").forEach(t=>t.classList.remove("active")),e.classList.add("active")}})}unbindEvents(){this._eventHandlers.forEach(({element:t,event:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._eventHandlers=[]}refresh(){document.querySelectorAll(".form-label-group").forEach(t=>{const e=t.querySelector("input, select"),i=e?.value;t.classList.toggle("label-on-top",!!i)})}}let p=null;try{p=require("perfect-scrollbar"),p&&p.default&&(p=p.default)}catch(t){}"undefined"!=typeof window&&p&&!window.PerfectScrollbar&&(window.PerfectScrollbar=p);class m extends i{static NAME="coolSidebar";static DEFAULTS={floating:!0,breakpoint:1046,wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0,onInit:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${m.NAME}`);i||(i=new m(this,"object"==typeof t&&t),e.data(`plugin_${m.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[m.NAME];$.fn[m.NAME]=m._jQueryInterface,$.fn[m.NAME].Constructor=m,$.fn[m.NAME].defaults=m.DEFAULTS||{},$.fn[m.NAME].noConflict=()=>($.fn[m.NAME]=t,m._jQueryInterface)}constructor(t,e){super(),this.opts=d({},m.DEFAULTS,window.Cool?.settings?.sidebar||{},e||{}),this.el=t,t&&t.jquery&&(this.el=t[0]),this.init()}init(){this.buildCache(),this.bindEvents(),this.initializeScrollbars(),this.initializeTabs(),this.onInit()}destroy(){this.unbindEvents(),this.destroyScrollbars(),this.onDestroy()}buildCache(){this.content=this.el.querySelector(".sidebar-content"),this.toggler=document.querySelector(".sidebar-left-toggler"),this.isFloating=this.el.classList.contains("sidebar-floating"),this.isOpen=document.body.classList.contains("sidebar-left-open"),this.tabs=Array.from(this.el.querySelectorAll(".sidebar-tab")),this.tabSelectors=Array.from(document.querySelectorAll('[name="sidebar-tab-select"]'))}bindEvents(){if(this._toggleHandler=t=>{const e=t.target.closest(".sidebar-left-toggler");e&&this.handleToggle(t,e)},this._mousedownHandler=t=>{if(t.target.matches(".sidebar-content .ps__thumb-y")){const e=t.target.closest(".sidebar-content");e?.classList.add("ps-mousedown-scroll"),this.mousedownScrollbar=!0}},this._mouseupHandler=()=>{this.mousedownScrollbar&&(document.querySelectorAll(".sidebar-content.ps-mousedown-scroll").forEach(t=>t.classList.remove("ps-mousedown-scroll")),this.mousedownScrollbar=!1)},this._tabSelectHandler=t=>{t.target.matches('[name="sidebar-tab-select"]')&&this.switchTab(t.target.value)},this._collapseClickHandler=t=>{const e=t.target.closest('[data-toggle="collapse"]');if(!e)return;const i=e.dataset.breakpoint;if(i&&window.matchMedia(`(min-width: ${i}px)`).matches){let i=e.nextElementSibling?.querySelector("li a")||e.parentElement.nextElementSibling?.querySelector("li a");i&&(t.metaKey||t.ctrlKey?window.open(i.href,"_blank").focus():window.location.href=i.href)}else setTimeout(()=>this.scrollbar?.update(),300)},window.ResizeObserver)this.resizeObserver=new ResizeObserver(t=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{window.innerWidth>this.opts.breakpoint&&this.removeBackdrop()})}),this.resizeObserver.observe(document.body);else{let t;this._resizeHandler=()=>{clearTimeout(t);const e=performance.now();!this.lastResizeTime||e-this.lastResizeTime>100?(window.innerWidth>this.opts.breakpoint&&this.removeBackdrop(),this.lastResizeTime=e):t=setTimeout(()=>{window.innerWidth>this.opts.breakpoint&&this.removeBackdrop()},16)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}document.addEventListener("click",this._toggleHandler),document.addEventListener("click",this._tabSelectHandler),document.addEventListener("mousedown",this._mousedownHandler),document.addEventListener("mouseup",this._mouseupHandler),this.content&&this.content.addEventListener("click",this._collapseClickHandler)}unbindEvents(){document.removeEventListener("click",this._toggleHandler),document.removeEventListener("click",this._tabSelectHandler),document.removeEventListener("mousedown",this._mousedownHandler),document.removeEventListener("mouseup",this._mouseupHandler),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this.content&&this.content.removeEventListener("click",this._collapseClickHandler)}initializeScrollbars(){this.content&&(p?this.scrollbar=new p(this.content,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX}):this.content.style.overflowY="auto")}initializeTabs(){this.tabScrollbars=new Map,this.tabs.forEach(t=>{const e=t.querySelector(".tab-content");if(e)if(p){const i=new p(e,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX});this.tabScrollbars.set(t,i)}else e.style.overflowY="auto"})}destroyScrollbars(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.tabScrollbars.forEach(t=>t.destroy()),this.tabScrollbars.clear()}toggleWithTransition(t){const e=document.documentElement;e.classList.add("sidebar-transitioning"),"open"===t?(document.body.classList.add("sidebar-left-open"),this.isFloating&&window.innerWidth<=this.opts.breakpoint&&this.createBackdrop()):(document.body.classList.remove("sidebar-left-open"),this.removeBackdrop()),setTimeout(()=>{e.classList.remove("sidebar-transitioning")},330)}createBackdrop(){if(document.querySelector(".sidebar-backdrop"))return;const t=document.createElement("div");t.className="sidebar-backdrop",t.addEventListener("click",()=>{this.toggleWithTransition("close"),this.toggler&&(this.toggler.classList.remove("open"),null!==this.toggler.ariaExpanded&&(this.toggler.ariaExpanded="false"))});const e=document.querySelector(".site-main");e&&(e.appendChild(t),requestAnimationFrame(()=>{t.classList.add("show")}))}removeBackdrop(){const t=document.querySelector(".sidebar-backdrop");t&&(t.classList.remove("show"),t.addEventListener("transitionend",()=>{t.remove()},{once:!0}),setTimeout(()=>{t?.remove()},330))}handleToggle(t,e){if(t.stopPropagation(),!e)return;null!==e.ariaExpanded&&(e.ariaExpanded="true"!==e.ariaExpanded),e.classList.toggle("open");const i=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(i?"close":"open"),i?this.onClose():this.onShow()}switchTab(t){const e=document.getElementById(`sidebar-tab-${t}`);if(!e)return;const i=this.tabs;i.forEach(t=>{if(t.classList.toggle("active",t===e),t!==e){const s=t.querySelector(".tab-content");if(s)if(t===i[0])s.style.transform="translate3d(100%, 0px, 0px)";else if(t===i[i.length-1])s.style.transform="translate3d(-100%, 0px, 0px)";else{const n=i.indexOf(t)<i.indexOf(e);s.style.transform=`translate3d(${n?"-100%":"100%"}, 0px, 0px)`}}});const s=e.querySelector(".tab-content");s&&(s.style.transform="none"),this.tabSelectors.forEach(e=>{e.classList.toggle("active",e.value===t)})}toggle(){const t=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(t?"close":"open")}open(){document.body.classList.contains("sidebar-left-open")||this.toggleWithTransition("open")}close(){document.body.classList.contains("sidebar-left-open")&&this.toggleWithTransition("close")}}m._jQueryInit();class f extends i{static NAME="coolPopover";static DEFAULTS={container:"body",containerAutoDetect:!1,trigger:"focus",placement:"bottom",align:"center",offset:null,collisionDetection:!0,title:"",content:"",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${f.NAME}`);i||(i=new f(this,"object"==typeof t&&t),e.data(`plugin_${f.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[f.NAME];$.fn[f.NAME]=f._jQueryInterface,$.fn[f.NAME].Constructor=f,$.fn[f.NAME].defaults=f.DEFAULTS||{},$.fn[f.NAME].noConflict=()=>($.fn[f.NAME]=t,f._jQueryInterface)}constructor(t,e){super(),this.opts=d({},f.DEFAULTS,window.Cool?.settings?.popover||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.popoverEl&&(this.popoverEl.remove(),this.popoverEl=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.popoverEl&&this.setPosition(),this.onUpdate()}buildCache(){this.containerEl=this.el.dataset.container?document.querySelector(this.el.dataset.container):document.querySelector(this.opts.container),this.containerAutoDetect=void 0!==this.el.dataset.containerAutoDetect?this.el.dataset.containerAutoDetect:void 0!==this.el.dataset.containerautodetect?this.el.dataset.containerautodetect:this.opts.containerAutoDetect,this.id="popover-"+a(),this.trigger=this.el.dataset.trigger||this.opts.trigger,this.placement=this.el.dataset.placement||this.opts.placement,this.align=this.el.dataset.align||this.opts.align,this.title=this.el.dataset.title||this.opts.title,this.content=this.el.dataset.content||this.opts.content,this.offset=this.el.dataset.offset||this.opts.offset,this.collisionDetection="false"!==(this.el.dataset.collisionDetection||this.el.dataset.collisiondetection)&&(this.el.dataset.collisionDetection||this.el.dataset.collisiondetection||this.opts.collisionDetection),this.containerAutoDetect&&(this.containerEl=this.el.offsetParent||document.body)}bindEvents(){"click"===this.trigger?(this._clickHandler=()=>{this.popoverEl?this.close():this.show()},this.el.addEventListener("click",this._clickHandler)):"hover"===this.trigger?(this._mouseenterHandler=()=>{clearTimeout(this.hoverTimeout),this.show()},this._mouseleaveHandler=()=>{this.hoverTimeout=setTimeout(()=>{this.popupHasFocus||this.close()},100)},this.el.addEventListener("mouseenter",this._mouseenterHandler),this.el.addEventListener("mouseleave",this._mouseleaveHandler)):"focus"===this.trigger&&(this._focusinHandler=()=>this.show(),this._focusoutHandler=()=>this.close(),this.el.addEventListener("focusin",this._focusinHandler),this.el.addEventListener("focusout",this._focusoutHandler)),window.ResizeObserver&&(this._resizeCallback=()=>{this.popoverEl&&this.popoverEl.classList.contains("show")&&requestAnimationFrame(()=>{this.setPosition()})},s.observe(this.el,this._resizeCallback))}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this._mouseenterHandler&&this.el.removeEventListener("mouseenter",this._mouseenterHandler),this._mouseleaveHandler&&this.el.removeEventListener("mouseleave",this._mouseleaveHandler),this._focusinHandler&&this.el.removeEventListener("focusin",this._focusinHandler),this._focusoutHandler&&this.el.removeEventListener("focusout",this._focusoutHandler),this._resizeCallback&&(s.unobserve(this.el),this._resizeCallback=null)}buildPopover(){let t;t="function"==typeof this.content?this.content():this.content,this.popoverEl=document.createElement("div"),this.popoverEl.className="popover",this.popoverEl.setAttribute("role","tooltip"),this.popoverEl.id=this.id,this.popoverEl.innerHTML=`\n <h3 class="popover-header">${this.title}</h3>\n <div class="popover-body">${t}</div>\n `,this.containerEl.appendChild(this.popoverEl),this.popoverEl.addEventListener("mouseenter",()=>{this.popupHasFocus=!0,"hover"===this.trigger&&this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),this.popoverEl.addEventListener("mouseleave",()=>{this.popupHasFocus=!1,"hover"===this.trigger&&(this.hoverTimeout=setTimeout(()=>{this.close()},100))})}setPosition(t){"undefined"!=typeof t&&null!==t||(t=this.placement);const e=window.innerWidth,i=window.innerHeight,s=this.popoverEl.offsetWidth,n=this.popoverEl.offsetHeight,o=this.el.offsetWidth,l=this.el.offsetHeight;let a,r;const h=this.containerEl.getBoundingClientRect(),c=h.left+window.scrollX,d=h.top+window.scrollY,u=this.el.getBoundingClientRect(),p=u.left+window.scrollX,m=u.top+window.scrollY;a=p-c,r=m-d;let f=0,b=0,g=0,y=0;if(this.offset){const t=this.offset.split(",");g=parseInt(t[0],10)||0,y=parseInt(t[1],10)||0}const E=getComputedStyle(this.popoverEl),w=parseInt(E.getPropertyValue("--cool-popover-spacer"))||8,v=(t,e=this.align)=>{let i=0,h=0;switch(t){case"top":i="end"===e?a+o-s:"center"===e?a+(o-s)/2:a,h=r-n-w;break;case"bottom":i="end"===e?a+o-s:"center"===e?a+(o-s)/2:a,h=r+l+w;break;case"left":i=a-s-w,h="end"===e?r+l-n:"center"===e?r+(l-n)/2:r;break;case"right":i=a+o+w,h="end"===e?r+l-n:"center"===e?r+(l-n)/2:r}return{x:i+g,y:h+y}};let C=t,_=this.align,S=v(t);if(this.collisionDetection){const o=5,l=t=>{const l={top:!1,bottom:!1,left:!1,right:!1},a=c+t.x,r=d+t.y,h=a+s,u=r+n;return l.top=r<o,l.bottom=u>i-o,l.left=a<o,l.right=h>e-o,l},a=l(S);"bottom"===t&&a.bottom&&!a.top?(C="top",S=v("top",_)):"top"===t&&a.top&&!a.bottom?(C="bottom",S=v("bottom",_)):"right"===t&&a.right&&!a.left?(C="left",S=v("left",_)):"left"===t&&a.left&&!a.right&&(C="right",S=v("right",_));const r=l(S);"top"!==C&&"bottom"!==C||("end"===_&&r.left&&!r.right?(_="start",S=v(C,_)):"start"===_&&r.right&&!r.left&&(_="end",S=v(C,_)));const h=l(S);h.left?S.x+=o-(c+S.x):h.right&&(S.x-=c+S.x+s-(e-o)),h.top?S.y+=o-(d+S.y):h.bottom&&(S.y-=d+S.y+n-(i-o))}f=S.x,b=S.y,Object.assign(this.popoverEl.style,{transform:`translate3d(${Math.round(f)}px, ${Math.round(b)}px, 0px)`,willChange:"transform"}),this.popoverEl.setAttribute("x-placement",C+"-"+_)}show(){this.popoverEl||(this.buildPopover(),this.setPosition(),this.popoverEl.classList.add("show"),this.el.setAttribute("data-popover",this.id),this.onShow())}close(){this.popoverEl&&(this.popoverEl.remove(),this.el.removeAttribute("data-popover"),this.popoverEl=null,this.onClose())}}f._jQueryInit();let b=null;try{b=require("perfect-scrollbar"),b&&b.default&&(b=b.default)}catch(t){}"undefined"!=typeof window&&b&&!window.PerfectScrollbar&&(window.PerfectScrollbar=b);const g=new WeakMap;function y(t){if(!t)return 0;const e=getComputedStyle(t);return t.offsetHeight+parseInt(e.marginTop,10)+parseInt(e.marginBottom,10)}class E extends i{static NAME="coolSelect";static DEFAULTS={name:"",type:"checkbox",labelTemplate:null,confirmCheck:null,confirmUncheck:null,setData:null,scrollContentHeight:300,useNativeScroll:!1,contentWidth:null,faPro:!1,items:[],showSearch:!1,showFooter:!1,searchApi:!1,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onReset:null,onSearch:null,onSelect:null,buildScroll:null,searchPlaceholder:null,btnCloseText:null,dynamicTitle:!1,dynamicTitleDefault:"",dynamicTitleEmptyDefault:"",allowNoneOnRadioSelect:!0,preventUncheck:!1,showValidStateIcon:!0,itemsToExclude:[],primaryKeyword:"id",position:"absolute",scrollEl:".content",useChips:!1};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${E.NAME}`);i||(i=new E(this,"object"==typeof t&&t),e.data(`plugin_${E.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[E.NAME];$.fn[E.NAME]=E._jQueryInterface,$.fn[E.NAME].Constructor=E,$.fn[E.NAME].defaults=E.DEFAULTS||{},$.fn[E.NAME].noConflict=()=>($.fn[E.NAME]=t,E._jQueryInterface)}constructor(t,e){super(),this.opts=d({},E.DEFAULTS,window.Cool?.settings?.select||{},e||{}),this.el=t,this.useChips=!1,this.cachedTitle="",this.lastSearchQuery="",this._resizeCallback=null,this._scrollCallback=null,this.init()}init(){this.buildCache(),this.buildScroll(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.bindEvents();let t=Promise.resolve();return this.searchApi&&this.searchApi.length&&(t=this._performInitialSearch()),t.then(()=>{this.onUpdate()})}reset(){this.data={},this.data[this.name]=[],this.items=[],this.selectEl.querySelectorAll(".select-item").forEach(t=>t.remove()),this.selectItems=[],this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.selectHeaderEl.classList.remove("select-placeholder"),"function"==typeof this.dynamicTitle?this.selectTitleEl.textContent=this.dynamicTitle.call(this):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.selectTitleEl.textContent.trim()&&(this.selectItems.length>0||this.searchApi)&&(this.selectTitleEl.textContent=this.dynamicTitleDefault),0==this.selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.selectHeaderEl.classList.add("select-placeholder"),this.selectIconContainerEl&&this.selectIconContainerEl.classList.add("d-none"),this.selectTitleEl.textContent=this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchData=[],this.searchInputEl.value="",this.searchString="",this.search.call(this))}buildCache(){if(this.containerEl=this.el.parentElement,this.selectHeaderEl=this.el.querySelector(".select-header"),this.selectTitleEl=this.el.querySelector(".select-title"),this.cachedTitle=this.selectTitleEl?this.selectTitleEl.textContent:"",this.selectIconContainerEl=this.selectHeaderEl?this.selectHeaderEl.querySelector(".select-icon"):null,this.searchIconContainerEl=this.el.querySelector(".select-search-icon"),this.selectIconDefault=this.selectIconContainerEl?this.selectIconContainerEl.innerHTML:'<i class="'+(this.opts.faPro?"fal":"fas")+'fa-angle-down icon"></i>',this.name=this.el.dataset.name||this.opts.name,this.scroll=null,this.scrollContentHeight=this.el.dataset.scrollContentHeight||this.el.dataset.scrollcontentheight||this.opts.scrollContentHeight,this.useNativeScroll=this.el.dataset.useNativeScroll||this.el.dataset.usenativescroll||this.opts.useNativeScroll,this.contentWidth=this.el.dataset.contentWidth||this.el.dataset.contentwidth||this.opts.contentWidth,this.items=this.el.dataset.items?JSON.parse(this.el.dataset.items):this.opts.items,this.data={},this.data[this.name]=[],this.searchData=[],this.searchApi=this.el.dataset.searchApi||this.el.dataset.searchapi||this.opts.searchApi,this.searchRequest=null,this.type=this.el.dataset.type||this.opts.type,this.contentOpen=this.el.classList.contains("show"),this.searchPlaceholder=this.el.dataset.searchPlaceholder||this.opts.searchPlaceholder,this.btnCloseText=this.el.dataset.btnCloseText||this.opts.btnCloseText,this.labelTemplate=this.opts.labelTemplate,this.confirmCheck=this.opts.confirmCheck,this.confirmUncheck=this.opts.confirmUncheck,this.preventUncheck=this.el.dataset.preventUncheck||this.el.dataset.preventuncheck||this.opts.preventUncheck,this.dynamicTitle=this.el.dataset.dynamicTitle||this.el.dataset.dynamictitle||this.opts.dynamicTitle,this.dynamicTitleDefault=this.el.dataset.dynamicTitleDefault||this.el.dataset.dynamictitledefault||this.opts.dynamicTitleDefault,this.dynamicTitleEmptyDefault=this.el.dataset.dynamicTitleEmptyDefault||this.el.dataset.dynamictitleemptydefault||this.opts.dynamicTitleEmptyDefault,this.allowNoneOnRadioSelect=this.el.dataset.allowNoneOnRadioSelect||this.el.dataset.allowneonradioselect||this.opts.allowNoneOnRadioSelect,this.showValidStateIcon=this.el.dataset.showValidStateIcon||this.el.dataset.showvalidstateicon||this.opts.showValidStateIcon,this.itemsToExclude=this.el.dataset.itemsToExclude||this.el.dataset.itemstoexclude?(this.el.dataset.itemsToExclude||this.el.dataset.itemstoexclude).replace(/\s/g,"").split(","):this.opts.itemsToExclude,this.primaryKeyword=this.el.dataset.primaryKeyword||this.el.dataset.primarykeyword||this.opts.primaryKeyword,this.useChips=this.el.dataset.useChips||this.el.dataset.usechips||this.opts.useChips,this.position=this.el.dataset.position||this.opts.position,this.useChips&&(this.showValidStateIcon=!1),this.preventClose=!1,this.itemsToExclude.length>0&&(this.itemsToExclude=this.itemsToExclude.map(String)),this.opts.setData&&(this.data=this.opts.setData),(this.el.dataset.setData||this.el.dataset.setdata)&&""!=(this.el.dataset.setData||this.el.dataset.setdata))try{this.data=JSON.parse(this.el.dataset.setData||this.el.dataset.setdata)}catch(t){this.data=this.el.dataset.setData||this.el.dataset.setdata}if(!Array.isArray(this.data[this.name])&&""!==this.data[this.name]&&this.data[this.name].length>0){const t=this.data[this.name].toString().trim().split(",");this.data[this.name]=t}if(this.data[this.name].length>0&&!this.useChips&&(this.data[this.name]=this.data[this.name].map(String)),this.data[this.name].length>0&&this.itemsToExclude.length>0&&(this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]?-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString()):-1===this.itemsToExclude.indexOf(t.toString()))),this.data&&this.useChips&&this._renderChips(),this.items.length>0&&this.itemsToExclude.length>0&&(this.items=this.items.filter(t=>t[this.primaryKeyword]?-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString()):-1===this.itemsToExclude.indexOf(t.toString()))),this.el.querySelector(".select-search")?this.showSearch=!0:this.showSearch=this.el.dataset.showSearch||this.el.dataset.showsearch||this.opts.showSearch,this.el.querySelector(".select-footer")?this.showFooter=!0:this.showFooter=this.el.dataset.showFooter||this.el.dataset.showfooter||this.opts.showFooter,this.selectEl=this.el.querySelector(".select-content"),this.selectEl){const t=this.selectEl.querySelectorAll(".select-item");t.length>0&&this.itemsToExclude.length>0&&t.forEach(t=>{const e=t.querySelector("input");e&&this.itemsToExclude.indexOf(e.value)>-1&&t.remove()})}else{let t=this._renderItemList(this.items);const e=document.createElement("div");e.innerHTML=`\n <div class="select-content">\n ${this._renderSearch()}\n <div class="select-scrollable-content"></div>\n ${this._renderFooter()}\n </div>\n `,this.selectEl=e.firstElementChild,this.el.appendChild(this.selectEl);const i=this.selectEl.querySelector(".select-scrollable-content");t.forEach(t=>i.appendChild(t))}if(this.data[this.name].length>0){const t=this.useChips?this.data[this.name].map(t=>t[this.primaryKeyword].toString()):this.data[this.name].map(String);if(this.selectEl.querySelectorAll("input").forEach(e=>{t.includes(e.value)&&(e.checked=!0,"radio"===this.type&&e.classList.add("checked"))}),this.useChips)this._renderChips();else if("radio"===this.type&&"function"!=typeof this.dynamicTitle){const t=this.selectEl.querySelector("input:checked");if(t){const e=t.parentElement.querySelector("[data-label]");e&&(this.selectTitleEl.textContent=e.textContent)}}}this.scrollableContentEl=this.selectEl.querySelector(".select-scrollable-content")||null,this.selectItems=Array.from(this.selectEl.querySelectorAll(".select-item")),this.selectHeaderEl.classList.remove("select-placeholder"),this.searchApi&&this.searchApi.length&&this._performInitialSearch(),"function"==typeof this.dynamicTitle?this.selectTitleEl.textContent=this.dynamicTitle.call(this):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.selectTitleEl.textContent.trim()&&(this.selectItems.length>0||this.searchApi)&&(this.selectTitleEl.textContent=this.dynamicTitleDefault),0==this.selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.selectHeaderEl.classList.add("select-placeholder"),this.selectIconContainerEl&&this.selectIconContainerEl.classList.add("d-none"),this.selectTitleEl.textContent=this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchContainerEl=this.selectEl.querySelector(".select-search"),this.searchInputEl=this.selectEl.querySelector('[name="select-search"]'),this.clearSearchButtonEl=this.selectEl.querySelector("[data-clear-search]"),this.searchInputEl&&(this.searchInputEl.tabIndex=-1)),this.showFooter&&(this.footerContainerEl=this.selectEl.querySelector(".select-footer"),this.closeButtonEl=this.selectEl.querySelector("[data-select-close]"),this.closeButtonEl&&(this.closeButtonEl.tabIndex=-1)),this.buildSearchData()}_updateScrollbarVisibility(){if(this.scroll&&this.scrollableContentEl){const t=this.scrollableContentEl;t.scrollHeight>t.clientHeight?(this.scroll.settings.suppressScrollY=!1,this.scrollableContentEl.classList.add("ps-show-rail-y")):(this.scroll.settings.suppressScrollY=!0,this.scrollableContentEl.classList.remove("ps-show-rail-y")),this.scroll.update()}}_performInitialSearch(){return this.isSearchApiEnabled()?(this._showSpinner(),fetch(this.searchApi).then(t=>t.json()).then(t=>{let e=t.filter(t=>-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString())&&0!=t[this.primaryKeyword]);this.useChips&&this.data[this.name].length>0&&(this.data[this.name].forEach(t=>{const i=e.find(e=>e[this.primaryKeyword].toString()===t[this.primaryKeyword].toString());i&&(t.label=i.label||i.name||i.value)}),this.selectTitleEl.innerHTML="",this.data[this.name].forEach(t=>{const e=document.createElement("span");e.className="chip",e.dataset.value=t[this.primaryKeyword],e.innerHTML=`<span class="chip-title">${c(t.label)}</span>`,e.addEventListener("click",e=>{e.stopPropagation();const i=this.selectEl.querySelector(`input[value="${t[this.primaryKeyword]}"]`);i&&(i.checked=!1,i.dispatchEvent(new Event("change",{bubbles:!0})))}),this.selectTitleEl.appendChild(e)}));let i=this._renderItemList(e);this.scrollableContentEl.innerHTML="",i.forEach(t=>this.scrollableContentEl.appendChild(t)),this.data[this.name].length>0&&this.data[this.name].forEach(t=>{const e=this.useChips?t[this.primaryKeyword].toString():t.toString(),i=this.scrollableContentEl.querySelector(`input[value="${e}"]`);i&&(i.checked=!0,"radio"===this.type&&i.classList.add("checked"))}),this._updateScrollbarVisibility(),this._hideSpinner(),this.useChips&&this.data[this.name].length>0&&this._renderChips(),this.contentOpen&&this._recalculateContentHeight()}).catch(t=>{this._hideSpinner(),this.scrollableContentEl.innerHTML='<div class="p-3 text-danger">Error loading items</div>'})):Promise.resolve()}buildScroll(){if(this.scrollableContentEl){let t=this.scrollContentHeight;this.showSearch&&this.searchContainerEl&&(t-=y(this.searchContainerEl)||0),this.showFooter&&this.footerContainerEl&&(t-=y(this.footerContainerEl)||0);const e=(parseInt(getComputedStyle(this.scrollableContentEl).marginTop,10)||0)+(parseInt(getComputedStyle(this.scrollableContentEl).marginBottom,10)||0),i=this.scrollableContentEl.scrollHeight,s=Math.min(i,t+e);this.scrollableContentEl.style.maxHeight=s+"px",l()?this.scrollableContentEl.style.overflowY="auto":(!1===this.useNativeScroll&&b?(this.scrollableContentEl.classList.add("ps-dark"),this.scroll=new b(this.scrollableContentEl,{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,scrollYMarginOffset:-1,suppressScrollY:!0,suppressScrollX:!0}),setTimeout(()=>{this._updateScrollbarVisibility()},0)):this.scrollableContentEl.style.overflowY="auto",this.scrollableContentEl.querySelectorAll('[tabindex="0"]').forEach(t=>{t.tabIndex=-1}))}}buildSearchData(){this.searchData=[];this.selectEl.querySelectorAll("[data-label]").forEach((t,e)=>{this.searchData.push({id:e,val:t.textContent.trim()})})}bindEvents(){if(this._headerClickHandler=()=>{this.contentOpen?this.close():(this.selectItems.length>0||this.searchApi)&&this.show()},this.selectHeaderEl.addEventListener("click",this._headerClickHandler),this._checkboxChangeHandler=t=>{if(!t.target.matches('input[type="checkbox"]'))return;const e=t.target,i=e.value,s=600;if(this.preventClose=!0,"function"==typeof this.confirmCheck&&e.checked)e.checked=!1,this.confirmCheck(t=>{if("confirmed"==t){if(this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword]===i)){const t=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:i,label:t?t.textContent:i})}}else-1===this.data[this.name].indexOf(i)&&this.data[this.name].push(i);e.checked=!0,this.onSelect(e)}setTimeout(()=>{this.preventClose=!1},s)},e);else if(e.checked){if(this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword]===i)){const t=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:i,label:t?t.textContent:i})}}else-1===this.data[this.name].indexOf(i)&&this.data[this.name].push(i);this.onSelect(e),setTimeout(()=>{this.preventClose=!1},s)}else"function"!=typeof this.confirmUncheck||e.checked?e.checked||this.preventUncheck?!e.checked&&this.preventUncheck&&(e.checked=!0,setTimeout(()=>{this.preventClose=!1},s)):(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]!=i):this.data[this.name]=this.data[this.name].filter(t=>t!=i),this.onSelect(e),setTimeout(()=>{this.preventClose=!1},s)):(e.checked=!0,this.confirmUncheck(t=>{"confirmed"==t&&(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]!=i):this.data[this.name]=this.data[this.name].filter(t=>t!=i),e.checked=!1,this.onSelect(e)),setTimeout(()=>{this.preventClose=!1},s)},e))},this.el.addEventListener("change",this._checkboxChangeHandler),this._radioChangeHandler=t=>{if(!t.target.matches('input[type="radio"]'))return;const e=t.target,i=e.value;if(e.checked){if(this.useChips){const t=e.parentElement.querySelector("[data-label]");this.data[this.name]=[{[this.primaryKeyword]:i,label:t?t.textContent:i}]}else this.data[this.name]=[i];this.data[this.name]=[i],this.selectEl.querySelectorAll('input[type="radio"]').forEach(t=>{t!==e&&(t.checked=!1,t.classList.remove("checked"))})}else this.data[this.name]=[]},this.el.addEventListener("change",this._radioChangeHandler),this._radioClickHandler=t=>{if(!t.target.matches('input[type="radio"]'))return;const e=t.target;if(e.classList.contains("checked")&&this.allowNoneOnRadioSelect&&!this.preventUncheck)this.data[this.name]=[],e.checked=!1,e.classList.remove("checked"),this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitleDefault);else if(e.classList.add("checked"),this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");this.selectTitleEl.textContent=c(t?t.textContent:"")}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(e)),this.onSelect(e)},this.el.addEventListener("click",this._radioClickHandler),this.scroll){const t=this.scrollableContentEl?this.scrollableContentEl.querySelector(".ps__thumb-y"):null;t&&(this._thumbMousedownHandler=()=>{this.scrollableContentEl.classList.add("ps-mousedown-scroll")},t.addEventListener("mousedown",this._thumbMousedownHandler)),this._documentMouseupHandler=()=>{this.scrollableContentEl&&this.scrollableContentEl.classList.contains("ps-mousedown-scroll")&&this.scrollableContentEl.classList.remove("ps-mousedown-scroll")},document.addEventListener("mouseup",this._documentMouseupHandler)}this.showSearch&&(this._searchKeydownHandler=o(()=>{this.searchString=this.searchInputEl.value.trim(),this.search.call(this)},250),this.searchInputEl.addEventListener("keydown",this._searchKeydownHandler),this._searchFocusinHandler=()=>{this.searchContainerEl.classList.add("focused")},this.searchInputEl.addEventListener("focusin",this._searchFocusinHandler),this._searchFocusoutHandler=()=>{this.searchContainerEl.classList.remove("focused")},this.searchInputEl.addEventListener("focusout",this._searchFocusoutHandler),this._clearSearchHandler=t=>{t.target.closest("[data-clear-search]")&&this.searchString.length&&(this.searchInputEl.value="",this.searchString="",this.search.call(this))},this.searchContainerEl.addEventListener("click",this._clearSearchHandler)),this.showFooter&&this.closeButtonEl&&(this._footerCloseHandler=()=>{this.close()},this.closeButtonEl.addEventListener("click",this._footerCloseHandler)),this._documentClickHandler=t=>{this.el.contains(t.target)||!this.contentOpen||this.preventClose||this.close.call(this)},document.addEventListener("touchstart",this._documentClickHandler),document.addEventListener("click",this._documentClickHandler),"fixed"===this.position&&(this._scrollCallback=()=>{this.el&&this.el.classList.contains("show")&&requestAnimationFrame(()=>{const t=this.el.querySelector(".select-content"),e=this.containerEl.getBoundingClientRect();t&&Object.assign(t.style,{top:e.top+"px",left:e.left+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:this.containerEl.offsetWidth+"px"})})},window.ResizeObserver&&(this._resizeCallback=()=>{this.el&&this.el.classList.contains("show")&&requestAnimationFrame(()=>{const t=this.el.querySelector(".select-content"),e=this.containerEl.getBoundingClientRect();t&&Object.assign(t.style,{top:e.top+"px",left:e.left+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:this.containerEl.offsetWidth+"px"})})},s.observe(document.body,this._resizeCallback)))}unbindEvents(){if(this._headerClickHandler&&(this.selectHeaderEl.removeEventListener("click",this._headerClickHandler),this._headerClickHandler=null),this._checkboxChangeHandler&&(this.el.removeEventListener("change",this._checkboxChangeHandler),this._checkboxChangeHandler=null),this._radioChangeHandler&&(this.el.removeEventListener("change",this._radioChangeHandler),this._radioChangeHandler=null),this._radioClickHandler&&(this.el.removeEventListener("click",this._radioClickHandler),this._radioClickHandler=null),this._thumbMousedownHandler){const t=this.scrollableContentEl?this.scrollableContentEl.querySelector(".ps__thumb-y"):null;t&&t.removeEventListener("mousedown",this._thumbMousedownHandler),this._thumbMousedownHandler=null}this._documentMouseupHandler&&(document.removeEventListener("mouseup",this._documentMouseupHandler),this._documentMouseupHandler=null),this._searchKeydownHandler&&(this.searchInputEl.removeEventListener("keydown",this._searchKeydownHandler),this._searchKeydownHandler=null),this._searchFocusinHandler&&(this.searchInputEl.removeEventListener("focusin",this._searchFocusinHandler),this._searchFocusinHandler=null),this._searchFocusoutHandler&&(this.searchInputEl.removeEventListener("focusout",this._searchFocusoutHandler),this._searchFocusoutHandler=null),this._clearSearchHandler&&this.searchContainerEl&&(this.searchContainerEl.removeEventListener("click",this._clearSearchHandler),this._clearSearchHandler=null),this._footerCloseHandler&&this.closeButtonEl&&(this.closeButtonEl.removeEventListener("click",this._footerCloseHandler),this._footerCloseHandler=null),this._documentClickHandler&&(document.removeEventListener("touchstart",this._documentClickHandler),document.removeEventListener("click",this._documentClickHandler),this._documentClickHandler=null),"fixed"===this.position&&(this._scrollCallback&&(n.remove(`select-${this.name}`),this._scrollCallback=null),this._resizeCallback&&(s.unobserve(document.body),this._resizeCallback=null))}getData(t){return t?this.data[t]:this.data}setData(){let t=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${t} fa-check text-success icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.useChips&&(this.selectTitleEl.innerHTML=""),this.searchApi.length){let t=this.searchApi,e=this.data[this.name].length,i=0;this.data[this.name].forEach(s=>{t+=encodeURIComponent("#"+s),i++,i!==e&&(t+="+")}),fetch(t).then(t=>t.json()).then(t=>{let e=t.map(t=>t.id.toString());this.data[this.name]=this.data[this.name].filter(t=>this.useObjects?e.indexOf(t[this.primaryKeyword].toString())>-1:e.indexOf(t.toString())>-1),0==this.data[this.name].length&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault);const i=t.filter(t=>this.useObjects?this.data[this.name].findIndex(e=>e[this.primaryKeyword]==t.id)>-1&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id:this.data[this.name].indexOf(t.id)>-1&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id);this._renderItemList(i).forEach(t=>this.scrollableContentEl.appendChild(t));let s=Array.from(this.scrollableContentEl.querySelectorAll("input"));if(this._updateScrollbarVisibility(),this.scrollableContentEl.querySelector('input[type="checkbox"]')?this.type="checkbox":this.scrollableContentEl.querySelector('input[type="radio"]')&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(t=>{let e=this.useObjects?t[this.primaryKeyword].toString():t.toString(),i=s.find(t=>t.value==e);i&&(i.checked=!0,this.useChips&&this._renderChips(),this.onSelect(i))});else if("radio"==this.type){const t=this.data[this.name][0];let e=s.find(e=>e.value==t);if(e){if(e.checked=!0,e.classList.add("checked"),this.useChips)this._renderChips();else if(this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");t&&(this.selectTitleEl.textContent=t.textContent)}this.onSelect(e)}}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(this))})}else{let t=Array.from(this.scrollableContentEl.querySelectorAll("input")),e=t.map(t=>t.value.toString());if(this.data[this.name]=this.data[this.name].filter(t=>e.indexOf(t.toString())>-1),0==this.data[this.name].length&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.scrollableContentEl.querySelector('input[type="checkbox"]')?this.type="checkbox":this.scrollableContentEl.querySelector('input[type="radio"]')&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(e=>{let i=t.find(t=>t.value==e);i&&(i.checked=!0,this.useChips&&this._renderChips(),this.onSelect(i))});else if("radio"==this.type){let e=t.find(t=>t.value==this.data[this.name][0]);if(e){if(e.checked=!0,e.classList.add("checked"),this.useChips)this._renderChips();else if(this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");t&&(this.selectTitleEl.textContent=t.textContent)}this.onSelect(e)}}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(this))}}_renderChips(){this.selectTitleEl.innerHTML="",0!==this.data[this.name].length?(this.data[this.name].forEach(t=>{const e=this.useChips?t[this.primaryKeyword]:t,i=this.selectEl?this.selectEl.querySelector(`input[value="${e}"]`):null,s=i?i.parentElement.querySelector("[data-label]"):null,n=s?s.textContent:t.label||t.name||t.value||e,o=document.createElement("span");o.className="chip",o.dataset.value=e,o.innerHTML=`<span class="chip-title">${c(n)}</span>`,o.addEventListener("click",i=>{i.stopPropagation();const s=this.selectEl.querySelector(`input[value="${e}"]`);s?(s.checked=!1,s.dispatchEvent(new Event("change",{bubbles:!0}))):(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==e.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==e.toString()),this.searchApi.length&&(this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==e.toString())),this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(this,t,this,!1))}),this.selectTitleEl.appendChild(o)}),this.contentOpen&&setTimeout(()=>{this._updateScrollbarVisibility()},0)):this.dynamicTitle&&this.dynamicTitleDefault?this.selectTitleEl.textContent=this.dynamicTitleDefault:this.selectTitleEl.textContent=this.cachedTitle}search(){let t=this.opts.faPro?"fal":"fas";if(this.searchString.length)if(this.isSearchApiEnabled()){if(this.searchString===this.lastSearchQuery)return;this.lastSearchQuery=this.searchString,this._showSpinner(),this._searchAbortController&&this._searchAbortController.abort(),clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=setTimeout(()=>{this._searchAbortController=new AbortController,fetch(this.searchApi+this.searchString,{signal:this._searchAbortController.signal}).then(t=>t.json()).then(e=>{this._searchAbortController=null,this.scrollableContentEl.querySelectorAll("input:not(:checked)").forEach(t=>{const e=t.closest(".select-item");e&&!e.classList.contains("static-item")&&e.remove()});const i=e.filter(t=>this.useObjects?-1===this.data[this.name].findIndex(e=>e[this.primaryKeyword]==t.id)&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id:-1===this.data[this.name].indexOf(t.id)&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id);this._renderItemList(i).forEach(t=>this.scrollableContentEl.appendChild(t)),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-times icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search","true"),this._updateScrollbarVisibility(),this.contentOpen&&this._recalculateContentHeight()}).catch(t=>{"AbortError"!==t.name&&this._hideSpinner()})},300)}else{const e=this.searchString.toLowerCase();let i=this.searchData.filter(t=>t.val.toLowerCase().indexOf(e)>-1);this.selectItems.forEach(t=>{t.classList.remove("d-none"),t.classList.remove("visible")}),i.forEach(t=>{this.selectItems[t.id]&&this.selectItems[t.id].classList.add("visible")}),this.selectItems.filter(t=>!t.classList.contains("visible")).forEach(t=>t.classList.add("d-none")),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-times icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search","true")}else this.lastSearchQuery="",this.isSearchApiEnabled()?(this.scrollableContentEl.querySelectorAll("input:not(:checked)").forEach(t=>{const e=t.closest(".select-item");e&&!e.classList.contains("static-item")&&e.remove()}),this._hideSpinner(),this.searchIconContainerEl.setAttribute("data-clear-search",""),this._performInitialSearch()):(this.selectItems.forEach(t=>{t.classList.remove("d-none"),t.classList.remove("visible")}),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-search icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search",""));this.scroll&&this.scroll.update(),this.onUpdate()}_recalculateContentHeight(){const t=this.el.querySelector(".select-content"),e=y(this.selectHeaderEl),i=this.scrollContentHeight,s=window.innerHeight,n=window.scrollY;let o=i,l=0,a=0;if(this.searchContainerEl&&(l=y(this.searchContainerEl)||0),this.footerContainerEl&&(a=y(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;o=Math.min(Math.max(t,e)+l+a,i)}let r=this.el.classList.contains("select-dropup"),h=0,c=o;const d=parseInt(getComputedStyle(t).marginBottom||0,10),u=parseInt(getComputedStyle(t).marginTop||0,10);if("fixed"===this.position){const t=this.containerEl.getBoundingClientRect().top,i=s-t-e-50,n=t-50;r?(c=Math.min(o,n),h=t-c-d):(c=Math.min(o,i),h=t+e+u)}else{const t=this.containerEl.getBoundingClientRect().top+n,i=s-(t-n)-e-50,l=t-n-50;r?(c=Math.min(o,l),h=-c-d):(c=Math.min(o,i),h=e+u)}const p=c-l-a;t.style.height=c+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=p+"px"),t.style.top=h+"px",this.scroll&&setTimeout(()=>{this._updateScrollbarVisibility()},0)}show(){if(this.el.classList.contains("show"))return;let t=0,e=0;if("fixed"===this.position){const i=this.containerEl.getBoundingClientRect();t=i.top,e=i.left}const i=document.querySelectorAll(".select.show");let s=1,o=this.opts.faPro?"fal":"fas";i.length&&(s=parseInt(getComputedStyle(i[0]).zIndex,10)+2),this.el.classList.add("show"),i.length||(s=parseInt(getComputedStyle(this.el).zIndex,10)+1);const l=this.el.querySelector(".select-content"),a=y(this.selectHeaderEl),r=this.scrollContentHeight,h=window.innerHeight,c=window.scrollY;let d=r,u=0,p=0;if(this.searchContainerEl&&(u=y(this.searchContainerEl)||0),this.footerContainerEl&&(p=y(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;d=Math.min(Math.max(t,e)+u+p,r)}let m=!1,f=0,b=d;const g=parseInt(getComputedStyle(l).marginBottom||0,10),E=parseInt(getComputedStyle(l).marginTop||0,10);if("fixed"===this.position){const e=h-t-a-50,i=t-50;m=e<d&&i>e,m?(b=Math.min(d,i),f=t-b-g):(b=Math.min(d,e),f=t+a+E)}else{const t=this.containerEl.getBoundingClientRect().top+c,e=h-(t-c)-a-50,i=t-c-50;m=e<d&&i>e,m?(b=Math.min(d,i),f=-b-g):(b=Math.min(d,e),f=a+E)}const w=b-u-p;l.style.height=b+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=w+"px"),this.el.classList.toggle("select-dropup",m),this.el.classList.toggle("select-dropdown",!m);const v=l.offsetWidth;Object.assign(l.style,{zIndex:s,position:"fixed"===this.position?"fixed":"absolute"});const C=this.containerEl.offsetWidth;"fixed"===this.position?Object.assign(l.style,{top:f+"px",left:e+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:C+"px"}):Object.assign(l.style,{top:f+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:v>C?"var(--cool-select-content-width, auto)":C+"px"}),l.style.minWidth=C+"px",this.scrollableContentEl&&this.scrollableContentEl.offsetHeight<this.scrollableContentEl.scrollHeight&&(this.scrollableContentEl.scrollTop=1,this.scrollableContentEl.scrollTop=0),m?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${o} fa-angle-down icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${o} fa-angle-up icon"></i>`),setTimeout(()=>{this.el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),this.scroll&&this._updateScrollbarVisibility()},300),this.contentOpen=!0,"fixed"===this.position&&this._scrollCallback&&n.add(`select-${this.name}`,this._scrollCallback),this.onShow()}close(){if(!this.preventClose){let t=this.opts.faPro?"fal":"fas";this.el.classList.remove("show"),this.el.classList.remove("select-dropup","select-dropdown"),setTimeout(()=>{this.el.removeAttribute("style")},300),this.data[this.name].length>0&&this.showValidStateIcon?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${t} fa-check text-success icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.contentOpen=!1,"fixed"===this.position&&this._scrollCallback&&n.remove(`select-${this.name}`),this.onClose()}}onSelect(t){const e=t.closest(".select-item"),i=e&&g.get(e)||{},s=t.value;if(this.searchApi.length&&Object.keys(i).length>0)if(t.checked)if(this.items.push(i),this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword].toString()===s.toString())){const e=t.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:s,label:e?e.textContent:s})}}else-1===this.data[this.name].indexOf(s)&&this.data[this.name].push(s);else this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==s.toString()),this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==s.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==s.toString());this.useChips&&this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,t.checked)}getItem(t,e){let i=this.items.filter(i=>i[t]==e)[0];return i||null}getSelectedItems(t){let e=[],i=[],s=this.data[this.name];return Array.isArray(s)?e=s:e.push(s),e=this.useChips?e.map(t=>t[this.primaryKeyword].toString()):e.map(String),this.items.length>0?(i=this.items.filter(t=>e.indexOf(t.id.toString())>-1),t&&(i=i.map(e=>e[t]).filter(t=>null!=t))):i=e,i}getSelectedItem(t){return this.getSelectedItems(t)[0]}_renderItemList(t){if(!t||!t.length)return[];const e=this.data[this.name].map(t=>this.useChips?t[this.primaryKeyword].toString():t.toString()),i=[];for(let s=0;s<t.length;++s){const n=t[s];let o="";"function"==typeof this.labelTemplate?o=this.labelTemplate(n):n.name?o=n.name:n.label?o=n.label:n.value&&(o=n.value);const l=this.useChips?n[this.primaryKeyword]:n.id,a=e.indexOf(l.toString())>-1,r=document.createElement("div");r.innerHTML=this._getItemTemplate(n,s,o,a).trim();const h=r.firstElementChild;g.set(h,n),i.push(h)}return i}_getItemTemplate(t,e,i,s){return`\n <div class="select-item">\n <div class="select-item-${this.type}">\n <div class="form-check">\n <input type="${this.type}"\n id="select-${this.name}-${t.id}"\n value="${t.id}"\n tabindex="-1"\n ${s?"checked":""}>\n <label for="select-${this.name}-${t.id}">\n <span class="form-check-icon">\n <svg viewBox="0 0 18 18">\n <polyline points="1.5 6 4.5 9 10.5 1"></polyline>\n </svg>\n </span>\n <span class="form-check-label"${"function"!=typeof this.labelTemplate?" data-label":""}>\n ${"function"!=typeof this.labelTemplate?c(i):i}\n </span>\n </label>\n </div>\n </div>\n </div>`}_renderSearch(){if(this.showSearch){const t=this.opts.faPro?"fal":"fas";return`\n\n <div class="select-search">\n\n <div class="select-search-input">\n\n <input type="text" name="select-search" value="" placeholder="${this.searchPlaceholder}" tabindex="-1">\n\n </div>\n\n <div class="select-search-icon">\n\n <i class="${t} fa-search icon"></i>\n\n </div>\n\n </div>\n\n `}return""}_renderFooter(){return this.showFooter?`\n\n <div class="select-footer">\n\n <button class="btn btn-block btn-light btn-sm" type="button" tabindex="-1" data-select-close >\n ${this.btnCloseText}\n </button>\n\n </div>\n\n `:""}isSearchApiEnabled(){return this.searchApi&&this.searchApi.length}_showSpinner(){let t=this.opts.faPro?"fal":"fas";this.searchIconContainerEl.innerHTML=`<i class="${t} fa-spinner-third fa-spin icon"></i>`}_hideSpinner(){let t=this.opts.faPro?"fal":"fas";this.searchIconContainerEl.innerHTML=`<i class="${t} fa-search icon"></i>`}selectItem(t){const e=this.selectEl.querySelector(`input[value="${t}"]`);if(e){if("radio"===this.type)if(this.selectEl.querySelectorAll('input[type="radio"]').forEach(t=>{t.checked=!1,t.classList.remove("checked")}),this.useChips){const i=e.parentElement.querySelector("[data-label]");this.data[this.name]=[{[this.primaryKeyword]:t,label:i?i.textContent:t}]}else this.data[this.name]=[t];else if(this.useChips){if(!this.data[this.name].find(e=>e[this.primaryKeyword].toString()===t.toString())){const i=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:t,label:i?i.textContent:t})}}else-1===this.data[this.name].indexOf(t)&&this.data[this.name].push(t);return e.checked=!0,e.classList.add("checked"),e.dispatchEvent(new Event("change",{bubbles:!0})),!0}return!1}clear(){const t=Array.from(this.selectEl.querySelectorAll("input:checked"));this.selectEl.querySelectorAll("input").forEach(t=>{t.checked=!1,t.classList.remove("checked")}),this.data[this.name]=[],this.useChips?this._renderChips():this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitleDefault||this.cachedTitle),this.showValidStateIcon&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),t.forEach(t=>{const e=t.closest(".select-item"),i=e&&g.get(e)||{};"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,!1)})}}E._jQueryInit();let w=null;try{w=require("perfect-scrollbar"),w&&w.default&&(w=w.default)}catch(t){}"undefined"!=typeof window&&w&&!window.PerfectScrollbar&&(window.PerfectScrollbar=w);class v extends i{static NAME="coolDropdown";static DEFAULTS={animation:!0,animationIn:"zoomIn",animationOut:"zoomOut",animationSpeed:"fastest",offset:null,minWidth:null,closeOnItemClick:!0,positionObserver:!0,content:!1,scroll:!0,scrollContentHeight:100,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onItemClick:null,position:"absolute",placement:"bottom",align:"start"};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${v.NAME}`);i||(i=new v(this,"object"==typeof t&&t),e.data(`plugin_${v.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[v.NAME];$.fn[v.NAME]=v._jQueryInterface,$.fn[v.NAME].Constructor=v,$.fn[v.NAME].defaults=v.DEFAULTS||{},$.fn[v.NAME].noConflict=()=>($.fn[v.NAME]=t,v._jQueryInterface)}constructor(t,e){super(),this.opts=d({},v.DEFAULTS,window.Cool?.settings?.dropdown||{},e||{}),this.el=t,this._resizeCallback=null,this._scrollCallback=null,this.init()}setupResizeHandling(){if(window.ResizeObserver)this._resizeCallback=()=>{this.contentOpen&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition(),this.onUpdate()}))},s.observe(this.el,this._resizeCallback),s.observe(document.body,this._resizeCallback),this.containerEl&&s.observe(this.containerEl,this._resizeCallback);else{let t;this.resizeHandler=()=>{if(!this.contentOpen)return;clearTimeout(t);const e=performance.now();!this.lastResizeTime||e-this.lastResizeTime>100?(this.setPosition(),this.onUpdate(),this.lastResizeTime=e):t=setTimeout(()=>{this.setPosition(),this.onUpdate()},16)},window.addEventListener("resize",this.resizeHandler,{passive:!0})}}setupScrollHandling(){if("fixed"===this.position){this._scrollCallback=()=>{this.contentOpen&&this.dropdownEl.classList.contains("show")&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition(),this.onUpdate()}))},n.add(`dropdown-${this.id}`,this._scrollCallback);let t=this.el.parentElement;for(this.scrollableParents=[];t&&t!==document.body;){const e=getComputedStyle(t).overflowY;if("scroll"===e||"auto"===e){const e=()=>this._scrollCallback();t.addEventListener("scroll",e,{passive:!0}),this.scrollableParents.push({element:t,handler:e})}t=t.parentElement}}}setupVisibilityDetection(){window.IntersectionObserver&&(this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(t=>{!t.isIntersecting&&this.contentOpen&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition()}))})},{threshold:.1,rootMargin:"50px"}),this.intersectionObserver.observe(this.el))}init(){this.buildCache().then(()=>{this.buildScroll(),this.setupVisibilityDetection(),this.bindEvents(),this.onInit()}).catch(()=>{})}destroy(){this.unbindEvents(),this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.dropdownEl&&this.dropdownEl.remove(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){const t=this.scrollableContentEl&&this.scrollableContentEl.classList.contains("ps-dark");this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.unbindEvents(),this.buildCache().then(()=>{t&&this.scrollableContentEl&&this.scrollableContentEl.classList.add("ps-dark"),this.buildScroll(),this.setupVisibilityDetection(),this.bindEvents(),this.onUpdate()}).catch(()=>{})}buildCache(){return new Promise((t,e)=>{this.el.classList.add("dropdown-trigger"),this.containerEl=this.el.closest(".dropdown")||this.el.parentElement,this.id="dropdown-"+a(),this.animation=this.el.dataset.animation||this.opts.animation,this.animationIn=this.el.dataset.animationIn||this.el.dataset.animationin||this.opts.animationIn,this.animationOut=this.el.dataset.animationOut||this.el.dataset.animationout||this.opts.animationOut,this.animationSpeed=this.el.dataset.animationSpeed||this.el.dataset.animationspeed||this.opts.animationSpeed,this.position=this.el.dataset.position||this.opts.position,this.placement=this.el.dataset.placement||this.opts.placement,this.align=this.el.dataset.align||this.opts.align,this.offset=this.el.dataset.offset||this.opts.offset,this.minWidth=this.el.dataset.minWidth||this.el.dataset.minwidth||this.opts.minWidth,this.scroll=this.el.dataset.scroll||this.opts.scroll,this.scrollContentHeight=this.el.dataset.scrollContentHeight||this.opts.scrollContentHeight,this.positionObserver=this.el.hasAttribute("data-position-observer")?JSON.parse(this.el.getAttribute("data-position-observer")):this.opts.positionObserver,this.closeOnItemClick=this.el.dataset.closeOnItemClick||this.el.dataset.closeonitemclick||this.opts.closeOnItemClick,this.preventClose=this.el.dataset.preventClose||this.el.dataset.preventclose||!1,this.content=this.el.dataset.content||this.opts.content,this.contentOpen=!1,this.containerEl.classList.contains("dropup")?this.placement="top":this.containerEl.classList.contains("dropright")?this.placement="right":this.containerEl.classList.contains("dropbottom")?this.placement="bottom":this.containerEl.classList.contains("dropleft")&&(this.placement="left");const i=this.containerEl.querySelector(".dropdown-menu");if("fixed"===this.position&&i){this.dropdownEl=i.cloneNode(!0),this.dropdownEl.id=this.id,this.dropdownEl.classList.remove("show"),this.align=i.classList.contains("dropdown-menu-right")?"end":this.align,document.body.appendChild(this.dropdownEl),i.remove();return this.dropdownEl.querySelectorAll(".dropdown").forEach(t=>{const e=t.querySelector('[data-toggle="dropdown"]'),i=t.querySelector(".dropdown-menu");e&&i&&!v.getInstance(e)&&new v(e,{position:"absolute",closeOnItemClick:!1,positionObserver:!0,onShow:()=>{const t=parseInt(getComputedStyle(this.dropdownEl).zIndex||9999,10);i.style.zIndex=t+1}})}),this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content"),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()}if("function"==typeof this.content){let e="end"===this.opts.align?" dropdown-menu-right":"";const i=document.createElement("div");return i.innerHTML=`<div class="dropdown-menu${e}" id="${this.id}">${this.content()}</div>`,this.dropdownEl=i.firstElementChild,"fixed"===this.position?document.body.appendChild(this.dropdownEl):this.el.insertAdjacentElement("afterend",this.dropdownEl),this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content")||null,this.align=this.dropdownEl.classList.contains("dropdown-menu-right")?"end":this.align,this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()}return this.dropdownEl=this.containerEl.querySelector(".dropdown-menu")||null,this.dropdownEl?(this.align=this.dropdownEl.classList.contains("dropdown-menu-right")?"end":this.align,this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content")||null,this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()):e()})}buildScroll(){this.opts.scroll&&this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=this.scrollContentHeight+"px",l()?this.scrollableContentEl.style.overflowY="auto":w?this.scroll=new w(this.scrollableContentEl,{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,suppressScrollX:!0,scrollYMarginOffset:2}):this.scrollableContentEl.style.overflowY="auto")}bindEvents(){this._triggerClickHandler=()=>{this.contentOpen?this.close():this.show()},this.el.addEventListener("click",this._triggerClickHandler),"fixed"===this.position?(this._dropdownItemHandler=t=>{const e=t.target.closest("a, button, .dropdown-item");e&&e.closest(".dropdown-menu")===this.dropdownEl&&(e.classList.contains("dropdown-trigger")||e.dataset.toggle||(this.closeOnItemClick&&this.close(),this.onItemClick(e,t)))},this.dropdownEl.addEventListener("click",this._dropdownItemHandler)):(this._itemHandlers=[],this.dropdownItems.forEach(t=>{const e=e=>{t.classList.contains("dropdown-trigger")||t.dataset.toggle||(this.closeOnItemClick&&this.close(),this.onItemClick(t,e))};t.addEventListener("click",e),this._itemHandlers.push({el:t,handler:e})})),this._documentClickHandler=t=>{if(!this.contentOpen)return;const e=this.el===t.target||this.el.contains(t.target)||this.dropdownEl===t.target||this.dropdownEl.contains(t.target),i=this.dropdownEl.contains(t.target)&&t.target.closest('[data-toggle="dropdown"]');e||i||this.close()},document.addEventListener("click",this._documentClickHandler,{passive:!0}),document.addEventListener("touchstart",this._documentClickHandler,{passive:!0}),this.setupResizeHandling(),this.setupScrollHandling()}unbindEvents(){this._triggerClickHandler&&(this.el.removeEventListener("click",this._triggerClickHandler),this._triggerClickHandler=null),this._dropdownItemHandler&&this.dropdownEl&&(this.dropdownEl.removeEventListener("click",this._dropdownItemHandler),this._dropdownItemHandler=null),this._itemHandlers&&(this._itemHandlers.forEach(({el:t,handler:e})=>{t.removeEventListener("click",e)}),this._itemHandlers=null),this._resizeCallback&&(s.unobserve(this.el),s.unobserve(document.body),this.containerEl&&s.unobserve(this.containerEl),this._resizeCallback=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._scrollCallback&&(n.remove(`dropdown-${this.id}`),this._scrollCallback=null),this.scrollableParents&&(this.scrollableParents.forEach(({element:t,handler:e})=>{t.removeEventListener("scroll",e)}),this.scrollableParents=[]),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this._documentClickHandler&&(document.removeEventListener("click",this._documentClickHandler),document.removeEventListener("touchstart",this._documentClickHandler),this._documentClickHandler=null)}setPosition(t){"undefined"!=typeof t&&null!==t||(t=this.placement);const e=this.el.getBoundingClientRect(),i=window.innerWidth,s=window.innerHeight,n=!this.dropdownEl.classList.contains("show")&&0===this.dropdownEl.offsetWidth;n&&(this.dropdownEl.style.display="block",this.dropdownEl.style.visibility="hidden");let o,l,a=this.dropdownEl.offsetWidth,r=this.dropdownEl.offsetHeight,h=this.el.offsetWidth,c=this.el.offsetHeight;if("fixed"===this.position)o=e.left+window.scrollX,l=e.top+window.scrollY;else{const t=this.dropdownEl.offsetParent||document.body,i=t.getBoundingClientRect();o=e.left-i.left+t.scrollLeft,l=e.top-i.top+t.scrollTop}let d=0,u=0,p=0,m=0;if(this.offset){const t=this.offset.split(",");p=parseInt(t[0],10)||0,m=parseInt(t[1],10)||0}const f=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cool-dropdown-spacer"))||2,b=(t,e=this.align)=>{let i=0,s=0;switch(t){case"top":i="end"===e?o+h-a:o,s=l-r-f;break;case"bottom":i="end"===e?o+h-a:o,s=l+c+f;break;case"left":i=o-a-f,s=l;break;case"right":i=o+h+f,s=l}return{x:i+p,y:s+m}};let g=t,y=this.align,E=b(t);if(this.positionObserver){const n=5,h=t=>{const h={top:!1,bottom:!1,left:!1,right:!1};if("fixed"===this.position)h.top=t.y<n,h.bottom=t.y+r>s-n,h.left=t.x<n,h.right=t.x+a>i-n;else{const c=e.left+(t.x-o),d=e.top+(t.y-l),u=c+a,p=d+r;h.top=d<n,h.bottom=p>s-n,h.left=c<n,h.right=u>i-n}return h},c=h(E);"bottom"===t&&c.bottom&&!c.top?(g="top",E=b("top",y)):"top"===t&&c.top&&!c.bottom?(g="bottom",E=b("bottom",y)):"right"===t&&c.right&&!c.left?(g="left",E=b("left",y)):"left"===t&&c.left&&!c.right&&(g="right",E=b("right",y));const d=h(E);if("top"!==g&&"bottom"!==g||("end"===y&&d.left&&!d.right?(y="start",E=b(g,y)):"start"===y&&d.right&&!d.left&&(y="end",E=b(g,y))),this.containerEl.classList.remove("dropup","dropbottom","dropleft","dropright"),"top"===g?this.containerEl.classList.add("dropup"):"left"===g?this.containerEl.classList.add("dropleft"):"right"===g?this.containerEl.classList.add("dropright"):this.containerEl.classList.add("dropbottom"),this.dropdownEl.setAttribute("x-placement",g+"-"+y),"fixed"===this.position)E.x=Math.max(n,Math.min(E.x,i-a-n)),E.y=Math.max(n,Math.min(E.y,s-r-n));else{const t=e.left+(E.x-o),h=e.top+(E.y-l);t<n?E.x+=n-t:t+a>i-n&&(E.x-=t+a-i+n),h<n?E.y+=n-h:h+r>s-n&&(E.y-=h+r-s+n)}}if(d=E.x,u=E.y,n&&(this.dropdownEl.style.display="",this.dropdownEl.style.visibility=""),"fixed"===this.position)Object.assign(this.dropdownEl.style,{position:"fixed",top:Math.round(u)+"px",left:Math.round(d)+"px",right:"auto",bottom:"auto",transform:"none",willChange:"auto",zIndex:"9999"});else{const t=this.el.closest(".dropdown, .dropup, .dropleft, .dropright");if(t){const i=t.getBoundingClientRect();let s=e.left-i.left,n=e.top-i.top;switch(g){case"bottom":n+=c+f,"end"===y&&(s=s+h-a);break;case"top":n-=r+f,"end"===y&&(s=s+h-a);break;case"left":s-=a+f;break;case"right":s+=h+f}s+=p,n+=m,Object.assign(this.dropdownEl.style,{position:"absolute",top:Math.round(n)+"px",left:Math.round(s)+"px",right:"auto",bottom:"auto",transform:"none",willChange:"auto"})}}}show(){if(this.dropdownEl&&!this.dropdownEl.classList.contains("show")){if(this.setPosition(),this.animation?(this.dropdownEl.setAttribute("x-placement",this.placement+"-"+this.align),this.dropdownEl.classList.add(this.animationSpeed),r(this.dropdownEl,this.animationIn),this.dropdownEl.classList.add("show"),this.dropdownEl.id=this.id,this.el.setAttribute("data-dropdown",this.id)):(this.dropdownEl.setAttribute("x-placement",this.placement+"-"+this.align),this.dropdownEl.classList.add("show"),this.dropdownEl.id=this.id,this.el.setAttribute("data-dropdown",this.id)),this.opts.scroll&&this.scroll&&this.scrollableContentEl)if(this.scrollableContentEl.offsetHeight,this.animation){const t=getComputedStyle(this.dropdownEl).animationDuration,e=t?1e3*parseFloat(t):300;setTimeout(()=>{this.scroll&&"function"==typeof this.scroll.update&&this.scroll.update()},e)}else requestAnimationFrame(()=>{this.scroll&&"function"==typeof this.scroll.update&&this.scroll.update()});this.contentOpen=!0,this.onShow()}}close(){this.dropdownEl&&!this.preventClose&&(this.animation&&!this.dropdownEl.classList.contains("animation")?r(this.dropdownEl,this.animationOut).then(()=>{this.dropdownEl.classList.remove("show"),this.el.removeAttribute("data-dropdown")}):(this.dropdownEl.classList.remove("show"),this.el.removeAttribute("data-dropdown")),this.contentOpen=!1,this.onClose())}onItemClick(t,e){let i=this.opts.onItemClick;"function"==typeof i&&i.call(t,e,this)}}v._jQueryInit();class C extends i{static NAME="coolTooltip";static DEFAULTS={container:"body",animation:!1,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",placement:"bottom",content:"",trigger:"auto",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${C.NAME}`);i||(i=new C(this,"object"==typeof t&&t),e.data(`plugin_${C.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[C.NAME];$.fn[C.NAME]=C._jQueryInterface,$.fn[C.NAME].Constructor=C,$.fn[C.NAME].defaults=C.DEFAULTS||{},$.fn[C.NAME].noConflict=()=>($.fn[C.NAME]=t,C._jQueryInterface)}constructor(t,e){super(),this.opts=d({},C.DEFAULTS,window.Cool?.settings?.tooltip||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.tooltipEl&&(this.tooltipEl.remove(),this.tooltipEl=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.tooltipEl&&this.setPosition(),this.onUpdate()}buildCache(){this.containerEl=this.el.dataset.container?document.querySelector(this.el.dataset.container):document.querySelector(this.opts.container),this.id="tooltip-"+a(),this.animation=void 0!==this.el.dataset.animation?this.el.dataset.animation:this.opts.animation,this.animationIn=this.el.dataset.animationIn||this.el.dataset.animationin||this.opts.animationIn,this.animationOut=this.el.dataset.animationOut||this.el.dataset.animationout||this.opts.animationOut,this.animationSpeed=this.el.dataset.animationSpeed||this.el.dataset.animationspeed||this.opts.animationSpeed,this.placement=this.el.dataset.placement||this.opts.placement,this.placementChanged=!1,this.content=this.el.dataset.content||this.opts.content,this.trigger=this.el.dataset.trigger||this.opts.trigger}bindEvents(){"auto"===this.trigger&&(this._mouseenterHandler=()=>this.show(),this._mouseleaveHandler=()=>this.close(),this._blurHandler=()=>this.close(),this._clickHandler=()=>this.close(),this.el.addEventListener("mouseenter",this._mouseenterHandler),this.el.addEventListener("mouseleave",this._mouseleaveHandler),this.el.addEventListener("blur",this._blurHandler),this.el.addEventListener("click",this._clickHandler)),window.ResizeObserver&&(this._resizeCallback=()=>{this.tooltipEl&&this.tooltipEl.classList.contains("show")&&requestAnimationFrame(()=>{this.setPosition()})},s.observe(this.el,this._resizeCallback))}unbindEvents(){this._mouseenterHandler&&(this.el.removeEventListener("mouseenter",this._mouseenterHandler),this.el.removeEventListener("mouseleave",this._mouseleaveHandler),this.el.removeEventListener("blur",this._blurHandler),this.el.removeEventListener("click",this._clickHandler)),this._resizeCallback&&(s.unobserve(this.el),this._resizeCallback=null)}buildTooltip(){this.tooltipEl=document.createElement("div"),this.tooltipEl.className="tooltip",this.tooltipEl.setAttribute("role","tooltip"),this.tooltipEl.id=this.id,this.tooltipEl.innerHTML=`\n <div class="arrow"></div>\n <div class="tooltip-inner">${this.content}</div>\n `,this.containerEl.appendChild(this.tooltipEl),this.arrowEl=this.tooltipEl.querySelector(".arrow")}setPosition(t){"undefined"!=typeof t&&null!==t||(t=this.placement),this.tooltipEl.classList.add("tooltip-"+t);const e=this.containerEl.clientWidth,i=this.containerEl.clientHeight,s=this.tooltipEl.offsetWidth,n=this.tooltipEl.offsetHeight,o=this.el.getBoundingClientRect(),l=this.el.offsetWidth,a=this.el.offsetHeight,r=o.left+window.scrollX,h=o.top+window.scrollY,c=this.arrowEl.offsetWidth,d=this.arrowEl.offsetHeight;let u,p,m;"top"===t?(p=Math.round(r-(s-l)/2),m=Math.round(h-n),u=Math.round(s/2-c/2),this.arrowEl.style.left=u+"px"):"right"===t?(p=Math.round(r+l),m=Math.round(h-(n-a)/2),u=Math.round(n/2-d/2),this.arrowEl.style.top=u+"px"):"bottom"===t?(p=Math.round(r-(s-l)/2),m=Math.round(h+a),u=Math.round(s/2-c/2),this.arrowEl.style.left=u+"px"):"left"===t&&(p=Math.round(r-s),m=Math.round(h-(n-a)/2),u=Math.round(n/2-d/2),this.arrowEl.style.top=u+"px"),Object.assign(this.tooltipEl.style,{position:"absolute",top:"0px",left:"0px",transform:`translate3d(${p}px, ${m}px, 0px)`,willChange:"transform"});let f=0;const b={left:this.tooltipEl.offsetLeft,top:this.tooltipEl.offsetTop,right:e-(this.tooltipEl.offsetLeft+s),bottom:i-(this.tooltipEl.offsetTop+n)};let g={left:!1,top:!1,right:!1,bottom:!1};if(b.right<0&&(g.right=!0,f++),b.left<0&&(g.left=!0,f++),b.bottom<0&&(g.bottom=!0,f++),b.top<0&&(g.top=!0,f++),f>0&&(!this.placementChanged&&g.left&&b.right>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("right")):!this.placementChanged&&g.top&&b.top>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")):!this.placementChanged&&g.right&&b.left>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("left")):!this.placementChanged&&g.bottom&&b.top>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!g.left&&!g.right?this.fixTooltipPosition=!0:b.top>b.bottom?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")),this.fixTooltipPosition)){if(g.left){let e=Math.abs(b.left);r>=p+e&&["top","bottom"].indexOf(t)<0?p+=e:(p+=e,u-=e)}if(g.top){let t=Math.abs(b.top);m+=t,u-=t}if(g.right){let e=Math.abs(b.right);r<=p-e&&["top","bottom"].indexOf(t)<0||(p-=e,u+=e)}if(g.bottom){let t=Math.abs(b.bottom);m-=t,u+=t}"top"===t||"bottom"===t?this.arrowEl.style.left=u+"px":this.arrowEl.style.top=u+"px",Object.assign(this.tooltipEl.style,{width:s+"px",transform:`translate3d(${p}px, ${m}px, 0px)`}),this.fixTooltipPosition=!1}}show(){this.tooltipEl||(this.buildTooltip(),this.setPosition(),this.animation?(this.tooltipEl.classList.add(this.animationSpeed),r(this.tooltipEl,this.animationIn),this.tooltipEl.classList.add("show"),this.tooltipEl.id=this.id,this.el.setAttribute("data-tooltip",this.id)):(this.tooltipEl.classList.add("show"),this.tooltipEl.id=this.id,this.el.setAttribute("data-tooltip",this.id)),this.onShow())}close(){this.tooltipEl&&(this.animation&&!this.tooltipEl.classList.contains("animation")?r(this.tooltipEl,this.animationOut).then(()=>{this.tooltipEl&&(this.tooltipEl.remove(),this.el.removeAttribute("data-tooltip"),this.tooltipEl=null,this.placementChanged=!1),this.onClose()}):(this.tooltipEl.remove(),this.el.removeAttribute("data-tooltip"),this.tooltipEl=null,this.placementChanged=!1,this.onClose()))}}C._jQueryInit();class _ extends i{static NAME="coolCollapse";static DEFAULTS={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${_.NAME}`);i||(i=new _(this,"object"==typeof t&&t),e.data(`plugin_${_.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[_.NAME];$.fn[_.NAME]=_._jQueryInterface,$.fn[_.NAME].Constructor=_,$.fn[_.NAME].defaults=_.DEFAULTS||{},$.fn[_.NAME].noConflict=()=>($.fn[_.NAME]=t,_._jQueryInterface)}constructor(t,e){super(),this.opts=d({},_.DEFAULTS,window.Cool?.settings?.collapse||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){const t=this.el.dataset.target||this.opts.target;if(this.target=t?document.querySelector(t):this.el.parentElement?.querySelector(".collapse"),this.breakpoint=this.el.dataset.breakpoint,this.expanded="true"===this.el.getAttribute("aria-expanded"),this.target){this.container=this.target.closest(".section-collapse");const t=this.el.dataset.target?`[data-collapse-indicator="${this.el.dataset.target}"]`:null;this.indicator=t?document.querySelector(t):this.el.parentElement?.querySelector("[data-collapse-indicator]")}}bindEvents(){this._clickHandler=t=>{this.breakpoint&&window.matchMedia(`(min-width: ${this.breakpoint}px)`).matches||(t.preventDefault(),this.toggle())},this.el.addEventListener("click",this._clickHandler)}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler)}toggle(){this.expanded?this.close():this.show()}show(){this.expanded||(this.target.classList.add("show"),this.container&&this.container.classList.add("show"),this.indicator&&this.indicator.classList.add("show"),this.el.setAttribute("aria-expanded","true"),this.expanded=!0,this.onShow())}close(){this.expanded&&(this.target.classList.remove("show"),this.container&&this.container.classList.remove("show"),this.indicator&&this.indicator.classList.remove("show"),this.el.setAttribute("aria-expanded","false"),this.expanded=!1,this.onClose())}}_._jQueryInit();class S extends i{static NAME="coolSectionTabs";static DEFAULTS={onInit:null,onUpdate:null,onDestroy:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${S.NAME}`);i||(i=new S(this,"object"==typeof t&&t),e.data(`plugin_${S.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[S.NAME];$.fn[S.NAME]=S._jQueryInterface,$.fn[S.NAME].Constructor=S,$.fn[S.NAME].defaults=S.DEFAULTS||{},$.fn[S.NAME].noConflict=()=>($.fn[S.NAME]=t,S._jQueryInterface)}constructor(t,e){super(),this.opts=d({},S.DEFAULTS,window.Cool?.settings?.sectionTabs||{},e||{}),this.el=t,this._tabsCache=new WeakMap,this._resizeObserver=null,this._isProcessing=!1,this._rafId=null,this.init()}init(){this.buildCache(),this.bindEvents(),this._rafId=requestAnimationFrame(()=>{this.dropdownContainer&&this.dropdownContainer.classList.add("js-ready"),this.el.classList.add("js-initialized"),this.checkForChanges(),this.onInit()})}destroy(){this.unbindEvents(),this._rafId&&cancelAnimationFrame(this._rafId),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){const t=this.el.closest(".section-tabs");this.dropdownContainer=t?t.querySelector(".dropdown-container"):this.el.querySelector(".dropdown-container"),this.dropdownList=t?t.querySelector(".dropdown-list"):this.el.querySelector(".dropdown-list")}bindEvents(){const t=this.el.closest(".section-tabs"),e=(t?t.closest(".section-header"):null)||t||this.el;window.ResizeObserver?(this._resizeObserver=new ResizeObserver(t=>{this._isProcessing||(this._isProcessing=!0,this._rafId&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this.checkForChanges(),this._isProcessing=!1}))}),this._resizeObserver.observe(e)):(this._resizeHandler=o(()=>{this.checkForChanges()},50),window.addEventListener("resize",this._resizeHandler,{passive:!0}))}unbindEvents(){this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler)}moveToList(t){const e=t.getAttribute("data-uuid"),i=this.el.querySelector(`:scope > .tab-item[data-related-dropdown-item="${e}"]`);i&&(i.removeAttribute("data-related-dropdown-item"),t.remove())}moveToDropdown(t){if(t.hasAttribute("data-related-dropdown-item"))return;if(!this.dropdownList)return;const e=crypto.randomUUID(),i=t.cloneNode(!0),s=i.querySelector(".tab-item-action");s&&s.classList.add("dropdown-item"),i.setAttribute("data-uuid",e),this.dropdownList.appendChild(i),t.setAttribute("data-related-dropdown-item",e)}getTabDimensions(t){if(this._tabsCache.has(t)){return this._tabsCache.get(t)}const e=t.classList.contains("invisible");e&&t.classList.remove("invisible");const i=this.el.closest(".section-tabs")||this.el,s=i.style.overflow;i.style.overflow="visible",i.offsetHeight;const n=t.offsetWidth,o=n+(parseInt(getComputedStyle(t).marginLeft,10)||0)+(parseInt(getComputedStyle(t).marginRight,10)||0);i.style.overflow=s,e&&t.classList.add("invisible");const l={width:n,totalWidth:o};return this._tabsCache.set(t,l),l}availableSpace(){const t=this.el.closest(".section-tabs"),e=t?t.closest(".section-header"):null;let i,s,n;if(e){const o=getComputedStyle(e);if("column"===o.flexDirection){const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0}else{i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0;const t=e.querySelector(".section-search");if(t){i-=t.offsetWidth;i-=parseInt(o.gap,10)||0}}}else{const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0}return i-s-n-(this.dropdownContainer?this.dropdownContainer.classList.contains("visible")?this.dropdownContainer.offsetWidth:40:0)}checkForChanges(){if(!this.dropdownList)return;this._tabsCache=new WeakMap;const t=Array.from(this.el.querySelectorAll(":scope > .tab-item")),e=Array.from(this.dropdownList.children),i=this.availableSpace(),s=parseInt(getComputedStyle(this.el).gap,10)||0;if(window.innerWidth<768&&i<200)return t.forEach(t=>{t.classList.remove("invisible"),t.removeAttribute("data-related-dropdown-item")}),void(this.dropdownContainer&&this.dropdownContainer.classList.remove("visible"));let n=0,o=[],l=[];for(let e=0;e<t.length;e++){const a=t[e],{totalWidth:r}=this.getTabDimensions(a),h=n+r+(e>0?s:0);if(h<=i){n=h,o.push(a);const t=a.getAttribute("data-related-dropdown-item");if(t){const e=this.dropdownList.querySelector(`[data-uuid="${t}"]`);e&&this.moveToList(e)}}else l.push(a)}if(l.forEach((t,e)=>{t.hasAttribute("data-related-dropdown-item")||this.moveToDropdown(t)}),e.length>0&&0===l.length){const t=i-n;for(let i=e.length-1;i>=0;i--){const l=e[i],a=l.getAttribute("data-uuid"),r=this.el.querySelector(`[data-related-dropdown-item="${a}"]`);if(r){const{totalWidth:e}=this.getTabDimensions(r),i=e+(n>0?s:0);if(!(i<=t))break;this.moveToList(l),o.push(r),n+=i}}}t.forEach(t=>{o.includes(t)?t.classList.remove("invisible"):t.classList.add("invisible")});const a=this.dropdownList&&this.dropdownList.children.length>0;this.dropdownContainer&&this.dropdownContainer.classList.toggle("visible",a)}}S._jQueryInit();class L extends i{static NAME="coolToast";static DEFAULTS={title:"",content:"",icon:"",action:null,template:"",placement:"top-right",animation:!0,animationIn:null,animationOut:null,animationSpeed:"faster",offsetX:null,offsetY:null,dismiss:3,header:!1,maxVisible:3,onInitialize:null,onDestroy:null,onInit:null,onShow:null,onClose:null,onClick:null};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${L.NAME}`);i||(i=new L(this,"object"==typeof t&&t),e.data(`plugin_${L.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[L.NAME];$.fn[L.NAME]=L._jQueryInterface,$.fn[L.NAME].Constructor=L,$.fn[L.NAME].defaults=L.DEFAULTS||{},$.fn[L.NAME].noConflict=()=>($.fn[L.NAME]=t,L._jQueryInterface)}constructor(t,e){super(),this.settings=d({},L.DEFAULTS,window.Cool?.settings?.toast||{},e||{}),this.container="string"==typeof t?document.querySelector(t):t,t&&t.jquery&&(this.container=t[0]),this.containers=new Map,this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}_getContainer(t,e,i,s){if(this.containers.has(t))return this.containers.get(t);const n=document.createElement("div");n.className="toast-container",n.setAttribute("data-placement",t),null!=e&&n.style.setProperty("--_toast-offset-x","number"==typeof e?`${e}px`:e),null!=i&&n.style.setProperty("--_toast-offset-y","number"==typeof i?`${i}px`:i),null!=s&&n.style.setProperty("--_toast-max-visible",String(s)),this.container.appendChild(n),n.addEventListener("mouseenter",()=>{this._pauseTimers(o)}),n.addEventListener("mouseleave",()=>{this._resumeTimers(o)});const o={el:n,toasts:[],queue:[]};return this.containers.set(t,o),o}_cleanupContainer(t){const e=this.containers.get(t);e&&0===e.toasts.length&&0===e.queue.length&&(e.el.remove(),this.containers.delete(t))}_updateStack(t){const e=t.toasts,i=parseInt(t.el.style.getPropertyValue("--_toast-max-visible")||this.settings.maxVisible,10);for(let t=0;t<e.length;t++){const s=e[t],n=e.length-1-t;s.el.style.setProperty("--_toast-index",String(n));const o=s.el.offsetHeight;s.el.style.setProperty("--_toast-collapse-height",`${o}px`),n>=i?s.el.setAttribute("data-toast-hidden","true"):s.el.removeAttribute("data-toast-hidden")}}_pauseTimers(t){const e=Date.now();for(const i of t.toasts)i._dismissTimer&&(clearTimeout(i._dismissTimer),i._dismissTimer=null,i._dismissRemaining=Math.max(0,(i._dismissEnd||e)-e))}_resumeTimers(t){for(const e of t.toasts)null!=e._dismissRemaining&&e._dismissRemaining>0&&this._startDismissTimer(e,e._dismissRemaining),e._dismissRemaining=null}_startDismissTimer(t,e){t._dismissEnd=Date.now()+e,t._dismissTimer=setTimeout(()=>{t._dismissTimer=null,t._dismissRemaining=null,this.close(t)},e)}init(t){const e=d({},this.settings,t||{}),i=this._buildToast(e),s=this._getContainer(i.placement,e.offsetX,e.offsetY,e.maxVisible);return s.toasts.push(i),i._containerEntry=s,this._showToast(i,s),this.onInit(i),i}destroy(){for(const[,t]of this.containers){const e=[...t.toasts];for(const i of e)this._removeToast(i,t,!1);t.queue.length=0}for(const[,t]of this.containers)t.el.remove();this.containers.clear(),this.onDestroy()}_buildToast(t){let e=t.animationIn,i=t.animationOut;if(!e||!i){const s=t.placement.startsWith("top-");e||(e=s?"slideInDown":"slideInUp"),i||(i=s?"slideOutUp":"slideOutDown")}const s={uuid:"toast-"+a(),placement:t.placement,animation:t.animation,animationIn:e,animationOut:i,animationSpeed:t.animationSpeed,dismiss:t.dismiss,title:t.title,content:t.content,icon:t.icon,action:t.action,template:t.template,maxBodyHeight:t.maxBodyHeight,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose,onClick:t.onClick,_dismissTimer:null,_dismissEnd:null,_dismissRemaining:null,_containerEntry:null};let n;n="function"==typeof s.template?s.template(s):this._renderTemplate(s);const o=document.createElement("div");return o.innerHTML=n.trim(),s.el=o.firstElementChild,s.innerEl=s.el.querySelector(".toast-inner"),s.closeBtn=s.el.querySelector("[data-toast-close]"),s}_showToast(t,e){e.el.appendChild(t.el),t._closeHandler=e=>{if(e.target.closest("[data-toast-close]"))return e.preventDefault(),e.stopPropagation(),void this.close(t);if("function"==typeof t.onClick&&t.onClick.call(t,e),t.action){const e="object"==typeof t.action?t.action.uri:t.action;e&&(window.location.href=e)}this.close(t)},t.el.addEventListener("click",t._closeHandler),this._updateStack(e),t.el.offsetHeight,t.el.classList.add("show"),requestAnimationFrame(()=>{t.animation&&(t.innerEl.classList.add(t.animationSpeed),r(t.innerEl,t.animationIn))}),t.dismiss&&this._startDismissTimer(t,1e3*t.dismiss),this.onShow(t)}close(t){const e=t._containerEntry;e&&(t._dismissTimer&&(clearTimeout(t._dismissTimer),t._dismissTimer=null),t.animation&&t.innerEl&&!t.innerEl.classList.contains("animation")?r(t.innerEl,t.animationOut).then(()=>{this._removeToast(t,e,!0)}):this._removeToast(t,e,!0))}_removeToast(t,e,i){if(t.el&&t.el.parentNode&&t.el.remove(),t._closeHandler&&(t.el.removeEventListener("click",t._closeHandler),t._closeHandler=null),e.toasts=e.toasts.filter(e=>e.uuid!==t.uuid),this._updateStack(e),i&&e.queue.length>0){const t=parseInt(e.el.style.getPropertyValue("--_toast-max-visible")||this.settings.maxVisible,10);if(e.toasts.length<t){const t=e.queue.shift();e.toasts.push(t),t._containerEntry=e,this._showToast(t,e)}}this._cleanupContainer(t.placement),this.onClose(t)}onInitialize(){const t=this.onInitialize;"function"==typeof t&&t.call(this.container)}onDestroy(){const t=this.onDestroy;"function"==typeof t&&t.call(this.container)}onInit(t){const e=t.onInit;"function"==typeof e&&e.call(t)}onShow(t){const e=t.onShow;"function"==typeof e&&e.call(t)}onClose(t){const e=t.onClose;"function"==typeof e&&e.call(t)}_renderTemplate(t){let e="",i="",s="",n="",o="";e="function"==typeof t.content?t.content():t.content,t.icon&&(o="string"==typeof t.icon&&t.icon.trimStart().startsWith("<")?`<div class="toast-icon">${t.icon}</div>`:`<div class="toast-icon"><img src="${t.icon}" alt=""></div>`),o||t.title?i=`\n <div class="toast-header">\n ${o}\n\n <span class="mr-auto">${t.title}</span>\n\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n\n </div>\n `:n='\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ',s=`\n <div class="toast-body"><div>${e}</div>${n}</div>\n `;const l=t.action?' role="button" style="cursor: pointer;"':"";return`\n <div class="toast${t.action?" toast-actionable":""}" role="alert" id="${t.uuid}"${l}>\n\n <div class="toast-inner">\n\n ${i}\n ${s}\n\n </div>\n\n </div>\n `}}L._jQueryInit();class I extends i{static NAME="coolDialog";static DEFAULTS={title:"",template:"",body:"",footer:!0,header:!0,size:"",classes:"",centered:!0,backdrop:!0,preventScroll:!0,closeBtn:!0,animation:!0,animationIn:"zoomIn",animationOut:"fadeOut",animationSpeed:"fastest",maxBodyHeight:null,overflowVisible:!1,onInitialize:null,onDestroy:null,onInit:null,onShow:null,onClose:null,callbacks:{},actions:{}};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${I.NAME}`);i||(i=new I(this,"object"==typeof t&&t),e.data(`plugin_${I.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[I.NAME];$.fn[I.NAME]=I._jQueryInterface,$.fn[I.NAME].Constructor=I,$.fn[I.NAME].defaults=I.DEFAULTS||{},$.fn[I.NAME].noConflict=()=>($.fn[I.NAME]=t,I._jQueryInterface)}constructor(t,e){super(),this.settings=d({},I.DEFAULTS,window.Cool?.settings?.dialog||{},e||{}),this.container="string"==typeof t?document.querySelector(t):t,t&&t.jquery&&(this.container=t[0]),this.dialogs=[],this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}init(t){let e=d({},this.settings,t||{});t&&t.actions&&(e.actions=t.actions||{}),t&&t.callbacks&&(e.callbacks=t.callbacks||{}),e.callbacks&&"object"==typeof e.callbacks&&Object.keys(e.callbacks).forEach(t=>{Object.prototype.hasOwnProperty.call(e.actions,t)?"object"!=typeof e.actions[t]||Object.prototype.hasOwnProperty.call(e.actions[t],"content")||this.settings.actions&&this.settings.actions[t]&&"object"==typeof this.settings.actions[t]&&Object.prototype.hasOwnProperty.call(this.settings.actions[t],"content")&&(e.actions[t].content=this.settings.actions[t].content):this.settings.actions&&this.settings.actions[t]?e.actions[t]=d({},this.settings.actions[t]):e.actions[t]={}});const i=this.buildDialog(e);return this.show(i),this.bindEvents(i),this.onInit(i),i}destroy(){this.onDestroy()}buildDialog(t){const e=this,i={uuid:"dialog-"+a(),title:t.title,template:t.template,body:t.body,footer:t.footer,header:t.header,size:t.size,classes:t.classes,centered:t.centered,backdrop:t.backdrop,preventScroll:t.preventScroll,closeBtn:t.closeBtn,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,callbacks:t.callbacks,maxBodyHeight:t.maxBodyHeight,overflowVisible:t.overflowVisible,actions:t.actions,actionInProgress:!1,actionThreshold:300,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};let s;null==i.maxBodyHeight&&"full"!==i.size&&(i.maxBodyHeight=window.innerHeight-200),s="function"==typeof i.template?i.template():this._renderTemplate(i);const n=document.createElement("div");return n.innerHTML=s.trim(),i.el=n.firstElementChild,"undefined"!=typeof $&&$.fn&&(i.$el=$(i.el)),i.show=function(){e.show(i)},i.close=function(){e.close(i)},this.dialogs.push(i),i}bindEvents(t){const e=this;if(t._actionHandler=i=>{const s=i.target.closest("[data-dialog-action], [data-dialog-confirm], [data-dialog-close], [data-dialog-remove]");if(!s)return;if(i.preventDefault(),t.actionInProgress)return void i.stopPropagation();t.actionInProgress=!0;const n=["confirm","close","remove"];let o=s.dataset.dialogAction;if(!o)for(const t of n)if(s.hasAttribute(`data-dialog-${t}`)){o=t;break}const l=t.actions[o]||{};t.el.dispatchEvent(new CustomEvent(`dialog.${o}`,{bubbles:!0}));const a="function"==typeof l.callback?l.callback:"function"==typeof t.callbacks[o]?t.callbacks[o]:null,r=(e=!1)=>{e?t.actionInProgress=!1:setTimeout(()=>{t.actionInProgress=!1},t.actionThreshold)};if("function"==typeof a)try{const i=a.call(e,function(){n.includes(o)&&e.close(t),r()},t);i&&"function"==typeof i.then?i.then(t=>{!1===t&&r()}).catch(()=>{r()}):r()}catch(t){r()}else n.includes(o)?(e.close(t),r()):r()},t.el.addEventListener("click",t._actionHandler),null!==t.maxBodyHeight&&"full"!==t.size){const e=()=>(t.maxBodyHeight=window.innerHeight-200,t.maxBodyHeight);if(window.ResizeObserver)t.resizeObserver=new ResizeObserver(()=>{t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px")})}),t.resizeObserver.observe(document.body);else{let i,s=window.orientation;t.resizeHandler=()=>{clearTimeout(i);const n=performance.now(),o=window.orientation!==s;if(o&&(s=window.orientation),!t.lastResizeTime||n-t.lastResizeTime>100||o){const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px"),t.lastResizeTime=n}else i=setTimeout(()=>{const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px")},16)},window.addEventListener("resize",t.resizeHandler,{passive:!0}),window.addEventListener("orientationchange",t.resizeHandler,{passive:!0})}}}show(t){if(this.container.classList.contains("has-dialogs")||this.container.classList.add("has-dialogs"),t.preventScroll&&!this.container.classList.contains("dialog-prevent-scroll")&&this.container.classList.add("dialog-prevent-scroll"),this.dialogs.length>1){let e=this.dialogs[this.dialogs.length-2].el,i=parseInt(getComputedStyle(e).zIndex,10)||0;i+=1,t.el.style.zIndex=i,Object.assign(e.style,{transition:"opacity 0.3s",opacity:"0",visibility:"visible"})}if(t.backdrop&&!this.container.querySelector(".dialog-backdrop")){const t=document.createElement("div");t.className="dialog-backdrop",this.container.appendChild(t);let e=setInterval(()=>{const t=this.container.querySelector(".dialog-backdrop");0==this.dialogs.length&&t&&(t.remove(),clearInterval(e))},100)}if(this.container.appendChild(t.el),t.animation){const e=t.el.querySelector(".dialog-content");r(e,t.animationIn)}this.onShow(t)}close(t){let e=null;t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null),t.rafId&&(cancelAnimationFrame(t.rafId),t.rafId=null),t.resizeHandler&&(window.removeEventListener("resize",t.resizeHandler),window.removeEventListener("orientationchange",t.resizeHandler),t.resizeHandler=null),t._actionHandler&&(t.el.removeEventListener("click",t._actionHandler),t._actionHandler=null),this.dialogs.length>1&&(e=this.dialogs[this.dialogs.length-2].el);const i=this.container.querySelectorAll('.dialog[data-dialog-backdrop="true"]'),s=this.container.querySelector(".dialog-backdrop");0===i.length&&s&&s.remove();const n=()=>{t.el.remove(),this.dialogs=this.dialogs.filter(e=>e.uuid!==t.uuid),0==this.dialogs.length?(this.container.classList.remove("has-dialogs"),this.container.classList.remove("dialog-prevent-scroll")):e&&(e.style.opacity="1")};if(t.animation){const e=t.el.querySelector(".dialog-content");r(e,t.animationOut).then(()=>{n()})}else n();this.onClose(t)}onInitialize(){let t=this.onInitialize;"function"==typeof t&&t.call(this.container)}onDestroy(){let t=this.onDestroy;"function"==typeof t&&t.call(this.container)}onInit(t){let e=t.onInit;"function"==typeof e&&e.call(t)}onShow(t){let e=t.onShow;"function"==typeof e&&e.call(t)}onClose(t){let e=t.onClose;"function"==typeof e&&e.call(t)}_renderFooter(t){if("function"==typeof t.footer)return t.footer();if(""!==t.footer&&!1!==t.footer&&!0!==t.footer)return t.footer;if(!0===t.footer){if(!t.actions||"object"!=typeof t.actions)return"";const e=Object.entries(t.actions).filter(([,t])=>!1!==t&&("undefined"==typeof t.visible||!!t.visible)).map(([t,e],i)=>({key:t,action:e,idx:i}));e.sort((t,i)=>{if(2===e.length&&e.some(t=>"close"===t.key)&&e.some(t=>"remove"===t.key)){if("close"===t.key)return-1;if("close"===i.key)return 1;if("remove"===t.key)return 1;if("remove"===i.key)return-1}return"remove"===t.key?-1:"remove"===i.key||"confirm"===t.key?1:"confirm"===i.key?-1:t.idx-i.idx});const i=e.map(({key:t,action:e})=>{let i=e.style?e.style:e.primary?"btn-primary":"btn-secondary";"remove"===t&&(i="btn-remove"),"confirm"!==t||"undefined"!==e.primary&&!1===e.primary||(i="btn-primary");let s=e.content||t.charAt(0).toUpperCase()+t.slice(1);return`\n <button type="button" class="btn ${i}${e.classes?" "+e.classes:""}"${e.attrs?" "+e.attrs:""} data-dialog-action="${t}"${["confirm","close","remove"].includes(t)?` data-dialog-${t}`:""}>\n ${s}\n </button>\n `});let s="";return s=i.length>2?`\n ${i[0]}\n <div class="spacer"></div>\n ${i[1]}\n ${i.slice(2).join("\n")}\n `:i.join("\n"),`\n <div class="dialog-footer">\n ${s}\n </div>\n `}return""}_renderHeader(t){let e="";const i='\n <button type="button" data-dialog-action="close" class="dialog-header-close">\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ';return e="function"==typeof t.header?t.header():""!==t.header&&!1!==t.header&&!0!==t.header?t.header:!0===t.header?`\n <div class="dialog-header">\n <span class="dialog-title">\n ${function(t){const e=document.createTextNode(t),i=document.createElement("p");return i.appendChild(e),i.innerHTML}(t.title)}\n </span>\n ${i}\n </div>\n `:`<div class="dialog-header">${i}</div>`,e}_renderTemplate(t){const e=t.classes?" "+t.classes:"",i=t.centered?" dialog-centered":"",s=t.size?" dialog-"+t.size:"",n=t.overflowVisible?" dialog-overflow-visible":"",o=' data-dialog-uuid="'+t.uuid+'"',l=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',a=t.maxBodyHeight?' style="--cool-dialog-body-height: '+t.maxBodyHeight+'px"':"",r="function"==typeof t.body?t.body():t.body,h=this._renderFooter(t);return`\n <div class="dialog${e}${i}${s}${n}"${o}${l}>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n ${this._renderHeader(t)}\n\n <div class="dialog-body"${a}>\n\n ${r}\n\n </div>\n\n ${h}\n\n </div>\n\n </div>\n\n </div>\n `}}I._jQueryInit();class k extends i{static NAME="coolThemeSwitcher";static DEFAULTS={theme:"auto",storageKey:"cool-theme",target:null,onInit:null,onUpdate:null,onDestroy:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${k.NAME}`);i||(i=new k(this,"object"==typeof t&&t),e.data(`plugin_${k.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[k.NAME];$.fn[k.NAME]=k._jQueryInterface,$.fn[k.NAME].Constructor=k,$.fn[k.NAME].defaults=k.DEFAULTS||{},$.fn[k.NAME].noConflict=()=>($.fn[k.NAME]=t,k._jQueryInterface)}constructor(t,e){super(),this.opts=d({},k.DEFAULTS,window.Cool?.settings?.themeSwitcher||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents();const t=this._getStoredTheme();if(t)this._applyTheme(t);else{const t=this.el.dataset.theme;t&&["light","dark","auto"].includes(t)?this._applyTheme(t):this._applyTheme(this.opts.theme)}this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){this.target=this.opts.target?"string"==typeof this.opts.target?document.querySelector(this.opts.target):this.opts.target:document.documentElement,this._mediaQuery=window.matchMedia("(prefers-color-scheme: dark)")}bindEvents(){this._clickHandler=t=>{t.preventDefault();const e=this.el.dataset.theme;e&&["light","dark","auto"].includes(e)?this.setTheme(e):this.toggle()},this._mediaChangeHandler=()=>{"auto"===this._currentTheme&&this._dispatchEvent()},this.el.addEventListener("click",this._clickHandler),this._mediaQuery.addEventListener("change",this._mediaChangeHandler)}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this._mediaChangeHandler&&this._mediaQuery&&this._mediaQuery.removeEventListener("change",this._mediaChangeHandler)}setTheme(t){["light","dark","auto"].includes(t)&&this._applyTheme(t)}getTheme(){return this._currentTheme||"auto"}getResolvedTheme(){return"dark"===this._currentTheme?"dark":"light"===this._currentTheme?"light":this._mediaQuery.matches?"dark":"light"}toggle(){const t=this.getTheme(),e=["light","dark","auto"],i=(e.indexOf(t)+1)%e.length;this.setTheme(e[i])}_applyTheme(t){this._currentTheme=t,this.target.classList.remove("dark","light"),"dark"===t?this.target.classList.add("dark"):"light"===t&&this.target.classList.add("light"),this.el.setAttribute("data-active-theme",t),this._storeTheme(t),this._dispatchEvent()}_dispatchEvent(){const t=new CustomEvent("cool.theme.change",{bubbles:!0,detail:{theme:this.getTheme(),resolvedTheme:this.getResolvedTheme()}});this.target.dispatchEvent(t)}_getStoredTheme(){try{return localStorage.getItem(this.opts.storageKey)}catch{return null}}_storeTheme(t){try{localStorage.setItem(this.opts.storageKey,t)}catch{}}}k._jQueryInit(),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};class T{static _sidebarInstance=null;static _sectionInstance=null;static _toastInstance=null;static refresh(){this._sectionInstance&&this._sectionInstance.refresh&&this._sectionInstance.refresh(),f.initializeElements('[data-toggle="popover"]',window.Cool.settings.popover),E.initializeElements('[data-toggle="select"]',window.Cool.settings.select),v.initializeElements('[data-toggle="dropdown"]',window.Cool.settings.dropdown),C.initializeElements('[data-toggle="tooltip"]',window.Cool.settings.tooltip),_.initializeElements('[data-toggle="collapse"]',window.Cool.settings.collapse),S.initializeElements('[data-toggle="section-tabs"]',window.Cool.settings.sectionTabs),k.initializeElements('[data-toggle="theme-switcher"]',window.Cool.settings.themeSwitcher)}static initialize(t={}){window.Cool.settings=t,this._sectionInstance||(this._sectionInstance=new u(t.section)),f.initializeElements('[data-toggle="popover"]',t.popover),E.initializeElements('[data-toggle="select"]',t.select),v.initializeElements('[data-toggle="dropdown"]',t.dropdown),C.initializeElements('[data-toggle="tooltip"]',t.tooltip),_.initializeElements('[data-toggle="collapse"]',t.collapse),S.initializeElements('[data-toggle="section-tabs"]',t.sectionTabs),k.initializeElements('[data-toggle="theme-switcher"]',t.themeSwitcher);const e=document.querySelector(".sidebar-left");e&&(this._sidebarInstance=m.initializeElement(e,t.sidebar)||m.getInstance(e)),this._toastInstance=L.initializeElement(document.body,t.toast)||L.getInstance(document.body),window.Cool.toast=this._toastInstance,I.initializeElement(document.body,t.dialog)}static initComponent(t){if(!t)return;const e=Array.isArray(t)?t:[t],i=[],s=[];e.forEach(t=>{const e="string"==typeof t?document.querySelector(t):t;if(!e)return;const i=e.querySelectorAll("[data-toggle]");(e.hasAttribute("data-toggle")?[e,...Array.from(i)]:Array.from(i)).forEach(t=>{s.push(t)})});const n=[],o=[];s.forEach(t=>{const e=t.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0?n.push(t):o.push(t)});const l=[...n,...o];let a=0;const r=()=>{l.slice(a,a+10).forEach(t=>{let e=null;switch(t.getAttribute("data-toggle")){case"popover":e=f.initializeElement(t,window.Cool.settings.popover);break;case"select":e=E.initializeElement(t,window.Cool.settings.select);break;case"dropdown":e=v.initializeElement(t,window.Cool.settings.dropdown);break;case"tooltip":e=C.initializeElement(t,window.Cool.settings.tooltip);break;case"collapse":e=_.initializeElement(t,window.Cool.settings.collapse);break;case"section-tabs":e=S.initializeElement(t,window.Cool.settings.sectionTabs);break;case"theme-switcher":e=k.initializeElement(t,window.Cool.settings.themeSwitcher)}e&&i.push(e)}),a+=10,a<l.length&&("requestIdleCallback"in window?requestIdleCallback(r,{timeout:50}):setTimeout(r,0))};return n.length>0?r():"requestIdleCallback"in window?requestIdleCallback(r,{timeout:100}):r(),i}static destroy(){this._sidebarInstance&&(this._sidebarInstance.destroy(),this._sidebarInstance=null),this._sectionInstance&&(this._sectionInstance.destroy(),this._sectionInstance=null)}static observeResize(t,e){if(t&&"function"==typeof e)return s.observe(t,e)}static unobserveResize(t){t&&s.unobserve(t)}static addScrollListener(t,e){t&&"function"==typeof e&&n.add(t,e)}static removeScrollListener(t){t&&n.remove(t)}static getSidebar(){return this._sidebarInstance}static getSection(){return this._sectionInstance}static getToast(){return this._toastInstance}static initjQuery(){f._jQueryInit(),E._jQueryInit(),v._jQueryInit(),C._jQueryInit(),_._jQueryInit(),S._jQueryInit(),L._jQueryInit(),I._jQueryInit(),m._jQueryInit(),k._jQueryInit()}}window.Cool.initialize=T.initialize.bind(T),window.Cool.initComponent=T.initComponent.bind(T),window.Cool.refresh=T.refresh.bind(T),window.Cool.destroy=T.destroy.bind(T),window.Cool.observeResize=T.observeResize.bind(T),window.Cool.unobserveResize=T.unobserveResize.bind(T),window.Cool.addScrollListener=T.addScrollListener.bind(T),window.Cool.removeScrollListener=T.removeScrollListener.bind(T),window.Cool.getSidebar=T.getSidebar.bind(T),window.Cool.getSection=T.getSection.bind(T),window.Cool.getToast=T.getToast.bind(T),window.Cool.initjQuery=T.initjQuery.bind(T),"undefined"!=typeof window&&(window.jQuery=window.$=t);return{Common:T,Sidebar:m,Popover:f,Select:E,Dropdown:v,Tooltip:C,SectionTabs:S,Collapse:_,Toast:L,Dialog:I,ThemeSwitcher:k}});
12
7
  //# sourceMappingURL=cool.min.js.map