(i=>{"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(t,e){return void 0===e&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(t)),i(e),e}:i(jQuery)})(function(e){(t=e&&e.fn&&e.fn.select2&&e.fn.select2.amd?e.fn.select2.amd:t)&&t.requirejs||(t?n=t:t={},f={},m={},g={},b={},i=Object.prototype.hasOwnProperty,o=[].slice,v=/\.js$/,_=function(t,e){var i,o,r=d(t),a=r[0],e=e[1];return t=r[1],a&&(i=w(a=c(a,e))),a?t=i&&i.normalize?i.normalize(t,(o=e,function(t){return c(t,o)})):c(t,e):(a=(r=d(t=c(t,e)))[0],t=r[1],a&&(i=w(a))),{f:a?a+"!"+t:t,n:t,pr:a,p:i}},u={require:function(t){return x(t)},exports:function(t){var e=f[t];return void 0!==e?e:f[t]={}},module:function(t){return{id:t,uri:"",exports:f[t],config:(e=t,function(){return g&&g.config&&g.config[e]||{}})};var e}},a=function(t,e,i,o){var r,a,s,n,l,c=[],d=typeof i,p=k(o=o||t);if("undefined"==d||"function"==d){for(e=!e.length&&i.length?["require","exports","module"]:e,n=0;n<e.length;n+=1)if("require"===(a=(s=_(e[n],p)).f))c[n]=u.require(t);else if("exports"===a)c[n]=u.exports(t),l=!0;else if("module"===a)r=c[n]=u.module(t);else if(y(f,a)||y(m,a)||y(b,a))c[n]=w(a);else{if(!s.p)throw new Error(t+" missing "+a);s.p.load(s.n,x(o,!0),(e=>function(t){f[e]=t})(a),{}),c[n]=f[a]}d=i?i.apply(f[t],c):void 0,t&&(r&&r.exports!==h&&r.exports!==f[t]?f[t]=r.exports:d===h&&l||(f[t]=d))}else t&&(f[t]=i)},r=n=s=function(t,e,i,o,r){if("string"==typeof t)return u[t]?u[t](e):w(_(t,k(e)).f);if(!t.splice){if((g=t).deps&&s(g.deps,g.callback),!e)return;e.splice?(t=e,e=i,i=null):t=h}return e=e||function(){},"function"==typeof i&&(i=o,o=r),o?a(h,t,e,i):setTimeout(function(){a(h,t,e,i)},4),s},s.config=function(t){return s(t)},r._defined=f,(l=function(t,e,i){if("string"!=typeof t)throw new Error("See almond README: incorrect module build, no module name");e.splice||(i=e,e=[]),y(f,t)||y(m,t)||(m[t]=[t,e,i])}).amd={jQuery:!0},t.requirejs=r,t.require=n,t.define=l),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(a){var o={};function c(t){var e,i=t.prototype,o=[];for(e in i)"function"==typeof i[e]&&"constructor"!==e&&o.push(e);return o}function t(){this.listeners={}}o.Extend=function(t,e){var i,o={}.hasOwnProperty;function r(){this.constructor=t}for(i in e)o.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o.Decorate=function(o,r){var t=c(r),e=c(o);function a(){var t=Array.prototype.unshift,e=r.prototype.constructor.length,i=o.prototype.constructor;0<e&&(t.call(arguments,o.prototype.constructor),i=r.prototype.constructor),i.apply(this,arguments)}r.displayName=o.displayName,a.prototype=new function(){this.constructor=a};for(var i=0;i<e.length;i++){var s=e[i];a.prototype[s]=o.prototype[s]}for(var n=0;n<t.length;n++){var l=t[n];a.prototype[l]=(t=>{var e=function(){},i=(t in a.prototype&&(e=a.prototype[t]),r.prototype[t]);return function(){return Array.prototype.unshift.call(arguments,e),i.apply(this,arguments)}})(l)}return a},t.prototype.on=function(t,e){this.listeners=this.listeners||{},t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e]},t.prototype.trigger=function(t){var e=Array.prototype.slice,i=e.call(arguments,1);this.listeners=this.listeners||{},0===(i=null==i?[]:i).length&&i.push({}),(i[0]._type=t)in this.listeners&&this.invoke(this.listeners[t],e.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},t.prototype.invoke=function(t,e){for(var i=0,o=t.length;i<o;i++)t[i].apply(this,e)},o.Observable=t,o.generateChars=function(t){for(var e="",i=0;i<t;i++)e+=Math.floor(36*Math.random()).toString(36);return e},o.bind=function(t,e){return function(){t.apply(e,arguments)}},o._convertData=function(t){for(var e in t){var i=e.split("-"),o=t;if(1!==i.length){for(var r=0;r<i.length;r++){var a=i[r];(a=a.substring(0,1).toLowerCase()+a.substring(1))in o||(o[a]={}),r==i.length-1&&(o[a]=t[e]),o=o[a]}delete t[e]}}return t},o.hasScroll=function(t,e){var i=a(e),o=e.style.overflowX,r=e.style.overflowY;return(o!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===o||"scroll"===r||i.innerHeight()<e.scrollHeight||i.innerWidth()<e.scrollWidth)},o.escapeMarkup=function(t){var e={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},o.appendMany=function(t,e){var i;"1.7"===a.fn.jquery.substr(0,3)&&(i=a(),a.map(e,function(t){i=i.add(t)}),e=i),t.append(e)},o.__cache={};var i=0;return o.GetUniqueElementId=function(t){var e=t.getAttribute("data-select2-id");return null==e&&(t.id?(e=t.id,t.setAttribute("data-select2-id",e)):(t.setAttribute("data-select2-id",++i),e=i.toString())),e},o.StoreData=function(t,e,i){t=o.GetUniqueElementId(t);o.__cache[t]||(o.__cache[t]={}),o.__cache[t][e]=i},o.GetData=function(t,e){var i=o.GetUniqueElementId(t);return e?o.__cache[i]&&null!=o.__cache[i][e]?o.__cache[i][e]:a(t).data(e):o.__cache[i]},o.RemoveData=function(t){var e=o.GetUniqueElementId(t);null!=o.__cache[e]&&delete o.__cache[e],t.removeAttribute("data-select2-id")},o}),t.define("select2/results",["jquery","./utils"],function(d,p){function o(t,e,i){this.$element=t,this.data=i,this.options=e,o.__super__.constructor.call(this)}return p.Extend(o,p.Observable),o.prototype.render=function(){var t=d('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t},o.prototype.clear=function(){this.$results.empty()},o.prototype.displayMessage=function(t){var e=this.options.get("escapeMarkup"),i=(this.clear(),this.hideLoading(),d('<li role="alert" aria-live="assertive" class="select2-results__option"></li>')),o=this.options.get("translations").get(t.message);i.append(e(o(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},o.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},o.prototype.append=function(t){this.hideLoading();var e=[];if(null!=t.results&&0!==t.results.length){t.results=this.sort(t.results);for(var i=0;i<t.results.length;i++){var o=t.results[i],o=this.option(o);e.push(o)}this.$results.append(e)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},o.prototype.position=function(t,e){e.find(".select2-results").append(t)},o.prototype.sort=function(t){return this.options.get("sorter")(t)},o.prototype.highlightFirstItem=function(){var t=this.$results.find(".select2-results__option[aria-selected]"),e=t.filter("[aria-selected=true]");(0<e.length?e:t).first().trigger("mouseenter"),this.ensureHighlightVisible()},o.prototype.setClasses=function(){var e=this;this.data.current(function(t){var o=d.map(t,function(t){return t.id.toString()});e.$results.find(".select2-results__option[aria-selected]").each(function(){var t=d(this),e=p.GetData(this,"data"),i=""+e.id;null!=e.element&&e.element.selected||null==e.element&&-1<d.inArray(i,o)?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},o.prototype.showLoading=function(t){this.hideLoading();t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(t)},t=this.option(t);t.className+=" loading-results",this.$results.prepend(t)},o.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},o.prototype.option=function(t){var e,i=document.createElement("li"),o=(i.className="select2-results__option",{role:"option","aria-selected":"false"}),r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(e in(null!=t.element&&r.call(t.element,":disabled")||null==t.element&&t.disabled)&&(delete o["aria-selected"],o["aria-disabled"]="true"),null==t.id&&delete o["aria-selected"],null!=t._resultId&&(i.id=t._resultId),t.title&&(i.title=t.title),t.children&&(o.role="group",o["aria-label"]=t.text,delete o["aria-selected"]),o)i.setAttribute(e,o[e]);if(t.children){var r=d(i),a=document.createElement("strong");a.className="select2-results__group",d(a),this.template(t,a);for(var s=[],n=0;n<t.children.length;n++){var l=t.children[n],l=this.option(l);s.push(l)}var c=d("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});c.append(s),r.append(a),r.append(c)}else this.template(t,i);return p.StoreData(i,"data",t),i},o.prototype.bind=function(e,t){var r=this,i=e.id+"-results";this.$results.attr("id",i),e.on("results:all",function(t){r.clear(),r.append(t.data),e.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),e.on("results:append",function(t){r.append(t.data),e.isOpen()&&r.setClasses()}),e.on("query",function(t){r.hideMessages(),r.showLoading(t)}),e.on("select",function(){e.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect"))&&r.highlightFirstItem()}),e.on("unselect",function(){e.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect"))&&r.highlightFirstItem()}),e.on("open",function(){r.$results.attr("aria-expanded","true"),r.$results.attr("aria-hidden","false"),r.setClasses(),r.ensureHighlightVisible()}),e.on("close",function(){r.$results.attr("aria-expanded","false"),r.$results.attr("aria-hidden","true"),r.$results.removeAttr("aria-activedescendant")}),e.on("results:toggle",function(){var t=r.getHighlightedResults();0!==t.length&&t.trigger("mouseup")}),e.on("results:select",function(){var t,e=r.getHighlightedResults();0!==e.length&&(t=p.GetData(e[0],"data"),"true"==e.attr("aria-selected")?r.trigger("close",{}):r.trigger("select",{data:t}))}),e.on("results:previous",function(){var t,e=r.getHighlightedResults(),i=r.$results.find("[aria-selected]"),o=i.index(e);o<=0||(o=o-1,0===e.length&&(o=0),(e=i.eq(o)).trigger("mouseenter"),i=r.$results.offset().top,e=e.offset().top,t=r.$results.scrollTop()+(e-i),0===o?r.$results.scrollTop(0):e-i<0&&r.$results.scrollTop(t))}),e.on("results:next",function(){var t,e,i=r.getHighlightedResults(),o=r.$results.find("[aria-selected]"),i=o.index(i)+1;i>=o.length||((o=o.eq(i)).trigger("mouseenter"),t=r.$results.offset().top+r.$results.outerHeight(!1),o=o.offset().top+o.outerHeight(!1),e=r.$results.scrollTop()+o-t,0===i?r.$results.scrollTop(0):t<o&&r.$results.scrollTop(e))}),e.on("results:focus",function(t){t.element.addClass("select2-results__option--highlighted")}),e.on("results:message",function(t){r.displayMessage(t)}),d.fn.mousewheel&&this.$results.on("mousewheel",function(t){var e=r.$results.scrollTop(),i=r.$results.get(0).scrollHeight-e+t.deltaY,e=0<t.deltaY&&e-t.deltaY<=0,i=t.deltaY<0&&i<=r.$results.height();e?(r.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):i&&(r.$results.scrollTop(r.$results.get(0).scrollHeight-r.$results.height()),t.preventDefault(),t.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var e=d(this),i=p.GetData(this,"data");"true"!==e.attr("aria-selected")?r.trigger("select",{originalEvent:t,data:i}):r.options.get("multiple")?r.trigger("unselect",{originalEvent:t,data:i}):r.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(t){var e=p.GetData(this,"data");r.getHighlightedResults().removeClass("select2-results__option--highlighted"),r.trigger("results:focus",{data:e,element:d(this)})})},o.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},o.prototype.destroy=function(){this.$results.remove()},o.prototype.ensureHighlightVisible=function(){var t,e,i,o,r=this.getHighlightedResults();0!==r.length&&(t=this.$results.find("[aria-selected]").index(r),e=this.$results.offset().top,o=r.offset().top,i=this.$results.scrollTop()+(o-e),o=o-e,i-=2*r.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(i))},o.prototype.template=function(t,e){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),i=i(t,e);null==i?e.style.display="none":"string"==typeof i?e.innerHTML=o(i):d(e).append(i)},o}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(i,o,r){function a(t,e){this.$element=t,this.options=e,a.__super__.constructor.call(this)}return o.Extend(a,o.Observable),a.prototype.render=function(){var t=i('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=o.GetData(this.$element[0],"old-tabindex")?this._tabindex=o.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),t.attr("aria-disabled","false"),this.$selection=t},a.prototype.bind=function(t,e){var i=this,o=t.id+"-results";this.container=t,this.$selection.on("focus",function(t){i.trigger("focus",t)}),this.$selection.on("blur",function(t){i._handleBlur(t)}),this.$selection.on("keydown",function(t){i.trigger("keypress",t),t.which===r.SPACE&&t.preventDefault()}),t.on("results:focus",function(t){i.$selection.attr("aria-activedescendant",t.data._resultId)}),t.on("selection:update",function(t){i.update(t.data)}),t.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(t)}),t.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.trigger("focus"),i._detachCloseHandler(t)}),t.on("enable",function(){i.$selection.attr("tabindex",i._tabindex),i.$selection.attr("aria-disabled","false")}),t.on("disable",function(){i.$selection.attr("tabindex","-1"),i.$selection.attr("aria-disabled","true")})},a.prototype._handleBlur=function(t){var e=this;window.setTimeout(function(){document.activeElement==e.$selection[0]||i.contains(e.$selection[0],document.activeElement)||e.trigger("blur",t)},1)},a.prototype._attachCloseHandler=function(t){i(document.body).on("mousedown.select2."+t.id,function(t){var e=i(t.target).closest(".select2");i(".select2.select2-container--open").each(function(){this!=e[0]&&o.GetData(this,"element").select2("close")})})},a.prototype._detachCloseHandler=function(t){i(document.body).off("mousedown.select2."+t.id)},a.prototype.position=function(t,e){e.find(".selection").append(t)},a.prototype.destroy=function(){this._detachCloseHandler(this.container)},a.prototype.update=function(t){throw new Error("The `update` method must be defined in child classes.")},a.prototype.isEnabled=function(){return!this.isDisabled()},a.prototype.isDisabled=function(){return this.options.get("disabled")},a}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(t,e,i,o){function r(){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,e),r.prototype.render=function(){var t=r.__super__.render.call(this);return t.addClass("select2-selection--single"),t.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),t},r.prototype.bind=function(e,t){var i=this,o=(r.__super__.bind.apply(this,arguments),e.id+"-container");this.$selection.find(".select2-selection__rendered").attr("id",o).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",o),this.$selection.on("mousedown",function(t){1===t.which&&i.trigger("toggle",{originalEvent:t})}),this.$selection.on("focus",function(t){}),this.$selection.on("blur",function(t){}),e.on("focus",function(t){e.isOpen()||i.$selection.trigger("focus")})},r.prototype.clear=function(){var t=this.$selection.find(".select2-selection__rendered");t.empty(),t.removeAttr("title")},r.prototype.display=function(t,e){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(t,e))},r.prototype.selectionContainer=function(){return t("<span></span>")},r.prototype.update=function(t){var e,i;0!==t.length?(t=t[0],e=this.$selection.find(".select2-selection__rendered"),i=this.display(t,e),e.empty().append(i),(i=t.title||t.text)?e.attr("title",i):e.removeAttr("title")):this.clear()},r}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(o,t,n){function r(t,e){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var t=r.__super__.render.call(this);return t.addClass("select2-selection--multiple"),t.html('<ul class="select2-selection__rendered"></ul>'),t},r.prototype.bind=function(t,e){var i=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(t){i.trigger("toggle",{originalEvent:t})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){var e;i.isDisabled()||(e=o(this).parent(),e=n.GetData(e[0],"data"),i.trigger("unselect",{originalEvent:t,data:e}))})},r.prototype.clear=function(){var t=this.$selection.find(".select2-selection__rendered");t.empty(),t.removeAttr("title")},r.prototype.display=function(t,e){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(t,e))},r.prototype.selectionContainer=function(){return o('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},r.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],i=0;i<t.length;i++){var o=t[i],r=this.selectionContainer(),a=this.display(o,r),a=(r.append(a),o.title||o.text);a&&r.attr("title",a),n.StoreData(r[0],"data",o),e.push(r)}var s=this.$selection.find(".select2-selection__rendered");n.appendMany(s,e)}},r}),t.define("select2/selection/placeholder",["../utils"],function(t){function e(t,e,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),t.call(this,e,i)}return e.prototype.normalizePlaceholder=function(t,e){return e="string"==typeof e?{id:"",text:e}:e},e.prototype.createPlaceholder=function(t,e){var i=this.selectionContainer();return i.html(this.display(e)),i.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),i},e.prototype.update=function(t,e){var i=1==e.length&&e[0].id!=this.placeholder.id;if(1<e.length||i)return t.call(this,e);this.clear();i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},e}),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,o,n){function t(){}return t.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(t){o._handleClear(t)}),e.on("keypress",function(t){o._handleKeyboardClear(t,e)})},t.prototype._handleClear=function(t,e){if(!this.isDisabled()){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){e.stopPropagation();var o=n.GetData(i[0],"data"),r=this.$element.val(),a=(this.$element.val(this.placeholder.id),{data:o});if(this.trigger("clear",a),a.prevented)this.$element.val(r);else{for(var s=0;s<o.length;s++)if(a={data:o[s]},this.trigger("unselect",a),a.prevented)return void this.$element.val(r);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},t.prototype._handleKeyboardClear=function(t,e,i){i.isOpen()||e.which!=o.DELETE&&e.which!=o.BACKSPACE||this._handleClear(e)},t.prototype.update=function(t,e){t.call(this,e),0<this.$selection.find(".select2-selection__placeholder").length||0===e.length||(t=this.options.get("translations").get("removeAllItems"),t=i('<span class="select2-selection__clear" title="'+t()+'">&times;</span>'),n.StoreData(t[0],"data",e),this.$selection.find(".select2-selection__rendered").prepend(t))},t}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(i,s,n){function t(t,e,i){t.call(this,e,i)}return t.prototype.render=function(t){var e=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>'),e=(this.$searchContainer=e,this.$search=e.find("input"),t.call(this));return this._transferTabIndex(),e},t.prototype.bind=function(t,e,i){var o=this,r=e.id+"-results",t=(t.call(this,e,i),e.on("open",function(){o.$search.attr("aria-controls",r),o.$search.trigger("focus")}),e.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),e.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),e.on("disable",function(){o.$search.prop("disabled",!0)}),e.on("focus",function(t){o.$search.trigger("focus")}),e.on("results:focus",function(t){t.data._resultId?o.$search.attr("aria-activedescendant",t.data._resultId):o.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(t){o.trigger("focus",t)}),this.$selection.on("focusout",".select2-search--inline",function(t){o._handleBlur(t)}),this.$selection.on("keydown",".select2-search--inline",function(t){var e;t.stopPropagation(),o.trigger("keypress",t),o._keyUpPrevented=t.isDefaultPrevented(),t.which===n.BACKSPACE&&""===o.$search.val()&&0<(e=o.$searchContainer.prev(".select2-selection__choice")).length&&(e=s.GetData(e[0],"data"),o.searchRemoveChoice(e),t.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(t){o.$search.val()&&t.stopPropagation()}),document.documentMode),a=t&&t<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(t){a?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(t){var e;a&&"input"===t.type?o.$selection.off("input.search input.searchcheck"):(e=t.which)!=n.SHIFT&&e!=n.CTRL&&e!=n.ALT&&e!=n.TAB&&o.handleSearch(t)})},t.prototype._transferTabIndex=function(t){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},t.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},t.prototype.update=function(t,e){var i=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),i&&this.$search.trigger("focus")},t.prototype.handleSearch=function(){var t;this.resizeSearch(),this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},t.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},t.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="",t=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em";this.$search.css("width",t)},t}),t.define("select2/selection/eventRelay",["jquery"],function(s){function t(){}return t.prototype.bind=function(t,e,i){var o=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],a=["opening","closing","selecting","unselecting","clearing"];t.call(this,e,i),e.on("*",function(t,e){var i;-1!==s.inArray(t,r)&&(i=s.Event("select2:"+t,{params:e=e||{}}),o.$element.trigger(i),-1!==s.inArray(t,a))&&(e.prevented=i.isDefaultPrevented())})},t}),t.define("select2/translation",["jquery","require"],function(e,i){function o(t){this.dict=t||{}}return o.prototype.all=function(){return this.dict},o.prototype.get=function(t){return this.dict[t]},o.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},o._cache={},o.loadPath=function(t){var e;return t in o._cache||(e=i(t),o._cache[t]=e),new o(o._cache[t])},o}),t.define("select2/diacritics",[],function(){return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),t.define("select2/data/base",["../utils"],function(i){function o(t,e){o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.current=function(t){throw new Error("The `current` method must be defined in child classes.")},o.prototype.query=function(t,e){throw new Error("The `query` method must be defined in child classes.")},o.prototype.bind=function(t,e){},o.prototype.destroy=function(){},o.prototype.generateResultId=function(t,e){t=t.id+"-result-";return t+=i.generateChars(4),null!=e.id?t+="-"+e.id.toString():t+="-"+i.generateChars(4),t},o}),t.define("select2/data/select",["./base","../utils","jquery"],function(t,s,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return s.Extend(i,t),i.prototype.current=function(t){var e=[],i=this;this.$element.find(":selected").each(function(){var t=n(this),t=i.item(t);e.push(t)}),t(e)},i.prototype.select=function(r){var t,a=this;r.selected=!0,n(r.element).is("option")?(r.element.selected=!0,this.$element.trigger("input").trigger("change")):this.$element.prop("multiple")?this.current(function(t){var e=[];(r=[r]).push.apply(r,t);for(var i=0;i<r.length;i++){var o=r[i].id;-1===n.inArray(o,e)&&e.push(o)}a.$element.val(e),a.$element.trigger("input").trigger("change")}):(t=r.id,this.$element.val(t),this.$element.trigger("input").trigger("change"))},i.prototype.unselect=function(r){var a=this;this.$element.prop("multiple")&&(r.selected=!1,n(r.element).is("option")?(r.element.selected=!1,this.$element.trigger("input").trigger("change")):this.current(function(t){for(var e=[],i=0;i<t.length;i++){var o=t[i].id;o!==r.id&&-1===n.inArray(o,e)&&e.push(o)}a.$element.val(e),a.$element.trigger("input").trigger("change")}))},i.prototype.bind=function(t,e){var i=this;(this.container=t).on("select",function(t){i.select(t.data)}),t.on("unselect",function(t){i.unselect(t.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){s.RemoveData(this)})},i.prototype.query=function(e,t){var i=[],o=this;this.$element.children().each(function(){var t=n(this);(t.is("option")||t.is("optgroup"))&&(t=o.item(t),null!==(t=o.matches(e,t)))&&i.push(t)}),t({results:i})},i.prototype.addOptions=function(t){s.appendMany(this.$element,t)},i.prototype.option=function(t){t.children?(e=document.createElement("optgroup")).label=t.text:void 0!==(e=document.createElement("option")).textContent?e.textContent=t.text:e.innerText=t.text,void 0!==t.id&&(e.value=t.id),t.disabled&&(e.disabled=!0),t.selected&&(e.selected=!0),t.title&&(e.title=t.title);var e,i=n(e),t=this._normalizeItem(t);return t.element=e,s.StoreData(e,"data",t),i},i.prototype.item=function(t){var e={};if(null==(e=s.GetData(t[0],"data"))){if(t.is("option"))e={id:t.val(),text:t.text(),disabled:t.prop("disabled"),selected:t.prop("selected"),title:t.prop("title")};else if(t.is("optgroup")){for(var e={text:t.prop("label"),children:[],title:t.prop("title")},i=t.children("option"),o=[],r=0;r<i.length;r++){var a=n(i[r]),a=this.item(a);o.push(a)}e.children=o}(e=this._normalizeItem(e)).element=t[0],s.StoreData(t[0],"data",e)}return e},i.prototype._normalizeItem=function(t){return t!==Object(t)&&(t={id:t,text:t}),null!=(t=n.extend({},{text:""},t)).id&&(t.id=t.id.toString()),null!=t.text&&(t.text=t.text.toString()),null==t._resultId&&t.id&&null!=this.container&&(t._resultId=this.generateResultId(this.container,t)),n.extend({},{selected:!1,disabled:!1},t)},i.prototype.matches=function(t,e){return this.options.get("matcher")(t,e)},i}),t.define("select2/data/array",["./select","../utils","jquery"],function(t,c,d){function o(t,e){this._dataToConvert=e.get("data")||[],o.__super__.constructor.call(this,t,e)}return c.Extend(o,t),o.prototype.bind=function(t,e){o.__super__.bind.call(this,t,e),this.addOptions(this.convertToOptions(this._dataToConvert))},o.prototype.select=function(i){var t;0===this.$element.find("option").filter(function(t,e){return e.value==i.id.toString()}).length&&(t=this.option(i),this.addOptions(t)),o.__super__.select.call(this,i)},o.prototype.convertToOptions=function(t){var e=this,i=this.$element.find("option"),o=i.map(function(){return e.item(d(this)).id}).get(),r=[];for(var a=0;a<t.length;a++){var s,n,l=this._normalizeItem(t[a]);0<=d.inArray(l.id,o)?(s=i.filter((t=>function(){return d(this).val()==t.id})(l)),n=this.item(s),n=d.extend(!0,{},l,n),n=this.option(n),s.replaceWith(n)):(s=this.option(l),l.children&&(n=this.convertToOptions(l.children),c.appendMany(s,n)),r.push(s))}return r},o}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(t,e,a){function i(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,t,e)}return e.Extend(i,t),i.prototype._applyDefaults=function(t){return a.extend({},{data:function(t){return a.extend({},t,{q:t.term})},transport:function(t,e,i){t=a.ajax(t);return t.then(e),t.fail(i),t}},t,!0)},i.prototype.processResults=function(t){return t},i.prototype.query=function(e,i){var o=this,r=(null!=this._request&&(a.isFunction(this._request.abort)&&this._request.abort(),this._request=null),a.extend({type:"GET"},this.ajaxOptions));function t(){var t=r.transport(r,function(t){t=o.processResults(t,e);o.options.get("debug")&&window.console&&console.error&&(t&&t.results&&a.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(t)},function(){"status"in t&&(0===t.status||"0"===t.status)||o.trigger("results:message",{message:"errorLoading"})});o._request=t}"function"==typeof r.url&&(r.url=r.url.call(this.$element,e)),"function"==typeof r.data&&(r.data=r.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(t,this.ajaxOptions.delay)):t()},i}),t.define("select2/data/tags",["jquery"],function(n){function t(t,e,i){var o=i.get("tags"),r=i.get("createTag"),r=(void 0!==r&&(this.createTag=r),i.get("insertTag"));if(void 0!==r&&(this.insertTag=r),t.call(this,e,i),n.isArray(o))for(var a=0;a<o.length;a++){var s=o[a],s=this._normalizeItem(s),s=this.option(s);this.$element.append(s)}}return t.prototype.query=function(t,c,d){var p=this;this._removeOldTags(),null!=c.term&&null==c.page?t.call(this,c,function t(e,i){for(var o=e.results,r=0;r<o.length;r++){var a=o[r],s=null!=a.children&&!t({results:a.children},!0);if((a.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!i&&(e.data=o,void d(e))}if(i)return!0;var n,l=p.createTag(c);null!=l&&((n=p.option(l)).attr("data-select2-tag",!0),p.addOptions([n]),p.insertTag(o,l)),e.results=o,d(e)}):t.call(this,c,d)},t.prototype.createTag=function(t,e){e=n.trim(e.term);return""===e?null:{id:e,text:e}},t.prototype.insertTag=function(t,e,i){e.unshift(i)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2-tag]").each(function(){this.selected||n(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(c){function t(t,e,i){var o=i.get("tokenizer");void 0!==o&&(this.tokenizer=o),t.call(this,e,i)}return t.prototype.bind=function(t,e,i){t.call(this,e,i),this.$search=e.dropdown.$search||e.selection.$search||i.find(".select2-search__field")},t.prototype.query=function(t,e,i){var o=this,r=(e.term=e.term||"",this.tokenizer(e,this.options,function(t){var e=o._normalizeItem(t);o.$element.find("option").filter(function(){return c(this).val()===e.id}).length||((t=o.option(e)).attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([t])),o.trigger("select",{data:e})}));r.term!==e.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),e.term=r.term),t.call(this,e,i)},t.prototype.tokenizer=function(t,e,i,o){for(var r=i.get("tokenSeparators")||[],a=e.term,s=0,n=this.createTag||function(t){return{id:t.term,text:t.term}};s<a.length;){var l=a[s];-1!==c.inArray(l,r)&&(l=a.substr(0,s),null!=(l=n(c.extend({},e,{term:l}))))?(o(l),a=a.substr(s+1)||"",s=0):s++}return{term:a}},t}),t.define("select2/data/minimumInputLength",[],function(){function t(t,e,i){this.minimumInputLength=i.get("minimumInputLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.term=e.term||"",e.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:e.term,params:e}}):t.call(this,e,i)},t}),t.define("select2/data/maximumInputLength",[],function(){function t(t,e,i){this.maximumInputLength=i.get("maximumInputLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.term=e.term||"",0<this.maximumInputLength&&e.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):t.call(this,e,i)},t}),t.define("select2/data/maximumSelectionLength",[],function(){function t(t,e,i){this.maximumSelectionLength=i.get("maximumSelectionLength"),t.call(this,e,i)}return t.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),e.on("select",function(){o._checkIfMaximumSelected()})},t.prototype.query=function(t,e,i){var o=this;this._checkIfMaximumSelected(function(){t.call(o,e,i)})},t.prototype._checkIfMaximumSelected=function(t,e){var i=this;this.current(function(t){t=null!=t?t.length:0;0<i.maximumSelectionLength&&t>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):e&&e()})},t}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t},i.prototype.bind=function(){},i.prototype.position=function(t,e){},i.prototype.destroy=function(){this.$dropdown.remove()},i}),t.define("select2/dropdown/search",["jquery","../utils"],function(a,t){function e(){}return e.prototype.render=function(t){var t=t.call(this),e=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=e,this.$search=e.find("input"),t.prepend(e),t},e.prototype.bind=function(t,e,i){var o=this,r=e.id+"-results";t.call(this,e,i),this.$search.on("keydown",function(t){o.trigger("keypress",t),o._keyUpPrevented=t.isDefaultPrevented()}),this.$search.on("input",function(t){a(this).off("keyup")}),this.$search.on("keyup input",function(t){o.handleSearch(t)}),e.on("open",function(){o.$search.attr("tabindex",0),o.$search.attr("aria-controls",r),o.$search.trigger("focus"),window.setTimeout(function(){o.$search.trigger("focus")},0)}),e.on("close",function(){o.$search.attr("tabindex",-1),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.val(""),o.$search.trigger("blur")}),e.on("focus",function(){e.isOpen()||o.$search.trigger("focus")}),e.on("results:all",function(t){null!=t.query.term&&""!==t.query.term||(o.showSearch(t)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))}),e.on("results:focus",function(t){t.data._resultId?o.$search.attr("aria-activedescendant",t.data._resultId):o.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(t){var e;this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.showSearch=function(t,e){return!0},e}),t.define("select2/dropdown/hidePlaceholder",[],function(){function t(t,e,i,o){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),t.call(this,e,i,o)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return e="string"==typeof e?{id:"",text:e}:e},t.prototype.removePlaceholder=function(t,e){for(var i=e.slice(0),o=e.length-1;0<=o;o--){var r=e[o];this.placeholder.id===r.id&&i.splice(o,1)}return i},t}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(i){function t(t,e,i,o){this.lastParams={},t.call(this,e,i,o),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),e.on("query",function(t){o.lastParams=t,o.loading=!0}),e.on("query:append",function(t){o.lastParams=t,o.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=i.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&(t=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50)&&this.loadMore()},t.prototype.loadMore=function(){this.loading=!0;var t=i.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},t.prototype.createLoadingMore=function(){var t=i('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),e=this.options.get("translations").get("loadingMore");return t.html(e(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(d,s){function t(t,e,i){this.$dropdownParent=d(i.get("dropdownParent")||document.body),t.call(this,e,i)}return t.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),e.on("open",function(){o._showDropdown(),o._attachPositioningHandler(e),o._bindContainerResultHandlers(e)}),e.on("close",function(){o._hideDropdown(),o._detachPositioningHandler(e)}),this.$dropdownContainer.on("mousedown",function(t){t.stopPropagation()})},t.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},t.prototype.position=function(t,e,i){e.attr("class",i.attr("class")),e.removeClass("select2"),e.addClass("select2-container--open"),e.css({position:"absolute",top:-999999}),this.$container=i},t.prototype.render=function(t){var e=d("<span></span>"),t=t.call(this);return e.append(t),this.$dropdownContainer=e},t.prototype._hideDropdown=function(t){this.$dropdownContainer.detach()},t.prototype._bindContainerResultHandlers=function(t,e){var i;this._containerResultsHandlersBound||(i=this,e.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("results:message",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("select",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("unselect",function(){i._positionDropdown(),i._resizeDropdown()}),this._containerResultsHandlersBound=!0)},t.prototype._attachPositioningHandler=function(t,e){var i=this,o="scroll.select2."+e.id,r="resize.select2."+e.id,e="orientationchange.select2."+e.id,a=this.$container.parents().filter(s.hasScroll);a.each(function(){s.StoreData(this,"select2-scroll-position",{x:d(this).scrollLeft(),y:d(this).scrollTop()})}),a.on(o,function(t){var e=s.GetData(this,"select2-scroll-position");d(this).scrollTop(e.y)}),d(window).on(o+" "+r+" "+e,function(t){i._positionDropdown(),i._resizeDropdown()})},t.prototype._detachPositioningHandler=function(t,e){var i="scroll.select2."+e.id,o="resize.select2."+e.id,e="orientationchange.select2."+e.id;this.$container.parents().filter(s.hasScroll).off(i),d(window).off(i+" "+o+" "+e)},t.prototype._positionDropdown=function(){var t=d(window),e=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),o=null,r=this.$container.offset(),a=(r.bottom=r.top+this.$container.outerHeight(!1),{height:this.$container.outerHeight(!1)}),s=(a.top=r.top,a.bottom=r.top+a.height,this.$dropdown.outerHeight(!1)),n=t.scrollTop(),t=t.scrollTop()+t.height(),n=n<r.top-s,t=t>r.bottom+s,r={left:r.left,top:a.bottom},l=this.$dropdownParent,c=("static"===l.css("position")&&(l=l.offsetParent()),{top:0,left:0});(d.contains(document.body,l[0])||l[0].isConnected)&&(c=l.offset()),r.top-=c.top,r.left-=c.left,e||i||(o="below"),t||!n||e?!n&&t&&e&&(o="below"):o="above",("above"==o||e&&"below"!==o)&&(r.top=a.top-c.top-s),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(r)},t.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},t.prototype._showDropdown=function(t){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},t}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function t(t,e,i,o){this.minimumResultsForSearch=i.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),t.call(this,e,i,o)}return t.prototype.showSearch=function(t,e){return!(function t(e){for(var i=0,o=0;o<e.length;o++){var r=e[o];r.children?i+=t(r.children):i++}return i}(e.data.results)<this.minimumResultsForSearch)&&t.call(this,e)},t}),t.define("select2/dropdown/selectOnClose",["../utils"],function(i){function t(){}return t.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),e.on("close",function(t){o._handleSelectOnClose(t)})},t.prototype._handleSelectOnClose=function(t,e){if(e&&null!=e.originalSelect2Event){e=e.originalSelect2Event;if("select"===e._type||"unselect"===e._type)return}var e=this.getHighlightedResults();e.length<1||null!=(e=i.GetData(e[0],"data")).element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})},t}),t.define("select2/dropdown/closeOnSelect",[],function(){function t(){}return t.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),e.on("select",function(t){o._selectTriggered(t)}),e.on("unselect",function(t){o._selectTriggered(t)})},t.prototype._selectTriggered=function(t,e){var i=e.originalEvent;i&&(i.ctrlKey||i.metaKey)||this.trigger("close",{originalEvent:i,originalSelect2Event:e})},t}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var t=t.input.length-t.maximum,e="Please delete "+t+" character";return 1!=t&&(e+="s"),e},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){var e="You can only select "+t.maximum+" item";return 1!=t.maximum&&(e+="s"),e},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(l,a,s,n,c,d,p,h,_,u,f,e,m,g,b,v,y,x,w,k,S,j,$,C,D,T,A,q,t){function i(){this.reset()}return i.prototype.apply=function(t){var e;null==(t=l.extend(!0,{},this.defaults,t)).dataAdapter&&(null!=t.ajax?t.dataAdapter=b:null!=t.data?t.dataAdapter=g:t.dataAdapter=m,0<t.minimumInputLength&&(t.dataAdapter=u.Decorate(t.dataAdapter,x)),0<t.maximumInputLength&&(t.dataAdapter=u.Decorate(t.dataAdapter,w)),0<t.maximumSelectionLength&&(t.dataAdapter=u.Decorate(t.dataAdapter,k)),t.tags&&(t.dataAdapter=u.Decorate(t.dataAdapter,v)),null==t.tokenSeparators&&null==t.tokenizer||(t.dataAdapter=u.Decorate(t.dataAdapter,y)),null!=t.query&&(e=a(t.amdBase+"compat/query"),t.dataAdapter=u.Decorate(t.dataAdapter,e)),null!=t.initSelection)&&(e=a(t.amdBase+"compat/initSelection"),t.dataAdapter=u.Decorate(t.dataAdapter,e)),null==t.resultsAdapter&&(t.resultsAdapter=s,null!=t.ajax&&(t.resultsAdapter=u.Decorate(t.resultsAdapter,C)),null!=t.placeholder&&(t.resultsAdapter=u.Decorate(t.resultsAdapter,$)),t.selectOnClose)&&(t.resultsAdapter=u.Decorate(t.resultsAdapter,A)),null==t.dropdownAdapter&&(t.multiple?t.dropdownAdapter=S:(e=u.Decorate(S,j),t.dropdownAdapter=e),0!==t.minimumResultsForSearch&&(t.dropdownAdapter=u.Decorate(t.dropdownAdapter,T)),t.closeOnSelect&&(t.dropdownAdapter=u.Decorate(t.dropdownAdapter,q)),null==t.dropdownCssClass&&null==t.dropdownCss&&null==t.adaptDropdownCssClass||(e=a(t.amdBase+"compat/dropdownCss"),t.dropdownAdapter=u.Decorate(t.dropdownAdapter,e)),t.dropdownAdapter=u.Decorate(t.dropdownAdapter,D)),null==t.selectionAdapter&&(t.multiple?t.selectionAdapter=c:t.selectionAdapter=n,null!=t.placeholder&&(t.selectionAdapter=u.Decorate(t.selectionAdapter,d)),t.allowClear&&(t.selectionAdapter=u.Decorate(t.selectionAdapter,p)),t.multiple&&(t.selectionAdapter=u.Decorate(t.selectionAdapter,h)),null==t.containerCssClass&&null==t.containerCss&&null==t.adaptContainerCssClass||(e=a(t.amdBase+"compat/containerCss"),t.selectionAdapter=u.Decorate(t.selectionAdapter,e)),t.selectionAdapter=u.Decorate(t.selectionAdapter,_)),t.language=this._resolveLanguage(t.language),t.language.push("en");for(var i=[],o=0;o<t.language.length;o++){var r=t.language[o];-1===i.indexOf(r)&&i.push(r)}return t.language=i,t.translations=this._processTranslations(t.language,t.debug),t},i.prototype.reset=function(){function n(t){return t.replace(/[^\u0000-\u007E]/g,function(t){return e[t]||t})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:u.escapeMarkup,language:{},matcher:function t(e,i){if(""===l.trim(e.term))return i;if(i.children&&0<i.children.length){for(var o=l.extend(!0,{},i),r=i.children.length-1;0<=r;r--)null==t(e,i.children[r])&&o.children.splice(r,1);return 0<o.children.length?o:t(e,o)}var a=n(i.text).toUpperCase(),s=n(e.term).toUpperCase();return-1<a.indexOf(s)?i:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},i.prototype.applyFromElement=function(t,e){var i=t.language,o=this.defaults.language,r=e.prop("lang"),e=e.closest("[lang]").prop("lang"),r=Array.prototype.concat.call(this._resolveLanguage(r),this._resolveLanguage(i),this._resolveLanguage(o),this._resolveLanguage(e));return t.language=r,t},i.prototype._resolveLanguage=function(t){if(!t)return[];if(l.isEmptyObject(t))return[];if(l.isPlainObject(t))return[t];for(var e,i=l.isArray(t)?t:[t],o=[],r=0;r<i.length;r++)o.push(i[r]),"string"==typeof i[r]&&0<i[r].indexOf("-")&&(e=i[r].split("-")[0],o.push(e));return o},i.prototype._processTranslations=function(t,e){for(var i=new f,o=0;o<t.length;o++){var r=new f,a=t[o];if("string"==typeof a)try{r=f.loadPath(a)}catch(t){try{a=this.defaults.amdLanguageBase+a,r=f.loadPath(a)}catch(t){e&&window.console&&console.warn&&console.warn('Select2: The language file for "'+a+'" could not be automatically loaded. A fallback will be used instead.')}}else r=l.isPlainObject(a)?new f(a):a;i.extend(r)}return i},i.prototype.set=function(t,e){var i={},t=(i[l.camelCase(t)]=e,u._convertData(i));l.extend(!0,this.defaults,t)},new i}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(i,c,o,d){function t(t,e){this.options=t,null!=e&&this.fromElement(e),null!=e&&(this.options=o.applyFromElement(this.options,e)),this.options=o.apply(this.options),e&&e.is("input")&&(t=i(this.get("amdBase")+"compat/inputData"),this.options.dataAdapter=d.Decorate(this.options.dataAdapter,t))}return t.prototype.fromElement=function(t){var e=["select2"],i=(null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),d.GetData(t[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(t[0],"data",d.GetData(t[0],"select2Tags")),d.StoreData(t[0],"tags",!0)),d.GetData(t[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",d.GetData(t[0],"ajaxUrl")),d.StoreData(t[0],"ajax-Url",d.GetData(t[0],"ajaxUrl"))),{});function o(t,e){return e.toUpperCase()}for(var r=0;r<t[0].attributes.length;r++){var a=t[0].attributes[r].name,s="data-";a.substr(0,s.length)==s&&(a=a.substring(s.length),s=d.GetData(t[0],a),i[a.replace(/-([a-z])/g,o)]=s)}c.fn.jquery&&"1."==c.fn.jquery.substr(0,2)&&t[0].dataset&&(i=c.extend(!0,{},t[0].dataset,i));var n,l=c.extend(!0,{},d.GetData(t[0]),i);for(n in l=d._convertData(l))-1<c.inArray(n,e)||(c.isPlainObject(this.options[n])?c.extend(this.options[n],l[n]):this.options[n]=l[n]);return this},t.prototype.get=function(t){return this.options[t]},t.prototype.set=function(t,e){this.options[t]=e},t}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(a,r,s,o){function n(t,e){null!=s.GetData(t[0],"select2")&&s.GetData(t[0],"select2").destroy(),this.$element=t,this.id=this._generateId(t),this.options=new r(e=e||{},t),n.__super__.constructor.call(this);var e=t.attr("tabindex")||0,e=(s.StoreData(t[0],"old-tabindex",e),t.attr("tabindex","-1"),this.options.get("dataAdapter")),e=(this.dataAdapter=new e(t,this.options),this.render()),i=(this._placeContainer(e),this.options.get("selectionAdapter")),i=(this.selection=new i(t,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,e),this.options.get("dropdownAdapter")),i=(this.dropdown=new i(t,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,e),this.options.get("resultsAdapter")),o=(this.results=new i(t,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown),this);this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(t){o.trigger("selection:update",{data:t})}),t.addClass("select2-hidden-accessible"),t.attr("aria-hidden","true"),this._syncAttributes(),s.StoreData(t[0],"select2",this),t.data("select2",this)}return s.Extend(n,s.Observable),n.prototype._generateId=function(t){return"select2-"+(null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+s.generateChars(2):s.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},n.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},n.prototype._resolveWidth=function(t,e){var i=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e)return null!=(o=this._resolveWidth(t,"style"))?o:this._resolveWidth(t,"element");if("element"==e)return(o=t.outerWidth(!1))<=0?"auto":o+"px";if("style"!=e)return"computedstyle"!=e?e:window.getComputedStyle(t[0]).width;var o=t.attr("style");if("string"==typeof o)for(var r=o.split(";"),a=0,s=r.length;a<s;a+=1){var n=r[a].replace(/\s/g,"").match(i);if(null!==n&&1<=n.length)return n[1]}return null},n.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},n.prototype._registerDomEvents=function(){var e=this,t=(this.$element.on("change.select2",function(){e.dataAdapter.current(function(t){e.trigger("selection:update",{data:t})})}),this.$element.on("focus.select2",function(t){e.trigger("focus",t)}),this._syncA=s.bind(this._syncAttributes,this),this._syncS=s.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA),window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver);null!=t?(this._observer=new t(function(t){e._syncA(),e._syncS(null,t)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},n.prototype._registerDataEvents=function(){var i=this;this.dataAdapter.on("*",function(t,e){i.trigger(t,e)})},n.prototype._registerSelectionEvents=function(){var i=this,o=["toggle","focus"];this.selection.on("toggle",function(){i.toggleDropdown()}),this.selection.on("focus",function(t){i.focus(t)}),this.selection.on("*",function(t,e){-1===a.inArray(t,o)&&i.trigger(t,e)})},n.prototype._registerDropdownEvents=function(){var i=this;this.dropdown.on("*",function(t,e){i.trigger(t,e)})},n.prototype._registerResultsEvents=function(){var i=this;this.results.on("*",function(t,e){i.trigger(t,e)})},n.prototype._registerEvents=function(){var i=this;this.on("open",function(){i.$container.addClass("select2-container--open")}),this.on("close",function(){i.$container.removeClass("select2-container--open")}),this.on("enable",function(){i.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){i.$container.addClass("select2-container--disabled")}),this.on("blur",function(){i.$container.removeClass("select2-container--focus")}),this.on("query",function(e){i.isOpen()||i.trigger("open",{}),this.dataAdapter.query(e,function(t){i.trigger("results:all",{data:t,query:e})})}),this.on("query:append",function(e){this.dataAdapter.query(e,function(t){i.trigger("results:append",{data:t,query:e})})}),this.on("keypress",function(t){var e=t.which;i.isOpen()?e===o.ESC||e===o.TAB||e===o.UP&&t.altKey?(i.close(t),t.preventDefault()):e===o.ENTER?(i.trigger("results:select",{}),t.preventDefault()):e===o.SPACE&&t.ctrlKey?(i.trigger("results:toggle",{}),t.preventDefault()):e===o.UP?(i.trigger("results:previous",{}),t.preventDefault()):e===o.DOWN&&(i.trigger("results:next",{}),t.preventDefault()):(e===o.ENTER||e===o.SPACE||e===o.DOWN&&t.altKey)&&(i.open(),t.preventDefault())})},n.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},n.prototype._isChangeMutation=function(t,e){var i=!1,o=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(e)if(e.addedNodes&&0<e.addedNodes.length)for(var r=0;r<e.addedNodes.length;r++)e.addedNodes[r].selected&&(i=!0);else e.removedNodes&&0<e.removedNodes.length?i=!0:a.isArray(e)&&a.each(e,function(t,e){if(o._isChangeMutation(t,e))return!(i=!0)});else i=!0;return i}},n.prototype._syncSubtree=function(t,e){var t=this._isChangeMutation(t,e),i=this;t&&this.dataAdapter.current(function(t){i.trigger("selection:update",{data:t})})},n.prototype.trigger=function(t,e){var i=n.__super__.trigger,o={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===e&&(e={}),t in o){var r={prevented:!1,name:t,args:e};if(i.call(this,o[t],r),r.prevented)return void(e.prevented=!0)}i.call(this,t,e)},n.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},n.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},n.prototype.close=function(t){this.isOpen()&&this.trigger("close",{originalEvent:t})},n.prototype.isEnabled=function(){return!this.isDisabled()},n.prototype.isDisabled=function(){return this.options.get("disabled")},n.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},n.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},n.prototype.focus=function(t){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},n.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');t=!(t=null!=t&&0!==t.length?t:[!0])[0];this.$element.prop("disabled",t)},n.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},n.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();t=t[0];a.isArray(t)&&(t=a.map(t,function(t){return t.toString()})),this.$element.val(t).trigger("input").trigger("change")},n.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",s.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),s.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},n.prototype.render=function(){var t=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),s.StoreData(t[0],"element",this.$element),t},n}),t.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(t,e,i){var o,r,a=[];(o=s.trim(t.attr("class")))&&s((o=""+o).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&a.push(this)}),(o=s.trim(e.attr("class")))&&s((o=""+o).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=i(this))&&a.push(r)}),t.attr("class",a.join(" "))}}}),t.define("select2/compat/containerCss",["jquery","./utils"],function(a,s){function n(t){return null}function t(){}return t.prototype.render=function(t){var i,t=t.call(this),e=this.options.get("containerCssClass")||"",o=(a.isFunction(e)&&(e=e(this.$element)),this.options.get("adaptContainerCssClass")),r=(o=o||n,-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),i=o,o=function(t){var e=i(t);return null!=e?e+" "+t:t}),this.options.get("containerCss")||{});return a.isFunction(r)&&(r=r(this.$element)),s.syncCssClasses(t,this.$element,o),t.css(r),t.addClass(e),t},t}),t.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,s){function n(t){return null}function t(){}return t.prototype.render=function(t){var i,t=t.call(this),e=this.options.get("dropdownCssClass")||"",o=(a.isFunction(e)&&(e=e(this.$element)),this.options.get("adaptDropdownCssClass")),r=(o=o||n,-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),i=o,o=function(t){var e=i(t);return null!=e?e+" "+t:t}),this.options.get("dropdownCss")||{});return a.isFunction(r)&&(r=r(this.$element)),s.syncCssClasses(t,this.$element,o),t.css(r),t.addClass(e),t},t}),t.define("select2/compat/initSelection",["jquery"],function(o){function t(t,e,i){i.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=i.get("initSelection"),this._isInitialized=!1,t.call(this,e,i)}return t.prototype.current=function(t,e){var i=this;this._isInitialized?t.call(this,e):this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,o.isArray(t)||(t=[t]),e(t)})},t}),t.define("select2/compat/inputData",["jquery","../utils"],function(a,i){function t(t,e,i){this._currentData=[],this._valueSeparator=i.get("valueSeparator")||",","hidden"===e.prop("type")&&i.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),t.call(this,e,i)}return t.prototype.current=function(t,e){for(var i=[],o=0;o<this._currentData.length;o++){var r=this._currentData[o];i.push.apply(i,function t(e,i){var o=[];return e.selected||-1!==a.inArray(e.id,i)?(e.selected=!0,o.push(e)):e.selected=!1,e.children&&o.push.apply(o,t(e.children,i)),o}(r,this.$element.val().split(this._valueSeparator)))}e(i)},t.prototype.select=function(t,e){var i;this.options.get("multiple")?(i=this.$element.val(),i+=this._valueSeparator+e.id,this.$element.val(i)):(this.current(function(t){a.map(t,function(t){t.selected=!1})}),this.$element.val(e.id)),this.$element.trigger("input").trigger("change")},t.prototype.unselect=function(t,r){var a=this;r.selected=!1,this.current(function(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];r.id!=o.id&&e.push(o.id)}a.$element.val(e.join(a._valueSeparator)),a.$element.trigger("input").trigger("change")})},t.prototype.query=function(t,e,i){for(var o=[],r=0;r<this._currentData.length;r++){var a=this._currentData[r],a=this.matches(e,a);null!==a&&o.push(a)}i({results:o})},t.prototype.addOptions=function(t,e){e=a.map(e,function(t){return i.GetData(t[0],"data")});this._currentData.push.apply(this._currentData,e)},t}),t.define("select2/compat/matcher",["jquery"],function(s){return function(a){return function(t,e){var i=s.extend(!0,{},e);if(null==t.term||""===s.trim(t.term))return i;if(e.children){for(var o=e.children.length-1;0<=o;o--){var r=e.children[o];a(t.term,r.text,r)||i.children.splice(o,1)}if(0<i.children.length)return i}return a(t.term,e.text,e)?i:null}}}),t.define("select2/compat/query",[],function(){function t(t,e,i){i.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.callback=i,this.options.get("query").call(null,e)},t}),t.define("select2/dropdown/attachContainer",[],function(){function t(t,e,i){t.call(this,e,i)}return t.prototype.position=function(t,e,i){i.find(".dropdown-wrapper").append(e),e.addClass("select2-dropdown--below"),i.addClass("select2-container--below")},t}),t.define("select2/dropdown/stopPropagation",[],function(){function t(){}return t.prototype.bind=function(t,e,i){t.call(this,e,i),this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(t){t.stopPropagation()})},t}),t.define("select2/selection/stopPropagation",[],function(){function t(){}return t.prototype.bind=function(t,e,i){t.call(this,e,i),this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(t){t.stopPropagation()})},t}),r=function(c){var d,p,t=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],e="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],h=Array.prototype.slice;if(c.event.fixHooks)for(var i=t.length;i;)c.event.fixHooks[t[--i]]=c.event.mouseHooks;var _=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=e.length;t;)this.addEventListener(e[--t],o,!1);else this.onmousewheel=o;c.data(this,"mousewheel-line-height",_.getLineHeight(this)),c.data(this,"mousewheel-page-height",_.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=e.length;t;)this.removeEventListener(e[--t],o,!1);else this.onmousewheel=null;c.removeData(this,"mousewheel-line-height"),c.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var t=c(t),e=t["offsetParent"in c.fn?"offsetParent":"parent"]();return e.length||(e=c("body")),parseInt(e.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(t){return c(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function o(t){var e,i=t||window.event,o=h.call(arguments,1),r=0,a=0,s=0,n=0,l=0;if((t=c.event.fix(i)).type="mousewheel","detail"in i&&(s=-1*i.detail),"wheelDelta"in i&&(s=i.wheelDelta),"wheelDeltaY"in i&&(s=i.wheelDeltaY),"wheelDeltaX"in i&&(a=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(a=-1*s,s=0),r=0===s?a:s,"deltaY"in i&&(r=s=-1*i.deltaY),"deltaX"in i&&(a=i.deltaX,0===s)&&(r=-1*a),0!==s||0!==a)return 1===i.deltaMode?(r*=e=c.data(this,"mousewheel-line-height"),s*=e,a*=e):2===i.deltaMode&&(r*=e=c.data(this,"mousewheel-page-height"),s*=e,a*=e),e=Math.max(Math.abs(s),Math.abs(a)),(!p||e<p)&&f(i,p=e)&&(p/=40),f(i,e)&&(r/=40,a/=40,s/=40),r=Math[1<=r?"floor":"ceil"](r/p),a=Math[1<=a?"floor":"ceil"](a/p),s=Math[1<=s?"floor":"ceil"](s/p),_.settings.normalizeOffset&&this.getBoundingClientRect&&(i=this.getBoundingClientRect(),n=t.clientX-i.left,l=t.clientY-i.top),t.deltaX=a,t.deltaY=s,t.deltaFactor=p,t.offsetX=n,t.offsetY=l,t.deltaMode=0,o.unshift(t,r,a,s),d&&clearTimeout(d),d=setTimeout(u,200),(c.event.dispatch||c.event.handle).apply(this,o)}function u(){p=null}function f(t,e){return _.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120==0}c.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})},"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],r):"object"==typeof exports?module.exports=r:r(e),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,t,a,e,s){var n;return null==r.fn.select2&&(n=["open","close","destroy"],r.fn.select2=function(e){if("object"==typeof(e=e||{}))return this.each(function(){var t=r.extend(!0,{},e);new a(r(this),t)}),this;if("string"!=typeof e)throw new Error("Invalid arguments for Select2: "+e);var i,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=s.GetData(this,"select2");null==t&&window.console&&console.error&&console.error("The select2('"+e+"') method was called on an element that is not using Select2."),i=t[e].apply(t,o)}),-1<r.inArray(e,n)?this:i}),null==r.fn.select2.defaults&&(r.fn.select2.defaults=e),a});var t,h,a,s,_,u,f,m,g,b,i,o,v,r,n={define:t.define,require:t.require},l=n.require("jquery.select2");function y(t,e){return i.call(t,e)}function c(t,e){var i,o,r,a,s,n,l,c,d,p,h=e&&e.split("/"),_=g.map,u=_&&_["*"]||{};if(t){for(e=(t=t.split("/")).length-1,g.nodeIdCompat&&v.test(t[e])&&(t[e]=t[e].replace(v,"")),"."===t[0].charAt(0)&&h&&(t=h.slice(0,h.length-1).concat(t)),c=0;c<t.length;c++)if("."===(p=t[c]))t.splice(c,1),--c;else if(".."===p){if(0===c||1===c&&".."===t[2]||".."===t[c-1])continue;0<c&&(t.splice(c-1,2),c-=2)}t=t.join("/")}if((h||u)&&_){for(c=(i=t.split("/")).length;0<c;--c){if(o=i.slice(0,c).join("/"),h)for(d=h.length;0<d;--d)if(r=(r=_[h.slice(0,d).join("/")])&&r[o]){a=r,s=c;break}if(a)break;!n&&u&&u[o]&&(n=u[o],l=c)}!a&&n&&(a=n,s=l),a&&(i.splice(0,s,a),t=i.join("/"))}return t}function x(e,i){return function(){var t=o.call(arguments,0);return"string"!=typeof t[0]&&1===t.length&&t.push(null),s.apply(h,t.concat([e,i]))}}function w(t){var e;if(y(m,t)&&(e=m[t],delete m[t],b[t]=!0,a.apply(h,e)),y(f,t)||y(b,t))return f[t];throw new Error("No "+t)}function d(t){var e,i=t?t.indexOf("!"):-1;return-1<i&&(e=t.substring(0,i),t=t.substring(i+1,t.length)),[e,t]}function k(t){return t?d(t):[]}return e.fn.select2.amd=n,l});var berocket_filters={};function berocket_make_args_array(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e}function berocket_apply_filters(t,i){var o;return void 0!==berocket_filters[t]&&((o=berocket_make_args_array(arguments)).splice(0,1),jQuery.each(berocket_filters[t],function(t,e){i=e.callback.apply(null,o),o[0]=i})),i}function berocket_do_action(t){var i;void 0!==berocket_filters[t]&&((i=berocket_make_args_array(arguments)).splice(0,1),jQuery.each(berocket_filters[t],function(t,e){e.callback.apply(null,i)}))}function berocket_throw_error(t){var e="berocket_throw_error";if(error_exist=!0,void 0!==berocket_filters[e]){for(var i=[error_exist],o=0;o<arguments.length;o++)i.push(arguments[o]);jQuery.each(berocket_filters[e],function(t,e){if(error_exist=e.callback.apply(null,i),!(i[0]=error_exist))return!1})}return error_exist}function berocket_add_filter(t,i,o){void 0===o&&(o=10),void 0===berocket_filters[t]&&(berocket_filters[t]=[]);var r=!1;jQuery.each(berocket_filters[t],function(t,e){e.priority===o&&e.callback===i&&(r=!0)}),r||(berocket_filters[t].push({callback:i,priority:o}),berocket_filters[t]=berocket_sort_by_priority(berocket_filters[t]))}function berocket_remove_filter(t,i,o){var r;void 0===o&&(o=10),void 0!==berocket_filters[t]&&(r=[],jQuery.each(berocket_filters[t],function(t,e){e.priority===o&&e.callback===i||r.push(e)}),berocket_filters[t]=berocket_sort_by_priority(r))}function berocket_sort_by_priority(t){return Array.isArray(t)&&t.sort(function(t,e){return t.priority>e.priority?1:t.priority<e.priority?-1:0}),t}function berocket_format_number(t,i){var e,o;return void 0===i&&(i=the_ajax_script.number_style),NaN===(t=parseFloat(t))?"0":(o=(e=(t=(t=t.toFixed(i[2])).toString()).split("."))[0],-1!=t.indexOf(".")&&(e=e[1]),o=o.replace(/\d(?=(?:\d{3})+(?:$))/g,function(t,e){return t+i[0]}),-1!=t.indexOf(".")?o+i[1]+e:o)}berocket_add_filter("compat_filters_result_single",function(t){return"object"==typeof t&&"string"==typeof t.taxonomy&&"pa_"==t.taxonomy.substr(0,3)&&(t.taxonomy=t.taxonomy.substr(3)),t}),jQuery(document).trigger("berocket_hooks_ready");var braapf_filters_var,braapf_ajax_request,braapf_checkbox_same,braapf_update_products,braapf_grab_all,braapf_grab_single,braapf_compact_filters,braapf_compat_filters_to_string,braapf_build_url_from_urldata,braapf_apply_additional_filter_data,braapf_glue_by_operator,braapf_ajax_load_from_url,braapf_ajax_load_from_url_request,braapf_init_load,braapf_remove_pages_from_url_data,braapf_filter_products_by_url,braapf_get_current_url_data,braapf_reset_buttons_hide,bapf_universal_theme_compatibility,braapf_disable_ajax_loading,braapf_close_tippy,braapf_context_is_update,braapf_get_current_filters,braapf_filters_url_decode,braapf_scroll_shop_to_top,braapf_set_filters_to_link,braapf_convert_ckbox_to_radio,braapf_hierarhical_save,braapf_hierarhical_set,braapf_collapse_status_save,braapf_collapse_status_set,braapf_show_hide_values_save,braapf_show_hide_values_set,braapf_child_parent_grab_single,braapf_child_parent_fix_selected,braapf_child_parent_load_with_update_button,braapf_check_partial_load_filters,braapf_add_loader_element,braapf_remove_loader_element,braapf_elementor_sticky_fix,baapfGet_wprocketInstance,brapf_jet_smart_filters_add,brapf_jet_smart_filters_remove_pages,brapf_jet_smart_filters,braapf_init_ion_slidr,braapf_ion_slidr_same,braapf_jqrui_slidr_ion_value_wc_price,braapf_jqrui_slidr_ion_value_arr_attr,braapf_init_ion_slidr_for_parent,braapf_grab_single_ion,braapf_jqrui_slidr_ion_values_link_arr_attr,braapf_grab_single_select,bapf_select2_init,bapf_select2_init_for_parent,bapf_select2_disable_for_parent,braapf_init_jqrui_slidr,braapf_jqrui_slidr_same,braapf_jqrui_slidr_values_wc_price,braapf_init_jqrui_slidr_for_parent,braapf_grab_single_jqrui,braapf_jqrui_slidr_values_arr_attr,braapf_jqrui_slidr_values_link_arr_attr,braapf_filter_blocked=!1,braapf_selected_filters=[],braapf_filtered_filters=[];function braapf_grab_all_init(){braapf_grab_all()}function braapf_selected_filters_area_set_init(){braapf_selected_filters_area_set()}function braapf_filtered_filters_set(){berocket_do_action("braapf_init_filtered_set",braapf_filtered_filters=braapf_selected_filters.slice())}(h=>{function e(t){return berocket_remove_filter("ajax_load_from_url_beforeSend",e),t.setRequestHeader("X-Braapfdisable","1"),t}h(document).on("change",".bapf_sfilter.bapf_ckbox input[type=checkbox]",function(){var t=h(this).val(),e=h(this).parents(".bapf_sfilter").data("taxonomy"),i=h(this).prop("checked");braapf_checkbox_same(e,t,i),berocket_do_action("input_ckbox_changed",this,e,t,i),berocket_apply_filters("filter_changed_element",{element:"#"+h(this).attr("id"),parent:1,find:!1},h(this)),berocket_do_action("update_products","filter",h(this))}),braapf_checkbox_same=function(t,e,i){h('.bapf_sfilter[data-taxonomy="'+t+'"] input[value="'+e+'"]').prop("checked",i),h('.bapf_sfilter[data-taxonomy="'+t+'"]').length>h('.bapf_sfilter.bapf_ckbox[data-taxonomy="'+t+'"]').length&&berocket_throw_error("multiple_filters_for_same_taxonomy",t)},h(document).on("braapf_unselect",".bapf_ckbox",function(t,e){var i,o;0<(e=0==(e=void 0===e?!1:e)?h(this).find("input[type=checkbox]"):h(this).find('input[value="'+e.value+'"]')).length&&(i=e.val(),o=h(this).data("taxonomy"),e.prop("checked",!1),braapf_checkbox_same(o,i,!1))}),h(document).on("braapf_unselect_all",".bapf_ckbox",function(t,e){h(this).trigger("braapf_unselect",!1)}),h(document).on("berocket_filters_document_ready",function(){h(".bapf_ckbox input[type=checkbox]:checked").closest("li").parents("li").trigger("bapf_ochild")}),h(document).on("click",".berocket_aapf_widget_update_button, .bapf_update",function(t){t.preventDefault(),berocket_do_action("update_products","update",h(this))}),h(document).on("click",".berocket_aapf_reset_button, .bapf_reset",function(t){t.preventDefault(),braapf_unselect_all(),berocket_do_action("update_products","reset_all",h(this))}),berocket_add_filter("braapf_init",braapf_reset_buttons_hide=function(){berocket_apply_filters("bapf_rst_nofltr_hide",void 0===braapf_filtered_filters||braapf_filtered_filters.length<=0)?h(".bapf_rst_nofltr").hide():h(".bapf_rst_nofltr").show();var i=!1;void 0!==braapf_filtered_filters&&0<braapf_filtered_filters.length&&h.each(braapf_filtered_filters,function(t,e){if(0<e.values.length)return!(i=!0)}),berocket_apply_filters("bapf_rst_sel_show",i)?h(".bapf_rst_sel").show():h(".bapf_rst_sel").hide()},1500),berocket_add_filter("braapf_init_filtered_set",braapf_reset_buttons_hide,1500),jQuery(document).ready(function(){var t=the_ajax_script.pagination_class;t=berocket_apply_filters("pagination_links_a_tags",(t=t.replaceAll(","," a,"))+" a",the_ajax_script.pagination_class),!the_ajax_script.disable_ajax_loading&&the_ajax_script.pagination_ajax&&h(the_ajax_script.products_holder_id).length&&h(document).on("click",t,function(t){t.preventDefault();t=h(this).attr("href"),t=berocket_apply_filters("pagination_href_from_clicked_a",decodeURI(t),h(this));braapf_change_url_history_api(t,{replace:the_ajax_script.seo_friendly_urls}),berocket_add_filter("ajax_load_from_url_beforeSend",e),braapf_ajax_load_from_url(t,{},berocket_apply_filters("ajax_load_from_pagination",{done:[braapf_replace_products,braapf_replace_pagination,braapf_replace_result_count,braapf_init_load,braapf_update_data_from_current,braapf_update_seo_elements]},t))})}),jQuery(document).ready(function(){!the_ajax_script.disable_ajax_loading&&the_ajax_script.control_sorting&&h(document).on("submit",the_ajax_script.ordering_class,function(t){t.preventDefault();var i,o=braapf_get_current_url_data(),o=braapf_remove_pages_from_url_data(o),t=(Array.isArray(o.queryargs)?(i=[],h.each(o.queryargs,function(t,e){"orderby"!=e.name&&i.push(e)}),o.queryargs=i):o.queryargs=[],h(this).serializeArray()),t=(Array.isArray(t)&&h.each(t,function(t,e){"paged"==e.name?o.page=parseInt(e.value):"orderby"==e.name&&the_ajax_script.default_sorting==e.value||o.queryargs.push(e)}),braapf_build_url_from_urldata(o));braapf_filter_products_by_url(t)})}),braapf_get_filters_selected=function(){braapf_grab_all();var t=braapf_compact_filters(),e=berocket_apply_filters("braapf_filters_mask",the_ajax_script.url_mask);return braapf_compat_filters_to_string(t,e,the_ajax_script.url_split)},braapf_get_url_with_filters_selected=function(){var t=braapf_get_filters_selected(),e=braapf_get_current_url_data();return e.filter=t,e=braapf_remove_pages_from_url_data(e),e=braapf_apply_additional_filter_data(e),braapf_build_url_from_urldata(e)},braapf_update_products=function(t,e){t=berocket_apply_filters("before_update_products_context",t=void 0===t?"filter":t,e=void 0===e?!1:e);var i=berocket_apply_filters("before_update_products_context_url_filtered",braapf_get_url_with_filters_selected(),t,e);berocket_apply_filters("apply_filters_to_page",0==h(".berocket_aapf_widget_update_button:visible, .bapf_update:visible").length||braapf_context_is_update(t),t,e,i)?(braapf_selected_filters_area_set(),braapf_filter_products_by_url(i)):berocket_apply_filters("apply_filters_to_page_partial",!1,t,e,i)&&braapf_ajax_load_from_url(berocket_apply_filters("before_update_products_context_url_filtered_partial",i,t,e),{},berocket_apply_filters("ajax_load_from_filters_partial",{done:[braapf_replace_each_filter,braapf_init_load]},i,"partial"),"partial")},braapf_context_is_update=function(t){return berocket_apply_filters("context_is_update","update"==t||"reset_all"==t||"reset_single"==t,t)},braapf_filter_products_by_url=function(t){berocket_apply_filters("page_has_products_holder",!h(the_ajax_script.products_holder_id).length,t)?location.href=t:(braapf_change_url_history_api(t,{replace:the_ajax_script.seo_friendly_urls}),braapf_ajax_load_from_url(t,{},berocket_apply_filters("ajax_load_from_filters",{done:[braapf_replace_products,braapf_replace_pagination,braapf_replace_result_count,braapf_replace_orderby,braapf_replace_each_filter,braapf_init_load,braapf_filtered_filters_set,braapf_update_url_history_api_from_current,braapf_update_seo_elements]},t,"default")))},braapf_update_data_from_current=function(){braapf_grab_all();braapf_compact_filters()},braapf_update_url_history_api_from_current=function(t,e,i,o,r){the_ajax_script.seo_friendly_urls&&(url_filtered=braapf_get_url_with_filters_selected(),history.replaceState(history.state,"BeRocket Rules",url_filtered),o!=url_filtered)&&the_ajax_script.reload_changed_filters&&setTimeout(function(){braapf_filter_products_by_url(url_filtered)},5)},braapf_filter_mobile_desktop_filters=function(t){var e=berocket_apply_filters("filter_mobile_width",767),i=berocket_apply_filters("filter_tablet_width",1024);return t=h(window).width()<=e?t.filter(function(){return!h(this).is(".bapf_sngl_hd_mobile")&&!h(this).parents(".bapf_sngl_hd_mobile").length}):h(window).width()>e&&h(window).width()<=i?t.filter(function(){return!h(this).is(".bapf_sngl_hd_tablet")&&!h(this).parents(".bapf_sngl_hd_tablet").length}):t.filter(function(){return!h(this).is(".bapf_sngl_hd_desktop")&&!h(this).parents(".bapf_sngl_hd_desktop").length})},braapf_grab_all=function(t){var e,i=berocket_apply_filters("before_grab_all_filters",[],t=void 0===t?!1:t);berocket_apply_filters("filter_mobile_width",767),berocket_apply_filters("filter_tablet_width",1024);return e=!1===t?h(".bapf_sfilter"):h(t).find(".bapf_sfilter"),(e=braapf_filter_mobile_desktop_filters(e)).each(function(){var t=braapf_grab_single(this,i);!1!==t&&i.push(t)}),i=berocket_apply_filters("grab_all_filters",i,t),!1===t&&(braapf_selected_filters=i),i},braapf_grab_single=function(t,e,i){void 0===i&&(i=!1),t=h(t);var o=!1,r=!1,a=t.data("taxonomy");if(void 0===a||!a)return berocket_apply_filters("grab_single_filter_taxonomy_undefined",o,t,e);if(h.each(e,function(t,e){e.taxonomy==a&&(r=!0)}),!berocket_apply_filters("grab_single_filter_exist",r,t,e)){if(!1!==(o=berocket_apply_filters("grab_single_filter",o,t,e)))return o;var s,n=t.data("op"),l=t.data("name"),c=(void 0===l&&(l=""),braapf_glue_by_operator(n)),d=[],p=[];(s=i?t:(s=h('.bapf_sfilter[data-taxonomy="'+a+'"]'),braapf_filter_mobile_desktop_filters(s))).find("input:checked:not(:disabled)").each(function(t,e){-1==p.indexOf(h(this).val())&&(d.push({value:h(this).val(),html:h(this).data("name")}),p.push(h(this).val()))}),o={name:l,taxonomy:a,values:d,glue:c,operator:n}}return berocket_apply_filters("grab_single_filter_default",o,t,e,i)},braapf_glue_by_operator=function(t){"string"!=typeof t&&(t="");var e=the_ajax_script.operator_or;return berocket_apply_filters("glue_by_operator",e="and"==t.toLowerCase()?the_ajax_script.operator_and:e,t)},braapf_compact_filters=function(t){void 0===t&&(t=braapf_selected_filters);var e=[];return h.each(t,function(t,i){var o="";void 0!==i.customValuesLine?o=i.customValuesLine:h.each(i.values,function(t,e){o.length&&(o+=i.glue),o+=e.value}),o.length&&e.push(berocket_apply_filters("compat_filters_result_single",{taxonomy:i.taxonomy,values:o},i))}),berocket_apply_filters("compat_filters_result",e,t)},braapf_compat_filters_to_string=function(o,r,a){var s="";return h.each(o,function(t,e){s.length&&(s+=a);var i=r;i=(i=r.replace("%t%",e.taxonomy)).replace("%v%",e.values),s+=berocket_apply_filters("compat_filters_to_string_single",i,e,o,r,a)}),berocket_apply_filters("compat_filters_to_string",s,o,r,a)},braapf_get_current_url_data=function(t){i=void 0===t?(e=location.href.split("#")[0].split("?")[0],location.search.substring(1)):(e=t.split("#")[0].split("?")[0],1<t.split("#")[0].split("?").length?t.split("#")[0].split("?")[1]:"");var e,i,o=[],r=1,a=the_ajax_script.pagination_base+"\\/(\\d+)/?",a=new RegExp(a),s=e.match(a);return s&&"string"==typeof s[1]&&(r=parseInt(s[1]),e=e.replace(a,"")),i=i.split("&"),h.each(i,function(t,e){e.length&&(i[t]=e.split("="),"paged"==i[t][0]?r=parseInt(i[t][1]):o.push({name:i[t][0],value:i[t][1]}))}),berocket_apply_filters("get_current_url_data",{baselink:e,queryargs:o,filter:"",page:r},t,i)},braapf_remove_pages_from_url_data=function(t){var i;return t.page=1,Array.isArray(t.queryargs)&&(i=[],h.each(t.queryargs,function(t,e){"product-page"!=e.name&&i.push(e)}),t.queryargs=i),t=berocket_apply_filters("braapf_remove_pages_from_url_data",t)},braapf_apply_additional_filter_data=function(i,t){return void 0===t&&(t=braapf_selected_filters),h.each(t,function(t,e){i=berocket_apply_filters("apply_additional_filter_data",i,e)}),i},braapf_build_url_from_urldata=function(t,e){void 0===e&&(e=braapf_build_url_parameters_default());var i=berocket_apply_filters("url_from_urldata_baselink",t.baselink,t,e),o="";return t.queryargs.length&&h.each(t.queryargs,function(t,e){o.length&&(o+="&"),void 0!==e.name&&e.name.length&&void 0!==e.value&&(o+=e.name+"="+e.value)}),t.page&&1<t.page&&(o.length&&(o+="&"),o+="paged="+t.page),berocket_apply_filters("url_from_urldata_linkget",i+(o=o.length?"?"+o:o),t,e,i,o)},braapf_build_url_parameters_default=function(){return berocket_apply_filters("build_url_parameters_default",{})},braapf_replace_current_with_new=function(t,e,i){void 0===i&&(i={}),args={replace:!1},jQuery.extend(args,i),args=berocket_apply_filters("replace_current_with_new_args",args,t,e);var o=h("<div><div>"+t+"</div></div>").find(e),i=h(e);0!=i.length&&(o.length!=i.length&&0!=o.length&&berocket_throw_error("error_notsame_block_qty",e,o.length,i.length),0==o.length?(i.html("").addClass("braapfNotReplaced"),i.hide()):(i.each(function(t,e){void 0!==o[t]?args.replace?h(e).replaceWith(h(o[t])):h(e).html(h(o[t]).html()).removeClass("braapfNotReplaced"):h(e).html("").addClass("braapfNotReplaced")}),i.show()))},braapf_replace_products=function(t){var e=the_ajax_script.products_holder_id;h("<div><div>"+t+"</div></div>");h(".bapf_no_products").remove(),braapf_replace_current_with_new(t,e),h(".braapfNotReplaced").filter(e).length&&h(".braapfNotReplaced").filter(e).before(h(the_ajax_script.no_products))},braapf_replace_pagination=function(t){var e,i,o=the_ajax_script.pagination_class;0==h(o).length?(e=the_ajax_script.products_holder_id,(i=h("<div><div>"+t+"</div></div>").find(o).last()).length&&h(e).last().after(i)):braapf_replace_current_with_new(t,o,{type:"pagination"})},braapf_replace_result_count=function(t){var e,i,o=the_ajax_script.result_count_class;0==h(o).length?(e=the_ajax_script.products_holder_id,(i=h("<div><div>"+t+"</div></div>").find(o).last()).length&&h(e).last().before(i)):braapf_replace_current_with_new(t,o)},braapf_replace_orderby=function(t){var e,i,o=the_ajax_script.ordering_class;0==h(o).length?(e=the_ajax_script.products_holder_id,(i=h("<div><div>"+t+"</div></div>").find(o).last()).length&&h(e).last().before(i)):braapf_replace_current_with_new(t,o)},braapf_replace_each_filter=function(t){var i=o(i=h("<div><div>"+t+"</div></div>"));h(".berocket_single_filter_widget").each(function(){var t=h(this).data("id"),e=h(this).data("wid");h(".berocket_single_filter_widget_"+t+".bapf_wid_"+e).html(i.find(".berocket_single_filter_widget_"+t+".bapf_wid_"+e).last().html()),i.find(".berocket_single_filter_widget_"+t+".bapf_wid_"+e).last().is(".bapf_mt_none")?h(".berocket_single_filter_widget_"+t+".bapf_wid_"+e).addClass("bapf_mt_none"):h(".berocket_single_filter_widget_"+t+".bapf_wid_"+e).removeClass("bapf_mt_none")})},braapf_update_seo_elements=function(t){t=h("<div><div>"+t+"</div></div>");h("title").text(t.find("title").text()),h("h1").first().html(t.find("h1").first().html()),0<h(".bapf_page_title").length&&h(".bapf_page_title").first().html(t.find(".bapf_page_title").first().html())},braapf_change_url_history_api=function(t,e){void 0!==e&&e.replace&&(e={BeRocket:"Rules"},history.replaceState(e,""),history.pushState(e,"",t),history.pathname=t)},window.addEventListener("popstate",function(t){berocket_apply_filters("load_products_ajax_on_popstate",!0)&&null!=t.state&&"Rules"==t.state.BeRocket&&(t=location.href,berocket_apply_filters("page_has_products_holder",!h(the_ajax_script.products_holder_id).length,t)?location.href=t:braapf_ajax_load_from_url(t,{},berocket_apply_filters("ajax_load_from_filters",{done:[braapf_replace_products,braapf_replace_pagination,braapf_replace_result_count,braapf_replace_orderby,braapf_replace_each_filter,braapf_init_load,braapf_filtered_filters_set,braapf_update_data_from_current,braapf_update_seo_elements]},t,"default")))}),braapf_ajax_load_from_url=function(t,e,i,o){void 0===o&&(o="default"),"object"!=typeof e&&(e={}),void 0!==(i="object"!=typeof i?{done:[],fail:[],always:[]}:i).done&&Array.isArray(i.done)||(i.done=[]),void 0!==i.fail&&Array.isArray(i.fail)||(i.fail=[]),void 0!==i.always&&Array.isArray(i.always)||(i.always=[]),t=berocket_apply_filters("ajax_load_from_url_url",t,e,i,o),e=berocket_apply_filters("ajax_load_from_url_data",e,t,i,o),i=berocket_apply_filters("ajax_load_from_url_callback",i,t,e,o),braapf_ajax_load_from_url_request(t,e,i,o)};var i=!(braapf_ajax_load_from_url_request=function(a,e,s,n){h(document).trigger("berocket_ajax_filtering_start"),"object"==typeof braapf_ajax_request&&void 0!==braapf_ajax_request.abort&&braapf_ajax_request.abort(),braapf_ajax_request=h.ajax({method:"GET",url:a,data:e,beforeSend:function(t){berocket_apply_filters("ajax_load_from_url_beforeSend",t,a,e,s,n)}}).done(function(i,o,r){h(document).trigger("berocket_ajax_filtering_on_update"),i=berocket_apply_filters("ajax_load_from_url_done",i,a,e,s,n),h.each(s.done,function(t,e){e(i,o,r,a,n)}),i=berocket_apply_filters("ajax_load_from_url_done_after",i,a,e,s,n),h(document).trigger("berocket_ajax_products_loaded")}).fail(function(i,o,r){if("abort"==o)return!1;var t;h(document).trigger("berocket_ajax_products_not_loaded"),i=berocket_apply_filters("ajax_load_from_url_fail",i,a,e,s,n),h.each(s.fail,function(t,e){e(i,o,r,a,n)}),i=berocket_apply_filters("ajax_load_from_url_fail_after",i,a,e,s,n),"default"==n&&((t=jQuery.param(e))&&(a=1<a.split("?").length?a+"&"+t:a+"?"+t),location.href=a)}).always(function(i,o,r){i=berocket_apply_filters("ajax_load_from_url_always",i,a,e,s,n),h.each(s.always,function(t,e){e(i,o,r,a,n)}),i=berocket_apply_filters("ajax_load_from_url_always_after",i,a,e,s,n),h(document).trigger("berocket_ajax_filtering_end")})});function o(t){var e=berocket_apply_filters("filter_mobile_width",767),i=berocket_apply_filters("filter_tablet_width",1024);return t.find(".bapf_sngl_hd_mobile").show(),t.find(".bapf_sngl_hd_tablet").show(),t.find(".bapf_sngl_hd_desktop").show(),h(window).width()<=e?t.find(".bapf_sngl_hd_mobile").hide():h(window).width()>e&&h(window).width()<=i?t.find(".bapf_sngl_hd_tablet").hide():h(window).width()>i&&t.find(".bapf_sngl_hd_desktop").hide(),t}jQuery(document).on("berocket_ajax_products_loaded",function(){var t;i&&(t=(t=the_ajax_script.ordering_class).replaceAll(","," select,"),t+=" select",jQuery(t).select2({minimumResultsForSearch:-1}))}),braapf_init_load=function(){o(h("html")),h(".bapf_sfilter .bapf_body.bapf_mcs:not(.bapf_mcs_ready)").each(function(){h(this).css("max-height",h(this).data("mcs-h")).mCustomScrollbar({scrollInertia:300}).addClass("bapf_mcs_ready")}),h(".berocket_single_filter_widget").each(function(){var t,e=h(this).data("id");berocket_apply_filters("remove_same_filters_to_prevent_errors",1<h(".berocket_single_filter_widget_"+e).length,h(this),e)&&(0<(t=(t=h(".berocket_single_filter_widget_"+e).not(".bapf_sngl_hd_mobile").not(".bapf_sngl_hd_tablet")).not(t.first())).length&&(t.remove(),berocket_throw_error("same_filters_multiple_times",e)),0<(t=(t=h(".berocket_single_filter_widget_"+e).not(".bapf_sngl_hd_mobile").not(".bapf_sngl_hd_desktop")).not(t.first())).length&&(t.remove(),berocket_throw_error("same_filters_multiple_times",e)),0<(t=(t=h(".berocket_single_filter_widget_"+e).not(".bapf_sngl_hd_tablet").not(".bapf_sngl_hd_desktop")).not(t.first())).length)&&(t.remove(),berocket_throw_error("same_filters_multiple_times",e))}),h("body").on("click",".bapf_desci",function(t){t.stopPropagation()}),h("body").on("hover",".bapf_desci",function(t){t.stopPropagation()}),berocket_do_action("braapf_init",braapf_selected_filters),h(document).trigger("berocket_filters_first_load")},braapf_update_page_on_error=function(){berocket_apply_filters("update_page_on_error",!0)&&location.reload()},braapf_selected_filters_area_set=function(){var r;void 0!==braapf_filtered_filters&&0<braapf_filtered_filters.length&&(r="",h.each(braapf_filtered_filters,function(t,i){var e,o;0<i.values.length&&(e='<div class="bapf_sfa_taxonomy"><span>'+(i=berocket_apply_filters("default_selected_filters_area_single_taxonomy",i)).name+"</span>",e+="<ul>",o="",h.each(i.values,function(t,e){o+=berocket_apply_filters("default_selected_filters_area_single",'<li><a href="#unselect_'+e.value+'" class="braapf_unselect" data-taxonomy="'+i.taxonomy+'" data-value="'+e.value+'"><i class="fa fa-times"></i> '+e.html+"</a></li>",e)}),r+=berocket_apply_filters("default_selected_filters_area_single_taxonomy",e=e+o+"</ul></div>",i,o))}),h(".berocket_aapf_widget_selected_area").parents(".berocket_single_filter_widget").removeClass("bapf_mt_none"),r?(h(".bapf_sfa_mt_hide").show().parent().removeClass("bapf_mt_none"),r=berocket_apply_filters("default_selected_filters_area_full_exist",'<div class="berocket_aapf_widget_selected_filter">'+r+'<ul class="bapf_sfa_unall"><li><a href="#Unselect_all" class="braapf_unselect_all"><i class="fa fa-times"></i> '+the_ajax_script.translate.unselect_all+"</a></li></ul>",r,braapf_filtered_filters)):(r=berocket_apply_filters("default_selected_filters_area_full_notexist",the_ajax_script.translate.nothing_selected,r,braapf_filtered_filters),h(".bapf_sfa_mt_hide").hide().parent().addClass("bapf_mt_none")),h(".berocket_aapf_widget_selected_area").html(r))},h(document).on("click",".berocket_aapf_widget_selected_area .braapf_unselect",function(t){t.preventDefault(),h('.bapf_sfilter[data-taxonomy="'+h(this).data("taxonomy")+'"]').trigger("braapf_unselect",h(this).data()),berocket_do_action("update_products","reset_single",h(this))}),braapf_unselect_all=function(){braapf_grab_all(),void 0!==braapf_selected_filters&&0<braapf_selected_filters.length&&h.each(braapf_selected_filters,function(t,e){0<e.values.length&&h('.bapf_sfilter[data-taxonomy="'+e.taxonomy+'"]').trigger("braapf_unselect_all",e)})},h(document).on("click",".berocket_aapf_widget_selected_area .braapf_unselect_all",function(t){t.preventDefault(),braapf_unselect_all(),berocket_do_action("update_products","reset_all",h(this))}),berocket_add_filter("braapf_init",braapf_grab_all_init,1e3),berocket_add_filter("braapf_init",braapf_selected_filters_area_set_init,1100),berocket_add_filter("braapf_init_filtered_set",braapf_selected_filters_area_set_init,1100),braapf_reload_page_for_products_error=function(t,e){return e==the_ajax_script.products_holder_id&&braapf_update_page_on_error(),t},berocket_add_filter("ajax_load_from_url_beforeSend",function(t){return t.setRequestHeader("X-Braapf","1"),t}),berocket_add_filter("ajax_load_from_url_beforeSend",function(t){var e=(e=the_ajax_script.ordering_class).replaceAll(","," select,");return e+=" select",jQuery(e).data("select2")&&(i=!0),t}),berocket_add_filter("update_products",braapf_update_products),berocket_add_filter("error_notsame_block_qty",braapf_reload_page_for_products_error),bapf_universal_theme_compatibility=function(t){if(berocket_apply_filters("universal_theme_compatibility",!0)){h(window).trigger("resize");try{berocket_apply_filters("uncode_theme_compatibility","object"==typeof UNCODE&&"function"==typeof UNCODE.init)&&UNCODE.init()}catch(t){berocket_throw_error("uncode_theme_compatibility",t)}try{berocket_apply_filters("flatsome_theme_compatibility","object"==typeof Flatsome&&"function"==typeof Flatsome.attach&&jQuery(the_ajax_script.products_holder_id).length)&&Flatsome.attach(jQuery(the_ajax_script.products_holder_id))}catch(t){berocket_throw_error("flatsome_theme_compatibility",t)}try{berocket_apply_filters("woodmart_theme_compatibility","object"==typeof woodmartThemeModule&&"function"==typeof woodmartThemeModule.init)&&(woodmartThemeModule.wooInit(),woodmartThemeModule.lazyLoading(),woodmartThemeModule.productsLoadMore())}catch(t){berocket_throw_error("woodmart_theme_compatibility",t)}try{berocket_apply_filters("divi_theme_compatibility","function"==typeof et_reinit_waypoint_modules)&&et_reinit_waypoint_modules()}catch(t){berocket_throw_error("divi_theme_compatibility",t)}try{berocket_apply_filters("rey_theme_compatibility","object"==typeof jQuery.reyTheme&&"function"==typeof jQuery.reyTheme.init)&&jQuery.reyTheme.init()}catch(t){berocket_throw_error("rey_theme_compatibility",t)}try{berocket_apply_filters("layzyloadimage_script_compatibility","function"==typeof layzyLoadImage)&&layzyLoadImage()}catch(t){berocket_throw_error("layzyloadimage_script_compatibility",t)}try{berocket_apply_filters("jetpacklazyimages_script_compatibility","function"==typeof jetpackLazyImagesModule)&&jetpackLazyImagesModule()}catch(t){berocket_throw_error("jetpacklazyimages_script_compatibility",t)}try{jQuery("img.jetpack-lazy-image").each(function(){jQuery(this).removeClass("jetpack-lazy-image").attr("src",jQuery(this).data("lazy-src")),jQuery(this).removeClass("jetpack-lazy-image").attr("srcset","")})}catch(t){berocket_throw_error("jetpacklazyimages_script_compatibility",t)}try{berocket_apply_filters("swift_script_compatibility","object"==typeof SWIFT&&"object"==typeof SWIFT.woocommerce&&"function"==typeof SWIFT.woocommerce.init)&&SWIFT.woocommerce.init()}catch(t){berocket_throw_error("swift_script_compatibility",t)}try{void 0!==baapfGet_wprocketInstance&&baapfGet_wprocketInstance.update()}catch(t){berocket_throw_error("wprocket_script_compatibility",t)}try{jQuery(document).trigger("facetwp-loaded")}catch(t){berocket_throw_error("facetwp_script_compatibility",t)}try{berocket_apply_filters("etTheme_compatibility","object"==typeof etTheme&&"function"==typeof etTheme.global_image_lazy)&&etTheme.global_image_lazy()}catch(t){berocket_throw_error("etTheme_compatibility",t)}try{berocket_apply_filters("the7_compatibility",0<h(the_ajax_script.products_holder_id+" .iso-lazy-load").length)&&h(the_ajax_script.products_holder_id+" .iso-lazy-load").attr("src",function(){return void 0!==h(this).data("src")&&h(this).data("src")?h(this).data("src"):h(this).attr("src")}).attr("srcset",function(){return void 0!==h(this).data("srcset")&&h(this).data("srcset")?h(this).data("srcset"):h(this).attr("srcset")}).removeClass("iso-lazy-load")}catch(t){berocket_throw_error("etTheme_compatibility",t)}try{var e,i;"function"==typeof InfiniteScroll&&"object"==typeof(e=InfiniteScroll.data(".shop-container .products"))&&e.options&&(i=e.options,e.destroy(),jQuery(".shop-container .products").data("infiniteScroll","").infiniteScroll(i))}catch(t){berocket_throw_error("flatsome_infinitescroll",t)}try{jQuery(".shop-container .products").length&&"object"==typeof jQuery(".shop-container .products").data("packery")&&jQuery(".shop-container .products").packery("reloadItems").packery("layout")}catch(t){berocket_throw_error("flatsome_packery",t)}try{berocket_apply_filters("JetSmartFilters_compatibility","object"==typeof window.JetSmartFilters&&"function"==typeof window.JetSmartFilters.initializeFilters)&&window.JetSmartFilters.initializeFilters()}catch(t){berocket_throw_error("JetSmartFilters_compatibility",t)}h(window).trigger("resize"),h(window).trigger("scroll")}return t},jQuery(document).on("preInit.dt",".berocket_product_table_compat .wc-product-table",function(t,e,i){the_ajax_script.nice_urls&&"object"==typeof e.ajax&&e.ajax&&(e.ajax.data[the_ajax_script.nice_url_variable]=braapf_get_filters_selected())}),berocket_add_filter("ajax_load_from_url_always_after",bapf_universal_theme_compatibility,2500),h(document).ready(function(){berocket_apply_filters("remove_shortcode_fix_filters",h(".berocket_wc_shortcode_fix").length)&&(braapf_replace_each_filter(h(".berocket_wc_shortcode_fix").html()),h(".berocket_wc_shortcode_fix").html("")),braapf_init_load(),braapf_filtered_filters_set(),o(h("html")),h(window).on("resize",function(){o(h("html"))}),h(document).trigger("berocket_filters_document_ready")}),braapf_disable_ajax_loading=function(t){return!0},h(document).ready(function(){the_ajax_script.disable_ajax_loading&&berocket_add_filter("page_has_products_holder",braapf_disable_ajax_loading)}),berocket_add_filter("update_products",braapf_close_tippy=function(){try{h(".tippy-box").length&&h(".tippy-box").each(function(){void 0!==h(this).parent()[0]._tippy&&h(this).parent()[0]._tippy.hide()})}catch(t){}})})(jQuery),(s=>{braapf_get_current_filters=function(i){var o;return i.queryargs.length&&(o=[],s.each(i.queryargs,function(t,e){e.name==the_ajax_script.url_variable||decodeURI(e.name)==the_ajax_script.url_variable?i.filter=e.value:o.push(e)}),i.queryargs=o),i},braapf_set_filters_to_link=function(t,e,i,o,r){return"string"==typeof e.filter&&e.filter.length&&(r.length?t+="&":t+="?",t+=the_ajax_script.url_variable+"="+e.filter),t},berocket_add_filter("input_ckbox_changed",braapf_convert_ckbox_to_radio=function(t,e,i,o){s(t);t=s(t).closest(".bapf_sfilter.bapf_ckbox");t.is(".bapf_asradio")&&t.find("input[type=checkbox]:checked:not(:disabled)").each(function(){var t=s(this).val();t!=i&&braapf_checkbox_same(e,t,!1)})}),s(document).on("click",".bapf_ochild, .bapf_cchild",function(t){t.preventDefault(),t.stopPropagation(),s(this).is(".bapf_ochild")?s(this).trigger("bapf_ochild"):s(this).trigger("bapf_cchild")}),s(document).on("bapf_ochild",".bapf_sfilter.bapf_ckbox ul li",function(t){t.stopPropagation(),berocket_apply_filters("colaps_child_open_apply",!0,s(this))&&(void 0===(t=s(this).parents(".bapf_sfilter").first().data()).ochild&&(t.ochild="fa-plus"),void 0===t.cchild&&(t.cchild="fa-minus"),s(this).find(".bapf_ochild, .bapf_cchild").first().removeClass("bapf_ochild").removeClass(t.ochild).addClass("bapf_cchild").addClass(t.cchild),s(this).find("ul").first().show())}),s(document).on("bapf_cchild",".bapf_sfilter.bapf_ckbox ul li",function(t){t.stopPropagation(),berocket_apply_filters("colaps_child_close_apply",!0,s(this))&&(void 0===(t=s(this).parents(".bapf_sfilter").first().data()).ochild&&(t.ochild="fa-plus"),void 0===t.cchild&&(t.cchild="fa-minus"),s(this).find(".bapf_ochild, .bapf_cchild").first().addClass("bapf_ochild").addClass(t.ochild).removeClass("bapf_cchild").removeClass(t.cchild),s(this).find("ul").first().hide())});var e=[],i=(braapf_hierarhical_set=function(t){return s.each(e,function(t,e){s("#"+e).trigger("bapf_ochild")}),t},berocket_add_filter("ajax_load_from_url_done",braapf_hierarhical_save=function(t){return e=[],s(".bapf_cchild").each(function(){e.push(s(this).parent().children("input[type=checkbox]").attr("id"))}),t},1),berocket_add_filter("ajax_load_from_url_done_after",braapf_hierarhical_set,1e3),s(document).on("click",".bapf_ocolaps .bapf_colaps_togl, .bapf_ccolaps .bapf_colaps_togl",function(t){t.preventDefault,s(this).closest(".bapf_ocolaps, .bapf_ccolaps").is(".bapf_ocolaps")?s(this).closest(".bapf_ocolaps, .bapf_ccolaps").trigger("bapf_ocolaps",["slideDown"]):s(this).closest(".bapf_ocolaps, .bapf_ccolaps").trigger("bapf_ccolaps",["slideUp"])}),s(document).on("keydown",".bapf_ocolaps .bapf_colaps_togl, .bapf_ccolaps .bapf_colaps_togl",function(t){"Enter"===t.key&&(t.preventDefault,s(this).closest(".bapf_ocolaps, .bapf_ccolaps").is(".bapf_ocolaps")?s(this).closest(".bapf_ocolaps, .bapf_ccolaps").trigger("bapf_ocolaps",["slideDown"]):s(this).closest(".bapf_ocolaps, .bapf_ccolaps").trigger("bapf_ccolaps",["slideUp"]))}),s(document).on("bapf_ocolaps",".bapf_sfilter.bapf_ocolaps, .bapf_sfilter.bapf_ccolaps",function(t,e){s(this).removeClass("bapf_ocolaps").addClass("bapf_ccolaps"),berocket_apply_filters("colaps_smb_open_apply",!0,s(this))&&("slideDown"==(e=void 0===e?"show":e)?s(this).find(".bapf_body").first().slideDown():s(this).find(".bapf_body").first().show(),s(this).find(".bapf_colaps_smb").length)&&(void 0===(e=s(this).find(".bapf_colaps_smb").data()).opened&&(e.opened="fa-chevron-up"),void 0===e.closed&&(e.closed="fa-chevron-down"),s(this).find(".bapf_colaps_smb").removeClass(e.closed).addClass(e.opened))}),s(document).on("bapf_ccolaps",".bapf_sfilter.bapf_ocolaps, .bapf_sfilter.bapf_ccolaps",function(t,e){s(this).addClass("bapf_ocolaps").removeClass("bapf_ccolaps"),berocket_apply_filters("colaps_smb_close_apply",!0,s(this))&&("slideUp"==(e=void 0===e?"hide":e)?s(this).find(".bapf_body").first().slideUp():s(this).find(".bapf_body").first().hide(),s(this).find(".bapf_colaps_smb").length)&&(void 0===(e=s(this).find(".bapf_colaps_smb").data()).opened&&(e.opened="fa-chevron-up"),void 0===e.closed&&(e.closed="fa-chevron-down"),s(this).find(".bapf_colaps_smb").addClass(e.closed).removeClass(e.opened))}),s(document).on("mouseenter",".bapf_colaps_smb",function(){var t=s(this).data();void 0!==t&&void 0!==t.hover&&t.hover&&(void 0===t.opened&&(t.opened="fa-chevron-up"),void 0===t.closed&&(t.closed="fa-chevron-down"),s(this).removeClass(t.closed).removeClass(t.opened).addClass(t.hover))}),s(document).on("mouseleave",".bapf_colaps_smb",function(){var t=s(this).data();void 0!==t&&void 0!==t.hover&&t.hover&&(void 0===t.opened&&(t.opened="fa-chevron-up"),void 0===t.closed&&(t.closed="fa-chevron-down"),s(this).removeClass(t.hover),s(this).parents(".bapf_sfilter").first().is(".bapf_ocolaps")?s(this).addClass(t.closed):s(this).addClass(t.opened))}),{open:[],close:[]}),o=(braapf_collapse_status_set=function(t){return s.each(i.open,function(t,e){s("#"+e).trigger("bapf_ccolaps",["show"])}),s.each(i.close,function(t,e){s("#"+e).trigger("bapf_ocolaps",["hide"])}),t},berocket_add_filter("ajax_load_from_url_done",braapf_collapse_status_save=function(t){return i={open:[],close:[]},s(".bapf_ocolaps, .bapf_ccolaps").each(function(){(s(this).is(".bapf_ocolaps")?i.open:i.close).push(s(this).attr("id"))}),t},1),berocket_add_filter("ajax_load_from_url_done_after",braapf_collapse_status_set,1e3),s(document).on("click",".bapf_show_hide",function(){s(this).closest(".bapf_sfilter").toggleClass("bapf_fhide"),s(this).closest(".bapf_sfilter").is(".bapf_fhide")?s(this).text(s(this).data("show")):s(this).text(s(this).data("hide"))}),{open:[],close:[]});braapf_show_hide_values_set=function(t){return s.each(o.open,function(t,e){s("#"+e).removeClass("bapf_fhide"),s("#"+e).find(".bapf_show_hide").text(s("#"+e).find(".bapf_show_hide").data("hide"))}),s.each(o.close,function(t,e){s("#"+e).addClass("bapf_fhide"),s("#"+e).find(".bapf_show_hide").text(s("#"+e).find(".bapf_show_hide").data("show"))}),t},berocket_add_filter("ajax_load_from_url_done",braapf_show_hide_values_save=function(t){return o={open:[],close:[]},s(".bapf_sfilter").each(function(){(s(this).is(".bapf_fhide")?o.close:o.open).push(s(this).attr("id"))}),t},1),berocket_add_filter("ajax_load_from_url_done_after",braapf_show_hide_values_set,1e3),berocket_add_filter("ajax_load_from_url_beforeSend",braapf_scroll_shop_to_top=function(t,e,i,o,r){var a=berocket_apply_filters("filter_mobile_width",767);return berocket_apply_filters("scroll_shop_to_top","default"==r&&(1==the_ajax_script.scroll_shop_top||2==the_ajax_script.scroll_shop_top&&s(window).width()<a||3==the_ajax_script.scroll_shop_top&&s(window).width()>=a))&&(r=0,s(the_ajax_script.products_holder_id).length?(r=s(the_ajax_script.products_holder_id).offset().top+parseInt(the_ajax_script.scroll_shop_top_px))<0&&(r=0):s(".bapf_no_products").length&&(r=s(".bapf_no_products").offset().top+parseInt(the_ajax_script.scroll_shop_top_px))<0&&(r=0),s("html, body").animate({scrollTop:r},"slow")),t}),s(document).on("mousedown",".wc-product-table-reset a",function(){s(this).remove(),br_reset_all_filters()}),s(document).on("click",".berocket_element_above_products_is_hide_toggle",function(t){t.preventDefault(),s(this).toggleClass("active").next().slideToggle(200,"linear");t="inactive";s(this).is(".active")&&(t="active"),s(document).trigger("berocket_element_above_products_"+t)}),s(document).on("berocket_ajax_filtering_start",function(){var t;jQuery(".berocket_product_table_compat").length&&(jQuery(".berocket_product_table_compat .dataTables_length select").length&&jQuery(".berocket_product_table_compat .wc-product-table").dataTable()._fnSaveState(),t=jQuery(".berocket_product_table_compat .wc-product-table").attr("id"),void 0!==window["config_"+t])&&window["config_"+t].serverSide&&(jQuery(".berocket_product_table_compat .wc-product-table").DataTable().destroy(),t=jQuery(".berocket_product_table_compat").html(),jQuery(".berocket_product_table_compat").html(""),jQuery(".berocket_product_table_compat").html(t),jQuery(".berocket_product_table_compat .blockUI.blockOverlay").remove(),jQuery(".berocket_product_table_compat .wc-product-table").productTable())}),braapf_filters_url_decode=function(t){return t=the_ajax_script.seo_uri_decode&&(t=encodeURIComponent(t),the_ajax_script.nice_urls)?t.replace(/%2F/g,"/"):t},jQuery(document).on("elementor/popup/show",function(){try{braapf_init_load()}catch(t){berocket_throw_error("elementor_popup_show",t)}}),jQuery(document).on("pjax:success",function(){try{braapf_init_load()}catch(t){berocket_throw_error("woodmart_ajax",t)}})})(jQuery),berocket_add_filter("get_current_url_data",braapf_get_current_filters),berocket_add_filter("compat_filters_to_string",braapf_filters_url_decode,900),berocket_add_filter("url_from_urldata_linkget",braapf_set_filters_to_link),(a=>{var s;braapf_child_parent_fix_selected=function(t,e){if(0!=e){e=e.closest(".bapf_sfilter");if(e.length){var o=e.data("child"),r=e.data("taxonomy");if(void 0!==o&&0<o)for(i=o+1;a(".bapf_sfilter.bapf_child_"+i+'[data-taxonomy="'+r+'"]').length;i++)a(".bapf_sfilter.bapf_child_"+i+'[data-taxonomy="'+r+'"]').trigger("braapf_unselect",!1)}}return t},braapf_child_parent_load_with_update_button=function(t,e,i){var o;return t=0!=i&&(i=i.closest(".bapf_sfilter")).length&&(o=i.data("child"),i.data("taxonomy"),void 0!==o)&&0<o?!0:t},braapf_check_partial_load_filters=function(t,e,i){return t=0<a(".berocket_single_filter_widget.bapf_partload").length?!0:t},berocket_add_filter("grab_single_filter_default",braapf_child_parent_grab_single=function(t,e,i){var o=e.data("child");return t=void 0!==o&&0<o&&"object"==typeof t&&void 0!==t.values&&Array.isArray(t.values)&&0<t.values.length&&(o++,e=e.data("taxonomy"),(o=a(".bapf_sfilter.bapf_child_"+o+'[data-taxonomy="'+e+'"]')).length)&&"object"==typeof(e=braapf_grab_single(o,[],!0))&&void 0!==e.values&&Array.isArray(e.values)&&0<e.values.length?e:t},9e6),berocket_add_filter("before_update_products_context",braapf_child_parent_fix_selected),berocket_add_filter("apply_filters_to_page_partial",braapf_child_parent_load_with_update_button),berocket_add_filter("apply_filters_to_page_partial",braapf_check_partial_load_filters),braapf_remove_loader_element=function(t){return void 0!==s&&"function"==typeof s.remove&&s.remove(),t},berocket_add_filter("ajax_load_from_url_beforeSend",braapf_add_loader_element=function(t,e,i,o,r){return"default"==r&&(void 0!==s&&"function"==typeof s.remove&&s.remove(),s=a(the_ajax_script.load_image),a("body").append(s)),t}),berocket_add_filter("ajax_load_from_url_always_after",braapf_remove_loader_element),a(document).on("click",".bapf_sfilter.bapf_ckbox .bapf_body li label a",function(t){t.preventDefault(),a(this).parent().trigger("click")}),jQuery(".elementor-widget").length&&jQuery(window).on("scroll",function(){jQuery(".elementor-sticky__spacer .bapf_sfilter").remove()});try{window.addEventListener("LazyLoad::Initialized",function(t){baapfGet_wprocketInstance=t.detail.instance})}catch(t){berocket_throw_error("wprocketInstance_get",t)}a(document).on("change","form.cart input.qty",function(){try{a(this.form).find("[data-quantity]").attr("data-quantity",this.value)}catch(t){berocket_throw_error("wc_quantity_change",t)}}),brapf_jet_smart_filters=function(t){t=a("<div><div>"+t+"</div></div>");0<jQuery("#jet-smart-filters-js-extra").length&&0<t.find("#jet-smart-filters-js-extra").length&&jQuery("#jet-smart-filters-js-extra").replaceWith(t.find("#jet-smart-filters-js-extra"))},brapf_jet_smart_filters_remove_pages=function(t){var i;return Array.isArray(t.queryargs)&&(i=[],a.each(t.queryargs,function(t,e){"pagenum"!=e.name&&i.push(e)}),t.queryargs=i),t},brapf_jet_smart_filters_add=function(t){return t.done.push(brapf_jet_smart_filters),t},brapf_JetSmartFilter_extra_props=function(){var t=braapf_compact_filters(),e=berocket_apply_filters("braapf_filters_mask",the_ajax_script.url_mask),t=braapf_compat_filters_to_string(t,e,the_ajax_script.url_split);JetSmartFilterSettings.extra_props.brfilters=t},jQuery(document).ready(function(){berocket_apply_filters("JetSmartFilter_compatibility",0<jQuery("#jet-smart-filters-js-extra").length)&&(jQuery(document).on("berocket_ajax_products_loaded",brapf_JetSmartFilter_extra_props),brapf_JetSmartFilter_extra_props(),berocket_add_filter("ajax_load_from_filters",brapf_jet_smart_filters_add),berocket_add_filter("braapf_remove_pages_from_url_data",brapf_jet_smart_filters_remove_pages))})})(jQuery),jQuery(document).trigger("bapf_js_loaded"),(r=>{function t(){berocket_add_filter("braapf_init",braapf_init_ion_slidr),berocket_add_filter("braapf_init_for_parent",braapf_init_ion_slidr_for_parent),berocket_add_filter("grab_single_filter_default",braapf_grab_single_ion),berocket_add_filter("jqrui_slidr_ion_link_arr_attr",braapf_jqrui_slidr_ion_values_link_arr_attr),berocket_add_filter("jqrui_slidr_ion_link_arr_attr_price",braapf_jqrui_slidr_ion_values_link_arr_attr),berocket_add_filter("jqrui_slidr_ion_wc_price",braapf_jqrui_slidr_ion_value_wc_price),berocket_add_filter("jqrui_slidr_ion_num_attr",braapf_jqrui_slidr_ion_value_wc_price),berocket_add_filter("jqrui_slidr_ion_arr_attr",braapf_jqrui_slidr_ion_value_arr_attr),berocket_add_filter("jqrui_slidr_ion_arr_attr_price",braapf_jqrui_slidr_ion_value_arr_attr,10),berocket_add_filter("jqrui_slidr_ion_arr_attr_price",braapf_jqrui_slidr_ion_value_wc_price,20)}braapf_init_ion_slidr=function(){braapf_init_ion_slidr_for_parent(r(document))},braapf_init_ion_slidr_for_parent=function(t){t.find(".bapf_slidr_ion:not(.bapf_slidr_ready)").each(function(){function t(t){var e;i.is(".bapf_ion_blocked")||(i.addClass("bapf_ion_blocked"),e=i.closest(".bapf_sfilter").data("taxonomy"),braapf_ion_slidr_same(e,t),berocket_apply_filters("filter_changed_element",{element:"#"+i.closest(".bapf_sfilter").attr("id"),parent:0,find:".bapf_body"},i),berocket_do_action("update_products","filter",i),i.removeClass("bapf_ion_blocked"))}var i=r(this).find(".bapf_slidr_all .bapf_slidr_main"),e=berocket_apply_filters("jqrui_data_slidr_ion",{type:"double",from:i.data("start"),to:i.data("end"),grid:!1,force_edges:!0,onFinish:t,onUpdate:t,prettify:function(t){return t=berocket_apply_filters("jqrui_slidr_ion_"+i.data("display"),t,i)}},i);i.ionRangeSlider(e),r(this).addClass("bapf_slidr_ready")})},braapf_ion_slidr_same=function(t,e){r('.bapf_slidr_ion.bapf_slidr_ready[data-taxonomy="'+t+'"]').each(function(){var t=r(this).find(".bapf_slidr_main");t.addClass("bapf_ion_blocked"),t.data("ionRangeSlider").update({from:e.from,to:e.to}),t.removeClass("bapf_ion_blocked")})},braapf_jqrui_slidr_ion_value_wc_price=function(t,e){e=(e=e.data("number_style"))||the_ajax_script.number_style;return t=berocket_format_number(parseFloat(t),e)},braapf_jqrui_slidr_ion_value_arr_attr=function(t,e){return t=e.data("attr")[t].n},braapf_grab_single_ion=function(t,e){var i,o,r,a;return e.is(".bapf_slidr_ion.bapf_slidr_ready")&&0!=t&&void 0!==(o=e.find(".bapf_slidr_main").data("ionRangeSlider"))&&(e=e.find(".bapf_slidr_main"),i=[o.options.from,o.options.to],o=[berocket_apply_filters("jqrui_slidr_ion_"+e.data("display"),o.options.from,e),berocket_apply_filters("jqrui_slidr_ion_"+e.data("display"),o.options.to,e)],void 0===(a=e.data("prefix"))&&(a=""),r=e.data("postfix"),o[0]=a+o[0]+(r=void 0===r?"":r),o[1]=a+o[1]+r,i[0]==e.data("min")&&i[1]==e.data("max")||(a={value:i[0]+"_"+i[1],html:o[0]+" - "+o[1]},a=berocket_apply_filters("jqrui_slidr_ion_link_"+e.data("display"),a,i,o,e,t),t.values=[a])),t},braapf_jqrui_slidr_ion_values_link_arr_attr=function(t,e,i,o,r){o=o.data("attr");return t.value=o[e[0]].v+"_"+o[e[1]].v,t},r(document).on("braapf_unselect braapf_unselect_all",".bapf_slidr_ion",function(t,e){var i=r(this).find(".bapf_slidr_main"),o=i.data("ionRangeSlider");i.addClass("bapf_ion_blocked"),o.update({from:o.options.min,to:o.options.max}),i.removeClass("bapf_ion_blocked")}),"function"==typeof berocket_add_filter?t():jQuery(document).on("berocket_hooks_ready",function(){t()})})(jQuery),(o=>{o(document).on("change",".bapf_slct .bapf_body select",function(){berocket_apply_filters("filter_changed_element",{element:"#"+o(this).closest(".bapf_sfilter").attr("id"),parent:0,find:".bapf_body"},o(this)),berocket_do_action("update_products","filter",o(this))}),braapf_grab_single_select=function(e,t){var i;return t.is(".bapf_slct")&&0!=e&&(t=o('.bapf_slct[data-taxonomy="'+e.taxonomy+'"] .bapf_body select:not(:disabled)'),i=[],t.find("option:selected:not(:disabled)").each(function(){var t=o(this).val();t&&-1===i.indexOf(t)&&(i.push(t),e.values.push({value:t,html:o(this).data("name")}))})),e},o(document).on("braapf_unselect braapf_unselect_all",".bapf_slct",function(t,e){o(this).find(".bapf_body select:not(:disabled) option:selected:not(:disabled)").each(function(){void 0!==e&&void 0!==e.value&&e.value!=o(this).val()||o(this).prop("selected",!1)})}),"function"==typeof berocket_add_filter?berocket_add_filter("grab_single_filter_default",braapf_grab_single_select):jQuery(document).on("berocket_hooks_ready",function(){berocket_add_filter("grab_single_filter_default",braapf_grab_single_select)})})(jQuery),jQuery(document).ready(function(){function t(){bapf_select2_init(),berocket_add_filter("braapf_init",bapf_select2_init,2e3),berocket_add_filter("braapf_init_for_parent",bapf_select2_init_for_parent)}bapf_select2_init=function(){bapf_select2_init_for_parent(jQuery(document))},bapf_select2_init_for_parent=function(t){t.find(".bapf_select2").length&&void 0!==t.find(".bapf_select2").select2&&t.find(".bapf_select2").each(function(){var t;jQuery(this).data("select2")||jQuery(this).is(".select2-hidden-accessible")||(t={width:"100%",theme:"default"},jQuery(this).prop("multiple")&&(t.placeholder=jQuery(this).data("placeholder")),jQuery(this).parents("#berocket-ajax-filters-sidebar").length&&(0==jQuery("#bapf-select2-high-zindex").length&&jQuery("body").append('<div id="bapf-select2-high-zindex"></div>'),t.dropdownParent=jQuery("#bapf-select2-high-zindex")),t=berocket_apply_filters("jqrui_data_select2",t,jQuery(this)),jQuery(this).select2(t))})},bapf_select2_disable_for_parent=function(t){t.find(".bapf_select2").length&&void 0!==t.find(".bapf_select2").select2&&t.find(".bapf_select2").each(function(){jQuery(this).data("select2")&&jQuery(this).select2("destroy")})},jQuery(document).on("berocket_ajax_filtering_on_update",function(){jQuery(".bapf_sfilter .bapf_select2").length&&"function"==typeof jQuery(".bapf_sfilter .bapf_select2").select2&&jQuery(".bapf_sfilter .bapf_select2").each(function(){jQuery(this).data("select2")&&jQuery(this).select2("close")}),bapf_select2_disable_for_parent(jQuery(document))}),"function"==typeof berocket_add_filter?t():jQuery(document).on("berocket_hooks_ready",function(){t()})}),(l=>{function e(t,e,i){var o=l(t).closest(".bapf_slidr_jqrui.bapf_slidr_ready").find(".bapf_slidr_main");"focusout"==i?l(t).val()==l(t).data("val")&&(i=o.slider("values"),o.trigger("braapf_change_jqrui_slidr",[i])):(i=parseInt(l(t).val()),o.slider("values",e,i))}function t(){berocket_add_filter("jqrui_slidr_wc_price",braapf_jqrui_slidr_values_wc_price),berocket_add_filter("jqrui_slidr_num_attr",braapf_jqrui_slidr_values_num_attr_style),berocket_add_filter("jqrui_slidr_arr_attr",braapf_jqrui_slidr_values_arr_attr),berocket_add_filter("jqrui_slidr_arr_attr_price",braapf_jqrui_slidr_values_arr_attr,10),berocket_add_filter("jqrui_slidr_arr_attr_price",braapf_jqrui_slidr_values_wc_price,20),berocket_add_filter("jqrui_slidr_link_arr_attr",braapf_jqrui_slidr_values_link_arr_attr),berocket_add_filter("jqrui_slidr_link_arr_attr_price",braapf_jqrui_slidr_values_link_arr_attr),berocket_add_filter("grab_single_filter_default",braapf_grab_single_jqrui),berocket_add_filter("braapf_init",braapf_init_jqrui_slidr),berocket_add_filter("braapf_init_for_parent",braapf_init_jqrui_slidr_for_parent)}l.each([{position:0,className:"bapf_from"},{position:1,className:"bapf_to"}],function(t,o){l(document).on("focusin",".bapf_slidr_jqrui.bapf_slidr_ready ."+o.className+" input[type=text]",function(){var t,e,i;t=this,e=o.position,i=l(t).closest(".bapf_slidr_jqrui.bapf_slidr_ready").find(".bapf_slidr_main").slider("values"),l(t).val(i[e]),l(t).data("val",i[e])}),l(document).on("change focusout",".bapf_slidr_jqrui.bapf_slidr_ready ."+o.className+" input[type=text]",function(t){e(this,o.position,t.type)}),l(document).on("change",".bapf_slidr_jqrui.bapf_slidr_ready ."+o.className+" select",function(t){e(this,o.position,t.type)})}),l(document).on("braapf_change_jqrui_slidr",".bapf_slidr_jqrui .bapf_slidr_main",function(t,e){var i=l(this),e=[e[0],e[1]],e=berocket_apply_filters("jqrui_slidr_"+i.data("display"),e,i);i.closest(".bapf_slidr_jqrui").find(".bapf_from span.bapf_val").length&&i.closest(".bapf_slidr_jqrui").find(".bapf_from span.bapf_val").text(e[0]),i.closest(".bapf_slidr_jqrui").find(".bapf_to span.bapf_val").length&&i.closest(".bapf_slidr_jqrui").find(".bapf_to span.bapf_val").text(e[1])}),l(document).on("braapf_change_jqrui_slidr",".bapf_slidr_jqrui .bapf_slidr_main",function(t,e){var i=l(this),e=[e[0],e[1]],e=berocket_apply_filters("jqrui_slidr_"+i.data("display"),e,i);i.closest(".bapf_slidr_jqrui").find(".bapf_from input[type=text]").length&&i.closest(".bapf_slidr_jqrui").find(".bapf_from input[type=text]").val(e[0]),i.closest(".bapf_slidr_jqrui").find(".bapf_to input[type=text]").length&&i.closest(".bapf_slidr_jqrui").find(".bapf_to input[type=text]").val(e[1])}),l(document).on("braapf_change_jqrui_slidr",".bapf_slidr_jqrui .bapf_slidr_main",function(t,o){var i,r,a,s,n=l(this),e=n.data("attr");(n.closest(".bapf_slidr_jqrui").find(".bapf_from select").length||n.closest(".bapf_slidr_jqrui").find(".bapf_to select").length)&&(e=n.data("attr"),i=[],s=a=!(r=[]),l.each(e,function(t,e){t==o[0]&&(s=!0),a||i.push({v:e.v,n:e.n,ov:t}),s&&r.push({v:e.v,n:e.n,ov:t}),t==o[1]&&(a=!0)})),n.closest(".bapf_slidr_jqrui").find(".bapf_from select").length&&(n.closest(".bapf_slidr_jqrui").find(".bapf_from select option").remove(),l.each(i,function(t,e){var i="";e.ov==o[0]&&(i=" selected"),n.closest(".bapf_slidr_jqrui").find(".bapf_from select").append(l('<option value="'+e.ov+'"'+i+">"+e.n+"</option>"))})),n.closest(".bapf_slidr_jqrui").find(".bapf_to select").length&&(n.closest(".bapf_slidr_jqrui").find(".bapf_to select option").remove(),l.each(r,function(t,e){var i="";e.ov==o[1]&&(i=" selected"),n.closest(".bapf_slidr_jqrui").find(".bapf_to select").append(l('<option value="'+e.ov+'"'+i+">"+e.n+"</option>"))}))}),braapf_init_jqrui_slidr=function(){braapf_init_jqrui_slidr_for_parent(l(document))},braapf_init_jqrui_slidr_for_parent=function(t){t.find(".bapf_slidr_jqrui:not(.bapf_slidr_ready)").each(function(){var t=l(this).find(".bapf_slidr_main"),e=berocket_apply_filters("jqrui_data_slidr_jqrui",{range:!0,min:t.data("min"),max:t.data("max"),values:[t.data("start"),t.data("end")],step:t.data("step"),create:function(t,e){var i=l(this).slider("values");l(this).trigger("braapf_change_jqrui_slidr",[i])},slide:function(t,e){l(this).trigger("braapf_change_jqrui_slidr",[e.values])},change:function(t,e){var i,o=l(this).slider("values");l(this).trigger("braapf_change_jqrui_slidr",[o]),l(this).is(".bapf_jqrui_blocked")||(o=l(this).slider("values"),i=l(this).parents(".bapf_sfilter").data("taxonomy"),braapf_jqrui_slidr_same(i,o),berocket_apply_filters("filter_changed_element",{element:"#"+l(this).closest(".bapf_sfilter").attr("id"),parent:0,find:".bapf_body"},l(this)),berocket_do_action("update_products","filter",l(this)))}},t);t.slider(e),l(this).addClass("bapf_slidr_ready")})},braapf_jqrui_slidr_same=function(t,e){l('.bapf_slidr_jqrui.bapf_slidr_ready[data-taxonomy="'+t+'"]').each(function(){var t=l(this).find(".bapf_slidr_main");t.addClass("bapf_jqrui_blocked"),t.slider("values",e),t.removeClass("bapf_jqrui_blocked")})},braapf_jqrui_slidr_values_num_attr_style=function(t,e){e=e.data("number_style");return e&&(t[0]=berocket_format_number(t[0],e),t[1]=berocket_format_number(t[1],e)),t},braapf_jqrui_slidr_values_wc_price=function(t,e){e=(e=e.data("number_style"))||the_ajax_script.number_style;return t[0]=berocket_format_number(t[0],e),t[1]=berocket_format_number(t[1],e),t},braapf_grab_single_jqrui=function(t,e){var i,o,r,a,s;return e.is(".bapf_slidr_jqrui.bapf_slidr_ready")&&0!=t&&(o=(i=e.find(".bapf_slidr_main")).slider("values"),r=i.slider("values"),a="",e.find(".bapf_tbprice").length&&(a=e.find(".bapf_tbprice").first().text()),s="",e.find(".bapf_taprice").length&&(s=e.find(".bapf_taprice").first().text()),o[0]==i.data("min")&&o[1]==i.data("max")||((r=berocket_apply_filters("jqrui_slidr_"+i.data("display"),r,i))[0]=a+r[0]+s,r[1]=a+r[1]+s,e={value:o[0]+"_"+o[1],html:r[0]+" - "+r[1]},e=berocket_apply_filters("jqrui_slidr_link_"+i.data("display"),e,o,r,i,t),t.values=[e])),t},braapf_jqrui_slidr_values_arr_attr=function(t,e){e=e.data("attr");return Array.isArray(t)&&2==t.length?(t[0]=e[t[0]].n,t[1]=e[t[1]].n):((t=["",""])[0]=e[0].n,t[1]=e[e.length-1].n),t},braapf_jqrui_slidr_values_link_arr_attr=function(t,e,i,o,r){o=o.data("attr");return t.value=o[e[0]].v+"_"+o[e[1]].v,t},l(document).on("braapf_unselect braapf_unselect_all",".bapf_slidr_jqrui",function(t,e){var i=l(this).find(".bapf_slidr_main"),o=i.data("min"),r=i.data("max");i.addClass("bapf_jqrui_blocked"),i.slider("values",[o,r]),i.removeClass("bapf_jqrui_blocked")}),"function"==typeof berocket_add_filter?t():jQuery(document).on("berocket_hooks_ready",function(){t()})})(jQuery),(e=>{function i(t,e){var i,o;1<t.originalEvent.touches.length||(t.preventDefault(),i=t.originalEvent.changedTouches[0],(o=document.createEvent("MouseEvents")).initMouseEvent(e,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(o))}var o,t,r,a;e.support.touch="ontouchend"in document,e.support.touch&&(t=e.ui.mouse.prototype,r=t._mouseInit,a=t._mouseDestroy,t._touchStart=function(t){!o&&this._mouseCapture(t.originalEvent.changedTouches[0])&&(o=!0,this._touchMoved=!1,i(t,"mouseover"),i(t,"mousemove"),i(t,"mousedown"))},t._touchMove=function(t){o&&(this._touchMoved=!0,i(t,"mousemove"))},t._touchEnd=function(t){o&&(i(t,"mouseup"),i(t,"mouseout"),this._touchMoved||i(t,"click"),o=!1)},t._mouseInit=function(){var t=this;t.element.bind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),r.call(t)},t._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),a.call(t)})})(jQuery),(t=>{"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t:t(jQuery)})(function(d){function e(t){var e,i=t||window.event,o=f.call(arguments,1),r=0,a=0,s=0,n=0,l=0,c=0;if((t=d.event.fix(i)).type="mousewheel","detail"in i&&(s=-1*i.detail),"wheelDelta"in i&&(s=i.wheelDelta),"wheelDeltaY"in i&&(s=i.wheelDeltaY),"wheelDeltaX"in i&&(a=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(a=-1*s,s=0),r=0===s?a:s,"deltaY"in i&&(r=s=-1*i.deltaY),"deltaX"in i&&(a=i.deltaX,0===s)&&(r=-1*a),0!==s||0!==a)return 1===i.deltaMode?(r*=e=d.data(this,"mousewheel-line-height"),s*=e,a*=e):2===i.deltaMode&&(r*=e=d.data(this,"mousewheel-page-height"),s*=e,a*=e),n=Math.max(Math.abs(s),Math.abs(a)),(!u||n<u)&&h(i,u=n)&&(u/=40),h(i,n)&&(r/=40,a/=40,s/=40),r=Math[1<=r?"floor":"ceil"](r/u),a=Math[1<=a?"floor":"ceil"](a/u),s=Math[1<=s?"floor":"ceil"](s/u),m.settings.normalizeOffset&&this.getBoundingClientRect&&(e=this.getBoundingClientRect(),l=t.clientX-e.left,c=t.clientY-e.top),t.deltaX=a,t.deltaY=s,t.deltaFactor=u,t.offsetX=l,t.offsetY=c,t.deltaMode=0,o.unshift(t,r,a,s),_&&clearTimeout(_),_=setTimeout(p,200),(d.event.dispatch||d.event.handle).apply(this,o)}function p(){u=null}function h(t,e){return m.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120==0}var _,u,t=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],f=Array.prototype.slice;if(d.event.fixHooks)for(var o=t.length;o;)d.event.fixHooks[t[--o]]=d.event.mouseHooks;var m=d.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],e,!1);else this.onmousewheel=e;d.data(this,"mousewheel-line-height",m.getLineHeight(this)),d.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=i.length;t;)this.removeEventListener(i[--t],e,!1);else this.onmousewheel=null;d.removeData(this,"mousewheel-line-height"),d.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var t=d(t),e=t["offsetParent"in d.fn?"offsetParent":"parent"]();return e.length||(e=d("body")),parseInt(e.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(t){return d(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};d.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}),(t=>{"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t:t(jQuery)})(function(d){function e(t){var e,i=t||window.event,o=f.call(arguments,1),r=0,a=0,s=0,n=0,l=0,c=0;if((t=d.event.fix(i)).type="mousewheel","detail"in i&&(s=-1*i.detail),"wheelDelta"in i&&(s=i.wheelDelta),"wheelDeltaY"in i&&(s=i.wheelDeltaY),"wheelDeltaX"in i&&(a=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(a=-1*s,s=0),r=0===s?a:s,"deltaY"in i&&(r=s=-1*i.deltaY),"deltaX"in i&&(a=i.deltaX,0===s)&&(r=-1*a),0!==s||0!==a)return 1===i.deltaMode?(r*=e=d.data(this,"mousewheel-line-height"),s*=e,a*=e):2===i.deltaMode&&(r*=e=d.data(this,"mousewheel-page-height"),s*=e,a*=e),n=Math.max(Math.abs(s),Math.abs(a)),(!u||n<u)&&h(i,u=n)&&(u/=40),h(i,n)&&(r/=40,a/=40,s/=40),r=Math[1<=r?"floor":"ceil"](r/u),a=Math[1<=a?"floor":"ceil"](a/u),s=Math[1<=s?"floor":"ceil"](s/u),m.settings.normalizeOffset&&this.getBoundingClientRect&&(e=this.getBoundingClientRect(),l=t.clientX-e.left,c=t.clientY-e.top),t.deltaX=a,t.deltaY=s,t.deltaFactor=u,t.offsetX=l,t.offsetY=c,t.deltaMode=0,o.unshift(t,r,a,s),_&&clearTimeout(_),_=setTimeout(p,200),(d.event.dispatch||d.event.handle).apply(this,o)}function p(){u=null}function h(t,e){return m.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120==0}var _,u,t=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],f=Array.prototype.slice;if(d.event.fixHooks)for(var o=t.length;o;)d.event.fixHooks[t[--o]]=d.event.mouseHooks;var m=d.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],e,!1);else this.onmousewheel=e;d.data(this,"mousewheel-line-height",m.getLineHeight(this)),d.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=i.length;t;)this.removeEventListener(i[--t],e,!1);else this.onmousewheel=null;d.removeData(this,"mousewheel-line-height"),d.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var t=d(t),e=t["offsetParent"in d.fn?"offsetParent":"parent"]();return e.length||(e=d("body")),parseInt(e.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(t){return d(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};d.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}),(t=>{"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t:t(jQuery,window,document)})(function(O){var E,l,I,o,r,T,a,f,B,m,h,c,n,d,A,q,M,p,U,W,N,Q,S,G,_,Y,u,g,L,X,V,K,Z,s,P,b,J,tt,et,it,ot,rt,v,j,y,x,R,F,$,z,e,w,k,H,C,D,at,t,i,st;t="function"==typeof define&&define.amd,i="undefined"!=typeof module&&module.exports,st="https:"==document.location.protocol?"https:":"http:",t||(i?require("jquery-mousewheel")(O):O.event.special.mousewheel||O("head").append(decodeURI("%3Cscript src="+st+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js%3E%3C/script%3E"))),l="mCustomScrollbar",I="mCS",o=".mCustomScrollbar",r={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},T=0,a={},f=window.attachEvent&&!window.addEventListener?1:0,B=!1,m=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],h={init:function(s){var s=O.extend(!0,{},r,s),t=c.call(this);if(s.live){var e=s.liveSelector||this.selector||o,i=O(e);if("off"===s.live)return void d(e);a[e]=setTimeout(function(){i.mCustomScrollbar(s),"once"===s.live&&i.length&&d(e)},500)}else d(e);return s.setWidth=s.set_width||s.setWidth,s.setHeight=s.set_height||s.setHeight,s.axis=s.horizontalScroll?"x":A(s.axis),s.scrollInertia=0<s.scrollInertia&&s.scrollInertia<17?17:s.scrollInertia,"object"!=typeof s.mouseWheel&&1==s.mouseWheel&&(s.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),s.mouseWheel.scrollAmount=s.mouseWheelPixels||s.mouseWheel.scrollAmount,s.mouseWheel.normalizeDelta=s.advanced.normalizeMouseWheelDelta||s.mouseWheel.normalizeDelta,s.scrollButtons.scrollType=q(s.scrollButtons.scrollType),n(s),O(t).each(function(){var t,e,i,o,r,a=O(this);a.data(I)||(a.data(I,{idx:++T,opt:s,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:a.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}}),e=(t=a.data(I)).opt,i=a.data("mcs-axis"),o=a.data("mcs-scrollbar-position"),r=a.data("mcs-theme"),i&&(e.axis=i),o&&(e.scrollbarPosition=o),r&&(e.theme=r,n(e)),M.call(this),t&&e.callbacks.onCreate&&"function"==typeof e.callbacks.onCreate&&e.callbacks.onCreate.call(this),O("#mCSB_"+t.idx+"_container img:not(."+m[2]+")").addClass(m[2]),h.update.call(null,a))})},update:function(t,s){t=t||c.call(this);return O(t).each(function(){var t,e,i,o,r,a=O(this);a.data(I)&&(e=(t=a.data(I)).opt,i=O("#mCSB_"+t.idx+"_container"),r=O("#mCSB_"+t.idx),o=[O("#mCSB_"+t.idx+"_dragger_vertical"),O("#mCSB_"+t.idx+"_dragger_horizontal")],i.length)&&(t.tweenRunning&&R(a),s&&t&&e.callbacks.onBeforeUpdate&&"function"==typeof e.callbacks.onBeforeUpdate&&e.callbacks.onBeforeUpdate.call(this),a.hasClass(m[3])&&a.removeClass(m[3]),a.hasClass(m[4])&&a.removeClass(m[4]),r.css("max-height","none"),r.height()!==a.height()&&r.css("max-height",a.height()),U.call(this),"y"===e.axis||e.advanced.autoExpandHorizontalScroll||i.css("width",p(i)),t.overflowed=G.call(this),g.call(this),e.autoDraggerLength&&N.call(this),Q.call(this),Y.call(this),r=[Math.abs(i[0].offsetTop),Math.abs(i[0].offsetLeft)],"x"!==e.axis&&(t.overflowed[0]?o[0].height()>o[0].parent().height()?_.call(this):(F(a,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}),t.contentReset.y=null):(_.call(this),"y"===e.axis?u.call(this):"yx"===e.axis&&t.overflowed[1]&&F(a,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==e.axis&&(t.overflowed[1]?o[1].width()>o[1].parent().width()?_.call(this):(F(a,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}),t.contentReset.x=null):(_.call(this),"x"===e.axis?u.call(this):"yx"===e.axis&&t.overflowed[0]&&F(a,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),s&&t&&(2===s&&e.callbacks.onImageLoad&&"function"==typeof e.callbacks.onImageLoad?e.callbacks.onImageLoad.call(this):3===s&&e.callbacks.onSelectorChange&&"function"==typeof e.callbacks.onSelectorChange?e.callbacks.onSelectorChange.call(this):e.callbacks.onUpdate&&"function"==typeof e.callbacks.onUpdate&&e.callbacks.onUpdate.call(this)),x.call(this))})},scrollTo:function(s,n){var t;if(void 0!==s&&null!=s)return t=c.call(this),O(t).each(function(){var t,e,i,o,r,a=O(this);a.data(I)&&(t=a.data(I),r={trigger:"external",scrollInertia:(e=t.opt).scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},i=O.extend(!0,{},r,n),o=j.call(this,s),r=0<i.scrollInertia&&i.scrollInertia<17?17:i.scrollInertia,o[0]=y.call(this,o[0],"y"),o[1]=y.call(this,o[1],"x"),i.moveDragger&&(o[0]*=t.scrollRatio.y,o[1]*=t.scrollRatio.x),i.dur=at()?0:r,setTimeout(function(){null!=o[0]&&"x"!==e.axis&&t.overflowed[0]&&(i.dir="y",i.overwrite="all",F(a,o[0].toString(),i)),null!=o[1]&&"y"!==e.axis&&t.overflowed[1]&&(i.dir="x",i.overwrite="none",F(a,o[1].toString(),i))},i.timeout))})},stop:function(){var t=c.call(this);return O(t).each(function(){var t=O(this);t.data(I)&&R(t)})},disable:function(e){var t=c.call(this);return O(t).each(function(){var t=O(this);t.data(I)&&(t.data(I),x.call(this,"remove"),u.call(this),e&&_.call(this),g.call(this,!0),t.addClass(m[3]))})},destroy:function(){var s=c.call(this);return O(s).each(function(){var t,e,i,o,r,a=O(this);a.data(I)&&(e=(t=a.data(I)).opt,i=O("#mCSB_"+t.idx),o=O("#mCSB_"+t.idx+"_container"),r=O(".mCSB_"+t.idx+"_scrollbar"),e.live&&d(e.liveSelector||O(s).selector),x.call(this,"remove"),u.call(this),_.call(this),a.removeData(I),w(this,"mcs"),r.remove(),o.find("img."+m[2]).removeClass(m[2]),i.replaceWith(o.contents()),a.removeClass(l+" _"+I+"_"+t.idx+" "+m[6]+" "+m[7]+" "+m[5]+" "+m[3]).addClass(m[4]))})}},c=function(){return"object"!=typeof O(this)||O(this).length<1?o:this},n=function(t){t.autoDraggerLength=!(-1<O.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"]))&&t.autoDraggerLength,t.autoExpandScrollbar=!(-1<O.inArray(t.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"]))&&t.autoExpandScrollbar,t.scrollButtons.enable=!(-1<O.inArray(t.theme,["minimal","minimal-dark"]))&&t.scrollButtons.enable,t.autoHideScrollbar=-1<O.inArray(t.theme,["minimal","minimal-dark"])||t.autoHideScrollbar,t.scrollbarPosition=-1<O.inArray(t.theme,["minimal","minimal-dark"])?"outside":t.scrollbarPosition},d=function(t){a[t]&&(clearTimeout(a[t]),w(a,t))},A=function(t){return"yx"===t||"xy"===t||"auto"===t?"yx":"x"===t||"horizontal"===t?"x":"y"},q=function(t){return"stepped"===t||"pixels"===t||"step"===t||"click"===t?"stepped":"stepless"},M=function(){var t=O(this),e=t.data(I),i=e.opt,o=i.autoExpandScrollbar?" "+m[1]+"_expand":"",o=["<div id='mCSB_"+e.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+e.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_vertical"+o+"'><div class='"+m[12]+"'><div id='mCSB_"+e.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar'></div></div><div class='mCSB_draggerRail'></div></div></div>","<div id='mCSB_"+e.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+e.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_horizontal"+o+"'><div class='"+m[12]+"'><div id='mCSB_"+e.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar'></div><div class='mCSB_draggerRail'></div></div>"],r="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",o="yx"===i.axis?o[0]+o[1]:"x"===i.axis?o[1]:o[0],a="yx"===i.axis?"<div id='mCSB_"+e.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",s=i.autoHideScrollbar?" "+m[6]:"",n="x"!==i.axis&&"rtl"===e.langDir?" "+m[7]:"",s=(i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===e.langDir?"989999px":i.setLeft,t.addClass(l+" _"+I+"_"+e.idx+s+n).wrapInner("<div id='mCSB_"+e.idx+"' class='mCustomScrollBox mCS-"+i.theme+" "+r+"'><div id='mCSB_"+e.idx+"_container' class='mCSB_container' style='position:relative; top:"+i.setTop+"; left:"+i.setLeft+";' dir='"+e.langDir+"' /></div>"),O("#mCSB_"+e.idx)),n=O("#mCSB_"+e.idx+"_container"),r=("y"===i.axis||i.advanced.autoExpandHorizontalScroll||n.css("width",p(n)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),s.addClass("mCSB_outside").after(o)):(s.addClass("mCSB_inside").append(o),n.wrap(a)),W.call(this),[O("#mCSB_"+e.idx+"_dragger_vertical"),O("#mCSB_"+e.idx+"_dragger_horizontal")]);r[0].css("min-height",r[0].height()),r[1].css("min-width",r[1].width())},p=function(t){var e=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return O(this).outerWidth(!0)}).get())],t=t.parent().width();return t<e[0]?e[0]:t<e[1]?e[1]:"100%"},U=function(){var t,e=O(this).data(I),i=e.opt,e=O("#mCSB_"+e.idx+"_container");i.advanced.autoExpandHorizontalScroll&&"y"!==i.axis&&(e.css({width:"auto","min-width":0,"overflow-x":"scroll"}),t=Math.ceil(e[0].scrollWidth),3===i.advanced.autoExpandHorizontalScroll||2!==i.advanced.autoExpandHorizontalScroll&&t>e.parent().width()?e.css({width:t,"min-width":"100%","overflow-x":"inherit"}):e.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(e[0].getBoundingClientRect().right+.4)-Math.floor(e[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap())},W=function(){var t=O(this).data(I),e=t.opt,t=O(".mCSB_"+t.idx+"_scrollbar:first"),i=C(e.scrollButtons.tabindex)?"tabindex='"+e.scrollButtons.tabindex+"'":"",i=["<a href='#' class='"+m[13]+"' "+i+" />","<a href='#' class='"+m[14]+"' "+i+" />","<a href='#' class='"+m[15]+"' "+i+" />","<a href='#' class='"+m[16]+"' "+i+" />"],i=["x"===e.axis?i[2]:i[0],"x"===e.axis?i[3]:i[1],i[2],i[3]];e.scrollButtons.enable&&t.prepend(i[0]).append(i[1]).next(".mCSB_scrollTools").prepend(i[2]).append(i[3])},N=function(){var t=O(this).data(I),e=O("#mCSB_"+t.idx),i=O("#mCSB_"+t.idx+"_container"),t=[O("#mCSB_"+t.idx+"_dragger_vertical"),O("#mCSB_"+t.idx+"_dragger_horizontal")],e=[e.height()/i.outerHeight(!1),e.width()/i.outerWidth(!1)],i=[parseInt(t[0].css("min-height")),Math.round(e[0]*t[0].parent().height()),parseInt(t[1].css("min-width")),Math.round(e[1]*t[1].parent().width())],e=f&&i[3]<i[2]?i[2]:i[3];t[0].css({height:f&&i[1]<i[0]?i[0]:i[1],"max-height":t[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":i[0]+"px"}),t[1].css({width:e,"max-width":t[1].parent().width()-10})},Q=function(){var t=O(this).data(I),e=O("#mCSB_"+t.idx),i=O("#mCSB_"+t.idx+"_container"),o=[O("#mCSB_"+t.idx+"_dragger_vertical"),O("#mCSB_"+t.idx+"_dragger_horizontal")],i=[i.outerHeight(!1)-e.height(),i.outerWidth(!1)-e.width()],e=[i[0]/(o[0].parent().height()-o[0].height()),i[1]/(o[1].parent().width()-o[1].width())];t.scrollRatio={y:e[0],x:e[1]}},S=function(t,e,i){var i=i?m[0]+"_expanded":"",o=t.closest(".mCSB_scrollTools");"active"===e?(t.toggleClass(m[0]+" "+i),o.toggleClass(m[1]),t[0]._draggable=t[0]._draggable?0:1):t[0]._draggable||("hide"===e?(t.removeClass(m[0]),o.removeClass(m[1])):(t.addClass(m[0]),o.addClass(m[1])))},G=function(){var t=O(this).data(I),e=O("#mCSB_"+t.idx),i=O("#mCSB_"+t.idx+"_container"),o=null==t.overflowed?i.height():i.outerHeight(!1),t=null==t.overflowed?i.width():i.outerWidth(!1),r=i[0].scrollHeight,i=i[0].scrollWidth;return t<i&&(t=i),[(o=o<r?r:o)>e.height(),t>e.width()]},_=function(){var t=O(this),e=t.data(I),i=e.opt,o=O("#mCSB_"+e.idx),r=O("#mCSB_"+e.idx+"_container"),a=[O("#mCSB_"+e.idx+"_dragger_vertical"),O("#mCSB_"+e.idx+"_dragger_horizontal")];R(t),("x"!==i.axis&&!e.overflowed[0]||"y"===i.axis&&e.overflowed[0])&&(a[0].add(r).css("top",0),F(t,"_resetY")),("y"!==i.axis&&!e.overflowed[1]||"x"===i.axis&&e.overflowed[1])&&(i=dx=0,"rtl"===e.langDir&&(i=o.width()-r.outerWidth(!1),dx=Math.abs(i/e.scrollRatio.x)),r.css("left",i),a[1].css("left",dx),F(t,"_resetX"))},Y=function(){var e,i=O(this),t=i.data(I),o=t.opt;t.bindEvents||(X.call(this),o.contentTouchScroll&&V.call(this),K.call(this),o.mouseWheel.enable&&function t(){e=setTimeout(function(){O.event.special.mousewheel?(clearTimeout(e),Z.call(i[0])):t()},100)}(),tt.call(this),it.call(this),o.advanced.autoScrollOnFocus&&et.call(this),o.scrollButtons.enable&&ot.call(this),o.keyboard.enable&&rt.call(this),t.bindEvents=!0)},u=function(){var t=O(this),e=t.data(I),i=e.opt,o="mCS_"+e.idx,r=".mCSB_"+e.idx+"_scrollbar",r=O("#mCSB_"+e.idx+",#mCSB_"+e.idx+"_container,#mCSB_"+e.idx+"_container_wrapper,"+r+" ."+m[12]+",#mCSB_"+e.idx+"_dragger_vertical,#mCSB_"+e.idx+"_dragger_horizontal,"+r+">a"),a=O("#mCSB_"+e.idx+"_container");i.advanced.releaseDraggableSelectors&&r.add(O(i.advanced.releaseDraggableSelectors)),i.advanced.extraDraggableSelectors&&r.add(O(i.advanced.extraDraggableSelectors)),e.bindEvents&&(O(document).add(O(!P()||top.document)).unbind("."+o),r.each(function(){O(this).unbind("."+o)}),clearTimeout(t[0]._focusTimeout),w(t[0],"_focusTimeout"),clearTimeout(e.sequential.step),w(e.sequential,"step"),clearTimeout(a[0].onCompleteTimeout),w(a[0],"onCompleteTimeout"),e.bindEvents=!1)},g=function(t){var e=O(this),i=e.data(I),o=i.opt,r=O("#mCSB_"+i.idx+"_container_wrapper"),r=r.length?r:O("#mCSB_"+i.idx+"_container"),a=[O("#mCSB_"+i.idx+"_scrollbar_vertical"),O("#mCSB_"+i.idx+"_scrollbar_horizontal")],s=[a[0].find(".mCSB_dragger"),a[1].find(".mCSB_dragger")];"x"!==o.axis&&(i.overflowed[0]&&!t?(a[0].add(s[0]).add(a[0].children("a")).css("display","block"),r.removeClass(m[8]+" "+m[10])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[0].css("display","none"),r.removeClass(m[10])):(a[0].css("display","none"),r.addClass(m[10])),r.addClass(m[8]))),"y"!==o.axis&&(i.overflowed[1]&&!t?(a[1].add(s[1]).add(a[1].children("a")).css("display","block"),r.removeClass(m[9]+" "+m[11])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[1].css("display","none"),r.removeClass(m[11])):(a[1].css("display","none"),r.addClass(m[11])),r.addClass(m[9]))),i.overflowed[0]||i.overflowed[1]?e.removeClass(m[5]):e.addClass(m[5])},L=function(t){var e=t.type,i=t.target.ownerDocument!==document&&null!==frameElement?[O(frameElement).offset().top,O(frameElement).offset().left]:null,o=P()&&t.target.ownerDocument!==top.document&&null!==frameElement?[O(t.view.frameElement).offset().top,O(t.view.frameElement).offset().left]:[0,0];switch(e){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return i?[t.originalEvent.pageY-i[0]+o[0],t.originalEvent.pageX-i[1]+o[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var r=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],a=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[r.screenY,r.screenX,1<a]:[r.pageY,r.pageX,1<a];default:return i?[t.pageY-i[0]+o[0],t.pageX-i[1]+o[1],!1]:[t.pageY,t.pageX,!1]}},X=function(){function o(t,e,i,o){var r;p[0].idleTimer=c.scrollInertia<233?250:0,e=a.attr("id")===d[1]?(r="x",(a[0].offsetLeft-e+o)*l.scrollRatio.x):(r="y",(a[0].offsetTop-t+i)*l.scrollRatio.y),F(n,e.toString(),{dir:r,drag:!0})}var a,r,s,n=O(this),l=n.data(I),c=l.opt,t="mCS_"+l.idx,d=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],p=O("#mCSB_"+l.idx+"_container"),e=O("#"+d[0]+",#"+d[1]),i=c.advanced.releaseDraggableSelectors?e.add(O(c.advanced.releaseDraggableSelectors)):e,h=c.advanced.extraDraggableSelectors?O(!P()||top.document).add(O(c.advanced.extraDraggableSelectors)):O(!P()||top.document);e.bind("contextmenu."+t,function(t){t.preventDefault()}).bind("mousedown."+t+" touchstart."+t+" pointerdown."+t+" MSPointerDown."+t,function(t){var e,i,o;t.stopImmediatePropagation(),t.preventDefault(),k(t)&&(B=!0,f&&(document.onselectstart=function(){return!1}),b.call(p,!1),R(n),o=(a=O(this)).offset(),e=L(t)[0]-o.top,t=L(t)[1]-o.left,i=a.height()+o.top,o=a.width()+o.left,e<i&&0<e&&t<o&&0<t&&(r=e,s=t),S(a,"active",c.autoExpandScrollbar))}).bind("touchmove."+t,function(t){t.stopImmediatePropagation(),t.preventDefault();var e=a.offset(),i=L(t)[0]-e.top,t=L(t)[1]-e.left;o(r,s,i,t)}),O(document).add(h).bind("mousemove."+t+" pointermove."+t+" MSPointerMove."+t,function(t){var e,i;a&&(e=a.offset(),i=L(t)[0]-e.top,t=L(t)[1]-e.left,r===i&&s===t||o(r,s,i,t))}).add(i).bind("mouseup."+t+" touchend."+t+" pointerup."+t+" MSPointerUp."+t,function(){a&&(S(a,"active",c.autoExpandScrollbar),a=null),B=!1,f&&(document.onselectstart=null),b.call(p,!0)})},V=function(){function e(t){if(!H(t)||B||L(t)[2])return E=0;b=g=0,n=E=1,v.removeClass("mCS_touch_action");var e=k.offset();l=L(t)[0]-e.top,c=L(t)[1]-e.left,T=[L(t)[0],L(t)[1]]}function i(t){var e,i,o,r,a;H(t)&&!B&&!L(t)[2]&&(x.documentTouchScroll||t.preventDefault(),t.stopImmediatePropagation(),!b||g)&&n&&(_=z(),i=w.offset(),e=L(t)[0]-i.top,i=L(t)[1]-i.left,o="mcsLinearOut",j.push(e),$.push(i),T[2]=Math.abs(L(t)[0]-T[0]),T[3]=Math.abs(L(t)[1]-T[1]),y.overflowed[0]&&(r=S[0].parent().height()-S[0].height(),r=0<l-e&&e-l>-(r*y.scrollRatio.y)&&(2*T[3]<T[2]||"yx"===x.axis)),y.overflowed[1]&&(a=S[1].parent().width()-S[1].width(),a=0<c-i&&i-c>-(a*y.scrollRatio.x)&&(2*T[2]<T[3]||"yx"===x.axis)),r||a?(M||t.preventDefault(),g=1):(b=1,v.addClass("mCS_touch_action")),M&&t.preventDefault(),f="yx"===x.axis?[l-e,c-i]:"x"===x.axis?[null,c-i]:[l-e,null],k[0].idleTimer=250,y.overflowed[0]&&s(f[0],C,o,"y","all",!0),y.overflowed[1])&&s(f[1],C,o,"x",D,!0)}function o(t){if(!H(t)||B||L(t)[2])return E=0;E=1,t.stopImmediatePropagation(),R(v),h=z();var e=w.offset();d=L(t)[0]-e.top,p=L(t)[1]-e.left,j=[],$=[]}function r(t){var e,i,o,r;!H(t)||B||L(t)[2]||(n=0,t.stopImmediatePropagation(),b=g=0,u=z(),e=w.offset(),r=L(t)[0]-e.top,t=L(t)[1]-e.left,30<u-_)||(e="mcsEaseOut",o=(i=(u=1e3/(u-h))<2.5)?[j[j.length-2],$[$.length-2]]:[0,0],m=i?[r-o[0],t-o[1]]:[r-d,t-p],o=[Math.abs(m[0]),Math.abs(m[1])],u=i?[Math.abs(m[0]/4),Math.abs(m[1]/4)]:[u,u],r=[Math.abs(k[0].offsetTop)-m[0]*a(o[0]/u[0],u[0]),Math.abs(k[0].offsetLeft)-m[1]*a(o[1]/u[1],u[1])],f="yx"===x.axis?[r[0],r[1]]:"x"===x.axis?[null,r[1]]:[r[0],null],m=[4*o[0]+x.scrollInertia,4*o[1]+x.scrollInertia],t=parseInt(x.contentTouchScroll)||0,f[0]=t<o[0]?f[0]:0,f[1]=t<o[1]?f[1]:0,y.overflowed[0]&&s(f[0],m[0],e,"y",D,!1),y.overflowed[1]&&s(f[1],m[1],e,"x",D,!1))}function a(t,e){var i=[1.5*e,2*e,e/1.5,e/2];return 90<t?4<e?i[0]:i[3]:60<t?3<e?i[3]:i[2]:30<t?8<e?i[1]:6<e?i[0]:4<e?e:i[2]:8<e?e:i[3]}function s(t,e,i,o,r,a){t&&F(v,t.toString(),{dur:e,scrollEasing:i,dir:o,overwrite:r,drag:a})}var n,l,c,d,p,h,_,u,f,m,g,b,v=O(this),y=v.data(I),x=y.opt,t="mCS_"+y.idx,w=O("#mCSB_"+y.idx),k=O("#mCSB_"+y.idx+"_container"),S=[O("#mCSB_"+y.idx+"_dragger_vertical"),O("#mCSB_"+y.idx+"_dragger_horizontal")],j=[],$=[],C=0,D="yx"===x.axis?"none":"all",T=[],A=k.find("iframe"),q=["touchstart."+t+" pointerdown."+t+" MSPointerDown."+t,"touchmove."+t+" pointermove."+t+" MSPointerMove."+t,"touchend."+t+" pointerup."+t+" MSPointerUp."+t],M=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;k.bind(q[0],function(t){e(t)}).bind(q[1],function(t){i(t)}),w.bind(q[0],function(t){o(t)}).bind(q[2],function(t){r(t)}),A.length&&A.each(function(){O(this).bind("load",function(){P(this)&&O(this.contentDocument||this.contentWindow.document).bind(q[0],function(t){e(t),o(t)}).bind(q[1],function(t){i(t)}).bind(q[2],function(t){r(t)})})})},K=function(){function o(t,e,i){l.type=i&&r?"stepped":"stepless",l.scrollAmount=10,v(a,t,e,"mcsLinearOut",i?60:null)}var r,a=O(this),s=a.data(I),n=s.opt,l=s.sequential,t="mCS_"+s.idx,c=O("#mCSB_"+s.idx+"_container"),d=c.parent();c.bind("mousedown."+t,function(){E||r||(r=1,B=!0)}).add(document).bind("mousemove."+t,function(t){var e,i;!E&&r&&(window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&document.selection.createRange().text)&&(e=c.offset(),i=L(t)[0]-e.top+c[0].offsetTop,t=L(t)[1]-e.left+c[0].offsetLeft,0<i&&i<d.height()&&0<t&&t<d.width()?l.step&&o("off",null,"stepped"):("x"!==n.axis&&s.overflowed[0]&&(i<0?o("on",38):i>d.height()&&o("on",40)),"y"!==n.axis&&s.overflowed[1]&&(t<0?o("on",37):t>d.width()&&o("on",39))))}).bind("mouseup."+t+" dragend."+t,function(){E||(r&&(r=0,o("off",null)),B=!1)})},Z=function(){function i(t,e){var i,o,r,a,s,n,l,c;R(d),J(d,t.target)||(c="auto"!==h.mouseWheel.deltaFactor?parseInt(h.mouseWheel.deltaFactor):!(f&&t.deltaFactor<100)&&t.deltaFactor||100,i=h.scrollInertia,c="x"===h.axis||"x"===h.mouseWheel.axis?(o="x",r=[Math.round(c*p.scrollRatio.x),parseInt(h.mouseWheel.scrollAmount)],a="auto"!==h.mouseWheel.scrollAmount?r[1]:r[0]>=_.width()?.9*_.width():r[0],s=Math.abs(O("#mCSB_"+p.idx+"_container")[0].offsetLeft),n=u[1][0].offsetLeft,l=u[1].parent().width()-u[1].width(),"y"===h.mouseWheel.axis?t.deltaY||e:t.deltaX):(o="y",r=[Math.round(c*p.scrollRatio.y),parseInt(h.mouseWheel.scrollAmount)],a="auto"!==h.mouseWheel.scrollAmount?r[1]:r[0]>=_.height()?.9*_.height():r[0],s=Math.abs(O("#mCSB_"+p.idx+"_container")[0].offsetTop),n=u[0][0].offsetTop,l=u[0].parent().height()-u[0].height(),t.deltaY||e),"y"===o&&!p.overflowed[0])||"x"===o&&!p.overflowed[1]||((h.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(c=-c),(0<(c=h.mouseWheel.normalizeDelta?c<0?-1:1:c)&&0!==n||c<0&&n!==l||h.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!h.mouseWheel.normalizeDelta&&(a=t.deltaFactor,i=17),F(d,(s-c*a).toString(),{dir:o,dur:i}))}var d,p,h,t,_,u,e;O(this).data(I)&&(d=O(this),p=d.data(I),h=p.opt,t="mCS_"+p.idx,_=O("#mCSB_"+p.idx),u=[O("#mCSB_"+p.idx+"_dragger_vertical"),O("#mCSB_"+p.idx+"_dragger_horizontal")],(e=O("#mCSB_"+p.idx+"_container").find("iframe")).length&&e.each(function(){O(this).bind("load",function(){P(this)&&O(this.contentDocument||this.contentWindow.document).bind("mousewheel."+t,function(t,e){i(t,e)})})}),_.bind("mousewheel."+t,function(t,e){i(t,e)}))},s=new Object,P=function(t){var e=!1,i=!1,o=null;if(void 0===t?i="#empty":void 0!==O(t).attr("id")&&(i=O(t).attr("id")),!1!==i&&void 0!==s[i])return s[i];if(t)try{o=(t.contentDocument||t.contentWindow.document).body.innerHTML}catch(t){}else try{o=top.document.body.innerHTML}catch(t){}return e=null!==o,!1!==i&&(s[i]=e),e},b=function(t){var e=this.find("iframe");e.length&&e.css("pointer-events",t?"auto":"none")},J=function(t,e){var i=e.nodeName.toLowerCase(),t=t.data(I).opt.mouseWheel.disableOver;return-1<O.inArray(i,t)&&!(-1<O.inArray(i,["select","textarea"])&&!O(e).is(":focus"))},tt=function(){var s,n=O(this),l=n.data(I),t="mCS_"+l.idx,c=O("#mCSB_"+l.idx+"_container"),d=c.parent();O(".mCSB_"+l.idx+"_scrollbar ."+m[12]).bind("mousedown."+t+" touchstart."+t+" pointerdown."+t+" MSPointerDown."+t,function(t){B=!0,O(t.target).hasClass("mCSB_dragger")||(s=1)}).bind("touchend."+t+" pointerup."+t+" MSPointerUp."+t,function(){B=!1}).bind("click."+t,function(t){if(s&&(s=0,O(t.target).hasClass(m[12])||O(t.target).hasClass("mCSB_draggerRail"))){R(n);var e=O(this),i=e.find(".mCSB_dragger");if(0<e.parent(".mCSB_scrollTools_horizontal").length){if(!l.overflowed[1])return;var o="x",r=t.pageX>i.offset().left?-1:1,a=Math.abs(c[0].offsetLeft)-r*(.9*d.width())}else{if(!l.overflowed[0])return;o="y",r=t.pageY>i.offset().top?-1:1,a=Math.abs(c[0].offsetTop)-r*(.9*d.height())}F(n,a.toString(),{dir:o,scrollEasing:"mcsEaseInOut"})}})},et=function(){var r=O(this),t=r.data(I),a=t.opt,e="mCS_"+t.idx,s=O("#mCSB_"+t.idx+"_container"),n=s.parent();s.bind("focusin."+e,function(){var o=O(document.activeElement),t=s.find(".mCustomScrollBox").length;o.is(a.advanced.autoScrollOnFocus)&&(R(r),clearTimeout(r[0]._focusTimeout),r[0]._focusTimer=t?17*t:0,r[0]._focusTimeout=setTimeout(function(){var t=[D(o)[0],D(o)[1]],e=[s[0].offsetTop,s[0].offsetLeft],e=[0<=e[0]+t[0]&&e[0]+t[0]<n.height()-o.outerHeight(!1),0<=e[1]+t[1]&&e[0]+t[1]<n.width()-o.outerWidth(!1)],i="yx"!==a.axis||e[0]||e[1]?"all":"none";"x"===a.axis||e[0]||F(r,t[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:i,dur:0}),"y"===a.axis||e[1]||F(r,t[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:i,dur:0})},r[0]._focusTimer))})},it=function(){var t=O(this).data(I),e="mCS_"+t.idx,i=O("#mCSB_"+t.idx+"_container").parent();i.bind("scroll."+e,function(){0===i.scrollTop()&&0===i.scrollLeft()||O(".mCSB_"+t.idx+"_scrollbar").css("visibility","hidden")})},ot=function(){var o=O(this),r=o.data(I),a=r.opt,s=r.sequential,t="mCS_"+r.idx;O(".mCSB_"+r.idx+"_scrollbar"+">a").bind("contextmenu."+t,function(t){t.preventDefault()}).bind("mousedown."+t+" touchstart."+t+" pointerdown."+t+" MSPointerDown."+t+" mouseup."+t+" touchend."+t+" pointerup."+t+" MSPointerUp."+t+" mouseout."+t+" pointerout."+t+" MSPointerOut."+t+" click."+t,function(t){function e(t,e){s.scrollAmount=a.scrollButtons.scrollAmount,v(o,t,e)}if(t.preventDefault(),k(t)){var i=O(this).attr("class");switch(s.type=a.scrollButtons.scrollType,t.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":"stepped"!==s.type&&(B=!0,r.tweenRunning=!1,e("on",i));break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":"stepped"!==s.type&&(B=!1,s.dir)&&e("off",i);break;case"click":if("stepped"!==s.type||r.tweenRunning)return;e("on",i)}}})},rt=function(){function e(t){function e(t,e){c.type=l.keyboard.scrollType,c.scrollAmount=l.keyboard.scrollAmount,"stepped"===c.type&&n.tweenRunning||v(s,t,e)}switch(t.type){case"blur":n.tweenRunning&&c.dir&&e("off",null);break;case"keydown":case"keyup":var i,o,r=t.keyCode||t.which,a="on";"x"!==l.axis&&(38===r||40===r)||"y"!==l.axis&&(37===r||39===r)?(38!==r&&40!==r||n.overflowed[0])&&(37!==r&&39!==r||n.overflowed[1])&&("keyup"===t.type&&(a="off"),O(document.activeElement).is(h)||(t.preventDefault(),t.stopImmediatePropagation(),e(a,r))):33===r||34===r?((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type&&(R(s),a=34===r?-1:1,o="x"===l.axis||"yx"===l.axis&&n.overflowed[1]&&!n.overflowed[0]?(i="x",Math.abs(d[0].offsetLeft)-a*(.9*p.width())):(i="y",Math.abs(d[0].offsetTop)-a*(.9*p.height())),F(s,o.toString(),{dir:i,scrollEasing:"mcsEaseInOut"}))):35!==r&&36!==r||O(document.activeElement).is(h)||((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"!==t.type)||(o="x"===l.axis||"yx"===l.axis&&n.overflowed[1]&&!n.overflowed[0]?(i="x",35===r?Math.abs(p.width()-d.outerWidth(!1)):0):(i="y",35===r?Math.abs(p.height()-d.outerHeight(!1)):0),F(s,o.toString(),{dir:i,scrollEasing:"mcsEaseInOut"}))}}var s=O(this),n=s.data(I),l=n.opt,c=n.sequential,t="mCS_"+n.idx,i=O("#mCSB_"+n.idx),d=O("#mCSB_"+n.idx+"_container"),p=d.parent(),h="input,textarea,select,datalist,keygen,[contenteditable='true']",o=d.find("iframe"),r=["blur."+t+" keydown."+t+" keyup."+t];o.length&&o.each(function(){O(this).bind("load",function(){P(this)&&O(this.contentDocument||this.contentWindow.document).bind(r[0],function(t){e(t)})})}),i.attr("tabindex","0").bind(r[0],function(t){e(t)})},v=function(s,t,e,n,l){function c(t){p.snapAmount&&(h.scrollAmount=p.snapAmount instanceof Array?"x"===h.dir[0]?p.snapAmount[1]:p.snapAmount[0]:p.snapAmount);var e="stepped"!==h.type,i=l||(t?e?u/1.5:f:1e3/60),o=t?e?7.5:40:2.5,r=[Math.abs(_[0].offsetTop),Math.abs(_[0].offsetLeft)],a=[10<d.scrollRatio.y?10:d.scrollRatio.y,10<d.scrollRatio.x?10:d.scrollRatio.x],a="x"===h.dir[0]?r[1]+h.dir[1]*(a[1]*o):r[0]+h.dir[1]*(a[0]*o),o="x"===h.dir[0]?r[1]+h.dir[1]*parseInt(h.scrollAmount):r[0]+h.dir[1]*parseInt(h.scrollAmount),o="auto"!==h.scrollAmount?o:a,a=n||(t?e?"mcsLinearOut":"mcsEaseInOut":"mcsLinear"),e=!!t;t&&i<17&&(o="x"===h.dir[0]?r[1]:r[0]),F(s,o.toString(),{dir:h.dir[0],scrollEasing:a,dur:i,onComplete:e}),t?h.dir=!1:(clearTimeout(h.step),h.step=setTimeout(function(){c()},i))}var d=s.data(I),p=d.opt,h=d.sequential,_=O("#mCSB_"+d.idx+"_container"),i="stepped"===h.type,u=p.scrollInertia<26?26:p.scrollInertia,f=p.scrollInertia<1?17:p.scrollInertia;switch(t){case"on":h.dir=[e===m[16]||e===m[15]||39===e||37===e?"x":"y",e===m[13]||e===m[15]||38===e||37===e?-1:1],R(s),C(e)&&"stepped"===h.type||c(i);break;case"off":clearTimeout(h.step),w(h,"step"),R(s),(i||d.tweenRunning&&h.dir)&&c(!0)}},j=function(t){var e=O(this).data(I).opt,i=[];return(t="function"==typeof t?t():t)instanceof Array?i=1<t.length?[t[0],t[1]]:"x"===e.axis?[null,t[0]]:[t[0],null]:(i[0]=t.y||(t.x||"x"===e.axis?null:t),i[1]=t.x||(t.y||"y"===e.axis?null:t)),"function"==typeof i[0]&&(i[0]=i[0]()),"function"==typeof i[1]&&(i[1]=i[1]()),i},y=function(t,e){if(null!=t&&void 0!==t){var i,o,r=O(this),a=r.data(I),s=a.opt,n=O("#mCSB_"+a.idx+"_container"),l=n.parent(),a=typeof t,c="x"===(e=e||("x"===s.axis?"x":"y"))?n.outerWidth(!1)-l.width():n.outerHeight(!1)-l.height(),d="x"===e?n[0].offsetLeft:n[0].offsetTop,p="x"===e?"left":"top";switch(a){case"function":return t();case"object":return(o=t.jquery?t:O(t)).length?"x"===e?D(o)[1]:D(o)[0]:void 0;case"string":case"number":return C(t)?Math.abs(t):-1!==t.indexOf("%")?Math.abs(c*parseInt(t)/100):-1!==t.indexOf("-=")?Math.abs(d-parseInt(t.split("-=")[1])):-1!==t.indexOf("+=")?0<=(i=d+parseInt(t.split("+=")[1]))?0:Math.abs(i):-1!==t.indexOf("px")&&C(t.split("px")[0])?Math.abs(t.split("px")[0]):"top"===t||"left"===t?0:"bottom"===t?Math.abs(l.height()-n.outerHeight(!1)):"right"===t?Math.abs(l.width()-n.outerWidth(!1)):"first"===t||"last"===t?(o=n.find(":"+t),"x"===e?D(o)[1]:D(o)[0]):O(t).length?"x"===e?D(O(t))[1]:D(O(t))[0]:(n.css(p,t),void h.update.call(null,r[0]))}}},x=function(t){function o(t){clearTimeout(n[0].autoUpdate),h.update.call(null,r[0],t)}var r=O(this),a=r.data(I),s=a.opt,n=O("#mCSB_"+a.idx+"_container");return t?(clearTimeout(n[0].autoUpdate),void w(n[0],"autoUpdate")):void function i(){return clearTimeout(n[0].autoUpdate),0===r.parents("html").length?void(r=null):void(n[0].autoUpdate=setTimeout(function(){return s.advanced.updateOnSelectorChange&&(a.poll.change.n=(!0===s.advanced.updateOnSelectorChange&&(s.advanced.updateOnSelectorChange="*"),t=0,e=n.find(s.advanced.updateOnSelectorChange),s.advanced.updateOnSelectorChange&&0<e.length&&e.each(function(){t+=this.offsetHeight+this.offsetWidth}),t),a.poll.change.n!==a.poll.change.o)?(a.poll.change.o=a.poll.change.n,void o(3)):s.advanced.updateOnContentResize&&(a.poll.size.n=r[0].scrollHeight+r[0].scrollWidth+n[0].offsetHeight+r[0].offsetHeight+r[0].offsetWidth,a.poll.size.n!==a.poll.size.o)?(a.poll.size.o=a.poll.size.n,void o(1)):!s.advanced.updateOnImageLoad||"auto"===s.advanced.updateOnImageLoad&&"y"===s.axis||(a.poll.img.n=n.find("img").length,a.poll.img.n===a.poll.img.o)?void((s.advanced.updateOnSelectorChange||s.advanced.updateOnContentResize||s.advanced.updateOnImageLoad)&&i()):(a.poll.img.o=a.poll.img.n,void n.find("img").each(function(){var t,e;O(t=this).hasClass(m[2])?o():((e=new Image).onload=((t,e)=>function(){return e.apply(t,arguments)})(e,function(){this.onload=null,O(t).addClass(m[2]),o(2)}),e.src=t.src)}));var t,e},s.advanced.autoUpdateTimeout))}()},R=function(t){t=t.data(I);O("#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal").each(function(){e.call(this)})},F=function(r,t,a){function e(t){return n&&l.callbacks[t]&&"function"==typeof l.callbacks[t]}function i(){var t=[p[0].offsetTop,p[0].offsetLeft],e=[f[0].offsetTop,f[0].offsetLeft],i=[p.outerHeight(!1),p.outerWidth(!1)],o=[d.height(),d.width()];r[0].mcs={content:p,top:t[0],left:t[1],draggerTop:e[0],draggerLeft:e[1],topPct:Math.round(100*Math.abs(t[0])/(Math.abs(i[0])-o[0])),leftPct:Math.round(100*Math.abs(t[1])/(Math.abs(i[1])-o[1])),direction:a.dir}}var o,s,n=r.data(I),l=n.opt,c={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:l.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},c=[(a=O.extend(c,a)).dur,a.drag?0:a.dur],d=O("#mCSB_"+n.idx),p=O("#mCSB_"+n.idx+"_container"),h=p.parent(),_=l.callbacks.onTotalScrollOffset?j.call(r,l.callbacks.onTotalScrollOffset):[0,0],u=l.callbacks.onTotalScrollBackOffset?j.call(r,l.callbacks.onTotalScrollBackOffset):[0,0];if(n.trigger=a.trigger,0===h.scrollTop()&&0===h.scrollLeft()||(O(".mCSB_"+n.idx+"_scrollbar").css("visibility","visible"),h.scrollTop(0).scrollLeft(0)),"_resetY"!==t||n.contentReset.y||(e("onOverflowYNone")&&l.callbacks.onOverflowYNone.call(r[0]),n.contentReset.y=1),"_resetX"!==t||n.contentReset.x||(e("onOverflowXNone")&&l.callbacks.onOverflowXNone.call(r[0]),n.contentReset.x=1),"_resetY"!==t&&"_resetX"!==t){switch(!n.contentReset.y&&r[0].mcs||!n.overflowed[0]||(e("onOverflowY")&&l.callbacks.onOverflowY.call(r[0]),n.contentReset.x=null),!n.contentReset.x&&r[0].mcs||!n.overflowed[1]||(e("onOverflowX")&&l.callbacks.onOverflowX.call(r[0]),n.contentReset.x=null),l.snapAmount&&(h=l.snapAmount instanceof Array?"x"===a.dir?l.snapAmount[1]:l.snapAmount[0]:l.snapAmount,o=t,h=h,s=l.snapOffset,t=Math.round(o/h)*h-s),a.dir){case"x":var f=O("#mCSB_"+n.idx+"_dragger_horizontal"),m="left",g=p[0].offsetLeft,b=[d.width()-p.outerWidth(!1),f.parent().width()-f.width()],v=[t,0===t?0:t/n.scrollRatio.x],y=_[1],x=u[1],w=0<y?y/n.scrollRatio.x:0,k=0<x?x/n.scrollRatio.x:0;break;case"y":f=O("#mCSB_"+n.idx+"_dragger_vertical"),m="top",g=p[0].offsetTop,b=[d.height()-p.outerHeight(!1),f.parent().height()-f.height()],v=[t,0===t?0:t/n.scrollRatio.y],y=_[0],x=u[0],w=0<y?y/n.scrollRatio.y:0,k=0<x?x/n.scrollRatio.y:0}v[1]<0||0===v[0]&&0===v[1]?v=[0,0]:v[1]>=b[1]?v=[b[0],b[1]]:v[0]=-v[0],r[0].mcs||(i(),e("onInit")&&l.callbacks.onInit.call(r[0])),clearTimeout(p[0].onCompleteTimeout),$(f[0],m,Math.round(v[1]),c[1],a.scrollEasing),!n.tweenRunning&&(0===g&&0<=v[0]||g===b[0]&&v[0]<=b[0])||$(p[0],m,Math.round(v[0]),c[0],a.scrollEasing,a.overwrite,{onStart:function(){a.callbacks&&a.onStart&&!n.tweenRunning&&(e("onScrollStart")&&(i(),l.callbacks.onScrollStart.call(r[0])),n.tweenRunning=!0,S(f),n.cbOffsets=[l.callbacks.alwaysTriggerOffsets||g>=b[0]+y,l.callbacks.alwaysTriggerOffsets||g<=-x])},onUpdate:function(){a.callbacks&&a.onUpdate&&e("whileScrolling")&&(i(),l.callbacks.whileScrolling.call(r[0]))},onComplete:function(){var t;a.callbacks&&a.onComplete&&("yx"===l.axis&&clearTimeout(p[0].onCompleteTimeout),t=p[0].idleTimer||0,p[0].onCompleteTimeout=setTimeout(function(){e("onScroll")&&(i(),l.callbacks.onScroll.call(r[0])),e("onTotalScroll")&&v[1]>=b[1]-w&&n.cbOffsets[0]&&(i(),l.callbacks.onTotalScroll.call(r[0])),e("onTotalScrollBack")&&v[1]<=k&&n.cbOffsets[1]&&(i(),l.callbacks.onTotalScrollBack.call(r[0])),n.tweenRunning=!1,p[0].idleTimer=0,S(f,"hide")},t))}})}},$=function(t,e,i,o,r,a,s){function n(){b.stop||(f||p.call(),f=z()-u,l(),f>=b.time&&(b.time=f>b.time?f+c-(f-b.time):f+c-1,b.time<f+1)&&(b.time=f+1),b.time<o?b.id=d(n):_.call())}function l(){0<o?(b.currVal=((t,e,i,o,r)=>{switch(r){case"linear":case"mcsLinear":return i*t/o+e;case"mcsLinearOut":return t/=o,t--,i*Math.sqrt(1-t*t)+e;case"easeInOutSmooth":return(t/=o/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e;case"easeInOutStrong":return(t/=o/2)<1?i/2*Math.pow(2,10*(t-1))+e:(t--,i/2*(2-Math.pow(2,-10*t))+e);case"easeInOut":case"mcsEaseInOut":return(t/=o/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e;case"easeOutSmooth":return t/=o,-i*(--t*t*t*t-1)+e;case"easeOutStrong":return i*(1-Math.pow(2,-10*t/o))+e;default:var a=(t/=o)*t,s=a*t;return e+i*(.499999999999997*s*a+-2.5*a*a+5.5*s+-6.5*a+4*t)}})(b.time,m,v,o,r),g[e]=Math.round(b.currVal)+"px"):g[e]=i+"px",h.call()}t._mTween||(t._mTween={top:{},left:{}});var c,d,p=(s=s||{}).onStart||function(){},h=s.onUpdate||function(){},_=s.onComplete||function(){},u=z(),f=0,m=t.offsetTop,g=t.style,b=t._mTween[e],v=("left"===e&&(m=t.offsetLeft),i-m);b.stop=0,"none"!==a&&null!=b.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(b.id):clearTimeout(b.id),b.id=null),c=1e3/60,b.time=f+c,d=window.requestAnimationFrame||function(t){return l(),setTimeout(t,.01)},b.id=d(n)},z=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},e=function(){var t=this;t._mTween||(t._mTween={top:{},left:{}});for(var e=["top","left"],i=0;i<e.length;i++){var o=e[i];t._mTween[o].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(t._mTween[o].id):clearTimeout(t._mTween[o].id),t._mTween[o].id=null,t._mTween[o].stop=1)}},w=function(e,i){try{delete e[i]}catch(t){e[i]=null}},k=function(t){return!(t.which&&1!==t.which)},H=function(t){t=t.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},C=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},D=function(t){var e=t.parents(".mCSB_container");return[t.offset().top-e.offset().top,t.offset().left-e.offset().left]},at=function(){var t=(()=>{var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var e=0;e<t.length;e++)if(t[e]+"Hidden"in document)return t[e]+"Hidden";return null})();return!!t&&document[t]},O.fn[l]=function(t){return h[t]?h[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void O.error("Method "+t+" does not exist"):h.init.apply(this,arguments)},O[l]=function(t){return h[t]?h[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void O.error("Method "+t+" does not exist"):h.init.apply(this,arguments)},O[l].defaults=r,window[l]=!0,O(window).bind("load",function(){O(o)[l](),O.extend(O.expr[":"],{mcsInView:O.expr[":"].mcsInView||function(t){var e,t=O(t),i=t.parents(".mCSB_container");if(i.length)return e=i.parent(),0<=(i=[i[0].offsetTop,i[0].offsetLeft])[0]+D(t)[0]&&i[0]+D(t)[0]<e.height()-t.outerHeight(!1)&&0<=i[1]+D(t)[1]&&i[1]+D(t)[1]<e.width()-t.outerWidth(!1)},mcsInSight:O.expr[":"].mcsInSight||function(t,e,i){var o,t=O(t),r=t.parents(".mCSB_container"),i="exact"===i[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(r.length)return o=[t.outerHeight(!1),t.outerWidth(!1)],t=[r[0].offsetTop+D(t)[0],r[0].offsetLeft+D(t)[1]],r=[r.parent()[0].offsetHeight,r.parent()[0].offsetWidth],t[0]-r[0]*(i=[o[0]<r[0]?i[0]:i[1],o[1]<r[1]?i[0]:i[1]])[0][0]<0&&0<=t[0]+o[0]-r[0]*i[0][1]&&t[1]-r[1]*i[1][0]<0&&0<=t[1]+o[1]-r[1]*i[1][1]},mcsOverflow:O.expr[":"].mcsOverflow||function(t){t=O(t).data(I);if(t)return t.overflowed[0]||t.overflowed[1]}})})}),(e=>{"undefined"!=typeof jQuery&&jQuery||"function"!=typeof define||!define.amd?"undefined"!=typeof jQuery&&jQuery||"object"!=typeof exports?e(jQuery,document,window,navigator):e(require("jquery"),document,window,navigator):define(["jquery"],function(t){return e(t,document,window,navigator)})})(function(s,n,l,t,c){var e,i=0,o=0<(t=t.userAgent).search(e=/msie\s\d+/i)&&e.exec(t).toString().split(" ")[1]<9&&(s("html").addClass("lt-ie9"),!0);function r(t,e,i){this.VERSION="2.3.1",this.input=t,this.plugin_count=i,this.current_plugin=0,this.calc_count=0,this.update_tm=0,this.old_from=0,this.old_to=0,this.old_min_interval=null,this.raf_id=null,this.dragging=!1,this.force_redraw=!1,this.no_diapason=!1,this.has_tab_index=!0,this.is_key=!1,this.is_update=!1,this.is_start=!0,this.is_finish=!1,this.is_active=!1,this.is_resize=!1,this.is_click=!1,e=e||{},this.$cache={win:s(l),body:s(n.body),input:s(t),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]},this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]},this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,p_single_fake:0,p_single_left:0};var o,r,i=this.$cache.input,t=i.prop("value"),a={skin:"flat",type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!0,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",postfix:"",max_postfix:"",decorate_both:!0,values_separator:" — ",input_values_separator:";",disable:!1,block:!1,extra_classes:"",scope:null,onStart:null,onChange:null,onFinish:null,onUpdate:null};for(r in"INPUT"!==i[0].nodeName&&console&&console.warn&&console.warn("Base element should be <input>!",i[0]),(o={skin:i.data("skin"),type:i.data("type"),min:i.data("min"),max:i.data("max"),from:i.data("from"),to:i.data("to"),step:i.data("step"),min_interval:i.data("minInterval"),max_interval:i.data("maxInterval"),drag_interval:i.data("dragInterval"),values:i.data("values"),from_fixed:i.data("fromFixed"),from_min:i.data("fromMin"),from_max:i.data("fromMax"),from_shadow:i.data("fromShadow"),to_fixed:i.data("toFixed"),to_min:i.data("toMin"),to_max:i.data("toMax"),to_shadow:i.data("toShadow"),prettify_enabled:i.data("prettifyEnabled"),prettify_separator:i.data("prettifySeparator"),force_edges:i.data("forceEdges"),keyboard:i.data("keyboard"),grid:i.data("grid"),grid_margin:i.data("gridMargin"),grid_num:i.data("gridNum"),grid_snap:i.data("gridSnap"),hide_min_max:i.data("hideMinMax"),hide_from_to:i.data("hideFromTo"),prefix:i.data("prefix"),postfix:i.data("postfix"),max_postfix:i.data("maxPostfix"),decorate_both:i.data("decorateBoth"),values_separator:i.data("valuesSeparator"),input_values_separator:i.data("inputValuesSeparator"),disable:i.data("disable"),block:i.data("block"),extra_classes:i.data("extraClasses")}).values=o.values&&o.values.split(","),o)!o.hasOwnProperty(r)||o[r]!==c&&""!==o[r]||delete o[r];t!==c&&""!==t&&((t=t.split(o.input_values_separator||e.input_values_separator||";"))[0]&&t[0]==+t[0]&&(t[0]=+t[0]),t[1]&&t[1]==+t[1]&&(t[1]=+t[1]),e&&e.values&&e.values.length?(a.from=t[0]&&e.values.indexOf(t[0]),a.to=t[1]&&e.values.indexOf(t[1])):(a.from=t[0]&&+t[0],a.to=t[1]&&+t[1])),s.extend(a,e),s.extend(a,o),this.options=a,this.update_check={},this.validate(),this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null},this.init()}Function.prototype.bind||(Function.prototype.bind=function(i){var o=this,r=[].slice;if("function"!=typeof o)throw new TypeError;var a=r.call(arguments,1),s=function(){var t,e;return this instanceof s?((t=function(){}).prototype=o.prototype,t=new t,e=o.apply(t,a.concat(r.call(arguments))),Object(e)===e?e:t):o.apply(i,a.concat(r.call(arguments)))};return s}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var i;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),r=o.length>>>0;if(0!=r){e=+e||0;if(!(r<=(e=Math.abs(e)===1/0?0:e)))for(i=Math.max(0<=e?e:r-Math.abs(e),0);i<r;){if(i in o&&o[i]===t)return i;i++}}return-1}),r.prototype={init:function(t){this.no_diapason=!1,this.coords.p_step=this.convertToPercent(this.options.step,!0),this.target="base",this.toggleInput(),this.append(),this.setMinMax(),t?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart()),this.updateScene()},append:function(){var t='<span class="irs irs--'+this.options.skin+" js-irs-"+this.plugin_count+" "+this.options.extra_classes+'"></span>';this.$cache.input.before(t),this.$cache.input.prop("readonly",!0),this.$cache.cont=this.$cache.input.prev(),this.result.slider=this.$cache.cont,this.$cache.cont.html('<span class="irs"><span class="irs-line" tabindex="0"></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span>'),this.$cache.rs=this.$cache.cont.find(".irs"),this.$cache.min=this.$cache.cont.find(".irs-min"),this.$cache.max=this.$cache.cont.find(".irs-max"),this.$cache.from=this.$cache.cont.find(".irs-from"),this.$cache.to=this.$cache.cont.find(".irs-to"),this.$cache.single=this.$cache.cont.find(".irs-single"),this.$cache.line=this.$cache.cont.find(".irs-line"),this.$cache.grid=this.$cache.cont.find(".irs-grid"),"single"===this.options.type?(this.$cache.cont.append('<span class="irs-bar irs-bar--single"></span><span class="irs-shadow shadow-single"></span><span class="irs-handle single"><i></i><i></i><i></i></span>'),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append('<span class="irs-bar"></span><span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-handle from"><i></i><i></i><i></i></span><span class="irs-handle to"><i></i><i></i><i></i></span>'),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler()),this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none"),this.appendGrid(),this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.input[0].disabled=!1,this.removeDisableMask(),this.bindEvents()),this.options.disable||(this.options.block?this.appendDisableMask():this.removeDisableMask()),this.options.drag_interval&&(this.$cache.bar[0].style.cursor="ew-resize")},setTopHandler:function(){var t=this.options.min,e=this.options.max,i=this.options.from,o=this.options.to;t<i&&o===e?this.$cache.s_from.addClass("type_last"):o<e&&this.$cache.s_to.addClass("type_last")},changeLevel:function(t){switch(t){case"single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake),this.$cache.s_single.addClass("state_hover");break;case"from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.$cache.s_from.addClass("state_hover"),this.$cache.s_from.addClass("type_last"),this.$cache.s_to.removeClass("type_last");break;case"to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to_fake),this.$cache.s_to.addClass("state_hover"),this.$cache.s_to.addClass("type_last"),this.$cache.s_from.removeClass("type_last");break;case"both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},appendDisableMask:function(){this.$cache.cont.append('<span class="irs-disable-mask"></span>'),this.$cache.cont.addClass("irs-disabled")},removeDisableMask:function(){this.$cache.cont.remove(".irs-disable-mask"),this.$cache.cont.removeClass("irs-disabled")},remove:function(){this.$cache.cont.remove(),this.$cache.cont=null,this.$cache.line.off("keydown.irs_"+this.plugin_count),this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),o&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)),this.$cache.grid_labels=[],this.coords.big=[],this.coords.big_w=[],this.coords.big_p=[],this.coords.big_x=[],cancelAnimationFrame(this.raf_id)},bindEvents:function(){this.no_diapason||(this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("focus.irs_"+this.plugin_count,this.pointerFocus.bind(this)),this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),("single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single):(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to)).on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.options.keyboard&&this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard")),o&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this))))},pointerFocus:function(t){var e,i;this.target||(e=(i="single"===this.options.type?this.$cache.single:this.$cache.from).offset().left,e+=i.width()/2-1,this.pointerClick("single",{preventDefault:function(){},pageX:e}))},pointerMove:function(t){this.dragging&&(t=t.pageX||t.originalEvent.touches&&t.originalEvent.touches[0].pageX,this.coords.x_pointer=t-this.coords.x_gap,this.calc())},pointerUp:function(t){this.current_plugin===this.plugin_count&&this.is_active&&(this.is_active=!1,this.$cache.cont.find(".state_hover").removeClass("state_hover"),this.force_redraw=!0,o&&s("*").prop("unselectable",!1),this.updateScene(),this.restoreOriginalMinInterval(),(s.contains(this.$cache.cont[0],t.target)||this.dragging)&&this.callOnFinish(),this.dragging=!1)},pointerDown:function(t,e){e.preventDefault();var i=e.pageX||e.originalEvent.touches&&e.originalEvent.touches[0].pageX;2!==e.button&&("both"===t&&this.setTempMinInterval(),t=t||this.target||"from",this.current_plugin=this.plugin_count,this.target=t,this.is_active=!0,this.dragging=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=i-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(t),o&&s("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),this.updateScene())},pointerClick:function(t,e){e.preventDefault();var i=e.pageX||e.originalEvent.touches&&e.originalEvent.touches[0].pageX;2!==e.button&&(this.current_plugin=this.plugin_count,this.target=t,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(i-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(t,e){if(!(this.current_plugin!==this.plugin_count||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)){switch(e.which){case 83:case 65:case 40:case 37:e.preventDefault(),this.moveByKey(!1);break;case 87:case 68:case 38:case 39:e.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(t){var e=this.coords.p_pointer,i=(this.options.max-this.options.min)/100,i=this.options.step/i;t?e+=i:e-=i,this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*e),this.is_key=!0,this.calc()},setMinMax:function(){var t,e;this.options&&(this.options.hide_min_max?(this.$cache.min[0].style.display="none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(t=this._prettify(this.options.min),e=this._prettify(this.options.max),this.result.min_pretty=t,this.result.max_pretty=e,this.$cache.min.html(this.decorate(t,this.options.min)),this.$cache.max.html(this.decorate(e,this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)))},setTempMinInterval:function(){var t=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval),this.options.min_interval=t},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},calc:function(t){if(this.options&&(this.calc_count++,10!==this.calc_count&&!t||(this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.calcHandlePercent()),this.coords.w_rs)){this.calcPointerPercent();var e,i,o=this.getHandleX();switch("both"===this.target&&(this.coords.p_gap=0,o=this.getHandleX()),"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,o=this.getHandleX(),this.options.drag_interval?this.target="both_one":this.target=this.chooseHandle(o)),this.target){case"base":var r=(this.options.max-this.options.min)/100,a=(this.result.from-this.options.min)/r,r=(this.result.to-this.options.min)/r;this.coords.p_single_real=this.toFixed(a),this.coords.p_from_real=this.toFixed(a),this.coords.p_to_real=this.toFixed(r),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real),this.target=null;break;case"single":this.options.from_fixed||(this.coords.p_single_real=this.convertToRealPercent(o),this.coords.p_single_real=this.calcWithStep(this.coords.p_single_real),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real));break;case"from":this.options.from_fixed||(this.coords.p_from_real=this.convertToRealPercent(o),this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real));break;case"to":this.options.to_fixed||(this.coords.p_to_real=this.convertToRealPercent(o),this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real));break;case"both":this.options.from_fixed||this.options.to_fixed||(o=this.toFixed(o+.001*this.coords.p_handle),this.coords.p_from_real=this.convertToRealPercent(o)-this.coords.p_gap_left,this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.convertToRealPercent(o)+this.coords.p_gap_right,this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real));break;case"both_one":this.options.from_fixed||this.options.to_fixed||(a=this.convertToRealPercent(o),r=this.result.from_percent,i=a+(e=(r=this.result.to_percent-r)/2),100<(i=(a=a-e)<0?(a=0)+r:i)&&(a=(i=100)-r),this.coords.p_from_real=this.calcWithStep(a),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.calcWithStep(i),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real))}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.result.from_pretty=this._prettify(this.result.from),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.from_pretty=this._prettify(this.result.from),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.result.to_pretty=this._prettify(this.result.to),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to])),this.calcMinMax(),this.calcLabels()}},calcPointerPercent:function(){this.coords.w_rs?(this.coords.x_pointer<0||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(t){return t/(100-this.coords.p_handle)*100},convertToFakePercent:function(t){return t/100*(100-this.coords.p_handle)},getHandleX:function(){var t=100-this.coords.p_handle,e=this.toFixed(this.coords.p_pointer-this.coords.p_gap);return e<0?e=0:t<e&&(e=t),e},calcHandlePercent:function(){"single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100)},chooseHandle:function(t){return"single"===this.options.type?"single":this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2<=t?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/2-this.labels.p_single_fake/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to_fake)/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake))},updateScene:function(){this.raf_id&&(cancelAnimationFrame(this.raf_id),this.raf_id=null),clearTimeout(this.update_tm),this.update_tm=null,this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0),this.coords.w_rs===this.coords.w_rs_old&&!this.force_redraw||(this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow()),this.coords.w_rs)&&(this.dragging||this.force_redraw||this.is_key)&&((this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key)&&(this.drawLabels(),this.$cache.bar[0].style.left=this.coords.p_bar_x+"%",this.$cache.bar[0].style.width=this.coords.p_bar_w+"%","single"===this.options.type?(this.$cache.bar[0].style.left=0,this.$cache.bar[0].style.width=this.coords.p_bar_w+this.coords.p_bar_x+"%",this.$cache.s_single[0].style.left=this.coords.p_single_fake+"%"):(this.$cache.s_from[0].style.left=this.coords.p_from_fake+"%",this.$cache.s_to[0].style.left=this.coords.p_to_fake+"%",this.old_from===this.result.from&&!this.force_redraw||(this.$cache.from[0].style.left=this.labels.p_from_left+"%"),this.old_to===this.result.to&&!this.force_redraw||(this.$cache.to[0].style.left=this.labels.p_to_left+"%")),this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.writeToInput(),this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||(this.$cache.input.trigger("change"),this.$cache.input.trigger("input")),this.old_from=this.result.from,this.old_to=this.result.to,this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange(),(this.is_key||this.is_click)&&(this.is_key=!1,this.is_click=!1,this.callOnFinish()),this.is_update=!1,this.is_resize=!1,this.is_finish=!1),this.is_start=!1,this.is_key=!1,this.is_click=!1,this.force_redraw=!1)},drawLabels:function(){var t,e,i,o,r;this.options&&(i=this.options.values.length,t=this.options.p_values,this.options.hide_from_to||("single"===this.options.type?(o=i?this.decorate(t[this.result.from]):(e=this._prettify(this.result.from),this.decorate(e,this.result.from)),this.$cache.single.html(o),this.calcLabels(),this.labels.p_single_left<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",this.labels.p_single_left+this.labels.p_single_fake>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible"):(t=i?(this.options.decorate_both?(o=this.decorate(t[this.result.from]),o=(o+=this.options.values_separator)+this.decorate(t[this.result.to])):o=this.decorate(t[this.result.from]+this.options.values_separator+t[this.result.to]),r=this.decorate(t[this.result.from]),this.decorate(t[this.result.to])):(e=this._prettify(this.result.from),i=this._prettify(this.result.to),this.options.decorate_both?(o=this.decorate(e,this.result.from),o=(o+=this.options.values_separator)+this.decorate(i,this.result.to)):o=this.decorate(e+this.options.values_separator+i,this.result.to),r=this.decorate(e,this.result.from),this.decorate(i,this.result.to)),this.$cache.single.html(o),this.$cache.from.html(r),this.$cache.to.html(t),this.calcLabels(),e=Math.min(this.labels.p_single_left,this.labels.p_from_left),i=this.labels.p_single_left+this.labels.p_single_fake,o=this.labels.p_to_left+this.labels.p_to_fake,r=Math.max(i,o),this.labels.p_from_left+this.labels.p_from_fake>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",r=this.result.from===this.result.to?("from"===this.target?this.$cache.from[0].style.visibility="visible":"to"===this.target?this.$cache.to[0].style.visibility="visible":this.target||(this.$cache.from[0].style.visibility="visible"),this.$cache.single[0].style.visibility="hidden",o):(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",Math.max(i,o))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden"),e<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",r>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible")))},drawShadow:function(){var t,e,i=this.options,o=this.$cache,r="number"==typeof i.from_min&&!isNaN(i.from_min),a="number"==typeof i.from_max&&!isNaN(i.from_max),s="number"==typeof i.to_min&&!isNaN(i.to_min),n="number"==typeof i.to_max&&!isNaN(i.to_max);"single"===i.type?i.from_shadow&&(r||a)?(t=this.convertToPercent(r?i.from_min:i.min),e=this.convertToPercent(a?i.from_max:i.max)-t,t=this.toFixed(t-this.coords.p_handle/100*t),e=this.toFixed(e-this.coords.p_handle/100*e),t+=this.coords.p_handle/2,o.shad_single[0].style.display="block",o.shad_single[0].style.left=t+"%",o.shad_single[0].style.width=e+"%"):o.shad_single[0].style.display="none":(i.from_shadow&&(r||a)?(t=this.convertToPercent(r?i.from_min:i.min),e=this.convertToPercent(a?i.from_max:i.max)-t,t=this.toFixed(t-this.coords.p_handle/100*t),e=this.toFixed(e-this.coords.p_handle/100*e),t+=this.coords.p_handle/2,o.shad_from[0].style.display="block",o.shad_from[0].style.left=t+"%",o.shad_from[0].style.width=e+"%"):o.shad_from[0].style.display="none",i.to_shadow&&(s||n)?(r=this.convertToPercent(s?i.to_min:i.min),a=this.convertToPercent(n?i.to_max:i.max)-r,r=this.toFixed(r-this.coords.p_handle/100*r),a=this.toFixed(a-this.coords.p_handle/100*a),r+=this.coords.p_handle/2,o.shad_to[0].style.display="block",o.shad_to[0].style.left=r+"%",o.shad_to[0].style.width=a+"%"):o.shad_to[0].style.display="none")},writeToInput:function(){"single"===this.options.type?(this.options.values.length?this.$cache.input.prop("value",this.result.from_value):this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from)):(this.options.values.length?this.$cache.input.prop("value",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop("value",this.result.from+this.options.input_values_separator+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))},callOnStart:function(){this.writeToInput(),this.options.onStart&&"function"==typeof this.options.onStart&&(this.options.scope?this.options.onStart.call(this.options.scope,this.result):this.options.onStart(this.result))},callOnChange:function(){this.writeToInput(),this.options.onChange&&"function"==typeof this.options.onChange&&(this.options.scope?this.options.onChange.call(this.options.scope,this.result):this.options.onChange(this.result))},callOnFinish:function(){this.writeToInput(),this.options.onFinish&&"function"==typeof this.options.onFinish&&(this.options.scope?this.options.onFinish.call(this.options.scope,this.result):this.options.onFinish(this.result))},callOnUpdate:function(){this.writeToInput(),this.options.onUpdate&&"function"==typeof this.options.onUpdate&&(this.options.scope?this.options.onUpdate.call(this.options.scope,this.result):this.options.onUpdate(this.result))},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input"),this.has_tab_index?this.$cache.input.prop("tabindex",-1):this.$cache.input.removeProp("tabindex"),this.has_tab_index=!this.has_tab_index},convertToPercent:function(t,e){var i=this.options.max-this.options.min;return i?(e=(e?t:t-this.options.min)/(i/100),this.toFixed(e)):(this.no_diapason=!0,0)},convertToValue:function(t){var e,i=this.options.min,o=this.options.max,r=i.toString().split(".")[1],a=o.toString().split(".")[1],s=0,n=0;if(0===t)return this.options.min;if(100===t)return this.options.max;r&&(s=l=r.length),a&&(s=e=a.length),l&&e&&(s=e<=l?l:e),i<0&&(i=+(i+(n=Math.abs(i))).toFixed(s),o=+(o+n).toFixed(s));var l,r=(o-i)/100*t+i,a=this.options.step.toString().split(".")[1],r=a?+r.toFixed(a.length):+(r=(r/=this.options.step)*this.options.step).toFixed(0);return n&&(r-=n),(l=a?+r.toFixed(a.length):this.toFixed(r))<this.options.min?l=this.options.min:l>this.options.max&&(l=this.options.max),l},calcWithStep:function(t){var e=Math.round(t/this.coords.p_step)*this.coords.p_step;return 100<e&&(e=100),this.toFixed(e=100===t?100:e)},checkMinInterval:function(t,e,i){var o,r=this.options;return r.min_interval?(o=this.convertToValue(t),e=this.convertToValue(e),"from"===i?e-o<r.min_interval&&(o=e-r.min_interval):o-e<r.min_interval&&(o=e+r.min_interval),this.convertToPercent(o)):t},checkMaxInterval:function(t,e,i){var o,r=this.options;return r.max_interval?(o=this.convertToValue(t),e=this.convertToValue(e),"from"===i?e-o>r.max_interval&&(o=e-r.max_interval):o-e>r.max_interval&&(o=e+r.max_interval),this.convertToPercent(o)):t},checkDiapason:function(t,e,i){var t=this.convertToValue(t),o=this.options;return"number"!=typeof e&&(e=o.min),(i="number"!=typeof i?o.max:i)<(t=t<e?e:t)&&(t=i),this.convertToPercent(t)},toFixed:function(t){return+t.toFixed(20)},_prettify:function(t){return this.options.prettify_enabled?(this.options.prettify&&"function"==typeof this.options.prettify?this.options:this).prettify(t):t},prettify:function(t){return t.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(t,e){return this.options.force_edges&&(t<0?t=0:100-e<t&&(t=100-e)),this.toFixed(t)},validate:function(){var t,e,i=this.options,o=this.result,r=i.values,a=r.length;if("string"==typeof i.min&&(i.min=+i.min),"string"==typeof i.max&&(i.max=+i.max),"string"==typeof i.from&&(i.from=+i.from),"string"==typeof i.to&&(i.to=+i.to),"string"==typeof i.step&&(i.step=+i.step),"string"==typeof i.from_min&&(i.from_min=+i.from_min),"string"==typeof i.from_max&&(i.from_max=+i.from_max),"string"==typeof i.to_min&&(i.to_min=+i.to_min),"string"==typeof i.to_max&&(i.to_max=+i.to_max),"string"==typeof i.grid_num&&(i.grid_num=+i.grid_num),i.max<i.min&&(i.max=i.min),a)for(i.p_values=[],i.min=0,i.max=a-1,i.step=1,i.grid_num=i.max,i.grid_snap=!0,e=0;e<a;e++)t=+r[e],t=isNaN(t)?r[e]:(r[e]=t,this._prettify(t)),i.p_values.push(t);"number"==typeof i.from&&!isNaN(i.from)||(i.from=i.min),"number"==typeof i.to&&!isNaN(i.to)||(i.to=i.max),"single"===i.type?(i.from<i.min&&(i.from=i.min),i.from>i.max&&(i.from=i.max)):(i.from<i.min&&(i.from=i.min),i.from>i.max&&(i.from=i.max),i.to<i.min&&(i.to=i.min),i.to>i.max&&(i.to=i.max),this.update_check.from&&(this.update_check.from!==i.from&&i.from>i.to&&(i.from=i.to),this.update_check.to!==i.to)&&i.to<i.from&&(i.to=i.from),i.from>i.to&&(i.from=i.to),i.to<i.from&&(i.to=i.from)),("number"!=typeof i.step||isNaN(i.step)||!i.step||i.step<0)&&(i.step=1),"number"==typeof i.from_min&&i.from<i.from_min&&(i.from=i.from_min),"number"==typeof i.from_max&&i.from>i.from_max&&(i.from=i.from_max),"number"==typeof i.to_min&&i.to<i.to_min&&(i.to=i.to_min),"number"==typeof i.to_max&&i.from>i.to_max&&(i.to=i.to_max),o&&(o.min!==i.min&&(o.min=i.min),o.max!==i.max&&(o.max=i.max),(o.from<o.min||o.from>o.max)&&(o.from=i.from),o.to<o.min||o.to>o.max)&&(o.to=i.to),("number"!=typeof i.min_interval||isNaN(i.min_interval)||!i.min_interval||i.min_interval<0)&&(i.min_interval=0),("number"!=typeof i.max_interval||isNaN(i.max_interval)||!i.max_interval||i.max_interval<0)&&(i.max_interval=0),i.min_interval&&i.min_interval>i.max-i.min&&(i.min_interval=i.max-i.min),i.max_interval&&i.max_interval>i.max-i.min&&(i.max_interval=i.max-i.min)},decorate:function(t,e){var i="",o=this.options;return o.prefix&&(i+=o.prefix),i+=t,o.max_postfix&&(o.values.length&&t===o.p_values[o.max]?(i+=o.max_postfix,o.postfix&&(i+=" ")):e===o.max&&(i+=o.max_postfix,o.postfix)&&(i+=" ")),o.postfix&&(i+=o.postfix),i},updateFrom:function(){this.result.from=this.options.from,this.result.from_percent=this.convertToPercent(this.result.from),this.result.from_pretty=this._prettify(this.result.from),this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to,this.result.to_percent=this.convertToPercent(this.result.to),this.result.to_pretty=this._prettify(this.result.to),this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min,this.result.max=this.options.max,this.updateFrom(),this.updateTo()},appendGrid:function(){if(this.options.grid){var t,e,i,o,r,a,s=this.options,n=s.max-s.min,l=s.grid_num,c=0,d=4,p="";for(this.calcGridMargin(),s.grid_snap&&(l=n/s.step),i=this.toFixed(100/(l=50<l?50:l)),4<l&&(d=3),7<l&&(d=2),14<l&&(d=1),28<l&&(d=0),t=0;t<l+1;t++){for(o=d,100<(c=this.toFixed(i*t))&&(c=100),r=((this.coords.big[t]=c)-i*(t-1))/(o+1),e=1;e<=o&&0!==c;e++)p+='<span class="irs-grid-pol small" style="left: '+this.toFixed(c-r*e)+'%"></span>';p+='<span class="irs-grid-pol" style="left: '+c+'%"></span>',a=this.convertToValue(c),p+='<span class="irs-grid-text js-grid-text-'+t+'" style="left: '+c+'%">'+(s.values.length?s.p_values[a]:this._prettify(a))+"</span>"}this.coords.big_num=Math.ceil(l+1),this.$cache.cont.addClass("irs-with-grid"),this.$cache.grid.html(p),this.cacheGridLabels()}},cacheGridLabels:function(){for(var t,e=this.coords.big_num,i=0;i<e;i++)t=this.$cache.grid.find(".js-grid-text-"+i),this.$cache.grid_labels.push(t);this.calcGridLabels()},calcGridLabels:function(){for(var t,e=[],i=[],o=this.coords.big_num,r=0;r<o;r++)this.coords.big_w[r]=this.$cache.grid_labels[r].outerWidth(!1),this.coords.big_p[r]=this.toFixed(this.coords.big_w[r]/this.coords.w_rs*100),this.coords.big_x[r]=this.toFixed(this.coords.big_p[r]/2),e[r]=this.toFixed(this.coords.big[r]-this.coords.big_x[r]),i[r]=this.toFixed(e[r]+this.coords.big_p[r]);for(this.options.force_edges&&(e[0]<-this.coords.grid_gap&&(e[0]=-this.coords.grid_gap,i[0]=this.toFixed(e[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),i[o-1]>100+this.coords.grid_gap)&&(i[o-1]=100+this.coords.grid_gap,e[o-1]=this.toFixed(i[o-1]-this.coords.big_p[o-1]),this.coords.big_x[o-1]=this.toFixed(this.coords.big_p[o-1]-this.coords.grid_gap)),this.calcGridCollision(2,e,i),this.calcGridCollision(4,e,i),r=0;r<o;r++)t=this.$cache.grid_labels[r][0],this.coords.big_x[r]!==Number.POSITIVE_INFINITY&&(t.style.marginLeft=-this.coords.big_x[r]+"%")},calcGridCollision:function(t,e,i){for(var o,r,a=this.coords.big_num,s=0;s<a&&!(a<=(o=s+t/2));s+=t)r=this.$cache.grid_labels[o][0],i[s]<=e[o]?r.style.visibility="visible":r.style.visibility="hidden"},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs)&&("single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%")},update:function(t){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.update_check.from=this.result.from,this.update_check.to=this.result.to,this.options=s.extend(this.options,t),this.validate(),this.updateResult(t),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),s.data(this.input,"ionRangeSlider",null),this.remove(),this.input=null,this.options=null)}},s.fn.ionRangeSlider=function(t){return this.each(function(){s.data(this,"ionRangeSlider")||s.data(this,"ionRangeSlider",new r(this,t,i++))})};for(var a=0,d=["ms","moz","webkit","o"],p=0;p<d.length&&!l.requestAnimationFrame;++p)l.requestAnimationFrame=l[d[p]+"RequestAnimationFrame"],l.cancelAnimationFrame=l[d[p]+"CancelAnimationFrame"]||l[d[p]+"CancelRequestAnimationFrame"];l.requestAnimationFrame||(l.requestAnimationFrame=function(t,e){var i=(new Date).getTime(),o=Math.max(0,16-(i-a)),r=l.setTimeout(function(){t(i+o)},o);return a=i+o,r}),l.cancelAnimationFrame||(l.cancelAnimationFrame=function(t){clearTimeout(t)})});