/home/arranoyd/magicraft/wp-content/plugins/popup-maker/assets/js/admin.min.js
function pumSelected(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' selected="selected"':"":i}function pumChecked(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' checked="checked"':"":i}!function(e){"function"==typeof define&&void 0!==define.amd&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.pumselect2&&e.fn.pumselect2.amd)var t=e.fn.pumselect2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};var e,n,i;!function(t){function o(e,t){return b.call(e,t)}function s(e,t){var n,i,o,s,r,a,l,c,p,u,d,h=t&&t.split("/"),f=v.map,m=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),r=e.length-1,v.nodeIdCompat&&k.test(e[r])&&(e[r]=e[r].replace(k,"")),e=h.slice(0,h.length-1).concat(e),p=0;p<e.length;p+=1)if(d=e[p],"."===d)e.splice(p,1),p-=1;else if(".."===d){if(1===p&&(".."===e[2]||".."===e[0]))break;p>0&&(e.splice(p-1,2),p-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||m)&&f){for(n=e.split("/"),p=n.length;p>0;p-=1){if(i=n.slice(0,p).join("/"),h)for(u=h.length;u>0;u-=1)if(o=f[h.slice(0,u).join("/")],o&&(o=o[i])){s=o,a=p;break}if(s)break;!l&&m&&m[i]&&(l=m[i],c=p)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function r(e,n){return function(){var i=w.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function a(e){return function(t){return s(t,e)}}function l(e){return function(t){g[e]=t}}function c(e){if(o(_,e)){var n=_[e];delete _[e],y[e]=!0,d.apply(t,n)}if(!o(g,e)&&!o(y,e))throw new Error("No "+e);return g[e]}function p(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return v&&v.config&&v.config[e]||{}}}var d,h,f,m,g={},_={},v={},y={},b=Object.prototype.hasOwnProperty,w=[].slice,k=/\.js$/;f=function(e,t){var n,i=p(e),o=i[0];return e=i[1],o&&(o=s(o,t),n=c(o)),o?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=p(e),o=i[0],e=i[1],o&&(n=c(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},m={require:function(e){return r(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:u(e)}}},d=function(e,n,i,s){var a,p,u,d,h,v,b=[],w=typeof i;if(s=s||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(d=f(n[h],s),p=d.f,"require"===p)b[h]=m.require(e);else if("exports"===p)b[h]=m.exports(e),v=!0;else if("module"===p)a=b[h]=m.module(e);else if(o(g,p)||o(_,p)||o(y,p))b[h]=c(p);else{if(!d.p)throw new Error(e+" missing "+p);d.p.load(d.n,r(s,!0),l(p),{}),b[h]=g[p]}u=i?i.apply(g[e],b):void 0,e&&(a&&a.exports!==t&&a.exports!==g[e]?g[e]=a.exports:u===t&&v||(g[e]=u))}else e&&(g[e]=i)},e=n=h=function(e,n,i,o,s){if("string"==typeof e)return m[e]?m[e](n):c(f(e,n).f);if(!e.splice){if(v=e,v.deps&&h(v.deps,v.callback),!n)return;n.splice?(e=n,n=i,i=null):e=t}return n=n||function(){},"function"==typeof i&&(i=o,o=s),o?d(t,e,n,i):setTimeout(function(){d(t,e,n,i)},4),h},h.config=function(e){return h(e)},e._defined=g,i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),o(g,e)||o(_,e)||(_[e]=[e,t,n])},i.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i}}(),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("pumselect2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t){var o=t[i];"function"==typeof o&&"constructor"!==i&&n.push(i)}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var o in t)i.call(t,o)&&(e[o]=t[o]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,o=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),o=n.prototype.constructor),o.apply(this,arguments)}function o(){this.constructor=i}var s=t(n),r=t(e);n.displayName=e.displayName,i.prototype=new o;for(var a=0;a<r.length;a++){var l=r[a];i.prototype[l]=e.prototype[l]}for(var c=(function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var o=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,t),o.apply(this,arguments)}}),p=0;p<s.length;p++){var u=s[p];i.prototype[u]=c(u)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice;this.listeners=this.listeners||{},e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++){var i=Math.floor(36*Math.random());t+=i.toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var o=0;o<n.length;o++){var s=n[o];s=s.substring(0,1).toLowerCase()+s.substring(1),s in i||(i[s]={}),o==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),o=n.style.overflowX,s=n.style.overflowY;return(o!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===o||"scroll"===s||(i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("pumselect2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="pumselect2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="pumselect2-results__option"></li>'),o=this.options.get("translations").get(t.message);i.append(n(o(t.args))),i[0].className+=" pumselect2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".pumselect2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],o=this.option(i);t.push(o)}this.$results.append(t)},n.prototype.position=function(e,t){var n=t.find(".pumselect2-results");n.append(e)},n.prototype.sort=function(e){var t=this.options.get("sorter");return t(e)},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()}),o=t.$results.find(".pumselect2-results__option[aria-selected]");o.each(function(){var t=e(this),n=e.data(this,"data"),o=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(o,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")});var s=o.filter("[aria-selected=true]");s.length>0?s.first().trigger("mouseenter"):o.first().trigger("mouseenter")})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="pumselect2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var o in i){var s=i[o];n.setAttribute(o,s)}if(t.children){var r=e(n),a=document.createElement("strong");a.className="pumselect2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var p=t.children[c],u=this.option(p);l.push(u)}var d=e("<ul></ul>",{"class":"pumselect2-results__options pumselect2-results__options--nested"});d.append(l),r.append(a),r.append(d)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,o=t.id+"-results";this.$results.attr("id",o),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&i.setClasses()}),t.on("unselect",function(){t.isOpen()&&i.setClasses()}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var o=n-1;0===e.length&&(o=0);var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top,a=s.offset().top,l=i.$results.scrollTop()+(a-r);0===o?i.$results.scrollTop(0):a-r<0&&i.$results.scrollTop(l)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e),o=n+1;if(!(o>=t.length)){var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top+i.$results.outerHeight(!1),a=s.offset().top+s.outerHeight(!1),l=i.$results.scrollTop()+a-r;0===o?i.$results.scrollTop(0):a>r&&i.$results.scrollTop(l)}}),t.on("results:focus",function(e){e.element.addClass("pumselect2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".pumselect2-results__option[aria-selected]",function(t){var n=e(this),o=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:o}):i.trigger("close",{})):void i.trigger("select",{originalEvent:t,data:o})}),this.$results.on("mouseenter",".pumselect2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("pumselect2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".pumselect2-results__option--highlighted");return e},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),i=this.$results.offset().top,o=e.offset().top,s=this.$results.scrollTop()+(o-i),r=o-i;s-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(r>this.$results.outerHeight()||r<0)&&this.$results.scrollTop(s)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=o(s):e(n).append(s)},n}),t.define("pumselect2/keys",[],function(){var e={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};return e}),t.define("pumselect2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="pumselect2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("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),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,o=(e.id+"-container",e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.pumselect2."+t.id,function(t){var n=e(t.target),i=n.closest(".pumselect2"),o=e(".pumselect2.pumselect2-container--open");o.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.pumselect2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.pumselect2."+t.id)},i.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("pumselect2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("pumselect2-selection--single"),e.html('<span class="pumselect2-selection__rendered"></span><span class="pumselect2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},o.prototype.bind=function(e,t){var n=this;o.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".pumselect2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("selection:update",function(e){n.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".pumselect2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".pumselect2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},o}),t.define("pumselect2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("pumselect2-selection--multiple"),e.html('<ul class="pumselect2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".pumselect2-selection__choice__remove",function(t){if(!o.options.get("disabled")){var n=e(this),i=n.parent(),s=i.data("data");o.trigger("unselect",{originalEvent:t,data:s})}})},i.prototype.clear=function(){this.$selection.find(".pumselect2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},i.prototype.selectionContainer=function(){var t=e('<li class="pumselect2-selection__choice"><span class="pumselect2-selection__choice__remove" role="presentation">×</span></li>');return t},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var o=e[i],s=this.selectionContainer(),r=this.display(o,s);s.append(r),s.prop("title",o.title||o.text),s.data("data",o),t.push(s)}var a=this.$selection.find(".pumselect2-selection__rendered");n.appendMany(a,t)}},i}),t.define("pumselect2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("pumselect2-selection__placeholder").removeClass("pumselect2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id,i=t.length>1;if(i||n)return e.call(this,t);this.clear();var o=this.createPlaceholder(this.placeholder);this.$selection.find(".pumselect2-selection__rendered").append(o)},t}),t.define("pumselect2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),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",".pumselect2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".pumselect2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),o=0;o<i.length;o++){var s={data:i[o]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".pumselect2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="pumselect2-selection__clear">×</span>');i.data("data",n),this.$selection.find(".pumselect2-selection__rendered").prepend(i)}},n}),t.define("pumselect2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="pumselect2-search pumselect2-search--inline"><input class="pumselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var o=this;e.call(this,t,i),t.on("open",function(){o.$search.trigger("focus")}),t.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),t.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),t.on("disable",function(){o.$search.prop("disabled",!0)}),t.on("focus",function(e){o.$search.trigger("focus")}),t.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".pumselect2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".pumselect2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".pumselect2-search--inline",function(e){e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented();var t=e.which;if(t===n.BACKSPACE&&""===o.$search.val()){var i=o.$searchContainer.prev(".pumselect2-selection__choice");if(i.length>0){var s=i.data("data");o.searchRemoveChoice(s),e.preventDefault()}}});var s=document.documentMode,r=s&&s<=11;this.$selection.on("input.searchcheck",".pumselect2-search--inline",function(e){return r?void o.$selection.off("input.search input.searchcheck"):void o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".pumselect2-search--inline",function(e){if(r&&"input"===e.type)return void o.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".pumselect2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".pumselect2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("pumselect2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var o=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting"],r=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(e.inArray(t,s)!==-1){n=n||{};var i=e.Event("pumselect2:"+t,{params:n});o.$element.trigger(i),e.inArray(t,r)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("pumselect2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("pumselect2/diacritics",[],function(){var e={"Ⓐ":"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","Ɓ":"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","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"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","Ꝼ":"F","Ⓖ":"G","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","Ⓘ":"I","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","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","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","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","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","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","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","Ꝣ":"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","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","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","ꝺ":"d","dz":"dz","dž":"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","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","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","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","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","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"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","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","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","ẛ":"s","ⓣ":"t","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","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","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","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return e}),t.define("pumselect2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+e.generateChars(4)},t}),t.define("pumselect2/data/select",["./base","../utils","jquery"],function(e,t,n){
function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),o=i.item(e);t.push(o)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var o=[];e=[e],e.push.apply(e,i);for(var s=0;s<e.length;s++){var r=e[s].id;n.inArray(r,o)===-1&&o.push(r)}t.$element.val(o),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple"))return e.selected=!1,n(e.element).is("option")?(e.element.selected=!1,void this.$element.trigger("change")):void this.current(function(i){for(var o=[],s=0;s<i.length;s++){var r=i[s].id;r!==e.id&&n.inArray(r,o)===-1&&o.push(r)}t.$element.val(o),t.$element.trigger("change")})},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],o=this,s=this.$element.children();s.each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=o.item(t),r=o.matches(e,s);null!==r&&i.push(r)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),o=this._normalizeItem(e);return o.element=t,n.data(t,"data",o),i},i.prototype.item=function(e){var t={};if(t=n.data(e[0],"data"),null!=t)return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),o=[],s=0;s<i.length;s++){var r=n(i[s]),a=this.item(r);o.push(a)}t.children=o}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},i.prototype.matches=function(e,t){var n=this.options.get("matcher");return n(e,t)},i}),t.define("pumselect2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var o=this,s=this.$element.find("option"),r=s.map(function(){return o.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,r)>=0){var p=s.filter(i(c)),u=this.item(p),d=n.extend(!0,{},c,u),h=this.option(d);p.replaceWith(h)}else{var f=this.option(c);if(c.children){var m=this.convertToOptions(c.children);t.appendMany(f,m)}a.push(f)}}return a},i}),t.define("pumselect2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var o=n.ajax(e);return o.then(t),o.fail(i),o}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=s.transport(s,function(i){var s=o.processResults(i,e);o.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)},function(){o.trigger("results:message",{message:"errorLoading"})});o._request=i}var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&""!==e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("pumselect2/data/tags",["jquery"],function(e){function t(t,n,i){var o=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var r=i.get("insertTag");if(void 0!==r&&(this.insertTag=r),t.call(this,n,i),e.isArray(o))for(var a=0;a<o.length;a++){var l=o[a],c=this._normalizeItem(l),p=this.option(c);this.$element.append(p)}}return t.prototype.query=function(e,t,n){function i(e,s){for(var r=e.results,a=0;a<r.length;a++){var l=r[a],c=null!=l.children&&!i({results:l.children},!0),p=l.text===t.term;if(p||c)return!s&&(e.data=r,void n(e))}if(s)return!0;var u=o.createTag(t);if(null!=u){var d=o.option(u);d.attr("data-pumselect2-tag",!0),o.addOptions([d]),o.insertTag(r,u)}e.results=r,n(e)}var o=this;return this._removeOldTags(),null==t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,i)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){var n=(this._lastTag,this.$element.find("option[data-pumselect2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("pumselect2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".pumselect2-search__field")},t.prototype.query=function(e,t,n){function i(e){o.trigger("select",{data:e})}var o=this;t.term=t.term||"";var s=this.tokenizer(t,this.options,i);s.term!==t.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.focus()),t.term=s.term),e.call(this,t,n)},t.prototype.tokenizer=function(t,n,i,o){for(var s=i.get("tokenSeparators")||[],r=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<r.length;){var c=r[a];if(e.inArray(c,s)!==-1){var p=r.substr(0,a),u=e.extend({},n,{term:p}),d=l(u);null!=d?(o(d),r=r.substr(a+1)||"",a=0):a++}else a++}return{term:r}},t}),t.define("pumselect2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("pumselect2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("pumselect2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(o){var s=null!=o?o.length:0;return i.maximumSelectionLength>0&&s>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void e.call(i,t,n)})},e}),t.define("pumselect2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="pumselect2-dropdown"><span class="pumselect2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("pumselect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="pumselect2-search pumselect2-search--dropdown"><input class="pumselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){o.handleSearch(e)}),n.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),n.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=o.showSearch(e);t?o.$searchContainer.removeClass("pumselect2-search--hide"):o.$searchContainer.addClass("pumselect2-search--hide")}})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("pumselect2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),t.define("pumselect2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),n.on("query",function(e){o.lastParams=e,o.loading=!0}),n.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,o.$loadingMore[0]);if(!o.loading&&t){var n=o.$results.offset().top+o.$results.outerHeight(!1),i=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1);n+50>=i&&o.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="pumselect2-results__option pumselect2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("pumselect2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("pumselect2"),t.addClass("pumselect2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var o=this,s="scroll.pumselect2."+i.id,r="resize.pumselect2."+i.id,a="orientationchange.pumselect2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("pumselect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("pumselect2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(s+" "+r+" "+a,function(e){o._positionDropdown(),o._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.pumselect2."+i.id,s="resize.pumselect2."+i.id,r="orientationchange.pumselect2."+i.id,a=this.$container.parents().filter(t.hasScroll);a.off(o),e(window).off(o+" "+s+" "+r)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("pumselect2-dropdown--above"),i=this.$dropdown.hasClass("pumselect2-dropdown--below"),o=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=s.top,r.bottom=s.top+r.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<s.top-a.height,p=l.bottom>s.bottom+a.height,u={left:s.left,top:r.bottom},d=this.$dropdownParent;"static"===d.css("position")&&(d=d.offsetParent());var h=d.offset();u.top-=h.top,u.left-=h.left,n||i||(o="below"),p||!c||n?!c&&p&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(u.top=r.top-a.height),null!=o&&(this.$dropdown.removeClass("pumselect2-dropdown--below pumselect2-dropdown--above").addClass("pumselect2-dropdown--"+o),this.$container.removeClass("pumselect2-container--below pumselect2-container--above").addClass("pumselect2-container--"+o)),this.$dropdownContainer.css(u)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("pumselect2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,i=0;i<t.length;i++){var o=t[i];o.children?n+=e(o.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("pumselect2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(){i._handleSelectOnClose()})},e.prototype._handleSelectOnClose=function(){var e=this.getHighlightedResults();if(!(e.length<1)){var t=e.data("data");null!=t.element&&t.element.selected||null==t.element&&t.selected||this.trigger("select",{data:t})}},e}),t.define("pumselect2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{})},e}),t.define("pumselect2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("pumselect2/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(e,t,n,i,o,s,r,a,l,c,p,u,d,h,f,m,g,_,v,y,b,w,k,x,$,C,P,M,A){function S(){this.reset()}S.prototype.apply=function(u){if(u=e.extend(!0,{},this.defaults,u),null==u.dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=d,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,_)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null!=u.query){var A=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,A)}if(null!=u.initSelection){var S=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,S)}}if(null==u.resultsAdapter&&(u.resultsAdapter=n,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,k)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,P))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=b;else{var U=c.Decorate(b,w);u.dropdownAdapter=U}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,M)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var T=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,T)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,$)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=o:u.selectionAdapter=i,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var D=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,D)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}if("string"==typeof u.language)if(u.language.indexOf("-")>0){var j=u.language.split("-"),O=j[0];u.language=[u.language,O]}else u.language=[u.language];if(e.isArray(u.language)){var E=new p;u.language.push("en");for(var q=u.language,I=0;I<q.length;I++){var z=q[I],L={};try{L=p.loadPath(z)}catch(R){try{z=this.defaults.amdLanguageBase+z,L=p.loadPath(z)}catch(H){u.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+z+'" could not be automatically loaded. A fallback will be used instead.');continue}}E.extend(L)}u.translations=E}else{var F=p.loadPath(this.defaults.amdLanguageBase+"en"),N=new p(u.language);N.extend(F),u.translations=N}return u},S.prototype.reset=function(){function t(e){function t(e){return u[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(i,o){if(""===e.trim(i.term))return o;if(o.children&&o.children.length>0){for(var s=e.extend(!0,{},o),r=o.children.length-1;r>=0;r--){var a=o.children[r],l=n(i,a);null==l&&s.children.splice(r,1)}return s.children.length>0?s:n(i,s)}var c=t(o.text).toUpperCase(),p=t(i.term).toUpperCase();return c.indexOf(p)>-1?o:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:A,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},S.prototype.set=function(t,n){var i=e.camelCase(t),o={};o[i]=n;var s=c._convertData(o);e.extend(this.defaults,s)};var U=new S;return U}),t.define("pumselect2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),this.options=n.apply(this.options),o&&o.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return o.prototype.fromElement=function(e){var n=["pumselect2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("pumselect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-pumselect2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("pumselect2Tags")),e.data("tags",!0)),e.data("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."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var o={};o=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var s=t.extend(!0,{},o);s=i._convertData(s);for(var r in s)t.inArray(r,n)>-1||(t.isPlainObject(this.options[r])?t.extend(this.options[r],s[r]):this.options[r]=s[r]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o}),t.define("pumselect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var o=function(e,n){null!=e.data("pumselect2")&&e.data("pumselect2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),o.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var r=this.render();this._placeContainer(r);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var p=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){p.trigger("selection:update",{data:e})}),e.addClass("pumselect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("pumselect2",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="pumselect2-"+t},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,""),p=c.match(n);if(null!==p&&p.length>=1)return p[1]}return null}return t},o.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)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.pumselect2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this._sync=n.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",t._sync,!1)},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,o){e.inArray(i,n)===-1&&t.trigger(i,o)})},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("pumselect2-container--open")}),this.on("close",function(){e.$container.removeClass("pumselect2-container--open")}),this.on("enable",function(){e.$container.removeClass("pumselect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("pumselect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("pumselect2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in i){var s=i[e],r={prevented:!1,name:e,args:t};if(n.call(this,s,r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.trigger("query",{})},o.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},o.prototype.isOpen=function(){return this.$container.hasClass("pumselect2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("pumselect2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("pumselect2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `pumselect2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("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();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".pumselect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("pumselect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("pumselect2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('<span class="pumselect2 pumselect2-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("pumselect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},o}),t.define("pumselect2/compat/utils",["jquery"],function(e){function t(t,n,i){var o,s,r=[];o=e.trim(t.attr("class")),o&&(o=""+o,e(o.split(/\s+/)).each(function(){0===this.indexOf("pumselect2-")&&r.push(this)})),o=e.trim(n.attr("class")),o&&(o=""+o,e(o.split(/\s+/)).each(function(){0!==this.indexOf("pumselect2-")&&(s=i(this),null!=s&&r.push(s))})),t.attr("class",r.join(" "));
}return{syncCssClasses:t}}),t.define("pumselect2/compat/containerCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("containerCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptContainerCssClass");if(r=r||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("pumselect2/compat/dropdownCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("dropdownCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptDropdownCssClass");if(r=r||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("pumselect2/compat/initSelection",["jquery"],function(e){function t(e,t,n){n.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=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return t.prototype.current=function(t,n){var i=this;return this._isInitialized?void t.call(this,n):void this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),n(t)})},t}),t.define("pumselect2/compat/inputData",["jquery"],function(e){function t(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.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."),e.call(this,t,n)}return t.prototype.current=function(t,n){function i(t,n){var o=[];return t.selected||e.inArray(t.id,n)!==-1?(t.selected=!0,o.push(t)):t.selected=!1,t.children&&o.push.apply(o,i(t.children,n)),o}for(var o=[],s=0;s<this._currentData.length;s++){var r=this._currentData[s];o.push.apply(o,i(r,this.$element.val().split(this._valueSeparator)))}n(o)},t.prototype.select=function(t,n){if(this.options.get("multiple")){var i=this.$element.val();i+=this._valueSeparator+n.id,this.$element.val(i),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(n.id),this.$element.trigger("change")},t.prototype.unselect=function(e,t){var n=this;t.selected=!1,this.current(function(e){for(var i=[],o=0;o<e.length;o++){var s=e[o];t.id!=s.id&&i.push(s.id)}n.$element.val(i.join(n._valueSeparator)),n.$element.trigger("change")})},t.prototype.query=function(e,t,n){for(var i=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o],r=this.matches(t,s);null!==r&&i.push(r)}n({results:i})},t.prototype.addOptions=function(t,n){var i=e.map(n,function(t){return e.data(t[0],"data")});this._currentData.push.apply(this._currentData,i)},t}),t.define("pumselect2/compat/matcher",["jquery"],function(e){function t(t){function n(n,i){var o=e.extend(!0,{},i);if(null==n.term||""===e.trim(n.term))return o;if(i.children){for(var s=i.children.length-1;s>=0;s--){var r=i.children[s],a=t(n.term,r.text,r);a||o.children.splice(s,1)}if(o.children.length>0)return o}return t(n.term,i.text,i)?o:null}return n}return t}),t.define("pumselect2/compat/query",[],function(){function e(e,t,n){n.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."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n;var i=this.options.get("query");i.call(null,t)},e}),t.define("pumselect2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){var i=n.find(".dropdown-wrapper");i.append(t),t.addClass("pumselect2-dropdown--below"),n.addClass("pumselect2-container--below")},e}),t.define("pumselect2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(i.join(" "),function(e){e.stopPropagation()})},e}),t.define("pumselect2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(i.join(" "),function(e){e.stopPropagation()})},e}),function(n){"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],n):"object"==typeof exports?module.exports=n:n(e)}(function(e){function t(t){var r=t||window.event,a=l.call(arguments,1),c=0,u=0,d=0,h=0,f=0,m=0;if(t=e.event.fix(r),t.type="mousewheel","detail"in r&&(d=r.detail*-1),"wheelDelta"in r&&(d=r.wheelDelta),"wheelDeltaY"in r&&(d=r.wheelDeltaY),"wheelDeltaX"in r&&(u=r.wheelDeltaX*-1),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(u=d*-1,d=0),c=0===d?u:d,"deltaY"in r&&(d=r.deltaY*-1,c=d),"deltaX"in r&&(u=r.deltaX,0===d&&(c=u*-1)),0!==d||0!==u){if(1===r.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,d*=g,u*=g}else if(2===r.deltaMode){var _=e.data(this,"mousewheel-page-height");c*=_,d*=_,u*=_}if(h=Math.max(Math.abs(d),Math.abs(u)),(!s||h<s)&&(s=h,i(r,h)&&(s/=40)),i(r,h)&&(c/=40,u/=40,d/=40),c=Math[c>=1?"floor":"ceil"](c/s),u=Math[u>=1?"floor":"ceil"](u/s),d=Math[d>=1?"floor":"ceil"](d/s),p.settings.normalizeOffset&&this.getBoundingClientRect){var v=this.getBoundingClientRect();f=t.clientX-v.left,m=t.clientY-v.top}return t.deltaX=u,t.deltaY=d,t.deltaFactor=s,t.offsetX=f,t.offsetY=m,t.deltaMode=0,a.unshift(t,c,u,d),o&&clearTimeout(o),o=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){s=null}function i(e,t){return p.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var o,s,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=r.length;c;)e.event.fixHooks[r[--c]]=e.event.mouseHooks;var p=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",p.getLineHeight(this)),e.data(this,"mousewheel-page-height",p.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),t.define("jquery.pumselect2",["jquery","jquery-mousewheel","./pumselect2/core","./pumselect2/defaults"],function(e,t,n,i){if(null==e.fn.pumselect2){var o=["open","close","destroy"];e.fn.pumselect2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i;return this.each(function(){var n=e(this).data("pumselect2");null==n&&window.console&&console.error&&console.error("The pumselect2('"+t+"') method was called on an element that is not using Select2.");var o=Array.prototype.slice.call(arguments,1);i=n[t].apply(n,o)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.pumselect2.defaults&&(e.fn.pumselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.pumselect2");return e.fn.pumselect2.amd=t,n}),function(e,t,n){"use strict";e(t).on("click","#popup_reset_open_count",function(){var t=e(this);t.is(":checked")&&!confirm(pum_admin.I10n.confirm_count_reset)&&t.prop("checked",!1)})}(jQuery,document);var PUMColorPickers;!function(e,t,n){"use strict";PUMColorPickers={init:function(){e(".color-picker").filter(":not(.initialized)").addClass("initialized").wpColorPicker({change:function(t,n){e(t.target).trigger("colorchange",n)},clear:function(t){e(t.target).prev().trigger("colorchange").wpColorPicker("close")}})}},e(t).on("click",".iris-palette",function(){e(this).parents(".wp-picker-active").find("input.color-picker").trigger("change"),setTimeout(PopMakeAdmin.update_theme,500)}).on("colorchange",function(t,i){var o=e(t.target),s=o.parents("tr").next("tr.background-opacity"),r="";i!==n&&i.color!==n&&(r=i.color.toString()),o.hasClass("background-color")&&("string"==typeof r&&r.length?s.show():s.hide()),o.val(r),"popup_theme"===e("form#post input#post_type").val()&&PopMakeAdmin.update_theme()}).on("pum_init",PUMColorPickers.init)}(jQuery,document);var PUMConditions;!function(e,t,n){"use strict";PUMConditions={templates:{},addGroup:function(n,i){var o=e("#pum-popup-conditions"),s={index:o.find(".facet-group-wrap").length,conditions:[{target:n||null,not_operand:i||!1,settings:{}}]};o.find(".facet-groups").append(PUMConditions.templates.group(s)),o.find(".facet-builder").addClass("has-conditions"),e(t).trigger("pum_init")},renumber:function(){e("#pum-popup-conditions .facet-group-wrap").each(function(){var t=e(this),n=t.parent().children().index(t);t.data("index",n).find(".facet").each(function(){var t=e(this),i=t.parent().children().index(t);t.data("index",i).find("[name]").each(function(){var e="popup_conditions["+n+"]["+i+"]";this.name=this.name.replace(/popup_conditions\[\d*?\]\[\d*?\]/,e),this.id=this.name})})})}},e(t).on("pum_init",PUMConditions.renumber).ready(function(){e("body.post-type-popup form#post").length&&(PUMConditions.templates.group=wp.template("pum-condition-group"),PUMConditions.templates.facet=wp.template("pum-condition-facet"),PUMConditions.templates.settings={},e("script.tmpl.pum-condition-settings").each(function(){var t=e(this),n=t.attr("id").replace("tmpl-","");PUMConditions.templates.settings[t.data("condition")]=wp.template(n)}),PUMConditions.renumber())}).on("select2:select pumselect2:select","#pum-first-condition",function(){var t=e(this),n=t.val(),i=e("#pum-first-condition-operand"),o=i.is(":checked")?i.val():null;PUMConditions.addGroup(n,o),t.val(null).trigger("change"),i.prop("checked",!1).parents(".pum-condition-target").removeClass("not-operand-checked")}).on("click","#pum-popup-conditions .pum-not-operand",function(){var t=e(this),n=t.find("input"),i=t.parents(".pum-condition-target");n.is(":checked")?(i.removeClass("not-operand-checked"),n.prop("checked",!1)):(i.addClass("not-operand-checked"),n.prop("checked",!0))}).on("change","#pum-popup-conditions select.target",function(){var i=e(this),o=i.val(),s={index:i.parents(".facet-group").find(".facet").length,target:o,settings:{}};""!==o&&o!==i.parents(".facet").data("target")&&PUMConditions.templates.settings[o]!==n&&(i.parents(".facet").data("target",o).find(".facet-settings").html(PUMConditions.templates.settings[o](s)),e(t).trigger("pum_init"))}).on("click","#pum-popup-conditions .facet-group-wrap:last-child .and .add-facet",PUMConditions.addGroup).on("click","#pum-popup-conditions .add-or .add-facet:not(.disabled)",function(){var n=e(this),i=n.parents(".facet-group-wrap"),o={group:i.data("index"),index:i.find(".facet").length,target:null,settings:{}};i.find(".facet-list").append(PUMConditions.templates.facet(o)),e(t).trigger("pum_init")}).on("click","#pum-popup-conditions .remove-facet",function(){var t=e(this),n=e("#pum-popup-conditions"),i=t.parents(".facet"),o=t.parents(".facet-group-wrap");i.remove(),0===o.find(".facet").length&&(o.prev(".facet-group-wrap").find(".and .add-facet").removeClass("disabled"),o.remove(),0===n.find(".facet-group-wrap").length&&n.find(".facet-builder").removeClass("has-conditions")),PUMConditions.renumber()})}(jQuery,document);var PUMCookies;!function(e,t,n){"use strict";var i=pum_admin.I10n,o=pum_admin.defaults;PUMCookies={getLabel:function(e){return i.labels.cookies[e].name},getSettingsDesc:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=_.template(i.labels.cookies[e].settings_column,null,n);return t.I10n=i,o(t)},renumber:function(){e("#pum_popup_cookies_list tbody tr").each(function(){var t=e(this),n=t.parent().children().index(t),i=t.data("index");t.data("index",n),t.find("[name]").each(function(){var e="["+n+"]";this.name=this.name.replace("["+i+"]",e).replace("[]",e)})})},refreshDescriptions:function(){e("#pum_popup_cookies_list tbody tr").each(function(){var t=e(this),n=t.find(".popup_cookies_field_event").val(),i=JSON.parse(t.find(".popup_cookies_field_settings:first").val());t.find("td.settings-column").html(PUMCookies.getSettingsDesc(n,i))})},initEditForm:function(){PUMCookies.updateSessionsCheckbox()},updateSessionsCheckbox:function(){var t=e(".cookie-editor .pum-form"),n=t.find('.field.checkbox.session input[type="checkbox"]').is(":checked"),i=t.find(".field").filter(".time");n?i.hide():i.show()},resetCookieKey:function(){var t=e(this),n=(new Date).getTime().toString(16);t.parents(".pum-form").find(".field.text.name").data("cookiekey",n),t.siblings('input[type="text"]:first').val(n)},insertDefault:function(t){var s,r="on_popup_close",a=wp.template("pum-cookie-row"),l={event:r,cookie_settings:o.cookies[r]!==n?o.cookies[r]:{},save_button_text:i.add,index:e("#pum_popup_cookies_list tbody tr").length,I10n:i};l.cookie_settings.name=t||"pum-"+e("#post_ID").val(),s=a(l),e("#pum_popup_cookies_list tbody").append(s),PUMCookies.renumber(),e("#pum_popup_cookie_fields").addClass("has-cookies")}},e(t).on("select2:select pumselect2:select","#pum-first-cookie",function(){var t=e(this),s=t.val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};c.cookie_settings=o.cookies[s]!==n?o.cookies[s]:{},c.cookie_settings.name="pum-"+e("#post_ID").val(),c.save_button_text=i.add,c.index=null,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm(),t.val(null).trigger("change")}).on("click",".field.cookiekey button.reset",PUMCookies.resetCookieKey).on("click",".cookie-editor .pum-form .field.checkbox.session",PUMCookies.updateSessionsCheckbox).on("click","#pum_popup_cookies .add-new",function(){var e=wp.template("pum-cookie-add-event");PUMModals.reload("#pum_cookie_add_event_modal",e())}).on("click","#pum_popup_cookies_list .edit",function(t){var n=e(this),o=n.parents("tr:first"),s=o.find(".popup_cookies_field_event").val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={index:o.parent().children().index(o),event:s,cookie_settings:JSON.parse(o.find(".popup_cookies_field_settings:first").val())};t.preventDefault(),c.save_button_text=i.save,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm()}).on("click","#pum_popup_cookies_list .remove",function(t){var n=e(this),o=n.parents("tr:first");t.preventDefault(),window.confirm(i.confirm_delete_cookie)&&(o.remove(),e("#pum_popup_cookies_list tbody tr").length||(e("#pum-first-cookie").val(null).trigger("change"),e("#pum_popup_cookie_fields").removeClass("has-cookies")),PUMCookies.renumber())}).on("submit","#pum_cookie_add_event_modal .pum-form",function(t){var s=e("#popup_cookie_add_event").val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};t.preventDefault(),c.cookie_settings=o.cookies[s]!==n?o.cookies[s]:{},c.cookie_settings.name="pum-"+e("#post_ID").val(),c.save_button_text=i.add,c.index=null,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm()}).on("submit",".cookie-editor .pum-form",function(t){var n,o,s,r=e(this),a=(r.find("input.event").val(),r.pumSerializeObject()),l=parseInt(a.index),c=l>=0?e("#pum_popup_cookies_list tbody tr").eq(l):null,p=wp.template("pum-cookie-row");t.preventDefault(),(!l||l<0)&&(a.index=e("#pum_popup_cookies_list tbody tr").length),a.I10n=i,n=p(a),c?c.replaceWith(n):e("#pum_popup_cookies_list tbody").append(n),PUMModals.closeAll(),PUMCookies.renumber(),e("#pum_popup_cookie_fields").addClass("has-cookies"),PUMTriggers.new_cookie!==!1&&PUMTriggers.new_cookie>=0&&(o=e("#pum_popup_triggers_list tbody tr").eq(PUMTriggers.new_cookie).find(".popup_triggers_field_settings:first"),s=JSON.parse(o.val()),s.cookie.name[s.cookie.name.indexOf("add_new")]=a.cookie_settings.name,o.val(JSON.stringify(s)),PUMTriggers.new_cookie=!1,PUMTriggers.refreshDescriptions())}).ready(function(){PUMCookies.refreshDescriptions(),e("#pum-first-cookie").val(null).trigger("change")})}(jQuery,document),function(e,t,n){"use strict";var i={init:function(){e("#popmake_popup_auto_open_fields, #popmake_popup_targeting_condition_fields").length&&(i.initialize_popup_page(),i.attachQuickSearchListeners(),i.attachTabsPanelListeners())},attachTabsPanelListeners:function(){e("#poststuff").bind("click",function(t){var n,i,o,s,r,a,l,c,p,u,d,h,f,m,g=e(t.target);if(g.hasClass("nav-tab-link"))i=g.data("type"),o=g.parents(".posttypediv, .taxonomydiv").first(),e("input",o).removeAttr("checked"),e(".tabs-panel-active",o).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),e("#"+i,o).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),e(".tabs",o).removeClass("tabs"),g.parent().addClass("tabs"),e(".quick-search",o).focus(),t.preventDefault();else if(g.hasClass("select-all"))n=/#(.*)$/.exec(t.target.href),n&&n[1]&&(s=e("#"+n[1]+" .tabs-panel-active .menu-item-title input"),s.length===s.filter(":checked").length?s.removeAttr("checked"):s.prop("checked",!0));else if(g.hasClass("submit-add-to-menu")){for(r=g.parents(".options"),a=e('.tabs-panel-active input[type="checkbox"]:checked',r),l=e("textarea",r),c=e(".tagchecklist",r),p=l.val().split(","),u=0;u<p.length;u+=1)p[u]=parseInt(p[u],10);a.each(function(){d=e(this),h=parseInt(d.val(),10),f=d.parent("label").siblings(".menu-item-title").val(),e.inArray(h,p)===-1&&p.push(h),c.append('<span><a class="ntdelbutton" data-id="'+h+'">X</a> '+f+"</span>")}),l.text(p.join(",")),t.preventDefault()}else g.hasClass("ntdelbutton")&&(d=g,m=parseInt(d.data("id"),10),r=g.parents(".options"),l=e("textarea",r),c=e(".tagchecklist",r),p=l.val().split(","),p=e.grep(p,function(e){return parseInt(e,10)!==parseInt(m,10)}),d.parent("span").remove(),l.text(p.join(",")))})},attachQuickSearchListeners:function(){var t;e(".quick-search").keypress(function(n){var o=e(this);return 13===n.which?(i.updateQuickSearchResults(o),!1):(t&&clearTimeout(t),void(t=setTimeout(function(){i.updateQuickSearchResults(o)},400)))}).attr("autocomplete","off")},updateQuickSearchResults:function(t){var n,o,s=2,r=t.val();r.length<s||(n=t.parents(".tabs-panel"),o={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":e("#menu-settings-column-nonce").val(),q:r,type:t.attr("name")},e(".spinner",n).show(),e.post(ajaxurl,o,function(e){i.processQuickSearchQueryResponse(e,o,n)}))},processQuickSearchQueryResponse:function(t,n,i){var o,s,r,a=e("form#post"),l={},c=/menu-item[(\[\^]\]*/,p=e("<div>").html(t).find("li");return p.length?(p.each(function(){if(r=e(this),o=c.exec(r.html()),o&&o[1]){for(s=o[1];a.elements["menu-item["+s+"][menu-item-type]"]||l[s];)s-=1;l[s]=!0,s!==o[1]&&r.html(r.html().replace(new RegExp("menu-item\\["+o[1]+"\\]","g"),"menu-item["+s+"]"))}}),e(".categorychecklist",i).html(p),e(".spinner",i).hide(),void e('[name^="menu-item"]').removeAttr("name")):(e(".categorychecklist",i).html("<li><p>noResultsFound</p></li>"),void e(".spinner",i).hide())},initialize_popup_page:function(){var n=function(t){var n,i,o=t.siblings(".options");t.is(":checked")?(o.show(),"popup_targeting_condition_on_entire_site"===t.attr("id")?(n=t.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),i=t.parents(".targeting_condition").siblings(".targeting_condition"),i.hide(),e("> *",i).prop("disabled",!0),n.show(),e("> *",n).prop("disabled",!1)):e("*",o).prop("disabled",!1)):(o.hide(),"popup_targeting_condition_on_entire_site"===t.attr("id")?(n=t.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),i=t.parents(".targeting_condition").siblings(".targeting_condition"),i.show(),e("> *",i).prop("disabled",!1),n.hide(),e("> *",n).prop("disabled",!0)):e("*",o).prop("disabled",!0))},i=function(t){var n=t.parents(".options").find('input[type="checkbox"]:eq(0)'),i=n.attr("name").indexOf("exclude")>=0,o=i?n.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):n.attr("name").replace("popup_targeting_condition_on_specific_",""),s=e(i?"#exclude_on_specific_"+o:"#on_specific_"+o);t.is(":checked")&&("true"===t.val()?(n.prop("checked",!0),s.show(),e("*",s).prop("disabled",!1)):""===t.val()&&(n.prop("checked",!1),s.hide(),e("*",s).prop("disabled",!0)))},o=function(){e("#popup_auto_open_session_cookie").is(":checked")?e(".not-session-cookie").hide():e(".not-session-cookie").show()},s=function(){e("#popup_auto_open_enabled").is(":checked")?(e(".auto-open-enabled").show(),o()):e(".auto-open-enabled").hide()},r=function(){e("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))};e('[name^="menu-item"]').removeAttr("name"),e("#title").prop("required",!0),e(t).on("click","#popup_auto_open_session_cookie",function(){o()}).on("click","#popup_auto_open_enabled",function(){s()}).on("click",".popmake-reset-auto-open-cookie-key",function(){r()}),e('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){n(e(this))}).each(function(){n(e(this))}),e('input[type="radio"][id*="popup_targeting_condition_"]').on("click",function(){i(e(this))}).each(function(){i(e(this))}),e(".posttypediv, .taxonomydiv").each(function(){var t=e(this),n=e("> ul li"),i=e(".tabs-panel",t);n.removeClass("tabs"),n.eq(0).addClass("tabs"),i.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style"),i.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")}),s(),""===e("#popup_auto_open_cookie_key").val()&&r()}};e(t).ready(function(){i.init(),e(t).trigger("pum_init")})}(jQuery,document);var PUMMarketing;!function(e,t,n){"use strict";PUMMarketing={init:function(){e('#menu-posts-popup ul li a[href="edit.php?post_type=popup&page=extensions"]').css({color:"#9aba27"})}},e(t).ready(PUMMarketing.init)}(jQuery,document);var PUMModals;!function(e,t,n){"use strict";var i,o,s,r=e("html"),a=e(t),l="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUMModals={forceFocus:function(e){s&&!s.contains(e.target)&&(e.stopPropagation(),s.focus())},trapEscapeKey:function(e){27===e.keyCode&&(PUMModals.closeAll(),e.preventDefault())},trapTabKey:function(t){if(9===t.keyCode){var n=s.find("*").filter(l).filter(":visible"),i=e(":focus"),o=n.length,r=n.index(i);t.shiftKey?0===r&&(n.get(o-1).focus(),t.preventDefault()):r===o-1&&(n.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){s.find(".pum-modal-content *").filter(l).filter(":visible").first().focus()},closeAll:function(t){e(".pum-modal-background").off("keydown.pum_modal").hide(0,function(){e("html").css({overflow:"visible",width:"auto"}),i&&(i.attr("aria-hidden","false"),i=null),o.length&&o.focus(),s=null,a.off("focus.pum_modal"),n!==t&&t()}).attr("aria-hidden","true")},show:function(t,a){e(".pum-modal-background").off("keydown.pum_modal").hide(0).attr("aria-hidden","true"),r.data("origwidth",r.innerWidth()).css({overflow:"hidden",width:r.innerWidth()});var l=e(":focus");l.parents(".pum-modal-wrap").length||(o=l),s=e(t),s.on("keydown.pum_modal",function(e){PUMModals.trapEscapeKey(e),PUMModals.trapTabKey(e)}).show(0,function(){i=e("body > *").filter(":visible").not(s),i.attr("aria-hidden","true"),s.trigger("pum_init").on("focus.pum_modal",PUMModals.forceFocus),PUMModals.setFocusToFirstItem(),n!==a&&a()}).attr("aria-hidden","false")},remove:function(t){e(t).remove()},replace:function(t,n){PUMModals.remove(e.trim(t)),e("body").append(e.trim(n))},reload:function(e,t,n){PUMModals.replace(e,t),PUMModals.show(e,n)}},e(t).on("click",".pum-modal-background, .pum-modal-wrap .cancel, .pum-modal-wrap .pum-modal-close",function(t){var n=e(t.target);(n.hasClass("pum-modal-background")||n.hasClass("cancel")||n.hasClass("pum-modal-close")||n.hasClass("submitdelete"))&&(PUMModals.closeAll(),t.preventDefault(),t.stopPropagation())})}(jQuery,document);var PUMRangeSLiders;!function(e,t,n){"use strict";PUMRangeSLiders={init:function(){var n,i,o,s,r,a=e('<input type="range"/>'),l=e('<button type="button" class="popmake-range-plus">+</button>'),c=e('<button type="button" class="popmake-range-minus">-</button>');e(".popmake-range-manual").filter(":not(.initialized)").each(function(){var p=e(this).addClass("initialized"),u=p.data("force-minmax"),d=parseInt(p.prop("min"),0),h=parseInt(p.prop("max"),0),f=parseInt(p.prop("step"),0),m=parseInt(p.val(),0);o=a.clone(),s=l.clone(),r=c.clone(),u&&m>h&&(m=h,p.val(m)),o.prop({min:d||0,max:u||h&&h>m?h:1.5*m,step:f||1.5*m/100,value:m}).on("change input",function(){p.trigger("input")}),p.next().after(r,s),p.before(o),n=t.createElement("input"),n.setAttribute("type","range"),"text"===n.type&&e("input[type=range]").each(function(t,n){i=e(n),o=e("<div />").slider({min:parseInt(i.attr("min"),10)||0,max:parseInt(i.attr("max"),10)||100,value:parseInt(i.attr("value"),10)||0,step:parseInt(i.attr("step"),10)||1,slide:function(t,n){e(this).prev("input").val(n.value)}}),i.after(o).hide()})})}},e(t).on("pum_init",PUMRangeSLiders.init).on("input",'input[type="range"]',function(){var t=e(this);t.siblings(".popmake-range-manual").val(t.val())}).on("change",".popmake-range-manual",function(){var t=e(this),n=parseInt(t.prop("max"),0),i=parseInt(t.prop("step"),0),o=t.data("force-minmax"),s=parseInt(t.val(),0),r=t.prev();isNaN(s)&&(s=r.val(),t.val(s)),o&&s>n&&(s=n,t.val(s)),r.prop({max:o||n&&n>s?n:1.5*s,step:i||1.5*s/100,value:s})}).on("click",".popmake-range-plus",function(t){var n=e(this).siblings(".popmake-range-manual"),i=parseInt(n.prop("step"),0),o=parseInt(n.val(),0),s=o+i,r=n.prev();t.preventDefault(),n.val(s).trigger("input"),r.val(s)}).on("click",".popmake-range-minus",function(t){var n=e(this).siblings(".popmake-range-manual"),i=parseInt(n.prop("step"),0),o=parseInt(n.val(),0),s=o-i,r=n.prev();t.preventDefault(),n.val(s).trigger("input"),r.val(s)})}(jQuery,document);var PUMSelect2Fields;!function(e,t,n){"use strict";e.fn.pumselect2=e.fn.pumselect2||e.fn.select2,PUMSelect2Fields={init:function(){e(".pum-select2 select").filter(":not(.initialized)").each(function(){var t=e(this),i=t.data("current"),o=t.data("objecttype"),s=t.data("objectkey"),r={multiple:!1,dropdownParent:t.parent()};t.attr("multiple")&&(r.multiple=!0),o&&s&&(r=e.extend(r,{ajax:{url:ajaxurl,dataType:"json",delay:250,data:function(e){return{s:e.term,page:e.page,action:"pum_object_search",object_type:o,object_key:s}},processResults:function(e,t){return t.page=t.page||1,{results:e.items,pagination:{more:10*t.page<e.total_count}}},cache:!0},cache:!0,escapeMarkup:function(e){return e},minimumInputLength:1,templateResult:PUMSelect2Fields.formatObject,templateSelection:PUMSelect2Fields.formatObjectSelection})),t.addClass("initialized").pumselect2(r),i!==n&&("object"!=typeof i&&(i=[i]),o&&s?e.ajax({url:ajaxurl,data:{action:"pum_object_search",object_type:o,object_key:s,include:i},dataType:"json",success:function(n){e.each(n.items,function(e,n){t.find('option[value="'+n.id+'"]').length||t.prepend('<option value="'+n.id+'">'+n.text+"</option>")}),t.val(i).trigger("change")}}):t.val(i).trigger("change"))})},formatObject:function(e){return e.text},formatObjectSelection:function(e){return e.text||e.text}},e(t).on("pum_init",PUMSelect2Fields.init)}(jQuery,document),function(e,t,n){function i(t,n){return e.inArray(n,t)!==-1}function o(e,t,n){var i=t[0];t.length>1?(e[i]||(e[i]=t[1]?{}:[]),o(e[i],t.slice(1),n)):(i||(i=e.length),e[i]=n)}var s="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),r="select,textarea".split(","),a=/\[([^\]]*)\]/g;e.fn.pumSerializeObject=function(t){e.extend({},t);var n={},l=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||i(l.exclude,this.name)||l.include.length&&!i(l.include,this.name)||this.className.indexOf(l.includeByClass)===-1||(t=this.name.replace(a,"[$1").split("["),t[0]&&(this.checked||i(s,this.type)||i(r,this.nodeName.toLowerCase()))&&("checkbox"===this.type,o(n,t,e(this).val())))}),n}}(jQuery,document);var PUMTabs;!function(e,t,n){"use strict";PUMTabs={init:function(){e(".pum-tabs-container").filter(":not(.initialized)").each(function(){var t=e(this),n=t.find(".tab:first");t.hasClass("vertical-tabs")&&t.css({minHeight:t.find(".tabs").eq(0).outerHeight(!0)}),t.find(".active").removeClass("active"),n.addClass("active"),e(n.find("a").attr("href")).addClass("active"),t.addClass("initialized")})}},e(t).on("pum_init",PUMTabs.init).on("click",".pum-tabs-container .tab",function(t){var n=e(this),i=n.parents(".pum-tabs-container:first"),o=n.find("a").attr("href");i.find(".active").removeClass("active"),n.addClass("active"),e(o).addClass("active"),t.preventDefault()})}(jQuery,document);var PUM_Templates;!function(e,t,n){"use strict";var i=pum_admin.I10n;PUM_Templates={render:function(e,t){var n=wp.template(e);return"object"==typeof t.classes&&(t.classes=t.classes.join(" ")),t=PUM_Templates.prepareMeta(t),n(t)},shortcode:function(t){var n=e.extend({},{tag:"",meta:{},has_content:!1,content:""},t),i=n.has_content?"pum-shortcode-w-content":"pum-shortcode";return PUM_Templates.render(i,n)},modal:function(t){var n=e.extend({},{id:"",title:"",description:"",classes:"",save_button:i.save,cancel_button:i.cancel,content:""},t);return PUM_Templates.render("pum-modal",n)},tabs:function(t){var n=t.classes||[],i=e.extend({},{id:"",vertical:!0,form:!0,classes:"",tabs:{general:{label:"General",content:""}}},t);return i.form&&n.push("tabbed-form"),i.vertical&&n.push("vertical-tabs"),i.classes=i.classes+" "+n.join(" "),PUM_Templates.render("pum-tabs",i)},section:function(t){var n=e.extend({},{classes:[],fields:[]},t);return PUM_Templates.render("pum-field-section",n)},field:function(t){var i="pum-field-"+t.type,o=[],s=e.extend({},{type:"text",id:"",id_prefix:"",name:"",label:null,placeholder:"",desc:null,size:"regular",classes:[],value:null,select2:!1,multiple:!1,as_array:!1,options:[],object_type:null,object_key:null,std:null,min:0,max:50,step:1,unit:"px",
required:!1,meta:{}},t);if(!e("#tmpl-"+i).length&&("objectselect"!==t.type&&"postselect"!==t.type&&"taxonomyselect"!==t.type||(i="pum-field-select"),!e("#tmpl-"+i).length))return"";switch(s.value||t.std===n||(s.value=t.std),"string"==typeof s.classes&&(s.classes=s.classes.split(" ")),t["class"]!==n&&s.classes.push(t["class"]),s.required&&(s.meta.required=!0,s.classes.push("pum-required")),t.type){case"select":case"objectselect":case"postselect":case"taxonomyselect":s.options!==n&&(_.each(s.options,function(e,t){var n=!1;s.multiple&&s.value.indexOf(e)!==!1?n="selected":s.multiple||s.value!=e||(n="selected"),o.push(PUM_Templates.prepareMeta({label:t,value:e,meta:{selected:n}}))}),s.options=o),s.multiple&&(s.meta.multiple=!0,s.as_array&&(s.name+="[]"),s.value&&s.value.length||(s.value=[]),"string"==typeof s.value&&(s.value=[s.value])),"select"!==t.type&&(s.select2=!0,s.classes.push("pum-field-objectselect"),s.classes.push("postselect"===t.type?"pum-field-postselect":"pum-field-taxonomyselect"),s.meta["data-objecttype"]="postselect"===t.type?"post_type":"taxonomy",s.meta["data-objectkey"]="postselect"===t.type?t.post_type:t.taxonomy,s.meta["data-current"]=s.value),s.select2&&(s.classes.push("pum-select2"),s.placeholder&&(s.meta["data-placeholder"]=s.placeholder));break;case"multicheck":s.options!==n&&(_.each(s.options,function(e,t){o.push({label:t,value:e,meta:{checked:s.value.indexOf(e)>=0}})}),s.options=o);break;case"checkbox":1===parseInt(s.value,10),s.meta.checked=!!s.value;break;case"rangeslider":s.meta.step=s.step,s.meta.min=s.min,s.meta.max=s.max;break;case"textarea":s.meta.cols=s.cols,s.meta.rows=s.rows}return s.field=PUM_Templates.render(i,s),PUM_Templates.render("pum-field-wrapper",s)},prepareMeta:function(e){var t,n=[];for(t in e.meta)e.meta.hasOwnProperty(t)&&("boolean"==typeof e.meta[t]?e.meta[t]&&n.push(_.escape(t)):n.push(_.escape(t)+'="'+_.escape(e.meta[t])+'"'));return e.meta=n.join(" "),e}}}(jQuery,document);var PUMTriggers;!function(e,t,n){"use strict";var i=pum_admin.I10n,o=pum_admin.defaults;PUMTriggers={new_cookie:!1,getLabel:function(e){return i.labels.triggers[e].name},getSettingsDesc:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=_.template(i.labels.triggers[e].settings_column,null,n);return t.I10n=i,o(t)},renumber:function(){e("#pum_popup_triggers_list tbody tr").each(function(){var t=e(this),n=t.parent().children().index(t),i=t.data("index");t.data("index",n),t.find("input").each(function(){var e="["+n+"]";this.name=this.name.replace("["+i+"]",e).replace("[]",e)})})},refreshDescriptions:function(){e("#pum_popup_triggers_list tbody tr").each(function(){var t=e(this),n=t.find(".popup_triggers_field_type").val(),i=JSON.parse(t.find(".popup_triggers_field_settings:first").val()),o=PUMTriggers.cookie_column_value(i.cookie.name);t.find("td.settings-column").html(PUMTriggers.getSettingsDesc(n,i)),t.find("td.cookie-column code").text(o)})},initEditForm:function(t){var n=e(".trigger-editor .pum-form"),i=n.find('input[name="type"]').val(),o=e("#name",n),s=t.trigger_settings,r=e("#pum_popup_cookies_list tbody tr");r.length||"click_open"===i||(PUMCookies.insertDefault(),r=e("#pum_popup_cookies_list tbody tr")),r.each(function(){var t=JSON.parse(e(this).find(".popup_cookies_field_settings:first").val());o.find('option[value="'+t.name+'"]').length||e('<option value="'+t.name+'">'+t.name+"</option>").appendTo(o)}),o.val(s.cookie.name).trigger("change.pumselect2")},cookie_column_value:function(e){var t=i.no_cookie;return e instanceof Array?t=e.join(", "):null!==e&&(t=e),t},append_click_selector_presets:function(){return e("#extra_selectors").each(function(){var t=e(this),n=_.template(e("#tmpl-pum-click-selector-presets").html()),i=t.parents(".pum-field").find(".pum-click-selector-presets");i.length||(t.before(n()),i=t.parents(".pum-field").find(".pum-click-selector-presets")),i.position({my:"right center",at:"right center",of:t})})},toggle_click_selector_presets:function(){e(this).parent().toggleClass("open")},reset_click_selector_presets:function(t){t!==n&&e(t.target).parents(".pum-click-selector-presets").length||e(".pum-click-selector-presets").removeClass("open")},insert_click_selector_preset:function(){var t=e(this),n=e("#extra_selectors"),i=n.val();""!==i&&(i+=", "),n.val(i+t.data("preset")),PUMTriggers.reset_click_selector_presets()}},PUMTriggers.refreshDescriptions(),e(t).on("pum_init",function(){PUMTriggers.append_click_selector_presets()}).on("click",".pum-click-selector-presets > span",PUMTriggers.toggle_click_selector_presets).on("click",".pum-click-selector-presets li",PUMTriggers.insert_click_selector_preset).on("click",PUMTriggers.reset_click_selector_presets).on("select2:select pumselect2:select","#pum-first-trigger",function(){var t=e(this),s=t.val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};c.trigger_settings=o.triggers[s]!==n?o.triggers[s]:{},c.save_button_text=i.add,c.index=null,"click_open"!==s&&(c.trigger_settings.cookie.name="pum-"+e("#post_ID").val()),l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c),t.val(null).trigger("change")}).on("click","#pum_popup_triggers .add-new",function(){var e=wp.template("pum-trigger-add-type");PUMModals.reload("#pum_trigger_add_type_modal",e())}).on("click","#pum_popup_triggers_list .edit",function(t){var n=e(this),o=n.parents("tr:first"),s=o.find(".popup_triggers_field_type").val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={index:o.parent().children().index(o),type:s,trigger_settings:JSON.parse(o.find(".popup_triggers_field_settings:first").val())};t.preventDefault(),c.save_button_text=i.save,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c)}).on("click","#pum_popup_triggers_list .remove",function(t){var n=e(this),o=n.parents("tr:first");t.preventDefault(),window.confirm(i.confirm_delete_trigger)&&(o.remove(),e("#pum_popup_triggers_list tbody tr").length||(e("#pum-first-trigger").val(null).trigger("change"),e("#pum_popup_trigger_fields").removeClass("has-triggers")),PUMTriggers.renumber())}).on("submit","#pum_trigger_add_type_modal .pum-form",function(t){var s=e("#popup_trigger_add_type").val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};t.preventDefault(),c.trigger_settings=o.triggers[s]!==n?o.triggers[s]:{},c.save_button_text=i.add,c.index=null,"click_open"!==s&&(c.trigger_settings.cookie.name="pum-"+e("#post_ID").val()),l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c)}).on("submit",".trigger-editor .pum-form",function(t){var n,o=e(this),s=(o.find("input.type").val(),o.pumSerializeObject()),r=parseInt(s.index),a=r>=0?e("#pum_popup_triggers_list tbody tr").eq(r):null,l=wp.template("pum-trigger-row");t.preventDefault(),(!r||r<0)&&(s.index=e("#pum_popup_triggers_list tbody tr").length),s.I10n=i,n=l(s),a?a.replaceWith(n):e("#pum_popup_triggers_list tbody").append(n),PUMModals.closeAll(),PUMTriggers.renumber(),PUMTriggers.refreshDescriptions(),e("#pum_popup_trigger_fields").addClass("has-triggers"),null!==s.trigger_settings.cookie.name&&s.trigger_settings.cookie.name.indexOf("add_new")>=0&&(PUMTriggers.new_cookie=s.index,e("#pum_popup_cookie_fields button.add-new").trigger("click"))}).ready(function(){PUMTriggers.refreshDescriptions(),e("#pum-first-trigger").val(null).trigger("change")})}(jQuery,document);var PUMUtils;!function(e,t,n){"use strict";PUMUtils={convert_meta_to_object:function(e){var t,i,o,s={};for(o in e)e.hasOwnProperty(o)&&(t=o.split(/_(.+)?/)[0],i=o.split(/_(.+)?/)[1],s[t]===n&&(s[t]={}),s[t][i]=e[o]);return s},serialize_form:function(t){var n={};return e("[name]",t).each(function(){var t,i,o=e(this).attr("name"),s=e(this).val(),r=o.split("["),a=n,l=r.length;for(t=0;t<l;t+=1)i=r[t].replace("]",""),a[i]||(a[i]={}),t!==r.length-1?a=a[i]:t===r.length-1&&(a[i]=s)}),n},convert_hex:function(e,t){if(n===e)return"";n===t&&(t=100),e=e.replace("#","");var i=parseInt(e.substring(0,2),16),o=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16),r="rgba("+i+","+o+","+s+","+t/100+")";return r},debounce:function(e,t){var n;return function(){var i=this,o=arguments;window.clearTimeout(n),n=window.setTimeout(function(){e.apply(i,o)},t)}},throttle:function(e,t){var n=!1,i=function(){n=!1};return function(){n||(e(),window.setTimeout(i,t),n=!0)}}},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)}}(jQuery,document);var PopMakeAdmin,PUM_Admin;!function(e,t,n){"use strict";var i=e(t);pum_admin.I10n,pum_admin.defaults;PUM_Admin={},PopMakeAdmin={init:function(){e("body.post-type-popup form#post").length&&PopMakeAdmin.initialize_popup_page(),e("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page()},initialize_popup_page:function(){var n=function(){"custom"===e("#popup_display_size").val()?(e(".custom-size-only").show(),e(".responsive-size-only").hide(),e("#popup_display_custom_height_auto").is(":checked")?e(".custom-size-height-only").hide():e(".custom-size-height-only").show()):(e(".custom-size-only").hide(),"auto"!==e("#popup_display_size").val()?(e(".responsive-size-only").show(),e("#popup_display_custom_height_auto").prop("checked",!1)):e(".responsive-size-only").hide())},i=function(){e(".animation-speed, .animation-origin").hide(),"fade"===e("#popup_display_animation_type").val()?e(".animation-speed").show():"none"!==e("#popup_display_animation_type").val()&&e(".animation-speed, .animation-origin").show()},o=function(){var t=e("#popup_display_location"),n=t.parents("table"),i=t.val();e("tr.top, tr.right, tr.left, tr.bottom",n).hide(),i.indexOf("top")>=0&&e("tr.top").show(),i.indexOf("left")>=0&&e("tr.left").show(),i.indexOf("bottom")>=0&&e("tr.bottom").show(),i.indexOf("right")>=0&&e("tr.right").show()};e("#popuptitlediv").insertAfter("#titlediv"),e("#title").prop("required",!0),e(t).on("change","#popup_theme",function(){var t=e(this),n=e("#edit_theme_link"),i=t.val();n.attr("href",n.data("baseurl")+i)}).on("keydown","#popuptitle",function(t){var n=t.keyCode||t.which;9===n&&(t.preventDefault(),e("#title").focus())}).on("keydown","#title, #popuptitle",function(t){var n,i=t.keyCode||t.which;t.shiftKey||9!==i||(t.preventDefault(),n="title"===e(this).attr("id")?"#popuptitle":"#insert-media-button",e(n).focus())}).on("keydown","#popuptitle, #insert-media-button",function(t){var n,i=t.keyCode||t.which;t.shiftKey&&9===i&&(t.preventDefault(),n="popuptitle"===e(this).attr("id")?"#title":"#popuptitle",e(n).focus())}).on("click","#popup_display_custom_height_auto",function(){n()}).on("change","#popup_display_size",function(){"custom"!==e("#popup_display_size").val()&&"auto"!==e("#popup_display_size").val()&&e("#popup_display_position_fixed, #popup_display_scrollable_content").prop("checked",!1),n()}).on("change","#popup_display_animation_type",function(){i()}).on("change","#popup_display_location",function(){o()}),n(),i(),o()},theme_page_listeners:function(){var n=this;e(".empreview .example-popup-overlay, .empreview .example-popup, .empreview .title, .empreview .content, .empreview .close-popup").css("cursor","pointer"),e(t).on("click",".empreview .example-popup-overlay, .empreview .example-popup, .empreview .title, .empreview .content, .empreview .close-popup",function(t){var n=e(this),i=n.attr("class"),o=0;switch(t.preventDefault(),t.stopPropagation(),i){case"example-popup-overlay":o=e("#popmake_popup_theme_overlay").offset().top;break;case"example-popup":o=e("#popmake_popup_theme_container").offset().top;break;case"title":o=e("#popmake_popup_theme_title").offset().top;break;case"content":o=e("#popmake_popup_theme_content").offset().top;break;case"close-popup":o=e("#popmake_popup_theme_close").offset().top}e("html, body").animate({scrollTop:o+"px"})}).on("change","select.font-family",function(){e("select.font-weight option, select.font-style option",e(this).parents("table")).prop("selected",!1),n.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){n.update_font_selectboxes()}).on("change input focusout","select, input",function(){n.update_theme()}).on("change","select.border-style",function(){var t=e(this);"none"===t.val()?t.parents("table").find(".border-options").hide():t.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var t=e(this),n=t.parents("table");e("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",n).hide(),e("tr."+t.val(),n).show()})},update_theme:function(){var t,n=e("[name^='popup_theme_']").serializeArray(),i={};for(t=0;n.length>t;t+=1)0===n[t].name.indexOf("popup_theme_")&&(i[n[t].name.replace("popup_theme_","")]=n[t].value);this.retheme_popup(i)},theme_preview_scroll:function(){var t=e("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),n=t.parent(),i=t.offset().top-50;e(window).on("scroll",function(){e("> .postbox:visible",n).index(t)===e("> .postbox:visible",n).length-1&&e(window).scrollTop()>=i?t.css({left:t.offset().left,width:t.width(),height:t.height(),position:"fixed",top:50}):t.removeAttr("style")})},update_font_selectboxes:function(){return e("select.font-family").each(function(){var t,i,o=e(this),s=o.parents("table").find("select.font-weight"),r=o.parents("table").find("select.font-style"),a=s.find("option"),l=r.find("option");if(popmake_google_fonts[o.val()]!==n){if(t=popmake_google_fonts[o.val()],a.hide(),l.hide(),t.variants.length)for(i=0;t.variants.length>i;i+=1)"regular"===t.variants[i]?(e('option[value=""]',s).show(),e('option[value=""]',r).show()):(t.variants[i].indexOf("italic")>=0&&e('option[value="italic"]',r).show(),e('option[value="'+parseInt(t.variants[i],10)+'"]',s).show())}else a.show(),l.show();s.parents("tr:first").show(),s.find("option:visible").length<=1?s.parents("tr:first").hide():s.parents("tr:first").show(),r.parents("tr:first").show(),r.find("option:visible").length<=1?r.parents("tr:first").hide():r.parents("tr:first").show()})},convert_theme_for_preview:function(e){},initialize_theme_page:function(){e("#popuptitlediv").insertAfter("#titlediv");var n=this,i=e("#popup_theme_close_location").parents("table");switch(n.update_theme(),n.theme_page_listeners(),n.theme_preview_scroll(),n.update_font_selectboxes(),e(t).on("click",".popmake-preview",function(t){t.preventDefault(),e("#popmake-preview, #popmake-overlay").css({visibility:"visible"}).show()}).on("click",".popmake-close",function(){e("#popmake-preview, #popmake-overlay").hide()}),e("select.border-style").each(function(){var t=e(this);"none"===t.val()?t.parents("table").find(".border-options").hide():t.parents("table").find(".border-options").show()}),e(".color-picker.background-color").each(function(){var t=e(this);""===t.val()?t.parents("table").find(".background-opacity").hide():t.parents("table").find(".background-opacity").show()}),e("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",i).hide(),e("#popup_theme_close_location").val()){case"topleft":e("tr.topleft",i).show();break;case"topright":e("tr.topright",i).show();break;case"bottomleft":e("tr.bottomleft",i).show();break;case"bottomright":e("tr.bottomright",i).show()}},retheme_popup:function(i){var o,s=e(".empreview .example-popup-overlay, #popmake-overlay"),r=e(".empreview .example-popup, #popmake-preview"),a=e(".title, .popmake-title",r),l=e(".content, .popmake-content",r),c=e(".close-popup, .popmake-close",r),p="yes"===i.container_boxshadow_inset?"inset ":"",u="yes"===i.close_boxshadow_inset?"inset ":"";switch(this.convert_theme_for_preview(i),popmake_google_fonts[i.title_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.title_font_family,"normal"!==i.title_font_weight&&(o+=":"+i.title_font_weight),"italic"===i.title_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),popmake_google_fonts[i.content_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.content_font_family,"normal"!==i.content_font_weight&&(o+=":"+i.content_font_weight),"italic"===i.content_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),popmake_google_fonts[i.close_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.close_font_family,"normal"!==i.close_font_weight&&(o+=":"+i.close_font_weight),"italic"===i.close_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),s.removeAttr("style").css({backgroundColor:PUMUtils.convert_hex(i.overlay_background_color,i.overlay_background_opacity)}),r.removeAttr("style").css({padding:i.container_padding+"px",backgroundColor:PUMUtils.convert_hex(i.container_background_color,i.container_background_opacity),borderStyle:i.container_border_style,borderColor:i.container_border_color,borderWidth:i.container_border_width+"px",borderRadius:i.container_border_radius+"px",boxShadow:p+i.container_boxshadow_horizontal+"px "+i.container_boxshadow_vertical+"px "+i.container_boxshadow_blur+"px "+i.container_boxshadow_spread+"px "+PUMUtils.convert_hex(i.container_boxshadow_color,i.container_boxshadow_opacity)}),a.removeAttr("style").css({color:i.title_font_color,lineHeight:i.title_line_height+"px",fontSize:i.title_font_size+"px",fontFamily:i.title_font_family,fontStyle:i.title_font_style,fontWeight:i.title_font_weight,textAlign:i.title_text_align,textShadow:i.title_textshadow_horizontal+"px "+i.title_textshadow_vertical+"px "+i.title_textshadow_blur+"px "+PUMUtils.convert_hex(i.title_textshadow_color,i.title_textshadow_opacity)}),l.removeAttr("style").css({color:i.content_font_color,fontFamily:i.content_font_family,fontStyle:i.content_font_style,fontWeight:i.content_font_weight}),c.html(i.close_text).removeAttr("style").css({padding:i.close_padding+"px",height:i.close_height>0?i.close_height+"px":"auto",width:i.close_width>0?i.close_width+"px":"auto",backgroundColor:PUMUtils.convert_hex(i.close_background_color,i.close_background_opacity),color:i.close_font_color,lineHeight:i.close_line_height+"px",fontSize:i.close_font_size+"px",fontFamily:i.close_font_family,fontWeight:i.close_font_weight,fontStyle:i.close_font_style,borderStyle:i.close_border_style,borderColor:i.close_border_color,borderWidth:i.close_border_width+"px",borderRadius:i.close_border_radius+"px",boxShadow:u+i.close_boxshadow_horizontal+"px "+i.close_boxshadow_vertical+"px "+i.close_boxshadow_blur+"px "+i.close_boxshadow_spread+"px "+PUMUtils.convert_hex(i.close_boxshadow_color,i.close_boxshadow_opacity),textShadow:i.close_textshadow_horizontal+"px "+i.close_textshadow_vertical+"px "+i.close_textshadow_blur+"px "+PUMUtils.convert_hex(i.close_textshadow_color,i.close_textshadow_opacity)}),i.close_location){case"topleft":c.css({top:i.close_position_top+"px",left:i.close_position_left+"px"});break;case"topright":c.css({top:i.close_position_top+"px",right:i.close_position_right+"px"});break;case"bottomleft":c.css({bottom:i.close_position_bottom+"px",left:i.close_position_left+"px"});break;case"bottomright":c.css({bottom:i.close_position_bottom+"px",right:i.close_position_right+"px"})}e(t).trigger("popmake-admin-retheme",[i])}},i.ready(function(){PopMakeAdmin.init(),i.trigger("pum_init")})}(jQuery,document);