@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,17 @@
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";
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cool=e()}(this,function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={exports:{}};
7
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}});
8
+ * jQuery JavaScript Library v3.7.1
9
+ * https://jquery.com/
10
+ *
11
+ * Copyright OpenJS Foundation and other contributors
12
+ * Released under the MIT license
13
+ * https://jquery.org/license
14
+ *
15
+ * Date: 2023-08-28T13:37Z
16
+ */!function(e){!function(t,i){e.exports=t.document?i(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}}("undefined"!=typeof window?window:t,function(t,e){var i=[],n=Object.getPrototypeOf,s=i.slice,o=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},r=i.push,l=i.indexOf,a={},c=a.toString,h=a.hasOwnProperty,d=h.toString,u=d.call(Object),p={},f=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},m=function(t){return null!=t&&t===t.window},g=t.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(t,e,i){var n,s,o=(i=i||g).createElement("script");if(o.text=t,e)for(n in y)(s=e[n]||e.getAttribute&&e.getAttribute(n))&&o.setAttribute(n,s);i.head.appendChild(o).parentNode.removeChild(o)}function b(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?a[c.call(t)]||"object":typeof t}var E="3.7.1",w=/HTML$/i,C=function(t,e){return new C.fn.init(t,e)};function x(t){var e=!!t&&"length"in t&&t.length,i=b(t);return!f(t)&&!m(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function S(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}C.fn=C.prototype={jquery:E,constructor:C,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return C.each(this,t)},map:function(t){return this.pushStack(C.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(C.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(C.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:r,sort:i.sort,splice:i.splice},C.extend=C.fn.extend=function(){var t,e,i,n,s,o,r=arguments[0]||{},l=1,a=arguments.length,c=!1;for("boolean"==typeof r&&(c=r,r=arguments[l]||{},l++),"object"==typeof r||f(r)||(r={}),l===a&&(r=this,l--);l<a;l++)if(null!=(t=arguments[l]))for(e in t)n=t[e],"__proto__"!==e&&r!==n&&(c&&n&&(C.isPlainObject(n)||(s=Array.isArray(n)))?(i=r[e],o=s&&!Array.isArray(i)?[]:s||C.isPlainObject(i)?i:{},s=!1,r[e]=C.extend(c,o,n)):void 0!==n&&(r[e]=n));return r},C.extend({expando:"jQuery"+(E+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==c.call(t))&&(!(e=n(t))||"function"==typeof(i=h.call(e,"constructor")&&e.constructor)&&d.call(i)===u)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){v(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,n=0;if(x(t))for(i=t.length;n<i&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},text:function(t){var e,i="",n=0,s=t.nodeType;if(!s)for(;e=t[n++];)i+=C.text(e);return 1===s||11===s?t.textContent:9===s?t.documentElement.textContent:3===s||4===s?t.nodeValue:i},makeArray:function(t,e){var i=e||[];return null!=t&&(x(Object(t))?C.merge(i,"string"==typeof t?[t]:t):r.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:l.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!w.test(e||i&&i.nodeName||"HTML")},merge:function(t,e){for(var i=+e.length,n=0,s=t.length;n<i;n++)t[s++]=e[n];return t.length=s,t},grep:function(t,e,i){for(var n=[],s=0,o=t.length,r=!i;s<o;s++)!e(t[s],s)!==r&&n.push(t[s]);return n},map:function(t,e,i){var n,s,r=0,l=[];if(x(t))for(n=t.length;r<n;r++)null!=(s=e(t[r],r,i))&&l.push(s);else for(r in t)null!=(s=e(t[r],r,i))&&l.push(s);return o(l)},guid:1,support:p}),"function"==typeof Symbol&&(C.fn[Symbol.iterator]=i[Symbol.iterator]),C.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){a["[object "+e+"]"]=e.toLowerCase()});var T=i.pop,k=i.sort,_=i.splice,L="[\\x20\\t\\r\\n\\f]",A=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g");C.contains=function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))};var I=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function H(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}C.escapeSelector=function(t){return(t+"").replace(I,H)};var D=g,$=r;!function(){var e,n,o,r,a,c,d,u,f,m,g=$,y=C.expando,v=0,b=0,E=tt(),w=tt(),x=tt(),I=tt(),H=function(t,e){return t===e&&(a=!0),0},q="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",N=new RegExp(L+"+","g"),z=new RegExp("^"+L+"*,"+L+"*"),P=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),F=new RegExp(L+"|>"),R=new RegExp(O),W=new RegExp("^"+M+"$"),B={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+q+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},U=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,X=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),Y=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},G=function(){at()},J=ut(function(t){return!0===t.disabled&&S(t,"fieldset")},{dir:"parentNode",next:"legend"});try{g.apply(i=s.call(D.childNodes),D.childNodes),i[D.childNodes.length].nodeType}catch(t){g={apply:function(t,e){$.apply(t,s.call(e))},call:function(t){$.apply(t,s.call(arguments,1))}}}function Z(t,e,i,n){var s,o,r,l,a,h,d,m=e&&e.ownerDocument,v=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==v&&9!==v&&11!==v)return i;if(!n&&(at(e),e=e||c,u)){if(11!==v&&(a=V.exec(t)))if(s=a[1]){if(9===v){if(!(r=e.getElementById(s)))return i;if(r.id===s)return g.call(i,r),i}else if(m&&(r=m.getElementById(s))&&Z.contains(e,r)&&r.id===s)return g.call(i,r),i}else{if(a[2])return g.apply(i,e.getElementsByTagName(t)),i;if((s=a[3])&&e.getElementsByClassName)return g.apply(i,e.getElementsByClassName(s)),i}if(!(I[t+" "]||f&&f.test(t))){if(d=t,m=e,1===v&&(F.test(t)||P.test(t))){for((m=K.test(t)&&lt(e.parentNode)||e)==e&&p.scope||((l=e.getAttribute("id"))?l=C.escapeSelector(l):e.setAttribute("id",l=y)),o=(h=ht(t)).length;o--;)h[o]=(l?"#"+l:":scope")+" "+dt(h[o]);d=h.join(",")}try{return g.apply(i,m.querySelectorAll(d)),i}catch(e){I(t,!0)}finally{l===y&&e.removeAttribute("id")}}}return vt(t.replace(A,"$1"),e,i,n)}function tt(){var t=[];return function e(i,s){return t.push(i+" ")>n.cacheLength&&delete e[t.shift()],e[i+" "]=s}}function et(t){return t[y]=!0,t}function it(t){var e=c.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return S(e,"input")&&e.type===t}}function st(t){return function(e){return(S(e,"input")||S(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&J(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function rt(t){return et(function(e){return e=+e,et(function(i,n){for(var s,o=t([],i.length,e),r=o.length;r--;)i[s=o[r]]&&(i[s]=!(n[s]=i[s]))})})}function lt(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function at(t){var e,i=t?t.ownerDocument||t:D;return i!=c&&9===i.nodeType&&i.documentElement?(d=(c=i).documentElement,u=!C.isXMLDoc(c),m=d.matches||d.webkitMatchesSelector||d.msMatchesSelector,d.msMatchesSelector&&D!=c&&(e=c.defaultView)&&e.top!==e&&e.addEventListener("unload",G),p.getById=it(function(t){return d.appendChild(t).id=C.expando,!c.getElementsByName||!c.getElementsByName(C.expando).length}),p.disconnectedMatch=it(function(t){return m.call(t,"*")}),p.scope=it(function(){return c.querySelectorAll(":scope")}),p.cssHas=it(function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}}),p.getById?(n.filter.ID=function(t){var e=t.replace(X,Y);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&u){var i=e.getElementById(t);return i?[i]:[]}}):(n.filter.ID=function(t){var e=t.replace(X,Y);return function(t){var i="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},n.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&u){var i,n,s,o=e.getElementById(t);if(o){if((i=o.getAttributeNode("id"))&&i.value===t)return[o];for(s=e.getElementsByName(t),n=0;o=s[n++];)if((i=o.getAttributeNode("id"))&&i.value===t)return[o]}return[]}}),n.find.TAG=function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},n.find.CLASS=function(t,e){if("undefined"!=typeof e.getElementsByClassName&&u)return e.getElementsByClassName(t)},f=[],it(function(t){var e;d.appendChild(t).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||f.push("\\["+L+"*(?:value|"+q+")"),t.querySelectorAll("[id~="+y+"-]").length||f.push("~="),t.querySelectorAll("a#"+y+"+*").length||f.push(".#.+[+~]"),t.querySelectorAll(":checked").length||f.push(":checked"),(e=c.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),d.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(e=c.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||f.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")")}),p.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),H=function(t,e){if(t===e)return a=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!p.sortDetached&&e.compareDocumentPosition(t)===i?t===c||t.ownerDocument==D&&Z.contains(D,t)?-1:e===c||e.ownerDocument==D&&Z.contains(D,e)?1:r?l.call(r,t)-l.call(r,e):0:4&i?-1:1)},c):c}for(e in Z.matches=function(t,e){return Z(t,null,null,e)},Z.matchesSelector=function(t,e){if(at(t),u&&!I[e+" "]&&(!f||!f.test(e)))try{var i=m.call(t,e);if(i||p.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){I(e,!0)}return Z(e,c,null,[t]).length>0},Z.contains=function(t,e){return(t.ownerDocument||t)!=c&&at(t),C.contains(t,e)},Z.attr=function(t,e){(t.ownerDocument||t)!=c&&at(t);var i=n.attrHandle[e.toLowerCase()],s=i&&h.call(n.attrHandle,e.toLowerCase())?i(t,e,!u):void 0;return void 0!==s?s:t.getAttribute(e)},Z.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},C.uniqueSort=function(t){var e,i=[],n=0,o=0;if(a=!p.sortStable,r=!p.sortStable&&s.call(t,0),k.call(t,H),a){for(;e=t[o++];)e===t[o]&&(n=i.push(o));for(;n--;)_.call(t,i[n],1)}return r=null,t},C.fn.uniqueSort=function(){return this.pushStack(C.uniqueSort(s.apply(this)))},n=C.expr={cacheLength:50,createPseudo:et,match:B,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(X,Y),t[3]=(t[3]||t[4]||t[5]||"").replace(X,Y),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Z.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Z.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return B.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&R.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(X,Y).toLowerCase();return"*"===t?function(){return!0}:function(t){return S(t,e)}},CLASS:function(t){var e=E[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&E(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,i){return function(n){var s=Z.attr(n,t);return null==s?"!="===e:!e||(s+="","="===e?s===i:"!="===e?s!==i:"^="===e?i&&0===s.indexOf(i):"*="===e?i&&s.indexOf(i)>-1:"$="===e?i&&s.slice(-i.length)===i:"~="===e?(" "+s.replace(N," ")+" ").indexOf(i)>-1:"|="===e&&(s===i||s.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,s){var o="nth"!==t.slice(0,3),r="last"!==t.slice(-4),l="of-type"===e;return 1===n&&0===s?function(t){return!!t.parentNode}:function(e,i,a){var c,h,d,u,p,f=o!==r?"nextSibling":"previousSibling",m=e.parentNode,g=l&&e.nodeName.toLowerCase(),b=!a&&!l,E=!1;if(m){if(o){for(;f;){for(d=e;d=d[f];)if(l?S(d,g):1===d.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[r?m.firstChild:m.lastChild],r&&b){for(E=(u=(c=(h=m[y]||(m[y]={}))[t]||[])[0]===v&&c[1])&&c[2],d=u&&m.childNodes[u];d=++u&&d&&d[f]||(E=u=0)||p.pop();)if(1===d.nodeType&&++E&&d===e){h[t]=[v,u,E];break}}else if(b&&(E=u=(c=(h=e[y]||(e[y]={}))[t]||[])[0]===v&&c[1]),!1===E)for(;(d=++u&&d&&d[f]||(E=u=0)||p.pop())&&(!(l?S(d,g):1===d.nodeType)||!++E||(b&&((h=d[y]||(d[y]={}))[t]=[v,E]),d!==e)););return(E-=s)===n||E%n===0&&E/n>=0}}},PSEUDO:function(t,e){var i,s=n.pseudos[t]||n.setFilters[t.toLowerCase()]||Z.error("unsupported pseudo: "+t);return s[y]?s(e):s.length>1?(i=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?et(function(t,i){for(var n,o=s(t,e),r=o.length;r--;)t[n=l.call(t,o[r])]=!(i[n]=o[r])}):function(t){return s(t,0,i)}):s}},pseudos:{not:et(function(t){var e=[],i=[],n=yt(t.replace(A,"$1"));return n[y]?et(function(t,e,i,s){for(var o,r=n(t,null,s,[]),l=t.length;l--;)(o=r[l])&&(t[l]=!(e[l]=o))}):function(t,s,o){return e[0]=t,n(e,null,o,i),e[0]=null,!i.pop()}}),has:et(function(t){return function(e){return Z(t,e).length>0}}),contains:et(function(t){return t=t.replace(X,Y),function(e){return(e.textContent||C.text(e)).indexOf(t)>-1}}),lang:et(function(t){return W.test(t||"")||Z.error("unsupported lang: "+t),t=t.replace(X,Y).toLowerCase(),function(e){var i;do{if(i=u?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===d},focus:function(t){return t===function(){try{return c.activeElement}catch(t){}}()&&c.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return S(t,"input")&&!!t.checked||S(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return Q.test(t.nodeName)},input:function(t){return U.test(t.nodeName)},button:function(t){return S(t,"input")&&"button"===t.type||S(t,"button")},text:function(t){var e;return S(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:rt(function(){return[0]}),last:rt(function(t,e){return[e-1]}),eq:rt(function(t,e,i){return[i<0?i+e:i]}),even:rt(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:rt(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:rt(function(t,e,i){var n;for(n=i<0?i+e:i>e?e:i;--n>=0;)t.push(n);return t}),gt:rt(function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t})}},n.pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[e]=nt(e);for(e in{submit:!0,reset:!0})n.pseudos[e]=st(e);function ct(){}function ht(t,e){var i,s,o,r,l,a,c,h=w[t+" "];if(h)return e?0:h.slice(0);for(l=t,a=[],c=n.preFilter;l;){for(r in i&&!(s=z.exec(l))||(s&&(l=l.slice(s[0].length)||l),a.push(o=[])),i=!1,(s=P.exec(l))&&(i=s.shift(),o.push({value:i,type:s[0].replace(A," ")}),l=l.slice(i.length)),n.filter)!(s=B[r].exec(l))||c[r]&&!(s=c[r](s))||(i=s.shift(),o.push({value:i,type:r,matches:s}),l=l.slice(i.length));if(!i)break}return e?l.length:l?Z.error(t):w(t,a).slice(0)}function dt(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function ut(t,e,i){var n=e.dir,s=e.next,o=s||n,r=i&&"parentNode"===o,l=b++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||r)return t(e,i,s);return!1}:function(e,i,a){var c,h,d=[v,l];if(a){for(;e=e[n];)if((1===e.nodeType||r)&&t(e,i,a))return!0}else for(;e=e[n];)if(1===e.nodeType||r)if(h=e[y]||(e[y]={}),s&&S(e,s))e=e[n]||e;else{if((c=h[o])&&c[0]===v&&c[1]===l)return d[2]=c[2];if(h[o]=d,d[2]=t(e,i,a))return!0}return!1}}function pt(t){return t.length>1?function(e,i,n){for(var s=t.length;s--;)if(!t[s](e,i,n))return!1;return!0}:t[0]}function ft(t,e,i,n,s){for(var o,r=[],l=0,a=t.length,c=null!=e;l<a;l++)(o=t[l])&&(i&&!i(o,n,s)||(r.push(o),c&&e.push(l)));return r}function mt(t,e,i,n,s,o){return n&&!n[y]&&(n=mt(n)),s&&!s[y]&&(s=mt(s,o)),et(function(o,r,a,c){var h,d,u,p,f=[],m=[],y=r.length,v=o||function(t,e,i){for(var n=0,s=e.length;n<s;n++)Z(t,e[n],i);return i}(e||"*",a.nodeType?[a]:a,[]),b=!t||!o&&e?v:ft(v,f,t,a,c);if(i?i(b,p=s||(o?t:y||n)?[]:r,a,c):p=b,n)for(h=ft(p,m),n(h,[],a,c),d=h.length;d--;)(u=h[d])&&(p[m[d]]=!(b[m[d]]=u));if(o){if(s||t){if(s){for(h=[],d=p.length;d--;)(u=p[d])&&h.push(b[d]=u);s(null,p=[],h,c)}for(d=p.length;d--;)(u=p[d])&&(h=s?l.call(o,u):f[d])>-1&&(o[h]=!(r[h]=u))}}else p=ft(p===r?p.splice(y,p.length):p),s?s(null,r,p,c):g.apply(r,p)})}function gt(t){for(var e,i,s,r=t.length,a=n.relative[t[0].type],c=a||n.relative[" "],h=a?1:0,d=ut(function(t){return t===e},c,!0),u=ut(function(t){return l.call(e,t)>-1},c,!0),p=[function(t,i,n){var s=!a&&(n||i!=o)||((e=i).nodeType?d(t,i,n):u(t,i,n));return e=null,s}];h<r;h++)if(i=n.relative[t[h].type])p=[ut(pt(p),i)];else{if((i=n.filter[t[h].type].apply(null,t[h].matches))[y]){for(s=++h;s<r&&!n.relative[t[s].type];s++);return mt(h>1&&pt(p),h>1&&dt(t.slice(0,h-1).concat({value:" "===t[h-2].type?"*":""})).replace(A,"$1"),i,h<s&&gt(t.slice(h,s)),s<r&&gt(t=t.slice(s)),s<r&&dt(t))}p.push(i)}return pt(p)}function yt(t,e){var i,s=[],r=[],l=x[t+" "];if(!l){for(e||(e=ht(t)),i=e.length;i--;)(l=gt(e[i]))[y]?s.push(l):r.push(l);l=x(t,function(t,e){var i=e.length>0,s=t.length>0,r=function(r,l,a,h,d){var p,f,m,y=0,b="0",E=r&&[],w=[],x=o,S=r||s&&n.find.TAG("*",d),k=v+=null==x?1:Math.random()||.1,_=S.length;for(d&&(o=l==c||l||d);b!==_&&null!=(p=S[b]);b++){if(s&&p){for(f=0,l||p.ownerDocument==c||(at(p),a=!u);m=t[f++];)if(m(p,l||c,a)){g.call(h,p);break}d&&(v=k)}i&&((p=!m&&p)&&y--,r&&E.push(p))}if(y+=b,i&&b!==y){for(f=0;m=e[f++];)m(E,w,l,a);if(r){if(y>0)for(;b--;)E[b]||w[b]||(w[b]=T.call(h));w=ft(w)}g.apply(h,w),d&&!r&&w.length>0&&y+e.length>1&&C.uniqueSort(h)}return d&&(v=k,o=x),E};return i?et(r):r}(r,s)),l.selector=t}return l}function vt(t,e,i,s){var o,r,l,a,c,h="function"==typeof t&&t,d=!s&&ht(t=h.selector||t);if(i=i||[],1===d.length){if((r=d[0]=d[0].slice(0)).length>2&&"ID"===(l=r[0]).type&&9===e.nodeType&&u&&n.relative[r[1].type]){if(!(e=(n.find.ID(l.matches[0].replace(X,Y),e)||[])[0]))return i;h&&(e=e.parentNode),t=t.slice(r.shift().value.length)}for(o=B.needsContext.test(t)?0:r.length;o--&&(l=r[o],!n.relative[a=l.type]);)if((c=n.find[a])&&(s=c(l.matches[0].replace(X,Y),K.test(r[0].type)&&lt(e.parentNode)||e))){if(r.splice(o,1),!(t=s.length&&dt(r)))return g.apply(i,s),i;break}}return(h||yt(t,d))(s,e,!u,i,!e||K.test(t)&&lt(e.parentNode)||e),i}ct.prototype=n.filters=n.pseudos,n.setFilters=new ct,p.sortStable=y.split("").sort(H).join("")===y,at(),p.sortDetached=it(function(t){return 1&t.compareDocumentPosition(c.createElement("fieldset"))}),C.find=Z,C.expr[":"]=C.expr.pseudos,C.unique=C.uniqueSort,Z.compile=yt,Z.select=vt,Z.setDocument=at,Z.tokenize=ht,Z.escape=C.escapeSelector,Z.getText=C.text,Z.isXML=C.isXMLDoc,Z.selectors=C.expr,Z.support=C.support,Z.uniqueSort=C.uniqueSort}();var q=function(t,e,i){for(var n=[],s=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&C(t).is(i))break;n.push(t)}return n},M=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},j=C.expr.match.needsContext,O=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(t,e,i){return f(e)?C.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?C.grep(t,function(t){return t===e!==i}):"string"!=typeof e?C.grep(t,function(t){return l.call(e,t)>-1!==i}):C.filter(e,t,i)}C.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?C.find.matchesSelector(n,t)?[n]:[]:C.find.matches(t,C.grep(e,function(t){return 1===t.nodeType}))},C.fn.extend({find:function(t){var e,i,n=this.length,s=this;if("string"!=typeof t)return this.pushStack(C(t).filter(function(){for(e=0;e<n;e++)if(C.contains(s[e],this))return!0}));for(i=this.pushStack([]),e=0;e<n;e++)C.find(t,s[e],i);return n>1?C.uniqueSort(i):i},filter:function(t){return this.pushStack(N(this,t||[],!1))},not:function(t){return this.pushStack(N(this,t||[],!0))},is:function(t){return!!N(this,"string"==typeof t&&j.test(t)?C(t):t||[],!1).length}});var z,P=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(t,e,i){var n,s;if(!t)return this;if(i=i||z,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:P.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),O.test(n[1])&&C.isPlainObject(e))for(n in e)f(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(s=g.getElementById(n[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):f(t)?void 0!==i.ready?i.ready(t):t(C):C.makeArray(t,this)}).prototype=C.fn,z=C(g);var F=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}C.fn.extend({has:function(t){var e=C(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(C.contains(this,e[t]))return!0})},closest:function(t,e){var i,n=0,s=this.length,o=[],r="string"!=typeof t&&C(t);if(!j.test(t))for(;n<s;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(r?r.index(i)>-1:1===i.nodeType&&C.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?C.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?l.call(C(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),C.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return q(t,"parentNode")},parentsUntil:function(t,e,i){return q(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return q(t,"nextSibling")},prevAll:function(t){return q(t,"previousSibling")},nextUntil:function(t,e,i){return q(t,"nextSibling",i)},prevUntil:function(t,e,i){return q(t,"previousSibling",i)},siblings:function(t){return M((t.parentNode||{}).firstChild,t)},children:function(t){return M(t.firstChild)},contents:function(t){return null!=t.contentDocument&&n(t.contentDocument)?t.contentDocument:(S(t,"template")&&(t=t.content||t),C.merge([],t.childNodes))}},function(t,e){C.fn[t]=function(i,n){var s=C.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=C.filter(n,s)),this.length>1&&(R[t]||C.uniqueSort(s),F.test(t)&&s.reverse()),this.pushStack(s)}});var B=/[^\x20\t\r\n\f]+/g;function U(t){return t}function Q(t){throw t}function V(t,e,i,n){var s;try{t&&f(s=t.promise)?s.call(t).done(e).fail(i):t&&f(s=t.then)?s.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}C.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return C.each(t.match(B)||[],function(t,i){e[i]=!0}),e}(t):C.extend({},t);var e,i,n,s,o=[],r=[],l=-1,a=function(){for(s=s||t.once,n=e=!0;r.length;l=-1)for(i=r.shift();++l<o.length;)!1===o[l].apply(i[0],i[1])&&t.stopOnFalse&&(l=o.length,i=!1);t.memory||(i=!1),e=!1,s&&(o=i?[]:"")},c={add:function(){return o&&(i&&!e&&(l=o.length-1,r.push(i)),function e(i){C.each(i,function(i,n){f(n)?t.unique&&c.has(n)||o.push(n):n&&n.length&&"string"!==b(n)&&e(n)})}(arguments),i&&!e&&a()),this},remove:function(){return C.each(arguments,function(t,e){for(var i;(i=C.inArray(e,o,i))>-1;)o.splice(i,1),i<=l&&l--}),this},has:function(t){return t?C.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return s=r=[],o=i="",this},disabled:function(){return!o},lock:function(){return s=r=[],i||e||(o=i=""),this},locked:function(){return!!s},fireWith:function(t,i){return s||(i=[t,(i=i||[]).slice?i.slice():i],r.push(i),e||a()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},C.extend({Deferred:function(e){var i=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return C.Deferred(function(e){C.each(i,function(i,n){var s=f(t[n[4]])&&t[n[4]];o[n[1]](function(){var t=s&&s.apply(this,arguments);t&&f(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[n[0]+"With"](this,s?[t]:arguments)})}),t=null}).promise()},then:function(e,n,s){var o=0;function r(e,i,n,s){return function(){var l=this,a=arguments,c=function(){var t,c;if(!(e<o)){if((t=n.apply(l,a))===i.promise())throw new TypeError("Thenable self-resolution");c=t&&("object"==typeof t||"function"==typeof t)&&t.then,f(c)?s?c.call(t,r(o,i,U,s),r(o,i,Q,s)):(o++,c.call(t,r(o,i,U,s),r(o,i,Q,s),r(o,i,U,i.notifyWith))):(n!==U&&(l=void 0,a=[t]),(s||i.resolveWith)(l,a))}},h=s?c:function(){try{c()}catch(t){C.Deferred.exceptionHook&&C.Deferred.exceptionHook(t,h.error),e+1>=o&&(n!==Q&&(l=void 0,a=[t]),i.rejectWith(l,a))}};e?h():(C.Deferred.getErrorHook?h.error=C.Deferred.getErrorHook():C.Deferred.getStackHook&&(h.error=C.Deferred.getStackHook()),t.setTimeout(h))}}return C.Deferred(function(t){i[0][3].add(r(0,t,f(s)?s:U,t.notifyWith)),i[1][3].add(r(0,t,f(e)?e:U)),i[2][3].add(r(0,t,f(n)?n:Q))}).promise()},promise:function(t){return null!=t?C.extend(t,s):s}},o={};return C.each(i,function(t,e){var r=e[2],l=e[5];s[e[1]]=r.add,l&&r.add(function(){n=l},i[3-t][2].disable,i[3-t][3].disable,i[0][2].lock,i[0][3].lock),r.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=r.fireWith}),s.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,i=e,n=Array(i),o=s.call(arguments),r=C.Deferred(),l=function(t){return function(i){n[t]=this,o[t]=arguments.length>1?s.call(arguments):i,--e||r.resolveWith(n,o)}};if(e<=1&&(V(t,r.done(l(i)).resolve,r.reject,!e),"pending"===r.state()||f(o[i]&&o[i].then)))return r.then();for(;i--;)V(o[i],l(i),r.reject);return r.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(e,i){t.console&&t.console.warn&&e&&K.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},C.readyException=function(e){t.setTimeout(function(){throw e})};var X=C.Deferred();function Y(){g.removeEventListener("DOMContentLoaded",Y),t.removeEventListener("load",Y),C.ready()}C.fn.ready=function(t){return X.then(t).catch(function(t){C.readyException(t)}),this},C.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==t&&--C.readyWait>0||X.resolveWith(g,[C]))}}),C.ready.then=X.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?t.setTimeout(C.ready):(g.addEventListener("DOMContentLoaded",Y),t.addEventListener("load",Y));var G=function(t,e,i,n,s,o,r){var l=0,a=t.length,c=null==i;if("object"===b(i))for(l in s=!0,i)G(t,e,l,i[l],!0,o,r);else if(void 0!==n&&(s=!0,f(n)||(r=!0),c&&(r?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(C(t),i)})),e))for(;l<a;l++)e(t[l],i,r?n:n.call(t[l],l,e(t[l],i)));return s?t:c?e.call(t):a?e(t[0],i):o},J=/^-ms-/,Z=/-([a-z])/g;function tt(t,e){return e.toUpperCase()}function et(t){return t.replace(J,"ms-").replace(Z,tt)}var it=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function nt(){this.expando=C.expando+nt.uid++}nt.uid=1,nt.prototype={cache:function(t){var e=t[this.expando];return e||(e={},it(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,s=this.cache(t);if("string"==typeof e)s[et(e)]=i;else for(n in e)s[et(n)]=e[n];return s},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][et(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){i=(e=Array.isArray(e)?e.map(et):(e=et(e))in n?[e]:e.match(B)||[]).length;for(;i--;)delete n[e[i]]}(void 0===e||C.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!C.isEmptyObject(e)}};var st=new nt,ot=new nt,rt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,lt=/[A-Z]/g;function at(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(lt,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:rt.test(t)?JSON.parse(t):t)}(i)}catch(t){}ot.set(t,e,i)}else i=void 0;return i}C.extend({hasData:function(t){return ot.hasData(t)||st.hasData(t)},data:function(t,e,i){return ot.access(t,e,i)},removeData:function(t,e){ot.remove(t,e)},_data:function(t,e,i){return st.access(t,e,i)},_removeData:function(t,e){st.remove(t,e)}}),C.fn.extend({data:function(t,e){var i,n,s,o=this[0],r=o&&o.attributes;if(void 0===t){if(this.length&&(s=ot.get(o),1===o.nodeType&&!st.get(o,"hasDataAttrs"))){for(i=r.length;i--;)r[i]&&0===(n=r[i].name).indexOf("data-")&&(n=et(n.slice(5)),at(o,n,s[n]));st.set(o,"hasDataAttrs",!0)}return s}return"object"==typeof t?this.each(function(){ot.set(this,t)}):G(this,function(e){var i;if(o&&void 0===e)return void 0!==(i=ot.get(o,t))||void 0!==(i=at(o,t))?i:void 0;this.each(function(){ot.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){ot.remove(this,t)})}}),C.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=st.get(t,e),i&&(!n||Array.isArray(i)?n=st.access(t,e,C.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=C.queue(t,e),n=i.length,s=i.shift(),o=C._queueHooks(t,e);"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===e&&i.unshift("inprogress"),delete o.stop,s.call(t,function(){C.dequeue(t,e)},o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return st.get(t,i)||st.access(t,i,{empty:C.Callbacks("once memory").add(function(){st.remove(t,[e+"queue",i])})})}}),C.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?C.queue(this[0],t):void 0===e?this:this.each(function(){var i=C.queue(this,t,e);C._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&C.dequeue(this,t)})},dequeue:function(t){return this.each(function(){C.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,s=C.Deferred(),o=this,r=this.length,l=function(){--n||s.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";r--;)(i=st.get(o[r],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(l));return l(),s.promise(e)}});var ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ht=new RegExp("^(?:([+-])=|)("+ct+")([a-z%]*)$","i"),dt=["Top","Right","Bottom","Left"],ut=g.documentElement,pt=function(t){return C.contains(t.ownerDocument,t)},ft={composed:!0};ut.getRootNode&&(pt=function(t){return C.contains(t.ownerDocument,t)||t.getRootNode(ft)===t.ownerDocument});var mt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&pt(t)&&"none"===C.css(t,"display")};function gt(t,e,i,n){var s,o,r=20,l=n?function(){return n.cur()}:function(){return C.css(t,e,"")},a=l(),c=i&&i[3]||(C.cssNumber[e]?"":"px"),h=t.nodeType&&(C.cssNumber[e]||"px"!==c&&+a)&&ht.exec(C.css(t,e));if(h&&h[3]!==c){for(a/=2,c=c||h[3],h=+a||1;r--;)C.style(t,e,h+c),(1-o)*(1-(o=l()/a||.5))<=0&&(r=0),h/=o;h*=2,C.style(t,e,h+c),i=i||[]}return i&&(h=+h||+a||0,s=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=h,n.end=s)),s}var yt={};function vt(t){var e,i=t.ownerDocument,n=t.nodeName,s=yt[n];return s||(e=i.body.appendChild(i.createElement(n)),s=C.css(e,"display"),e.parentNode.removeChild(e),"none"===s&&(s="block"),yt[n]=s,s)}function bt(t,e){for(var i,n,s=[],o=0,r=t.length;o<r;o++)(n=t[o]).style&&(i=n.style.display,e?("none"===i&&(s[o]=st.get(n,"display")||null,s[o]||(n.style.display="")),""===n.style.display&&mt(n)&&(s[o]=vt(n))):"none"!==i&&(s[o]="none",st.set(n,"display",i)));for(o=0;o<r;o++)null!=s[o]&&(t[o].style.display=s[o]);return t}C.fn.extend({show:function(){return bt(this,!0)},hide:function(){return bt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){mt(this)?C(this).show():C(this).hide()})}});var Et,wt,Ct=/^(?:checkbox|radio)$/i,xt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,St=/^$|^module$|\/(?:java|ecma)script/i;Et=g.createDocumentFragment().appendChild(g.createElement("div")),(wt=g.createElement("input")).setAttribute("type","radio"),wt.setAttribute("checked","checked"),wt.setAttribute("name","t"),Et.appendChild(wt),p.checkClone=Et.cloneNode(!0).cloneNode(!0).lastChild.checked,Et.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!Et.cloneNode(!0).lastChild.defaultValue,Et.innerHTML="<option></option>",p.option=!!Et.lastChild;var Tt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function kt(t,e){var i;return i="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&S(t,e)?C.merge([t],i):i}function _t(t,e){for(var i=0,n=t.length;i<n;i++)st.set(t[i],"globalEval",!e||st.get(e[i],"globalEval"))}Tt.tbody=Tt.tfoot=Tt.colgroup=Tt.caption=Tt.thead,Tt.th=Tt.td,p.option||(Tt.optgroup=Tt.option=[1,"<select multiple='multiple'>","</select>"]);var Lt=/<|&#?\w+;/;function At(t,e,i,n,s){for(var o,r,l,a,c,h,d=e.createDocumentFragment(),u=[],p=0,f=t.length;p<f;p++)if((o=t[p])||0===o)if("object"===b(o))C.merge(u,o.nodeType?[o]:o);else if(Lt.test(o)){for(r=r||d.appendChild(e.createElement("div")),l=(xt.exec(o)||["",""])[1].toLowerCase(),a=Tt[l]||Tt._default,r.innerHTML=a[1]+C.htmlPrefilter(o)+a[2],h=a[0];h--;)r=r.lastChild;C.merge(u,r.childNodes),(r=d.firstChild).textContent=""}else u.push(e.createTextNode(o));for(d.textContent="",p=0;o=u[p++];)if(n&&C.inArray(o,n)>-1)s&&s.push(o);else if(c=pt(o),r=kt(d.appendChild(o),"script"),c&&_t(r),i)for(h=0;o=r[h++];)St.test(o.type||"")&&i.push(o);return d}var It=/^([^.]*)(?:\.(.+)|)/;function Ht(){return!0}function Dt(){return!1}function $t(t,e,i,n,s,o){var r,l;if("object"==typeof e){for(l in"string"!=typeof i&&(n=n||i,i=void 0),e)$t(t,l,i,n,e[l],o);return t}if(null==n&&null==s?(s=i,n=i=void 0):null==s&&("string"==typeof i?(s=n,n=void 0):(s=n,n=i,i=void 0)),!1===s)s=Dt;else if(!s)return t;return 1===o&&(r=s,s=function(t){return C().off(t),r.apply(this,arguments)},s.guid=r.guid||(r.guid=C.guid++)),t.each(function(){C.event.add(this,e,s,n,i)})}function qt(t,e,i){i?(st.set(t,e,!1),C.event.add(t,e,{namespace:!1,handler:function(t){var i,n=st.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(C.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=s.call(arguments),st.set(this,e,n),this[e](),i=st.get(this,e),st.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(st.set(this,e,C.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Ht)}})):void 0===st.get(t,e)&&C.event.add(t,e,Ht)}C.event={global:{},add:function(t,e,i,n,s){var o,r,l,a,c,h,d,u,p,f,m,g=st.get(t);if(it(t))for(i.handler&&(i=(o=i).handler,s=o.selector),s&&C.find.matchesSelector(ut,s),i.guid||(i.guid=C.guid++),(a=g.events)||(a=g.events=Object.create(null)),(r=g.handle)||(r=g.handle=function(e){return"undefined"!=typeof C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(B)||[""]).length;c--;)p=m=(l=It.exec(e[c])||[])[1],f=(l[2]||"").split(".").sort(),p&&(d=C.event.special[p]||{},p=(s?d.delegateType:d.bindType)||p,d=C.event.special[p]||{},h=C.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&C.expr.match.needsContext.test(s),namespace:f.join(".")},o),(u=a[p])||((u=a[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,n,f,r)||t.addEventListener&&t.addEventListener(p,r)),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),s?u.splice(u.delegateCount++,0,h):u.push(h),C.event.global[p]=!0)},remove:function(t,e,i,n,s){var o,r,l,a,c,h,d,u,p,f,m,g=st.hasData(t)&&st.get(t);if(g&&(a=g.events)){for(c=(e=(e||"").match(B)||[""]).length;c--;)if(p=m=(l=It.exec(e[c])||[])[1],f=(l[2]||"").split(".").sort(),p){for(d=C.event.special[p]||{},u=a[p=(n?d.delegateType:d.bindType)||p]||[],l=l[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=o=u.length;o--;)h=u[o],!s&&m!==h.origType||i&&i.guid!==h.guid||l&&!l.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(u.splice(o,1),h.selector&&u.delegateCount--,d.remove&&d.remove.call(t,h));r&&!u.length&&(d.teardown&&!1!==d.teardown.call(t,f,g.handle)||C.removeEvent(t,p,g.handle),delete a[p])}else for(p in a)C.event.remove(t,p+e[c],i,n,!0);C.isEmptyObject(a)&&st.remove(t,"handle events")}},dispatch:function(t){var e,i,n,s,o,r,l=new Array(arguments.length),a=C.event.fix(t),c=(st.get(this,"events")||Object.create(null))[a.type]||[],h=C.event.special[a.type]||{};for(l[0]=a,e=1;e<arguments.length;e++)l[e]=arguments[e];if(a.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,a)){for(r=C.event.handlers.call(this,a,c),e=0;(s=r[e++])&&!a.isPropagationStopped();)for(a.currentTarget=s.elem,i=0;(o=s.handlers[i++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!1!==o.namespace&&!a.rnamespace.test(o.namespace)||(a.handleObj=o,a.data=o.data,void 0!==(n=((C.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,l))&&!1===(a.result=n)&&(a.preventDefault(),a.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,a),a.result}},handlers:function(t,e){var i,n,s,o,r,l=[],a=e.delegateCount,c=t.target;if(a&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],r={},i=0;i<a;i++)void 0===r[s=(n=e[i]).selector+" "]&&(r[s]=n.needsContext?C(s,this).index(c)>-1:C.find(s,this,null,[c]).length),r[s]&&o.push(n);o.length&&l.push({elem:c,handlers:o})}return c=this,a<e.length&&l.push({elem:c,handlers:e.slice(a)}),l},addProp:function(t,e){Object.defineProperty(C.Event.prototype,t,{enumerable:!0,configurable:!0,get:f(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[C.expando]?t:new C.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return Ct.test(e.type)&&e.click&&S(e,"input")&&qt(e,"click",!0),!1},trigger:function(t){var e=this||t;return Ct.test(e.type)&&e.click&&S(e,"input")&&qt(e,"click"),!0},_default:function(t){var e=t.target;return Ct.test(e.type)&&e.click&&S(e,"input")&&st.get(e,"click")||S(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},C.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},C.Event=function(t,e){if(!(this instanceof C.Event))return new C.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Ht:Dt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&C.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[C.expando]=!0},C.Event.prototype={constructor:C.Event,isDefaultPrevented:Dt,isPropagationStopped:Dt,isImmediatePropagationStopped:Dt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Ht,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Ht,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Ht,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},C.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},C.event.addProp),C.each({focus:"focusin",blur:"focusout"},function(t,e){function i(t){if(g.documentMode){var i=st.get(this,"handle"),n=C.event.fix(t);n.type="focusin"===t.type?"focus":"blur",n.isSimulated=!0,i(t),n.target===n.currentTarget&&i(n)}else C.event.simulate(e,t.target,C.event.fix(t))}C.event.special[t]={setup:function(){var n;if(qt(this,t,!0),!g.documentMode)return!1;(n=st.get(this,e))||this.addEventListener(e,i),st.set(this,e,(n||0)+1)},trigger:function(){return qt(this,t),!0},teardown:function(){var t;if(!g.documentMode)return!1;(t=st.get(this,e)-1)?st.set(this,e,t):(this.removeEventListener(e,i),st.remove(this,e))},_default:function(e){return st.get(e.target,t)},delegateType:e},C.event.special[e]={setup:function(){var n=this.ownerDocument||this.document||this,s=g.documentMode?this:n,o=st.get(s,e);o||(g.documentMode?this.addEventListener(e,i):n.addEventListener(t,i,!0)),st.set(s,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,s=g.documentMode?this:n,o=st.get(s,e)-1;o?st.set(s,e,o):(g.documentMode?this.removeEventListener(e,i):n.removeEventListener(t,i,!0),st.remove(s,e))}}}),C.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){C.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=t.relatedTarget,s=t.handleObj;return n&&(n===this||C.contains(this,n))||(t.type=s.origType,i=s.handler.apply(this,arguments),t.type=e),i}}}),C.fn.extend({on:function(t,e,i,n){return $t(this,t,e,i,n)},one:function(t,e,i,n){return $t(this,t,e,i,n,1)},off:function(t,e,i){var n,s;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,C(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(s in t)this.off(s,e,t[s]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Dt),this.each(function(){C.event.remove(this,t,i,e)})}});var Mt=/<script|<style|<link/i,jt=/checked\s*(?:[^=]|=\s*.checked.)/i,Ot=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Nt(t,e){return S(t,"table")&&S(11!==e.nodeType?e:e.firstChild,"tr")&&C(t).children("tbody")[0]||t}function zt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Pt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ft(t,e){var i,n,s,o,r,l;if(1===e.nodeType){if(st.hasData(t)&&(l=st.get(t).events))for(s in st.remove(e,"handle events"),l)for(i=0,n=l[s].length;i<n;i++)C.event.add(e,s,l[s][i]);ot.hasData(t)&&(o=ot.access(t),r=C.extend({},o),ot.set(e,r))}}function Rt(t,e){var i=e.nodeName.toLowerCase();"input"===i&&Ct.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function Wt(t,e,i,n){e=o(e);var s,r,l,a,c,h,d=0,u=t.length,m=u-1,g=e[0],y=f(g);if(y||u>1&&"string"==typeof g&&!p.checkClone&&jt.test(g))return t.each(function(s){var o=t.eq(s);y&&(e[0]=g.call(this,s,o.html())),Wt(o,e,i,n)});if(u&&(r=(s=At(e,t[0].ownerDocument,!1,t,n)).firstChild,1===s.childNodes.length&&(s=r),r||n)){for(a=(l=C.map(kt(s,"script"),zt)).length;d<u;d++)c=s,d!==m&&(c=C.clone(c,!0,!0),a&&C.merge(l,kt(c,"script"))),i.call(t[d],c,d);if(a)for(h=l[l.length-1].ownerDocument,C.map(l,Pt),d=0;d<a;d++)c=l[d],St.test(c.type||"")&&!st.access(c,"globalEval")&&C.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?C._evalUrl&&!c.noModule&&C._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):v(c.textContent.replace(Ot,""),c,h))}return t}function Bt(t,e,i){for(var n,s=e?C.filter(e,t):t,o=0;null!=(n=s[o]);o++)i||1!==n.nodeType||C.cleanData(kt(n)),n.parentNode&&(i&&pt(n)&&_t(kt(n,"script")),n.parentNode.removeChild(n));return t}C.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var n,s,o,r,l=t.cloneNode(!0),a=pt(t);if(!(p.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||C.isXMLDoc(t)))for(r=kt(l),n=0,s=(o=kt(t)).length;n<s;n++)Rt(o[n],r[n]);if(e)if(i)for(o=o||kt(t),r=r||kt(l),n=0,s=o.length;n<s;n++)Ft(o[n],r[n]);else Ft(t,l);return(r=kt(l,"script")).length>0&&_t(r,!a&&kt(t,"script")),l},cleanData:function(t){for(var e,i,n,s=C.event.special,o=0;void 0!==(i=t[o]);o++)if(it(i)){if(e=i[st.expando]){if(e.events)for(n in e.events)s[n]?C.event.remove(i,n):C.removeEvent(i,n,e.handle);i[st.expando]=void 0}i[ot.expando]&&(i[ot.expando]=void 0)}}}),C.fn.extend({detach:function(t){return Bt(this,t,!0)},remove:function(t){return Bt(this,t)},text:function(t){return G(this,function(t){return void 0===t?C.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Wt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Nt(this,t).appendChild(t)})},prepend:function(){return Wt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Nt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Wt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Wt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(C.cleanData(kt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return C.clone(this,t,e)})},html:function(t){return G(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Mt.test(t)&&!Tt[(xt.exec(t)||["",""])[1].toLowerCase()]){t=C.htmlPrefilter(t);try{for(;i<n;i++)1===(e=this[i]||{}).nodeType&&(C.cleanData(kt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return Wt(this,arguments,function(e){var i=this.parentNode;C.inArray(this,t)<0&&(C.cleanData(kt(this)),i&&i.replaceChild(e,this))},t)}}),C.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){C.fn[t]=function(t){for(var i,n=[],s=C(t),o=s.length-1,l=0;l<=o;l++)i=l===o?this:this.clone(!0),C(s[l])[e](i),r.apply(n,i.get());return this.pushStack(n)}});var Ut=new RegExp("^("+ct+")(?!px)[a-z%]+$","i"),Qt=/^--/,Vt=function(e){var i=e.ownerDocument.defaultView;return i&&i.opener||(i=t),i.getComputedStyle(e)},Kt=function(t,e,i){var n,s,o={};for(s in e)o[s]=t.style[s],t.style[s]=e[s];for(s in n=i.call(t),e)t.style[s]=o[s];return n},Xt=new RegExp(dt.join("|"),"i");function Yt(t,e,i){var n,s,o,r,l=Qt.test(e),a=t.style;return(i=i||Vt(t))&&(r=i.getPropertyValue(e)||i[e],l&&r&&(r=r.replace(A,"$1")||void 0),""!==r||pt(t)||(r=C.style(t,e)),!p.pixelBoxStyles()&&Ut.test(r)&&Xt.test(e)&&(n=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=i.width,a.width=n,a.minWidth=s,a.maxWidth=o)),void 0!==r?r+"":r}function Gt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function e(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ut.appendChild(c).appendChild(h);var e=t.getComputedStyle(h);n="1%"!==e.top,a=12===i(e.marginLeft),h.style.right="60%",r=36===i(e.right),s=36===i(e.width),h.style.position="absolute",o=12===i(h.offsetWidth/3),ut.removeChild(c),h=null}}function i(t){return Math.round(parseFloat(t))}var n,s,o,r,l,a,c=g.createElement("div"),h=g.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===h.style.backgroundClip,C.extend(p,{boxSizingReliable:function(){return e(),s},pixelBoxStyles:function(){return e(),r},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,i,n,s;return null==l&&(e=g.createElement("table"),i=g.createElement("tr"),n=g.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",i.style.cssText="box-sizing:content-box;border:1px solid",i.style.height="1px",n.style.height="9px",n.style.display="block",ut.appendChild(e).appendChild(i).appendChild(n),s=t.getComputedStyle(i),l=parseInt(s.height,10)+parseInt(s.borderTopWidth,10)+parseInt(s.borderBottomWidth,10)===i.offsetHeight,ut.removeChild(e)),l}}))}();var Jt=["Webkit","Moz","ms"],Zt=g.createElement("div").style,te={};function ee(t){var e=C.cssProps[t]||te[t];return e||(t in Zt?t:te[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=Jt.length;i--;)if((t=Jt[i]+e)in Zt)return t}(t)||t)}var ie=/^(none|table(?!-c[ea]).+)/,ne={position:"absolute",visibility:"hidden",display:"block"},se={letterSpacing:"0",fontWeight:"400"};function oe(t,e,i){var n=ht.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function re(t,e,i,n,s,o){var r="width"===e?1:0,l=0,a=0,c=0;if(i===(n?"border":"content"))return 0;for(;r<4;r+=2)"margin"===i&&(c+=C.css(t,i+dt[r],!0,s)),n?("content"===i&&(a-=C.css(t,"padding"+dt[r],!0,s)),"margin"!==i&&(a-=C.css(t,"border"+dt[r]+"Width",!0,s))):(a+=C.css(t,"padding"+dt[r],!0,s),"padding"!==i?a+=C.css(t,"border"+dt[r]+"Width",!0,s):l+=C.css(t,"border"+dt[r]+"Width",!0,s));return!n&&o>=0&&(a+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-a-l-.5))||0),a+c}function le(t,e,i){var n=Vt(t),s=(!p.boxSizingReliable()||i)&&"border-box"===C.css(t,"boxSizing",!1,n),o=s,r=Yt(t,e,n),l="offset"+e[0].toUpperCase()+e.slice(1);if(Ut.test(r)){if(!i)return r;r="auto"}return(!p.boxSizingReliable()&&s||!p.reliableTrDimensions()&&S(t,"tr")||"auto"===r||!parseFloat(r)&&"inline"===C.css(t,"display",!1,n))&&t.getClientRects().length&&(s="border-box"===C.css(t,"boxSizing",!1,n),(o=l in t)&&(r=t[l])),(r=parseFloat(r)||0)+re(t,e,i||(s?"border":"content"),o,n,r)+"px"}function ae(t,e,i,n,s){return new ae.prototype.init(t,e,i,n,s)}C.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Yt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,o,r,l=et(e),a=Qt.test(e),c=t.style;if(a||(e=ee(l)),r=C.cssHooks[e]||C.cssHooks[l],void 0===i)return r&&"get"in r&&void 0!==(s=r.get(t,!1,n))?s:c[e];"string"===(o=typeof i)&&(s=ht.exec(i))&&s[1]&&(i=gt(t,e,s),o="number"),null!=i&&i==i&&("number"!==o||a||(i+=s&&s[3]||(C.cssNumber[l]?"":"px")),p.clearCloneStyle||""!==i||0!==e.indexOf("background")||(c[e]="inherit"),r&&"set"in r&&void 0===(i=r.set(t,i,n))||(a?c.setProperty(e,i):c[e]=i))}},css:function(t,e,i,n){var s,o,r,l=et(e);return Qt.test(e)||(e=ee(l)),(r=C.cssHooks[e]||C.cssHooks[l])&&"get"in r&&(s=r.get(t,!0,i)),void 0===s&&(s=Yt(t,e,n)),"normal"===s&&e in se&&(s=se[e]),""===i||i?(o=parseFloat(s),!0===i||isFinite(o)?o||0:s):s}}),C.each(["height","width"],function(t,e){C.cssHooks[e]={get:function(t,i,n){if(i)return!ie.test(C.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?le(t,e,n):Kt(t,ne,function(){return le(t,e,n)})},set:function(t,i,n){var s,o=Vt(t),r=!p.scrollboxSize()&&"absolute"===o.position,l=(r||n)&&"border-box"===C.css(t,"boxSizing",!1,o),a=n?re(t,e,n,l,o):0;return l&&r&&(a-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-re(t,e,"border",!1,o)-.5)),a&&(s=ht.exec(i))&&"px"!==(s[3]||"px")&&(t.style[e]=i,i=C.css(t,e)),oe(0,i,a)}}}),C.cssHooks.marginLeft=Gt(p.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Yt(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),C.each({margin:"",padding:"",border:"Width"},function(t,e){C.cssHooks[t+e]={expand:function(i){for(var n=0,s={},o="string"==typeof i?i.split(" "):[i];n<4;n++)s[t+dt[n]+e]=o[n]||o[n-2]||o[0];return s}},"margin"!==t&&(C.cssHooks[t+e].set=oe)}),C.fn.extend({css:function(t,e){return G(this,function(t,e,i){var n,s,o={},r=0;if(Array.isArray(e)){for(n=Vt(t),s=e.length;r<s;r++)o[e[r]]=C.css(t,e[r],!1,n);return o}return void 0!==i?C.style(t,e,i):C.css(t,e)},t,e,arguments.length>1)}}),C.Tween=ae,ae.prototype={constructor:ae,init:function(t,e,i,n,s,o){this.elem=t,this.prop=i,this.easing=s||C.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(C.cssNumber[i]?"":"px")},cur:function(){var t=ae.propHooks[this.prop];return t&&t.get?t.get(this):ae.propHooks._default.get(this)},run:function(t){var e,i=ae.propHooks[this.prop];return this.options.duration?this.pos=e=C.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ae.propHooks._default.set(this),this}},ae.prototype.init.prototype=ae.prototype,ae.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=C.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){C.fx.step[t.prop]?C.fx.step[t.prop](t):1!==t.elem.nodeType||!C.cssHooks[t.prop]&&null==t.elem.style[ee(t.prop)]?t.elem[t.prop]=t.now:C.style(t.elem,t.prop,t.now+t.unit)}}},ae.propHooks.scrollTop=ae.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},C.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},C.fx=ae.prototype.init,C.fx.step={};var ce,he,de=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function pe(){he&&(!1===g.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(pe):t.setTimeout(pe,C.fx.interval),C.fx.tick())}function fe(){return t.setTimeout(function(){ce=void 0}),ce=Date.now()}function me(t,e){var i,n=0,s={height:t};for(e=e?1:0;n<4;n+=2-e)s["margin"+(i=dt[n])]=s["padding"+i]=t;return e&&(s.opacity=s.width=t),s}function ge(t,e,i){for(var n,s=(ye.tweeners[e]||[]).concat(ye.tweeners["*"]),o=0,r=s.length;o<r;o++)if(n=s[o].call(i,e,t))return n}function ye(t,e,i){var n,s,o=0,r=ye.prefilters.length,l=C.Deferred().always(function(){delete a.elem}),a=function(){if(s)return!1;for(var e=ce||fe(),i=Math.max(0,c.startTime+c.duration-e),n=1-(i/c.duration||0),o=0,r=c.tweens.length;o<r;o++)c.tweens[o].run(n);return l.notifyWith(t,[c,n,i]),n<1&&r?i:(r||l.notifyWith(t,[c,1,0]),l.resolveWith(t,[c]),!1)},c=l.promise({elem:t,props:C.extend({},e),opts:C.extend(!0,{specialEasing:{},easing:C.easing._default},i),originalProperties:e,originalOptions:i,startTime:ce||fe(),duration:i.duration,tweens:[],createTween:function(e,i){var n=C.Tween(t,c.opts,e,i,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(n),n},stop:function(e){var i=0,n=e?c.tweens.length:0;if(s)return this;for(s=!0;i<n;i++)c.tweens[i].run(1);return e?(l.notifyWith(t,[c,1,0]),l.resolveWith(t,[c,e])):l.rejectWith(t,[c,e]),this}}),h=c.props;for(!function(t,e){var i,n,s,o,r;for(i in t)if(s=e[n=et(i)],o=t[i],Array.isArray(o)&&(s=o[1],o=t[i]=o[0]),i!==n&&(t[n]=o,delete t[i]),(r=C.cssHooks[n])&&"expand"in r)for(i in o=r.expand(o),delete t[n],o)i in t||(t[i]=o[i],e[i]=s);else e[n]=s}(h,c.opts.specialEasing);o<r;o++)if(n=ye.prefilters[o].call(c,t,h,c.opts))return f(n.stop)&&(C._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return C.map(h,ge,c),f(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),C.fx.timer(C.extend(a,{elem:t,anim:c,queue:c.opts.queue})),c}C.Animation=C.extend(ye,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return gt(i.elem,t,ht.exec(e),i),i}]},tweener:function(t,e){f(t)?(e=t,t=["*"]):t=t.match(B);for(var i,n=0,s=t.length;n<s;n++)i=t[n],ye.tweeners[i]=ye.tweeners[i]||[],ye.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var n,s,o,r,l,a,c,h,d="width"in e||"height"in e,u=this,p={},f=t.style,m=t.nodeType&&mt(t),g=st.get(t,"fxshow");for(n in i.queue||(null==(r=C._queueHooks(t,"fx")).unqueued&&(r.unqueued=0,l=r.empty.fire,r.empty.fire=function(){r.unqueued||l()}),r.unqueued++,u.always(function(){u.always(function(){r.unqueued--,C.queue(t,"fx").length||r.empty.fire()})})),e)if(s=e[n],de.test(s)){if(delete e[n],o=o||"toggle"===s,s===(m?"hide":"show")){if("show"!==s||!g||void 0===g[n])continue;m=!0}p[n]=g&&g[n]||C.style(t,n)}if((a=!C.isEmptyObject(e))||!C.isEmptyObject(p))for(n in d&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=g&&g.display)&&(c=st.get(t,"display")),"none"===(h=C.css(t,"display"))&&(c?h=c:(bt([t],!0),c=t.style.display||c,h=C.css(t,"display"),bt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===C.css(t,"float")&&(a||(u.done(function(){f.display=c}),null==c&&(h=f.display,c="none"===h?"":h)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",u.always(function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})),a=!1,p)a||(g?"hidden"in g&&(m=g.hidden):g=st.access(t,"fxshow",{display:c}),o&&(g.hidden=!m),m&&bt([t],!0),u.done(function(){for(n in m||bt([t]),st.remove(t,"fxshow"),p)C.style(t,n,p[n])})),a=ge(m?g[n]:0,n,u),n in g||(g[n]=a.start,m&&(a.end=a.start,a.start=0))}],prefilter:function(t,e){e?ye.prefilters.unshift(t):ye.prefilters.push(t)}}),C.speed=function(t,e,i){var n=t&&"object"==typeof t?C.extend({},t):{complete:i||!i&&e||f(t)&&t,duration:t,easing:i&&e||e&&!f(e)&&e};return C.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in C.fx.speeds?n.duration=C.fx.speeds[n.duration]:n.duration=C.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){f(n.old)&&n.old.call(this),n.queue&&C.dequeue(this,n.queue)},n},C.fn.extend({fadeTo:function(t,e,i,n){return this.filter(mt).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var s=C.isEmptyObject(t),o=C.speed(e,i,n),r=function(){var e=ye(this,C.extend({},t),o);(s||st.get(this,"finish"))&&e.stop(!0)};return r.finish=r,s||!1===o.queue?this.each(r):this.queue(o.queue,r)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,s=null!=t&&t+"queueHooks",o=C.timers,r=st.get(this);if(s)r[s]&&r[s].stop&&n(r[s]);else for(s in r)r[s]&&r[s].stop&&ue.test(s)&&n(r[s]);for(s=o.length;s--;)o[s].elem!==this||null!=t&&o[s].queue!==t||(o[s].anim.stop(i),e=!1,o.splice(s,1));!e&&i||C.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,i=st.get(this),n=i[t+"queue"],s=i[t+"queueHooks"],o=C.timers,r=n?n.length:0;for(i.finish=!0,C.queue(this,t,[]),s&&s.stop&&s.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<r;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish})}}),C.each(["toggle","show","hide"],function(t,e){var i=C.fn[e];C.fn[e]=function(t,n,s){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(me(e,!0),t,n,s)}}),C.each({slideDown:me("show"),slideUp:me("hide"),slideToggle:me("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){C.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),C.timers=[],C.fx.tick=function(){var t,e=0,i=C.timers;for(ce=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||C.fx.stop(),ce=void 0},C.fx.timer=function(t){C.timers.push(t),C.fx.start()},C.fx.interval=13,C.fx.start=function(){he||(he=!0,pe())},C.fx.stop=function(){he=null},C.fx.speeds={slow:600,fast:200,_default:400},C.fn.delay=function(e,i){return e=C.fx&&C.fx.speeds[e]||e,i=i||"fx",this.queue(i,function(i,n){var s=t.setTimeout(i,e);n.stop=function(){t.clearTimeout(s)}})},function(){var t=g.createElement("input"),e=g.createElement("select").appendChild(g.createElement("option"));t.type="checkbox",p.checkOn=""!==t.value,p.optSelected=e.selected,(t=g.createElement("input")).value="t",t.type="radio",p.radioValue="t"===t.value}();var ve,be=C.expr.attrHandle;C.fn.extend({attr:function(t,e){return G(this,C.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){C.removeAttr(this,t)})}}),C.extend({attr:function(t,e,i){var n,s,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?C.prop(t,e,i):(1===o&&C.isXMLDoc(t)||(s=C.attrHooks[e.toLowerCase()]||(C.expr.match.bool.test(e)?ve:void 0)),void 0!==i?null===i?void C.removeAttr(t,e):s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:(t.setAttribute(e,i+""),i):s&&"get"in s&&null!==(n=s.get(t,e))?n:null==(n=C.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&S(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,s=e&&e.match(B);if(s&&1===t.nodeType)for(;i=s[n++];)t.removeAttribute(i)}}),ve={set:function(t,e,i){return!1===e?C.removeAttr(t,i):t.setAttribute(i,i),i}},C.each(C.expr.match.bool.source.match(/\w+/g),function(t,e){var i=be[e]||C.find.attr;be[e]=function(t,e,n){var s,o,r=e.toLowerCase();return n||(o=be[r],be[r]=s,s=null!=i(t,e,n)?r:null,be[r]=o),s}});var Ee=/^(?:input|select|textarea|button)$/i,we=/^(?:a|area)$/i;function Ce(t){return(t.match(B)||[]).join(" ")}function xe(t){return t.getAttribute&&t.getAttribute("class")||""}function Se(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(B)||[]}C.fn.extend({prop:function(t,e){return G(this,C.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[C.propFix[t]||t]})}}),C.extend({prop:function(t,e,i){var n,s,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&C.isXMLDoc(t)||(e=C.propFix[e]||e,s=C.propHooks[e]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:t[e]=i:s&&"get"in s&&null!==(n=s.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=C.find.attr(t,"tabindex");return e?parseInt(e,10):Ee.test(t.nodeName)||we.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(C.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){C.propFix[this.toLowerCase()]=this}),C.fn.extend({addClass:function(t){var e,i,n,s,o,r;return f(t)?this.each(function(e){C(this).addClass(t.call(this,e,xe(this)))}):(e=Se(t)).length?this.each(function(){if(n=xe(this),i=1===this.nodeType&&" "+Ce(n)+" "){for(o=0;o<e.length;o++)s=e[o],i.indexOf(" "+s+" ")<0&&(i+=s+" ");r=Ce(i),n!==r&&this.setAttribute("class",r)}}):this},removeClass:function(t){var e,i,n,s,o,r;return f(t)?this.each(function(e){C(this).removeClass(t.call(this,e,xe(this)))}):arguments.length?(e=Se(t)).length?this.each(function(){if(n=xe(this),i=1===this.nodeType&&" "+Ce(n)+" "){for(o=0;o<e.length;o++)for(s=e[o];i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");r=Ce(i),n!==r&&this.setAttribute("class",r)}}):this:this.attr("class","")},toggleClass:function(t,e){var i,n,s,o,r=typeof t,l="string"===r||Array.isArray(t);return f(t)?this.each(function(i){C(this).toggleClass(t.call(this,i,xe(this),e),e)}):"boolean"==typeof e&&l?e?this.addClass(t):this.removeClass(t):(i=Se(t),this.each(function(){if(l)for(o=C(this),s=0;s<i.length;s++)n=i[s],o.hasClass(n)?o.removeClass(n):o.addClass(n);else void 0!==t&&"boolean"!==r||((n=xe(this))&&st.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===t?"":st.get(this,"__className__")||""))}))},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+Ce(xe(i))+" ").indexOf(e)>-1)return!0;return!1}});var Te=/\r/g;C.fn.extend({val:function(t){var e,i,n,s=this[0];return arguments.length?(n=f(t),this.each(function(i){var s;1===this.nodeType&&(null==(s=n?t.call(this,i,C(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=C.map(s,function(t){return null==t?"":t+""})),(e=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))})):s?(e=C.valHooks[s.type]||C.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(s,"value"))?i:"string"==typeof(i=s.value)?i.replace(Te,""):null==i?"":i:void 0}}),C.extend({valHooks:{option:{get:function(t){var e=C.find.attr(t,"value");return null!=e?e:Ce(C.text(t))}},select:{get:function(t){var e,i,n,s=t.options,o=t.selectedIndex,r="select-one"===t.type,l=r?null:[],a=r?o+1:s.length;for(n=o<0?a:r?o:0;n<a;n++)if(((i=s[n]).selected||n===o)&&!i.disabled&&(!i.parentNode.disabled||!S(i.parentNode,"optgroup"))){if(e=C(i).val(),r)return e;l.push(e)}return l},set:function(t,e){for(var i,n,s=t.options,o=C.makeArray(e),r=s.length;r--;)((n=s[r]).selected=C.inArray(C.valHooks.option.get(n),o)>-1)&&(i=!0);return i||(t.selectedIndex=-1),o}}}}),C.each(["radio","checkbox"],function(){C.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=C.inArray(C(t).val(),e)>-1}},p.checkOn||(C.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var ke=t.location,_e={guid:Date.now()},Le=/\?/;C.parseXML=function(e){var i,n;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return n=i&&i.getElementsByTagName("parsererror")[0],i&&!n||C.error("Invalid XML: "+(n?C.map(n.childNodes,function(t){return t.textContent}).join("\n"):e)),i};var Ae=/^(?:focusinfocus|focusoutblur)$/,Ie=function(t){t.stopPropagation()};C.extend(C.event,{trigger:function(e,i,n,s){var o,r,l,a,c,d,u,p,y=[n||g],v=h.call(e,"type")?e.type:e,b=h.call(e,"namespace")?e.namespace.split("."):[];if(r=p=l=n=n||g,3!==n.nodeType&&8!==n.nodeType&&!Ae.test(v+C.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[C.expando]?e:new C.Event(v,"object"==typeof e&&e)).isTrigger=s?2:3,e.namespace=b.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:C.makeArray(i,[e]),u=C.event.special[v]||{},s||!u.trigger||!1!==u.trigger.apply(n,i))){if(!s&&!u.noBubble&&!m(n)){for(a=u.delegateType||v,Ae.test(a+v)||(r=r.parentNode);r;r=r.parentNode)y.push(r),l=r;l===(n.ownerDocument||g)&&y.push(l.defaultView||l.parentWindow||t)}for(o=0;(r=y[o++])&&!e.isPropagationStopped();)p=r,e.type=o>1?a:u.bindType||v,(d=(st.get(r,"events")||Object.create(null))[e.type]&&st.get(r,"handle"))&&d.apply(r,i),(d=c&&r[c])&&d.apply&&it(r)&&(e.result=d.apply(r,i),!1===e.result&&e.preventDefault());return e.type=v,s||e.isDefaultPrevented()||u._default&&!1!==u._default.apply(y.pop(),i)||!it(n)||c&&f(n[v])&&!m(n)&&((l=n[c])&&(n[c]=null),C.event.triggered=v,e.isPropagationStopped()&&p.addEventListener(v,Ie),n[v](),e.isPropagationStopped()&&p.removeEventListener(v,Ie),C.event.triggered=void 0,l&&(n[c]=l)),e.result}},simulate:function(t,e,i){var n=C.extend(new C.Event,i,{type:t,isSimulated:!0});C.event.trigger(n,null,e)}}),C.fn.extend({trigger:function(t,e){return this.each(function(){C.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return C.event.trigger(t,e,i,!0)}});var He=/\[\]$/,De=/\r?\n/g,$e=/^(?:submit|button|image|reset|file)$/i,qe=/^(?:input|select|textarea|keygen)/i;function Me(t,e,i,n){var s;if(Array.isArray(e))C.each(e,function(e,s){i||He.test(t)?n(t,s):Me(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,i,n)});else if(i||"object"!==b(e))n(t,e);else for(s in e)Me(t+"["+s+"]",e[s],i,n)}C.param=function(t,e){var i,n=[],s=function(t,e){var i=f(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!C.isPlainObject(t))C.each(t,function(){s(this.name,this.value)});else for(i in t)Me(i,t[i],e,s);return n.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=C.prop(this,"elements");return t?C.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!C(this).is(":disabled")&&qe.test(this.nodeName)&&!$e.test(t)&&(this.checked||!Ct.test(t))}).map(function(t,e){var i=C(this).val();return null==i?null:Array.isArray(i)?C.map(i,function(t){return{name:e.name,value:t.replace(De,"\r\n")}}):{name:e.name,value:i.replace(De,"\r\n")}}).get()}});var je=/%20/g,Oe=/#.*$/,Ne=/([?&])_=[^&]*/,ze=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pe=/^(?:GET|HEAD)$/,Fe=/^\/\//,Re={},We={},Be="*/".concat("*"),Ue=g.createElement("a");function Qe(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,s=0,o=e.toLowerCase().match(B)||[];if(f(i))for(;n=o[s++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Ve(t,e,i,n){var s={},o=t===We;function r(l){var a;return s[l]=!0,C.each(t[l]||[],function(t,l){var c=l(e,i,n);return"string"!=typeof c||o||s[c]?o?!(a=c):void 0:(e.dataTypes.unshift(c),r(c),!1)}),a}return r(e.dataTypes[0])||!s["*"]&&r("*")}function Ke(t,e){var i,n,s=C.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((s[i]?t:n||(n={}))[i]=e[i]);return n&&C.extend(!0,t,n),t}Ue.href=ke.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Be,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ke(Ke(t,C.ajaxSettings),e):Ke(C.ajaxSettings,t)},ajaxPrefilter:Qe(Re),ajaxTransport:Qe(We),ajax:function(e,i){"object"==typeof e&&(i=e,e=void 0),i=i||{};var n,s,o,r,l,a,c,h,d,u,p=C.ajaxSetup({},i),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?C(f):C.event,y=C.Deferred(),v=C.Callbacks("once memory"),b=p.statusCode||{},E={},w={},x="canceled",S={readyState:0,getResponseHeader:function(t){var e;if(c){if(!r)for(r={};e=ze.exec(o);)r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=r[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,E[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)S.always(t[S.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),T(0,e),this}};if(y.promise(S),p.url=((e||p.url||ke.href)+"").replace(Fe,ke.protocol+"//"),p.type=i.method||i.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(B)||[""],null==p.crossDomain){a=g.createElement("a");try{a.href=p.url,a.href=a.href,p.crossDomain=Ue.protocol+"//"+Ue.host!=a.protocol+"//"+a.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=C.param(p.data,p.traditional)),Ve(Re,p,i,S),c)return S;for(d in(h=C.event&&p.global)&&0===C.active++&&C.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pe.test(p.type),s=p.url.replace(Oe,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(je,"+")):(u=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(Le.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace(Ne,"$1"),u=(Le.test(s)?"&":"?")+"_="+_e.guid+++u),p.url=s+u),p.ifModified&&(C.lastModified[s]&&S.setRequestHeader("If-Modified-Since",C.lastModified[s]),C.etag[s]&&S.setRequestHeader("If-None-Match",C.etag[s])),(p.data&&p.hasContent&&!1!==p.contentType||i.contentType)&&S.setRequestHeader("Content-Type",p.contentType),S.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Be+"; q=0.01":""):p.accepts["*"]),p.headers)S.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(f,S,p)||c))return S.abort();if(x="abort",v.add(p.complete),S.done(p.success),S.fail(p.error),n=Ve(We,p,i,S)){if(S.readyState=1,h&&m.trigger("ajaxSend",[S,p]),c)return S;p.async&&p.timeout>0&&(l=t.setTimeout(function(){S.abort("timeout")},p.timeout));try{c=!1,n.send(E,T)}catch(t){if(c)throw t;T(-1,t)}}else T(-1,"No Transport");function T(e,i,r,a){var d,u,g,E,w,x=i;c||(c=!0,l&&t.clearTimeout(l),n=void 0,o=a||"",S.readyState=e>0?4:0,d=e>=200&&e<300||304===e,r&&(E=function(t,e,i){for(var n,s,o,r,l=t.contents,a=t.dataTypes;"*"===a[0];)a.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(s in l)if(l[s]&&l[s].test(n)){a.unshift(s);break}if(a[0]in i)o=a[0];else{for(s in i){if(!a[0]||t.converters[s+" "+a[0]]){o=s;break}r||(r=s)}o=o||r}if(o)return o!==a[0]&&a.unshift(o),i[o]}(p,S,r)),!d&&C.inArray("script",p.dataTypes)>-1&&C.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),E=function(t,e,i,n){var s,o,r,l,a,c={},h=t.dataTypes.slice();if(h[1])for(r in t.converters)c[r.toLowerCase()]=t.converters[r];for(o=h.shift();o;)if(t.responseFields[o]&&(i[t.responseFields[o]]=e),!a&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),a=o,o=h.shift())if("*"===o)o=a;else if("*"!==a&&a!==o){if(!(r=c[a+" "+o]||c["* "+o]))for(s in c)if((l=s.split(" "))[1]===o&&(r=c[a+" "+l[0]]||c["* "+l[0]])){!0===r?r=c[s]:!0!==c[s]&&(o=l[0],h.unshift(l[1]));break}if(!0!==r)if(r&&t.throws)e=r(e);else try{e=r(e)}catch(t){return{state:"parsererror",error:r?t:"No conversion from "+a+" to "+o}}}return{state:"success",data:e}}(p,E,S,d),d?(p.ifModified&&((w=S.getResponseHeader("Last-Modified"))&&(C.lastModified[s]=w),(w=S.getResponseHeader("etag"))&&(C.etag[s]=w)),204===e||"HEAD"===p.type?x="nocontent":304===e?x="notmodified":(x=E.state,u=E.data,d=!(g=E.error))):(g=x,!e&&x||(x="error",e<0&&(e=0))),S.status=e,S.statusText=(i||x)+"",d?y.resolveWith(f,[u,x,S]):y.rejectWith(f,[S,x,g]),S.statusCode(b),b=void 0,h&&m.trigger(d?"ajaxSuccess":"ajaxError",[S,p,d?u:g]),v.fireWith(f,[S,x]),h&&(m.trigger("ajaxComplete",[S,p]),--C.active||C.event.trigger("ajaxStop")))}return S},getJSON:function(t,e,i){return C.get(t,e,i,"json")},getScript:function(t,e){return C.get(t,void 0,e,"script")}}),C.each(["get","post"],function(t,e){C[e]=function(t,i,n,s){return f(i)&&(s=s||n,n=i,i=void 0),C.ajax(C.extend({url:t,type:e,dataType:s,data:i,success:n},C.isPlainObject(t)&&t))}}),C.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),C._evalUrl=function(t,e,i){return C.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){C.globalEval(t,e,i)}})},C.fn.extend({wrapAll:function(t){var e;return this[0]&&(f(t)&&(t=t.call(this[0])),e=C(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return f(t)?this.each(function(e){C(this).wrapInner(t.call(this,e))}):this.each(function(){var e=C(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=f(t);return this.each(function(i){C(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){C(this).replaceWith(this.childNodes)}),this}}),C.expr.pseudos.hidden=function(t){return!C.expr.pseudos.visible(t)},C.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},C.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Xe={0:200,1223:204},Ye=C.ajaxSettings.xhr();p.cors=!!Ye&&"withCredentials"in Ye,p.ajax=Ye=!!Ye,C.ajaxTransport(function(e){var i,n;if(p.cors||Ye&&!e.crossDomain)return{send:function(s,o){var r,l=e.xhr();if(l.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)l[r]=e.xhrFields[r];for(r in e.mimeType&&l.overrideMimeType&&l.overrideMimeType(e.mimeType),e.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)l.setRequestHeader(r,s[r]);i=function(t){return function(){i&&(i=n=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===t?l.abort():"error"===t?"number"!=typeof l.status?o(0,"error"):o(l.status,l.statusText):o(Xe[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=i(),n=l.onerror=l.ontimeout=i("error"),void 0!==l.onabort?l.onabort=n:l.onreadystatechange=function(){4===l.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{l.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),C.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),C.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return C.globalEval(t),t}}}),C.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),C.ajaxTransport("script",function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,s){e=C("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&s("error"===t.type?404:200,t.type)}),g.head.appendChild(e[0])},abort:function(){i&&i()}}});var Ge,Je=[],Ze=/(=)\?(?=&|$)|\?\?/;C.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Je.pop()||C.expando+"_"+_e.guid++;return this[t]=!0,t}}),C.ajaxPrefilter("json jsonp",function(e,i,n){var s,o,r,l=!1!==e.jsonp&&(Ze.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ze.test(e.data)&&"data");if(l||"jsonp"===e.dataTypes[0])return s=e.jsonpCallback=f(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,l?e[l]=e[l].replace(Ze,"$1"+s):!1!==e.jsonp&&(e.url+=(Le.test(e.url)?"&":"?")+e.jsonp+"="+s),e.converters["script json"]=function(){return r||C.error(s+" was not called"),r[0]},e.dataTypes[0]="json",o=t[s],t[s]=function(){r=arguments},n.always(function(){void 0===o?C(t).removeProp(s):t[s]=o,e[s]&&(e.jsonpCallback=i.jsonpCallback,Je.push(s)),r&&f(o)&&o(r[0]),r=o=void 0}),"script"}),p.createHTMLDocument=((Ge=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ge.childNodes.length),C.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(p.createHTMLDocument?((n=(e=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,e.head.appendChild(n)):e=g),o=!i&&[],(s=O.exec(t))?[e.createElement(s[1])]:(s=At([t],e,o),o&&o.length&&C(o).remove(),C.merge([],s.childNodes)));var n,s,o},C.fn.load=function(t,e,i){var n,s,o,r=this,l=t.indexOf(" ");return l>-1&&(n=Ce(t.slice(l)),t=t.slice(0,l)),f(e)?(i=e,e=void 0):e&&"object"==typeof e&&(s="POST"),r.length>0&&C.ajax({url:t,type:s||"GET",dataType:"html",data:e}).done(function(t){o=arguments,r.html(n?C("<div>").append(C.parseHTML(t)).find(n):t)}).always(i&&function(t,e){r.each(function(){i.apply(this,o||[t.responseText,e,t])})}),this},C.expr.pseudos.animated=function(t){return C.grep(C.timers,function(e){return t===e.elem}).length},C.offset={setOffset:function(t,e,i){var n,s,o,r,l,a,c=C.css(t,"position"),h=C(t),d={};"static"===c&&(t.style.position="relative"),l=h.offset(),o=C.css(t,"top"),a=C.css(t,"left"),("absolute"===c||"fixed"===c)&&(o+a).indexOf("auto")>-1?(r=(n=h.position()).top,s=n.left):(r=parseFloat(o)||0,s=parseFloat(a)||0),f(e)&&(e=e.call(t,i,C.extend({},l))),null!=e.top&&(d.top=e.top-l.top+r),null!=e.left&&(d.left=e.left-l.left+s),"using"in e?e.using.call(t,d):h.css(d)}},C.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){C.offset.setOffset(this,t,e)});var e,i,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,n=this[0],s={top:0,left:0};if("fixed"===C.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===C.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((s=C(t).offset()).top+=C.css(t,"borderTopWidth",!0),s.left+=C.css(t,"borderLeftWidth",!0))}return{top:e.top-s.top-C.css(n,"marginTop",!0),left:e.left-s.left-C.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===C.css(t,"position");)t=t.offsetParent;return t||ut})}}),C.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;C.fn[t]=function(n){return G(this,function(t,n,s){var o;if(m(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===s)return o?o[e]:t[n];o?o.scrollTo(i?o.pageXOffset:s,i?s:o.pageYOffset):t[n]=s},t,n,arguments.length)}}),C.each(["top","left"],function(t,e){C.cssHooks[e]=Gt(p.pixelPosition,function(t,i){if(i)return i=Yt(t,e),Ut.test(i)?C(t).position()[e]+"px":i})}),C.each({Height:"height",Width:"width"},function(t,e){C.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){C.fn[n]=function(s,o){var r=arguments.length&&(i||"boolean"!=typeof s),l=i||(!0===s||!0===o?"margin":"border");return G(this,function(e,i,s){var o;return m(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===s?C.css(e,i,l):C.style(e,i,s,l)},e,r?s:void 0,r)}})}),C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){C.fn[e]=function(t){return this.on(e,t)}}),C.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),C.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){C.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}});var ti=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;C.proxy=function(t,e){var i,n,o;if("string"==typeof e&&(i=t[e],e=t,t=i),f(t))return n=s.call(arguments,2),o=function(){return t.apply(e||this,n.concat(s.call(arguments)))},o.guid=t.guid=t.guid||C.guid++,o},C.holdReady=function(t){t?C.readyWait++:C.ready(!0)},C.isArray=Array.isArray,C.parseJSON=JSON.parse,C.nodeName=S,C.isFunction=f,C.isWindow=m,C.camelCase=et,C.type=b,C.now=Date.now,C.isNumeric=function(t){var e=C.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},C.trim=function(t){return null==t?"":(t+"").replace(ti,"$1")};var ei=t.jQuery,ii=t.$;return C.noConflict=function(e){return t.$===C&&(t.$=ii),e&&t.jQuery===C&&(t.jQuery=ei),C},"undefined"==typeof e&&(t.jQuery=t.$=C),C})}(i);const n=e(i.exports),s=new WeakMap;class o{static instances=[];static initializeElement(t,e={}){const i="string"==typeof t?document.querySelector(t):t;if(!i)return!1;const n=`plugin_${this.NAME}`;let o=s.has(i)&&s.get(i)[n];if(!o&&"undefined"!=typeof $&&$.fn&&(o=$(i).data(n)),!o){const t=new this(i,e);return s.has(i)||s.set(i,{}),s.get(i)[n]=t,"undefined"!=typeof $&&$.fn&&$(i).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 e=`plugin_${this.NAME}`,i=s.get(t);if(i&&i[e])return i[e];if("undefined"!=typeof $&&$.fn&&$(t).data(e)){const i=$(t).data(e);return s.has(t)||s.set(t,{}),s.get(t)[e]=i,i}return null}static removeInstance(t){const e=`plugin_${this.NAME}`,i=s.get(t);i&&(delete i[e],0===Object.keys(i).length&&s.delete(t)),"undefined"!=typeof $&&$.fn&&$(t).removeData(e)}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 r=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()}},l=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())})}},a=function(t,e,i){let n;return function(){let i=this,s=arguments;clearTimeout(n),n=setTimeout(function(){n=null,t.apply(i,s)},e)}},c=function(){let t=!1;return("ontouchstart"in window||navigator.maxTouchPoints>0)&&(t=!0),t},h=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)})},d=function(t,e){const i=t&&t.jquery?t[0]:t;return i?new Promise(t=>{const n=["animation",e];i.classList.add(...n),i.addEventListener("animationend",function e(s){s.stopPropagation(),i.classList.remove(...n),i.removeEventListener("animationend",e),t()},{once:!0})}):Promise.resolve()},u=t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"}[t]),p=t=>{if("string"!=typeof t){if(null===t)return"";if(!t)return String(t);t=String(t)}return/[&<>"'`=]/.test(t)?t.replace(/[&<>"'`=]/g,u):t};function f(t,...e){for(const i of e)if(i&&"object"==typeof i)for(const e of Object.keys(i)){const n=i[e],s=t[e];n&&"object"==typeof n&&!Array.isArray(n)&&s&&"object"==typeof s&&!Array.isArray(s)?t[e]=f({},s,n):t[e]=n}return t}class m extends o{static NAME="coolSection";static DEFAULTS={observeSections:!0,initFormControls:!0,initTableHandlers:!0,initButtonGroups:!0,initTabs:!0,onInit:null,onDestroy:null};constructor(t){super(),this.opts=f({},m.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,n){t.addEventListener(e,i,n),this._eventHandlers.push({element:t,event:e,handler:i,options:n})}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(" "):[],n=Array.from(e.classList);return[...n.filter(t=>!i.includes(t)),...i.filter(t=>!n.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,n=this.getVisibleElements(i.querySelectorAll("tr"));n.length&&t.tables.push({tbody:i,lastVisibleRow:n[n.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"),n=e.dataset.tableLink;if(i?.classList.contains("bulk-actions-active"))return;t.ctrlKey||t.metaKey?window.open(n,"_blank"):window.location.href=n}if(t.target.closest("[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select"))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:n})=>{t.removeEventListener(e,i,n)}),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 g=null;try{g=require("perfect-scrollbar"),g&&g.default&&(g=g.default)}catch(t){}"undefined"!=typeof window&&g&&!window.PerfectScrollbar&&(window.PerfectScrollbar=g);class y extends o{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_${y.NAME}`);i||(i=new y(this,"object"==typeof t&&t),e.data(`plugin_${y.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[y.NAME];$.fn[y.NAME]=y._jQueryInterface,$.fn[y.NAME].Constructor=y,$.fn[y.NAME].defaults=y.DEFAULTS||{},$.fn[y.NAME].noConflict=()=>($.fn[y.NAME]=t,y._jQueryInterface)}constructor(t,e){super(),this.opts=f({},y.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&&(g?this.scrollbar=new g(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(g){const i=new g(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 n=t.querySelector(".tab-content");if(n)if(t===i[0])n.style.transform="translate3d(100%, 0px, 0px)";else if(t===i[i.length-1])n.style.transform="translate3d(-100%, 0px, 0px)";else{const s=i.indexOf(t)<i.indexOf(e);n.style.transform=`translate3d(${s?"-100%":"100%"}, 0px, 0px)`}}});const n=e.querySelector(".tab-content");n&&(n.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")}}y._jQueryInit();class v extends o{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_${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=f({},v.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-"+h(),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()})},r.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&&(r.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,n=this.popoverEl.offsetWidth,s=this.popoverEl.offsetHeight,o=this.el.offsetWidth,r=this.el.offsetHeight;let l,a;const c=this.containerEl.getBoundingClientRect(),h=c.left+window.scrollX,d=c.top+window.scrollY,u=this.el.getBoundingClientRect(),p=u.left+window.scrollX,f=u.top+window.scrollY;l=p-h,a=f-d;let m=0,g=0,y=0,v=0;if(this.offset){const t=this.offset.split(",");y=parseInt(t[0],10)||0,v=parseInt(t[1],10)||0}const b=getComputedStyle(this.popoverEl),E=parseInt(b.getPropertyValue("--cool-popover-spacer"))||8,w=(t,e=this.align)=>{let i=0,c=0;switch(t){case"top":i="end"===e?l+o-n:"center"===e?l+(o-n)/2:l,c=a-s-E;break;case"bottom":i="end"===e?l+o-n:"center"===e?l+(o-n)/2:l,c=a+r+E;break;case"left":i=l-n-E,c="end"===e?a+r-s:"center"===e?a+(r-s)/2:a;break;case"right":i=l+o+E,c="end"===e?a+r-s:"center"===e?a+(r-s)/2:a}return{x:i+y,y:c+v}};let C=t,x=this.align,S=w(t);if(this.collisionDetection){const o=5,r=t=>{const r={top:!1,bottom:!1,left:!1,right:!1},l=h+t.x,a=d+t.y,c=l+n,u=a+s;return r.top=a<o,r.bottom=u>i-o,r.left=l<o,r.right=c>e-o,r},l=r(S);"bottom"===t&&l.bottom&&!l.top?(C="top",S=w("top",x)):"top"===t&&l.top&&!l.bottom?(C="bottom",S=w("bottom",x)):"right"===t&&l.right&&!l.left?(C="left",S=w("left",x)):"left"===t&&l.left&&!l.right&&(C="right",S=w("right",x));const a=r(S);"top"!==C&&"bottom"!==C||("end"===x&&a.left&&!a.right?(x="start",S=w(C,x)):"start"===x&&a.right&&!a.left&&(x="end",S=w(C,x)));const c=r(S);c.left?S.x+=o-(h+S.x):c.right&&(S.x-=h+S.x+n-(e-o)),c.top?S.y+=o-(d+S.y):c.bottom&&(S.y-=d+S.y+s-(i-o))}m=S.x,g=S.y,Object.assign(this.popoverEl.style,{transform:`translate3d(${Math.round(m)}px, ${Math.round(g)}px, 0px)`,willChange:"transform"}),this.popoverEl.setAttribute("x-placement",C+"-"+x)}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())}}v._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 E=new WeakMap;function w(t){if(!t)return 0;const e=getComputedStyle(t);return t.offsetHeight+parseInt(e.marginTop,10)+parseInt(e.marginBottom,10)}class C extends o{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_${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=f({},C.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">${p(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-=w(this.searchContainerEl)||0),this.showFooter&&this.footerContainerEl&&(t-=w(this.footerContainerEl)||0);const e=(parseInt(getComputedStyle(this.scrollableContentEl).marginTop,10)||0)+(parseInt(getComputedStyle(this.scrollableContentEl).marginBottom,10)||0),i=this.scrollableContentEl.scrollHeight,n=Math.min(i,t+e);this.scrollableContentEl.style.maxHeight=n+"px",c()?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,n=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},n)},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},n)}else"function"!=typeof this.confirmUncheck||e.checked?e.checked||this.preventUncheck?!e.checked&&this.preventUncheck&&(e.checked=!0,setTimeout(()=>{this.preventClose=!1},n)):(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},n)):(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},n)},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=p(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=a(()=>{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"})})},r.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&&(l.remove(`select-${this.name}`),this._scrollCallback=null),this._resizeCallback&&(r.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(n=>{t+=encodeURIComponent("#"+n),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 n=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=n.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=n.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,n=i?i.parentElement.querySelector("[data-label]"):null,s=n?n.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">${p(s)}</span>`,o.addEventListener("click",i=>{i.stopPropagation();const n=this.selectEl.querySelector(`input[value="${e}"]`);n?(n.checked=!1,n.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=w(this.selectHeaderEl),i=this.scrollContentHeight,n=window.innerHeight,s=window.scrollY;let o=i,r=0,l=0;if(this.searchContainerEl&&(r=w(this.searchContainerEl)||0),this.footerContainerEl&&(l=w(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;o=Math.min(Math.max(t,e)+r+l,i)}let a=this.el.classList.contains("select-dropup"),c=0,h=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=n-t-e-50,s=t-50;a?(h=Math.min(o,s),c=t-h-d):(h=Math.min(o,i),c=t+e+u)}else{const t=this.containerEl.getBoundingClientRect().top+s,i=n-(t-s)-e-50,r=t-s-50;a?(h=Math.min(o,r),c=-h-d):(h=Math.min(o,i),c=e+u)}const p=h-r-l;t.style.height=h+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=p+"px"),t.style.top=c+"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 n=1,s=this.opts.faPro?"fal":"fas";i.length&&(n=parseInt(getComputedStyle(i[0]).zIndex,10)+2),this.el.classList.add("show"),i.length||(n=parseInt(getComputedStyle(this.el).zIndex,10)+1);const o=this.el.querySelector(".select-content"),r=w(this.selectHeaderEl),a=this.scrollContentHeight,c=window.innerHeight,h=window.scrollY;let d=a,u=0,p=0;if(this.searchContainerEl&&(u=w(this.searchContainerEl)||0),this.footerContainerEl&&(p=w(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;d=Math.min(Math.max(t,e)+u+p,a)}let f=!1,m=0,g=d;const y=parseInt(getComputedStyle(o).marginBottom||0,10),v=parseInt(getComputedStyle(o).marginTop||0,10);if("fixed"===this.position){const e=c-t-r-50,i=t-50;f=e<d&&i>e,f?(g=Math.min(d,i),m=t-g-y):(g=Math.min(d,e),m=t+r+v)}else{const t=this.containerEl.getBoundingClientRect().top+h,e=c-(t-h)-r-50,i=t-h-50;f=e<d&&i>e,f?(g=Math.min(d,i),m=-g-y):(g=Math.min(d,e),m=r+v)}const b=g-u-p;o.style.height=g+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=b+"px"),this.el.classList.toggle("select-dropup",f),this.el.classList.toggle("select-dropdown",!f);const E=o.offsetWidth;Object.assign(o.style,{zIndex:n,position:"fixed"===this.position?"fixed":"absolute"});const C=this.containerEl.offsetWidth;"fixed"===this.position?Object.assign(o.style,{top:m+"px",left:e+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:C+"px"}):Object.assign(o.style,{top:m+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:E>C?"var(--cool-select-content-width, auto)":C+"px"}),o.style.minWidth=C+"px",this.scrollableContentEl&&this.scrollableContentEl.offsetHeight<this.scrollableContentEl.scrollHeight&&(this.scrollableContentEl.scrollTop=1,this.scrollableContentEl.scrollTop=0),f?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${s} fa-angle-down icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${s} 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&&l.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&&l.remove(`select-${this.name}`),this.onClose()}}onSelect(t){const e=t.closest(".select-item"),i=e&&E.get(e)||{},n=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()===n.toString())){const e=t.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:n,label:e?e.textContent:n})}}else-1===this.data[this.name].indexOf(n)&&this.data[this.name].push(n);else this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==n.toString()),this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==n.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==n.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=[],n=this.data[this.name];return Array.isArray(n)?e=n:e.push(n),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 n=0;n<t.length;++n){const s=t[n];let o="";"function"==typeof this.labelTemplate?o=this.labelTemplate(s):s.name?o=s.name:s.label?o=s.label:s.value&&(o=s.value);const r=this.useChips?s[this.primaryKeyword]:s.id,l=e.indexOf(r.toString())>-1,a=document.createElement("div");a.innerHTML=this._getItemTemplate(s,n,o,l).trim();const c=a.firstElementChild;E.set(c,s),i.push(c)}return i}_getItemTemplate(t,e,i,n){return`\n <div class="select-item">\n <div class="select-item-${this.type}">\n <div class="form-check">\n <input type="${this.type}"\n id="select-${this.name}-${t.id}"\n value="${t.id}"\n tabindex="-1"\n ${n?"checked":""}>\n <label for="select-${this.name}-${t.id}">\n <span class="form-check-icon">\n <svg viewBox="0 0 18 18">\n <polyline points="1.5 6 4.5 9 10.5 1"></polyline>\n </svg>\n </span>\n <span class="form-check-label"${"function"!=typeof this.labelTemplate?" data-label":""}>\n ${"function"!=typeof this.labelTemplate?p(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&&E.get(e)||{};"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,!1)})}}C._jQueryInit();let x=null;try{x=require("perfect-scrollbar"),x&&x.default&&(x=x.default)}catch(t){}"undefined"!=typeof window&&x&&!window.PerfectScrollbar&&(window.PerfectScrollbar=x);class S extends o{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_${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=f({},S.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()}))},r.observe(this.el,this._resizeCallback),r.observe(document.body,this._resizeCallback),this.containerEl&&r.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()}))},l.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-"+h(),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&&!S.getInstance(e)&&new S(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",c()?this.scrollableContentEl.style.overflowY="auto":x?this.scroll=new x(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&&(r.unobserve(this.el),r.unobserve(document.body),this.containerEl&&r.unobserve(this.containerEl),this._resizeCallback=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._scrollCallback&&(l.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,n=window.innerHeight,s=!this.dropdownEl.classList.contains("show")&&0===this.dropdownEl.offsetWidth;s&&(this.dropdownEl.style.display="block",this.dropdownEl.style.visibility="hidden");let o,r,l=this.dropdownEl.offsetWidth,a=this.dropdownEl.offsetHeight,c=this.el.offsetWidth,h=this.el.offsetHeight;if("fixed"===this.position)o=e.left+window.scrollX,r=e.top+window.scrollY;else{const t=this.dropdownEl.offsetParent||document.body,i=t.getBoundingClientRect();o=e.left-i.left+t.scrollLeft,r=e.top-i.top+t.scrollTop}let d=0,u=0,p=0,f=0;if(this.offset){const t=this.offset.split(",");p=parseInt(t[0],10)||0,f=parseInt(t[1],10)||0}const m=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cool-dropdown-spacer"))||2,g=(t,e=this.align)=>{let i=0,n=0;switch(t){case"top":i="end"===e?o+c-l:o,n=r-a-m;break;case"bottom":i="end"===e?o+c-l:o,n=r+h+m;break;case"left":i=o-l-m,n=r;break;case"right":i=o+c+m,n=r}return{x:i+p,y:n+f}};let y=t,v=this.align,b=g(t);if(this.positionObserver){const s=5,c=t=>{const c={top:!1,bottom:!1,left:!1,right:!1};if("fixed"===this.position)c.top=t.y<s,c.bottom=t.y+a>n-s,c.left=t.x<s,c.right=t.x+l>i-s;else{const h=e.left+(t.x-o),d=e.top+(t.y-r),u=h+l,p=d+a;c.top=d<s,c.bottom=p>n-s,c.left=h<s,c.right=u>i-s}return c},h=c(b);"bottom"===t&&h.bottom&&!h.top?(y="top",b=g("top",v)):"top"===t&&h.top&&!h.bottom?(y="bottom",b=g("bottom",v)):"right"===t&&h.right&&!h.left?(y="left",b=g("left",v)):"left"===t&&h.left&&!h.right&&(y="right",b=g("right",v));const d=c(b);if("top"!==y&&"bottom"!==y||("end"===v&&d.left&&!d.right?(v="start",b=g(y,v)):"start"===v&&d.right&&!d.left&&(v="end",b=g(y,v))),this.containerEl.classList.remove("dropup","dropbottom","dropleft","dropright"),"top"===y?this.containerEl.classList.add("dropup"):"left"===y?this.containerEl.classList.add("dropleft"):"right"===y?this.containerEl.classList.add("dropright"):this.containerEl.classList.add("dropbottom"),this.dropdownEl.setAttribute("x-placement",y+"-"+v),"fixed"===this.position)b.x=Math.max(s,Math.min(b.x,i-l-s)),b.y=Math.max(s,Math.min(b.y,n-a-s));else{const t=e.left+(b.x-o),c=e.top+(b.y-r);t<s?b.x+=s-t:t+l>i-s&&(b.x-=t+l-i+s),c<s?b.y+=s-c:c+a>n-s&&(b.y-=c+a-n+s)}}if(d=b.x,u=b.y,s&&(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 n=e.left-i.left,s=e.top-i.top;switch(y){case"bottom":s+=h+m,"end"===v&&(n=n+c-l);break;case"top":s-=a+m,"end"===v&&(n=n+c-l);break;case"left":n-=l+m;break;case"right":n+=c+m}n+=p,s+=f,Object.assign(this.dropdownEl.style,{position:"absolute",top:Math.round(s)+"px",left:Math.round(n)+"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),d(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")?d(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)}}S._jQueryInit();class T extends o{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_${T.NAME}`);i||(i=new T(this,"object"==typeof t&&t),e.data(`plugin_${T.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[T.NAME];$.fn[T.NAME]=T._jQueryInterface,$.fn[T.NAME].Constructor=T,$.fn[T.NAME].defaults=T.DEFAULTS||{},$.fn[T.NAME].noConflict=()=>($.fn[T.NAME]=t,T._jQueryInterface)}constructor(t,e){super(),this.opts=f({},T.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-"+h(),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()})},r.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&&(r.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,n=this.tooltipEl.offsetWidth,s=this.tooltipEl.offsetHeight,o=this.el.getBoundingClientRect(),r=this.el.offsetWidth,l=this.el.offsetHeight,a=o.left+window.scrollX,c=o.top+window.scrollY,h=this.arrowEl.offsetWidth,d=this.arrowEl.offsetHeight;let u,p,f;"top"===t?(p=Math.round(a-(n-r)/2),f=Math.round(c-s),u=Math.round(n/2-h/2),this.arrowEl.style.left=u+"px"):"right"===t?(p=Math.round(a+r),f=Math.round(c-(s-l)/2),u=Math.round(s/2-d/2),this.arrowEl.style.top=u+"px"):"bottom"===t?(p=Math.round(a-(n-r)/2),f=Math.round(c+l),u=Math.round(n/2-h/2),this.arrowEl.style.left=u+"px"):"left"===t&&(p=Math.round(a-n),f=Math.round(c-(s-l)/2),u=Math.round(s/2-d/2),this.arrowEl.style.top=u+"px"),Object.assign(this.tooltipEl.style,{position:"absolute",top:"0px",left:"0px",transform:`translate3d(${p}px, ${f}px, 0px)`,willChange:"transform"});let m=0;const g={left:this.tooltipEl.offsetLeft,top:this.tooltipEl.offsetTop,right:e-(this.tooltipEl.offsetLeft+n),bottom:i-(this.tooltipEl.offsetTop+s)};let y={left:!1,top:!1,right:!1,bottom:!1};if(g.right<0&&(y.right=!0,m++),g.left<0&&(y.left=!0,m++),g.bottom<0&&(y.bottom=!0,m++),g.top<0&&(y.top=!0,m++),m>0&&(!this.placementChanged&&y.left&&g.right>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("right")):!this.placementChanged&&y.top&&g.top>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")):!this.placementChanged&&y.right&&g.left>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("left")):!this.placementChanged&&y.bottom&&g.top>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!y.left&&!y.right?this.fixTooltipPosition=!0:g.top>g.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(y.left){let e=Math.abs(g.left);a>=p+e&&["top","bottom"].indexOf(t)<0?p+=e:(p+=e,u-=e)}if(y.top){let t=Math.abs(g.top);f+=t,u-=t}if(y.right){let e=Math.abs(g.right);a<=p-e&&["top","bottom"].indexOf(t)<0||(p-=e,u+=e)}if(y.bottom){let t=Math.abs(g.bottom);f-=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:n+"px",transform:`translate3d(${p}px, ${f}px, 0px)`}),this.fixTooltipPosition=!1}}show(){this.tooltipEl||(this.buildTooltip(),this.setPosition(),this.animation?(this.tooltipEl.classList.add(this.animationSpeed),d(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")?d(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()))}}T._jQueryInit();class k extends o{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_${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=f({},k.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())}}k._jQueryInit();class _ extends o{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_${_.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=f({},_.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=a(()=>{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),n=i.querySelector(".tab-item-action");n&&n.classList.add("dropdown-item"),i.setAttribute("data-uuid",e),this.dropdownList.appendChild(i),t.setAttribute("data-related-dropdown-item",e)}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,n=i.style.overflow;i.style.overflow="visible",i.offsetHeight;const s=t.offsetWidth,o=s+(parseInt(getComputedStyle(t).marginLeft,10)||0)+(parseInt(getComputedStyle(t).marginRight,10)||0);i.style.overflow=n,e&&t.classList.add("invisible");const r={width:s,totalWidth:o};return this._tabsCache.set(t,r),r}availableSpace(){const t=this.el.closest(".section-tabs"),e=t?t.closest(".section-header"):null;let i,n,s;if(e){const o=getComputedStyle(e);if("column"===o.flexDirection){const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,n=parseInt(o.paddingLeft,10)||0,s=parseInt(o.paddingRight,10)||0}else{i=e.offsetWidth,n=parseInt(o.paddingLeft,10)||0,s=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,n=parseInt(o.paddingLeft,10)||0,s=parseInt(o.paddingRight,10)||0}return i-n-s-(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(),n=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 s=0,o=[],r=[];for(let e=0;e<t.length;e++){const l=t[e],{totalWidth:a}=this.getTabDimensions(l),c=s+a+(e>0?n:0);if(c<=i){s=c,o.push(l);const t=l.getAttribute("data-related-dropdown-item");if(t){const e=this.dropdownList.querySelector(`[data-uuid="${t}"]`);e&&this.moveToList(e)}}else r.push(l)}if(r.forEach((t,e)=>{t.hasAttribute("data-related-dropdown-item")||this.moveToDropdown(t)}),e.length>0&&0===r.length){const t=i-s;for(let i=e.length-1;i>=0;i--){const r=e[i],l=r.getAttribute("data-uuid"),a=this.el.querySelector(`[data-related-dropdown-item="${l}"]`);if(a){const{totalWidth:e}=this.getTabDimensions(a),i=e+(s>0?n:0);if(!(i<=t))break;this.moveToList(r),o.push(a),s+=i}}}t.forEach(t=>{o.includes(t)?t.classList.remove("invisible"):t.classList.add("invisible")});const l=this.dropdownList&&this.dropdownList.children.length>0;this.dropdownContainer&&this.dropdownContainer.classList.toggle("visible",l)}}_._jQueryInit();class L extends o{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=f({},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,n){if(this.containers.has(t))return this.containers.get(t);const s=document.createElement("div");s.className="toast-container",s.setAttribute("data-placement",t),null!=e&&s.style.setProperty("--_toast-offset-x","number"==typeof e?`${e}px`:e),null!=i&&s.style.setProperty("--_toast-offset-y","number"==typeof i?`${i}px`:i),null!=n&&s.style.setProperty("--_toast-max-visible",String(n)),this.container.appendChild(s),s.addEventListener("mouseenter",()=>{this._pauseTimers(o)}),s.addEventListener("mouseleave",()=>{this._resumeTimers(o)});const o={el:s,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 n=e[t],s=e.length-1-t;n.el.style.setProperty("--_toast-index",String(s));const o=n.el.offsetHeight;n.el.style.setProperty("--_toast-collapse-height",`${o}px`),s>=i?n.el.setAttribute("data-toast-hidden","true"):n.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=f({},this.settings,t||{}),i=this._buildToast(e),n=this._getContainer(i.placement,e.offsetX,e.offsetY,e.maxVisible);return n.toasts.push(i),i._containerEntry=n,this._showToast(i,n),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 n=t.placement.startsWith("top-");e||(e=n?"slideInDown":"slideInUp"),i||(i=n?"slideOutUp":"slideOutDown")}const n={uuid:"toast-"+h(),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 s;s="function"==typeof n.template?n.template(n):this._renderTemplate(n);const o=document.createElement("div");return o.innerHTML=s.trim(),n.el=o.firstElementChild,n.innerEl=n.el.querySelector(".toast-inner"),n.closeBtn=n.el.querySelector("[data-toast-close]"),n}_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),d(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")?d(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="",n="",s="",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 `:s='\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=`\n <div class="toast-body"><div>${e}</div>${s}</div>\n `;const r=t.action?' role="button" style="cursor: pointer;"':"";return`\n <div class="toast${t.action?" toast-actionable":""}" role="alert" id="${t.uuid}"${r}>\n\n <div class="toast-inner">\n\n ${i}\n ${n}\n\n </div>\n\n </div>\n `}}L._jQueryInit();class A extends o{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_${A.NAME}`);i||(i=new A(this,"object"==typeof t&&t),e.data(`plugin_${A.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[A.NAME];$.fn[A.NAME]=A._jQueryInterface,$.fn[A.NAME].Constructor=A,$.fn[A.NAME].defaults=A.DEFAULTS||{},$.fn[A.NAME].noConflict=()=>($.fn[A.NAME]=t,A._jQueryInterface)}constructor(t,e){super(),this.settings=f({},A.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=f({},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]=f({},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-"+h(),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 n;null==i.maxBodyHeight&&"full"!==i.size&&(i.maxBodyHeight=window.innerHeight-200),n="function"==typeof i.template?i.template():this._renderTemplate(i);const s=document.createElement("div");return s.innerHTML=n.trim(),i.el=s.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 n=i.target.closest("[data-dialog-action], [data-dialog-confirm], [data-dialog-close], [data-dialog-remove]");if(!n)return;if(i.preventDefault(),t.actionInProgress)return void i.stopPropagation();t.actionInProgress=!0;const s=["confirm","close","remove"];let o=n.dataset.dialogAction;if(!o)for(const t of s)if(n.hasAttribute(`data-dialog-${t}`)){o=t;break}const r=t.actions[o]||{};t.el.dispatchEvent(new CustomEvent(`dialog.${o}`,{bubbles:!0}));const l="function"==typeof r.callback?r.callback:"function"==typeof t.callbacks[o]?t.callbacks[o]:null,a=(e=!1)=>{e?t.actionInProgress=!1:setTimeout(()=>{t.actionInProgress=!1},t.actionThreshold)};if("function"==typeof l)try{const i=l.call(e,function(){s.includes(o)&&e.close(t),a()},t);i&&"function"==typeof i.then?i.then(t=>{!1===t&&a()}).catch(()=>{a()}):a()}catch(t){a()}else s.includes(o)?(e.close(t),a()):a()},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(),n=t.el.querySelector(".dialog-body");n&&n.style.setProperty("--cool-dialog-body-height",i+"px")})}),t.resizeObserver.observe(document.body);else{let i,n=window.orientation;t.resizeHandler=()=>{clearTimeout(i);const s=performance.now(),o=window.orientation!==n;if(o&&(n=window.orientation),!t.lastResizeTime||s-t.lastResizeTime>100||o){const i=e(),n=t.el.querySelector(".dialog-body");n&&n.style.setProperty("--cool-dialog-body-height",i+"px"),t.lastResizeTime=s}else i=setTimeout(()=>{const i=e(),n=t.el.querySelector(".dialog-body");n&&n.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");d(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"]'),n=this.container.querySelector(".dialog-backdrop");0===i.length&&n&&n.remove();const s=()=>{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");d(e,t.animationOut).then(()=>{s()})}else s();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 n=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 ${n}\n </button>\n `});let n="";return n=i.length>2?`\n ${i[0]}\n <div class="spacer"></div>\n ${i[1]}\n ${i.slice(2).join("\n")}\n `:i.join("\n"),`\n <div class="dialog-footer">\n ${n}\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":"",n=t.size?" dialog-"+t.size:"",s=t.overflowVisible?" dialog-overflow-visible":"",o=' data-dialog-uuid="'+t.uuid+'"',r=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',l=t.maxBodyHeight?' style="--cool-dialog-body-height: '+t.maxBodyHeight+'px"':"",a="function"==typeof t.body?t.body():t.body,c=this._renderFooter(t);return`\n <div class="dialog${e}${i}${n}${s}"${o}${r}>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n ${this._renderHeader(t)}\n\n <div class="dialog-body"${l}>\n\n ${a}\n\n </div>\n\n ${c}\n\n </div>\n\n </div>\n\n </div>\n `}}A._jQueryInit();class I extends o{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_${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.opts=f({},I.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{}}}I._jQueryInit(),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};class H{static _sidebarInstance=null;static _sectionInstance=null;static _toastInstance=null;static refresh(){this._sectionInstance&&this._sectionInstance.refresh&&this._sectionInstance.refresh(),v.initializeElements('[data-toggle="popover"]',window.Cool.settings.popover),C.initializeElements('[data-toggle="select"]',window.Cool.settings.select),S.initializeElements('[data-toggle="dropdown"]',window.Cool.settings.dropdown),T.initializeElements('[data-toggle="tooltip"]',window.Cool.settings.tooltip),k.initializeElements('[data-toggle="collapse"]',window.Cool.settings.collapse),_.initializeElements('[data-toggle="section-tabs"]',window.Cool.settings.sectionTabs),I.initializeElements('[data-toggle="theme-switcher"]',window.Cool.settings.themeSwitcher)}static initialize(t={}){window.Cool.settings=t,this._sectionInstance||(this._sectionInstance=new m(t.section)),v.initializeElements('[data-toggle="popover"]',t.popover),C.initializeElements('[data-toggle="select"]',t.select),S.initializeElements('[data-toggle="dropdown"]',t.dropdown),T.initializeElements('[data-toggle="tooltip"]',t.tooltip),k.initializeElements('[data-toggle="collapse"]',t.collapse),_.initializeElements('[data-toggle="section-tabs"]',t.sectionTabs),I.initializeElements('[data-toggle="theme-switcher"]',t.themeSwitcher);const e=document.querySelector(".sidebar-left");e&&(this._sidebarInstance=y.initializeElement(e,t.sidebar)||y.getInstance(e)),this._toastInstance=L.initializeElement(document.body,t.toast)||L.getInstance(document.body),window.Cool.toast=this._toastInstance,A.initializeElement(document.body,t.dialog)}static initComponent(t){if(!t)return;const e=Array.isArray(t)?t:[t],i=[],n=[];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=>{n.push(t)})});const s=[],o=[];n.forEach(t=>{const e=t.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0?s.push(t):o.push(t)});const r=[...s,...o];let l=0;const a=()=>{r.slice(l,l+10).forEach(t=>{let e=null;switch(t.getAttribute("data-toggle")){case"popover":e=v.initializeElement(t,window.Cool.settings.popover);break;case"select":e=C.initializeElement(t,window.Cool.settings.select);break;case"dropdown":e=S.initializeElement(t,window.Cool.settings.dropdown);break;case"tooltip":e=T.initializeElement(t,window.Cool.settings.tooltip);break;case"collapse":e=k.initializeElement(t,window.Cool.settings.collapse);break;case"section-tabs":e=_.initializeElement(t,window.Cool.settings.sectionTabs);break;case"theme-switcher":e=I.initializeElement(t,window.Cool.settings.themeSwitcher)}e&&i.push(e)}),l+=10,l<r.length&&("requestIdleCallback"in window?requestIdleCallback(a,{timeout:50}):setTimeout(a,0))};return s.length>0?a():"requestIdleCallback"in window?requestIdleCallback(a,{timeout:100}):a(),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 r.observe(t,e)}static unobserveResize(t){t&&r.unobserve(t)}static addScrollListener(t,e){t&&"function"==typeof e&&l.add(t,e)}static removeScrollListener(t){t&&l.remove(t)}static getSidebar(){return this._sidebarInstance}static getSection(){return this._sectionInstance}static getToast(){return this._toastInstance}static initjQuery(){v._jQueryInit(),C._jQueryInit(),S._jQueryInit(),T._jQueryInit(),k._jQueryInit(),_._jQueryInit(),L._jQueryInit(),A._jQueryInit(),y._jQueryInit(),I._jQueryInit()}}window.Cool.initialize=H.initialize.bind(H),window.Cool.initComponent=H.initComponent.bind(H),window.Cool.refresh=H.refresh.bind(H),window.Cool.destroy=H.destroy.bind(H),window.Cool.observeResize=H.observeResize.bind(H),window.Cool.unobserveResize=H.unobserveResize.bind(H),window.Cool.addScrollListener=H.addScrollListener.bind(H),window.Cool.removeScrollListener=H.removeScrollListener.bind(H),window.Cool.getSidebar=H.getSidebar.bind(H),window.Cool.getSection=H.getSection.bind(H),window.Cool.getToast=H.getToast.bind(H),window.Cool.initjQuery=H.initjQuery.bind(H),"undefined"!=typeof window&&(window.jQuery=window.$=n);return{Common:H,Sidebar:y,Popover:v,Select:C,Dropdown:S,Tooltip:T,SectionTabs:_,Collapse:k,Toast:L,Dialog:A,ThemeSwitcher:I}});
12
17
  //# sourceMappingURL=cool.bundle.min.js.map