!function(){"use strict";function e(p){p.fn._fadeIn=p.fn.fadeIn;var b=p.noop||function(){},h=/MSIE/.test(navigator.userAgent),k=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),y=(document.documentMode,"function"==typeof document.createElement("div").style.setExpression&&document.createElement("div").style.setExpression);p.blockUI=function(e){o(window,e)},p.unblockUI=function(e){v(window,e)},p.growlUI=function(e,t,o,n){var i=p('<div class="growlUI"></div>');e&&i.append("<h1>"+e+"</h1>"),t&&i.append("<h2>"+t+"</h2>"),o===undefined&&(o=3e3);var s=function(e){e=e||{},p.blockUI({message:i,fadeIn:"undefined"!=typeof e.fadeIn?e.fadeIn:700,fadeOut:"undefined"!=typeof e.fadeOut?e.fadeOut:1e3,timeout:"undefined"!=typeof e.timeout?e.timeout:o,centerY:!1,showOverlay:!1,onUnblock:n,css:p.blockUI.defaults.growlCSS})};s();i.css("opacity");i.on("mouseover",function(){s({fadeIn:0,timeout:3e4});var e=p(".blockMsg");e.stop(),e.fadeTo(300,1)}).on("mouseout",function(){p(".blockMsg").fadeOut(1e3)})},p.fn.block=function(e){if(this[0]===window)return p.blockUI(e),this;var t=p.extend({},p.blockUI.defaults,e||{});return this.each(function(){var e=p(this);t.ignoreIfBlocked&&e.data("blockUI.isBlocked")||e.unblock({fadeOut:0})}),this.each(function(){"static"==p.css(this,"position")&&(this.style.position="relative",p(this).data("blockUI.static",!0)),this.style.zoom=1,o(this,e)})},p.fn.unblock=function(e){return this[0]===window?(p.unblockUI(e),this):this.each(function(){v(this,e)})},p.blockUI.version=2.7,p.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var m=null,g=[];function o(e,o){var t,n,i,s,l,d,a,c,r,u=e==window,f=o&&o.message!==undefined?o.message:undefined;(o=p.extend({},p.blockUI.defaults,o||{})).ignoreIfBlocked&&p(e).data("blockUI.isBlocked")||(o.overlayCSS=p.extend({},p.blockUI.defaults.overlayCSS,o.overlayCSS||{}),i=p.extend({},p.blockUI.defaults.css,o.css||{}),o.onOverlayClick&&(o.overlayCSS.cursor="pointer"),s=p.extend({},p.blockUI.defaults.themedCSS,o.themedCSS||{}),f=f===undefined?o.message:f,u&&m&&v(window,{fadeOut:0}),f&&"string"!=typeof f&&(f.parentNode||f.jquery)&&(t=f.jquery?f[0]:f,a={},p(e).data("blockUI.history",a),a.el=t,a.parent=t.parentNode,a.display=t.style.display,a.position=t.style.position,a.parent&&a.parent.removeChild(t)),p(e).data("blockUI.onUnblock",o.onUnblock),r=o.baseZ,a=h||o.forceIframe?p('<iframe class="blockUI" style="z-index:'+r+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+o.iframeSrc+'"></iframe>'):p('<div class="blockUI" style="display:none"></div>'),t=o.theme?p('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+r+++';display:none"></div>'):p('<div class="blockUI blockOverlay" style="z-index:'+r+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),o.theme&&u?(c='<div class="blockUI '+o.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(r+10)+';display:none;position:fixed">',o.title&&(c+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(o.title||"&nbsp;")+"</div>"),c+='<div class="ui-widget-content ui-dialog-content"></div>',c+="</div>"):o.theme?(c='<div class="blockUI '+o.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(r+10)+';display:none;position:absolute">',o.title&&(c+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(o.title||"&nbsp;")+"</div>"),c+='<div class="ui-widget-content ui-dialog-content"></div>',c+="</div>"):c=u?'<div class="blockUI '+o.blockMsgClass+' blockPage" style="z-index:'+(r+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+o.blockMsgClass+' blockElement" style="z-index:'+(r+10)+';display:none;position:absolute"></div>',r=p(c),f&&(o.theme?(r.css(s),r.addClass("ui-widget-content")):r.css(i)),o.theme||t.css(o.overlayCSS),t.css("position",u?"fixed":"absolute"),(h||o.forceIframe)&&a.css("opacity",0),c=[a,t,r],n=p(u?"body":e),p.each(c,function(){this.appendTo(n)}),o.theme&&o.draggable&&p.fn.draggable&&r.draggable({handle:".ui-dialog-titlebar",cancel:"li"}),s=y&&(!p.support.boxModel||0<p("object,embed",u?null:e).length),(k||s)&&(u&&o.allowBodyStretch&&p.support.boxModel&&p("html,body").css("height","100%"),!k&&p.support.boxModel||u||(i=U(e,"borderTopWidth"),s=U(e,"borderLeftWidth"),l=i?"(0 - "+i+")":0,d=s?"(0 - "+s+")":0),p.each(c,function(e,t){t=t[0].style;t.position="absolute",e<2?(u?t.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+o.quirksmodeOffsetHack+') + "px"'):t.setExpression("height",'this.parentNode.offsetHeight + "px"'),u?t.setExpression("width",'jQuery.support.boxModel&&document.documentElement.clientWidth||document.body.clientWidth + "px"'):t.setExpression("width",'this.parentNode.offsetWidth + "px"'),d&&t.setExpression("left",d),l&&t.setExpression("top",l)):o.centerY?(u&&t.setExpression("top",'(document.documentElement.clientHeight||document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah=document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "px"'),t.marginTop=0):!o.centerY&&u&&(e="((document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "+(o.css&&o.css.top?parseInt(o.css.top,10):0)+') + "px"',t.setExpression("top",e))})),f&&((o.theme?r.find(".ui-widget-content"):r).append(f),(f.jquery||f.nodeType)&&p(f).show()),(h||o.forceIframe)&&o.showOverlay&&a.show(),o.fadeIn?(c=o.onBlock?o.onBlock:b,a=o.showOverlay&&!f?c:b,c=f?c:b,o.showOverlay&&t._fadeIn(o.fadeIn,a),f&&r._fadeIn(o.fadeIn,c)):(o.showOverlay&&t.show(),f&&r.show(),o.onBlock&&o.onBlock.bind(r)()),I(1,e,o),u?(m=r[0],g=p(o.focusableElements,m),o.focusInput&&setTimeout(w,20)):function(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-U(n,"borderLeftWidth"),n=(n.offsetHeight-e.offsetHeight)/2-U(n,"borderTopWidth");t&&(i.left=0<s?s+"px":"0");o&&(i.top=0<n?n+"px":"0")}(r[0],o.centerX,o.centerY),o.timeout&&(r=setTimeout(function(){u?p.unblockUI(o):p(e).unblock(o)},o.timeout),p(e).data("blockUI.timeout",r)))}function v(e,t){var o,n,i=e==window,s=p(e),l=s.data("blockUI.history"),d=s.data("blockUI.timeout");d&&(clearTimeout(d),s.removeData("blockUI.timeout")),t=p.extend({},p.blockUI.defaults,t||{}),I(0,e,t),null===t.onUnblock&&(t.onUnblock=s.data("blockUI.onUnblock"),s.removeData("blockUI.onUnblock")),n=i?p(document.body).children().filter(".blockUI").add("body > .blockUI"):s.find(">.blockUI"),t.cursorReset&&(1<n.length&&(n[1].style.cursor=t.cursorReset),2<n.length&&(n[2].style.cursor=t.cursorReset)),i&&(m=g=null),t.fadeOut?(o=n.length,n.stop().fadeOut(t.fadeOut,function(){0==--o&&a(n,l,t,e)})):a(n,l,t,e)}function a(e,t,o,n){var i=p(n);i.data("blockUI.isBlocked")||(e.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),t&&t.el&&(t.el.style.display=t.display,t.el.style.position=t.position,t.el.style.cursor="default",t.parent&&t.parent.appendChild(t.el),i.removeData("blockUI.history")),i.data("blockUI.static")&&i.css("position","static"),"function"==typeof o.onUnblock&&o.onUnblock(n,o),n=(i=p(document.body)).width(),o=i[0].style.width,i.width(n-1).width(n),i[0].style.width=o)}function I(e,t,o){var n=t==window,t=p(t);!e&&(n&&!m||!n&&!t.data("blockUI.isBlocked"))||(t.data("blockUI.isBlocked",e),n&&o.bindEvents&&(!e||o.showOverlay)&&(n="mousedown mouseup keydown keypress keyup touchstart touchend touchmove",e?p(document).on(n,o,i):p(document).off(n,i)))}function i(e){if("keydown"===e.type&&e.keyCode&&9==e.keyCode&&m&&e.data.constrainTabKey){var t=!e.shiftKey&&e.target===g[g.length-1],o=e.shiftKey&&e.target===g[0];if(t||o)return setTimeout(function(){w(o)},10),!1}var n=e.data,t=p(e.target);return t.hasClass("blockOverlay")&&n.onOverlayClick&&n.onOverlayClick(e),0<t.parents("div."+n.blockMsgClass).length||0===t.parents().children().filter("div.blockUI").length}function w(e){!g||(e=g[!0===e?g.length-1:0])&&e.trigger("focus")}function U(e,t){return parseInt(p.css(e,t),10)||0}}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}();
jQuery(function(d){if("undefined"==typeof wc_add_to_cart_params)return!1;var t=function(){this.requests=[],this.addRequest=this.addRequest.bind(this),this.run=this.run.bind(this),d(document.body).on("click",".add_to_cart_button",{addToCartHandler:this},this.onAddToCart).on("click",".remove_from_cart_button",{addToCartHandler:this},this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("ajax_request_not_sent.adding_to_cart",this.updateButton).on("added_to_cart removed_from_cart",{addToCartHandler:this},this.updateFragments)};t.prototype.addRequest=function(t){this.requests.push(t),1===this.requests.length&&this.run()},t.prototype.run=function(){var t=this,a=t.requests[0].complete;t.requests[0].complete=function(){"function"==typeof a&&a(),t.requests.shift(),0<t.requests.length&&t.run()},d.ajax(this.requests[0])},t.prototype.onAddToCart=function(t){var a=d(this);if(a.is(".ajax_add_to_cart")){if(!a.attr("data-product_id"))return!0;if(t.preventDefault(),a.removeClass("added"),a.addClass("loading"),!1===d(document.body).triggerHandler("should_send_ajax_request.adding_to_cart",[a]))return d(document.body).trigger("ajax_request_not_sent.adding_to_cart",[!1,!1,a]),!0;var e={};d.each(a.data(),function(t,a){e[t]=a}),d.each(a[0].dataset,function(t,a){e[t]=a}),d(document.body).trigger("adding_to_cart",[a,e]),t.data.addToCartHandler.addRequest({type:"POST",url:wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),data:e,success:function(t){t&&(t.error&&t.product_url?window.location=t.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?d(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,a]):window.location=wc_add_to_cart_params.cart_url)},dataType:"json"})}},t.prototype.onRemoveFromCart=function(t){var a=d(this),e=a.closest(".woocommerce-mini-cart-item");t.preventDefault(),e.block({message:null,overlayCSS:{opacity:.6}}),t.data.addToCartHandler.addRequest({type:"POST",url:wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),data:{cart_item_key:a.data("cart_item_key")},success:function(t){t&&t.fragments?d(document.body).trigger("removed_from_cart",[t.fragments,t.cart_hash,a]):window.location=a.attr("href")},error:function(){window.location=a.attr("href")},dataType:"json"})},t.prototype.updateButton=function(t,a,e,r){(r=void 0!==r&&r)&&(r.removeClass("loading"),a&&r.addClass("added"),a&&!wc_add_to_cart_params.is_cart&&0===r.parent().find(".added_to_cart").length&&r.after('<a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),d(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateFragments=function(t,a){a&&(d.each(a,function(t){d(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),d.each(a,function(t,a){d(t).replaceWith(a),d(t).stop(!0).css("opacity","1").unblock()}),d(document.body).trigger("wc_fragments_loaded"))},new t});
!function(e){var n,o,t=!1;"function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),t||(n=window.Cookies,(o=window.Cookies=e()).noConflict=function(){return window.Cookies=n,o})}(function(){function m(){for(var e=0,n={};e<arguments.length;e++){var o,t=arguments[e];for(o in t)n[o]=t[o]}return n}return function e(C){function g(e,n,o){var t,r;if("undefined"!=typeof document){if(1<arguments.length){"number"==typeof(o=m({path:"/"},g.defaults,o)).expires&&((r=new Date).setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r),o.expires=o.expires?o.expires.toUTCString():"";try{t=JSON.stringify(n),/^[\{\[]/.test(t)&&(n=t)}catch(l){}n=C.write?C.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var i,c="";for(i in o)o[i]&&(c+="; "+i,!0!==o[i]&&(c+="="+o[i]));return document.cookie=e+"="+n+c}e||(t={});for(var s=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,p=0;p<s.length;p++){var a=s[p].split("=");'"'===(u=a.slice(1).join("=")).charAt(0)&&(u=u.slice(1,-1));try{var d=a[0].replace(f,decodeURIComponent),u=C.read?C.read(u,d):C(u,d)||u.replace(f,decodeURIComponent);if(this.json)try{u=JSON.parse(u)}catch(l){}if(e===d){t=u;break}e||(t[d]=u)}catch(l){}}return t}}return(g.set=g).get=function(e){return g.call(g,e)},g.getJSON=function(){return g.apply({json:!0},[].slice.call(arguments))},g.defaults={},g.remove=function(e,n){g(e,"",m(n,{expires:-1}))},g.withConverter=e,g}(function(){})});
jQuery(function(s){s(".woocommerce-ordering").on("change","select.orderby",function(){s(this).closest("form").trigger("submit")}),s("input.qty:not(.product-quantity input.qty)").each(function(){var o=parseFloat(s(this).attr("min"));0<=o&&parseFloat(s(this).val())<o&&s(this).val(o)});var e="store_notice"+(s(".woocommerce-store-notice").data("noticeId")||"");"hidden"===Cookies.get(e)?s(".woocommerce-store-notice").hide():s(".woocommerce-store-notice").show(),s(".woocommerce-store-notice__dismiss-link").on("click",function(o){Cookies.set(e,"hidden",{path:"/"}),s(".woocommerce-store-notice").hide(),o.preventDefault()}),s(".woocommerce-input-wrapper span.description").length&&s(document.body).on("click",function(){s(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),s(".woocommerce-input-wrapper").on("click",function(o){o.stopPropagation()}),s(".woocommerce-input-wrapper :input").on("keydown",function(o){var e=s(this).parent().find("span.description");if(27===o.which&&e.length&&e.is(":visible"))return e.prop("aria-hidden",!0).slideUp(250),o.preventDefault(),!1}).on("click focus",function(){var o=s(this).parent(),e=o.find("span.description");o.addClass("currentTarget"),s(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),e.length&&e.is(":hidden")&&e.prop("aria-hidden",!1).slideDown(250),o.removeClass("currentTarget")}),s.scroll_to_notices=function(o){o.length&&s("html, body").animate({scrollTop:o.offset().top-100},1e3)},s('.woocommerce form .woocommerce-Input[type="password"]').wrap('<span class="password-input"></span>'),s(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),s(".password-input").append('<span class="show-password-input"></span>'),s(".show-password-input").on("click",function(){s(this).hasClass("display-password")?s(this).removeClass("display-password"):s(this).addClass("display-password"),s(this).hasClass("display-password")?s(this).siblings(['input[type="password"]']).prop("type","text"):s(this).siblings('input[type="text"]').prop("type","password")})});
jQuery(function(r){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=!0,o=wc_cart_fragments_params.cart_hash_key;try{t="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(w){t=!1}function a(){t&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())}function s(e){t&&(localStorage.setItem(o,e),sessionStorage.setItem(o,e))}var e={url:wc_cart_fragments_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",data:{time:(new Date).getTime()},timeout:wc_cart_fragments_params.request_timeout,success:function(e){e&&e.fragments&&(r.each(e.fragments,function(e,t){r(e).replaceWith(t)}),t&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e.fragments)),s(e.cart_hash),e.cart_hash&&a()),r(document.body).trigger("wc_fragments_refreshed"))},error:function(){r(document.body).trigger("wc_fragments_ajax_error")}};function n(){r.ajax(e)}if(t){var i=null;r(document.body).on("wc_fragment_refresh updated_wc_div",function(){n()}),r(document.body).on("added_to_cart removed_from_cart",function(e,t,r){var n=sessionStorage.getItem(o);null!==n&&n!==undefined&&""!==n||a(),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(t)),s(r)}),r(document.body).on("wc_fragments_refreshed",function(){clearTimeout(i),i=setTimeout(n,864e5)}),r(window).on("storage onstorage",function(e){o===e.originalEvent.key&&localStorage.getItem(o)!==sessionStorage.getItem(o)&&n()}),r(window).on("pageshow",function(e){e.originalEvent.persisted&&(r(".widget_shopping_cart_content").empty(),r(document.body).trigger("wc_fragment_refresh"))});try{var c=JSON.parse(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),_=sessionStorage.getItem(o),g=Cookies.get("woocommerce_cart_hash"),m=sessionStorage.getItem("wc_cart_created");if(null!==_&&_!==undefined&&""!==_||(_=""),null!==g&&g!==undefined&&""!==g||(g=""),_&&(null===m||m===undefined||""===m))throw"No cart_created";if(m){var d=+m+864e5,m=(new Date).getTime();if(d<m)throw"Fragment expired";i=setTimeout(n,d-m)}if(!c||!c["div.widget_shopping_cart_content"]||_!==g)throw"No fragment";r.each(c,function(e,t){r(e).replaceWith(t)}),r(document.body).trigger("wc_fragments_loaded")}catch(w){n()}}else n();0<Cookies.get("woocommerce_items_in_cart")?r(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show():r(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").hide(),r(document.body).on("adding_to_cart",function(){r(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show()}),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.widgetsPreview&&wp.customize.widgetsPreview.WidgetPartial&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){n()})});
document.addEventListener("DOMContentLoaded",function(){const t=document.getElementById("site-navigation");if(t){const n=t.querySelector("button");if(n){const a=t.querySelector("ul");if(a){n.setAttribute("aria-expanded","false"),a.setAttribute("aria-expanded","false"),a.classList.add("nav-menu"),n.addEventListener("click",function(){t.classList.toggle("toggled");var e=t.classList.contains("toggled")?"true":"false";n.setAttribute("aria-expanded",e),a.setAttribute("aria-expanded",e)});const e=document.getElementsByClassName("handheld-navigation");if(0<e.length&&[].forEach.call(e[0].querySelectorAll(".menu-item-has-children > a, .page_item_has_children > a"),function(e){const t=document.createElement("button");t.setAttribute("aria-expanded","false"),t.classList.add("dropdown-toggle");const n=document.createElement("span");n.classList.add("screen-reader-text"),n.appendChild(document.createTextNode(storefrontScreenReaderText.expand)),t.appendChild(n),e.parentNode.insertBefore(t,e.nextSibling),e.parentNode.classList.contains("current-menu-ancestor")&&(t.setAttribute("aria-expanded","true"),t.classList.add("toggled-on"),t.nextElementSibling.classList.add("toggled-on")),t.addEventListener("click",function(){for(t.classList.toggle("toggled-on");n.firstChild;)n.removeChild(n.firstChild);var e=t.classList.contains("toggled-on");t.setAttribute("aria-expanded",e),n.appendChild(document.createTextNode(e?storefrontScreenReaderText.collapse:storefrontScreenReaderText.expand)),t.nextElementSibling.classList.toggle("toggled-on")})}),[].forEach.call(document.querySelectorAll(".site-header .menu-item > a, .site-header .page_item > a, .site-header-cart a"),function(n){n.addEventListener("focus",function(){var e=document.querySelectorAll(".focus");[].forEach.call(e,function(e){e.contains(n)||(e.classList.remove("focus"),e.firstChild&&e.firstChild.classList&&e.firstChild.classList.remove("blocked"))});const t=n.parentNode;t.classList.add("focus")})}),[].forEach.call(document.querySelectorAll("body #page > :not(.site-header)"),function(e){e.addEventListener("click",function(){[].forEach.call(document.querySelectorAll(".focus, .blocked"),function(e){e.classList.remove("focus"),e.classList.remove("blocked")})})}),("ontouchstart"in window||window.navigator.maxTouchPoints)&&767<window.innerWidth){[].forEach.call(document.querySelectorAll(".site-header ul ul, .site-header-cart .widget_shopping_cart"),function(e){e.classList.add("sub-menu--is-touch-device")});let n=!1;[].forEach.call(document.querySelectorAll(".site-header .menu-item > a, .site-header .page_item > a, .site-header-cart a"),function(t){t.addEventListener("click",function(e){t.classList.contains("blocked")&&!1===n&&e.preventDefault(),n=!1}),t.addEventListener("pointerup",function(e){!t.classList.contains("blocked")&&"mouse"!==e.pointerType&&("cart-contents"===t.className&&t.parentNode.nextElementSibling&&""!==t.parentNode.nextElementSibling.textContent.trim()||t.nextElementSibling)?t.classList.add("blocked"):n=!0})})}}else n.style.display="none"}}});
!function(){var e=-1<window.navigator.userAgent.toLowerCase().indexOf("webkit"),t=-1<window.navigator.userAgent.toLowerCase().indexOf("opera"),n=-1<window.navigator.userAgent.toLowerCase().indexOf("msie");(e||t||n)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){const e=document.getElementById(window.location.hash.substring(1));e&&(/^(?:a|select|input|button|textarea)$/i.test(e.tagName)||(e.tabIndex=-1),e.focus())},!1)}();
document.body.classList.contains("woocommerce-cart")||document.body.classList.contains("woocommerce-checkout")||window.innerWidth<768||!document.getElementById("site-header-cart")||window.addEventListener("load",function(){const e=document.querySelector(".site-header-cart");e.addEventListener("mouseover",function(){const e=window.outerHeight,t=this.querySelector(".widget_shopping_cart_content").getBoundingClientRect().bottom+this.offsetHeight,o=this.querySelector(".cart_list");e<t&&(o.style.maxHeight="15em",o.style.overflowY="auto")})});
document.addEventListener("DOMContentLoaded",function(){if(0!==document.getElementsByClassName("storefront-handheld-footer-bar").length){[].forEach.call(document.querySelectorAll(".storefront-handheld-footer-bar .search > a"),function(t){t.addEventListener("click",function(e){t.parentElement.classList.toggle("active"),e.preventDefault()})});const n=document.getElementsByClassName("storefront-handheld-footer-bar"),o=document.forms;function t(t){return function(e){t&&-1!==e.target.tabIndex?document.body.classList.add("sf-input-focused"):document.body.classList.remove("sf-input-focused")}}if(n.length&&o.length)for(let e=0;e<o.length;e++)n[0].contains(o[e])||(o[e].addEventListener("focus",t(!0),!0),o[e].addEventListener("blur",t(!1),!0))}});
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.2.7",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.left<i.left||e.origin.windowOffset.right>i.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.top<i.top||e.origin.windowOffset.bottom>i.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&false:c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]));var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"),
this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});
(function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate,
v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true");
g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap();
f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i";
_add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c=
f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this,
b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='<div class="'+l+'" '+(u?'role="'+c[_type]+'" ':"");u&&z.each(function(){h+=
'aria-labelledby="';this.id?h+=this.id:(this.id=y,h+=y);h+='"'});h=a.wrap(h+"/>")[_callback]("ifCreated").parent().append(e.insert);d=f('<ins class="'+C+'"/>').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return;
A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d=
b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
var woof_redirect='';
var woof_reset_btn_action=false;
jQuery(function ($){
jQuery('body').append('<div id="woof_html_buffer" class="woof_info_popup" style="display: none;"></div>');
jQuery.extend(jQuery.fn, {
within: function (pSelector){
return this.filter(function (){
return jQuery(this).closest(pSelector).length;
});
}});
if(jQuery('#woof_results_by_ajax').length > 0){
woof_is_ajax=1;
}
woof_autosubmit=parseInt(jQuery('.woof').eq(0).data('autosubmit'), 10);
woof_ajax_redraw=parseInt(jQuery('.woof').eq(0).data('ajax-redraw'), 10);
woof_ext_init_functions=jQuery.parseJSON(woof_ext_init_functions);
woof_init_native_woo_price_filter();
jQuery('body').bind('price_slider_change', function (event, min, max){
if(woof_autosubmit&&!woof_show_price_search_button&&jQuery('.price_slider_wrapper').length < 3){
jQuery('.woof .widget_price_filter form').trigger('submit');
}else{
var min_price=jQuery(this).find('.price_slider_amount #min_price').val();
var max_price=jQuery(this).find('.price_slider_amount #max_price').val();
woof_current_values.min_price=min_price;
woof_current_values.max_price=max_price;
}});
jQuery('body').on('change', '.woof_price_filter_dropdown', function (){
var val=jQuery(this).val();
if(parseInt(val, 10)==-1){
delete woof_current_values.min_price;
delete woof_current_values.max_price;
}else{
var val=val.split("-");
woof_current_values.min_price=val[0];
woof_current_values.max_price=val[1];
}
if(woof_autosubmit||jQuery(this).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}});
woof_recount_text_price_filter();
jQuery('body').on('change', '.woof_price_filter_txt', function (){
var from=parseInt(jQuery(this).parent().find('.woof_price_filter_txt_from').val(), 10);
var to=parseInt(jQuery(this).parent().find('.woof_price_filter_txt_to').val(), 10);
if(to < from||from < 0){
delete woof_current_values.min_price;
delete woof_current_values.max_price;
}else{
if(typeof woocs_current_currency!=='undefined'){
from=Math.ceil(from / parseFloat(woocs_current_currency.rate));
to=Math.ceil(to / parseFloat(woocs_current_currency.rate));
}
woof_current_values.min_price=from;
woof_current_values.max_price=to;
}
if(woof_autosubmit||jQuery(this).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}});
jQuery('body').on('click', '.woof_open_hidden_li_btn', function (){
var state=jQuery(this).data('state');
var type=jQuery(this).data('type');
if(state=='closed'){
jQuery(this).parents('.woof_list').find('.woof_hidden_term').addClass('woof_hidden_term2');
jQuery(this).parents('.woof_list').find('.woof_hidden_term').removeClass('woof_hidden_term');
if(type=='image'){
jQuery(this).find('img').attr('src', jQuery(this).data('opened'));
}else{
jQuery(this).html(jQuery(this).data('opened'));
}
jQuery(this).data('state', 'opened');
}else{
jQuery(this).parents('.woof_list').find('.woof_hidden_term2').addClass('woof_hidden_term');
jQuery(this).parents('.woof_list').find('.woof_hidden_term2').removeClass('woof_hidden_term2');
if(type=='image'){
jQuery(this).find('img').attr('src', jQuery(this).data('closed'));
}else{
jQuery(this).text(jQuery(this).data('closed'));
}
jQuery(this).data('state', 'closed');
}
return false;
});
woof_open_hidden_li();
jQuery('.widget_rating_filter li.wc-layered-nav-rating a').click(function (){
var is_chosen=jQuery(this).parent().hasClass('chosen');
var parsed_url=woof_parse_url(jQuery(this).attr('href'));
var rate=0;
if(parsed_url.query!==undefined){
if(parsed_url.query.indexOf('min_rating')!==-1){
var arrayOfStrings=parsed_url.query.split('min_rating=');
rate=parseInt(arrayOfStrings[1], 10);
}}
jQuery(this).parents('ul').find('li').removeClass('chosen');
if(is_chosen){
delete woof_current_values.min_rating;
}else{
woof_current_values.min_rating=rate;
jQuery(this).parent().addClass('chosen');
}
woof_submit_link(woof_get_submit_link());
return false;
});
jQuery('body').on('click', '.woof_start_filtering_btn', function (){
var shortcode=jQuery(this).parents('.woof').data('shortcode');
jQuery(this).html(woof_lang_loading);
jQuery(this).addClass('woof_start_filtering_btn2');
jQuery(this).removeClass('woof_start_filtering_btn');
var data={
action: "woof_draw_products",
page: 1,
shortcode: 'woof_nothing',
woof_shortcode: shortcode
};
jQuery.post(woof_ajaxurl, data, function (content){
content=jQuery.parseJSON(content);
jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone'));
woof_mass_reinit();
});
return false;
});
var str=window.location.href;
window.onpopstate=function (event){
try {
if(Object.keys(woof_current_values).length){
var temp=str.split('?');
var get1="";
if(temp[1]!=undefined){
get1=temp[1].split('#');
}
var str2=window.location.href;
var temp2=str2.split('?');
if(temp2[1]==undefined){
var get2={0: "", 1: ""};}else{
var get2=temp2[1].split('#');
}
if(get2[0]!=get1[0]){
woof_show_info_popup(woof_lang_loading);
window.location.reload();
}
return false;
}} catch (e){
console.log(e);
}};
woof_init_ion_sliders();
woof_init_show_auto_form();
woof_init_hide_auto_form();
woof_remove_empty_elements();
woof_init_search_form();
woof_init_pagination();
woof_init_orderby();
woof_init_reset_button();
woof_init_beauty_scroll();
woof_draw_products_top_panel();
woof_shortcode_observer();
woof_init_tooltip();
if(!woof_is_ajax){
woof_redirect_init();
}
woof_init_toggles();
});
function woof_redirect_init(){
try {
if(jQuery('.woof').length){
if(undefined!==jQuery('.woof').val()){
woof_redirect=jQuery('.woof').eq(0).data('redirect');
if(woof_redirect.length > 0){
woof_shop_page=woof_current_page_link=woof_redirect;
}
return woof_redirect;
}}
} catch (e){
console.log(e);
}}
function woof_init_orderby(){
jQuery('body').on('submit', 'form.woocommerce-ordering', function (){
if(!jQuery("#is_woo_shortcode").length){
return false;
}
});
jQuery('body').on('change', 'form.woocommerce-ordering select.orderby', function (){
if(!jQuery("#is_woo_shortcode").length){
woof_current_values.orderby=jQuery(this).val();
woof_ajax_page_num=1;
woof_submit_link(woof_get_submit_link(), 0);
return false;
}
});
}
function woof_init_reset_button(){
jQuery('body').on('click', '.woof_reset_search_form', function (){
woof_ajax_page_num=1;
woof_ajax_redraw=0;
woof_reset_btn_action=true;
if(woof_is_permalink){
woof_current_values={};
woof_submit_link(woof_get_submit_link().split("page/")[0]);
}else{
var link=woof_shop_page;
if(woof_current_values.hasOwnProperty('page_id')){
link=location.protocol + '//' + location.host + "/?page_id=" + woof_current_values.page_id;
woof_current_values={'page_id': woof_current_values.page_id};
woof_get_submit_link();
}
woof_submit_link(link);
if(woof_is_ajax){
history.pushState({}, "", link);
if(woof_current_values.hasOwnProperty('page_id')){
woof_current_values={'page_id': woof_current_values.page_id};}else{
woof_current_values={};}}
}
return false;
});
}
function woof_init_pagination(){
if(woof_is_ajax===1){
jQuery('body').on('click', '.woocommerce-pagination a.page-numbers', function (){
var l=jQuery(this).attr('href');
if(woof_ajax_first_done){
var res=l.split("paged=");
if(typeof res[1]!=='undefined'){
woof_ajax_page_num=parseInt(res[1]);
}else{
woof_ajax_page_num=1;
}
var res2=l.split("product-page=");
if(typeof res2[1]!=='undefined'){
woof_ajax_page_num=parseInt(res2[1]);
}}else{
var res=l.split("page/");
if(typeof res[1]!=='undefined'){
woof_ajax_page_num=parseInt(res[1]);
}else{
woof_ajax_page_num=1;
}
var res2=l.split("product-page=");
if(typeof res2[1]!=='undefined'){
woof_ajax_page_num=parseInt(res2[1]);
}}
{
woof_submit_link(woof_get_submit_link(), 0);
}
return false;
});
}}
function woof_init_search_form(){
woof_init_checkboxes();
woof_init_mselects();
woof_init_radios();
woof_price_filter_radio_init();
woof_init_selects();
if(woof_ext_init_functions!==null){
jQuery.each(woof_ext_init_functions, function (type, func){
eval(func + '()');
});
}
jQuery('.woof_submit_search_form').click(function (){
if(woof_ajax_redraw){
woof_ajax_redraw=0;
woof_is_ajax=0;
}
woof_submit_link(woof_get_submit_link());
return false;
});
jQuery('ul.woof_childs_list').parent('li').addClass('woof_childs_list_li');
woof_remove_class_widget();
woof_checkboxes_slide();
}
var woof_submit_link_locked=false;
function woof_submit_link(link, ajax_redraw){
if(woof_submit_link_locked){
return;
}
if(typeof WoofTurboMode!='undefined'){
WoofTurboMode.woof_submit_link(link);
return;
}
if(typeof ajax_redraw=='undefined'){
ajax_redraw=woof_ajax_redraw;
}
woof_submit_link_locked=true;
woof_show_info_popup(woof_lang_loading);
if(woof_is_ajax===1&&!ajax_redraw){
woof_ajax_first_done=true;
var data={
action: "woof_draw_products",
link: link,
page: woof_ajax_page_num,
shortcode: jQuery('#woof_results_by_ajax').data('shortcode'),
woof_shortcode: jQuery('div.woof').data('shortcode')
};
jQuery.post(woof_ajaxurl, data, function (content){
content=jQuery.parseJSON(content);
if(jQuery('.woof_results_by_ajax_shortcode').length){
if(typeof content.products!="undefined"){
jQuery('#woof_results_by_ajax').replaceWith(content.products);
}}else{
if(typeof content.products!="undefined"){
jQuery('.woof_shortcode_output').replaceWith(content.products);
}}
if(typeof content.additional_fields!="undefined"){
jQuery.each(content.additional_fields, function (selector, html_data){
jQuery(selector).replaceWith(html_data);
});
}
jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone'));
woof_draw_products_top_panel();
woof_mass_reinit();
woof_submit_link_locked=false;
jQuery.each(jQuery('#woof_results_by_ajax'), function (index, item){
if(index==0){
return;
}
jQuery(item).removeAttr('id');
});
woof_infinite();
woof_js_after_ajax_done();
woof_change_link_addtocart();
woof_init_tooltip();
document.dispatchEvent(new CustomEvent('woof-ajax-form-redrawing', {detail: {
link: link
}}));
});
}else{
if(ajax_redraw){
var data={
action: "woof_draw_products",
link: link,
page: 1,
shortcode: 'woof_nothing',
woof_shortcode: jQuery('div.woof').eq(0).data('shortcode')
};
jQuery.post(woof_ajaxurl, data, function (content){
content=jQuery.parseJSON(content);
jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone'));
woof_mass_reinit();
woof_submit_link_locked=false;
woof_init_tooltip();
document.dispatchEvent(new CustomEvent('woof-ajax-form-redrawing', {detail: {
link: link
}}));
});
}else{
window.location=link;
woof_show_info_popup(woof_lang_loading);
}}
}
function woof_remove_empty_elements(){
jQuery.each(jQuery('.woof_container select'), function (index, select){
var size=jQuery(select).find('option').length;
if(size===0){
jQuery(select).parents('.woof_container').remove();
}});
jQuery.each(jQuery('ul.woof_list'), function (index, ch){
var size=jQuery(ch).find('li').length;
if(size===0){
jQuery(ch).parents('.woof_container').remove();
}});
}
function woof_get_submit_link(){
if(woof_is_ajax){
woof_current_values.page=woof_ajax_page_num;
}
if(Object.keys(woof_current_values).length > 0){
jQuery.each(woof_current_values, function (index, value){
if(index==swoof_search_slug){
delete woof_current_values[index];
}
if(index=='s'){
delete woof_current_values[index];
}
if(index=='product'){
delete woof_current_values[index];
}
if(index=='really_curr_tax'){
delete woof_current_values[index];
}});
}
if(Object.keys(woof_current_values).length===2){
if(('min_price' in woof_current_values)&&('max_price' in woof_current_values)){
woof_current_page_link=woof_current_page_link.replace(new RegExp(/page\/(\d+)\//), "");
var l=woof_current_page_link + '?min_price=' + woof_current_values.min_price + '&max_price=' + woof_current_values.max_price;
if(woof_is_ajax){
history.pushState({}, "", l);
}
return l;
}}
if(Object.keys(woof_current_values).length===0){
if(woof_is_ajax){
history.pushState({}, "", woof_current_page_link);
}
return woof_current_page_link;
}
if(Object.keys(woof_really_curr_tax).length > 0){
woof_current_values['really_curr_tax']=woof_really_curr_tax.term_id + '-' + woof_really_curr_tax.taxonomy;
}
var link=woof_current_page_link + "?" + swoof_search_slug + "=1";
if(!woof_is_permalink){
if(woof_redirect.length > 0){
link=woof_redirect + "?" + swoof_search_slug + "=1";
if(woof_current_values.hasOwnProperty('page_id')){
delete woof_current_values.page_id;
}}else{
link=location.protocol + '//' + location.host + "?" + swoof_search_slug + "=1";
}}
var woof_exclude_accept_array=['path'];
if(Object.keys(woof_current_values).length > 0){
jQuery.each(woof_current_values, function (index, value){
if(index=='page'&&woof_is_ajax){
index='paged';
}
if(index=="product-page"){
return;
}
if(typeof value!=='undefined'){
if((typeof value&&value.length > 0)||typeof value=='number'){
if(jQuery.inArray(index, woof_exclude_accept_array)==-1){
link=link + "&" + index + "=" + value;
}}
}});
}
link=link.replace(new RegExp(/page\/(\d+)\//), "");
if(woof_is_ajax){
history.pushState({}, "", link);
}
return link;
}
function woof_show_info_popup(text){
if(woof_overlay_skin=='default'){
jQuery("#woof_html_buffer").text(text);
jQuery("#woof_html_buffer").fadeTo(200, 0.9);
}else{
switch (woof_overlay_skin){
case 'loading-balls':
case 'loading-bars':
case 'loading-bubbles':
case 'loading-cubes':
case 'loading-cylon':
case 'loading-spin':
case 'loading-spinning-bubbles':
case 'loading-spokes':
jQuery('body').plainOverlay('show', {progress: function (){
return jQuery('<div id="woof_svg_load_container"><img style="height: 100%;width: 100%" src="' + woof_link + 'img/loading-master/' + woof_overlay_skin + '.svg" alt=""></div>');
}});
break;
default:
jQuery('body').plainOverlay('show', {duration: -1});
break;
}}
}
function woof_hide_info_popup(){
if(woof_overlay_skin=='default'){
window.setTimeout(function (){
jQuery("#woof_html_buffer").fadeOut(400);
}, 200);
}else{
jQuery('body').plainOverlay('hide');
}}
function woof_draw_products_top_panel(){
if(woof_is_ajax){
jQuery('#woof_results_by_ajax').prev('.woof_products_top_panel').remove();
}
var panel=jQuery('.woof_products_top_panel');
panel.html('');
if(Object.keys(woof_current_values).length > 0){
panel.show();
panel.html('<ul></ul>');
panel.find('ul').attr('class', 'woof_products_top_panel_ul');
var is_price_in=false;
jQuery.each(woof_current_values, function (index, value){
if(jQuery.inArray(index, woof_accept_array)==-1&&jQuery.inArray(index.replace("rev_", ""), woof_accept_array)==-1){
return;
}
if((index=='min_price'||index=='max_price')&&is_price_in){
return;
}
if((index=='min_price'||index=='max_price')&&!is_price_in){
is_price_in=true;
index='price';
value=woof_lang_pricerange;
}
value=value.toString().trim();
if(value.search(',')){
value=value.split(',');
}
jQuery.each(value, function (i, v){
if(index=='page'){
return;
}
if(index=='post_type'){
return;
}
var txt=v;
if(index=='orderby'){
if(woof_lang[v]!==undefined){
txt=woof_lang.orderby + ': ' + woof_lang[v];
}else{
txt=woof_lang.orderby + ': ' + v;
}}else if(index=='perpage'){
txt=woof_lang.perpage;
}else if(index=='price'){
txt=woof_lang.pricerange;
}else{
var is_in_custom=false;
if(Object.keys(woof_lang_custom).length > 0){
jQuery.each(woof_lang_custom, function (i, tt){
if(i==index){
is_in_custom=true;
txt=tt;
if(index=='woof_sku'){
txt +=" " + v;
}}
});
}
if(!is_in_custom){
try {
txt=jQuery("input[data-anchor='woof_n_" + index + '_' + v + "']").val();
} catch (e){
console.log(e);
}
if(typeof txt==='undefined'){
txt=v;
}}
}
if(typeof woof_filter_titles[index]!='undefined'){
var cont_item=panel.find('ul.woof_products_top_panel_ul li ul[data-container=' + index + ']');
if(cont_item.length){
cont_item.append(jQuery('<li>').append(jQuery('<a>').attr('href', "").attr('data-tax', index).attr('data-slug', v).append(jQuery('<span>').attr('class', 'woof_remove_ppi').append(txt)
)));
}else{
panel.find('ul.woof_products_top_panel_ul').append(jQuery('<li>').append(jQuery('<ul>').attr('data-container', index).append(jQuery('<li>').text(woof_filter_titles[index] + ":")).append(jQuery('<li>').append(jQuery('<a>').attr('href', "").attr('data-tax', index).attr('data-slug', v).append(jQuery('<span>').attr('class', 'woof_remove_ppi').append(txt)
)))));
}}else{
panel.find('ul.woof_products_top_panel_ul').append(jQuery('<li>').append(jQuery('<a>').attr('href', "").attr('data-tax', index).attr('data-slug', v).append(jQuery('<span>').attr('class', 'woof_remove_ppi').append(txt)
)));
}});
});
}
if(jQuery(panel).find('li').length==0||!jQuery('.woof_products_top_panel').length){
panel.hide();
}else{
panel.find('ul.woof_products_top_panel_ul').prepend(jQuery('<li>').append(jQuery('<button>').attr('class', "woof_reset_button_2").append(woof_lang.clear_all))
);
}
jQuery('.woof_reset_button_2').click(function (){
woof_ajax_page_num=1;
woof_ajax_redraw=0;
woof_reset_btn_action=true;
if(woof_is_permalink){
woof_current_values={};
woof_submit_link(woof_get_submit_link().split("page/")[0]);
}else{
var link=woof_shop_page;
if(woof_current_values.hasOwnProperty('page_id')){
link=location.protocol + '//' + location.host + "/?page_id=" + woof_current_values.page_id;
woof_current_values={'page_id': woof_current_values.page_id};
woof_get_submit_link();
}
woof_submit_link(link);
if(woof_is_ajax){
history.pushState({}, "", link);
if(woof_current_values.hasOwnProperty('page_id')){
woof_current_values={'page_id': woof_current_values.page_id};}else{
woof_current_values={};}}
}
return false;
});
jQuery('.woof_remove_ppi').parent().click(function (){
var tax=jQuery(this).data('tax');
var name=jQuery(this).data('slug');
if(tax!='price'){
values=woof_current_values[tax];
values=values.split(',');
var tmp=[];
jQuery.each(values, function (index, value){
if(value!=name){
tmp.push(value);
}});
values=tmp;
if(values.length){
woof_current_values[tax]=values.join(',');
}else{
delete woof_current_values[tax];
}}else{
delete woof_current_values['min_price'];
delete woof_current_values['max_price'];
}
woof_ajax_page_num=1;
woof_reset_btn_action=true;
{
woof_submit_link(woof_get_submit_link());
}
jQuery('.woof_products_top_panel').find("[data-tax='" + tax + "'][href='" + name + "']").hide(333);
return false;
});
}
function woof_shortcode_observer(){
var redirect=true;
if(jQuery('.woof_shortcode_output').length||(jQuery('.woocommerce .products').length&&!jQuery('.single-product').length)){
redirect=false;
}
if(jQuery('.woocommerce .woocommerce-info').length){
redirect=false;
}
if(typeof woof_not_redirect!=='undefined'&&woof_not_redirect==1){
redirect=false;
}
if(jQuery('.woot-data-table').length){
redirect=false;
}
if(!redirect){
woof_current_page_link=location.protocol + '//' + location.host + location.pathname;
}
if(jQuery('#woof_results_by_ajax').length){
woof_is_ajax=1;
}}
function woof_init_beauty_scroll(){
if(woof_use_beauty_scroll){
try {
var anchor=".woof_section_scrolled, .woof_sid_auto_shortcode .woof_container_radio .woof_block_html_items, .woof_sid_auto_shortcode .woof_container_checkbox .woof_block_html_items, .woof_sid_auto_shortcode .woof_container_label .woof_block_html_items";
jQuery("" + anchor).mCustomScrollbar('destroy');
jQuery("" + anchor).mCustomScrollbar({
scrollButtons: {
enable: true
},
advanced: {
updateOnContentResize: true,
updateOnBrowserResize: true
},
theme: "dark-2",
horizontalScroll: false,
mouseWheel: true,
scrollType: 'pixels',
contentTouchScroll: true
});
} catch (e){
console.log(e);
}}
}
function woof_remove_class_widget(){
jQuery('.woof_container_inner').find('.widget').removeClass('widget');
}
function woof_init_show_auto_form(){
jQuery('.woof_show_auto_form').unbind('click');
jQuery('.woof_show_auto_form').click(function (){
var _this=this;
jQuery(_this).addClass('woof_hide_auto_form').removeClass('woof_show_auto_form');
jQuery(".woof_auto_show").show().animate({
height: (jQuery(".woof_auto_show_indent").height() + 20) + "px",
opacity: 1
}, 377, function (){
woof_init_hide_auto_form();
jQuery('.woof_auto_show').removeClass('woof_overflow_hidden');
jQuery('.woof_auto_show_indent').removeClass('woof_overflow_hidden');
jQuery(".woof_auto_show").height('auto');
});
return false;
});
}
function woof_init_hide_auto_form(){
jQuery('.woof_hide_auto_form').unbind('click');
jQuery('.woof_hide_auto_form').click(function (){
var _this=this;
jQuery(_this).addClass('woof_show_auto_form').removeClass('woof_hide_auto_form');
jQuery(".woof_auto_show").show().animate({
height: "1px",
opacity: 0
}, 377, function (){
jQuery('.woof_auto_show').addClass('woof_overflow_hidden');
jQuery('.woof_auto_show_indent').addClass('woof_overflow_hidden');
woof_init_show_auto_form();
});
return false;
});
}
function woof_checkboxes_slide(){
if(woof_checkboxes_slide_flag==true){
var childs=jQuery('ul.woof_childs_list');
if(childs.length){
jQuery.each(childs, function (index, ul){
if(jQuery(ul).parents('.woof_no_close_childs').length){
return;
}
var span_class='woof_is_closed';
if(woof_supports_html5_storage()){
var preulstate=localStorage.getItem(jQuery(ul).closest('li').attr("class"));
if(preulstate&&preulstate=='woof_is_opened'){
var span_class='woof_is_opened';
jQuery(ul).show();
}
jQuery(ul).parent('li').children('label').after('<a href="javascript:void(0);" class="woof_childs_list_opener" ><span class="' + span_class + '"></span></a>');
}else{
if(jQuery(ul).find('input[type=checkbox],input[type=radio]').is(':checked')){
jQuery(ul).show();
span_class='woof_is_opened';
}
jQuery(ul).parent('li').children('label').after('<a href="javascript:void(0);" class="woof_childs_list_opener" ><span class="' + span_class + '"></span></a>');
}});
jQuery.each(jQuery('a.woof_childs_list_opener span'), function (index, a){
jQuery(a).click(function (){
var span=jQuery(this);
var this_=jQuery(this).parent(".woof_childs_list_opener");
if(span.hasClass('woof_is_closed')){
jQuery(this_).parent().find('ul.woof_childs_list').first().show(333);
span.removeClass('woof_is_closed');
span.addClass('woof_is_opened');
}else{
jQuery(this_).parent().find('ul.woof_childs_list').first().hide(333);
span.removeClass('woof_is_opened');
span.addClass('woof_is_closed');
}
if(woof_supports_html5_storage()){
var ullabel=jQuery(this_).closest('li').attr("class");
var ullstate=jQuery(this_).children("span").attr("class");
localStorage.setItem(ullabel, ullstate);
}
return false;
});
});
}}
}
function woof_init_ion_sliders(){
jQuery.each(jQuery('.woof_range_slider'), function (index, input){
try {
jQuery(input).ionRangeSlider({
min: jQuery(input).data('min'),
max: jQuery(input).data('max'),
from: jQuery(input).data('min-now'),
to: jQuery(input).data('max-now'),
type: 'double',
prefix: jQuery(input).data('slider-prefix'),
postfix: jQuery(input).data('slider-postfix'),
prettify: true,
hideMinMax: false,
hideFromTo: false,
grid: true,
step: jQuery(input).data('step'),
onFinish: function (ui){
var tax=jQuery(input).data('taxes');
woof_current_values.min_price=(parseFloat(ui.from, 10) / tax);
woof_current_values.max_price=(parseFloat(ui.to, 10) / tax);
if(typeof woocs_current_currency!=='undefined'){
woof_current_values.min_price=woof_current_values.min_price / parseFloat(woocs_current_currency.rate);
woof_current_values.max_price=woof_current_values.max_price / parseFloat(woocs_current_currency.rate);
}
woof_ajax_page_num=1;
if(woof_autosubmit||jQuery(input).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}
return false;
},
onChange: function (data){
if(jQuery('.woof_price_filter_txt')){
var tax=jQuery(input).data('taxes');
jQuery('.woof_price_filter_txt_from').val(parseInt(data.from, 10) / tax);
jQuery('.woof_price_filter_txt_to').val(parseInt(data.to, 10) / tax);
if(typeof woocs_current_currency!=='undefined'){
jQuery('.woof_price_filter_txt_from').val(Math.ceil(jQuery('.woof_price_filter_txt_from').val() / parseFloat(woocs_current_currency.rate)));
jQuery('.woof_price_filter_txt_to').val(Math.ceil(jQuery('.woof_price_filter_txt_to').val() / parseFloat(woocs_current_currency.rate)));
}}
},
});
} catch (e){
}});
}
function woof_init_native_woo_price_filter(){
jQuery('.widget_price_filter form').unbind('submit');
jQuery('.widget_price_filter form').submit(function (){
var min_price=jQuery(this).find('.price_slider_amount #min_price').val();
var max_price=jQuery(this).find('.price_slider_amount #max_price').val();
woof_current_values.min_price=min_price;
woof_current_values.max_price=max_price;
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link(), 0);
}
return false;
});
}
function woof_reinit_native_woo_price_filter(){
if(typeof woocommerce_price_slider_params==='undefined'){
return false;
}
jQuery('input#min_price, input#max_price').hide();
jQuery('.price_slider, .price_label').show();
var min_price=jQuery('.price_slider_amount #min_price').data('min'),
max_price=jQuery('.price_slider_amount #max_price').data('max'),
current_min_price=parseInt(min_price, 10),
current_max_price=parseInt(max_price, 10);
if(woof_current_values.hasOwnProperty('min_price')){
current_min_price=parseInt(woof_current_values.min_price, 10);
current_max_price=parseInt(woof_current_values.max_price, 10);
}else{
if(woocommerce_price_slider_params.min_price){
current_min_price=parseInt(woocommerce_price_slider_params.min_price, 10);
}
if(woocommerce_price_slider_params.max_price){
current_max_price=parseInt(woocommerce_price_slider_params.max_price, 10);
}}
var currency_symbol=woocommerce_price_slider_params.currency_symbol;
if(typeof currency_symbol=='undefined'){
currency_symbol=woocommerce_price_slider_params.currency_format_symbol;
}
jQuery(document.body).bind('price_slider_create price_slider_slide', function (event, min, max){
if(typeof woocs_current_currency!=='undefined'){
var label_min=min;
var label_max=max;
if(typeof currency_symbol=='undefined'){
currency_symbol=woocs_current_currency.symbol
}
if(woocs_current_currency.rate!==1){
label_min=Math.ceil(label_min * parseFloat(woocs_current_currency.rate));
label_max=Math.ceil(label_max * parseFloat(woocs_current_currency.rate));
}
label_min=woof_front_number_format(label_min, 2, '.', ',');
label_max=woof_front_number_format(label_max, 2, '.', ',');
if(jQuery.inArray(woocs_current_currency.name, woocs_array_no_cents)||woocs_current_currency.hide_cents==1){
label_min=label_min.replace('.00', '');
label_max=label_max.replace('.00', '');
}
if(woocs_current_currency.position==='left'){
jQuery('.price_slider_amount span.from').html(currency_symbol + label_min);
jQuery('.price_slider_amount span.to').html(currency_symbol + label_max);
}else if(woocs_current_currency.position==='left_space'){
jQuery('.price_slider_amount span.from').html(currency_symbol + " " + label_min);
jQuery('.price_slider_amount span.to').html(currency_symbol + " " + label_max);
}else if(woocs_current_currency.position==='right'){
jQuery('.price_slider_amount span.from').html(label_min + currency_symbol);
jQuery('.price_slider_amount span.to').html(label_max + currency_symbol);
}else if(woocs_current_currency.position==='right_space'){
jQuery('.price_slider_amount span.from').html(label_min + " " + currency_symbol);
jQuery('.price_slider_amount span.to').html(label_max + " " + currency_symbol);
}}else{
if(woocommerce_price_slider_params.currency_pos==='left'){
jQuery('.price_slider_amount span.from').html(currency_symbol + min);
jQuery('.price_slider_amount span.to').html(currency_symbol + max);
}else if(woocommerce_price_slider_params.currency_pos==='left_space'){
jQuery('.price_slider_amount span.from').html(currency_symbol + ' ' + min);
jQuery('.price_slider_amount span.to').html(currency_symbol + ' ' + max);
}else if(woocommerce_price_slider_params.currency_pos==='right'){
jQuery('.price_slider_amount span.from').html(min + currency_symbol);
jQuery('.price_slider_amount span.to').html(max + currency_symbol);
}else if(woocommerce_price_slider_params.currency_pos==='right_space'){
jQuery('.price_slider_amount span.from').html(min + ' ' + currency_symbol);
jQuery('.price_slider_amount span.to').html(max + ' ' + currency_symbol);
}}
jQuery(document.body).trigger('price_slider_updated', [min, max]);
});
jQuery('.price_slider').slider({
range: true,
animate: true,
min: min_price,
max: max_price,
values: [current_min_price, current_max_price],
create: function (){
jQuery('.price_slider_amount #min_price').val(current_min_price);
jQuery('.price_slider_amount #max_price').val(current_max_price);
jQuery(document.body).trigger('price_slider_create', [current_min_price, current_max_price]);
},
slide: function (event, ui){
jQuery('input#min_price').val(ui.values[0]);
jQuery('input#max_price').val(ui.values[1]);
jQuery(document.body).trigger('price_slider_slide', [ui.values[0], ui.values[1]]);
},
change: function (event, ui){
jQuery(document.body).trigger('price_slider_change', [ui.values[0], ui.values[1]]);
}});
woof_init_native_woo_price_filter();
}
function woof_mass_reinit(){
woof_remove_empty_elements();
woof_open_hidden_li();
woof_init_search_form();
woof_hide_info_popup();
woof_init_beauty_scroll();
woof_init_ion_sliders();
woof_reinit_native_woo_price_filter();
woof_recount_text_price_filter();
woof_draw_products_top_panel();
}
function woof_recount_text_price_filter(){
if(typeof woocs_current_currency!=='undefined'){
jQuery.each(jQuery('.woof_price_filter_txt_from, .woof_price_filter_txt_to'), function (i, item){
jQuery(this).val(Math.ceil(jQuery(this).data('value')));
});
}}
function woof_init_toggles(){
jQuery('body').on('click', '.woof_front_toggle', function (){
if(jQuery(this).data('condition')=='opened'){
jQuery(this).removeClass('woof_front_toggle_opened');
jQuery(this).addClass('woof_front_toggle_closed');
jQuery(this).data('condition', 'closed');
if(woof_toggle_type=='text'){
jQuery(this).text(woof_toggle_closed_text);
}else{
jQuery(this).find('img').prop('src', woof_toggle_closed_image);
}}else{
jQuery(this).addClass('woof_front_toggle_opened');
jQuery(this).removeClass('woof_front_toggle_closed');
jQuery(this).data('condition', 'opened');
if(woof_toggle_type=='text'){
jQuery(this).text(woof_toggle_opened_text);
}else{
jQuery(this).find('img').prop('src', woof_toggle_opened_image);
}}
jQuery(this).parents('.woof_container_inner').find('.woof_block_html_items').toggle(500);
return false;
});
}
function woof_open_hidden_li(){
if(jQuery('.woof_open_hidden_li_btn').length > 0){
jQuery.each(jQuery('.woof_open_hidden_li_btn'), function (i, b){
if(jQuery(b).parents('ul').find('li.woof_hidden_term input[type=checkbox],li.woof_hidden_term input[type=radio]').is(':checked')){
jQuery(b).trigger('click');
}});
}}
function $_woof_GET(q, s){
s=(s) ? s:window.location.search;
var re=new RegExp('&' + q + '=([^&]*)', 'i');
return (s=s.replace(/^\?/, '&').match(re)) ? s=s[1]:s='';
}
function woof_parse_url(url){
var pattern=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
var matches=url.match(pattern);
return {
scheme: matches[2],
authority: matches[4],
path: matches[5],
query: matches[7],
fragment: matches[9]
};}
function woof_price_filter_radio_init(){
if(icheck_skin!='none'){
jQuery('.woof_price_filter_radio').iCheck('destroy');
jQuery('.woof_price_filter_radio').iCheck({
radioClass: 'iradio_' + icheck_skin.skin + '-' + icheck_skin.color,
});
jQuery('.woof_price_filter_radio').siblings('div').removeClass('checked');
jQuery('.woof_price_filter_radio').unbind('ifChecked');
jQuery('.woof_price_filter_radio').on('ifChecked', function (event){
jQuery(this).attr("checked", true);
jQuery('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible');
jQuery(this).parents('.woof_list').find('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible');
jQuery(this).parents('.woof_list').find('.woof_radio_price_reset').hide();
jQuery(this).parents('li').eq(0).find('.woof_radio_price_reset').eq(0).addClass('woof_radio_term_reset_visible');
var val=jQuery(this).val();
if(parseInt(val, 10)==-1){
delete woof_current_values.min_price;
delete woof_current_values.max_price;
jQuery(this).removeAttr('checked');
jQuery(this).siblings('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible');
}else{
var val=val.split("-");
woof_current_values.min_price=val[0];
woof_current_values.max_price=val[1];
jQuery(this).siblings('.woof_radio_price_reset').addClass('woof_radio_term_reset_visible');
jQuery(this).attr("checked", true);
}
if(woof_autosubmit||jQuery(this).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}});
}else{
jQuery('body').on('change', '.woof_price_filter_radio', function (){
var val=jQuery(this).val();
jQuery('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible');
if(parseInt(val, 10)==-1){
delete woof_current_values.min_price;
delete woof_current_values.max_price;
jQuery(this).removeAttr('checked');
jQuery(this).siblings('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible');
}else{
var val=val.split("-");
woof_current_values.min_price=val[0];
woof_current_values.max_price=val[1];
jQuery(this).siblings('.woof_radio_price_reset').addClass('woof_radio_term_reset_visible');
jQuery(this).attr("checked", true);
}
if(woof_autosubmit||jQuery(this).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}});
}
jQuery('.woof_radio_price_reset').click(function (){
delete woof_current_values.min_price;
delete woof_current_values.max_price;
jQuery(this).siblings('div').removeClass('checked');
jQuery(this).parents('.woof_list').find('input[type=radio]').removeAttr('checked');
jQuery(this).removeClass('woof_radio_term_reset_visible');
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}
return false;
});
}
function woof_serialize(serializedString){
var str=decodeURI(serializedString);
var pairs=str.split('&');
var obj={}, p, idx, val;
for (var i=0, n=pairs.length; i < n; i++){
p=pairs[i].split('=');
idx=p[0];
if(idx.indexOf("[]")==(idx.length - 2)){
var ind=idx.substring(0, idx.length - 2)
if(obj[ind]===undefined){
obj[ind]=[];
}
obj[ind].push(p[1]);
}else{
obj[idx]=p[1];
}}
return obj;
}
function woof_infinite(){
if(typeof yith_infs==='undefined'){
return;
}
var infinite_scroll1={
'nextSelector': '.woocommerce-pagination li .next',
'navSelector': yith_infs.navSelector,
'itemSelector': yith_infs.itemSelector,
'contentSelector': yith_infs.contentSelector,
'loader': '<img src="' + yith_infs.loader + '">',
'is_shop': yith_infs.shop
};
var curr_l=window.location.href;
var curr_link=curr_l.split('?');
var get="";
if(curr_link[1]!=undefined){
var temp=woof_serialize(curr_link[1]);
delete temp['paged'];
get=decodeURIComponent(jQuery.param(temp))
}
var page_link=jQuery('.woocommerce-pagination li .next').attr("href");
if(page_link==undefined){
page_link=curr_link + "page/1/"
}
var ajax_link=page_link.split('?');
var page="";
if(ajax_link[1]!=undefined){
var temp1=woof_serialize(ajax_link[1]);
if(temp1['paged']!=undefined){
page="page/" + temp1['paged'] + "/";
}}
page_link=curr_link[0] + page + '?' + get;
jQuery('.woocommerce-pagination li .next').attr('href', page_link);
jQuery(window).unbind("yith_infs_start"), jQuery(yith_infs.contentSelector).yit_infinitescroll(infinite_scroll1)
}
function woof_change_link_addtocart(){
if(!woof_is_ajax){
return;
}
jQuery(".add_to_cart_button").each(function (i, elem){
var link=jQuery(elem).attr('href');
if(link){
var link_items=link.split("?");
var site_link_items=window.location.href.split("?");
if(link_items[1]!=undefined){
link=site_link_items[0] + "?" + link_items[1];
jQuery(elem).attr('href', link);
}}
});
}
function woof_front_number_format(number, decimals, dec_point, thousands_sep){
number=(number + '')
.replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0:+number,
prec = !isFinite(+decimals) ? 0:Math.abs(decimals),
sep=(typeof thousands_sep==='undefined') ? ',':thousands_sep,
dec=(typeof dec_point==='undefined') ? '.':dec_point,
s='',
toFixedFix=function (n, prec){
var k=Math.pow(10, prec);
return '' + (Math.round(n * k) / k)
.toFixed(prec);
};
s=(prec ? toFixedFix(n, prec):'' + Math.round(n))
.split('.');
if(s[0].length > 3){
s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
}
if((s[1]||'')
.length < prec){
s[1]=s[1]||'';
s[1] +=new Array(prec - s[1].length + 1)
.join('0');
}
return s.join(dec);
}
function woof_supports_html5_storage(){
try {
return 'localStorage' in window&&window['localStorage']!==null;
} catch (e){
return false;
}}
function woof_init_tooltip(){
var tooltips=jQuery(".woof_tooltip_header");
if(tooltips.length){
jQuery(tooltips).tooltipster({
theme: 'tooltipster-noir',
side: 'right'
});
}};
function woof_init_radios(){
if(icheck_skin!='none'){
jQuery('.woof_radio_term').iCheck('destroy');
jQuery('.woof_radio_term').iCheck({
radioClass: 'iradio_' + icheck_skin.skin + '-' + icheck_skin.color,
});
jQuery('.woof_radio_term').unbind('ifChecked');
jQuery('.woof_radio_term').on('ifChecked', function (event){
jQuery(this).attr("checked", true);
jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').removeClass('woof_radio_term_reset_visible');
jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').hide();
jQuery(this).parents('li').eq(0).find('.woof_radio_term_reset').eq(0).addClass('woof_radio_term_reset_visible');
var slug=jQuery(this).data('slug');
var name=jQuery(this).attr('name');
var term_id=jQuery(this).data('term-id');
woof_radio_direct_search(term_id, name, slug);
});
}else{
jQuery('.woof_radio_term').on('change', function (event){
jQuery(this).attr("checked", true);
var slug=jQuery(this).data('slug');
var name=jQuery(this).attr('name');
var term_id=jQuery(this).data('term-id');
jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').removeClass('woof_radio_term_reset_visible');
jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').hide();
jQuery(this).parents('li').eq(0).find('.woof_radio_term_reset').eq(0).addClass('woof_radio_term_reset_visible');
woof_radio_direct_search(term_id, name, slug);
});
}
jQuery('.woof_radio_term_reset').click(function (){
woof_radio_direct_search(jQuery(this).data('term-id'), jQuery(this).attr('data-name'), 0);
jQuery(this).parents('.woof_list').find('.checked').removeClass('checked');
jQuery(this).parents('.woof_list').find('input[type=radio]').removeAttr('checked');
jQuery(this).removeClass('woof_radio_term_reset_visible');
return false;
});
}
function woof_radio_direct_search(term_id, name, slug){
jQuery.each(woof_current_values, function (index, value){
if(index==name){
delete woof_current_values[name];
return;
}});
if(slug!=0){
woof_current_values[name]=slug;
jQuery('a.woof_radio_term_reset_' + term_id).hide();
jQuery('woof_radio_term_' + term_id).filter(':checked').parents('li').find('a.woof_radio_term_reset').show();
jQuery('woof_radio_term_' + term_id).parents('ul.woof_list').find('label').css({'fontWeight': 'normal'});
jQuery('woof_radio_term_' + term_id).filter(':checked').parents('li').find('label.woof_radio_label_' + slug).css({'fontWeight': 'bold'});
}else{
jQuery('a.woof_radio_term_reset_' + term_id).hide();
jQuery('woof_radio_term_' + term_id).attr('checked', false);
jQuery('woof_radio_term_' + term_id).parent().removeClass('checked');
jQuery('woof_radio_term_' + term_id).parents('ul.woof_list').find('label').css({'fontWeight': 'normal'});
}
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}};
function woof_init_checkboxes(){
if(icheck_skin!='none'){
jQuery('.woof_checkbox_term').iCheck('destroy');
jQuery('.woof_checkbox_term').iCheck({
checkboxClass: 'icheckbox_' + icheck_skin.skin + '-' + icheck_skin.color,
});
jQuery('.woof_checkbox_term').unbind('ifChecked');
jQuery('.woof_checkbox_term').on('ifChecked', function (event){
jQuery(this).attr("checked", true);
jQuery(".woof_select_radio_check input").attr('disabled','disabled');
woof_checkbox_process_data(this, true);
});
jQuery('.woof_checkbox_term').unbind('ifUnchecked');
jQuery('.woof_checkbox_term').on('ifUnchecked', function (event){
jQuery(this).attr("checked", false);
woof_checkbox_process_data(this, false);
});
jQuery('.woof_checkbox_label').unbind();
jQuery('label.woof_checkbox_label').click(function (){
if(jQuery(this).prev().find('.woof_checkbox_term').is(':disabled')){
return false;
}
if(jQuery(this).prev().find('.woof_checkbox_term').is(':checked')){
jQuery(this).prev().find('.woof_checkbox_term').trigger('ifUnchecked');
jQuery(this).prev().removeClass('checked');
}else{
jQuery(this).prev().find('.woof_checkbox_term').trigger('ifChecked');
jQuery(this).prev().addClass('checked');
}});
}else{
jQuery('.woof_checkbox_term').on('change', function (event){
if(jQuery(this).is(':checked')){
jQuery(this).attr("checked", true);
woof_checkbox_process_data(this, true);
}else{
jQuery(this).attr("checked", false);
woof_checkbox_process_data(this, false);
}});
}}
function woof_checkbox_process_data(_this, is_checked){
var tax=jQuery(_this).data('tax');
var name=jQuery(_this).attr('name');
var term_id=jQuery(_this).data('term-id');
woof_checkbox_direct_search(term_id, name, tax, is_checked);
}
function woof_checkbox_direct_search(term_id, name, tax, is_checked){
var values='';
var checked=true;
if(is_checked){
if(tax in woof_current_values){
woof_current_values[tax]=woof_current_values[tax] + ',' + name;
}else{
woof_current_values[tax]=name;
}
checked=true;
}else{
values=woof_current_values[tax];
values=values.split(',');
var tmp=[];
jQuery.each(values, function (index, value){
if(value!=name){
tmp.push(value);
}});
values=tmp;
if(values.length){
woof_current_values[tax]=values.join(',');
}else{
delete woof_current_values[tax];
}
checked=false;
}
jQuery('.woof_checkbox_term_' + term_id).attr('checked', checked);
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}};
function woof_init_selects(){
if(is_woof_use_chosen){
try {
jQuery("select.woof_select, select.woof_price_filter_dropdown").chosen();
} catch (e){
}}
jQuery('.woof_select').change(function (){
var slug=jQuery(this).val();
var name=jQuery(this).attr('name');
woof_select_direct_search(this, name, slug);
});
}
function woof_select_direct_search(_this, name, slug){
jQuery.each(woof_current_values, function (index, value){
if(index==name){
delete woof_current_values[name];
return;
}});
if(slug!=0){
woof_current_values[name]=slug;
}
woof_ajax_page_num=1;
if(woof_autosubmit||jQuery(_this).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}};
function woof_init_mselects(){
try {
jQuery("select.woof_mselect").chosen();
} catch (e){
}
jQuery('.woof_mselect').change(function (a){
var slug=jQuery(this).val();
var name=jQuery(this).attr('name');
if(is_woof_use_chosen){
var vals=jQuery(this).chosen().val();
jQuery('.woof_mselect[name=' + name + '] option:selected').removeAttr("selected");
jQuery('.woof_mselect[name=' + name + '] option').each(function (i, option){
var v=jQuery(this).val();
if(jQuery.inArray(v, vals)!==-1){
jQuery(this).prop("selected", true);
}});
}
woof_mselect_direct_search(name, slug);
return true;
});
}
function woof_mselect_direct_search(name, slug){
var values=[];
jQuery('.woof_mselect[name=' + name + '] option:selected').each(function (i, v){
values.push(jQuery(this).val());
});
values=values.filter(function (item, pos){
return values.indexOf(item)==pos;
});
values=values.join(',');
if(values.length){
woof_current_values[name]=values;
}else{
delete woof_current_values[name];
}
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}};
function woof_init_onbackorder(){
if(icheck_skin!='none'){
jQuery('.woof_checkbox_onbackorder').iCheck({
checkboxClass: 'icheckbox_' + icheck_skin.skin + '-' + icheck_skin.color,
});
jQuery('.woof_checkbox_onbackorder').on('ifChecked', function (event){
jQuery(this).attr("checked", true);
woof_current_values.backorder='onbackorder';
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}});
jQuery('.woof_checkbox_onbackorder').on('ifUnchecked', function (event){
jQuery(this).attr("onbackorder", false);
delete woof_current_values.backorder;
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}});
}else{
jQuery('.woof_checkbox_onbackorder').on('change', function (event){
if(jQuery(this).is(':checked')){
jQuery(this).attr("checked", true);
woof_current_values.backorder='onbackorder';
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}}else{
jQuery(this).attr("checked", false);
delete woof_current_values.backorder;
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}}
});
}};
function woof_init_instock(){
if(icheck_skin!='none'){
jQuery('.woof_checkbox_instock').iCheck({
checkboxClass: 'icheckbox_' + icheck_skin.skin + '-' + icheck_skin.color,
});
jQuery('.woof_checkbox_instock').on('ifChecked', function (event){
jQuery(this).attr("checked", true);
woof_current_values.stock='instock';
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}});
jQuery('.woof_checkbox_instock').on('ifUnchecked', function (event){
jQuery(this).attr("checked", false);
delete woof_current_values.stock;
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}});
}else{
jQuery('.woof_checkbox_instock').on('change', function (event){
if(jQuery(this).is(':checked')){
jQuery(this).attr("checked", true);
woof_current_values.stock='instock';
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}}else{
jQuery(this).attr("checked", false);
delete woof_current_values.stock;
woof_ajax_page_num=1;
if(woof_autosubmit){
woof_submit_link(woof_get_submit_link());
}}
});
}};
(function (){
var $, AbstractChosen, Chosen, SelectParser, _ref,
__hasProp={}.hasOwnProperty,
__extends=function (child, parent){
for (var key in parent){
if(__hasProp.call(parent, key))
child[key]=parent[key];
}
function ctor(){
this.constructor=child;
}
ctor.prototype=parent.prototype;
child.prototype=new ctor();
child.__super__=parent.prototype;
return child;
};
SelectParser=(function (){
function SelectParser(){
this.options_index=0;
this.parsed=[];
}
SelectParser.prototype.add_node=function (child){
if(child.nodeName.toUpperCase()==="OPTGROUP"){
return this.add_group(child);
}else{
return this.add_option(child);
}};
SelectParser.prototype.add_group=function (group){
var group_position, option, _i, _len, _ref, _results;
group_position=this.parsed.length;
this.parsed.push({
array_index: group_position,
group: true,
label: this.escapeExpression(group.label),
children: 0,
disabled: group.disabled
});
_ref=group.childNodes;
_results=[];
for (_i=0, _len=_ref.length; _i < _len; _i++){
option=_ref[_i];
_results.push(this.add_option(option, group_position, group.disabled));
}
return _results;
};
SelectParser.prototype.add_option=function (option, group_position, group_disabled){
if(option.nodeName.toUpperCase()==="OPTION"){
if(option.text!==""){
if(group_position!=null){
this.parsed[group_position].children +=1;
}
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
value: option.value,
text: option.text,
html: option.innerHTML,
selected: option.selected,
disabled: group_disabled===true ? group_disabled:option.disabled,
group_array_index: group_position,
classes: option.className,
style: option.style.cssText
});
}else{
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
empty: true
});
}
return this.options_index +=1;
}};
SelectParser.prototype.escapeExpression=function (text){
var map, unsafe_chars;
if((text==null)||text===false){
return "";
}
if(!/[\&\<\>\"\'\`]/.test(text)){
return text;
}
map={
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
};
unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;
return text.replace(unsafe_chars, function (chr){
return map[chr]||"&amp;";
});
};
return SelectParser;
})();
SelectParser.select_to_array=function (select){
var child, parser, _i, _len, _ref;
parser=new SelectParser();
_ref=select.childNodes;
for (_i=0, _len=_ref.length; _i < _len; _i++){
child=_ref[_i];
parser.add_node(child);
}
return parser.parsed;
};
AbstractChosen=(function (){
function AbstractChosen(form_field, options){
this.form_field=form_field;
this.options=options!=null ? options:{};
if(!AbstractChosen.browser_is_supported()){
return;
}
this.is_multiple=this.form_field.multiple;
this.set_default_text();
this.set_default_values();
this.setup();
this.set_up_html();
this.register_observers();
}
AbstractChosen.prototype.set_default_values=function (){
var _this=this;
this.click_test_action=function (evt){
return _this.test_active_click(evt);
};
this.activate_action=function (evt){
return _this.activate_field(evt);
};
this.active_field=false;
this.mouse_on_container=false;
this.results_showing=false;
this.result_highlighted=null;
this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text==="" ? this.options.allow_single_deselect:false;
this.disable_search_threshold=this.options.disable_search_threshold||0;
this.disable_search=this.options.disable_search||false;
this.enable_split_word_search=this.options.enable_split_word_search!=null ? this.options.enable_split_word_search:true;
this.group_search=this.options.group_search!=null ? this.options.group_search:true;
this.search_contains=this.options.search_contains||false;
this.single_backstroke_delete=this.options.single_backstroke_delete!=null ? this.options.single_backstroke_delete:true;
this.max_selected_options=this.options.max_selected_options||Infinity;
this.inherit_select_classes=this.options.inherit_select_classes||false;
this.display_selected_options=this.options.display_selected_options!=null ? this.options.display_selected_options:true;
return this.display_disabled_options=this.options.display_disabled_options!=null ? this.options.display_disabled_options:true;
};
AbstractChosen.prototype.set_default_text=function (){
if(this.form_field.getAttribute("data-placeholder")){
this.default_text=this.form_field.getAttribute("data-placeholder");
}else if(this.is_multiple){
this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;
}else{
this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;
}
return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;
};
AbstractChosen.prototype.mouse_enter=function (){
return this.mouse_on_container=true;
};
AbstractChosen.prototype.mouse_leave=function (){
return this.mouse_on_container=false;
};
AbstractChosen.prototype.input_focus=function (evt){
var _this=this;
if(this.is_multiple){
if(!this.active_field){
return setTimeout((function (){
return _this.container_mousedown();
}), 50);
}}else{
if(!this.active_field){
return this.activate_field();
}}
};
AbstractChosen.prototype.input_blur=function (evt){
var _this=this;
if(!this.mouse_on_container){
this.active_field=false;
return setTimeout((function (){
return _this.blur_test();
}), 100);
}};
AbstractChosen.prototype.results_option_build=function (options){
var content, data, _i, _len, _ref;
content='';
_ref=this.results_data;
for (_i=0, _len=_ref.length; _i < _len; _i++){
data=_ref[_i];
if(data.group){
content +=this.result_add_group(data);
}else{
content +=this.result_add_option(data);
}
if(options!=null ? options.first:void 0){
if(data.selected&&this.is_multiple){
this.choice_build(data);
}else if(data.selected&&!this.is_multiple){
this.single_set_selected_text(data.text);
}}
}
return content;
};
AbstractChosen.prototype.result_add_option=function (option){
var classes, option_el;
if(!option.search_match){
return '';
}
if(!this.include_option_in_results(option)){
return '';
}
classes=[];
if(!option.disabled&&!(option.selected&&this.is_multiple)){
classes.push("active-result");
}
if(option.disabled&&!(option.selected&&this.is_multiple)){
classes.push("disabled-result");
}
if(option.selected){
classes.push("result-selected");
}
if(option.group_array_index!=null){
classes.push("group-option");
}
if(option.classes!==""){
classes.push(option.classes);
}
option_el=document.createElement("li");
option_el.className=classes.join(" ");
option_el.style.cssText=option.style;
option_el.setAttribute("data-option-array-index", option.array_index);
option_el.innerHTML=option.search_text;
return this.outerHTML(option_el);
};
AbstractChosen.prototype.result_add_group=function (group){
var group_el;
if(!(group.search_match||group.group_match)){
return '';
}
if(!(group.active_options > 0)){
return '';
}
group_el=document.createElement("li");
group_el.className="group-result";
group_el.innerHTML=group.search_text;
return this.outerHTML(group_el);
};
AbstractChosen.prototype.results_update_field=function (){
this.set_default_text();
if(!this.is_multiple){
this.results_reset_cleanup();
}
this.result_clear_highlight();
this.results_build();
if(this.results_showing){
return this.winnow_results();
}};
AbstractChosen.prototype.reset_single_select_options=function (){
var result, _i, _len, _ref, _results;
_ref=this.results_data;
_results=[];
for (_i=0, _len=_ref.length; _i < _len; _i++){
result=_ref[_i];
if(result.selected){
_results.push(result.selected=false);
}else{
_results.push(void 0);
}}
return _results;
};
AbstractChosen.prototype.results_toggle=function (){
if(this.results_showing){
return this.results_hide();
}else{
return this.results_show();
}};
AbstractChosen.prototype.results_search=function (evt){
if(this.results_showing){
return this.winnow_results();
}else{
return this.results_show();
}};
AbstractChosen.prototype.winnow_results=function (){
var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
this.no_results_clear();
results=0;
searchText=this.get_search_text();
escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
regexAnchor=this.search_contains ? "":"^";
regex=new RegExp(regexAnchor + escapedSearchText, 'i');
zregex=new RegExp(escapedSearchText, 'i');
_ref=this.results_data;
for (_i=0, _len=_ref.length; _i < _len; _i++){
option=_ref[_i];
option.search_match=false;
results_group=null;
if(this.include_option_in_results(option)){
if(option.group){
option.group_match=false;
option.active_options=0;
}
if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){
results_group=this.results_data[option.group_array_index];
if(results_group.active_options===0&&results_group.search_match){
results +=1;
}
results_group.active_options +=1;
}
if(!(option.group&&!this.group_search)){
option.search_text=option.group ? option.label:option.html;
option.search_match=this.search_string_match(option.search_text, regex);
if(option.search_match&&!option.group){
results +=1;
}
if(option.search_match){
if(searchText.length){
startpos=option.search_text.search(zregex);
text=option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
option.search_text=text.substr(0, startpos) + '<em>' + text.substr(startpos);
}
if(results_group!=null){
results_group.group_match=true;
}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){
option.search_match=true;
}}
}}
this.result_clear_highlight();
if(results < 1&&searchText.length){
this.update_results_content("");
return this.no_results(searchText);
}else{
this.update_results_content(this.results_option_build());
return this.winnow_results_set_highlight();
}};
AbstractChosen.prototype.search_string_match=function (search_string, regex){
var part, parts, _i, _len;
if(regex.test(search_string)){
return true;
}else if(this.enable_split_word_search&&(search_string.indexOf(" ") >=0||search_string.indexOf("[")===0)){
parts=search_string.replace(/\[|\]/g, "").split(" ");
if(parts.length){
for (_i=0, _len=parts.length; _i < _len; _i++){
part=parts[_i];
if(regex.test(part)){
return true;
}}
}}
};
AbstractChosen.prototype.choices_count=function (){
var option, _i, _len, _ref;
if(this.selected_option_count!=null){
return this.selected_option_count;
}
this.selected_option_count=0;
_ref=this.form_field.options;
for (_i=0, _len=_ref.length; _i < _len; _i++){
option=_ref[_i];
if(option.selected){
this.selected_option_count +=1;
}}
return this.selected_option_count;
};
AbstractChosen.prototype.choices_click=function (evt){
evt.preventDefault();
if(!(this.results_showing||this.is_disabled)){
return this.results_show();
}};
AbstractChosen.prototype.keyup_checker=function (evt){
var stroke, _ref;
stroke=(_ref=evt.which)!=null ? _ref:evt.keyCode;
this.search_field_scale();
switch (stroke){
case 8:
if(this.is_multiple&&this.backstroke_length < 1&&this.choices_count() > 0){
return this.keydown_backstroke();
}else if(!this.pending_backstroke){
this.result_clear_highlight();
return this.results_search();
}
break;
case 13:
evt.preventDefault();
if(this.results_showing){
return this.result_select(evt);
}
break;
case 27:
if(this.results_showing){
this.results_hide();
}
return true;
case 9:
case 38:
case 40:
case 16:
case 91:
case 17:
break;
default:
return this.results_search();
}};
AbstractChosen.prototype.clipboard_event_checker=function (evt){
var _this=this;
return setTimeout((function (){
return _this.results_search();
}), 50);
};
AbstractChosen.prototype.container_width=function (){
if(this.options.width!=null){
return this.options.width;
}else{
return "" + this.form_field.offsetWidth + "px";
}};
AbstractChosen.prototype.include_option_in_results=function (option){
if(this.is_multiple&&(!this.display_selected_options&&option.selected)){
return false;
}
if(!this.display_disabled_options&&option.disabled){
return false;
}
if(option.empty){
return false;
}
return true;
};
AbstractChosen.prototype.search_results_touchstart=function (evt){
this.touch_started=true;
return this.search_results_mouseover(evt);
};
AbstractChosen.prototype.search_results_touchmove=function (evt){
this.touch_started=false;
return this.search_results_mouseout(evt);
};
AbstractChosen.prototype.search_results_touchend=function (evt){
if(this.touch_started){
return this.search_results_mouseup(evt);
}};
AbstractChosen.prototype.outerHTML=function (element){
var tmp;
if(element.outerHTML){
return element.outerHTML;
}
tmp=document.createElement("div");
tmp.appendChild(element);
return tmp.innerHTML;
};
AbstractChosen.browser_is_supported=function (){
return true;
if(window.navigator.appName==="Microsoft Internet Explorer"){
return document.documentMode >=8;
}
if(/iP(od|hone)/i.test(window.navigator.userAgent)){
return false;
}
if(/Android/i.test(window.navigator.userAgent)){
if(/Mobile/i.test(window.navigator.userAgent)){
return false;
}}
return true;
};
AbstractChosen.default_multiple_text="Select Some Options";
AbstractChosen.default_single_text="Select an Option";
AbstractChosen.default_no_result_text="No results match";
return AbstractChosen;
})();
$=jQuery;
$.fn.extend({
chosen: function (options){
if(!AbstractChosen.browser_is_supported()){
return this;
}
return this.each(function (input_field){
var $this, chosen;
$this=$(this);
chosen=$this.data('chosen');
if(options==='destroy'&&chosen){
chosen.destroy();
}else if(!chosen){
$this.data('chosen', new Chosen(this, options));
}});
}});
Chosen=(function (_super){
__extends(Chosen, _super);
function Chosen(){
_ref=Chosen.__super__.constructor.apply(this, arguments);
return _ref;
}
Chosen.prototype.setup=function (){
this.form_field_jq=$(this.form_field);
this.current_selectedIndex=this.form_field.selectedIndex;
return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");
};
Chosen.prototype.set_up_html=function (){
var container_classes, container_props;
container_classes=["chosen-container"];
container_classes.push("chosen-container-" + (this.is_multiple ? "multi":"single"));
if(this.inherit_select_classes&&this.form_field.className){
container_classes.push(this.form_field.className);
}
if(this.is_rtl){
container_classes.push("chosen-rtl");
}
container_props={
'class': container_classes.join(' '),
'style': "width: " + (this.container_width()) + ";",
'title': this.form_field.title
};
if(this.form_field.id.length){
container_props.id=this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
}
this.container=$("<div />", container_props);
if(this.is_multiple){
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
}else{
this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
}
this.form_field_jq.hide().after(this.container);
this.dropdown=this.container.find('div.chosen-drop').first();
this.search_field=this.container.find('input').first();
this.search_results=this.container.find('ul.chosen-results').first();
this.search_field_scale();
this.search_no_results=this.container.find('li.no-results').first();
if(this.is_multiple){
this.search_choices=this.container.find('ul.chosen-choices').first();
this.search_container=this.container.find('li.search-field').first();
}else{
this.search_container=this.container.find('div.chosen-search').first();
this.selected_item=this.container.find('.chosen-single').first();
}
this.results_build();
this.set_tab_index();
this.set_label_behavior();
return this.form_field_jq.trigger("chosen:ready", {
chosen: this
});
};
Chosen.prototype.register_observers=function (){
var _this=this;
this.container.bind('mousedown.chosen', function (evt){
_this.container_mousedown(evt);
});
this.container.bind('mouseup.chosen', function (evt){
_this.container_mouseup(evt);
});
this.container.bind('mouseenter.chosen', function (evt){
_this.mouse_enter(evt);
});
this.container.bind('mouseleave.chosen', function (evt){
_this.mouse_leave(evt);
});
this.search_results.bind('mouseup.chosen', function (evt){
_this.search_results_mouseup(evt);
});
this.search_results.bind('mouseover.chosen', function (evt){
_this.search_results_mouseover(evt);
});
this.search_results.bind('mouseout.chosen', function (evt){
_this.search_results_mouseout(evt);
});
this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function (evt){
_this.search_results_mousewheel(evt);
});
this.search_results.bind('touchstart.chosen', function (evt){
_this.search_results_touchstart(evt);
});
this.search_results.bind('touchmove.chosen', function (evt){
_this.search_results_touchmove(evt);
});
this.search_results.bind('touchend.chosen', function (evt){
_this.search_results_touchend(evt);
});
this.form_field_jq.bind("chosen:updated.chosen", function (evt){
_this.results_update_field(evt);
});
this.form_field_jq.bind("chosen:activate.chosen", function (evt){
_this.activate_field(evt);
});
this.form_field_jq.bind("chosen:open.chosen", function (evt){
_this.container_mousedown(evt);
});
this.form_field_jq.bind("chosen:close.chosen", function (evt){
_this.input_blur(evt);
});
this.search_field.bind('blur.chosen', function (evt){
_this.input_blur(evt);
});
this.search_field.bind('keyup.chosen', function (evt){
_this.keyup_checker(evt);
});
this.search_field.bind('keydown.chosen', function (evt){
_this.keydown_checker(evt);
});
this.search_field.bind('focus.chosen', function (evt){
_this.input_focus(evt);
});
this.search_field.bind('cut.chosen', function (evt){
_this.clipboard_event_checker(evt);
});
this.search_field.bind('paste.chosen', function (evt){
_this.clipboard_event_checker(evt);
});
if(this.is_multiple){
return this.search_choices.bind('click.chosen', function (evt){
_this.choices_click(evt);
});
}else{
return this.container.bind('click.chosen', function (evt){
evt.preventDefault();
});
}};
Chosen.prototype.destroy=function (){
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
if(this.search_field[0].tabIndex){
this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;
}
this.container.remove();
this.form_field_jq.removeData('chosen');
return this.form_field_jq.show();
};
Chosen.prototype.search_field_disabled=function (){
this.is_disabled=this.form_field_jq[0].disabled;
if(this.is_disabled){
this.container.addClass('chosen-disabled');
this.search_field[0].disabled=true;
if(!this.is_multiple){
this.selected_item.unbind("focus.chosen", this.activate_action);
}
return this.close_field();
}else{
this.container.removeClass('chosen-disabled');
this.search_field[0].disabled=false;
if(!this.is_multiple){
return this.selected_item.bind("focus.chosen", this.activate_action);
}}
};
Chosen.prototype.container_mousedown=function (evt){
if(!this.is_disabled){
if(evt&&evt.type==="mousedown"&&!this.results_showing){
evt.preventDefault();
}
if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){
if(!this.active_field){
if(this.is_multiple){
this.search_field.val("");
}
$(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
this.results_show();
}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){
evt.preventDefault();
this.results_toggle();
}
return this.activate_field();
}}
};
Chosen.prototype.container_mouseup=function (evt){
if(evt.target.nodeName==="ABBR"&&!this.is_disabled){
return this.results_reset(evt);
}};
Chosen.prototype.search_results_mousewheel=function (evt){
var delta;
if(evt.originalEvent){
delta=-evt.originalEvent.wheelDelta||evt.originalEvent.detail;
}
if(delta!=null){
evt.preventDefault();
if(evt.type==='DOMMouseScroll'){
delta=delta * 40;
}
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
}};
Chosen.prototype.blur_test=function (evt){
if(!this.active_field&&this.container.hasClass("chosen-container-active")){
return this.close_field();
}};
Chosen.prototype.close_field=function (){
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
this.active_field=false;
this.results_hide();
this.container.removeClass("chosen-container-active");
this.clear_backstroke();
this.show_search_field_default();
return this.search_field_scale();
};
Chosen.prototype.activate_field=function (){
this.container.addClass("chosen-container-active");
this.active_field=true;
this.search_field.val(this.search_field.val());
return this.search_field.focus();
};
Chosen.prototype.test_active_click=function (evt){
var active_container;
active_container=$(evt.target).closest('.chosen-container');
if(active_container.length&&this.container[0]===active_container[0]){
return this.active_field=true;
}else{
return this.close_field();
}};
Chosen.prototype.results_build=function (){
this.parsing=true;
this.selected_option_count=null;
this.results_data=SelectParser.select_to_array(this.form_field);
if(this.is_multiple){
this.search_choices.find("li.search-choice").remove();
}else if(!this.is_multiple){
this.single_set_selected_text();
if(this.disable_search||this.form_field.options.length <=this.disable_search_threshold){
this.search_field[0].readOnly=true;
this.container.addClass("chosen-container-single-nosearch");
}else{
this.search_field[0].readOnly=false;
this.container.removeClass("chosen-container-single-nosearch");
}}
this.update_results_content(this.results_option_build({
first: true
}));
this.search_field_disabled();
this.show_search_field_default();
this.search_field_scale();
return this.parsing=false;
};
Chosen.prototype.result_do_highlight=function (el){
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
if(el.length){
this.result_clear_highlight();
this.result_highlight=el;
this.result_highlight.addClass("highlighted");
maxHeight=parseInt(this.search_results.css("maxHeight"), 10);
visible_top=this.search_results.scrollTop();
visible_bottom=maxHeight + visible_top;
high_top=this.result_highlight.position().top + this.search_results.scrollTop();
high_bottom=high_top + this.result_highlight.outerHeight();
if(high_bottom >=visible_bottom){
return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight:0);
}else if(high_top < visible_top){
return this.search_results.scrollTop(high_top);
}}
};
Chosen.prototype.result_clear_highlight=function (){
if(this.result_highlight){
this.result_highlight.removeClass("highlighted");
}
return this.result_highlight=null;
};
Chosen.prototype.results_show=function (){
if(this.is_multiple&&this.max_selected_options <=this.choices_count()){
this.form_field_jq.trigger("chosen:maxselected", {
chosen: this
});
return false;
}
this.container.addClass("chosen-with-drop");
this.results_showing=true;
this.search_field.focus();
this.search_field.val(this.search_field.val());
this.winnow_results();
return this.form_field_jq.trigger("chosen:showing_dropdown", {
chosen: this
});
};
Chosen.prototype.update_results_content=function (content){
return this.search_results.html(content);
};
Chosen.prototype.results_hide=function (){
if(this.results_showing){
this.result_clear_highlight();
this.container.removeClass("chosen-with-drop");
this.form_field_jq.trigger("chosen:hiding_dropdown", {
chosen: this
});
}
return this.results_showing=false;
};
Chosen.prototype.set_tab_index=function (el){
var ti;
if(this.form_field.tabIndex){
ti=this.form_field.tabIndex;
this.form_field.tabIndex=-1;
return this.search_field[0].tabIndex=ti;
}};
Chosen.prototype.set_label_behavior=function (){
var _this=this;
this.form_field_label=this.form_field_jq.parents("label");
if(!this.form_field_label.length&&this.form_field.id.length){
this.form_field_label=$("label[for='" + this.form_field.id + "']");
}
if(this.form_field_label.length > 0){
return this.form_field_label.bind('click.chosen', function (evt){
if(_this.is_multiple){
return _this.container_mousedown(evt);
}else{
return _this.activate_field();
}});
}};
Chosen.prototype.show_search_field_default=function (){
if(this.is_multiple&&this.choices_count() < 1&&!this.active_field){
this.search_field.val(this.default_text);
return this.search_field.addClass("default");
}else{
this.search_field.val("");
return this.search_field.removeClass("default");
}};
Chosen.prototype.search_results_mouseup=function (evt){
var target;
target=$(evt.target).hasClass("active-result") ? $(evt.target):$(evt.target).parents(".active-result").first();
if(target.length){
this.result_highlight=target;
this.result_select(evt);
return this.search_field.focus();
}};
Chosen.prototype.search_results_mouseover=function (evt){
var target;
target=$(evt.target).hasClass("active-result") ? $(evt.target):$(evt.target).parents(".active-result").first();
if(target){
return this.result_do_highlight(target);
}};
Chosen.prototype.search_results_mouseout=function (evt){
if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){
return this.result_clear_highlight();
}};
Chosen.prototype.choice_build=function (item){
var choice, close_link,
_this=this;
choice=$('<li />', {
"class": "search-choice"
}).html("<span>" + item.html + "</span>");
if(item.disabled){
choice.addClass('search-choice-disabled');
}else{
close_link=$('<a />', {
"class": 'search-choice-close',
'data-option-array-index': item.array_index
});
close_link.bind('click.chosen', function (evt){
return _this.choice_destroy_link_click(evt);
});
choice.append(close_link);
}
return this.search_container.before(choice);
};
Chosen.prototype.choice_destroy_link_click=function (evt){
evt.preventDefault();
evt.stopPropagation();
if(!this.is_disabled){
return this.choice_destroy($(evt.target));
}};
Chosen.prototype.choice_destroy=function (link){
if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){
this.show_search_field_default();
if(this.is_multiple&&this.choices_count() > 0&&this.search_field.val().length < 1){
this.results_hide();
}
link.parents('li').first().remove();
return this.search_field_scale();
}};
Chosen.prototype.results_reset=function (){
this.reset_single_select_options();
this.form_field.options[0].selected=true;
this.single_set_selected_text();
this.show_search_field_default();
this.results_reset_cleanup();
this.form_field_jq.trigger("change");
if(this.active_field){
return this.results_hide();
}};
Chosen.prototype.results_reset_cleanup=function (){
this.current_selectedIndex=this.form_field.selectedIndex;
return this.selected_item.find("abbr").remove();
};
Chosen.prototype.result_select=function (evt){
var high, item;
if(this.result_highlight){
high=this.result_highlight;
this.result_clear_highlight();
if(this.is_multiple&&this.max_selected_options <=this.choices_count()){
this.form_field_jq.trigger("chosen:maxselected", {
chosen: this
});
return false;
}
if(this.is_multiple){
high.removeClass("active-result");
}else{
this.reset_single_select_options();
}
item=this.results_data[high[0].getAttribute("data-option-array-index")];
item.selected=true;
this.form_field.options[item.options_index].selected=true;
this.selected_option_count=null;
if(this.is_multiple){
this.choice_build(item);
}else{
this.single_set_selected_text(item.text);
}
if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){
this.results_hide();
}
this.search_field.val("");
if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){
this.form_field_jq.trigger("change", {
'selected': this.form_field.options[item.options_index].value
});
}
this.current_selectedIndex=this.form_field.selectedIndex;
evt.preventDefault();
evt.stopPropagation();
return this.search_field_scale();
}};
Chosen.prototype.single_set_selected_text=function (text){
if(text==null){
text=this.default_text;
}
if(text===this.default_text){
this.selected_item.addClass("chosen-default");
}else{
this.single_deselect_control_build();
this.selected_item.removeClass("chosen-default");
}
return this.selected_item.find("span").text(text);
};
Chosen.prototype.result_deselect=function (pos){
var result_data;
result_data=this.results_data[pos];
if(!this.form_field.options[result_data.options_index].disabled){
result_data.selected=false;
this.form_field.options[result_data.options_index].selected=false;
this.selected_option_count=null;
this.result_clear_highlight();
if(this.results_showing){
this.winnow_results();
}
this.form_field_jq.trigger("change", {
deselected: this.form_field.options[result_data.options_index].value
});
this.search_field_scale();
return true;
}else{
return false;
}};
Chosen.prototype.single_deselect_control_build=function (){
if(!this.allow_single_deselect){
return;
}
if(!this.selected_item.find("abbr").length){
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
}
return this.selected_item.addClass("chosen-single-with-deselect");
};
Chosen.prototype.get_search_text=function (){
if(this.search_field.val()===this.default_text){
return "";
}else{
return $('<div/>').text($.trim(this.search_field.val())).html();
}};
Chosen.prototype.winnow_results_set_highlight=function (){
var do_high, selected_results;
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result"):[];
do_high=selected_results.length ? selected_results.first():this.search_results.find(".active-result").first();
if(do_high!=null){
return this.result_do_highlight(do_high);
}};
Chosen.prototype.no_results=function (terms){
var no_results_html;
no_results_html=$('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
no_results_html.find("span").first().html(terms);
this.search_results.append(no_results_html);
return this.form_field_jq.trigger("chosen:no_results", {
chosen: this
});
};
Chosen.prototype.no_results_clear=function (){
return this.search_results.find(".no-results").remove();
};
Chosen.prototype.keydown_arrow=function (){
var next_sib;
if(this.results_showing&&this.result_highlight){
next_sib=this.result_highlight.nextAll("li.active-result").first();
if(next_sib){
return this.result_do_highlight(next_sib);
}}else{
return this.results_show();
}};
Chosen.prototype.keyup_arrow=function (){
var prev_sibs;
if(!this.results_showing&&!this.is_multiple){
return this.results_show();
}else if(this.result_highlight){
prev_sibs=this.result_highlight.prevAll("li.active-result");
if(prev_sibs.length){
return this.result_do_highlight(prev_sibs.first());
}else{
if(this.choices_count() > 0){
this.results_hide();
}
return this.result_clear_highlight();
}}
};
Chosen.prototype.keydown_backstroke=function (){
var next_available_destroy;
if(this.pending_backstroke){
this.choice_destroy(this.pending_backstroke.find("a").first());
return this.clear_backstroke();
}else{
next_available_destroy=this.search_container.siblings("li.search-choice").last();
if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){
this.pending_backstroke=next_available_destroy;
if(this.single_backstroke_delete){
return this.keydown_backstroke();
}else{
return this.pending_backstroke.addClass("search-choice-focus");
}}
}};
Chosen.prototype.clear_backstroke=function (){
if(this.pending_backstroke){
this.pending_backstroke.removeClass("search-choice-focus");
}
return this.pending_backstroke=null;
};
Chosen.prototype.keydown_checker=function (evt){
var stroke, _ref1;
stroke=(_ref1=evt.which)!=null ? _ref1:evt.keyCode;
this.search_field_scale();
if(stroke!==8&&this.pending_backstroke){
this.clear_backstroke();
}
switch (stroke){
case 8:
this.backstroke_length=this.search_field.val().length;
break;
case 9:
if(this.results_showing&&!this.is_multiple){
this.result_select(evt);
}
this.mouse_on_container=false;
break;
case 13:
evt.preventDefault();
break;
case 38:
evt.preventDefault();
this.keyup_arrow();
break;
case 40:
evt.preventDefault();
this.keydown_arrow();
break;
}};
Chosen.prototype.search_field_scale=function (){
var div, f_width, h, style, style_block, styles, w, _i, _len;
if(this.is_multiple){
h=0;
w=0;
style_block="position:absolute; left: -1000px; top: -1000px; display:none;";
styles=['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
for (_i=0, _len=styles.length; _i < _len; _i++){
style=styles[_i];
style_block +=style + ":" + this.search_field.css(style) + ";";
}
div=$('<div />', {
'style': style_block
});
div.text(this.search_field.val());
$('body').append(div);
w=div.width() + 25;
div.remove();
f_width=this.container.outerWidth();
if(w > f_width - 10){
w=f_width - 10;
}
return this.search_field.css({
'width': w + 'px'
});
}};
return Chosen;
})(AbstractChosen);
}).call(this);