var WOF;!function(s){var t=function(){function s(t,a){function i(){r.forEach(function(t){return s.updateFetti(t,p/o,n.decay)}),p+=1,p<o?requestAnimationFrame(i):r.forEach(function(s){s.e.remove()})}void 0===a&&(a={}),this.colors=["#a864fd","#29cdff","#78ff44","#ff718d","#fdff6a"];var n={};jQuery.extend(n,{amt:120,angle:55,spread:295,sv:65,decay:.82},a);for(var r=[],e=0;e<n.amt;e++){var c=Math.round(10*(Math.random()+.5))+"px",h=jQuery("<div>").css({"background-color":this.colors[e%this.colors.length],position:"absolute","z-index":999999999,width:c,height:c});Math.random()>.5&&h.css("border-radius","50%"),r.push({e:h,physics:s.physics(n.angle,n.spread,n.sv,Math.random)}),t.append(h)}var o=200,p=0;requestAnimationFrame(i)}return s.physics=function(s,t,a,i){var n=s*(Math.PI/180),r=t*(Math.PI/180);return{x:0,y:0,w:10*i(),v:.5*a+i()*a,angle2D:-n+(.5*r-i()*r),angle3D:-Math.PI/4+i()*(Math.PI/2),tilt:i()*Math.PI}},s.updateFetti=function(s,t,a){s.physics.x+=Math.cos(s.physics.angle2D)*s.physics.v,s.physics.y+=Math.sin(s.physics.angle2D)*s.physics.v,s.physics.z+=Math.sin(s.physics.angle3D)*s.physics.v,s.physics.w+=.1,s.physics.v*=a,s.physics.y+=3,s.physics.tilt+=.1;var i=s.physics,n=i.x+10*Math.cos(i.w),r=i.y+10*Math.sin(i.w);s.e.css({transform:"translate3d("+n+"px, "+r+"px, 0) rotate3d(1, 1, 1, "+i.tilt+"rad)",opacity:1-t})},s}();s.Fetti=t}(WOF||(WOF={}));
!function(e){var n=function(){function e(){}return e.set=function(e,n,t){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var o="";if(t){var i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3),o=";expires="+i.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(n)+o+";samesite=lax;path=/",!0},e.has=function(e){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},e.remove=function(e){return!!this.has(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",!0)},e}();e.Cookie=n}(WOF||(WOF={}));
!function(t){var e=function(){function e(t,e,i){var s=this;if(this.element=t,this.duration=e,this.period=i,this.wheelId=this.element.data("id"),this.element&&this.element.find(".wof-bar-close").on("click",function(t){t.preventDefault(),s.hide()}),null!==sessionStorage.getItem("wof-cb-"+this.wheelId)){var n=sessionStorage.getItem("wof-cb-"+this.wheelId).split("--");this.show(n[0],parseInt(n[1]))}}return e.prototype.show=function(e,i){if(t.Dispatcher.applyFilter("wof-show-couponbar",!0)){var s=i||(new Date).getTime()/1e3;this.element.find(".wof-bar-code").text(e),sessionStorage.setItem("wof-cb-"+this.wheelId,e+"--"+s),this.startTicking(s),this.element.show()}},e.prototype.hide=function(){sessionStorage.removeItem("wof-cb-"+this.wheelId),this.element.remove(),clearInterval(this.interval)},e.prototype.startTicking=function(t){var e=this,i=".wof-bar-",s=this.element.find(i+"d"),n=this.element.find(i+"h"),o=this.element.find(i+"m"),h=this.element.find(i+"s"),a=t,r=a,d=(new Date).getTime()/1e3;switch(this.period){case"minutes":r=a+60*this.duration;break;case"hours":r=a+3600*this.duration;break;case"days":r=a+86400*this.duration}var l=r-d,f=function(){l--;var t={days:Math.floor(l/86400),hours:Math.floor(l%86400/3600),minutes:Math.floor(l%86400%3600/60),seconds:Math.floor(l%86400%3600%60%60)};s.html(t.days+s.data("text")),n.html(t.hours+n.data("text")),o.html(t.minutes+o.data("text")),h.html(t.seconds+h.data("text")),0==t.days&&s.hide(),0==t.hours&&n.hide(),0==t.minutes&&o.hide(),l<=0&&e.hide()};f(),this.interval=setInterval(function(){f()},1e3)},e}();t.CouponBar=e}(WOF||(WOF={}));
!function(t){var i=function(){function t(){}return t.addFilter=function(t,i){this.f[t]||(this.f[t]=[]),this.f[t].push(i)},t.hasFilter=function(t){return!!this.f[t]},t.applyFilter=function(i,n){if(!t.hasFilter(i))return n;var h=n;return this.f[i].forEach(function(t){h=t(h)}),h},t.subscribe=function(t,i){this.hOP.call(this.t,t)||(this.t[t]=[]),this.t[t].push(i)},t.publish=function(t,i){this.hOP.call(this.t,t)&&this.t[t].forEach(function(t){t(void 0!=i?i:{})})},t.f=[],t.t=[],t.hOP=[].hasOwnProperty,t}();t.Dispatcher=i}(WOF||(WOF={}));
!function(e){var a=function(){function a(){}return a.getFormFieldValues=function(e){var a=[],t=e.find(".wof-input");return jQuery.each(t,function(e,t){var o=jQuery(t),r=o.data("type");"primary_email"!=r&&a.push({id:o.data("field-id"),value:"consent_checkbox"==r?o.is(":checked"):o.val(),type:r})}),a},a.buildForm=function(a){var t=[];return a.length?(a.forEach(function(a){a.options&&"string"==typeof a.options&&(a.options=JSON.parse(a.options)),t.push(e.FormBuilder.createField(a))}),t):[]},a.createField=function(a){a.type=a.type.toLowerCase();var t=jQuery("<div>"),o=null;switch(a.type){case"textarea":o=jQuery("<textarea>");break;case"dropdown":o=jQuery("<select>");break;case"consent_checkbox":o=jQuery('<input type="checkbox">');break;default:o=jQuery('<input type="'+("number"===a.type?"number":"primary_email"===a.type?"email":"text")+'">')}o.attr("placeholder",a.placeholder?a.placeholder:"primary_email"===a.type?"E-mail":"").attr("aria-label",a.placeholder).data("type",a.type).data("fieldId",a.id?a.id:"").attr("data-wof-field",a.id?a.id:"").addClass("wof-input");var r=function(e,a,t){t.data("mask").getRegexMask().test(e)?t.data("mask-validated",!0):t.data("mask-validated",!1)};switch(a.type){case"primary_email":o.attr("name","wof-email");break;case"date_ml":o.wpmask("0000/00/00",{placeholder:a.placeholder,onChange:r});break;case"date":o.wpmask("00/00/0000",{placeholder:a.placeholder+" ("+(a.options.date_format?a.options.date_format:"__/__/____")+")",onChange:r});break;case"birthday":o.wpmask("00/00",{placeholder:a.placeholder+" ("+(a.options.date_format?a.options.date_format:"__/__")+")",onChange:r});break;case"zip":o.wpmask("00000X9999",{placeholder:"",onChange:r,translation:{X:{pattern:/-/,optional:!0}}});break;case"sms":o.wpmask("+# #",{placeholder:a.placeholder+" (+_ _____)",onChange:r});case"phone":a.options.phone_format&&"US"==a.options.phone_format?o.wpmask("(999) 999-9999",{placeholder:"",onChange:r}):o.wpmask("Z0#",{translation:{Z:{pattern:/[\-\+]/,optional:!0}}});break;case"dropdown":a.placeholder&&o.append(jQuery('<option value="">'+a.placeholder+"</option>")),a.options&&a.options.choices&&a.options.choices.forEach(function(e){o.append(jQuery('<option value="'+e+'">'+e+"</option>"))})}return a.required&&o.data("wof-required","primary_email"===a.type||"email"===a.type?"email":"consent_checkbox"===a.type?"checked":"text"),t.append(e.Dispatcher.applyFilter("wof-form-element",o)),"consent_checkbox"===a.type&&(o.attr("id","ckb-"+a.id),t.append('<label class="wof-fgcolor" for="ckb-'+a.id+'">'+a.placeholder+"</label>")),t},a}();e.FormBuilder=a}(WOF||(WOF={}));
!function(e){var n=function(){function n(){this.bars=[],this.init()}return n.prototype.init=function(){var n=this;jQuery(".wof-coupon-bar").each(function(t,o){var i=jQuery(o);n.bars.push(new e.CouponBar(i,i.data("duration"),i.data("timeframe")))}),jQuery(".wof-wheel").each(function(t,o){for(var i=jQuery(o),r=i.data("id"),a=null,t=0;t<n.bars.length;t++)if(n.bars[t].wheelId==r){a=n.bars[t];break}var s=i.data("standalone"),l=new e.Wheel(i,r,i.data("options"),i.data("seq"),s,a);l.widgets=jQuery(".wof-widget[data-id="+l.id+"]"),e.Frontend.wheels.push(l);var c=e.FormBuilder.buildForm(i.data("fields"));jQuery.each(c,function(e,n){l.element.find(".wof-form-fields").append(n)}),l.element.find(".wof-bg").css("height",s?"100%":l.element.find(".wof-wrapper").outerHeight(!0)),l.canShowWidgets()&&l.widgets.show().addClass("wof-visible")}),jQuery(window).resize(function(){e.Frontend.wheels.forEach(function(e){e.standalone||e.element.find(".wof-bg").css("height",e.element.find(".wof-wrapper").outerHeight(!0))})}),this.initFormSubmit(),this.initWheelEvents(),this.initShowWheels(),jQuery(document).trigger("wof:init")},n.prototype.getScrollPercentage=function(){var e=pageYOffset/(jQuery(document).height()-jQuery(window).height());return Math.round(100*e)},n.prototype.initShowWheels=function(){function n(e,n){var o=function(){t.getScrollPercentage()>=n&&(e.show("scroll"),jQuery(window).off("scroll",o))};jQuery(window).on("scroll",o)}var t=this;e.Frontend.wheels.forEach(function(o){if(o.standalone)return void o.show("standalone");if(o.widgets.on("click",function(e){o.show("widget")}),jQuery.inArray("immediately",o.options.appear)>-1&&o.show("immediately"),jQuery.inArray("click",o.options.appear)>-1&&o.options.selector){var i=0===o.options.selector.lastIndexOf("#",0)?"#":".";jQuery("body").on("click",i+o.options.selector.replace(/[#\.]/g,""),function(e){e.preventDefault(),o.show("click")})}if(jQuery.inArray("delay",o.options.appear)>-1&&setTimeout(function(){o.show("delay")},1e3*o.options.delay),jQuery.inArray("exit",o.options.appear)>-1)if(e.Helpers.isDevice("mobile")){var r=0,a=function(){var e=jQuery(this).scrollTop();if(e<r){if(t.getScrollPercentage()<25)return;if(r-e<60)return;o.show("exit-mobile"),jQuery(window).off("scroll",a)}else r=e};jQuery(window).on("scroll",a)}else{var s;document.documentElement.addEventListener("mouseleave",function(e){e.clientY>20||(s=setTimeout(function(){o.show("exit")},100))}),document.documentElement.addEventListener("mouseenter",function(e){s&&clearTimeout(s)})}jQuery.inArray("scroll",o.options.appear)>-1&&n(o,o.options.scroll)})},n.prototype.initWheelEvents=function(){e.Frontend.wheels.forEach(function(e){e.element.on("click",".wof-close",function(n){n.preventDefault(),e.hide()}),e.element.find(".wof-response").on("click",".wof-btn-again",function(n){n.preventDefault(),e.element.find(".wof-spinning").removeClass("wof-spinning").css("animationName","unset").addClass("wof-spinning"),e.element.removeClass("wof-played wof-won"),e.game.start()}),e.element.on("keypress change","input,input[type=checkbox],select",function(e){jQuery(e.currentTarget).removeClass("wof-form-error")})})},n.prototype.initFormSubmit=function(){e.Frontend.wheels.forEach(function(n){n.element.find(".wof-btn-submit").off("click").on("click",function(t){t.preventDefault(),e.Dispatcher.publish("wof-submit-clicked",n);var o=!e.Dispatcher.hasFilter("wof-can-optin")||e.Dispatcher.applyFilter("wof-can-optin",n);if(e.Helpers.validateForm(n)&&o){e.Helpers.triggerLoading(jQuery(t.currentTarget));var i=n.element.find('input[name="wof-email"]').val(),r=e.FormBuilder.getFormFieldValues(n.element);e.Helpers.optIn(n.id,i,n.game.sequence,n.game.sequence,r).then(function(t){if(n.game.mail=i,!1===t.success)return e.Helpers.triggerError(n.element,t.data),void e.Helpers.triggerLoading(n.element.find(".wof-btn-submit"));jQuery(document).trigger("wof:optin",{wheel:n.id,email:i,fields:r}),e.Dispatcher.applyFilter("wof-set-browser-data",!0)&&!n.standalone&&e.Cookie.set("wof-"+n.id,"1",365),n.game.start(t.data,r),e.Dispatcher.publish("wof-after-game-start",n)})}})})},n.wheels=[],n}();e.Frontend=n}(WOF||(WOF={})),jQuery(window).on("load",function(){new WOF.Frontend}),WOF=WOF;
!function(e){var t=function(){function t(e,t,i,n,o,s){void 0===s&&(s=null);var a=this;if(this.game=0,this.audio=null,this.audioContext=null,this.$wheelElement=e,this.wheelId=t,this.sequence=o,this.previousSequence=o,this.maxPlays=i+1,this.status="idle",this.onGameCompleted=s,n){this.audioContext=new(AudioContext||webkitAudioContext);!function(e){fetch(e).then(function(e){return e.arrayBuffer()}).then(function(e){return a.audioContext.decodeAudioData(e)}).then(function(e){a.audio=e}).catch(function(e){return console.error("Error loading audio:",e)})}(wofVars.baseUrl+"public/tick.mp3")}}return t.prototype.start=function(t,i){var n=this;void 0===t&&(t=null),void 0===i&&(i=[]),this.canStartNewGame()&&(this.status="playing",this.game++,t?this.doPlay(t):(e.Helpers.triggerLoading(this.$wheelElement.find(".wof-btn-submit,.wof-btn-again")),e.Helpers.getSegment(this.wheelId,this.sequence,this.previousSequence,this.mail,i).then(function(e){if(!1===e.success)return n.triggerGameError(e.data);n.doPlay(e.data)})))},t.prototype.end=function(t){e.Helpers.setResultText(this.$wheelElement,t),this.status="idle","function"==typeof this.onGameCompleted&&(t.winning||this.game>=this.maxPlays)&&this.onGameCompleted(t)},t.prototype.triggerGameError=function(t){this.status="idle",e.Helpers.triggerError(this.$wheelElement,t),e.Helpers.triggerLoading(this.$wheelElement.find(".wof-btn-submit,.wof-btn-again"))},t.prototype.doPlay=function(e){var t=this;this.previousSequence=this.sequence?this.sequence:e.seq,this.sequence=e.seq,this.doAnimation(e.segment,function(){t.end(e),jQuery(document).trigger("wof:play",{wheel:t.wheelId,email:t.mail,winning:e.winning,segment:e.segment,segment_text:e.text,segment_prize:e.value})})},t.prototype.canStartNewGame=function(){return this.game<=this.maxPlays&&"playing"!==this.status},t.prototype.doAnimation=function(t,i){var n=this,o=this.$wheelElement.data("time"),s=this.$wheelElement.data("speed"),a=this.$wheelElement.data("pointer"),r=1e3*o,u=e.Helpers.getRounds(s,o),h=360/this.$wheelElement.data("slice-count"),l=h/2,d=this.$wheelElement.find(".wof-spinning"),m=this.$wheelElement.find(".wof-pointer"),f={1:{5:150,6:150,7:150,8:150,9:150,10:150,11:150,12:160,13:160,14:160,15:170,16:170,17:170,18:200,19:200,20:200},2:{5:100,6:100,7:100,8:100,9:120,10:120,11:120,12:120,13:120,14:140,15:140,16:140,17:140,18:140,19:140,20:150},3:{5:50,6:50,7:60,8:60,9:60,10:70,11:70,12:80,13:90,14:90,15:90,16:90,17:90,18:110,19:110,20:110},4:{5:30,6:30,7:40,8:40,9:40,10:40,11:40,12:40,13:40,14:50,15:50,16:50,17:60,18:70,19:70,20:70},5:{5:20,6:20,7:20,8:20,9:30,10:30,11:30,12:30,13:40,14:40,15:40,16:40,17:50,18:60,19:60,20:60},6:{5:20,6:20,7:20,8:20,9:20,10:20,11:20,12:20,13:25,14:25,15:25,16:25,17:25,18:25,19:25,20:25}}[s][o];jQuery("#wof-"+this.wheelId+"-anim").remove();var c=(t-1)*h,w="@keyframes wof-spin-"+this.wheelId+"{ from { transform: rotate(0deg); } to { transform: rotate("+(360*(u+1)-c)+"deg); }}";jQuery("head").append('<style id="wof-'+this.wheelId+'-anim">'+w+"</style>");var p,g=d.first(),v=0,y=0,x=performance.now();d.css("animationName","wof-spin-"+this.wheelId).css("animationDuration",r+"ms");var E=function(){var t=performance.now();if(t-x>=r)return void("function"==typeof i&&setTimeout(function(){i()},25));var u=Math.max(1,e.Helpers.getRotationDegrees(g,l));if(u===y)return void requestAnimationFrame(E);var d=e.Helpers.getAnimDelta(u,v);if(d>=h-2.5&&d<200){if(n.audio){var c=n.audioContext.createBufferSource();c.buffer=n.audio,c.connect(n.audioContext.destination),n.audioContext.resume().then(function(){c.start(0)})}a&&(clearTimeout(p),p=setTimeout(function(){m.removeClass("do-nudge")},e.Helpers.calcAnimTimeOut(f,s,o,r,t-x)),m.addClass("do-nudge")),v=Math.round(u/h)*h}y=u,requestAnimationFrame(E)};requestAnimationFrame(E)},t}();e.Game=t}(WOF||(WOF={}));
!function(e){var t=function(){function t(){}return t.validateForm=function(t){var i=t.element.find("input,select"),r=!0;return jQuery.each(i,function(t,i){var a=jQuery(i),n=a.data("fieldId"),o=a.data("wof-required"),s=a.val(),f=!0;switch(o){case"email":-1!==s.indexOf("@")&&-1!==s.indexOf(".")||(f=!1);break;case"text":s.length||(f=!1);break;case"checked":a.is(":checked")||(f=!1)}a.data("mask")&&!1===a.data("mask-validated")&&(f=!1),e.Dispatcher.hasFilter("wof-validate-"+n)&&(f=e.Dispatcher.applyFilter("wof-validate-"+n,{id:n,value:s,$input:a})),f||(r=!1,a.addClass("wof-form-error do-form-nudge"),setTimeout(function(){a.removeClass("do-form-nudge")},300))}),r},t.isDevice=function(e){return jQuery(".wof-"+e+"-check").is(":visible")},t.registerView=function(t){if(wofVars){var i=!0;i=e.Dispatcher.applyFilter("wof-register-view",i),i&&jQuery.post(wofVars.ajaxurl,{action:"wof-register-view",nonce:e.Helpers.nonce(),id:t})}},t.getSegment=function(t,i,r,a,n){var o=e.Dispatcher.applyFilter("wof-play-data",{action:"wof-play",id:t,mail:a,seq:i,pseq:r,nonce:e.Helpers.nonce(),fields:JSON.stringify(n)});return jQuery.post(wofVars.ajaxurl,o).then(function(e){return e})},t.optIn=function(t,i,r,a,n){var o=e.Dispatcher.applyFilter("wof-optin-request-data",{action:"wof-email-optin",id:t,mail:i,seq:r,pseq:a,nonce:e.Helpers.nonce(),fields:JSON.stringify(n)});return jQuery.post(wofVars.ajaxurl,o).then(function(e){return e})},t.setOccurance=function(t,i,r){void 0===r&&(r=null);var a="wof-"+i;if(localStorage.removeItem(a),sessionStorage.removeItem(a),e.Cookie.remove(a),e.Dispatcher.applyFilter("wof-set-browser-data",!0))switch(t){case"session":sessionStorage.setItem(a,"1");break;case"storage":e.Cookie.set(a,"1",500),localStorage.setItem(a,"1");break;case"time":e.Cookie.set(a,"1",r)}},t.nonce=function(){return jQuery("[data-wof-nonce]").data("wof-nonce")},t.triggerError=function(e,t){e.find(".wof-error").html(t).fadeIn("fast"),setTimeout(function(){e.find(".wof-error").fadeOut("fast")},7e3)},t.triggerLoading=function(e){var t=e.find("span");t.is(":visible")?(e.attr("disabled",!0).find(".wof-loader").show(),t.hide()):(t.show(),e.attr("disabled",!1).find(".wof-loader").hide())},t.getAnimDelta=function(e,t){var i=e-t+(e<t?360:0);return i<1&&(i=1),i>360&&(i=360),i},t.calcAnimTimeOut=function(e,t,i,r,a){var n=a/r*100,o=Math.pow(n/100,2),s=0,f=90;return t<3&&i>15?f=70:t<4&&i>12&&(f=80),n>f&&(s=e*o),e+.65*s},t.getRounds=function(e,t){var i=1,r=1;switch(e){case 1:i=.35;break;case 2:i=.55;break;case 3:i=.75;break;case 4:i=.95;break;case 5:i=1.3;break;case 6:i=1.6}t>8&&t<13&&(r=.7),t>13&&t<16&&(r=.6),t>16&&(r=.45);var a=Math.ceil(e*i*(t*r*i));return a<1&&(a=1),a>200&&(a=200),a},t.setResultText=function(t,i){var r=t.find(".wof-right-inner");r.fadeOut(150,function(){var a=".wof-";if(t.find(a+"form-fields").remove(),t.find(a+"title").html(i.title),t.find(a+"explainer").html(i.text),t.find(a+"btn-submit").hide(),t.find(a+"disclaimer").hide(),t.find(a+"fb-checkbox").hide(),3==i.type){var n=e.Dispatcher.applyFilter("wof-redirect-time",800);setTimeout(function(){location.href=e.Dispatcher.applyFilter("wof-redirect-link",i.value)},n)}else if(i.value){var o=jQuery('<input type="text">');4!=i.type&&5!=i.type||(o=jQuery('<div class="wof-winnings">')),4==i.type||5==i.type?o.html(i.value):o.val(i.value),t.find(".wof-form-wrapper").prepend(o)}i.html&&t.find(a+"response").html(i.html),r.fadeIn(150)})},t.getRotationDegrees=function(e,t){void 0===t&&(t=0);var i=e.css("transform");if("none"!==i)var r=i.split("(")[1].split(")")[0].split(","),a=r[0],n=r[1],o=Math.round(Math.atan2(n,a)*(180/Math.PI));else var o=0;return o+=t,o<0&&(o+=360),o>360&&(o-=360),o},t}();e.Helpers=t}(WOF||(WOF={}));
!function(a){var t=function(t,e,n){var s={invalid:[],getCaret:function(){try{var a,e=0,n=t.get(0),r=document.selection,o=n.selectionStart;return r&&-1===navigator.appVersion.indexOf("MSIE 10")?(a=r.createRange(),a.moveStart("character",-s.val().length),e=a.text.length):(o||"0"===o)&&(e=o),e}catch(a){}},setCaret:function(a){try{if(t.is(":focus")){var e,n=t.get(0);n.setSelectionRange?n.setSelectionRange(a,a):(e=n.createTextRange(),e.collapse(!0),e.moveEnd("character",a),e.moveStart("character",a),e.select())}}catch(a){}},events:function(){t.on("keydown.mask",function(a){t.data("mask-keycode",a.keyCode||a.which),t.data("mask-previus-value",t.val()),t.data("mask-previus-caret-pos",s.getCaret()),s.maskDigitPosMapOld=s.maskDigitPosMap}).on(a.jMaskGlobals.useInput?"input.mask":"keyup.mask",s.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){t.keydown().keyup()},100)}).on("change.mask",function(){t.data("changed",!0)}).on("blur.mask",function(){i===s.val()||t.data("changed")||t.trigger("change"),t.data("changed",!1)}).on("blur.mask",function(){i=s.val()}).on("focus.mask",function(t){!0===n.selectOnFocus&&a(t.target).select()}).on("focusout.mask",function(){n.clearIfNotMatch&&!r.test(s.val())&&s.val("")})},getRegexMask:function(){for(var a,t,n,s,r,i,l=[],c=0;c<e.length;c++)a=o.translation[e.charAt(c)],a?(t=a.pattern.toString().replace(/.{1}$|^.{1}/g,""),n=a.optional,s=a.recursive,s?(l.push(e.charAt(c)),r={digit:e.charAt(c),pattern:t}):l.push(n||s?t+"?":t)):l.push(e.charAt(c).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));return i=l.join(""),r&&(i=i.replace(new RegExp("("+r.digit+"(.*"+r.digit+")?)"),"($1)?").replace(new RegExp(r.digit,"g"),r.pattern)),new RegExp(i)},destroyEvents:function(){t.off(["input","keydown","keyup","paste","drop","blur","focusout",""].join(".mask "))},val:function(a){var e,n=t.is("input"),s=n?"val":"text";return arguments.length>0?(t[s]()!==a&&t[s](a),e=t):e=t[s](),e},calculateCaretPosition:function(){var a=t.data("mask-previus-value")||"",e=s.getMasked(),n=s.getCaret();if(a!==e){var r=t.data("mask-previus-caret-pos")||0,o=e.length,i=a.length,l=0,c=0,u=0,k=0,v=0;for(v=n;v<o&&s.maskDigitPosMap[v];v++)c++;for(v=n-1;v>=0&&s.maskDigitPosMap[v];v--)l++;for(v=n-1;v>=0;v--)s.maskDigitPosMap[v]&&u++;for(v=r-1;v>=0;v--)s.maskDigitPosMapOld[v]&&k++;if(n>i)n=10*o;else if(r>=n&&r!==i){if(!s.maskDigitPosMapOld[n]){var h=n;n-=k-u,n-=l,s.maskDigitPosMap[n]&&(n=h)}}else n>r&&(n+=u-k,n+=c)}return n},behaviour:function(e){e=e||event,s.invalid=[];var n=t.data("mask-keycode");if(-1===a.inArray(n,o.byPassKeys)){var r=s.getMasked(),i=s.getCaret();return setTimeout(function(){s.setCaret(s.calculateCaretPosition())},a.jMaskGlobals.keyStrokeCompensation),s.val(r),s.setCaret(i),s.callbacks(e)}},getMasked:function(a,t){var r,i,l=[],c=void 0===t?s.val():t+"",u=0,k=e.length,v=0,h=c.length,p=1,f="push",d=-1,g=0,m=[];n.reverse?(f="unshift",p=-1,r=0,u=k-1,v=h-1,i=function(){return u>-1&&v>-1}):(r=k-1,i=function(){return u<k&&v<h});for(var M;i();){var y=e.charAt(u),b=c.charAt(v),C=o.translation[y];C?(b.match(C.pattern)?(l[f](b),C.recursive&&(-1===d?d=u:u===r&&u!==d&&(u=d-p),r===d&&(u-=p)),u+=p):b===M?(g--,M=void 0):C.optional?(u+=p,v-=p):C.fallback?(l[f](C.fallback),u+=p,v-=p):s.invalid.push({p:v,v:b,e:C.pattern}),v+=p):(a||l[f](y),b===y?(m.push(v),v+=p):(M=y,m.push(v+g),g++),u+=p)}var w=e.charAt(r);k!==h+1||o.translation[w]||l.push(w);var x=l.join("");return s.mapMaskdigitPositions(x,m,h),x},mapMaskdigitPositions:function(a,t,e){var r=n.reverse?a.length-e:0;s.maskDigitPosMap={};for(var o=0;o<t.length;o++)s.maskDigitPosMap[t[o]+r]=1},callbacks:function(a){var r=s.val(),o=r!==i,l=[r,a,t,n],c=function(a,t,e){"function"==typeof n[a]&&t&&n[a].apply(this,e)};c("onChange",!0===o,l),c("onKeyPress",!0===o,l),c("onComplete",r.length===e.length,l),c("onInvalid",s.invalid.length>0,[r,a,t,s.invalid,n])}};t=a(t);var r,o=this,i=s.val();e="function"==typeof e?e(s.val(),void 0,t,n):e,o.mask=e,o.options=n,o.remove=function(){var a=s.getCaret();return o.options.placeholder&&t.removeAttr("placeholder"),t.data("mask-maxlength")&&t.removeAttr("maxlength"),s.destroyEvents(),s.val(o.getCleanVal()),s.setCaret(a),t},o.getCleanVal=function(){return s.getMasked(!0)},o.getMaskedVal=function(a){return s.getMasked(!1,a)},o.getRegexMask=function(){return s.getRegexMask()},o.init=function(i){if(i=i||!1,n=n||{},o.clearIfNotMatch=a.jMaskGlobals.clearIfNotMatch,o.byPassKeys=a.jMaskGlobals.byPassKeys,o.translation=a.extend({},a.jMaskGlobals.translation,n.translation),o=a.extend(!0,{},o,n),r=s.getRegexMask(),i)s.events(),s.val(s.getMasked());else{n.placeholder&&t.attr("placeholder",n.placeholder),t.data("mask")&&t.attr("autocomplete","off");for(var l=0,c=!0;l<e.length;l++){var u=o.translation[e.charAt(l)];if(u&&u.recursive){c=!1;break}}c&&t.attr("maxlength",e.length).data("mask-maxlength",!0),s.destroyEvents(),s.events();var k=s.getCaret();s.val(s.getMasked()),s.setCaret(k)}},o.init(!t.is("input"))};a.maskWatchers={};var e=function(){var e=a(this),s={},r=e.attr("data-mask");if(e.attr("data-mask-reverse")&&(s.reverse=!0),e.attr("data-mask-clearifnotmatch")&&(s.clearIfNotMatch=!0),"true"===e.attr("data-mask-selectonfocus")&&(s.selectOnFocus=!0),n(e,r,s))return e.data("mask",new t(this,r,s))},n=function(t,e,n){n=n||{};var s=a(t).data("mask"),r=JSON.stringify,o=a(t).val()||a(t).text();try{return"function"==typeof e&&(e=e(o)),"object"!=typeof s||r(s.options)!==r(n)||s.mask!==e}catch(a){}};a.fn.wpmask=function(e,s){s=s||{};var r=this.selector,o=a.jMaskGlobals,i=o.watchInterval,l=s.watchInputs||o.watchInputs,c=function(){if(n(this,e,s))return a(this).data("mask",new t(this,e,s))};return a(this).each(c),r&&""!==r&&l&&(clearInterval(a.maskWatchers[r]),a.maskWatchers[r]=setInterval(function(){a(document).find(r).each(c)},i)),this},a.fn.masked=function(a){return this.data("mask").getMaskedVal(a)},a.fn.unmask=function(){return clearInterval(a.maskWatchers[this.selector]),delete a.maskWatchers[this.selector],this.each(function(){var t=a(this).data("mask");t&&t.remove().removeData("mask")})},a.fn.cleanVal=function(){return this.data("mask").getCleanVal()},a.applyDataMask=function(t){t=t||a.jMaskGlobals.maskElements,(t instanceof a?t:a(t)).filter(a.jMaskGlobals.dataMaskAttr).each(e)};var s={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,keyStrokeCompensation:10,useInput:!0,watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};a.jMaskGlobals=a.jMaskGlobals||{},s=a.jMaskGlobals=a.extend(!0,{},s,a.jMaskGlobals),s.dataMask&&a.applyDataMask(),setInterval(function(){a.jMaskGlobals.watchDataMask&&a.applyDataMask()},s.watchInterval)}(jQuery);
!function(e){var t=function(){function t(t,i,s,o,n,a){void 0===n&&(n=!1);var r=this;this.couponBar=null,this.element=t,this.id=i,this.options=s,this.options.appear=s.appear.split(";"),this.status="hidden",this.standalone=n,this.couponBar=a,this.game=new e.Game(t,i,s.plays,s.sound,o,function(i){if(r.standalone||(r.options.retry?e.Helpers.setOccurance(r.options.retryOccurance,r.id,r.options.retryOccuranceData):e.Helpers.setOccurance("storage",r.id)),r.couponBar&&i.winning&&1==i.type&&r.couponBar.show(i.value),r.options.confetti&&i.winning){var s=t.find(".wof-pointer");new e.Fetti(s),setTimeout(function(){new e.Fetti(s,{angle:-90,amt:110,spread:200})},300),setTimeout(function(){new e.Fetti(s,{angle:-30,decay:.86})},600)}r.element.addClass("wof-played"),i.winning&&r.element.addClass("wof-won")})}return t.prototype.canShowWidgets=function(){return"hidden"===this.status&&((!this.options.hideMobile||!e.Helpers.isDevice("mobile"))&&((!this.options.hideTablet||!e.Helpers.isDevice("tablet"))&&((!this.options.hideDesktop||!e.Helpers.isDevice("desktop"))&&(!this.standalone&&this.canShow()))))},t.prototype.show=function(t){"hidden"===this.status&&(this.options.hideMobile&&e.Helpers.isDevice("mobile")&&"click"!==t||this.options.hideDesktop&&e.Helpers.isDevice("desktop")&&"click"!==t||this.options.hideTablet&&e.Helpers.isDevice("tablet")&&"click"!==t||(this.standalone||this.canShow()||"click"===t)&&(this.element.addClass("wof-visible").attr("aria-hidden","false"),this.widgets.removeClass("wof-visible").attr("aria-hidden","true"),this.standalone||(jQuery(".wof-overlay").fadeIn(170),setTimeout(function(){jQuery(document.body).addClass("wof-is-open")},170),"click"!==t&&e.Helpers.setOccurance(this.options.occurance,this.id,this.options.occuranceData)),this.status="visible",e.Helpers.registerView(this.id)))},t.prototype.hide=function(e){void 0===e&&(e=!1),"hidden"!==this.status&&(this.element.attr("aria-hidden","true").removeClass("wof-visible"),this.status="hidden",this.standalone||-1!==jQuery.inArray("click",this.options.appear)||(this.element.remove(),this.status="removed"),this.standalone||jQuery(".wof-wheel.wof-visible").not('[data-standalone="1"]').length||(jQuery(".wof-overlay").fadeOut(170),setTimeout(function(){jQuery(document.body).removeClass("wof-is-open")},170)))},t.prototype.canShow=function(){var t="wof-"+this.id;return!(sessionStorage.getItem(t)||localStorage.getItem(t)||e.Cookie.has(t))},t}();e.Wheel=t}(WOF||(WOF={}));