Changeset 2882364
- Timestamp:
- 03/18/2023 01:55:47 AM (3 years ago)
- Location:
- giveasap/trunk
- Files:
-
- 11 edited
-
admin/giveasap-cpt-metabox.php (modified) (2 diffs)
-
assets/dist/js/admin.js (modified) (1 diff)
-
assets/dist/js/admin.js.map (modified) (1 diff)
-
assets/dist/js/giveasap.js (modified) (1 diff)
-
assets/dist/js/gutenberg.js (modified) (1 diff)
-
assets/js/admin.js (modified) (3 diffs)
-
giveasap.php (modified) (1 diff)
-
includes/abstracts/class-sharer.php (modified) (1 diff)
-
includes/class-menu.php (modified) (2 diffs)
-
includes/giveasap-template-functions.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
giveasap/trunk/admin/giveasap-cpt-metabox.php
r2793238 r2882364 407 407 'desc' => 'Enter the value of the prize (example: $1,000.00)', 408 408 'render' => 'giveasap_prizes_metabox_field', 409 'validate' => 'giveasap_prizes_metabox_field_validate', 409 410 'default' => array(), 410 411 ) 411 412 ); 413 414 function giveasap_prizes_metabox_field_validate( $data ) { 415 416 foreach ( $data as $index => $prize_fields ) { 417 $data[ $index ]['title'] = sanitize_text_field( $prize_fields['title'] ); 418 } 419 420 return $data; 421 } 412 422 413 423 $metabox_prize->add_field( … … 581 591 <?php 582 592 foreach ( $fields as $index => $form_field ) { 583 $title = isset( $form_field['title'] ) ? $form_field['title']: '';593 $title = isset( $form_field['title'] ) ? esc_html( $form_field['title'] ) : ''; 584 594 $value = isset( $form_field['value'] ) ? $form_field['value'] : ''; 585 595 $image = isset( $form_field['image'] ) ? $form_field['image'] : 0; -
giveasap/trunk/assets/dist/js/admin.js
r2878241 r2882364 1 !function(){var e={729:function(e,t,a){var i,n,s;n=[a(311)],i=function(e){var t,a,i,n,s,o,r="Close",d="BeforeClose",l="MarkupParse",c="Open",p="Change",u="mfp",f=".mfp",m="mfp-ready",g="mfp-removing",h="mfp-prevent-close",v=function(){},y=!!window.jQuery,_=e(window),w=function(e,a){t.ev.on(u+e+f,a)},b=function(t,a,i,n){var s=document.createElement("div");return s.className="mfp-"+t,i&&(s.innerHTML=i),n?a&&a.appendChild(s):(s=e(s),a&&s.appendTo(a)),s},x=function(a,i){t.ev.triggerHandler(u+a,i),t.st.callbacks&&(a=a.charAt(0).toLowerCase()+a.slice(1),t.st.callbacks[a]&&t.st.callbacks[a].apply(t,e.isArray(i)?i:[i]))},C=function(a){return a===o&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),o=a),t.currTemplate.closeBtn},k=function(){e.magnificPopup.instance||((t=new v).init(),e.magnificPopup.instance=t)};v.prototype={constructor:v,init:function(){var a=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener,t.isAndroid=/android/gi.test(a),t.isIOS=/iphone|ipad|ipod/gi.test(a),t.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),i=e(document),t.popupsCache={}},open:function(a){var n;if(!1===a.isObj){t.items=a.items.toArray(),t.index=0;var o,r=a.items;for(n=0;n<r.length;n++)if((o=r[n]).parsed&&(o=o.el[0]),o===a.el[0]){t.index=n;break}}else t.items=e.isArray(a.items)?a.items:[a.items],t.index=a.index||0;if(!t.isOpen){t.types=[],s="",a.mainEl&&a.mainEl.length?t.ev=a.mainEl.eq(0):t.ev=i,a.key?(t.popupsCache[a.key]||(t.popupsCache[a.key]={}),t.currTemplate=t.popupsCache[a.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,a),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=b("bg").on("click.mfp",(function(){t.close()})),t.wrap=b("wrap").attr("tabindex",-1).on("click.mfp",(function(e){t._checkIfClose(e.target)&&t.close()})),t.container=b("container",t.wrap)),t.contentContainer=b("content"),t.st.preloader&&(t.preloader=b("preloader",t.container,t.st.tLoading));var d=e.magnificPopup.modules;for(n=0;n<d.length;n++){var p=d[n];p=p.charAt(0).toUpperCase()+p.slice(1),t["init"+p].call(t)}x("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(w(l,(function(e,t,a,i){a.close_replaceWith=C(i.type)})),s+=" mfp-close-btn-in"):t.wrap.append(C())),t.st.alignTop&&(s+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:_.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:i.height(),position:"absolute"}),t.st.enableEscapeKey&&i.on("keyup.mfp",(function(e){27===e.keyCode&&t.close()})),_.on("resize.mfp",(function(){t.updateSize()})),t.st.closeOnContentClick||(s+=" mfp-auto-cursor"),s&&t.wrap.addClass(s);var u=t.wH=_.height(),f={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(f.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):f.overflow="hidden");var h=t.st.mainClass;return t.isIE7&&(h+=" mfp-ie7"),h&&t._addClassToMFP(h),t.updateItemHTML(),x("BuildControls"),e("html").css(f),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout((function(){t.content?(t._addClassToMFP(m),t._setFocus()):t.bgOverlay.addClass(m),i.on("focusin.mfp",t._onFocusIn)}),16),t.isOpen=!0,t.updateSize(u),x(c),a}t.updateItemHTML()},close:function(){t.isOpen&&(x(d),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(g),setTimeout((function(){t._close()}),t.st.removalDelay)):t._close())},_close:function(){x(r);var a="mfp-removing mfp-ready ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(a+=t.st.mainClass+" "),t._removeClassFromMFP(a),t.fixedContentPos){var n={marginRight:""};t.isIE7?e("body, html").css("overflow",""):n.overflow="",e("html").css(n)}i.off("keyup.mfp focusin.mfp"),t.ev.off(f),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t.st.autoFocusLast&&t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,x("AfterClose")},updateSize:function(e){if(t.isIOS){var a=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*a;t.wrap.css("height",i),t.wH=i}else t.wH=e||_.height();t.fixedContentPos||t.wrap.css("height",t.wH),x("Resize")},updateItemHTML:function(){var a=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),a.parsed||(a=t.parseEl(t.index));var i=a.type;if(x("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=a,!t.currTemplate[i]){var s=!!t.st[i]&&t.st[i].markup;x("FirstMarkupParse",s),t.currTemplate[i]=!s||e(s)}n&&n!==a.type&&t.container.removeClass("mfp-"+n+"-holder");var o=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](a,t.currTemplate[i]);t.appendContent(o,i),a.preloaded=!0,x(p,a),n=a.type,t.container.prepend(t.contentContainer),x("AfterChange")},appendContent:function(e,a){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[a]?t.content.find(".mfp-close").length||t.content.append(C()):t.content=e:t.content="",x("BeforeAppend"),t.container.addClass("mfp-"+a+"-holder"),t.contentContainer.append(t.content)},parseEl:function(a){var i,n=t.items[a];if(n.tagName?n={el:e(n)}:(i=n.type,n={data:n,src:n.src}),n.el){for(var s=t.types,o=0;o<s.length;o++)if(n.el.hasClass("mfp-"+s[o])){i=s[o];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=i||t.st.type||"inline",n.index=a,n.parsed=!0,t.items[a]=n,x("ElementParse",n),t.items[a]},addGroup:function(e,a){var i=function(i){i.mfpEl=this,t._openClick(i,e,a)};a||(a={});var n="click.magnificPopup";a.mainEl=e,a.items?(a.isObj=!0,e.off(n).on(n,i)):(a.isObj=!1,a.delegate?e.off(n).on(n,a.delegate,i):(a.items=e,e.off(n).on(n,i)))},_openClick:function(a,i,n){if((void 0!==n.midClick?n.midClick:e.magnificPopup.defaults.midClick)||!(2===a.which||a.ctrlKey||a.metaKey||a.altKey||a.shiftKey)){var s=void 0!==n.disableOn?n.disableOn:e.magnificPopup.defaults.disableOn;if(s)if(e.isFunction(s)){if(!s.call(t))return!0}else if(_.width()<s)return!0;a.type&&(a.preventDefault(),t.isOpen&&a.stopPropagation()),n.el=e(a.mfpEl),n.delegate&&(n.items=i.find(n.delegate)),t.open(n)}},updateStatus:function(e,i){if(t.preloader){a!==e&&t.container.removeClass("mfp-s-"+a),i||"loading"!==e||(i=t.st.tLoading);var n={status:e,text:i};x("UpdateStatus",n),e=n.status,i=n.text,t.preloader.html(i),t.preloader.find("a").on("click",(function(e){e.stopImmediatePropagation()})),t.container.addClass("mfp-s-"+e),a=e}},_checkIfClose:function(a){if(!e(a).hasClass(h)){var i=t.st.closeOnContentClick,n=t.st.closeOnBgClick;if(i&&n)return!0;if(!t.content||e(a).hasClass("mfp-close")||t.preloader&&a===t.preloader[0])return!0;if(a===t.content[0]||e.contains(t.content[0],a)){if(i)return!0}else if(n&&e.contains(document,a))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?i.height():document.body.scrollHeight)>(e||_.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(a){if(a.target!==t.wrap[0]&&!e.contains(t.wrap[0],a.target))return t._setFocus(),!1},_parseMarkup:function(t,a,i){var n;i.data&&(a=e.extend(i.data,a)),x(l,[t,a,i]),e.each(a,(function(a,i){if(void 0===i||!1===i)return!0;if((n=a.split("_")).length>1){var s=t.find(".mfp-"+n[0]);if(s.length>0){var o=n[1];"replaceWith"===o?s[0]!==i[0]&&s.replaceWith(i):"img"===o?s.is("img")?s.attr("src",i):s.replaceWith(e("<img>").attr("src",i).attr("class",s.attr("class"))):s.attr(n[1],i)}}else t.find(".mfp-"+a).html(i)}))},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:v.prototype,modules:[],open:function(t,a){return k(),(t=t?e.extend(!0,{},t):{}).isObj=!0,t.index=a||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,a){a.options&&(e.magnificPopup.defaults[t]=a.options),e.extend(this.proto,a.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},e.fn.magnificPopup=function(a){k();var i=e(this);if("string"==typeof a)if("open"===a){var n,s=y?i.data("magnificPopup"):i[0].magnificPopup,o=parseInt(arguments[1],10)||0;s.items?n=s.items[o]:(n=i,s.delegate&&(n=n.find(s.delegate)),n=n.eq(o)),t._openClick({mfpEl:n},i,s)}else t.isOpen&&t[a].apply(t,Array.prototype.slice.call(arguments,1));else a=e.extend(!0,{},a),y?i.data("magnificPopup",a):i[0].magnificPopup=a,t.addGroup(i,a);return i};var I,T,z,j="inline",E=function(){z&&(T.after(z.addClass(I)).detach(),z=null)};e.magnificPopup.registerModule(j,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(j),w("Close.inline",(function(){E()}))},getInline:function(a,i){if(E(),a.src){var n=t.st.inline,s=e(a.src);if(s.length){var o=s[0].parentNode;o&&o.tagName&&(T||(I=n.hiddenClass,T=b(I),I="mfp-"+I),z=s.after(T).detach().removeClass(I)),t.updateStatus("ready")}else t.updateStatus("error",n.tNotFound),s=e("<div>");return a.inlineElement=s,s}return t.updateStatus("ready"),t._parseMarkup(i,{},a),i}}});var P,S="ajax",O=function(){P&&e(document.body).removeClass(P)},M=function(){O(),t.req&&t.req.abort()};e.magnificPopup.registerModule(S,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(S),P=t.st.ajax.cursor,w("Close.ajax",M),w("BeforeChange.ajax",M)},getAjax:function(a){P&&e(document.body).addClass(P),t.updateStatus("loading");var i=e.extend({url:a.src,success:function(i,n,s){var o={data:i,xhr:s};x("ParseAjax",o),t.appendContent(e(o.data),S),a.finished=!0,O(),t._setFocus(),setTimeout((function(){t.wrap.addClass(m)}),16),t.updateStatus("ready"),x("AjaxContentAdded")},error:function(){O(),a.finished=a.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",a.src))}},t.st.ajax.settings);return t.req=e.ajax(i),""}}});var L,B=function(a){if(a.data&&void 0!==a.data.title)return a.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,a);if(a.el)return a.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var a=t.st.image,i=".image";t.types.push("image"),w("Open.image",(function(){"image"===t.currItem.type&&a.cursor&&e(document.body).addClass(a.cursor)})),w("Close.image",(function(){a.cursor&&e(document.body).removeClass(a.cursor),_.off("resize.mfp")})),w("Resize"+i,t.resizeImage),t.isLowIE&&w("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var a=0;t.isLowIE&&(a=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-a)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,L&&clearInterval(L),e.isCheckingImgSize=!1,x("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var a=0,i=e.img[0],n=function(s){L&&clearInterval(L),L=setInterval((function(){i.naturalWidth>0?t._onImageHasSize(e):(a>200&&clearInterval(L),3==++a?n(10):40===a?n(50):100===a&&n(500))}),s)};n(1)},getImage:function(a,i){var n=0,s=function(){a&&(a.img[0].complete?(a.img.off(".mfploader"),a===t.currItem&&(t._onImageHasSize(a),t.updateStatus("ready")),a.hasSize=!0,a.loaded=!0,x("ImageLoadComplete")):++n<200?setTimeout(s,100):o())},o=function(){a&&(a.img.off(".mfploader"),a===t.currItem&&(t._onImageHasSize(a),t.updateStatus("error",r.tError.replace("%url%",a.src))),a.hasSize=!0,a.loaded=!0,a.loadError=!0)},r=t.st.image,d=i.find(".mfp-img");if(d.length){var l=document.createElement("img");l.className="mfp-img",a.el&&a.el.find("img").length&&(l.alt=a.el.find("img").attr("alt")),a.img=e(l).on("load.mfploader",s).on("error.mfploader",o),l.src=a.src,d.is("img")&&(a.img=a.img.clone()),(l=a.img[0]).naturalWidth>0?a.hasSize=!0:l.width||(a.hasSize=!1)}return t._parseMarkup(i,{title:B(a),img_replaceWith:a.img},a),t.resizeImage(),a.hasSize?(L&&clearInterval(L),a.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",r.tError.replace("%url%",a.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),a.loading=!0,a.hasSize||(a.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(a)),i)}}});var A;e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,a=t.st.zoom,i=".zoom";if(a.enabled&&t.supportsTransition){var n,s,o=a.duration,r=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+a.duration/1e3+"s "+a.easing,n={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},s="transition";return n["-webkit-"+s]=n["-moz-"+s]=n["-o-"+s]=n[s]=i,t.css(n),t},d=function(){t.content.css("visibility","visible")};w("BuildControls"+i,(function(){if(t._allowZoom()){if(clearTimeout(n),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void d();(s=r(e)).css(t._getOffset()),t.wrap.append(s),n=setTimeout((function(){s.css(t._getOffset(!0)),n=setTimeout((function(){d(),setTimeout((function(){s.remove(),e=s=null,x("ZoomAnimationEnded")}),16)}),o)}),16)}})),w("BeforeClose.zoom",(function(){if(t._allowZoom()){if(clearTimeout(n),t.st.removalDelay=o,!e){if(!(e=t._getItemToZoom()))return;s=r(e)}s.css(t._getOffset(!0)),t.wrap.append(s),t.content.css("visibility","hidden"),setTimeout((function(){s.css(t._getOffset())}),16)}})),w("Close.zoom",(function(){t._allowZoom()&&(d(),s&&s.remove(),e=null)}))}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(a){var i,n=(i=a?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem)).offset(),s=parseInt(i.css("padding-top"),10),o=parseInt(i.css("padding-bottom"),10);n.top-=e(window).scrollTop()-s;var r={width:i.width(),height:(y?i.innerHeight():i[0].offsetHeight)-o-s};return void 0===A&&(A=void 0!==document.createElement("p").style.MozTransform),A?r["-moz-transform"]=r.transform="translate("+n.left+"px,"+n.top+"px)":(r.left=n.left,r.top=n.top),r}}});var H="iframe",F=function(e){if(t.currTemplate.iframe){var a=t.currTemplate.iframe.find("iframe");a.length&&(e||(a[0].src="//about:blank"),t.isIE8&&a.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(H,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(H),w("BeforeChange",(function(e,t,a){t!==a&&(t===H?F():a===H&&F(!0))})),w("Close.iframe",(function(){F()}))},getIframe:function(a,i){var n=a.src,s=t.st.iframe;e.each(s.patterns,(function(){if(n.indexOf(this.index)>-1)return this.id&&(n="string"==typeof this.id?n.substr(n.lastIndexOf(this.id)+this.id.length,n.length):this.id.call(this,n)),n=this.src.replace("%id%",n),!1}));var o={};return s.srcAction&&(o[s.srcAction]=n),t._parseMarkup(i,o,a),t.updateStatus("ready"),i}}});var D=function(e){var a=t.items.length;return e>a-1?e-a:e<0?a+e:e},N=function(e,t,a){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,a)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var a=t.st.gallery,n=".mfp-gallery";if(t.direction=!0,!a||!a.enabled)return!1;s+=" mfp-gallery",w(c+n,(function(){a.navigateByImgClick&&t.wrap.on("click"+n,".mfp-img",(function(){if(t.items.length>1)return t.next(),!1})),i.on("keydown"+n,(function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()}))})),w("UpdateStatus"+n,(function(e,a){a.text&&(a.text=N(a.text,t.currItem.index,t.items.length))})),w(l+n,(function(e,i,n,s){var o=t.items.length;n.counter=o>1?N(a.tCounter,s.index,o):""})),w("BuildControls"+n,(function(){if(t.items.length>1&&a.arrows&&!t.arrowLeft){var i=a.arrowMarkup,n=t.arrowLeft=e(i.replace(/%title%/gi,a.tPrev).replace(/%dir%/gi,"left")).addClass(h),s=t.arrowRight=e(i.replace(/%title%/gi,a.tNext).replace(/%dir%/gi,"right")).addClass(h);n.click((function(){t.prev()})),s.click((function(){t.next()})),t.container.append(n.add(s))}})),w(p+n,(function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout((function(){t.preloadNearbyImages(),t._preloadTimeout=null}),16)})),w(r+n,(function(){i.off(n),t.wrap.off("click"+n),t.arrowRight=t.arrowLeft=null}))},next:function(){t.direction=!0,t.index=D(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=D(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,a=t.st.gallery.preload,i=Math.min(a[0],t.items.length),n=Math.min(a[1],t.items.length);for(e=1;e<=(t.direction?n:i);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?i:n);e++)t._preloadItem(t.index-e)},_preloadItem:function(a){if(a=D(a),!t.items[a].preloaded){var i=t.items[a];i.parsed||(i=t.parseEl(a)),x("LazyLoad",i),"image"===i.type&&(i.img=e('<img class="mfp-img" />').on("load.mfploader",(function(){i.hasSize=!0})).on("error.mfploader",(function(){i.hasSize=!0,i.loadError=!0,x("LazyLoadError",i)})).attr("src",i.src)),i.preloaded=!0}}}});var W="retina";e.magnificPopup.registerModule(W,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,(function(e){return"@2x"+e}))},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,a=e.ratio;(a=isNaN(a)?a():a)>1&&(w("ImageHasSize.retina",(function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/a,width:"100%"})})),w("ElementParse.retina",(function(t,i){i.src=e.replaceSrc(i,a)})))}}}}),k()},void 0===(s=i.apply(t,n))||(e.exports=s)},951:function(e){function t(e){document.addEventListener("mouseover",(function(a){var i=a.target,n=e(i);n||(n=(i=i.parentElement)&&e(i)),n&&t.show(i,n,!0)}))}t.show=function(e,a,i){var n="data-tlite";a=a||{},(e.tooltip||function(e,a){var s,o,r;function d(){t.hide(e,!0)}function l(){s||(s=function(e,t,a){var i=document.createElement("span"),n=a.grav||e.getAttribute("data-tlite")||"n";i.innerHTML=t,e.appendChild(i);var s=n[0]||"",o=n[1]||"";function r(){i.className="tlite tlite-"+s+o;var t=e.offsetTop,a=e.offsetLeft;i.offsetParent===e&&(t=a=0);var n=e.offsetWidth,r=e.offsetHeight,d=i.offsetHeight,l=i.offsetWidth,c=a+n/2;i.style.top=("s"===s?t-d-10:"n"===s?t+r+10:t+r/2-d/2)+"px",i.style.left=("w"===o?a:"e"===o?a+n-l:"w"===s?a+n+10:"e"===s?a-l-10:c-l/2)+"px"}r();var d=i.getBoundingClientRect();return"s"===s&&d.top<0?(s="n",r()):"n"===s&&d.bottom>window.innerHeight?(s="s",r()):"e"===s&&d.left<0?(s="w",r()):"w"===s&&d.right>window.innerWidth&&(s="e",r()),i.className+=" tlite-visible",i}(e,r,a))}return e.addEventListener("mousedown",d),e.addEventListener("mouseleave",d),e.tooltip={show:function(){r=e.title||e.getAttribute(n)||r,e.title="",e.setAttribute(n,""),r&&!o&&(o=setTimeout(l,i?150:1))},hide:function(e){if(i===e){o=clearTimeout(o);var t=s&&s.parentNode;t&&t.removeChild(s),s=void 0}}}}(e,a)).show()},t.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},e.exports&&(e.exports=t)},311:function(e){"use strict";e.exports=jQuery}},t={};function a(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,a),s.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e,t=a(951),i=a.n(t);function n(e,t){var a;a=e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url;var i='<li tabindex="0" role="checkbox" aria-label="'+e.title+'" aria-checked="true" data-id="'+e.id+'" class="attachment save-ready selected details">';return i+='<div class="attachment-preview js--select-attachment type-image subtype-jpeg portrait">',i+='<div class="thumbnail">',i+='<div class="centered">',i+='<img src="'+a+'" draggable="false" alt="">',i+="</div>",i+="</div>",i+="</div>",(i+='<button type="button" data-gallery="#'+t+'" class="button-link check remove-sortable-wordpress-gallery-image" tabindex="0"><span class="media-modal-icon"></span><span class="screen-reader-text">Deselect</span></button>')+"</li>"}a(729),(e=jQuery)(document).ready((function(){e(document.body).on("click","#notify",(function(t){if(e("#sg_allow_awarding").length&&e("#sg_allow_awarding").prop("checked")&&e(".sg-select-prizes-manual").length&&e(".sg-prizes-field-container ").length&&e(".sg-prizes-field-container ").children().length){var a=e(".sg-select-prizes-manual"),i=!0;a.each((function(){e(this).find("select").val().length||(i=!1)})),i||(t.preventDefault(),alert("Some users don't have their prizes selected! Please make sure all have their prizes selected, save the giveaway and click again to notify."))}})),i()((e=>e.classList.contains("sg-tooltip"))),e("#sgToggleAwardPrizes").on("click",(function(t){t.preventDefault();var a=e(this),i=a.attr("data-target"),n=a.attr("data-class");e(i).toggleClass(n),e(i).hasClass(n)?e("#sg_awarding_prizes_manually").removeAttr("checked"):e("#sg_awarding_prizes_manually").attr("checked","checked")})),e(".sg-toggle").on("click",(function(t){t.preventDefault();var a=e(this),i=a.attr("data-target"),n=a.attr("data-class"),s=a.attr("data-text");if(e(i).toggleClass(n),s){var o=a.text();a.attr("data-text",o),a.html(s)}})),e("#sg_giveaway_add_subscriber").length&&e("#sg_giveaway_add_subscriber").on("change",(function(){e.ajax({url:gasap.ajax_url,dataType:"json",type:"GET",data:{action:"sg_get_giveaway_form_fields",giveaway:e(this).val(),nonce:gasap.nonce},success:function(t){t.success&&e("#sgGiveawayFields").html(t.data)}})}));var t=e(".add-sortable-wordpress-gallery");function a(){var t=0;e(".giveaway-sharing-methods").children().each((function(){var a=parseInt(e(this).attr("data-index"));if(a!==t){var i=e(this).html(),n=new RegExp("giveasap_methods\\["+a+"\\]","g"),s=i.replace(n,"giveasap_methods["+t+"]");e(this).html(s),e(this).attr("data-index",t)}t++}))}function s(){var t=0;e(".sg-form-fields-container").children().each((function(){var a=parseInt(e(this).attr("data-index"));if(a!==t){var i=e(this).html(),n=new RegExp("form_fields\\["+a+"\\]","g"),s=i.replace(n,"form_fields["+t+"]");e(this).html(s),e(this).attr("data-index",t)}t++}))}function o(){var t=0;e(".sg-prizes-field-container").children().each((function(){var a=parseInt(e(this).attr("data-index"));if(a!==t){var i=e(this).html(),n=new RegExp("form_fields\\["+a+"\\]","g"),s=i.replace(n,"form_fields["+t+"]");e(this).html(s),e(this).attr("data-index",t)}t++}))}function r(){var t=e("#giveasap_type").val();e(".sg-metaboxes .hide_if_any").hide(),e(".sg-metaboxes .show_if_any").show(),e(".hide_if_"+t).hide(),e(".show_if_"+t).show(),e(document.body).triggerHandler("sg_giveaway_type_changed",[t])}function d(){var t=0;e(".sg-extra-actions").children().each((function(){var a=parseInt(e(this).attr("data-index"));if(a!==t){var i=e(this).html(),n=new RegExp("entries_actions\\["+a+"\\]","g"),s=i.replace(n,"entries_actions["+t+"]");e(this).html(s),e(this).attr("data-index",t)}t++}))}function l(){e(document).find(".sg-select-specific-mandatory-actions").each((function(){var t=e(this),a=t.parents(".sg-admin-form"),i=t.parents(".sg-form-field"),n=i.attr("data-value"),s=i.attr("data-name"),o=a.find(".sg-action-form-instance").val(),r=[];if(n&&(n=n.split(",")),window.giveasap_actions&&window.giveasap_actions.length)for(var d=0;d<window.giveasap_actions.length;d++){var l=window.giveasap_actions[d].instance;if(parseInt(o)!==parseInt(l)){var c=n&&n.indexOf(l)>=0;r.push({id:l,text:window.giveasap_actions[d].title,selected:c})}}if(r.length){for(var p="",u=0;u<r.length;u++){var f=r[u],m="";f.selected&&(m='checked="checked"'),p+='<label for="'+o+"_specific_action_"+u+'">',p+='<input class="mandatory-specific-action-checkbox" '+m+' id="'+o+"_specific_action_"+u+'" type="checkbox" name="'+s+'" value="'+f.id+'"/>',p+=f.text,p+="</label>"}t.html(p),i.removeClass("hidden")}else i.addClass("hidden")}))}function c(t){switch(t){case"default":e(".sg-prizes-field-container .sg-form-field").each((function(){var t=e(this);t.find(".sg-prize-field-winner").removeClass("hidden"),t.find(".sg-prize-field-chance").addClass("hidden"),t.find(".sg-prize-field-quantity").addClass("hidden")}));break;case"random":e(".sg-prizes-field-container .sg-form-field").each((function(){var t=e(this);t.find(".sg-prize-field-winner").addClass("hidden"),t.find(".sg-prize-field-chance").removeClass("hidden"),t.find(".sg-prize-field-quantity").removeClass("hidden")}))}e(document.body).triggerHandler("sg_toggle_multiple_prizes_fields",[t])}e(document).on("click",".remove-sortable-wordpress-gallery-image",(function(t){t.preventDefault();var a=e(this),i=a.parent().attr("data-id"),n=a.attr("data-gallery"),s=e(n+"_input"),o=s.val().split(","),r=o.indexOf(i);r>=0&&(o.splice(r,1),s.val(o.join())),a.parent().remove()})),t.each((function(){var t=e(this).attr("data-gallery"),a=e(t),i=e(t+"_input");a.sortable(),a.on("sortupdate",(function(t,n){var s=[];a.children("li").each((function(){s.push(e(this).attr("data-id"))})),i.val(s.join())})),e(this).on("click",(function(){var e,t,s;e=a,t=i,void 0===s?((s=wp.media({multiple:!0})).on("open",(function(){var e=s.state().get("selection");t.val().split(",").forEach((function(t){var a=wp.media.attachment(t);a.fetch(),e.add(a?[a]:[])}))})),s.on("select",(function(){var a=s.state().get("selection").toJSON(),i=[];e.empty();for(var o=e.attr("id"),r=0;r<a.length;r++)"image"==a[r].type&&(i.push(a[r].id),e.append(n(a[r],o)));t.val(i.join())})),s.open()):s.open()}))})),e(document).on("click",".add-single-wordpress-image",(function(t){t.preventDefault();var a,i,s,o=e(this).attr("data-gallery"),r=e(o),d=e(o+"_input");a=r,i=d,void 0===s?((s=wp.media({multiple:!1})).on("open",(function(){var e=s.state().get("selection");i.val().split(",").forEach((function(t){var a=wp.media.attachment(t);a.fetch(),e.add(a?[a]:[])}))})),s.on("select",(function(){var e=s.state().get("selection").toJSON(),t=[];a.empty(),console.log(a);for(var o=a.attr("id"),r=0;r<e.length;r++)"image"==e[r].type&&(t.push(e[r].id),a.append(n(e[r],o)));i.val(t.join())})),s.open()):s.open()})),e(document).on("change","#giveasap_end_date, #giveasap_end_time",(function(){var t=e("#giveasap_end_time").val(),a=e("#giveasap_end_date").val().split("-").reverse().join("-"),i=e("#giveasap_winner_time").val(),n=e("#giveasap_winner_date").val().split("-").reverse().join("-");Date.parse(a+"T"+t)>Date.parse(n+"T"+i)&&(e("#giveasap_winner_date").val(e("#giveasap_end_date").val()),e("#giveasap_winner_time").val(e("#giveasap_end_time").val()))})),e(document).on("change","#giveasap_winner_time, #giveasap_winner_date",(function(){var t=e("#giveasap_end_time").val(),a=e("#giveasap_end_date").val().split("-").reverse().join("-"),i=e("#giveasap_winner_time").val(),n=e("#giveasap_winner_date").val().split("-").reverse().join("-");Date.parse(a+"T"+t)>Date.parse(n+"T"+i)&&alert(gasap.text.winner_before_end)})),e("#giveasap_expand_users").on("click",(function(){e("#giveasap_users_container").toggleClass("hidden")})),e("#date_format").on("change",(function(){$format=e(this).val().replace("d","dd").replace("j","d").replace("Y","yy").replace("m","mm"),e(".datepicker").datepicker("option",{altFormat:$format})})),e(document).on("click",".button-integration-deactivate",(function(t){t.preventDefault();var a=e(this).attr("data-integration"),i=e(this);a&&e.ajax({url:gasap.ajax_url,dataType:"json",type:"POST",data:{action:"giveasap_deactivate_integration",integration:a,nonce:gasap.nonce},success:function(e){e.success&&i.removeClass("button-integration-deactivate").removeClass("button-default").addClass("button-integration-activate").addClass("button-primary").html(gasap.text.activate)}})})),e(document).on("click",".button-integration-activate",(function(t){t.preventDefault();var a=e(this).attr("data-integration"),i=e(this);a&&e.ajax({url:gasap.ajax_url,dataType:"json",type:"POST",data:{action:"giveasap_activate_integration",integration:a,nonce:gasap.nonce},success:function(e){e.success&&i.addClass("button-integration-deactivate").addClass("button-default").removeClass("button-integration-activate").removeClass("button-primary").html(gasap.text.deactivate)}})})),e(document).on("click",".ga-search-email",(function(t){t.preventDefault();for(var a=e(this).parent().find("input"),i=window.location.href.split("?"),n=i[1].split("&"),s={},o=0;o<n.length;o++){var r=n[o].split("=");s[r[0]]=r[1]}a.each((function(){var t=e(this).attr("name"),a=e(this).val();a?s[t]=a:delete s[t]}));var d=[];for(var l in s)d.push(l+"="+s[l]);var c=i[0]+"?"+d.join("&");window.location.href=c})),e(document).on("click",".sg-metaboxes li.sg-metabox a",(function(t){t.preventDefault(),e(".sg-metabox-fields").addClass("hidden"),e(".sg-metaboxes li.active").removeClass("active");var a=e(this).attr("href");e(a).removeClass("hidden"),e(this).parent().addClass("active"),e(a).find(".wp-editor-wrap").each((function(){var t=e(this).find("iframe");t.height()<200&&t.height(200)})),e(a).find(".sg-code-editor")&&function(){var e=jQuery;e(".sg-code-editor").length&&e(".sg-code-editor").each((function(){var t=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{},a=e(this).attr("data-mode");void 0===a&&(a=!1),t.codemirror=_.extend({},t.codemirror,{indentUnit:2,tabSize:2}),a&&(t.codemirror.mode=a),wp.codeEditor.initialize(e(this),t)}))}()})),e(document).on("change",".sg-admin-form.sg-action-form :input",(function(){var t=e(this).parents(".sg-admin-form");if(!e(this)[0].checkValidity()){var a=e(this)[0].validationMessage,i=t.find(".error");e(this).focus(),i.length?i.find("p").html(a):t.prepend('<div class="notice error"><p>'+a+"</p></div>"),setTimeout((function(){t.find(".error").fadeOut().remove()}),5e3)}})),e(".sg-image-popup-link").magnificPopup({type:"image"}),e("#addShareMethod").on("click",(function(t){t.preventDefault();var a=wp.template("sharing-method"),i=e(".giveaway-sharing-methods").children().length,n=a({index:i,title:"New Method"});e(".giveaway-sharing-methods").append(n),e(".giveaway-sharing-methods").children().eq(i).find(".method-select").trigger("change")})),e(".giveaway-sharing-methods").sortable({update:function(e,t){a()}}),e(document).on("click",".giveaway-sharing-method .method-header",(function(){e(this).parent().toggleClass("active")})),e(document).on("click",".giveaway-sharing-method .button-delete",(function(){e(this).parents(".giveaway-sharing-method").remove(),a()})),e(document).on("change",".giveaway-sharing-method .method-select",(function(){if("custom"===e(this).val()){var t=wp.template("sharing-method-custom")({index:(a=e(this).parents(".giveaway-sharing-method")).attr("data-index"),url:"",title:a.attr("data-title"),attributes:{url:"",text:"",image:""}});a.find(".giveasap-method-html").html(t),a.find(".color-picker").wpColorPicker()}else{var a;(a=e(this).parents(".giveaway-sharing-method")).find(".giveasap-method-html").html("")}})),e(document).on("keyup",".giveaway-sharing-method .method-title",(function(){e(this).parents(".giveaway-sharing-method").find(".method-header strong").html(e(this).val())})),e(".giveaway-sharing-methods").length&&e(".giveaway-sharing-methods .color-picker").wpColorPicker(),e(document.body).on("change",".sg-field-type",(function(t){var a=e(this).val(),i=e(this),n=i.parent();if("radio"===a||"select"===a){if(0===n.find(".sg-form-field-options").length){var s=i.parents(".sg-form-field").attr("data-index"),o=wp.template("sg-form-field-options")({index:s});n.append(o)}}else{var r=n.find(".sg-form-field-options");r.length&&r.remove()}})),e(document.body).on("click",".sg-remove-form-field-option",(function(t){e(this).parent().remove()})),e(document.body).on("click",".sg-add-form-field-option",(function(t){t.preventDefault();var a=e(this).parents(".sg-form-field").attr("data-index"),i=wp.template("sg-form-field-option")({index:a});e(this).parent().find(".sg-form-field-options-container").append(i)})),e(".sg-form-fields-container").sortable({placeholder:"ui-state-highlight",handle:".sg-form-row-handle",update:function(e,t){s()}}),e("#sgAddFormField").on("click",(function(){var t=wp.template("sg-form-field")({index:e(".sg-form-fields-container").children().length});e(".sg-form-fields-container").append(t)})),e(document.body).on("click",".sg-delete-form-field",(function(){e(this).parents(".sg-form-field").remove(),s()})),e(document.body).on("click",".sg-form-field-header .sg-field-name",(function(){e(this).parents(".sg-form-field").toggleClass("open")})),e(document.body).on("keyup",".sg-form-field-body .sg-field-name input",(function(){var t=e(this).val();e(this).parents(".sg-form-field").find(".sg-form-field-header .sg-field-name").html(t)})),e("#sgAddPrizesField").on("click",(function(){var t=wp.template("sg-prizes-field")({index:e(".sg-prizes-field-container").children().length});e(".sg-prizes-field-container").append(t);var a=e(".sg-prizes-field-container .sg-form-field").last();a.toggleClass("open"),a.find(".sg-field-name input").focus(),r(),e(document.body).triggerHandler("sg_prizes_field_added")})),e(document.body).on("click",".sg-delete-prizes-field",(function(){e(this).parents(".sg-form-field").remove(),o()})),e(".sg-prizes-field-container").sortable({placeholder:"ui-state-highlight",handle:".sg-form-row-handle",update:function(e,t){o()}}),e("#sg-metaboxes").length&&(r(),e("#giveasap_type").on("change",r)),e(document).on("click",".sg-button-action",(function(t){t.preventDefault();var a=e(this),i=a.attr("data-ajax")||"",n=a.attr("data-reload")||"0",s=a.attr("data-callback")||"",o=a.attr("data-nonce")||"",r=a.attr("data-text"),d=a.text(),l=a.attr("href");if(r&&a.text(r),i){var c={action:i};if(o&&(c.nonce=gasap.nonce),this.attributes.length)for(var p=0;p<this.attributes.length;p++){var u=this.attributes[p];c[u.nodeName.replace("-","_")]=u.nodeValue}e.ajax({url:gasap.ajax_url,dataType:"json",data:c,success:function(e){if(s){var t=window[s];"function"==typeof t&&t(a,e)}r&&"1"!==n&&a.text(d),"1"===n&&(l?window.location.href=l:location.reload(!1))}})}else{if(s){var f=window[s];"function"==typeof f&&f(a)}r&&"1"!==n&&a.text(d),"1"===n&&(l?window.location.href=l:location.reload(!1))}})),e(".sg-action-category-title").on("click",(function(t){e(this).parent().toggleClass("active")})),e(".sg-action").on("click",(function(t){var a=e("#sgEntriesActions"),i=a.children().length,n=e(this).attr("data-slug"),s=wp.template(n);if(e("#tmpl-"+n).length){t.preventDefault(),a.append(s({index:i})),e(document.body).trigger("sg-enhanced-select-search-init"),e(document.body).trigger("sg-color-picker-init");var o=a.children().last();o.find(".sg-admin-action-title").trigger("click"),window.giveasap_max_instance_id=window.giveasap_max_instance_id+1,o.find(".sg-action-form-instance").val(window.giveasap_max_instance_id),e([document.documentElement,document.body]).animate({scrollTop:a.children().last().offset().top-24},500)}})),e(".sg-extra-actions").sortable({update:function(e,t){d(),l()}}),e(document).on("click",".sg-admin-action-remove",(function(t){t.preventDefault(),e(this).parents(".sg-admin-action").remove(),d(),l()})),e(document).on("click",".sg-admin-action-title",(function(t){t.preventDefault(),e(this).parent().toggleClass("active")})),e(document).on("click",".sg-multioption-button",(function(t){t.preventDefault();var a=e(this).attr("data-id"),i=e(this).attr("data-name"),n=e(this).attr("data-template"),s=e("#"+a).children().length,o=wp.template(n)({index:s,id:a,name:i});e("#"+a).append(o)})),e(document).on("click",".sg-multioption-delete",(function(t){t.preventDefault(),e(this).parent().remove()})),e(document).on("keyup",".sg-form-field-title input",(function(){var t,a;t=e(this).parents(".sg-admin-form").find(".sg-action-form-instance").val(),a=e(this).val(),window.giveasap_actions.map((function(e){return parseInt(e.instance)})).indexOf(parseInt(t))>=0?window.giveasap_actions=window.giveasap_actions.map((function(e){return parseInt(e.instance)!==parseInt(t)||(e.title=a),e})):window.giveasap_actions.push({instance:t,title:a}),l()})),e(document).on("change",".mandatory-specific-action-checkbox",(function(){var t=e(this).parents(".sg-admin-form"),a=e(this).parents(".sg-form-field"),i=a.attr("data-value"),n=(t.find(".sg-action-form-instance").val(),e(this).val());if(i=i.split(","),e(this).prop("checked")&&i.indexOf(n)<0&&i.push(n),!e(this).prop("checked")&&i.indexOf(n)>=0){var s=i.indexOf(n);s>-1&&i.splice(s,1)}a.attr("data-value",i.join(","))})),l(),e(document).find(".sg-select2:not(.enhanced)").each((function(){if(!e(this).parents(".sg-report-options").length){var t=e(this);e(this).select2({placeholder:t.attr("placeholder")||"",minimumInputLength:t.attr("data-mininput")||3,ajax:{url:gasap.ajax_url,dataType:"json",data:function(e){return{search:e.term,type:"public",action:t.attr("data-action")||"sg_get_giveaways"}},processResults:function(e){if(e.success){var t=[];for(var a in e.data)t.push({id:e.data[a].ID,text:e.data[a].post_title});return{results:t}}return{results:e.items}}}}).addClass("enhanced")}})),e(document.body).on("sg_giveaway_type_changed",(function(t,a){"instant"===a&&e("#sg-metabox-fields-giveasap_prize #type").val("random"),c(e("#sg-metabox-fields-giveasap_prize #type").val())})),e(document.body).on("sg_prizes_field_added",(function(){c(e("#sg-metabox-fields-giveasap_prize #type").val())})),e("#sg-metabox-fields-giveasap_prize").length&&c(e("#sg-metabox-fields-giveasap_prize #type").val()),e(document.body).on("change","#sg-metabox-fields-giveasap_prize #type",(function(t){c(e(this).val())})),e("#ga_aweber_disconnect").on("click",(function(){e(this),e(this).parent(),e.ajax({url:gasap.ajax_url,dataType:"json",type:"POST",data:{action:"giveasap_disconnect_ga_aweber",nonce:gasap.nonce},success:function(t){t.success&&(e(".ga-aweber-disconnect").addClass("hidden"),e(".ga-aweber-connect").removeClass("hidden"))}})})),e(document).on("click",".giveasap-edit-user",(function(){var t=e(this).parent();t.find(".giveasap-edit-user").addClass("hidden"),t.find(".giveasap-edit-user-input").attr("type","number"),t.find(".giveasap-edit-user-save").removeClass("hidden"),t.find(".giveasap-user-entries").addClass("hidden"),t.find(".giveasap-edit-user-cancel").removeClass("hidden"),t.find(".giveasap-edit-user-alert").remove()})),e(document).on("click",".giveasap-edit-user-save",(function(){var t=e(this),a=t.parent(),i=a.find(".giveasap-edit-user-input").attr("data-id"),n=a.find(".giveasap-edit-user-input").val();a.find(".giveasap-edit-user-alert").remove(),t.html(gasap.text.saving),e.ajax({url:gasap.ajax_url,dataType:"json",type:"POST",data:{action:"giveasap_edit_user_entry",user_id:i,nonce:gasap.nonce,entries:n},success:function(e){if(e.success)t.html(gasap.text.save),a.find(".giveasap-edit-user-input").val(e.data.entries),a.find(".giveasap-user-entries").html(e.data.entries),a.find(".giveasap-edit-user").removeClass("hidden"),a.find(".giveasap-edit-user-input").attr("type","hidden"),a.find(".giveasap-edit-user-save").addClass("hidden"),a.find(".giveasap-user-entries").removeClass("hidden"),a.find(".giveasap-edit-user-cancel").addClass("hidden");else{var i='<p class="giveasap-edit-user-alert">'+e.data.message+"</p>";a.append(i)}}})})),e(document).on("click",".giveasap-edit-user-cancel",(function(){var t=e(this).parent();t.find(".giveasap-edit-user-alert").remove(),t.find(".giveasap-edit-user").removeClass("hidden"),t.find(".giveasap-edit-user-input").attr("type","hidden"),t.find(".giveasap-edit-user-save").addClass("hidden"),t.find(".giveasap-user-entries").removeClass("hidden"),t.find(".giveasap-edit-user-cancel").addClass("hidden")})),e(document).on("click",".giveasap-edit-user-email",(function(t){t.preventDefault();var a=e(this).parents("tr");a.find(".sg-premium-subscriber-email-text").addClass("hidden"),a.find(".sg-premium-subscriber-email-input").removeClass("hidden")})),e(document).on("click",".giveasap-edit-user-email-cancel",(function(t){t.preventDefault();var a=e(this).parents("tr");a.find(".sg-premium-subscriber-email-text").removeClass("hidden"),a.find(".sg-premium-subscriber-email-input").addClass("hidden")})),e(document).on("click",".giveasap-edit-user-email-save",(function(){var t=e(this),a=t.parents("td"),i=a.find(".giveasap-edit-user-email-input").attr("data-id"),n=a.find(".giveasap-edit-user-email-input").val();a.find(".giveasap-edit-user-alert").remove(),t.html(gasap.text.saving),e.ajax({url:gasap.ajax_url,dataType:"json",type:"POST",data:{action:"giveasap_edit_user_email",user_id:i,nonce:gasap.nonce,email:n},success:function(e){if(e.success)t.html(gasap.text.save),a.find(".sg-premium-subscriber-email-text").removeClass("hidden"),a.find(".sg-premium-subscriber-email-input").addClass("hidden"),a.find(".sg-premium-subscriber-email-text strong").html(n);else{var i='<p class="giveasap-edit-user-alert">'+e.data.message+"</p>";a.append(i)}}})})),window.sg_replace_form_fields=function(e,t){t.success&&e.parents("tr").html(t.data.fields_html)},e(document).on("change","[name=mailchimp_list], #ga_mailchimp [name=list]",(function(){console.log(e(this).val());var t=e(this).val(),a=e(this),i=a.attr("name");a.parents("td").addClass("sg-loading"),e(".mailchimp-groups").html(""),e(".mailchimp-group-options").html(""),e.ajax({url:gasap.ajax_url,dataType:"json",type:"GET",data:{action:"sg_mailchimp_get_groups",nonce:gasap.nonce,list:t,name:i},success:function(t){t.success&&e(".mailchimp-groups").html(t.data.html)},complete:function(){a.parents("td").removeClass("sg-loading")}})})),e(document).on("change",".mailchimp-groups select",(function(){console.log(e(this).val());var t=e(this).val(),a=e(".mailchimp-list").val(),i=e(this),n=i.attr("name");i.parents("td").addClass("sg-loading"),e(".mailchimp-group-options").html(""),e.ajax({url:gasap.ajax_url,dataType:"json",type:"GET",data:{action:"sg_mailchimp_get_group_options",nonce:gasap.nonce,list:a,name:n,group:t},success:function(t){t.success&&e(".mailchimp-group-options").html(t.data.html)},complete:function(){i.parents("td").removeClass("sg-loading")}})})),e(document.body).on("sg-enhanced-select-search-init",(function(){e(":input.sg-select-search").filter(":not(.enhanced)").each((function(){var t={allowClear:!!e(this).data("allow_clear"),placeholder:e(this).data("placeholder"),minimumInputLength:e(this).data("minimum_input_length")?e(this).data("minimum_input_length"):"3",escapeMarkup:function(e){return e},ajax:{url:gasap.ajax_url,dataType:"json",delay:250,data:function(t){return{term:t.term,action:e(this).data("action")||"sg_select_search",security:gasap.nonce,exclude:e(this).data("exclude"),exclude_type:e(this).data("exclude_type"),include:e(this).data("include"),limit:e(this).data("limit"),display_stock:e(this).data("display_stock")}},processResults:function(t){var a=[];return t&&e.each(t,(function(e,t){a.push({id:e,text:t})})),{results:a}},cache:!0}};e(this).select2(t).addClass("enhanced"),e(this).prop("multiple")&&e(this).on("change",(function(){var t=e(this).children();t.sort((function(e,t){var a=e.text.toLowerCase(),i=t.text.toLowerCase();return a>i?1:a<i?-1:0})),e(this).html(t)}))}))})).trigger("sg-enhanced-select-search-init"),e(document.body).on("sg-color-picker-init",(function(){e(":input.sg-color-picker").filter(":not(.enhanced)").each((function(){e(this).wpColorPicker()}))})).trigger("sg-color-picker-init")}))}()}(); 1 /******/ (function() { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ "./node_modules/magnific-popup/dist/jquery.magnific-popup.js": 5 /*!*******************************************************************!*\ 6 !*** ./node_modules/magnific-popup/dist/jquery.magnific-popup.js ***! 7 \*******************************************************************/ 8 /***/ (function(module, exports, __webpack_require__) { 9 10 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Magnific Popup - v1.1.0 - 2016-02-20 11 * http://dimsemenov.com/plugins/magnific-popup/ 12 * Copyright (c) 2016 Dmitry Semenov; */ 13 ;(function (factory) { 14 if (true) { 15 // AMD. Register as an anonymous module. 16 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "jquery")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 17 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 18 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 19 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 20 } else {} 21 }(function($) { 22 23 /*>>core*/ 24 /** 25 * 26 * Magnific Popup Core JS file 27 * 28 */ 29 30 31 /** 32 * Private static constants 33 */ 34 var CLOSE_EVENT = 'Close', 35 BEFORE_CLOSE_EVENT = 'BeforeClose', 36 AFTER_CLOSE_EVENT = 'AfterClose', 37 BEFORE_APPEND_EVENT = 'BeforeAppend', 38 MARKUP_PARSE_EVENT = 'MarkupParse', 39 OPEN_EVENT = 'Open', 40 CHANGE_EVENT = 'Change', 41 NS = 'mfp', 42 EVENT_NS = '.' + NS, 43 READY_CLASS = 'mfp-ready', 44 REMOVING_CLASS = 'mfp-removing', 45 PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; 46 47 48 /** 49 * Private vars 50 */ 51 /*jshint -W079 */ 52 var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' 53 MagnificPopup = function(){}, 54 _isJQ = !!(window.jQuery), 55 _prevStatus, 56 _window = $(window), 57 _document, 58 _prevContentType, 59 _wrapClasses, 60 _currPopupType; 61 62 63 /** 64 * Private functions 65 */ 66 var _mfpOn = function(name, f) { 67 mfp.ev.on(NS + name + EVENT_NS, f); 68 }, 69 _getEl = function(className, appendTo, html, raw) { 70 var el = document.createElement('div'); 71 el.className = 'mfp-'+className; 72 if(html) { 73 el.innerHTML = html; 74 } 75 if(!raw) { 76 el = $(el); 77 if(appendTo) { 78 el.appendTo(appendTo); 79 } 80 } else if(appendTo) { 81 appendTo.appendChild(el); 82 } 83 return el; 84 }, 85 _mfpTrigger = function(e, data) { 86 mfp.ev.triggerHandler(NS + e, data); 87 88 if(mfp.st.callbacks) { 89 // converts "mfpEventName" to "eventName" callback and triggers it if it's present 90 e = e.charAt(0).toLowerCase() + e.slice(1); 91 if(mfp.st.callbacks[e]) { 92 mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); 93 } 94 } 95 }, 96 _getCloseBtn = function(type) { 97 if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { 98 mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); 99 _currPopupType = type; 100 } 101 return mfp.currTemplate.closeBtn; 102 }, 103 // Initialize Magnific Popup only when called at least once 104 _checkInstance = function() { 105 if(!$.magnificPopup.instance) { 106 /*jshint -W020 */ 107 mfp = new MagnificPopup(); 108 mfp.init(); 109 $.magnificPopup.instance = mfp; 110 } 111 }, 112 // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr 113 supportsTransitions = function() { 114 var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist 115 v = ['ms','O','Moz','Webkit']; // 'v' for vendor 116 117 if( s['transition'] !== undefined ) { 118 return true; 119 } 120 121 while( v.length ) { 122 if( v.pop() + 'Transition' in s ) { 123 return true; 124 } 125 } 126 127 return false; 128 }; 129 130 131 132 /** 133 * Public functions 134 */ 135 MagnificPopup.prototype = { 136 137 constructor: MagnificPopup, 138 139 /** 140 * Initializes Magnific Popup plugin. 141 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed 142 */ 143 init: function() { 144 var appVersion = navigator.appVersion; 145 mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; 146 mfp.isAndroid = (/android/gi).test(appVersion); 147 mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); 148 mfp.supportsTransition = supportsTransitions(); 149 150 // We disable fixed positioned lightbox on devices that don't handle it nicely. 151 // If you know a better way of detecting this - let me know. 152 mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); 153 _document = $(document); 154 155 mfp.popupsCache = {}; 156 }, 157 158 /** 159 * Opens popup 160 * @param data [description] 161 */ 162 open: function(data) { 163 164 var i; 165 166 if(data.isObj === false) { 167 // convert jQuery collection to array to avoid conflicts later 168 mfp.items = data.items.toArray(); 169 170 mfp.index = 0; 171 var items = data.items, 172 item; 173 for(i = 0; i < items.length; i++) { 174 item = items[i]; 175 if(item.parsed) { 176 item = item.el[0]; 177 } 178 if(item === data.el[0]) { 179 mfp.index = i; 180 break; 181 } 182 } 183 } else { 184 mfp.items = $.isArray(data.items) ? data.items : [data.items]; 185 mfp.index = data.index || 0; 186 } 187 188 // if popup is already opened - we just update the content 189 if(mfp.isOpen) { 190 mfp.updateItemHTML(); 191 return; 192 } 193 194 mfp.types = []; 195 _wrapClasses = ''; 196 if(data.mainEl && data.mainEl.length) { 197 mfp.ev = data.mainEl.eq(0); 198 } else { 199 mfp.ev = _document; 200 } 201 202 if(data.key) { 203 if(!mfp.popupsCache[data.key]) { 204 mfp.popupsCache[data.key] = {}; 205 } 206 mfp.currTemplate = mfp.popupsCache[data.key]; 207 } else { 208 mfp.currTemplate = {}; 209 } 210 211 212 213 mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); 214 mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; 215 216 if(mfp.st.modal) { 217 mfp.st.closeOnContentClick = false; 218 mfp.st.closeOnBgClick = false; 219 mfp.st.showCloseBtn = false; 220 mfp.st.enableEscapeKey = false; 221 } 222 223 224 // Building markup 225 // main containers are created only once 226 if(!mfp.bgOverlay) { 227 228 // Dark overlay 229 mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { 230 mfp.close(); 231 }); 232 233 mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { 234 if(mfp._checkIfClose(e.target)) { 235 mfp.close(); 236 } 237 }); 238 239 mfp.container = _getEl('container', mfp.wrap); 240 } 241 242 mfp.contentContainer = _getEl('content'); 243 if(mfp.st.preloader) { 244 mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); 245 } 246 247 248 // Initializing modules 249 var modules = $.magnificPopup.modules; 250 for(i = 0; i < modules.length; i++) { 251 var n = modules[i]; 252 n = n.charAt(0).toUpperCase() + n.slice(1); 253 mfp['init'+n].call(mfp); 254 } 255 _mfpTrigger('BeforeOpen'); 256 257 258 if(mfp.st.showCloseBtn) { 259 // Close button 260 if(!mfp.st.closeBtnInside) { 261 mfp.wrap.append( _getCloseBtn() ); 262 } else { 263 _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { 264 values.close_replaceWith = _getCloseBtn(item.type); 265 }); 266 _wrapClasses += ' mfp-close-btn-in'; 267 } 268 } 269 270 if(mfp.st.alignTop) { 271 _wrapClasses += ' mfp-align-top'; 272 } 273 274 275 276 if(mfp.fixedContentPos) { 277 mfp.wrap.css({ 278 overflow: mfp.st.overflowY, 279 overflowX: 'hidden', 280 overflowY: mfp.st.overflowY 281 }); 282 } else { 283 mfp.wrap.css({ 284 top: _window.scrollTop(), 285 position: 'absolute' 286 }); 287 } 288 if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { 289 mfp.bgOverlay.css({ 290 height: _document.height(), 291 position: 'absolute' 292 }); 293 } 294 295 296 297 if(mfp.st.enableEscapeKey) { 298 // Close on ESC key 299 _document.on('keyup' + EVENT_NS, function(e) { 300 if(e.keyCode === 27) { 301 mfp.close(); 302 } 303 }); 304 } 305 306 _window.on('resize' + EVENT_NS, function() { 307 mfp.updateSize(); 308 }); 309 310 311 if(!mfp.st.closeOnContentClick) { 312 _wrapClasses += ' mfp-auto-cursor'; 313 } 314 315 if(_wrapClasses) 316 mfp.wrap.addClass(_wrapClasses); 317 318 319 // this triggers recalculation of layout, so we get it once to not to trigger twice 320 var windowHeight = mfp.wH = _window.height(); 321 322 323 var windowStyles = {}; 324 325 if( mfp.fixedContentPos ) { 326 if(mfp._hasScrollBar(windowHeight)){ 327 var s = mfp._getScrollbarSize(); 328 if(s) { 329 windowStyles.marginRight = s; 330 } 331 } 332 } 333 334 if(mfp.fixedContentPos) { 335 if(!mfp.isIE7) { 336 windowStyles.overflow = 'hidden'; 337 } else { 338 // ie7 double-scroll bug 339 $('body, html').css('overflow', 'hidden'); 340 } 341 } 342 343 344 345 var classesToadd = mfp.st.mainClass; 346 if(mfp.isIE7) { 347 classesToadd += ' mfp-ie7'; 348 } 349 if(classesToadd) { 350 mfp._addClassToMFP( classesToadd ); 351 } 352 353 // add content 354 mfp.updateItemHTML(); 355 356 _mfpTrigger('BuildControls'); 357 358 // remove scrollbar, add margin e.t.c 359 $('html').css(windowStyles); 360 361 // add everything to DOM 362 mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) ); 363 364 // Save last focused element 365 mfp._lastFocusedEl = document.activeElement; 366 367 // Wait for next cycle to allow CSS transition 368 setTimeout(function() { 369 370 if(mfp.content) { 371 mfp._addClassToMFP(READY_CLASS); 372 mfp._setFocus(); 373 } else { 374 // if content is not defined (not loaded e.t.c) we add class only for BG 375 mfp.bgOverlay.addClass(READY_CLASS); 376 } 377 378 // Trap the focus in popup 379 _document.on('focusin' + EVENT_NS, mfp._onFocusIn); 380 381 }, 16); 382 383 mfp.isOpen = true; 384 mfp.updateSize(windowHeight); 385 _mfpTrigger(OPEN_EVENT); 386 387 return data; 388 }, 389 390 /** 391 * Closes the popup 392 */ 393 close: function() { 394 if(!mfp.isOpen) return; 395 _mfpTrigger(BEFORE_CLOSE_EVENT); 396 397 mfp.isOpen = false; 398 // for CSS3 animation 399 if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { 400 mfp._addClassToMFP(REMOVING_CLASS); 401 setTimeout(function() { 402 mfp._close(); 403 }, mfp.st.removalDelay); 404 } else { 405 mfp._close(); 406 } 407 }, 408 409 /** 410 * Helper for close() function 411 */ 412 _close: function() { 413 _mfpTrigger(CLOSE_EVENT); 414 415 var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; 416 417 mfp.bgOverlay.detach(); 418 mfp.wrap.detach(); 419 mfp.container.empty(); 420 421 if(mfp.st.mainClass) { 422 classesToRemove += mfp.st.mainClass + ' '; 423 } 424 425 mfp._removeClassFromMFP(classesToRemove); 426 427 if(mfp.fixedContentPos) { 428 var windowStyles = {marginRight: ''}; 429 if(mfp.isIE7) { 430 $('body, html').css('overflow', ''); 431 } else { 432 windowStyles.overflow = ''; 433 } 434 $('html').css(windowStyles); 435 } 436 437 _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); 438 mfp.ev.off(EVENT_NS); 439 440 // clean up DOM elements that aren't removed 441 mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); 442 mfp.bgOverlay.attr('class', 'mfp-bg'); 443 mfp.container.attr('class', 'mfp-container'); 444 445 // remove close button from target element 446 if(mfp.st.showCloseBtn && 447 (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { 448 if(mfp.currTemplate.closeBtn) 449 mfp.currTemplate.closeBtn.detach(); 450 } 451 452 453 if(mfp.st.autoFocusLast && mfp._lastFocusedEl) { 454 $(mfp._lastFocusedEl).focus(); // put tab focus back 455 } 456 mfp.currItem = null; 457 mfp.content = null; 458 mfp.currTemplate = null; 459 mfp.prevHeight = 0; 460 461 _mfpTrigger(AFTER_CLOSE_EVENT); 462 }, 463 464 updateSize: function(winHeight) { 465 466 if(mfp.isIOS) { 467 // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 468 var zoomLevel = document.documentElement.clientWidth / window.innerWidth; 469 var height = window.innerHeight * zoomLevel; 470 mfp.wrap.css('height', height); 471 mfp.wH = height; 472 } else { 473 mfp.wH = winHeight || _window.height(); 474 } 475 // Fixes #84: popup incorrectly positioned with position:relative on body 476 if(!mfp.fixedContentPos) { 477 mfp.wrap.css('height', mfp.wH); 478 } 479 480 _mfpTrigger('Resize'); 481 482 }, 483 484 /** 485 * Set content of popup based on current index 486 */ 487 updateItemHTML: function() { 488 var item = mfp.items[mfp.index]; 489 490 // Detach and perform modifications 491 mfp.contentContainer.detach(); 492 493 if(mfp.content) 494 mfp.content.detach(); 495 496 if(!item.parsed) { 497 item = mfp.parseEl( mfp.index ); 498 } 499 500 var type = item.type; 501 502 _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); 503 // BeforeChange event works like so: 504 // _mfpOn('BeforeChange', function(e, prevType, newType) { }); 505 506 mfp.currItem = item; 507 508 if(!mfp.currTemplate[type]) { 509 var markup = mfp.st[type] ? mfp.st[type].markup : false; 510 511 // allows to modify markup 512 _mfpTrigger('FirstMarkupParse', markup); 513 514 if(markup) { 515 mfp.currTemplate[type] = $(markup); 516 } else { 517 // if there is no markup found we just define that template is parsed 518 mfp.currTemplate[type] = true; 519 } 520 } 521 522 if(_prevContentType && _prevContentType !== item.type) { 523 mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); 524 } 525 526 var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); 527 mfp.appendContent(newContent, type); 528 529 item.preloaded = true; 530 531 _mfpTrigger(CHANGE_EVENT, item); 532 _prevContentType = item.type; 533 534 // Append container back after its content changed 535 mfp.container.prepend(mfp.contentContainer); 536 537 _mfpTrigger('AfterChange'); 538 }, 539 540 541 /** 542 * Set HTML content of popup 543 */ 544 appendContent: function(newContent, type) { 545 mfp.content = newContent; 546 547 if(newContent) { 548 if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && 549 mfp.currTemplate[type] === true) { 550 // if there is no markup, we just append close button element inside 551 if(!mfp.content.find('.mfp-close').length) { 552 mfp.content.append(_getCloseBtn()); 553 } 554 } else { 555 mfp.content = newContent; 556 } 557 } else { 558 mfp.content = ''; 559 } 560 561 _mfpTrigger(BEFORE_APPEND_EVENT); 562 mfp.container.addClass('mfp-'+type+'-holder'); 563 564 mfp.contentContainer.append(mfp.content); 565 }, 566 567 568 /** 569 * Creates Magnific Popup data object based on given data 570 * @param {int} index Index of item to parse 571 */ 572 parseEl: function(index) { 573 var item = mfp.items[index], 574 type; 575 576 if(item.tagName) { 577 item = { el: $(item) }; 578 } else { 579 type = item.type; 580 item = { data: item, src: item.src }; 581 } 582 583 if(item.el) { 584 var types = mfp.types; 585 586 // check for 'mfp-TYPE' class 587 for(var i = 0; i < types.length; i++) { 588 if( item.el.hasClass('mfp-'+types[i]) ) { 589 type = types[i]; 590 break; 591 } 592 } 593 594 item.src = item.el.attr('data-mfp-src'); 595 if(!item.src) { 596 item.src = item.el.attr('href'); 597 } 598 } 599 600 item.type = type || mfp.st.type || 'inline'; 601 item.index = index; 602 item.parsed = true; 603 mfp.items[index] = item; 604 _mfpTrigger('ElementParse', item); 605 606 return mfp.items[index]; 607 }, 608 609 610 /** 611 * Initializes single popup or a group of popups 612 */ 613 addGroup: function(el, options) { 614 var eHandler = function(e) { 615 e.mfpEl = this; 616 mfp._openClick(e, el, options); 617 }; 618 619 if(!options) { 620 options = {}; 621 } 622 623 var eName = 'click.magnificPopup'; 624 options.mainEl = el; 625 626 if(options.items) { 627 options.isObj = true; 628 el.off(eName).on(eName, eHandler); 629 } else { 630 options.isObj = false; 631 if(options.delegate) { 632 el.off(eName).on(eName, options.delegate , eHandler); 633 } else { 634 options.items = el; 635 el.off(eName).on(eName, eHandler); 636 } 637 } 638 }, 639 _openClick: function(e, el, options) { 640 var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; 641 642 643 if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) { 644 return; 645 } 646 647 var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; 648 649 if(disableOn) { 650 if($.isFunction(disableOn)) { 651 if( !disableOn.call(mfp) ) { 652 return true; 653 } 654 } else { // else it's number 655 if( _window.width() < disableOn ) { 656 return true; 657 } 658 } 659 } 660 661 if(e.type) { 662 e.preventDefault(); 663 664 // This will prevent popup from closing if element is inside and popup is already opened 665 if(mfp.isOpen) { 666 e.stopPropagation(); 667 } 668 } 669 670 options.el = $(e.mfpEl); 671 if(options.delegate) { 672 options.items = el.find(options.delegate); 673 } 674 mfp.open(options); 675 }, 676 677 678 /** 679 * Updates text on preloader 680 */ 681 updateStatus: function(status, text) { 682 683 if(mfp.preloader) { 684 if(_prevStatus !== status) { 685 mfp.container.removeClass('mfp-s-'+_prevStatus); 686 } 687 688 if(!text && status === 'loading') { 689 text = mfp.st.tLoading; 690 } 691 692 var data = { 693 status: status, 694 text: text 695 }; 696 // allows to modify status 697 _mfpTrigger('UpdateStatus', data); 698 699 status = data.status; 700 text = data.text; 701 702 mfp.preloader.html(text); 703 704 mfp.preloader.find('a').on('click', function(e) { 705 e.stopImmediatePropagation(); 706 }); 707 708 mfp.container.addClass('mfp-s-'+status); 709 _prevStatus = status; 710 } 711 }, 712 713 714 /* 715 "Private" helpers that aren't private at all 716 */ 717 // Check to close popup or not 718 // "target" is an element that was clicked 719 _checkIfClose: function(target) { 720 721 if($(target).hasClass(PREVENT_CLOSE_CLASS)) { 722 return; 723 } 724 725 var closeOnContent = mfp.st.closeOnContentClick; 726 var closeOnBg = mfp.st.closeOnBgClick; 727 728 if(closeOnContent && closeOnBg) { 729 return true; 730 } else { 731 732 // We close the popup if click is on close button or on preloader. Or if there is no content. 733 if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { 734 return true; 735 } 736 737 // if click is outside the content 738 if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { 739 if(closeOnBg) { 740 // last check, if the clicked element is in DOM, (in case it's removed onclick) 741 if( $.contains(document, target) ) { 742 return true; 743 } 744 } 745 } else if(closeOnContent) { 746 return true; 747 } 748 749 } 750 return false; 751 }, 752 _addClassToMFP: function(cName) { 753 mfp.bgOverlay.addClass(cName); 754 mfp.wrap.addClass(cName); 755 }, 756 _removeClassFromMFP: function(cName) { 757 this.bgOverlay.removeClass(cName); 758 mfp.wrap.removeClass(cName); 759 }, 760 _hasScrollBar: function(winHeight) { 761 return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); 762 }, 763 _setFocus: function() { 764 (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); 765 }, 766 _onFocusIn: function(e) { 767 if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { 768 mfp._setFocus(); 769 return false; 770 } 771 }, 772 _parseMarkup: function(template, values, item) { 773 var arr; 774 if(item.data) { 775 values = $.extend(item.data, values); 776 } 777 _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); 778 779 $.each(values, function(key, value) { 780 if(value === undefined || value === false) { 781 return true; 782 } 783 arr = key.split('_'); 784 if(arr.length > 1) { 785 var el = template.find(EVENT_NS + '-'+arr[0]); 786 787 if(el.length > 0) { 788 var attr = arr[1]; 789 if(attr === 'replaceWith') { 790 if(el[0] !== value[0]) { 791 el.replaceWith(value); 792 } 793 } else if(attr === 'img') { 794 if(el.is('img')) { 795 el.attr('src', value); 796 } else { 797 el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) ); 798 } 799 } else { 800 el.attr(arr[1], value); 801 } 802 } 803 804 } else { 805 template.find(EVENT_NS + '-'+key).html(value); 806 } 807 }); 808 }, 809 810 _getScrollbarSize: function() { 811 // thx David 812 if(mfp.scrollbarSize === undefined) { 813 var scrollDiv = document.createElement("div"); 814 scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; 815 document.body.appendChild(scrollDiv); 816 mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; 817 document.body.removeChild(scrollDiv); 818 } 819 return mfp.scrollbarSize; 820 } 821 822 }; /* MagnificPopup core prototype end */ 823 824 825 826 827 /** 828 * Public static functions 829 */ 830 $.magnificPopup = { 831 instance: null, 832 proto: MagnificPopup.prototype, 833 modules: [], 834 835 open: function(options, index) { 836 _checkInstance(); 837 838 if(!options) { 839 options = {}; 840 } else { 841 options = $.extend(true, {}, options); 842 } 843 844 options.isObj = true; 845 options.index = index || 0; 846 return this.instance.open(options); 847 }, 848 849 close: function() { 850 return $.magnificPopup.instance && $.magnificPopup.instance.close(); 851 }, 852 853 registerModule: function(name, module) { 854 if(module.options) { 855 $.magnificPopup.defaults[name] = module.options; 856 } 857 $.extend(this.proto, module.proto); 858 this.modules.push(name); 859 }, 860 861 defaults: { 862 863 // Info about options is in docs: 864 // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options 865 866 disableOn: 0, 867 868 key: null, 869 870 midClick: false, 871 872 mainClass: '', 873 874 preloader: true, 875 876 focus: '', // CSS selector of input to focus after popup is opened 877 878 closeOnContentClick: false, 879 880 closeOnBgClick: true, 881 882 closeBtnInside: true, 883 884 showCloseBtn: true, 885 886 enableEscapeKey: true, 887 888 modal: false, 889 890 alignTop: false, 891 892 removalDelay: 0, 893 894 prependTo: null, 895 896 fixedContentPos: 'auto', 897 898 fixedBgPos: 'auto', 899 900 overflowY: 'auto', 901 902 closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>', 903 904 tClose: 'Close (Esc)', 905 906 tLoading: 'Loading...', 907 908 autoFocusLast: true 909 910 } 911 }; 912 913 914 915 $.fn.magnificPopup = function(options) { 916 _checkInstance(); 917 918 var jqEl = $(this); 919 920 // We call some API method of first param is a string 921 if (typeof options === "string" ) { 922 923 if(options === 'open') { 924 var items, 925 itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, 926 index = parseInt(arguments[1], 10) || 0; 927 928 if(itemOpts.items) { 929 items = itemOpts.items[index]; 930 } else { 931 items = jqEl; 932 if(itemOpts.delegate) { 933 items = items.find(itemOpts.delegate); 934 } 935 items = items.eq( index ); 936 } 937 mfp._openClick({mfpEl:items}, jqEl, itemOpts); 938 } else { 939 if(mfp.isOpen) 940 mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); 941 } 942 943 } else { 944 // clone options obj 945 options = $.extend(true, {}, options); 946 947 /* 948 * As Zepto doesn't support .data() method for objects 949 * and it works only in normal browsers 950 * we assign "options" object directly to the DOM element. FTW! 951 */ 952 if(_isJQ) { 953 jqEl.data('magnificPopup', options); 954 } else { 955 jqEl[0].magnificPopup = options; 956 } 957 958 mfp.addGroup(jqEl, options); 959 960 } 961 return jqEl; 962 }; 963 964 /*>>core*/ 965 966 /*>>inline*/ 967 968 var INLINE_NS = 'inline', 969 _hiddenClass, 970 _inlinePlaceholder, 971 _lastInlineElement, 972 _putInlineElementsBack = function() { 973 if(_lastInlineElement) { 974 _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); 975 _lastInlineElement = null; 976 } 977 }; 978 979 $.magnificPopup.registerModule(INLINE_NS, { 980 options: { 981 hiddenClass: 'hide', // will be appended with `mfp-` prefix 982 markup: '', 983 tNotFound: 'Content not found' 984 }, 985 proto: { 986 987 initInline: function() { 988 mfp.types.push(INLINE_NS); 989 990 _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { 991 _putInlineElementsBack(); 992 }); 993 }, 994 995 getInline: function(item, template) { 996 997 _putInlineElementsBack(); 998 999 if(item.src) { 1000 var inlineSt = mfp.st.inline, 1001 el = $(item.src); 1002 1003 if(el.length) { 1004 1005 // If target element has parent - we replace it with placeholder and put it back after popup is closed 1006 var parent = el[0].parentNode; 1007 if(parent && parent.tagName) { 1008 if(!_inlinePlaceholder) { 1009 _hiddenClass = inlineSt.hiddenClass; 1010 _inlinePlaceholder = _getEl(_hiddenClass); 1011 _hiddenClass = 'mfp-'+_hiddenClass; 1012 } 1013 // replace target inline element with placeholder 1014 _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); 1015 } 1016 1017 mfp.updateStatus('ready'); 1018 } else { 1019 mfp.updateStatus('error', inlineSt.tNotFound); 1020 el = $('<div>'); 1021 } 1022 1023 item.inlineElement = el; 1024 return el; 1025 } 1026 1027 mfp.updateStatus('ready'); 1028 mfp._parseMarkup(template, {}, item); 1029 return template; 1030 } 1031 } 1032 }); 1033 1034 /*>>inline*/ 1035 1036 /*>>ajax*/ 1037 var AJAX_NS = 'ajax', 1038 _ajaxCur, 1039 _removeAjaxCursor = function() { 1040 if(_ajaxCur) { 1041 $(document.body).removeClass(_ajaxCur); 1042 } 1043 }, 1044 _destroyAjaxRequest = function() { 1045 _removeAjaxCursor(); 1046 if(mfp.req) { 1047 mfp.req.abort(); 1048 } 1049 }; 1050 1051 $.magnificPopup.registerModule(AJAX_NS, { 1052 1053 options: { 1054 settings: null, 1055 cursor: 'mfp-ajax-cur', 1056 tError: '<a href="%url%">The content</a> could not be loaded.' 1057 }, 1058 1059 proto: { 1060 initAjax: function() { 1061 mfp.types.push(AJAX_NS); 1062 _ajaxCur = mfp.st.ajax.cursor; 1063 1064 _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); 1065 _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); 1066 }, 1067 getAjax: function(item) { 1068 1069 if(_ajaxCur) { 1070 $(document.body).addClass(_ajaxCur); 1071 } 1072 1073 mfp.updateStatus('loading'); 1074 1075 var opts = $.extend({ 1076 url: item.src, 1077 success: function(data, textStatus, jqXHR) { 1078 var temp = { 1079 data:data, 1080 xhr:jqXHR 1081 }; 1082 1083 _mfpTrigger('ParseAjax', temp); 1084 1085 mfp.appendContent( $(temp.data), AJAX_NS ); 1086 1087 item.finished = true; 1088 1089 _removeAjaxCursor(); 1090 1091 mfp._setFocus(); 1092 1093 setTimeout(function() { 1094 mfp.wrap.addClass(READY_CLASS); 1095 }, 16); 1096 1097 mfp.updateStatus('ready'); 1098 1099 _mfpTrigger('AjaxContentAdded'); 1100 }, 1101 error: function() { 1102 _removeAjaxCursor(); 1103 item.finished = item.loadError = true; 1104 mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); 1105 } 1106 }, mfp.st.ajax.settings); 1107 1108 mfp.req = $.ajax(opts); 1109 1110 return ''; 1111 } 1112 } 1113 }); 1114 1115 /*>>ajax*/ 1116 1117 /*>>image*/ 1118 var _imgInterval, 1119 _getTitle = function(item) { 1120 if(item.data && item.data.title !== undefined) 1121 return item.data.title; 1122 1123 var src = mfp.st.image.titleSrc; 1124 1125 if(src) { 1126 if($.isFunction(src)) { 1127 return src.call(mfp, item); 1128 } else if(item.el) { 1129 return item.el.attr(src) || ''; 1130 } 1131 } 1132 return ''; 1133 }; 1134 1135 $.magnificPopup.registerModule('image', { 1136 1137 options: { 1138 markup: '<div class="mfp-figure">'+ 1139 '<div class="mfp-close"></div>'+ 1140 '<figure>'+ 1141 '<div class="mfp-img"></div>'+ 1142 '<figcaption>'+ 1143 '<div class="mfp-bottom-bar">'+ 1144 '<div class="mfp-title"></div>'+ 1145 '<div class="mfp-counter"></div>'+ 1146 '</div>'+ 1147 '</figcaption>'+ 1148 '</figure>'+ 1149 '</div>', 1150 cursor: 'mfp-zoom-out-cur', 1151 titleSrc: 'title', 1152 verticalFit: true, 1153 tError: '<a href="%url%">The image</a> could not be loaded.' 1154 }, 1155 1156 proto: { 1157 initImage: function() { 1158 var imgSt = mfp.st.image, 1159 ns = '.image'; 1160 1161 mfp.types.push('image'); 1162 1163 _mfpOn(OPEN_EVENT+ns, function() { 1164 if(mfp.currItem.type === 'image' && imgSt.cursor) { 1165 $(document.body).addClass(imgSt.cursor); 1166 } 1167 }); 1168 1169 _mfpOn(CLOSE_EVENT+ns, function() { 1170 if(imgSt.cursor) { 1171 $(document.body).removeClass(imgSt.cursor); 1172 } 1173 _window.off('resize' + EVENT_NS); 1174 }); 1175 1176 _mfpOn('Resize'+ns, mfp.resizeImage); 1177 if(mfp.isLowIE) { 1178 _mfpOn('AfterChange', mfp.resizeImage); 1179 } 1180 }, 1181 resizeImage: function() { 1182 var item = mfp.currItem; 1183 if(!item || !item.img) return; 1184 1185 if(mfp.st.image.verticalFit) { 1186 var decr = 0; 1187 // fix box-sizing in ie7/8 1188 if(mfp.isLowIE) { 1189 decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); 1190 } 1191 item.img.css('max-height', mfp.wH-decr); 1192 } 1193 }, 1194 _onImageHasSize: function(item) { 1195 if(item.img) { 1196 1197 item.hasSize = true; 1198 1199 if(_imgInterval) { 1200 clearInterval(_imgInterval); 1201 } 1202 1203 item.isCheckingImgSize = false; 1204 1205 _mfpTrigger('ImageHasSize', item); 1206 1207 if(item.imgHidden) { 1208 if(mfp.content) 1209 mfp.content.removeClass('mfp-loading'); 1210 1211 item.imgHidden = false; 1212 } 1213 1214 } 1215 }, 1216 1217 /** 1218 * Function that loops until the image has size to display elements that rely on it asap 1219 */ 1220 findImageSize: function(item) { 1221 1222 var counter = 0, 1223 img = item.img[0], 1224 mfpSetInterval = function(delay) { 1225 1226 if(_imgInterval) { 1227 clearInterval(_imgInterval); 1228 } 1229 // decelerating interval that checks for size of an image 1230 _imgInterval = setInterval(function() { 1231 if(img.naturalWidth > 0) { 1232 mfp._onImageHasSize(item); 1233 return; 1234 } 1235 1236 if(counter > 200) { 1237 clearInterval(_imgInterval); 1238 } 1239 1240 counter++; 1241 if(counter === 3) { 1242 mfpSetInterval(10); 1243 } else if(counter === 40) { 1244 mfpSetInterval(50); 1245 } else if(counter === 100) { 1246 mfpSetInterval(500); 1247 } 1248 }, delay); 1249 }; 1250 1251 mfpSetInterval(1); 1252 }, 1253 1254 getImage: function(item, template) { 1255 1256 var guard = 0, 1257 1258 // image load complete handler 1259 onLoadComplete = function() { 1260 if(item) { 1261 if (item.img[0].complete) { 1262 item.img.off('.mfploader'); 1263 1264 if(item === mfp.currItem){ 1265 mfp._onImageHasSize(item); 1266 1267 mfp.updateStatus('ready'); 1268 } 1269 1270 item.hasSize = true; 1271 item.loaded = true; 1272 1273 _mfpTrigger('ImageLoadComplete'); 1274 1275 } 1276 else { 1277 // if image complete check fails 200 times (20 sec), we assume that there was an error. 1278 guard++; 1279 if(guard < 200) { 1280 setTimeout(onLoadComplete,100); 1281 } else { 1282 onLoadError(); 1283 } 1284 } 1285 } 1286 }, 1287 1288 // image error handler 1289 onLoadError = function() { 1290 if(item) { 1291 item.img.off('.mfploader'); 1292 if(item === mfp.currItem){ 1293 mfp._onImageHasSize(item); 1294 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); 1295 } 1296 1297 item.hasSize = true; 1298 item.loaded = true; 1299 item.loadError = true; 1300 } 1301 }, 1302 imgSt = mfp.st.image; 1303 1304 1305 var el = template.find('.mfp-img'); 1306 if(el.length) { 1307 var img = document.createElement('img'); 1308 img.className = 'mfp-img'; 1309 if(item.el && item.el.find('img').length) { 1310 img.alt = item.el.find('img').attr('alt'); 1311 } 1312 item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); 1313 img.src = item.src; 1314 1315 // without clone() "error" event is not firing when IMG is replaced by new IMG 1316 // TODO: find a way to avoid such cloning 1317 if(el.is('img')) { 1318 item.img = item.img.clone(); 1319 } 1320 1321 img = item.img[0]; 1322 if(img.naturalWidth > 0) { 1323 item.hasSize = true; 1324 } else if(!img.width) { 1325 item.hasSize = false; 1326 } 1327 } 1328 1329 mfp._parseMarkup(template, { 1330 title: _getTitle(item), 1331 img_replaceWith: item.img 1332 }, item); 1333 1334 mfp.resizeImage(); 1335 1336 if(item.hasSize) { 1337 if(_imgInterval) clearInterval(_imgInterval); 1338 1339 if(item.loadError) { 1340 template.addClass('mfp-loading'); 1341 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); 1342 } else { 1343 template.removeClass('mfp-loading'); 1344 mfp.updateStatus('ready'); 1345 } 1346 return template; 1347 } 1348 1349 mfp.updateStatus('loading'); 1350 item.loading = true; 1351 1352 if(!item.hasSize) { 1353 item.imgHidden = true; 1354 template.addClass('mfp-loading'); 1355 mfp.findImageSize(item); 1356 } 1357 1358 return template; 1359 } 1360 } 1361 }); 1362 1363 /*>>image*/ 1364 1365 /*>>zoom*/ 1366 var hasMozTransform, 1367 getHasMozTransform = function() { 1368 if(hasMozTransform === undefined) { 1369 hasMozTransform = document.createElement('p').style.MozTransform !== undefined; 1370 } 1371 return hasMozTransform; 1372 }; 1373 1374 $.magnificPopup.registerModule('zoom', { 1375 1376 options: { 1377 enabled: false, 1378 easing: 'ease-in-out', 1379 duration: 300, 1380 opener: function(element) { 1381 return element.is('img') ? element : element.find('img'); 1382 } 1383 }, 1384 1385 proto: { 1386 1387 initZoom: function() { 1388 var zoomSt = mfp.st.zoom, 1389 ns = '.zoom', 1390 image; 1391 1392 if(!zoomSt.enabled || !mfp.supportsTransition) { 1393 return; 1394 } 1395 1396 var duration = zoomSt.duration, 1397 getElToAnimate = function(image) { 1398 var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), 1399 transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, 1400 cssObj = { 1401 position: 'fixed', 1402 zIndex: 9999, 1403 left: 0, 1404 top: 0, 1405 '-webkit-backface-visibility': 'hidden' 1406 }, 1407 t = 'transition'; 1408 1409 cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; 1410 1411 newImg.css(cssObj); 1412 return newImg; 1413 }, 1414 showMainContent = function() { 1415 mfp.content.css('visibility', 'visible'); 1416 }, 1417 openTimeout, 1418 animatedImg; 1419 1420 _mfpOn('BuildControls'+ns, function() { 1421 if(mfp._allowZoom()) { 1422 1423 clearTimeout(openTimeout); 1424 mfp.content.css('visibility', 'hidden'); 1425 1426 // Basically, all code below does is clones existing image, puts in on top of the current one and animated it 1427 1428 image = mfp._getItemToZoom(); 1429 1430 if(!image) { 1431 showMainContent(); 1432 return; 1433 } 1434 1435 animatedImg = getElToAnimate(image); 1436 1437 animatedImg.css( mfp._getOffset() ); 1438 1439 mfp.wrap.append(animatedImg); 1440 1441 openTimeout = setTimeout(function() { 1442 animatedImg.css( mfp._getOffset( true ) ); 1443 openTimeout = setTimeout(function() { 1444 1445 showMainContent(); 1446 1447 setTimeout(function() { 1448 animatedImg.remove(); 1449 image = animatedImg = null; 1450 _mfpTrigger('ZoomAnimationEnded'); 1451 }, 16); // avoid blink when switching images 1452 1453 }, duration); // this timeout equals animation duration 1454 1455 }, 16); // by adding this timeout we avoid short glitch at the beginning of animation 1456 1457 1458 // Lots of timeouts... 1459 } 1460 }); 1461 _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { 1462 if(mfp._allowZoom()) { 1463 1464 clearTimeout(openTimeout); 1465 1466 mfp.st.removalDelay = duration; 1467 1468 if(!image) { 1469 image = mfp._getItemToZoom(); 1470 if(!image) { 1471 return; 1472 } 1473 animatedImg = getElToAnimate(image); 1474 } 1475 1476 animatedImg.css( mfp._getOffset(true) ); 1477 mfp.wrap.append(animatedImg); 1478 mfp.content.css('visibility', 'hidden'); 1479 1480 setTimeout(function() { 1481 animatedImg.css( mfp._getOffset() ); 1482 }, 16); 1483 } 1484 1485 }); 1486 1487 _mfpOn(CLOSE_EVENT+ns, function() { 1488 if(mfp._allowZoom()) { 1489 showMainContent(); 1490 if(animatedImg) { 1491 animatedImg.remove(); 1492 } 1493 image = null; 1494 } 1495 }); 1496 }, 1497 1498 _allowZoom: function() { 1499 return mfp.currItem.type === 'image'; 1500 }, 1501 1502 _getItemToZoom: function() { 1503 if(mfp.currItem.hasSize) { 1504 return mfp.currItem.img; 1505 } else { 1506 return false; 1507 } 1508 }, 1509 1510 // Get element postion relative to viewport 1511 _getOffset: function(isLarge) { 1512 var el; 1513 if(isLarge) { 1514 el = mfp.currItem.img; 1515 } else { 1516 el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); 1517 } 1518 1519 var offset = el.offset(); 1520 var paddingTop = parseInt(el.css('padding-top'),10); 1521 var paddingBottom = parseInt(el.css('padding-bottom'),10); 1522 offset.top -= ( $(window).scrollTop() - paddingTop ); 1523 1524 1525 /* 1526 1527 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. 1528 1529 */ 1530 var obj = { 1531 width: el.width(), 1532 // fix Zepto height+padding issue 1533 height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop 1534 }; 1535 1536 // I hate to do this, but there is no another option 1537 if( getHasMozTransform() ) { 1538 obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; 1539 } else { 1540 obj.left = offset.left; 1541 obj.top = offset.top; 1542 } 1543 return obj; 1544 } 1545 1546 } 1547 }); 1548 1549 1550 1551 /*>>zoom*/ 1552 1553 /*>>iframe*/ 1554 1555 var IFRAME_NS = 'iframe', 1556 _emptyPage = '//about:blank', 1557 1558 _fixIframeBugs = function(isShowing) { 1559 if(mfp.currTemplate[IFRAME_NS]) { 1560 var el = mfp.currTemplate[IFRAME_NS].find('iframe'); 1561 if(el.length) { 1562 // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug 1563 if(!isShowing) { 1564 el[0].src = _emptyPage; 1565 } 1566 1567 // IE8 black screen bug fix 1568 if(mfp.isIE8) { 1569 el.css('display', isShowing ? 'block' : 'none'); 1570 } 1571 } 1572 } 1573 }; 1574 1575 $.magnificPopup.registerModule(IFRAME_NS, { 1576 1577 options: { 1578 markup: '<div class="mfp-iframe-scaler">'+ 1579 '<div class="mfp-close"></div>'+ 1580 '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+ 1581 '</div>', 1582 1583 srcAction: 'iframe_src', 1584 1585 // we don't care and support only one default type of URL by default 1586 patterns: { 1587 youtube: { 1588 index: 'youtube.com', 1589 id: 'v=', 1590 src: '//www.youtube.com/embed/%id%?autoplay=1' 1591 }, 1592 vimeo: { 1593 index: 'vimeo.com/', 1594 id: '/', 1595 src: '//player.vimeo.com/video/%id%?autoplay=1' 1596 }, 1597 gmaps: { 1598 index: '//maps.google.', 1599 src: '%id%&output=embed' 1600 } 1601 } 1602 }, 1603 1604 proto: { 1605 initIframe: function() { 1606 mfp.types.push(IFRAME_NS); 1607 1608 _mfpOn('BeforeChange', function(e, prevType, newType) { 1609 if(prevType !== newType) { 1610 if(prevType === IFRAME_NS) { 1611 _fixIframeBugs(); // iframe if removed 1612 } else if(newType === IFRAME_NS) { 1613 _fixIframeBugs(true); // iframe is showing 1614 } 1615 }// else { 1616 // iframe source is switched, don't do anything 1617 //} 1618 }); 1619 1620 _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { 1621 _fixIframeBugs(); 1622 }); 1623 }, 1624 1625 getIframe: function(item, template) { 1626 var embedSrc = item.src; 1627 var iframeSt = mfp.st.iframe; 1628 1629 $.each(iframeSt.patterns, function() { 1630 if(embedSrc.indexOf( this.index ) > -1) { 1631 if(this.id) { 1632 if(typeof this.id === 'string') { 1633 embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); 1634 } else { 1635 embedSrc = this.id.call( this, embedSrc ); 1636 } 1637 } 1638 embedSrc = this.src.replace('%id%', embedSrc ); 1639 return false; // break; 1640 } 1641 }); 1642 1643 var dataObj = {}; 1644 if(iframeSt.srcAction) { 1645 dataObj[iframeSt.srcAction] = embedSrc; 1646 } 1647 mfp._parseMarkup(template, dataObj, item); 1648 1649 mfp.updateStatus('ready'); 1650 1651 return template; 1652 } 1653 } 1654 }); 1655 1656 1657 1658 /*>>iframe*/ 1659 1660 /*>>gallery*/ 1661 /** 1662 * Get looped index depending on number of slides 1663 */ 1664 var _getLoopedId = function(index) { 1665 var numSlides = mfp.items.length; 1666 if(index > numSlides - 1) { 1667 return index - numSlides; 1668 } else if(index < 0) { 1669 return numSlides + index; 1670 } 1671 return index; 1672 }, 1673 _replaceCurrTotal = function(text, curr, total) { 1674 return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); 1675 }; 1676 1677 $.magnificPopup.registerModule('gallery', { 1678 1679 options: { 1680 enabled: false, 1681 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 1682 preload: [0,2], 1683 navigateByImgClick: true, 1684 arrows: true, 1685 1686 tPrev: 'Previous (Left arrow key)', 1687 tNext: 'Next (Right arrow key)', 1688 tCounter: '%curr% of %total%' 1689 }, 1690 1691 proto: { 1692 initGallery: function() { 1693 1694 var gSt = mfp.st.gallery, 1695 ns = '.mfp-gallery'; 1696 1697 mfp.direction = true; // true - next, false - prev 1698 1699 if(!gSt || !gSt.enabled ) return false; 1700 1701 _wrapClasses += ' mfp-gallery'; 1702 1703 _mfpOn(OPEN_EVENT+ns, function() { 1704 1705 if(gSt.navigateByImgClick) { 1706 mfp.wrap.on('click'+ns, '.mfp-img', function() { 1707 if(mfp.items.length > 1) { 1708 mfp.next(); 1709 return false; 1710 } 1711 }); 1712 } 1713 1714 _document.on('keydown'+ns, function(e) { 1715 if (e.keyCode === 37) { 1716 mfp.prev(); 1717 } else if (e.keyCode === 39) { 1718 mfp.next(); 1719 } 1720 }); 1721 }); 1722 1723 _mfpOn('UpdateStatus'+ns, function(e, data) { 1724 if(data.text) { 1725 data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); 1726 } 1727 }); 1728 1729 _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { 1730 var l = mfp.items.length; 1731 values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; 1732 }); 1733 1734 _mfpOn('BuildControls' + ns, function() { 1735 if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { 1736 var markup = gSt.arrowMarkup, 1737 arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), 1738 arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); 1739 1740 arrowLeft.click(function() { 1741 mfp.prev(); 1742 }); 1743 arrowRight.click(function() { 1744 mfp.next(); 1745 }); 1746 1747 mfp.container.append(arrowLeft.add(arrowRight)); 1748 } 1749 }); 1750 1751 _mfpOn(CHANGE_EVENT+ns, function() { 1752 if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); 1753 1754 mfp._preloadTimeout = setTimeout(function() { 1755 mfp.preloadNearbyImages(); 1756 mfp._preloadTimeout = null; 1757 }, 16); 1758 }); 1759 1760 1761 _mfpOn(CLOSE_EVENT+ns, function() { 1762 _document.off(ns); 1763 mfp.wrap.off('click'+ns); 1764 mfp.arrowRight = mfp.arrowLeft = null; 1765 }); 1766 1767 }, 1768 next: function() { 1769 mfp.direction = true; 1770 mfp.index = _getLoopedId(mfp.index + 1); 1771 mfp.updateItemHTML(); 1772 }, 1773 prev: function() { 1774 mfp.direction = false; 1775 mfp.index = _getLoopedId(mfp.index - 1); 1776 mfp.updateItemHTML(); 1777 }, 1778 goTo: function(newIndex) { 1779 mfp.direction = (newIndex >= mfp.index); 1780 mfp.index = newIndex; 1781 mfp.updateItemHTML(); 1782 }, 1783 preloadNearbyImages: function() { 1784 var p = mfp.st.gallery.preload, 1785 preloadBefore = Math.min(p[0], mfp.items.length), 1786 preloadAfter = Math.min(p[1], mfp.items.length), 1787 i; 1788 1789 for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { 1790 mfp._preloadItem(mfp.index+i); 1791 } 1792 for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { 1793 mfp._preloadItem(mfp.index-i); 1794 } 1795 }, 1796 _preloadItem: function(index) { 1797 index = _getLoopedId(index); 1798 1799 if(mfp.items[index].preloaded) { 1800 return; 1801 } 1802 1803 var item = mfp.items[index]; 1804 if(!item.parsed) { 1805 item = mfp.parseEl( index ); 1806 } 1807 1808 _mfpTrigger('LazyLoad', item); 1809 1810 if(item.type === 'image') { 1811 item.img = $('<img class="mfp-img" />').on('load.mfploader', function() { 1812 item.hasSize = true; 1813 }).on('error.mfploader', function() { 1814 item.hasSize = true; 1815 item.loadError = true; 1816 _mfpTrigger('LazyLoadError', item); 1817 }).attr('src', item.src); 1818 } 1819 1820 1821 item.preloaded = true; 1822 } 1823 } 1824 }); 1825 1826 /*>>gallery*/ 1827 1828 /*>>retina*/ 1829 1830 var RETINA_NS = 'retina'; 1831 1832 $.magnificPopup.registerModule(RETINA_NS, { 1833 options: { 1834 replaceSrc: function(item) { 1835 return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); 1836 }, 1837 ratio: 1 // Function or number. Set to 1 to disable. 1838 }, 1839 proto: { 1840 initRetina: function() { 1841 if(window.devicePixelRatio > 1) { 1842 1843 var st = mfp.st.retina, 1844 ratio = st.ratio; 1845 1846 ratio = !isNaN(ratio) ? ratio : ratio(); 1847 1848 if(ratio > 1) { 1849 _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { 1850 item.img.css({ 1851 'max-width': item.img[0].naturalWidth / ratio, 1852 'width': '100%' 1853 }); 1854 }); 1855 _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { 1856 item.src = st.replaceSrc(item, ratio); 1857 }); 1858 } 1859 } 1860 1861 } 1862 } 1863 }); 1864 1865 /*>>retina*/ 1866 _checkInstance(); })); 1867 1868 /***/ }), 1869 1870 /***/ "./node_modules/tlite/tlite.js": 1871 /*!*************************************!*\ 1872 !*** ./node_modules/tlite/tlite.js ***! 1873 \*************************************/ 1874 /***/ (function(module) { 1875 1876 function tlite(getTooltipOpts) { 1877 document.addEventListener('mouseover', function (e) { 1878 var el = e.target; 1879 var opts = getTooltipOpts(el); 1880 1881 if (!opts) { 1882 el = el.parentElement; 1883 opts = el && getTooltipOpts(el); 1884 } 1885 1886 opts && tlite.show(el, opts, true); 1887 }); 1888 } 1889 1890 tlite.show = function (el, opts, isAuto) { 1891 var fallbackAttrib = 'data-tlite'; 1892 opts = opts || {}; 1893 1894 (el.tooltip || Tooltip(el, opts)).show(); 1895 1896 function Tooltip(el, opts) { 1897 var tooltipEl; 1898 var showTimer; 1899 var text; 1900 1901 el.addEventListener('mousedown', autoHide); 1902 el.addEventListener('mouseleave', autoHide); 1903 1904 function show() { 1905 text = el.title || el.getAttribute(fallbackAttrib) || text; 1906 el.title = ''; 1907 el.setAttribute(fallbackAttrib, ''); 1908 text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1)) 1909 } 1910 1911 function autoHide() { 1912 tlite.hide(el, true); 1913 } 1914 1915 function hide(isAutoHiding) { 1916 if (isAuto === isAutoHiding) { 1917 showTimer = clearTimeout(showTimer); 1918 var parent = tooltipEl && tooltipEl.parentNode; 1919 parent && parent.removeChild(tooltipEl); 1920 tooltipEl = undefined; 1921 } 1922 } 1923 1924 function fadeIn() { 1925 if (!tooltipEl) { 1926 tooltipEl = createTooltip(el, text, opts); 1927 } 1928 } 1929 1930 return el.tooltip = { 1931 show: show, 1932 hide: hide 1933 }; 1934 } 1935 1936 function createTooltip(el, text, opts) { 1937 var tooltipEl = document.createElement('span'); 1938 var grav = opts.grav || el.getAttribute('data-tlite') || 'n'; 1939 1940 tooltipEl.innerHTML = text; 1941 1942 el.appendChild(tooltipEl); 1943 1944 var vertGrav = grav[0] || ''; 1945 var horzGrav = grav[1] || ''; 1946 1947 function positionTooltip() { 1948 tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav; 1949 1950 var arrowSize = 10; 1951 var top = el.offsetTop; 1952 var left = el.offsetLeft; 1953 1954 if (tooltipEl.offsetParent === el) { 1955 top = left = 0; 1956 } 1957 1958 var width = el.offsetWidth; 1959 var height = el.offsetHeight; 1960 var tooltipHeight = tooltipEl.offsetHeight; 1961 var tooltipWidth = tooltipEl.offsetWidth; 1962 var centerEl = left + (width / 2); 1963 1964 tooltipEl.style.top = ( 1965 vertGrav === 's' ? (top - tooltipHeight - arrowSize) : 1966 vertGrav === 'n' ? (top + height + arrowSize) : 1967 (top + (height / 2) - (tooltipHeight / 2)) 1968 ) + 'px'; 1969 1970 tooltipEl.style.left = ( 1971 horzGrav === 'w' ? left : 1972 horzGrav === 'e' ? left + width - tooltipWidth : 1973 vertGrav === 'w' ? (left + width + arrowSize) : 1974 vertGrav === 'e' ? (left - tooltipWidth - arrowSize) : 1975 (centerEl - tooltipWidth / 2) 1976 ) + 'px'; 1977 } 1978 1979 positionTooltip(); 1980 1981 var rect = tooltipEl.getBoundingClientRect(); 1982 1983 if (vertGrav === 's' && rect.top < 0) { 1984 vertGrav = 'n'; 1985 positionTooltip(); 1986 } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) { 1987 vertGrav = 's'; 1988 positionTooltip(); 1989 } else if (vertGrav === 'e' && rect.left < 0) { 1990 vertGrav = 'w'; 1991 positionTooltip(); 1992 } else if (vertGrav === 'w' && rect.right > window.innerWidth) { 1993 vertGrav = 'e'; 1994 positionTooltip(); 1995 } 1996 1997 tooltipEl.className += ' tlite-visible'; 1998 1999 return tooltipEl; 2000 } 2001 }; 2002 2003 tlite.hide = function (el, isAuto) { 2004 el.tooltip && el.tooltip.hide(isAuto); 2005 }; 2006 2007 if ( true && module.exports) { 2008 module.exports = tlite; 2009 } 2010 2011 2012 /***/ }), 2013 2014 /***/ "jquery": 2015 /*!*************************!*\ 2016 !*** external "jQuery" ***! 2017 \*************************/ 2018 /***/ (function(module) { 2019 2020 "use strict"; 2021 module.exports = jQuery; 2022 2023 /***/ }) 2024 2025 /******/ }); 2026 /************************************************************************/ 2027 /******/ // The module cache 2028 /******/ var __webpack_module_cache__ = {}; 2029 /******/ 2030 /******/ // The require function 2031 /******/ function __webpack_require__(moduleId) { 2032 /******/ // Check if module is in cache 2033 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 2034 /******/ if (cachedModule !== undefined) { 2035 /******/ return cachedModule.exports; 2036 /******/ } 2037 /******/ // Create a new module (and put it into the cache) 2038 /******/ var module = __webpack_module_cache__[moduleId] = { 2039 /******/ // no module.id needed 2040 /******/ // no module.loaded needed 2041 /******/ exports: {} 2042 /******/ }; 2043 /******/ 2044 /******/ // Execute the module function 2045 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 2046 /******/ 2047 /******/ // Return the exports of the module 2048 /******/ return module.exports; 2049 /******/ } 2050 /******/ 2051 /************************************************************************/ 2052 /******/ /* webpack/runtime/compat get default export */ 2053 /******/ !function() { 2054 /******/ // getDefaultExport function for compatibility with non-harmony modules 2055 /******/ __webpack_require__.n = function(module) { 2056 /******/ var getter = module && module.__esModule ? 2057 /******/ function() { return module['default']; } : 2058 /******/ function() { return module; }; 2059 /******/ __webpack_require__.d(getter, { a: getter }); 2060 /******/ return getter; 2061 /******/ }; 2062 /******/ }(); 2063 /******/ 2064 /******/ /* webpack/runtime/define property getters */ 2065 /******/ !function() { 2066 /******/ // define getter functions for harmony exports 2067 /******/ __webpack_require__.d = function(exports, definition) { 2068 /******/ for(var key in definition) { 2069 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 2070 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 2071 /******/ } 2072 /******/ } 2073 /******/ }; 2074 /******/ }(); 2075 /******/ 2076 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 2077 /******/ !function() { 2078 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 2079 /******/ }(); 2080 /******/ 2081 /******/ /* webpack/runtime/make namespace object */ 2082 /******/ !function() { 2083 /******/ // define __esModule on exports 2084 /******/ __webpack_require__.r = function(exports) { 2085 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 2086 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 2087 /******/ } 2088 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 2089 /******/ }; 2090 /******/ }(); 2091 /******/ 2092 /************************************************************************/ 2093 var __webpack_exports__ = {}; 2094 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 2095 !function() { 2096 "use strict"; 2097 /*!****************************!*\ 2098 !*** ./assets/js/admin.js ***! 2099 \****************************/ 2100 __webpack_require__.r(__webpack_exports__); 2101 /* harmony import */ var tlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tlite */ "./node_modules/tlite/tlite.js"); 2102 /* harmony import */ var tlite__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tlite__WEBPACK_IMPORTED_MODULE_0__); 2103 /* harmony import */ var _node_modules_magnific_popup_dist_jquery_magnific_popup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/magnific-popup/dist/jquery.magnific-popup.js */ "./node_modules/magnific-popup/dist/jquery.magnific-popup.js"); 2104 /* harmony import */ var _node_modules_magnific_popup_dist_jquery_magnific_popup_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_magnific_popup_dist_jquery_magnific_popup_js__WEBPACK_IMPORTED_MODULE_1__); 2105 2106 2107 /** 2108 * Creating the Media Uploader 2109 * 2110 * @param $imageContainer 2111 * @param $imageInput 2112 */ 2113 2114 function giveasap_image_media($imageContainer, $imageInput) { 2115 'use strict'; 2116 2117 var file_frame; 2118 /** 2119 * If an instance of file_frame already exists, then we can open it 2120 * rather than creating a new instance. 2121 */ 2122 2123 if (undefined !== file_frame) { 2124 file_frame.open(); 2125 return; 2126 } 2127 /** 2128 * If we're this far, then an instance does not exist, so we need to 2129 * create our own. 2130 * 2131 * Here, use the wp.media library to define the settings of the Media 2132 * Uploader. We're opting to use the 'post' frame which is a template 2133 * defined in WordPress core and are initializing the file frame 2134 * with the 'insert' state. 2135 * 2136 * We're also not allowing the user to select more than one image. 2137 */ 2138 2139 2140 file_frame = wp.media({ 2141 multiple: false 2142 }); 2143 file_frame.on('open', function () { 2144 var selection = file_frame.state().get('selection'); 2145 var ids = $imageInput.val().split(','); 2146 ids.forEach(function (id) { 2147 var attachment = wp.media.attachment(id); 2148 attachment.fetch(); 2149 selection.add(attachment ? [attachment] : []); 2150 }); 2151 }); // When an image is selected in the media frame... 2152 2153 file_frame.on('select', function () { 2154 // Get media attachment details from the frame state 2155 var attachments = file_frame.state().get('selection').toJSON(); 2156 var attachmentIDs = []; 2157 $imageContainer.empty(); 2158 console.log($imageContainer); 2159 var $galleryID = $imageContainer.attr("id"); 2160 2161 for (var i = 0; i < attachments.length; i++) { 2162 if (attachments[i].type == "image") { 2163 attachmentIDs.push(attachments[i].id); 2164 $imageContainer.append(sortable_gallery_image_create(attachments[i], $galleryID)); 2165 } 2166 } 2167 2168 $imageInput.val(attachmentIDs.join()); // sortable_gallery_image_remove(); 2169 }); // Now display the actual file_frame 2170 2171 file_frame.open(); 2172 } 2173 2174 function sortable_image_gallery_media($imageContainer, $imageInput) { 2175 'use strict'; 2176 2177 var file_frame; 2178 /** 2179 * If an instance of file_frame already exists, then we can open it 2180 * rather than creating a new instance. 2181 */ 2182 2183 if (undefined !== file_frame) { 2184 file_frame.open(); 2185 return; 2186 } 2187 /** 2188 * If we're this far, then an instance does not exist, so we need to 2189 * create our own. 2190 * 2191 * Here, use the wp.media library to define the settings of the Media 2192 * Uploader. We're opting to use the 'post' frame which is a template 2193 * defined in WordPress core and are initializing the file frame 2194 * with the 'insert' state. 2195 * 2196 * We're also not allowing the user to select more than one image. 2197 */ 2198 2199 2200 file_frame = wp.media({ 2201 multiple: true 2202 }); 2203 file_frame.on('open', function () { 2204 var selection = file_frame.state().get('selection'); 2205 var ids = $imageInput.val().split(','); 2206 ids.forEach(function (id) { 2207 var attachment = wp.media.attachment(id); 2208 attachment.fetch(); 2209 selection.add(attachment ? [attachment] : []); 2210 }); 2211 }); // When an image is selected in the media frame... 2212 2213 file_frame.on('select', function () { 2214 // Get media attachment details from the frame state 2215 var attachments = file_frame.state().get('selection').toJSON(); 2216 var attachmentIDs = []; 2217 $imageContainer.empty(); 2218 var $galleryID = $imageContainer.attr("id"); 2219 2220 for (var i = 0; i < attachments.length; i++) { 2221 if (attachments[i].type == "image") { 2222 attachmentIDs.push(attachments[i].id); 2223 $imageContainer.append(sortable_gallery_image_create(attachments[i], $galleryID)); 2224 } 2225 } 2226 2227 $imageInput.val(attachmentIDs.join()); // sortable_gallery_image_remove(); 2228 }); // Now display the actual file_frame 2229 2230 file_frame.open(); 2231 } 2232 2233 function sortable_gallery_image_create($attachment, $galleryID) { 2234 var image_url = ''; 2235 2236 if ($attachment.sizes.thumbnail) { 2237 image_url = $attachment.sizes.thumbnail.url; 2238 } else { 2239 image_url = $attachment.sizes.full.url; 2240 } 2241 2242 var $output = '<li tabindex="0" role="checkbox" aria-label="' + $attachment.title + '" aria-checked="true" data-id="' + $attachment.id + '" class="attachment save-ready selected details">'; 2243 $output += '<div class="attachment-preview js--select-attachment type-image subtype-jpeg portrait">'; 2244 $output += '<div class="thumbnail">'; 2245 $output += '<div class="centered">'; 2246 $output += '<img src="' + image_url + '" draggable="false" alt="">'; 2247 $output += '</div>'; 2248 $output += '</div>'; 2249 $output += '</div>'; 2250 $output += '<button type="button" data-gallery="#' + $galleryID + '" class="button-link check remove-sortable-wordpress-gallery-image" tabindex="0"><span class="media-modal-icon"></span><span class="screen-reader-text">Deselect</span></button>'; 2251 $output += '</li>'; 2252 return $output; 2253 } 2254 2255 function sortable_gallery_image_remove() { 2256 jQuery(".remove-sortable-wordpress-gallery-image").on('click', function () { 2257 var $id = jQuery(this).parent().attr("data-id"); 2258 var $gallery = jQuery(this).attr("data-gallery"); 2259 var $imageInput = jQuery($gallery + "_input"); 2260 jQuery(this).parent().remove(); 2261 var ids = $imageInput.val().split(','); 2262 var $idIndex = ids.indexOf($id); 2263 2264 if ($idIndex >= 0) { 2265 ids.splice($idIndex, 1); 2266 $imageInput.val(ids.join()); 2267 } 2268 }); 2269 } 2270 2271 function giveasap_prepare_format_from_php(format) { 2272 format = format.replace("d", "dd"); 2273 format = format.replace("j", "d"); 2274 format = format.replace("Y", "yy"); 2275 format = format.replace("m", "mm"); 2276 return format; 2277 } 2278 2279 function giveasap_initialize_code_editor() { 2280 var $ = jQuery; 2281 2282 if ($('.sg-code-editor').length) { 2283 $('.sg-code-editor').each(function () { 2284 var editorSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {}; 2285 var mode = $(this).attr('data-mode'); 2286 2287 if (typeof mode === 'undefined') { 2288 mode = false; 2289 } 2290 2291 editorSettings.codemirror = _.extend({}, editorSettings.codemirror, { 2292 indentUnit: 2, 2293 tabSize: 2 2294 }); 2295 2296 if (mode) { 2297 editorSettings.codemirror.mode = mode; 2298 } 2299 2300 var editor = wp.codeEditor.initialize($(this), editorSettings); 2301 }); 2302 } 2303 } 2304 2305 (function ($) { 2306 $(document).ready(function () { 2307 $(document.body).on('click', '#notify', function (e) { 2308 if (!$('#sg_allow_awarding').length) { 2309 return; 2310 } 2311 2312 if (!$('#sg_allow_awarding').prop('checked')) { 2313 return; 2314 } 2315 2316 if (!$('.sg-select-prizes-manual').length) { 2317 return; 2318 } 2319 2320 if (!$('.sg-prizes-field-container ').length) { 2321 return; 2322 } 2323 2324 if (!$('.sg-prizes-field-container ').children().length) { 2325 return; 2326 } 2327 2328 var prizesDropdown = $('.sg-select-prizes-manual'); 2329 var havePricesSelected = true; 2330 prizesDropdown.each(function () { 2331 var value = $(this).find('select').val(); 2332 2333 if (!value.length) { 2334 havePricesSelected = false; 2335 } 2336 }); 2337 2338 if (!havePricesSelected) { 2339 e.preventDefault(); 2340 alert('Some users don\'t have their prizes selected! Please make sure all have their prizes selected, save the giveaway and click again to notify.'); 2341 } 2342 }); 2343 tlite__WEBPACK_IMPORTED_MODULE_0___default()(el => el.classList.contains('sg-tooltip')); 2344 $('#sgToggleAwardPrizes').on('click', function (e) { 2345 e.preventDefault(); 2346 var $this = $(this), 2347 $target = $this.attr('data-target'), 2348 $class = $this.attr('data-class'); 2349 $($target).toggleClass($class); 2350 2351 if ($($target).hasClass($class)) { 2352 $('#sg_awarding_prizes_manually').removeAttr('checked'); 2353 } else { 2354 $('#sg_awarding_prizes_manually').attr('checked', 'checked'); 2355 } 2356 }); 2357 $('.sg-toggle').on('click', function (e) { 2358 e.preventDefault(); 2359 var $this = $(this), 2360 $target = $this.attr('data-target'), 2361 $class = $this.attr('data-class'), 2362 $text = $this.attr('data-text'); 2363 $($target).toggleClass($class); 2364 2365 if ($text) { 2366 var old_text = $this.text(); 2367 $this.attr('data-text', old_text); 2368 $this.html($text); 2369 } 2370 }); 2371 2372 if ($('#sg_giveaway_add_subscriber').length) { 2373 $('#sg_giveaway_add_subscriber').on('change', function () { 2374 $.ajax({ 2375 url: gasap.ajax_url, 2376 dataType: 'json', 2377 type: 'GET', 2378 data: { 2379 action: 'sg_get_giveaway_form_fields', 2380 giveaway: $(this).val(), 2381 nonce: gasap.nonce 2382 }, 2383 success: function (resp) { 2384 if (resp.success) { 2385 $('#sgGiveawayFields').html(resp.data); 2386 } 2387 } 2388 }); 2389 }); 2390 } 2391 2392 var imageButton = $(".add-sortable-wordpress-gallery"); 2393 $(document).on('click', '.remove-sortable-wordpress-gallery-image', function (e) { 2394 e.preventDefault(); 2395 var $this = $(this), 2396 $id = $this.parent().attr('data-id'), 2397 $gallery = $this.attr('data-gallery'), 2398 $input = $($gallery + '_input'); 2399 var ids = $input.val().split(','), 2400 $idIndex = ids.indexOf($id); 2401 2402 if ($idIndex >= 0) { 2403 ids.splice($idIndex, 1); 2404 $input.val(ids.join()); 2405 } 2406 2407 $this.parent().remove(); 2408 }); // sortable_gallery_image_remove(); 2409 2410 imageButton.each(function () { 2411 var galleryID = $(this).attr("data-gallery"); 2412 var imageContainer = $(galleryID); 2413 var imageInput = $(galleryID + "_input"); 2414 imageContainer.sortable(); 2415 imageContainer.on("sortupdate", function (event, ui) { 2416 var $ids = []; 2417 var $images = imageContainer.children("li"); 2418 $images.each(function () { 2419 $ids.push($(this).attr("data-id")); 2420 }); 2421 imageInput.val($ids.join()); 2422 }); 2423 $(this).on('click', function () { 2424 sortable_image_gallery_media(imageContainer, imageInput); 2425 }); 2426 }); 2427 $(document).on('click', '.add-single-wordpress-image', function (e) { 2428 e.preventDefault(); 2429 var galleryID = $(this).attr("data-gallery"); 2430 var imageContainer = $(galleryID); 2431 var imageInput = $(galleryID + "_input"); 2432 giveasap_image_media(imageContainer, imageInput); 2433 }); 2434 $(document).on('change', '#giveasap_end_date, #giveasap_end_time', function () { 2435 var end_time = $('#giveasap_end_time').val(), 2436 end_date = $('#giveasap_end_date').val().split('-').reverse().join('-'), 2437 winner_time = $('#giveasap_winner_time').val(), 2438 winner_date = $('#giveasap_winner_date').val().split('-').reverse().join('-'), 2439 end_date_object = Date.parse(end_date + 'T' + end_time), 2440 winner_date_object = Date.parse(winner_date + 'T' + winner_time); 2441 2442 if (end_date_object > winner_date_object) { 2443 $('#giveasap_winner_date').val($('#giveasap_end_date').val()); 2444 $('#giveasap_winner_time').val($('#giveasap_end_time').val()); 2445 } 2446 }); 2447 $(document).on('change', '#giveasap_winner_time, #giveasap_winner_date', function () { 2448 var end_time = $('#giveasap_end_time').val(), 2449 end_date = $('#giveasap_end_date').val().split('-').reverse().join('-'), 2450 winner_time = $('#giveasap_winner_time').val(), 2451 winner_date = $('#giveasap_winner_date').val().split('-').reverse().join('-'), 2452 end_date_object = Date.parse(end_date + 'T' + end_time), 2453 winner_date_object = Date.parse(winner_date + 'T' + winner_time); 2454 2455 if (end_date_object > winner_date_object) { 2456 alert(gasap.text.winner_before_end); 2457 } 2458 }); 2459 var $expand_users = $("#giveasap_expand_users"); 2460 $expand_users.on('click', function () { 2461 var $users_container = $("#giveasap_users_container"); 2462 $users_container.toggleClass("hidden"); 2463 }); 2464 var $date_format = $("#date_format"); 2465 $date_format.on('change', function () { 2466 $format = giveasap_prepare_format_from_php($(this).val()); 2467 $(".datepicker").datepicker('option', { 2468 altFormat: $format 2469 }); 2470 }); 2471 $(document).on('click', '.button-integration-deactivate', function (e) { 2472 e.preventDefault(); 2473 var integration = $(this).attr('data-integration'), 2474 $this = $(this); 2475 2476 if (integration) { 2477 $.ajax({ 2478 url: gasap.ajax_url, 2479 dataType: 'json', 2480 type: 'POST', 2481 data: { 2482 action: 'giveasap_deactivate_integration', 2483 integration: integration, 2484 nonce: gasap.nonce 2485 }, 2486 success: function (resp) { 2487 if (resp.success) { 2488 $this.removeClass('button-integration-deactivate').removeClass('button-default').addClass('button-integration-activate').addClass('button-primary').html(gasap.text.activate); 2489 } 2490 } 2491 }); 2492 } 2493 }); 2494 $(document).on('click', '.button-integration-activate', function (e) { 2495 e.preventDefault(); 2496 var integration = $(this).attr('data-integration'), 2497 $this = $(this); 2498 2499 if (integration) { 2500 $.ajax({ 2501 url: gasap.ajax_url, 2502 dataType: 'json', 2503 type: 'POST', 2504 data: { 2505 action: 'giveasap_activate_integration', 2506 integration: integration, 2507 nonce: gasap.nonce 2508 }, 2509 success: function (resp) { 2510 if (resp.success) { 2511 $this.addClass('button-integration-deactivate').addClass('button-default').removeClass('button-integration-activate').removeClass('button-primary').html(gasap.text.deactivate); 2512 } 2513 } 2514 }); 2515 } 2516 }); 2517 /** 2518 * Searching Email on User List. 2519 */ 2520 2521 $(document).on('click', '.ga-search-email', function (e) { 2522 e.preventDefault(); 2523 var inputs = $(this).parent().find('input'), 2524 url = window.location.href, 2525 parts = url.split('?'), 2526 query = parts[1], 2527 qparams = query.split('&'), 2528 params = {}; 2529 2530 for (var i = 0; i < qparams.length; i++) { 2531 var strings = qparams[i].split('='); 2532 params[strings[0]] = strings[1]; 2533 } 2534 2535 inputs.each(function () { 2536 var name = $(this).attr('name'), 2537 val = $(this).val(); 2538 2539 if (val) { 2540 params[name] = val; 2541 } else { 2542 delete params[name]; 2543 } 2544 }); 2545 var params_array = []; 2546 2547 for (var key in params) { 2548 params_array.push(key + '=' + params[key]); 2549 } 2550 2551 var location = parts[0] + '?' + params_array.join('&'); 2552 window.location.href = location; 2553 }); 2554 $(document).on('click', '.sg-metaboxes li.sg-metabox a', function (e) { 2555 e.preventDefault(); 2556 $('.sg-metabox-fields').addClass('hidden'); 2557 $('.sg-metaboxes li.active').removeClass('active'); 2558 var target = $(this).attr('href'); 2559 $(target).removeClass('hidden'); 2560 $(this).parent().addClass('active'); 2561 $(target).find('.wp-editor-wrap').each(function () { 2562 var frame = $(this).find('iframe'), 2563 height = frame.height(); 2564 2565 if (height < 200) { 2566 frame.height(200); 2567 } 2568 }); 2569 2570 if ($(target).find('.sg-code-editor')) { 2571 giveasap_initialize_code_editor(); 2572 } 2573 }); 2574 $(document).on('change', '.sg-admin-form.sg-action-form :input', function () { 2575 var form = $(this).parents('.sg-admin-form'); 2576 2577 if (!$(this)[0].checkValidity()) { 2578 var txt = $(this)[0].validationMessage; 2579 var error = form.find('.error'); 2580 $(this).focus(); 2581 2582 if (error.length) { 2583 error.find('p').html(txt); 2584 } else { 2585 form.prepend('<div class="notice error"><p>' + txt + '</p></div>'); 2586 } 2587 2588 setTimeout(function () { 2589 form.find('.error').fadeOut().remove(); 2590 }, 5000); 2591 } 2592 }); 2593 $('.sg-image-popup-link').magnificPopup({ 2594 type: 'image' 2595 }); 2596 /** 2597 * Sharing Methods. 2598 */ 2599 2600 $('#addShareMethod').on('click', function (e) { 2601 e.preventDefault(); 2602 var template = wp.template('sharing-method'), 2603 index = $('.giveaway-sharing-methods').children().length, 2604 data = { 2605 index: index, 2606 title: 'New Method' 2607 }, 2608 html = template(data); 2609 $('.giveaway-sharing-methods').append(html); 2610 $('.giveaway-sharing-methods').children().eq(index).find('.method-select').trigger('change'); 2611 }); 2612 2613 function giveaway_reset_methods_index() { 2614 var index = 0; 2615 $('.giveaway-sharing-methods').children().each(function () { 2616 var _index = parseInt($(this).attr('data-index')); 2617 2618 if (_index !== index) { 2619 var html = $(this).html(), 2620 reg = new RegExp('giveasap_methods\\[' + _index + '\\]', 'g'); 2621 2622 var _html = html.replace(reg, 'giveasap_methods[' + index + ']'); 2623 2624 $(this).html(_html); 2625 $(this).attr('data-index', index); 2626 } 2627 2628 index++; 2629 }); 2630 } 2631 2632 $('.giveaway-sharing-methods').sortable({ 2633 update: function (event, ui) { 2634 giveaway_reset_methods_index(); 2635 } 2636 }); 2637 $(document).on('click', '.giveaway-sharing-method .method-header', function () { 2638 $(this).parent().toggleClass('active'); 2639 }); 2640 $(document).on('click', '.giveaway-sharing-method .button-delete', function () { 2641 $(this).parents('.giveaway-sharing-method').remove(); 2642 giveaway_reset_methods_index(); 2643 }); 2644 $(document).on('change', '.giveaway-sharing-method .method-select', function () { 2645 var value = $(this).val(); 2646 2647 if ('custom' === value) { 2648 var template = wp.template('sharing-method-custom'), 2649 method = $(this).parents('.giveaway-sharing-method'), 2650 index = method.attr('data-index'), 2651 data = { 2652 index: index, 2653 url: '', 2654 title: method.attr('data-title'), 2655 attributes: { 2656 url: '', 2657 text: '', 2658 image: '' 2659 } 2660 }, 2661 html = template(data); 2662 method.find('.giveasap-method-html').html(html); 2663 method.find('.color-picker').wpColorPicker(); 2664 } else { 2665 var method = $(this).parents('.giveaway-sharing-method'); 2666 method.find('.giveasap-method-html').html(''); 2667 } 2668 }); 2669 2670 function strip_tags(input, allowed) { 2671 allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>) 2672 2673 var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, 2674 commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; 2675 commentsAndPhpTags = /<(script|style)[^>]*?>.*?<\/\1>/g; 2676 return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { 2677 return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; 2678 }); 2679 } 2680 2681 $(document).on('keyup', '.giveaway-sharing-method .method-title', function () { 2682 var val = strip_tags($(this).val()); 2683 console.log(val); 2684 $(this).parents('.giveaway-sharing-method').find('.method-header strong').html(val); 2685 }); 2686 2687 if ($('.giveaway-sharing-methods').length) { 2688 $('.giveaway-sharing-methods .color-picker').wpColorPicker(); 2689 } 2690 /** Form Fields ********/ 2691 2692 2693 function giveaway_reset_form_fields_index() { 2694 var index = 0; 2695 $('.sg-form-fields-container').children().each(function () { 2696 var _index = parseInt($(this).attr('data-index')); 2697 2698 if (_index !== index) { 2699 var html = $(this).html(), 2700 reg = new RegExp('form_fields\\[' + _index + '\\]', 'g'); 2701 2702 var _html = html.replace(reg, 'form_fields[' + index + ']'); 2703 2704 $(this).html(_html); 2705 $(this).attr('data-index', index); 2706 } 2707 2708 index++; 2709 }); 2710 } 2711 2712 function giveaway_reset_prizes_fields_index() { 2713 var index = 0; 2714 $('.sg-prizes-field-container').children().each(function () { 2715 var _index = parseInt($(this).attr('data-index')); 2716 2717 if (_index !== index) { 2718 var html = $(this).html(), 2719 reg = new RegExp('form_fields\\[' + _index + '\\]', 'g'); 2720 2721 var _html = html.replace(reg, 'form_fields[' + index + ']'); 2722 2723 $(this).html(_html); 2724 $(this).attr('data-index', index); 2725 } 2726 2727 index++; 2728 }); 2729 } 2730 2731 $(document.body).on('change', '.sg-field-type', function (e) { 2732 var type = $(this).val(), 2733 $this = $(this), 2734 parent = $this.parent(); 2735 2736 if ('radio' === type || 'select' === type) { 2737 if (parent.find('.sg-form-field-options').length === 0) { 2738 var index = $this.parents('.sg-form-field').attr('data-index'), 2739 tmpl = wp.template('sg-form-field-options'), 2740 html = tmpl({ 2741 index: index 2742 }); 2743 parent.append(html); 2744 } 2745 } else { 2746 var options = parent.find('.sg-form-field-options'); 2747 2748 if (options.length) { 2749 options.remove(); 2750 } 2751 } 2752 }); 2753 $(document.body).on('click', '.sg-remove-form-field-option', function (e) { 2754 $(this).parent().remove(); 2755 }); 2756 $(document.body).on('click', '.sg-add-form-field-option', function (e) { 2757 e.preventDefault(); 2758 var index = $(this).parents('.sg-form-field').attr('data-index'), 2759 tmpl = wp.template('sg-form-field-option'), 2760 html = tmpl({ 2761 index: index 2762 }); 2763 $(this).parent().find('.sg-form-field-options-container').append(html); 2764 }); 2765 $('.sg-form-fields-container').sortable({ 2766 placeholder: "ui-state-highlight", 2767 handle: '.sg-form-row-handle', 2768 update: function (event, ui) { 2769 giveaway_reset_form_fields_index(); 2770 } 2771 }); 2772 $('#sgAddFormField').on('click', function () { 2773 var tmpl = wp.template('sg-form-field'), 2774 count = $('.sg-form-fields-container').children().length, 2775 html = tmpl({ 2776 index: count 2777 }); 2778 $('.sg-form-fields-container').append(html); 2779 }); 2780 $(document.body).on('click', '.sg-delete-form-field', function () { 2781 $(this).parents('.sg-form-field').remove(); 2782 giveaway_reset_form_fields_index(); 2783 }); 2784 $(document.body).on('click', '.sg-form-field-header .sg-field-name', function () { 2785 $(this).parents('.sg-form-field').toggleClass('open'); 2786 }); 2787 $(document.body).on('keyup', '.sg-form-field-body .sg-field-name input', function () { 2788 var value = $(this).val(); 2789 value = strip_tags(value); 2790 $(this).parents('.sg-form-field').find('.sg-form-field-header .sg-field-name').html(value); 2791 }); 2792 $('#sgAddPrizesField').on('click', function () { 2793 var tmpl = wp.template('sg-prizes-field'), 2794 count = $('.sg-prizes-field-container').children().length, 2795 html = tmpl({ 2796 index: count 2797 }); 2798 $('.sg-prizes-field-container').append(html); 2799 var prizesBox = $('.sg-prizes-field-container .sg-form-field').last(); 2800 prizesBox.toggleClass('open'); 2801 prizesBox.find('.sg-field-name input').focus(); 2802 sg_hide_show_metabox_fields_per_type(); 2803 $(document.body).triggerHandler('sg_prizes_field_added'); 2804 }); 2805 $(document.body).on('click', '.sg-delete-prizes-field', function () { 2806 $(this).parents('.sg-form-field').remove(); 2807 giveaway_reset_prizes_fields_index(); 2808 }); 2809 $('.sg-prizes-field-container').sortable({ 2810 placeholder: "ui-state-highlight", 2811 handle: '.sg-form-row-handle', 2812 update: function (event, ui) { 2813 giveaway_reset_prizes_fields_index(); 2814 } 2815 }); 2816 /** Giveaway ***********/ 2817 2818 function sg_hide_show_metabox_fields_per_type() { 2819 var giveaway_type = $('#giveasap_type').val(); 2820 $('.sg-metaboxes .hide_if_any').hide(); 2821 $('.sg-metaboxes .show_if_any').show(); 2822 $('.hide_if_' + giveaway_type).hide(); 2823 $('.show_if_' + giveaway_type).show(); // $('.sg-metaboxes tr:not(.hide_if_' + giveaway_type + ')').show(); 2824 2825 $(document.body).triggerHandler('sg_giveaway_type_changed', [giveaway_type]); 2826 } 2827 2828 if ($('#sg-metaboxes').length) { 2829 sg_hide_show_metabox_fields_per_type(); 2830 $('#giveasap_type').on('change', sg_hide_show_metabox_fields_per_type); 2831 } 2832 /** Globals ***********/ 2833 2834 2835 $(document).on('click', '.sg-button-action', function (e) { 2836 e.preventDefault(); 2837 var $this = $(this), 2838 ajax = $this.attr('data-ajax') || '', 2839 reload = $this.attr('data-reload') || '0', 2840 callback = $this.attr('data-callback') || '', 2841 nonce = $this.attr('data-nonce') || '', 2842 text2 = $this.attr('data-text'), 2843 text = $this.text(), 2844 href = $this.attr('href'); 2845 2846 if (text2) { 2847 $this.text(text2); 2848 } 2849 2850 if (ajax) { 2851 var data = { 2852 action: ajax 2853 }; 2854 2855 if (nonce) { 2856 data.nonce = gasap.nonce; 2857 } 2858 2859 if (this.attributes.length) { 2860 for (var i = 0; i < this.attributes.length; i++) { 2861 var attr = this.attributes[i]; 2862 data[attr.nodeName.replace('-', '_')] = attr.nodeValue; 2863 } 2864 } 2865 2866 $.ajax({ 2867 url: gasap.ajax_url, 2868 dataType: 'json', 2869 data: data, 2870 success: function (resp) { 2871 if (callback) { 2872 var fn = window[callback]; 2873 2874 if (typeof fn === 'function') { 2875 fn($this, resp); 2876 } 2877 } 2878 2879 if (text2 && '1' !== reload) { 2880 $this.text(text); 2881 } 2882 2883 if ('1' === reload) { 2884 if (href) { 2885 window.location.href = href; 2886 } else { 2887 location.reload(false); 2888 } 2889 } 2890 } 2891 }); 2892 } else { 2893 if (callback) { 2894 var fn = window[callback]; 2895 2896 if (typeof fn === 'function') { 2897 fn($this); 2898 } 2899 } 2900 2901 if (text2 && '1' !== reload) { 2902 $this.text(text); 2903 } 2904 2905 if ('1' === reload) { 2906 if (href) { 2907 window.location.href = href; 2908 } else { 2909 location.reload(false); 2910 } 2911 } 2912 } 2913 }); 2914 $('.sg-action-category-title').on('click', function (e) { 2915 $(this).parent().toggleClass('active'); 2916 }); 2917 $('.sg-action').on('click', function (e) { 2918 var $actionContainer = $('#sgEntriesActions'), 2919 count = $actionContainer.children().length, 2920 slug = $(this).attr('data-slug'), 2921 template = wp.template(slug); 2922 2923 if ($('#tmpl-' + slug).length) { 2924 e.preventDefault(); 2925 $actionContainer.append(template({ 2926 index: count 2927 })); 2928 $(document.body).trigger('sg-enhanced-select-search-init'); 2929 $(document.body).trigger('sg-color-picker-init'); 2930 var action = $actionContainer.children().last(); 2931 action.find('.sg-admin-action-title').trigger('click'); 2932 window.giveasap_max_instance_id = window.giveasap_max_instance_id + 1; 2933 action.find('.sg-action-form-instance').val(window.giveasap_max_instance_id); 2934 $([document.documentElement, document.body]).animate({ 2935 scrollTop: $actionContainer.children().last().offset().top - 24 // admin bar. 2936 2937 }, 500); 2938 } 2939 }); 2940 $('.sg-extra-actions').sortable({ 2941 update: function (event, ui) { 2942 giveaway_reset_extra_action_index(); 2943 giveasap_update_specific_mandatory_actions(); 2944 } 2945 }); 2946 $(document).on('click', '.sg-admin-action-remove', function (e) { 2947 e.preventDefault(); 2948 $(this).parents('.sg-admin-action').remove(); 2949 giveaway_reset_extra_action_index(); 2950 giveasap_update_specific_mandatory_actions(); 2951 }); 2952 2953 function giveaway_reset_extra_action_index() { 2954 var index = 0; 2955 $('.sg-extra-actions').children().each(function () { 2956 var _index = parseInt($(this).attr('data-index')); 2957 2958 if (_index !== index) { 2959 var html = $(this).html(), 2960 reg = new RegExp('entries_actions\\[' + _index + '\\]', 'g'); 2961 2962 var _html = html.replace(reg, 'entries_actions[' + index + ']'); 2963 2964 $(this).html(_html); 2965 $(this).attr('data-index', index); 2966 } 2967 2968 index++; 2969 }); 2970 } 2971 2972 $(document).on('click', '.sg-admin-action-title', function (e) { 2973 e.preventDefault(); 2974 $(this).parent().toggleClass('active'); 2975 }); 2976 $(document).on('click', '.sg-multioption-button', function (e) { 2977 e.preventDefault(); 2978 var id = $(this).attr('data-id'), 2979 name = $(this).attr('data-name'), 2980 tmpl = $(this).attr('data-template'), 2981 count = $('#' + id).children().length, 2982 template = wp.template(tmpl), 2983 html = template({ 2984 index: count, 2985 id: id, 2986 name: name 2987 }); 2988 $('#' + id).append(html); 2989 }); 2990 $(document).on('click', '.sg-multioption-delete', function (e) { 2991 e.preventDefault(); 2992 $(this).parent().remove(); 2993 }); 2994 $(document).on('keyup', '.sg-form-field-title input', function () { 2995 var parent = $(this).parents('.sg-admin-form'); 2996 var instance = parent.find('.sg-action-form-instance').val(); 2997 var title = $(this).val(); 2998 title = strip_tags(title); 2999 giveasap_update_specific_mandatory_action(instance, title); 3000 giveasap_update_specific_mandatory_actions(); 3001 }); 3002 $(document).on('change', '.mandatory-specific-action-checkbox', function () { 3003 var parent = $(this).parents('.sg-admin-form'); 3004 var field = $(this).parents('.sg-form-field'); 3005 var selected = field.attr('data-value'); 3006 var instance = parent.find('.sg-action-form-instance').val(); 3007 var value = $(this).val(); 3008 selected = selected.split(','); 3009 3010 if ($(this).prop('checked') && selected.indexOf(value) < 0) { 3011 selected.push(value); 3012 } 3013 3014 if (!$(this).prop('checked') && selected.indexOf(value) >= 0) { 3015 var index = selected.indexOf(value); 3016 3017 if (index > -1) { 3018 selected.splice(index, 1); 3019 } 3020 } 3021 3022 field.attr('data-value', selected.join(',')); 3023 }); 3024 3025 function giveasap_update_specific_mandatory_action(instance, title) { 3026 var ids = window.giveasap_actions.map(function (action) { 3027 return parseInt(action.instance); 3028 }); 3029 3030 if (ids.indexOf(parseInt(instance)) >= 0) { 3031 window.giveasap_actions = window.giveasap_actions.map(function (action) { 3032 if (parseInt(action.instance) !== parseInt(instance)) { 3033 return action; 3034 } 3035 3036 action.title = title; 3037 return action; 3038 }); 3039 } else { 3040 window.giveasap_actions.push({ 3041 instance: instance, 3042 title: title 3043 }); 3044 } 3045 } 3046 3047 function giveasap_update_specific_mandatory_actions() { 3048 $(document).find('.sg-select-specific-mandatory-actions').each(function () { 3049 var $this = $(this); 3050 var parent = $this.parents('.sg-admin-form'); 3051 var field = $this.parents('.sg-form-field'); 3052 var selected = field.attr('data-value'); 3053 var name = field.attr('data-name'); 3054 var instance = parent.find('.sg-action-form-instance').val(); 3055 var data = []; 3056 3057 if (selected) { 3058 selected = selected.split(','); 3059 } 3060 3061 if (window.giveasap_actions && window.giveasap_actions.length) { 3062 for (var g = 0; g < window.giveasap_actions.length; g++) { 3063 var action_id = window.giveasap_actions[g].instance; 3064 3065 if (parseInt(instance) === parseInt(action_id)) { 3066 continue; 3067 } 3068 3069 var optionSelected = selected && selected.indexOf(action_id) >= 0; 3070 data.push({ 3071 id: action_id, 3072 text: window.giveasap_actions[g].title, 3073 selected: optionSelected 3074 }); 3075 } 3076 } 3077 3078 if (!data.length) { 3079 field.addClass('hidden'); 3080 return; 3081 } 3082 3083 var html = ''; 3084 3085 for (var d = 0; d < data.length; d++) { 3086 var action = data[d]; 3087 var checkedHTML = ''; 3088 3089 if (action.selected) { 3090 checkedHTML = 'checked="checked"'; 3091 } 3092 3093 html += '<label for="' + instance + '_specific_action_' + d + '">'; 3094 html += '<input class="mandatory-specific-action-checkbox" ' + checkedHTML + ' id="' + instance + '_specific_action_' + d + '" type="checkbox" name="' + name + '" value="' + action.id + '"/>'; 3095 html += action.text; 3096 html += '</label>'; 3097 } 3098 3099 $this.html(html); 3100 field.removeClass('hidden'); 3101 }); 3102 } 3103 3104 giveasap_update_specific_mandatory_actions(); 3105 $(document).find('.sg-select2:not(.enhanced)').each(function () { 3106 if ($(this).parents('.sg-report-options').length) { 3107 return; 3108 } 3109 3110 var $this = $(this); 3111 $(this).select2({ 3112 placeholder: $this.attr('placeholder') || '', 3113 minimumInputLength: $this.attr('data-mininput') || 3, 3114 ajax: { 3115 url: gasap.ajax_url, 3116 dataType: 'json', 3117 data: function (params) { 3118 var query = { 3119 search: params.term, 3120 type: 'public', 3121 action: $this.attr('data-action') || 'sg_get_giveaways' 3122 }; // Query parameters will be ?search=[term]&type=public 3123 3124 return query; 3125 }, 3126 processResults: function (data) { 3127 if (data.success) { 3128 var items = []; 3129 3130 for (var index in data.data) { 3131 items.push({ 3132 id: data.data[index].ID, 3133 text: data.data[index].post_title 3134 }); 3135 } 3136 3137 return { 3138 results: items 3139 }; 3140 } // Transforms the top-level key of the response object from 'items' to 'results' 3141 3142 3143 return { 3144 results: data.items 3145 }; 3146 } 3147 } 3148 }).addClass('enhanced'); 3149 }); 3150 3151 3152 /** Select2 Ajax **/ 3153 3154 $(document.body).on('sg-enhanced-select-search-init', function () { 3155 // Ajax product search box 3156 $(':input.sg-select-search').filter(':not(.enhanced)').each(function () { 3157 var select2_args = { 3158 allowClear: $(this).data('allow_clear') ? true : false, 3159 placeholder: $(this).data('placeholder'), 3160 minimumInputLength: $(this).data('minimum_input_length') ? $(this).data('minimum_input_length') : '3', 3161 escapeMarkup: function (m) { 3162 return m; 3163 }, 3164 ajax: { 3165 url: gasap.ajax_url, 3166 dataType: 'json', 3167 delay: 250, 3168 data: function (params) { 3169 return { 3170 term: params.term, 3171 action: $(this).data('action') || 'sg_select_search', 3172 security: gasap.nonce, 3173 exclude: $(this).data('exclude'), 3174 exclude_type: $(this).data('exclude_type'), 3175 include: $(this).data('include'), 3176 limit: $(this).data('limit'), 3177 display_stock: $(this).data('display_stock') 3178 }; 3179 }, 3180 processResults: function (data) { 3181 var terms = []; 3182 3183 if (data) { 3184 $.each(data, function (id, text) { 3185 terms.push({ 3186 id: id, 3187 text: text 3188 }); 3189 }); 3190 } 3191 3192 return { 3193 results: terms 3194 }; 3195 }, 3196 cache: true 3197 } 3198 }; 3199 $(this).select2(select2_args).addClass('enhanced'); 3200 3201 if ($(this).prop('multiple')) { 3202 $(this).on('change', function () { 3203 var $children = $(this).children(); 3204 $children.sort(function (a, b) { 3205 var atext = a.text.toLowerCase(); 3206 var btext = b.text.toLowerCase(); 3207 3208 if (atext > btext) { 3209 return 1; 3210 } 3211 3212 if (atext < btext) { 3213 return -1; 3214 } 3215 3216 return 0; 3217 }); 3218 $(this).html($children); 3219 }); 3220 } 3221 }); 3222 }).trigger('sg-enhanced-select-search-init'); 3223 $(document.body).on('sg-color-picker-init', function () { 3224 // Ajax product search box 3225 $(':input.sg-color-picker').filter(':not(.enhanced)').each(function () { 3226 $(this).wpColorPicker(); 3227 }); 3228 }).trigger('sg-color-picker-init'); 3229 }); 3230 })(jQuery); 3231 }(); 3232 /******/ })() 3233 ; 3234 //# sourceMappingURL=admin.js.map -
giveasap/trunk/assets/dist/js/admin.js.map
r2878241 r2882364 1 {"version":3,"file":"js/admin.js","mappings":";;;;;;;;;AAAA;AACA;AACA,qCAAqC;AACrC,CAAC;AACD,IAAI,IAA0C;AAC9C;AACA,CAAC,iCAAO,CAAC,2CAAQ,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,kGAAC;AAC5B,GAAG,KAAK,EAMN;AACF,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;;;AAIA,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,IAAI;AACJ;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,uBAAuB;AACvB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,8DAA8D;;AAE9D;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;;AAGF;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ,IAAI;AACJ;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,OAAO;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,QAAQ;AACR;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA,2CAA2C,cAAc,kBAAkB,oBAAoB,aAAa;AAC5G;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;;;;;AAKH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,8EAA8E;;AAE9E;;AAEA;;AAEA;;AAEA;AACA;;;;AAIA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B,IAAI;AACJ;AACA;AACA;;AAEA,GAAG;AACH;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAM;;AAEN;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;;AAEA;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,OAAO;;AAEf,OAAO,aAAa;;AAEpB,MAAM,OAAO;;;AAGb;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;AAID;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB,OAAO;AACP,4BAA4B;AAC5B;AACA,KAAK;AACL;AACA;AACA,IAAI;;AAEJ;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,CAAC;;;;AAID;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;;AAEA,yBAAyB;;AAEzB;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;;AAEN;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,cAAc,qDAAqD;AACnE;AACA;AACA,cAAc,qDAAqD;AACnE;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,mDAAmD,mBAAmB;AACtE,GAAG;AACH;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA,oBAAoB;;;;;;;;;;ACn0DpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,IAAI,KAA6B;AACjC;AACA;;;;;;;;;;;;ACrIA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,oBAAT,CAA+BC,eAA/B,EAAgDC,WAAhD,EAA8D;EAC7D;;EA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CAAV,EAAaC,CAAb,EAAgB;cACf,IAAIC,KAAK,GAAGF,CAAC,CAACtK,IAAF,CAAOyK,WAAP,EAAZ;cACA,IAAIC,KAAK,GAAGH,CAAC,CAACvK,IAAF,CAAOyK,WAAP,EAAZ;;cAEA,IAAID,KAAK,GAAGE,KAAZ,EAAmB;gBAClB,OAAO,CAAP;cACA;;cACD,IAAIF,KAAK,GAAGE,KAAZ,EAAmB;gBAClB,OAAO,CAAC,CAAR;cACA;;cACD,OAAO,CAAP;YACA,CAZF;YAcA/M,CAAC,CAAE,IAAF,CAAD,CAAUsC,IAAV,CAAgBmK,SAAhB;UACA,CAnBF;QAqBA;MACD,CApEF;IAsEA,CA5EF,EA6EE5F,OA7EF,CA6EW,gCA7EX;IA+EA7G,CAAC,CAAEc,QAAQ,CAACE,IAAX,CAAD,CACCjE,EADD,CAEC,sBAFD,EAGC,YAAW;MACV;MACAiD,CAAC,CAAE,wBAAF,CAAD,CAA8B2L,MAA9B,CAAsC,iBAAtC,EAA0D1L,IAA1D,CACC,YAAY;QACXD,CAAC,CAAE,IAAF,CAAD,CAAUwH,aAAV;MACA,CAHF;IAKA,CAVF,EAWEX,OAXF,CAWW,sBAXX;EAYA,CAp3CF;AAs3CA,CAx3CD,EAw3CIzH,MAx3CJ,E","sources":["webpack://simple-giveaways/./node_modules/magnific-popup/dist/jquery.magnific-popup.js","webpack://simple-giveaways/./node_modules/tlite/tlite.js","webpack://simple-giveaways/external var \"jQuery\"","webpack://simple-giveaways/webpack/bootstrap","webpack://simple-giveaways/webpack/runtime/compat get default export","webpack://simple-giveaways/webpack/runtime/define property getters","webpack://simple-giveaways/webpack/runtime/hasOwnProperty shorthand","webpack://simple-giveaways/webpack/runtime/make namespace object","webpack://simple-giveaways/./assets/js/admin.js"],"sourcesContent":["/*! Magnific Popup - v1.1.0 - 2016-02-20\n* http://dimsemenov.com/plugins/magnific-popup/\n* Copyright (c) 2016 Dmitry Semenov; */\n;(function (factory) { \nif (typeof define === 'function' && define.amd) { \n // AMD. Register as an anonymous module. \n define(['jquery'], factory); \n } else if (typeof exports === 'object') { \n // Node/CommonJS \n factory(require('jquery')); \n } else { \n // Browser globals \n factory(window.jQuery || window.Zepto); \n } \n }(function($) { \n\n/*>>core*/\n/**\n * \n * Magnific Popup Core JS file\n * \n */\n\n\n/**\n * Private static constants\n */\nvar CLOSE_EVENT = 'Close',\n\tBEFORE_CLOSE_EVENT = 'BeforeClose',\n\tAFTER_CLOSE_EVENT = 'AfterClose',\n\tBEFORE_APPEND_EVENT = 'BeforeAppend',\n\tMARKUP_PARSE_EVENT = 'MarkupParse',\n\tOPEN_EVENT = 'Open',\n\tCHANGE_EVENT = 'Change',\n\tNS = 'mfp',\n\tEVENT_NS = '.' + NS,\n\tREADY_CLASS = 'mfp-ready',\n\tREMOVING_CLASS = 'mfp-removing',\n\tPREVENT_CLOSE_CLASS = 'mfp-prevent-close';\n\n\n/**\n * Private vars \n */\n/*jshint -W079 */\nvar mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'\n\tMagnificPopup = function(){},\n\t_isJQ = !!(window.jQuery),\n\t_prevStatus,\n\t_window = $(window),\n\t_document,\n\t_prevContentType,\n\t_wrapClasses,\n\t_currPopupType;\n\n\n/**\n * Private functions\n */\nvar _mfpOn = function(name, f) {\n\t\tmfp.ev.on(NS + name + EVENT_NS, f);\n\t},\n\t_getEl = function(className, appendTo, html, raw) {\n\t\tvar el = document.createElement('div');\n\t\tel.className = 'mfp-'+className;\n\t\tif(html) {\n\t\t\tel.innerHTML = html;\n\t\t}\n\t\tif(!raw) {\n\t\t\tel = $(el);\n\t\t\tif(appendTo) {\n\t\t\t\tel.appendTo(appendTo);\n\t\t\t}\n\t\t} else if(appendTo) {\n\t\t\tappendTo.appendChild(el);\n\t\t}\n\t\treturn el;\n\t},\n\t_mfpTrigger = function(e, data) {\n\t\tmfp.ev.triggerHandler(NS + e, data);\n\n\t\tif(mfp.st.callbacks) {\n\t\t\t// converts \"mfpEventName\" to \"eventName\" callback and triggers it if it's present\n\t\t\te = e.charAt(0).toLowerCase() + e.slice(1);\n\t\t\tif(mfp.st.callbacks[e]) {\n\t\t\t\tmfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);\n\t\t\t}\n\t\t}\n\t},\n\t_getCloseBtn = function(type) {\n\t\tif(type !== _currPopupType || !mfp.currTemplate.closeBtn) {\n\t\t\tmfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );\n\t\t\t_currPopupType = type;\n\t\t}\n\t\treturn mfp.currTemplate.closeBtn;\n\t},\n\t// Initialize Magnific Popup only when called at least once\n\t_checkInstance = function() {\n\t\tif(!$.magnificPopup.instance) {\n\t\t\t/*jshint -W020 */\n\t\t\tmfp = new MagnificPopup();\n\t\t\tmfp.init();\n\t\t\t$.magnificPopup.instance = mfp;\n\t\t}\n\t},\n\t// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr\n\tsupportsTransitions = function() {\n\t\tvar s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist\n\t\t\tv = ['ms','O','Moz','Webkit']; // 'v' for vendor\n\n\t\tif( s['transition'] !== undefined ) {\n\t\t\treturn true; \n\t\t}\n\t\t\t\n\t\twhile( v.length ) {\n\t\t\tif( v.pop() + 'Transition' in s ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\treturn false;\n\t};\n\n\n\n/**\n * Public functions\n */\nMagnificPopup.prototype = {\n\n\tconstructor: MagnificPopup,\n\n\t/**\n\t * Initializes Magnific Popup plugin. \n\t * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed\n\t */\n\tinit: function() {\n\t\tvar appVersion = navigator.appVersion;\n\t\tmfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;\n\t\tmfp.isAndroid = (/android/gi).test(appVersion);\n\t\tmfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);\n\t\tmfp.supportsTransition = supportsTransitions();\n\n\t\t// We disable fixed positioned lightbox on devices that don't handle it nicely.\n\t\t// If you know a better way of detecting this - let me know.\n\t\tmfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );\n\t\t_document = $(document);\n\n\t\tmfp.popupsCache = {};\n\t},\n\n\t/**\n\t * Opens popup\n\t * @param data [description]\n\t */\n\topen: function(data) {\n\n\t\tvar i;\n\n\t\tif(data.isObj === false) { \n\t\t\t// convert jQuery collection to array to avoid conflicts later\n\t\t\tmfp.items = data.items.toArray();\n\n\t\t\tmfp.index = 0;\n\t\t\tvar items = data.items,\n\t\t\t\titem;\n\t\t\tfor(i = 0; i < items.length; i++) {\n\t\t\t\titem = items[i];\n\t\t\t\tif(item.parsed) {\n\t\t\t\t\titem = item.el[0];\n\t\t\t\t}\n\t\t\t\tif(item === data.el[0]) {\n\t\t\t\t\tmfp.index = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tmfp.items = $.isArray(data.items) ? data.items : [data.items];\n\t\t\tmfp.index = data.index || 0;\n\t\t}\n\n\t\t// if popup is already opened - we just update the content\n\t\tif(mfp.isOpen) {\n\t\t\tmfp.updateItemHTML();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tmfp.types = []; \n\t\t_wrapClasses = '';\n\t\tif(data.mainEl && data.mainEl.length) {\n\t\t\tmfp.ev = data.mainEl.eq(0);\n\t\t} else {\n\t\t\tmfp.ev = _document;\n\t\t}\n\n\t\tif(data.key) {\n\t\t\tif(!mfp.popupsCache[data.key]) {\n\t\t\t\tmfp.popupsCache[data.key] = {};\n\t\t\t}\n\t\t\tmfp.currTemplate = mfp.popupsCache[data.key];\n\t\t} else {\n\t\t\tmfp.currTemplate = {};\n\t\t}\n\n\n\n\t\tmfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); \n\t\tmfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;\n\n\t\tif(mfp.st.modal) {\n\t\t\tmfp.st.closeOnContentClick = false;\n\t\t\tmfp.st.closeOnBgClick = false;\n\t\t\tmfp.st.showCloseBtn = false;\n\t\t\tmfp.st.enableEscapeKey = false;\n\t\t}\n\t\t\n\n\t\t// Building markup\n\t\t// main containers are created only once\n\t\tif(!mfp.bgOverlay) {\n\n\t\t\t// Dark overlay\n\t\t\tmfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {\n\t\t\t\tmfp.close();\n\t\t\t});\n\n\t\t\tmfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {\n\t\t\t\tif(mfp._checkIfClose(e.target)) {\n\t\t\t\t\tmfp.close();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmfp.container = _getEl('container', mfp.wrap);\n\t\t}\n\n\t\tmfp.contentContainer = _getEl('content');\n\t\tif(mfp.st.preloader) {\n\t\t\tmfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);\n\t\t}\n\n\n\t\t// Initializing modules\n\t\tvar modules = $.magnificPopup.modules;\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar n = modules[i];\n\t\t\tn = n.charAt(0).toUpperCase() + n.slice(1);\n\t\t\tmfp['init'+n].call(mfp);\n\t\t}\n\t\t_mfpTrigger('BeforeOpen');\n\n\n\t\tif(mfp.st.showCloseBtn) {\n\t\t\t// Close button\n\t\t\tif(!mfp.st.closeBtnInside) {\n\t\t\t\tmfp.wrap.append( _getCloseBtn() );\n\t\t\t} else {\n\t\t\t\t_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {\n\t\t\t\t\tvalues.close_replaceWith = _getCloseBtn(item.type);\n\t\t\t\t});\n\t\t\t\t_wrapClasses += ' mfp-close-btn-in';\n\t\t\t}\n\t\t}\n\n\t\tif(mfp.st.alignTop) {\n\t\t\t_wrapClasses += ' mfp-align-top';\n\t\t}\n\n\t\n\n\t\tif(mfp.fixedContentPos) {\n\t\t\tmfp.wrap.css({\n\t\t\t\toverflow: mfp.st.overflowY,\n\t\t\t\toverflowX: 'hidden',\n\t\t\t\toverflowY: mfp.st.overflowY\n\t\t\t});\n\t\t} else {\n\t\t\tmfp.wrap.css({ \n\t\t\t\ttop: _window.scrollTop(),\n\t\t\t\tposition: 'absolute'\n\t\t\t});\n\t\t}\n\t\tif( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {\n\t\t\tmfp.bgOverlay.css({\n\t\t\t\theight: _document.height(),\n\t\t\t\tposition: 'absolute'\n\t\t\t});\n\t\t}\n\n\t\t\n\n\t\tif(mfp.st.enableEscapeKey) {\n\t\t\t// Close on ESC key\n\t\t\t_document.on('keyup' + EVENT_NS, function(e) {\n\t\t\t\tif(e.keyCode === 27) {\n\t\t\t\t\tmfp.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t_window.on('resize' + EVENT_NS, function() {\n\t\t\tmfp.updateSize();\n\t\t});\n\n\n\t\tif(!mfp.st.closeOnContentClick) {\n\t\t\t_wrapClasses += ' mfp-auto-cursor';\n\t\t}\n\t\t\n\t\tif(_wrapClasses)\n\t\t\tmfp.wrap.addClass(_wrapClasses);\n\n\n\t\t// this triggers recalculation of layout, so we get it once to not to trigger twice\n\t\tvar windowHeight = mfp.wH = _window.height();\n\n\t\t\n\t\tvar windowStyles = {};\n\n\t\tif( mfp.fixedContentPos ) {\n if(mfp._hasScrollBar(windowHeight)){\n var s = mfp._getScrollbarSize();\n if(s) {\n windowStyles.marginRight = s;\n }\n }\n }\n\n\t\tif(mfp.fixedContentPos) {\n\t\t\tif(!mfp.isIE7) {\n\t\t\t\twindowStyles.overflow = 'hidden';\n\t\t\t} else {\n\t\t\t\t// ie7 double-scroll bug\n\t\t\t\t$('body, html').css('overflow', 'hidden');\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\tvar classesToadd = mfp.st.mainClass;\n\t\tif(mfp.isIE7) {\n\t\t\tclassesToadd += ' mfp-ie7';\n\t\t}\n\t\tif(classesToadd) {\n\t\t\tmfp._addClassToMFP( classesToadd );\n\t\t}\n\n\t\t// add content\n\t\tmfp.updateItemHTML();\n\n\t\t_mfpTrigger('BuildControls');\n\n\t\t// remove scrollbar, add margin e.t.c\n\t\t$('html').css(windowStyles);\n\t\t\n\t\t// add everything to DOM\n\t\tmfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );\n\n\t\t// Save last focused element\n\t\tmfp._lastFocusedEl = document.activeElement;\n\t\t\n\t\t// Wait for next cycle to allow CSS transition\n\t\tsetTimeout(function() {\n\t\t\t\n\t\t\tif(mfp.content) {\n\t\t\t\tmfp._addClassToMFP(READY_CLASS);\n\t\t\t\tmfp._setFocus();\n\t\t\t} else {\n\t\t\t\t// if content is not defined (not loaded e.t.c) we add class only for BG\n\t\t\t\tmfp.bgOverlay.addClass(READY_CLASS);\n\t\t\t}\n\t\t\t\n\t\t\t// Trap the focus in popup\n\t\t\t_document.on('focusin' + EVENT_NS, mfp._onFocusIn);\n\n\t\t}, 16);\n\n\t\tmfp.isOpen = true;\n\t\tmfp.updateSize(windowHeight);\n\t\t_mfpTrigger(OPEN_EVENT);\n\n\t\treturn data;\n\t},\n\n\t/**\n\t * Closes the popup\n\t */\n\tclose: function() {\n\t\tif(!mfp.isOpen) return;\n\t\t_mfpTrigger(BEFORE_CLOSE_EVENT);\n\n\t\tmfp.isOpen = false;\n\t\t// for CSS3 animation\n\t\tif(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {\n\t\t\tmfp._addClassToMFP(REMOVING_CLASS);\n\t\t\tsetTimeout(function() {\n\t\t\t\tmfp._close();\n\t\t\t}, mfp.st.removalDelay);\n\t\t} else {\n\t\t\tmfp._close();\n\t\t}\n\t},\n\n\t/**\n\t * Helper for close() function\n\t */\n\t_close: function() {\n\t\t_mfpTrigger(CLOSE_EVENT);\n\n\t\tvar classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';\n\n\t\tmfp.bgOverlay.detach();\n\t\tmfp.wrap.detach();\n\t\tmfp.container.empty();\n\n\t\tif(mfp.st.mainClass) {\n\t\t\tclassesToRemove += mfp.st.mainClass + ' ';\n\t\t}\n\n\t\tmfp._removeClassFromMFP(classesToRemove);\n\n\t\tif(mfp.fixedContentPos) {\n\t\t\tvar windowStyles = {marginRight: ''};\n\t\t\tif(mfp.isIE7) {\n\t\t\t\t$('body, html').css('overflow', '');\n\t\t\t} else {\n\t\t\t\twindowStyles.overflow = '';\n\t\t\t}\n\t\t\t$('html').css(windowStyles);\n\t\t}\n\t\t\n\t\t_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);\n\t\tmfp.ev.off(EVENT_NS);\n\n\t\t// clean up DOM elements that aren't removed\n\t\tmfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');\n\t\tmfp.bgOverlay.attr('class', 'mfp-bg');\n\t\tmfp.container.attr('class', 'mfp-container');\n\n\t\t// remove close button from target element\n\t\tif(mfp.st.showCloseBtn &&\n\t\t(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {\n\t\t\tif(mfp.currTemplate.closeBtn)\n\t\t\t\tmfp.currTemplate.closeBtn.detach();\n\t\t}\n\n\n\t\tif(mfp.st.autoFocusLast && mfp._lastFocusedEl) {\n\t\t\t$(mfp._lastFocusedEl).focus(); // put tab focus back\n\t\t}\n\t\tmfp.currItem = null;\t\n\t\tmfp.content = null;\n\t\tmfp.currTemplate = null;\n\t\tmfp.prevHeight = 0;\n\n\t\t_mfpTrigger(AFTER_CLOSE_EVENT);\n\t},\n\t\n\tupdateSize: function(winHeight) {\n\n\t\tif(mfp.isIOS) {\n\t\t\t// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2\n\t\t\tvar zoomLevel = document.documentElement.clientWidth / window.innerWidth;\n\t\t\tvar height = window.innerHeight * zoomLevel;\n\t\t\tmfp.wrap.css('height', height);\n\t\t\tmfp.wH = height;\n\t\t} else {\n\t\t\tmfp.wH = winHeight || _window.height();\n\t\t}\n\t\t// Fixes #84: popup incorrectly positioned with position:relative on body\n\t\tif(!mfp.fixedContentPos) {\n\t\t\tmfp.wrap.css('height', mfp.wH);\n\t\t}\n\n\t\t_mfpTrigger('Resize');\n\n\t},\n\n\t/**\n\t * Set content of popup based on current index\n\t */\n\tupdateItemHTML: function() {\n\t\tvar item = mfp.items[mfp.index];\n\n\t\t// Detach and perform modifications\n\t\tmfp.contentContainer.detach();\n\n\t\tif(mfp.content)\n\t\t\tmfp.content.detach();\n\n\t\tif(!item.parsed) {\n\t\t\titem = mfp.parseEl( mfp.index );\n\t\t}\n\n\t\tvar type = item.type;\n\n\t\t_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);\n\t\t// BeforeChange event works like so:\n\t\t// _mfpOn('BeforeChange', function(e, prevType, newType) { });\n\n\t\tmfp.currItem = item;\n\n\t\tif(!mfp.currTemplate[type]) {\n\t\t\tvar markup = mfp.st[type] ? mfp.st[type].markup : false;\n\n\t\t\t// allows to modify markup\n\t\t\t_mfpTrigger('FirstMarkupParse', markup);\n\n\t\t\tif(markup) {\n\t\t\t\tmfp.currTemplate[type] = $(markup);\n\t\t\t} else {\n\t\t\t\t// if there is no markup found we just define that template is parsed\n\t\t\t\tmfp.currTemplate[type] = true;\n\t\t\t}\n\t\t}\n\n\t\tif(_prevContentType && _prevContentType !== item.type) {\n\t\t\tmfp.container.removeClass('mfp-'+_prevContentType+'-holder');\n\t\t}\n\n\t\tvar newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);\n\t\tmfp.appendContent(newContent, type);\n\n\t\titem.preloaded = true;\n\n\t\t_mfpTrigger(CHANGE_EVENT, item);\n\t\t_prevContentType = item.type;\n\n\t\t// Append container back after its content changed\n\t\tmfp.container.prepend(mfp.contentContainer);\n\n\t\t_mfpTrigger('AfterChange');\n\t},\n\n\n\t/**\n\t * Set HTML content of popup\n\t */\n\tappendContent: function(newContent, type) {\n\t\tmfp.content = newContent;\n\n\t\tif(newContent) {\n\t\t\tif(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&\n\t\t\t\tmfp.currTemplate[type] === true) {\n\t\t\t\t// if there is no markup, we just append close button element inside\n\t\t\t\tif(!mfp.content.find('.mfp-close').length) {\n\t\t\t\t\tmfp.content.append(_getCloseBtn());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmfp.content = newContent;\n\t\t\t}\n\t\t} else {\n\t\t\tmfp.content = '';\n\t\t}\n\n\t\t_mfpTrigger(BEFORE_APPEND_EVENT);\n\t\tmfp.container.addClass('mfp-'+type+'-holder');\n\n\t\tmfp.contentContainer.append(mfp.content);\n\t},\n\n\n\t/**\n\t * Creates Magnific Popup data object based on given data\n\t * @param {int} index Index of item to parse\n\t */\n\tparseEl: function(index) {\n\t\tvar item = mfp.items[index],\n\t\t\ttype;\n\n\t\tif(item.tagName) {\n\t\t\titem = { el: $(item) };\n\t\t} else {\n\t\t\ttype = item.type;\n\t\t\titem = { data: item, src: item.src };\n\t\t}\n\n\t\tif(item.el) {\n\t\t\tvar types = mfp.types;\n\n\t\t\t// check for 'mfp-TYPE' class\n\t\t\tfor(var i = 0; i < types.length; i++) {\n\t\t\t\tif( item.el.hasClass('mfp-'+types[i]) ) {\n\t\t\t\t\ttype = types[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titem.src = item.el.attr('data-mfp-src');\n\t\t\tif(!item.src) {\n\t\t\t\titem.src = item.el.attr('href');\n\t\t\t}\n\t\t}\n\n\t\titem.type = type || mfp.st.type || 'inline';\n\t\titem.index = index;\n\t\titem.parsed = true;\n\t\tmfp.items[index] = item;\n\t\t_mfpTrigger('ElementParse', item);\n\n\t\treturn mfp.items[index];\n\t},\n\n\n\t/**\n\t * Initializes single popup or a group of popups\n\t */\n\taddGroup: function(el, options) {\n\t\tvar eHandler = function(e) {\n\t\t\te.mfpEl = this;\n\t\t\tmfp._openClick(e, el, options);\n\t\t};\n\n\t\tif(!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\tvar eName = 'click.magnificPopup';\n\t\toptions.mainEl = el;\n\n\t\tif(options.items) {\n\t\t\toptions.isObj = true;\n\t\t\tel.off(eName).on(eName, eHandler);\n\t\t} else {\n\t\t\toptions.isObj = false;\n\t\t\tif(options.delegate) {\n\t\t\t\tel.off(eName).on(eName, options.delegate , eHandler);\n\t\t\t} else {\n\t\t\t\toptions.items = el;\n\t\t\t\tel.off(eName).on(eName, eHandler);\n\t\t\t}\n\t\t}\n\t},\n\t_openClick: function(e, el, options) {\n\t\tvar midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;\n\n\n\t\tif(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;\n\n\t\tif(disableOn) {\n\t\t\tif($.isFunction(disableOn)) {\n\t\t\t\tif( !disableOn.call(mfp) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else { // else it's number\n\t\t\t\tif( _window.width() < disableOn ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(e.type) {\n\t\t\te.preventDefault();\n\n\t\t\t// This will prevent popup from closing if element is inside and popup is already opened\n\t\t\tif(mfp.isOpen) {\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t}\n\n\t\toptions.el = $(e.mfpEl);\n\t\tif(options.delegate) {\n\t\t\toptions.items = el.find(options.delegate);\n\t\t}\n\t\tmfp.open(options);\n\t},\n\n\n\t/**\n\t * Updates text on preloader\n\t */\n\tupdateStatus: function(status, text) {\n\n\t\tif(mfp.preloader) {\n\t\t\tif(_prevStatus !== status) {\n\t\t\t\tmfp.container.removeClass('mfp-s-'+_prevStatus);\n\t\t\t}\n\n\t\t\tif(!text && status === 'loading') {\n\t\t\t\ttext = mfp.st.tLoading;\n\t\t\t}\n\n\t\t\tvar data = {\n\t\t\t\tstatus: status,\n\t\t\t\ttext: text\n\t\t\t};\n\t\t\t// allows to modify status\n\t\t\t_mfpTrigger('UpdateStatus', data);\n\n\t\t\tstatus = data.status;\n\t\t\ttext = data.text;\n\n\t\t\tmfp.preloader.html(text);\n\n\t\t\tmfp.preloader.find('a').on('click', function(e) {\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t});\n\n\t\t\tmfp.container.addClass('mfp-s-'+status);\n\t\t\t_prevStatus = status;\n\t\t}\n\t},\n\n\n\t/*\n\t\t\"Private\" helpers that aren't private at all\n\t */\n\t// Check to close popup or not\n\t// \"target\" is an element that was clicked\n\t_checkIfClose: function(target) {\n\n\t\tif($(target).hasClass(PREVENT_CLOSE_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar closeOnContent = mfp.st.closeOnContentClick;\n\t\tvar closeOnBg = mfp.st.closeOnBgClick;\n\n\t\tif(closeOnContent && closeOnBg) {\n\t\t\treturn true;\n\t\t} else {\n\n\t\t\t// We close the popup if click is on close button or on preloader. Or if there is no content.\n\t\t\tif(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if click is outside the content\n\t\t\tif( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {\n\t\t\t\tif(closeOnBg) {\n\t\t\t\t\t// last check, if the clicked element is in DOM, (in case it's removed onclick)\n\t\t\t\t\tif( $.contains(document, target) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(closeOnContent) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t},\n\t_addClassToMFP: function(cName) {\n\t\tmfp.bgOverlay.addClass(cName);\n\t\tmfp.wrap.addClass(cName);\n\t},\n\t_removeClassFromMFP: function(cName) {\n\t\tthis.bgOverlay.removeClass(cName);\n\t\tmfp.wrap.removeClass(cName);\n\t},\n\t_hasScrollBar: function(winHeight) {\n\t\treturn ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );\n\t},\n\t_setFocus: function() {\n\t\t(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();\n\t},\n\t_onFocusIn: function(e) {\n\t\tif( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {\n\t\t\tmfp._setFocus();\n\t\t\treturn false;\n\t\t}\n\t},\n\t_parseMarkup: function(template, values, item) {\n\t\tvar arr;\n\t\tif(item.data) {\n\t\t\tvalues = $.extend(item.data, values);\n\t\t}\n\t\t_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );\n\n\t\t$.each(values, function(key, value) {\n\t\t\tif(value === undefined || value === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tarr = key.split('_');\n\t\t\tif(arr.length > 1) {\n\t\t\t\tvar el = template.find(EVENT_NS + '-'+arr[0]);\n\n\t\t\t\tif(el.length > 0) {\n\t\t\t\t\tvar attr = arr[1];\n\t\t\t\t\tif(attr === 'replaceWith') {\n\t\t\t\t\t\tif(el[0] !== value[0]) {\n\t\t\t\t\t\t\tel.replaceWith(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(attr === 'img') {\n\t\t\t\t\t\tif(el.is('img')) {\n\t\t\t\t\t\t\tel.attr('src', value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tel.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.attr(arr[1], value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\ttemplate.find(EVENT_NS + '-'+key).html(value);\n\t\t\t}\n\t\t});\n\t},\n\n\t_getScrollbarSize: function() {\n\t\t// thx David\n\t\tif(mfp.scrollbarSize === undefined) {\n\t\t\tvar scrollDiv = document.createElement(\"div\");\n\t\t\tscrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';\n\t\t\tdocument.body.appendChild(scrollDiv);\n\t\t\tmfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n\t\t\tdocument.body.removeChild(scrollDiv);\n\t\t}\n\t\treturn mfp.scrollbarSize;\n\t}\n\n}; /* MagnificPopup core prototype end */\n\n\n\n\n/**\n * Public static functions\n */\n$.magnificPopup = {\n\tinstance: null,\n\tproto: MagnificPopup.prototype,\n\tmodules: [],\n\n\topen: function(options, index) {\n\t\t_checkInstance();\n\n\t\tif(!options) {\n\t\t\toptions = {};\n\t\t} else {\n\t\t\toptions = $.extend(true, {}, options);\n\t\t}\n\n\t\toptions.isObj = true;\n\t\toptions.index = index || 0;\n\t\treturn this.instance.open(options);\n\t},\n\n\tclose: function() {\n\t\treturn $.magnificPopup.instance && $.magnificPopup.instance.close();\n\t},\n\n\tregisterModule: function(name, module) {\n\t\tif(module.options) {\n\t\t\t$.magnificPopup.defaults[name] = module.options;\n\t\t}\n\t\t$.extend(this.proto, module.proto);\n\t\tthis.modules.push(name);\n\t},\n\n\tdefaults: {\n\n\t\t// Info about options is in docs:\n\t\t// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options\n\n\t\tdisableOn: 0,\n\n\t\tkey: null,\n\n\t\tmidClick: false,\n\n\t\tmainClass: '',\n\n\t\tpreloader: true,\n\n\t\tfocus: '', // CSS selector of input to focus after popup is opened\n\n\t\tcloseOnContentClick: false,\n\n\t\tcloseOnBgClick: true,\n\n\t\tcloseBtnInside: true,\n\n\t\tshowCloseBtn: true,\n\n\t\tenableEscapeKey: true,\n\n\t\tmodal: false,\n\n\t\talignTop: false,\n\n\t\tremovalDelay: 0,\n\n\t\tprependTo: null,\n\n\t\tfixedContentPos: 'auto',\n\n\t\tfixedBgPos: 'auto',\n\n\t\toverflowY: 'auto',\n\n\t\tcloseMarkup: '<button title=\"%title%\" type=\"button\" class=\"mfp-close\">×</button>',\n\n\t\ttClose: 'Close (Esc)',\n\n\t\ttLoading: 'Loading...',\n\n\t\tautoFocusLast: true\n\n\t}\n};\n\n\n\n$.fn.magnificPopup = function(options) {\n\t_checkInstance();\n\n\tvar jqEl = $(this);\n\n\t// We call some API method of first param is a string\n\tif (typeof options === \"string\" ) {\n\n\t\tif(options === 'open') {\n\t\t\tvar items,\n\t\t\t\titemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,\n\t\t\t\tindex = parseInt(arguments[1], 10) || 0;\n\n\t\t\tif(itemOpts.items) {\n\t\t\t\titems = itemOpts.items[index];\n\t\t\t} else {\n\t\t\t\titems = jqEl;\n\t\t\t\tif(itemOpts.delegate) {\n\t\t\t\t\titems = items.find(itemOpts.delegate);\n\t\t\t\t}\n\t\t\t\titems = items.eq( index );\n\t\t\t}\n\t\t\tmfp._openClick({mfpEl:items}, jqEl, itemOpts);\n\t\t} else {\n\t\t\tif(mfp.isOpen)\n\t\t\t\tmfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));\n\t\t}\n\n\t} else {\n\t\t// clone options obj\n\t\toptions = $.extend(true, {}, options);\n\n\t\t/*\n\t\t * As Zepto doesn't support .data() method for objects\n\t\t * and it works only in normal browsers\n\t\t * we assign \"options\" object directly to the DOM element. FTW!\n\t\t */\n\t\tif(_isJQ) {\n\t\t\tjqEl.data('magnificPopup', options);\n\t\t} else {\n\t\t\tjqEl[0].magnificPopup = options;\n\t\t}\n\n\t\tmfp.addGroup(jqEl, options);\n\n\t}\n\treturn jqEl;\n};\n\n/*>>core*/\n\n/*>>inline*/\n\nvar INLINE_NS = 'inline',\n\t_hiddenClass,\n\t_inlinePlaceholder,\n\t_lastInlineElement,\n\t_putInlineElementsBack = function() {\n\t\tif(_lastInlineElement) {\n\t\t\t_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();\n\t\t\t_lastInlineElement = null;\n\t\t}\n\t};\n\n$.magnificPopup.registerModule(INLINE_NS, {\n\toptions: {\n\t\thiddenClass: 'hide', // will be appended with `mfp-` prefix\n\t\tmarkup: '',\n\t\ttNotFound: 'Content not found'\n\t},\n\tproto: {\n\n\t\tinitInline: function() {\n\t\t\tmfp.types.push(INLINE_NS);\n\n\t\t\t_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {\n\t\t\t\t_putInlineElementsBack();\n\t\t\t});\n\t\t},\n\n\t\tgetInline: function(item, template) {\n\n\t\t\t_putInlineElementsBack();\n\n\t\t\tif(item.src) {\n\t\t\t\tvar inlineSt = mfp.st.inline,\n\t\t\t\t\tel = $(item.src);\n\n\t\t\t\tif(el.length) {\n\n\t\t\t\t\t// If target element has parent - we replace it with placeholder and put it back after popup is closed\n\t\t\t\t\tvar parent = el[0].parentNode;\n\t\t\t\t\tif(parent && parent.tagName) {\n\t\t\t\t\t\tif(!_inlinePlaceholder) {\n\t\t\t\t\t\t\t_hiddenClass = inlineSt.hiddenClass;\n\t\t\t\t\t\t\t_inlinePlaceholder = _getEl(_hiddenClass);\n\t\t\t\t\t\t\t_hiddenClass = 'mfp-'+_hiddenClass;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// replace target inline element with placeholder\n\t\t\t\t\t\t_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);\n\t\t\t\t\t}\n\n\t\t\t\t\tmfp.updateStatus('ready');\n\t\t\t\t} else {\n\t\t\t\t\tmfp.updateStatus('error', inlineSt.tNotFound);\n\t\t\t\t\tel = $('<div>');\n\t\t\t\t}\n\n\t\t\t\titem.inlineElement = el;\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tmfp.updateStatus('ready');\n\t\t\tmfp._parseMarkup(template, {}, item);\n\t\t\treturn template;\n\t\t}\n\t}\n});\n\n/*>>inline*/\n\n/*>>ajax*/\nvar AJAX_NS = 'ajax',\n\t_ajaxCur,\n\t_removeAjaxCursor = function() {\n\t\tif(_ajaxCur) {\n\t\t\t$(document.body).removeClass(_ajaxCur);\n\t\t}\n\t},\n\t_destroyAjaxRequest = function() {\n\t\t_removeAjaxCursor();\n\t\tif(mfp.req) {\n\t\t\tmfp.req.abort();\n\t\t}\n\t};\n\n$.magnificPopup.registerModule(AJAX_NS, {\n\n\toptions: {\n\t\tsettings: null,\n\t\tcursor: 'mfp-ajax-cur',\n\t\ttError: '<a href=\"%url%\">The content</a> could not be loaded.'\n\t},\n\n\tproto: {\n\t\tinitAjax: function() {\n\t\t\tmfp.types.push(AJAX_NS);\n\t\t\t_ajaxCur = mfp.st.ajax.cursor;\n\n\t\t\t_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);\n\t\t\t_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);\n\t\t},\n\t\tgetAjax: function(item) {\n\n\t\t\tif(_ajaxCur) {\n\t\t\t\t$(document.body).addClass(_ajaxCur);\n\t\t\t}\n\n\t\t\tmfp.updateStatus('loading');\n\n\t\t\tvar opts = $.extend({\n\t\t\t\turl: item.src,\n\t\t\t\tsuccess: function(data, textStatus, jqXHR) {\n\t\t\t\t\tvar temp = {\n\t\t\t\t\t\tdata:data,\n\t\t\t\t\t\txhr:jqXHR\n\t\t\t\t\t};\n\n\t\t\t\t\t_mfpTrigger('ParseAjax', temp);\n\n\t\t\t\t\tmfp.appendContent( $(temp.data), AJAX_NS );\n\n\t\t\t\t\titem.finished = true;\n\n\t\t\t\t\t_removeAjaxCursor();\n\n\t\t\t\t\tmfp._setFocus();\n\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tmfp.wrap.addClass(READY_CLASS);\n\t\t\t\t\t}, 16);\n\n\t\t\t\t\tmfp.updateStatus('ready');\n\n\t\t\t\t\t_mfpTrigger('AjaxContentAdded');\n\t\t\t\t},\n\t\t\t\terror: function() {\n\t\t\t\t\t_removeAjaxCursor();\n\t\t\t\t\titem.finished = item.loadError = true;\n\t\t\t\t\tmfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));\n\t\t\t\t}\n\t\t\t}, mfp.st.ajax.settings);\n\n\t\t\tmfp.req = $.ajax(opts);\n\n\t\t\treturn '';\n\t\t}\n\t}\n});\n\n/*>>ajax*/\n\n/*>>image*/\nvar _imgInterval,\n\t_getTitle = function(item) {\n\t\tif(item.data && item.data.title !== undefined)\n\t\t\treturn item.data.title;\n\n\t\tvar src = mfp.st.image.titleSrc;\n\n\t\tif(src) {\n\t\t\tif($.isFunction(src)) {\n\t\t\t\treturn src.call(mfp, item);\n\t\t\t} else if(item.el) {\n\t\t\t\treturn item.el.attr(src) || '';\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n$.magnificPopup.registerModule('image', {\n\n\toptions: {\n\t\tmarkup: '<div class=\"mfp-figure\">'+\n\t\t\t\t\t'<div class=\"mfp-close\"></div>'+\n\t\t\t\t\t'<figure>'+\n\t\t\t\t\t\t'<div class=\"mfp-img\"></div>'+\n\t\t\t\t\t\t'<figcaption>'+\n\t\t\t\t\t\t\t'<div class=\"mfp-bottom-bar\">'+\n\t\t\t\t\t\t\t\t'<div class=\"mfp-title\"></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"mfp-counter\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'</figcaption>'+\n\t\t\t\t\t'</figure>'+\n\t\t\t\t'</div>',\n\t\tcursor: 'mfp-zoom-out-cur',\n\t\ttitleSrc: 'title',\n\t\tverticalFit: true,\n\t\ttError: '<a href=\"%url%\">The image</a> could not be loaded.'\n\t},\n\n\tproto: {\n\t\tinitImage: function() {\n\t\t\tvar imgSt = mfp.st.image,\n\t\t\t\tns = '.image';\n\n\t\t\tmfp.types.push('image');\n\n\t\t\t_mfpOn(OPEN_EVENT+ns, function() {\n\t\t\t\tif(mfp.currItem.type === 'image' && imgSt.cursor) {\n\t\t\t\t\t$(document.body).addClass(imgSt.cursor);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\n\t\t\t\tif(imgSt.cursor) {\n\t\t\t\t\t$(document.body).removeClass(imgSt.cursor);\n\t\t\t\t}\n\t\t\t\t_window.off('resize' + EVENT_NS);\n\t\t\t});\n\n\t\t\t_mfpOn('Resize'+ns, mfp.resizeImage);\n\t\t\tif(mfp.isLowIE) {\n\t\t\t\t_mfpOn('AfterChange', mfp.resizeImage);\n\t\t\t}\n\t\t},\n\t\tresizeImage: function() {\n\t\t\tvar item = mfp.currItem;\n\t\t\tif(!item || !item.img) return;\n\n\t\t\tif(mfp.st.image.verticalFit) {\n\t\t\t\tvar decr = 0;\n\t\t\t\t// fix box-sizing in ie7/8\n\t\t\t\tif(mfp.isLowIE) {\n\t\t\t\t\tdecr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);\n\t\t\t\t}\n\t\t\t\titem.img.css('max-height', mfp.wH-decr);\n\t\t\t}\n\t\t},\n\t\t_onImageHasSize: function(item) {\n\t\t\tif(item.img) {\n\n\t\t\t\titem.hasSize = true;\n\n\t\t\t\tif(_imgInterval) {\n\t\t\t\t\tclearInterval(_imgInterval);\n\t\t\t\t}\n\n\t\t\t\titem.isCheckingImgSize = false;\n\n\t\t\t\t_mfpTrigger('ImageHasSize', item);\n\n\t\t\t\tif(item.imgHidden) {\n\t\t\t\t\tif(mfp.content)\n\t\t\t\t\t\tmfp.content.removeClass('mfp-loading');\n\n\t\t\t\t\titem.imgHidden = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Function that loops until the image has size to display elements that rely on it asap\n\t\t */\n\t\tfindImageSize: function(item) {\n\n\t\t\tvar counter = 0,\n\t\t\t\timg = item.img[0],\n\t\t\t\tmfpSetInterval = function(delay) {\n\n\t\t\t\t\tif(_imgInterval) {\n\t\t\t\t\t\tclearInterval(_imgInterval);\n\t\t\t\t\t}\n\t\t\t\t\t// decelerating interval that checks for size of an image\n\t\t\t\t\t_imgInterval = setInterval(function() {\n\t\t\t\t\t\tif(img.naturalWidth > 0) {\n\t\t\t\t\t\t\tmfp._onImageHasSize(item);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(counter > 200) {\n\t\t\t\t\t\t\tclearInterval(_imgInterval);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\tif(counter === 3) {\n\t\t\t\t\t\t\tmfpSetInterval(10);\n\t\t\t\t\t\t} else if(counter === 40) {\n\t\t\t\t\t\t\tmfpSetInterval(50);\n\t\t\t\t\t\t} else if(counter === 100) {\n\t\t\t\t\t\t\tmfpSetInterval(500);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, delay);\n\t\t\t\t};\n\n\t\t\tmfpSetInterval(1);\n\t\t},\n\n\t\tgetImage: function(item, template) {\n\n\t\t\tvar guard = 0,\n\n\t\t\t\t// image load complete handler\n\t\t\t\tonLoadComplete = function() {\n\t\t\t\t\tif(item) {\n\t\t\t\t\t\tif (item.img[0].complete) {\n\t\t\t\t\t\t\titem.img.off('.mfploader');\n\n\t\t\t\t\t\t\tif(item === mfp.currItem){\n\t\t\t\t\t\t\t\tmfp._onImageHasSize(item);\n\n\t\t\t\t\t\t\t\tmfp.updateStatus('ready');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem.hasSize = true;\n\t\t\t\t\t\t\titem.loaded = true;\n\n\t\t\t\t\t\t\t_mfpTrigger('ImageLoadComplete');\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// if image complete check fails 200 times (20 sec), we assume that there was an error.\n\t\t\t\t\t\t\tguard++;\n\t\t\t\t\t\t\tif(guard < 200) {\n\t\t\t\t\t\t\t\tsetTimeout(onLoadComplete,100);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonLoadError();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// image error handler\n\t\t\t\tonLoadError = function() {\n\t\t\t\t\tif(item) {\n\t\t\t\t\t\titem.img.off('.mfploader');\n\t\t\t\t\t\tif(item === mfp.currItem){\n\t\t\t\t\t\t\tmfp._onImageHasSize(item);\n\t\t\t\t\t\t\tmfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\titem.hasSize = true;\n\t\t\t\t\t\titem.loaded = true;\n\t\t\t\t\t\titem.loadError = true;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\timgSt = mfp.st.image;\n\n\n\t\t\tvar el = template.find('.mfp-img');\n\t\t\tif(el.length) {\n\t\t\t\tvar img = document.createElement('img');\n\t\t\t\timg.className = 'mfp-img';\n\t\t\t\tif(item.el && item.el.find('img').length) {\n\t\t\t\t\timg.alt = item.el.find('img').attr('alt');\n\t\t\t\t}\n\t\t\t\titem.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);\n\t\t\t\timg.src = item.src;\n\n\t\t\t\t// without clone() \"error\" event is not firing when IMG is replaced by new IMG\n\t\t\t\t// TODO: find a way to avoid such cloning\n\t\t\t\tif(el.is('img')) {\n\t\t\t\t\titem.img = item.img.clone();\n\t\t\t\t}\n\n\t\t\t\timg = item.img[0];\n\t\t\t\tif(img.naturalWidth > 0) {\n\t\t\t\t\titem.hasSize = true;\n\t\t\t\t} else if(!img.width) {\n\t\t\t\t\titem.hasSize = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmfp._parseMarkup(template, {\n\t\t\t\ttitle: _getTitle(item),\n\t\t\t\timg_replaceWith: item.img\n\t\t\t}, item);\n\n\t\t\tmfp.resizeImage();\n\n\t\t\tif(item.hasSize) {\n\t\t\t\tif(_imgInterval) clearInterval(_imgInterval);\n\n\t\t\t\tif(item.loadError) {\n\t\t\t\t\ttemplate.addClass('mfp-loading');\n\t\t\t\t\tmfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );\n\t\t\t\t} else {\n\t\t\t\t\ttemplate.removeClass('mfp-loading');\n\t\t\t\t\tmfp.updateStatus('ready');\n\t\t\t\t}\n\t\t\t\treturn template;\n\t\t\t}\n\n\t\t\tmfp.updateStatus('loading');\n\t\t\titem.loading = true;\n\n\t\t\tif(!item.hasSize) {\n\t\t\t\titem.imgHidden = true;\n\t\t\t\ttemplate.addClass('mfp-loading');\n\t\t\t\tmfp.findImageSize(item);\n\t\t\t}\n\n\t\t\treturn template;\n\t\t}\n\t}\n});\n\n/*>>image*/\n\n/*>>zoom*/\nvar hasMozTransform,\n\tgetHasMozTransform = function() {\n\t\tif(hasMozTransform === undefined) {\n\t\t\thasMozTransform = document.createElement('p').style.MozTransform !== undefined;\n\t\t}\n\t\treturn hasMozTransform;\n\t};\n\n$.magnificPopup.registerModule('zoom', {\n\n\toptions: {\n\t\tenabled: false,\n\t\teasing: 'ease-in-out',\n\t\tduration: 300,\n\t\topener: function(element) {\n\t\t\treturn element.is('img') ? element : element.find('img');\n\t\t}\n\t},\n\n\tproto: {\n\n\t\tinitZoom: function() {\n\t\t\tvar zoomSt = mfp.st.zoom,\n\t\t\t\tns = '.zoom',\n\t\t\t\timage;\n\n\t\t\tif(!zoomSt.enabled || !mfp.supportsTransition) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar duration = zoomSt.duration,\n\t\t\t\tgetElToAnimate = function(image) {\n\t\t\t\t\tvar newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),\n\t\t\t\t\t\ttransition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,\n\t\t\t\t\t\tcssObj = {\n\t\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t'-webkit-backface-visibility': 'hidden'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tt = 'transition';\n\n\t\t\t\t\tcssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;\n\n\t\t\t\t\tnewImg.css(cssObj);\n\t\t\t\t\treturn newImg;\n\t\t\t\t},\n\t\t\t\tshowMainContent = function() {\n\t\t\t\t\tmfp.content.css('visibility', 'visible');\n\t\t\t\t},\n\t\t\t\topenTimeout,\n\t\t\t\tanimatedImg;\n\n\t\t\t_mfpOn('BuildControls'+ns, function() {\n\t\t\t\tif(mfp._allowZoom()) {\n\n\t\t\t\t\tclearTimeout(openTimeout);\n\t\t\t\t\tmfp.content.css('visibility', 'hidden');\n\n\t\t\t\t\t// Basically, all code below does is clones existing image, puts in on top of the current one and animated it\n\n\t\t\t\t\timage = mfp._getItemToZoom();\n\n\t\t\t\t\tif(!image) {\n\t\t\t\t\t\tshowMainContent();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tanimatedImg = getElToAnimate(image);\n\n\t\t\t\t\tanimatedImg.css( mfp._getOffset() );\n\n\t\t\t\t\tmfp.wrap.append(animatedImg);\n\n\t\t\t\t\topenTimeout = setTimeout(function() {\n\t\t\t\t\t\tanimatedImg.css( mfp._getOffset( true ) );\n\t\t\t\t\t\topenTimeout = setTimeout(function() {\n\n\t\t\t\t\t\t\tshowMainContent();\n\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tanimatedImg.remove();\n\t\t\t\t\t\t\t\timage = animatedImg = null;\n\t\t\t\t\t\t\t\t_mfpTrigger('ZoomAnimationEnded');\n\t\t\t\t\t\t\t}, 16); // avoid blink when switching images\n\n\t\t\t\t\t\t}, duration); // this timeout equals animation duration\n\n\t\t\t\t\t}, 16); // by adding this timeout we avoid short glitch at the beginning of animation\n\n\n\t\t\t\t\t// Lots of timeouts...\n\t\t\t\t}\n\t\t\t});\n\t\t\t_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {\n\t\t\t\tif(mfp._allowZoom()) {\n\n\t\t\t\t\tclearTimeout(openTimeout);\n\n\t\t\t\t\tmfp.st.removalDelay = duration;\n\n\t\t\t\t\tif(!image) {\n\t\t\t\t\t\timage = mfp._getItemToZoom();\n\t\t\t\t\t\tif(!image) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimatedImg = getElToAnimate(image);\n\t\t\t\t\t}\n\n\t\t\t\t\tanimatedImg.css( mfp._getOffset(true) );\n\t\t\t\t\tmfp.wrap.append(animatedImg);\n\t\t\t\t\tmfp.content.css('visibility', 'hidden');\n\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tanimatedImg.css( mfp._getOffset() );\n\t\t\t\t\t}, 16);\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\n\t\t\t\tif(mfp._allowZoom()) {\n\t\t\t\t\tshowMainContent();\n\t\t\t\t\tif(animatedImg) {\n\t\t\t\t\t\tanimatedImg.remove();\n\t\t\t\t\t}\n\t\t\t\t\timage = null;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_allowZoom: function() {\n\t\t\treturn mfp.currItem.type === 'image';\n\t\t},\n\n\t\t_getItemToZoom: function() {\n\t\t\tif(mfp.currItem.hasSize) {\n\t\t\t\treturn mfp.currItem.img;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\n\t\t// Get element postion relative to viewport\n\t\t_getOffset: function(isLarge) {\n\t\t\tvar el;\n\t\t\tif(isLarge) {\n\t\t\t\tel = mfp.currItem.img;\n\t\t\t} else {\n\t\t\t\tel = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);\n\t\t\t}\n\n\t\t\tvar offset = el.offset();\n\t\t\tvar paddingTop = parseInt(el.css('padding-top'),10);\n\t\t\tvar paddingBottom = parseInt(el.css('padding-bottom'),10);\n\t\t\toffset.top -= ( $(window).scrollTop() - paddingTop );\n\n\n\t\t\t/*\n\n\t\t\tAnimating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.\n\n\t\t\t */\n\t\t\tvar obj = {\n\t\t\t\twidth: el.width(),\n\t\t\t\t// fix Zepto height+padding issue\n\t\t\t\theight: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop\n\t\t\t};\n\n\t\t\t// I hate to do this, but there is no another option\n\t\t\tif( getHasMozTransform() ) {\n\t\t\t\tobj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';\n\t\t\t} else {\n\t\t\t\tobj.left = offset.left;\n\t\t\t\tobj.top = offset.top;\n\t\t\t}\n\t\t\treturn obj;\n\t\t}\n\n\t}\n});\n\n\n\n/*>>zoom*/\n\n/*>>iframe*/\n\nvar IFRAME_NS = 'iframe',\n\t_emptyPage = '//about:blank',\n\n\t_fixIframeBugs = function(isShowing) {\n\t\tif(mfp.currTemplate[IFRAME_NS]) {\n\t\t\tvar el = mfp.currTemplate[IFRAME_NS].find('iframe');\n\t\t\tif(el.length) {\n\t\t\t\t// reset src after the popup is closed to avoid \"video keeps playing after popup is closed\" bug\n\t\t\t\tif(!isShowing) {\n\t\t\t\t\tel[0].src = _emptyPage;\n\t\t\t\t}\n\n\t\t\t\t// IE8 black screen bug fix\n\t\t\t\tif(mfp.isIE8) {\n\t\t\t\t\tel.css('display', isShowing ? 'block' : 'none');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n$.magnificPopup.registerModule(IFRAME_NS, {\n\n\toptions: {\n\t\tmarkup: '<div class=\"mfp-iframe-scaler\">'+\n\t\t\t\t\t'<div class=\"mfp-close\"></div>'+\n\t\t\t\t\t'<iframe class=\"mfp-iframe\" src=\"//about:blank\" frameborder=\"0\" allowfullscreen></iframe>'+\n\t\t\t\t'</div>',\n\n\t\tsrcAction: 'iframe_src',\n\n\t\t// we don't care and support only one default type of URL by default\n\t\tpatterns: {\n\t\t\tyoutube: {\n\t\t\t\tindex: 'youtube.com',\n\t\t\t\tid: 'v=',\n\t\t\t\tsrc: '//www.youtube.com/embed/%id%?autoplay=1'\n\t\t\t},\n\t\t\tvimeo: {\n\t\t\t\tindex: 'vimeo.com/',\n\t\t\t\tid: '/',\n\t\t\t\tsrc: '//player.vimeo.com/video/%id%?autoplay=1'\n\t\t\t},\n\t\t\tgmaps: {\n\t\t\t\tindex: '//maps.google.',\n\t\t\t\tsrc: '%id%&output=embed'\n\t\t\t}\n\t\t}\n\t},\n\n\tproto: {\n\t\tinitIframe: function() {\n\t\t\tmfp.types.push(IFRAME_NS);\n\n\t\t\t_mfpOn('BeforeChange', function(e, prevType, newType) {\n\t\t\t\tif(prevType !== newType) {\n\t\t\t\t\tif(prevType === IFRAME_NS) {\n\t\t\t\t\t\t_fixIframeBugs(); // iframe if removed\n\t\t\t\t\t} else if(newType === IFRAME_NS) {\n\t\t\t\t\t\t_fixIframeBugs(true); // iframe is showing\n\t\t\t\t\t}\n\t\t\t\t}// else {\n\t\t\t\t\t// iframe source is switched, don't do anything\n\t\t\t\t//}\n\t\t\t});\n\n\t\t\t_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {\n\t\t\t\t_fixIframeBugs();\n\t\t\t});\n\t\t},\n\n\t\tgetIframe: function(item, template) {\n\t\t\tvar embedSrc = item.src;\n\t\t\tvar iframeSt = mfp.st.iframe;\n\n\t\t\t$.each(iframeSt.patterns, function() {\n\t\t\t\tif(embedSrc.indexOf( this.index ) > -1) {\n\t\t\t\t\tif(this.id) {\n\t\t\t\t\t\tif(typeof this.id === 'string') {\n\t\t\t\t\t\t\tembedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tembedSrc = this.id.call( this, embedSrc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tembedSrc = this.src.replace('%id%', embedSrc );\n\t\t\t\t\treturn false; // break;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar dataObj = {};\n\t\t\tif(iframeSt.srcAction) {\n\t\t\t\tdataObj[iframeSt.srcAction] = embedSrc;\n\t\t\t}\n\t\t\tmfp._parseMarkup(template, dataObj, item);\n\n\t\t\tmfp.updateStatus('ready');\n\n\t\t\treturn template;\n\t\t}\n\t}\n});\n\n\n\n/*>>iframe*/\n\n/*>>gallery*/\n/**\n * Get looped index depending on number of slides\n */\nvar _getLoopedId = function(index) {\n\t\tvar numSlides = mfp.items.length;\n\t\tif(index > numSlides - 1) {\n\t\t\treturn index - numSlides;\n\t\t} else if(index < 0) {\n\t\t\treturn numSlides + index;\n\t\t}\n\t\treturn index;\n\t},\n\t_replaceCurrTotal = function(text, curr, total) {\n\t\treturn text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);\n\t};\n\n$.magnificPopup.registerModule('gallery', {\n\n\toptions: {\n\t\tenabled: false,\n\t\tarrowMarkup: '<button title=\"%title%\" type=\"button\" class=\"mfp-arrow mfp-arrow-%dir%\"></button>',\n\t\tpreload: [0,2],\n\t\tnavigateByImgClick: true,\n\t\tarrows: true,\n\n\t\ttPrev: 'Previous (Left arrow key)',\n\t\ttNext: 'Next (Right arrow key)',\n\t\ttCounter: '%curr% of %total%'\n\t},\n\n\tproto: {\n\t\tinitGallery: function() {\n\n\t\t\tvar gSt = mfp.st.gallery,\n\t\t\t\tns = '.mfp-gallery';\n\n\t\t\tmfp.direction = true; // true - next, false - prev\n\n\t\t\tif(!gSt || !gSt.enabled ) return false;\n\n\t\t\t_wrapClasses += ' mfp-gallery';\n\n\t\t\t_mfpOn(OPEN_EVENT+ns, function() {\n\n\t\t\t\tif(gSt.navigateByImgClick) {\n\t\t\t\t\tmfp.wrap.on('click'+ns, '.mfp-img', function() {\n\t\t\t\t\t\tif(mfp.items.length > 1) {\n\t\t\t\t\t\t\tmfp.next();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t_document.on('keydown'+ns, function(e) {\n\t\t\t\t\tif (e.keyCode === 37) {\n\t\t\t\t\t\tmfp.prev();\n\t\t\t\t\t} else if (e.keyCode === 39) {\n\t\t\t\t\t\tmfp.next();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t_mfpOn('UpdateStatus'+ns, function(e, data) {\n\t\t\t\tif(data.text) {\n\t\t\t\t\tdata.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {\n\t\t\t\tvar l = mfp.items.length;\n\t\t\t\tvalues.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';\n\t\t\t});\n\n\t\t\t_mfpOn('BuildControls' + ns, function() {\n\t\t\t\tif(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {\n\t\t\t\t\tvar markup = gSt.arrowMarkup,\n\t\t\t\t\t\tarrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),\n\t\t\t\t\t\tarrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);\n\n\t\t\t\t\tarrowLeft.click(function() {\n\t\t\t\t\t\tmfp.prev();\n\t\t\t\t\t});\n\t\t\t\t\tarrowRight.click(function() {\n\t\t\t\t\t\tmfp.next();\n\t\t\t\t\t});\n\n\t\t\t\t\tmfp.container.append(arrowLeft.add(arrowRight));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_mfpOn(CHANGE_EVENT+ns, function() {\n\t\t\t\tif(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);\n\n\t\t\t\tmfp._preloadTimeout = setTimeout(function() {\n\t\t\t\t\tmfp.preloadNearbyImages();\n\t\t\t\t\tmfp._preloadTimeout = null;\n\t\t\t\t}, 16);\n\t\t\t});\n\n\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\n\t\t\t\t_document.off(ns);\n\t\t\t\tmfp.wrap.off('click'+ns);\n\t\t\t\tmfp.arrowRight = mfp.arrowLeft = null;\n\t\t\t});\n\n\t\t},\n\t\tnext: function() {\n\t\t\tmfp.direction = true;\n\t\t\tmfp.index = _getLoopedId(mfp.index + 1);\n\t\t\tmfp.updateItemHTML();\n\t\t},\n\t\tprev: function() {\n\t\t\tmfp.direction = false;\n\t\t\tmfp.index = _getLoopedId(mfp.index - 1);\n\t\t\tmfp.updateItemHTML();\n\t\t},\n\t\tgoTo: function(newIndex) {\n\t\t\tmfp.direction = (newIndex >= mfp.index);\n\t\t\tmfp.index = newIndex;\n\t\t\tmfp.updateItemHTML();\n\t\t},\n\t\tpreloadNearbyImages: function() {\n\t\t\tvar p = mfp.st.gallery.preload,\n\t\t\t\tpreloadBefore = Math.min(p[0], mfp.items.length),\n\t\t\t\tpreloadAfter = Math.min(p[1], mfp.items.length),\n\t\t\t\ti;\n\n\t\t\tfor(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {\n\t\t\t\tmfp._preloadItem(mfp.index+i);\n\t\t\t}\n\t\t\tfor(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {\n\t\t\t\tmfp._preloadItem(mfp.index-i);\n\t\t\t}\n\t\t},\n\t\t_preloadItem: function(index) {\n\t\t\tindex = _getLoopedId(index);\n\n\t\t\tif(mfp.items[index].preloaded) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar item = mfp.items[index];\n\t\t\tif(!item.parsed) {\n\t\t\t\titem = mfp.parseEl( index );\n\t\t\t}\n\n\t\t\t_mfpTrigger('LazyLoad', item);\n\n\t\t\tif(item.type === 'image') {\n\t\t\t\titem.img = $('<img class=\"mfp-img\" />').on('load.mfploader', function() {\n\t\t\t\t\titem.hasSize = true;\n\t\t\t\t}).on('error.mfploader', function() {\n\t\t\t\t\titem.hasSize = true;\n\t\t\t\t\titem.loadError = true;\n\t\t\t\t\t_mfpTrigger('LazyLoadError', item);\n\t\t\t\t}).attr('src', item.src);\n\t\t\t}\n\n\n\t\t\titem.preloaded = true;\n\t\t}\n\t}\n});\n\n/*>>gallery*/\n\n/*>>retina*/\n\nvar RETINA_NS = 'retina';\n\n$.magnificPopup.registerModule(RETINA_NS, {\n\toptions: {\n\t\treplaceSrc: function(item) {\n\t\t\treturn item.src.replace(/\\.\\w+$/, function(m) { return '@2x' + m; });\n\t\t},\n\t\tratio: 1 // Function or number. Set to 1 to disable.\n\t},\n\tproto: {\n\t\tinitRetina: function() {\n\t\t\tif(window.devicePixelRatio > 1) {\n\n\t\t\t\tvar st = mfp.st.retina,\n\t\t\t\t\tratio = st.ratio;\n\n\t\t\t\tratio = !isNaN(ratio) ? ratio : ratio();\n\n\t\t\t\tif(ratio > 1) {\n\t\t\t\t\t_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {\n\t\t\t\t\t\titem.img.css({\n\t\t\t\t\t\t\t'max-width': item.img[0].naturalWidth / ratio,\n\t\t\t\t\t\t\t'width': '100%'\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\t_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {\n\t\t\t\t\t\titem.src = st.replaceSrc(item, ratio);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n});\n\n/*>>retina*/\n _checkInstance(); }));","function tlite(getTooltipOpts) {\n document.addEventListener('mouseover', function (e) {\n var el = e.target;\n var opts = getTooltipOpts(el);\n\n if (!opts) {\n el = el.parentElement;\n opts = el && getTooltipOpts(el);\n }\n\n opts && tlite.show(el, opts, true);\n });\n}\n\ntlite.show = function (el, opts, isAuto) {\n var fallbackAttrib = 'data-tlite';\n opts = opts || {};\n\n (el.tooltip || Tooltip(el, opts)).show();\n\n function Tooltip(el, opts) {\n var tooltipEl;\n var showTimer;\n var text;\n\n el.addEventListener('mousedown', autoHide);\n el.addEventListener('mouseleave', autoHide);\n\n function show() {\n text = el.title || el.getAttribute(fallbackAttrib) || text;\n el.title = '';\n el.setAttribute(fallbackAttrib, '');\n text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1))\n }\n\n function autoHide() {\n tlite.hide(el, true);\n }\n\n function hide(isAutoHiding) {\n if (isAuto === isAutoHiding) {\n showTimer = clearTimeout(showTimer);\n var parent = tooltipEl && tooltipEl.parentNode;\n parent && parent.removeChild(tooltipEl);\n tooltipEl = undefined;\n }\n }\n\n function fadeIn() {\n if (!tooltipEl) {\n tooltipEl = createTooltip(el, text, opts);\n }\n }\n\n return el.tooltip = {\n show: show,\n hide: hide\n };\n }\n\n function createTooltip(el, text, opts) {\n var tooltipEl = document.createElement('span');\n var grav = opts.grav || el.getAttribute('data-tlite') || 'n';\n\n tooltipEl.innerHTML = text;\n\n el.appendChild(tooltipEl);\n\n var vertGrav = grav[0] || '';\n var horzGrav = grav[1] || '';\n\n function positionTooltip() {\n tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav;\n\n var arrowSize = 10;\n var top = el.offsetTop;\n var left = el.offsetLeft;\n\n if (tooltipEl.offsetParent === el) {\n top = left = 0;\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var tooltipHeight = tooltipEl.offsetHeight;\n var tooltipWidth = tooltipEl.offsetWidth;\n var centerEl = left + (width / 2);\n\n tooltipEl.style.top = (\n vertGrav === 's' ? (top - tooltipHeight - arrowSize) :\n vertGrav === 'n' ? (top + height + arrowSize) :\n (top + (height / 2) - (tooltipHeight / 2))\n ) + 'px';\n\n tooltipEl.style.left = (\n horzGrav === 'w' ? left :\n horzGrav === 'e' ? left + width - tooltipWidth :\n vertGrav === 'w' ? (left + width + arrowSize) :\n vertGrav === 'e' ? (left - tooltipWidth - arrowSize) :\n (centerEl - tooltipWidth / 2)\n ) + 'px';\n }\n\n positionTooltip();\n\n var rect = tooltipEl.getBoundingClientRect();\n\n if (vertGrav === 's' && rect.top < 0) {\n vertGrav = 'n';\n positionTooltip();\n } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) {\n vertGrav = 's';\n positionTooltip();\n } else if (vertGrav === 'e' && rect.left < 0) {\n vertGrav = 'w';\n positionTooltip();\n } else if (vertGrav === 'w' && rect.right > window.innerWidth) {\n vertGrav = 'e';\n positionTooltip();\n }\n\n tooltipEl.className += ' tlite-visible';\n\n return tooltipEl;\n }\n};\n\ntlite.hide = function (el, isAuto) {\n el.tooltip && el.tooltip.hide(isAuto);\n};\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = tlite;\n}\n","module.exports = jQuery;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import tlite from 'tlite';\nimport '../../node_modules/magnific-popup/dist/jquery.magnific-popup.js';\n\n/**\n * Creating the Media Uploader\n *\n * @param $imageContainer\n * @param $imageInput\n */\nfunction giveasap_image_media( $imageContainer, $imageInput ) {\n\t'use strict';\n\n\tvar file_frame;\n\n\t/**\n\t * If an instance of file_frame already exists, then we can open it\n\t * rather than creating a new instance.\n\t */\n\n\tif ( undefined !== file_frame ) {\n\n\t\tfile_frame.open();\n\n\t\treturn;\n\n\t}\n\n\t/**\n\t * If we're this far, then an instance does not exist, so we need to\n\t * create our own.\n\t *\n\t * Here, use the wp.media library to define the settings of the Media\n\t * Uploader. We're opting to use the 'post' frame which is a template\n\t * defined in WordPress core and are initializing the file frame\n\t * with the 'insert' state.\n\t *\n\t * We're also not allowing the user to select more than one image.\n\t */\n\tfile_frame = wp.media(\n\t\t{\n\t\t\tmultiple: false,\n\t\t}\n\t);\n\n\tfile_frame.on(\n\t\t'open',\n\t\tfunction() {\n\t\t\tvar selection = file_frame.state().get( 'selection' );\n\t\t\tvar ids = $imageInput.val().split( ',' );\n\t\t\tids.forEach(\n\t\t\t\tfunction(id) {\n\t\t\t\t\tvar attachment = wp.media.attachment( id );\n\t\t\t\t\tattachment.fetch();\n\t\t\t\t\tselection.add( attachment ? [ attachment ] : [] );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\t// When an image is selected in the media frame...\n\tfile_frame.on(\n\t\t'select',\n\t\tfunction() {\n\n\t\t\t// Get media attachment details from the frame state\n\t\t\tvar attachments = file_frame.state().get( 'selection' ).toJSON();\n\n\t\t\tvar attachmentIDs = [];\n\t\t\t$imageContainer.empty();\n\t\t\tconsole.log( $imageContainer );\n\t\t\tvar $galleryID = $imageContainer.attr( \"id\" );\n\t\t\tfor ( var i = 0; i < attachments.length; i++ ) {\n\t\t\t\tif ( attachments[ i ].type == \"image\" ) {\n\t\t\t\t\tattachmentIDs.push( attachments[ i ].id );\n\t\t\t\t\t$imageContainer.append( sortable_gallery_image_create( attachments[ i ], $galleryID ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$imageInput.val( attachmentIDs.join() );\n\t\t\t// sortable_gallery_image_remove();\n\t\t}\n\t);\n\n\t// Now display the actual file_frame\n\tfile_frame.open();\n\n}\n\nfunction sortable_image_gallery_media( $imageContainer, $imageInput ) {\n\t'use strict';\n\n\tvar file_frame;\n\n\t/**\n\t * If an instance of file_frame already exists, then we can open it\n\t * rather than creating a new instance.\n\t */\n\n\tif ( undefined !== file_frame ) {\n\n\t\tfile_frame.open();\n\n\t\treturn;\n\n\t}\n\n\t/**\n\t * If we're this far, then an instance does not exist, so we need to\n\t * create our own.\n\t *\n\t * Here, use the wp.media library to define the settings of the Media\n\t * Uploader. We're opting to use the 'post' frame which is a template\n\t * defined in WordPress core and are initializing the file frame\n\t * with the 'insert' state.\n\t *\n\t * We're also not allowing the user to select more than one image.\n\t */\n\tfile_frame = wp.media(\n\t\t{\n\t\t\tmultiple: true,\n\t\t}\n\t);\n\n\tfile_frame.on(\n\t\t'open',\n\t\tfunction() {\n\t\t\tvar selection = file_frame.state().get( 'selection' );\n\t\t\tvar ids = $imageInput.val().split( ',' );\n\t\t\tids.forEach(\n\t\t\t\tfunction(id) {\n\t\t\t\t\tvar attachment = wp.media.attachment( id );\n\t\t\t\t\tattachment.fetch();\n\t\t\t\t\tselection.add( attachment ? [ attachment ] : [] );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\t// When an image is selected in the media frame...\n\tfile_frame.on(\n\t\t'select',\n\t\tfunction() {\n\n\t\t\t// Get media attachment details from the frame state\n\t\t\tvar attachments = file_frame.state().get( 'selection' ).toJSON();\n\n\t\t\tvar attachmentIDs = [];\n\t\t\t$imageContainer.empty();\n\t\t\tvar $galleryID = $imageContainer.attr( \"id\" );\n\t\t\tfor ( var i = 0; i < attachments.length; i++ ) {\n\t\t\t\tif ( attachments[ i ].type == \"image\" ) {\n\t\t\t\t\tattachmentIDs.push( attachments[ i ].id );\n\t\t\t\t\t$imageContainer.append( sortable_gallery_image_create( attachments[ i ], $galleryID ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$imageInput.val( attachmentIDs.join() );\n\t\t\t// sortable_gallery_image_remove();\n\t\t}\n\t);\n\n\t// Now display the actual file_frame\n\tfile_frame.open();\n\n}\n\nfunction sortable_gallery_image_create( $attachment, $galleryID ) {\n\tvar image_url = '';\n\tif ( $attachment.sizes.thumbnail ) {\n\t\timage_url = $attachment.sizes.thumbnail.url;\n\t} else {\n\t\timage_url = $attachment.sizes.full.url;\n\t}\n\tvar $output = '<li tabindex=\"0\" role=\"checkbox\" aria-label=\"' + $attachment.title + '\" aria-checked=\"true\" data-id=\"' + $attachment.id + '\" class=\"attachment save-ready selected details\">';\n\t$output += '<div class=\"attachment-preview js--select-attachment type-image subtype-jpeg portrait\">';\n\t$output += '<div class=\"thumbnail\">'\n\n\t$output += '<div class=\"centered\">'\n\t$output += '<img src=\"' + image_url + '\" draggable=\"false\" alt=\"\">'\n\t$output += '</div>'\n\n\t$output += '</div>'\n\n\t$output += '</div>'\n\n\t$output += '<button type=\"button\" data-gallery=\"#' + $galleryID + '\" class=\"button-link check remove-sortable-wordpress-gallery-image\" tabindex=\"0\"><span class=\"media-modal-icon\"></span><span class=\"screen-reader-text\">Deselect</span></button>'\n\n\t$output += '</li>';\n\treturn $output;\n\n}\n\nfunction sortable_gallery_image_remove( ) {\n\tjQuery( \".remove-sortable-wordpress-gallery-image\" ).on(\n\t\t'click',\n\t\tfunction(){\n\t\t\tvar $id = jQuery( this ).parent().attr( \"data-id\" );\n\t\t\tvar $gallery = jQuery( this ).attr( \"data-gallery\" );\n\t\t\tvar $imageInput = jQuery( $gallery + \"_input\" );\n\n\t\t\tjQuery( this ).parent().remove();\n\t\t\tvar ids = $imageInput.val().split( ',' );\n\t\t\tvar $idIndex = ids.indexOf( $id );\n\t\t\tif ( $idIndex >= 0 ) {\n\t\t\t\tids.splice( $idIndex, 1 );\n\t\t\t\t$imageInput.val( ids.join() );\n\t\t\t}\n\t\t}\n\t);\n}\n\nfunction giveasap_prepare_format_from_php( format ) {\n\tformat = format.replace( \"d\", \"dd\" );\n\tformat = format.replace( \"j\", \"d\" );\n\tformat = format.replace( \"Y\", \"yy\" );\n\tformat = format.replace( \"m\", \"mm\" );\n\n\treturn format;\n}\n\nfunction giveasap_initialize_code_editor() {\n\tvar $ = jQuery;\n\tif ( $( '.sg-code-editor' ).length ) {\n\t\t$( '.sg-code-editor' ).each(\n\t\t\tfunction(){\n\t\t\t\tvar editorSettings = wp.codeEditor.defaultSettings ? _.clone( wp.codeEditor.defaultSettings ) : {};\n\t\t\t\tvar mode = $( this ).attr( 'data-mode' );\n\t\t\t\tif ( typeof mode === 'undefined' ) {\n\t\t\t\t\tmode = false;\n\t\t\t\t}\n\t\t\t\teditorSettings.codemirror = _.extend(\n\t\t\t\t\t{},\n\t\t\t\t\teditorSettings.codemirror,\n\t\t\t\t\t{\n\t\t\t\t\t\tindentUnit: 2,\n\t\t\t\t\t\ttabSize: 2\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( mode ) {\n\t\t\t\t\teditorSettings.codemirror.mode = mode;\n\t\t\t\t}\n\n\t\t\t\tvar editor = wp.codeEditor.initialize( $( this ), editorSettings );\n\t\t\t}\n\t\t);\n\t}\n}\n\n(function($){\n\n\t$( document ).ready(\n\t\tfunction(){\n\n\t\t\t$(document.body).on( 'click', '#notify', function (e){\n\t\t\t\tif ( ! $('#sg_allow_awarding').length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('#sg_allow_awarding').prop('checked') ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('.sg-select-prizes-manual').length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('.sg-prizes-field-container ').length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('.sg-prizes-field-container ').children().length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar prizesDropdown = $('.sg-select-prizes-manual');\n\t\t\t\tvar havePricesSelected = true;\n\t\t\t\tprizesDropdown.each(function() {\n\t\t\t\t\tvar value = $(this).find('select').val();\n\t\t\t\t\tif ( ! value.length ) {\n\t\t\t\t\t\thavePricesSelected = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ( ! havePricesSelected ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\talert('Some users don\\'t have their prizes selected! Please make sure all have their prizes selected, save the giveaway and click again to notify.');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ttlite( el => el.classList.contains( 'sg-tooltip' ) );\n\n\n\t\t\t$( '#sgToggleAwardPrizes' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\t$target = $this.attr( 'data-target' ),\n\t\t\t\t\t$class = $this.attr( 'data-class' );\n\n\t\t\t\t\t$( $target ).toggleClass( $class );\n\t\t\t\t\tif ( $( $target ).hasClass( $class ) ) {\n\t\t\t\t\t\t$( '#sg_awarding_prizes_manually' ).removeAttr( 'checked' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$( '#sg_awarding_prizes_manually' ).attr( 'checked', 'checked' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-toggle' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\t$target = $this.attr( 'data-target' ),\n\t\t\t\t\t$class = $this.attr( 'data-class' ),\n\t\t\t\t\t$text = $this.attr( 'data-text' );\n\n\t\t\t\t\t$( $target ).toggleClass( $class );\n\t\t\t\t\tif ( $text ) {\n\t\t\t\t\t\tvar old_text = $this.text();\n\t\t\t\t\t\t$this.attr( 'data-text', old_text );\n\t\t\t\t\t\t$this.html( $text );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( $( '#sg_giveaway_add_subscriber' ).length ) {\n\t\t\t\t$( '#sg_giveaway_add_subscriber' ).on(\n\t\t\t\t\t'change',\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\tdata: { action: 'sg_get_giveaway_form_fields', giveaway: $( this ).val(), nonce: gasap.nonce },\n\t\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t\t$( '#sgGiveawayFields' ).html( resp.data );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar imageButton = $( \".add-sortable-wordpress-gallery\" );\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.remove-sortable-wordpress-gallery-image',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\t$id = $this.parent().attr( 'data-id' ),\n\t\t\t\t\t$gallery = $this.attr( 'data-gallery' ),\n\t\t\t\t\t$input = $( $gallery + '_input' );\n\n\t\t\t\t\tvar ids = $input.val().split( ',' ),\n\t\t\t\t\t$idIndex = ids.indexOf( $id );\n\t\t\t\t\tif ( $idIndex >= 0 ) {\n\t\t\t\t\t\tids.splice( $idIndex, 1 );\n\t\t\t\t\t\t$input.val( ids.join() );\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.parent().remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// sortable_gallery_image_remove();\n\t\t\timageButton.each(\n\t\t\t\tfunction(){\n\t\t\t\t\tvar galleryID = $( this ).attr( \"data-gallery\" );\n\t\t\t\t\tvar imageContainer = $( galleryID );\n\t\t\t\t\tvar imageInput = $( galleryID + \"_input\" );\n\t\t\t\t\timageContainer.sortable();\n\t\t\t\t\timageContainer.on(\n\t\t\t\t\t\t\"sortupdate\",\n\t\t\t\t\t\tfunction( event, ui ) {\n\t\t\t\t\t\t\tvar $ids = [];\n\t\t\t\t\t\t\tvar $images = imageContainer.children( \"li\" );\n\t\t\t\t\t\t\t$images.each(\n\t\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\t$ids.push( $( this ).attr( \"data-id\" ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\timageInput.val( $ids.join() );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t$( this ).on(\n\t\t\t\t\t\t'click',\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tsortable_image_gallery_media( imageContainer, imageInput );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.add-single-wordpress-image',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar galleryID = $( this ).attr( \"data-gallery\" );\n\t\t\t\t\tvar imageContainer = $( galleryID );\n\t\t\t\t\tvar imageInput = $( galleryID + \"_input\" );\n\t\t\t\t\tgiveasap_image_media( imageContainer, imageInput );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'#giveasap_end_date, #giveasap_end_time',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar end_time = $( '#giveasap_end_time' ).val(),\n\t\t\t\t\tend_date = $( '#giveasap_end_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\twinner_time = $( '#giveasap_winner_time' ).val(),\n\t\t\t\t\twinner_date = $( '#giveasap_winner_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\tend_date_object = Date.parse( end_date + 'T' + end_time ),\n\t\t\t\t\twinner_date_object = Date.parse( winner_date + 'T' + winner_time );\n\n\t\t\t\t\tif ( end_date_object > winner_date_object ) {\n\t\t\t\t\t\t$( '#giveasap_winner_date' ).val( $( '#giveasap_end_date' ).val() );\n\t\t\t\t\t\t$( '#giveasap_winner_time' ).val( $( '#giveasap_end_time' ).val() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'#giveasap_winner_time, #giveasap_winner_date',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar end_time = $( '#giveasap_end_time' ).val(),\n\t\t\t\t\tend_date = $( '#giveasap_end_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\twinner_time = $( '#giveasap_winner_time' ).val(),\n\t\t\t\t\twinner_date = $( '#giveasap_winner_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\tend_date_object = Date.parse( end_date + 'T' + end_time ),\n\t\t\t\t\twinner_date_object = Date.parse( winner_date + 'T' + winner_time );\n\n\t\t\t\t\tif ( end_date_object > winner_date_object ) {\n\t\t\t\t\t\talert( gasap.text.winner_before_end );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tvar $expand_users = $( \"#giveasap_expand_users\" );\n\t\t\t$expand_users.on(\n\t\t\t\t'click',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $users_container = $( \"#giveasap_users_container\" );\n\t\t\t\t\t$users_container.toggleClass( \"hidden\" );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tvar $date_format = $( \"#date_format\" );\n\t\t\t$date_format.on(\n\t\t\t\t'change',\n\t\t\t\tfunction(){\n\n\t\t\t\t\t$format = giveasap_prepare_format_from_php( $( this ).val() );\n\t\t\t\t\t$( \".datepicker\" ).datepicker(\n\t\t\t\t\t\t'option',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taltFormat: $format\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.button-integration-deactivate',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar integration = $( this ).attr( 'data-integration' ),\n\t\t\t\t\t$this = $( this );\n\t\t\t\t\tif ( integration ) {\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tdata: { action: 'giveasap_deactivate_integration', integration: integration, nonce: gasap.nonce },\n\t\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t\t$this.removeClass( 'button-integration-deactivate' )\n\t\t\t\t\t\t\t\t\t\t.removeClass( 'button-default' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'button-integration-activate' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'button-primary' )\n\t\t\t\t\t\t\t\t\t\t.html( gasap.text.activate );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.button-integration-activate',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar integration = $( this ).attr( 'data-integration' ),\n\t\t\t\t\t$this = $( this );\n\n\t\t\t\t\tif ( integration ) {\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tdata: { action: 'giveasap_activate_integration', integration: integration, nonce: gasap.nonce },\n\t\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t\t$this.addClass( 'button-integration-deactivate' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'button-default' )\n\t\t\t\t\t\t\t\t\t\t.removeClass( 'button-integration-activate' )\n\t\t\t\t\t\t\t\t\t\t.removeClass( 'button-primary' )\n\t\t\t\t\t\t\t\t\t\t.html( gasap.text.deactivate );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Searching Email on User List.\n\t\t\t */\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.ga-search-email',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar inputs = $( this ).parent().find( 'input' ),\n\t\t\t\t\turl = window.location.href,\n\t\t\t\t\tparts = url.split( '?' ),\n\t\t\t\t\tquery = parts[1],\n\t\t\t\t\tqparams = query.split( '&' ),\n\t\t\t\t\tparams = {};\n\n\t\t\t\t\tfor ( var i = 0; i < qparams.length; i++ ) {\n\t\t\t\t\t\tvar strings = qparams[i].split( '=' );\n\t\t\t\t\t\tparams[ strings[0] ] = strings[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tinputs.each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tvar name = $( this ).attr( 'name' ),\n\t\t\t\t\t\t\tval = $( this ).val();\n\t\t\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\t\t\tparams[ name ] = val;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete params[ name ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tvar params_array = [];\n\t\t\t\t\tfor ( var key in params ) {\n\t\t\t\t\t\tparams_array.push( key + '=' + params[key] );\n\t\t\t\t\t}\n\t\t\t\t\tvar location = parts[0] + '?' + params_array.join( '&' );\n\n\t\t\t\t\twindow.location.href = location;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-metaboxes li.sg-metabox a',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( '.sg-metabox-fields' ).addClass( 'hidden' );\n\t\t\t\t\t$( '.sg-metaboxes li.active' ).removeClass( 'active' );\n\t\t\t\t\tvar target = $( this ).attr( 'href' );\n\t\t\t\t\t$( target ).removeClass( 'hidden' );\n\t\t\t\t\t$( this ).parent().addClass( 'active' );\n\t\t\t\t\t$( target ).find( '.wp-editor-wrap' ).each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tvar frame = $( this ).find( 'iframe' ),\n\t\t\t\t\t\t\theight = frame.height();\n\t\t\t\t\t\t\tif ( height < 200 ) {\n\t\t\t\t\t\t\t\tframe.height( 200 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tif ( $( target ).find('.sg-code-editor') ) {\n\t\t\t\t\t\tgiveasap_initialize_code_editor();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.sg-admin-form.sg-action-form :input',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar form = $( this ).parents( '.sg-admin-form' );\n\t\t\t\t\tif ( ! $( this )[0].checkValidity() ) {\n\t\t\t\t\t\tvar txt = $( this )[0].validationMessage;\n\t\t\t\t\t\tvar error = form.find( '.error' );\n\t\t\t\t\t\t$( this ).focus();\n\t\t\t\t\t\tif ( error.length ) {\n\t\t\t\t\t\t\terror.find( 'p' ).html( txt );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tform.prepend( '<div class=\"notice error\"><p>' + txt + '</p></div>' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\tform.find( '.error' ).fadeOut().remove();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t5000\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-image-popup-link' ).magnificPopup( {type:'image'} );\n\n\t\t\t/**\n\t\t\t * Sharing Methods.\n\t\t\t */\n\t\t\t$( '#addShareMethod' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar template = wp.template( 'sharing-method' ),\n\t\t\t\t\tindex = $( '.giveaway-sharing-methods' ).children().length,\n\t\t\t\t\tdata = { index: index, title: 'New Method' },\n\t\t\t\t\thtml = template( data );\n\t\t\t\t\t$( '.giveaway-sharing-methods' ).append( html );\n\t\t\t\t\t$( '.giveaway-sharing-methods' ).children().eq( index ).find( '.method-select' ).trigger( 'change' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction giveaway_reset_methods_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.giveaway-sharing-methods' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'giveasap_methods\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'giveasap_methods[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$( '.giveaway-sharing-methods' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_methods_index();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveaway-sharing-method .method-header',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parent().toggleClass( 'active' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveaway-sharing-method .button-delete',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.giveaway-sharing-method' ).remove();\n\t\t\t\t\tgiveaway_reset_methods_index();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.giveaway-sharing-method .method-select',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar value = $( this ).val();\n\n\t\t\t\t\tif ( 'custom' === value ) {\n\t\t\t\t\t\tvar template = wp.template( 'sharing-method-custom' ),\n\t\t\t\t\t\tmethod = $( this ).parents( '.giveaway-sharing-method' ),\n\t\t\t\t\t\tindex = method.attr( 'data-index' ),\n\t\t\t\t\t\tdata = { index: index, url: '', title: method.attr( 'data-title' ), attributes: { url: '', text: '', image: '' } },\n\t\t\t\t\t\thtml = template( data );\n\t\t\t\t\t\tmethod.find( '.giveasap-method-html' ).html( html );\n\t\t\t\t\t\tmethod.find( '.color-picker' ).wpColorPicker();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar method = $( this ).parents( '.giveaway-sharing-method' );\n\t\t\t\t\t\tmethod.find( '.giveasap-method-html' ).html( '' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'keyup',\n\t\t\t\t'.giveaway-sharing-method .method-title',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.giveaway-sharing-method' ).find( '.method-header strong' ).html( $( this ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( $( '.giveaway-sharing-methods' ).length ) {\n\t\t\t\t$( '.giveaway-sharing-methods .color-picker' ).wpColorPicker();\n\t\t\t}\n\n\t\t\t/** Form Fields ********/\n\n\t\t\tfunction giveaway_reset_form_fields_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.sg-form-fields-container' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'form_fields\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'form_fields[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfunction giveaway_reset_prizes_fields_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.sg-prizes-field-container' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'form_fields\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'form_fields[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'change',\n\t\t\t\t'.sg-field-type',\n\t\t\t\tfunction(e){\n\t\t\t\t\tvar type = $( this ).val(),\n\t\t\t\t\t$this = $( this ),\n\t\t\t\t\tparent = $this.parent();\n\t\t\t\t\tif ( 'radio' === type || 'select' === type ) {\n\t\t\t\t\t\tif ( parent.find( '.sg-form-field-options' ).length === 0 ) {\n\t\t\t\t\t\t\tvar index = $this.parents( '.sg-form-field' ).attr( 'data-index' ),\n\t\t\t\t\t\t\t tmpl = wp.template( 'sg-form-field-options' ),\n\t\t\t\t\t\t\t html = tmpl( {index: index} );\n\t\t\t\t\t\t\tparent.append( html );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar options = parent.find( '.sg-form-field-options' );\n\t\t\t\t\t\tif ( options.length ) {\n\t\t\t\t\t\t\toptions.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-remove-form-field-option',\n\t\t\t\tfunction(e){\n\t\t\t\t\t$( this ).parent().remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-add-form-field-option',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar index = $( this ).parents( '.sg-form-field' ).attr( 'data-index' ),\n\t\t\t\t\ttmpl = wp.template( 'sg-form-field-option' ),\n\t\t\t\t\thtml = tmpl( { index: index } );\n\t\t\t\t\t$( this ).parent().find( '.sg-form-field-options-container' ).append( html );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-form-fields-container' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tplaceholder: \"ui-state-highlight\",\n\t\t\t\t\thandle: '.sg-form-row-handle',\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_form_fields_index();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '#sgAddFormField' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction() {\n\t\t\t\t\tvar tmpl = wp.template( 'sg-form-field' ),\n\t\t\t\t\tcount = $( '.sg-form-fields-container' ).children().length,\n\t\t\t\t\thtml = tmpl( { index: count } );\n\t\t\t\t\t$( '.sg-form-fields-container' ).append( html );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-delete-form-field',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).remove();\n\t\t\t\t\tgiveaway_reset_form_fields_index();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-form-field-header .sg-field-name',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).toggleClass( 'open' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'keyup',\n\t\t\t\t'.sg-form-field-body .sg-field-name input',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar value = $( this ).val();\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).find( '.sg-form-field-header .sg-field-name' ).html( value );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '#sgAddPrizesField' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction() {\n\t\t\t\t\tvar tmpl = wp.template( 'sg-prizes-field' ),\n\t\t\t\t\tcount = $( '.sg-prizes-field-container' ).children().length,\n\t\t\t\t\thtml = tmpl( { index: count } );\n\t\t\t\t\t$( '.sg-prizes-field-container' ).append( html );\n\n\t\t\t\t\tvar prizesBox = $( '.sg-prizes-field-container .sg-form-field' ).last();\n\t\t\t\t\tprizesBox.toggleClass( 'open' );\n\t\t\t\t\tprizesBox.find( '.sg-field-name input' ).focus();\n\t\t\t\t\tsg_hide_show_metabox_fields_per_type();\n\t\t\t\t\t$( document.body ).triggerHandler( 'sg_prizes_field_added' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-delete-prizes-field',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).remove();\n\t\t\t\t\tgiveaway_reset_prizes_fields_index();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-prizes-field-container' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tplaceholder: \"ui-state-highlight\",\n\t\t\t\t\thandle: '.sg-form-row-handle',\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_prizes_fields_index();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/** Giveaway ***********/\n\t\t\tfunction sg_hide_show_metabox_fields_per_type() {\n\t\t\t\tvar giveaway_type = $( '#giveasap_type' ).val();\n\n\t\t\t\t$( '.sg-metaboxes .hide_if_any' ).hide();\n\t\t\t\t$( '.sg-metaboxes .show_if_any' ).show();\n\t\t\t\t$( '.hide_if_' + giveaway_type ).hide();\n\t\t\t\t$( '.show_if_' + giveaway_type ).show();\n\t\t\t\t// $('.sg-metaboxes tr:not(.hide_if_' + giveaway_type + ')').show();\n\n\t\t\t\t$( document.body ).triggerHandler( 'sg_giveaway_type_changed', [ giveaway_type ] );\n\t\t\t}\n\n\t\t\tif ( $( '#sg-metaboxes' ).length ) {\n\n\t\t\t\tsg_hide_show_metabox_fields_per_type();\n\n\t\t\t\t$( '#giveasap_type' ).on( 'change', sg_hide_show_metabox_fields_per_type );\n\t\t\t}\n\n\t\t\t/** Globals ***********/\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-button-action',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tajax = $this.attr( 'data-ajax' ) || '',\n\t\t\t\t\treload = $this.attr( 'data-reload' ) || '0',\n\t\t\t\t\tcallback = $this.attr( 'data-callback' ) || '',\n\t\t\t\t\tnonce = $this.attr( 'data-nonce' ) || '',\n\t\t\t\t\ttext2 = $this.attr( 'data-text' ),\n\t\t\t\t\ttext = $this.text(),\n\t\t\t\t\thref = $this.attr( 'href' );\n\n\t\t\t\t\tif ( text2 ) {\n\t\t\t\t\t\t$this.text( text2 );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ajax ) {\n\n\t\t\t\t\t\tvar data = { action: ajax };\n\n\t\t\t\t\t\tif ( nonce ) {\n\t\t\t\t\t\t\tdata.nonce = gasap.nonce;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( this.attributes.length ) {\n\t\t\t\t\t\t\tfor ( var i = 0; i < this.attributes.length; i++ ) {\n\t\t\t\t\t\t\t\tvar attr = this.attributes[ i ];\n\t\t\t\t\t\t\t\tdata[ attr.nodeName.replace( '-', '_' ) ] = attr.nodeValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\t\t\tsuccess: function( resp ) {\n\t\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\t\tvar fn = window[ callback ];\n\t\t\t\t\t\t\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\t\t\t\t\t\t\tfn( $this, resp );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( text2 && '1' !== reload ) {\n\t\t\t\t\t\t\t\t\t\t$this.text( text );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( '1' === reload ) {\n\t\t\t\t\t\t\t\t\t\tif ( href ) {\n\t\t\t\t\t\t\t\t\t\t\twindow.location.href = href;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tlocation.reload( false );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tvar fn = window[ callback ];\n\t\t\t\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\t\t\t\tfn( $this );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( text2 && '1' !== reload ) {\n\t\t\t\t\t\t\t$this.text( text );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( '1' === reload ) {\n\t\t\t\t\t\t\tif ( href ) {\n\t\t\t\t\t\t\t\twindow.location.href = href;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocation.reload( false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-action-category-title' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\t$( this ).parent().toggleClass( 'active' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-action' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\tvar $actionContainer = $( '#sgEntriesActions' ),\n\t\t\t\t\tcount = $actionContainer.children().length,\n\t\t\t\t\tslug = $( this ).attr( 'data-slug' ),\n\t\t\t\t\ttemplate = wp.template( slug );\n\n\t\t\t\t\tif ( $( '#tmpl-' + slug ).length ) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t$actionContainer.append( template( { index: count } ) );\n\t\t\t\t\t\t$( document.body ).trigger( 'sg-enhanced-select-search-init' );\n\t\t\t\t\t\t$( document.body ).trigger( 'sg-color-picker-init' );\n\t\t\t\t\t\tvar action = $actionContainer.children().last();\n\t\t\t\t\t\taction.find( '.sg-admin-action-title' ).trigger( 'click' );\n\t\t\t\t\t\twindow.giveasap_max_instance_id = window.giveasap_max_instance_id + 1\n\t\t\t\t\t\taction.find( '.sg-action-form-instance' ).val( window.giveasap_max_instance_id );\n\t\t\t\t\t\t$( [document.documentElement, document.body] ).animate(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tscrollTop: $actionContainer.children().last().offset().top - 24 // admin bar.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t500\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-extra-actions' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_extra_action_index();\n\t\t\t\t\t\tgiveasap_update_specific_mandatory_actions();\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-admin-action-remove',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( this ).parents( '.sg-admin-action' ).remove();\n\t\t\t\t\tgiveaway_reset_extra_action_index();\n\t\t\t\t\tgiveasap_update_specific_mandatory_actions();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction giveaway_reset_extra_action_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.sg-extra-actions' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'entries_actions\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'entries_actions[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-admin-action-title',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( this ).parent().toggleClass( 'active' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-multioption-button',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar id = $( this ).attr( 'data-id' ),\n\t\t\t\t\tname = $( this ).attr( 'data-name' ),\n\t\t\t\t\ttmpl = $( this ).attr( 'data-template' ),\n\t\t\t\t\tcount = $( '#' + id ).children().length,\n\t\t\t\t\ttemplate = wp.template( tmpl ),\n\t\t\t\t\thtml = template( { index: count, id: id, name: name } );\n\n\t\t\t\t\t$( '#' + id ).append( html );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-multioption-delete',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( this ).parent().remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'keyup',\n\t\t\t\t'.sg-form-field-title input',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar parent = $( this ).parents( '.sg-admin-form' );\n\t\t\t\t\tvar instance = parent.find( '.sg-action-form-instance' ).val();\n\t\t\t\t\tvar title = $( this ).val();\n\t\t\t\t\tgiveasap_update_specific_mandatory_action( instance, title );\n\t\t\t\t\tgiveasap_update_specific_mandatory_actions();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.mandatory-specific-action-checkbox',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar parent = $( this ).parents( '.sg-admin-form' );\n\t\t\t\t\tvar field = $( this ).parents( '.sg-form-field' );\n\t\t\t\t\tvar selected = field.attr( 'data-value' );\n\t\t\t\t\tvar instance = parent.find( '.sg-action-form-instance' ).val();\n\t\t\t\t\tvar value = $( this ).val();\n\n\t\t\t\t\tselected = selected.split(',');\n\t\t\t\t\tif ( $(this).prop('checked') && selected.indexOf( value ) < 0) {\n\t\t\t\t\t\tselected.push( value );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! $(this).prop('checked') && selected.indexOf( value ) >= 0) {\n\t\t\t\t\t\tvar index = selected.indexOf(value);\n\t\t\t\t\t\tif (index > -1) {\n\t\t\t\t\t\t\tselected.splice(index, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfield.attr('data-value', selected.join(','));\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction giveasap_update_specific_mandatory_action( instance, title ) {\n\t\t\t\tvar ids = window.giveasap_actions.map(\n\t\t\t\t\tfunction(action){\n\t\t\t\t\t\treturn parseInt( action.instance );\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( ids.indexOf( parseInt( instance ) ) >= 0 ) {\n\t\t\t\t\twindow.giveasap_actions = window.giveasap_actions.map(\n\t\t\t\t\t\tfunction (action) {\n\t\t\t\t\t\t\tif (parseInt( action.instance ) !== parseInt( instance )) {\n\t\t\t\t\t\t\t\treturn action;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\taction.title = title;\n\t\t\t\t\t\t\treturn action;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\twindow.giveasap_actions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinstance: instance,\n\t\t\t\t\t\t\ttitle: title\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction giveasap_update_specific_mandatory_actions() {\n\t\t\t\t$( document ).find( '.sg-select-specific-mandatory-actions' ).each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar $this = $( this );\n\t\t\t\t\t\tvar parent = $this.parents( '.sg-admin-form' );\n\t\t\t\t\t\tvar field = $this.parents( '.sg-form-field' );\n\t\t\t\t\t\tvar selected = field.attr( 'data-value' );\n\t\t\t\t\t\tvar name = field.attr( 'data-name' );\n\t\t\t\t\t\tvar instance = parent.find( '.sg-action-form-instance' ).val();\n\t\t\t\t\t\tvar data = [];\n\n\t\t\t\t\t\tif ( selected ) {\n\t\t\t\t\t\t\tselected = selected.split(',');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( window.giveasap_actions && window.giveasap_actions.length ) {\n\t\t\t\t\t\t\tfor (var g = 0; g < window.giveasap_actions.length; g++ ) {\n\t\t\t\t\t\t\t\tvar action_id = window.giveasap_actions[ g ].instance;\n\n\t\t\t\t\t\t\t\tif ( parseInt( instance ) === parseInt( action_id ) ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar optionSelected = selected && selected.indexOf( action_id ) >= 0;\n\n\t\t\t\t\t\t\t\tdata.push(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: action_id,\n\t\t\t\t\t\t\t\t\t\ttext: window.giveasap_actions[ g ].title,\n\t\t\t\t\t\t\t\t\t\tselected: optionSelected\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! data.length ) {\n\t\t\t\t\t\t\tfield.addClass('hidden');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar html = '';\n\t\t\t\t\t\tfor( var d = 0; d < data.length; d++ ) {\n\t\t\t\t\t\t\tvar action = data[d];\n\t\t\t\t\t\t\tvar checkedHTML = '';\n\t\t\t\t\t\t\tif ( action.selected ) {\n\t\t\t\t\t\t\t\tcheckedHTML = 'checked=\"checked\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += '<label for=\"' + instance + '_specific_action_' + d + '\">';\n\t\t\t\t\t\t\thtml += '<input class=\"mandatory-specific-action-checkbox\" ' + checkedHTML + ' id=\"' + instance + '_specific_action_' + d + '\" type=\"checkbox\" name=\"' + name + '\" value=\"' + action.id + '\"/>'\n\t\t\t\t\t\t\thtml += action.text;\n\t\t\t\t\t\t\thtml += '</label>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this.html(html);\n\t\t\t\t\t\tfield.removeClass('hidden');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tgiveasap_update_specific_mandatory_actions();\n\n\t\t\t$( document ).find( '.sg-select2:not(.enhanced)' ).each(\n\t\t\t\tfunction(){\n\t\t\t\t\tif ( $( this ).parents( '.sg-report-options' ).length ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $this = $( this );\n\t\t\t\t\t$( this ).select2(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tplaceholder: $this.attr( 'placeholder' ) || '',\n\t\t\t\t\t\t\tminimumInputLength: $this.attr( 'data-mininput' ) || 3,\n\t\t\t\t\t\t\tajax: {\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\tdata: function (params) {\n\t\t\t\t\t\t\t\t\tvar query = {\n\t\t\t\t\t\t\t\t\t\tsearch: params.term,\n\t\t\t\t\t\t\t\t\t\ttype: 'public',\n\t\t\t\t\t\t\t\t\t\taction: $this.attr( 'data-action' ) || 'sg_get_giveaways'\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Query parameters will be ?search=[term]&type=public\n\t\t\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tprocessResults: function (data) {\n\t\t\t\t\t\t\t\t\tif ( data.success ) {\n\t\t\t\t\t\t\t\t\t\tvar items = [];\n\t\t\t\t\t\t\t\t\t\tfor ( var index in data.data ) {\n\t\t\t\t\t\t\t\t\t\t\titems.push(\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tid: data.data[index].ID,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttext: data.data[index].post_title\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresults: items\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Transforms the top-level key of the response object from 'items' to 'results'\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tresults: data.items\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t).addClass( 'enhanced' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/* <fs_premium_only> */\n\n\t\t\tfunction sgToggleMultiplePrizesFields( type ) {\n\n\t\t\t\tswitch ( type ) {\n\t\t\t\t\tcase 'default':\n\t\t\t\t\t\t$( '.sg-prizes-field-container .sg-form-field' ).each(\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\tvar $prize_fields = $( this );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-winner' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-chance' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-quantity' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'random':\n\t\t\t\t\t\t$( '.sg-prizes-field-container .sg-form-field' ).each(\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\tvar $prize_fields = $( this );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-winner' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-chance' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-quantity' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$( document.body ).triggerHandler( 'sg_toggle_multiple_prizes_fields', [ type ] );\n\t\t\t}\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'sg_giveaway_type_changed',\n\t\t\t\tfunction( e, type ) {\n\t\t\t\t\tif ( 'instant' === type ) {\n\t\t\t\t\t\t$( '#sg-metabox-fields-giveasap_prize #type' ).val( 'random' );\n\t\t\t\t\t}\n\t\t\t\t\tsgToggleMultiplePrizesFields( $( '#sg-metabox-fields-giveasap_prize #type' ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'sg_prizes_field_added',\n\t\t\t\tfunction(){\n\t\t\t\t\tsgToggleMultiplePrizesFields( $( '#sg-metabox-fields-giveasap_prize #type' ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( $( '#sg-metabox-fields-giveasap_prize' ).length ) {\n\t\t\t\tsgToggleMultiplePrizesFields( $( '#sg-metabox-fields-giveasap_prize #type' ).val() );\n\t\t\t}\n\t\t\t$( document.body ).on(\n\t\t\t\t'change',\n\t\t\t\t'#sg-metabox-fields-giveasap_prize #type',\n\t\t\t\tfunction(e){\n\t\t\t\t\tsgToggleMultiplePrizesFields( $( this ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '#ga_aweber_disconnect' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $( this ).parent();\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: { action: 'giveasap_disconnect_ga_aweber', nonce: gasap.nonce },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$( '.ga-aweber-disconnect' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t\t$( '.ga-aweber-connect' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parent();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).attr( 'type', 'number' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-save' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-user-entries' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-cancel' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-save',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parent(),\n\t\t\t\t\tuser_id = parent.find( '.giveasap-edit-user-input' ).attr( 'data-id' ),\n\t\t\t\t\tentries = parent.find( '.giveasap-edit-user-input' ).val();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\n\t\t\t\t\t$this.html( gasap.text.saving );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: { action: 'giveasap_edit_user_entry', user_id: user_id, nonce: gasap.nonce, entries: entries },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$this.html( gasap.text.save );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).val( resp.data.entries );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-user-entries' ).html( resp.data.entries );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).attr( 'type', 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-save' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-user-entries' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-cancel' ).addClass( 'hidden' );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar html = '<p class=\"giveasap-edit-user-alert\">' + resp.data.message + '</p>';\n\t\t\t\t\t\t\t\t\tparent.append( html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-cancel',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parent();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\t\t\t\t\tparent.find( '.giveasap-edit-user' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).attr( 'type', 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-save' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-user-entries' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-cancel' ).addClass( 'hidden' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-email',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar parent = $( this ).parents( 'tr' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-input' ).removeClass( 'hidden' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-email-cancel',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar parent = $( this ).parents( 'tr' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-input' ).addClass( 'hidden' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-email-save',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parents( 'td' ),\n\t\t\t\t\tuser_id = parent.find( '.giveasap-edit-user-email-input' ).attr( 'data-id' ),\n\t\t\t\t\temail = parent.find( '.giveasap-edit-user-email-input' ).val();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\n\t\t\t\t\t$this.html( gasap.text.saving );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: { action: 'giveasap_edit_user_email', user_id: user_id, nonce: gasap.nonce, email: email },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$this.html( gasap.text.save );\n\t\t\t\t\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-input' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text strong' ).html( email );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar html = '<p class=\"giveasap-edit-user-alert\">' + resp.data.message + '</p>';\n\t\t\t\t\t\t\t\t\tparent.append( html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\twindow['sg_replace_form_fields'] = function sg_replace_form_fields( $el, response ) {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\t$el.parents( 'tr' ).html( response.data.fields_html );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'[name=mailchimp_list], #ga_mailchimp [name=list]',\n\t\t\t\tfunction(){\n\t\t\t\t\tconsole.log( $( this ).val() );\n\t\t\t\t\tvar list = $( this ).val(),\n\t\t\t\t\tself = $( this ),\n\t\t\t\t\tname = self.attr( 'name' );\n\n\t\t\t\t\tself.parents( 'td' ).addClass( 'sg-loading' );\n\t\t\t\t\t$( '.mailchimp-groups' ).html( '' );\n\t\t\t\t\t$( '.mailchimp-group-options' ).html( '' );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\tdata: { action: 'sg_mailchimp_get_groups', nonce: gasap.nonce, list: list, name: name },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$( '.mailchimp-groups' ).html( resp.data.html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete: function(){\n\n\t\t\t\t\t\t\t\tself.parents( 'td' ).removeClass( 'sg-loading' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.mailchimp-groups select',\n\t\t\t\tfunction(){\n\t\t\t\t\tconsole.log( $( this ).val() );\n\t\t\t\t\tvar group = $( this ).val(),\n\t\t\t\t\tlist = $( '.mailchimp-list' ).val(),\n\t\t\t\t\tself = $( this ),\n\t\t\t\t\tname = self.attr( 'name' );\n\n\t\t\t\t\tself.parents( 'td' ).addClass( 'sg-loading' );\n\t\t\t\t\t$( '.mailchimp-group-options' ).html( '' );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\tdata: { action: 'sg_mailchimp_get_group_options', nonce: gasap.nonce, list: list, name: name, group: group },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$( '.mailchimp-group-options' ).html( resp.data.html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete: function(){\n\n\t\t\t\t\t\t\t\tself.parents( 'td' ).removeClass( 'sg-loading' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/* </fs_premium_only> */\n\n\t\t\t/** Select2 Ajax **/\n\t\t\t$( document.body )\n\t\t\t.on(\n\t\t\t\t'sg-enhanced-select-search-init',\n\t\t\t\tfunction() {\n\n\t\t\t\t\t// Ajax product search box\n\t\t\t\t\t$( ':input.sg-select-search' ).filter( ':not(.enhanced)' ).each(\n\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\tvar select2_args = {\n\t\t\t\t\t\t\t\tallowClear: $( this ).data( 'allow_clear' ) ? true : false,\n\t\t\t\t\t\t\t\tplaceholder: $( this ).data( 'placeholder' ),\n\t\t\t\t\t\t\t\tminimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',\n\t\t\t\t\t\t\t\tescapeMarkup: function (m) {\n\t\t\t\t\t\t\t\t\treturn m;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tajax: {\n\t\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\t\tdelay: 250,\n\t\t\t\t\t\t\t\t\tdata: function (params) {\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tterm: params.term,\n\t\t\t\t\t\t\t\t\t\t\taction: $( this ).data( 'action' ) || 'sg_select_search',\n\t\t\t\t\t\t\t\t\t\t\tsecurity: gasap.nonce,\n\t\t\t\t\t\t\t\t\t\t\texclude: $( this ).data( 'exclude' ),\n\t\t\t\t\t\t\t\t\t\t\texclude_type: $( this ).data( 'exclude_type' ),\n\t\t\t\t\t\t\t\t\t\t\tinclude: $( this ).data( 'include' ),\n\t\t\t\t\t\t\t\t\t\t\tlimit: $( this ).data( 'limit' ),\n\t\t\t\t\t\t\t\t\t\t\tdisplay_stock: $( this ).data( 'display_stock' )\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tprocessResults: function (data) {\n\t\t\t\t\t\t\t\t\t\tvar terms = [];\n\t\t\t\t\t\t\t\t\t\tif (data) {\n\t\t\t\t\t\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t\t\t\t\t\tfunction (id, text) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tterms.push( {id: id, text: text} );\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresults: terms\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tcache: true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t$( this ).select2( select2_args ).addClass( 'enhanced' );\n\n\t\t\t\t\t\t\tif ($( this ).prop( 'multiple' )) {\n\t\t\t\t\t\t\t\t$( this ).on(\n\t\t\t\t\t\t\t\t\t'change',\n\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\tvar $children = $( this ).children();\n\t\t\t\t\t\t\t\t\t\t$children.sort(\n\t\t\t\t\t\t\t\t\t\t\tfunction (a, b) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar atext = a.text.toLowerCase();\n\t\t\t\t\t\t\t\t\t\t\t\tvar btext = b.text.toLowerCase();\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (atext > btext) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (atext < btext) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t$( this ).html( $children );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t).trigger( 'sg-enhanced-select-search-init' );\n\n\t\t\t$( document.body )\n\t\t\t.on(\n\t\t\t\t'sg-color-picker-init',\n\t\t\t\tfunction() {\n\t\t\t\t\t// Ajax product search box\n\t\t\t\t\t$( ':input.sg-color-picker' ).filter( ':not(.enhanced)' ).each(\n\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t$( this ).wpColorPicker();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t).trigger( 'sg-color-picker-init' );\n\t\t}\n\t);\n})( jQuery )\n"],"names":["tlite","giveasap_image_media","$imageContainer","$imageInput","file_frame","undefined","open","wp","media","multiple","on","selection","state","get","ids","val","split","forEach","id","attachment","fetch","add","attachments","toJSON","attachmentIDs","empty","console","log","$galleryID","attr","i","length","type","push","append","sortable_gallery_image_create","join","sortable_image_gallery_media","$attachment","image_url","sizes","thumbnail","url","full","$output","title","sortable_gallery_image_remove","jQuery","$id","parent","$gallery","remove","$idIndex","indexOf","splice","giveasap_prepare_format_from_php","format","replace","giveasap_initialize_code_editor","$","each","editorSettings","codeEditor","defaultSettings","_","clone","mode","codemirror","extend","indentUnit","tabSize","editor","initialize","document","ready","body","e","prop","children","prizesDropdown","havePricesSelected","value","find","preventDefault","alert","el","classList","contains","$this","$target","$class","toggleClass","hasClass","removeAttr","$text","old_text","text","html","ajax","gasap","ajax_url","dataType","data","action","giveaway","nonce","success","resp","imageButton","$input","galleryID","imageContainer","imageInput","sortable","event","ui","$ids","$images","end_time","end_date","reverse","winner_time","winner_date","end_date_object","Date","parse","winner_date_object","winner_before_end","$expand_users","$users_container","$date_format","$format","datepicker","altFormat","integration","removeClass","addClass","activate","deactivate","inputs","window","location","href","parts","query","qparams","params","strings","name","params_array","key","target","frame","height","form","parents","checkValidity","txt","validationMessage","error","focus","prepend","setTimeout","fadeOut","magnificPopup","template","index","eq","trigger","giveaway_reset_methods_index","_index","parseInt","reg","RegExp","_html","update","method","attributes","image","wpColorPicker","giveaway_reset_form_fields_index","giveaway_reset_prizes_fields_index","tmpl","options","placeholder","handle","count","prizesBox","last","sg_hide_show_metabox_fields_per_type","triggerHandler","giveaway_type","hide","show","reload","callback","text2","nodeName","nodeValue","fn","$actionContainer","slug","giveasap_max_instance_id","documentElement","animate","scrollTop","offset","top","giveaway_reset_extra_action_index","giveasap_update_specific_mandatory_actions","instance","giveasap_update_specific_mandatory_action","field","selected","giveasap_actions","map","g","action_id","optionSelected","d","checkedHTML","select2","minimumInputLength","search","term","processResults","items","ID","post_title","results","sgToggleMultiplePrizesFields","$prize_fields","user_id","entries","saving","save","message","email","sg_replace_form_fields","$el","response","fields_html","list","self","complete","group","filter","select2_args","allowClear","escapeMarkup","m","delay","security","exclude","exclude_type","include","limit","display_stock","terms","cache","$children","sort","a","b","atext","toLowerCase","btext"],"sourceRoot":""}1 {"version":3,"file":"js/admin.js","mappings":";;;;;;;;;AAAA;AACA;AACA,qCAAqC;AACrC,CAAC;AACD,IAAI,IAA0C;AAC9C;AACA,CAAC,iCAAO,CAAC,2CAAQ,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,kGAAC;AAC5B,GAAG,KAAK,EAMN;AACF,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;;;AAIA,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,IAAI;AACJ;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,uBAAuB;AACvB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,8DAA8D;;AAE9D;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;;AAGF;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ,IAAI;AACJ;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,OAAO;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA,EAAE;;;AAGF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,QAAQ;AACR;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA,2CAA2C,cAAc,kBAAkB,oBAAoB,aAAa;AAC5G;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;;;;;AAKH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,8EAA8E;;AAE9E;;AAEA;;AAEA;;AAEA;AACA;;;;AAIA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B,IAAI;AACJ;AACA;AACA;;AAEA,GAAG;AACH;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAM;;AAEN;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;;AAEA;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,OAAO;;AAEf,OAAO,aAAa;;AAEpB,MAAM,OAAO;;;AAGb;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;AAID;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB,OAAO;AACP,4BAA4B;AAC5B;AACA,KAAK;AACL;AACA;AACA,IAAI;;AAEJ;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,CAAC;;;;AAID;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;;AAEA,yBAAyB;;AAEzB;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;;AAEN;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,cAAc,qDAAqD;AACnE;AACA;AACA,cAAc,qDAAqD;AACnE;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,mDAAmD,mBAAmB;AACtE,GAAG;AACH;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA,oBAAoB;;;;;;;;;;ACn0DpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA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aways/./node_modules/tlite/tlite.js","webpack://simple-giveaways/external var \"jQuery\"","webpack://simple-giveaways/webpack/bootstrap","webpack://simple-giveaways/webpack/runtime/compat get default export","webpack://simple-giveaways/webpack/runtime/define property getters","webpack://simple-giveaways/webpack/runtime/hasOwnProperty shorthand","webpack://simple-giveaways/webpack/runtime/make namespace object","webpack://simple-giveaways/./assets/js/admin.js"],"sourcesContent":["/*! Magnific Popup - v1.1.0 - 2016-02-20\n* http://dimsemenov.com/plugins/magnific-popup/\n* Copyright (c) 2016 Dmitry Semenov; */\n;(function (factory) { \nif (typeof define === 'function' && define.amd) { \n // AMD. Register as an anonymous module. \n define(['jquery'], factory); \n } else if (typeof exports === 'object') { \n // Node/CommonJS \n factory(require('jquery')); \n } else { \n // Browser globals \n factory(window.jQuery || window.Zepto); \n } \n }(function($) { \n\n/*>>core*/\n/**\n * \n * Magnific Popup Core JS file\n * \n */\n\n\n/**\n * Private static constants\n */\nvar CLOSE_EVENT = 'Close',\n\tBEFORE_CLOSE_EVENT = 'BeforeClose',\n\tAFTER_CLOSE_EVENT = 'AfterClose',\n\tBEFORE_APPEND_EVENT = 'BeforeAppend',\n\tMARKUP_PARSE_EVENT = 'MarkupParse',\n\tOPEN_EVENT = 'Open',\n\tCHANGE_EVENT = 'Change',\n\tNS = 'mfp',\n\tEVENT_NS = '.' + NS,\n\tREADY_CLASS = 'mfp-ready',\n\tREMOVING_CLASS = 'mfp-removing',\n\tPREVENT_CLOSE_CLASS = 'mfp-prevent-close';\n\n\n/**\n * Private vars \n */\n/*jshint -W079 */\nvar mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'\n\tMagnificPopup = function(){},\n\t_isJQ = !!(window.jQuery),\n\t_prevStatus,\n\t_window = $(window),\n\t_document,\n\t_prevContentType,\n\t_wrapClasses,\n\t_currPopupType;\n\n\n/**\n * Private functions\n */\nvar _mfpOn = function(name, f) {\n\t\tmfp.ev.on(NS + name + EVENT_NS, f);\n\t},\n\t_getEl = function(className, appendTo, html, raw) {\n\t\tvar el = document.createElement('div');\n\t\tel.className = 'mfp-'+className;\n\t\tif(html) {\n\t\t\tel.innerHTML = html;\n\t\t}\n\t\tif(!raw) {\n\t\t\tel = $(el);\n\t\t\tif(appendTo) {\n\t\t\t\tel.appendTo(appendTo);\n\t\t\t}\n\t\t} else if(appendTo) {\n\t\t\tappendTo.appendChild(el);\n\t\t}\n\t\treturn el;\n\t},\n\t_mfpTrigger = function(e, data) {\n\t\tmfp.ev.triggerHandler(NS + e, data);\n\n\t\tif(mfp.st.callbacks) {\n\t\t\t// converts \"mfpEventName\" to \"eventName\" callback and triggers it if it's present\n\t\t\te = e.charAt(0).toLowerCase() + e.slice(1);\n\t\t\tif(mfp.st.callbacks[e]) {\n\t\t\t\tmfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);\n\t\t\t}\n\t\t}\n\t},\n\t_getCloseBtn = function(type) {\n\t\tif(type !== _currPopupType || !mfp.currTemplate.closeBtn) {\n\t\t\tmfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );\n\t\t\t_currPopupType = type;\n\t\t}\n\t\treturn mfp.currTemplate.closeBtn;\n\t},\n\t// Initialize Magnific Popup only when called at least once\n\t_checkInstance = function() {\n\t\tif(!$.magnificPopup.instance) {\n\t\t\t/*jshint -W020 */\n\t\t\tmfp = new MagnificPopup();\n\t\t\tmfp.init();\n\t\t\t$.magnificPopup.instance = mfp;\n\t\t}\n\t},\n\t// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr\n\tsupportsTransitions = function() {\n\t\tvar s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist\n\t\t\tv = ['ms','O','Moz','Webkit']; // 'v' for vendor\n\n\t\tif( s['transition'] !== undefined ) {\n\t\t\treturn true; \n\t\t}\n\t\t\t\n\t\twhile( v.length ) {\n\t\t\tif( v.pop() + 'Transition' in s ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\treturn false;\n\t};\n\n\n\n/**\n * Public functions\n */\nMagnificPopup.prototype = {\n\n\tconstructor: MagnificPopup,\n\n\t/**\n\t * Initializes Magnific Popup plugin. \n\t * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed\n\t */\n\tinit: function() {\n\t\tvar appVersion = navigator.appVersion;\n\t\tmfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;\n\t\tmfp.isAndroid = (/android/gi).test(appVersion);\n\t\tmfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);\n\t\tmfp.supportsTransition = supportsTransitions();\n\n\t\t// We disable fixed positioned lightbox on devices that don't handle it nicely.\n\t\t// If you know a better way of detecting this - let me know.\n\t\tmfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );\n\t\t_document = $(document);\n\n\t\tmfp.popupsCache = {};\n\t},\n\n\t/**\n\t * Opens popup\n\t * @param data [description]\n\t */\n\topen: function(data) {\n\n\t\tvar i;\n\n\t\tif(data.isObj === false) { \n\t\t\t// convert jQuery collection to array to avoid conflicts later\n\t\t\tmfp.items = data.items.toArray();\n\n\t\t\tmfp.index = 0;\n\t\t\tvar items = data.items,\n\t\t\t\titem;\n\t\t\tfor(i = 0; i < items.length; i++) {\n\t\t\t\titem = items[i];\n\t\t\t\tif(item.parsed) {\n\t\t\t\t\titem = item.el[0];\n\t\t\t\t}\n\t\t\t\tif(item === data.el[0]) {\n\t\t\t\t\tmfp.index = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tmfp.items = $.isArray(data.items) ? data.items : [data.items];\n\t\t\tmfp.index = data.index || 0;\n\t\t}\n\n\t\t// if popup is already opened - we just update the content\n\t\tif(mfp.isOpen) {\n\t\t\tmfp.updateItemHTML();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tmfp.types = []; \n\t\t_wrapClasses = '';\n\t\tif(data.mainEl && data.mainEl.length) {\n\t\t\tmfp.ev = data.mainEl.eq(0);\n\t\t} else {\n\t\t\tmfp.ev = _document;\n\t\t}\n\n\t\tif(data.key) {\n\t\t\tif(!mfp.popupsCache[data.key]) {\n\t\t\t\tmfp.popupsCache[data.key] = {};\n\t\t\t}\n\t\t\tmfp.currTemplate = mfp.popupsCache[data.key];\n\t\t} else {\n\t\t\tmfp.currTemplate = {};\n\t\t}\n\n\n\n\t\tmfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); \n\t\tmfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;\n\n\t\tif(mfp.st.modal) {\n\t\t\tmfp.st.closeOnContentClick = false;\n\t\t\tmfp.st.closeOnBgClick = false;\n\t\t\tmfp.st.showCloseBtn = false;\n\t\t\tmfp.st.enableEscapeKey = false;\n\t\t}\n\t\t\n\n\t\t// Building markup\n\t\t// main containers are created only once\n\t\tif(!mfp.bgOverlay) {\n\n\t\t\t// Dark overlay\n\t\t\tmfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {\n\t\t\t\tmfp.close();\n\t\t\t});\n\n\t\t\tmfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {\n\t\t\t\tif(mfp._checkIfClose(e.target)) {\n\t\t\t\t\tmfp.close();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmfp.container = _getEl('container', mfp.wrap);\n\t\t}\n\n\t\tmfp.contentContainer = _getEl('content');\n\t\tif(mfp.st.preloader) {\n\t\t\tmfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);\n\t\t}\n\n\n\t\t// Initializing modules\n\t\tvar modules = $.magnificPopup.modules;\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar n = modules[i];\n\t\t\tn = n.charAt(0).toUpperCase() + n.slice(1);\n\t\t\tmfp['init'+n].call(mfp);\n\t\t}\n\t\t_mfpTrigger('BeforeOpen');\n\n\n\t\tif(mfp.st.showCloseBtn) {\n\t\t\t// Close button\n\t\t\tif(!mfp.st.closeBtnInside) {\n\t\t\t\tmfp.wrap.append( _getCloseBtn() );\n\t\t\t} else {\n\t\t\t\t_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {\n\t\t\t\t\tvalues.close_replaceWith = _getCloseBtn(item.type);\n\t\t\t\t});\n\t\t\t\t_wrapClasses += ' mfp-close-btn-in';\n\t\t\t}\n\t\t}\n\n\t\tif(mfp.st.alignTop) {\n\t\t\t_wrapClasses += ' mfp-align-top';\n\t\t}\n\n\t\n\n\t\tif(mfp.fixedContentPos) {\n\t\t\tmfp.wrap.css({\n\t\t\t\toverflow: mfp.st.overflowY,\n\t\t\t\toverflowX: 'hidden',\n\t\t\t\toverflowY: mfp.st.overflowY\n\t\t\t});\n\t\t} else {\n\t\t\tmfp.wrap.css({ \n\t\t\t\ttop: _window.scrollTop(),\n\t\t\t\tposition: 'absolute'\n\t\t\t});\n\t\t}\n\t\tif( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {\n\t\t\tmfp.bgOverlay.css({\n\t\t\t\theight: _document.height(),\n\t\t\t\tposition: 'absolute'\n\t\t\t});\n\t\t}\n\n\t\t\n\n\t\tif(mfp.st.enableEscapeKey) {\n\t\t\t// Close on ESC key\n\t\t\t_document.on('keyup' + EVENT_NS, function(e) {\n\t\t\t\tif(e.keyCode === 27) {\n\t\t\t\t\tmfp.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t_window.on('resize' + EVENT_NS, function() {\n\t\t\tmfp.updateSize();\n\t\t});\n\n\n\t\tif(!mfp.st.closeOnContentClick) {\n\t\t\t_wrapClasses += ' mfp-auto-cursor';\n\t\t}\n\t\t\n\t\tif(_wrapClasses)\n\t\t\tmfp.wrap.addClass(_wrapClasses);\n\n\n\t\t// this triggers recalculation of layout, so we get it once to not to trigger twice\n\t\tvar windowHeight = mfp.wH = _window.height();\n\n\t\t\n\t\tvar windowStyles = {};\n\n\t\tif( mfp.fixedContentPos ) {\n if(mfp._hasScrollBar(windowHeight)){\n var s = mfp._getScrollbarSize();\n if(s) {\n windowStyles.marginRight = s;\n }\n }\n }\n\n\t\tif(mfp.fixedContentPos) {\n\t\t\tif(!mfp.isIE7) {\n\t\t\t\twindowStyles.overflow = 'hidden';\n\t\t\t} else {\n\t\t\t\t// ie7 double-scroll bug\n\t\t\t\t$('body, html').css('overflow', 'hidden');\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\tvar classesToadd = mfp.st.mainClass;\n\t\tif(mfp.isIE7) {\n\t\t\tclassesToadd += ' mfp-ie7';\n\t\t}\n\t\tif(classesToadd) {\n\t\t\tmfp._addClassToMFP( classesToadd );\n\t\t}\n\n\t\t// add content\n\t\tmfp.updateItemHTML();\n\n\t\t_mfpTrigger('BuildControls');\n\n\t\t// remove scrollbar, add margin e.t.c\n\t\t$('html').css(windowStyles);\n\t\t\n\t\t// add everything to DOM\n\t\tmfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );\n\n\t\t// Save last focused element\n\t\tmfp._lastFocusedEl = document.activeElement;\n\t\t\n\t\t// Wait for next cycle to allow CSS transition\n\t\tsetTimeout(function() {\n\t\t\t\n\t\t\tif(mfp.content) {\n\t\t\t\tmfp._addClassToMFP(READY_CLASS);\n\t\t\t\tmfp._setFocus();\n\t\t\t} else {\n\t\t\t\t// if content is not defined (not loaded e.t.c) we add class only for BG\n\t\t\t\tmfp.bgOverlay.addClass(READY_CLASS);\n\t\t\t}\n\t\t\t\n\t\t\t// Trap the focus in popup\n\t\t\t_document.on('focusin' + EVENT_NS, mfp._onFocusIn);\n\n\t\t}, 16);\n\n\t\tmfp.isOpen = true;\n\t\tmfp.updateSize(windowHeight);\n\t\t_mfpTrigger(OPEN_EVENT);\n\n\t\treturn data;\n\t},\n\n\t/**\n\t * Closes the popup\n\t */\n\tclose: function() {\n\t\tif(!mfp.isOpen) return;\n\t\t_mfpTrigger(BEFORE_CLOSE_EVENT);\n\n\t\tmfp.isOpen = false;\n\t\t// for CSS3 animation\n\t\tif(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {\n\t\t\tmfp._addClassToMFP(REMOVING_CLASS);\n\t\t\tsetTimeout(function() {\n\t\t\t\tmfp._close();\n\t\t\t}, mfp.st.removalDelay);\n\t\t} else {\n\t\t\tmfp._close();\n\t\t}\n\t},\n\n\t/**\n\t * Helper for close() function\n\t */\n\t_close: function() {\n\t\t_mfpTrigger(CLOSE_EVENT);\n\n\t\tvar classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';\n\n\t\tmfp.bgOverlay.detach();\n\t\tmfp.wrap.detach();\n\t\tmfp.container.empty();\n\n\t\tif(mfp.st.mainClass) {\n\t\t\tclassesToRemove += mfp.st.mainClass + ' ';\n\t\t}\n\n\t\tmfp._removeClassFromMFP(classesToRemove);\n\n\t\tif(mfp.fixedContentPos) {\n\t\t\tvar windowStyles = {marginRight: ''};\n\t\t\tif(mfp.isIE7) {\n\t\t\t\t$('body, html').css('overflow', '');\n\t\t\t} else {\n\t\t\t\twindowStyles.overflow = '';\n\t\t\t}\n\t\t\t$('html').css(windowStyles);\n\t\t}\n\t\t\n\t\t_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);\n\t\tmfp.ev.off(EVENT_NS);\n\n\t\t// clean up DOM elements that aren't removed\n\t\tmfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');\n\t\tmfp.bgOverlay.attr('class', 'mfp-bg');\n\t\tmfp.container.attr('class', 'mfp-container');\n\n\t\t// remove close button from target element\n\t\tif(mfp.st.showCloseBtn &&\n\t\t(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {\n\t\t\tif(mfp.currTemplate.closeBtn)\n\t\t\t\tmfp.currTemplate.closeBtn.detach();\n\t\t}\n\n\n\t\tif(mfp.st.autoFocusLast && mfp._lastFocusedEl) {\n\t\t\t$(mfp._lastFocusedEl).focus(); // put tab focus back\n\t\t}\n\t\tmfp.currItem = null;\t\n\t\tmfp.content = null;\n\t\tmfp.currTemplate = null;\n\t\tmfp.prevHeight = 0;\n\n\t\t_mfpTrigger(AFTER_CLOSE_EVENT);\n\t},\n\t\n\tupdateSize: function(winHeight) {\n\n\t\tif(mfp.isIOS) {\n\t\t\t// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2\n\t\t\tvar zoomLevel = document.documentElement.clientWidth / window.innerWidth;\n\t\t\tvar height = window.innerHeight * zoomLevel;\n\t\t\tmfp.wrap.css('height', height);\n\t\t\tmfp.wH = height;\n\t\t} else {\n\t\t\tmfp.wH = winHeight || _window.height();\n\t\t}\n\t\t// Fixes #84: popup incorrectly positioned with position:relative on body\n\t\tif(!mfp.fixedContentPos) {\n\t\t\tmfp.wrap.css('height', mfp.wH);\n\t\t}\n\n\t\t_mfpTrigger('Resize');\n\n\t},\n\n\t/**\n\t * Set content of popup based on current index\n\t */\n\tupdateItemHTML: function() {\n\t\tvar item = mfp.items[mfp.index];\n\n\t\t// Detach and perform modifications\n\t\tmfp.contentContainer.detach();\n\n\t\tif(mfp.content)\n\t\t\tmfp.content.detach();\n\n\t\tif(!item.parsed) {\n\t\t\titem = mfp.parseEl( mfp.index );\n\t\t}\n\n\t\tvar type = item.type;\n\n\t\t_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);\n\t\t// BeforeChange event works like so:\n\t\t// _mfpOn('BeforeChange', function(e, prevType, newType) { });\n\n\t\tmfp.currItem = item;\n\n\t\tif(!mfp.currTemplate[type]) {\n\t\t\tvar markup = mfp.st[type] ? mfp.st[type].markup : false;\n\n\t\t\t// allows to modify markup\n\t\t\t_mfpTrigger('FirstMarkupParse', markup);\n\n\t\t\tif(markup) {\n\t\t\t\tmfp.currTemplate[type] = $(markup);\n\t\t\t} else {\n\t\t\t\t// if there is no markup found we just define that template is parsed\n\t\t\t\tmfp.currTemplate[type] = true;\n\t\t\t}\n\t\t}\n\n\t\tif(_prevContentType && _prevContentType !== item.type) {\n\t\t\tmfp.container.removeClass('mfp-'+_prevContentType+'-holder');\n\t\t}\n\n\t\tvar newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);\n\t\tmfp.appendContent(newContent, type);\n\n\t\titem.preloaded = true;\n\n\t\t_mfpTrigger(CHANGE_EVENT, item);\n\t\t_prevContentType = item.type;\n\n\t\t// Append container back after its content changed\n\t\tmfp.container.prepend(mfp.contentContainer);\n\n\t\t_mfpTrigger('AfterChange');\n\t},\n\n\n\t/**\n\t * Set HTML content of popup\n\t */\n\tappendContent: function(newContent, type) {\n\t\tmfp.content = newContent;\n\n\t\tif(newContent) {\n\t\t\tif(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&\n\t\t\t\tmfp.currTemplate[type] === true) {\n\t\t\t\t// if there is no markup, we just append close button element inside\n\t\t\t\tif(!mfp.content.find('.mfp-close').length) {\n\t\t\t\t\tmfp.content.append(_getCloseBtn());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmfp.content = newContent;\n\t\t\t}\n\t\t} else {\n\t\t\tmfp.content = '';\n\t\t}\n\n\t\t_mfpTrigger(BEFORE_APPEND_EVENT);\n\t\tmfp.container.addClass('mfp-'+type+'-holder');\n\n\t\tmfp.contentContainer.append(mfp.content);\n\t},\n\n\n\t/**\n\t * Creates Magnific Popup data object based on given data\n\t * @param {int} index Index of item to parse\n\t */\n\tparseEl: function(index) {\n\t\tvar item = mfp.items[index],\n\t\t\ttype;\n\n\t\tif(item.tagName) {\n\t\t\titem = { el: $(item) };\n\t\t} else {\n\t\t\ttype = item.type;\n\t\t\titem = { data: item, src: item.src };\n\t\t}\n\n\t\tif(item.el) {\n\t\t\tvar types = mfp.types;\n\n\t\t\t// check for 'mfp-TYPE' class\n\t\t\tfor(var i = 0; i < types.length; i++) {\n\t\t\t\tif( item.el.hasClass('mfp-'+types[i]) ) {\n\t\t\t\t\ttype = types[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titem.src = item.el.attr('data-mfp-src');\n\t\t\tif(!item.src) {\n\t\t\t\titem.src = item.el.attr('href');\n\t\t\t}\n\t\t}\n\n\t\titem.type = type || mfp.st.type || 'inline';\n\t\titem.index = index;\n\t\titem.parsed = true;\n\t\tmfp.items[index] = item;\n\t\t_mfpTrigger('ElementParse', item);\n\n\t\treturn mfp.items[index];\n\t},\n\n\n\t/**\n\t * Initializes single popup or a group of popups\n\t */\n\taddGroup: function(el, options) {\n\t\tvar eHandler = function(e) {\n\t\t\te.mfpEl = this;\n\t\t\tmfp._openClick(e, el, options);\n\t\t};\n\n\t\tif(!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\tvar eName = 'click.magnificPopup';\n\t\toptions.mainEl = el;\n\n\t\tif(options.items) {\n\t\t\toptions.isObj = true;\n\t\t\tel.off(eName).on(eName, eHandler);\n\t\t} else {\n\t\t\toptions.isObj = false;\n\t\t\tif(options.delegate) {\n\t\t\t\tel.off(eName).on(eName, options.delegate , eHandler);\n\t\t\t} else {\n\t\t\t\toptions.items = el;\n\t\t\t\tel.off(eName).on(eName, eHandler);\n\t\t\t}\n\t\t}\n\t},\n\t_openClick: function(e, el, options) {\n\t\tvar midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;\n\n\n\t\tif(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;\n\n\t\tif(disableOn) {\n\t\t\tif($.isFunction(disableOn)) {\n\t\t\t\tif( !disableOn.call(mfp) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else { // else it's number\n\t\t\t\tif( _window.width() < disableOn ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(e.type) {\n\t\t\te.preventDefault();\n\n\t\t\t// This will prevent popup from closing if element is inside and popup is already opened\n\t\t\tif(mfp.isOpen) {\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t}\n\n\t\toptions.el = $(e.mfpEl);\n\t\tif(options.delegate) {\n\t\t\toptions.items = el.find(options.delegate);\n\t\t}\n\t\tmfp.open(options);\n\t},\n\n\n\t/**\n\t * Updates text on preloader\n\t */\n\tupdateStatus: function(status, text) {\n\n\t\tif(mfp.preloader) {\n\t\t\tif(_prevStatus !== status) {\n\t\t\t\tmfp.container.removeClass('mfp-s-'+_prevStatus);\n\t\t\t}\n\n\t\t\tif(!text && status === 'loading') {\n\t\t\t\ttext = mfp.st.tLoading;\n\t\t\t}\n\n\t\t\tvar data = {\n\t\t\t\tstatus: status,\n\t\t\t\ttext: text\n\t\t\t};\n\t\t\t// allows to modify status\n\t\t\t_mfpTrigger('UpdateStatus', data);\n\n\t\t\tstatus = data.status;\n\t\t\ttext = data.text;\n\n\t\t\tmfp.preloader.html(text);\n\n\t\t\tmfp.preloader.find('a').on('click', function(e) {\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t});\n\n\t\t\tmfp.container.addClass('mfp-s-'+status);\n\t\t\t_prevStatus = status;\n\t\t}\n\t},\n\n\n\t/*\n\t\t\"Private\" helpers that aren't private at all\n\t */\n\t// Check to close popup or not\n\t// \"target\" is an element that was clicked\n\t_checkIfClose: function(target) {\n\n\t\tif($(target).hasClass(PREVENT_CLOSE_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar closeOnContent = mfp.st.closeOnContentClick;\n\t\tvar closeOnBg = mfp.st.closeOnBgClick;\n\n\t\tif(closeOnContent && closeOnBg) {\n\t\t\treturn true;\n\t\t} else {\n\n\t\t\t// We close the popup if click is on close button or on preloader. Or if there is no content.\n\t\t\tif(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if click is outside the content\n\t\t\tif( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {\n\t\t\t\tif(closeOnBg) {\n\t\t\t\t\t// last check, if the clicked element is in DOM, (in case it's removed onclick)\n\t\t\t\t\tif( $.contains(document, target) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(closeOnContent) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t},\n\t_addClassToMFP: function(cName) {\n\t\tmfp.bgOverlay.addClass(cName);\n\t\tmfp.wrap.addClass(cName);\n\t},\n\t_removeClassFromMFP: function(cName) {\n\t\tthis.bgOverlay.removeClass(cName);\n\t\tmfp.wrap.removeClass(cName);\n\t},\n\t_hasScrollBar: function(winHeight) {\n\t\treturn ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );\n\t},\n\t_setFocus: function() {\n\t\t(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();\n\t},\n\t_onFocusIn: function(e) {\n\t\tif( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {\n\t\t\tmfp._setFocus();\n\t\t\treturn false;\n\t\t}\n\t},\n\t_parseMarkup: function(template, values, item) {\n\t\tvar arr;\n\t\tif(item.data) {\n\t\t\tvalues = $.extend(item.data, values);\n\t\t}\n\t\t_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );\n\n\t\t$.each(values, function(key, value) {\n\t\t\tif(value === undefined || value === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tarr = key.split('_');\n\t\t\tif(arr.length > 1) {\n\t\t\t\tvar el = template.find(EVENT_NS + '-'+arr[0]);\n\n\t\t\t\tif(el.length > 0) {\n\t\t\t\t\tvar attr = arr[1];\n\t\t\t\t\tif(attr === 'replaceWith') {\n\t\t\t\t\t\tif(el[0] !== value[0]) {\n\t\t\t\t\t\t\tel.replaceWith(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(attr === 'img') {\n\t\t\t\t\t\tif(el.is('img')) {\n\t\t\t\t\t\t\tel.attr('src', value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tel.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.attr(arr[1], value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\ttemplate.find(EVENT_NS + '-'+key).html(value);\n\t\t\t}\n\t\t});\n\t},\n\n\t_getScrollbarSize: function() {\n\t\t// thx David\n\t\tif(mfp.scrollbarSize === undefined) {\n\t\t\tvar scrollDiv = document.createElement(\"div\");\n\t\t\tscrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';\n\t\t\tdocument.body.appendChild(scrollDiv);\n\t\t\tmfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n\t\t\tdocument.body.removeChild(scrollDiv);\n\t\t}\n\t\treturn mfp.scrollbarSize;\n\t}\n\n}; /* MagnificPopup core prototype end */\n\n\n\n\n/**\n * Public static functions\n */\n$.magnificPopup = {\n\tinstance: null,\n\tproto: MagnificPopup.prototype,\n\tmodules: [],\n\n\topen: function(options, index) {\n\t\t_checkInstance();\n\n\t\tif(!options) {\n\t\t\toptions = {};\n\t\t} else {\n\t\t\toptions = $.extend(true, {}, options);\n\t\t}\n\n\t\toptions.isObj = true;\n\t\toptions.index = index || 0;\n\t\treturn this.instance.open(options);\n\t},\n\n\tclose: function() {\n\t\treturn $.magnificPopup.instance && $.magnificPopup.instance.close();\n\t},\n\n\tregisterModule: function(name, module) {\n\t\tif(module.options) {\n\t\t\t$.magnificPopup.defaults[name] = module.options;\n\t\t}\n\t\t$.extend(this.proto, module.proto);\n\t\tthis.modules.push(name);\n\t},\n\n\tdefaults: {\n\n\t\t// Info about options is in docs:\n\t\t// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options\n\n\t\tdisableOn: 0,\n\n\t\tkey: null,\n\n\t\tmidClick: false,\n\n\t\tmainClass: '',\n\n\t\tpreloader: true,\n\n\t\tfocus: '', // CSS selector of input to focus after popup is opened\n\n\t\tcloseOnContentClick: false,\n\n\t\tcloseOnBgClick: true,\n\n\t\tcloseBtnInside: true,\n\n\t\tshowCloseBtn: true,\n\n\t\tenableEscapeKey: true,\n\n\t\tmodal: false,\n\n\t\talignTop: false,\n\n\t\tremovalDelay: 0,\n\n\t\tprependTo: null,\n\n\t\tfixedContentPos: 'auto',\n\n\t\tfixedBgPos: 'auto',\n\n\t\toverflowY: 'auto',\n\n\t\tcloseMarkup: '<button title=\"%title%\" type=\"button\" class=\"mfp-close\">×</button>',\n\n\t\ttClose: 'Close (Esc)',\n\n\t\ttLoading: 'Loading...',\n\n\t\tautoFocusLast: true\n\n\t}\n};\n\n\n\n$.fn.magnificPopup = function(options) {\n\t_checkInstance();\n\n\tvar jqEl = $(this);\n\n\t// We call some API method of first param is a string\n\tif (typeof options === \"string\" ) {\n\n\t\tif(options === 'open') {\n\t\t\tvar items,\n\t\t\t\titemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,\n\t\t\t\tindex = parseInt(arguments[1], 10) || 0;\n\n\t\t\tif(itemOpts.items) {\n\t\t\t\titems = itemOpts.items[index];\n\t\t\t} else {\n\t\t\t\titems = jqEl;\n\t\t\t\tif(itemOpts.delegate) {\n\t\t\t\t\titems = items.find(itemOpts.delegate);\n\t\t\t\t}\n\t\t\t\titems = items.eq( index );\n\t\t\t}\n\t\t\tmfp._openClick({mfpEl:items}, jqEl, itemOpts);\n\t\t} else {\n\t\t\tif(mfp.isOpen)\n\t\t\t\tmfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));\n\t\t}\n\n\t} else {\n\t\t// clone options obj\n\t\toptions = $.extend(true, {}, options);\n\n\t\t/*\n\t\t * As Zepto doesn't support .data() method for objects\n\t\t * and it works only in normal browsers\n\t\t * we assign \"options\" object directly to the DOM element. FTW!\n\t\t */\n\t\tif(_isJQ) {\n\t\t\tjqEl.data('magnificPopup', options);\n\t\t} else {\n\t\t\tjqEl[0].magnificPopup = options;\n\t\t}\n\n\t\tmfp.addGroup(jqEl, options);\n\n\t}\n\treturn jqEl;\n};\n\n/*>>core*/\n\n/*>>inline*/\n\nvar INLINE_NS = 'inline',\n\t_hiddenClass,\n\t_inlinePlaceholder,\n\t_lastInlineElement,\n\t_putInlineElementsBack = function() {\n\t\tif(_lastInlineElement) {\n\t\t\t_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();\n\t\t\t_lastInlineElement = null;\n\t\t}\n\t};\n\n$.magnificPopup.registerModule(INLINE_NS, {\n\toptions: {\n\t\thiddenClass: 'hide', // will be appended with `mfp-` prefix\n\t\tmarkup: '',\n\t\ttNotFound: 'Content not found'\n\t},\n\tproto: {\n\n\t\tinitInline: function() {\n\t\t\tmfp.types.push(INLINE_NS);\n\n\t\t\t_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {\n\t\t\t\t_putInlineElementsBack();\n\t\t\t});\n\t\t},\n\n\t\tgetInline: function(item, template) {\n\n\t\t\t_putInlineElementsBack();\n\n\t\t\tif(item.src) {\n\t\t\t\tvar inlineSt = mfp.st.inline,\n\t\t\t\t\tel = $(item.src);\n\n\t\t\t\tif(el.length) {\n\n\t\t\t\t\t// If target element has parent - we replace it with placeholder and put it back after popup is closed\n\t\t\t\t\tvar parent = el[0].parentNode;\n\t\t\t\t\tif(parent && parent.tagName) {\n\t\t\t\t\t\tif(!_inlinePlaceholder) {\n\t\t\t\t\t\t\t_hiddenClass = inlineSt.hiddenClass;\n\t\t\t\t\t\t\t_inlinePlaceholder = _getEl(_hiddenClass);\n\t\t\t\t\t\t\t_hiddenClass = 'mfp-'+_hiddenClass;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// replace target inline element with placeholder\n\t\t\t\t\t\t_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);\n\t\t\t\t\t}\n\n\t\t\t\t\tmfp.updateStatus('ready');\n\t\t\t\t} else {\n\t\t\t\t\tmfp.updateStatus('error', inlineSt.tNotFound);\n\t\t\t\t\tel = $('<div>');\n\t\t\t\t}\n\n\t\t\t\titem.inlineElement = el;\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tmfp.updateStatus('ready');\n\t\t\tmfp._parseMarkup(template, {}, item);\n\t\t\treturn template;\n\t\t}\n\t}\n});\n\n/*>>inline*/\n\n/*>>ajax*/\nvar AJAX_NS = 'ajax',\n\t_ajaxCur,\n\t_removeAjaxCursor = function() {\n\t\tif(_ajaxCur) {\n\t\t\t$(document.body).removeClass(_ajaxCur);\n\t\t}\n\t},\n\t_destroyAjaxRequest = function() {\n\t\t_removeAjaxCursor();\n\t\tif(mfp.req) {\n\t\t\tmfp.req.abort();\n\t\t}\n\t};\n\n$.magnificPopup.registerModule(AJAX_NS, {\n\n\toptions: {\n\t\tsettings: null,\n\t\tcursor: 'mfp-ajax-cur',\n\t\ttError: '<a href=\"%url%\">The content</a> could not be loaded.'\n\t},\n\n\tproto: {\n\t\tinitAjax: function() {\n\t\t\tmfp.types.push(AJAX_NS);\n\t\t\t_ajaxCur = mfp.st.ajax.cursor;\n\n\t\t\t_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);\n\t\t\t_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);\n\t\t},\n\t\tgetAjax: function(item) {\n\n\t\t\tif(_ajaxCur) {\n\t\t\t\t$(document.body).addClass(_ajaxCur);\n\t\t\t}\n\n\t\t\tmfp.updateStatus('loading');\n\n\t\t\tvar opts = $.extend({\n\t\t\t\turl: item.src,\n\t\t\t\tsuccess: function(data, textStatus, jqXHR) {\n\t\t\t\t\tvar temp = {\n\t\t\t\t\t\tdata:data,\n\t\t\t\t\t\txhr:jqXHR\n\t\t\t\t\t};\n\n\t\t\t\t\t_mfpTrigger('ParseAjax', temp);\n\n\t\t\t\t\tmfp.appendContent( $(temp.data), AJAX_NS );\n\n\t\t\t\t\titem.finished = true;\n\n\t\t\t\t\t_removeAjaxCursor();\n\n\t\t\t\t\tmfp._setFocus();\n\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tmfp.wrap.addClass(READY_CLASS);\n\t\t\t\t\t}, 16);\n\n\t\t\t\t\tmfp.updateStatus('ready');\n\n\t\t\t\t\t_mfpTrigger('AjaxContentAdded');\n\t\t\t\t},\n\t\t\t\terror: function() {\n\t\t\t\t\t_removeAjaxCursor();\n\t\t\t\t\titem.finished = item.loadError = true;\n\t\t\t\t\tmfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));\n\t\t\t\t}\n\t\t\t}, mfp.st.ajax.settings);\n\n\t\t\tmfp.req = $.ajax(opts);\n\n\t\t\treturn '';\n\t\t}\n\t}\n});\n\n/*>>ajax*/\n\n/*>>image*/\nvar _imgInterval,\n\t_getTitle = function(item) {\n\t\tif(item.data && item.data.title !== undefined)\n\t\t\treturn item.data.title;\n\n\t\tvar src = mfp.st.image.titleSrc;\n\n\t\tif(src) {\n\t\t\tif($.isFunction(src)) {\n\t\t\t\treturn src.call(mfp, item);\n\t\t\t} else if(item.el) {\n\t\t\t\treturn item.el.attr(src) || '';\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n$.magnificPopup.registerModule('image', {\n\n\toptions: {\n\t\tmarkup: '<div class=\"mfp-figure\">'+\n\t\t\t\t\t'<div class=\"mfp-close\"></div>'+\n\t\t\t\t\t'<figure>'+\n\t\t\t\t\t\t'<div class=\"mfp-img\"></div>'+\n\t\t\t\t\t\t'<figcaption>'+\n\t\t\t\t\t\t\t'<div class=\"mfp-bottom-bar\">'+\n\t\t\t\t\t\t\t\t'<div class=\"mfp-title\"></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"mfp-counter\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'</figcaption>'+\n\t\t\t\t\t'</figure>'+\n\t\t\t\t'</div>',\n\t\tcursor: 'mfp-zoom-out-cur',\n\t\ttitleSrc: 'title',\n\t\tverticalFit: true,\n\t\ttError: '<a href=\"%url%\">The image</a> could not be loaded.'\n\t},\n\n\tproto: {\n\t\tinitImage: function() {\n\t\t\tvar imgSt = mfp.st.image,\n\t\t\t\tns = '.image';\n\n\t\t\tmfp.types.push('image');\n\n\t\t\t_mfpOn(OPEN_EVENT+ns, function() {\n\t\t\t\tif(mfp.currItem.type === 'image' && imgSt.cursor) {\n\t\t\t\t\t$(document.body).addClass(imgSt.cursor);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\n\t\t\t\tif(imgSt.cursor) {\n\t\t\t\t\t$(document.body).removeClass(imgSt.cursor);\n\t\t\t\t}\n\t\t\t\t_window.off('resize' + EVENT_NS);\n\t\t\t});\n\n\t\t\t_mfpOn('Resize'+ns, mfp.resizeImage);\n\t\t\tif(mfp.isLowIE) {\n\t\t\t\t_mfpOn('AfterChange', mfp.resizeImage);\n\t\t\t}\n\t\t},\n\t\tresizeImage: function() {\n\t\t\tvar item = mfp.currItem;\n\t\t\tif(!item || !item.img) return;\n\n\t\t\tif(mfp.st.image.verticalFit) {\n\t\t\t\tvar decr = 0;\n\t\t\t\t// fix box-sizing in ie7/8\n\t\t\t\tif(mfp.isLowIE) {\n\t\t\t\t\tdecr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);\n\t\t\t\t}\n\t\t\t\titem.img.css('max-height', mfp.wH-decr);\n\t\t\t}\n\t\t},\n\t\t_onImageHasSize: function(item) {\n\t\t\tif(item.img) {\n\n\t\t\t\titem.hasSize = true;\n\n\t\t\t\tif(_imgInterval) {\n\t\t\t\t\tclearInterval(_imgInterval);\n\t\t\t\t}\n\n\t\t\t\titem.isCheckingImgSize = false;\n\n\t\t\t\t_mfpTrigger('ImageHasSize', item);\n\n\t\t\t\tif(item.imgHidden) {\n\t\t\t\t\tif(mfp.content)\n\t\t\t\t\t\tmfp.content.removeClass('mfp-loading');\n\n\t\t\t\t\titem.imgHidden = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Function that loops until the image has size to display elements that rely on it asap\n\t\t */\n\t\tfindImageSize: function(item) {\n\n\t\t\tvar counter = 0,\n\t\t\t\timg = item.img[0],\n\t\t\t\tmfpSetInterval = function(delay) {\n\n\t\t\t\t\tif(_imgInterval) {\n\t\t\t\t\t\tclearInterval(_imgInterval);\n\t\t\t\t\t}\n\t\t\t\t\t// decelerating interval that checks for size of an image\n\t\t\t\t\t_imgInterval = setInterval(function() {\n\t\t\t\t\t\tif(img.naturalWidth > 0) {\n\t\t\t\t\t\t\tmfp._onImageHasSize(item);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(counter > 200) {\n\t\t\t\t\t\t\tclearInterval(_imgInterval);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\tif(counter === 3) {\n\t\t\t\t\t\t\tmfpSetInterval(10);\n\t\t\t\t\t\t} else if(counter === 40) {\n\t\t\t\t\t\t\tmfpSetInterval(50);\n\t\t\t\t\t\t} else if(counter === 100) {\n\t\t\t\t\t\t\tmfpSetInterval(500);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, delay);\n\t\t\t\t};\n\n\t\t\tmfpSetInterval(1);\n\t\t},\n\n\t\tgetImage: function(item, template) {\n\n\t\t\tvar guard = 0,\n\n\t\t\t\t// image load complete handler\n\t\t\t\tonLoadComplete = function() {\n\t\t\t\t\tif(item) {\n\t\t\t\t\t\tif (item.img[0].complete) {\n\t\t\t\t\t\t\titem.img.off('.mfploader');\n\n\t\t\t\t\t\t\tif(item === mfp.currItem){\n\t\t\t\t\t\t\t\tmfp._onImageHasSize(item);\n\n\t\t\t\t\t\t\t\tmfp.updateStatus('ready');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem.hasSize = true;\n\t\t\t\t\t\t\titem.loaded = true;\n\n\t\t\t\t\t\t\t_mfpTrigger('ImageLoadComplete');\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// if image complete check fails 200 times (20 sec), we assume that there was an error.\n\t\t\t\t\t\t\tguard++;\n\t\t\t\t\t\t\tif(guard < 200) {\n\t\t\t\t\t\t\t\tsetTimeout(onLoadComplete,100);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonLoadError();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// image error handler\n\t\t\t\tonLoadError = function() {\n\t\t\t\t\tif(item) {\n\t\t\t\t\t\titem.img.off('.mfploader');\n\t\t\t\t\t\tif(item === mfp.currItem){\n\t\t\t\t\t\t\tmfp._onImageHasSize(item);\n\t\t\t\t\t\t\tmfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\titem.hasSize = true;\n\t\t\t\t\t\titem.loaded = true;\n\t\t\t\t\t\titem.loadError = true;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\timgSt = mfp.st.image;\n\n\n\t\t\tvar el = template.find('.mfp-img');\n\t\t\tif(el.length) {\n\t\t\t\tvar img = document.createElement('img');\n\t\t\t\timg.className = 'mfp-img';\n\t\t\t\tif(item.el && item.el.find('img').length) {\n\t\t\t\t\timg.alt = item.el.find('img').attr('alt');\n\t\t\t\t}\n\t\t\t\titem.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);\n\t\t\t\timg.src = item.src;\n\n\t\t\t\t// without clone() \"error\" event is not firing when IMG is replaced by new IMG\n\t\t\t\t// TODO: find a way to avoid such cloning\n\t\t\t\tif(el.is('img')) {\n\t\t\t\t\titem.img = item.img.clone();\n\t\t\t\t}\n\n\t\t\t\timg = item.img[0];\n\t\t\t\tif(img.naturalWidth > 0) {\n\t\t\t\t\titem.hasSize = true;\n\t\t\t\t} else if(!img.width) {\n\t\t\t\t\titem.hasSize = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmfp._parseMarkup(template, {\n\t\t\t\ttitle: _getTitle(item),\n\t\t\t\timg_replaceWith: item.img\n\t\t\t}, item);\n\n\t\t\tmfp.resizeImage();\n\n\t\t\tif(item.hasSize) {\n\t\t\t\tif(_imgInterval) clearInterval(_imgInterval);\n\n\t\t\t\tif(item.loadError) {\n\t\t\t\t\ttemplate.addClass('mfp-loading');\n\t\t\t\t\tmfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );\n\t\t\t\t} else {\n\t\t\t\t\ttemplate.removeClass('mfp-loading');\n\t\t\t\t\tmfp.updateStatus('ready');\n\t\t\t\t}\n\t\t\t\treturn template;\n\t\t\t}\n\n\t\t\tmfp.updateStatus('loading');\n\t\t\titem.loading = true;\n\n\t\t\tif(!item.hasSize) {\n\t\t\t\titem.imgHidden = true;\n\t\t\t\ttemplate.addClass('mfp-loading');\n\t\t\t\tmfp.findImageSize(item);\n\t\t\t}\n\n\t\t\treturn template;\n\t\t}\n\t}\n});\n\n/*>>image*/\n\n/*>>zoom*/\nvar hasMozTransform,\n\tgetHasMozTransform = function() {\n\t\tif(hasMozTransform === undefined) {\n\t\t\thasMozTransform = document.createElement('p').style.MozTransform !== undefined;\n\t\t}\n\t\treturn hasMozTransform;\n\t};\n\n$.magnificPopup.registerModule('zoom', {\n\n\toptions: {\n\t\tenabled: false,\n\t\teasing: 'ease-in-out',\n\t\tduration: 300,\n\t\topener: function(element) {\n\t\t\treturn element.is('img') ? element : element.find('img');\n\t\t}\n\t},\n\n\tproto: {\n\n\t\tinitZoom: function() {\n\t\t\tvar zoomSt = mfp.st.zoom,\n\t\t\t\tns = '.zoom',\n\t\t\t\timage;\n\n\t\t\tif(!zoomSt.enabled || !mfp.supportsTransition) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar duration = zoomSt.duration,\n\t\t\t\tgetElToAnimate = function(image) {\n\t\t\t\t\tvar newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),\n\t\t\t\t\t\ttransition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,\n\t\t\t\t\t\tcssObj = {\n\t\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t'-webkit-backface-visibility': 'hidden'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tt = 'transition';\n\n\t\t\t\t\tcssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;\n\n\t\t\t\t\tnewImg.css(cssObj);\n\t\t\t\t\treturn newImg;\n\t\t\t\t},\n\t\t\t\tshowMainContent = function() {\n\t\t\t\t\tmfp.content.css('visibility', 'visible');\n\t\t\t\t},\n\t\t\t\topenTimeout,\n\t\t\t\tanimatedImg;\n\n\t\t\t_mfpOn('BuildControls'+ns, function() {\n\t\t\t\tif(mfp._allowZoom()) {\n\n\t\t\t\t\tclearTimeout(openTimeout);\n\t\t\t\t\tmfp.content.css('visibility', 'hidden');\n\n\t\t\t\t\t// Basically, all code below does is clones existing image, puts in on top of the current one and animated it\n\n\t\t\t\t\timage = mfp._getItemToZoom();\n\n\t\t\t\t\tif(!image) {\n\t\t\t\t\t\tshowMainContent();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tanimatedImg = getElToAnimate(image);\n\n\t\t\t\t\tanimatedImg.css( mfp._getOffset() );\n\n\t\t\t\t\tmfp.wrap.append(animatedImg);\n\n\t\t\t\t\topenTimeout = setTimeout(function() {\n\t\t\t\t\t\tanimatedImg.css( mfp._getOffset( true ) );\n\t\t\t\t\t\topenTimeout = setTimeout(function() {\n\n\t\t\t\t\t\t\tshowMainContent();\n\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tanimatedImg.remove();\n\t\t\t\t\t\t\t\timage = animatedImg = null;\n\t\t\t\t\t\t\t\t_mfpTrigger('ZoomAnimationEnded');\n\t\t\t\t\t\t\t}, 16); // avoid blink when switching images\n\n\t\t\t\t\t\t}, duration); // this timeout equals animation duration\n\n\t\t\t\t\t}, 16); // by adding this timeout we avoid short glitch at the beginning of animation\n\n\n\t\t\t\t\t// Lots of timeouts...\n\t\t\t\t}\n\t\t\t});\n\t\t\t_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {\n\t\t\t\tif(mfp._allowZoom()) {\n\n\t\t\t\t\tclearTimeout(openTimeout);\n\n\t\t\t\t\tmfp.st.removalDelay = duration;\n\n\t\t\t\t\tif(!image) {\n\t\t\t\t\t\timage = mfp._getItemToZoom();\n\t\t\t\t\t\tif(!image) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimatedImg = getElToAnimate(image);\n\t\t\t\t\t}\n\n\t\t\t\t\tanimatedImg.css( mfp._getOffset(true) );\n\t\t\t\t\tmfp.wrap.append(animatedImg);\n\t\t\t\t\tmfp.content.css('visibility', 'hidden');\n\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tanimatedImg.css( mfp._getOffset() );\n\t\t\t\t\t}, 16);\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\n\t\t\t\tif(mfp._allowZoom()) {\n\t\t\t\t\tshowMainContent();\n\t\t\t\t\tif(animatedImg) {\n\t\t\t\t\t\tanimatedImg.remove();\n\t\t\t\t\t}\n\t\t\t\t\timage = null;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_allowZoom: function() {\n\t\t\treturn mfp.currItem.type === 'image';\n\t\t},\n\n\t\t_getItemToZoom: function() {\n\t\t\tif(mfp.currItem.hasSize) {\n\t\t\t\treturn mfp.currItem.img;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\n\t\t// Get element postion relative to viewport\n\t\t_getOffset: function(isLarge) {\n\t\t\tvar el;\n\t\t\tif(isLarge) {\n\t\t\t\tel = mfp.currItem.img;\n\t\t\t} else {\n\t\t\t\tel = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);\n\t\t\t}\n\n\t\t\tvar offset = el.offset();\n\t\t\tvar paddingTop = parseInt(el.css('padding-top'),10);\n\t\t\tvar paddingBottom = parseInt(el.css('padding-bottom'),10);\n\t\t\toffset.top -= ( $(window).scrollTop() - paddingTop );\n\n\n\t\t\t/*\n\n\t\t\tAnimating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.\n\n\t\t\t */\n\t\t\tvar obj = {\n\t\t\t\twidth: el.width(),\n\t\t\t\t// fix Zepto height+padding issue\n\t\t\t\theight: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop\n\t\t\t};\n\n\t\t\t// I hate to do this, but there is no another option\n\t\t\tif( getHasMozTransform() ) {\n\t\t\t\tobj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';\n\t\t\t} else {\n\t\t\t\tobj.left = offset.left;\n\t\t\t\tobj.top = offset.top;\n\t\t\t}\n\t\t\treturn obj;\n\t\t}\n\n\t}\n});\n\n\n\n/*>>zoom*/\n\n/*>>iframe*/\n\nvar IFRAME_NS = 'iframe',\n\t_emptyPage = '//about:blank',\n\n\t_fixIframeBugs = function(isShowing) {\n\t\tif(mfp.currTemplate[IFRAME_NS]) {\n\t\t\tvar el = mfp.currTemplate[IFRAME_NS].find('iframe');\n\t\t\tif(el.length) {\n\t\t\t\t// reset src after the popup is closed to avoid \"video keeps playing after popup is closed\" bug\n\t\t\t\tif(!isShowing) {\n\t\t\t\t\tel[0].src = _emptyPage;\n\t\t\t\t}\n\n\t\t\t\t// IE8 black screen bug fix\n\t\t\t\tif(mfp.isIE8) {\n\t\t\t\t\tel.css('display', isShowing ? 'block' : 'none');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n$.magnificPopup.registerModule(IFRAME_NS, {\n\n\toptions: {\n\t\tmarkup: '<div class=\"mfp-iframe-scaler\">'+\n\t\t\t\t\t'<div class=\"mfp-close\"></div>'+\n\t\t\t\t\t'<iframe class=\"mfp-iframe\" src=\"//about:blank\" frameborder=\"0\" allowfullscreen></iframe>'+\n\t\t\t\t'</div>',\n\n\t\tsrcAction: 'iframe_src',\n\n\t\t// we don't care and support only one default type of URL by default\n\t\tpatterns: {\n\t\t\tyoutube: {\n\t\t\t\tindex: 'youtube.com',\n\t\t\t\tid: 'v=',\n\t\t\t\tsrc: '//www.youtube.com/embed/%id%?autoplay=1'\n\t\t\t},\n\t\t\tvimeo: {\n\t\t\t\tindex: 'vimeo.com/',\n\t\t\t\tid: '/',\n\t\t\t\tsrc: '//player.vimeo.com/video/%id%?autoplay=1'\n\t\t\t},\n\t\t\tgmaps: {\n\t\t\t\tindex: '//maps.google.',\n\t\t\t\tsrc: '%id%&output=embed'\n\t\t\t}\n\t\t}\n\t},\n\n\tproto: {\n\t\tinitIframe: function() {\n\t\t\tmfp.types.push(IFRAME_NS);\n\n\t\t\t_mfpOn('BeforeChange', function(e, prevType, newType) {\n\t\t\t\tif(prevType !== newType) {\n\t\t\t\t\tif(prevType === IFRAME_NS) {\n\t\t\t\t\t\t_fixIframeBugs(); // iframe if removed\n\t\t\t\t\t} else if(newType === IFRAME_NS) {\n\t\t\t\t\t\t_fixIframeBugs(true); // iframe is showing\n\t\t\t\t\t}\n\t\t\t\t}// else {\n\t\t\t\t\t// iframe source is switched, don't do anything\n\t\t\t\t//}\n\t\t\t});\n\n\t\t\t_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {\n\t\t\t\t_fixIframeBugs();\n\t\t\t});\n\t\t},\n\n\t\tgetIframe: function(item, template) {\n\t\t\tvar embedSrc = item.src;\n\t\t\tvar iframeSt = mfp.st.iframe;\n\n\t\t\t$.each(iframeSt.patterns, function() {\n\t\t\t\tif(embedSrc.indexOf( this.index ) > -1) {\n\t\t\t\t\tif(this.id) {\n\t\t\t\t\t\tif(typeof this.id === 'string') {\n\t\t\t\t\t\t\tembedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tembedSrc = this.id.call( this, embedSrc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tembedSrc = this.src.replace('%id%', embedSrc );\n\t\t\t\t\treturn false; // break;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar dataObj = {};\n\t\t\tif(iframeSt.srcAction) {\n\t\t\t\tdataObj[iframeSt.srcAction] = embedSrc;\n\t\t\t}\n\t\t\tmfp._parseMarkup(template, dataObj, item);\n\n\t\t\tmfp.updateStatus('ready');\n\n\t\t\treturn template;\n\t\t}\n\t}\n});\n\n\n\n/*>>iframe*/\n\n/*>>gallery*/\n/**\n * Get looped index depending on number of slides\n */\nvar _getLoopedId = function(index) {\n\t\tvar numSlides = mfp.items.length;\n\t\tif(index > numSlides - 1) {\n\t\t\treturn index - numSlides;\n\t\t} else if(index < 0) {\n\t\t\treturn numSlides + index;\n\t\t}\n\t\treturn index;\n\t},\n\t_replaceCurrTotal = function(text, curr, total) {\n\t\treturn text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);\n\t};\n\n$.magnificPopup.registerModule('gallery', {\n\n\toptions: {\n\t\tenabled: false,\n\t\tarrowMarkup: '<button title=\"%title%\" type=\"button\" class=\"mfp-arrow mfp-arrow-%dir%\"></button>',\n\t\tpreload: [0,2],\n\t\tnavigateByImgClick: true,\n\t\tarrows: true,\n\n\t\ttPrev: 'Previous (Left arrow key)',\n\t\ttNext: 'Next (Right arrow key)',\n\t\ttCounter: '%curr% of %total%'\n\t},\n\n\tproto: {\n\t\tinitGallery: function() {\n\n\t\t\tvar gSt = mfp.st.gallery,\n\t\t\t\tns = '.mfp-gallery';\n\n\t\t\tmfp.direction = true; // true - next, false - prev\n\n\t\t\tif(!gSt || !gSt.enabled ) return false;\n\n\t\t\t_wrapClasses += ' mfp-gallery';\n\n\t\t\t_mfpOn(OPEN_EVENT+ns, function() {\n\n\t\t\t\tif(gSt.navigateByImgClick) {\n\t\t\t\t\tmfp.wrap.on('click'+ns, '.mfp-img', function() {\n\t\t\t\t\t\tif(mfp.items.length > 1) {\n\t\t\t\t\t\t\tmfp.next();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t_document.on('keydown'+ns, function(e) {\n\t\t\t\t\tif (e.keyCode === 37) {\n\t\t\t\t\t\tmfp.prev();\n\t\t\t\t\t} else if (e.keyCode === 39) {\n\t\t\t\t\t\tmfp.next();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t_mfpOn('UpdateStatus'+ns, function(e, data) {\n\t\t\t\tif(data.text) {\n\t\t\t\t\tdata.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {\n\t\t\t\tvar l = mfp.items.length;\n\t\t\t\tvalues.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';\n\t\t\t});\n\n\t\t\t_mfpOn('BuildControls' + ns, function() {\n\t\t\t\tif(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {\n\t\t\t\t\tvar markup = gSt.arrowMarkup,\n\t\t\t\t\t\tarrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),\n\t\t\t\t\t\tarrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);\n\n\t\t\t\t\tarrowLeft.click(function() {\n\t\t\t\t\t\tmfp.prev();\n\t\t\t\t\t});\n\t\t\t\t\tarrowRight.click(function() {\n\t\t\t\t\t\tmfp.next();\n\t\t\t\t\t});\n\n\t\t\t\t\tmfp.container.append(arrowLeft.add(arrowRight));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_mfpOn(CHANGE_EVENT+ns, function() {\n\t\t\t\tif(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);\n\n\t\t\t\tmfp._preloadTimeout = setTimeout(function() {\n\t\t\t\t\tmfp.preloadNearbyImages();\n\t\t\t\t\tmfp._preloadTimeout = null;\n\t\t\t\t}, 16);\n\t\t\t});\n\n\n\t\t\t_mfpOn(CLOSE_EVENT+ns, function() {\n\t\t\t\t_document.off(ns);\n\t\t\t\tmfp.wrap.off('click'+ns);\n\t\t\t\tmfp.arrowRight = mfp.arrowLeft = null;\n\t\t\t});\n\n\t\t},\n\t\tnext: function() {\n\t\t\tmfp.direction = true;\n\t\t\tmfp.index = _getLoopedId(mfp.index + 1);\n\t\t\tmfp.updateItemHTML();\n\t\t},\n\t\tprev: function() {\n\t\t\tmfp.direction = false;\n\t\t\tmfp.index = _getLoopedId(mfp.index - 1);\n\t\t\tmfp.updateItemHTML();\n\t\t},\n\t\tgoTo: function(newIndex) {\n\t\t\tmfp.direction = (newIndex >= mfp.index);\n\t\t\tmfp.index = newIndex;\n\t\t\tmfp.updateItemHTML();\n\t\t},\n\t\tpreloadNearbyImages: function() {\n\t\t\tvar p = mfp.st.gallery.preload,\n\t\t\t\tpreloadBefore = Math.min(p[0], mfp.items.length),\n\t\t\t\tpreloadAfter = Math.min(p[1], mfp.items.length),\n\t\t\t\ti;\n\n\t\t\tfor(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {\n\t\t\t\tmfp._preloadItem(mfp.index+i);\n\t\t\t}\n\t\t\tfor(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {\n\t\t\t\tmfp._preloadItem(mfp.index-i);\n\t\t\t}\n\t\t},\n\t\t_preloadItem: function(index) {\n\t\t\tindex = _getLoopedId(index);\n\n\t\t\tif(mfp.items[index].preloaded) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar item = mfp.items[index];\n\t\t\tif(!item.parsed) {\n\t\t\t\titem = mfp.parseEl( index );\n\t\t\t}\n\n\t\t\t_mfpTrigger('LazyLoad', item);\n\n\t\t\tif(item.type === 'image') {\n\t\t\t\titem.img = $('<img class=\"mfp-img\" />').on('load.mfploader', function() {\n\t\t\t\t\titem.hasSize = true;\n\t\t\t\t}).on('error.mfploader', function() {\n\t\t\t\t\titem.hasSize = true;\n\t\t\t\t\titem.loadError = true;\n\t\t\t\t\t_mfpTrigger('LazyLoadError', item);\n\t\t\t\t}).attr('src', item.src);\n\t\t\t}\n\n\n\t\t\titem.preloaded = true;\n\t\t}\n\t}\n});\n\n/*>>gallery*/\n\n/*>>retina*/\n\nvar RETINA_NS = 'retina';\n\n$.magnificPopup.registerModule(RETINA_NS, {\n\toptions: {\n\t\treplaceSrc: function(item) {\n\t\t\treturn item.src.replace(/\\.\\w+$/, function(m) { return '@2x' + m; });\n\t\t},\n\t\tratio: 1 // Function or number. Set to 1 to disable.\n\t},\n\tproto: {\n\t\tinitRetina: function() {\n\t\t\tif(window.devicePixelRatio > 1) {\n\n\t\t\t\tvar st = mfp.st.retina,\n\t\t\t\t\tratio = st.ratio;\n\n\t\t\t\tratio = !isNaN(ratio) ? ratio : ratio();\n\n\t\t\t\tif(ratio > 1) {\n\t\t\t\t\t_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {\n\t\t\t\t\t\titem.img.css({\n\t\t\t\t\t\t\t'max-width': item.img[0].naturalWidth / ratio,\n\t\t\t\t\t\t\t'width': '100%'\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\t_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {\n\t\t\t\t\t\titem.src = st.replaceSrc(item, ratio);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n});\n\n/*>>retina*/\n _checkInstance(); }));","function tlite(getTooltipOpts) {\n document.addEventListener('mouseover', function (e) {\n var el = e.target;\n var opts = getTooltipOpts(el);\n\n if (!opts) {\n el = el.parentElement;\n opts = el && getTooltipOpts(el);\n }\n\n opts && tlite.show(el, opts, true);\n });\n}\n\ntlite.show = function (el, opts, isAuto) {\n var fallbackAttrib = 'data-tlite';\n opts = opts || {};\n\n (el.tooltip || Tooltip(el, opts)).show();\n\n function Tooltip(el, opts) {\n var tooltipEl;\n var showTimer;\n var text;\n\n el.addEventListener('mousedown', autoHide);\n el.addEventListener('mouseleave', autoHide);\n\n function show() {\n text = el.title || el.getAttribute(fallbackAttrib) || text;\n el.title = '';\n el.setAttribute(fallbackAttrib, '');\n text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1))\n }\n\n function autoHide() {\n tlite.hide(el, true);\n }\n\n function hide(isAutoHiding) {\n if (isAuto === isAutoHiding) {\n showTimer = clearTimeout(showTimer);\n var parent = tooltipEl && tooltipEl.parentNode;\n parent && parent.removeChild(tooltipEl);\n tooltipEl = undefined;\n }\n }\n\n function fadeIn() {\n if (!tooltipEl) {\n tooltipEl = createTooltip(el, text, opts);\n }\n }\n\n return el.tooltip = {\n show: show,\n hide: hide\n };\n }\n\n function createTooltip(el, text, opts) {\n var tooltipEl = document.createElement('span');\n var grav = opts.grav || el.getAttribute('data-tlite') || 'n';\n\n tooltipEl.innerHTML = text;\n\n el.appendChild(tooltipEl);\n\n var vertGrav = grav[0] || '';\n var horzGrav = grav[1] || '';\n\n function positionTooltip() {\n tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav;\n\n var arrowSize = 10;\n var top = el.offsetTop;\n var left = el.offsetLeft;\n\n if (tooltipEl.offsetParent === el) {\n top = left = 0;\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var tooltipHeight = tooltipEl.offsetHeight;\n var tooltipWidth = tooltipEl.offsetWidth;\n var centerEl = left + (width / 2);\n\n tooltipEl.style.top = (\n vertGrav === 's' ? (top - tooltipHeight - arrowSize) :\n vertGrav === 'n' ? (top + height + arrowSize) :\n (top + (height / 2) - (tooltipHeight / 2))\n ) + 'px';\n\n tooltipEl.style.left = (\n horzGrav === 'w' ? left :\n horzGrav === 'e' ? left + width - tooltipWidth :\n vertGrav === 'w' ? (left + width + arrowSize) :\n vertGrav === 'e' ? (left - tooltipWidth - arrowSize) :\n (centerEl - tooltipWidth / 2)\n ) + 'px';\n }\n\n positionTooltip();\n\n var rect = tooltipEl.getBoundingClientRect();\n\n if (vertGrav === 's' && rect.top < 0) {\n vertGrav = 'n';\n positionTooltip();\n } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) {\n vertGrav = 's';\n positionTooltip();\n } else if (vertGrav === 'e' && rect.left < 0) {\n vertGrav = 'w';\n positionTooltip();\n } else if (vertGrav === 'w' && rect.right > window.innerWidth) {\n vertGrav = 'e';\n positionTooltip();\n }\n\n tooltipEl.className += ' tlite-visible';\n\n return tooltipEl;\n }\n};\n\ntlite.hide = function (el, isAuto) {\n el.tooltip && el.tooltip.hide(isAuto);\n};\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = tlite;\n}\n","module.exports = jQuery;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import tlite from 'tlite';\nimport '../../node_modules/magnific-popup/dist/jquery.magnific-popup.js';\n\n/**\n * Creating the Media Uploader\n *\n * @param $imageContainer\n * @param $imageInput\n */\nfunction giveasap_image_media( $imageContainer, $imageInput ) {\n\t'use strict';\n\n\tvar file_frame;\n\n\t/**\n\t * If an instance of file_frame already exists, then we can open it\n\t * rather than creating a new instance.\n\t */\n\n\tif ( undefined !== file_frame ) {\n\n\t\tfile_frame.open();\n\n\t\treturn;\n\n\t}\n\n\t/**\n\t * If we're this far, then an instance does not exist, so we need to\n\t * create our own.\n\t *\n\t * Here, use the wp.media library to define the settings of the Media\n\t * Uploader. We're opting to use the 'post' frame which is a template\n\t * defined in WordPress core and are initializing the file frame\n\t * with the 'insert' state.\n\t *\n\t * We're also not allowing the user to select more than one image.\n\t */\n\tfile_frame = wp.media(\n\t\t{\n\t\t\tmultiple: false,\n\t\t}\n\t);\n\n\tfile_frame.on(\n\t\t'open',\n\t\tfunction() {\n\t\t\tvar selection = file_frame.state().get( 'selection' );\n\t\t\tvar ids = $imageInput.val().split( ',' );\n\t\t\tids.forEach(\n\t\t\t\tfunction(id) {\n\t\t\t\t\tvar attachment = wp.media.attachment( id );\n\t\t\t\t\tattachment.fetch();\n\t\t\t\t\tselection.add( attachment ? [ attachment ] : [] );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\t// When an image is selected in the media frame...\n\tfile_frame.on(\n\t\t'select',\n\t\tfunction() {\n\n\t\t\t// Get media attachment details from the frame state\n\t\t\tvar attachments = file_frame.state().get( 'selection' ).toJSON();\n\n\t\t\tvar attachmentIDs = [];\n\t\t\t$imageContainer.empty();\n\t\t\tconsole.log( $imageContainer );\n\t\t\tvar $galleryID = $imageContainer.attr( \"id\" );\n\t\t\tfor ( var i = 0; i < attachments.length; i++ ) {\n\t\t\t\tif ( attachments[ i ].type == \"image\" ) {\n\t\t\t\t\tattachmentIDs.push( attachments[ i ].id );\n\t\t\t\t\t$imageContainer.append( sortable_gallery_image_create( attachments[ i ], $galleryID ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$imageInput.val( attachmentIDs.join() );\n\t\t\t// sortable_gallery_image_remove();\n\t\t}\n\t);\n\n\t// Now display the actual file_frame\n\tfile_frame.open();\n\n}\n\nfunction sortable_image_gallery_media( $imageContainer, $imageInput ) {\n\t'use strict';\n\n\tvar file_frame;\n\n\t/**\n\t * If an instance of file_frame already exists, then we can open it\n\t * rather than creating a new instance.\n\t */\n\n\tif ( undefined !== file_frame ) {\n\n\t\tfile_frame.open();\n\n\t\treturn;\n\n\t}\n\n\t/**\n\t * If we're this far, then an instance does not exist, so we need to\n\t * create our own.\n\t *\n\t * Here, use the wp.media library to define the settings of the Media\n\t * Uploader. We're opting to use the 'post' frame which is a template\n\t * defined in WordPress core and are initializing the file frame\n\t * with the 'insert' state.\n\t *\n\t * We're also not allowing the user to select more than one image.\n\t */\n\tfile_frame = wp.media(\n\t\t{\n\t\t\tmultiple: true,\n\t\t}\n\t);\n\n\tfile_frame.on(\n\t\t'open',\n\t\tfunction() {\n\t\t\tvar selection = file_frame.state().get( 'selection' );\n\t\t\tvar ids = $imageInput.val().split( ',' );\n\t\t\tids.forEach(\n\t\t\t\tfunction(id) {\n\t\t\t\t\tvar attachment = wp.media.attachment( id );\n\t\t\t\t\tattachment.fetch();\n\t\t\t\t\tselection.add( attachment ? [ attachment ] : [] );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\t// When an image is selected in the media frame...\n\tfile_frame.on(\n\t\t'select',\n\t\tfunction() {\n\n\t\t\t// Get media attachment details from the frame state\n\t\t\tvar attachments = file_frame.state().get( 'selection' ).toJSON();\n\n\t\t\tvar attachmentIDs = [];\n\t\t\t$imageContainer.empty();\n\t\t\tvar $galleryID = $imageContainer.attr( \"id\" );\n\t\t\tfor ( var i = 0; i < attachments.length; i++ ) {\n\t\t\t\tif ( attachments[ i ].type == \"image\" ) {\n\t\t\t\t\tattachmentIDs.push( attachments[ i ].id );\n\t\t\t\t\t$imageContainer.append( sortable_gallery_image_create( attachments[ i ], $galleryID ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$imageInput.val( attachmentIDs.join() );\n\t\t\t// sortable_gallery_image_remove();\n\t\t}\n\t);\n\n\t// Now display the actual file_frame\n\tfile_frame.open();\n\n}\n\nfunction sortable_gallery_image_create( $attachment, $galleryID ) {\n\tvar image_url = '';\n\tif ( $attachment.sizes.thumbnail ) {\n\t\timage_url = $attachment.sizes.thumbnail.url;\n\t} else {\n\t\timage_url = $attachment.sizes.full.url;\n\t}\n\tvar $output = '<li tabindex=\"0\" role=\"checkbox\" aria-label=\"' + $attachment.title + '\" aria-checked=\"true\" data-id=\"' + $attachment.id + '\" class=\"attachment save-ready selected details\">';\n\t$output += '<div class=\"attachment-preview js--select-attachment type-image subtype-jpeg portrait\">';\n\t$output += '<div class=\"thumbnail\">'\n\n\t$output += '<div class=\"centered\">'\n\t$output += '<img src=\"' + image_url + '\" draggable=\"false\" alt=\"\">'\n\t$output += '</div>'\n\n\t$output += '</div>'\n\n\t$output += '</div>'\n\n\t$output += '<button type=\"button\" data-gallery=\"#' + $galleryID + '\" class=\"button-link check remove-sortable-wordpress-gallery-image\" tabindex=\"0\"><span class=\"media-modal-icon\"></span><span class=\"screen-reader-text\">Deselect</span></button>'\n\n\t$output += '</li>';\n\treturn $output;\n\n}\n\nfunction sortable_gallery_image_remove( ) {\n\tjQuery( \".remove-sortable-wordpress-gallery-image\" ).on(\n\t\t'click',\n\t\tfunction(){\n\t\t\tvar $id = jQuery( this ).parent().attr( \"data-id\" );\n\t\t\tvar $gallery = jQuery( this ).attr( \"data-gallery\" );\n\t\t\tvar $imageInput = jQuery( $gallery + \"_input\" );\n\n\t\t\tjQuery( this ).parent().remove();\n\t\t\tvar ids = $imageInput.val().split( ',' );\n\t\t\tvar $idIndex = ids.indexOf( $id );\n\t\t\tif ( $idIndex >= 0 ) {\n\t\t\t\tids.splice( $idIndex, 1 );\n\t\t\t\t$imageInput.val( ids.join() );\n\t\t\t}\n\t\t}\n\t);\n}\n\nfunction giveasap_prepare_format_from_php( format ) {\n\tformat = format.replace( \"d\", \"dd\" );\n\tformat = format.replace( \"j\", \"d\" );\n\tformat = format.replace( \"Y\", \"yy\" );\n\tformat = format.replace( \"m\", \"mm\" );\n\n\treturn format;\n}\n\nfunction giveasap_initialize_code_editor() {\n\tvar $ = jQuery;\n\tif ( $( '.sg-code-editor' ).length ) {\n\t\t$( '.sg-code-editor' ).each(\n\t\t\tfunction(){\n\t\t\t\tvar editorSettings = wp.codeEditor.defaultSettings ? _.clone( wp.codeEditor.defaultSettings ) : {};\n\t\t\t\tvar mode = $( this ).attr( 'data-mode' );\n\t\t\t\tif ( typeof mode === 'undefined' ) {\n\t\t\t\t\tmode = false;\n\t\t\t\t}\n\t\t\t\teditorSettings.codemirror = _.extend(\n\t\t\t\t\t{},\n\t\t\t\t\teditorSettings.codemirror,\n\t\t\t\t\t{\n\t\t\t\t\t\tindentUnit: 2,\n\t\t\t\t\t\ttabSize: 2\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( mode ) {\n\t\t\t\t\teditorSettings.codemirror.mode = mode;\n\t\t\t\t}\n\n\t\t\t\tvar editor = wp.codeEditor.initialize( $( this ), editorSettings );\n\t\t\t}\n\t\t);\n\t}\n}\n\n(function($){\n\n\t$( document ).ready(\n\t\tfunction(){\n\n\t\t\t$(document.body).on( 'click', '#notify', function (e){\n\t\t\t\tif ( ! $('#sg_allow_awarding').length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('#sg_allow_awarding').prop('checked') ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('.sg-select-prizes-manual').length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('.sg-prizes-field-container ').length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $('.sg-prizes-field-container ').children().length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar prizesDropdown = $('.sg-select-prizes-manual');\n\t\t\t\tvar havePricesSelected = true;\n\t\t\t\tprizesDropdown.each(function() {\n\t\t\t\t\tvar value = $(this).find('select').val();\n\t\t\t\t\tif ( ! value.length ) {\n\t\t\t\t\t\thavePricesSelected = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ( ! havePricesSelected ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\talert('Some users don\\'t have their prizes selected! Please make sure all have their prizes selected, save the giveaway and click again to notify.');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ttlite( el => el.classList.contains( 'sg-tooltip' ) );\n\n\n\t\t\t$( '#sgToggleAwardPrizes' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\t$target = $this.attr( 'data-target' ),\n\t\t\t\t\t$class = $this.attr( 'data-class' );\n\n\t\t\t\t\t$( $target ).toggleClass( $class );\n\t\t\t\t\tif ( $( $target ).hasClass( $class ) ) {\n\t\t\t\t\t\t$( '#sg_awarding_prizes_manually' ).removeAttr( 'checked' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$( '#sg_awarding_prizes_manually' ).attr( 'checked', 'checked' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-toggle' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\t$target = $this.attr( 'data-target' ),\n\t\t\t\t\t$class = $this.attr( 'data-class' ),\n\t\t\t\t\t$text = $this.attr( 'data-text' );\n\n\t\t\t\t\t$( $target ).toggleClass( $class );\n\t\t\t\t\tif ( $text ) {\n\t\t\t\t\t\tvar old_text = $this.text();\n\t\t\t\t\t\t$this.attr( 'data-text', old_text );\n\t\t\t\t\t\t$this.html( $text );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( $( '#sg_giveaway_add_subscriber' ).length ) {\n\t\t\t\t$( '#sg_giveaway_add_subscriber' ).on(\n\t\t\t\t\t'change',\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\tdata: { action: 'sg_get_giveaway_form_fields', giveaway: $( this ).val(), nonce: gasap.nonce },\n\t\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t\t$( '#sgGiveawayFields' ).html( resp.data );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar imageButton = $( \".add-sortable-wordpress-gallery\" );\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.remove-sortable-wordpress-gallery-image',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\t$id = $this.parent().attr( 'data-id' ),\n\t\t\t\t\t$gallery = $this.attr( 'data-gallery' ),\n\t\t\t\t\t$input = $( $gallery + '_input' );\n\n\t\t\t\t\tvar ids = $input.val().split( ',' ),\n\t\t\t\t\t$idIndex = ids.indexOf( $id );\n\t\t\t\t\tif ( $idIndex >= 0 ) {\n\t\t\t\t\t\tids.splice( $idIndex, 1 );\n\t\t\t\t\t\t$input.val( ids.join() );\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.parent().remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// sortable_gallery_image_remove();\n\t\t\timageButton.each(\n\t\t\t\tfunction(){\n\t\t\t\t\tvar galleryID = $( this ).attr( \"data-gallery\" );\n\t\t\t\t\tvar imageContainer = $( galleryID );\n\t\t\t\t\tvar imageInput = $( galleryID + \"_input\" );\n\t\t\t\t\timageContainer.sortable();\n\t\t\t\t\timageContainer.on(\n\t\t\t\t\t\t\"sortupdate\",\n\t\t\t\t\t\tfunction( event, ui ) {\n\t\t\t\t\t\t\tvar $ids = [];\n\t\t\t\t\t\t\tvar $images = imageContainer.children( \"li\" );\n\t\t\t\t\t\t\t$images.each(\n\t\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\t$ids.push( $( this ).attr( \"data-id\" ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\timageInput.val( $ids.join() );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t$( this ).on(\n\t\t\t\t\t\t'click',\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tsortable_image_gallery_media( imageContainer, imageInput );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.add-single-wordpress-image',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar galleryID = $( this ).attr( \"data-gallery\" );\n\t\t\t\t\tvar imageContainer = $( galleryID );\n\t\t\t\t\tvar imageInput = $( galleryID + \"_input\" );\n\t\t\t\t\tgiveasap_image_media( imageContainer, imageInput );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'#giveasap_end_date, #giveasap_end_time',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar end_time = $( '#giveasap_end_time' ).val(),\n\t\t\t\t\tend_date = $( '#giveasap_end_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\twinner_time = $( '#giveasap_winner_time' ).val(),\n\t\t\t\t\twinner_date = $( '#giveasap_winner_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\tend_date_object = Date.parse( end_date + 'T' + end_time ),\n\t\t\t\t\twinner_date_object = Date.parse( winner_date + 'T' + winner_time );\n\n\t\t\t\t\tif ( end_date_object > winner_date_object ) {\n\t\t\t\t\t\t$( '#giveasap_winner_date' ).val( $( '#giveasap_end_date' ).val() );\n\t\t\t\t\t\t$( '#giveasap_winner_time' ).val( $( '#giveasap_end_time' ).val() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'#giveasap_winner_time, #giveasap_winner_date',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar end_time = $( '#giveasap_end_time' ).val(),\n\t\t\t\t\tend_date = $( '#giveasap_end_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\twinner_time = $( '#giveasap_winner_time' ).val(),\n\t\t\t\t\twinner_date = $( '#giveasap_winner_date' ).val().split( '-' ).reverse().join( '-' ),\n\t\t\t\t\tend_date_object = Date.parse( end_date + 'T' + end_time ),\n\t\t\t\t\twinner_date_object = Date.parse( winner_date + 'T' + winner_time );\n\n\t\t\t\t\tif ( end_date_object > winner_date_object ) {\n\t\t\t\t\t\talert( gasap.text.winner_before_end );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tvar $expand_users = $( \"#giveasap_expand_users\" );\n\t\t\t$expand_users.on(\n\t\t\t\t'click',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $users_container = $( \"#giveasap_users_container\" );\n\t\t\t\t\t$users_container.toggleClass( \"hidden\" );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tvar $date_format = $( \"#date_format\" );\n\t\t\t$date_format.on(\n\t\t\t\t'change',\n\t\t\t\tfunction(){\n\n\t\t\t\t\t$format = giveasap_prepare_format_from_php( $( this ).val() );\n\t\t\t\t\t$( \".datepicker\" ).datepicker(\n\t\t\t\t\t\t'option',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taltFormat: $format\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.button-integration-deactivate',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar integration = $( this ).attr( 'data-integration' ),\n\t\t\t\t\t$this = $( this );\n\t\t\t\t\tif ( integration ) {\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tdata: { action: 'giveasap_deactivate_integration', integration: integration, nonce: gasap.nonce },\n\t\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t\t$this.removeClass( 'button-integration-deactivate' )\n\t\t\t\t\t\t\t\t\t\t.removeClass( 'button-default' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'button-integration-activate' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'button-primary' )\n\t\t\t\t\t\t\t\t\t\t.html( gasap.text.activate );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.button-integration-activate',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar integration = $( this ).attr( 'data-integration' ),\n\t\t\t\t\t$this = $( this );\n\n\t\t\t\t\tif ( integration ) {\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tdata: { action: 'giveasap_activate_integration', integration: integration, nonce: gasap.nonce },\n\t\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t\t$this.addClass( 'button-integration-deactivate' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'button-default' )\n\t\t\t\t\t\t\t\t\t\t.removeClass( 'button-integration-activate' )\n\t\t\t\t\t\t\t\t\t\t.removeClass( 'button-primary' )\n\t\t\t\t\t\t\t\t\t\t.html( gasap.text.deactivate );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Searching Email on User List.\n\t\t\t */\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.ga-search-email',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar inputs = $( this ).parent().find( 'input' ),\n\t\t\t\t\turl = window.location.href,\n\t\t\t\t\tparts = url.split( '?' ),\n\t\t\t\t\tquery = parts[1],\n\t\t\t\t\tqparams = query.split( '&' ),\n\t\t\t\t\tparams = {};\n\n\t\t\t\t\tfor ( var i = 0; i < qparams.length; i++ ) {\n\t\t\t\t\t\tvar strings = qparams[i].split( '=' );\n\t\t\t\t\t\tparams[ strings[0] ] = strings[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tinputs.each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tvar name = $( this ).attr( 'name' ),\n\t\t\t\t\t\t\tval = $( this ).val();\n\t\t\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\t\t\tparams[ name ] = val;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete params[ name ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tvar params_array = [];\n\t\t\t\t\tfor ( var key in params ) {\n\t\t\t\t\t\tparams_array.push( key + '=' + params[key] );\n\t\t\t\t\t}\n\t\t\t\t\tvar location = parts[0] + '?' + params_array.join( '&' );\n\n\t\t\t\t\twindow.location.href = location;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-metaboxes li.sg-metabox a',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( '.sg-metabox-fields' ).addClass( 'hidden' );\n\t\t\t\t\t$( '.sg-metaboxes li.active' ).removeClass( 'active' );\n\t\t\t\t\tvar target = $( this ).attr( 'href' );\n\t\t\t\t\t$( target ).removeClass( 'hidden' );\n\t\t\t\t\t$( this ).parent().addClass( 'active' );\n\t\t\t\t\t$( target ).find( '.wp-editor-wrap' ).each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tvar frame = $( this ).find( 'iframe' ),\n\t\t\t\t\t\t\theight = frame.height();\n\t\t\t\t\t\t\tif ( height < 200 ) {\n\t\t\t\t\t\t\t\tframe.height( 200 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tif ( $( target ).find('.sg-code-editor') ) {\n\t\t\t\t\t\tgiveasap_initialize_code_editor();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.sg-admin-form.sg-action-form :input',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar form = $( this ).parents( '.sg-admin-form' );\n\t\t\t\t\tif ( ! $( this )[0].checkValidity() ) {\n\t\t\t\t\t\tvar txt = $( this )[0].validationMessage;\n\t\t\t\t\t\tvar error = form.find( '.error' );\n\t\t\t\t\t\t$( this ).focus();\n\t\t\t\t\t\tif ( error.length ) {\n\t\t\t\t\t\t\terror.find( 'p' ).html( txt );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tform.prepend( '<div class=\"notice error\"><p>' + txt + '</p></div>' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\tform.find( '.error' ).fadeOut().remove();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t5000\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-image-popup-link' ).magnificPopup( {type:'image'} );\n\n\t\t\t/**\n\t\t\t * Sharing Methods.\n\t\t\t */\n\t\t\t$( '#addShareMethod' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar template = wp.template( 'sharing-method' ),\n\t\t\t\t\tindex = $( '.giveaway-sharing-methods' ).children().length,\n\t\t\t\t\tdata = { index: index, title: 'New Method' },\n\t\t\t\t\thtml = template( data );\n\t\t\t\t\t$( '.giveaway-sharing-methods' ).append( html );\n\t\t\t\t\t$( '.giveaway-sharing-methods' ).children().eq( index ).find( '.method-select' ).trigger( 'change' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction giveaway_reset_methods_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.giveaway-sharing-methods' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'giveasap_methods\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'giveasap_methods[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$( '.giveaway-sharing-methods' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_methods_index();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveaway-sharing-method .method-header',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parent().toggleClass( 'active' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveaway-sharing-method .button-delete',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.giveaway-sharing-method' ).remove();\n\t\t\t\t\tgiveaway_reset_methods_index();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.giveaway-sharing-method .method-select',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar value = $( this ).val();\n\n\t\t\t\t\tif ( 'custom' === value ) {\n\t\t\t\t\t\tvar template = wp.template( 'sharing-method-custom' ),\n\t\t\t\t\t\tmethod = $( this ).parents( '.giveaway-sharing-method' ),\n\t\t\t\t\t\tindex = method.attr( 'data-index' ),\n\t\t\t\t\t\tdata = { index: index, url: '', title: method.attr( 'data-title' ), attributes: { url: '', text: '', image: '' } },\n\t\t\t\t\t\thtml = template( data );\n\t\t\t\t\t\tmethod.find( '.giveasap-method-html' ).html( html );\n\t\t\t\t\t\tmethod.find( '.color-picker' ).wpColorPicker();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar method = $( this ).parents( '.giveaway-sharing-method' );\n\t\t\t\t\t\tmethod.find( '.giveasap-method-html' ).html( '' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction strip_tags(input, allowed) {\n\t\t\t\tallowed = (((allowed || '') + '')\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.match(/<[a-z][a-z0-9]*>/g) || [])\n\t\t\t\t\t.join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n\t\t\t\tvar tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n\t\t\t\t\tcommentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n\t\t\t\tcommentsAndPhpTags = /<(script|style)[^>]*?>.*?<\\/\\1>/g;\n\t\t\t\treturn input.replace(commentsAndPhpTags, '')\n\t\t\t\t\t.replace(tags, function($0, $1) {\n\t\t\t\t\t\treturn allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\t$( document ).on(\n\t\t\t\t'keyup',\n\t\t\t\t'.giveaway-sharing-method .method-title',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar val = strip_tags( $( this ).val() );\n\t\t\t\t\tconsole.log(val);\n\t\t\t\t\t$( this ).parents( '.giveaway-sharing-method' ).find( '.method-header strong' ).html( val );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( $( '.giveaway-sharing-methods' ).length ) {\n\t\t\t\t$( '.giveaway-sharing-methods .color-picker' ).wpColorPicker();\n\t\t\t}\n\n\t\t\t/** Form Fields ********/\n\n\t\t\tfunction giveaway_reset_form_fields_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.sg-form-fields-container' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'form_fields\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'form_fields[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfunction giveaway_reset_prizes_fields_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.sg-prizes-field-container' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'form_fields\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'form_fields[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'change',\n\t\t\t\t'.sg-field-type',\n\t\t\t\tfunction(e){\n\t\t\t\t\tvar type = $( this ).val(),\n\t\t\t\t\t$this = $( this ),\n\t\t\t\t\tparent = $this.parent();\n\t\t\t\t\tif ( 'radio' === type || 'select' === type ) {\n\t\t\t\t\t\tif ( parent.find( '.sg-form-field-options' ).length === 0 ) {\n\t\t\t\t\t\t\tvar index = $this.parents( '.sg-form-field' ).attr( 'data-index' ),\n\t\t\t\t\t\t\t tmpl = wp.template( 'sg-form-field-options' ),\n\t\t\t\t\t\t\t html = tmpl( {index: index} );\n\t\t\t\t\t\t\tparent.append( html );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar options = parent.find( '.sg-form-field-options' );\n\t\t\t\t\t\tif ( options.length ) {\n\t\t\t\t\t\t\toptions.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-remove-form-field-option',\n\t\t\t\tfunction(e){\n\t\t\t\t\t$( this ).parent().remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-add-form-field-option',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar index = $( this ).parents( '.sg-form-field' ).attr( 'data-index' ),\n\t\t\t\t\ttmpl = wp.template( 'sg-form-field-option' ),\n\t\t\t\t\thtml = tmpl( { index: index } );\n\t\t\t\t\t$( this ).parent().find( '.sg-form-field-options-container' ).append( html );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-form-fields-container' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tplaceholder: \"ui-state-highlight\",\n\t\t\t\t\thandle: '.sg-form-row-handle',\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_form_fields_index();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '#sgAddFormField' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction() {\n\t\t\t\t\tvar tmpl = wp.template( 'sg-form-field' ),\n\t\t\t\t\tcount = $( '.sg-form-fields-container' ).children().length,\n\t\t\t\t\thtml = tmpl( { index: count } );\n\t\t\t\t\t$( '.sg-form-fields-container' ).append( html );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-delete-form-field',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).remove();\n\t\t\t\t\tgiveaway_reset_form_fields_index();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-form-field-header .sg-field-name',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).toggleClass( 'open' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'keyup',\n\t\t\t\t'.sg-form-field-body .sg-field-name input',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar value = $( this ).val();\n\t\t\t\t\tvalue = strip_tags(value);\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).find( '.sg-form-field-header .sg-field-name' ).html( value );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '#sgAddPrizesField' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction() {\n\t\t\t\t\tvar tmpl = wp.template( 'sg-prizes-field' ),\n\t\t\t\t\tcount = $( '.sg-prizes-field-container' ).children().length,\n\t\t\t\t\thtml = tmpl( { index: count } );\n\t\t\t\t\t$( '.sg-prizes-field-container' ).append( html );\n\n\t\t\t\t\tvar prizesBox = $( '.sg-prizes-field-container .sg-form-field' ).last();\n\t\t\t\t\tprizesBox.toggleClass( 'open' );\n\t\t\t\t\tprizesBox.find( '.sg-field-name input' ).focus();\n\t\t\t\t\tsg_hide_show_metabox_fields_per_type();\n\t\t\t\t\t$( document.body ).triggerHandler( 'sg_prizes_field_added' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-delete-prizes-field',\n\t\t\t\tfunction(){\n\t\t\t\t\t$( this ).parents( '.sg-form-field' ).remove();\n\t\t\t\t\tgiveaway_reset_prizes_fields_index();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-prizes-field-container' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tplaceholder: \"ui-state-highlight\",\n\t\t\t\t\thandle: '.sg-form-row-handle',\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_prizes_fields_index();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/** Giveaway ***********/\n\t\t\tfunction sg_hide_show_metabox_fields_per_type() {\n\t\t\t\tvar giveaway_type = $( '#giveasap_type' ).val();\n\n\t\t\t\t$( '.sg-metaboxes .hide_if_any' ).hide();\n\t\t\t\t$( '.sg-metaboxes .show_if_any' ).show();\n\t\t\t\t$( '.hide_if_' + giveaway_type ).hide();\n\t\t\t\t$( '.show_if_' + giveaway_type ).show();\n\t\t\t\t// $('.sg-metaboxes tr:not(.hide_if_' + giveaway_type + ')').show();\n\n\t\t\t\t$( document.body ).triggerHandler( 'sg_giveaway_type_changed', [ giveaway_type ] );\n\t\t\t}\n\n\t\t\tif ( $( '#sg-metaboxes' ).length ) {\n\n\t\t\t\tsg_hide_show_metabox_fields_per_type();\n\n\t\t\t\t$( '#giveasap_type' ).on( 'change', sg_hide_show_metabox_fields_per_type );\n\t\t\t}\n\n\t\t\t/** Globals ***********/\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-button-action',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tajax = $this.attr( 'data-ajax' ) || '',\n\t\t\t\t\treload = $this.attr( 'data-reload' ) || '0',\n\t\t\t\t\tcallback = $this.attr( 'data-callback' ) || '',\n\t\t\t\t\tnonce = $this.attr( 'data-nonce' ) || '',\n\t\t\t\t\ttext2 = $this.attr( 'data-text' ),\n\t\t\t\t\ttext = $this.text(),\n\t\t\t\t\thref = $this.attr( 'href' );\n\n\t\t\t\t\tif ( text2 ) {\n\t\t\t\t\t\t$this.text( text2 );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ajax ) {\n\n\t\t\t\t\t\tvar data = { action: ajax };\n\n\t\t\t\t\t\tif ( nonce ) {\n\t\t\t\t\t\t\tdata.nonce = gasap.nonce;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( this.attributes.length ) {\n\t\t\t\t\t\t\tfor ( var i = 0; i < this.attributes.length; i++ ) {\n\t\t\t\t\t\t\t\tvar attr = this.attributes[ i ];\n\t\t\t\t\t\t\t\tdata[ attr.nodeName.replace( '-', '_' ) ] = attr.nodeValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\t\t\tsuccess: function( resp ) {\n\t\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\t\tvar fn = window[ callback ];\n\t\t\t\t\t\t\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\t\t\t\t\t\t\tfn( $this, resp );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( text2 && '1' !== reload ) {\n\t\t\t\t\t\t\t\t\t\t$this.text( text );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( '1' === reload ) {\n\t\t\t\t\t\t\t\t\t\tif ( href ) {\n\t\t\t\t\t\t\t\t\t\t\twindow.location.href = href;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tlocation.reload( false );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tvar fn = window[ callback ];\n\t\t\t\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\t\t\t\tfn( $this );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( text2 && '1' !== reload ) {\n\t\t\t\t\t\t\t$this.text( text );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( '1' === reload ) {\n\t\t\t\t\t\t\tif ( href ) {\n\t\t\t\t\t\t\t\twindow.location.href = href;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocation.reload( false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-action-category-title' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\t$( this ).parent().toggleClass( 'active' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-action' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(e){\n\t\t\t\t\tvar $actionContainer = $( '#sgEntriesActions' ),\n\t\t\t\t\tcount = $actionContainer.children().length,\n\t\t\t\t\tslug = $( this ).attr( 'data-slug' ),\n\t\t\t\t\ttemplate = wp.template( slug );\n\n\t\t\t\t\tif ( $( '#tmpl-' + slug ).length ) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t$actionContainer.append( template( { index: count } ) );\n\t\t\t\t\t\t$( document.body ).trigger( 'sg-enhanced-select-search-init' );\n\t\t\t\t\t\t$( document.body ).trigger( 'sg-color-picker-init' );\n\t\t\t\t\t\tvar action = $actionContainer.children().last();\n\t\t\t\t\t\taction.find( '.sg-admin-action-title' ).trigger( 'click' );\n\t\t\t\t\t\twindow.giveasap_max_instance_id = window.giveasap_max_instance_id + 1\n\t\t\t\t\t\taction.find( '.sg-action-form-instance' ).val( window.giveasap_max_instance_id );\n\t\t\t\t\t\t$( [document.documentElement, document.body] ).animate(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tscrollTop: $actionContainer.children().last().offset().top - 24 // admin bar.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t500\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '.sg-extra-actions' ).sortable(\n\t\t\t\t{\n\t\t\t\t\tupdate: function( event, ui ) {\n\t\t\t\t\t\tgiveaway_reset_extra_action_index();\n\t\t\t\t\t\tgiveasap_update_specific_mandatory_actions();\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-admin-action-remove',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( this ).parents( '.sg-admin-action' ).remove();\n\t\t\t\t\tgiveaway_reset_extra_action_index();\n\t\t\t\t\tgiveasap_update_specific_mandatory_actions();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction giveaway_reset_extra_action_index() {\n\t\t\t\tvar index = 0;\n\t\t\t\t$( '.sg-extra-actions' ).children().each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar _index = parseInt( $( this ).attr( 'data-index' ) );\n\t\t\t\t\t\tif ( _index !== index ) {\n\t\t\t\t\t\t\tvar html = $( this ).html(),\n\t\t\t\t\t\t\treg = new RegExp( 'entries_actions\\\\[' + _index + '\\\\]', 'g' );\n\t\t\t\t\t\t\tvar _html = html.replace( reg, 'entries_actions[' + index + ']' );\n\t\t\t\t\t\t\t$( this ).html( _html );\n\t\t\t\t\t\t\t$( this ).attr( 'data-index', index );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-admin-action-title',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( this ).parent().toggleClass( 'active' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-multioption-button',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar id = $( this ).attr( 'data-id' ),\n\t\t\t\t\tname = $( this ).attr( 'data-name' ),\n\t\t\t\t\ttmpl = $( this ).attr( 'data-template' ),\n\t\t\t\t\tcount = $( '#' + id ).children().length,\n\t\t\t\t\ttemplate = wp.template( tmpl ),\n\t\t\t\t\thtml = template( { index: count, id: id, name: name } );\n\n\t\t\t\t\t$( '#' + id ).append( html );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.sg-multioption-delete',\n\t\t\t\tfunction(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$( this ).parent().remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'keyup',\n\t\t\t\t'.sg-form-field-title input',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar parent = $( this ).parents( '.sg-admin-form' );\n\t\t\t\t\tvar instance = parent.find( '.sg-action-form-instance' ).val();\n\t\t\t\t\tvar title = $( this ).val();\n\t\t\t\t\ttitle = strip_tags(title);\n\t\t\t\t\tgiveasap_update_specific_mandatory_action( instance, title );\n\t\t\t\t\tgiveasap_update_specific_mandatory_actions();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.mandatory-specific-action-checkbox',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar parent = $( this ).parents( '.sg-admin-form' );\n\t\t\t\t\tvar field = $( this ).parents( '.sg-form-field' );\n\t\t\t\t\tvar selected = field.attr( 'data-value' );\n\t\t\t\t\tvar instance = parent.find( '.sg-action-form-instance' ).val();\n\t\t\t\t\tvar value = $( this ).val();\n\n\t\t\t\t\tselected = selected.split(',');\n\t\t\t\t\tif ( $(this).prop('checked') && selected.indexOf( value ) < 0) {\n\t\t\t\t\t\tselected.push( value );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! $(this).prop('checked') && selected.indexOf( value ) >= 0) {\n\t\t\t\t\t\tvar index = selected.indexOf(value);\n\t\t\t\t\t\tif (index > -1) {\n\t\t\t\t\t\t\tselected.splice(index, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfield.attr('data-value', selected.join(','));\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfunction giveasap_update_specific_mandatory_action( instance, title ) {\n\t\t\t\tvar ids = window.giveasap_actions.map(\n\t\t\t\t\tfunction(action){\n\t\t\t\t\t\treturn parseInt( action.instance );\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( ids.indexOf( parseInt( instance ) ) >= 0 ) {\n\t\t\t\t\twindow.giveasap_actions = window.giveasap_actions.map(\n\t\t\t\t\t\tfunction (action) {\n\t\t\t\t\t\t\tif (parseInt( action.instance ) !== parseInt( instance )) {\n\t\t\t\t\t\t\t\treturn action;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\taction.title = title;\n\t\t\t\t\t\t\treturn action;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\twindow.giveasap_actions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinstance: instance,\n\t\t\t\t\t\t\ttitle: title\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction giveasap_update_specific_mandatory_actions() {\n\t\t\t\t$( document ).find( '.sg-select-specific-mandatory-actions' ).each(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvar $this = $( this );\n\t\t\t\t\t\tvar parent = $this.parents( '.sg-admin-form' );\n\t\t\t\t\t\tvar field = $this.parents( '.sg-form-field' );\n\t\t\t\t\t\tvar selected = field.attr( 'data-value' );\n\t\t\t\t\t\tvar name = field.attr( 'data-name' );\n\t\t\t\t\t\tvar instance = parent.find( '.sg-action-form-instance' ).val();\n\t\t\t\t\t\tvar data = [];\n\n\t\t\t\t\t\tif ( selected ) {\n\t\t\t\t\t\t\tselected = selected.split(',');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( window.giveasap_actions && window.giveasap_actions.length ) {\n\t\t\t\t\t\t\tfor (var g = 0; g < window.giveasap_actions.length; g++ ) {\n\t\t\t\t\t\t\t\tvar action_id = window.giveasap_actions[ g ].instance;\n\n\t\t\t\t\t\t\t\tif ( parseInt( instance ) === parseInt( action_id ) ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar optionSelected = selected && selected.indexOf( action_id ) >= 0;\n\n\t\t\t\t\t\t\t\tdata.push(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: action_id,\n\t\t\t\t\t\t\t\t\t\ttext: window.giveasap_actions[ g ].title,\n\t\t\t\t\t\t\t\t\t\tselected: optionSelected\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! data.length ) {\n\t\t\t\t\t\t\tfield.addClass('hidden');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar html = '';\n\t\t\t\t\t\tfor( var d = 0; d < data.length; d++ ) {\n\t\t\t\t\t\t\tvar action = data[d];\n\t\t\t\t\t\t\tvar checkedHTML = '';\n\t\t\t\t\t\t\tif ( action.selected ) {\n\t\t\t\t\t\t\t\tcheckedHTML = 'checked=\"checked\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += '<label for=\"' + instance + '_specific_action_' + d + '\">';\n\t\t\t\t\t\t\thtml += '<input class=\"mandatory-specific-action-checkbox\" ' + checkedHTML + ' id=\"' + instance + '_specific_action_' + d + '\" type=\"checkbox\" name=\"' + name + '\" value=\"' + action.id + '\"/>'\n\t\t\t\t\t\t\thtml += action.text;\n\t\t\t\t\t\t\thtml += '</label>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this.html(html);\n\t\t\t\t\t\tfield.removeClass('hidden');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tgiveasap_update_specific_mandatory_actions();\n\n\t\t\t$( document ).find( '.sg-select2:not(.enhanced)' ).each(\n\t\t\t\tfunction(){\n\t\t\t\t\tif ( $( this ).parents( '.sg-report-options' ).length ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $this = $( this );\n\t\t\t\t\t$( this ).select2(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tplaceholder: $this.attr( 'placeholder' ) || '',\n\t\t\t\t\t\t\tminimumInputLength: $this.attr( 'data-mininput' ) || 3,\n\t\t\t\t\t\t\tajax: {\n\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\tdata: function (params) {\n\t\t\t\t\t\t\t\t\tvar query = {\n\t\t\t\t\t\t\t\t\t\tsearch: params.term,\n\t\t\t\t\t\t\t\t\t\ttype: 'public',\n\t\t\t\t\t\t\t\t\t\taction: $this.attr( 'data-action' ) || 'sg_get_giveaways'\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Query parameters will be ?search=[term]&type=public\n\t\t\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tprocessResults: function (data) {\n\t\t\t\t\t\t\t\t\tif ( data.success ) {\n\t\t\t\t\t\t\t\t\t\tvar items = [];\n\t\t\t\t\t\t\t\t\t\tfor ( var index in data.data ) {\n\t\t\t\t\t\t\t\t\t\t\titems.push(\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tid: data.data[index].ID,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttext: data.data[index].post_title\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresults: items\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Transforms the top-level key of the response object from 'items' to 'results'\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tresults: data.items\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t).addClass( 'enhanced' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/* <fs_premium_only> */\n\n\t\t\tfunction sgToggleMultiplePrizesFields( type ) {\n\n\t\t\t\tswitch ( type ) {\n\t\t\t\t\tcase 'default':\n\t\t\t\t\t\t$( '.sg-prizes-field-container .sg-form-field' ).each(\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\tvar $prize_fields = $( this );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-winner' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-chance' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-quantity' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'random':\n\t\t\t\t\t\t$( '.sg-prizes-field-container .sg-form-field' ).each(\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\tvar $prize_fields = $( this );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-winner' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-chance' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t$prize_fields.find( '.sg-prize-field-quantity' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$( document.body ).triggerHandler( 'sg_toggle_multiple_prizes_fields', [ type ] );\n\t\t\t}\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'sg_giveaway_type_changed',\n\t\t\t\tfunction( e, type ) {\n\t\t\t\t\tif ( 'instant' === type ) {\n\t\t\t\t\t\t$( '#sg-metabox-fields-giveasap_prize #type' ).val( 'random' );\n\t\t\t\t\t}\n\t\t\t\t\tsgToggleMultiplePrizesFields( $( '#sg-metabox-fields-giveasap_prize #type' ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document.body ).on(\n\t\t\t\t'sg_prizes_field_added',\n\t\t\t\tfunction(){\n\t\t\t\t\tsgToggleMultiplePrizesFields( $( '#sg-metabox-fields-giveasap_prize #type' ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( $( '#sg-metabox-fields-giveasap_prize' ).length ) {\n\t\t\t\tsgToggleMultiplePrizesFields( $( '#sg-metabox-fields-giveasap_prize #type' ).val() );\n\t\t\t}\n\t\t\t$( document.body ).on(\n\t\t\t\t'change',\n\t\t\t\t'#sg-metabox-fields-giveasap_prize #type',\n\t\t\t\tfunction(e){\n\t\t\t\t\tsgToggleMultiplePrizesFields( $( this ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( '#ga_aweber_disconnect' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $( this ).parent();\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: { action: 'giveasap_disconnect_ga_aweber', nonce: gasap.nonce },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$( '.ga-aweber-disconnect' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t\t$( '.ga-aweber-connect' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parent();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).attr( 'type', 'number' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-save' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-user-entries' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-cancel' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-save',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parent(),\n\t\t\t\t\tuser_id = parent.find( '.giveasap-edit-user-input' ).attr( 'data-id' ),\n\t\t\t\t\tentries = parent.find( '.giveasap-edit-user-input' ).val();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\n\t\t\t\t\t$this.html( gasap.text.saving );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: { action: 'giveasap_edit_user_entry', user_id: user_id, nonce: gasap.nonce, entries: entries },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$this.html( gasap.text.save );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).val( resp.data.entries );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-user-entries' ).html( resp.data.entries );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).attr( 'type', 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-save' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-user-entries' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.giveasap-edit-user-cancel' ).addClass( 'hidden' );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar html = '<p class=\"giveasap-edit-user-alert\">' + resp.data.message + '</p>';\n\t\t\t\t\t\t\t\t\tparent.append( html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-cancel',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parent();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\t\t\t\t\tparent.find( '.giveasap-edit-user' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-input' ).attr( 'type', 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-save' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-user-entries' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.giveasap-edit-user-cancel' ).addClass( 'hidden' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-email',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tvar parent = $( this ).parents( 'tr' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text' ).addClass( 'hidden' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-input' ).removeClass( 'hidden' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-email-cancel',\n\t\t\t\tfunction( e ){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar parent = $( this ).parents( 'tr' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text' ).removeClass( 'hidden' );\n\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-input' ).addClass( 'hidden' );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'click',\n\t\t\t\t'.giveasap-edit-user-email-save',\n\t\t\t\tfunction(){\n\t\t\t\t\tvar $this = $( this ),\n\t\t\t\t\tparent = $this.parents( 'td' ),\n\t\t\t\t\tuser_id = parent.find( '.giveasap-edit-user-email-input' ).attr( 'data-id' ),\n\t\t\t\t\temail = parent.find( '.giveasap-edit-user-email-input' ).val();\n\n\t\t\t\t\tparent.find( '.giveasap-edit-user-alert' ).remove();\n\n\t\t\t\t\t$this.html( gasap.text.saving );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: { action: 'giveasap_edit_user_email', user_id: user_id, nonce: gasap.nonce, email: email },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$this.html( gasap.text.save );\n\t\t\t\t\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text' ).removeClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-input' ).addClass( 'hidden' );\n\t\t\t\t\t\t\t\t\tparent.find( '.sg-premium-subscriber-email-text strong' ).html( email );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar html = '<p class=\"giveasap-edit-user-alert\">' + resp.data.message + '</p>';\n\t\t\t\t\t\t\t\t\tparent.append( html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t\twindow['sg_replace_form_fields'] = function sg_replace_form_fields( $el, response ) {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\t$el.parents( 'tr' ).html( response.data.fields_html );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'[name=mailchimp_list], #ga_mailchimp [name=list]',\n\t\t\t\tfunction(){\n\t\t\t\t\tconsole.log( $( this ).val() );\n\t\t\t\t\tvar list = $( this ).val(),\n\t\t\t\t\tself = $( this ),\n\t\t\t\t\tname = self.attr( 'name' );\n\n\t\t\t\t\tself.parents( 'td' ).addClass( 'sg-loading' );\n\t\t\t\t\t$( '.mailchimp-groups' ).html( '' );\n\t\t\t\t\t$( '.mailchimp-group-options' ).html( '' );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\tdata: { action: 'sg_mailchimp_get_groups', nonce: gasap.nonce, list: list, name: name },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$( '.mailchimp-groups' ).html( resp.data.html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete: function(){\n\n\t\t\t\t\t\t\t\tself.parents( 'td' ).removeClass( 'sg-loading' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$( document ).on(\n\t\t\t\t'change',\n\t\t\t\t'.mailchimp-groups select',\n\t\t\t\tfunction(){\n\t\t\t\t\tconsole.log( $( this ).val() );\n\t\t\t\t\tvar group = $( this ).val(),\n\t\t\t\t\tlist = $( '.mailchimp-list' ).val(),\n\t\t\t\t\tself = $( this ),\n\t\t\t\t\tname = self.attr( 'name' );\n\n\t\t\t\t\tself.parents( 'td' ).addClass( 'sg-loading' );\n\t\t\t\t\t$( '.mailchimp-group-options' ).html( '' );\n\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\tdata: { action: 'sg_mailchimp_get_group_options', nonce: gasap.nonce, list: list, name: name, group: group },\n\t\t\t\t\t\t\tsuccess: function(resp) {\n\t\t\t\t\t\t\t\tif ( resp.success ) {\n\t\t\t\t\t\t\t\t\t$( '.mailchimp-group-options' ).html( resp.data.html );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete: function(){\n\n\t\t\t\t\t\t\t\tself.parents( 'td' ).removeClass( 'sg-loading' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/* </fs_premium_only> */\n\n\t\t\t/** Select2 Ajax **/\n\t\t\t$( document.body )\n\t\t\t.on(\n\t\t\t\t'sg-enhanced-select-search-init',\n\t\t\t\tfunction() {\n\n\t\t\t\t\t// Ajax product search box\n\t\t\t\t\t$( ':input.sg-select-search' ).filter( ':not(.enhanced)' ).each(\n\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\tvar select2_args = {\n\t\t\t\t\t\t\t\tallowClear: $( this ).data( 'allow_clear' ) ? true : false,\n\t\t\t\t\t\t\t\tplaceholder: $( this ).data( 'placeholder' ),\n\t\t\t\t\t\t\t\tminimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',\n\t\t\t\t\t\t\t\tescapeMarkup: function (m) {\n\t\t\t\t\t\t\t\t\treturn m;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tajax: {\n\t\t\t\t\t\t\t\t\turl: gasap.ajax_url,\n\t\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\t\tdelay: 250,\n\t\t\t\t\t\t\t\t\tdata: function (params) {\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tterm: params.term,\n\t\t\t\t\t\t\t\t\t\t\taction: $( this ).data( 'action' ) || 'sg_select_search',\n\t\t\t\t\t\t\t\t\t\t\tsecurity: gasap.nonce,\n\t\t\t\t\t\t\t\t\t\t\texclude: $( this ).data( 'exclude' ),\n\t\t\t\t\t\t\t\t\t\t\texclude_type: $( this ).data( 'exclude_type' ),\n\t\t\t\t\t\t\t\t\t\t\tinclude: $( this ).data( 'include' ),\n\t\t\t\t\t\t\t\t\t\t\tlimit: $( this ).data( 'limit' ),\n\t\t\t\t\t\t\t\t\t\t\tdisplay_stock: $( this ).data( 'display_stock' )\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tprocessResults: function (data) {\n\t\t\t\t\t\t\t\t\t\tvar terms = [];\n\t\t\t\t\t\t\t\t\t\tif (data) {\n\t\t\t\t\t\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t\t\t\t\t\tfunction (id, text) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tterms.push( {id: id, text: text} );\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\tresults: terms\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tcache: true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t$( this ).select2( select2_args ).addClass( 'enhanced' );\n\n\t\t\t\t\t\t\tif ($( this ).prop( 'multiple' )) {\n\t\t\t\t\t\t\t\t$( this ).on(\n\t\t\t\t\t\t\t\t\t'change',\n\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\tvar $children = $( this ).children();\n\t\t\t\t\t\t\t\t\t\t$children.sort(\n\t\t\t\t\t\t\t\t\t\t\tfunction (a, b) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar atext = a.text.toLowerCase();\n\t\t\t\t\t\t\t\t\t\t\t\tvar btext = b.text.toLowerCase();\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (atext > btext) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (atext < btext) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t$( this ).html( $children );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t).trigger( 'sg-enhanced-select-search-init' );\n\n\t\t\t$( document.body )\n\t\t\t.on(\n\t\t\t\t'sg-color-picker-init',\n\t\t\t\tfunction() {\n\t\t\t\t\t// Ajax product search box\n\t\t\t\t\t$( ':input.sg-color-picker' ).filter( ':not(.enhanced)' ).each(\n\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t$( this ).wpColorPicker();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t).trigger( 'sg-color-picker-init' );\n\t\t}\n\t);\n})( jQuery )\n"],"names":["tlite","giveasap_image_media","$imageContainer","$imageInput","file_frame","undefined","open","wp","media","multiple","on","selection","state","get","ids","val","split","forEach","id","attachment","fetch","add","attachments","toJSON","attachmentIDs","empty","console","log","$galleryID","attr","i","length","type","push","append","sortable_gallery_image_create","join","sortable_image_gallery_media","$attachment","image_url","sizes","thumbnail","url","full","$output","title","sortable_gallery_image_remove","jQuery","$id","parent","$gallery","remove","$idIndex","indexOf","splice","giveasap_prepare_format_from_php","format","replace","giveasap_initialize_code_editor","$","each","editorSettings","codeEditor","defaultSettings","_","clone","mode","codemirror","extend","indentUnit","tabSize","editor","initialize","document","ready","body","e","prop","children","prizesDropdown","havePricesSelected","value","find","preventDefault","alert","el","classList","contains","$this","$target","$class","toggleClass","hasClass","removeAttr","$text","old_text","text","html","ajax","gasap","ajax_url","dataType","data","action","giveaway","nonce","success","resp","imageButton","$input","galleryID","imageContainer","imageInput","sortable","event","ui","$ids","$images","end_time","end_date","reverse","winner_time","winner_date","end_date_object","Date","parse","winner_date_object","winner_before_end","$expand_users","$users_container","$date_format","$format","datepicker","altFormat","integration","removeClass","addClass","activate","deactivate","inputs","window","location","href","parts","query","qparams","params","strings","name","params_array","key","target","frame","height","form","parents","checkValidity","txt","validationMessage","error","focus","prepend","setTimeout","fadeOut","magnificPopup","template","index","eq","trigger","giveaway_reset_methods_index","_index","parseInt","reg","RegExp","_html","update","method","attributes","image","wpColorPicker","strip_tags","input","allowed","toLowerCase","match","tags","commentsAndPhpTags","$0","$1","giveaway_reset_form_fields_index","giveaway_reset_prizes_fields_index","tmpl","options","placeholder","handle","count","prizesBox","last","sg_hide_show_metabox_fields_per_type","triggerHandler","giveaway_type","hide","show","reload","callback","text2","nodeName","nodeValue","fn","$actionContainer","slug","giveasap_max_instance_id","documentElement","animate","scrollTop","offset","top","giveaway_reset_extra_action_index","giveasap_update_specific_mandatory_actions","instance","giveasap_update_specific_mandatory_action","field","selected","giveasap_actions","map","g","action_id","optionSelected","d","checkedHTML","select2","minimumInputLength","search","term","processResults","items","ID","post_title","results","sgToggleMultiplePrizesFields","$prize_fields","user_id","entries","saving","save","message","email","sg_replace_form_fields","$el","response","fields_html","list","self","complete","group","filter","select2_args","allowClear","escapeMarkup","m","delay","security","exclude","exclude_type","include","limit","display_stock","terms","cache","$children","sort","a","b","atext","btext"],"sourceRoot":""} -
giveasap/trunk/assets/dist/js/giveasap.js
r2793238 r2882364 1 !function(){var e={238:function(e){e.exports=function(e){var t={};function i(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(o,s,function(t){return e[t]}.bind(null,s));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=l(i(1)),r=l(i(3)),a=l(i(4));function l(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.resolveOptions(i),o.listenClick(e),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default),s(t,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===o(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,a.default)(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new n.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return c("action",e)}},{key:"defaultTarget",value:function(e){var t=c("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return c("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,i=!!document.queryCommandSupported;return t.forEach((function(e){i=i&&!!document.queryCommandSupported(e)})),i}}]),t}();function c(e,t){var i="data-clipboard-"+e;if(t.hasAttribute(i))return t.getAttribute(i)}e.exports=d},function(e,t,i){"use strict";var o,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=(o=i(2))&&o.__esModule?o:{default:o},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return n(e,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":s(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=a},function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var i=e.hasAttribute("readonly");i||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),i||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var o=window.getSelection(),s=document.createRange();s.selectNodeContents(e),o.removeAllRanges(),o.addRange(s),t=o.toString()}return t}},function(e,t){function i(){}i.prototype={on:function(e,t,i){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:i}),this},once:function(e,t,i){var o=this;function s(){o.off(e,s),t.apply(i,arguments)}return s._=t,this.on(e,s,i)},emit:function(e){for(var t=[].slice.call(arguments,1),i=((this.e||(this.e={}))[e]||[]).slice(),o=0,s=i.length;o<s;o++)i[o].fn.apply(i[o].ctx,t);return this},off:function(e,t){var i=this.e||(this.e={}),o=i[e],s=[];if(o&&t)for(var n=0,r=o.length;n<r;n++)o[n].fn!==t&&o[n].fn._!==t&&s.push(o[n]);return s.length?i[e]=s:delete i[e],this}},e.exports=i},function(e,t,i){var o=i(5),s=i(6);e.exports=function(e,t,i){if(!e&&!t&&!i)throw new Error("Missing required arguments");if(!o.string(t))throw new TypeError("Second argument must be a String");if(!o.fn(i))throw new TypeError("Third argument must be a Function");if(o.node(e))return u=t,f=i,(p=e).addEventListener(u,f),{destroy:function(){p.removeEventListener(u,f)}};if(o.nodeList(e))return l=e,d=t,c=i,Array.prototype.forEach.call(l,(function(e){e.addEventListener(d,c)})),{destroy:function(){Array.prototype.forEach.call(l,(function(e){e.removeEventListener(d,c)}))}};if(o.string(e))return n=e,r=t,a=i,s(document.body,n,r,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var n,r,a,l,d,c,p,u,f}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var i=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,i){var o=i(7);function s(e,t,i,s,n){var r=function(e,t,i,s){return function(i){i.delegateTarget=o(i.target,t),i.delegateTarget&&s.call(e,i)}}.apply(this,arguments);return e.addEventListener(i,r,n),{destroy:function(){e.removeEventListener(i,r,n)}}}e.exports=function(e,t,i,o,n){return"function"==typeof e.addEventListener?s.apply(null,arguments):"function"==typeof i?s.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return s(e,t,i,o,n)})))}},function(e,t){if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}}])},340:function(e,t,i){var o,s,n;!function(r){"use strict";s=[i(311)],o=function(e){var t=window.Slick||{};(t=function(){var t=0;return function(i,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:e(i),appendDots:e(i),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,i){return e('<button type="button" />').text(i+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},e.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=e(i),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=e(i).data("slick")||{},n.options=e.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=e.proxy(n.autoPlay,n),n.autoPlayClear=e.proxy(n.autoPlayClear,n),n.autoPlayIterator=e.proxy(n.autoPlayIterator,n),n.changeSlide=e.proxy(n.changeSlide,n),n.clickHandler=e.proxy(n.clickHandler,n),n.selectHandler=e.proxy(n.selectHandler,n),n.setPosition=e.proxy(n.setPosition,n),n.swipeHandler=e.proxy(n.swipeHandler,n),n.dragHandler=e.proxy(n.dragHandler,n),n.keyHandler=e.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},t.prototype.addSlide=t.prototype.slickAdd=function(t,i,o){var s=this;if("boolean"==typeof i)o=i,i=null;else if(i<0||i>=s.slideCount)return!1;s.unload(),"number"==typeof i?0===i&&0===s.$slides.length?e(t).appendTo(s.$slideTrack):o?e(t).insertBefore(s.$slides.eq(i)):e(t).insertAfter(s.$slides.eq(i)):!0===o?e(t).prependTo(s.$slideTrack):e(t).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each((function(t,i){e(i).attr("data-slick-index",t)})),s.$slidesCache=s.$slides,s.reinit()},t.prototype.animateHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.animate({height:t},e.options.speed)}},t.prototype.animateSlide=function(t,i){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(t=-t),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:t},s.options.speed,s.options.easing,i):s.$slideTrack.animate({top:t},s.options.speed,s.options.easing,i):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),e({animStart:s.currentLeft}).animate({animStart:t},{duration:s.options.speed,easing:s.options.easing,step:function(e){e=Math.ceil(e),!1===s.options.vertical?(o[s.animType]="translate("+e+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+e+"px)",s.$slideTrack.css(o))},complete:function(){i&&i.call()}})):(s.applyTransition(),t=Math.ceil(t),!1===s.options.vertical?o[s.animType]="translate3d("+t+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+t+"px, 0px)",s.$slideTrack.css(o),i&&setTimeout((function(){s.disableTransition(),i.call()}),s.options.speed))},t.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=e(t).not(this.$slider)),t},t.prototype.asNavFor=function(t){var i=this.getNavTarget();null!==i&&"object"==typeof i&&i.each((function(){var i=e(this).slick("getSlick");i.unslicked||i.slideHandler(t,!0)}))},t.prototype.applyTransition=function(e){var t=this,i={};!1===t.options.fade?i[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:i[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},t.prototype.autoPlay=function(){var e=this;e.autoPlayClear(),e.slideCount>e.options.slidesToShow&&(e.autoPlayTimer=setInterval(e.autoPlayIterator,e.options.autoplaySpeed))},t.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},t.prototype.autoPlayIterator=function(){var e=this,t=e.currentSlide+e.options.slidesToScroll;e.paused||e.interrupted||e.focussed||(!1===e.options.infinite&&(1===e.direction&&e.currentSlide+1===e.slideCount-1?e.direction=0:0===e.direction&&(t=e.currentSlide-e.options.slidesToScroll,e.currentSlide-1==0&&(e.direction=1))),e.slideHandler(t))},t.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=e(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=e(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},t.prototype.buildDots=function(){var t,i,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),i=e("<ul />").addClass(o.options.dotsClass),t=0;t<=o.getDotCount();t+=1)i.append(e("<li />").append(o.options.customPaging.call(this,o,t)));o.$dots=i.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},t.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each((function(t,i){e(i).attr("data-slick-index",t).data("originalStyling",e(i).attr("style")||"")})),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?e('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0!==t.options.centerMode&&!0!==t.options.swipeToSlide||(t.options.slidesToScroll=1),e("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},t.prototype.buildRows=function(){var e,t,i,o,s,n,r,a=this;if(o=document.createDocumentFragment(),n=a.$slider.children(),a.options.rows>1){for(r=a.options.slidesPerRow*a.options.rows,s=Math.ceil(n.length/r),e=0;e<s;e++){var l=document.createElement("div");for(t=0;t<a.options.rows;t++){var d=document.createElement("div");for(i=0;i<a.options.slidesPerRow;i++){var c=e*r+(t*a.options.slidesPerRow+i);n.get(c)&&d.appendChild(n.get(c))}l.appendChild(d)}o.appendChild(l)}a.$slider.empty().append(o),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},t.prototype.checkResponsive=function(t,i){var o,s,n,r=this,a=!1,l=r.$slider.width(),d=window.innerWidth||e(window).width();if("window"===r.respondTo?n=d:"slider"===r.respondTo?n=l:"min"===r.respondTo&&(n=Math.min(d,l)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){for(o in s=null,r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||i)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=e.extend({},r.originalSettings,r.breakpointSettings[s]),!0===t&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),a=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=e.extend({},r.originalSettings,r.breakpointSettings[s]),!0===t&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),a=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===t&&(r.currentSlide=r.options.initialSlide),r.refresh(t),a=s),t||!1===a||r.$slider.trigger("breakpoint",[r,a])}},t.prototype.changeSlide=function(t,i){var o,s,n=this,r=e(t.currentTarget);switch(r.is("a")&&t.preventDefault(),r.is("li")||(r=r.closest("li")),o=n.slideCount%n.options.slidesToScroll!=0?0:(n.slideCount-n.currentSlide)%n.options.slidesToScroll,t.data.message){case"previous":s=0===o?n.options.slidesToScroll:n.options.slidesToShow-o,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide-s,!1,i);break;case"next":s=0===o?n.options.slidesToScroll:o,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide+s,!1,i);break;case"index":var a=0===t.data.index?0:t.data.index||r.index()*n.options.slidesToScroll;n.slideHandler(n.checkNavigable(a),!1,i),r.children().trigger("focus");break;default:return}},t.prototype.checkNavigable=function(e){var t,i;if(i=0,e>(t=this.getNavigableIndexes())[t.length-1])e=t[t.length-1];else for(var o in t){if(e<t[o]){e=i;break}i=t[o]}return e},t.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&null!==t.$dots&&(e("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",e.proxy(t.interrupt,t,!0)).off("mouseleave.slick",e.proxy(t.interrupt,t,!1)),!0===t.options.accessibility&&t.$dots.off("keydown.slick",t.keyHandler)),t.$slider.off("focus.slick blur.slick"),!0===t.options.arrows&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide),!0===t.options.accessibility&&(t.$prevArrow&&t.$prevArrow.off("keydown.slick",t.keyHandler),t.$nextArrow&&t.$nextArrow.off("keydown.slick",t.keyHandler))),t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler),t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler),t.$list.off("touchend.slick mouseup.slick",t.swipeHandler),t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler),t.$list.off("click.slick",t.clickHandler),e(document).off(t.visibilityChange,t.visibility),t.cleanUpSlideEvents(),!0===t.options.accessibility&&t.$list.off("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().off("click.slick",t.selectHandler),e(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange),e(window).off("resize.slick.slick-"+t.instanceUid,t.resize),e("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault),e(window).off("load.slick.slick-"+t.instanceUid,t.setPosition)},t.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.off("mouseleave.slick",e.proxy(t.interrupt,t,!1))},t.prototype.cleanUpRows=function(){var e,t=this;t.options.rows>1&&((e=t.$slides.children().children()).removeAttr("style"),t.$slider.empty().append(e))},t.prototype.clickHandler=function(e){!1===this.shouldClick&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},t.prototype.destroy=function(t){var i=this;i.autoPlayClear(),i.touchObject={},i.cleanUpEvents(),e(".slick-cloned",i.$slider).detach(),i.$dots&&i.$dots.remove(),i.$prevArrow&&i.$prevArrow.length&&(i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove()),i.$nextArrow&&i.$nextArrow.length&&(i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove()),i.$slides&&(i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each((function(){e(this).attr("style",e(this).data("originalStyling"))})),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.detach(),i.$list.detach(),i.$slider.append(i.$slides)),i.cleanUpRows(),i.$slider.removeClass("slick-slider"),i.$slider.removeClass("slick-initialized"),i.$slider.removeClass("slick-dotted"),i.unslicked=!0,t||i.$slider.trigger("destroy",[i])},t.prototype.disableTransition=function(e){var t=this,i={};i[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},t.prototype.fadeSlide=function(e,t){var i=this;!1===i.cssTransitions?(i.$slides.eq(e).css({zIndex:i.options.zIndex}),i.$slides.eq(e).animate({opacity:1},i.options.speed,i.options.easing,t)):(i.applyTransition(e),i.$slides.eq(e).css({opacity:1,zIndex:i.options.zIndex}),t&&setTimeout((function(){i.disableTransition(e),t.call()}),i.options.speed))},t.prototype.fadeSlideOut=function(e){var t=this;!1===t.cssTransitions?t.$slides.eq(e).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(e),t.$slides.eq(e).css({opacity:0,zIndex:t.options.zIndex-2}))},t.prototype.filterSlides=t.prototype.slickFilter=function(e){var t=this;null!==e&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(e).appendTo(t.$slideTrack),t.reinit())},t.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",(function(i){i.stopImmediatePropagation();var o=e(this);setTimeout((function(){t.options.pauseOnFocus&&(t.focussed=o.is(":focus"),t.autoPlay())}),0)}))},t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){return this.currentSlide},t.prototype.getDotCount=function(){var e=this,t=0,i=0,o=0;if(!0===e.options.infinite)if(e.slideCount<=e.options.slidesToShow)++o;else for(;t<e.slideCount;)++o,t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else if(!0===e.options.centerMode)o=e.slideCount;else if(e.options.asNavFor)for(;t<e.slideCount;)++o,t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else o=1+Math.ceil((e.slideCount-e.options.slidesToShow)/e.options.slidesToScroll);return o-1},t.prototype.getLeft=function(e){var t,i,o,s,n=this,r=0;return n.slideOffset=0,i=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=i*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&e+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(e>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(e-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(e-n.slideCount))*i*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*i*-1))):e+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(e+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(e+n.options.slidesToShow-n.slideCount)*i),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),t=!1===n.options.vertical?e*n.slideWidth*-1+n.slideOffset:e*i*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(e):n.$slideTrack.children(".slick-slide").eq(e+n.options.slidesToShow),t=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(e):n.$slideTrack.children(".slick-slide").eq(e+n.options.slidesToShow+1),t=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,t+=(n.$list.width()-o.outerWidth())/2)),t},t.prototype.getOption=t.prototype.slickGetOption=function(e){return this.options[e]},t.prototype.getNavigableIndexes=function(){var e,t=this,i=0,o=0,s=[];for(!1===t.options.infinite?e=t.slideCount:(i=-1*t.options.slidesToScroll,o=-1*t.options.slidesToScroll,e=2*t.slideCount);i<e;)s.push(i),i=o+t.options.slidesToScroll,o+=t.options.slidesToScroll<=t.options.slidesToShow?t.options.slidesToScroll:t.options.slidesToShow;return s},t.prototype.getSlick=function(){return this},t.prototype.getSlideCount=function(){var t,i,o=this;return i=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each((function(s,n){if(n.offsetLeft-i+e(n).outerWidth()/2>-1*o.swipeLeft)return t=n,!1})),Math.abs(e(t).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},t.prototype.goTo=t.prototype.slickGoTo=function(e,t){this.changeSlide({data:{message:"index",index:parseInt(e)}},t)},t.prototype.init=function(t){var i=this;e(i.$slider).hasClass("slick-initialized")||(e(i.$slider).addClass("slick-initialized"),i.buildRows(),i.buildOut(),i.setProps(),i.startLoad(),i.loadSlider(),i.initializeEvents(),i.updateArrows(),i.updateDots(),i.checkResponsive(!0),i.focusHandler()),t&&i.$slider.trigger("init",[i]),!0===i.options.accessibility&&i.initADA(),i.options.autoplay&&(i.paused=!1,i.autoPlay())},t.prototype.initADA=function(){var t=this,i=Math.ceil(t.slideCount/t.options.slidesToShow),o=t.getNavigableIndexes().filter((function(e){return e>=0&&e<t.slideCount}));t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each((function(i){var s=o.indexOf(i);e(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+i,tabindex:-1}),-1!==s&&e(this).attr({"aria-describedby":"slick-slide-control"+t.instanceUid+s})})),t.$dots.attr("role","tablist").find("li").each((function(s){var n=o[s];e(this).attr({role:"presentation"}),e(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+s,"aria-controls":"slick-slide"+t.instanceUid+n,"aria-label":s+1+" of "+i,"aria-selected":null,tabindex:"-1"})})).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=t.currentSlide,n=s+t.options.slidesToShow;s<n;s++)t.$slides.eq(s).attr("tabindex",0);t.activateADA()},t.prototype.initArrowEvents=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},e.changeSlide),e.$nextArrow.off("click.slick").on("click.slick",{message:"next"},e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow.on("keydown.slick",e.keyHandler),e.$nextArrow.on("keydown.slick",e.keyHandler)))},t.prototype.initDotEvents=function(){var t=this;!0===t.options.dots&&(e("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide),!0===t.options.accessibility&&t.$dots.on("keydown.slick",t.keyHandler)),!0===t.options.dots&&!0===t.options.pauseOnDotsHover&&e("li",t.$dots).on("mouseenter.slick",e.proxy(t.interrupt,t,!0)).on("mouseleave.slick",e.proxy(t.interrupt,t,!1))},t.prototype.initSlideEvents=function(){var t=this;t.options.pauseOnHover&&(t.$list.on("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.on("mouseleave.slick",e.proxy(t.interrupt,t,!1)))},t.prototype.initializeEvents=function(){var t=this;t.initArrowEvents(),t.initDotEvents(),t.initSlideEvents(),t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler),t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler),t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler),t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler),t.$list.on("click.slick",t.clickHandler),e(document).on(t.visibilityChange,e.proxy(t.visibility,t)),!0===t.options.accessibility&&t.$list.on("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),e(window).on("orientationchange.slick.slick-"+t.instanceUid,e.proxy(t.orientationChange,t)),e(window).on("resize.slick.slick-"+t.instanceUid,e.proxy(t.resize,t)),e("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault),e(window).on("load.slick.slick-"+t.instanceUid,t.setPosition),e(t.setPosition)},t.prototype.initUI=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.show(),e.$nextArrow.show()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.show()},t.prototype.keyHandler=function(e){var t=this;e.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===e.keyCode&&!0===t.options.accessibility?t.changeSlide({data:{message:!0===t.options.rtl?"next":"previous"}}):39===e.keyCode&&!0===t.options.accessibility&&t.changeSlide({data:{message:!0===t.options.rtl?"previous":"next"}}))},t.prototype.lazyLoad=function(){function t(t){e("img[data-lazy]",t).each((function(){var t=e(this),i=e(this).attr("data-lazy"),o=e(this).attr("data-srcset"),s=e(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){t.animate({opacity:0},100,(function(){o&&(t.attr("srcset",o),s&&t.attr("sizes",s)),t.attr("src",i).animate({opacity:1},200,(function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")})),n.$slider.trigger("lazyLoaded",[n,t,i])}))},r.onerror=function(){t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,t,i])},r.src=i}))}var i,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),i=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,a=s,l=n.$slider.find(".slick-slide"),d=0;d<n.options.slidesToScroll;d++)r<0&&(r=n.slideCount-1),i=(i=i.add(l.eq(r))).add(l.eq(a)),r--,a++;t(i),n.slideCount<=n.options.slidesToShow?t(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?t(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&t(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},t.prototype.loadSlider=function(){var e=this;e.setPosition(),e.$slideTrack.css({opacity:1}),e.$slider.removeClass("slick-loading"),e.initUI(),"progressive"===e.options.lazyLoad&&e.progressiveLazyLoad()},t.prototype.next=t.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},t.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},t.prototype.pause=t.prototype.slickPause=function(){this.autoPlayClear(),this.paused=!0},t.prototype.play=t.prototype.slickPlay=function(){var e=this;e.autoPlay(),e.options.autoplay=!0,e.paused=!1,e.focussed=!1,e.interrupted=!1},t.prototype.postSlide=function(t){var i=this;i.unslicked||(i.$slider.trigger("afterChange",[i,t]),i.animating=!1,i.slideCount>i.options.slidesToShow&&i.setPosition(),i.swipeLeft=null,i.options.autoplay&&i.autoPlay(),!0===i.options.accessibility&&(i.initADA(),i.options.focusOnChange&&e(i.$slides.get(i.currentSlide)).attr("tabindex",0).focus()))},t.prototype.prev=t.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},t.prototype.preventDefault=function(e){e.preventDefault()},t.prototype.progressiveLazyLoad=function(t){t=t||1;var i,o,s,n,r,a=this,l=e("img[data-lazy]",a.$slider);l.length?(i=l.first(),o=i.attr("data-lazy"),s=i.attr("data-srcset"),n=i.attr("data-sizes")||a.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(i.attr("srcset",s),n&&i.attr("sizes",n)),i.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===a.options.adaptiveHeight&&a.setPosition(),a.$slider.trigger("lazyLoaded",[a,i,o]),a.progressiveLazyLoad()},r.onerror=function(){t<3?setTimeout((function(){a.progressiveLazyLoad(t+1)}),500):(i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),a.$slider.trigger("lazyLoadError",[a,i,o]),a.progressiveLazyLoad())},r.src=o):a.$slider.trigger("allImagesLoaded",[a])},t.prototype.refresh=function(t){var i,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),i=s.currentSlide,s.destroy(!0),e.extend(s,s.initials,{currentSlide:i}),s.init(),t||s.changeSlide({data:{message:"index",index:i}},!1)},t.prototype.registerBreakpoints=function(){var t,i,o,s=this,n=s.options.responsive||null;if("array"===e.type(n)&&n.length){for(t in s.respondTo=s.options.respondTo||"window",n)if(o=s.breakpoints.length-1,n.hasOwnProperty(t)){for(i=n[t].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===i&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(i),s.breakpointSettings[i]=n[t].settings}s.breakpoints.sort((function(e,t){return s.options.mobileFirst?e-t:t-e}))}},t.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},t.prototype.resize=function(){var t=this;e(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout((function(){t.windowWidth=e(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()}),50))},t.prototype.removeSlide=t.prototype.slickRemove=function(e,t,i){var o=this;if(e="boolean"==typeof e?!0===(t=e)?0:o.slideCount-1:!0===t?--e:e,o.slideCount<1||e<0||e>o.slideCount-1)return!1;o.unload(),!0===i?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(e).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},t.prototype.setCSS=function(e){var t,i,o=this,s={};!0===o.options.rtl&&(e=-e),t="left"==o.positionProp?Math.ceil(e)+"px":"0px",i="top"==o.positionProp?Math.ceil(e)+"px":"0px",s[o.positionProp]=e,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+t+", "+i+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+t+", "+i+", 0px)",o.$slideTrack.css(s)))},t.prototype.setDimensions=function(){var e=this;!1===e.options.vertical?!0===e.options.centerMode&&e.$list.css({padding:"0px "+e.options.centerPadding}):(e.$list.height(e.$slides.first().outerHeight(!0)*e.options.slidesToShow),!0===e.options.centerMode&&e.$list.css({padding:e.options.centerPadding+" 0px"})),e.listWidth=e.$list.width(),e.listHeight=e.$list.height(),!1===e.options.vertical&&!1===e.options.variableWidth?(e.slideWidth=Math.ceil(e.listWidth/e.options.slidesToShow),e.$slideTrack.width(Math.ceil(e.slideWidth*e.$slideTrack.children(".slick-slide").length))):!0===e.options.variableWidth?e.$slideTrack.width(5e3*e.slideCount):(e.slideWidth=Math.ceil(e.listWidth),e.$slideTrack.height(Math.ceil(e.$slides.first().outerHeight(!0)*e.$slideTrack.children(".slick-slide").length)));var t=e.$slides.first().outerWidth(!0)-e.$slides.first().width();!1===e.options.variableWidth&&e.$slideTrack.children(".slick-slide").width(e.slideWidth-t)},t.prototype.setFade=function(){var t,i=this;i.$slides.each((function(o,s){t=i.slideWidth*o*-1,!0===i.options.rtl?e(s).css({position:"relative",right:t,top:0,zIndex:i.options.zIndex-2,opacity:0}):e(s).css({position:"relative",left:t,top:0,zIndex:i.options.zIndex-2,opacity:0})})),i.$slides.eq(i.currentSlide).css({zIndex:i.options.zIndex-1,opacity:1})},t.prototype.setHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.css("height",t)}},t.prototype.setOption=t.prototype.slickSetOption=function(){var t,i,o,s,n,r=this,a=!1;if("object"===e.type(arguments[0])?(o=arguments[0],a=arguments[1],n="multiple"):"string"===e.type(arguments[0])&&(o=arguments[0],s=arguments[1],a=arguments[2],"responsive"===arguments[0]&&"array"===e.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)e.each(o,(function(e,t){r.options[e]=t}));else if("responsive"===n)for(i in s)if("array"!==e.type(r.options.responsive))r.options.responsive=[s[i]];else{for(t=r.options.responsive.length-1;t>=0;)r.options.responsive[t].breakpoint===s[i].breakpoint&&r.options.responsive.splice(t,1),t--;r.options.responsive.push(s[i])}a&&(r.unload(),r.reinit())},t.prototype.setPosition=function(){var e=this;e.setDimensions(),e.setHeight(),!1===e.options.fade?e.setCSS(e.getLeft(e.currentSlide)):e.setFade(),e.$slider.trigger("setPosition",[e])},t.prototype.setProps=function(){var e=this,t=document.body.style;e.positionProp=!0===e.options.vertical?"top":"left","top"===e.positionProp?e.$slider.addClass("slick-vertical"):e.$slider.removeClass("slick-vertical"),void 0===t.WebkitTransition&&void 0===t.MozTransition&&void 0===t.msTransition||!0===e.options.useCSS&&(e.cssTransitions=!0),e.options.fade&&("number"==typeof e.options.zIndex?e.options.zIndex<3&&(e.options.zIndex=3):e.options.zIndex=e.defaults.zIndex),void 0!==t.OTransform&&(e.animType="OTransform",e.transformType="-o-transform",e.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.MozTransform&&(e.animType="MozTransform",e.transformType="-moz-transform",e.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(e.animType=!1)),void 0!==t.webkitTransform&&(e.animType="webkitTransform",e.transformType="-webkit-transform",e.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.msTransform&&(e.animType="msTransform",e.transformType="-ms-transform",e.transitionType="msTransition",void 0===t.msTransform&&(e.animType=!1)),void 0!==t.transform&&!1!==e.animType&&(e.animType="transform",e.transformType="transform",e.transitionType="transition"),e.transformsEnabled=e.options.useTransform&&null!==e.animType&&!1!==e.animType},t.prototype.setSlideClasses=function(e){var t,i,o,s,n=this;if(i=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(e).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;t=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(e>=t&&e<=n.slideCount-1-t?n.$slides.slice(e-t+r,e+t+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+e,i.slice(o-t+1+r,o+t+2).addClass("slick-active").attr("aria-hidden","false")),0===e?i.eq(i.length-1-n.options.slidesToShow).addClass("slick-center"):e===n.slideCount-1&&i.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(e).addClass("slick-center")}else e>=0&&e<=n.slideCount-n.options.slidesToShow?n.$slides.slice(e,e+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):i.length<=n.options.slidesToShow?i.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+e:e,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-e<n.options.slidesToShow?i.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):i.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},t.prototype.setupInfinite=function(){var t,i,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(i=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,t=s.slideCount;t>s.slideCount-o;t-=1)i=t-1,e(s.$slides[i]).clone(!0).attr("id","").attr("data-slick-index",i-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(t=0;t<o+s.slideCount;t+=1)i=t,e(s.$slides[i]).clone(!0).attr("id","").attr("data-slick-index",i+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each((function(){e(this).attr("id","")}))}},t.prototype.interrupt=function(e){e||this.autoPlay(),this.interrupted=e},t.prototype.selectHandler=function(t){var i=this,o=e(t.target).is(".slick-slide")?e(t.target):e(t.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),i.slideCount<=i.options.slidesToShow?i.slideHandler(s,!1,!0):i.slideHandler(s)},t.prototype.slideHandler=function(e,t,i){var o,s,n,r,a,l=null,d=this;if(t=t||!1,!(!0===d.animating&&!0===d.options.waitForAnimate||!0===d.options.fade&&d.currentSlide===e))if(!1===t&&d.asNavFor(e),o=e,l=d.getLeft(o),r=d.getLeft(d.currentSlide),d.currentLeft=null===d.swipeLeft?r:d.swipeLeft,!1===d.options.infinite&&!1===d.options.centerMode&&(e<0||e>d.getDotCount()*d.options.slidesToScroll))!1===d.options.fade&&(o=d.currentSlide,!0!==i?d.animateSlide(r,(function(){d.postSlide(o)})):d.postSlide(o));else if(!1===d.options.infinite&&!0===d.options.centerMode&&(e<0||e>d.slideCount-d.options.slidesToScroll))!1===d.options.fade&&(o=d.currentSlide,!0!==i?d.animateSlide(r,(function(){d.postSlide(o)})):d.postSlide(o));else{if(d.options.autoplay&&clearInterval(d.autoPlayTimer),s=o<0?d.slideCount%d.options.slidesToScroll!=0?d.slideCount-d.slideCount%d.options.slidesToScroll:d.slideCount+o:o>=d.slideCount?d.slideCount%d.options.slidesToScroll!=0?0:o-d.slideCount:o,d.animating=!0,d.$slider.trigger("beforeChange",[d,d.currentSlide,s]),n=d.currentSlide,d.currentSlide=s,d.setSlideClasses(d.currentSlide),d.options.asNavFor&&(a=(a=d.getNavTarget()).slick("getSlick")).slideCount<=a.options.slidesToShow&&a.setSlideClasses(d.currentSlide),d.updateDots(),d.updateArrows(),!0===d.options.fade)return!0!==i?(d.fadeSlideOut(n),d.fadeSlide(s,(function(){d.postSlide(s)}))):d.postSlide(s),void d.animateHeight();!0!==i?d.animateSlide(l,(function(){d.postSlide(s)})):d.postSlide(s)}},t.prototype.startLoad=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.hide(),e.$nextArrow.hide()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.hide(),e.$slider.addClass("slick-loading")},t.prototype.swipeDirection=function(){var e,t,i,o,s=this;return e=s.touchObject.startX-s.touchObject.curX,t=s.touchObject.startY-s.touchObject.curY,i=Math.atan2(t,e),(o=Math.round(180*i/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0||o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},t.prototype.swipeEnd=function(e){var t,i,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(i=o.swipeDirection()){case"left":case"down":t=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":t=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=i&&(o.slideHandler(t),o.touchObject={},o.$slider.trigger("swipe",[o,i]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},t.prototype.swipeHandler=function(e){var t=this;if(!(!1===t.options.swipe||"ontouchend"in document&&!1===t.options.swipe||!1===t.options.draggable&&-1!==e.type.indexOf("mouse")))switch(t.touchObject.fingerCount=e.originalEvent&&void 0!==e.originalEvent.touches?e.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),e.data.action){case"start":t.swipeStart(e);break;case"move":t.swipeMove(e);break;case"end":t.swipeEnd(e)}},t.prototype.swipeMove=function(e){var t,i,o,s,n,r,a=this;return n=void 0!==e.originalEvent?e.originalEvent.touches:null,!(!a.dragging||a.scrolling||n&&1!==n.length)&&(t=a.getLeft(a.currentSlide),a.touchObject.curX=void 0!==n?n[0].pageX:e.clientX,a.touchObject.curY=void 0!==n?n[0].pageY:e.clientY,a.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(a.touchObject.curX-a.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(a.touchObject.curY-a.touchObject.startY,2))),!a.options.verticalSwiping&&!a.swiping&&r>4?(a.scrolling=!0,!1):(!0===a.options.verticalSwiping&&(a.touchObject.swipeLength=r),i=a.swipeDirection(),void 0!==e.originalEvent&&a.touchObject.swipeLength>4&&(a.swiping=!0,e.preventDefault()),s=(!1===a.options.rtl?1:-1)*(a.touchObject.curX>a.touchObject.startX?1:-1),!0===a.options.verticalSwiping&&(s=a.touchObject.curY>a.touchObject.startY?1:-1),o=a.touchObject.swipeLength,a.touchObject.edgeHit=!1,!1===a.options.infinite&&(0===a.currentSlide&&"right"===i||a.currentSlide>=a.getDotCount()&&"left"===i)&&(o=a.touchObject.swipeLength*a.options.edgeFriction,a.touchObject.edgeHit=!0),!1===a.options.vertical?a.swipeLeft=t+o*s:a.swipeLeft=t+o*(a.$list.height()/a.listWidth)*s,!0===a.options.verticalSwiping&&(a.swipeLeft=t+o*s),!0!==a.options.fade&&!1!==a.options.touchMove&&(!0===a.animating?(a.swipeLeft=null,!1):void a.setCSS(a.swipeLeft))))},t.prototype.swipeStart=function(e){var t,i=this;if(i.interrupted=!0,1!==i.touchObject.fingerCount||i.slideCount<=i.options.slidesToShow)return i.touchObject={},!1;void 0!==e.originalEvent&&void 0!==e.originalEvent.touches&&(t=e.originalEvent.touches[0]),i.touchObject.startX=i.touchObject.curX=void 0!==t?t.pageX:e.clientX,i.touchObject.startY=i.touchObject.curY=void 0!==t?t.pageY:e.clientY,i.dragging=!0},t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var e=this;null!==e.$slidesCache&&(e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.appendTo(e.$slideTrack),e.reinit())},t.prototype.unload=function(){var t=this;e(".slick-cloned",t.$slider).remove(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove(),t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove(),t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},t.prototype.unslick=function(e){var t=this;t.$slider.trigger("unslick",[t,e]),t.destroy()},t.prototype.updateArrows=function(){var e=this;Math.floor(e.options.slidesToShow/2),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):(e.currentSlide>=e.slideCount-e.options.slidesToShow&&!1===e.options.centerMode||e.currentSlide>=e.slideCount-1&&!0===e.options.centerMode)&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},t.prototype.updateDots=function(){var e=this;null!==e.$dots&&(e.$dots.find("li").removeClass("slick-active").end(),e.$dots.find("li").eq(Math.floor(e.currentSlide/e.options.slidesToScroll)).addClass("slick-active"))},t.prototype.visibility=function(){var e=this;e.options.autoplay&&(document[e.hidden]?e.interrupted=!0:e.interrupted=!1)},e.fn.slick=function(){var e,i,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(e=0;e<r;e++)if("object"==typeof s||void 0===s?o[e].slick=new t(o[e],s):i=o[e].slick[s].apply(o[e].slick,n),void 0!==i)return i;return o}},void 0===(n=o.apply(t,s))||(e.exports=n)}()},217:function(){"use strict";var e;(e=jQuery)(document).ready((function(){var t,i,o,s,n,r;function a(t){FB.api("/me","get",{fields:"id,name,email,first_name,last_name",access_token:t},(function(i){var o=e("#giveasap_subscribe_form"),s=o.find("[name=sg_fb_access_token]");s.length?s.val(t):o.append('<input type="hidden" name="sg_fb_access_token" value="'+t+'"/>');var n={action:"sg_facebook_login",nonce:sg.nonce};o.find(":input").each((function(t){var i=e(this);n[i.attr("name")]=i.val(),"checkbox"===i.attr("type")&&(n[i.attr("name")]=i.prop("checked")?"1":"0")})),o.addClass("sg-loading"),e.ajax({url:sg.ajaxurl,data:n,method:"POST",success:function(e){e.success?window.location.href=e.data.redirect:alert(e.data.message)},error:function(e,t,i){o.removeClass("sg-loading"),alert(i)},complete:function(){o.removeClass("sg-loading")}})}))}0!==e(".sg-facebook-login-button").length&&(window.sgCheckFBLoginState=function(){FB.getLoginStatus((function(e){"connected"===e.status?a(e.authResponse.accessToken):FB.login((function(e){e.authResponse?a(FB.getAuthResponse().accessToken):console.log("User cancelled login or did not fully authorize.")}))}))},t=document,i="script",o="facebook-jssdk",n=window.sg_fb_locale||"en_US",r=t.getElementsByTagName(i)[0],t.getElementById(o)||((s=t.createElement(i)).id=o,s.src="https://connect.facebook.net/"+n+"/sdk.js",r.parentNode.insertBefore(s,r)),window.fbAsyncInit=function(){FB.init({appId:sg.fb_app_id,cookie:!0,xfbml:!0,version:"v3.3"})})}))},311:function(e){"use strict";e.exports=jQuery}},t={};function i(o){var s=t[o];if(void 0!==s)return s.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,i),n.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=i(238),t=i.n(e);i(217),i(340),function(e){function i(e,t){return((window.giveasap_completed_actions||{})[e]||[]).indexOf(t)>=0}if(e(document).on("click","[data-giveaway-popup]",(function(t){t.preventDefault();var i=e(this).attr("data-giveaway-popup"),o=e("#sg-giveaway-popup-"+i);o.length&&o.toggleClass("show")})),e(".sg-giveaway-prizes-slider .sg-giveaway-prize").length>1&&e(".sg-giveaway-prizes-slider").slick({infinite:!0,slidesToShow:1,slidesToScroll:1,arrows:!1,dots:!0}),e(document).on("click",".sg-extra-action-title, .sg-extra-action-close",(function(t){t.preventDefault();var i=e(this).parents(".sg-extra-action").find(".sg-extra-action-title"),o="true"===i.attr("aria-expanded");i.attr("aria-expanded",!o),e(this).parents(".sg-extra-action").toggleClass("expanded")})),e(document).on("submit",".sg-extra-action form",(function(t){var o=e(this),s=o,n=e(this).serialize(),r=!0,a="application/x-www-form-urlencoded",l={action:"sg_extra_action_complete",nonce:sg.nonce,data:n};return s.find("input[type=file]").length>0&&window.FormData&&((l=new FormData(s[0])).append("action","sg_extra_action_complete"),l.append("nonce",sg.nonce),l.append("data",n),r=!1,a=!1),s.addClass("sg-loading"),e.ajax({url:sg.ajaxurl,method:"POST",contentType:a,processData:r,data:l,success:function(t){if(t.success){var n=t.data.complete_mark||"",r=t.data.entries||!1,a=t.data.html||!1,l=t.data.actions_completed||!1;if(n){var d=s.parent().find(".sg-extra-action-title");d.find(".sg-extra-action-entries").remove(),d.append(n)}if(a&&s.find(".sg-extra-action-form-body").html(a),r){var c=s.parents(".giveasap-box");0===c.length&&(c=s.parents(".giveasap_box")),function(t,i){(i=i||!1)||(i=e(".giveasap-box")),i.find(".giveasap-entries strong").html(t)}(r,c)}var p=o.find("[name=instance]").val(),u=o.find("[name=giveaway_id]").val();(function(e,t){window.giveasap_completed_actions=window.giveasap_completed_actions||{},window.giveasap_completed_actions[e]=window.giveasap_completed_actions[e]||[],window.giveasap_completed_actions[e].indexOf(t)<0&&window.giveasap_completed_actions[e].push(parseInt(t))})(u,p),l&&s.parents(".giveasap_extra_actions").find(".sg-extra-action.sg-extra-action-locked").each((function(){var t,o,s=e(this);return t=l,!(!(o=s.attr("data-mandatory"))||parseInt(t)>=parseInt(o))||!function(e,t){var o=e.attr("data-mandatory_actions");if(!o)return!0;for(var s=o.split(","),n=!0,r=0;r<s.length;r++){var a=s[r];i(t,parseInt(a))||(n=!1)}return n}(s,u)||void s.removeClass("sg-extra-action-locked")})),o.find("button[name=sg_extra_action_submit]").remove()}else alert(t.data)},complete:function(){s.removeClass("sg-loading")}}),!1})),e(document).on("click",".sg_extra_action_button[data-check-action]",(function(t){var i=e(this),o=i.parents("form"),s=o.serialize(),n=i.attr("data-check-action");o.addClass("sg-loading"),e.ajax({url:sg.ajaxurl,data:{action:"sg_extra_action_check",nonce:sg.nonce,data:s,value:n},success:function(e){e.success?void 0!==e.data&&void 0!==e.data.redirect&&e.data.redirect?window.location.href=e.data.redirect:o.find("[name=sg_extra_action_submit]").removeAttr("disabled"):alert(e.data)},complete:function(){o.removeClass("sg-loading")}})})),e((function(){var t=e("#countdown"),i=e(".giveasap_countdown");if(e.countdown.defaultOptions.labels.indexOf("Years")>=0&&e.countdown.setDefaults({labels:[sg.text.countdown.labels.years,sg.text.countdown.labels.months,sg.text.countdown.labels.weeks,sg.text.countdown.labels.days,sg.text.countdown.labels.hours,sg.text.countdown.labels.minutes,sg.text.countdown.labels.seconds],labels1:[sg.text.countdown.labels1.year,sg.text.countdown.labels1.month,sg.text.countdown.labels1.week,sg.text.countdown.labels1.day,sg.text.countdown.labels1.hour,sg.text.countdown.labels1.minute,sg.text.countdown.labels1.second],compactLabels:[sg.text.countdown.compactLabels.y,sg.text.countdown.compactLabels.m,sg.text.countdown.compactLabels.w,sg.text.countdown.compactLabels.d]}),t.length){var o=t.attr("data-end");t.attr("data-timezone"),t.countdown({until:new Date(1e3*o),format:"dHMS"})}if(i.length&&i.each((function(){var t=e(this).attr("data-end");e(this).attr("data-timezone"),e(this).countdown({until:new Date(1e3*t),format:"dHMS"})})),e(".giveasap.template3 .giveasap_box.step-1").length>0){var s=e(".giveasap_aside").outerHeight(!0)+100;e(".giveasap_box").css("margin-bottom",s+"px")}})),e("#giveasap_show_rules").on("click",(function(){e(".giveasap_rules_extended").toggleClass("active")})),e("#giveasap_request_link").on("click",(function(t){e(this).parents("form").addClass("hidden"),e("#giveasap_request_link_form").removeClass("hidden")})),e(".sg-toggle").on("click",(function(t){t.preventDefault();var i=e(this),o=i.attr("data-target"),s=i.attr("data-class"),n=i.attr("data-text");if(e(o).toggleClass(s),n){var r=i.text();i.attr("data-text",r),i.html(n)}})),e(document).on("click",".sg-twitter-login-button a",(function(t){e("#giveasap_consent").length&&!e("#giveasap_consent").prop("checked")&&(t.preventDefault(),alert(sg.text.accept_terms||"Please accept terms and conditions"))})),e(document).on("click",".giveasap_sharing .sharing_method a",(function(t){var i=e(this).attr("href"),o=e(this).attr("data-popup");e(document.body).triggerHandler("giveasap_sharing_method_clicked",[e(this)]),void 0!==o&&"1"===o&&(t.preventDefault(),window.open(i,"popUpWindow","height=300,width=400,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes"))})),e(".giveasap_link").length&&t().isSupported()){var o=e(".giveasap_link input").val();e(".giveasap_link").append('<button data-clipboard-text="'+o+'" class="sg-btn-copy" type="button"><span class="fal fa-copy"></span><span class="sg-btn-copy-text">Copy</span></button>'),new(t())(".sg-btn-copy").on("success",(function(t){var i=e(".sg-btn-copy .fal");i.removeClass("fa-copy").addClass("fa-check"),setTimeout((function(){i.removeClass("fa-check").addClass("fa-copy")}),2e3)}))}}(jQuery)}()}(); 1 /******/ (function() { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ "./assets/js/clipboard.min.js": 5 /*!************************************!*\ 6 !*** ./assets/js/clipboard.min.js ***! 7 \************************************/ 8 /***/ (function(module) { 9 10 /*! 11 * clipboard.js v2.0.4 12 * https://zenorocha.github.io/clipboard.js 13 * 14 * Licensed MIT © Zeno Rocha 15 */ 16 !function (t, e) { 17 true ? module.exports = e() : 0; 18 }(this, function () { 19 return function (n) { 20 var o = {}; 21 22 function r(t) { 23 if (o[t]) return o[t].exports; 24 var e = o[t] = { 25 i: t, 26 l: !1, 27 exports: {} 28 }; 29 return n[t].call(e.exports, e, e.exports, r), e.l = !0, e.exports; 30 } 31 32 return r.m = n, r.c = o, r.d = function (t, e, n) { 33 r.o(t, e) || Object.defineProperty(t, e, { 34 enumerable: !0, 35 get: n 36 }); 37 }, r.r = function (t) { 38 "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { 39 value: "Module" 40 }), Object.defineProperty(t, "__esModule", { 41 value: !0 42 }); 43 }, r.t = function (e, t) { 44 if (1 & t && (e = r(e)), 8 & t) return e; 45 if (4 & t && "object" == typeof e && e && e.__esModule) return e; 46 var n = Object.create(null); 47 if (r.r(n), Object.defineProperty(n, "default", { 48 enumerable: !0, 49 value: e 50 }), 2 & t && "string" != typeof e) for (var o in e) r.d(n, o, function (t) { 51 return e[t]; 52 }.bind(null, o)); 53 return n; 54 }, r.n = function (t) { 55 var e = t && t.__esModule ? function () { 56 return t.default; 57 } : function () { 58 return t; 59 }; 60 return r.d(e, "a", e), e; 61 }, r.o = function (t, e) { 62 return Object.prototype.hasOwnProperty.call(t, e); 63 }, r.p = "", r(r.s = 0); 64 }([function (t, e, n) { 65 "use strict"; 66 67 var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { 68 return typeof t; 69 } : function (t) { 70 return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; 71 }, 72 i = function () { 73 function o(t, e) { 74 for (var n = 0; n < e.length; n++) { 75 var o = e[n]; 76 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); 77 } 78 } 79 80 return function (t, e, n) { 81 return e && o(t.prototype, e), n && o(t, n), t; 82 }; 83 }(), 84 a = o(n(1)), 85 c = o(n(3)), 86 u = o(n(4)); 87 88 function o(t) { 89 return t && t.__esModule ? t : { 90 default: t 91 }; 92 } 93 94 var l = function (t) { 95 function o(t, e) { 96 !function (t, e) { 97 if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); 98 }(this, o); 99 100 var n = function (t, e) { 101 if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 102 return !e || "object" != typeof e && "function" != typeof e ? t : e; 103 }(this, (o.__proto__ || Object.getPrototypeOf(o)).call(this)); 104 105 return n.resolveOptions(e), n.listenClick(t), n; 106 } 107 108 return function (t, e) { 109 if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e); 110 t.prototype = Object.create(e && e.prototype, { 111 constructor: { 112 value: t, 113 enumerable: !1, 114 writable: !0, 115 configurable: !0 116 } 117 }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e); 118 }(o, c.default), i(o, [{ 119 key: "resolveOptions", 120 value: function () { 121 var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; 122 this.action = "function" == typeof t.action ? t.action : this.defaultAction, this.target = "function" == typeof t.target ? t.target : this.defaultTarget, this.text = "function" == typeof t.text ? t.text : this.defaultText, this.container = "object" === r(t.container) ? t.container : document.body; 123 } 124 }, { 125 key: "listenClick", 126 value: function (t) { 127 var e = this; 128 this.listener = (0, u.default)(t, "click", function (t) { 129 return e.onClick(t); 130 }); 131 } 132 }, { 133 key: "onClick", 134 value: function (t) { 135 var e = t.delegateTarget || t.currentTarget; 136 this.clipboardAction && (this.clipboardAction = null), this.clipboardAction = new a.default({ 137 action: this.action(e), 138 target: this.target(e), 139 text: this.text(e), 140 container: this.container, 141 trigger: e, 142 emitter: this 143 }); 144 } 145 }, { 146 key: "defaultAction", 147 value: function (t) { 148 return s("action", t); 149 } 150 }, { 151 key: "defaultTarget", 152 value: function (t) { 153 var e = s("target", t); 154 if (e) return document.querySelector(e); 155 } 156 }, { 157 key: "defaultText", 158 value: function (t) { 159 return s("text", t); 160 } 161 }, { 162 key: "destroy", 163 value: function () { 164 this.listener.destroy(), this.clipboardAction && (this.clipboardAction.destroy(), this.clipboardAction = null); 165 } 166 }], [{ 167 key: "isSupported", 168 value: function () { 169 var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"], 170 e = "string" == typeof t ? [t] : t, 171 n = !!document.queryCommandSupported; 172 return e.forEach(function (t) { 173 n = n && !!document.queryCommandSupported(t); 174 }), n; 175 } 176 }]), o; 177 }(); 178 179 function s(t, e) { 180 var n = "data-clipboard-" + t; 181 if (e.hasAttribute(n)) return e.getAttribute(n); 182 } 183 184 t.exports = l; 185 }, function (t, e, n) { 186 "use strict"; 187 188 var o, 189 r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { 190 return typeof t; 191 } : function (t) { 192 return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; 193 }, 194 i = function () { 195 function o(t, e) { 196 for (var n = 0; n < e.length; n++) { 197 var o = e[n]; 198 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); 199 } 200 } 201 202 return function (t, e, n) { 203 return e && o(t.prototype, e), n && o(t, n), t; 204 }; 205 }(), 206 a = n(2), 207 c = (o = a) && o.__esModule ? o : { 208 default: o 209 }; 210 211 var u = function () { 212 function e(t) { 213 !function (t, e) { 214 if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); 215 }(this, e), this.resolveOptions(t), this.initSelection(); 216 } 217 218 return i(e, [{ 219 key: "resolveOptions", 220 value: function () { 221 var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; 222 this.action = t.action, this.container = t.container, this.emitter = t.emitter, this.target = t.target, this.text = t.text, this.trigger = t.trigger, this.selectedText = ""; 223 } 224 }, { 225 key: "initSelection", 226 value: function () { 227 this.text ? this.selectFake() : this.target && this.selectTarget(); 228 } 229 }, { 230 key: "selectFake", 231 value: function () { 232 var t = this, 233 e = "rtl" == document.documentElement.getAttribute("dir"); 234 this.removeFake(), this.fakeHandlerCallback = function () { 235 return t.removeFake(); 236 }, this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0, this.fakeElem = document.createElement("textarea"), this.fakeElem.style.fontSize = "12pt", this.fakeElem.style.border = "0", this.fakeElem.style.padding = "0", this.fakeElem.style.margin = "0", this.fakeElem.style.position = "absolute", this.fakeElem.style[e ? "right" : "left"] = "-9999px"; 237 var n = window.pageYOffset || document.documentElement.scrollTop; 238 this.fakeElem.style.top = n + "px", this.fakeElem.setAttribute("readonly", ""), this.fakeElem.value = this.text, this.container.appendChild(this.fakeElem), this.selectedText = (0, c.default)(this.fakeElem), this.copyText(); 239 } 240 }, { 241 key: "removeFake", 242 value: function () { 243 this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback), this.fakeHandler = null, this.fakeHandlerCallback = null), this.fakeElem && (this.container.removeChild(this.fakeElem), this.fakeElem = null); 244 } 245 }, { 246 key: "selectTarget", 247 value: function () { 248 this.selectedText = (0, c.default)(this.target), this.copyText(); 249 } 250 }, { 251 key: "copyText", 252 value: function () { 253 var e = void 0; 254 255 try { 256 e = document.execCommand(this.action); 257 } catch (t) { 258 e = !1; 259 } 260 261 this.handleResult(e); 262 } 263 }, { 264 key: "handleResult", 265 value: function (t) { 266 this.emitter.emit(t ? "success" : "error", { 267 action: this.action, 268 text: this.selectedText, 269 trigger: this.trigger, 270 clearSelection: this.clearSelection.bind(this) 271 }); 272 } 273 }, { 274 key: "clearSelection", 275 value: function () { 276 this.trigger && this.trigger.focus(), window.getSelection().removeAllRanges(); 277 } 278 }, { 279 key: "destroy", 280 value: function () { 281 this.removeFake(); 282 } 283 }, { 284 key: "action", 285 set: function () { 286 var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "copy"; 287 if (this._action = t, "copy" !== this._action && "cut" !== this._action) throw new Error('Invalid "action" value, use either "copy" or "cut"'); 288 }, 289 get: function () { 290 return this._action; 291 } 292 }, { 293 key: "target", 294 set: function (t) { 295 if (void 0 !== t) { 296 if (!t || "object" !== (void 0 === t ? "undefined" : r(t)) || 1 !== t.nodeType) throw new Error('Invalid "target" value, use a valid Element'); 297 if ("copy" === this.action && t.hasAttribute("disabled")) throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); 298 if ("cut" === this.action && (t.hasAttribute("readonly") || t.hasAttribute("disabled"))) throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); 299 this._target = t; 300 } 301 }, 302 get: function () { 303 return this._target; 304 } 305 }]), e; 306 }(); 307 308 t.exports = u; 309 }, function (t, e) { 310 t.exports = function (t) { 311 var e; 312 if ("SELECT" === t.nodeName) t.focus(), e = t.value;else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) { 313 var n = t.hasAttribute("readonly"); 314 n || t.setAttribute("readonly", ""), t.select(), t.setSelectionRange(0, t.value.length), n || t.removeAttribute("readonly"), e = t.value; 315 } else { 316 t.hasAttribute("contenteditable") && t.focus(); 317 var o = window.getSelection(), 318 r = document.createRange(); 319 r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), e = o.toString(); 320 } 321 return e; 322 }; 323 }, function (t, e) { 324 function n() {} 325 326 n.prototype = { 327 on: function (t, e, n) { 328 var o = this.e || (this.e = {}); 329 return (o[t] || (o[t] = [])).push({ 330 fn: e, 331 ctx: n 332 }), this; 333 }, 334 once: function (t, e, n) { 335 var o = this; 336 337 function r() { 338 o.off(t, r), e.apply(n, arguments); 339 } 340 341 return r._ = e, this.on(t, r, n); 342 }, 343 emit: function (t) { 344 for (var e = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[t] || []).slice(), o = 0, r = n.length; o < r; o++) n[o].fn.apply(n[o].ctx, e); 345 346 return this; 347 }, 348 off: function (t, e) { 349 var n = this.e || (this.e = {}), 350 o = n[t], 351 r = []; 352 if (o && e) for (var i = 0, a = o.length; i < a; i++) o[i].fn !== e && o[i].fn._ !== e && r.push(o[i]); 353 return r.length ? n[t] = r : delete n[t], this; 354 } 355 }, t.exports = n; 356 }, function (t, e, n) { 357 var d = n(5), 358 h = n(6); 359 360 t.exports = function (t, e, n) { 361 if (!t && !e && !n) throw new Error("Missing required arguments"); 362 if (!d.string(e)) throw new TypeError("Second argument must be a String"); 363 if (!d.fn(n)) throw new TypeError("Third argument must be a Function"); 364 if (d.node(t)) return s = e, f = n, (l = t).addEventListener(s, f), { 365 destroy: function () { 366 l.removeEventListener(s, f); 367 } 368 }; 369 if (d.nodeList(t)) return a = t, c = e, u = n, Array.prototype.forEach.call(a, function (t) { 370 t.addEventListener(c, u); 371 }), { 372 destroy: function () { 373 Array.prototype.forEach.call(a, function (t) { 374 t.removeEventListener(c, u); 375 }); 376 } 377 }; 378 if (d.string(t)) return o = t, r = e, i = n, h(document.body, o, r, i); 379 throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList"); 380 var o, r, i, a, c, u, l, s, f; 381 }; 382 }, function (t, n) { 383 n.node = function (t) { 384 return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType; 385 }, n.nodeList = function (t) { 386 var e = Object.prototype.toString.call(t); 387 return void 0 !== t && ("[object NodeList]" === e || "[object HTMLCollection]" === e) && "length" in t && (0 === t.length || n.node(t[0])); 388 }, n.string = function (t) { 389 return "string" == typeof t || t instanceof String; 390 }, n.fn = function (t) { 391 return "[object Function]" === Object.prototype.toString.call(t); 392 }; 393 }, function (t, e, n) { 394 var a = n(7); 395 396 function i(t, e, n, o, r) { 397 var i = function (e, n, t, o) { 398 return function (t) { 399 t.delegateTarget = a(t.target, n), t.delegateTarget && o.call(e, t); 400 }; 401 }.apply(this, arguments); 402 403 return t.addEventListener(n, i, r), { 404 destroy: function () { 405 t.removeEventListener(n, i, r); 406 } 407 }; 408 } 409 410 t.exports = function (t, e, n, o, r) { 411 return "function" == typeof t.addEventListener ? i.apply(null, arguments) : "function" == typeof n ? i.bind(null, document).apply(null, arguments) : ("string" == typeof t && (t = document.querySelectorAll(t)), Array.prototype.map.call(t, function (t) { 412 return i(t, e, n, o, r); 413 })); 414 }; 415 }, function (t, e) { 416 if ("undefined" != typeof Element && !Element.prototype.matches) { 417 var n = Element.prototype; 418 n.matches = n.matchesSelector || n.mozMatchesSelector || n.msMatchesSelector || n.oMatchesSelector || n.webkitMatchesSelector; 419 } 420 421 t.exports = function (t, e) { 422 for (; t && 9 !== t.nodeType;) { 423 if ("function" == typeof t.matches && t.matches(e)) return t; 424 t = t.parentNode; 425 } 426 }; 427 }]); 428 }); 429 430 /***/ }), 431 432 /***/ "./assets/js/slick.min.js": 433 /*!********************************!*\ 434 !*** ./assets/js/slick.min.js ***! 435 \********************************/ 436 /***/ (function(module, exports, __webpack_require__) { 437 438 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function (i) { 439 "use strict"; 440 441 true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "jquery")], __WEBPACK_AMD_DEFINE_FACTORY__ = (i), 442 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 443 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 444 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0; 445 }(function (i) { 446 "use strict"; 447 448 var e = window.Slick || {}; 449 (e = function () { 450 var e = 0; 451 return function (t, o) { 452 var s, 453 n = this; 454 n.defaults = { 455 accessibility: !0, 456 adaptiveHeight: !1, 457 appendArrows: i(t), 458 appendDots: i(t), 459 arrows: !0, 460 asNavFor: null, 461 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 462 nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 463 autoplay: !1, 464 autoplaySpeed: 3e3, 465 centerMode: !1, 466 centerPadding: "50px", 467 cssEase: "ease", 468 customPaging: function (e, t) { 469 return i('<button type="button" />').text(t + 1); 470 }, 471 dots: !1, 472 dotsClass: "slick-dots", 473 draggable: !0, 474 easing: "linear", 475 edgeFriction: .35, 476 fade: !1, 477 focusOnSelect: !1, 478 focusOnChange: !1, 479 infinite: !0, 480 initialSlide: 0, 481 lazyLoad: "ondemand", 482 mobileFirst: !1, 483 pauseOnHover: !0, 484 pauseOnFocus: !0, 485 pauseOnDotsHover: !1, 486 respondTo: "window", 487 responsive: null, 488 rows: 1, 489 rtl: !1, 490 slide: "", 491 slidesPerRow: 1, 492 slidesToShow: 1, 493 slidesToScroll: 1, 494 speed: 500, 495 swipe: !0, 496 swipeToSlide: !1, 497 touchMove: !0, 498 touchThreshold: 5, 499 useCSS: !0, 500 useTransform: !0, 501 variableWidth: !1, 502 vertical: !1, 503 verticalSwiping: !1, 504 waitForAnimate: !0, 505 zIndex: 1e3 506 }, n.initials = { 507 animating: !1, 508 dragging: !1, 509 autoPlayTimer: null, 510 currentDirection: 0, 511 currentLeft: null, 512 currentSlide: 0, 513 direction: 1, 514 $dots: null, 515 listWidth: null, 516 listHeight: null, 517 loadIndex: 0, 518 $nextArrow: null, 519 $prevArrow: null, 520 scrolling: !1, 521 slideCount: null, 522 slideWidth: null, 523 $slideTrack: null, 524 $slides: null, 525 sliding: !1, 526 slideOffset: 0, 527 swipeLeft: null, 528 swiping: !1, 529 $list: null, 530 touchObject: {}, 531 transformsEnabled: !1, 532 unslicked: !1 533 }, i.extend(n, n.initials), n.activeBreakpoint = null, n.animType = null, n.animProp = null, n.breakpoints = [], n.breakpointSettings = [], n.cssTransitions = !1, n.focussed = !1, n.interrupted = !1, n.hidden = "hidden", n.paused = !0, n.positionProp = null, n.respondTo = null, n.rowCount = 1, n.shouldClick = !0, n.$slider = i(t), n.$slidesCache = null, n.transformType = null, n.transitionType = null, n.visibilityChange = "visibilitychange", n.windowWidth = 0, n.windowTimer = null, s = i(t).data("slick") || {}, n.options = i.extend({}, n.defaults, o, s), n.currentSlide = n.options.initialSlide, n.originalSettings = n.options, void 0 !== document.mozHidden ? (n.hidden = "mozHidden", n.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (n.hidden = "webkitHidden", n.visibilityChange = "webkitvisibilitychange"), n.autoPlay = i.proxy(n.autoPlay, n), n.autoPlayClear = i.proxy(n.autoPlayClear, n), n.autoPlayIterator = i.proxy(n.autoPlayIterator, n), n.changeSlide = i.proxy(n.changeSlide, n), n.clickHandler = i.proxy(n.clickHandler, n), n.selectHandler = i.proxy(n.selectHandler, n), n.setPosition = i.proxy(n.setPosition, n), n.swipeHandler = i.proxy(n.swipeHandler, n), n.dragHandler = i.proxy(n.dragHandler, n), n.keyHandler = i.proxy(n.keyHandler, n), n.instanceUid = e++, n.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, n.registerBreakpoints(), n.init(!0); 534 }; 535 }()).prototype.activateADA = function () { 536 this.$slideTrack.find(".slick-active").attr({ 537 "aria-hidden": "false" 538 }).find("a, input, button, select").attr({ 539 tabindex: "0" 540 }); 541 }, e.prototype.addSlide = e.prototype.slickAdd = function (e, t, o) { 542 var s = this; 543 if ("boolean" == typeof t) o = t, t = null;else if (t < 0 || t >= s.slideCount) return !1; 544 s.unload(), "number" == typeof t ? 0 === t && 0 === s.$slides.length ? i(e).appendTo(s.$slideTrack) : o ? i(e).insertBefore(s.$slides.eq(t)) : i(e).insertAfter(s.$slides.eq(t)) : !0 === o ? i(e).prependTo(s.$slideTrack) : i(e).appendTo(s.$slideTrack), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slides.each(function (e, t) { 545 i(t).attr("data-slick-index", e); 546 }), s.$slidesCache = s.$slides, s.reinit(); 547 }, e.prototype.animateHeight = function () { 548 var i = this; 549 550 if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { 551 var e = i.$slides.eq(i.currentSlide).outerHeight(!0); 552 i.$list.animate({ 553 height: e 554 }, i.options.speed); 555 } 556 }, e.prototype.animateSlide = function (e, t) { 557 var o = {}, 558 s = this; 559 s.animateHeight(), !0 === s.options.rtl && !1 === s.options.vertical && (e = -e), !1 === s.transformsEnabled ? !1 === s.options.vertical ? s.$slideTrack.animate({ 560 left: e 561 }, s.options.speed, s.options.easing, t) : s.$slideTrack.animate({ 562 top: e 563 }, s.options.speed, s.options.easing, t) : !1 === s.cssTransitions ? (!0 === s.options.rtl && (s.currentLeft = -s.currentLeft), i({ 564 animStart: s.currentLeft 565 }).animate({ 566 animStart: e 567 }, { 568 duration: s.options.speed, 569 easing: s.options.easing, 570 step: function (i) { 571 i = Math.ceil(i), !1 === s.options.vertical ? (o[s.animType] = "translate(" + i + "px, 0px)", s.$slideTrack.css(o)) : (o[s.animType] = "translate(0px," + i + "px)", s.$slideTrack.css(o)); 572 }, 573 complete: function () { 574 t && t.call(); 575 } 576 })) : (s.applyTransition(), e = Math.ceil(e), !1 === s.options.vertical ? o[s.animType] = "translate3d(" + e + "px, 0px, 0px)" : o[s.animType] = "translate3d(0px," + e + "px, 0px)", s.$slideTrack.css(o), t && setTimeout(function () { 577 s.disableTransition(), t.call(); 578 }, s.options.speed)); 579 }, e.prototype.getNavTarget = function () { 580 var e = this, 581 t = e.options.asNavFor; 582 return t && null !== t && (t = i(t).not(e.$slider)), t; 583 }, e.prototype.asNavFor = function (e) { 584 var t = this.getNavTarget(); 585 null !== t && "object" == typeof t && t.each(function () { 586 var t = i(this).slick("getSlick"); 587 t.unslicked || t.slideHandler(e, !0); 588 }); 589 }, e.prototype.applyTransition = function (i) { 590 var e = this, 591 t = {}; 592 !1 === e.options.fade ? t[e.transitionType] = e.transformType + " " + e.options.speed + "ms " + e.options.cssEase : t[e.transitionType] = "opacity " + e.options.speed + "ms " + e.options.cssEase, !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t); 593 }, e.prototype.autoPlay = function () { 594 var i = this; 595 i.autoPlayClear(), i.slideCount > i.options.slidesToShow && (i.autoPlayTimer = setInterval(i.autoPlayIterator, i.options.autoplaySpeed)); 596 }, e.prototype.autoPlayClear = function () { 597 var i = this; 598 i.autoPlayTimer && clearInterval(i.autoPlayTimer); 599 }, e.prototype.autoPlayIterator = function () { 600 var i = this, 601 e = i.currentSlide + i.options.slidesToScroll; 602 i.paused || i.interrupted || i.focussed || (!1 === i.options.infinite && (1 === i.direction && i.currentSlide + 1 === i.slideCount - 1 ? i.direction = 0 : 0 === i.direction && (e = i.currentSlide - i.options.slidesToScroll, i.currentSlide - 1 == 0 && (i.direction = 1))), i.slideHandler(e)); 603 }, e.prototype.buildArrows = function () { 604 var e = this; 605 !0 === e.options.arrows && (e.$prevArrow = i(e.options.prevArrow).addClass("slick-arrow"), e.$nextArrow = i(e.options.nextArrow).addClass("slick-arrow"), e.slideCount > e.options.slidesToShow ? (e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.prependTo(e.options.appendArrows), e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.appendTo(e.options.appendArrows), !0 !== e.options.infinite && e.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({ 606 "aria-disabled": "true", 607 tabindex: "-1" 608 })); 609 }, e.prototype.buildDots = function () { 610 var e, 611 t, 612 o = this; 613 614 if (!0 === o.options.dots) { 615 for (o.$slider.addClass("slick-dotted"), t = i("<ul />").addClass(o.options.dotsClass), e = 0; e <= o.getDotCount(); e += 1) t.append(i("<li />").append(o.options.customPaging.call(this, o, e))); 616 617 o.$dots = t.appendTo(o.options.appendDots), o.$dots.find("li").first().addClass("slick-active"); 618 } 619 }, e.prototype.buildOut = function () { 620 var e = this; 621 e.$slides = e.$slider.children(e.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), e.slideCount = e.$slides.length, e.$slides.each(function (e, t) { 622 i(t).attr("data-slick-index", e).data("originalStyling", i(t).attr("style") || ""); 623 }), e.$slider.addClass("slick-slider"), e.$slideTrack = 0 === e.slideCount ? i('<div class="slick-track"/>').appendTo(e.$slider) : e.$slides.wrapAll('<div class="slick-track"/>').parent(), e.$list = e.$slideTrack.wrap('<div class="slick-list"/>').parent(), e.$slideTrack.css("opacity", 0), !0 !== e.options.centerMode && !0 !== e.options.swipeToSlide || (e.options.slidesToScroll = 1), i("img[data-lazy]", e.$slider).not("[src]").addClass("slick-loading"), e.setupInfinite(), e.buildArrows(), e.buildDots(), e.updateDots(), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), !0 === e.options.draggable && e.$list.addClass("draggable"); 624 }, e.prototype.buildRows = function () { 625 var i, 626 e, 627 t, 628 o, 629 s, 630 n, 631 r, 632 l = this; 633 634 if (o = document.createDocumentFragment(), n = l.$slider.children(), l.options.rows > 1) { 635 for (r = l.options.slidesPerRow * l.options.rows, s = Math.ceil(n.length / r), i = 0; i < s; i++) { 636 var d = document.createElement("div"); 637 638 for (e = 0; e < l.options.rows; e++) { 639 var a = document.createElement("div"); 640 641 for (t = 0; t < l.options.slidesPerRow; t++) { 642 var c = i * r + (e * l.options.slidesPerRow + t); 643 n.get(c) && a.appendChild(n.get(c)); 644 } 645 646 d.appendChild(a); 647 } 648 649 o.appendChild(d); 650 } 651 652 l.$slider.empty().append(o), l.$slider.children().children().children().css({ 653 width: 100 / l.options.slidesPerRow + "%", 654 display: "inline-block" 655 }); 656 } 657 }, e.prototype.checkResponsive = function (e, t) { 658 var o, 659 s, 660 n, 661 r = this, 662 l = !1, 663 d = r.$slider.width(), 664 a = window.innerWidth || i(window).width(); 665 666 if ("window" === r.respondTo ? n = a : "slider" === r.respondTo ? n = d : "min" === r.respondTo && (n = Math.min(a, d)), r.options.responsive && r.options.responsive.length && null !== r.options.responsive) { 667 s = null; 668 669 for (o in r.breakpoints) r.breakpoints.hasOwnProperty(o) && (!1 === r.originalSettings.mobileFirst ? n < r.breakpoints[o] && (s = r.breakpoints[o]) : n > r.breakpoints[o] && (s = r.breakpoints[o])); 670 671 null !== s ? null !== r.activeBreakpoint ? (s !== r.activeBreakpoint || t) && (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = i.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e)), l = s) : (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = i.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e)), l = s) : null !== r.activeBreakpoint && (r.activeBreakpoint = null, r.options = r.originalSettings, !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e), l = s), e || !1 === l || r.$slider.trigger("breakpoint", [r, l]); 672 } 673 }, e.prototype.changeSlide = function (e, t) { 674 var o, 675 s, 676 n, 677 r = this, 678 l = i(e.currentTarget); 679 680 switch (l.is("a") && e.preventDefault(), l.is("li") || (l = l.closest("li")), n = r.slideCount % r.options.slidesToScroll != 0, o = n ? 0 : (r.slideCount - r.currentSlide) % r.options.slidesToScroll, e.data.message) { 681 case "previous": 682 s = 0 === o ? r.options.slidesToScroll : r.options.slidesToShow - o, r.slideCount > r.options.slidesToShow && r.slideHandler(r.currentSlide - s, !1, t); 683 break; 684 685 case "next": 686 s = 0 === o ? r.options.slidesToScroll : o, r.slideCount > r.options.slidesToShow && r.slideHandler(r.currentSlide + s, !1, t); 687 break; 688 689 case "index": 690 var d = 0 === e.data.index ? 0 : e.data.index || l.index() * r.options.slidesToScroll; 691 r.slideHandler(r.checkNavigable(d), !1, t), l.children().trigger("focus"); 692 break; 693 694 default: 695 return; 696 } 697 }, e.prototype.checkNavigable = function (i) { 698 var e, t; 699 if (e = this.getNavigableIndexes(), t = 0, i > e[e.length - 1]) i = e[e.length - 1];else for (var o in e) { 700 if (i < e[o]) { 701 i = t; 702 break; 703 } 704 705 t = e[o]; 706 } 707 return i; 708 }, e.prototype.cleanUpEvents = function () { 709 var e = this; 710 e.options.dots && null !== e.$dots && (i("li", e.$dots).off("click.slick", e.changeSlide).off("mouseenter.slick", i.proxy(e.interrupt, e, !0)).off("mouseleave.slick", i.proxy(e.interrupt, e, !1)), !0 === e.options.accessibility && e.$dots.off("keydown.slick", e.keyHandler)), e.$slider.off("focus.slick blur.slick"), !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow && e.$prevArrow.off("click.slick", e.changeSlide), e.$nextArrow && e.$nextArrow.off("click.slick", e.changeSlide), !0 === e.options.accessibility && (e.$prevArrow && e.$prevArrow.off("keydown.slick", e.keyHandler), e.$nextArrow && e.$nextArrow.off("keydown.slick", e.keyHandler))), e.$list.off("touchstart.slick mousedown.slick", e.swipeHandler), e.$list.off("touchmove.slick mousemove.slick", e.swipeHandler), e.$list.off("touchend.slick mouseup.slick", e.swipeHandler), e.$list.off("touchcancel.slick mouseleave.slick", e.swipeHandler), e.$list.off("click.slick", e.clickHandler), i(document).off(e.visibilityChange, e.visibility), e.cleanUpSlideEvents(), !0 === e.options.accessibility && e.$list.off("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().off("click.slick", e.selectHandler), i(window).off("orientationchange.slick.slick-" + e.instanceUid, e.orientationChange), i(window).off("resize.slick.slick-" + e.instanceUid, e.resize), i("[draggable!=true]", e.$slideTrack).off("dragstart", e.preventDefault), i(window).off("load.slick.slick-" + e.instanceUid, e.setPosition); 711 }, e.prototype.cleanUpSlideEvents = function () { 712 var e = this; 713 e.$list.off("mouseenter.slick", i.proxy(e.interrupt, e, !0)), e.$list.off("mouseleave.slick", i.proxy(e.interrupt, e, !1)); 714 }, e.prototype.cleanUpRows = function () { 715 var i, 716 e = this; 717 e.options.rows > 1 && ((i = e.$slides.children().children()).removeAttr("style"), e.$slider.empty().append(i)); 718 }, e.prototype.clickHandler = function (i) { 719 !1 === this.shouldClick && (i.stopImmediatePropagation(), i.stopPropagation(), i.preventDefault()); 720 }, e.prototype.destroy = function (e) { 721 var t = this; 722 t.autoPlayClear(), t.touchObject = {}, t.cleanUpEvents(), i(".slick-cloned", t.$slider).detach(), t.$dots && t.$dots.remove(), t.$prevArrow && t.$prevArrow.length && (t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.remove()), t.$nextArrow && t.$nextArrow.length && (t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.remove()), t.$slides && (t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function () { 723 i(this).attr("style", i(this).data("originalStyling")); 724 }), t.$slideTrack.children(this.options.slide).detach(), t.$slideTrack.detach(), t.$list.detach(), t.$slider.append(t.$slides)), t.cleanUpRows(), t.$slider.removeClass("slick-slider"), t.$slider.removeClass("slick-initialized"), t.$slider.removeClass("slick-dotted"), t.unslicked = !0, e || t.$slider.trigger("destroy", [t]); 725 }, e.prototype.disableTransition = function (i) { 726 var e = this, 727 t = {}; 728 t[e.transitionType] = "", !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t); 729 }, e.prototype.fadeSlide = function (i, e) { 730 var t = this; 731 !1 === t.cssTransitions ? (t.$slides.eq(i).css({ 732 zIndex: t.options.zIndex 733 }), t.$slides.eq(i).animate({ 734 opacity: 1 735 }, t.options.speed, t.options.easing, e)) : (t.applyTransition(i), t.$slides.eq(i).css({ 736 opacity: 1, 737 zIndex: t.options.zIndex 738 }), e && setTimeout(function () { 739 t.disableTransition(i), e.call(); 740 }, t.options.speed)); 741 }, e.prototype.fadeSlideOut = function (i) { 742 var e = this; 743 !1 === e.cssTransitions ? e.$slides.eq(i).animate({ 744 opacity: 0, 745 zIndex: e.options.zIndex - 2 746 }, e.options.speed, e.options.easing) : (e.applyTransition(i), e.$slides.eq(i).css({ 747 opacity: 0, 748 zIndex: e.options.zIndex - 2 749 })); 750 }, e.prototype.filterSlides = e.prototype.slickFilter = function (i) { 751 var e = this; 752 null !== i && (e.$slidesCache = e.$slides, e.unload(), e.$slideTrack.children(this.options.slide).detach(), e.$slidesCache.filter(i).appendTo(e.$slideTrack), e.reinit()); 753 }, e.prototype.focusHandler = function () { 754 var e = this; 755 e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*", function (t) { 756 t.stopImmediatePropagation(); 757 var o = i(this); 758 setTimeout(function () { 759 e.options.pauseOnFocus && (e.focussed = o.is(":focus"), e.autoPlay()); 760 }, 0); 761 }); 762 }, e.prototype.getCurrent = e.prototype.slickCurrentSlide = function () { 763 return this.currentSlide; 764 }, e.prototype.getDotCount = function () { 765 var i = this, 766 e = 0, 767 t = 0, 768 o = 0; 769 if (!0 === i.options.infinite) { 770 if (i.slideCount <= i.options.slidesToShow) ++o;else for (; e < i.slideCount;) ++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow; 771 } else if (!0 === i.options.centerMode) o = i.slideCount;else if (i.options.asNavFor) for (; e < i.slideCount;) ++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow;else o = 1 + Math.ceil((i.slideCount - i.options.slidesToShow) / i.options.slidesToScroll); 772 return o - 1; 773 }, e.prototype.getLeft = function (i) { 774 var e, 775 t, 776 o, 777 s, 778 n = this, 779 r = 0; 780 return n.slideOffset = 0, t = n.$slides.first().outerHeight(!0), !0 === n.options.infinite ? (n.slideCount > n.options.slidesToShow && (n.slideOffset = n.slideWidth * n.options.slidesToShow * -1, s = -1, !0 === n.options.vertical && !0 === n.options.centerMode && (2 === n.options.slidesToShow ? s = -1.5 : 1 === n.options.slidesToShow && (s = -2)), r = t * n.options.slidesToShow * s), n.slideCount % n.options.slidesToScroll != 0 && i + n.options.slidesToScroll > n.slideCount && n.slideCount > n.options.slidesToShow && (i > n.slideCount ? (n.slideOffset = (n.options.slidesToShow - (i - n.slideCount)) * n.slideWidth * -1, r = (n.options.slidesToShow - (i - n.slideCount)) * t * -1) : (n.slideOffset = n.slideCount % n.options.slidesToScroll * n.slideWidth * -1, r = n.slideCount % n.options.slidesToScroll * t * -1))) : i + n.options.slidesToShow > n.slideCount && (n.slideOffset = (i + n.options.slidesToShow - n.slideCount) * n.slideWidth, r = (i + n.options.slidesToShow - n.slideCount) * t), n.slideCount <= n.options.slidesToShow && (n.slideOffset = 0, r = 0), !0 === n.options.centerMode && n.slideCount <= n.options.slidesToShow ? n.slideOffset = n.slideWidth * Math.floor(n.options.slidesToShow) / 2 - n.slideWidth * n.slideCount / 2 : !0 === n.options.centerMode && !0 === n.options.infinite ? n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2) - n.slideWidth : !0 === n.options.centerMode && (n.slideOffset = 0, n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2)), e = !1 === n.options.vertical ? i * n.slideWidth * -1 + n.slideOffset : i * t * -1 + r, !0 === n.options.variableWidth && (o = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(i) : n.$slideTrack.children(".slick-slide").eq(i + n.options.slidesToShow), e = !0 === n.options.rtl ? o[0] ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, !0 === n.options.centerMode && (o = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(i) : n.$slideTrack.children(".slick-slide").eq(i + n.options.slidesToShow + 1), e = !0 === n.options.rtl ? o[0] ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, e += (n.$list.width() - o.outerWidth()) / 2)), e; 781 }, e.prototype.getOption = e.prototype.slickGetOption = function (i) { 782 return this.options[i]; 783 }, e.prototype.getNavigableIndexes = function () { 784 var i, 785 e = this, 786 t = 0, 787 o = 0, 788 s = []; 789 790 for (!1 === e.options.infinite ? i = e.slideCount : (t = -1 * e.options.slidesToScroll, o = -1 * e.options.slidesToScroll, i = 2 * e.slideCount); t < i;) s.push(t), t = o + e.options.slidesToScroll, o += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; 791 792 return s; 793 }, e.prototype.getSlick = function () { 794 return this; 795 }, e.prototype.getSlideCount = function () { 796 var e, 797 t, 798 o = this; 799 return t = !0 === o.options.centerMode ? o.slideWidth * Math.floor(o.options.slidesToShow / 2) : 0, !0 === o.options.swipeToSlide ? (o.$slideTrack.find(".slick-slide").each(function (s, n) { 800 if (n.offsetLeft - t + i(n).outerWidth() / 2 > -1 * o.swipeLeft) return e = n, !1; 801 }), Math.abs(i(e).attr("data-slick-index") - o.currentSlide) || 1) : o.options.slidesToScroll; 802 }, e.prototype.goTo = e.prototype.slickGoTo = function (i, e) { 803 this.changeSlide({ 804 data: { 805 message: "index", 806 index: parseInt(i) 807 } 808 }, e); 809 }, e.prototype.init = function (e) { 810 var t = this; 811 i(t.$slider).hasClass("slick-initialized") || (i(t.$slider).addClass("slick-initialized"), t.buildRows(), t.buildOut(), t.setProps(), t.startLoad(), t.loadSlider(), t.initializeEvents(), t.updateArrows(), t.updateDots(), t.checkResponsive(!0), t.focusHandler()), e && t.$slider.trigger("init", [t]), !0 === t.options.accessibility && t.initADA(), t.options.autoplay && (t.paused = !1, t.autoPlay()); 812 }, e.prototype.initADA = function () { 813 var e = this, 814 t = Math.ceil(e.slideCount / e.options.slidesToShow), 815 o = e.getNavigableIndexes().filter(function (i) { 816 return i >= 0 && i < e.slideCount; 817 }); 818 e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({ 819 "aria-hidden": "true", 820 tabindex: "-1" 821 }).find("a, input, button, select").attr({ 822 tabindex: "-1" 823 }), null !== e.$dots && (e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function (t) { 824 var s = o.indexOf(t); 825 i(this).attr({ 826 role: "tabpanel", 827 id: "slick-slide" + e.instanceUid + t, 828 tabindex: -1 829 }), -1 !== s && i(this).attr({ 830 "aria-describedby": "slick-slide-control" + e.instanceUid + s 831 }); 832 }), e.$dots.attr("role", "tablist").find("li").each(function (s) { 833 var n = o[s]; 834 i(this).attr({ 835 role: "presentation" 836 }), i(this).find("button").first().attr({ 837 role: "tab", 838 id: "slick-slide-control" + e.instanceUid + s, 839 "aria-controls": "slick-slide" + e.instanceUid + n, 840 "aria-label": s + 1 + " of " + t, 841 "aria-selected": null, 842 tabindex: "-1" 843 }); 844 }).eq(e.currentSlide).find("button").attr({ 845 "aria-selected": "true", 846 tabindex: "0" 847 }).end()); 848 849 for (var s = e.currentSlide, n = s + e.options.slidesToShow; s < n; s++) e.$slides.eq(s).attr("tabindex", 0); 850 851 e.activateADA(); 852 }, e.prototype.initArrowEvents = function () { 853 var i = this; 854 !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.off("click.slick").on("click.slick", { 855 message: "previous" 856 }, i.changeSlide), i.$nextArrow.off("click.slick").on("click.slick", { 857 message: "next" 858 }, i.changeSlide), !0 === i.options.accessibility && (i.$prevArrow.on("keydown.slick", i.keyHandler), i.$nextArrow.on("keydown.slick", i.keyHandler))); 859 }, e.prototype.initDotEvents = function () { 860 var e = this; 861 !0 === e.options.dots && (i("li", e.$dots).on("click.slick", { 862 message: "index" 863 }, e.changeSlide), !0 === e.options.accessibility && e.$dots.on("keydown.slick", e.keyHandler)), !0 === e.options.dots && !0 === e.options.pauseOnDotsHover && i("li", e.$dots).on("mouseenter.slick", i.proxy(e.interrupt, e, !0)).on("mouseleave.slick", i.proxy(e.interrupt, e, !1)); 864 }, e.prototype.initSlideEvents = function () { 865 var e = this; 866 e.options.pauseOnHover && (e.$list.on("mouseenter.slick", i.proxy(e.interrupt, e, !0)), e.$list.on("mouseleave.slick", i.proxy(e.interrupt, e, !1))); 867 }, e.prototype.initializeEvents = function () { 868 var e = this; 869 e.initArrowEvents(), e.initDotEvents(), e.initSlideEvents(), e.$list.on("touchstart.slick mousedown.slick", { 870 action: "start" 871 }, e.swipeHandler), e.$list.on("touchmove.slick mousemove.slick", { 872 action: "move" 873 }, e.swipeHandler), e.$list.on("touchend.slick mouseup.slick", { 874 action: "end" 875 }, e.swipeHandler), e.$list.on("touchcancel.slick mouseleave.slick", { 876 action: "end" 877 }, e.swipeHandler), e.$list.on("click.slick", e.clickHandler), i(document).on(e.visibilityChange, i.proxy(e.visibility, e)), !0 === e.options.accessibility && e.$list.on("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), i(window).on("orientationchange.slick.slick-" + e.instanceUid, i.proxy(e.orientationChange, e)), i(window).on("resize.slick.slick-" + e.instanceUid, i.proxy(e.resize, e)), i("[draggable!=true]", e.$slideTrack).on("dragstart", e.preventDefault), i(window).on("load.slick.slick-" + e.instanceUid, e.setPosition), i(e.setPosition); 878 }, e.prototype.initUI = function () { 879 var i = this; 880 !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.show(), i.$nextArrow.show()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.show(); 881 }, e.prototype.keyHandler = function (i) { 882 var e = this; 883 i.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === i.keyCode && !0 === e.options.accessibility ? e.changeSlide({ 884 data: { 885 message: !0 === e.options.rtl ? "next" : "previous" 886 } 887 }) : 39 === i.keyCode && !0 === e.options.accessibility && e.changeSlide({ 888 data: { 889 message: !0 === e.options.rtl ? "previous" : "next" 890 } 891 })); 892 }, e.prototype.lazyLoad = function () { 893 function e(e) { 894 i("img[data-lazy]", e).each(function () { 895 var e = i(this), 896 t = i(this).attr("data-lazy"), 897 o = i(this).attr("data-srcset"), 898 s = i(this).attr("data-sizes") || n.$slider.attr("data-sizes"), 899 r = document.createElement("img"); 900 r.onload = function () { 901 e.animate({ 902 opacity: 0 903 }, 100, function () { 904 o && (e.attr("srcset", o), s && e.attr("sizes", s)), e.attr("src", t).animate({ 905 opacity: 1 906 }, 200, function () { 907 e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"); 908 }), n.$slider.trigger("lazyLoaded", [n, e, t]); 909 }); 910 }, r.onerror = function () { 911 e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), n.$slider.trigger("lazyLoadError", [n, e, t]); 912 }, r.src = t; 913 }); 914 } 915 916 var t, 917 o, 918 s, 919 n = this; 920 if (!0 === n.options.centerMode ? !0 === n.options.infinite ? s = (o = n.currentSlide + (n.options.slidesToShow / 2 + 1)) + n.options.slidesToShow + 2 : (o = Math.max(0, n.currentSlide - (n.options.slidesToShow / 2 + 1)), s = n.options.slidesToShow / 2 + 1 + 2 + n.currentSlide) : (o = n.options.infinite ? n.options.slidesToShow + n.currentSlide : n.currentSlide, s = Math.ceil(o + n.options.slidesToShow), !0 === n.options.fade && (o > 0 && o--, s <= n.slideCount && s++)), t = n.$slider.find(".slick-slide").slice(o, s), "anticipated" === n.options.lazyLoad) for (var r = o - 1, l = s, d = n.$slider.find(".slick-slide"), a = 0; a < n.options.slidesToScroll; a++) r < 0 && (r = n.slideCount - 1), t = (t = t.add(d.eq(r))).add(d.eq(l)), r--, l++; 921 e(t), n.slideCount <= n.options.slidesToShow ? e(n.$slider.find(".slick-slide")) : n.currentSlide >= n.slideCount - n.options.slidesToShow ? e(n.$slider.find(".slick-cloned").slice(0, n.options.slidesToShow)) : 0 === n.currentSlide && e(n.$slider.find(".slick-cloned").slice(-1 * n.options.slidesToShow)); 922 }, e.prototype.loadSlider = function () { 923 var i = this; 924 i.setPosition(), i.$slideTrack.css({ 925 opacity: 1 926 }), i.$slider.removeClass("slick-loading"), i.initUI(), "progressive" === i.options.lazyLoad && i.progressiveLazyLoad(); 927 }, e.prototype.next = e.prototype.slickNext = function () { 928 this.changeSlide({ 929 data: { 930 message: "next" 931 } 932 }); 933 }, e.prototype.orientationChange = function () { 934 var i = this; 935 i.checkResponsive(), i.setPosition(); 936 }, e.prototype.pause = e.prototype.slickPause = function () { 937 var i = this; 938 i.autoPlayClear(), i.paused = !0; 939 }, e.prototype.play = e.prototype.slickPlay = function () { 940 var i = this; 941 i.autoPlay(), i.options.autoplay = !0, i.paused = !1, i.focussed = !1, i.interrupted = !1; 942 }, e.prototype.postSlide = function (e) { 943 var t = this; 944 t.unslicked || (t.$slider.trigger("afterChange", [t, e]), t.animating = !1, t.slideCount > t.options.slidesToShow && t.setPosition(), t.swipeLeft = null, t.options.autoplay && t.autoPlay(), !0 === t.options.accessibility && (t.initADA(), t.options.focusOnChange && i(t.$slides.get(t.currentSlide)).attr("tabindex", 0).focus())); 945 }, e.prototype.prev = e.prototype.slickPrev = function () { 946 this.changeSlide({ 947 data: { 948 message: "previous" 949 } 950 }); 951 }, e.prototype.preventDefault = function (i) { 952 i.preventDefault(); 953 }, e.prototype.progressiveLazyLoad = function (e) { 954 e = e || 1; 955 var t, 956 o, 957 s, 958 n, 959 r, 960 l = this, 961 d = i("img[data-lazy]", l.$slider); 962 d.length ? (t = d.first(), o = t.attr("data-lazy"), s = t.attr("data-srcset"), n = t.attr("data-sizes") || l.$slider.attr("data-sizes"), (r = document.createElement("img")).onload = function () { 963 s && (t.attr("srcset", s), n && t.attr("sizes", n)), t.attr("src", o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"), !0 === l.options.adaptiveHeight && l.setPosition(), l.$slider.trigger("lazyLoaded", [l, t, o]), l.progressiveLazyLoad(); 964 }, r.onerror = function () { 965 e < 3 ? setTimeout(function () { 966 l.progressiveLazyLoad(e + 1); 967 }, 500) : (t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), l.$slider.trigger("lazyLoadError", [l, t, o]), l.progressiveLazyLoad()); 968 }, r.src = o) : l.$slider.trigger("allImagesLoaded", [l]); 969 }, e.prototype.refresh = function (e) { 970 var t, 971 o, 972 s = this; 973 o = s.slideCount - s.options.slidesToShow, !s.options.infinite && s.currentSlide > o && (s.currentSlide = o), s.slideCount <= s.options.slidesToShow && (s.currentSlide = 0), t = s.currentSlide, s.destroy(!0), i.extend(s, s.initials, { 974 currentSlide: t 975 }), s.init(), e || s.changeSlide({ 976 data: { 977 message: "index", 978 index: t 979 } 980 }, !1); 981 }, e.prototype.registerBreakpoints = function () { 982 var e, 983 t, 984 o, 985 s = this, 986 n = s.options.responsive || null; 987 988 if ("array" === i.type(n) && n.length) { 989 s.respondTo = s.options.respondTo || "window"; 990 991 for (e in n) if (o = s.breakpoints.length - 1, n.hasOwnProperty(e)) { 992 for (t = n[e].breakpoint; o >= 0;) s.breakpoints[o] && s.breakpoints[o] === t && s.breakpoints.splice(o, 1), o--; 993 994 s.breakpoints.push(t), s.breakpointSettings[t] = n[e].settings; 995 } 996 997 s.breakpoints.sort(function (i, e) { 998 return s.options.mobileFirst ? i - e : e - i; 999 }); 1000 } 1001 }, e.prototype.reinit = function () { 1002 var e = this; 1003 e.$slides = e.$slideTrack.children(e.options.slide).addClass("slick-slide"), e.slideCount = e.$slides.length, e.currentSlide >= e.slideCount && 0 !== e.currentSlide && (e.currentSlide = e.currentSlide - e.options.slidesToScroll), e.slideCount <= e.options.slidesToShow && (e.currentSlide = 0), e.registerBreakpoints(), e.setProps(), e.setupInfinite(), e.buildArrows(), e.updateArrows(), e.initArrowEvents(), e.buildDots(), e.updateDots(), e.initDotEvents(), e.cleanUpSlideEvents(), e.initSlideEvents(), e.checkResponsive(!1, !0), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), e.setPosition(), e.focusHandler(), e.paused = !e.options.autoplay, e.autoPlay(), e.$slider.trigger("reInit", [e]); 1004 }, e.prototype.resize = function () { 1005 var e = this; 1006 i(window).width() !== e.windowWidth && (clearTimeout(e.windowDelay), e.windowDelay = window.setTimeout(function () { 1007 e.windowWidth = i(window).width(), e.checkResponsive(), e.unslicked || e.setPosition(); 1008 }, 50)); 1009 }, e.prototype.removeSlide = e.prototype.slickRemove = function (i, e, t) { 1010 var o = this; 1011 if (i = "boolean" == typeof i ? !0 === (e = i) ? 0 : o.slideCount - 1 : !0 === e ? --i : i, o.slideCount < 1 || i < 0 || i > o.slideCount - 1) return !1; 1012 o.unload(), !0 === t ? o.$slideTrack.children().remove() : o.$slideTrack.children(this.options.slide).eq(i).remove(), o.$slides = o.$slideTrack.children(this.options.slide), o.$slideTrack.children(this.options.slide).detach(), o.$slideTrack.append(o.$slides), o.$slidesCache = o.$slides, o.reinit(); 1013 }, e.prototype.setCSS = function (i) { 1014 var e, 1015 t, 1016 o = this, 1017 s = {}; 1018 !0 === o.options.rtl && (i = -i), e = "left" == o.positionProp ? Math.ceil(i) + "px" : "0px", t = "top" == o.positionProp ? Math.ceil(i) + "px" : "0px", s[o.positionProp] = i, !1 === o.transformsEnabled ? o.$slideTrack.css(s) : (s = {}, !1 === o.cssTransitions ? (s[o.animType] = "translate(" + e + ", " + t + ")", o.$slideTrack.css(s)) : (s[o.animType] = "translate3d(" + e + ", " + t + ", 0px)", o.$slideTrack.css(s))); 1019 }, e.prototype.setDimensions = function () { 1020 var i = this; 1021 !1 === i.options.vertical ? !0 === i.options.centerMode && i.$list.css({ 1022 padding: "0px " + i.options.centerPadding 1023 }) : (i.$list.height(i.$slides.first().outerHeight(!0) * i.options.slidesToShow), !0 === i.options.centerMode && i.$list.css({ 1024 padding: i.options.centerPadding + " 0px" 1025 })), i.listWidth = i.$list.width(), i.listHeight = i.$list.height(), !1 === i.options.vertical && !1 === i.options.variableWidth ? (i.slideWidth = Math.ceil(i.listWidth / i.options.slidesToShow), i.$slideTrack.width(Math.ceil(i.slideWidth * i.$slideTrack.children(".slick-slide").length))) : !0 === i.options.variableWidth ? i.$slideTrack.width(5e3 * i.slideCount) : (i.slideWidth = Math.ceil(i.listWidth), i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0) * i.$slideTrack.children(".slick-slide").length))); 1026 var e = i.$slides.first().outerWidth(!0) - i.$slides.first().width(); 1027 !1 === i.options.variableWidth && i.$slideTrack.children(".slick-slide").width(i.slideWidth - e); 1028 }, e.prototype.setFade = function () { 1029 var e, 1030 t = this; 1031 t.$slides.each(function (o, s) { 1032 e = t.slideWidth * o * -1, !0 === t.options.rtl ? i(s).css({ 1033 position: "relative", 1034 right: e, 1035 top: 0, 1036 zIndex: t.options.zIndex - 2, 1037 opacity: 0 1038 }) : i(s).css({ 1039 position: "relative", 1040 left: e, 1041 top: 0, 1042 zIndex: t.options.zIndex - 2, 1043 opacity: 0 1044 }); 1045 }), t.$slides.eq(t.currentSlide).css({ 1046 zIndex: t.options.zIndex - 1, 1047 opacity: 1 1048 }); 1049 }, e.prototype.setHeight = function () { 1050 var i = this; 1051 1052 if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { 1053 var e = i.$slides.eq(i.currentSlide).outerHeight(!0); 1054 i.$list.css("height", e); 1055 } 1056 }, e.prototype.setOption = e.prototype.slickSetOption = function () { 1057 var e, 1058 t, 1059 o, 1060 s, 1061 n, 1062 r = this, 1063 l = !1; 1064 if ("object" === i.type(arguments[0]) ? (o = arguments[0], l = arguments[1], n = "multiple") : "string" === i.type(arguments[0]) && (o = arguments[0], s = arguments[1], l = arguments[2], "responsive" === arguments[0] && "array" === i.type(arguments[1]) ? n = "responsive" : void 0 !== arguments[1] && (n = "single")), "single" === n) r.options[o] = s;else if ("multiple" === n) i.each(o, function (i, e) { 1065 r.options[i] = e; 1066 });else if ("responsive" === n) for (t in s) if ("array" !== i.type(r.options.responsive)) r.options.responsive = [s[t]];else { 1067 for (e = r.options.responsive.length - 1; e >= 0;) r.options.responsive[e].breakpoint === s[t].breakpoint && r.options.responsive.splice(e, 1), e--; 1068 1069 r.options.responsive.push(s[t]); 1070 } 1071 l && (r.unload(), r.reinit()); 1072 }, e.prototype.setPosition = function () { 1073 var i = this; 1074 i.setDimensions(), i.setHeight(), !1 === i.options.fade ? i.setCSS(i.getLeft(i.currentSlide)) : i.setFade(), i.$slider.trigger("setPosition", [i]); 1075 }, e.prototype.setProps = function () { 1076 var i = this, 1077 e = document.body.style; 1078 i.positionProp = !0 === i.options.vertical ? "top" : "left", "top" === i.positionProp ? i.$slider.addClass("slick-vertical") : i.$slider.removeClass("slick-vertical"), void 0 === e.WebkitTransition && void 0 === e.MozTransition && void 0 === e.msTransition || !0 === i.options.useCSS && (i.cssTransitions = !0), i.options.fade && ("number" == typeof i.options.zIndex ? i.options.zIndex < 3 && (i.options.zIndex = 3) : i.options.zIndex = i.defaults.zIndex), void 0 !== e.OTransform && (i.animType = "OTransform", i.transformType = "-o-transform", i.transitionType = "OTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.MozTransform && (i.animType = "MozTransform", i.transformType = "-moz-transform", i.transitionType = "MozTransition", void 0 === e.perspectiveProperty && void 0 === e.MozPerspective && (i.animType = !1)), void 0 !== e.webkitTransform && (i.animType = "webkitTransform", i.transformType = "-webkit-transform", i.transitionType = "webkitTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.msTransform && (i.animType = "msTransform", i.transformType = "-ms-transform", i.transitionType = "msTransition", void 0 === e.msTransform && (i.animType = !1)), void 0 !== e.transform && !1 !== i.animType && (i.animType = "transform", i.transformType = "transform", i.transitionType = "transition"), i.transformsEnabled = i.options.useTransform && null !== i.animType && !1 !== i.animType; 1079 }, e.prototype.setSlideClasses = function (i) { 1080 var e, 1081 t, 1082 o, 1083 s, 1084 n = this; 1085 1086 if (t = n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), n.$slides.eq(i).addClass("slick-current"), !0 === n.options.centerMode) { 1087 var r = n.options.slidesToShow % 2 == 0 ? 1 : 0; 1088 e = Math.floor(n.options.slidesToShow / 2), !0 === n.options.infinite && (i >= e && i <= n.slideCount - 1 - e ? n.$slides.slice(i - e + r, i + e + 1).addClass("slick-active").attr("aria-hidden", "false") : (o = n.options.slidesToShow + i, t.slice(o - e + 1 + r, o + e + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === i ? t.eq(t.length - 1 - n.options.slidesToShow).addClass("slick-center") : i === n.slideCount - 1 && t.eq(n.options.slidesToShow).addClass("slick-center")), n.$slides.eq(i).addClass("slick-center"); 1089 } else i >= 0 && i <= n.slideCount - n.options.slidesToShow ? n.$slides.slice(i, i + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : t.length <= n.options.slidesToShow ? t.addClass("slick-active").attr("aria-hidden", "false") : (s = n.slideCount % n.options.slidesToShow, o = !0 === n.options.infinite ? n.options.slidesToShow + i : i, n.options.slidesToShow == n.options.slidesToScroll && n.slideCount - i < n.options.slidesToShow ? t.slice(o - (n.options.slidesToShow - s), o + s).addClass("slick-active").attr("aria-hidden", "false") : t.slice(o, o + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")); 1090 1091 "ondemand" !== n.options.lazyLoad && "anticipated" !== n.options.lazyLoad || n.lazyLoad(); 1092 }, e.prototype.setupInfinite = function () { 1093 var e, 1094 t, 1095 o, 1096 s = this; 1097 1098 if (!0 === s.options.fade && (s.options.centerMode = !1), !0 === s.options.infinite && !1 === s.options.fade && (t = null, s.slideCount > s.options.slidesToShow)) { 1099 for (o = !0 === s.options.centerMode ? s.options.slidesToShow + 1 : s.options.slidesToShow, e = s.slideCount; e > s.slideCount - o; e -= 1) t = e - 1, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t - s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned"); 1100 1101 for (e = 0; e < o + s.slideCount; e += 1) t = e, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t + s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned"); 1102 1103 s.$slideTrack.find(".slick-cloned").find("[id]").each(function () { 1104 i(this).attr("id", ""); 1105 }); 1106 } 1107 }, e.prototype.interrupt = function (i) { 1108 var e = this; 1109 i || e.autoPlay(), e.interrupted = i; 1110 }, e.prototype.selectHandler = function (e) { 1111 var t = this, 1112 o = i(e.target).is(".slick-slide") ? i(e.target) : i(e.target).parents(".slick-slide"), 1113 s = parseInt(o.attr("data-slick-index")); 1114 s || (s = 0), t.slideCount <= t.options.slidesToShow ? t.slideHandler(s, !1, !0) : t.slideHandler(s); 1115 }, e.prototype.slideHandler = function (i, e, t) { 1116 var o, 1117 s, 1118 n, 1119 r, 1120 l, 1121 d = null, 1122 a = this; 1123 if (e = e || !1, !(!0 === a.animating && !0 === a.options.waitForAnimate || !0 === a.options.fade && a.currentSlide === i)) if (!1 === e && a.asNavFor(i), o = i, d = a.getLeft(o), r = a.getLeft(a.currentSlide), a.currentLeft = null === a.swipeLeft ? r : a.swipeLeft, !1 === a.options.infinite && !1 === a.options.centerMode && (i < 0 || i > a.getDotCount() * a.options.slidesToScroll)) !1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(r, function () { 1124 a.postSlide(o); 1125 }) : a.postSlide(o));else if (!1 === a.options.infinite && !0 === a.options.centerMode && (i < 0 || i > a.slideCount - a.options.slidesToScroll)) !1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(r, function () { 1126 a.postSlide(o); 1127 }) : a.postSlide(o));else { 1128 if (a.options.autoplay && clearInterval(a.autoPlayTimer), s = o < 0 ? a.slideCount % a.options.slidesToScroll != 0 ? a.slideCount - a.slideCount % a.options.slidesToScroll : a.slideCount + o : o >= a.slideCount ? a.slideCount % a.options.slidesToScroll != 0 ? 0 : o - a.slideCount : o, a.animating = !0, a.$slider.trigger("beforeChange", [a, a.currentSlide, s]), n = a.currentSlide, a.currentSlide = s, a.setSlideClasses(a.currentSlide), a.options.asNavFor && (l = (l = a.getNavTarget()).slick("getSlick")).slideCount <= l.options.slidesToShow && l.setSlideClasses(a.currentSlide), a.updateDots(), a.updateArrows(), !0 === a.options.fade) return !0 !== t ? (a.fadeSlideOut(n), a.fadeSlide(s, function () { 1129 a.postSlide(s); 1130 })) : a.postSlide(s), void a.animateHeight(); 1131 !0 !== t ? a.animateSlide(d, function () { 1132 a.postSlide(s); 1133 }) : a.postSlide(s); 1134 } 1135 }, e.prototype.startLoad = function () { 1136 var i = this; 1137 !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.hide(), i.$nextArrow.hide()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.hide(), i.$slider.addClass("slick-loading"); 1138 }, e.prototype.swipeDirection = function () { 1139 var i, 1140 e, 1141 t, 1142 o, 1143 s = this; 1144 return i = s.touchObject.startX - s.touchObject.curX, e = s.touchObject.startY - s.touchObject.curY, t = Math.atan2(e, i), (o = Math.round(180 * t / Math.PI)) < 0 && (o = 360 - Math.abs(o)), o <= 45 && o >= 0 ? !1 === s.options.rtl ? "left" : "right" : o <= 360 && o >= 315 ? !1 === s.options.rtl ? "left" : "right" : o >= 135 && o <= 225 ? !1 === s.options.rtl ? "right" : "left" : !0 === s.options.verticalSwiping ? o >= 35 && o <= 135 ? "down" : "up" : "vertical"; 1145 }, e.prototype.swipeEnd = function (i) { 1146 var e, 1147 t, 1148 o = this; 1149 if (o.dragging = !1, o.swiping = !1, o.scrolling) return o.scrolling = !1, !1; 1150 if (o.interrupted = !1, o.shouldClick = !(o.touchObject.swipeLength > 10), void 0 === o.touchObject.curX) return !1; 1151 1152 if (!0 === o.touchObject.edgeHit && o.$slider.trigger("edge", [o, o.swipeDirection()]), o.touchObject.swipeLength >= o.touchObject.minSwipe) { 1153 switch (t = o.swipeDirection()) { 1154 case "left": 1155 case "down": 1156 e = o.options.swipeToSlide ? o.checkNavigable(o.currentSlide + o.getSlideCount()) : o.currentSlide + o.getSlideCount(), o.currentDirection = 0; 1157 break; 1158 1159 case "right": 1160 case "up": 1161 e = o.options.swipeToSlide ? o.checkNavigable(o.currentSlide - o.getSlideCount()) : o.currentSlide - o.getSlideCount(), o.currentDirection = 1; 1162 } 1163 1164 "vertical" != t && (o.slideHandler(e), o.touchObject = {}, o.$slider.trigger("swipe", [o, t])); 1165 } else o.touchObject.startX !== o.touchObject.curX && (o.slideHandler(o.currentSlide), o.touchObject = {}); 1166 }, e.prototype.swipeHandler = function (i) { 1167 var e = this; 1168 if (!(!1 === e.options.swipe || "ontouchend" in document && !1 === e.options.swipe || !1 === e.options.draggable && -1 !== i.type.indexOf("mouse"))) switch (e.touchObject.fingerCount = i.originalEvent && void 0 !== i.originalEvent.touches ? i.originalEvent.touches.length : 1, e.touchObject.minSwipe = e.listWidth / e.options.touchThreshold, !0 === e.options.verticalSwiping && (e.touchObject.minSwipe = e.listHeight / e.options.touchThreshold), i.data.action) { 1169 case "start": 1170 e.swipeStart(i); 1171 break; 1172 1173 case "move": 1174 e.swipeMove(i); 1175 break; 1176 1177 case "end": 1178 e.swipeEnd(i); 1179 } 1180 }, e.prototype.swipeMove = function (i) { 1181 var e, 1182 t, 1183 o, 1184 s, 1185 n, 1186 r, 1187 l = this; 1188 return n = void 0 !== i.originalEvent ? i.originalEvent.touches : null, !(!l.dragging || l.scrolling || n && 1 !== n.length) && (e = l.getLeft(l.currentSlide), l.touchObject.curX = void 0 !== n ? n[0].pageX : i.clientX, l.touchObject.curY = void 0 !== n ? n[0].pageY : i.clientY, l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))), r = Math.round(Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2))), !l.options.verticalSwiping && !l.swiping && r > 4 ? (l.scrolling = !0, !1) : (!0 === l.options.verticalSwiping && (l.touchObject.swipeLength = r), t = l.swipeDirection(), void 0 !== i.originalEvent && l.touchObject.swipeLength > 4 && (l.swiping = !0, i.preventDefault()), s = (!1 === l.options.rtl ? 1 : -1) * (l.touchObject.curX > l.touchObject.startX ? 1 : -1), !0 === l.options.verticalSwiping && (s = l.touchObject.curY > l.touchObject.startY ? 1 : -1), o = l.touchObject.swipeLength, l.touchObject.edgeHit = !1, !1 === l.options.infinite && (0 === l.currentSlide && "right" === t || l.currentSlide >= l.getDotCount() && "left" === t) && (o = l.touchObject.swipeLength * l.options.edgeFriction, l.touchObject.edgeHit = !0), !1 === l.options.vertical ? l.swipeLeft = e + o * s : l.swipeLeft = e + o * (l.$list.height() / l.listWidth) * s, !0 === l.options.verticalSwiping && (l.swipeLeft = e + o * s), !0 !== l.options.fade && !1 !== l.options.touchMove && (!0 === l.animating ? (l.swipeLeft = null, !1) : void l.setCSS(l.swipeLeft)))); 1189 }, e.prototype.swipeStart = function (i) { 1190 var e, 1191 t = this; 1192 if (t.interrupted = !0, 1 !== t.touchObject.fingerCount || t.slideCount <= t.options.slidesToShow) return t.touchObject = {}, !1; 1193 void 0 !== i.originalEvent && void 0 !== i.originalEvent.touches && (e = i.originalEvent.touches[0]), t.touchObject.startX = t.touchObject.curX = void 0 !== e ? e.pageX : i.clientX, t.touchObject.startY = t.touchObject.curY = void 0 !== e ? e.pageY : i.clientY, t.dragging = !0; 1194 }, e.prototype.unfilterSlides = e.prototype.slickUnfilter = function () { 1195 var i = this; 1196 null !== i.$slidesCache && (i.unload(), i.$slideTrack.children(this.options.slide).detach(), i.$slidesCache.appendTo(i.$slideTrack), i.reinit()); 1197 }, e.prototype.unload = function () { 1198 var e = this; 1199 i(".slick-cloned", e.$slider).remove(), e.$dots && e.$dots.remove(), e.$prevArrow && e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.remove(), e.$nextArrow && e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.remove(), e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", ""); 1200 }, e.prototype.unslick = function (i) { 1201 var e = this; 1202 e.$slider.trigger("unslick", [e, i]), e.destroy(); 1203 }, e.prototype.updateArrows = function () { 1204 var i = this; 1205 Math.floor(i.options.slidesToShow / 2), !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && !i.options.infinite && (i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === i.currentSlide ? (i.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - i.options.slidesToShow && !1 === i.options.centerMode ? (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - 1 && !0 === i.options.centerMode && (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))); 1206 }, e.prototype.updateDots = function () { 1207 var i = this; 1208 null !== i.$dots && (i.$dots.find("li").removeClass("slick-active").end(), i.$dots.find("li").eq(Math.floor(i.currentSlide / i.options.slidesToScroll)).addClass("slick-active")); 1209 }, e.prototype.visibility = function () { 1210 var i = this; 1211 i.options.autoplay && (document[i.hidden] ? i.interrupted = !0 : i.interrupted = !1); 1212 }, i.fn.slick = function () { 1213 var i, 1214 t, 1215 o = this, 1216 s = arguments[0], 1217 n = Array.prototype.slice.call(arguments, 1), 1218 r = o.length; 1219 1220 for (i = 0; i < r; i++) if ("object" == typeof s || void 0 === s ? o[i].slick = new e(o[i], s) : t = o[i].slick[s].apply(o[i].slick, n), void 0 !== t) return t; 1221 1222 return o; 1223 }; 1224 }); 1225 1226 /***/ }), 1227 1228 /***/ "./assets/js/src/facebook.js": 1229 /*!***********************************!*\ 1230 !*** ./assets/js/src/facebook.js ***! 1231 \***********************************/ 1232 /***/ (function() { 1233 1234 "use strict"; 1235 1236 1237 (function ($) { 1238 $(document).ready(function () { 1239 if ($('.sg-facebook-login-button').length === 0) { 1240 return; 1241 } 1242 1243 function sgFBLogin(accesstoken) { 1244 FB.api('/me', 'get', { 1245 fields: 'id,name,email,first_name,last_name', 1246 access_token: accesstoken 1247 }, function (response) { 1248 var form = $('#giveasap_subscribe_form'); 1249 var tokenField = form.find('[name=sg_fb_access_token]'); 1250 1251 if (tokenField.length) { 1252 tokenField.val(accesstoken); 1253 } else { 1254 form.append('<input type="hidden" name="sg_fb_access_token" value="' + accesstoken + '"/>'); 1255 } 1256 1257 var data = { 1258 action: 'sg_facebook_login', 1259 nonce: sg.nonce 1260 }; 1261 form.find(':input').each(function (e) { 1262 var input = $(this); 1263 data[input.attr('name')] = input.val(); 1264 1265 if ('checkbox' === input.attr('type')) { 1266 data[input.attr('name')] = input.prop('checked') ? '1' : '0'; 1267 } 1268 }); 1269 form.addClass('sg-loading'); 1270 $.ajax({ 1271 url: sg.ajaxurl, 1272 data: data, 1273 method: 'POST', 1274 success: function (resp) { 1275 if (resp.success) { 1276 window.location.href = resp.data.redirect; 1277 } else { 1278 alert(resp.data.message); 1279 } 1280 }, 1281 error: function (error, ajaxOptions, thrownError) { 1282 form.removeClass('sg-loading'); 1283 alert(thrownError); 1284 }, 1285 complete: function () { 1286 form.removeClass('sg-loading'); 1287 } 1288 }); 1289 }); 1290 } 1291 1292 window.sgCheckFBLoginState = function () { 1293 FB.getLoginStatus(function (response) { 1294 if ('connected' === response.status) { 1295 var accesstoken = response.authResponse.accessToken; 1296 sgFBLogin(accesstoken); 1297 } else { 1298 FB.login(function (response) { 1299 if (response.authResponse) { 1300 sgFBLogin(FB.getAuthResponse().accessToken); 1301 } else { 1302 console.log('User cancelled login or did not fully authorize.'); 1303 } 1304 }); 1305 } 1306 }); 1307 }; 1308 1309 (function (d, s, id) { 1310 var fb_locale = window.sg_fb_locale || 'en_US'; 1311 var js, 1312 fjs = d.getElementsByTagName(s)[0]; 1313 if (d.getElementById(id)) return; 1314 js = d.createElement(s); 1315 js.id = id; 1316 js.src = "https://connect.facebook.net/" + fb_locale + "/sdk.js"; 1317 fjs.parentNode.insertBefore(js, fjs); 1318 })(document, 'script', 'facebook-jssdk'); 1319 1320 window.fbAsyncInit = function () { 1321 FB.init({ 1322 appId: sg.fb_app_id, 1323 cookie: true, 1324 // enable cookies to allow the server to access 1325 // the session 1326 xfbml: true, 1327 // parse social plugins on this page 1328 version: 'v3.3' // The Graph API version to use for the call 1329 1330 }); 1331 }; 1332 }); 1333 })(jQuery); 1334 1335 /***/ }), 1336 1337 /***/ "jquery": 1338 /*!*************************!*\ 1339 !*** external "jQuery" ***! 1340 \*************************/ 1341 /***/ (function(module) { 1342 1343 "use strict"; 1344 module.exports = jQuery; 1345 1346 /***/ }) 1347 1348 /******/ }); 1349 /************************************************************************/ 1350 /******/ // The module cache 1351 /******/ var __webpack_module_cache__ = {}; 1352 /******/ 1353 /******/ // The require function 1354 /******/ function __webpack_require__(moduleId) { 1355 /******/ // Check if module is in cache 1356 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 1357 /******/ if (cachedModule !== undefined) { 1358 /******/ return cachedModule.exports; 1359 /******/ } 1360 /******/ // Create a new module (and put it into the cache) 1361 /******/ var module = __webpack_module_cache__[moduleId] = { 1362 /******/ // no module.id needed 1363 /******/ // no module.loaded needed 1364 /******/ exports: {} 1365 /******/ }; 1366 /******/ 1367 /******/ // Execute the module function 1368 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 1369 /******/ 1370 /******/ // Return the exports of the module 1371 /******/ return module.exports; 1372 /******/ } 1373 /******/ 1374 /************************************************************************/ 1375 /******/ /* webpack/runtime/compat get default export */ 1376 /******/ !function() { 1377 /******/ // getDefaultExport function for compatibility with non-harmony modules 1378 /******/ __webpack_require__.n = function(module) { 1379 /******/ var getter = module && module.__esModule ? 1380 /******/ function() { return module['default']; } : 1381 /******/ function() { return module; }; 1382 /******/ __webpack_require__.d(getter, { a: getter }); 1383 /******/ return getter; 1384 /******/ }; 1385 /******/ }(); 1386 /******/ 1387 /******/ /* webpack/runtime/define property getters */ 1388 /******/ !function() { 1389 /******/ // define getter functions for harmony exports 1390 /******/ __webpack_require__.d = function(exports, definition) { 1391 /******/ for(var key in definition) { 1392 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 1393 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 1394 /******/ } 1395 /******/ } 1396 /******/ }; 1397 /******/ }(); 1398 /******/ 1399 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 1400 /******/ !function() { 1401 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 1402 /******/ }(); 1403 /******/ 1404 /******/ /* webpack/runtime/make namespace object */ 1405 /******/ !function() { 1406 /******/ // define __esModule on exports 1407 /******/ __webpack_require__.r = function(exports) { 1408 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 1409 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 1410 /******/ } 1411 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 1412 /******/ }; 1413 /******/ }(); 1414 /******/ 1415 /************************************************************************/ 1416 var __webpack_exports__ = {}; 1417 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 1418 !function() { 1419 "use strict"; 1420 /*!*******************************!*\ 1421 !*** ./assets/js/giveasap.js ***! 1422 \*******************************/ 1423 __webpack_require__.r(__webpack_exports__); 1424 /* harmony import */ var _clipboard_min_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clipboard.min.js */ "./assets/js/clipboard.min.js"); 1425 /* harmony import */ var _clipboard_min_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_clipboard_min_js__WEBPACK_IMPORTED_MODULE_0__); 1426 /* harmony import */ var _src_facebook_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./src/facebook.js */ "./assets/js/src/facebook.js"); 1427 /* harmony import */ var _src_facebook_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_src_facebook_js__WEBPACK_IMPORTED_MODULE_1__); 1428 /* harmony import */ var _slick_min_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./slick.min.js */ "./assets/js/slick.min.js"); 1429 /* harmony import */ var _slick_min_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_slick_min_js__WEBPACK_IMPORTED_MODULE_2__); 1430 // import './jquery.plugin.min.js'; 1431 // import './jquery.countdown.min.js'; 1432 1433 1434 1435 1436 (function ($) { 1437 $(document).on('click', '[data-giveaway-popup]', function (e) { 1438 e.preventDefault(); 1439 var giveawayId = $(this).attr('data-giveaway-popup'); 1440 var giveawayPopup = $('#sg-giveaway-popup-' + giveawayId); 1441 1442 if (giveawayPopup.length) { 1443 giveawayPopup.toggleClass('show'); 1444 } 1445 }); 1446 1447 function sgUpdateEntries(entries, giveawayBox) { 1448 var giveawayBox = giveawayBox || false; 1449 1450 if (!giveawayBox) { 1451 giveawayBox = $('.giveasap-box'); 1452 } 1453 1454 giveawayBox.find('.giveasap-entries strong').html(entries); 1455 } 1456 1457 if ($('.sg-giveaway-prizes-slider .sg-giveaway-prize').length > 1) { 1458 $(".sg-giveaway-prizes-slider").slick({ 1459 // normal options... 1460 infinite: true, 1461 slidesToShow: 1, 1462 slidesToScroll: 1, 1463 arrows: false, 1464 dots: true 1465 }); 1466 } 1467 1468 $(document).on('click', '.sg-extra-action-title, .sg-extra-action-close', function (e) { 1469 e.preventDefault(); 1470 var actionTitle = $(this).parents('.sg-extra-action').find('.sg-extra-action-title'), 1471 expanded = actionTitle.attr('aria-expanded') === 'true'; 1472 actionTitle.attr('aria-expanded', !expanded); 1473 $(this).parents('.sg-extra-action').toggleClass('expanded'); 1474 }); 1475 /** 1476 * Add the Completed Action to a global object. 1477 * 1478 * @param giveaway_id 1479 * @param instance_id 1480 */ 1481 1482 function giveasap_add_completed_action(giveaway_id, instance_id) { 1483 window.giveasap_completed_actions = window.giveasap_completed_actions || {}; 1484 window.giveasap_completed_actions[giveaway_id] = window.giveasap_completed_actions[giveaway_id] || []; 1485 1486 if (window.giveasap_completed_actions[giveaway_id].indexOf(instance_id) < 0) { 1487 window.giveasap_completed_actions[giveaway_id].push(parseInt(instance_id)); 1488 } 1489 } 1490 /** 1491 * Check if the action is completed. 1492 * 1493 * @param giveaway_id 1494 * @param instance_id 1495 * @returns {boolean} 1496 */ 1497 1498 1499 function giveasap_is_action_completed(giveaway_id, instance_id) { 1500 var completed_actions = window.giveasap_completed_actions || {}; 1501 var giveaway_actions = completed_actions[giveaway_id] || []; 1502 return giveaway_actions.indexOf(instance_id) >= 0; 1503 } 1504 /** 1505 * Check if an action can be completed due to number of completed actions. 1506 * 1507 * @param $action 1508 * @param completed_count 1509 * @returns {boolean} 1510 */ 1511 1512 1513 function giveasap_can_be_unlocked_with_completed_count($action, completed_count) { 1514 var required_completed = $action.attr('data-mandatory'); // No mandatory data at all. Must be a unlocked one. 1515 1516 if (!required_completed) { 1517 return true; 1518 } 1519 1520 return parseInt(completed_count) >= parseInt(required_completed); 1521 } 1522 /** 1523 * Check if can be unlocked with completed specific actions. 1524 * @param $action 1525 * @param giveaway_id 1526 * @returns {boolean} 1527 */ 1528 1529 1530 function giveasap_can_be_unlocked_with_completed_specific_actions($action, giveaway_id) { 1531 var specific_actions = $action.attr('data-mandatory_actions'); // No such attribute. It can be unlocked. 1532 1533 if (!specific_actions) { 1534 return true; 1535 } 1536 1537 var instance_ids = specific_actions.split(','); 1538 var unlocked = true; 1539 1540 for (var u = 0; u < instance_ids.length; u++) { 1541 var id = instance_ids[u]; 1542 1543 if (!giveasap_is_action_completed(giveaway_id, parseInt(id))) { 1544 unlocked = false; 1545 } 1546 } 1547 1548 return unlocked; 1549 } 1550 1551 $(document).on('submit', '.sg-extra-action form', function (e) { 1552 var $this = $(this), 1553 form = $this, 1554 data = $(this).serialize(), 1555 processData = true, 1556 contentType = 'application/x-www-form-urlencoded', 1557 ajaxData = { 1558 action: 'sg_extra_action_complete', 1559 nonce: sg.nonce, 1560 data: data 1561 }; 1562 1563 if (form.find('input[type=file]').length > 0) { 1564 if (window.FormData) { 1565 ajaxData = new FormData(form[0]); 1566 ajaxData.append('action', 'sg_extra_action_complete'); 1567 ajaxData.append('nonce', sg.nonce); 1568 ajaxData.append('data', data); 1569 processData = false; 1570 contentType = false; 1571 } 1572 } 1573 1574 form.addClass('sg-loading'); 1575 $.ajax({ 1576 url: sg.ajaxurl, 1577 method: 'POST', 1578 contentType: contentType, 1579 processData: processData, 1580 data: ajaxData, 1581 success: function (resp) { 1582 if (resp.success) { 1583 var html = resp.data.complete_mark || '', 1584 entries = resp.data.entries || false, 1585 action_html = resp.data.html || false, 1586 actions_completed = resp.data.actions_completed || false; 1587 1588 if (html) { 1589 var title = form.parent().find('.sg-extra-action-title'); 1590 title.find('.sg-extra-action-entries').remove(); 1591 title.append(html); 1592 } 1593 1594 if (action_html) { 1595 form.find('.sg-extra-action-form-body').html(action_html); 1596 } 1597 1598 if (entries) { 1599 var gBox = form.parents('.giveasap-box'); 1600 1601 if (gBox.length === 0) { 1602 gBox = form.parents('.giveasap_box'); 1603 } 1604 1605 sgUpdateEntries(entries, gBox); 1606 } 1607 1608 var instance_id = $this.find('[name=instance]').val(); 1609 var giveaway_id = $this.find('[name=giveaway_id]').val(); 1610 giveasap_add_completed_action(giveaway_id, instance_id); 1611 1612 if (actions_completed) { 1613 var actions = form.parents('.giveasap_extra_actions'), 1614 locked_actions = actions.find('.sg-extra-action.sg-extra-action-locked'); 1615 locked_actions.each(function () { 1616 var $this = $(this); // Can't be completed yet. 1617 1618 if (!giveasap_can_be_unlocked_with_completed_count($this, actions_completed)) { 1619 return true; 1620 } 1621 1622 if (!giveasap_can_be_unlocked_with_completed_specific_actions($this, giveaway_id)) { 1623 return true; 1624 } 1625 1626 $this.removeClass('sg-extra-action-locked'); 1627 }); 1628 } 1629 1630 $this.find('button[name=sg_extra_action_submit]').remove(); 1631 } else { 1632 alert(resp.data); 1633 } 1634 }, 1635 complete: function () { 1636 form.removeClass('sg-loading'); 1637 } 1638 }); 1639 return false; 1640 }); 1641 $(document).on('click', '.sg_extra_action_button[data-check-action]', function (e) { 1642 var $this = $(this), 1643 form = $this.parents('form'), 1644 data = form.serialize(), 1645 value = $this.attr('data-check-action'); 1646 form.addClass('sg-loading'); 1647 $.ajax({ 1648 url: sg.ajaxurl, 1649 data: { 1650 action: 'sg_extra_action_check', 1651 nonce: sg.nonce, 1652 data: data, 1653 value: value 1654 }, 1655 success: function (resp) { 1656 if (resp.success) { 1657 if (typeof resp.data !== 'undefined' && typeof resp.data.redirect !== 'undefined' && resp.data.redirect) { 1658 window.location.href = resp.data.redirect; 1659 } else { 1660 form.find('[name=sg_extra_action_submit]').removeAttr('disabled'); 1661 } 1662 } else { 1663 alert(resp.data); 1664 } 1665 }, 1666 complete: function () { 1667 form.removeClass('sg-loading'); 1668 } 1669 }); 1670 }); // We are ready! 1671 1672 $(function () { 1673 var $countdown = $("#countdown"), 1674 $countdowns = $(".giveasap_countdown"); 1675 1676 if ($.countdown.defaultOptions.labels.indexOf('Years') >= 0) { 1677 $.countdown.setDefaults({ 1678 labels: [sg.text.countdown.labels.years, sg.text.countdown.labels.months, sg.text.countdown.labels.weeks, sg.text.countdown.labels.days, sg.text.countdown.labels.hours, sg.text.countdown.labels.minutes, sg.text.countdown.labels.seconds], 1679 labels1: [sg.text.countdown.labels1.year, sg.text.countdown.labels1.month, sg.text.countdown.labels1.week, sg.text.countdown.labels1.day, sg.text.countdown.labels1.hour, sg.text.countdown.labels1.minute, sg.text.countdown.labels1.second], 1680 compactLabels: [sg.text.countdown.compactLabels.y, sg.text.countdown.compactLabels.m, sg.text.countdown.compactLabels.w, sg.text.countdown.compactLabels.d] 1681 }); 1682 } 1683 1684 if ($countdown.length) { 1685 var $timestamp = $countdown.attr("data-end"); 1686 var $timezone = $countdown.attr("data-timezone"); 1687 $countdown.countdown({ 1688 until: new Date($timestamp * 1000), 1689 format: 'dHMS' 1690 }); 1691 } 1692 1693 if ($countdowns.length) { 1694 $countdowns.each(function () { 1695 var $timestamp = $(this).attr("data-end"); 1696 var $timezone = $(this).attr("data-timezone"); 1697 $(this).countdown({ 1698 until: new Date($timestamp * 1000), 1699 format: 'dHMS' 1700 }); 1701 }); 1702 } 1703 1704 if ($('.giveasap.template3 .giveasap_box.step-1').length > 0) { 1705 var height = $('.giveasap_aside').outerHeight(true) + 100; 1706 $('.giveasap_box').css('margin-bottom', height + 'px'); 1707 } 1708 }); 1709 $("#giveasap_show_rules").on('click', function () { 1710 $(".giveasap_rules_extended").toggleClass("active"); 1711 }); 1712 $("#giveasap_request_link").on('click', function (e) { 1713 $(this).parents('form').addClass('hidden'); 1714 $('#giveasap_request_link_form').removeClass('hidden'); 1715 }); 1716 $('.sg-toggle').on('click', function (e) { 1717 e.preventDefault(); 1718 var $this = $(this), 1719 $target = $this.attr('data-target'), 1720 $class = $this.attr('data-class'), 1721 $text = $this.attr('data-text'); 1722 $($target).toggleClass($class); 1723 1724 if ($text) { 1725 var old_text = $this.text(); 1726 $this.attr('data-text', old_text); 1727 $this.html($text); 1728 } 1729 }); 1730 $(document).on('click', '.sg-twitter-login-button a', function (e) { 1731 if ($('#giveasap_consent').length && !$('#giveasap_consent').prop('checked')) { 1732 e.preventDefault(); 1733 alert(sg.text.accept_terms || 'Please accept terms and conditions'); 1734 } 1735 }); 1736 $(document).on('click', '.giveasap_sharing .sharing_method a', function (e) { 1737 var href = $(this).attr('href'), 1738 popup = $(this).attr('data-popup'); 1739 $(document.body).triggerHandler('giveasap_sharing_method_clicked', [$(this)]); 1740 1741 if (typeof popup !== 'undefined' && popup === '1') { 1742 e.preventDefault(); 1743 var popupWindow = window.open(href, 'popUpWindow', 'height=300,width=400,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes'); 1744 } 1745 }); 1746 1747 if ($('.giveasap_link').length && _clipboard_min_js__WEBPACK_IMPORTED_MODULE_0___default().isSupported()) { 1748 var val = $('.giveasap_link input').val(); 1749 $('.giveasap_link').append('<button data-clipboard-text="' + val + '" class="sg-btn-copy" type="button"><span class="fal fa-copy"></span><span class="sg-btn-copy-text">Copy</span></button>'); 1750 var clipboard = new (_clipboard_min_js__WEBPACK_IMPORTED_MODULE_0___default())('.sg-btn-copy'); 1751 clipboard.on('success', function (e) { 1752 var icon = $('.sg-btn-copy .fal'); 1753 icon.removeClass('fa-copy').addClass('fa-check'); 1754 setTimeout(function () { 1755 icon.removeClass('fa-check').addClass('fa-copy'); 1756 }, 2000); 1757 }); 1758 } 1759 })(jQuery); 1760 }(); 1761 /******/ })() 1762 ; 1763 //# sourceMappingURL=giveasap.js.map -
giveasap/trunk/assets/dist/js/gutenberg.js
r2793238 r2882364 1 (function(){var __webpack_modules__={797:function(){var e,t;t="countdown",(e=jQuery).JQPlugin.createPlugin({name:t,defaultOptions:{until:null,since:null,timezone:null,serverSync:null,format:"dHMS",layout:"",compact:!1,padZeroes:!1,significant:0,description:"",expiryUrl:"",expiryText:"",alwaysExpire:!1,onExpiry:null,onTick:null,tickInterval:1},regionalOptions:{"":{labels:["Years","Months","Weeks","Days","Hours","Minutes","Seconds"],labels1:["Year","Month","Week","Day","Hour","Minute","Second"],compactLabels:["y","m","w","d"],whichLabels:null,digits:["0","1","2","3","4","5","6","7","8","9"],timeSeparator:":",isRTL:!1}},_getters:["getTimes"],_rtlClass:t+"-rtl",_sectionClass:t+"-section",_amountClass:t+"-amount",_periodClass:t+"-period",_rowClass:t+"-row",_holdingClass:t+"-holding",_showClass:t+"-show",_descrClass:t+"-descr",_timerElems:[],_init:function(){var t=this;this._super(),this._serverSyncs=[];var i="function"==typeof Date.now?Date.now:function(){return(new Date).getTime()},s=window.performance&&"function"==typeof window.performance.now,o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null,n=0;!o||e.noRequestAnimationFrame?(e.noRequestAnimationFrame=null,setInterval((function(){t._updateElems()}),980)):(n=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||i(),o((function e(r){var a=r<1e12?s?performance.now()+performance.timing.navigationStart:i():r||i();a-n>=1e3&&(t._updateElems(),n=a),o(e)})))},UTCDate:function(e,t,i,s,o,n,r,a){"object"==typeof t&&t.constructor==Date&&(a=t.getMilliseconds(),r=t.getSeconds(),n=t.getMinutes(),o=t.getHours(),s=t.getDate(),i=t.getMonth(),t=t.getFullYear());var l=new Date;return l.setUTCFullYear(t),l.setUTCDate(1),l.setUTCMonth(i||0),l.setUTCDate(s||1),l.setUTCHours(o||0),l.setUTCMinutes((n||0)-(Math.abs(e)<30?60*e:e)),l.setUTCSeconds(r||0),l.setUTCMilliseconds(a||0),l},periodsToSeconds:function(e){return 31557600*e[0]+2629800*e[1]+604800*e[2]+86400*e[3]+3600*e[4]+60*e[5]+e[6]},resync:function(){var t=this;e("."+this._getMarker()).each((function(){var i=e.data(this,t.name);if(i.options.serverSync){for(var s=null,o=0;o<t._serverSyncs.length;o++)if(t._serverSyncs[o][0]==i.options.serverSync){s=t._serverSyncs[o];break}if(null==s[2]){var n=e.isFunction(i.options.serverSync)?i.options.serverSync.apply(this,[]):null;s[2]=(n?(new Date).getTime()-n.getTime():0)-s[1]}i._since&&i._since.setMilliseconds(i._since.getMilliseconds()+s[2]),i._until.setMilliseconds(i._until.getMilliseconds()+s[2])}}));for(var i=0;i<t._serverSyncs.length;i++)null!=t._serverSyncs[i][2]&&(t._serverSyncs[i][1]+=t._serverSyncs[i][2],delete t._serverSyncs[i][2])},_instSettings:function(e,t){return{_periods:[0,0,0,0,0,0,0]}},_addElem:function(e){this._hasElem(e)||this._timerElems.push(e)},_hasElem:function(t){return e.inArray(t,this._timerElems)>-1},_removeElem:function(t){this._timerElems=e.map(this._timerElems,(function(e){return e==t?null:e}))},_updateElems:function(){for(var e=this._timerElems.length-1;e>=0;e--)this._updateCountdown(this._timerElems[e])},_optionsChanged:function(t,i,s){s.layout&&(s.layout=s.layout.replace(/</g,"<").replace(/>/g,">")),this._resetExtraLabels(i.options,s);var o=i.options.timezone!=s.timezone;e.extend(i.options,s),this._adjustSettings(t,i,null!=s.until||null!=s.since||o);var n=new Date;(i._since&&i._since<n||i._until&&i._until>n)&&this._addElem(t[0]),this._updateCountdown(t,i)},_updateCountdown:function(t,i){if(t=t.jquery?t:e(t),i=i||this._getInst(t)){if(t.html(this._generateHTML(i)).toggleClass(this._rtlClass,i.options.isRTL),e.isFunction(i.options.onTick)){var s="lap"!=i._hold?i._periods:this._calculatePeriods(i,i._show,i.options.significant,new Date);1!=i.options.tickInterval&&this.periodsToSeconds(s)%i.options.tickInterval!=0||i.options.onTick.apply(t[0],[s])}if("pause"!=i._hold&&(i._since?i._now.getTime()<i._since.getTime():i._now.getTime()>=i._until.getTime())&&!i._expiring){if(i._expiring=!0,this._hasElem(t[0])||i.options.alwaysExpire){if(this._removeElem(t[0]),e.isFunction(i.options.onExpiry)&&i.options.onExpiry.apply(t[0],[]),i.options.expiryText){var o=i.options.layout;i.options.layout=i.options.expiryText,this._updateCountdown(t[0],i),i.options.layout=o}i.options.expiryUrl&&(window.location=i.options.expiryUrl)}i._expiring=!1}else"pause"==i._hold&&this._removeElem(t[0])}},_resetExtraLabels:function(e,t){for(var i in t)i.match(/[Ll]abels[02-9]|compactLabels1/)&&(e[i]=t[i]);for(var i in e)i.match(/[Ll]abels[02-9]|compactLabels1/)&&void 0===t[i]&&(e[i]=null)},_adjustSettings:function(t,i,s){for(var o=null,n=0;n<this._serverSyncs.length;n++)if(this._serverSyncs[n][0]==i.options.serverSync){o=this._serverSyncs[n][1];break}if(null!=o)var r=i.options.serverSync?o:0,a=new Date;else{var l=e.isFunction(i.options.serverSync)?i.options.serverSync.apply(t[0],[]):null;a=new Date,r=l?a.getTime()-l.getTime():0,this._serverSyncs.push([i.options.serverSync,r])}var d=i.options.timezone;d=null==d?-a.getTimezoneOffset():d,(s||!s&&null==i._until&&null==i._since)&&(i._since=i.options.since,null!=i._since&&(i._since=this.UTCDate(d,this._determineTime(i._since,null)),i._since&&r&&i._since.setMilliseconds(i._since.getMilliseconds()+r)),i._until=this.UTCDate(d,this._determineTime(i.options.until,a)),r&&i._until.setMilliseconds(i._until.getMilliseconds()+r)),i._show=this._determineShow(i)},_preDestroy:function(e,t){this._removeElem(e[0]),e.empty()},pause:function(e){this._hold(e,"pause")},lap:function(e){this._hold(e,"lap")},resume:function(e){this._hold(e,null)},toggle:function(t){this[(e.data(t,this.name)||{})._hold?"resume":"pause"](t)},toggleLap:function(t){this[(e.data(t,this.name)||{})._hold?"resume":"lap"](t)},_hold:function(t,i){var s=e.data(t,this.name);if(s){if("pause"==s._hold&&!i){s._periods=s._savePeriods;var o=s._since?"-":"+";s[s._since?"_since":"_until"]=this._determineTime(o+s._periods[0]+"y"+o+s._periods[1]+"o"+o+s._periods[2]+"w"+o+s._periods[3]+"d"+o+s._periods[4]+"h"+o+s._periods[5]+"m"+o+s._periods[6]+"s"),this._addElem(t)}s._hold=i,s._savePeriods="pause"==i?s._periods:null,e.data(t,this.name,s),this._updateCountdown(t,s)}},getTimes:function(t){var i=e.data(t,this.name);return i?"pause"==i._hold?i._savePeriods:i._hold?this._calculatePeriods(i,i._show,i.options.significant,new Date):i._periods:null},_determineTime:function(e,t){var i,s,o=this,n=null==e?t:"string"==typeof e?function(e){e=e.toLowerCase();for(var t=new Date,i=t.getFullYear(),s=t.getMonth(),n=t.getDate(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),d=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g,c=d.exec(e);c;){switch(c[2]||"s"){case"s":l+=parseInt(c[1],10);break;case"m":a+=parseInt(c[1],10);break;case"h":r+=parseInt(c[1],10);break;case"d":n+=parseInt(c[1],10);break;case"w":n+=7*parseInt(c[1],10);break;case"o":s+=parseInt(c[1],10),n=Math.min(n,o._getDaysInMonth(i,s));break;case"y":i+=parseInt(c[1],10),n=Math.min(n,o._getDaysInMonth(i,s))}c=d.exec(e)}return new Date(i,s,n,r,a,l,0)}(e):"number"==typeof e?(i=e,(s=new Date).setTime(s.getTime()+1e3*i),s):e;return n&&n.setMilliseconds(0),n},_getDaysInMonth:function(e,t){return 32-new Date(e,t,32).getDate()},_normalLabels:function(e){return e},_generateHTML:function(t){var i=this;t._periods=t._hold?t._periods:this._calculatePeriods(t,t._show,t.options.significant,new Date);for(var s=!1,o=0,n=t.options.significant,r=e.extend({},t._show),a=0;a<=6;a++)s|="?"==t._show[a]&&t._periods[a]>0,r[a]="?"!=t._show[a]||s?t._show[a]:null,o+=r[a]?1:0,n-=t._periods[a]>0?1:0;var l=[!1,!1,!1,!1,!1,!1,!1];for(a=6;a>=0;a--)t._show[a]&&(t._periods[a]?l[a]=!0:(l[a]=n>0,n--));var d=t.options.compact?t.options.compactLabels:t.options.labels,c=t.options.whichLabels||this._normalLabels,p=function(e){var s=t.options["compactLabels"+c(t._periods[e])];return r[e]?i._translateDigits(t,t._periods[e])+(s?s[e]:d[e])+" ":""},u=t.options.padZeroes?2:1,h=function(e){var s=t.options["labels"+c(t._periods[e])];return!t.options.significant&&r[e]||t.options.significant&&l[e]?'<span class="'+i._sectionClass+'"><span class="'+i._amountClass+'">'+i._minDigits(t,t._periods[e],u)+'</span><span class="'+i._periodClass+'">'+(s?s[e]:d[e])+"</span></span>":""};return t.options.layout?this._buildLayout(t,r,t.options.layout,t.options.compact,t.options.significant,l):(t.options.compact?'<span class="'+this._rowClass+" "+this._amountClass+(t._hold?" "+this._holdingClass:"")+'">'+p(0)+p(1)+p(2)+p(3)+(r[4]?this._minDigits(t,t._periods[4],2):"")+(r[5]?(r[4]?t.options.timeSeparator:"")+this._minDigits(t,t._periods[5],2):"")+(r[6]?(r[4]||r[5]?t.options.timeSeparator:"")+this._minDigits(t,t._periods[6],2):""):'<span class="'+this._rowClass+" "+this._showClass+(t.options.significant||o)+(t._hold?" "+this._holdingClass:"")+'">'+h(0)+h(1)+h(2)+h(3)+h(4)+h(5)+h(6))+"</span>"+(t.options.description?'<span class="'+this._rowClass+" "+this._descrClass+'">'+t.options.description+"</span>":"")},_buildLayout:function(t,i,s,o,n,r){for(var a=t.options[o?"compactLabels":"labels"],l=t.options.whichLabels||this._normalLabels,d=function(e){return(t.options[(o?"compactLabels":"labels")+l(t._periods[e])]||a)[e]},c=function(e,i){return t.options.digits[Math.floor(e/i)%10]},p={desc:t.options.description,sep:t.options.timeSeparator,yl:d(0),yn:this._minDigits(t,t._periods[0],1),ynn:this._minDigits(t,t._periods[0],2),ynnn:this._minDigits(t,t._periods[0],3),y1:c(t._periods[0],1),y10:c(t._periods[0],10),y100:c(t._periods[0],100),y1000:c(t._periods[0],1e3),ol:d(1),on:this._minDigits(t,t._periods[1],1),onn:this._minDigits(t,t._periods[1],2),onnn:this._minDigits(t,t._periods[1],3),o1:c(t._periods[1],1),o10:c(t._periods[1],10),o100:c(t._periods[1],100),o1000:c(t._periods[1],1e3),wl:d(2),wn:this._minDigits(t,t._periods[2],1),wnn:this._minDigits(t,t._periods[2],2),wnnn:this._minDigits(t,t._periods[2],3),w1:c(t._periods[2],1),w10:c(t._periods[2],10),w100:c(t._periods[2],100),w1000:c(t._periods[2],1e3),dl:d(3),dn:this._minDigits(t,t._periods[3],1),dnn:this._minDigits(t,t._periods[3],2),dnnn:this._minDigits(t,t._periods[3],3),d1:c(t._periods[3],1),d10:c(t._periods[3],10),d100:c(t._periods[3],100),d1000:c(t._periods[3],1e3),hl:d(4),hn:this._minDigits(t,t._periods[4],1),hnn:this._minDigits(t,t._periods[4],2),hnnn:this._minDigits(t,t._periods[4],3),h1:c(t._periods[4],1),h10:c(t._periods[4],10),h100:c(t._periods[4],100),h1000:c(t._periods[4],1e3),ml:d(5),mn:this._minDigits(t,t._periods[5],1),mnn:this._minDigits(t,t._periods[5],2),mnnn:this._minDigits(t,t._periods[5],3),m1:c(t._periods[5],1),m10:c(t._periods[5],10),m100:c(t._periods[5],100),m1000:c(t._periods[5],1e3),sl:d(6),sn:this._minDigits(t,t._periods[6],1),snn:this._minDigits(t,t._periods[6],2),snnn:this._minDigits(t,t._periods[6],3),s1:c(t._periods[6],1),s10:c(t._periods[6],10),s100:c(t._periods[6],100),s1000:c(t._periods[6],1e3)},u=s,h=0;h<=6;h++){var f="yowdhms".charAt(h),g=new RegExp("\\{"+f+"<\\}([\\s\\S]*)\\{"+f+">\\}","g");u=u.replace(g,!n&&i[h]||n&&r[h]?"$1":"")}return e.each(p,(function(e,t){var i=new RegExp("\\{"+e+"\\}","g");u=u.replace(i,t)})),u},_minDigits:function(e,t,i){return(t=""+t).length>=i?this._translateDigits(e,t):(t="0000000000"+t,this._translateDigits(e,t.substr(t.length-i)))},_translateDigits:function(e,t){return(""+t).replace(/[0-9]/g,(function(t){return e.options.digits[t]}))},_determineShow:function(e){var t=e.options.format,i=[];return i[0]=t.match("y")?"?":t.match("Y")?"!":null,i[1]=t.match("o")?"?":t.match("O")?"!":null,i[2]=t.match("w")?"?":t.match("W")?"!":null,i[3]=t.match("d")?"?":t.match("D")?"!":null,i[4]=t.match("h")?"?":t.match("H")?"!":null,i[5]=t.match("m")?"?":t.match("M")?"!":null,i[6]=t.match("s")?"?":t.match("S")?"!":null,i},_calculatePeriods:function(e,t,i,s){e._now=s,e._now.setMilliseconds(0);var o=new Date(e._now.getTime());e._since?s.getTime()<e._since.getTime()?e._now=s=o:s=e._since:(o.setTime(e._until.getTime()),s.getTime()>e._until.getTime()&&(e._now=s=o));var n=[0,0,0,0,0,0,0];if(t[0]||t[1]){var r=this._getDaysInMonth(s.getFullYear(),s.getMonth()),a=this._getDaysInMonth(o.getFullYear(),o.getMonth()),l=o.getDate()==s.getDate()||o.getDate()>=Math.min(r,a)&&s.getDate()>=Math.min(r,a),d=function(e){return 60*(60*e.getHours()+e.getMinutes())+e.getSeconds()},c=Math.max(0,12*(o.getFullYear()-s.getFullYear())+o.getMonth()-s.getMonth()+(o.getDate()<s.getDate()&&!l||l&&d(o)<d(s)?-1:0));n[0]=t[0]?Math.floor(c/12):0,n[1]=t[1]?c-12*n[0]:0;var p=(s=new Date(s.getTime())).getDate()==r,u=this._getDaysInMonth(s.getFullYear()+n[0],s.getMonth()+n[1]);s.getDate()>u&&s.setDate(u),s.setFullYear(s.getFullYear()+n[0]),s.setMonth(s.getMonth()+n[1]),p&&s.setDate(u)}var h=Math.floor((o.getTime()-s.getTime())/1e3),f=function(e,i){n[e]=t[e]?Math.floor(h/i):0,h-=n[e]*i};if(f(2,604800),f(3,86400),f(4,3600),f(5,60),f(6,1),h>0&&!e._since)for(var g=[1,12,4.3482,7,24,60,60],w=6,v=1,m=6;m>=0;m--)t[m]&&(n[w]>=v&&(n[w]=0,h=1),h>0&&(n[m]++,h=0,w=m,v=1)),v*=g[m];if(i)for(m=0;m<=6;m++)i&&n[m]?i--:i||(n[m]=0);return n}})},741:function(){var j;j=!1,window.JQClass=function(){},JQClass.classes={},JQClass.extend=function e(t){var i=this.prototype;j=!0;var s=new this;for(var o in j=!1,t)s[o]="function"==typeof t[o]&&"function"==typeof i[o]?function(e,t){return function(){var s=this._super;this._super=function(t){return i[e].apply(this,t||[])};var o=t.apply(this,arguments);return this._super=s,o}}(o,t[o]):t[o];function n(){!j&&this._init&&this._init.apply(this,arguments)}return n.prototype=s,n.prototype.constructor=n,n.extend=e,n},function($){function camelCase(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}JQClass.classes.JQPlugin=JQClass.extend({name:"plugin",defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return"is-"+this.name},_init:function(){$.extend(this.defaultOptions,this.regionalOptions&&this.regionalOptions[""]||{});var e=camelCase(this.name);$[e]=this,$.fn[e]=function(t){var i=Array.prototype.slice.call(arguments,1);return $[e]._isNotChained(t,i)?$[e][t].apply($[e],[this[0]].concat(i)):this.each((function(){if("string"==typeof t){if("_"===t[0]||!$[e][t])throw"Unknown method: "+t;$[e][t].apply($[e],[this].concat(i))}else $[e]._attach(this,t)}))}},setDefaults:function(e){$.extend(this.defaultOptions,e||{})},_isNotChained:function(e,t){return"option"===e&&(0===t.length||1===t.length&&"string"==typeof t[0])||$.inArray(e,this._getters)>-1},_attach:function(e,t){if(!(e=$(e)).hasClass(this._getMarker())){e.addClass(this._getMarker()),t=$.extend({},this.defaultOptions,this._getMetadata(e),t||{});var i=$.extend({name:this.name,elem:e,options:t},this._instSettings(e,t));e.data(this.name,i),this._postAttach(e,i),this.option(e,t)}},_instSettings:function(e,t){return{}},_postAttach:function(e,t){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||"";for(var g in f=f.replace(/'/g,'"'),f=f.replace(/([a-zA-Z0-9]+):/g,(function(e,t,i){var s=f.substring(0,i).match(/"/g);return s&&s.length%2!=0?t+":":'"'+t+'":'})),f=$.parseJSON("{"+f+"}"),f){var h=f[g];"string"==typeof h&&h.match(/^new Date\((.*)\)$/)&&(f[g]=eval(h))}return f}catch(e){return{}}},_getInst:function(e){return $(e).data(this.name)||{}},option:function(e,t,i){var s=(e=$(e)).data(this.name);if(!t||"string"==typeof t&&null==i)return(o=(s||{}).options)&&t?o[t]:o;if(e.hasClass(this._getMarker())){var o=t||{};"string"==typeof t&&((o={})[t]=i),this._optionsChanged(e,s,o),$.extend(s.options,o)}},_optionsChanged:function(e,t,i){},destroy:function(e){(e=$(e)).hasClass(this._getMarker())&&(this._preDestroy(e,this._getInst(e)),e.removeData(this.name).removeClass(this._getMarker()))},_preDestroy:function(e,t){}}),$.JQPlugin={createPlugin:function(e,t){"object"==typeof e&&(t=e,e="JQPlugin"),e=camelCase(e);var i=camelCase(t.name);JQClass.classes[i]=JQClass.classes[e].extend(t),new JQClass.classes[i]}}}(jQuery)},340:function(e,t,i){var s,o,n;!function(r){"use strict";o=[i(311)],s=function(e){var t=window.Slick||{};(t=function(){var t=0;return function(i,s){var o,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:e(i),appendDots:e(i),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,i){return e('<button type="button" />').text(i+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},e.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=e(i),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,o=e(i).data("slick")||{},n.options=e.extend({},n.defaults,s,o),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=e.proxy(n.autoPlay,n),n.autoPlayClear=e.proxy(n.autoPlayClear,n),n.autoPlayIterator=e.proxy(n.autoPlayIterator,n),n.changeSlide=e.proxy(n.changeSlide,n),n.clickHandler=e.proxy(n.clickHandler,n),n.selectHandler=e.proxy(n.selectHandler,n),n.setPosition=e.proxy(n.setPosition,n),n.swipeHandler=e.proxy(n.swipeHandler,n),n.dragHandler=e.proxy(n.dragHandler,n),n.keyHandler=e.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},t.prototype.addSlide=t.prototype.slickAdd=function(t,i,s){var o=this;if("boolean"==typeof i)s=i,i=null;else if(i<0||i>=o.slideCount)return!1;o.unload(),"number"==typeof i?0===i&&0===o.$slides.length?e(t).appendTo(o.$slideTrack):s?e(t).insertBefore(o.$slides.eq(i)):e(t).insertAfter(o.$slides.eq(i)):!0===s?e(t).prependTo(o.$slideTrack):e(t).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each((function(t,i){e(i).attr("data-slick-index",t)})),o.$slidesCache=o.$slides,o.reinit()},t.prototype.animateHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.animate({height:t},e.options.speed)}},t.prototype.animateSlide=function(t,i){var s={},o=this;o.animateHeight(),!0===o.options.rtl&&!1===o.options.vertical&&(t=-t),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:t},o.options.speed,o.options.easing,i):o.$slideTrack.animate({top:t},o.options.speed,o.options.easing,i):!1===o.cssTransitions?(!0===o.options.rtl&&(o.currentLeft=-o.currentLeft),e({animStart:o.currentLeft}).animate({animStart:t},{duration:o.options.speed,easing:o.options.easing,step:function(e){e=Math.ceil(e),!1===o.options.vertical?(s[o.animType]="translate("+e+"px, 0px)",o.$slideTrack.css(s)):(s[o.animType]="translate(0px,"+e+"px)",o.$slideTrack.css(s))},complete:function(){i&&i.call()}})):(o.applyTransition(),t=Math.ceil(t),!1===o.options.vertical?s[o.animType]="translate3d("+t+"px, 0px, 0px)":s[o.animType]="translate3d(0px,"+t+"px, 0px)",o.$slideTrack.css(s),i&&setTimeout((function(){o.disableTransition(),i.call()}),o.options.speed))},t.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=e(t).not(this.$slider)),t},t.prototype.asNavFor=function(t){var i=this.getNavTarget();null!==i&&"object"==typeof i&&i.each((function(){var i=e(this).slick("getSlick");i.unslicked||i.slideHandler(t,!0)}))},t.prototype.applyTransition=function(e){var t=this,i={};!1===t.options.fade?i[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:i[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},t.prototype.autoPlay=function(){var e=this;e.autoPlayClear(),e.slideCount>e.options.slidesToShow&&(e.autoPlayTimer=setInterval(e.autoPlayIterator,e.options.autoplaySpeed))},t.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},t.prototype.autoPlayIterator=function(){var e=this,t=e.currentSlide+e.options.slidesToScroll;e.paused||e.interrupted||e.focussed||(!1===e.options.infinite&&(1===e.direction&&e.currentSlide+1===e.slideCount-1?e.direction=0:0===e.direction&&(t=e.currentSlide-e.options.slidesToScroll,e.currentSlide-1==0&&(e.direction=1))),e.slideHandler(t))},t.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=e(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=e(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},t.prototype.buildDots=function(){var t,i,s=this;if(!0===s.options.dots){for(s.$slider.addClass("slick-dotted"),i=e("<ul />").addClass(s.options.dotsClass),t=0;t<=s.getDotCount();t+=1)i.append(e("<li />").append(s.options.customPaging.call(this,s,t)));s.$dots=i.appendTo(s.options.appendDots),s.$dots.find("li").first().addClass("slick-active")}},t.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each((function(t,i){e(i).attr("data-slick-index",t).data("originalStyling",e(i).attr("style")||"")})),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?e('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0!==t.options.centerMode&&!0!==t.options.swipeToSlide||(t.options.slidesToScroll=1),e("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},t.prototype.buildRows=function(){var e,t,i,s,o,n,r,a=this;if(s=document.createDocumentFragment(),n=a.$slider.children(),a.options.rows>1){for(r=a.options.slidesPerRow*a.options.rows,o=Math.ceil(n.length/r),e=0;e<o;e++){var l=document.createElement("div");for(t=0;t<a.options.rows;t++){var d=document.createElement("div");for(i=0;i<a.options.slidesPerRow;i++){var c=e*r+(t*a.options.slidesPerRow+i);n.get(c)&&d.appendChild(n.get(c))}l.appendChild(d)}s.appendChild(l)}a.$slider.empty().append(s),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},t.prototype.checkResponsive=function(t,i){var s,o,n,r=this,a=!1,l=r.$slider.width(),d=window.innerWidth||e(window).width();if("window"===r.respondTo?n=d:"slider"===r.respondTo?n=l:"min"===r.respondTo&&(n=Math.min(d,l)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){for(s in o=null,r.breakpoints)r.breakpoints.hasOwnProperty(s)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[s]&&(o=r.breakpoints[s]):n>r.breakpoints[s]&&(o=r.breakpoints[s]));null!==o?null!==r.activeBreakpoint?(o!==r.activeBreakpoint||i)&&(r.activeBreakpoint=o,"unslick"===r.breakpointSettings[o]?r.unslick(o):(r.options=e.extend({},r.originalSettings,r.breakpointSettings[o]),!0===t&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),a=o):(r.activeBreakpoint=o,"unslick"===r.breakpointSettings[o]?r.unslick(o):(r.options=e.extend({},r.originalSettings,r.breakpointSettings[o]),!0===t&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),a=o):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===t&&(r.currentSlide=r.options.initialSlide),r.refresh(t),a=o),t||!1===a||r.$slider.trigger("breakpoint",[r,a])}},t.prototype.changeSlide=function(t,i){var s,o,n=this,r=e(t.currentTarget);switch(r.is("a")&&t.preventDefault(),r.is("li")||(r=r.closest("li")),s=n.slideCount%n.options.slidesToScroll!=0?0:(n.slideCount-n.currentSlide)%n.options.slidesToScroll,t.data.message){case"previous":o=0===s?n.options.slidesToScroll:n.options.slidesToShow-s,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide-o,!1,i);break;case"next":o=0===s?n.options.slidesToScroll:s,n.slideCount>n.options.slidesToShow&&n.slideHandler(n.currentSlide+o,!1,i);break;case"index":var a=0===t.data.index?0:t.data.index||r.index()*n.options.slidesToScroll;n.slideHandler(n.checkNavigable(a),!1,i),r.children().trigger("focus");break;default:return}},t.prototype.checkNavigable=function(e){var t,i;if(i=0,e>(t=this.getNavigableIndexes())[t.length-1])e=t[t.length-1];else for(var s in t){if(e<t[s]){e=i;break}i=t[s]}return e},t.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&null!==t.$dots&&(e("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",e.proxy(t.interrupt,t,!0)).off("mouseleave.slick",e.proxy(t.interrupt,t,!1)),!0===t.options.accessibility&&t.$dots.off("keydown.slick",t.keyHandler)),t.$slider.off("focus.slick blur.slick"),!0===t.options.arrows&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide),!0===t.options.accessibility&&(t.$prevArrow&&t.$prevArrow.off("keydown.slick",t.keyHandler),t.$nextArrow&&t.$nextArrow.off("keydown.slick",t.keyHandler))),t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler),t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler),t.$list.off("touchend.slick mouseup.slick",t.swipeHandler),t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler),t.$list.off("click.slick",t.clickHandler),e(document).off(t.visibilityChange,t.visibility),t.cleanUpSlideEvents(),!0===t.options.accessibility&&t.$list.off("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().off("click.slick",t.selectHandler),e(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange),e(window).off("resize.slick.slick-"+t.instanceUid,t.resize),e("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault),e(window).off("load.slick.slick-"+t.instanceUid,t.setPosition)},t.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.off("mouseleave.slick",e.proxy(t.interrupt,t,!1))},t.prototype.cleanUpRows=function(){var e,t=this;t.options.rows>1&&((e=t.$slides.children().children()).removeAttr("style"),t.$slider.empty().append(e))},t.prototype.clickHandler=function(e){!1===this.shouldClick&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},t.prototype.destroy=function(t){var i=this;i.autoPlayClear(),i.touchObject={},i.cleanUpEvents(),e(".slick-cloned",i.$slider).detach(),i.$dots&&i.$dots.remove(),i.$prevArrow&&i.$prevArrow.length&&(i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove()),i.$nextArrow&&i.$nextArrow.length&&(i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove()),i.$slides&&(i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each((function(){e(this).attr("style",e(this).data("originalStyling"))})),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.detach(),i.$list.detach(),i.$slider.append(i.$slides)),i.cleanUpRows(),i.$slider.removeClass("slick-slider"),i.$slider.removeClass("slick-initialized"),i.$slider.removeClass("slick-dotted"),i.unslicked=!0,t||i.$slider.trigger("destroy",[i])},t.prototype.disableTransition=function(e){var t=this,i={};i[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},t.prototype.fadeSlide=function(e,t){var i=this;!1===i.cssTransitions?(i.$slides.eq(e).css({zIndex:i.options.zIndex}),i.$slides.eq(e).animate({opacity:1},i.options.speed,i.options.easing,t)):(i.applyTransition(e),i.$slides.eq(e).css({opacity:1,zIndex:i.options.zIndex}),t&&setTimeout((function(){i.disableTransition(e),t.call()}),i.options.speed))},t.prototype.fadeSlideOut=function(e){var t=this;!1===t.cssTransitions?t.$slides.eq(e).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(e),t.$slides.eq(e).css({opacity:0,zIndex:t.options.zIndex-2}))},t.prototype.filterSlides=t.prototype.slickFilter=function(e){var t=this;null!==e&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(e).appendTo(t.$slideTrack),t.reinit())},t.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",(function(i){i.stopImmediatePropagation();var s=e(this);setTimeout((function(){t.options.pauseOnFocus&&(t.focussed=s.is(":focus"),t.autoPlay())}),0)}))},t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){return this.currentSlide},t.prototype.getDotCount=function(){var e=this,t=0,i=0,s=0;if(!0===e.options.infinite)if(e.slideCount<=e.options.slidesToShow)++s;else for(;t<e.slideCount;)++s,t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else if(!0===e.options.centerMode)s=e.slideCount;else if(e.options.asNavFor)for(;t<e.slideCount;)++s,t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else s=1+Math.ceil((e.slideCount-e.options.slidesToShow)/e.options.slidesToScroll);return s-1},t.prototype.getLeft=function(e){var t,i,s,o,n=this,r=0;return n.slideOffset=0,i=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,o=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?o=-1.5:1===n.options.slidesToShow&&(o=-2)),r=i*n.options.slidesToShow*o),n.slideCount%n.options.slidesToScroll!=0&&e+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(e>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(e-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(e-n.slideCount))*i*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*i*-1))):e+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(e+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(e+n.options.slidesToShow-n.slideCount)*i),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),t=!1===n.options.vertical?e*n.slideWidth*-1+n.slideOffset:e*i*-1+r,!0===n.options.variableWidth&&(s=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(e):n.$slideTrack.children(".slick-slide").eq(e+n.options.slidesToShow),t=!0===n.options.rtl?s[0]?-1*(n.$slideTrack.width()-s[0].offsetLeft-s.width()):0:s[0]?-1*s[0].offsetLeft:0,!0===n.options.centerMode&&(s=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(e):n.$slideTrack.children(".slick-slide").eq(e+n.options.slidesToShow+1),t=!0===n.options.rtl?s[0]?-1*(n.$slideTrack.width()-s[0].offsetLeft-s.width()):0:s[0]?-1*s[0].offsetLeft:0,t+=(n.$list.width()-s.outerWidth())/2)),t},t.prototype.getOption=t.prototype.slickGetOption=function(e){return this.options[e]},t.prototype.getNavigableIndexes=function(){var e,t=this,i=0,s=0,o=[];for(!1===t.options.infinite?e=t.slideCount:(i=-1*t.options.slidesToScroll,s=-1*t.options.slidesToScroll,e=2*t.slideCount);i<e;)o.push(i),i=s+t.options.slidesToScroll,s+=t.options.slidesToScroll<=t.options.slidesToShow?t.options.slidesToScroll:t.options.slidesToShow;return o},t.prototype.getSlick=function(){return this},t.prototype.getSlideCount=function(){var t,i,s=this;return i=!0===s.options.centerMode?s.slideWidth*Math.floor(s.options.slidesToShow/2):0,!0===s.options.swipeToSlide?(s.$slideTrack.find(".slick-slide").each((function(o,n){if(n.offsetLeft-i+e(n).outerWidth()/2>-1*s.swipeLeft)return t=n,!1})),Math.abs(e(t).attr("data-slick-index")-s.currentSlide)||1):s.options.slidesToScroll},t.prototype.goTo=t.prototype.slickGoTo=function(e,t){this.changeSlide({data:{message:"index",index:parseInt(e)}},t)},t.prototype.init=function(t){var i=this;e(i.$slider).hasClass("slick-initialized")||(e(i.$slider).addClass("slick-initialized"),i.buildRows(),i.buildOut(),i.setProps(),i.startLoad(),i.loadSlider(),i.initializeEvents(),i.updateArrows(),i.updateDots(),i.checkResponsive(!0),i.focusHandler()),t&&i.$slider.trigger("init",[i]),!0===i.options.accessibility&&i.initADA(),i.options.autoplay&&(i.paused=!1,i.autoPlay())},t.prototype.initADA=function(){var t=this,i=Math.ceil(t.slideCount/t.options.slidesToShow),s=t.getNavigableIndexes().filter((function(e){return e>=0&&e<t.slideCount}));t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each((function(i){var o=s.indexOf(i);e(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+i,tabindex:-1}),-1!==o&&e(this).attr({"aria-describedby":"slick-slide-control"+t.instanceUid+o})})),t.$dots.attr("role","tablist").find("li").each((function(o){var n=s[o];e(this).attr({role:"presentation"}),e(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+o,"aria-controls":"slick-slide"+t.instanceUid+n,"aria-label":o+1+" of "+i,"aria-selected":null,tabindex:"-1"})})).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var o=t.currentSlide,n=o+t.options.slidesToShow;o<n;o++)t.$slides.eq(o).attr("tabindex",0);t.activateADA()},t.prototype.initArrowEvents=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},e.changeSlide),e.$nextArrow.off("click.slick").on("click.slick",{message:"next"},e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow.on("keydown.slick",e.keyHandler),e.$nextArrow.on("keydown.slick",e.keyHandler)))},t.prototype.initDotEvents=function(){var t=this;!0===t.options.dots&&(e("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide),!0===t.options.accessibility&&t.$dots.on("keydown.slick",t.keyHandler)),!0===t.options.dots&&!0===t.options.pauseOnDotsHover&&e("li",t.$dots).on("mouseenter.slick",e.proxy(t.interrupt,t,!0)).on("mouseleave.slick",e.proxy(t.interrupt,t,!1))},t.prototype.initSlideEvents=function(){var t=this;t.options.pauseOnHover&&(t.$list.on("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.on("mouseleave.slick",e.proxy(t.interrupt,t,!1)))},t.prototype.initializeEvents=function(){var t=this;t.initArrowEvents(),t.initDotEvents(),t.initSlideEvents(),t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler),t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler),t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler),t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler),t.$list.on("click.slick",t.clickHandler),e(document).on(t.visibilityChange,e.proxy(t.visibility,t)),!0===t.options.accessibility&&t.$list.on("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),e(window).on("orientationchange.slick.slick-"+t.instanceUid,e.proxy(t.orientationChange,t)),e(window).on("resize.slick.slick-"+t.instanceUid,e.proxy(t.resize,t)),e("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault),e(window).on("load.slick.slick-"+t.instanceUid,t.setPosition),e(t.setPosition)},t.prototype.initUI=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.show(),e.$nextArrow.show()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.show()},t.prototype.keyHandler=function(e){var t=this;e.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===e.keyCode&&!0===t.options.accessibility?t.changeSlide({data:{message:!0===t.options.rtl?"next":"previous"}}):39===e.keyCode&&!0===t.options.accessibility&&t.changeSlide({data:{message:!0===t.options.rtl?"previous":"next"}}))},t.prototype.lazyLoad=function(){function t(t){e("img[data-lazy]",t).each((function(){var t=e(this),i=e(this).attr("data-lazy"),s=e(this).attr("data-srcset"),o=e(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){t.animate({opacity:0},100,(function(){s&&(t.attr("srcset",s),o&&t.attr("sizes",o)),t.attr("src",i).animate({opacity:1},200,(function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")})),n.$slider.trigger("lazyLoaded",[n,t,i])}))},r.onerror=function(){t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,t,i])},r.src=i}))}var i,s,o,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?o=(s=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(s=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),o=n.options.slidesToShow/2+1+2+n.currentSlide):(s=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,o=Math.ceil(s+n.options.slidesToShow),!0===n.options.fade&&(s>0&&s--,o<=n.slideCount&&o++)),i=n.$slider.find(".slick-slide").slice(s,o),"anticipated"===n.options.lazyLoad)for(var r=s-1,a=o,l=n.$slider.find(".slick-slide"),d=0;d<n.options.slidesToScroll;d++)r<0&&(r=n.slideCount-1),i=(i=i.add(l.eq(r))).add(l.eq(a)),r--,a++;t(i),n.slideCount<=n.options.slidesToShow?t(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?t(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&t(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},t.prototype.loadSlider=function(){var e=this;e.setPosition(),e.$slideTrack.css({opacity:1}),e.$slider.removeClass("slick-loading"),e.initUI(),"progressive"===e.options.lazyLoad&&e.progressiveLazyLoad()},t.prototype.next=t.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},t.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},t.prototype.pause=t.prototype.slickPause=function(){this.autoPlayClear(),this.paused=!0},t.prototype.play=t.prototype.slickPlay=function(){var e=this;e.autoPlay(),e.options.autoplay=!0,e.paused=!1,e.focussed=!1,e.interrupted=!1},t.prototype.postSlide=function(t){var i=this;i.unslicked||(i.$slider.trigger("afterChange",[i,t]),i.animating=!1,i.slideCount>i.options.slidesToShow&&i.setPosition(),i.swipeLeft=null,i.options.autoplay&&i.autoPlay(),!0===i.options.accessibility&&(i.initADA(),i.options.focusOnChange&&e(i.$slides.get(i.currentSlide)).attr("tabindex",0).focus()))},t.prototype.prev=t.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},t.prototype.preventDefault=function(e){e.preventDefault()},t.prototype.progressiveLazyLoad=function(t){t=t||1;var i,s,o,n,r,a=this,l=e("img[data-lazy]",a.$slider);l.length?(i=l.first(),s=i.attr("data-lazy"),o=i.attr("data-srcset"),n=i.attr("data-sizes")||a.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){o&&(i.attr("srcset",o),n&&i.attr("sizes",n)),i.attr("src",s).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===a.options.adaptiveHeight&&a.setPosition(),a.$slider.trigger("lazyLoaded",[a,i,s]),a.progressiveLazyLoad()},r.onerror=function(){t<3?setTimeout((function(){a.progressiveLazyLoad(t+1)}),500):(i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),a.$slider.trigger("lazyLoadError",[a,i,s]),a.progressiveLazyLoad())},r.src=s):a.$slider.trigger("allImagesLoaded",[a])},t.prototype.refresh=function(t){var i,s,o=this;s=o.slideCount-o.options.slidesToShow,!o.options.infinite&&o.currentSlide>s&&(o.currentSlide=s),o.slideCount<=o.options.slidesToShow&&(o.currentSlide=0),i=o.currentSlide,o.destroy(!0),e.extend(o,o.initials,{currentSlide:i}),o.init(),t||o.changeSlide({data:{message:"index",index:i}},!1)},t.prototype.registerBreakpoints=function(){var t,i,s,o=this,n=o.options.responsive||null;if("array"===e.type(n)&&n.length){for(t in o.respondTo=o.options.respondTo||"window",n)if(s=o.breakpoints.length-1,n.hasOwnProperty(t)){for(i=n[t].breakpoint;s>=0;)o.breakpoints[s]&&o.breakpoints[s]===i&&o.breakpoints.splice(s,1),s--;o.breakpoints.push(i),o.breakpointSettings[i]=n[t].settings}o.breakpoints.sort((function(e,t){return o.options.mobileFirst?e-t:t-e}))}},t.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},t.prototype.resize=function(){var t=this;e(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout((function(){t.windowWidth=e(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()}),50))},t.prototype.removeSlide=t.prototype.slickRemove=function(e,t,i){var s=this;if(e="boolean"==typeof e?!0===(t=e)?0:s.slideCount-1:!0===t?--e:e,s.slideCount<1||e<0||e>s.slideCount-1)return!1;s.unload(),!0===i?s.$slideTrack.children().remove():s.$slideTrack.children(this.options.slide).eq(e).remove(),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slidesCache=s.$slides,s.reinit()},t.prototype.setCSS=function(e){var t,i,s=this,o={};!0===s.options.rtl&&(e=-e),t="left"==s.positionProp?Math.ceil(e)+"px":"0px",i="top"==s.positionProp?Math.ceil(e)+"px":"0px",o[s.positionProp]=e,!1===s.transformsEnabled?s.$slideTrack.css(o):(o={},!1===s.cssTransitions?(o[s.animType]="translate("+t+", "+i+")",s.$slideTrack.css(o)):(o[s.animType]="translate3d("+t+", "+i+", 0px)",s.$slideTrack.css(o)))},t.prototype.setDimensions=function(){var e=this;!1===e.options.vertical?!0===e.options.centerMode&&e.$list.css({padding:"0px "+e.options.centerPadding}):(e.$list.height(e.$slides.first().outerHeight(!0)*e.options.slidesToShow),!0===e.options.centerMode&&e.$list.css({padding:e.options.centerPadding+" 0px"})),e.listWidth=e.$list.width(),e.listHeight=e.$list.height(),!1===e.options.vertical&&!1===e.options.variableWidth?(e.slideWidth=Math.ceil(e.listWidth/e.options.slidesToShow),e.$slideTrack.width(Math.ceil(e.slideWidth*e.$slideTrack.children(".slick-slide").length))):!0===e.options.variableWidth?e.$slideTrack.width(5e3*e.slideCount):(e.slideWidth=Math.ceil(e.listWidth),e.$slideTrack.height(Math.ceil(e.$slides.first().outerHeight(!0)*e.$slideTrack.children(".slick-slide").length)));var t=e.$slides.first().outerWidth(!0)-e.$slides.first().width();!1===e.options.variableWidth&&e.$slideTrack.children(".slick-slide").width(e.slideWidth-t)},t.prototype.setFade=function(){var t,i=this;i.$slides.each((function(s,o){t=i.slideWidth*s*-1,!0===i.options.rtl?e(o).css({position:"relative",right:t,top:0,zIndex:i.options.zIndex-2,opacity:0}):e(o).css({position:"relative",left:t,top:0,zIndex:i.options.zIndex-2,opacity:0})})),i.$slides.eq(i.currentSlide).css({zIndex:i.options.zIndex-1,opacity:1})},t.prototype.setHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.css("height",t)}},t.prototype.setOption=t.prototype.slickSetOption=function(){var t,i,s,o,n,r=this,a=!1;if("object"===e.type(arguments[0])?(s=arguments[0],a=arguments[1],n="multiple"):"string"===e.type(arguments[0])&&(s=arguments[0],o=arguments[1],a=arguments[2],"responsive"===arguments[0]&&"array"===e.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[s]=o;else if("multiple"===n)e.each(s,(function(e,t){r.options[e]=t}));else if("responsive"===n)for(i in o)if("array"!==e.type(r.options.responsive))r.options.responsive=[o[i]];else{for(t=r.options.responsive.length-1;t>=0;)r.options.responsive[t].breakpoint===o[i].breakpoint&&r.options.responsive.splice(t,1),t--;r.options.responsive.push(o[i])}a&&(r.unload(),r.reinit())},t.prototype.setPosition=function(){var e=this;e.setDimensions(),e.setHeight(),!1===e.options.fade?e.setCSS(e.getLeft(e.currentSlide)):e.setFade(),e.$slider.trigger("setPosition",[e])},t.prototype.setProps=function(){var e=this,t=document.body.style;e.positionProp=!0===e.options.vertical?"top":"left","top"===e.positionProp?e.$slider.addClass("slick-vertical"):e.$slider.removeClass("slick-vertical"),void 0===t.WebkitTransition&&void 0===t.MozTransition&&void 0===t.msTransition||!0===e.options.useCSS&&(e.cssTransitions=!0),e.options.fade&&("number"==typeof e.options.zIndex?e.options.zIndex<3&&(e.options.zIndex=3):e.options.zIndex=e.defaults.zIndex),void 0!==t.OTransform&&(e.animType="OTransform",e.transformType="-o-transform",e.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.MozTransform&&(e.animType="MozTransform",e.transformType="-moz-transform",e.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(e.animType=!1)),void 0!==t.webkitTransform&&(e.animType="webkitTransform",e.transformType="-webkit-transform",e.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.msTransform&&(e.animType="msTransform",e.transformType="-ms-transform",e.transitionType="msTransition",void 0===t.msTransform&&(e.animType=!1)),void 0!==t.transform&&!1!==e.animType&&(e.animType="transform",e.transformType="transform",e.transitionType="transition"),e.transformsEnabled=e.options.useTransform&&null!==e.animType&&!1!==e.animType},t.prototype.setSlideClasses=function(e){var t,i,s,o,n=this;if(i=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(e).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;t=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(e>=t&&e<=n.slideCount-1-t?n.$slides.slice(e-t+r,e+t+1).addClass("slick-active").attr("aria-hidden","false"):(s=n.options.slidesToShow+e,i.slice(s-t+1+r,s+t+2).addClass("slick-active").attr("aria-hidden","false")),0===e?i.eq(i.length-1-n.options.slidesToShow).addClass("slick-center"):e===n.slideCount-1&&i.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(e).addClass("slick-center")}else e>=0&&e<=n.slideCount-n.options.slidesToShow?n.$slides.slice(e,e+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):i.length<=n.options.slidesToShow?i.addClass("slick-active").attr("aria-hidden","false"):(o=n.slideCount%n.options.slidesToShow,s=!0===n.options.infinite?n.options.slidesToShow+e:e,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-e<n.options.slidesToShow?i.slice(s-(n.options.slidesToShow-o),s+o).addClass("slick-active").attr("aria-hidden","false"):i.slice(s,s+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},t.prototype.setupInfinite=function(){var t,i,s,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(i=null,o.slideCount>o.options.slidesToShow)){for(s=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,t=o.slideCount;t>o.slideCount-s;t-=1)i=t-1,e(o.$slides[i]).clone(!0).attr("id","").attr("data-slick-index",i-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(t=0;t<s+o.slideCount;t+=1)i=t,e(o.$slides[i]).clone(!0).attr("id","").attr("data-slick-index",i+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each((function(){e(this).attr("id","")}))}},t.prototype.interrupt=function(e){e||this.autoPlay(),this.interrupted=e},t.prototype.selectHandler=function(t){var i=this,s=e(t.target).is(".slick-slide")?e(t.target):e(t.target).parents(".slick-slide"),o=parseInt(s.attr("data-slick-index"));o||(o=0),i.slideCount<=i.options.slidesToShow?i.slideHandler(o,!1,!0):i.slideHandler(o)},t.prototype.slideHandler=function(e,t,i){var s,o,n,r,a,l=null,d=this;if(t=t||!1,!(!0===d.animating&&!0===d.options.waitForAnimate||!0===d.options.fade&&d.currentSlide===e))if(!1===t&&d.asNavFor(e),s=e,l=d.getLeft(s),r=d.getLeft(d.currentSlide),d.currentLeft=null===d.swipeLeft?r:d.swipeLeft,!1===d.options.infinite&&!1===d.options.centerMode&&(e<0||e>d.getDotCount()*d.options.slidesToScroll))!1===d.options.fade&&(s=d.currentSlide,!0!==i?d.animateSlide(r,(function(){d.postSlide(s)})):d.postSlide(s));else if(!1===d.options.infinite&&!0===d.options.centerMode&&(e<0||e>d.slideCount-d.options.slidesToScroll))!1===d.options.fade&&(s=d.currentSlide,!0!==i?d.animateSlide(r,(function(){d.postSlide(s)})):d.postSlide(s));else{if(d.options.autoplay&&clearInterval(d.autoPlayTimer),o=s<0?d.slideCount%d.options.slidesToScroll!=0?d.slideCount-d.slideCount%d.options.slidesToScroll:d.slideCount+s:s>=d.slideCount?d.slideCount%d.options.slidesToScroll!=0?0:s-d.slideCount:s,d.animating=!0,d.$slider.trigger("beforeChange",[d,d.currentSlide,o]),n=d.currentSlide,d.currentSlide=o,d.setSlideClasses(d.currentSlide),d.options.asNavFor&&(a=(a=d.getNavTarget()).slick("getSlick")).slideCount<=a.options.slidesToShow&&a.setSlideClasses(d.currentSlide),d.updateDots(),d.updateArrows(),!0===d.options.fade)return!0!==i?(d.fadeSlideOut(n),d.fadeSlide(o,(function(){d.postSlide(o)}))):d.postSlide(o),void d.animateHeight();!0!==i?d.animateSlide(l,(function(){d.postSlide(o)})):d.postSlide(o)}},t.prototype.startLoad=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.hide(),e.$nextArrow.hide()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.hide(),e.$slider.addClass("slick-loading")},t.prototype.swipeDirection=function(){var e,t,i,s,o=this;return e=o.touchObject.startX-o.touchObject.curX,t=o.touchObject.startY-o.touchObject.curY,i=Math.atan2(t,e),(s=Math.round(180*i/Math.PI))<0&&(s=360-Math.abs(s)),s<=45&&s>=0||s<=360&&s>=315?!1===o.options.rtl?"left":"right":s>=135&&s<=225?!1===o.options.rtl?"right":"left":!0===o.options.verticalSwiping?s>=35&&s<=135?"down":"up":"vertical"},t.prototype.swipeEnd=function(e){var t,i,s=this;if(s.dragging=!1,s.swiping=!1,s.scrolling)return s.scrolling=!1,!1;if(s.interrupted=!1,s.shouldClick=!(s.touchObject.swipeLength>10),void 0===s.touchObject.curX)return!1;if(!0===s.touchObject.edgeHit&&s.$slider.trigger("edge",[s,s.swipeDirection()]),s.touchObject.swipeLength>=s.touchObject.minSwipe){switch(i=s.swipeDirection()){case"left":case"down":t=s.options.swipeToSlide?s.checkNavigable(s.currentSlide+s.getSlideCount()):s.currentSlide+s.getSlideCount(),s.currentDirection=0;break;case"right":case"up":t=s.options.swipeToSlide?s.checkNavigable(s.currentSlide-s.getSlideCount()):s.currentSlide-s.getSlideCount(),s.currentDirection=1}"vertical"!=i&&(s.slideHandler(t),s.touchObject={},s.$slider.trigger("swipe",[s,i]))}else s.touchObject.startX!==s.touchObject.curX&&(s.slideHandler(s.currentSlide),s.touchObject={})},t.prototype.swipeHandler=function(e){var t=this;if(!(!1===t.options.swipe||"ontouchend"in document&&!1===t.options.swipe||!1===t.options.draggable&&-1!==e.type.indexOf("mouse")))switch(t.touchObject.fingerCount=e.originalEvent&&void 0!==e.originalEvent.touches?e.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),e.data.action){case"start":t.swipeStart(e);break;case"move":t.swipeMove(e);break;case"end":t.swipeEnd(e)}},t.prototype.swipeMove=function(e){var t,i,s,o,n,r,a=this;return n=void 0!==e.originalEvent?e.originalEvent.touches:null,!(!a.dragging||a.scrolling||n&&1!==n.length)&&(t=a.getLeft(a.currentSlide),a.touchObject.curX=void 0!==n?n[0].pageX:e.clientX,a.touchObject.curY=void 0!==n?n[0].pageY:e.clientY,a.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(a.touchObject.curX-a.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(a.touchObject.curY-a.touchObject.startY,2))),!a.options.verticalSwiping&&!a.swiping&&r>4?(a.scrolling=!0,!1):(!0===a.options.verticalSwiping&&(a.touchObject.swipeLength=r),i=a.swipeDirection(),void 0!==e.originalEvent&&a.touchObject.swipeLength>4&&(a.swiping=!0,e.preventDefault()),o=(!1===a.options.rtl?1:-1)*(a.touchObject.curX>a.touchObject.startX?1:-1),!0===a.options.verticalSwiping&&(o=a.touchObject.curY>a.touchObject.startY?1:-1),s=a.touchObject.swipeLength,a.touchObject.edgeHit=!1,!1===a.options.infinite&&(0===a.currentSlide&&"right"===i||a.currentSlide>=a.getDotCount()&&"left"===i)&&(s=a.touchObject.swipeLength*a.options.edgeFriction,a.touchObject.edgeHit=!0),!1===a.options.vertical?a.swipeLeft=t+s*o:a.swipeLeft=t+s*(a.$list.height()/a.listWidth)*o,!0===a.options.verticalSwiping&&(a.swipeLeft=t+s*o),!0!==a.options.fade&&!1!==a.options.touchMove&&(!0===a.animating?(a.swipeLeft=null,!1):void a.setCSS(a.swipeLeft))))},t.prototype.swipeStart=function(e){var t,i=this;if(i.interrupted=!0,1!==i.touchObject.fingerCount||i.slideCount<=i.options.slidesToShow)return i.touchObject={},!1;void 0!==e.originalEvent&&void 0!==e.originalEvent.touches&&(t=e.originalEvent.touches[0]),i.touchObject.startX=i.touchObject.curX=void 0!==t?t.pageX:e.clientX,i.touchObject.startY=i.touchObject.curY=void 0!==t?t.pageY:e.clientY,i.dragging=!0},t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var e=this;null!==e.$slidesCache&&(e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.appendTo(e.$slideTrack),e.reinit())},t.prototype.unload=function(){var t=this;e(".slick-cloned",t.$slider).remove(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove(),t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove(),t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},t.prototype.unslick=function(e){var t=this;t.$slider.trigger("unslick",[t,e]),t.destroy()},t.prototype.updateArrows=function(){var e=this;Math.floor(e.options.slidesToShow/2),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):(e.currentSlide>=e.slideCount-e.options.slidesToShow&&!1===e.options.centerMode||e.currentSlide>=e.slideCount-1&&!0===e.options.centerMode)&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},t.prototype.updateDots=function(){var e=this;null!==e.$dots&&(e.$dots.find("li").removeClass("slick-active").end(),e.$dots.find("li").eq(Math.floor(e.currentSlide/e.options.slidesToScroll)).addClass("slick-active"))},t.prototype.visibility=function(){var e=this;e.options.autoplay&&(document[e.hidden]?e.interrupted=!0:e.interrupted=!1)},e.fn.slick=function(){var e,i,s=this,o=arguments[0],n=Array.prototype.slice.call(arguments,1),r=s.length;for(e=0;e<r;e++)if("object"==typeof o||void 0===o?s[e].slick=new t(s[e],o):i=s[e].slick[o].apply(s[e].slick,n),void 0!==i)return i;return s}},void 0===(n=s.apply(t,o))||(e.exports=n)}()},311:function(e){"use strict";e.exports=jQuery}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](i,i.exports,__webpack_require__),i.exports}var __webpack_exports__={};!function(){"use strict";__webpack_require__(340),__webpack_require__(741),__webpack_require__(797);var e=React,t=function(){return(0,e.createElement)("svg",{id:"sg-logo",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 300 300"},(0,e.createElement)("g",{fill:"#a46497"},(0,e.createElement)("path",{d:"M108.592,263.672c0,0,23.812,5.895,29.47,7.309c5.659,1.416,15.088,0.474,15.325-10.845c0.236-11.317,0-35.129,0-42.438 c0-7.309,2.123-16.975,9.668-16.975c7.543,0,7.777,11.788,12.021,13.674c4.242,1.888,16.268,1.181,21.219-11.551 s3.771-33.244-6.838-39.138c-10.607-5.896-15.795,6.836-20.746,10.372c-4.949,3.537-14.852,1.416-15.795-11.315 c-0.943-12.732,0.707-37.251-3.3-44.56c-4.009-7.311-9.904-8.725-23.104-7.544c-13.202,1.18-27.114,4.715-27.114,4.715 L108.592,263.672z"}),(0,e.createElement)("path",{d:"M165.883,169.247c-2.594,1.415-4.715,0.354-4.715-7.663s0.236-30.413,0.236-37.486s4.479-16.268,16.502-12.968 s37.486,11.081,40.316,12.023c2.828,0.943,1.885,8.251,1.414,11.554c-0.473,3.301-8.959,91.712-8.959,94.776 c0,3.066-1.18,5.424-5.658,8.961c-4.48,3.536-33.008,24.99-36.309,26.877c-3.301,1.886-7.309,1.888-7.309-5.423 c0-7.309,0-43.381,0-46.683c0-3.299,0.234-7.073,3.063-2.122c2.83,4.951,8.725,13.438,22.869,8.96 c14.148-4.479,19.098-29.235,16.033-42.201c-3.063-12.967-13.203-23.341-22.635-21.219 C171.307,158.756,165.883,169.247,165.883,169.247z"}),(0,e.createElement)("path",{d:"M55.782,122.685l17.684,132.5c0,0-16.032-3.065-20.512-4.716c-4.48-1.65-8.488-8.487-10.847-17.918 s-4.479-18.627-5.659-23.813c-1.178-5.187,0.709-8.486,4.008-7.072c3.301,1.414,8.959,10.139,16.269,4.009 c7.31-6.131-0.707-35.365-6.603-37.959c-5.895-2.593-9.666,1.181-9.901,6.603c-0.236,5.422-5.894,5.895-8.017,4.243 c-2.121-1.65-4.951-12.023-7.309-22.162s-4.244-20.748-2.122-24.284c2.122-3.535,11.08-5.188,16.976-6.365 C45.642,124.571,55.782,122.685,55.782,122.685z"}),(0,e.createElement)("path",{d:"M95.625,110.66c0,0-4.008-1.65-3.299,7.073c0.707,8.724,10.608,150.417,10.608,150.417l-23.104-7.308 c0,0-17.447-125.663-18.39-132.736c-0.942-7.072-2.593-12.26,7.31-14.146S95.625,110.66,95.625,110.66z"}),(0,e.createElement)("path",{d:"M92.325,117.734c-0.378-4.663,0.592-6.351,1.576-6.923c-4.563,0.413-17.158,1.627-25.152,3.149 c-9.901,1.886-8.25,7.074-7.309,14.146c0.215,1.613,1.292,9.416,2.824,20.48c3.799-4.101,15.023-13.447,30.158-1.669 C93.325,131.38,92.51,120.011,92.325,117.734z"}),(0,e.createElement)("path",{d:"M93.9,110.811c1.089-0.097,1.726-0.15,1.726-0.15S94.758,110.314,93.9,110.811z"}),(0,e.createElement)("path",{d:"M79.831,260.843l23.104,7.308c0,0-0.152-2.191-0.423-6.042c-9.765-2.707-19.821-9.14-24.193-12.152 C79.258,256.724,79.831,260.843,79.831,260.843z"}),(0,e.createElement)("path",{d:"M131.816,102.821c0,0,27.407-1.415,36.249-1.061c8.842,0.354,17.15,2.299,17.15,2.299s36.957,0.354,62.42-6.188 s28.291-16.269,30.061-23.519s-1.77-13.438-7.957-18.389c-6.189-4.951-34.127-24.226-34.127-24.226s6.885,18.743-0.178,31.829 C224.648,83.548,193.881,95.748,131.816,102.821z"}),(0,e.createElement)("path",{d:"M131.993,98.754l22.986-4.42c0,0,44.207-45.443,74.973-35.188c0,0,6.014-25.108-9.193-30.59 C205.553,23.075,173.369,30.147,131.993,98.754z"}),(0,e.createElement)("path",{d:"M106.177,103.705c0,0-21.042-1.062-31.652-5.835c-10.608-4.774-16.091-13.438-13.792-27.763c0,0-9.195-7.603-24.225-7.426 c-15.03,0.177-11.141,26.523,0.531,36.603C48.709,109.364,72.403,112.016,106.177,103.705z"}),(0,e.createElement)("path",{d:"M65.991,92.006c-4.783-5.063-6.818-12.17-5.258-21.897c0,0-9.195-7.603-24.225-7.426 c-7.943,0.092-10.598,7.496-9.618,15.941C31.366,82.897,43.997,92.581,65.991,92.006z"}),(0,e.createElement)("path",{d:"M105.823,99.815c0,0-1.592-5.835,0.178-8.665c0,0-9.902-26.522-19.981-33.419c-10.079-6.896-29.589-5.895-46.21-0.942 C39.808,56.788,83.779,61.385,105.823,99.815z"}),(0,e.createElement)("path",{d:"M86.019,57.731c-10.079-6.896-29.589-5.895-46.21-0.942c0,0,20.557,2.155,40.605,15.801 c3.803,1.434,7.342,1.964,7.728,0.173c0.511-2.39-3.256-10.875,5.709-6.208C91.374,62.802,88.704,59.569,86.019,57.731z"}),(0,e.createElement)("path",{d:"M122.09,87.615c0,0-10.963-1.237-12.024,7.428c-1.062,8.664,2.829,9.372,2.829,9.372l13.969-0.708 c0,0,0.178-7.78,7.073-15.385C133.937,88.322,130.401,82.84,122.09,87.615z"}),(0,e.createElement)("path",{d:"M133.937,88.322c0,0-3.537-5.48-11.847-0.707c0,0-9.353-1.039-11.606,5.644c0.878,1.865,3.019,4.632,6.125,4.259 c4.356-0.522,8.022,2.031,12.19-1.272C129.843,93.826,131.45,91.064,133.937,88.322z"})))};const{RadioControl:i,ServerSideRender:s,PanelBody:o,SelectControl:n,Toolbar:r,Snackbar:a}=wp.components,{__:__}=wp.i18n,{Fragment:l,Component:d}=wp.element,{InspectorControls:c,BlockControls:p}=wp.blockEditor;wp.apiFetch;const{registerBlockType:u}=wp.blocks,{__:h}=wp.i18n;u("simple-giveaways/giveaway",{title:h("Giveaway"),description:h("Show a giveaway"),icon:t,category:"simple-giveaways",attributes:{id:{type:"string",default:"0"},hide_link:{type:"string",default:"current"},title:{type:"string",default:"0"},prizes:{type:"string",default:"1"},show_total_entries:{type:"string",default:"0"},show_entries:{type:"string",default:"0"},countdown_in_header:{type:"string",default:"0"},hide_winners_number:{type:"string",default:"0"},hide_prize_value:{type:"string",default:"0"},hide_prize_title:{type:"string",default:"0"},content:{type:"string",default:"0"},rules:{type:"string",default:"0"}},edit:class extends d{constructor(e){super(...e),this.state={giveaways:[]},this.props=e,this.get_giveaways=this.get_giveaways.bind(this),this.maybeStartSlider=this.maybeStartSlider.bind(this),this.startLibraries=this.startLibraries.bind(this)}componentDidMount(){this.get_giveaways()}get_giveaways(){var e=this;fetch(window.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=sg_get_available_giveaways",credentials:"same-origin"}).then((function(e){return e.json()})).then((function(t){t.success&&e.setState({giveaways:t.data})}))}startLibraries(){const e=this;setTimeout((function(){e.maybeStartSlider(),e.maybeStartCountdown()}),arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3)}maybeStartCountdown(){var e=jQuery,t=e(".giveasap_countdown:not(.countdown-started)");t.length&&t.each((function(){var t=e(this).attr("data-end");e(this).countdown({until:new Date(1e3*t),format:"dHMS"})})).addClass("countdown-started")}maybeStartSlider(){jQuery(".sg-giveaway-prizes-slider:not(.slick-started)").length&&jQuery(".sg-giveaway-prizes-slider:not(.slick-started)").slick({infinite:!0,slidesToShow:1,slidesToScroll:1,arrows:!1,dots:!0}).addClass("slick-started")}render(){let t=[{label:__("Select a Giveaway"),value:0}];const{attributes:a,setAttributes:d,isSelected:u}=this.props;let h="",f=(0,e.createElement)("p",null,__("Please, select a giveaway to show"));const g=parseInt(a.id);return t=this.state.giveaways.length?t.concat(this.state.giveaways.map((e=>({label:e.post_title,value:e.ID})))):[],0===t.length&&(h=(0,e.createElement)("p",null,__("No Giveaways found."))),parseInt(a.id)>0&&(f=(0,e.createElement)(s,{block:"simple-giveaways/giveaway",attributes:a}),this.startLibraries()),(0,e.createElement)(l,null,(0,e.createElement)(c,null,(0,e.createElement)(o,{title:__("Display Options"),initialOpen:!0},t.length>1&&[(0,e.createElement)(n,{label:__("Giveaway"),value:g,options:t,onChange:e=>{d({id:e}),this.startLibraries()}}),(0,e.createElement)(i,{label:__("Show Giveaway Title"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.title,onChange:e=>{d({title:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Show Giveaway Content"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.content,onChange:e=>{d({content:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Show Rules"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.rules,onChange:e=>{d({rules:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Show Prizes"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.prizes,onChange:e=>{d({prizes:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Show Total Entries"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.show_total_entries,onChange:e=>{d({show_total_entries:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Show Your Entries"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.show_entries,onChange:e=>{d({show_entries:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Countdown in Header"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.countdown_in_header,onChange:e=>{d({countdown_in_header:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Hide Winners Number"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.hide_winners_number,onChange:e=>{d({hide_winners_number:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Hide Prize Value"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.hide_prize_value,onChange:e=>{d({hide_prize_value:e}),this.startLibraries(2e3)}}),(0,e.createElement)(i,{label:__("Hide Prize Title"),options:[{value:"0",label:__("No")},{value:"1",label:__("Yes")}],selected:a.hide_prize_title,onChange:e=>{d({hide_prize_title:e}),this.startLibraries(2e3)}})],h)),(0,e.createElement)(p,null,(0,e.createElement)(r,{controls:[{icon:"image-rotate",title:"Reload countdown/slider if not started",isActive:!1,onClick:()=>{this.startLibraries(100)}}]})),f)}},save:()=>null});const{ServerSideRender:f,PanelBody:g,SelectControl:w,Toolbar:v}=wp.components,{__:m}=wp.i18n,{Fragment:y,Component:_}=wp.element,{InspectorControls:k,BlockControls:S}=wp.blockEditor,{registerBlockType:b}=wp.blocks,{__:T}=wp.i18n;b("simple-giveaways/countdown",{title:T("Countdown"),description:T("Show the giveaway countdown"),icon:t,category:"simple-giveaways",attributes:{id:{type:"string",default:"0"}},edit:class extends _{constructor(e){super(...e),this.state={giveaways:[]},this.props=e,this.get_giveaways=this.get_giveaways.bind(this),this.startLibraries=this.startLibraries.bind(this)}componentDidMount(){this.get_giveaways()}get_giveaways(){var e=this;fetch(window.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=sg_get_available_giveaways",credentials:"same-origin"}).then((function(e){return e.json()})).then((function(t){t.success&&e.setState({giveaways:t.data})}))}startLibraries(){const e=this;setTimeout((function(){e.maybeStartCountdown()}),arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3)}maybeStartCountdown(){var e=jQuery,t=e(".giveasap_countdown:not(.countdown-started)");t.length&&t.each((function(){var t=e(this).attr("data-end");e(this).countdown({until:new Date(1e3*t),format:"dHMS"})})).addClass("countdown-started")}render(){let t=[{label:m("Select a Giveaway"),value:0}];const{attributes:i,setAttributes:s,isSelected:o}=this.props;let n="",r=(0,e.createElement)("p",null,m("Please, select a giveaway to show"));const a=parseInt(i.id);return t=this.state.giveaways.length?t.concat(this.state.giveaways.map((e=>({label:e.post_title,value:e.ID})))):[],0===t.length&&(n=(0,e.createElement)("p",null,m("No Giveaways found."))),parseInt(i.id)>0&&(r=(0,e.createElement)(f,{block:"simple-giveaways/countdown",attributes:i}),this.startLibraries()),(0,e.createElement)(y,null,(0,e.createElement)(k,null,(0,e.createElement)(g,{title:m("Display Options"),initialOpen:!0},t.length>1&&[(0,e.createElement)(w,{label:m("Giveaway"),value:a,options:t,onChange:e=>{s({id:e}),this.startLibraries()}})],n)),(0,e.createElement)(S,null,(0,e.createElement)(v,{controls:[{icon:"image-rotate",title:"Reload countdown/slider if not started",isActive:!1,onClick:()=>{this.startLibraries(100)}}]})),r)}},save:()=>null});const{ServerSideRender:C,PanelBody:$,SelectControl:x}=wp.components,{__:M}=wp.i18n,{Fragment:E,Component:D}=wp.element,{InspectorControls:A}=wp.blockEditor,{registerBlockType:z}=wp.blocks,{__:L}=wp.i18n;z("simple-giveaways/winners",{title:L("Winners"),description:L("Show the giveaway winners"),icon:t,category:"simple-giveaways",attributes:{id:{type:"string",default:"0"}},edit:class extends D{constructor(e){super(...e),this.state={giveaways:[]},this.props=e,this.get_giveaways=this.get_giveaways.bind(this)}componentDidMount(){this.get_giveaways()}get_giveaways(){var e=this;fetch(window.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=sg_get_available_giveaways",credentials:"same-origin"}).then((function(e){return e.json()})).then((function(t){t.success&&e.setState({giveaways:t.data})}))}render(){let t=[{label:M("Select a Giveaway"),value:0}];const{attributes:i,setAttributes:s,isSelected:o}=this.props;let n="",r=(0,e.createElement)("p",null,M("Please, select a giveaway to show"));const a=parseInt(i.id);return t=this.state.giveaways.length?t.concat(this.state.giveaways.map((e=>({label:e.post_title,value:e.ID})))):[],0===t.length&&(n=(0,e.createElement)("p",null,M("No Giveaways found."))),parseInt(i.id)>0&&(r=(0,e.createElement)(C,{block:"simple-giveaways/winners",attributes:i})),(0,e.createElement)(E,null,(0,e.createElement)(A,null,(0,e.createElement)($,{title:M("Display Options"),initialOpen:!0},t.length>1&&[(0,e.createElement)(x,{label:M("Giveaway"),value:a,options:t,onChange:e=>{s({id:e})}})],n)),r)}},save:()=>null})}()})(); 1 /******/ (function() { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ "./assets/js/blocks/countdown/edit.js": 5 /*!********************************************!*\ 6 !*** ./assets/js/blocks/countdown/edit.js ***! 7 \********************************************/ 8 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 9 10 "use strict"; 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 13 /* harmony export */ "default": function() { return /* binding */ Edit; } 14 /* harmony export */ }); 15 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "react"); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 17 18 const { 19 ServerSideRender, 20 PanelBody, 21 SelectControl, 22 Toolbar 23 } = wp.components; 24 const { 25 __ 26 } = wp.i18n; 27 const { 28 Fragment, 29 Component 30 } = wp.element; 31 const { 32 InspectorControls, 33 BlockControls 34 } = wp.blockEditor; 35 class Edit extends Component { 36 constructor(props) { 37 super(...props); 38 this.state = { 39 giveaways: [] 40 }; 41 this.props = props; 42 this.get_giveaways = this.get_giveaways.bind(this); 43 this.startLibraries = this.startLibraries.bind(this); 44 } 45 46 componentDidMount() { 47 this.get_giveaways(); 48 } 49 50 get_giveaways() { 51 var self = this; 52 fetch(window.ajaxurl, { 53 method: 'POST', 54 headers: { 55 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' 56 }, 57 body: 'action=sg_get_available_giveaways', 58 credentials: 'same-origin' 59 }).then(function (res) { 60 return res.json(); 61 }).then(function (res) { 62 if (res.success) { 63 self.setState({ 64 giveaways: res.data 65 }); 66 } 67 }); 68 } 69 70 startLibraries() { 71 let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000; 72 const self = this; 73 setTimeout(function () { 74 self.maybeStartCountdown(); 75 }, timeout); 76 } 77 /** 78 * Maybe Start Countdown 79 */ 80 81 82 maybeStartCountdown() { 83 var $ = jQuery, 84 $countdowns = $(".giveasap_countdown:not(.countdown-started)"); 85 86 if ($countdowns.length) { 87 $countdowns.each(function () { 88 var $timestamp = $(this).attr("data-end"); 89 $(this).countdown({ 90 until: new Date($timestamp * 1000), 91 format: 'dHMS' 92 }); 93 }).addClass('countdown-started'); 94 } 95 } 96 97 render() { 98 let giveaways = [{ 99 label: __('Select a Giveaway'), 100 value: 0 101 }]; 102 const { 103 attributes, 104 setAttributes, 105 isSelected 106 } = this.props; 107 let message = ''; 108 let blockContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('Please, select a giveaway to show')); 109 const selectedID = parseInt(attributes.id); 110 111 if (this.state.giveaways.length) { 112 giveaways = giveaways.concat(this.state.giveaways.map(post => { 113 return { 114 label: post.post_title, 115 value: post.ID 116 }; 117 })); 118 } else { 119 giveaways = []; 120 } 121 122 if (0 === giveaways.length) { 123 message = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('No Giveaways found.')); 124 } 125 126 if (parseInt(attributes.id) > 0) { 127 blockContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ServerSideRender, { 128 block: "simple-giveaways/countdown", 129 attributes: attributes 130 }); 131 this.startLibraries(); 132 } 133 134 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelBody, { 135 title: __('Display Options'), 136 initialOpen: true 137 }, giveaways.length > 1 && [(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, { 138 label: __('Giveaway'), 139 value: selectedID, 140 options: giveaways, 141 onChange: id => { 142 setAttributes({ 143 id: id 144 }); 145 this.startLibraries(); 146 } 147 })], message)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Toolbar, { 148 controls: [{ 149 icon: `image-rotate`, 150 title: `Reload countdown/slider if not started`, 151 isActive: false, 152 onClick: () => { 153 this.startLibraries(100); 154 } 155 }] 156 })), blockContent); 157 } 158 159 } 160 161 /***/ }), 162 163 /***/ "./assets/js/blocks/countdown/index.js": 164 /*!*********************************************!*\ 165 !*** ./assets/js/blocks/countdown/index.js ***! 166 \*********************************************/ 167 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 168 169 "use strict"; 170 __webpack_require__.r(__webpack_exports__); 171 /* harmony import */ var _logo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../logo */ "./assets/js/blocks/logo.js"); 172 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/countdown/edit.js"); 173 const { 174 registerBlockType 175 } = wp.blocks; 176 const { 177 __ 178 } = wp.i18n; 179 180 181 registerBlockType('simple-giveaways/countdown', { 182 title: __('Countdown'), 183 description: __('Show the giveaway countdown'), 184 icon: _logo__WEBPACK_IMPORTED_MODULE_0__["default"], 185 category: 'simple-giveaways', 186 attributes: { 187 id: { 188 type: 'string', 189 default: '0' 190 } 191 }, 192 edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], 193 194 save() { 195 return null; 196 } 197 198 }); 199 200 /***/ }), 201 202 /***/ "./assets/js/blocks/giveaway/edit.js": 203 /*!*******************************************!*\ 204 !*** ./assets/js/blocks/giveaway/edit.js ***! 205 \*******************************************/ 206 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 207 208 "use strict"; 209 __webpack_require__.r(__webpack_exports__); 210 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 211 /* harmony export */ "default": function() { return /* binding */ Edit; } 212 /* harmony export */ }); 213 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "react"); 214 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 215 216 const { 217 RadioControl, 218 ServerSideRender, 219 PanelBody, 220 SelectControl, 221 Toolbar, 222 Snackbar 223 } = wp.components; 224 const { 225 __ 226 } = wp.i18n; 227 const { 228 Fragment, 229 Component 230 } = wp.element; 231 const { 232 InspectorControls, 233 BlockControls 234 } = wp.blockEditor; 235 const apiFetch = wp.apiFetch; 236 237 function get_current_content_id() { 238 // Remove ? and then construct an array of objects. 239 const params = window.location.search.replace('?', '').split('&').map(param => { 240 const args = param.split('='); 241 return { 242 tag: args[0], 243 value: args[1] 244 }; 245 }); 246 let id = 'current'; 247 248 if (params.length) { 249 for (var querystring in params) { 250 const object = params[querystring]; 251 252 if ('post' === object['tag']) { 253 id = object['value']; 254 } 255 } 256 } 257 258 return id; 259 } 260 261 class Edit extends Component { 262 constructor(props) { 263 super(...props); 264 this.state = { 265 giveaways: [] 266 }; 267 this.props = props; 268 this.get_giveaways = this.get_giveaways.bind(this); 269 this.maybeStartSlider = this.maybeStartSlider.bind(this); 270 this.startLibraries = this.startLibraries.bind(this); 271 } 272 273 componentDidMount() { 274 this.get_giveaways(); 275 } 276 277 get_giveaways() { 278 var self = this; 279 fetch(window.ajaxurl, { 280 method: 'POST', 281 headers: { 282 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' 283 }, 284 body: 'action=sg_get_available_giveaways', 285 credentials: 'same-origin' 286 }).then(function (res) { 287 return res.json(); 288 }).then(function (res) { 289 if (res.success) { 290 self.setState({ 291 giveaways: res.data 292 }); 293 } 294 }); 295 } 296 297 startLibraries() { 298 let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000; 299 const self = this; 300 setTimeout(function () { 301 self.maybeStartSlider(); 302 self.maybeStartCountdown(); 303 }, timeout); 304 } 305 /** 306 * Maybe Start Countdown 307 */ 308 309 310 maybeStartCountdown() { 311 var $ = jQuery, 312 $countdowns = $(".giveasap_countdown:not(.countdown-started)"); 313 314 if ($countdowns.length) { 315 $countdowns.each(function () { 316 var $timestamp = $(this).attr("data-end"); 317 $(this).countdown({ 318 until: new Date($timestamp * 1000), 319 format: 'dHMS' 320 }); 321 }).addClass('countdown-started'); 322 } 323 } 324 /** 325 * Maybe Start the Slider 326 */ 327 328 329 maybeStartSlider() { 330 if (jQuery('.sg-giveaway-prizes-slider:not(.slick-started)').length) { 331 jQuery(".sg-giveaway-prizes-slider:not(.slick-started)").slick({ 332 // normal options... 333 infinite: true, 334 slidesToShow: 1, 335 slidesToScroll: 1, 336 arrows: false, 337 dots: true 338 }).addClass('slick-started'); 339 } 340 } 341 342 render() { 343 let giveaways = [{ 344 label: __('Select a Giveaway'), 345 value: 0 346 }]; 347 const { 348 attributes, 349 setAttributes, 350 isSelected 351 } = this.props; 352 let message = ''; 353 let blockContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('Please, select a giveaway to show')); 354 const selectedID = parseInt(attributes.id); 355 356 if (this.state.giveaways.length) { 357 giveaways = giveaways.concat(this.state.giveaways.map(post => { 358 return { 359 label: post.post_title, 360 value: post.ID 361 }; 362 })); 363 } else { 364 giveaways = []; 365 } 366 367 if (0 === giveaways.length) { 368 message = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('No Giveaways found.')); 369 } 370 371 if (parseInt(attributes.id) > 0) { 372 blockContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ServerSideRender, { 373 block: "simple-giveaways/giveaway", 374 attributes: attributes 375 }); 376 this.startLibraries(); 377 } 378 379 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelBody, { 380 title: __('Display Options'), 381 initialOpen: true 382 }, giveaways.length > 1 && [(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, { 383 label: __('Giveaway'), 384 value: selectedID, 385 options: giveaways, 386 onChange: id => { 387 setAttributes({ 388 id: id 389 }); 390 this.startLibraries(); 391 } 392 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 393 label: __('Show Giveaway Title'), 394 options: [{ 395 value: '0', 396 label: __('No') 397 }, { 398 value: '1', 399 label: __('Yes') 400 }], 401 selected: attributes.title, 402 onChange: title => { 403 setAttributes({ 404 title: title 405 }); 406 this.startLibraries(2000); 407 } 408 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 409 label: __('Show Giveaway Content'), 410 options: [{ 411 value: '0', 412 label: __('No') 413 }, { 414 value: '1', 415 label: __('Yes') 416 }], 417 selected: attributes.content, 418 onChange: value => { 419 setAttributes({ 420 content: value 421 }); 422 this.startLibraries(2000); 423 } 424 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 425 label: __('Show Rules'), 426 options: [{ 427 value: '0', 428 label: __('No') 429 }, { 430 value: '1', 431 label: __('Yes') 432 }], 433 selected: attributes.rules, 434 onChange: value => { 435 setAttributes({ 436 rules: value 437 }); 438 this.startLibraries(2000); 439 } 440 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 441 label: __('Show Prizes'), 442 options: [{ 443 value: '0', 444 label: __('No') 445 }, { 446 value: '1', 447 label: __('Yes') 448 }], 449 selected: attributes.prizes, 450 onChange: value => { 451 setAttributes({ 452 prizes: value 453 }); 454 this.startLibraries(2000); 455 } 456 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 457 label: __('Show Total Entries'), 458 options: [{ 459 value: '0', 460 label: __('No') 461 }, { 462 value: '1', 463 label: __('Yes') 464 }], 465 selected: attributes.show_total_entries, 466 onChange: value => { 467 setAttributes({ 468 show_total_entries: value 469 }); 470 this.startLibraries(2000); 471 } 472 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 473 label: __('Show Your Entries'), 474 options: [{ 475 value: '0', 476 label: __('No') 477 }, { 478 value: '1', 479 label: __('Yes') 480 }], 481 selected: attributes.show_entries, 482 onChange: value => { 483 setAttributes({ 484 show_entries: value 485 }); 486 this.startLibraries(2000); 487 } 488 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 489 label: __('Countdown in Header'), 490 options: [{ 491 value: '0', 492 label: __('No') 493 }, { 494 value: '1', 495 label: __('Yes') 496 }], 497 selected: attributes.countdown_in_header, 498 onChange: value => { 499 setAttributes({ 500 countdown_in_header: value 501 }); 502 this.startLibraries(2000); 503 } 504 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 505 label: __('Hide Winners Number'), 506 options: [{ 507 value: '0', 508 label: __('No') 509 }, { 510 value: '1', 511 label: __('Yes') 512 }], 513 selected: attributes.hide_winners_number, 514 onChange: value => { 515 setAttributes({ 516 hide_winners_number: value 517 }); 518 this.startLibraries(2000); 519 } 520 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 521 label: __('Hide Prize Value'), 522 options: [{ 523 value: '0', 524 label: __('No') 525 }, { 526 value: '1', 527 label: __('Yes') 528 }], 529 selected: attributes.hide_prize_value, 530 onChange: value => { 531 setAttributes({ 532 hide_prize_value: value 533 }); 534 this.startLibraries(2000); 535 } 536 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RadioControl, { 537 label: __('Hide Prize Title'), 538 options: [{ 539 value: '0', 540 label: __('No') 541 }, { 542 value: '1', 543 label: __('Yes') 544 }], 545 selected: attributes.hide_prize_title, 546 onChange: value => { 547 setAttributes({ 548 hide_prize_title: value 549 }); 550 this.startLibraries(2000); 551 } 552 })], message)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Toolbar, { 553 controls: [{ 554 icon: `image-rotate`, 555 title: `Reload countdown/slider if not started`, 556 isActive: false, 557 onClick: () => { 558 this.startLibraries(100); 559 } 560 }] 561 })), blockContent); 562 } 563 564 } 565 566 /***/ }), 567 568 /***/ "./assets/js/blocks/giveaway/index.js": 569 /*!********************************************!*\ 570 !*** ./assets/js/blocks/giveaway/index.js ***! 571 \********************************************/ 572 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 573 574 "use strict"; 575 __webpack_require__.r(__webpack_exports__); 576 /* harmony import */ var _logo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../logo */ "./assets/js/blocks/logo.js"); 577 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/giveaway/edit.js"); 578 const { 579 registerBlockType 580 } = wp.blocks; 581 const { 582 __ 583 } = wp.i18n; 584 585 586 registerBlockType('simple-giveaways/giveaway', { 587 title: __('Giveaway'), 588 description: __('Show a giveaway'), 589 icon: _logo__WEBPACK_IMPORTED_MODULE_0__["default"], 590 category: 'simple-giveaways', 591 attributes: { 592 id: { 593 type: 'string', 594 default: '0' 595 }, 596 hide_link: { 597 type: 'string', 598 default: 'current' 599 }, 600 title: { 601 type: 'string', 602 default: '0' 603 }, 604 prizes: { 605 type: 'string', 606 default: '1' 607 }, 608 show_total_entries: { 609 type: 'string', 610 default: '0' 611 }, 612 show_entries: { 613 type: 'string', 614 default: '0' 615 }, 616 countdown_in_header: { 617 type: 'string', 618 default: '0' 619 }, 620 hide_winners_number: { 621 type: 'string', 622 default: '0' 623 }, 624 hide_prize_value: { 625 type: 'string', 626 default: '0' 627 }, 628 hide_prize_title: { 629 type: 'string', 630 default: '0' 631 }, 632 content: { 633 type: 'string', 634 default: '0' 635 }, 636 rules: { 637 type: 'string', 638 default: '0' 639 } 640 }, 641 edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], 642 643 save() { 644 return null; 645 } 646 647 }); 648 649 /***/ }), 650 651 /***/ "./assets/js/blocks/logo.js": 652 /*!**********************************!*\ 653 !*** ./assets/js/blocks/logo.js ***! 654 \**********************************/ 655 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 656 657 "use strict"; 658 __webpack_require__.r(__webpack_exports__); 659 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "react"); 660 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 661 662 663 function Icon() { 664 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { 665 id: "sg-logo", 666 xmlns: "http://www.w3.org/2000/svg", 667 width: "20", 668 height: "20", 669 viewBox: "0 0 300 300" 670 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", { 671 fill: "#a46497" 672 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 673 d: "M108.592,263.672c0,0,23.812,5.895,29.47,7.309c5.659,1.416,15.088,0.474,15.325-10.845c0.236-11.317,0-35.129,0-42.438 c0-7.309,2.123-16.975,9.668-16.975c7.543,0,7.777,11.788,12.021,13.674c4.242,1.888,16.268,1.181,21.219-11.551 s3.771-33.244-6.838-39.138c-10.607-5.896-15.795,6.836-20.746,10.372c-4.949,3.537-14.852,1.416-15.795-11.315 c-0.943-12.732,0.707-37.251-3.3-44.56c-4.009-7.311-9.904-8.725-23.104-7.544c-13.202,1.18-27.114,4.715-27.114,4.715 L108.592,263.672z" 674 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 675 d: "M165.883,169.247c-2.594,1.415-4.715,0.354-4.715-7.663s0.236-30.413,0.236-37.486s4.479-16.268,16.502-12.968 s37.486,11.081,40.316,12.023c2.828,0.943,1.885,8.251,1.414,11.554c-0.473,3.301-8.959,91.712-8.959,94.776 c0,3.066-1.18,5.424-5.658,8.961c-4.48,3.536-33.008,24.99-36.309,26.877c-3.301,1.886-7.309,1.888-7.309-5.423 c0-7.309,0-43.381,0-46.683c0-3.299,0.234-7.073,3.063-2.122c2.83,4.951,8.725,13.438,22.869,8.96 c14.148-4.479,19.098-29.235,16.033-42.201c-3.063-12.967-13.203-23.341-22.635-21.219 C171.307,158.756,165.883,169.247,165.883,169.247z" 676 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 677 d: "M55.782,122.685l17.684,132.5c0,0-16.032-3.065-20.512-4.716c-4.48-1.65-8.488-8.487-10.847-17.918 s-4.479-18.627-5.659-23.813c-1.178-5.187,0.709-8.486,4.008-7.072c3.301,1.414,8.959,10.139,16.269,4.009 c7.31-6.131-0.707-35.365-6.603-37.959c-5.895-2.593-9.666,1.181-9.901,6.603c-0.236,5.422-5.894,5.895-8.017,4.243 c-2.121-1.65-4.951-12.023-7.309-22.162s-4.244-20.748-2.122-24.284c2.122-3.535,11.08-5.188,16.976-6.365 C45.642,124.571,55.782,122.685,55.782,122.685z" 678 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 679 d: "M95.625,110.66c0,0-4.008-1.65-3.299,7.073c0.707,8.724,10.608,150.417,10.608,150.417l-23.104-7.308 c0,0-17.447-125.663-18.39-132.736c-0.942-7.072-2.593-12.26,7.31-14.146S95.625,110.66,95.625,110.66z" 680 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 681 d: "M92.325,117.734c-0.378-4.663,0.592-6.351,1.576-6.923c-4.563,0.413-17.158,1.627-25.152,3.149 c-9.901,1.886-8.25,7.074-7.309,14.146c0.215,1.613,1.292,9.416,2.824,20.48c3.799-4.101,15.023-13.447,30.158-1.669 C93.325,131.38,92.51,120.011,92.325,117.734z" 682 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 683 d: "M93.9,110.811c1.089-0.097,1.726-0.15,1.726-0.15S94.758,110.314,93.9,110.811z" 684 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 685 d: "M79.831,260.843l23.104,7.308c0,0-0.152-2.191-0.423-6.042c-9.765-2.707-19.821-9.14-24.193-12.152 C79.258,256.724,79.831,260.843,79.831,260.843z" 686 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 687 d: "M131.816,102.821c0,0,27.407-1.415,36.249-1.061c8.842,0.354,17.15,2.299,17.15,2.299s36.957,0.354,62.42-6.188 s28.291-16.269,30.061-23.519s-1.77-13.438-7.957-18.389c-6.189-4.951-34.127-24.226-34.127-24.226s6.885,18.743-0.178,31.829 C224.648,83.548,193.881,95.748,131.816,102.821z" 688 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 689 d: "M131.993,98.754l22.986-4.42c0,0,44.207-45.443,74.973-35.188c0,0,6.014-25.108-9.193-30.59 C205.553,23.075,173.369,30.147,131.993,98.754z" 690 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 691 d: "M106.177,103.705c0,0-21.042-1.062-31.652-5.835c-10.608-4.774-16.091-13.438-13.792-27.763c0,0-9.195-7.603-24.225-7.426 c-15.03,0.177-11.141,26.523,0.531,36.603C48.709,109.364,72.403,112.016,106.177,103.705z" 692 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 693 d: "M65.991,92.006c-4.783-5.063-6.818-12.17-5.258-21.897c0,0-9.195-7.603-24.225-7.426 c-7.943,0.092-10.598,7.496-9.618,15.941C31.366,82.897,43.997,92.581,65.991,92.006z" 694 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 695 d: "M105.823,99.815c0,0-1.592-5.835,0.178-8.665c0,0-9.902-26.522-19.981-33.419c-10.079-6.896-29.589-5.895-46.21-0.942 C39.808,56.788,83.779,61.385,105.823,99.815z" 696 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 697 d: "M86.019,57.731c-10.079-6.896-29.589-5.895-46.21-0.942c0,0,20.557,2.155,40.605,15.801 c3.803,1.434,7.342,1.964,7.728,0.173c0.511-2.39-3.256-10.875,5.709-6.208C91.374,62.802,88.704,59.569,86.019,57.731z" 698 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 699 d: "M122.09,87.615c0,0-10.963-1.237-12.024,7.428c-1.062,8.664,2.829,9.372,2.829,9.372l13.969-0.708 c0,0,0.178-7.78,7.073-15.385C133.937,88.322,130.401,82.84,122.09,87.615z" 700 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { 701 d: "M133.937,88.322c0,0-3.537-5.48-11.847-0.707c0,0-9.353-1.039-11.606,5.644c0.878,1.865,3.019,4.632,6.125,4.259 c4.356-0.522,8.022,2.031,12.19-1.272C129.843,93.826,131.45,91.064,133.937,88.322z" 702 }))); 703 } 704 705 /* harmony default export */ __webpack_exports__["default"] = (Icon); 706 707 /***/ }), 708 709 /***/ "./assets/js/blocks/winners/edit.js": 710 /*!******************************************!*\ 711 !*** ./assets/js/blocks/winners/edit.js ***! 712 \******************************************/ 713 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 714 715 "use strict"; 716 __webpack_require__.r(__webpack_exports__); 717 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 718 /* harmony export */ "default": function() { return /* binding */ Edit; } 719 /* harmony export */ }); 720 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "react"); 721 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 722 723 const { 724 ServerSideRender, 725 PanelBody, 726 SelectControl 727 } = wp.components; 728 const { 729 __ 730 } = wp.i18n; 731 const { 732 Fragment, 733 Component 734 } = wp.element; 735 const { 736 InspectorControls 737 } = wp.blockEditor; 738 class Edit extends Component { 739 constructor(props) { 740 super(...props); 741 this.state = { 742 giveaways: [] 743 }; 744 this.props = props; 745 this.get_giveaways = this.get_giveaways.bind(this); 746 } 747 748 componentDidMount() { 749 this.get_giveaways(); 750 } 751 752 get_giveaways() { 753 var self = this; 754 fetch(window.ajaxurl, { 755 method: 'POST', 756 headers: { 757 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' 758 }, 759 body: 'action=sg_get_available_giveaways', 760 credentials: 'same-origin' 761 }).then(function (res) { 762 return res.json(); 763 }).then(function (res) { 764 if (res.success) { 765 self.setState({ 766 giveaways: res.data 767 }); 768 } 769 }); 770 } 771 772 render() { 773 let giveaways = [{ 774 label: __('Select a Giveaway'), 775 value: 0 776 }]; 777 const { 778 attributes, 779 setAttributes, 780 isSelected 781 } = this.props; 782 let message = ''; 783 let blockContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('Please, select a giveaway to show')); 784 const selectedID = parseInt(attributes.id); 785 786 if (this.state.giveaways.length) { 787 giveaways = giveaways.concat(this.state.giveaways.map(post => { 788 return { 789 label: post.post_title, 790 value: post.ID 791 }; 792 })); 793 } else { 794 giveaways = []; 795 } 796 797 if (0 === giveaways.length) { 798 message = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, __('No Giveaways found.')); 799 } 800 801 if (parseInt(attributes.id) > 0) { 802 blockContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ServerSideRender, { 803 block: "simple-giveaways/winners", 804 attributes: attributes 805 }); 806 } 807 808 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelBody, { 809 title: __('Display Options'), 810 initialOpen: true 811 }, giveaways.length > 1 && [(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, { 812 label: __('Giveaway'), 813 value: selectedID, 814 options: giveaways, 815 onChange: id => { 816 setAttributes({ 817 id: id 818 }); 819 } 820 })], message)), blockContent); 821 } 822 823 } 824 825 /***/ }), 826 827 /***/ "./assets/js/blocks/winners/index.js": 828 /*!*******************************************!*\ 829 !*** ./assets/js/blocks/winners/index.js ***! 830 \*******************************************/ 831 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 832 833 "use strict"; 834 __webpack_require__.r(__webpack_exports__); 835 /* harmony import */ var _logo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../logo */ "./assets/js/blocks/logo.js"); 836 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/winners/edit.js"); 837 const { 838 registerBlockType 839 } = wp.blocks; 840 const { 841 __ 842 } = wp.i18n; 843 844 845 registerBlockType('simple-giveaways/winners', { 846 title: __('Winners'), 847 description: __('Show the giveaway winners'), 848 icon: _logo__WEBPACK_IMPORTED_MODULE_0__["default"], 849 category: 'simple-giveaways', 850 attributes: { 851 id: { 852 type: 'string', 853 default: '0' 854 } 855 }, 856 edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], 857 858 save() { 859 return null; 860 } 861 862 }); 863 864 /***/ }), 865 866 /***/ "./assets/js/jquery.countdown.min.js": 867 /*!*******************************************!*\ 868 !*** ./assets/js/jquery.countdown.min.js ***! 869 \*******************************************/ 870 /***/ (function() { 871 872 /* http://keith-wood.name/countdown.html 873 Countdown for jQuery v2.0.2. 874 Written by Keith Wood (kbwood{at}iinet.com.au) January 2008. 875 Available under the MIT (http://keith-wood.name/licence.html) license. 876 Please attribute the author if you use it. */ 877 (function ($) { 878 var w = 'countdown'; 879 var Y = 0; 880 var O = 1; 881 var W = 2; 882 var D = 3; 883 var H = 4; 884 var M = 5; 885 var S = 6; 886 $.JQPlugin.createPlugin({ 887 name: w, 888 defaultOptions: { 889 until: null, 890 since: null, 891 timezone: null, 892 serverSync: null, 893 format: 'dHMS', 894 layout: '', 895 compact: false, 896 padZeroes: false, 897 significant: 0, 898 description: '', 899 expiryUrl: '', 900 expiryText: '', 901 alwaysExpire: false, 902 onExpiry: null, 903 onTick: null, 904 tickInterval: 1 905 }, 906 regionalOptions: { 907 '': { 908 labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'], 909 labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'], 910 compactLabels: ['y', 'm', 'w', 'd'], 911 whichLabels: null, 912 digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 913 timeSeparator: ':', 914 isRTL: false 915 } 916 }, 917 _getters: ['getTimes'], 918 _rtlClass: w + '-rtl', 919 _sectionClass: w + '-section', 920 _amountClass: w + '-amount', 921 _periodClass: w + '-period', 922 _rowClass: w + '-row', 923 _holdingClass: w + '-holding', 924 _showClass: w + '-show', 925 _descrClass: w + '-descr', 926 _timerElems: [], 927 _init: function () { 928 var c = this; 929 930 this._super(); 931 932 this._serverSyncs = []; 933 var d = typeof Date.now == 'function' ? Date.now : function () { 934 return new Date().getTime(); 935 }; 936 var e = window.performance && typeof window.performance.now == 'function'; 937 938 function timerCallBack(a) { 939 var b = a < 1e12 ? e ? performance.now() + performance.timing.navigationStart : d() : a || d(); 940 941 if (b - g >= 1000) { 942 c._updateElems(); 943 944 g = b; 945 } 946 947 f(timerCallBack); 948 } 949 950 var f = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || null; 951 var g = 0; 952 953 if (!f || $.noRequestAnimationFrame) { 954 $.noRequestAnimationFrame = null; 955 setInterval(function () { 956 c._updateElems(); 957 }, 980); 958 } else { 959 g = window.animationStartTime || window.webkitAnimationStartTime || window.mozAnimationStartTime || window.oAnimationStartTime || window.msAnimationStartTime || d(); 960 f(timerCallBack); 961 } 962 }, 963 UTCDate: function (a, b, c, e, f, g, h, i) { 964 if (typeof b == 'object' && b.constructor == Date) { 965 i = b.getMilliseconds(); 966 h = b.getSeconds(); 967 g = b.getMinutes(); 968 f = b.getHours(); 969 e = b.getDate(); 970 c = b.getMonth(); 971 b = b.getFullYear(); 972 } 973 974 var d = new Date(); 975 d.setUTCFullYear(b); 976 d.setUTCDate(1); 977 d.setUTCMonth(c || 0); 978 d.setUTCDate(e || 1); 979 d.setUTCHours(f || 0); 980 d.setUTCMinutes((g || 0) - (Math.abs(a) < 30 ? a * 60 : a)); 981 d.setUTCSeconds(h || 0); 982 d.setUTCMilliseconds(i || 0); 983 return d; 984 }, 985 periodsToSeconds: function (a) { 986 return a[0] * 31557600 + a[1] * 2629800 + a[2] * 604800 + a[3] * 86400 + a[4] * 3600 + a[5] * 60 + a[6]; 987 }, 988 resync: function () { 989 var d = this; 990 $('.' + this._getMarker()).each(function () { 991 var a = $.data(this, d.name); 992 993 if (a.options.serverSync) { 994 var b = null; 995 996 for (var i = 0; i < d._serverSyncs.length; i++) { 997 if (d._serverSyncs[i][0] == a.options.serverSync) { 998 b = d._serverSyncs[i]; 999 break; 1000 } 1001 } 1002 1003 if (b[2] == null) { 1004 var c = $.isFunction(a.options.serverSync) ? a.options.serverSync.apply(this, []) : null; 1005 b[2] = (c ? new Date().getTime() - c.getTime() : 0) - b[1]; 1006 } 1007 1008 if (a._since) { 1009 a._since.setMilliseconds(a._since.getMilliseconds() + b[2]); 1010 } 1011 1012 a._until.setMilliseconds(a._until.getMilliseconds() + b[2]); 1013 } 1014 }); 1015 1016 for (var i = 0; i < d._serverSyncs.length; i++) { 1017 if (d._serverSyncs[i][2] != null) { 1018 d._serverSyncs[i][1] += d._serverSyncs[i][2]; 1019 delete d._serverSyncs[i][2]; 1020 } 1021 } 1022 }, 1023 _instSettings: function (a, b) { 1024 return { 1025 _periods: [0, 0, 0, 0, 0, 0, 0] 1026 }; 1027 }, 1028 _addElem: function (a) { 1029 if (!this._hasElem(a)) { 1030 this._timerElems.push(a); 1031 } 1032 }, 1033 _hasElem: function (a) { 1034 return $.inArray(a, this._timerElems) > -1; 1035 }, 1036 _removeElem: function (b) { 1037 this._timerElems = $.map(this._timerElems, function (a) { 1038 return a == b ? null : a; 1039 }); 1040 }, 1041 _updateElems: function () { 1042 for (var i = this._timerElems.length - 1; i >= 0; i--) { 1043 this._updateCountdown(this._timerElems[i]); 1044 } 1045 }, 1046 _optionsChanged: function (a, b, c) { 1047 if (c.layout) { 1048 c.layout = c.layout.replace(/</g, '<').replace(/>/g, '>'); 1049 } 1050 1051 this._resetExtraLabels(b.options, c); 1052 1053 var d = b.options.timezone != c.timezone; 1054 $.extend(b.options, c); 1055 1056 this._adjustSettings(a, b, c.until != null || c.since != null || d); 1057 1058 var e = new Date(); 1059 1060 if (b._since && b._since < e || b._until && b._until > e) { 1061 this._addElem(a[0]); 1062 } 1063 1064 this._updateCountdown(a, b); 1065 }, 1066 _updateCountdown: function (a, b) { 1067 a = a.jquery ? a : $(a); 1068 b = b || this._getInst(a); 1069 1070 if (!b) { 1071 return; 1072 } 1073 1074 a.html(this._generateHTML(b)).toggleClass(this._rtlClass, b.options.isRTL); 1075 1076 if ($.isFunction(b.options.onTick)) { 1077 var c = b._hold != 'lap' ? b._periods : this._calculatePeriods(b, b._show, b.options.significant, new Date()); 1078 1079 if (b.options.tickInterval == 1 || this.periodsToSeconds(c) % b.options.tickInterval == 0) { 1080 b.options.onTick.apply(a[0], [c]); 1081 } 1082 } 1083 1084 var d = b._hold != 'pause' && (b._since ? b._now.getTime() < b._since.getTime() : b._now.getTime() >= b._until.getTime()); 1085 1086 if (d && !b._expiring) { 1087 b._expiring = true; 1088 1089 if (this._hasElem(a[0]) || b.options.alwaysExpire) { 1090 this._removeElem(a[0]); 1091 1092 if ($.isFunction(b.options.onExpiry)) { 1093 b.options.onExpiry.apply(a[0], []); 1094 } 1095 1096 if (b.options.expiryText) { 1097 var e = b.options.layout; 1098 b.options.layout = b.options.expiryText; 1099 1100 this._updateCountdown(a[0], b); 1101 1102 b.options.layout = e; 1103 } 1104 1105 if (b.options.expiryUrl) { 1106 window.location = b.options.expiryUrl; 1107 } 1108 } 1109 1110 b._expiring = false; 1111 } else if (b._hold == 'pause') { 1112 this._removeElem(a[0]); 1113 } 1114 }, 1115 _resetExtraLabels: function (a, b) { 1116 for (var n in b) { 1117 if (n.match(/[Ll]abels[02-9]|compactLabels1/)) { 1118 a[n] = b[n]; 1119 } 1120 } 1121 1122 for (var n in a) { 1123 if (n.match(/[Ll]abels[02-9]|compactLabels1/) && typeof b[n] === 'undefined') { 1124 a[n] = null; 1125 } 1126 } 1127 }, 1128 _adjustSettings: function (a, b, c) { 1129 var d = null; 1130 1131 for (var i = 0; i < this._serverSyncs.length; i++) { 1132 if (this._serverSyncs[i][0] == b.options.serverSync) { 1133 d = this._serverSyncs[i][1]; 1134 break; 1135 } 1136 } 1137 1138 if (d != null) { 1139 var e = b.options.serverSync ? d : 0; 1140 var f = new Date(); 1141 } else { 1142 var g = $.isFunction(b.options.serverSync) ? b.options.serverSync.apply(a[0], []) : null; 1143 var f = new Date(); 1144 var e = g ? f.getTime() - g.getTime() : 0; 1145 1146 this._serverSyncs.push([b.options.serverSync, e]); 1147 } 1148 1149 var h = b.options.timezone; 1150 h = h == null ? -f.getTimezoneOffset() : h; 1151 1152 if (c || !c && b._until == null && b._since == null) { 1153 b._since = b.options.since; 1154 1155 if (b._since != null) { 1156 b._since = this.UTCDate(h, this._determineTime(b._since, null)); 1157 1158 if (b._since && e) { 1159 b._since.setMilliseconds(b._since.getMilliseconds() + e); 1160 } 1161 } 1162 1163 b._until = this.UTCDate(h, this._determineTime(b.options.until, f)); 1164 1165 if (e) { 1166 b._until.setMilliseconds(b._until.getMilliseconds() + e); 1167 } 1168 } 1169 1170 b._show = this._determineShow(b); 1171 }, 1172 _preDestroy: function (a, b) { 1173 this._removeElem(a[0]); 1174 1175 a.empty(); 1176 }, 1177 pause: function (a) { 1178 this._hold(a, 'pause'); 1179 }, 1180 lap: function (a) { 1181 this._hold(a, 'lap'); 1182 }, 1183 resume: function (a) { 1184 this._hold(a, null); 1185 }, 1186 toggle: function (a) { 1187 var b = $.data(a, this.name) || {}; 1188 this[!b._hold ? 'pause' : 'resume'](a); 1189 }, 1190 toggleLap: function (a) { 1191 var b = $.data(a, this.name) || {}; 1192 this[!b._hold ? 'lap' : 'resume'](a); 1193 }, 1194 _hold: function (a, b) { 1195 var c = $.data(a, this.name); 1196 1197 if (c) { 1198 if (c._hold == 'pause' && !b) { 1199 c._periods = c._savePeriods; 1200 var d = c._since ? '-' : '+'; 1201 c[c._since ? '_since' : '_until'] = this._determineTime(d + c._periods[0] + 'y' + d + c._periods[1] + 'o' + d + c._periods[2] + 'w' + d + c._periods[3] + 'd' + d + c._periods[4] + 'h' + d + c._periods[5] + 'm' + d + c._periods[6] + 's'); 1202 1203 this._addElem(a); 1204 } 1205 1206 c._hold = b; 1207 c._savePeriods = b == 'pause' ? c._periods : null; 1208 $.data(a, this.name, c); 1209 1210 this._updateCountdown(a, c); 1211 } 1212 }, 1213 getTimes: function (a) { 1214 var b = $.data(a, this.name); 1215 return !b ? null : b._hold == 'pause' ? b._savePeriods : !b._hold ? b._periods : this._calculatePeriods(b, b._show, b.options.significant, new Date()); 1216 }, 1217 _determineTime: function (k, l) { 1218 var m = this; 1219 1220 var n = function (a) { 1221 var b = new Date(); 1222 b.setTime(b.getTime() + a * 1000); 1223 return b; 1224 }; 1225 1226 var o = function (a) { 1227 a = a.toLowerCase(); 1228 var b = new Date(); 1229 var c = b.getFullYear(); 1230 var d = b.getMonth(); 1231 var e = b.getDate(); 1232 var f = b.getHours(); 1233 var g = b.getMinutes(); 1234 var h = b.getSeconds(); 1235 var i = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g; 1236 var j = i.exec(a); 1237 1238 while (j) { 1239 switch (j[2] || 's') { 1240 case 's': 1241 h += parseInt(j[1], 10); 1242 break; 1243 1244 case 'm': 1245 g += parseInt(j[1], 10); 1246 break; 1247 1248 case 'h': 1249 f += parseInt(j[1], 10); 1250 break; 1251 1252 case 'd': 1253 e += parseInt(j[1], 10); 1254 break; 1255 1256 case 'w': 1257 e += parseInt(j[1], 10) * 7; 1258 break; 1259 1260 case 'o': 1261 d += parseInt(j[1], 10); 1262 e = Math.min(e, m._getDaysInMonth(c, d)); 1263 break; 1264 1265 case 'y': 1266 c += parseInt(j[1], 10); 1267 e = Math.min(e, m._getDaysInMonth(c, d)); 1268 break; 1269 } 1270 1271 j = i.exec(a); 1272 } 1273 1274 return new Date(c, d, e, f, g, h, 0); 1275 }; 1276 1277 var p = k == null ? l : typeof k == 'string' ? o(k) : typeof k == 'number' ? n(k) : k; 1278 if (p) p.setMilliseconds(0); 1279 return p; 1280 }, 1281 _getDaysInMonth: function (a, b) { 1282 return 32 - new Date(a, b, 32).getDate(); 1283 }, 1284 _normalLabels: function (a) { 1285 return a; 1286 }, 1287 _generateHTML: function (c) { 1288 var d = this; 1289 c._periods = c._hold ? c._periods : this._calculatePeriods(c, c._show, c.options.significant, new Date()); 1290 var e = false; 1291 var f = 0; 1292 var g = c.options.significant; 1293 var h = $.extend({}, c._show); 1294 1295 for (var i = Y; i <= S; i++) { 1296 e |= c._show[i] == '?' && c._periods[i] > 0; 1297 h[i] = c._show[i] == '?' && !e ? null : c._show[i]; 1298 f += h[i] ? 1 : 0; 1299 g -= c._periods[i] > 0 ? 1 : 0; 1300 } 1301 1302 var j = [false, false, false, false, false, false, false]; 1303 1304 for (var i = S; i >= Y; i--) { 1305 if (c._show[i]) { 1306 if (c._periods[i]) { 1307 j[i] = true; 1308 } else { 1309 j[i] = g > 0; 1310 g--; 1311 } 1312 } 1313 } 1314 1315 var k = c.options.compact ? c.options.compactLabels : c.options.labels; 1316 var l = c.options.whichLabels || this._normalLabels; 1317 1318 var m = function (a) { 1319 var b = c.options['compactLabels' + l(c._periods[a])]; 1320 return h[a] ? d._translateDigits(c, c._periods[a]) + (b ? b[a] : k[a]) + ' ' : ''; 1321 }; 1322 1323 var n = c.options.padZeroes ? 2 : 1; 1324 1325 var o = function (a) { 1326 var b = c.options['labels' + l(c._periods[a])]; 1327 return !c.options.significant && h[a] || c.options.significant && j[a] ? '<span class="' + d._sectionClass + '">' + '<span class="' + d._amountClass + '">' + d._minDigits(c, c._periods[a], n) + '</span>' + '<span class="' + d._periodClass + '">' + (b ? b[a] : k[a]) + '</span></span>' : ''; 1328 }; 1329 1330 return c.options.layout ? this._buildLayout(c, h, c.options.layout, c.options.compact, c.options.significant, j) : (c.options.compact ? '<span class="' + this._rowClass + ' ' + this._amountClass + (c._hold ? ' ' + this._holdingClass : '') + '">' + m(Y) + m(O) + m(W) + m(D) + (h[H] ? this._minDigits(c, c._periods[H], 2) : '') + (h[M] ? (h[H] ? c.options.timeSeparator : '') + this._minDigits(c, c._periods[M], 2) : '') + (h[S] ? (h[H] || h[M] ? c.options.timeSeparator : '') + this._minDigits(c, c._periods[S], 2) : '') : '<span class="' + this._rowClass + ' ' + this._showClass + (c.options.significant || f) + (c._hold ? ' ' + this._holdingClass : '') + '">' + o(Y) + o(O) + o(W) + o(D) + o(H) + o(M) + o(S)) + '</span>' + (c.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' + c.options.description + '</span>' : ''); 1331 }, 1332 _buildLayout: function (c, d, e, f, g, h) { 1333 var j = c.options[f ? 'compactLabels' : 'labels']; 1334 var k = c.options.whichLabels || this._normalLabels; 1335 1336 var l = function (a) { 1337 return (c.options[(f ? 'compactLabels' : 'labels') + k(c._periods[a])] || j)[a]; 1338 }; 1339 1340 var m = function (a, b) { 1341 return c.options.digits[Math.floor(a / b) % 10]; 1342 }; 1343 1344 var o = { 1345 desc: c.options.description, 1346 sep: c.options.timeSeparator, 1347 yl: l(Y), 1348 yn: this._minDigits(c, c._periods[Y], 1), 1349 ynn: this._minDigits(c, c._periods[Y], 2), 1350 ynnn: this._minDigits(c, c._periods[Y], 3), 1351 y1: m(c._periods[Y], 1), 1352 y10: m(c._periods[Y], 10), 1353 y100: m(c._periods[Y], 100), 1354 y1000: m(c._periods[Y], 1000), 1355 ol: l(O), 1356 on: this._minDigits(c, c._periods[O], 1), 1357 onn: this._minDigits(c, c._periods[O], 2), 1358 onnn: this._minDigits(c, c._periods[O], 3), 1359 o1: m(c._periods[O], 1), 1360 o10: m(c._periods[O], 10), 1361 o100: m(c._periods[O], 100), 1362 o1000: m(c._periods[O], 1000), 1363 wl: l(W), 1364 wn: this._minDigits(c, c._periods[W], 1), 1365 wnn: this._minDigits(c, c._periods[W], 2), 1366 wnnn: this._minDigits(c, c._periods[W], 3), 1367 w1: m(c._periods[W], 1), 1368 w10: m(c._periods[W], 10), 1369 w100: m(c._periods[W], 100), 1370 w1000: m(c._periods[W], 1000), 1371 dl: l(D), 1372 dn: this._minDigits(c, c._periods[D], 1), 1373 dnn: this._minDigits(c, c._periods[D], 2), 1374 dnnn: this._minDigits(c, c._periods[D], 3), 1375 d1: m(c._periods[D], 1), 1376 d10: m(c._periods[D], 10), 1377 d100: m(c._periods[D], 100), 1378 d1000: m(c._periods[D], 1000), 1379 hl: l(H), 1380 hn: this._minDigits(c, c._periods[H], 1), 1381 hnn: this._minDigits(c, c._periods[H], 2), 1382 hnnn: this._minDigits(c, c._periods[H], 3), 1383 h1: m(c._periods[H], 1), 1384 h10: m(c._periods[H], 10), 1385 h100: m(c._periods[H], 100), 1386 h1000: m(c._periods[H], 1000), 1387 ml: l(M), 1388 mn: this._minDigits(c, c._periods[M], 1), 1389 mnn: this._minDigits(c, c._periods[M], 2), 1390 mnnn: this._minDigits(c, c._periods[M], 3), 1391 m1: m(c._periods[M], 1), 1392 m10: m(c._periods[M], 10), 1393 m100: m(c._periods[M], 100), 1394 m1000: m(c._periods[M], 1000), 1395 sl: l(S), 1396 sn: this._minDigits(c, c._periods[S], 1), 1397 snn: this._minDigits(c, c._periods[S], 2), 1398 snnn: this._minDigits(c, c._periods[S], 3), 1399 s1: m(c._periods[S], 1), 1400 s10: m(c._periods[S], 10), 1401 s100: m(c._periods[S], 100), 1402 s1000: m(c._periods[S], 1000) 1403 }; 1404 var p = e; 1405 1406 for (var i = Y; i <= S; i++) { 1407 var q = 'yowdhms'.charAt(i); 1408 var r = new RegExp('\\{' + q + '<\\}([\\s\\S]*)\\{' + q + '>\\}', 'g'); 1409 p = p.replace(r, !g && d[i] || g && h[i] ? '$1' : ''); 1410 } 1411 1412 $.each(o, function (n, v) { 1413 var a = new RegExp('\\{' + n + '\\}', 'g'); 1414 p = p.replace(a, v); 1415 }); 1416 return p; 1417 }, 1418 _minDigits: function (a, b, c) { 1419 b = '' + b; 1420 1421 if (b.length >= c) { 1422 return this._translateDigits(a, b); 1423 } 1424 1425 b = '0000000000' + b; 1426 return this._translateDigits(a, b.substr(b.length - c)); 1427 }, 1428 _translateDigits: function (b, c) { 1429 return ('' + c).replace(/[0-9]/g, function (a) { 1430 return b.options.digits[a]; 1431 }); 1432 }, 1433 _determineShow: function (a) { 1434 var b = a.options.format; 1435 var c = []; 1436 c[Y] = b.match('y') ? '?' : b.match('Y') ? '!' : null; 1437 c[O] = b.match('o') ? '?' : b.match('O') ? '!' : null; 1438 c[W] = b.match('w') ? '?' : b.match('W') ? '!' : null; 1439 c[D] = b.match('d') ? '?' : b.match('D') ? '!' : null; 1440 c[H] = b.match('h') ? '?' : b.match('H') ? '!' : null; 1441 c[M] = b.match('m') ? '?' : b.match('M') ? '!' : null; 1442 c[S] = b.match('s') ? '?' : b.match('S') ? '!' : null; 1443 return c; 1444 }, 1445 _calculatePeriods: function (c, d, e, f) { 1446 c._now = f; 1447 1448 c._now.setMilliseconds(0); 1449 1450 var g = new Date(c._now.getTime()); 1451 1452 if (c._since) { 1453 if (f.getTime() < c._since.getTime()) { 1454 c._now = f = g; 1455 } else { 1456 f = c._since; 1457 } 1458 } else { 1459 g.setTime(c._until.getTime()); 1460 1461 if (f.getTime() > c._until.getTime()) { 1462 c._now = f = g; 1463 } 1464 } 1465 1466 var h = [0, 0, 0, 0, 0, 0, 0]; 1467 1468 if (d[Y] || d[O]) { 1469 var i = this._getDaysInMonth(f.getFullYear(), f.getMonth()); 1470 1471 var j = this._getDaysInMonth(g.getFullYear(), g.getMonth()); 1472 1473 var k = g.getDate() == f.getDate() || g.getDate() >= Math.min(i, j) && f.getDate() >= Math.min(i, j); 1474 1475 var l = function (a) { 1476 return (a.getHours() * 60 + a.getMinutes()) * 60 + a.getSeconds(); 1477 }; 1478 1479 var m = Math.max(0, (g.getFullYear() - f.getFullYear()) * 12 + g.getMonth() - f.getMonth() + (g.getDate() < f.getDate() && !k || k && l(g) < l(f) ? -1 : 0)); 1480 h[Y] = d[Y] ? Math.floor(m / 12) : 0; 1481 h[O] = d[O] ? m - h[Y] * 12 : 0; 1482 f = new Date(f.getTime()); 1483 var n = f.getDate() == i; 1484 1485 var o = this._getDaysInMonth(f.getFullYear() + h[Y], f.getMonth() + h[O]); 1486 1487 if (f.getDate() > o) { 1488 f.setDate(o); 1489 } 1490 1491 f.setFullYear(f.getFullYear() + h[Y]); 1492 f.setMonth(f.getMonth() + h[O]); 1493 1494 if (n) { 1495 f.setDate(o); 1496 } 1497 } 1498 1499 var p = Math.floor((g.getTime() - f.getTime()) / 1000); 1500 1501 var q = function (a, b) { 1502 h[a] = d[a] ? Math.floor(p / b) : 0; 1503 p -= h[a] * b; 1504 }; 1505 1506 q(W, 604800); 1507 q(D, 86400); 1508 q(H, 3600); 1509 q(M, 60); 1510 q(S, 1); 1511 1512 if (p > 0 && !c._since) { 1513 var r = [1, 12, 4.3482, 7, 24, 60, 60]; 1514 var s = S; 1515 var t = 1; 1516 1517 for (var u = S; u >= Y; u--) { 1518 if (d[u]) { 1519 if (h[s] >= t) { 1520 h[s] = 0; 1521 p = 1; 1522 } 1523 1524 if (p > 0) { 1525 h[u]++; 1526 p = 0; 1527 s = u; 1528 t = 1; 1529 } 1530 } 1531 1532 t *= r[u]; 1533 } 1534 } 1535 1536 if (e) { 1537 for (var u = Y; u <= S; u++) { 1538 if (e && h[u]) { 1539 e--; 1540 } else if (!e) { 1541 h[u] = 0; 1542 } 1543 } 1544 } 1545 1546 return h; 1547 } 1548 }); 1549 })(jQuery); 1550 1551 /***/ }), 1552 1553 /***/ "./assets/js/jquery.plugin.min.js": 1554 /*!****************************************!*\ 1555 !*** ./assets/js/jquery.plugin.min.js ***! 1556 \****************************************/ 1557 /***/ (function() { 1558 1559 /** Abstract base class for collection plugins v1.0.1. 1560 Written by Keith Wood (kbwood{at}iinet.com.au) December 2013. 1561 Licensed under the MIT (http://keith-wood.name/licence.html) license. */ 1562 (function () { 1563 var j = false; 1564 1565 window.JQClass = function () {}; 1566 1567 JQClass.classes = {}; 1568 1569 JQClass.extend = function extender(f) { 1570 var g = this.prototype; 1571 j = true; 1572 var h = new this(); 1573 j = false; 1574 1575 for (var i in f) { 1576 h[i] = typeof f[i] == 'function' && typeof g[i] == 'function' ? function (d, e) { 1577 return function () { 1578 var b = this._super; 1579 1580 this._super = function (a) { 1581 return g[d].apply(this, a || []); 1582 }; 1583 1584 var c = e.apply(this, arguments); 1585 this._super = b; 1586 return c; 1587 }; 1588 }(i, f[i]) : f[i]; 1589 } 1590 1591 function JQClass() { 1592 if (!j && this._init) { 1593 this._init.apply(this, arguments); 1594 } 1595 } 1596 1597 JQClass.prototype = h; 1598 JQClass.prototype.constructor = JQClass; 1599 JQClass.extend = extender; 1600 return JQClass; 1601 }; 1602 })(); 1603 1604 (function ($) { 1605 JQClass.classes.JQPlugin = JQClass.extend({ 1606 name: 'plugin', 1607 defaultOptions: {}, 1608 regionalOptions: {}, 1609 _getters: [], 1610 _getMarker: function () { 1611 return 'is-' + this.name; 1612 }, 1613 _init: function () { 1614 $.extend(this.defaultOptions, this.regionalOptions && this.regionalOptions[''] || {}); 1615 var c = camelCase(this.name); 1616 $[c] = this; 1617 1618 $.fn[c] = function (a) { 1619 var b = Array.prototype.slice.call(arguments, 1); 1620 1621 if ($[c]._isNotChained(a, b)) { 1622 return $[c][a].apply($[c], [this[0]].concat(b)); 1623 } 1624 1625 return this.each(function () { 1626 if (typeof a === 'string') { 1627 if (a[0] === '_' || !$[c][a]) { 1628 throw 'Unknown method: ' + a; 1629 } 1630 1631 $[c][a].apply($[c], [this].concat(b)); 1632 } else { 1633 $[c]._attach(this, a); 1634 } 1635 }); 1636 }; 1637 }, 1638 setDefaults: function (a) { 1639 $.extend(this.defaultOptions, a || {}); 1640 }, 1641 _isNotChained: function (a, b) { 1642 if (a === 'option' && (b.length === 0 || b.length === 1 && typeof b[0] === 'string')) { 1643 return true; 1644 } 1645 1646 return $.inArray(a, this._getters) > -1; 1647 }, 1648 _attach: function (a, b) { 1649 a = $(a); 1650 1651 if (a.hasClass(this._getMarker())) { 1652 return; 1653 } 1654 1655 a.addClass(this._getMarker()); 1656 b = $.extend({}, this.defaultOptions, this._getMetadata(a), b || {}); 1657 var c = $.extend({ 1658 name: this.name, 1659 elem: a, 1660 options: b 1661 }, this._instSettings(a, b)); 1662 a.data(this.name, c); 1663 1664 this._postAttach(a, c); 1665 1666 this.option(a, b); 1667 }, 1668 _instSettings: function (a, b) { 1669 return {}; 1670 }, 1671 _postAttach: function (a, b) {}, 1672 _getMetadata: function (d) { 1673 try { 1674 var f = d.data(this.name.toLowerCase()) || ''; 1675 f = f.replace(/'/g, '"'); 1676 f = f.replace(/([a-zA-Z0-9]+):/g, function (a, b, i) { 1677 var c = f.substring(0, i).match(/"/g); 1678 return !c || c.length % 2 === 0 ? '"' + b + '":' : b + ':'; 1679 }); 1680 f = $.parseJSON('{' + f + '}'); 1681 1682 for (var g in f) { 1683 var h = f[g]; 1684 1685 if (typeof h === 'string' && h.match(/^new Date\((.*)\)$/)) { 1686 f[g] = eval(h); 1687 } 1688 } 1689 1690 return f; 1691 } catch (e) { 1692 return {}; 1693 } 1694 }, 1695 _getInst: function (a) { 1696 return $(a).data(this.name) || {}; 1697 }, 1698 option: function (a, b, c) { 1699 a = $(a); 1700 var d = a.data(this.name); 1701 1702 if (!b || typeof b === 'string' && c == null) { 1703 var e = (d || {}).options; 1704 return e && b ? e[b] : e; 1705 } 1706 1707 if (!a.hasClass(this._getMarker())) { 1708 return; 1709 } 1710 1711 var e = b || {}; 1712 1713 if (typeof b === 'string') { 1714 e = {}; 1715 e[b] = c; 1716 } 1717 1718 this._optionsChanged(a, d, e); 1719 1720 $.extend(d.options, e); 1721 }, 1722 _optionsChanged: function (a, b, c) {}, 1723 destroy: function (a) { 1724 a = $(a); 1725 1726 if (!a.hasClass(this._getMarker())) { 1727 return; 1728 } 1729 1730 this._preDestroy(a, this._getInst(a)); 1731 1732 a.removeData(this.name).removeClass(this._getMarker()); 1733 }, 1734 _preDestroy: function (a, b) {} 1735 }); 1736 1737 function camelCase(c) { 1738 return c.replace(/-([a-z])/g, function (a, b) { 1739 return b.toUpperCase(); 1740 }); 1741 } 1742 1743 $.JQPlugin = { 1744 createPlugin: function (a, b) { 1745 if (typeof a === 'object') { 1746 b = a; 1747 a = 'JQPlugin'; 1748 } 1749 1750 a = camelCase(a); 1751 var c = camelCase(b.name); 1752 JQClass.classes[c] = JQClass.classes[a].extend(b); 1753 new JQClass.classes[c](); 1754 } 1755 }; 1756 })(jQuery); 1757 1758 /***/ }), 1759 1760 /***/ "./assets/js/slick.min.js": 1761 /*!********************************!*\ 1762 !*** ./assets/js/slick.min.js ***! 1763 \********************************/ 1764 /***/ (function(module, exports, __webpack_require__) { 1765 1766 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function (i) { 1767 "use strict"; 1768 1769 true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "jquery")], __WEBPACK_AMD_DEFINE_FACTORY__ = (i), 1770 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1771 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1772 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0; 1773 }(function (i) { 1774 "use strict"; 1775 1776 var e = window.Slick || {}; 1777 (e = function () { 1778 var e = 0; 1779 return function (t, o) { 1780 var s, 1781 n = this; 1782 n.defaults = { 1783 accessibility: !0, 1784 adaptiveHeight: !1, 1785 appendArrows: i(t), 1786 appendDots: i(t), 1787 arrows: !0, 1788 asNavFor: null, 1789 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 1790 nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 1791 autoplay: !1, 1792 autoplaySpeed: 3e3, 1793 centerMode: !1, 1794 centerPadding: "50px", 1795 cssEase: "ease", 1796 customPaging: function (e, t) { 1797 return i('<button type="button" />').text(t + 1); 1798 }, 1799 dots: !1, 1800 dotsClass: "slick-dots", 1801 draggable: !0, 1802 easing: "linear", 1803 edgeFriction: .35, 1804 fade: !1, 1805 focusOnSelect: !1, 1806 focusOnChange: !1, 1807 infinite: !0, 1808 initialSlide: 0, 1809 lazyLoad: "ondemand", 1810 mobileFirst: !1, 1811 pauseOnHover: !0, 1812 pauseOnFocus: !0, 1813 pauseOnDotsHover: !1, 1814 respondTo: "window", 1815 responsive: null, 1816 rows: 1, 1817 rtl: !1, 1818 slide: "", 1819 slidesPerRow: 1, 1820 slidesToShow: 1, 1821 slidesToScroll: 1, 1822 speed: 500, 1823 swipe: !0, 1824 swipeToSlide: !1, 1825 touchMove: !0, 1826 touchThreshold: 5, 1827 useCSS: !0, 1828 useTransform: !0, 1829 variableWidth: !1, 1830 vertical: !1, 1831 verticalSwiping: !1, 1832 waitForAnimate: !0, 1833 zIndex: 1e3 1834 }, n.initials = { 1835 animating: !1, 1836 dragging: !1, 1837 autoPlayTimer: null, 1838 currentDirection: 0, 1839 currentLeft: null, 1840 currentSlide: 0, 1841 direction: 1, 1842 $dots: null, 1843 listWidth: null, 1844 listHeight: null, 1845 loadIndex: 0, 1846 $nextArrow: null, 1847 $prevArrow: null, 1848 scrolling: !1, 1849 slideCount: null, 1850 slideWidth: null, 1851 $slideTrack: null, 1852 $slides: null, 1853 sliding: !1, 1854 slideOffset: 0, 1855 swipeLeft: null, 1856 swiping: !1, 1857 $list: null, 1858 touchObject: {}, 1859 transformsEnabled: !1, 1860 unslicked: !1 1861 }, i.extend(n, n.initials), n.activeBreakpoint = null, n.animType = null, n.animProp = null, n.breakpoints = [], n.breakpointSettings = [], n.cssTransitions = !1, n.focussed = !1, n.interrupted = !1, n.hidden = "hidden", n.paused = !0, n.positionProp = null, n.respondTo = null, n.rowCount = 1, n.shouldClick = !0, n.$slider = i(t), n.$slidesCache = null, n.transformType = null, n.transitionType = null, n.visibilityChange = "visibilitychange", n.windowWidth = 0, n.windowTimer = null, s = i(t).data("slick") || {}, n.options = i.extend({}, n.defaults, o, s), n.currentSlide = n.options.initialSlide, n.originalSettings = n.options, void 0 !== document.mozHidden ? (n.hidden = "mozHidden", n.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (n.hidden = "webkitHidden", n.visibilityChange = "webkitvisibilitychange"), n.autoPlay = i.proxy(n.autoPlay, n), n.autoPlayClear = i.proxy(n.autoPlayClear, n), n.autoPlayIterator = i.proxy(n.autoPlayIterator, n), n.changeSlide = i.proxy(n.changeSlide, n), n.clickHandler = i.proxy(n.clickHandler, n), n.selectHandler = i.proxy(n.selectHandler, n), n.setPosition = i.proxy(n.setPosition, n), n.swipeHandler = i.proxy(n.swipeHandler, n), n.dragHandler = i.proxy(n.dragHandler, n), n.keyHandler = i.proxy(n.keyHandler, n), n.instanceUid = e++, n.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, n.registerBreakpoints(), n.init(!0); 1862 }; 1863 }()).prototype.activateADA = function () { 1864 this.$slideTrack.find(".slick-active").attr({ 1865 "aria-hidden": "false" 1866 }).find("a, input, button, select").attr({ 1867 tabindex: "0" 1868 }); 1869 }, e.prototype.addSlide = e.prototype.slickAdd = function (e, t, o) { 1870 var s = this; 1871 if ("boolean" == typeof t) o = t, t = null;else if (t < 0 || t >= s.slideCount) return !1; 1872 s.unload(), "number" == typeof t ? 0 === t && 0 === s.$slides.length ? i(e).appendTo(s.$slideTrack) : o ? i(e).insertBefore(s.$slides.eq(t)) : i(e).insertAfter(s.$slides.eq(t)) : !0 === o ? i(e).prependTo(s.$slideTrack) : i(e).appendTo(s.$slideTrack), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slides.each(function (e, t) { 1873 i(t).attr("data-slick-index", e); 1874 }), s.$slidesCache = s.$slides, s.reinit(); 1875 }, e.prototype.animateHeight = function () { 1876 var i = this; 1877 1878 if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { 1879 var e = i.$slides.eq(i.currentSlide).outerHeight(!0); 1880 i.$list.animate({ 1881 height: e 1882 }, i.options.speed); 1883 } 1884 }, e.prototype.animateSlide = function (e, t) { 1885 var o = {}, 1886 s = this; 1887 s.animateHeight(), !0 === s.options.rtl && !1 === s.options.vertical && (e = -e), !1 === s.transformsEnabled ? !1 === s.options.vertical ? s.$slideTrack.animate({ 1888 left: e 1889 }, s.options.speed, s.options.easing, t) : s.$slideTrack.animate({ 1890 top: e 1891 }, s.options.speed, s.options.easing, t) : !1 === s.cssTransitions ? (!0 === s.options.rtl && (s.currentLeft = -s.currentLeft), i({ 1892 animStart: s.currentLeft 1893 }).animate({ 1894 animStart: e 1895 }, { 1896 duration: s.options.speed, 1897 easing: s.options.easing, 1898 step: function (i) { 1899 i = Math.ceil(i), !1 === s.options.vertical ? (o[s.animType] = "translate(" + i + "px, 0px)", s.$slideTrack.css(o)) : (o[s.animType] = "translate(0px," + i + "px)", s.$slideTrack.css(o)); 1900 }, 1901 complete: function () { 1902 t && t.call(); 1903 } 1904 })) : (s.applyTransition(), e = Math.ceil(e), !1 === s.options.vertical ? o[s.animType] = "translate3d(" + e + "px, 0px, 0px)" : o[s.animType] = "translate3d(0px," + e + "px, 0px)", s.$slideTrack.css(o), t && setTimeout(function () { 1905 s.disableTransition(), t.call(); 1906 }, s.options.speed)); 1907 }, e.prototype.getNavTarget = function () { 1908 var e = this, 1909 t = e.options.asNavFor; 1910 return t && null !== t && (t = i(t).not(e.$slider)), t; 1911 }, e.prototype.asNavFor = function (e) { 1912 var t = this.getNavTarget(); 1913 null !== t && "object" == typeof t && t.each(function () { 1914 var t = i(this).slick("getSlick"); 1915 t.unslicked || t.slideHandler(e, !0); 1916 }); 1917 }, e.prototype.applyTransition = function (i) { 1918 var e = this, 1919 t = {}; 1920 !1 === e.options.fade ? t[e.transitionType] = e.transformType + " " + e.options.speed + "ms " + e.options.cssEase : t[e.transitionType] = "opacity " + e.options.speed + "ms " + e.options.cssEase, !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t); 1921 }, e.prototype.autoPlay = function () { 1922 var i = this; 1923 i.autoPlayClear(), i.slideCount > i.options.slidesToShow && (i.autoPlayTimer = setInterval(i.autoPlayIterator, i.options.autoplaySpeed)); 1924 }, e.prototype.autoPlayClear = function () { 1925 var i = this; 1926 i.autoPlayTimer && clearInterval(i.autoPlayTimer); 1927 }, e.prototype.autoPlayIterator = function () { 1928 var i = this, 1929 e = i.currentSlide + i.options.slidesToScroll; 1930 i.paused || i.interrupted || i.focussed || (!1 === i.options.infinite && (1 === i.direction && i.currentSlide + 1 === i.slideCount - 1 ? i.direction = 0 : 0 === i.direction && (e = i.currentSlide - i.options.slidesToScroll, i.currentSlide - 1 == 0 && (i.direction = 1))), i.slideHandler(e)); 1931 }, e.prototype.buildArrows = function () { 1932 var e = this; 1933 !0 === e.options.arrows && (e.$prevArrow = i(e.options.prevArrow).addClass("slick-arrow"), e.$nextArrow = i(e.options.nextArrow).addClass("slick-arrow"), e.slideCount > e.options.slidesToShow ? (e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.prependTo(e.options.appendArrows), e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.appendTo(e.options.appendArrows), !0 !== e.options.infinite && e.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({ 1934 "aria-disabled": "true", 1935 tabindex: "-1" 1936 })); 1937 }, e.prototype.buildDots = function () { 1938 var e, 1939 t, 1940 o = this; 1941 1942 if (!0 === o.options.dots) { 1943 for (o.$slider.addClass("slick-dotted"), t = i("<ul />").addClass(o.options.dotsClass), e = 0; e <= o.getDotCount(); e += 1) t.append(i("<li />").append(o.options.customPaging.call(this, o, e))); 1944 1945 o.$dots = t.appendTo(o.options.appendDots), o.$dots.find("li").first().addClass("slick-active"); 1946 } 1947 }, e.prototype.buildOut = function () { 1948 var e = this; 1949 e.$slides = e.$slider.children(e.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), e.slideCount = e.$slides.length, e.$slides.each(function (e, t) { 1950 i(t).attr("data-slick-index", e).data("originalStyling", i(t).attr("style") || ""); 1951 }), e.$slider.addClass("slick-slider"), e.$slideTrack = 0 === e.slideCount ? i('<div class="slick-track"/>').appendTo(e.$slider) : e.$slides.wrapAll('<div class="slick-track"/>').parent(), e.$list = e.$slideTrack.wrap('<div class="slick-list"/>').parent(), e.$slideTrack.css("opacity", 0), !0 !== e.options.centerMode && !0 !== e.options.swipeToSlide || (e.options.slidesToScroll = 1), i("img[data-lazy]", e.$slider).not("[src]").addClass("slick-loading"), e.setupInfinite(), e.buildArrows(), e.buildDots(), e.updateDots(), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), !0 === e.options.draggable && e.$list.addClass("draggable"); 1952 }, e.prototype.buildRows = function () { 1953 var i, 1954 e, 1955 t, 1956 o, 1957 s, 1958 n, 1959 r, 1960 l = this; 1961 1962 if (o = document.createDocumentFragment(), n = l.$slider.children(), l.options.rows > 1) { 1963 for (r = l.options.slidesPerRow * l.options.rows, s = Math.ceil(n.length / r), i = 0; i < s; i++) { 1964 var d = document.createElement("div"); 1965 1966 for (e = 0; e < l.options.rows; e++) { 1967 var a = document.createElement("div"); 1968 1969 for (t = 0; t < l.options.slidesPerRow; t++) { 1970 var c = i * r + (e * l.options.slidesPerRow + t); 1971 n.get(c) && a.appendChild(n.get(c)); 1972 } 1973 1974 d.appendChild(a); 1975 } 1976 1977 o.appendChild(d); 1978 } 1979 1980 l.$slider.empty().append(o), l.$slider.children().children().children().css({ 1981 width: 100 / l.options.slidesPerRow + "%", 1982 display: "inline-block" 1983 }); 1984 } 1985 }, e.prototype.checkResponsive = function (e, t) { 1986 var o, 1987 s, 1988 n, 1989 r = this, 1990 l = !1, 1991 d = r.$slider.width(), 1992 a = window.innerWidth || i(window).width(); 1993 1994 if ("window" === r.respondTo ? n = a : "slider" === r.respondTo ? n = d : "min" === r.respondTo && (n = Math.min(a, d)), r.options.responsive && r.options.responsive.length && null !== r.options.responsive) { 1995 s = null; 1996 1997 for (o in r.breakpoints) r.breakpoints.hasOwnProperty(o) && (!1 === r.originalSettings.mobileFirst ? n < r.breakpoints[o] && (s = r.breakpoints[o]) : n > r.breakpoints[o] && (s = r.breakpoints[o])); 1998 1999 null !== s ? null !== r.activeBreakpoint ? (s !== r.activeBreakpoint || t) && (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = i.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e)), l = s) : (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = i.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e)), l = s) : null !== r.activeBreakpoint && (r.activeBreakpoint = null, r.options = r.originalSettings, !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e), l = s), e || !1 === l || r.$slider.trigger("breakpoint", [r, l]); 2000 } 2001 }, e.prototype.changeSlide = function (e, t) { 2002 var o, 2003 s, 2004 n, 2005 r = this, 2006 l = i(e.currentTarget); 2007 2008 switch (l.is("a") && e.preventDefault(), l.is("li") || (l = l.closest("li")), n = r.slideCount % r.options.slidesToScroll != 0, o = n ? 0 : (r.slideCount - r.currentSlide) % r.options.slidesToScroll, e.data.message) { 2009 case "previous": 2010 s = 0 === o ? r.options.slidesToScroll : r.options.slidesToShow - o, r.slideCount > r.options.slidesToShow && r.slideHandler(r.currentSlide - s, !1, t); 2011 break; 2012 2013 case "next": 2014 s = 0 === o ? r.options.slidesToScroll : o, r.slideCount > r.options.slidesToShow && r.slideHandler(r.currentSlide + s, !1, t); 2015 break; 2016 2017 case "index": 2018 var d = 0 === e.data.index ? 0 : e.data.index || l.index() * r.options.slidesToScroll; 2019 r.slideHandler(r.checkNavigable(d), !1, t), l.children().trigger("focus"); 2020 break; 2021 2022 default: 2023 return; 2024 } 2025 }, e.prototype.checkNavigable = function (i) { 2026 var e, t; 2027 if (e = this.getNavigableIndexes(), t = 0, i > e[e.length - 1]) i = e[e.length - 1];else for (var o in e) { 2028 if (i < e[o]) { 2029 i = t; 2030 break; 2031 } 2032 2033 t = e[o]; 2034 } 2035 return i; 2036 }, e.prototype.cleanUpEvents = function () { 2037 var e = this; 2038 e.options.dots && null !== e.$dots && (i("li", e.$dots).off("click.slick", e.changeSlide).off("mouseenter.slick", i.proxy(e.interrupt, e, !0)).off("mouseleave.slick", i.proxy(e.interrupt, e, !1)), !0 === e.options.accessibility && e.$dots.off("keydown.slick", e.keyHandler)), e.$slider.off("focus.slick blur.slick"), !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow && e.$prevArrow.off("click.slick", e.changeSlide), e.$nextArrow && e.$nextArrow.off("click.slick", e.changeSlide), !0 === e.options.accessibility && (e.$prevArrow && e.$prevArrow.off("keydown.slick", e.keyHandler), e.$nextArrow && e.$nextArrow.off("keydown.slick", e.keyHandler))), e.$list.off("touchstart.slick mousedown.slick", e.swipeHandler), e.$list.off("touchmove.slick mousemove.slick", e.swipeHandler), e.$list.off("touchend.slick mouseup.slick", e.swipeHandler), e.$list.off("touchcancel.slick mouseleave.slick", e.swipeHandler), e.$list.off("click.slick", e.clickHandler), i(document).off(e.visibilityChange, e.visibility), e.cleanUpSlideEvents(), !0 === e.options.accessibility && e.$list.off("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().off("click.slick", e.selectHandler), i(window).off("orientationchange.slick.slick-" + e.instanceUid, e.orientationChange), i(window).off("resize.slick.slick-" + e.instanceUid, e.resize), i("[draggable!=true]", e.$slideTrack).off("dragstart", e.preventDefault), i(window).off("load.slick.slick-" + e.instanceUid, e.setPosition); 2039 }, e.prototype.cleanUpSlideEvents = function () { 2040 var e = this; 2041 e.$list.off("mouseenter.slick", i.proxy(e.interrupt, e, !0)), e.$list.off("mouseleave.slick", i.proxy(e.interrupt, e, !1)); 2042 }, e.prototype.cleanUpRows = function () { 2043 var i, 2044 e = this; 2045 e.options.rows > 1 && ((i = e.$slides.children().children()).removeAttr("style"), e.$slider.empty().append(i)); 2046 }, e.prototype.clickHandler = function (i) { 2047 !1 === this.shouldClick && (i.stopImmediatePropagation(), i.stopPropagation(), i.preventDefault()); 2048 }, e.prototype.destroy = function (e) { 2049 var t = this; 2050 t.autoPlayClear(), t.touchObject = {}, t.cleanUpEvents(), i(".slick-cloned", t.$slider).detach(), t.$dots && t.$dots.remove(), t.$prevArrow && t.$prevArrow.length && (t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.remove()), t.$nextArrow && t.$nextArrow.length && (t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.remove()), t.$slides && (t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function () { 2051 i(this).attr("style", i(this).data("originalStyling")); 2052 }), t.$slideTrack.children(this.options.slide).detach(), t.$slideTrack.detach(), t.$list.detach(), t.$slider.append(t.$slides)), t.cleanUpRows(), t.$slider.removeClass("slick-slider"), t.$slider.removeClass("slick-initialized"), t.$slider.removeClass("slick-dotted"), t.unslicked = !0, e || t.$slider.trigger("destroy", [t]); 2053 }, e.prototype.disableTransition = function (i) { 2054 var e = this, 2055 t = {}; 2056 t[e.transitionType] = "", !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t); 2057 }, e.prototype.fadeSlide = function (i, e) { 2058 var t = this; 2059 !1 === t.cssTransitions ? (t.$slides.eq(i).css({ 2060 zIndex: t.options.zIndex 2061 }), t.$slides.eq(i).animate({ 2062 opacity: 1 2063 }, t.options.speed, t.options.easing, e)) : (t.applyTransition(i), t.$slides.eq(i).css({ 2064 opacity: 1, 2065 zIndex: t.options.zIndex 2066 }), e && setTimeout(function () { 2067 t.disableTransition(i), e.call(); 2068 }, t.options.speed)); 2069 }, e.prototype.fadeSlideOut = function (i) { 2070 var e = this; 2071 !1 === e.cssTransitions ? e.$slides.eq(i).animate({ 2072 opacity: 0, 2073 zIndex: e.options.zIndex - 2 2074 }, e.options.speed, e.options.easing) : (e.applyTransition(i), e.$slides.eq(i).css({ 2075 opacity: 0, 2076 zIndex: e.options.zIndex - 2 2077 })); 2078 }, e.prototype.filterSlides = e.prototype.slickFilter = function (i) { 2079 var e = this; 2080 null !== i && (e.$slidesCache = e.$slides, e.unload(), e.$slideTrack.children(this.options.slide).detach(), e.$slidesCache.filter(i).appendTo(e.$slideTrack), e.reinit()); 2081 }, e.prototype.focusHandler = function () { 2082 var e = this; 2083 e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*", function (t) { 2084 t.stopImmediatePropagation(); 2085 var o = i(this); 2086 setTimeout(function () { 2087 e.options.pauseOnFocus && (e.focussed = o.is(":focus"), e.autoPlay()); 2088 }, 0); 2089 }); 2090 }, e.prototype.getCurrent = e.prototype.slickCurrentSlide = function () { 2091 return this.currentSlide; 2092 }, e.prototype.getDotCount = function () { 2093 var i = this, 2094 e = 0, 2095 t = 0, 2096 o = 0; 2097 if (!0 === i.options.infinite) { 2098 if (i.slideCount <= i.options.slidesToShow) ++o;else for (; e < i.slideCount;) ++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow; 2099 } else if (!0 === i.options.centerMode) o = i.slideCount;else if (i.options.asNavFor) for (; e < i.slideCount;) ++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow;else o = 1 + Math.ceil((i.slideCount - i.options.slidesToShow) / i.options.slidesToScroll); 2100 return o - 1; 2101 }, e.prototype.getLeft = function (i) { 2102 var e, 2103 t, 2104 o, 2105 s, 2106 n = this, 2107 r = 0; 2108 return n.slideOffset = 0, t = n.$slides.first().outerHeight(!0), !0 === n.options.infinite ? (n.slideCount > n.options.slidesToShow && (n.slideOffset = n.slideWidth * n.options.slidesToShow * -1, s = -1, !0 === n.options.vertical && !0 === n.options.centerMode && (2 === n.options.slidesToShow ? s = -1.5 : 1 === n.options.slidesToShow && (s = -2)), r = t * n.options.slidesToShow * s), n.slideCount % n.options.slidesToScroll != 0 && i + n.options.slidesToScroll > n.slideCount && n.slideCount > n.options.slidesToShow && (i > n.slideCount ? (n.slideOffset = (n.options.slidesToShow - (i - n.slideCount)) * n.slideWidth * -1, r = (n.options.slidesToShow - (i - n.slideCount)) * t * -1) : (n.slideOffset = n.slideCount % n.options.slidesToScroll * n.slideWidth * -1, r = n.slideCount % n.options.slidesToScroll * t * -1))) : i + n.options.slidesToShow > n.slideCount && (n.slideOffset = (i + n.options.slidesToShow - n.slideCount) * n.slideWidth, r = (i + n.options.slidesToShow - n.slideCount) * t), n.slideCount <= n.options.slidesToShow && (n.slideOffset = 0, r = 0), !0 === n.options.centerMode && n.slideCount <= n.options.slidesToShow ? n.slideOffset = n.slideWidth * Math.floor(n.options.slidesToShow) / 2 - n.slideWidth * n.slideCount / 2 : !0 === n.options.centerMode && !0 === n.options.infinite ? n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2) - n.slideWidth : !0 === n.options.centerMode && (n.slideOffset = 0, n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2)), e = !1 === n.options.vertical ? i * n.slideWidth * -1 + n.slideOffset : i * t * -1 + r, !0 === n.options.variableWidth && (o = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(i) : n.$slideTrack.children(".slick-slide").eq(i + n.options.slidesToShow), e = !0 === n.options.rtl ? o[0] ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, !0 === n.options.centerMode && (o = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(i) : n.$slideTrack.children(".slick-slide").eq(i + n.options.slidesToShow + 1), e = !0 === n.options.rtl ? o[0] ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, e += (n.$list.width() - o.outerWidth()) / 2)), e; 2109 }, e.prototype.getOption = e.prototype.slickGetOption = function (i) { 2110 return this.options[i]; 2111 }, e.prototype.getNavigableIndexes = function () { 2112 var i, 2113 e = this, 2114 t = 0, 2115 o = 0, 2116 s = []; 2117 2118 for (!1 === e.options.infinite ? i = e.slideCount : (t = -1 * e.options.slidesToScroll, o = -1 * e.options.slidesToScroll, i = 2 * e.slideCount); t < i;) s.push(t), t = o + e.options.slidesToScroll, o += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; 2119 2120 return s; 2121 }, e.prototype.getSlick = function () { 2122 return this; 2123 }, e.prototype.getSlideCount = function () { 2124 var e, 2125 t, 2126 o = this; 2127 return t = !0 === o.options.centerMode ? o.slideWidth * Math.floor(o.options.slidesToShow / 2) : 0, !0 === o.options.swipeToSlide ? (o.$slideTrack.find(".slick-slide").each(function (s, n) { 2128 if (n.offsetLeft - t + i(n).outerWidth() / 2 > -1 * o.swipeLeft) return e = n, !1; 2129 }), Math.abs(i(e).attr("data-slick-index") - o.currentSlide) || 1) : o.options.slidesToScroll; 2130 }, e.prototype.goTo = e.prototype.slickGoTo = function (i, e) { 2131 this.changeSlide({ 2132 data: { 2133 message: "index", 2134 index: parseInt(i) 2135 } 2136 }, e); 2137 }, e.prototype.init = function (e) { 2138 var t = this; 2139 i(t.$slider).hasClass("slick-initialized") || (i(t.$slider).addClass("slick-initialized"), t.buildRows(), t.buildOut(), t.setProps(), t.startLoad(), t.loadSlider(), t.initializeEvents(), t.updateArrows(), t.updateDots(), t.checkResponsive(!0), t.focusHandler()), e && t.$slider.trigger("init", [t]), !0 === t.options.accessibility && t.initADA(), t.options.autoplay && (t.paused = !1, t.autoPlay()); 2140 }, e.prototype.initADA = function () { 2141 var e = this, 2142 t = Math.ceil(e.slideCount / e.options.slidesToShow), 2143 o = e.getNavigableIndexes().filter(function (i) { 2144 return i >= 0 && i < e.slideCount; 2145 }); 2146 e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({ 2147 "aria-hidden": "true", 2148 tabindex: "-1" 2149 }).find("a, input, button, select").attr({ 2150 tabindex: "-1" 2151 }), null !== e.$dots && (e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function (t) { 2152 var s = o.indexOf(t); 2153 i(this).attr({ 2154 role: "tabpanel", 2155 id: "slick-slide" + e.instanceUid + t, 2156 tabindex: -1 2157 }), -1 !== s && i(this).attr({ 2158 "aria-describedby": "slick-slide-control" + e.instanceUid + s 2159 }); 2160 }), e.$dots.attr("role", "tablist").find("li").each(function (s) { 2161 var n = o[s]; 2162 i(this).attr({ 2163 role: "presentation" 2164 }), i(this).find("button").first().attr({ 2165 role: "tab", 2166 id: "slick-slide-control" + e.instanceUid + s, 2167 "aria-controls": "slick-slide" + e.instanceUid + n, 2168 "aria-label": s + 1 + " of " + t, 2169 "aria-selected": null, 2170 tabindex: "-1" 2171 }); 2172 }).eq(e.currentSlide).find("button").attr({ 2173 "aria-selected": "true", 2174 tabindex: "0" 2175 }).end()); 2176 2177 for (var s = e.currentSlide, n = s + e.options.slidesToShow; s < n; s++) e.$slides.eq(s).attr("tabindex", 0); 2178 2179 e.activateADA(); 2180 }, e.prototype.initArrowEvents = function () { 2181 var i = this; 2182 !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.off("click.slick").on("click.slick", { 2183 message: "previous" 2184 }, i.changeSlide), i.$nextArrow.off("click.slick").on("click.slick", { 2185 message: "next" 2186 }, i.changeSlide), !0 === i.options.accessibility && (i.$prevArrow.on("keydown.slick", i.keyHandler), i.$nextArrow.on("keydown.slick", i.keyHandler))); 2187 }, e.prototype.initDotEvents = function () { 2188 var e = this; 2189 !0 === e.options.dots && (i("li", e.$dots).on("click.slick", { 2190 message: "index" 2191 }, e.changeSlide), !0 === e.options.accessibility && e.$dots.on("keydown.slick", e.keyHandler)), !0 === e.options.dots && !0 === e.options.pauseOnDotsHover && i("li", e.$dots).on("mouseenter.slick", i.proxy(e.interrupt, e, !0)).on("mouseleave.slick", i.proxy(e.interrupt, e, !1)); 2192 }, e.prototype.initSlideEvents = function () { 2193 var e = this; 2194 e.options.pauseOnHover && (e.$list.on("mouseenter.slick", i.proxy(e.interrupt, e, !0)), e.$list.on("mouseleave.slick", i.proxy(e.interrupt, e, !1))); 2195 }, e.prototype.initializeEvents = function () { 2196 var e = this; 2197 e.initArrowEvents(), e.initDotEvents(), e.initSlideEvents(), e.$list.on("touchstart.slick mousedown.slick", { 2198 action: "start" 2199 }, e.swipeHandler), e.$list.on("touchmove.slick mousemove.slick", { 2200 action: "move" 2201 }, e.swipeHandler), e.$list.on("touchend.slick mouseup.slick", { 2202 action: "end" 2203 }, e.swipeHandler), e.$list.on("touchcancel.slick mouseleave.slick", { 2204 action: "end" 2205 }, e.swipeHandler), e.$list.on("click.slick", e.clickHandler), i(document).on(e.visibilityChange, i.proxy(e.visibility, e)), !0 === e.options.accessibility && e.$list.on("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), i(window).on("orientationchange.slick.slick-" + e.instanceUid, i.proxy(e.orientationChange, e)), i(window).on("resize.slick.slick-" + e.instanceUid, i.proxy(e.resize, e)), i("[draggable!=true]", e.$slideTrack).on("dragstart", e.preventDefault), i(window).on("load.slick.slick-" + e.instanceUid, e.setPosition), i(e.setPosition); 2206 }, e.prototype.initUI = function () { 2207 var i = this; 2208 !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.show(), i.$nextArrow.show()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.show(); 2209 }, e.prototype.keyHandler = function (i) { 2210 var e = this; 2211 i.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === i.keyCode && !0 === e.options.accessibility ? e.changeSlide({ 2212 data: { 2213 message: !0 === e.options.rtl ? "next" : "previous" 2214 } 2215 }) : 39 === i.keyCode && !0 === e.options.accessibility && e.changeSlide({ 2216 data: { 2217 message: !0 === e.options.rtl ? "previous" : "next" 2218 } 2219 })); 2220 }, e.prototype.lazyLoad = function () { 2221 function e(e) { 2222 i("img[data-lazy]", e).each(function () { 2223 var e = i(this), 2224 t = i(this).attr("data-lazy"), 2225 o = i(this).attr("data-srcset"), 2226 s = i(this).attr("data-sizes") || n.$slider.attr("data-sizes"), 2227 r = document.createElement("img"); 2228 r.onload = function () { 2229 e.animate({ 2230 opacity: 0 2231 }, 100, function () { 2232 o && (e.attr("srcset", o), s && e.attr("sizes", s)), e.attr("src", t).animate({ 2233 opacity: 1 2234 }, 200, function () { 2235 e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"); 2236 }), n.$slider.trigger("lazyLoaded", [n, e, t]); 2237 }); 2238 }, r.onerror = function () { 2239 e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), n.$slider.trigger("lazyLoadError", [n, e, t]); 2240 }, r.src = t; 2241 }); 2242 } 2243 2244 var t, 2245 o, 2246 s, 2247 n = this; 2248 if (!0 === n.options.centerMode ? !0 === n.options.infinite ? s = (o = n.currentSlide + (n.options.slidesToShow / 2 + 1)) + n.options.slidesToShow + 2 : (o = Math.max(0, n.currentSlide - (n.options.slidesToShow / 2 + 1)), s = n.options.slidesToShow / 2 + 1 + 2 + n.currentSlide) : (o = n.options.infinite ? n.options.slidesToShow + n.currentSlide : n.currentSlide, s = Math.ceil(o + n.options.slidesToShow), !0 === n.options.fade && (o > 0 && o--, s <= n.slideCount && s++)), t = n.$slider.find(".slick-slide").slice(o, s), "anticipated" === n.options.lazyLoad) for (var r = o - 1, l = s, d = n.$slider.find(".slick-slide"), a = 0; a < n.options.slidesToScroll; a++) r < 0 && (r = n.slideCount - 1), t = (t = t.add(d.eq(r))).add(d.eq(l)), r--, l++; 2249 e(t), n.slideCount <= n.options.slidesToShow ? e(n.$slider.find(".slick-slide")) : n.currentSlide >= n.slideCount - n.options.slidesToShow ? e(n.$slider.find(".slick-cloned").slice(0, n.options.slidesToShow)) : 0 === n.currentSlide && e(n.$slider.find(".slick-cloned").slice(-1 * n.options.slidesToShow)); 2250 }, e.prototype.loadSlider = function () { 2251 var i = this; 2252 i.setPosition(), i.$slideTrack.css({ 2253 opacity: 1 2254 }), i.$slider.removeClass("slick-loading"), i.initUI(), "progressive" === i.options.lazyLoad && i.progressiveLazyLoad(); 2255 }, e.prototype.next = e.prototype.slickNext = function () { 2256 this.changeSlide({ 2257 data: { 2258 message: "next" 2259 } 2260 }); 2261 }, e.prototype.orientationChange = function () { 2262 var i = this; 2263 i.checkResponsive(), i.setPosition(); 2264 }, e.prototype.pause = e.prototype.slickPause = function () { 2265 var i = this; 2266 i.autoPlayClear(), i.paused = !0; 2267 }, e.prototype.play = e.prototype.slickPlay = function () { 2268 var i = this; 2269 i.autoPlay(), i.options.autoplay = !0, i.paused = !1, i.focussed = !1, i.interrupted = !1; 2270 }, e.prototype.postSlide = function (e) { 2271 var t = this; 2272 t.unslicked || (t.$slider.trigger("afterChange", [t, e]), t.animating = !1, t.slideCount > t.options.slidesToShow && t.setPosition(), t.swipeLeft = null, t.options.autoplay && t.autoPlay(), !0 === t.options.accessibility && (t.initADA(), t.options.focusOnChange && i(t.$slides.get(t.currentSlide)).attr("tabindex", 0).focus())); 2273 }, e.prototype.prev = e.prototype.slickPrev = function () { 2274 this.changeSlide({ 2275 data: { 2276 message: "previous" 2277 } 2278 }); 2279 }, e.prototype.preventDefault = function (i) { 2280 i.preventDefault(); 2281 }, e.prototype.progressiveLazyLoad = function (e) { 2282 e = e || 1; 2283 var t, 2284 o, 2285 s, 2286 n, 2287 r, 2288 l = this, 2289 d = i("img[data-lazy]", l.$slider); 2290 d.length ? (t = d.first(), o = t.attr("data-lazy"), s = t.attr("data-srcset"), n = t.attr("data-sizes") || l.$slider.attr("data-sizes"), (r = document.createElement("img")).onload = function () { 2291 s && (t.attr("srcset", s), n && t.attr("sizes", n)), t.attr("src", o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"), !0 === l.options.adaptiveHeight && l.setPosition(), l.$slider.trigger("lazyLoaded", [l, t, o]), l.progressiveLazyLoad(); 2292 }, r.onerror = function () { 2293 e < 3 ? setTimeout(function () { 2294 l.progressiveLazyLoad(e + 1); 2295 }, 500) : (t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), l.$slider.trigger("lazyLoadError", [l, t, o]), l.progressiveLazyLoad()); 2296 }, r.src = o) : l.$slider.trigger("allImagesLoaded", [l]); 2297 }, e.prototype.refresh = function (e) { 2298 var t, 2299 o, 2300 s = this; 2301 o = s.slideCount - s.options.slidesToShow, !s.options.infinite && s.currentSlide > o && (s.currentSlide = o), s.slideCount <= s.options.slidesToShow && (s.currentSlide = 0), t = s.currentSlide, s.destroy(!0), i.extend(s, s.initials, { 2302 currentSlide: t 2303 }), s.init(), e || s.changeSlide({ 2304 data: { 2305 message: "index", 2306 index: t 2307 } 2308 }, !1); 2309 }, e.prototype.registerBreakpoints = function () { 2310 var e, 2311 t, 2312 o, 2313 s = this, 2314 n = s.options.responsive || null; 2315 2316 if ("array" === i.type(n) && n.length) { 2317 s.respondTo = s.options.respondTo || "window"; 2318 2319 for (e in n) if (o = s.breakpoints.length - 1, n.hasOwnProperty(e)) { 2320 for (t = n[e].breakpoint; o >= 0;) s.breakpoints[o] && s.breakpoints[o] === t && s.breakpoints.splice(o, 1), o--; 2321 2322 s.breakpoints.push(t), s.breakpointSettings[t] = n[e].settings; 2323 } 2324 2325 s.breakpoints.sort(function (i, e) { 2326 return s.options.mobileFirst ? i - e : e - i; 2327 }); 2328 } 2329 }, e.prototype.reinit = function () { 2330 var e = this; 2331 e.$slides = e.$slideTrack.children(e.options.slide).addClass("slick-slide"), e.slideCount = e.$slides.length, e.currentSlide >= e.slideCount && 0 !== e.currentSlide && (e.currentSlide = e.currentSlide - e.options.slidesToScroll), e.slideCount <= e.options.slidesToShow && (e.currentSlide = 0), e.registerBreakpoints(), e.setProps(), e.setupInfinite(), e.buildArrows(), e.updateArrows(), e.initArrowEvents(), e.buildDots(), e.updateDots(), e.initDotEvents(), e.cleanUpSlideEvents(), e.initSlideEvents(), e.checkResponsive(!1, !0), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), e.setPosition(), e.focusHandler(), e.paused = !e.options.autoplay, e.autoPlay(), e.$slider.trigger("reInit", [e]); 2332 }, e.prototype.resize = function () { 2333 var e = this; 2334 i(window).width() !== e.windowWidth && (clearTimeout(e.windowDelay), e.windowDelay = window.setTimeout(function () { 2335 e.windowWidth = i(window).width(), e.checkResponsive(), e.unslicked || e.setPosition(); 2336 }, 50)); 2337 }, e.prototype.removeSlide = e.prototype.slickRemove = function (i, e, t) { 2338 var o = this; 2339 if (i = "boolean" == typeof i ? !0 === (e = i) ? 0 : o.slideCount - 1 : !0 === e ? --i : i, o.slideCount < 1 || i < 0 || i > o.slideCount - 1) return !1; 2340 o.unload(), !0 === t ? o.$slideTrack.children().remove() : o.$slideTrack.children(this.options.slide).eq(i).remove(), o.$slides = o.$slideTrack.children(this.options.slide), o.$slideTrack.children(this.options.slide).detach(), o.$slideTrack.append(o.$slides), o.$slidesCache = o.$slides, o.reinit(); 2341 }, e.prototype.setCSS = function (i) { 2342 var e, 2343 t, 2344 o = this, 2345 s = {}; 2346 !0 === o.options.rtl && (i = -i), e = "left" == o.positionProp ? Math.ceil(i) + "px" : "0px", t = "top" == o.positionProp ? Math.ceil(i) + "px" : "0px", s[o.positionProp] = i, !1 === o.transformsEnabled ? o.$slideTrack.css(s) : (s = {}, !1 === o.cssTransitions ? (s[o.animType] = "translate(" + e + ", " + t + ")", o.$slideTrack.css(s)) : (s[o.animType] = "translate3d(" + e + ", " + t + ", 0px)", o.$slideTrack.css(s))); 2347 }, e.prototype.setDimensions = function () { 2348 var i = this; 2349 !1 === i.options.vertical ? !0 === i.options.centerMode && i.$list.css({ 2350 padding: "0px " + i.options.centerPadding 2351 }) : (i.$list.height(i.$slides.first().outerHeight(!0) * i.options.slidesToShow), !0 === i.options.centerMode && i.$list.css({ 2352 padding: i.options.centerPadding + " 0px" 2353 })), i.listWidth = i.$list.width(), i.listHeight = i.$list.height(), !1 === i.options.vertical && !1 === i.options.variableWidth ? (i.slideWidth = Math.ceil(i.listWidth / i.options.slidesToShow), i.$slideTrack.width(Math.ceil(i.slideWidth * i.$slideTrack.children(".slick-slide").length))) : !0 === i.options.variableWidth ? i.$slideTrack.width(5e3 * i.slideCount) : (i.slideWidth = Math.ceil(i.listWidth), i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0) * i.$slideTrack.children(".slick-slide").length))); 2354 var e = i.$slides.first().outerWidth(!0) - i.$slides.first().width(); 2355 !1 === i.options.variableWidth && i.$slideTrack.children(".slick-slide").width(i.slideWidth - e); 2356 }, e.prototype.setFade = function () { 2357 var e, 2358 t = this; 2359 t.$slides.each(function (o, s) { 2360 e = t.slideWidth * o * -1, !0 === t.options.rtl ? i(s).css({ 2361 position: "relative", 2362 right: e, 2363 top: 0, 2364 zIndex: t.options.zIndex - 2, 2365 opacity: 0 2366 }) : i(s).css({ 2367 position: "relative", 2368 left: e, 2369 top: 0, 2370 zIndex: t.options.zIndex - 2, 2371 opacity: 0 2372 }); 2373 }), t.$slides.eq(t.currentSlide).css({ 2374 zIndex: t.options.zIndex - 1, 2375 opacity: 1 2376 }); 2377 }, e.prototype.setHeight = function () { 2378 var i = this; 2379 2380 if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { 2381 var e = i.$slides.eq(i.currentSlide).outerHeight(!0); 2382 i.$list.css("height", e); 2383 } 2384 }, e.prototype.setOption = e.prototype.slickSetOption = function () { 2385 var e, 2386 t, 2387 o, 2388 s, 2389 n, 2390 r = this, 2391 l = !1; 2392 if ("object" === i.type(arguments[0]) ? (o = arguments[0], l = arguments[1], n = "multiple") : "string" === i.type(arguments[0]) && (o = arguments[0], s = arguments[1], l = arguments[2], "responsive" === arguments[0] && "array" === i.type(arguments[1]) ? n = "responsive" : void 0 !== arguments[1] && (n = "single")), "single" === n) r.options[o] = s;else if ("multiple" === n) i.each(o, function (i, e) { 2393 r.options[i] = e; 2394 });else if ("responsive" === n) for (t in s) if ("array" !== i.type(r.options.responsive)) r.options.responsive = [s[t]];else { 2395 for (e = r.options.responsive.length - 1; e >= 0;) r.options.responsive[e].breakpoint === s[t].breakpoint && r.options.responsive.splice(e, 1), e--; 2396 2397 r.options.responsive.push(s[t]); 2398 } 2399 l && (r.unload(), r.reinit()); 2400 }, e.prototype.setPosition = function () { 2401 var i = this; 2402 i.setDimensions(), i.setHeight(), !1 === i.options.fade ? i.setCSS(i.getLeft(i.currentSlide)) : i.setFade(), i.$slider.trigger("setPosition", [i]); 2403 }, e.prototype.setProps = function () { 2404 var i = this, 2405 e = document.body.style; 2406 i.positionProp = !0 === i.options.vertical ? "top" : "left", "top" === i.positionProp ? i.$slider.addClass("slick-vertical") : i.$slider.removeClass("slick-vertical"), void 0 === e.WebkitTransition && void 0 === e.MozTransition && void 0 === e.msTransition || !0 === i.options.useCSS && (i.cssTransitions = !0), i.options.fade && ("number" == typeof i.options.zIndex ? i.options.zIndex < 3 && (i.options.zIndex = 3) : i.options.zIndex = i.defaults.zIndex), void 0 !== e.OTransform && (i.animType = "OTransform", i.transformType = "-o-transform", i.transitionType = "OTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.MozTransform && (i.animType = "MozTransform", i.transformType = "-moz-transform", i.transitionType = "MozTransition", void 0 === e.perspectiveProperty && void 0 === e.MozPerspective && (i.animType = !1)), void 0 !== e.webkitTransform && (i.animType = "webkitTransform", i.transformType = "-webkit-transform", i.transitionType = "webkitTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.msTransform && (i.animType = "msTransform", i.transformType = "-ms-transform", i.transitionType = "msTransition", void 0 === e.msTransform && (i.animType = !1)), void 0 !== e.transform && !1 !== i.animType && (i.animType = "transform", i.transformType = "transform", i.transitionType = "transition"), i.transformsEnabled = i.options.useTransform && null !== i.animType && !1 !== i.animType; 2407 }, e.prototype.setSlideClasses = function (i) { 2408 var e, 2409 t, 2410 o, 2411 s, 2412 n = this; 2413 2414 if (t = n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), n.$slides.eq(i).addClass("slick-current"), !0 === n.options.centerMode) { 2415 var r = n.options.slidesToShow % 2 == 0 ? 1 : 0; 2416 e = Math.floor(n.options.slidesToShow / 2), !0 === n.options.infinite && (i >= e && i <= n.slideCount - 1 - e ? n.$slides.slice(i - e + r, i + e + 1).addClass("slick-active").attr("aria-hidden", "false") : (o = n.options.slidesToShow + i, t.slice(o - e + 1 + r, o + e + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === i ? t.eq(t.length - 1 - n.options.slidesToShow).addClass("slick-center") : i === n.slideCount - 1 && t.eq(n.options.slidesToShow).addClass("slick-center")), n.$slides.eq(i).addClass("slick-center"); 2417 } else i >= 0 && i <= n.slideCount - n.options.slidesToShow ? n.$slides.slice(i, i + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : t.length <= n.options.slidesToShow ? t.addClass("slick-active").attr("aria-hidden", "false") : (s = n.slideCount % n.options.slidesToShow, o = !0 === n.options.infinite ? n.options.slidesToShow + i : i, n.options.slidesToShow == n.options.slidesToScroll && n.slideCount - i < n.options.slidesToShow ? t.slice(o - (n.options.slidesToShow - s), o + s).addClass("slick-active").attr("aria-hidden", "false") : t.slice(o, o + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")); 2418 2419 "ondemand" !== n.options.lazyLoad && "anticipated" !== n.options.lazyLoad || n.lazyLoad(); 2420 }, e.prototype.setupInfinite = function () { 2421 var e, 2422 t, 2423 o, 2424 s = this; 2425 2426 if (!0 === s.options.fade && (s.options.centerMode = !1), !0 === s.options.infinite && !1 === s.options.fade && (t = null, s.slideCount > s.options.slidesToShow)) { 2427 for (o = !0 === s.options.centerMode ? s.options.slidesToShow + 1 : s.options.slidesToShow, e = s.slideCount; e > s.slideCount - o; e -= 1) t = e - 1, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t - s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned"); 2428 2429 for (e = 0; e < o + s.slideCount; e += 1) t = e, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t + s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned"); 2430 2431 s.$slideTrack.find(".slick-cloned").find("[id]").each(function () { 2432 i(this).attr("id", ""); 2433 }); 2434 } 2435 }, e.prototype.interrupt = function (i) { 2436 var e = this; 2437 i || e.autoPlay(), e.interrupted = i; 2438 }, e.prototype.selectHandler = function (e) { 2439 var t = this, 2440 o = i(e.target).is(".slick-slide") ? i(e.target) : i(e.target).parents(".slick-slide"), 2441 s = parseInt(o.attr("data-slick-index")); 2442 s || (s = 0), t.slideCount <= t.options.slidesToShow ? t.slideHandler(s, !1, !0) : t.slideHandler(s); 2443 }, e.prototype.slideHandler = function (i, e, t) { 2444 var o, 2445 s, 2446 n, 2447 r, 2448 l, 2449 d = null, 2450 a = this; 2451 if (e = e || !1, !(!0 === a.animating && !0 === a.options.waitForAnimate || !0 === a.options.fade && a.currentSlide === i)) if (!1 === e && a.asNavFor(i), o = i, d = a.getLeft(o), r = a.getLeft(a.currentSlide), a.currentLeft = null === a.swipeLeft ? r : a.swipeLeft, !1 === a.options.infinite && !1 === a.options.centerMode && (i < 0 || i > a.getDotCount() * a.options.slidesToScroll)) !1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(r, function () { 2452 a.postSlide(o); 2453 }) : a.postSlide(o));else if (!1 === a.options.infinite && !0 === a.options.centerMode && (i < 0 || i > a.slideCount - a.options.slidesToScroll)) !1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(r, function () { 2454 a.postSlide(o); 2455 }) : a.postSlide(o));else { 2456 if (a.options.autoplay && clearInterval(a.autoPlayTimer), s = o < 0 ? a.slideCount % a.options.slidesToScroll != 0 ? a.slideCount - a.slideCount % a.options.slidesToScroll : a.slideCount + o : o >= a.slideCount ? a.slideCount % a.options.slidesToScroll != 0 ? 0 : o - a.slideCount : o, a.animating = !0, a.$slider.trigger("beforeChange", [a, a.currentSlide, s]), n = a.currentSlide, a.currentSlide = s, a.setSlideClasses(a.currentSlide), a.options.asNavFor && (l = (l = a.getNavTarget()).slick("getSlick")).slideCount <= l.options.slidesToShow && l.setSlideClasses(a.currentSlide), a.updateDots(), a.updateArrows(), !0 === a.options.fade) return !0 !== t ? (a.fadeSlideOut(n), a.fadeSlide(s, function () { 2457 a.postSlide(s); 2458 })) : a.postSlide(s), void a.animateHeight(); 2459 !0 !== t ? a.animateSlide(d, function () { 2460 a.postSlide(s); 2461 }) : a.postSlide(s); 2462 } 2463 }, e.prototype.startLoad = function () { 2464 var i = this; 2465 !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.hide(), i.$nextArrow.hide()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.hide(), i.$slider.addClass("slick-loading"); 2466 }, e.prototype.swipeDirection = function () { 2467 var i, 2468 e, 2469 t, 2470 o, 2471 s = this; 2472 return i = s.touchObject.startX - s.touchObject.curX, e = s.touchObject.startY - s.touchObject.curY, t = Math.atan2(e, i), (o = Math.round(180 * t / Math.PI)) < 0 && (o = 360 - Math.abs(o)), o <= 45 && o >= 0 ? !1 === s.options.rtl ? "left" : "right" : o <= 360 && o >= 315 ? !1 === s.options.rtl ? "left" : "right" : o >= 135 && o <= 225 ? !1 === s.options.rtl ? "right" : "left" : !0 === s.options.verticalSwiping ? o >= 35 && o <= 135 ? "down" : "up" : "vertical"; 2473 }, e.prototype.swipeEnd = function (i) { 2474 var e, 2475 t, 2476 o = this; 2477 if (o.dragging = !1, o.swiping = !1, o.scrolling) return o.scrolling = !1, !1; 2478 if (o.interrupted = !1, o.shouldClick = !(o.touchObject.swipeLength > 10), void 0 === o.touchObject.curX) return !1; 2479 2480 if (!0 === o.touchObject.edgeHit && o.$slider.trigger("edge", [o, o.swipeDirection()]), o.touchObject.swipeLength >= o.touchObject.minSwipe) { 2481 switch (t = o.swipeDirection()) { 2482 case "left": 2483 case "down": 2484 e = o.options.swipeToSlide ? o.checkNavigable(o.currentSlide + o.getSlideCount()) : o.currentSlide + o.getSlideCount(), o.currentDirection = 0; 2485 break; 2486 2487 case "right": 2488 case "up": 2489 e = o.options.swipeToSlide ? o.checkNavigable(o.currentSlide - o.getSlideCount()) : o.currentSlide - o.getSlideCount(), o.currentDirection = 1; 2490 } 2491 2492 "vertical" != t && (o.slideHandler(e), o.touchObject = {}, o.$slider.trigger("swipe", [o, t])); 2493 } else o.touchObject.startX !== o.touchObject.curX && (o.slideHandler(o.currentSlide), o.touchObject = {}); 2494 }, e.prototype.swipeHandler = function (i) { 2495 var e = this; 2496 if (!(!1 === e.options.swipe || "ontouchend" in document && !1 === e.options.swipe || !1 === e.options.draggable && -1 !== i.type.indexOf("mouse"))) switch (e.touchObject.fingerCount = i.originalEvent && void 0 !== i.originalEvent.touches ? i.originalEvent.touches.length : 1, e.touchObject.minSwipe = e.listWidth / e.options.touchThreshold, !0 === e.options.verticalSwiping && (e.touchObject.minSwipe = e.listHeight / e.options.touchThreshold), i.data.action) { 2497 case "start": 2498 e.swipeStart(i); 2499 break; 2500 2501 case "move": 2502 e.swipeMove(i); 2503 break; 2504 2505 case "end": 2506 e.swipeEnd(i); 2507 } 2508 }, e.prototype.swipeMove = function (i) { 2509 var e, 2510 t, 2511 o, 2512 s, 2513 n, 2514 r, 2515 l = this; 2516 return n = void 0 !== i.originalEvent ? i.originalEvent.touches : null, !(!l.dragging || l.scrolling || n && 1 !== n.length) && (e = l.getLeft(l.currentSlide), l.touchObject.curX = void 0 !== n ? n[0].pageX : i.clientX, l.touchObject.curY = void 0 !== n ? n[0].pageY : i.clientY, l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))), r = Math.round(Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2))), !l.options.verticalSwiping && !l.swiping && r > 4 ? (l.scrolling = !0, !1) : (!0 === l.options.verticalSwiping && (l.touchObject.swipeLength = r), t = l.swipeDirection(), void 0 !== i.originalEvent && l.touchObject.swipeLength > 4 && (l.swiping = !0, i.preventDefault()), s = (!1 === l.options.rtl ? 1 : -1) * (l.touchObject.curX > l.touchObject.startX ? 1 : -1), !0 === l.options.verticalSwiping && (s = l.touchObject.curY > l.touchObject.startY ? 1 : -1), o = l.touchObject.swipeLength, l.touchObject.edgeHit = !1, !1 === l.options.infinite && (0 === l.currentSlide && "right" === t || l.currentSlide >= l.getDotCount() && "left" === t) && (o = l.touchObject.swipeLength * l.options.edgeFriction, l.touchObject.edgeHit = !0), !1 === l.options.vertical ? l.swipeLeft = e + o * s : l.swipeLeft = e + o * (l.$list.height() / l.listWidth) * s, !0 === l.options.verticalSwiping && (l.swipeLeft = e + o * s), !0 !== l.options.fade && !1 !== l.options.touchMove && (!0 === l.animating ? (l.swipeLeft = null, !1) : void l.setCSS(l.swipeLeft)))); 2517 }, e.prototype.swipeStart = function (i) { 2518 var e, 2519 t = this; 2520 if (t.interrupted = !0, 1 !== t.touchObject.fingerCount || t.slideCount <= t.options.slidesToShow) return t.touchObject = {}, !1; 2521 void 0 !== i.originalEvent && void 0 !== i.originalEvent.touches && (e = i.originalEvent.touches[0]), t.touchObject.startX = t.touchObject.curX = void 0 !== e ? e.pageX : i.clientX, t.touchObject.startY = t.touchObject.curY = void 0 !== e ? e.pageY : i.clientY, t.dragging = !0; 2522 }, e.prototype.unfilterSlides = e.prototype.slickUnfilter = function () { 2523 var i = this; 2524 null !== i.$slidesCache && (i.unload(), i.$slideTrack.children(this.options.slide).detach(), i.$slidesCache.appendTo(i.$slideTrack), i.reinit()); 2525 }, e.prototype.unload = function () { 2526 var e = this; 2527 i(".slick-cloned", e.$slider).remove(), e.$dots && e.$dots.remove(), e.$prevArrow && e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.remove(), e.$nextArrow && e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.remove(), e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", ""); 2528 }, e.prototype.unslick = function (i) { 2529 var e = this; 2530 e.$slider.trigger("unslick", [e, i]), e.destroy(); 2531 }, e.prototype.updateArrows = function () { 2532 var i = this; 2533 Math.floor(i.options.slidesToShow / 2), !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && !i.options.infinite && (i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === i.currentSlide ? (i.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - i.options.slidesToShow && !1 === i.options.centerMode ? (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - 1 && !0 === i.options.centerMode && (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))); 2534 }, e.prototype.updateDots = function () { 2535 var i = this; 2536 null !== i.$dots && (i.$dots.find("li").removeClass("slick-active").end(), i.$dots.find("li").eq(Math.floor(i.currentSlide / i.options.slidesToScroll)).addClass("slick-active")); 2537 }, e.prototype.visibility = function () { 2538 var i = this; 2539 i.options.autoplay && (document[i.hidden] ? i.interrupted = !0 : i.interrupted = !1); 2540 }, i.fn.slick = function () { 2541 var i, 2542 t, 2543 o = this, 2544 s = arguments[0], 2545 n = Array.prototype.slice.call(arguments, 1), 2546 r = o.length; 2547 2548 for (i = 0; i < r; i++) if ("object" == typeof s || void 0 === s ? o[i].slick = new e(o[i], s) : t = o[i].slick[s].apply(o[i].slick, n), void 0 !== t) return t; 2549 2550 return o; 2551 }; 2552 }); 2553 2554 /***/ }), 2555 2556 /***/ "react": 2557 /*!************************!*\ 2558 !*** external "React" ***! 2559 \************************/ 2560 /***/ (function(module) { 2561 2562 "use strict"; 2563 module.exports = React; 2564 2565 /***/ }), 2566 2567 /***/ "jquery": 2568 /*!*************************!*\ 2569 !*** external "jQuery" ***! 2570 \*************************/ 2571 /***/ (function(module) { 2572 2573 "use strict"; 2574 module.exports = jQuery; 2575 2576 /***/ }) 2577 2578 /******/ }); 2579 /************************************************************************/ 2580 /******/ // The module cache 2581 /******/ var __webpack_module_cache__ = {}; 2582 /******/ 2583 /******/ // The require function 2584 /******/ function __webpack_require__(moduleId) { 2585 /******/ // Check if module is in cache 2586 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 2587 /******/ if (cachedModule !== undefined) { 2588 /******/ return cachedModule.exports; 2589 /******/ } 2590 /******/ // Create a new module (and put it into the cache) 2591 /******/ var module = __webpack_module_cache__[moduleId] = { 2592 /******/ // no module.id needed 2593 /******/ // no module.loaded needed 2594 /******/ exports: {} 2595 /******/ }; 2596 /******/ 2597 /******/ // Execute the module function 2598 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 2599 /******/ 2600 /******/ // Return the exports of the module 2601 /******/ return module.exports; 2602 /******/ } 2603 /******/ 2604 /************************************************************************/ 2605 /******/ /* webpack/runtime/compat get default export */ 2606 /******/ !function() { 2607 /******/ // getDefaultExport function for compatibility with non-harmony modules 2608 /******/ __webpack_require__.n = function(module) { 2609 /******/ var getter = module && module.__esModule ? 2610 /******/ function() { return module['default']; } : 2611 /******/ function() { return module; }; 2612 /******/ __webpack_require__.d(getter, { a: getter }); 2613 /******/ return getter; 2614 /******/ }; 2615 /******/ }(); 2616 /******/ 2617 /******/ /* webpack/runtime/define property getters */ 2618 /******/ !function() { 2619 /******/ // define getter functions for harmony exports 2620 /******/ __webpack_require__.d = function(exports, definition) { 2621 /******/ for(var key in definition) { 2622 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 2623 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 2624 /******/ } 2625 /******/ } 2626 /******/ }; 2627 /******/ }(); 2628 /******/ 2629 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 2630 /******/ !function() { 2631 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 2632 /******/ }(); 2633 /******/ 2634 /******/ /* webpack/runtime/make namespace object */ 2635 /******/ !function() { 2636 /******/ // define __esModule on exports 2637 /******/ __webpack_require__.r = function(exports) { 2638 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 2639 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 2640 /******/ } 2641 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 2642 /******/ }; 2643 /******/ }(); 2644 /******/ 2645 /************************************************************************/ 2646 var __webpack_exports__ = {}; 2647 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 2648 !function() { 2649 "use strict"; 2650 /*!*****************************!*\ 2651 !*** ./assets/js/blocks.js ***! 2652 \*****************************/ 2653 __webpack_require__.r(__webpack_exports__); 2654 /* harmony import */ var _slick_min_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./slick.min.js */ "./assets/js/slick.min.js"); 2655 /* harmony import */ var _slick_min_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_slick_min_js__WEBPACK_IMPORTED_MODULE_0__); 2656 /* harmony import */ var _jquery_plugin_min_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jquery.plugin.min.js */ "./assets/js/jquery.plugin.min.js"); 2657 /* harmony import */ var _jquery_plugin_min_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jquery_plugin_min_js__WEBPACK_IMPORTED_MODULE_1__); 2658 /* harmony import */ var _jquery_countdown_min_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jquery.countdown.min.js */ "./assets/js/jquery.countdown.min.js"); 2659 /* harmony import */ var _jquery_countdown_min_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jquery_countdown_min_js__WEBPACK_IMPORTED_MODULE_2__); 2660 /* harmony import */ var _blocks_giveaway_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blocks/giveaway/index */ "./assets/js/blocks/giveaway/index.js"); 2661 /* harmony import */ var _blocks_countdown_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blocks/countdown/index */ "./assets/js/blocks/countdown/index.js"); 2662 /* harmony import */ var _blocks_winners_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blocks/winners/index */ "./assets/js/blocks/winners/index.js"); 2663 2664 2665 2666 2667 2668 2669 }(); 2670 /******/ })() 2671 ; 2672 //# sourceMappingURL=gutenberg.js.map -
giveasap/trunk/assets/js/admin.js
r2878241 r2882364 708 708 ); 709 709 710 function strip_tags(input, allowed) { 711 allowed = (((allowed || '') + '') 712 .toLowerCase() 713 .match(/<[a-z][a-z0-9]*>/g) || []) 714 .join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>) 715 var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, 716 commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; 717 commentsAndPhpTags = /<(script|style)[^>]*?>.*?<\/\1>/g; 718 return input.replace(commentsAndPhpTags, '') 719 .replace(tags, function($0, $1) { 720 return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; 721 }); 722 } 723 710 724 $( document ).on( 711 725 'keyup', 712 726 '.giveaway-sharing-method .method-title', 713 727 function(){ 714 $( this ).parents( '.giveaway-sharing-method' ).find( '.method-header strong' ).html( $( this ).val() ); 728 var val = strip_tags( $( this ).val() ); 729 console.log(val); 730 $( this ).parents( '.giveaway-sharing-method' ).find( '.method-header strong' ).html( val ); 715 731 } 716 732 ); … … 841 857 function(){ 842 858 var value = $( this ).val(); 859 value = strip_tags(value); 843 860 $( this ).parents( '.sg-form-field' ).find( '.sg-form-field-header .sg-field-name' ).html( value ); 844 861 } … … 1095 1112 var instance = parent.find( '.sg-action-form-instance' ).val(); 1096 1113 var title = $( this ).val(); 1114 title = strip_tags(title); 1097 1115 giveasap_update_specific_mandatory_action( instance, title ); 1098 1116 giveasap_update_specific_mandatory_actions(); -
giveasap/trunk/giveasap.php
r2878241 r2882364 5 5 * Plugin URI: http://www.wpsimplegiveaways.com 6 6 * Description: Create beautiful giveaways and grow your email list and business. 7 * Version: 2.45. 07 * Version: 2.45.1 8 8 * Author: Igor Benic 9 9 * Author URI: http://ibenic.com -
giveasap/trunk/includes/abstracts/class-sharer.php
r2525023 r2882364 121 121 } 122 122 } 123 return '<a ' . implode( ' ', $link_atts ) . ' data-popup="' . absint( $this->use_popup ) . '" target="_blank" href="' . $this->sharer_link . $this->sharing_attributes( $url, $text, $display ) . '">' . $this->get_sharer_icon() . $this->get_title() . $this->get_extra_content() . '</a>';123 return '<a ' . implode( ' ', $link_atts ) . ' data-popup="' . absint( $this->use_popup ) . '" target="_blank" href="' . $this->sharer_link . $this->sharing_attributes( $url, $text, $display ) . '">' . $this->get_sharer_icon() . esc_html( sanitize_text_field( $this->get_title() ) ) . $this->get_extra_content() . '</a>'; 124 124 } 125 125 -
giveasap/trunk/includes/class-menu.php
r2878241 r2882364 917 917 'type' => 'custom', 918 918 'render' => 'giveasap_option_sharing_methods', 919 ) 920 ); 919 'validate' => 'giveasap_option_sharing_methods_validate' 920 ) 921 ); 922 923 function giveasap_option_sharing_methods_validate( $data ) { 924 foreach ( $data as $index => $method_info ) { 925 $data[ $index ]['title'] = sanitize_text_field( $method_info['title'] ); 926 } 927 928 return $data; 929 } 921 930 922 931 $giveASAP_menu_form = new GiveASAP_MenuTab( … … 934 943 'type' => 'custom', 935 944 'render' => 'giveasap_option_form_fields', 936 ) 937 ); 945 'validate' => 'giveasap_option_form_fields_validate' 946 ) 947 ); 948 949 function giveasap_option_form_fields_validate( $form_data ) { 950 951 foreach ( $form_data as $index => $field_data ) { 952 $form_data[ $index ]['label'] = sanitize_text_field( $field_data['label'] ); 953 } 954 955 return $form_data; 956 } 938 957 939 958 $giveASAP_menu_form->add_field( -
giveasap/trunk/includes/giveasap-template-functions.php
r2878241 r2882364 909 909 */ 910 910 function giveasap_render_form_field( $field, $echo = true ) { 911 $label = isset( $field['label'] ) ? $field['label']: '';911 $label = isset( $field['label'] ) ? esc_html( $field['label'] ) : ''; 912 912 $name = isset( $field['name'] ) ? $field['name'] : ''; 913 913 $value = isset( $field['value'] ) ? $field['value'] : ''; -
giveasap/trunk/readme.txt
r2878241 r2882364 4 4 Requires at least: 4.0 5 5 Tested up to: 6.1.1 6 Stable tag: 2.45. 06 Stable tag: 2.45.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 164 164 165 165 == Changelog == 166 167 = 2.45.1 - 2023-03-18 = 168 * Fix: XSS was possible on some form, prize and sharing method fields, if entered by the admin or editors. 169 166 170 = 2.45.0 - 2023-03-11 = 167 171 * New: Unsubscribe Link - Subscribers, if they want, can unsubscribe from giveaway emails they didn't request by themselves
Note: See TracChangeset
for help on using the changeset viewer.