(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=true;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=false;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(!ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}})(jQuery);!function(t,e,r,s,n){function a(e){e=e.split(")");var r,n,a,i=t.trim,o=-1,c=e.length-1,p=O?new Float32Array(6):[],l=O?new Float32Array(6):[],f=O?new Float32Array(6):[1,0,0,1,0,0];for(p[0]=p[3]=f[0]=f[3]=1,p[1]=p[2]=p[4]=p[5]=0;++o<c;){switch(r=e[o].split("("),n=i(r[0]),a=r[1],l[0]=l[3]=1,l[1]=l[2]=l[4]=l[5]=0,n){case Y+"X":l[4]=parseInt(a,10);break;case Y+"Y":l[5]=parseInt(a,10);break;case Y:a=a.split(","),l[4]=parseInt(a[0],10),l[5]=parseInt(a[1]||0,10);break;case j:a=u(a),l[0]=s.cos(a),l[1]=s.sin(a),l[2]=-s.sin(a),l[3]=s.cos(a);break;case H+"X":l[0]=+a;break;case H+"Y":l[3]=a;break;case H:a=a.split(","),l[0]=a[0],l[3]=a.length>1?a[1]:a[0];break;case $+"X":l[2]=s.tan(u(a));break;case $+"Y":l[1]=s.tan(u(a));break;case z:a=a.split(","),l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l[4]=parseInt(a[4],10),l[5]=parseInt(a[5],10)}f[0]=p[0]*l[0]+p[2]*l[1],f[1]=p[1]*l[0]+p[3]*l[1],f[2]=p[0]*l[2]+p[2]*l[3],f[3]=p[1]*l[2]+p[3]*l[3],f[4]=p[0]*l[4]+p[2]*l[5]+p[4],f[5]=p[1]*l[4]+p[3]*l[5]+p[5],p=[f[0],f[1],f[2],f[3],f[4],f[5]]}return f}function i(t){var e,r,n,a=t[0],i=t[1],o=t[2],c=t[3];return a*c-i*o?(e=s.sqrt(a*a+i*i),a/=e,i/=e,n=a*o+i*c,o-=a*n,c-=i*n,r=s.sqrt(o*o+c*c),o/=r,c/=r,n/=r,i*o>a*c&&(a=-a,i=-i,n=-n,e=-e)):e=r=n=0,[[Y,[+t[4],+t[5]]],[j,s.atan2(i,a)],[$+"X",s.atan(n)],[H,[e,r]]]}function o(e,r){var s,n,o,u,m={start:[],end:[]},x=-1;if(("none"==e||p(e))&&(e=""),("none"==r||p(r))&&(r=""),e&&r&&!r.indexOf("matrix")&&g(e).join()==g(r.split(")")[0]).join()&&(m.origin=e,e="",r=r.slice(r.indexOf(")")+1)),e||r){if(e&&r&&l(e)!=l(r))m.start=i(a(e)),m.end=i(a(r));else for(e&&(e=e.split(")"))&&(s=e.length),r&&(r=r.split(")"))&&(s=r.length);++x<s-1;)e[x]&&(n=e[x].split("(")),r[x]&&(o=r[x].split("(")),u=t.trim((n||o)[0]),f(m.start,c(u,n?n[1]:0)),f(m.end,c(u,o?o[1]:0));return m}}function c(t,e){var r,s=+!t.indexOf(H),n=t.replace(/e[XY]/,"e");switch(t){case Y+"Y":case H+"Y":e=[s,e?parseFloat(e):s];break;case Y+"X":case Y:case H+"X":r=1;case H:e=e?(e=e.split(","))&&[parseFloat(e[0]),parseFloat(e.length>1?e[1]:t==H?r||e[0]:s+"")]:[s,s];break;case $+"X":case $+"Y":case j:e=e?u(e):0;break;case z:return i(e?g(e):[1,0,0,1,0,0])}return[[n,e]]}function p(t){return v.test(t)}function l(t){return t.replace(/(?:\([^)]*\))|\s/g,"")}function f(t,e,r){for(;r=e.shift();)t.push(r)}function u(t){return~t.indexOf("deg")?parseInt(t,10)*(2*s.PI/360):~t.indexOf("grad")?parseInt(t,10)*(s.PI/200):parseFloat(t)}function g(t){return t=/([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(t),[t[1],t[2],t[3],t[4],t[5],t[6]]}for(var m,x,d,k,h=r.createElement("div"),y=h.style,b="Transform",I=["O"+b,"ms"+b,"Webkit"+b,"Moz"+b],M=I.length,O=("Float32Array"in e),X=/Matrix([^)]*)/,v=/^\s*matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*(?:,\s*0(?:px)?\s*){2}\)\s*$/,w="transform",F="transformOrigin",Y="translate",j="rotate",H="scale",$="skew",z="matrix";M--;)I[M]in y&&(t.support[w]=m=I[M],t.support[F]=m+"Origin");m||(t.support.matrixFilter=x=""===y.filter),t.cssNumber[w]=t.cssNumber[F]=!0,m&&m!=w?(t.cssProps[w]=m,t.cssProps[F]=m+"Origin",m=="Moz"+b?d={get:function(e,r){return r?t.css(e,m).split("px").join(""):e.style[m]},set:function(t,e){t.style[m]=/matrix\([^)p]*\)/.test(e)?e.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/,z+"$1$2px,$3px"):e}}:/^1\.[0-5](?:\.|$)/.test(t.fn.jquery)&&(d={get:function(e,r){return r?t.css(e,m.replace(/^ms/,"Ms")):e.style[m]}})):x&&(d={get:function(e,r,s){var a,i,o=r&&e.currentStyle?e.currentStyle:e.style;return o&&X.test(o.filter)?(a=RegExp.$1.split(","),a=[a[0].split("=")[1],a[2].split("=")[1],a[1].split("=")[1],a[3].split("=")[1]]):a=[1,0,0,1],t.cssHooks[F]?(i=t._data(e,"transformTranslate",n),a[4]=i?i[0]:0,a[5]=i?i[1]:0):(a[4]=o?parseInt(o.left,10)||0:0,a[5]=o?parseInt(o.top,10)||0:0),s?a:z+"("+a+")"},set:function(e,r,s){var n,i,o,c,p=e.style;s||(p.zoom=1),r=a(r),i=["Matrix(M11="+r[0],"M12="+r[2],"M21="+r[1],"M22="+r[3],"SizingMethod='auto expand'"].join(),o=(n=e.currentStyle)&&n.filter||p.filter||"",p.filter=X.test(o)?o.replace(X,i):o+" progid:DXImageTransform.Microsoft."+i+")",t.cssHooks[F]?t.cssHooks[F].set(e,r):((c=t.transform.centerOrigin)&&(p["margin"==c?"marginLeft":"left"]=-(e.offsetWidth/2)+e.clientWidth/2+"px",p["margin"==c?"marginTop":"top"]=-(e.offsetHeight/2)+e.clientHeight/2+"px"),p.left=r[4]+"px",p.top=r[5]+"px")}}),d&&(t.cssHooks[w]=d),k=d&&d.get||t.css,t.fx.step.transform=function(e){var r,n,a,i,c=e.elem,p=e.start,l=e.end,f=e.pos,u="",g=1e5;for(p&&"string"!=typeof p||(p||(p=k(c,m)),x&&(c.style.zoom=1),l=l.split("+=").join(p),t.extend(e,o(p,l)),p=e.start,l=e.end),r=p.length;r--;)switch(n=p[r],a=l[r],i=0,n[0]){case Y:i="px";case H:i||(i=""),u=n[0]+"("+s.round((n[1][0]+(a[1][0]-n[1][0])*f)*g)/g+i+","+s.round((n[1][1]+(a[1][1]-n[1][1])*f)*g)/g+i+")"+u;break;case $+"X":case $+"Y":case j:u=n[0]+"("+s.round((n[1]+(a[1]-n[1])*f)*g)/g+"rad)"+u}e.origin&&(u=e.origin+u),d&&d.set?d.set(c,u,1):c.style[m]=u},t.transform={centerOrigin:"margin"}}(jQuery,window,document,Math);
!function(c,d){"use strict";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=d.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=0;o<n.length;o++)n[o].style.display="none";for(o=0;o<s.length;o++)if(r=s[o],e.source===r.contentWindow){if(r.removeAttribute("style"),"height"===t.message){if(1e3<(i=parseInt(t.value,10)))i=1e3;else if(~~i<200)i=200;r.height=i}if("link"===t.message)if(a=d.createElement("a"),i=d.createElement("a"),a.href=r.getAttribute("src"),i.href=t.value,i.host===a.host)if(d.activeElement===r)c.top.location.href=t.value}}},e)c.addEventListener("message",c.wp.receiveEmbedMessage,!1),d.addEventListener("DOMContentLoaded",t,!1),c.addEventListener("load",t,!1);function t(){if(!n){n=!0;for(var e,t,r=-1!==navigator.appVersion.indexOf("MSIE 10"),a=!!navigator.userAgent.match(/Trident.*rv:11\./),i=d.querySelectorAll("iframe.wp-embedded-content"),s=0;s<i.length;s++){if(!(e=i[s]).getAttribute("data-secret"))t=Math.random().toString(36).substr(2,10),e.src+="#?secret="+t,e.setAttribute("data-secret",t);if(r||a)(t=e.cloneNode(!0)).removeAttribute("security"),e.parentNode.replaceChild(t,e)}}}}(window,document);
!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.6",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&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):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});
var woof_redirect='';
jQuery(function ($){
jQuery('body').append('<div id="woof_html_buffer" class="woof_info_popup" style="display: none;"></div>');
jQuery.fn.life=function (types, data, fn){
jQuery(this.context).on(types, this.selector, data, fn);
return this;
};
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 < 2){
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('.woof_price_filter_dropdown').life('change', 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('.woof_price_filter_txt').life('change', 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('.woof_open_hidden_li_btn').life('click', 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('.woof_start_filtering_btn').life('click', 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
};
console.log(data);
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 {
console.log(woof_current_values)
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('form.woocommerce-ordering').life('submit', function (){
if(!jQuery("#is_woo_shortcode").length){
return false;
}
});
jQuery('form.woocommerce-ordering select.orderby').life('change', 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());
return false;
}
});
}
function woof_init_reset_button(){
jQuery('.woof_reset_search_form').on('click', function (){
woof_ajax_page_num=1;
woof_ajax_redraw=0;
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('a.page-numbers').life('click', 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());
}
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){
if(woof_submit_link_locked){
return;
}
woof_submit_link_locked=true;
woof_show_info_popup(woof_lang_loading);
if(woof_is_ajax===1&&!woof_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){
jQuery('#woof_results_by_ajax').replaceWith(content.products);
}else{
jQuery('.woof_shortcode_output').replaceWith(content.products);
}
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();
});
}else{
if(woof_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;
});
}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)){
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(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>');
var is_price_in=false;
jQuery.each(woof_current_values, function (index, value){
if(jQuery.inArray(index, 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;
}}
}
panel.find('ul').append(jQuery('<li>').append(jQuery('<a>').attr('href', v).attr('data-tax', index).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();
}
jQuery('.woof_remove_ppi').parent().click(function (){
var tax=jQuery(this).data('tax');
var name=jQuery(this).attr('href');
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_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(!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').find('label').first().text());
if(preulstate&&preulstate=='woof_is_opened'){
var span_class='woof_is_opened';
jQuery(ul).show();
}
jQuery(ul).before('<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).before('<a href="javascript:void(0);" class="woof_childs_list_opener"><span class="' + span_class + '"></span></a>');
}});
jQuery.each(jQuery('a.woof_childs_list_opener'), function (index, a){
jQuery(a).click(function (){
var span=jQuery(this).find('span');
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").find("label").first().text();
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=(parseInt(ui.from, 10)/tax);
woof_current_values.max_price=(parseInt(ui.to, 10)/tax);
if(typeof woocs_current_currency!=='undefined'){
woof_current_values.min_price=Math.ceil(woof_current_values.min_price / parseFloat(woocs_current_currency.rate));
woof_current_values.max_price=Math.ceil(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;
}});
} 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||jQuery(input).within('.woof').length==0){
woof_submit_link(woof_get_submit_link());
}
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(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('.woof_front_toggle').life('click', 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('.woof_price_filter_radio').life('change', 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/"
}
console.log(page_link);
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');
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(){
jQuery(".woof_tooltip_header").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');
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 (){
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);
(()=>{var e={1677:()=>{function e(e){for(var t=!!e.getAttribute("data-show-if"),r=t?e.getAttribute("data-show-if").split(":"):e.getAttribute("data-hide-if").split(":"),n=r[0],a=(r.length>1?r[1]:"*").split("|"),i=function(e,t){for(var r=[],n=e.querySelectorAll('input[name="'+t+'"],select[name="'+t+'"],textarea[name="'+t+'"]'),a=0;a<n.length;a++){var i=n[a];("radio"!==i.type&&"checkbox"!==i.type||i.checked)&&r.push(i.value)}return r}(function(e){for(var t=e;t.parentElement;)if("FORM"===(t=t.parentElement).tagName)return t;return null}(e),n),o=!1,s=0;s<i.length;s++){var c=i[s];if(o=a.indexOf(c)>-1||a.indexOf("*")>-1&&c.length>0)break}e.style.display=t?o?"":"none":o?"none":"";var u=e.querySelectorAll("input,select,textarea");[].forEach.call(u,(function(e){(o||t)&&e.getAttribute("data-was-required")&&(e.required=!0,e.removeAttribute("data-was-required")),o&&t||!e.required||(e.setAttribute("data-was-required","true"),e.required=!1)}))}function t(){var t=document.querySelectorAll(".mc4wp-form [data-show-if],.mc4wp-form [data-hide-if]");[].forEach.call(t,e)}function r(t){if(t.target&&t.target.form&&!(t.target.form.className.indexOf("mc4wp-form")<0)){var r=t.target.form.querySelectorAll("[data-show-if],[data-hide-if]");[].forEach.call(r,e)}}document.addEventListener("keyup",r,!0),document.addEventListener("change",r,!0),document.addEventListener("mc4wp-refresh",t,!0),window.addEventListener("load",t),t()},2573:(e,t,r)=>{var n=r(7422),a=r(3409),i=function(e,t){this.id=e,this.element=t||document.createElement("form"),this.name=this.element.getAttribute("data-name")||"Form #"+this.id,this.errors=[],this.started=!1};i.prototype.setData=function(e){try{a(this.element,e)}catch(e){console.error(e)}},i.prototype.getData=function(){return n(this.element,{hash:!0,empty:!0})},i.prototype.getSerializedData=function(){return n(this.element,{hash:!1,empty:!0})},i.prototype.setResponse=function(e){this.element.querySelector(".mc4wp-response").innerHTML=e},i.prototype.reset=function(){this.setResponse(""),this.element.querySelector(".mc4wp-form-fields").style.display="",this.element.reset()},e.exports=i},8592:(e,t,r)=>{var n=r(2573),a=[],i={};function o(e,t){i[e]=i[e]||[],i[e].forEach((function(e){return e.apply(null,t)}))}function s(e,t){t=t||parseInt(e.getAttribute("data-id"))||0;var r=new n(t,e);return a.push(r),r}e.exports={get:function(e){e=parseInt(e);for(var t=0;t<a.length;t++)if(a[t].id===e)return a[t];return s(document.querySelector(".mc4wp-form-"+e),e)},getByElement:function(e){for(var t=e.form||e,r=0;r<a.length;r++)if(a[r].element===t)return a[r];return s(t)},on:function(e,t){i[e]=i[e]||[],i[e].push(t)},off:function(e,t){i[e]=i[e]||[],i[e]=i[e].filter((function(e){return e!==t}))},trigger:function(e,t){"submit"===e||e.indexOf(".submit")>0?o(e,t):window.setTimeout((function(){o(e,t)}),1)}}},7422:e=>{var t=/^(?:submit|button|image|reset|file)$/i,r=/^(?:input|select|textarea|keygen)/i,n=/(\[[^\[\]]*\])/g;function a(e,t,r){if(0===t.length)return r;var n=t.shift(),i=n.match(/^\[(.+?)\]$/);if("[]"===n)return e=e||[],Array.isArray(e)?e.push(a(null,t,r)):(e._values=e._values||[],e._values.push(a(null,t,r))),e;if(i){var o=i[1],s=+o;isNaN(s)?(e=e||{})[o]=a(e[o],t,r):(e=e||[])[s]=a(e[s],t,r)}else e[n]=a(e[n],t,r);return e}function i(e,t,r){if(t.match(n))a(e,function(e){var t=[],r=new RegExp(n),a=/^([^\[\]]*)/.exec(e);for(a[1]&&t.push(a[1]);null!==(a=r.exec(e));)t.push(a[1]);return t}(t),r);else{var i=e[t];i?(Array.isArray(i)||(e[t]=[i]),e[t].push(r)):e[t]=r}return e}function o(e,t,r){return r=r.replace(/(\r)?\n/g,"\r\n"),r=(r=encodeURIComponent(r)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+r}e.exports=function(e,n){"object"!=typeof n?n={hash:!!n}:void 0===n.hash&&(n.hash=!0);for(var a=n.hash?{}:"",s=n.serializer||(n.hash?i:o),c=e&&e.elements?e.elements:[],u=Object.create(null),l=0;l<c.length;++l){var f=c[l];if((n.disabled||!f.disabled)&&f.name&&r.test(f.nodeName)&&!t.test(f.type)){var d=f.name,m=f.value;if("checkbox"!==f.type&&"radio"!==f.type||f.checked||(m=void 0),n.empty){if("checkbox"!==f.type||f.checked||(m=""),"radio"===f.type&&(u[f.name]||f.checked?f.checked&&(u[f.name]=!0):u[f.name]=!1),null==m&&"radio"==f.type)continue}else if(!m)continue;if("select-multiple"!==f.type)a=s(a,d,m);else{m=[];for(var p=f.options,h=!1,v=0;v<p.length;++v){var g=p[v],y=n.empty&&!g.value,w=g.value||y;g.selected&&w&&(h=!0,a=n.hash&&"[]"!==d.slice(d.length-2)?s(a,d+"[]",g.value):s(a,d,g.value))}!h&&n.empty&&(a=s(a,d,""))}}}if(n.empty)for(var d in u)u[d]||(a=s(a,d,""));return a}},3409:e=>{e.exports&&(e.exports=function e(t,r,n){for(var a in r)if(r.hasOwnProperty(a)){var i=a,o=r[a];if(void 0===o&&(o=""),null===o&&(o=""),void 0!==n&&(i=n+"["+a+"]"),o.constructor===Array)i+="[]";else if("object"==typeof o){e(t,o,i);continue}var s=t.elements.namedItem(i);if(s)switch(s.type||s[0].type){default:s.value=o;break;case"radio":case"checkbox":for(var c=o.constructor===Array?o:[o],u=0;u<s.length;u++)s[u].checked=c.indexOf(s[u].value)>-1;break;case"select-multiple":c=o.constructor===Array?o:[o];for(var l=0;l<s.options.length;l++)s.options[l].selected=c.indexOf(s.options[l].value)>-1;break;case"select":case"select-one":s.value=o.toString()||o;break;case"date":s.value=new Date(o).toISOString().split("T")[0]}}})}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(()=>{var e=window.mc4wp||{},t=r(8592);function n(e,r){t.trigger(r[0].id+"."+e,r),t.trigger(e,r)}function a(e,t){document.addEventListener(e,(function(e){if(e.target){var r=e.target,n=!1;"string"==typeof r.className&&(n=r.className.indexOf("mc4wp-form")>-1),n||"function"!=typeof r.matches||(n=r.matches(".mc4wp-form *")),n&&t.call(e,e)}}),!0)}if(r(1677),a("submit",(function(e){var r=t.getByElement(e.target);e.defaultPrevented||t.trigger(r.id+".submit",[r,e]),e.defaultPrevented||t.trigger("submit",[r,e])})),a("focus",(function(e){var r=t.getByElement(e.target);r.started||(n("started",[r,e]),r.started=!0)})),a("change",(function(e){n("change",[t.getByElement(e.target),e])})),e.listeners){for(var i=e.listeners,o=0;o<i.length;o++)t.on(i[o].event,i[o].callback);delete e.listeners}e.forms=t,window.mc4wp=e})()})();