(function (e){
e.fn.ddslick=function (l){
if(c[l]){
return c[l].apply(this, Array.prototype.slice.call(arguments, 1));
}else{
if(typeof l==="object"||!l){
return c.init.apply(this, arguments);
}else{
e.error("Method " + l + " does not exists.");
}}
};
var c={},
d={
data: [],
keepJSONItemsOnTop: false,
width: 260,
height: null,
background: "#eee",
selectText: "",
defaultSelectedIndex: null,
truncateDescription: true,
imagePosition: "left",
showSelectedHTML: true,
clickOffToClose: true,
embedCSS: true,
onSelected: function (){},
},
i='<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>',
a='<ul class="dd-options"></ul>',
b =
'<style id="css-ddslick" type="text/css">.dd-select{ border-radius:2px; border:solid 1px #ccc; position:relative; cursor:pointer;}.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }.dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}.dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}.dd-option{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }.dd-options > li:last-child > .dd-option{ border-bottom:none;}.dd-option:hover{ background:#f3f3f3; color:#000;}.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }.dd-option-selected { background:#f6f6f6; }.dd-option-image, .dd-selected-image { vertical-align:middle; float:left; margin-right:5px; max-width:64px;}.dd-image-right { float:right; margin-right:15px; margin-left:5px;}.dd-container{ position:relative;}​ .dd-selected-text { font-weight:bold}​</style>';
c.init=function (l){
var l=e.extend({}, d, l);
if(e("#css-ddslick").length <=0&&l.embedCSS){
e(b).appendTo("head");
}
return this.each(function (){
var p=e(this),
q=p.data("ddslick");
if(!q){
var n=[],
o=l.data;
p.find("option").each(function (){
var w=e(this),
v=w.data();
var pushdata={ text: w.text().trim(), value: w.val(), selected: w.is(":selected"), description: v.description, imageSrc: v.imagesrc };
if(v.imagesrcFull){
pushdata.imagesrcFull=v.imagesrcFull;
}
if(v.imagesrcWidth){
pushdata.imagesrcWidth=v.imagesrcWidth;
}
if(v.imagesrcHeight){
pushdata.imagesrcHeight=v.imagesrcHeight;
}
n.push(pushdata);
});
if(l.keepJSONItemsOnTop){
e.merge(l.data, n);
}else{
l.data=e.merge(n, l.data);
}
var m=p,
s=e('<div id="' + p.attr("id") + '"></div>');
var gc=p.clone().attr('id',p.attr('data-select-id'));
p.after(gc);
p.replaceWith(s);
p=s;
p.addClass("dd-container").append(i).append(a);
var n=p.find(".dd-select"),
u=p.find(".dd-options");
u.css({ width: l.width });
n.css({ width: l.width, background: l.background });
p.css({ width: l.width });
if(l.height!=null){
u.css({ height: l.height, overflow: "auto" });
}
e.each(l.data, function (v, w){
if(w.selected){
l.defaultSelectedIndex=v;
}
u.append('<li><a class="dd-option">' +
(w.value ? ' <input class="dd-option-value" type="hidden" value="' + w.value + '" />':"") +
(w.imageSrc ? ' <img class="dd-option-image' + (l.imagePosition=="right" ? " dd-image-right":"") + '" src="' + w.imageSrc + '" alt="' + w.value + '" />':"") +
(w.text ? ' <label class="dd-option-text">' + w.text + "</label>":"") +
(w.description ? ' <small class="dd-option-description dd-desc">' + w.description + "</small>":"") +
"</a></li>"
);
});
var t={ settings: l, original: m, selectedIndex: -1, selectedItem: null, selectedData: null };
p.data("ddslick", t);
if(l.selectText.length > 0&&l.defaultSelectedIndex==null){
p.find(".dd-selected").html(l.selectText);
}else{
var r=l.defaultSelectedIndex!=null&&l.defaultSelectedIndex >=0&&l.defaultSelectedIndex < l.data.length ? l.defaultSelectedIndex:0;
j(p, r);
}
p.find(".dd-select").on("click.ddslick", function (){
f(p);
});
p.find(".dd-option").on("click.ddslick", function (){
j(p, e(this).closest("li").index());
});
if(l.clickOffToClose){
u.addClass("dd-click-off-close");
p.on("click.ddslick", function (v){
v.stopPropagation();
});
e("body").on("click", function (){
e(".dd-click-off-close").slideUp(50).siblings(".dd-select").find(".dd-pointer").removeClass("dd-pointer-up");
});
}}
});
};
c.select=function (l){
return this.each(function (){
if(l.index!==undefined){
j(e(this), l.index);
}});
};
c.open=function (){
return this.each(function (){
var m=e(this),
l=m.data("ddslick");
if(l){
f(m);
}});
};
c.close=function (){
return this.each(function (){
var m=e(this),
l=m.data("ddslick");
if(l){
k(m);
}});
};
c.destroy=function (){
return this.each(function (){
var n=e(this),
m=n.data("ddslick");
if(m){
var l=m.original;
n.removeData("ddslick").unbind(".ddslick").replaceWith(l);
}});
};
function j(q, s){
var u=q.data("ddslick");
var r=q.find(".dd-selected"),
n=r.siblings(".dd-selected-value"),
v=q.find(".dd-options"),
l=r.siblings(".dd-pointer"),
p=q.find(".dd-option").eq(s),
m=p.closest("li"),
o=u.settings,
t=u.settings.data[s];
q.find(".dd-option").removeClass("dd-option-selected");
p.addClass("dd-option-selected");
u.selectedIndex=s;
u.selectedItem=m;
u.selectedData=t;
if(o.showSelectedHTML){
r.html((t.imageSrc ? '<img class="dd-selected-image' + (o.imagePosition=="right" ? " dd-image-right":"") + '" src="' + t.imageSrc + '" alt="' + t.text + '" />':"") +
(t.text ? '<label class="dd-selected-text">' + t.text + "</label>":"") +
(t.description ? '<small class="dd-selected-description dd-desc' + (o.truncateDescription ? " dd-selected-description-truncated":"") + '" >' + t.description + "</small>":"") +
(t.imagesrcFull ? '<input type="hidden" class="dd-selected-image-full" data-imgsrc-width="' +(t.imagesrcWidth ? t.imagesrcWidth:'') + '" data-imgsrc-height="' +(t.imagesrcHeight ? t.imagesrcHeight:'') + '" value="' + t.imagesrcFull + '">':"")
);
}else{
r.html(t.text);
}
n.val(t.value);
u.original.val(t.value);
q.data("ddslick", u);
k(q);
g(q);
if(typeof o.onSelected=="function"){
o.onSelected.call(this, u);
}}
function f(p){
var o=p.find(".dd-select"),
m=o.siblings(".dd-options"),
l=o.find(".dd-pointer"),
n=m.is(":visible");
e(".dd-click-off-close").not(m).slideUp(50);
e(".dd-pointer").removeClass("dd-pointer-up");
if(n){
m.slideUp("fast");
l.removeClass("dd-pointer-up");
}else{
m.slideDown("fast");
l.addClass("dd-pointer-up");
}
h(p);
}
function k(l){
l.find(".dd-options").slideUp(50);
l.find(".dd-pointer").removeClass("dd-pointer-up").removeClass("dd-pointer-up");
}
function g(o){
var n=o.find(".dd-select").css("height");
var m=o.find(".dd-selected-description");
var l=o.find(".dd-selected-image");
if(m.length <=0&&l.length > 0&&pewc_vars.disable_line_height_select_box!='yes'){
o.find(".dd-selected-text").css("lineHeight", n);
}}
function h(l){
l.find(".dd-option").each(function (){
var p=e(this);
if(p.find(".dd-option-text").attr("style") ){
return;
}
var n=p.css("height");
var o=p.find(".dd-option-description");
var m=l.find(".dd-option-image");
if(o.length <=0&&m.length > 0&&pewc_vars.disable_line_height_select_box!='yes'){
p.find(".dd-option-text").css("lineHeight", n);
}});
}})(jQuery);
jQuery(function(t){if("undefined"==typeof wc_single_product_params)return!1;t("body").on("init",".wc-tabs-wrapper, .woocommerce-tabs",function(){t(this).find(".wc-tab, .woocommerce-tabs .panel:not(.panel .panel)").hide();var e=window.location.hash,i=window.location.href,o=t(this).find(".wc-tabs, ul.tabs").first();e.toLowerCase().indexOf("comment-")>=0||"#reviews"===e||"#tab-reviews"===e?o.find("li.reviews_tab a").trigger("click"):i.indexOf("comment-page-")>0||i.indexOf("cpage=")>0?o.find("li.reviews_tab a").trigger("click"):"#tab-additional_information"===e?o.find("li.additional_information_tab a").trigger("click"):o.find("li:first a").trigger("click")}).on("click",".wc-tabs li a, ul.tabs li a",function(e){e.preventDefault();var i=t(this),o=i.closest(".wc-tabs-wrapper, .woocommerce-tabs"),a=o.find(".wc-tabs, ul.tabs");a.find("li").removeClass("active"),a.find('a[role="tab"]').attr("aria-selected","false").attr("tabindex","-1"),o.find(".wc-tab, .panel:not(.panel .panel)").hide(),i.closest("li").addClass("active"),i.attr("aria-selected","true").attr("tabindex","0"),o.find("#"+i.attr("href").split("#")[1]).show()}).on("keydown",".wc-tabs li a, ul.tabs li a",function(e){var i="rtl"===document.documentElement.dir,o=e.key,a=i?"ArrowLeft":"ArrowRight",r=i?"ArrowRight":"ArrowLeft",n="ArrowDown",s="ArrowUp",l="Home",c="End";if([a,r,n,s,c,l].includes(o)){var d=t(this),p=d.closest(".wc-tabs-wrapper, .woocommerce-tabs").find(".wc-tabs, ul.tabs").find('a[role="tab"]'),h=p.length-1,g=p.index(d),u=o===r||o===s?g-1:g+1,m="horizontal";if(p.length>=2){var _=p[0].getBoundingClientRect(),f=p[1].getBoundingClientRect();m=Math.abs(f.top-_.top)>Math.abs(f.left-_.left)?"vertical":"horizontal"}("vertical"!==m||o!==r&&o!==a)&&("horizontal"!==m||o!==s&&o!==n)&&(e.preventDefault(),o===r&&0===g&&"horizontal"===m||o===s&&0===g&&"vertical"===m||o===c?u=h:(a===o&&g===h&&"horizontal"===m||n===o&&g===h&&"vertical"===m||o===l)&&(u=0),p.eq(u).focus())}}).on("click","a.woocommerce-review-link",function(){return t(".reviews_tab a").trigger("click"),!0}).on("init","#rating",function(){t(this).hide().before('<p class="stars">\t\t\t\t\t\t<span role="group" aria-labelledby="comment-form-rating-label">\t\t\t\t\t\t\t<a role="radio" tabindex="0" aria-checked="false" class="star-1" href="#">'+wc_single_product_params.i18n_rating_options[0]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-2" href="#">'+wc_single_product_params.i18n_rating_options[1]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-3" href="#">'+wc_single_product_params.i18n_rating_options[2]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-4" href="#">'+wc_single_product_params.i18n_rating_options[3]+'</a>\t\t\t\t\t\t\t<a role="radio" tabindex="-1" aria-checked="false" class="star-5" href="#">'+wc_single_product_params.i18n_rating_options[4]+"</a>\t\t\t\t\t\t</span>\t\t\t\t\t</p>")}).on("click","#respond p.stars a",function(){var e=t(this),i=e.closest("p.stars").find("a").index(e)+1,o=t(this).closest("#respond").find("#rating"),a=t(this).closest(".stars");return o.val(i),e.siblings("a").removeClass("active").attr("aria-checked","false").attr("tabindex","-1"),e.addClass("active").attr("aria-checked","true").attr("tabindex","0"),a.addClass("selected"),!1}).on("click","#respond #submit",function(){var e=t(this).closest("#respond").find("#rating"),i=e.val();if(e.length>0&&!i&&"yes"===wc_single_product_params.review_rating_required)return window.alert(wc_single_product_params.i18n_required_rating_text),!1}).on("keyup",".wc-tabs li a, ul.tabs li a, #respond p.stars a",function(e){var i=e.key,o=["ArrowRight","ArrowDown"];o.concat(["ArrowLeft","ArrowUp"]).includes(i)&&(e.preventDefault(),e.stopPropagation(),o.includes(i)?t(this).next().focus().click():t(this).prev().focus().click())}),t(".wc-tabs-wrapper, .woocommerce-tabs, #rating").trigger("init");var e=function(e,i){this.$target=e,this.$images=t(".woocommerce-product-gallery__image",e),0!==this.$images.length?(e.data("product_gallery",this),this.flexslider_enabled="function"==typeof t.fn.flexslider&&wc_single_product_params.flexslider_enabled,this.zoom_enabled="function"==typeof t.fn.zoom&&wc_single_product_params.zoom_enabled,this.photoswipe_enabled="undefined"!=typeof PhotoSwipe&&wc_single_product_params.photoswipe_enabled,i&&(this.flexslider_enabled=!1!==i.flexslider_enabled&&this.flexslider_enabled,this.zoom_enabled=!1!==i.zoom_enabled&&this.zoom_enabled,this.photoswipe_enabled=!1!==i.photoswipe_enabled&&this.photoswipe_enabled),1===this.$images.length&&(this.flexslider_enabled=!1),this.initFlexslider=this.initFlexslider.bind(this),this.initZoom=this.initZoom.bind(this),this.initZoomForTarget=this.initZoomForTarget.bind(this),this.initPhotoswipe=this.initPhotoswipe.bind(this),this.onResetSlidePosition=this.onResetSlidePosition.bind(this),this.getGalleryItems=this.getGalleryItems.bind(this),this.openPhotoswipe=this.openPhotoswipe.bind(this),this.trapFocusPhotoswipe=this.trapFocusPhotoswipe.bind(this),this.handlePswpTrapFocus=this.handlePswpTrapFocus.bind(this),this.flexslider_enabled?(this.initFlexslider(i.flexslider),e.on("woocommerce_gallery_reset_slide_position",this.onResetSlidePosition)):this.$target.css("opacity",1),this.zoom_enabled&&(this.initZoom(),e.on("woocommerce_gallery_init_zoom",this.initZoom)),this.photoswipe_enabled&&this.initPhotoswipe()):this.$target.css("opacity",1)};e.prototype.initFlexslider=function(e){var i=this.$target,o=this,a=t.extend({selector:".woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image",start:function(){i.css("opacity",1)},after:function(t){o.initZoomForTarget(o.$images.eq(t.currentSlide))}},e);i.flexslider(a),t(".woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image").one("load",function(){var e=t(this);e&&setTimeout(function(){var t=e.closest(".woocommerce-product-gallery__image").height(),i=e.closest(".flex-viewport");t&&i&&i.height(t)},100)}).each(function(){this.complete&&t(this).trigger("load")})},e.prototype.initZoom=function(){"complete"===document.readyState?this.initZoomForTarget(this.$images.first()):t(window).on("load",()=>{this.initZoomForTarget(this.$images.first())})},e.prototype.initZoomForTarget=function(e){if(!this.zoom_enabled)return!1;var i=this.$target.width(),o=!1;if(t(e).each(function(e,a){if(t(a).find("img").data("large_image_width")>i)return o=!0,!1}),o){var a=t.extend({touch:!1,callback:function(){var t=this;setTimeout(function(){t.removeAttribute("role"),t.setAttribute("alt",""),t.setAttribute("aria-hidden","true")},100)}},wc_single_product_params.zoom_options);"ontouchstart"in document.documentElement&&(a.on="click"),e.trigger("zoom.destroy"),e.zoom(a),setTimeout(function(){e.find(":hover").length&&e.trigger("mouseover")},100)}},e.prototype.initPhotoswipe=function(){this.zoom_enabled&&this.$images.length>0?(this.$target.prepend('<a href="#" role="button" class="woocommerce-product-gallery__trigger" aria-haspopup="dialog" aria-controls="photoswipe-fullscreen-dialog" aria-label="'+wc_single_product_params.i18n_product_gallery_trigger_text+'"><span aria-hidden="true">🔍</span></a>'),this.$target.on("click",".woocommerce-product-gallery__trigger",this.openPhotoswipe),this.$target.on("keydown",".woocommerce-product-gallery__trigger",t=>{" "===t.key&&this.openPhotoswipe(t)}),this.$target.on("click",".woocommerce-product-gallery__image a",function(t){t.preventDefault()}),this.flexslider_enabled||this.$target.on("click",".woocommerce-product-gallery__image a",this.openPhotoswipe)):this.$target.on("click",".woocommerce-product-gallery__image a",this.openPhotoswipe)},e.prototype.onResetSlidePosition=function(){this.$target.flexslider(0)},e.prototype.getGalleryItems=function(){var e=this.$images,i=[];return e.length>0&&e.each(function(e,o){var a=t(o).find("img");if(a.length){var r=a.attr("data-large_image"),n=a.attr("data-large_image_width"),s=a.attr("data-large_image_height"),l={alt:a.attr("alt"),src:r,w:n,h:s,title:a.attr("data-caption")?a.attr("data-caption"):a.attr("title")};i.push(l)}}),i},e.prototype.openPhotoswipe=function(e){e.preventDefault();var i,o=t(".pswp")[0],a=this.getGalleryItems(),r=t(e.target),n=e.currentTarget,s=this;i=0<r.closest(".woocommerce-product-gallery__trigger").length?this.$target.find(".flex-active-slide"):r.closest(".woocommerce-product-gallery__image");var l=t.extend({index:t(i).index(),addCaptionHTMLFn:function(t,e){return t.title?(e.children[0].textContent=t.title,!0):(e.children[0].textContent="",!1)},timeToIdle:0},wc_single_product_params.photoswipe_options),c=new PhotoSwipe(o,PhotoSwipeUI_Default,a,l);c.listen("afterInit",function(){s.trapFocusPhotoswipe(!0)}),c.listen("close",function(){s.trapFocusPhotoswipe(!1),n.focus()}),c.init()},e.prototype.trapFocusPhotoswipe=function(t){var e=document.querySelector(".pswp");e&&(t?e.addEventListener("keydown",this.handlePswpTrapFocus):e.removeEventListener("keydown",this.handlePswpTrapFocus))},e.prototype.handlePswpTrapFocus=function(t){var e=t.currentTarget.querySelectorAll("button:not([disabled])"),i=Array.from(e).filter(function(t){return"none"!==t.style.display&&"none"!==window.getComputedStyle(t).display});if(!(1>=i.length)){var o=i[0],a=i[i.length-1];"Tab"===t.key&&(t.shiftKey?document.activeElement===o&&(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),o.focus()))}},t.fn.wc_product_gallery=function(t){return new e(this,t||wc_single_product_params),this},t(".woocommerce-product-gallery").each(function(){t(this).trigger("wc-product-gallery-before-init",[this,wc_single_product_params]),t(this).wc_product_gallery(wc_single_product_params),t(this).trigger("wc-product-gallery-after-init",[this,wc_single_product_params])})});
!function(n,r){var e={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},t=Array.prototype.map,o=Array.isArray,a=Object.prototype.toString;function i(n){return!!(""===n||n&&n.charCodeAt&&n.substr)}function u(n){return o?o(n):"[object Array]"===a.call(n)}function c(n){return n&&"[object Object]"===a.call(n)}function s(n,r){var e;for(e in n=n||{},r=r||{})r.hasOwnProperty(e)&&null==n[e]&&(n[e]=r[e]);return n}function f(n,r,e){var o,a,i=[];if(!n)return i;if(t&&n.map===t)return n.map(r,e);for(o=0,a=n.length;o<a;o++)i[o]=r.call(e,n[o],o,n);return i}function p(n,r){return n=Math.round(Math.abs(n)),isNaN(n)?r:n}function l(n){var r=e.settings.currency.format;return"function"==typeof n&&(n=n()),i(n)&&n.match("%v")?{pos:n,neg:n.replace("-","").replace("%v","-%v"),zero:n}:n&&n.pos&&n.pos.match("%v")?n:i(r)?e.settings.currency.format={pos:r,neg:r.replace("%v","-%v"),zero:r}:r}var m,d=e.unformat=e.parse=function(n,r){if(u(n))return f(n,function(n){return d(n,r)});if("number"==typeof(n=n||0))return n;r=r||e.settings.number.decimal;var t=new RegExp("[^0-9-"+r+"]",["g"]),o=parseFloat((""+n).replace(/\((.*)\)/,"-$1").replace(t,"").replace(r,"."));return isNaN(o)?0:o},g=e.toFixed=function(n,r){r=p(r,e.settings.number.precision);var t=Math.pow(10,r);return(Math.round(e.unformat(n)*t)/t).toFixed(r)},h=e.formatNumber=e.format=function(n,r,t,o){if(u(n))return f(n,function(n){return h(n,r,t,o)});n=d(n);var a=s(c(r)?r:{precision:r,thousand:t,decimal:o},e.settings.number),i=p(a.precision),l=n<0?"-":"",m=parseInt(g(Math.abs(n||0),i),10)+"",y=m.length>3?m.length%3:0;return l+(y?m.substr(0,y)+a.thousand:"")+m.substr(y).replace(/(\d{3})(?=\d)/g,"$1"+a.thousand)+(i?a.decimal+g(Math.abs(n),i).split(".")[1]:"")},y=e.formatMoney=function(n,r,t,o,a,i){if(u(n))return f(n,function(n){return y(n,r,t,o,a,i)});n=d(n);var m=s(c(r)?r:{symbol:r,precision:t,thousand:o,decimal:a,format:i},e.settings.currency),g=l(m.format);return(n>0?g.pos:n<0?g.neg:g.zero).replace("%s",m.symbol).replace("%v",h(Math.abs(n),p(m.precision),m.thousand,m.decimal))};e.formatColumn=function(n,r,t,o,a,m){if(!n)return[];var g=s(c(r)?r:{symbol:r,precision:t,thousand:o,decimal:a,format:m},e.settings.currency),y=l(g.format),b=y.pos.indexOf("%s")<y.pos.indexOf("%v"),v=0;return f(f(n,function(n,r){if(u(n))return e.formatColumn(n,g);var t=((n=d(n))>0?y.pos:n<0?y.neg:y.zero).replace("%s",g.symbol).replace("%v",h(Math.abs(n),p(g.precision),g.thousand,g.decimal));return t.length>v&&(v=t.length),t}),function(n,r){return i(n)&&n.length<v?b?n.replace(g.symbol,g.symbol+new Array(v-n.length+1).join(" ")):new Array(v-n.length+1).join(" ")+n:n})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.accounting=e):"function"==typeof define&&define.amd?define([],function(){return e}):(e.noConflict=(m=n.accounting,function(){return n.accounting=m,e.noConflict=void 0,e}),n.accounting=e)}(this);
(function($){
var total_updated=false;
var pewc_update_total_timer=null;
function pewc_update_total_js_debounced(){
clearTimeout(pewc_update_total_timer);
pewc_update_total_timer=setTimeout(pewc_update_total_js, 0);
}
$(document).ready(function(){
$('.pewc-select-box').each(function(index, element){
$(element).ddslick({
onSelected: function(selectedData){
var original=selectedData.original[0];
var index=selectedData.selectedIndex;
var value=selectedData.selectedData.value;
var box_id=$(original).attr('id');
var hidden_option_id=box_id.replace('_select_box', '') + '_' + index + '_hidden';
var price=$('#' + hidden_option_id).attr('data-option-cost');
var wrapper=$('#' + box_id).closest('.pewc-item')
.attr('data-selected-option-price', price)
.attr('data-value', value)
.attr('data-field-value', value);
var hidden_select=$('#' + box_id + '_' + index).closest('.pewc-item').find('.pewc-select-box-hidden').attr('data-selected-option-price', price).val(value);
var select_box_wrapper=$('body').find('.pewc-item-select-box .dd-container');
$('body').find('.dd-option label, .dd-selected label').each(function(){
$(this).next('small').addBack().wrapAll('<div class="dd-option-wrap"/>');
});
box_id=$('#' + box_id).closest('.pewc-item').attr('data-id');
$('body').find('#' + box_id).val(value).trigger('change');
var selected_option_price=$('#' + box_id).find('option:selected').attr('data-option-cost');
$(wrapper).attr('data-selected-option-price', selected_option_price);
$('body').find('#' + box_id).trigger('pewc_update_select_box');
$(wrapper).find('.dd-selected-description').text(pewc_wc_price(selected_option_price, true) );
}});
});
$('.pewc-color-picker-field').each(function(index, element){
$(element).wpColorPicker({
defaultColor: $(element).data('color') ? $(element).data('color'):false,
change: function(event, ui){
$('body').trigger('pewc_trigger_calculations');
$(element).trigger('pewc_trigger_color_picker_change');
$(element).closest('.pewc-item').attr('data-field-value', ui.color.toString());
},
clear: function(){
$('body').trigger('pewc_trigger_calculations');
$(element).closest('.pewc-item').attr('data-field-value', '');
},
hide: !$(element).data('show'),
palettes: !!$(element).data('palettes'),
width: $(element).data('box-width') ? $(element).data('box-width'):255,
mode: 'hsv',
type: 'full',
slider: 'horizontal'
});
});
$('body').find('.dd-option label, .dd-selected label').each(function(){
$(this).next('small').addBack().wrapAll('<div class="dd-option-wrap"/>');
});
$('input.pewc-range-slider').each(function(){
if($(this).attr('value') > 0){
$(this).trigger('change');
}});
$('form.wp-block-add-to-cart-with-options .wc-block-components-quantity-selector').on('click', function(e){
$('body').trigger('pewc_force_update_total_js');
});
$('.products-quantities-independent .pewc-child-select-field').each(function(){
var number_field=$(this).closest('.child-product-wrapper').find('.pewc-child-quantity-field');
pewc_update_independent_quantity_input_max($(this), number_field);
});
});
$('.require-depends li:first input').on('change',function(){
if($(this).val()!=''){
$(this).closest('.pewc-group').addClass('show-required');
}else{
$(this).closest('.pewc-group').removeClass('show-required');
}});
$('.pewc-file-upload').on('change',function(){
readURL(this, $(this).attr('id'));
});
$('.pewc-remove-image').on('click',function(e){
e.preventDefault();
id=$(this).attr('data-id');
$('#'+id).val("");
$('#'+id+'-placeholder').css('display','none');
$('#'+id+'-placeholder img').attr('src', '#');
$('#'+id+'-wrapper').removeClass('image-loaded');
});
function readURL(input,id){
if(input.files&&input.files[0]){
var i=input.files.length;
var reader=new FileReader();
reader.onload=function (e){
$('#'+id+'-wrapper').addClass('image-loaded');
$('#'+id+'-placeholder').fadeIn();
$('#'+id+'-placeholder img').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}}
$('body').on('change input keyup','.pewc-has-maxchars input, .pewc-has-maxchars textarea',function(){
var maxchars=parseInt($(this).attr('data-maxchars'));
var str=$(this).val();
var str_ex_spaces=$(this).val();
if(pewc_vars.remove_spaces!='no'){
str_ex_spaces=str.replace(/\s/g, "");
var num_spaces=str.split(" ").length - 1;
maxchars +=parseInt(num_spaces);
}else{
str_ex_spaces=str;
}
var str_len=str_ex_spaces.length;
if(str_len>maxchars){
var new_str=str_ex_spaces.substring(0, maxchars);
$(this).val(new_str);
}});
$('body').on('change input', '.pewc-form-field', function(){
$form=$(this).closest('form');
add_on_images.update_add_on_image($(this), $form);
pewc_update_total_js_debounced();
if('yes'==pewc_vars.enable_character_counter){
pewc_update_text_field_counter($(this));
}});
$('body').on('change input', '.pewc-range-slider', function(){
$(this).closest('.pewc-item-field-wrapper').find('.pewc-range-value').text($(this).val());
$(this).closest('.pewc-item').attr('data-field-value', $(this).val());
});
function pewc_update_text_field_counters(){
$('.pewc-form-field').each(function(){
if($(this).closest('.pewc-item').hasClass('pewc-item-text')||$(this).closest('.pewc-item').hasClass('pewc-item-textarea')||$(this).closest('.pewc-item').hasClass('pewc-item-advanced-preview')){
pewc_update_text_field_counter($(this));
}});
}
function pewc_update_text_field_counter(field){
var wrapper=field.closest('.pewc-item');
if(! wrapper.hasClass('pewc-item-text')&&! wrapper.hasClass('pewc-item-textarea')&&! wrapper.hasClass('pewc-item-advanced-preview')){
return;
}
var val_length=field.val().length;
var field_id=field.attr('id').replace('_clone', '');
var current_count=field.closest('.pewc-item').find('.pewc-text-counter-container.' + field_id + ' .pewc-current-count');
current_count.html(val_length);
current_count.removeClass('error');
if(parseInt(field.attr('data-minchars')) > 0&&val_length < parseInt(field.attr('data-minchars')) ){
current_count.addClass('error');
}else if(parseInt(field.attr('data-maxchars')) > 0&&val_length > parseInt(field.attr('data-maxchars')) ){
current_count.addClass('error');
}}
$('body').on('click','.pewc-remove-image',function(){
$form=$(this).closest('form');
pewc_update_total_js();
});
$(document).on('hide_variation', function(event, variation, purchasable){
$('#pewc-product-price').val(0);
$('#pewc-product-price-original').val(0);
pewc_update_total_js();
$('.pewc-variation-dependent').each(function(){
if($(this).hasClass('active')){
$(this).removeClass('active');
if(pewc_vars.conditions_timer > 0){
if(pewc_vars.reset_fields=='yes'&&! $(this).hasClass('pewc-reset-me') ){
$(this).addClass('pewc-reset-me');
}
if($(this).hasClass('pewc-field-triggers-condition') ){
if($(this).find('input').length > 0){
$(this).find('input').trigger('change');
}else if($(this).find('select').length > 0){
$(this).find('select').trigger('change');
}}
if($(this).hasClass('pewc-calculation-trigger') ){
calculations.recalculate();
}}
$('body').trigger('pewc_field_visibility_updated', [ $(this).attr('data-id'), 'hide' ]);
}});
$('body').trigger('pewc_reset_fields');
});
$(document).on('show_variation', function(event, variation, purchasable){
$('#pewc_calc_set_price').attr('data-calc-set', 0);
pewc_update_total_js();
var var_price=variation.display_price;
$('#pewc_variation_price').val(var_price);
$('#pewc-product-price').val(var_price);
$('#pewc-product-price-original').val(var_price);
$('body').trigger('pewc_do_percentages');
$(this).find('.pewc-percentage.pewc-item-select select').each(function(){
pewc_update_select_percentage_field($(this), var_price);
});
$(this).find('.pewc-percentage.pewc-item-select-box').each(function(){
pewc_update_select_box_percentage_field($(this), var_price);
});
$(this).find('.pewc-percentage.pewc-item-image_swatch, .pewc-percentage.pewc-item-radio').each(function(){
pewc_update_radio_percentage_field($(this), var_price);
});
var variation_id=variation.variation_id;
$('.pewc-variation-dependent').each(function(){
var ids=$(this).attr('data-variations');
ids=ids.split(',');
ids=ids.map(function(x){
return parseInt(x, 10);
});
if(ids.indexOf(variation_id)!=-1){
$(this).addClass('active');
if(pewc_vars.reset_fields=='yes'&&pewc_vars.conditions_timer > 0){
$(this).removeClass('pewc-reset-me');
}
$('body').trigger('pewc_field_visibility_updated', [ $(this).attr('data-id'), 'show' ]);
}else{
$(this).removeClass('active');
if(pewc_vars.reset_fields=='yes'&&! $(this).hasClass('pewc-reset-me')&&pewc_vars.conditions_timer > 0){
$(this).addClass('pewc-reset-me');
}}
if(pewc_vars.conditions_timer > 0){
if($(this).hasClass('pewc-field-triggers-condition') ){
if($(this).find('input').length > 0){
$(this).find('input').trigger('change');
}else if($(this).find('select').length > 0){
$(this).find('select').trigger('change');
}}
if($(this).hasClass('pewc-calculation-trigger') ){
calculations.recalculate();
}}
});
$('#pewc_product_length').val(variation.dimensions['length']);
$('#pewc_product_width').val(variation.dimensions['width']);
$('#pewc_product_height').val(variation.dimensions['height']);
$('#pewc_product_weight').val(variation.weight);
$('body').trigger('pewc_trigger_calculations');
$('body').trigger('pewc_variations_updated');
$('body').trigger('pewc_reset_fields');
pewc_update_total_js();
});
$('body').on('pewc_do_percentages', function(){
$('.pewc-percentage').each(function(){
var var_price=$('#pewc-product-price').val();
var new_price=(var_price / 100) * parseFloat($(this).attr('data-percentage') );
if(isNaN(new_price) ){
new_price=0;
}
$(this).attr('data-price', new_price);
var new_price_html=pewc_wc_price(new_price.toFixed(pewc_vars.decimals));
$(this).find('.pewc-field-price').html(new_price_html);
if($(this).hasClass('pewc-item-checkbox') ){
var new_price_currency_only=pewc_wc_price(new_price.toFixed(pewc_vars.decimals), true);
$(this).find('.pewc-checkbox-price').html(new_price_currency_only);
return;
}
$(this).find('.pewc-option-has-percentage').each(function(){
var option_price=(var_price / 100) * $(this).attr('data-option-percentage');
$(this).attr('data-option-cost',option_price.toFixed(pewc_vars.decimals));
option_price=pewc_wc_price(option_price.toFixed(pewc_vars.decimals));
$(this).closest('.pewc-checkbox-form-label').find('.pewc-option-cost-label').html(option_price);
});
});
});
$('body.pewc-variable-product').on('update change', '.pewc-percentage.pewc-item-select select', function(e){
pewc_update_select_percentage_field($(this), $('#pewc_variation_price').val());
});
function pewc_update_select_percentage_field(select, var_price){
pewc_update_select_option_percentage(select, var_price);
$('body').trigger('pewc_trigger_calculations');
pewc_update_total_js();
}
function pewc_update_select_box_percentage_field(selectbox, var_price){
var select=$(selectbox).find('select');
pewc_update_select_option_percentage(select, var_price);
var box=$(selectbox).find('.dd-select');
var box_options=$(selectbox).find('.dd-options');
$(select).find('option').each(function(i, v){
var new_price=(var_price / 100) * $(this).attr('data-option-percentage');
var new_text=$(this).val() + pewc_vars.separator + pewc_wc_price(new_price.toFixed(pewc_vars.decimals), true);
var option=$(box_options).find('li').eq(i);
$(option).find('.dd-option-description').text(new_text);
});
var selected_price=$(select).children('option:selected').attr('data-option-cost');
selected_price=pewc_wc_price(selected_price, true);
$(selectbox).find('.dd-selected .dd-selected-description').text(selected_price);
$('body').trigger('pewc_trigger_calculations');
pewc_update_total_js();
}
function pewc_update_select_option_percentage(select, var_price){
var selected=$(select).children('option:selected');
var option_price=(var_price / 100) * $(selected).attr('data-option-percentage');
var item=$(select).closest('.pewc-item').attr('data-selected-option-price', option_price);
$(selected).attr('data-option-cost', option_price.toFixed(pewc_vars.decimals) );
option_price=pewc_wc_price(option_price.toFixed(pewc_vars.decimals) );
var data_price=$(select).closest('.pewc-item').attr('data-price');
if(isNaN(data_price) ){
$(select).closest('.pewc-item').attr('data-price', 0);
}
$(select).find('option').each(function(i, v){
var new_price=(var_price / 100) * $(this).attr('data-option-percentage');
$(this).attr('data-option-cost', new_price.toFixed(pewc_vars.decimals) );
if($(select).closest('.pewc-item').hasClass('pewc-hide-option-price')||$(this).hasClass('pewc-first-option') ){
return;
}
var new_text=$(this).val() + pewc_vars.separator + pewc_wc_price(new_price.toFixed(pewc_vars.decimals), true);
$(this).text(new_text);
});
}
function pewc_update_radio_percentage_field(field, var_price){
$(field).find('input').each(function(i, v){
var new_price=(var_price / 100) * $(this).attr('data-option-percentage');
$(this).attr('data-option-cost', new_price.toFixed(pewc_vars.decimals) );
var new_text=$(this).val() + pewc_vars.separator + pewc_wc_price(new_price.toFixed(pewc_vars.decimals), true);
$(this).closest('label').next().text(new_text);
if($(field).hasClass('pewc-hide-option-price') ){
return;
}
if(( $(field).hasClass('pewc-item-radio')||$(field).hasClass('pewc-item-image-swatch-checkbox') )&&$(field).hasClass('pewc-item-image_swatch') ){
$(this).closest('label').find('.pewc-radio-image-desc span').text(new_text);
}else if($(field).hasClass('pewc-item-radio') ){
$(this).closest('li').find('label span.pewc-radio-option-text').text(new_text);
}});
$('body').trigger('pewc_trigger_calculations');
pewc_update_total_js();
}
function pewc_update_total_js($update=0){
var flat_rate_total=0;
var product_price=parseFloat($('#pewc-product-price').val());
var orig_product_price=parseFloat($('#pewc-product-price-original').val());
var total_price=0;
var orig_total_price=0;
var added_price=0;
var repeatable_prices=0;
var field_value=[];
var field_label=[];
$('form.cart .pewc-form-field').each(function(){
added_price=0;
var field_wrapper=$(this).closest('.pewc-group');
$(field_wrapper).removeClass('pewc-active-field');
if(! $(field_wrapper).hasClass('pewc-variation-dependent')||($(field_wrapper).hasClass('pewc-variation-dependent')&&$(field_wrapper).hasClass('active') )){
var group_wrap=$(field_wrapper).closest('.pewc-group-wrap');
if(group_wrap.hasClass('pewc-group-hidden')&&! group_wrap.hasClass('pewc-group-always-include') ){
return;
}
if(! $(field_wrapper).hasClass('pewc-flatrate')){
if($(field_wrapper).hasClass('pewc-group-checkbox')&&! $(field_wrapper).hasClass('pewc-hidden-field')){
if($(field_wrapper).hasClass('pewc-per-unit-pricing')&&$(this).prop('checked')){
added_price=parseFloat($('#num_units_int').val()) * parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}else if($(this).prop('checked')){
added_price=parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}else{
$(field_wrapper).removeClass('pewc-active-field');
}}else if($(field_wrapper).hasClass('pewc-group-select')&&! $(field_wrapper).hasClass('pewc-hidden-field')){
if(! $(field_wrapper).hasClass('pewc-first-field-empty')||$(this).find(':selected').val()!=''){
$(field_wrapper).addClass('pewc-active-field');
$(field_wrapper).attr('data-field-value', $(this).find(':selected').val());
if($(field_wrapper).attr('data-option-price-visibility')!='value'){
added_price=parseFloat($(this).find(':selected').attr('data-option-cost'));
added_price +=parseFloat($(field_wrapper).attr('data-price'));
}}
}else if($(field_wrapper).hasClass('pewc-group-select-box')&&! $(field_wrapper).hasClass('pewc-hidden-field')){
if(! $(field_wrapper).hasClass('pewc-first-field-empty')||$(this).find(':selected').val()!=''){
$(field_wrapper).addClass('pewc-active-field');
$(field_wrapper).attr('data-field-value', $(this).find(':selected').val());
if($(field_wrapper).attr('data-option-price-visibility')!='value'){
added_price=parseFloat($(field_wrapper).attr('data-selected-option-price'));
added_price +=parseFloat($(field_wrapper).attr('data-price') );
}}
}else if($(this).val()&&! $(field_wrapper).hasClass('pewc-hidden-field')){
if($(field_wrapper).hasClass('pewc-per-character-pricing')&&($(field_wrapper).hasClass('pewc-item-text')||$(field_wrapper).hasClass('pewc-item-textarea')||$(field_wrapper).hasClass('pewc-item-advanced-preview') )){
var str_len=pewc_get_text_str_len($(this).val(), field_wrapper);
added_price=str_len * parseFloat($(field_wrapper).attr('data-price'));
}else if($(field_wrapper).hasClass('pewc-multiply-pricing') ){
var num_value=$(this).val();
added_price=num_value * parseFloat($(field_wrapper).attr('data-price'));
}else if($(field_wrapper).hasClass('pewc-group-name_price')){
added_price=parseFloat($(this).val());
}else{
added_price=parseFloat($(field_wrapper).attr('data-price'));
}
if($(field_wrapper).hasClass('pewc-item-number')&&$(field_wrapper).hasClass('pewc-per-unit-pricing') ){
added_price=parseFloat(added_price) * parseFloat($('#num_units_int').val());
}
if($(this).val()){
$(field_wrapper).addClass('pewc-active-field');
if($(this).hasClass('pewc-range-slider')&&$(this).attr('value')==''){
}else{
$(field_wrapper).attr('data-field-value', $(this).val());
}}
}else{
$(field_wrapper).attr('data-field-value', '');
}
if($(field_wrapper).hasClass('pewc-repeatable-field')&&! $(field_wrapper).hasClass('pewc-multiply-repeatable') ){
repeatable_prices +=added_price;
}else{
total_price +=added_price;
}
if(! isNaN(added_price) ){
$(field_wrapper).attr('data-field-price', added_price);
}}else{
if($(field_wrapper).hasClass('pewc-group-checkbox')&&! $(field_wrapper).hasClass('pewc-hidden-field')){
if($(field_wrapper).hasClass('pewc-per-unit-pricing')&&$(this).prop('checked')){
added_price=parseFloat($('#num_units_int').val()) * parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}else if($(this).prop('checked')){
added_price=parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}}else if(( $(field_wrapper).hasClass('pewc-group-select')||$(field_wrapper).hasClass('pewc-group-select-box'))&&! $(field_wrapper).hasClass('pewc-hidden-field')){
added_price=parseFloat($(this).find(':selected').attr('data-option-cost'));
added_price +=parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}else if($(this).val()&&! $(field_wrapper).hasClass('pewc-hidden-field')){
if($(field_wrapper).hasClass('pewc-per-character-pricing')){
var str_len=pewc_get_text_str_len($(this).val(), field_wrapper);
added_price=str_len * parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}else if($(field_wrapper).hasClass('pewc-multiply-pricing')){
var num_value=$(this).val();
added_price=num_value * parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}else if($(field_wrapper).hasClass('pewc-group-name_price')){
added_price=parseFloat($(this).val());
}else{
added_price=parseFloat($(field_wrapper).attr('data-price'));
$(field_wrapper).addClass('pewc-active-field');
}}
flat_rate_total +=added_price;
$(field_wrapper).attr('data-field-price', added_price);
$(field_wrapper).attr('data-field-value', $(this).val());
}}
if($(field_wrapper).val()){
set_summary_panel_data($(field_wrapper), $(field_wrapper).val(), added_price);
}});
$('form.cart .pewc-item-radio, form.cart .pewc-item-image_swatch, form.cart .pewc-item-calendar-list').each(function(){
var field_value=[];
if(! $(this).hasClass('pewc-variation-dependent')||($(this).hasClass('pewc-variation-dependent')&&$(this).hasClass('active') )){
var group_wrap=$(this).closest('.pewc-group-wrap');
if(! $(this).hasClass('pewc-hidden-field')&&! group_wrap.hasClass('pewc-group-hidden') ){
var checked_radio=$(this).find('input[type=radio]:checked');
if(checked_radio.attr('data-option-cost') ){
if($(this).attr('data-option-price-visibility')=='value'){
var selected_option_price=checked_radio.attr('data-option-cost');
$(this).attr('data-selected-option-price', selected_option_price);
}else if(! $(this).hasClass('pewc-flatrate') ){
added_price=parseFloat($(this).attr('data-price') );
var selected_option_price=checked_radio.attr('data-option-cost');
$(this).attr('data-selected-option-price', selected_option_price);
added_price +=parseFloat(selected_option_price);
if($(this).hasClass('pewc-repeatable-field')&&! $(this).hasClass('pewc-multiply-repeatable') ){
repeatable_prices +=added_price;
}else{
total_price +=added_price;
}}else{
flat_rate_total +=parseFloat($(this).attr('data-price') );
var selected_option_price=checked_radio.attr('data-option-cost');
$(this).attr('data-selected-option-price', selected_option_price);
flat_rate_total +=parseFloat(selected_option_price);
}}else{
$(this).attr('data-selected-option-price', 0);
}
if(checked_radio.val()){
set_summary_panel_data($(this), checked_radio.val(), added_price);
}else{
set_summary_panel_data($(this), '', 0);
$(this).removeClass('pewc-active-field');
}}
}});
$('form.cart .pewc-item-select').each(function(){
var selected_option_price=$(this).find('option:selected').attr('data-option-cost');
$(this).attr('data-selected-option-price', selected_option_price);
});
$('form.cart .pewc-item-checkbox_group').each(function(){
var field_value=[];
var selected_counter=0;
if(! $(this).hasClass('pewc-variation-dependent')||($(this).hasClass('pewc-variation-dependent')&&$(this).hasClass('active') )){
var checkbox_group_id=$(this).attr('data-id');
var checkbox_group_price=0;
var group_wrap=$(this).closest('.pewc-group-wrap');
if(! $(this).hasClass('pewc-hidden-field')&&! group_wrap.hasClass('pewc-group-hidden') ){
var checkbox_value=[];
if(! $(this).hasClass('pewc-flatrate')){
if($("input[name='" + checkbox_group_id + "[]']:checked").val()){
checkbox_group_price +=parseFloat($(this).attr('data-price'));
}
$('.'+checkbox_group_id).find($('input[type=checkbox]:checked')).each(function(){
checkbox_group_price +=parseFloat($(this).attr('data-option-cost'));
checkbox_value.push($(this).val());
selected_counter++;
});
total_price +=checkbox_group_price;
if($("input[name='" + checkbox_group_id + "[]']:checked").val()){
$(this).attr('data-field-price', checkbox_group_price);
$(this).addClass('pewc-active-field');
$(this).attr('data-field-value', checkbox_value.join(', ') );
}else{
$(this).attr('data-field-price', 0);
$(this).removeClass('pewc-active-field');
$(this).attr('data-field-value', '');
}}else{
if($("input[name='" + checkbox_group_id + "[]']:checked").val()){
flat_rate_total +=parseFloat($(this).attr('data-price'));
}
$('.'+checkbox_group_id).find($('input[type=checkbox]:checked')).each(function(){
flat_rate_total +=parseFloat($(this).attr('data-option-cost'));
checkbox_value.push($(this).val());
selected_counter++;
});
if(checkbox_value.length > 0){
$(this).attr('data-field-value', checkbox_value.join(', ') );
}else{
$(this).attr('data-field-value', '');
}}
}}
pewc_update_checkbox_field_counter($(this), selected_counter);
});
$('form.cart .pewc-item-image-swatch-checkbox').each(function(){
var field_value=[];
var selected_counter=0;
if(! $(this).hasClass('pewc-variation-dependent')||($(this).hasClass('pewc-variation-dependent')&&$(this).hasClass('active') )){
var checkbox_group_id=$(this).attr('data-id');
var checkbox_group_price=0;
var group_wrap=$(this).closest('.pewc-group-wrap');
if(! $(this).hasClass('pewc-hidden-field')&&! group_wrap.hasClass('pewc-group-hidden') ){
var field_value=[];
if(! $(this).hasClass('pewc-flatrate')){
if($("input[name='" + checkbox_group_id + "[]']:checked").val()){
checkbox_group_price +=parseFloat($(this).attr('data-price'));
}
$('.'+checkbox_group_id).find($('input[type=checkbox]:checked')).each(function(){
field_value.push($(this).val());
checkbox_group_price +=parseFloat($(this).attr('data-option-cost'));
selected_counter++;
});
total_price +=checkbox_group_price;
}else{
if($("input[name='" + checkbox_group_id + "[]']:checked").val()){
flat_rate_total +=parseFloat($(this).attr('data-price'));
}
$('.'+checkbox_group_id).find($('input[type=checkbox]:checked')).each(function(){
field_value.push($(this).val());
flat_rate_total +=parseFloat($(this).attr('data-option-cost'));
selected_counter++;
});
}}
if(field_value.length > 0){
set_summary_panel_data($(this), field_value.join(', '), checkbox_group_price);
}else{
$(this).removeClass('pewc-active-field');
set_summary_panel_data($(this), '', 0);
}}
pewc_update_checkbox_field_counter($(this), selected_counter);
});
var child_products_total=0;
$('form.cart .pewc-child-select-field').each(function(){
var field_wrapper=$(this).closest('.pewc-item');
var field_value=[];
var is_hidden=$(this).closest('.pewc-item').hasClass('pewc-hidden-field');
var is_dependent=($(this).closest('.pewc-item').hasClass('pewc-variation-dependent') )&&(! $(this).closest('.pewc-item').hasClass('active') );
if(! is_hidden&&! is_dependent){
if($(this).val()&&$(this).val()!=''){
field_value.push($(this).find(':selected').attr('data-field-value') );
var selected=$(this).find(':selected');
var child_product_price=selected.data('option-cost');
if(parseFloat(selected.attr('data-wcfad-price')) > 0){
child_product_price=parseFloat(selected.attr('data-wcfad-price'));
}
var qty=0;
if(child_product_price > 0){
var wrapper=$(this).closest('.child-product-wrapper');
var quantities=$(wrapper).data('products-quantities');
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
}else if(quantities=='independent'){
qty=$(wrapper).find('.pewc-child-quantity-field').val();
if(pewc_vars.multiply_independent=='yes' ){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
}}
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
if(field_value.length > 0){
$(this).closest('.pewc-item').attr('data-field-price', child_products_total);
set_summary_panel_data($(this).closest('.pewc-item'), field_value.join(', '), parseFloat(child_product_price) * parseFloat(qty) );
}else{
$(this).closest('.pewc-item').removeClass('pewc-active-field');
}}
}});
$('form.cart .pewc-radio-images-wrapper.child-product-wrapper').each(function(){
var field_value=[];
var is_hidden=$(this).closest('.pewc-item').hasClass('pewc-hidden-field');
var is_dependent=($(this).closest('.pewc-item').hasClass('pewc-variation-dependent') )&&(! $(this).closest('.pewc-item').hasClass('active') );
if(! is_hidden&&! is_dependent){
var quantities=$(this).data('products-quantities');
var checked_radio=$(this).find('.pewc-radio-form-field:checked');
var radio_val=checked_radio.val();
if(radio_val&&radio_val!=undefined){
var child_product_price=checked_radio.data('option-cost');
if(parseFloat(checked_radio.attr('data-wcfad-price')) > 0){
child_product_price=parseFloat(checked_radio.attr('data-wcfad-price'));
}
var qty=0;
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
}else if(quantities=='independent'){
qty=$(this).closest('.pewc-item-field-wrapper').find('.pewc-child-quantity-field').val();
if(pewc_vars.multiply_independent=='yes' ){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
}
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
if(child_products_total > 0||qty > 0){
$(this).closest('.pewc-item').attr('data-field-price', child_products_total);
set_summary_panel_data($(this).closest('.pewc-item'), checked_radio.attr('data-field-label'), parseFloat(child_product_price) * parseFloat(qty) );
}}else{
$(this).closest('.pewc-item').removeClass('pewc-active-field');
$(this).closest('.pewc-item')
.attr('data-field-price', 0)
.attr('data-field-value', '');
}}
});
$('form.cart .pewc-checkboxes-images-wrapper.child-product-wrapper, form.cart .pewc-components-wrapper.child-product-wrapper').each(function(){
var this_child_total=0;
var field_value=[];
var selected_counter=0;
var is_hidden=$(this).closest('.pewc-item').hasClass('pewc-hidden-field');
var is_dependent=($(this).closest('.pewc-item').hasClass('pewc-variation-dependent') )&&(! $(this).closest('.pewc-item').hasClass('active') );
if(! is_hidden&&! is_dependent){
var quantities=$(this).data('products-quantities');
$(this).closest('.pewc-item').removeClass('pewc-active-field');
$(this).find('.pewc-checkbox-form-field:checkbox:checked').each(function(){
field_value.push($(this).attr('data-field-label') );
var child_product_price=$(this).data('option-cost');
if(parseFloat($(this).attr('data-wcfad-price')) > 0){
child_product_price=parseFloat($(this).attr('data-wcfad-price'));
}
var qty=0;
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
selected_counter++;
}else if(quantities=='independent'){
qty=$(this).closest('.pewc-checkbox-wrapper').find('.pewc-child-quantity-field').val();
selected_counter +=parseInt(qty);
if(pewc_vars.multiply_independent=='yes' ){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
selected_counter++;
}
if(child_product_price > 0){
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
this_child_total +=parseFloat(child_product_price) * parseFloat(qty);
}});
if(field_value.length > 0){
$(this).closest('.pewc-item').attr('data-field-price', child_products_total);
set_summary_panel_data($(this).closest('.pewc-item'), field_value.join(', '), this_child_total);
}}
pewc_update_checkbox_field_counter($(this).closest('.pewc-item'), selected_counter);
});
$('form.cart .pewc-item-products-column').each(function(){
$(this).removeClass('pewc-active-field');
$(this).attr('data-field-price', 0);
$(this).attr('data-field-value', '');
pewc_update_checkbox_field_counter($(this), 0);
});
$('form.cart .pewc-column-wrapper .pewc-variable-child-product-wrapper.checked').each(function(){
var field_value=[];
var field_wrapper=$(this).closest('.pewc-item');
var parent_field_value=field_wrapper.attr('data-field-value');
if(parent_field_value!=0&&parent_field_value!=''){
field_value=parent_field_value.split(', ');
}
var parent_field_price=parseFloat(field_wrapper.attr('data-field-price'));
var selected_counter=parseInt(field_wrapper.attr('data-field-selected-counter') );
var is_hidden=field_wrapper.hasClass('pewc-hidden-field');
var is_dependent=(field_wrapper.hasClass('pewc-variation-dependent') )&&(! field_wrapper.hasClass('active') );
if(! is_hidden&&! is_dependent){
var quantities=$(this).closest('.pewc-column-wrapper').data('products-quantities');
field_wrapper.removeClass('pewc-active-field');
$(this).find('.pewc-variable-child-select').each(function(){
field_value.push($(this).find('option:selected').text());
var child_product_price=$(this).find(':selected').data('option-cost');
if(parseFloat($(this).find(':selected').attr('data-wcfad-price')) > 0){
child_product_price=parseFloat($(this).find(':selected').attr('data-wcfad-price'));
}
var qty=0;
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
selected_counter++;
}else if(quantities=='independent'){
qty=$(this).closest('.pewc-checkbox-image-wrapper').find('.pewc-child-quantity-field').val();
selected_counter +=parseInt(qty);
if(pewc_vars.multiply_independent=='yes' ){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
selected_counter++;
}
if(child_product_price > 0){
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
parent_field_price +=parseFloat(child_product_price) * parseFloat(qty);
}
if(field_value.length > 0){
field_wrapper.attr('data-field-price', parent_field_price);
set_summary_panel_data(field_wrapper, field_value.join(', '), parent_field_price);
}});
if($(this).find('.pewc-column-attributes-select').length > 0){
var child_id=$(this).data('option-id');
var child_variant=$(this).find('input[name="pewc_child_variants_' + child_id + '"]');
field_value.push(child_variant.attr('data-variation-name') );
var child_product_price=child_variant.attr('data-option-cost');
var qty=0;
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
selected_counter++;
}else if(quantities=='independent'){
qty=$(this).find('.pewc-child-quantity-field').val();
selected_counter +=parseInt(qty);
if(pewc_vars.multiply_independent=='yes'){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
selected_counter++;
}
if(child_product_price > 0){
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
parent_field_price +=parseFloat(child_product_price) * parseFloat(qty);
}
if(field_value.length > 0){
field_wrapper.attr('data-field-price', parent_field_price);
set_summary_panel_data(field_wrapper, field_value.join(', '), parent_field_price);
}}
}
pewc_update_checkbox_field_counter(field_wrapper, selected_counter);
});
$('form.cart .pewc-column-wrapper .pewc-simple-child-product-wrapper.checked').each(function(){
var field_value=[];
var field_wrapper=$(this).closest('.pewc-item');
var parent_field_value=field_wrapper.attr('data-field-value');
if(parent_field_value!=0&&parent_field_value!=''){
field_value=parent_field_value.split(', ');
}
var parent_field_price=parseFloat(field_wrapper.attr('data-field-price'));
var selected_counter=parseInt(field_wrapper.attr('data-field-selected-counter') );
var is_hidden=field_wrapper.hasClass('pewc-hidden-field');
var is_dependent=(field_wrapper.hasClass('pewc-variation-dependent') )&&(! field_wrapper.hasClass('active') );
if(! is_hidden&&! is_dependent){
var quantities=$(this).closest('.pewc-column-wrapper').data('products-quantities');
field_wrapper.removeClass('pewc-active-field');
$(this).find('.pewc-checkbox-form-field').each(function(){
field_value.push($(this).attr('data-field-label') );
var child_product_price=$(this).data('option-cost');
if(parseFloat($(this).attr('data-wcfad-price')) > 0){
child_product_price=parseFloat($(this).attr('data-wcfad-price'));
}
var qty=0;
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
selected_counter++;
}else if(quantities=='independent'){
qty=$(this).closest('.pewc-simple-child-product-wrapper').find('.pewc-child-quantity-field').val();
selected_counter +=parseInt(qty);
if(pewc_vars.multiply_independent=='yes' ){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
selected_counter++;
}
if(child_product_price > 0){
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
parent_field_price +=parseFloat(child_product_price) * parseFloat(qty);
}
if(field_value.length > 0){
field_wrapper.attr('data-field-price', parent_field_price);
set_summary_panel_data(field_wrapper, field_value.join(', '), parent_field_price);
}});
}
pewc_update_checkbox_field_counter(field_wrapper, selected_counter);
});
$('form.cart .pewc-item-products-swatches').each(function(){
$(this).removeClass('pewc-active-field');
$(this).attr('data-field-price', 0);
$(this).attr('data-field-value', '');
});
$('form.cart .pewc-swatches-wrapper .pewc-child-variation-main').each(function(){
var field_value=[];
var parent_field_value=$(this).closest('.pewc-item').attr('data-field-value');
if(parent_field_value!=0&&parent_field_value!=''){
field_value=parent_field_value.split(', ');
}
var parent_field_price=parseFloat($(this).closest('.pewc-item').attr('data-field-price'));
var is_hidden=$(this).closest('.pewc-item').hasClass('pewc-hidden-field');
var is_dependent=($(this).closest('.pewc-item').hasClass('pewc-variation-dependent') )&&(! $(this).closest('.pewc-item').hasClass('active') );
if(! is_hidden&&! is_dependent){
var quantities=$(this).closest('.pewc-swatches-wrapper').data('products-quantities');
$(this).find('.pewc-child-name input').each(function(){
var child_product_price=parseFloat($(this).attr('data-option-cost') );
if(parseFloat($(this).attr('data-wcfad-price')) > 0){
child_product_price=parseFloat($(this).attr('data-wcfad-price'));
}
var qty=0;
if(child_product_price > 0&&$(this).is(':checked') ){
if(quantities=='linked'){
qty=pewc_get_quantity(qty, 'linked');
}else if(quantities=='independent'){
qty=$(this).closest('.pewc-child-variation-main').find('.pewc-child-quantity-field').val();
if(pewc_vars.multiply_independent=='yes' ){
var main_quantity=pewc_get_quantity();
qty=qty * parseFloat(main_quantity);
}}else if(quantities=='one-only'){
qty=pewc_get_quantity(1, 'one-only');
}}
if(qty < 1){
return;
}
field_value.push($(this).attr('data-field-label') );
child_products_total +=parseFloat(child_product_price) * parseFloat(qty);
parent_field_price +=parseFloat(child_product_price) * parseFloat(qty);
if(field_value.length > 0){
$(this).closest('.pewc-item').attr('data-field-price', parent_field_price);
set_summary_panel_data($(this).closest('.pewc-item'), field_value.join(', '), parent_field_price);
}});
}});
$('form.cart .grid-layout').each(function(){
var is_hidden=$(this).closest('.pewc-item').hasClass('pewc-hidden-field');
var is_hidden_group=$(this).closest('.pewc-group-wrap').hasClass('pewc-group-hidden');
var is_dependent=($(this).closest('.pewc-item').hasClass('pewc-variation-dependent') )&&(! $(this).closest('.pewc-item').hasClass('active') );
if(! is_hidden&&! is_hidden_group&&! is_dependent){
var child_product_price=parseFloat($(this).closest('.pewc-item').attr('data-price') );
child_products_total +=parseFloat(child_product_price);
}});
if(product_price < 0) product_price=0;
$('.pewc-summary-panel-group-row').addClass('pewc-summary-panel-field-row-inactive');
$('.pewc-group-wrap').not('.pewc-group-hidden').each(function(){
var group_id=$(this).attr('data-group-id');
$('.pewc-summary-panel-group-'+group_id).removeClass('pewc-summary-panel-field-row-inactive');
});
$('.pewc-summary-panel-field-row').addClass('pewc-summary-panel-field-row-inactive');
$('.pewc-active-field').not('.pewc-hidden-field, .pewc-hidden-calculation').each(function(){
var field_id=$(this).attr('data-field-id');
var field_type=$('.pewc-field-' + field_id).attr('data-field-type');
$('#pewc-summary-row-' + field_id).removeClass('pewc-summary-panel-field-row-inactive').addClass('pewc-field-' + field_type);
var field_price=parseFloat($(this).attr('data-field-price') );
if(field_price){
field_price=field_price.toFixed(pewc_vars.decimals);
}
var field_label=$(this).attr('data-field-label');
var field_value;
if($(this).attr('data-field-type')!='checkbox'){
field_value=$(this).attr('data-field-value');
}
$('#pewc-summary-row-' + field_id).find('.pewc-summary-panel-product-name').text(field_label);
$('#pewc-summary-row-' + field_id).find('.pewc-summary-panel-product-value').text(field_value);
$('#pewc-summary-row-' + field_id).find('.pewc-summary-panel-price').html(pewc_wc_price(field_price) );
});
var qty=1;
qty=pewc_get_quantity(qty, 'linked');
orig_total_price=total_price;
if(pewc_wcfad_apply_discount()){
total_price=pewc_wcfad.adjust_price(total_price);
if(repeatable_prices > 0){
repeatable_prices=pewc_wcfad.adjust_price(repeatable_prices);
}}
var subtotal=parseFloat(child_products_total) + parseFloat(total_price) + parseFloat(qty * product_price);
if(! isNaN(subtotal) ){
$('#pewc-summary-panel-subtotal').html(pewc_wc_price(subtotal.toFixed(pewc_vars.decimals)) );
}
var total_grid_variations=$('#pewc-grid-total-variations').val();
if(! pewc_is_booking_product()&&! pewc_wcbvp_variation_grid()){
var product_price=qty * product_price;
}
var grand_total=product_price;
var orig_grand_total=qty * orig_product_price;
base_price=product_price;
product_price=product_price.toFixed(pewc_vars.decimals);
product_price=pewc_wc_price(product_price);
product_price=add_price_suffix(product_price, base_price);
$('#pewc-per-product-total').html(product_price);
total_price=qty * total_price;
orig_total_price=qty * orig_total_price;
if(repeatable_prices > 0){
total_price +=repeatable_prices;
orig_total_price +=repeatable_prices;
}
if(total_grid_variations > 0){
total_price=total_grid_variations * total_price;
}
total_price +=child_products_total;
grand_total +=total_price;
orig_grand_total +=orig_total_price;
if(! isNaN(total_price) ){
var base_total_price=total_price;
total_price=total_price.toFixed(pewc_vars.decimals);
total_price=pewc_wc_price(total_price);
total_price=add_price_suffix(total_price, base_total_price);
$('#pewc-options-total').html(total_price);
}
if(flat_rate_total < 0) flat_rate_total=0;
base_flat_rate_total=flat_rate_total;
grand_total +=flat_rate_total;
flat_rate_total=flat_rate_total.toFixed(pewc_vars.decimals);
flat_rate_total=pewc_wc_price(flat_rate_total);
flat_rate_total=add_price_suffix(flat_rate_total, base_flat_rate_total);
$('#pewc-flat-rate-total').html(flat_rate_total);
if(( $('#pewc_calc_set_price').attr('data-calc-set')==1||$('input[name="pewc_calc_set_price"]').length > 1)&&$('.pewc-product-extra-groups-wrap .pewc-item-calculation').not('.pewc-hidden-field').length > 0){
if($('input[name="pewc_calc_set_price"]').length > 1){
var new_grand_total=0;
$('input[name="pewc_calc_set_price"]').each(function(){
if($(this).attr('data-calc-set')==1&&$(this).closest('.pewc-product-extra-groups-wrap').is(':visible') ){
new_grand_total=parseFloat($(this).closest('.pewc-product-extra-groups-wrap').find('input[name="pewc_calc_set_price"][data-calc-set="1"]').val());
}});
if(new_grand_total > 0){
grand_total=new_grand_total;
}}else{
grand_total=parseFloat($('#pewc_calc_set_price').val());
}
orig_grand_total=grand_total;
if($('form.cart .quantity .qty').length > 0){
if(pewc_wcfad_apply_discount()){
grand_total=pewc_wcfad.adjust_price(grand_total);
}
grand_total=grand_total * parseFloat($('form.cart .quantity .qty').val());
orig_grand_total=orig_grand_total * parseFloat($('form.cart .quantity .qty').val());
}}
if(! isNaN(grand_total) ){
if(isNaN(orig_grand_total)||orig_grand_total==grand_total){
orig_grand_total='';
}
var base_price=grand_total;
grand_total=grand_total.toFixed(pewc_vars.decimals);
grand_total=pewc_wc_price(grand_total);
if(pewc_vars.update_price=='yes'){
update_product_price(grand_total, base_price, orig_grand_total);
}
grand_total=add_price_suffix(grand_total, base_price);
$('#pewc-grand-total').html(grand_total);
if($('#pewc-grand-total_clone').length > 0){
$('#pewc-grand-total_clone').html(grand_total);
}}
if($update==0&&pewc_vars.conditions_timer < 1){
var interval=setTimeout(function(){
pewc_update_total_js(1);
if(! total_updated){
$('body').trigger('pewc_trigger_calculations');
total_updated=true;
}},
250);
}
$('body').trigger('pewc_after_update_total_js', [ base_total_price, base_price, grand_total ]);
}
function pewc_update_checkbox_field_counter(field_wrapper, counter){
var current_count=field_wrapper.attr('data-field-selected-counter');
if(current_count!=counter){
field_wrapper.attr('data-field-selected-counter', counter);
$('body').trigger('pewc_field_selected_counter_updated', [ field_wrapper, counter ]);
}}
function add_price_suffix(price, base_price){
if(pewc_vars.show_suffix=='yes'){
var price_suffix_setting=pewc_vars.price_suffix_setting;
if(price_suffix_setting.indexOf('{price_excluding_tax}') > -1){
var price_ex_tax=base_price *(pewc_vars.percent_exc_tax / 100);
suffix=price_suffix_setting.replace('{price_excluding_tax}', pewc_wc_price(price_ex_tax.toFixed(pewc_vars.decimals), false, false) );
}else if(price_suffix_setting.indexOf('{price_including_tax}') > -1){
var price_inc_tax=base_price *(pewc_vars.percent_inc_tax / 100);
suffix=price_suffix_setting.replace('{price_including_tax}', pewc_wc_price(price_inc_tax.toFixed(pewc_vars.decimals), false, false) );
}else{
suffix=pewc_vars.price_suffix;
}
price=price + ' <small class="woocommerce-price-suffix">' + suffix + '</small>';
}
return price;
}
function update_product_price(grand_total, base_price, orig_grand_total){
var price_suffix_setting=pewc_vars.price_suffix_setting;
var main_price=$('.pewc-main-price').not('.pewc-quickview-product-wrapper .pewc-main-price');
if(main_price.length > 1){
main_price.each(function(index, element){
if(index < 1){
$(this).addClass('pewc-main-main-price');
return false;
};});
main_price=$('.pewc-main-price.pewc-main-main-price');
}
var suffix=main_price.find('.woocommerce-price-suffix').html();
var label=main_price.find('.wcfad-rule-label').html();
var before=main_price.find('.pewc-label-before').html();
var after=main_price.find('.pewc-label-after').html();
var hide=main_price.find('.pewc-label-hidden');
var new_total='';
if(hide.length > 0){
new_total='<span class="pewc-label-hidden">' + hide.html() + '</span>';
}else{
if(before){
new_total +='<span class="pewc-label-before">' + before + ' </span>';
}
if(orig_grand_total!=''&&pewc_vars.disable_wcfad_label!='yes'){
orig_grand_total.toFixed(pewc_vars.decimals);
orig_grand_total=pewc_wc_price(orig_grand_total);
new_total +=' <s>' + orig_grand_total + '</s> ';
}
new_total +=grand_total;
if(after){
new_total +='<span class="pewc-label-after"> ' + after + '</span>';
}
if(suffix){
if(price_suffix_setting.indexOf('{price_excluding_tax}') > -1){
var price_ex_tax=base_price *(pewc_vars.percent_exc_tax / 100);
suffix=price_suffix_setting.replace('{price_excluding_tax}', pewc_wc_price(price_ex_tax.toFixed(pewc_vars.decimals), false, false) );
}else if(price_suffix_setting.indexOf('{price_including_tax}') > -1){
var price_inc_tax=base_price *(pewc_vars.percent_inc_tax / 100);
suffix=price_suffix_setting.replace('{price_including_tax}', pewc_wc_price(price_inc_tax.toFixed(pewc_vars.decimals), false, false) );
}
if(label&&suffix.indexOf('wcfad-rule-label') < 0){
suffix +='<br><span class="wcfad-rule-label">' + label + '</span>';
}
new_total +='&nbsp;<small class="woocommerce-price-suffix">' + suffix + '</small>';
}}
if(main_price.find('.wcfad-rule-label').length > 0&&new_total.indexOf('wcfad-rule-label')==-1){
var dpdr_label=main_price.find('.wcfad-rule-label');
new_total +='<br>' + dpdr_label[0].outerHTML;
}
main_price.html(new_total);
}
function set_summary_panel_data(field, value, added_price){
$(field).attr('data-field-value', value);
$(field).attr('data-field-price', added_price);
$(field).addClass('pewc-active-field');
}
function format_separator(num){
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
}
$('body').on('pewc_attach_form_cart_input_change', function(){
$('form.cart').on('keyup input change paste', 'input:not(.pewc-grid-quantity-field), select, textarea.pewc-has-field-price', function(){
pewc_update_total_js_debounced();
$('body').trigger('pewc_updated_total_js');
});
});
$('body').trigger('pewc_attach_form_cart_input_change');
var interval=setTimeout(function(){
pewc_update_total_js();
if('yes'==pewc_vars.enable_character_counter){
pewc_update_text_field_counters();
}},
250);
$('body').on('pewc_add_button_clicked', function(){
pewc_update_total_js();
});
$('body').on('pewc_force_update_total_js', function(){
pewc_update_total_js_debounced();
});
$('.pewc-groups-accordion h3').on('click', function(e){
pewc_accordion_click($(this) );
});
if(pewc_vars.accordion_toggle=='open'){
$('.pewc-group-wrap').addClass('group-active');
}else if(pewc_vars.accordion_toggle=='closed'){
$('.pewc-group-wrap').removeClass('group-active');
}else{
$('.first-group').addClass('group-active');
}
$('.pewc-tab').on('click',function(e){
if($(this).hasClass('pewc-disabled-group')){
return;
}
e.preventDefault();
var tab_id=$(this).attr('data-group-id');
$('.pewc-tab').removeClass('active-tab tab-failed');
$('.pewc-group-js-validation-notice').hide();
$(this).addClass('active-tab');
$('.pewc-group-wrap').removeClass('group-active');
$('.pewc-group-wrap-'+tab_id).addClass('group-active');
});
$('.pewc-next-step-button').on('click',function(e){
e.preventDefault();
if($(this).hasClass('pewc-disabled-group')){
return;
}
var tab_id=$(this).attr('data-group-id');
var tab_index=$(this).closest('.pewc-group-wrap').attr('data-group-index');
var direction=$(this).attr('data-direction');
$('.pewc-tab').removeClass('active-tab tab-failed');
$('.pewc-group-js-validation-notice').hide();
if($('.pewc-group-wrap-' + tab_id).hasClass('pewc-group-hidden') ){
var total_tabs=$('.pewc-group-wrap').length;
if(direction=='next'){
for(var i=parseInt(tab_index) + 1; i < total_tabs; i++){
if(! $('.pewc-group-index-' + i).hasClass('pewc-group-hidden') ){
tab_id=$('.pewc-group-index-' + i).attr('data-group-id');
break;
}}
}else{
for(var i=parseInt(tab_index) - 1; i >=0; i--){
if(! $('.pewc-group-index-' + i).hasClass('pewc-group-hidden') ){
tab_id=$('.pewc-group-index-' + i).attr('data-group-id');
break;
}}
}}
$('#pewc-tab-' + tab_id).addClass('active-tab');
$('.pewc-group-wrap').removeClass('group-active');
$('.pewc-group-wrap-' + tab_id).addClass('group-active');
if(pewc_vars.steps_group_disable_scroll_to_top!='yes'){
if($('.pewc-steps-wrapper').length > 0){
$([document.documentElement, document.body]).animate({
scrollTop: $('.pewc-steps-wrapper').offset().top
}, 150);
}}
});
function pewc_get_text_str_len(str, wrapper){
var new_str, str_ex_spaces ;
var field=$(wrapper).find('.pewc-form-field');
if(pewc_vars.remove_spaces!='yes'){
str_ex_spaces=str.replace(/\s/g, "");
}else{
str_ex_spaces=str;
}
var str_len=str_ex_spaces.length;
if($(field).attr('data-alphanumeric')==1){
str_ex_spaces=str_ex_spaces.replace(/\W/g, '');
$(field).val(str_ex_spaces);
str_len=str_ex_spaces.length;
}
if($(field).attr('data-alphanumeric-charge')==1){
str_ex_spaces=str_ex_spaces.replace(/\W/g, '');
str_len=str_ex_spaces.length;
}
var freechars=$(field).attr('data-freechars');
str_len -=freechars;
str_len=Math.max(0,str_len);
return str_len;
}
function pewc_disable_child_product_quantities(){
$('.woocommerce-cart-form__cart-item.pewc-child-product').each(function(){
if(pewc_vars.disable_qty||pewc_vars.multiply_independent=='yes'){
$(this).find('.product-quantity input').attr('disabled',true);
}});
}
$('body').on('click', 'a.wfc-open-cart-button', function(e){
var timeout=setTimeout(
function(){
$('.wfc-cart-form__cart-item.pewc-child-product').each(function(){
if(pewc_vars.disable_qty||pewc_vars.multiply_independent=='yes'){
$(this).find('.product-quantity input').attr('disabled',true);
}});
},
250
);
});
if($('.woocommerce-cart-form__cart-item.pewc-child-product').length > 0){
pewc_disable_child_product_quantities();
$('body').on('updated_cart_totals', pewc_disable_child_product_quantities);
}
$('body').on('change','.products-quantities-independent .pewc-child-select-field',function(){
var number_field=$(this).closest('.child-product-wrapper').find('.pewc-child-quantity-field');
if($(this).val()!=''){
if($(number_field).val()==0){
$(number_field).val(1);
};}else{
$(number_field).val(0);
}
pewc_update_independent_quantity_input_max($(this), number_field);
});
function pewc_update_independent_quantity_input_max(select_field, number_field){
var available_stock=$(select_field).find(':selected').data('stock');
if(available_stock){
var number=$(number_field).attr('max', available_stock);
if($(number).val() > available_stock){
$(number_field).val(available_stock);
}}else{
$(number_field).removeAttr('max');
}}
$('body').on('change input keyup paste click','.products-quantities-independent .pewc-child-quantity-field',function(e){
e.stopPropagation();
if($(this).closest('.pewc-item').hasClass('pewc-item-products-select') ){
var selIndex=0;
if($(this).val() > 0){
var selField=$(this).closest('.pewc-item').find('select.pewc-child-select-field');
selIndex=selField.prop('selectedIndex');
if(selIndex < 1&&selField.val()==''){
$(this).closest('.pewc-item').find('select.pewc-child-select-field option').each(function(index, element){
if($(this).val()!=''&&selIndex < 1){
selIndex=index;
return;
}});
}}
$(this).closest('.pewc-item').find('select.pewc-child-select-field').prop('selectedIndex', selIndex);
}else{
if($(this).val() > 0){
var checkbox=$(this).closest('.pewc-checkbox-wrapper').find('input[type=checkbox]').prop('checked',true).trigger('change');
}else{
var checkbox=$(this).closest('.pewc-checkbox-wrapper').find('input[type=checkbox]').prop('checked',false).trigger('change');
}}
var available_stock=$(this).find(':selected').data('stock');
$('body').trigger('pewc_update_child_quantity', [ $(this).closest('.pewc-checkbox-wrapper').find('input[type=checkbox]') ]);
pewc_update_total_js();
});
$('body').on('change input keyup paste click', '.pewc-item-products-radio.pewc-item-products-independent .pewc-child-quantity-field, .pewc-item-products-radio-list.pewc-item-products-independent .pewc-child-quantity-field', function(e){
var item_field_wrapper=$(this).closest('.pewc-item-field-wrapper');
var pewc_item_wrapper=item_field_wrapper.closest('.pewc-item');
var radio_type='';
var number_checked=0;
if(pewc_item_wrapper.hasClass('pewc-item-products-radio') ){
radio_type='radio images';
number_checked=item_field_wrapper.find('.pewc-radio-images-wrapper .pewc-radio-image-wrapper.checked').length;
}else{
radio_type='radio list';
number_checked=item_field_wrapper.find('.pewc-radio-wrapper input.pewc-radio-form-field:checked').length;
}
var number_value=$(this).val();
if(number_value > 0&&number_checked < 1){
if(radio_type=='radio images'){
item_field_wrapper.find('.pewc-radio-images-wrapper .pewc-radio-image-wrapper').each(function(){
if(! $(this).hasClass('checked') ){
$(this).addClass('checked');
}
$(this).find('input.pewc-radio-form-field').prop('checked', true);
return false;
});
}else{
item_field_wrapper.find('.pewc-radio-list-wrapper .pewc-radio-wrapper input.pewc-radio-form-field').each(function(){
$(this).prop('checked', true);
return false;
});
}}else if(number_value < 1&&number_checked > 0){
if(radio_type=='radio images'){
item_field_wrapper.find('.pewc-radio-images-wrapper .pewc-radio-image-wrapper.checked').each(function(){
$(this).removeClass('checked');
$(this).find('input.pewc-radio-form-field').prop('checked', false);
});
}else{
item_field_wrapper.find('.pewc-radio-list-wrapper .pewc-radio-wrapper input.pewc-radio-form-field:checked').each(function(){
$(this).prop('checked', false);
});
}}
});
$('body').on('change input keyup paste','.pewc-item-products-independent.pewc-child-qty-target .pewc-child-quantity-field',function(){
var wrapper=$(this).closest('.pewc-item');
var triggered_by=$(wrapper).attr('data-child-qty-triggered-by');
var reverse_field_id=$('.pewc-field-' + triggered_by).attr('data-reverse-formula-field');
var reverse_formula=calculations.get_formula_by_id(reverse_field_id);
calc_field=$('.pewc-field-' + reverse_field_id);
calc_field_id=$(calc_field).attr('data-field-id');
price_wrapper=$(calc_field).find('.pewc-calculation-price-wrapper');
calc_field_id=$(calc_field).attr('data-field-id');
formula=$(price_wrapper).find('.pewc-data-formula').val();
fields=$(price_wrapper).find('.pewc-data-fields').val();
round=$(price_wrapper).find('.pewc-formula-round').val();
decimals=$(price_wrapper).find('.pewc-decimal-places').val();
if(fields){
fields=JSON.parse(fields);
}
var reverse_result=calculations.evaluate_formula(fields, reverse_formula, round, decimals, calc_field_id);
var source_field_id=$('.pewc-field-' + triggered_by).attr('data-reverse-input-field');
$('.pewc-field-' + source_field_id).find('input').val(reverse_result);
if($('.pewc-field-' + triggered_by).hasClass('pewc-quantity-overrides') ){
$(wrapper).addClass('pewc-quantity-updated');
}});
$('body').on('pewc_update_child_quantity', function(e, el){
var child_qty=$(el).closest('.pewc-checkbox-wrapper').find('input[type=number]').val();
if(child_qty > 0){
$(el).closest('.pewc-checkbox-image-wrapper').addClass('checked');
}else{
$(el).closest('.pewc-checkbox-image-wrapper').removeClass('checked');
}});
$('body').on('click', '.products-quantities-independent .pewc-checkbox-form-field', function(e){
if($(this).closest('.pewc-checkbox-images-wrapper').hasClass('pewc-force-quantity')||$(this).closest('.pewc-checkbox-image-wrapper').find('.pewc-column-attributes-select').length > 0){
e.stopPropagation();
e.preventDefault();
return;
}
if($(this).is(':checked')){
var number=$(this).closest('.pewc-checkbox-wrapper').find('input[type=number]').val();
if(number==0){
var default_quantity=$(this).closest('.pewc-checkbox-wrapper').find('input[type=number]').attr('data-default-quantity');
if(default_quantity==undefined||pewc_vars.set_child_quantity_default!='yes'){
default_quantity=1;
}
$(this).closest('.pewc-checkbox-wrapper').find('input[type=number]').val(default_quantity);
}}else{
var number=$(this).closest('.pewc-checkbox-wrapper').find('input[type=number]').val(0);
}
e.stopPropagation();
});
$('body').on('click', '.products-quantities-linked .pewc-checkbox-form-field, .products-quantities-one-only .pewc-checkbox-form-field', function(e){
e.stopPropagation();
if($(this).is(':checked')){
$(this).closest('.pewc-checkbox-image-wrapper').addClass('checked');
}else{
$(this).closest('.pewc-checkbox-image-wrapper').removeClass('checked');
}});
$('body').on('change', '.pewc-text-swatch input', function(e){
var field_type=$(this).closest('.pewc-item').attr('data-field-type');
if(field_type=='radio'){
$(this).closest('ul').find('label').removeClass('active-swatch');
}
if($(this).prop('checked')==true){
$(this).closest('label').addClass('active-swatch');
}else{
$(this).closest('label').removeClass('active-swatch');
}});
$('body').on('click', '.pewc-radio-image-wrapper, .pewc-checkbox-image-wrapper', function(e){
var wrapper=$(this);
if($(wrapper).hasClass('pewc-checkbox-disabled') ){
return;
}
if($(wrapper).closest('.pewc-components-wrapper').hasClass('pewc-force-quantity') ){
return;
}
if($(wrapper).find('.pewc-column-attributes-select').length > 0){
return;
}
var radio;
var is_image_swatch_checkbox=$(wrapper).closest('.pewc-item').hasClass('pewc-item-image-swatch-checkbox');
var is_checkbox=$(wrapper).hasClass('pewc-checkbox-image-wrapper');
if(! is_image_swatch_checkbox&&! is_checkbox){
var checked=$(wrapper).find('.pewc-radio-form-field').prop('checked');
var group=$(wrapper).closest('.pewc-radio-images-wrapper').find('.pewc-radio-image-wrapper').removeClass('checked');
if(! checked){
$(wrapper).addClass('checked');
}
radio=$(wrapper).find('.pewc-radio-form-field');
setTimeout(function(){ radio.trigger('click'); }, 0);
}else{
if(is_checkbox){
e.preventDefault();
radio=$(wrapper).find('.pewc-checkbox-form-field');
$(wrapper).toggleClass('checked');
if(is_image_swatch_checkbox){
var checked=$(radio).prop('checked');
var new_checked = ! checked;
setTimeout(function(){ $(radio).prop('checked', new_checked).trigger('change'); }, 0);
}else{
setTimeout(function(){ $(radio).trigger('click'); }, 0);
}
e.stopPropagation();
}else{
radio=$(wrapper).find('.pewc-radio-form-field');
var checked=$(radio).prop('checked');
$(wrapper).toggleClass('checked');
var new_checked = ! checked;
setTimeout(function(){ $(radio).prop('checked', new_checked).trigger('click'); }, 0);
}}
}).on('click', '.pewc-radio-image-wrapper .pewc-radio-form-field', function(e){
var wrapper=$(this).closest('.pewc-radio-image-wrapper');
if($(wrapper).find('.pewc-column-attributes-select').length > 0){
return;
}
var is_image_swatch_checkbox=$(this).closest('.pewc-item').hasClass('pewc-item-image-swatch-checkbox');
if(! is_image_swatch_checkbox){
e.stopPropagation();
var checked=$(this).closest('.pewc-radio-image-wrapper').hasClass('checked');
if(! checked){
$(this).prop('checked', false).trigger('change');
}}else{
e.stopPropagation();
$(this).closest('.pewc-radio-image-wrapper').toggleClass('checked');
}
$form=$(this).closest('form');
add_on_images.update_add_on_image($(this), $form);
});
$('body').on('click' , '.products-quantities-independent .pewc-radio-form-field', function(){
if($(this).is(':checked')){
var number_field=$(this).closest('.pewc-item-field-wrapper').find('input[type=number]');
var number=$(number_field).val();
if(number==0){
$(number_field).val(1);
}
if($(this).attr('data-stock') > 0){
$(number_field).attr('max', $(this).attr('data-stock'));
if($(number_field).val() > $(this).attr('data-stock')){
$(number_field).val($(this).attr('data-stock'));
}}
}else{
var number=$(this).closest('.pewc-item-field-wrapper').find('input[type=number]').val(0);
}});
function pewc_toggle_add_to_cart_button(eventType, disabled, caller){
var button=$('body').find('form.cart .single_add_to_cart_button');
var disable_class='pewc-disabled-by-'+caller;
if(button.length < 1) return;
if(disabled){
button.attr('disabled', true);
if(! button.hasClass(disable_class) ){
button.addClass(disable_class);
var button_text=pewc_vars.calculating_text;
if(caller==='upload'){
button_text=pewc_vars.uploading_text;
}
pewc_update_add_to_cart_button_text(button, button_text);
}}else{
button.removeClass(disable_class);
if(button.attr('class').indexOf('pewc-disabled-by')==-1){
button.attr('disabled', false);
pewc_update_add_to_cart_button_text(button, pewc_vars.default_add_to_cart_text);
}}
}
$('body').on('pewc_toggle_add_to_cart_button', pewc_toggle_add_to_cart_button);
function pewc_update_add_to_cart_button_text(button, button_text){
if(button.is('button') ){
button.text(button_text);
}else{
button.val(button_text);
}}
var calculations={
init: function(){
if(pewc_vars.calculations_timer > 0){
if(pewc_vars.event_driven_conditions==='yes'){
$('body').on('keyup input change paste', 'form.cart .qty', this.recalculate);
$('body').on('keyup input change paste', 'form.cart .pewc-item.pewc-calculation-trigger, .pewc-form-field.pewc-calculation-trigger, .pewc-field-triggers-condition .pewc-form-field, .pewc-field-triggers-condition .pewc-radio-form-field', this.recalculate);
$('body').on('keyup input change paste', '.pewc-number-uploads', this.recalculate);
$('body').on('pewc_trigger_calculations', this.recalculate);
$('body').on('pewc_conditions_checked', this.recalculate);
$('body').one('pewc_after_update_total_js', this.recalculate);
}else{
var interval=setInterval(
this.recalculate,
pewc_vars.calculations_timer
);
}
if(pewc_vars.disable_button_recalculate=='yes'){
$('body').on('keyup input change paste', 'form.cart .qty', this.disable_add_to_cart_button);
$('body').on('keyup input change paste', 'form.cart .pewc-item.pewc-calculation-trigger, .pewc-form-field.pewc-calculation-trigger, .pewc-field-triggers-condition .pewc-form-field, .pewc-field-triggers-condition .pewc-radio-form-field', this.disable_add_to_cart_button);
$('body').on('keyup input change paste', '.pewc-number-uploads', this.disable_add_to_cart_button);
$('body').on('pewc_trigger_calculations', this.disable_add_to_cart_button);
$('body').on('pewc_conditions_checked', this.disable_add_to_cart_button);
}}else{
$('body').on('keyup input change paste', 'form.cart .qty', this.recalculate);
$('body').on('keyup input change paste', 'form.cart .pewc-item.pewc-calculation-trigger, .pewc-form-field.pewc-calculation-trigger, .pewc-field-triggers-condition .pewc-form-field, .pewc-field-triggers-condition .pewc-radio-form-field', this.recalculate);
$('body').on('keyup input change paste', '.pewc-number-uploads', this.recalculate);
$('body').on('pewc_trigger_calculations', this.recalculate);
$('body').on('pewc_conditions_checked', this.recalculate);
}},
disable_add_to_cart_button: function(e){
var num_calcs=$('.pewc-product-extra-groups-wrap .pewc-item-calculation').not('.pewc-hidden-field').length;
if(parseFloat(num_calcs) < 1){
return;
}
pewc_toggle_add_to_cart_button(e, true, 'calculation_recalculate');
},
recalculate: function(e){
var num_calcs=parseInt($('.pewc-product-extra-groups-wrap .pewc-item-calculation').not('.pewc-hidden-field').length);
var num_formulas_in_field_prices=parseInt($('.pewc-product-extra-groups-wrap .pewc-field-price-has-formula').not('.pewc-hidden-field').length);
var num_formulas_in_option_prices=parseInt($('.pewc-product-extra-groups-wrap .pewc-field-option-price-has-formula').not('.pewc-hidden-field').length);
if(num_calcs < 1&&num_formulas_in_field_prices < 1&&num_formulas_in_option_prices < 1){
return;
}
var calc_field, price_wrapper, dimensions_wrapper, formula, tags, calc_formula, replace, calc_field_id, calc_value, prev_calc_value;
var calc_fields=[];
var update=0;
if(pewc_vars.calculations_timer > 0&&pewc_vars.disable_button_recalculate=='yes'){
var pewc_total_calc_price_start=$('#pewc_total_calc_price').val();
}
$('body').find('form.cart .pewc-item-calculation').not('.pewc-hidden-field').each(function(){
if($(this).hasClass('pewc-variation-dependent')&&! $(this).hasClass('active') ){
return;
}
var group=$(this).closest('.pewc-group-wrap');
if($(group).hasClass('pewc-group-hidden') ){
return;
}
var group_id=$(group).attr('data-group-id');
calc_field=$(this);
var field_id=$(calc_field).attr('data-id');
calc_field_id=$(calc_field).attr('data-field-id');
price_wrapper=$(calc_field).find('.pewc-calculation-price-wrapper');
formula=$(price_wrapper).find('.pewc-data-formula').val();
fields=$(price_wrapper).find('.pewc-data-fields').val();
tags=$(price_wrapper).find('.pewc-data-tag').val();
action=$(price_wrapper).find('.pewc-action').val();
round=$(price_wrapper).find('.pewc-formula-round').val();
decimals=$(price_wrapper).find('.pewc-decimal-places').val();
calc_value=$(price_wrapper).find('.pewc-calculation-value');
prev_calc_value=calc_value.val();
if(fields){
fields=JSON.parse(fields);
}
var result=calculations.evaluate_formula(fields, formula, round, decimals, calc_field_id);
if(result=='*'){
$(calc_field).closest('.pewc-item-calculation').attr('data-price', 0);
$(price_wrapper).find('span').html(pewc_vars.null_signifier);
calc_value.val(0);
if(prev_calc_value!=0){
calc_value.trigger('calculation_field_updated')
}
if(pewc_vars.disable_button_calcs=='yes'){
calc_fields.push(calc_field_id);
$('body').trigger('pewc_toggle_add_to_cart_button', [ true, 'calculation' ]);
}}else if(! result||! isNaN(result) ){
if(pewc_vars.disable_button_calcs=='yes'){
calc_fields=calc_fields.filter(function(item){
return item!==calc_field_id;
});
if(calc_fields.length < 1){
$('body').trigger('pewc_toggle_add_to_cart_button', [ false, 'calculation' ]);
}}
$(price_wrapper).find('span').html(result);
if(action=='cost'||action=='price'){
$(calc_field).closest('.pewc-item-calculation').attr('data-price', result);
$(price_wrapper).find('span').html(pewc_wc_price(result) );
}else if(action=='qty'){
$('form.cart').find('.quantity .qty').val(result).trigger('pewc_qty_changed');
}else if(action=='child-qty'){
var product_field_id=$(calc_field).closest('.pewc-item-calculation').find('.pewc-calculation-price-wrapper').attr('data-product-field-id');
var child_qty_product_id=$(calc_field).closest('.pewc-item-calculation').find('.pewc-calculation-price-wrapper').attr('data-child-product-id');
if(! $('.pewc-field-' + product_field_id).hasClass('pewc-quantity-updated') ){
$('.pewc-field-' + product_field_id).find('.pewc-child-quantity-field').val(result).trigger('pewc_update_child_quantity');
var group_name='pewc_group_' + group_id + '_' + product_field_id;
if($("input[name='" + group_name + "_child_product[]']:checked").length < 1){
$('#' + group_name + '_' + child_qty_product_id).prop('checked', true);
$('#' + group_name + '_' + child_qty_product_id).closest('.pewc-radio-image-wrapper').addClass('checked');
}}
}else if(! $(calc_field).hasClass('pewc-hidden-calculation') ){
var result_format=$(price_wrapper).find('.pewc-result-format').val();
if(result_format=='price'){
$(price_wrapper).find('span').html(pewc_wc_price(result) );
}else if(result_format=='price without currency'){
$(price_wrapper).find('span').html(pewc_wc_price_without_currency(result) );
}}
if(action=='price'){
$(calc_field).closest('.pewc-product-extra-groups-wrap').find('#pewc_calc_set_price').val(result).attr('data-calc-set', 1);
}
calc_value.val(result);
if(prev_calc_value!=result){
calc_value.trigger('calculation_field_updated');
calc_value.trigger('change');
}}else if(result&&isNaN(result)&&result!='error'){
allow_text_calcs_fields=pewc_vars.allow_text_calcs_fields;
if(pewc_vars.allow_text_calcs){
$(price_wrapper).find('span').html(result);
calc_value.val(result);
}else if(allow_text_calcs_fields.includes(parseInt(calc_field_id) )){
$(price_wrapper).find('span').html(result);
calc_value.val(result);
}}
update++;
});
if(num_formulas_in_field_prices > 0){
calculations.evaluate_field_prices();
}
if(num_formulas_in_option_prices > 0){
calculations.evaluate_option_prices();
}
if(update > 0){
update=0;
pewc_update_total_js();
}
if(pewc_vars.calculations_timer > 0&&pewc_vars.disable_button_recalculate=='yes'){
var pewc_total_calc_price_end=$('#pewc_total_calc_price').val();
var d=new Date();
var time=d.getTime();
if(pewc_total_calc_price_start!=pewc_total_calc_price_end){
$('body').trigger('pewc_toggle_add_to_cart_button', [ true, 'calculation_recalculate' ]);
$('#pewc_total_calc_price').attr('data-last-calc-time', time);
}else{
if(isNaN($('#pewc_total_calc_price').attr('data-last-calc-time')) ){
$('#pewc_total_calc_price').attr('data-last-calc-time', time);
}else{
var diff=parseFloat(time) - parseFloat($('#pewc_total_calc_price').attr('data-last-calc-time'));
if(isNaN(diff)||diff < pewc_vars.recalculate_waiting_time){
}else{
$('body').trigger('pewc_toggle_add_to_cart_button', [ false, 'calculation_recalculate' ]);
}}
}}
},
evaluate_look_up_table: function(calc_field_id){
var result=false;
if(pewc_look_up_fields==undefined) return false;
var look_up_field=pewc_look_up_fields[calc_field_id];
var table=look_up_field[0];
var x_field=look_up_field[1];
var y_field=look_up_field[2];
var x_value=this.get_field_value(x_field);
var y_value=this.get_field_value(y_field);
var tables=pewc_look_up_tables[table];
if(tables==undefined){
return false;
}
var x_axis=tables[x_value];
if(x_axis==undefined&&x_value&&x_value!=undefined){
if(this.exact_match(calc_field_id, 'x') ){
return '*';
}else{
x_value=calculations.find_nearest_index(x_value, tables);
x_axis=tables[x_value];
}}else if(x_axis==undefined&&x_value==0&&x_value!=undefined){
x_axis=tables[Object.keys(tables)[0]];
}
if(x_axis!=undefined){
var y_axis=tables[y_value];
if(y_value&&y_value!=undefined){
if(! this.exact_match(calc_field_id, 'y') ){
y_value=calculations.find_nearest_index(y_value, x_axis);
}}
if(y_value=='max'){
result=x_axis[Object.keys(x_axis)[Object.keys(x_axis).length - 1]];
}else{
result=x_axis[y_value];
}
if(this.exact_match(calc_field_id, 'y')&&result==undefined){
result='*';
}}else{
return false;
}
return result;
},
get_field_value: function(field_id){
var value=0;
if($('.pewc-field-' + field_id).find('input.pewc-number-field').length > 0){
return $('.pewc-field-' + field_id).find('input.pewc-number-field').val();
}else if($('.pewc-field-' + field_id).find('select').length > 0){
if(! isNaN($('.pewc-field-' + field_id).find('select option:selected').attr('value') )){
return $('.pewc-field-' + field_id).find('select option:selected').attr('value');
}else{
return $('.pewc-field-' + field_id).find('select option:selected').attr('data-option-cost');
}}else if($('.pewc-field-' + field_id).find('input.pewc-radio-form-field[type="radio"]:checked').length > 0){
return $('.pewc-field-' + field_id).find('input.pewc-radio-form-field[type="radio"]:checked').attr('data-option-cost');
}
return value;
},
find_nearest_index: function(value, axis){
var keys=Object.keys(axis);
keys.sort((a,b)=> a-b);
if(parseFloat(value) <=parseFloat(keys[0]) ){
return keys[0];
}
if(pewc_vars.set_initial_key=='yes'){
if(isNaN(keys[0])||keys[0]==''){
keys[0]=0;
}}
for(var i=0; i < keys.length; i++){
if(( parseFloat(value) > parseFloat(keys[i]) )&&keys[i+1]!=undefined&&(parseFloat(value) <=parseFloat(keys[i+1]) )){
return keys[i+1];
}}
if(keys[(keys.length) - 1]=='max'){
return 'max';
}
return keys[i];
},
exact_match: function(calc_field_id, axis){
if($('.pewc-item-calculation.pewc-field-' + calc_field_id).attr('data-exact-match-' + axis)=='yes'){
return true;
}else{
return false;
}},
evaluate_formula: function(fields, formula, round, decimals, calc_field_id){
var calc_formula=formula;
if(fields){
for(var i in fields){
if(fields[i].indexOf('_option_price') > -1){
var field_id=fields[i].replace('_option_price', '');
var o_price=parseFloat($('form.cart .pewc-field-' + field_id).attr('data-selected-option-price') );
if(isNaN(o_price)||($('form.cart .pewc-field-' + field_id).length==0&&pewc_vars.zero_missing_field=='yes') ){
o_price=0;
}
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, o_price);
}else if(fields[i].indexOf('_option_value') > -1){
var field_id=fields[i].replace('_option_value', '');
var o_value=parseFloat($('form.cart .pewc-field-' + field_id).attr('data-field-value'));
if(( $('form.cart .pewc-field-' + field_id).length==0&&pewc_vars.zero_missing_field=='yes')||isNaN(o_value) ){
o_value=0;
}
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, o_value);
}else if(fields[i].indexOf('_field_price') > -1){
var field_id=fields[i].replace('_field_price', '');
var f_price=parseFloat($('form.cart .pewc-field-' + field_id).attr('data-field-price') );
if($('form.cart .pewc-field-' + field_id).length==0&&pewc_vars.zero_missing_field=='yes'){
f_price=0;
}
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, f_price);
}else if(fields[i].indexOf('_number_uploads') > -1){
var field_id=fields[i].replace('_number_uploads', '');
var num_uploads=parseFloat($('form.cart .pewc-field-' + field_id).find('.pewc-number-uploads').val());
if($('form.cart .pewc-field-' + field_id).length==0&&pewc_vars.zero_missing_field=='yes'){
num_uploads=0;
}
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, num_uploads);
}else if(fields[i].indexOf('_pdf_count') > -1){
var field_id=fields[i].replace('_pdf_count', '');
var pdf_count=parseFloat($('#field_' + field_id + "_pdf_count").val());
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, pdf_count);
}else if(fields[i].indexOf('_weight') > -1){
var field_id=fields[i].replace('_weight', '');
var weight=$('form.cart .pewc-field-' + field_id).find('input:checked').closest('.pewc-radio-wrapper').attr('data-product-weight');
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, weight);
}else if(fields[i].indexOf('_length') > -1){
var field_id=fields[i].replace('_length', '');
var length=$('form.cart .pewc-field-' + field_id).find('input:checked').closest('.pewc-radio-wrapper').attr('data-product-length');
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, length);
}else if(fields[i].indexOf('_width') > -1){
var field_id=fields[i].replace('_width', '');
var width=$('form.cart .pewc-field-' + field_id).find('input:checked').closest('.pewc-radio-wrapper').attr('data-product-width');
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, width);
}else if(fields[i].indexOf('_height') > -1){
var field_id=fields[i].replace('_height', '');
var height=$('form.cart .pewc-field-' + field_id).find('input:checked').closest('.pewc-radio-wrapper').attr('data-product-height');
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, height);
}else if(fields[i].indexOf('_quantity') > -1){
var field_id=fields[i].replace('_quantity', '');
var quantity=$('form.cart .pewc-field-' + field_id).find('.pewc-independent-quantity-field').val();
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, quantity);
}else{
var f_val=parseFloat($('form.cart .pewc-number-field-' + fields[i]).val());
if(! f_val&&pewc_vars.zero_missing_field=='yes'){
f_val=0;
}
if(! isNaN(f_val) ){
if($('form.cart .pewc-field-' + fields[i]).length==0&&pewc_vars.zero_missing_field=='yes'){
f_val=0;
}
replace=new RegExp('{field_' + fields[i] + '}', 'g');
calc_formula=calc_formula.replace(replace, f_val);
}}
}}
if(formula===undefined){
console.log('formula not defined: ' + calc_field_id);
return false;
}
var product_price=parseFloat($('#pewc-product-price').val());
if(typeof pewc_wcfad!=='undefined'&&pewc_wcfad.reset_product_price(formula, calc_field_id) ){
product_price=parseFloat($('#pewc-product-price-original').val());
}
var quantity=parseFloat($('form.cart .quantity').find('.qty').val());
if(formula.includes("{look_up_table}") ){
calc_formula=calculations.evaluate_look_up_table(calc_field_id);
}
if(formula.includes("{product_weight}") ){
var product_weight=parseFloat($('#pewc_product_weight').val());
calc_formula=calc_formula.replace(/{product_weight}/g, parseFloat(product_weight) );
}
if(formula.includes("{product_height}") ){
var product_height=parseFloat($('#pewc_product_height').val());
calc_formula=calc_formula.replace(/{product_height}/g, parseFloat(product_height) );
}
if(formula.includes("{product_length}") ){
var product_length=parseFloat($('#pewc_product_length').val());
calc_formula=calc_formula.replace(/{product_length}/g, parseFloat(product_length) );
}
if(formula.includes("{product_width}") ){
var product_width=parseFloat($('#pewc_product_width').val());
calc_formula=calc_formula.replace(/{product_width}/g, parseFloat(product_width) );
}
if(formula.includes("{product_price}")&&product_price){
calc_formula=calc_formula.replace(/{product_price}/g, parseFloat(product_price) );
}
if(formula.includes("{quantity}")&&quantity){
calc_formula=calc_formula.replace(/{quantity}/g, parseFloat(quantity) );
}
if(formula.includes("{variable_1}")&&pewc_vars.variable_1){
calc_formula=calc_formula.replace(/{variable_1}/g, parseFloat(pewc_vars.variable_1) );
}
if(formula.includes("{variable_2}")&&pewc_vars.variable_2){
calc_formula=calc_formula.replace(/{variable_2}/g, parseFloat(pewc_vars.variable_2) );
}
if(formula.includes("{variable_3}")&&pewc_vars.variable_3){
calc_formula=calc_formula.replace(/{variable_3}/g, parseFloat(pewc_vars.variable_3) );
}
if(formula.includes("{calculated_booking_cost}") ){
var calculated_booking_cost=parseFloat($('#calculated_booking_cost').val());
calc_formula=calc_formula.replace(/{calculated_booking_cost}/g, parseFloat(calculated_booking_cost) );
}
if(formula.includes("{num_units_int}") ){
var num_units_int=parseFloat($('#num_units_int').val());
calc_formula=calc_formula.replace(/{num_units_int}/g, parseFloat(num_units_int) );
}
if(formula.includes("{num_bookings}") ){
var num_units_int=parseFloat($('#num_bookings').val());
calc_formula=calc_formula.replace(/{num_bookings}/g, parseFloat(num_units_int) );
}
if(formula.includes("{total_variations}") ){
var total_variations=parseFloat($('#wcbvp_total_variations').val());
calc_formula=calc_formula.replace(/{total_variations}/g, parseFloat(total_variations) );
}
if(formula.includes("{pa_") ){
var attribute=formula.replace("{", "");
var attribute=attribute.replace("}", "");
var attribute_data=pewc_vars.attribute_data;
calc_formula=parseFloat(attribute_data[attribute]);
}
if(pewc_vars.global_calc_vars){
var global_calc_vars=pewc_vars.global_calc_vars;
for(var key in global_calc_vars){
if(formula.includes("{" + key + "}") ){
var global_var="{" + key + "}";
var global_var_regex=new RegExp(global_var, 'g');
calc_formula=calc_formula.replace(global_var_regex, global_calc_vars[key]);
}}
}
if(typeof pewc_acf_fields!='undefined'){
for(var key in pewc_acf_fields){
if(formula.includes("{acf_" + key + "}") ){
var acf_field="{acf_" + key + "}";
var acf_field_regex=new RegExp(acf_field, 'g');
calc_formula=calc_formula.replace(acf_field_regex, pewc_acf_fields[key]);
}}
}
var result;
if(calc_formula=='*') return calc_formula;
if(pewc_vars.allow_text_calcs){
return calc_formula;
}
allow_text_calcs_fields=pewc_vars.allow_text_calcs_fields;
if(allow_text_calcs_fields.includes(parseInt(calc_field_id) )){
return calc_formula;
}
try {
result=math.eval(calc_formula);
if(round=='ceil'){
result=math.ceil(result);
}else if(round=='floor'){
result=math.floor(result);
}
if(pewc_vars.math_round=='yes'){
result=Math.round(result * 100) / 100;
}
return result.toFixed(parseFloat(decimals) );
} catch(err){
return 'error';
}},
get_formula_by_id: function(reverse_field_id){
var formula=$('.pewc-field-' + reverse_field_id).find('.pewc-data-formula').val();
return formula;
},
evaluate_field_prices: function(){
$('body').find('form.cart .pewc-field-price-has-formula').not('.pewc-hidden-field').each(function(){
if($(this).hasClass('pewc-variation-dependent')&&! $(this).hasClass('active') ){
return;
}
var group=$(this).closest('.pewc-group-wrap');
if($(group).hasClass('pewc-group-hidden') ){
return;
}
var group_id=$(group).attr('data-group-id');
var pewc_item=$(this);
var field_id=$(pewc_item).attr('data-id');
var data_field_id=$(pewc_item).attr('data-field-id');
var formula=$(pewc_item).attr('data-field-price-formula');
if(formula==undefined){
return;
}
var fields=$(pewc_item).attr('data-field-price-formula-fields');
var tags=$(pewc_item).attr('data-field-price-formula-tags');
var round=$(pewc_item).attr('data-field-price-formula-round');
var decimals=$(pewc_item).attr('data-field-price-formula-decimals');
if(fields){
fields=JSON.parse(fields);
}
var result=calculations.evaluate_formula(fields, formula, round, decimals, data_field_id);
if(isNaN(result) ){
result=0;
}
$(pewc_item).attr('data-price', result);
if('checkbox'===$(pewc_item).attr('data-field-type') ){
$(pewc_item).find('.pewc-checkbox-price').html(pewc_wc_price(result, true) );
}else{
$(pewc_item).find('.pewc-field-price').html(pewc_wc_price(result, true) );
}
$(pewc_item).find('input[name="' + field_id + '_field_price_calculated"]').val(result);
});
},
evaluate_option_prices: function(){
$('body').find('form.cart .pewc-field-option-price-has-formula').not('.pewc-hidden-field').each(function(){
if($(this).hasClass('pewc-variation-dependent')&&! $(this).hasClass('active') ){
return;
}
var group=$(this).closest('.pewc-group-wrap');
if($(group).hasClass('pewc-group-hidden') ){
return;
}
var group_id=$(group).attr('data-group-id');
var pewc_item=$(this);
var field_id=$(pewc_item).attr('data-id');
var data_field_id=$(pewc_item).attr('data-field-id');
var round=$(pewc_item).attr('data-field-price-formula-round');
var decimals=$(pewc_item).attr('data-field-price-formula-decimals');
$(this).find('.pewc-option-price-has-formula').each(function(){
var opt=$(this);
var formula=$(opt).attr('data-option-cost-formula');
if(formula==undefined){
return;
}
var fields=$(opt).attr('data-option-price-formula-fields');
var tags=$(opt).attr('data-option-price-formula-tags');
var index=$(opt).attr('data-option-index');
if(fields){
fields=JSON.parse(fields);
}
var result=calculations.evaluate_formula(fields, formula, round, decimals, data_field_id);
if(isNaN(result) ){
result=0;
}
if($(opt).attr('data-option-cost')==result&&'select'===$(pewc_item).attr('data-field-type') ){
return;
}
$(opt).attr('data-option-cost', result);
$(opt).closest('label').find('.pewc-option-cost-label').html(pewc_wc_price(result) );
if('select'===$(pewc_item).attr('data-field-type') ){
var new_text=$(opt).val() + pewc_vars.separator + pewc_wc_price(result, true);
$(this).text(new_text);
}else if('select-box'===$(pewc_item).attr('data-field-type') ){
var selectbox=$('#' + field_id + '_select_box');
if(selectbox.length > 0){
var optprice=0;
selectbox.find('.dd-option').each(function(index, element){
optprice=parseFloat($('input[name="' + field_id + '_option_' + index + '_price_calculated"]').val());
if(! isNaN(optprice) ){
$(element).find('.dd-option-description').html(pewc_wc_price(optprice, true) );
}});
var selected_value=$(pewc_item).find('.dd-selected-value').val();
var select_option_index=0;
select_option_index=$('select#' + field_id + ' option[value="' + selected_value.replace(/"/g, '\\"') + '"]').index();
optprice=parseFloat($('input[name="' + field_id + '_option_' + select_option_index + '_price_calculated"]').val());
if(! isNaN(optprice) ){
$(pewc_item).find('.dd-selected-description').html(pewc_wc_price(optprice, true) );
$(pewc_item).attr('data-selected-option-price', optprice);
}}
}
$(pewc_item).find('input[name="' + field_id  + '_option_' + index + '_price_calculated"]').val(result);
});
});
}}
calculations.init();
var hidden_groups={
init: function(){
$('body').on('pewc_conditions_checked', this.check_group_visibility);
},
check_group_visibility: function(){
$('body').find('.pewc-group-wrap').each(function(){
var all_hidden=true;
var group=$(this);
$(group).find('.pewc-item').each(function(){
if(! $(this).hasClass('pewc-hidden-field') ){
all_hidden=false;
}});
if(all_hidden){
$(group).addClass('pewc-hidden-group');
}else{
$(group).removeClass('pewc-hidden-group');
}});
}}
hidden_groups.init();
var summary_panel={
init: function(){
$('.pewc-form-field').on('change update keyup', this.update_panel);
},
update_panel: function(e){
var field_id=$(this).closest('.pewc-item').attr('data-field-id');
var field_value=$(this).val();
},
}
summary_panel.init();
var add_on_images={
init: function(){
var $product=$('form.cart').closest('.product'),
$product_gallery=$product.find(pewc_vars.product_gallery),
$gallery_nav=$product.find('.flex-control-nav'),
$gallery_img=$gallery_nav.find('li:eq(0) img'),
$product_img_wrap=$product_gallery.find(pewc_vars.product_img_wrap).eq(0),
$product_img=$product_img_wrap.find('img').eq(0),
$product_link=$product_img_wrap.find('a').eq(0);
if(add_on_images.replace_image()){
$product_img.attr('data-pewc-from-field', '');
$(document).ready(function(){
add_on_images.replace_main_with_default();
});
$('body').on('pewc_group_visibility_updated', function(e, id, action){
add_on_images.check_if_src_hidden($product_img);
});
$('body').on('pewc_field_visibility_updated', function(e, id, action){
var pewc_item=$('.pewc-item.' + id);
if(pewc_item.attr('data-field-value')!=''){
if(pewc_item.data('field-type')==='image_swatch'){
var field=pewc_item.find('input[name="' + id + '[]"]:checked')[0];
}else{
var field=pewc_item.find('input[name="' + id + '[]"]')[0];
}
var $form=pewc_item.closest('form');
add_on_images.update_add_on_image($(field), $form);
}});
}
$('.pewc-swatch-parent .pewc-radio-form-field').on('change', this.change_child);
$('.pewc-swatch-child .pewc-radio-form-field').on('change', this.sync_children);
},
replace_image: function(field){
if(pewc_vars.replace_image){
return pewc_vars.replace_image;
}else if(field){
if(field.hasClass('pewc-replace-main-image') ){
return true;
}}else{
if($(document).find('.pewc-replace-main-image').length > 0){
return true;
}}
return false;
},
save_original_src: function($product_img){
if($product_img.attr('data-pewc-old-src') ){
return;
}
$product_img.attr('data-pewc-old-src', $product_img.attr('src') );
if($product_img.attr('data-src') ){
$product_img.attr('data-pewc-old-data-src', $product_img.attr('data-src') );
}else{
$product_img.attr('data-pewc-old-data-src', '');
}
if($product_img.attr('srcset') ){
$product_img.attr('data-pewc-old-srcset', $product_img.attr('srcset') );
}else{
$product_img.attr('data-pewc-old-srcset', '');
}
if($product_img.attr('data-large_image') ){
$product_img.attr('data-pewc-old-data-large_image', $product_img.attr('data-large_image') );
}else{
$product_img.attr('data-pewc-old-data-large_image', '');
}
if($product_img.attr('data-large_image_width') ){
$product_img.attr('data-pewc-old-data-large_image_width', $product_img.attr('data-large_image_width') );
}else{
$product_img.attr('data-pewc-old-data-large_image_width', '');
}
if($product_img.attr('data-large_image_height') ){
$product_img.attr('data-pewc-old-data-large_image_height', $product_img.attr('data-large_image_height') );
}else{
$product_img.attr('data-pewc-old-data-large_image_height', '');
}
var zoomImg=$product_img.closest(pewc_vars.product_img_wrap).find(pewc_vars.product_img_zoom).eq(0);
if(zoomImg){
$product_img.attr('data-pewc-old-zoom', zoomImg.attr('src') );
}},
update_add_on_image: function(field, $form){
var field_wrapper=$(field).closest('.pewc-item');
var is_layered=$(field_wrapper).attr('data-field-layered');
if(! add_on_images.replace_image(field_wrapper)&&is_layered!='yes'){
return;
}
var field_type=$(field_wrapper).attr('data-field-type');
var $product=$form.closest('.product'),
$product_gallery=$product.find(pewc_vars.product_gallery),
$layer_parent=pewc_vars.layer_parent,
$gallery_nav=$product.find('.flex-control-nav'),
$gallery_img=$gallery_nav.find('li:eq(0) img'),
$product_img_wrap=$product_gallery.find(pewc_vars.product_img_wrap).eq(0),
$product_img=$product_img_wrap.find('img').eq(0),
$product_link=$product_img_wrap.find('a').eq(0);
if(! $(field_wrapper).hasClass('pewc-has-field-image')&&field_type!='image_swatch'&&field_type!='select-box'){
add_on_images.check_if_src_hidden($product_img);
return;
}
if($(field_wrapper).closest('.pewc-group-wrap').hasClass('pewc-group-hidden') ){
add_on_images.check_if_src_hidden($product_img);
return;
}
if(( $(field_wrapper).hasClass('pewc-variation-dependent')&&! $(field_wrapper).hasClass('active') )||$(field_wrapper).hasClass('pewc-hidden-field') ){
add_on_images.check_if_src_hidden($product_img);
return;
}
var add_on_image_wrapper;
var add_on_image_src;
var add_on_image_large_image, add_on_image_large_image_width, add_on_image_large_image_height;
var turn='off';
var add_on_image_field='', add_on_image_option='';
if(field_type=='checkbox'&&$(field).prop('checked')&&add_on_images.replace_image(field_wrapper)!='replace_image_swatch_only'){
turn='on';
add_on_image_wrapper=$(field_wrapper).find('.pewc-item-field-image-wrapper');
add_on_image_src=$(add_on_image_wrapper).attr('data-image-full-size');
add_on_image_srcset=add_on_image_src;
add_on_image_large_image=$(add_on_image_wrapper).attr('data-image-full-size');
add_on_image_large_image_width=$(add_on_image_wrapper).attr('data-large_image_width');
add_on_image_large_image_height=$(add_on_image_wrapper).attr('data-large_image_height');
add_on_image_field='pewc-add-on-image-' + $(field_wrapper).attr('data-field-id');
}
if(field_type=='image_swatch'){
add_on_image_wrapper=field.closest('.pewc-radio-image-wrapper');
if(add_on_image_wrapper.hasClass('checked') ){
add_on_image_src=add_on_image_wrapper.find('img').attr('data-src');
add_on_image_srcset=add_on_image_src;
add_on_image_large_image=add_on_image_wrapper.find('img').attr('data-large_image');
add_on_image_large_image_width=add_on_image_wrapper.find('img').attr('data-large_image_width');
add_on_image_large_image_height=add_on_image_wrapper.find('img').attr('data-large_image_height');
if(add_on_image_src!=undefined){
turn='on';
if($(field_wrapper).hasClass('pewc-item-radio') ){
$product_img.closest('.' + pewc_vars.layer_parent).removeClass(function(index, className){
return (className.match(/(^|\s)pewc\-add\-on\-image\-\S+/g)||[]).join(' ');
});
}
add_on_image_field='pewc-add-on-image-' + $(field_wrapper).attr('data-field-id');
add_on_image_option=add_on_image_field + '-' + $(field).attr('id').replace($(field_wrapper).attr('data-id') + '_', '');
}}
}else if(field_type=='select-box'&&add_on_images.replace_image(field_wrapper)!='replace_image_swatch_only'){
if(field_wrapper.find('input.dd-selected-value').val()!=''){
var src_image=field_wrapper.find('input.dd-selected-image-full');
if(src_image.length > 0){
add_on_image_src=src_image.val();
}else{
src_image=field_wrapper.find('img.dd-selected-image');
add_on_image_src=src_image.attr('src');
}
add_on_image_srcset=add_on_image_src;
add_on_image_large_image=add_on_image_src;
add_on_image_large_image_width=src_image.attr('data-imgsrc-width');
add_on_image_large_image_height=src_image.attr('data-imgsrc-height');
if(add_on_image_src!=undefined){
turn='on';
$product_img.closest('.' + pewc_vars.layer_parent).removeClass(function(index, className){
return (className.match(/(^|\s)pewc\-add\-on\-image\-\S+/g)||[]).join(' ');
});
add_on_image_field='pewc-add-on-image-' + $(field_wrapper).attr('data-field-id');
add_on_image_option=add_on_image_field + '-index-' + $(field_wrapper).find('select').prop('selectedIndex');
}}
}
if(is_layered=='yes'){
var field_id=$(field_wrapper).attr('data-field-id');
var layer_id='pewc-layer-' + field_id;
var layer_index=$(field_wrapper).attr('data-field-index');
var swatch_src=$(add_on_image_wrapper).find('img').attr('data-large_image');
if($(add_on_image_wrapper).find('img').attr('data-alt_image').length > 0){
swatch_src=$(add_on_image_wrapper).find('img').attr('data-alt_image');
}
if($('.' + layer_id).length===0&&$(add_on_image_wrapper).hasClass('checked') ){
var layer_image='<img class="pewc-layer-image" src="' + swatch_src + '">';
$($('.' + $layer_parent) ).append('<div class="pewc-image-layer ' + layer_id + '" style="z-index:' +(layer_index + 1) * 10 + '">' + layer_image + '</div>');
}else if($('.' + layer_id).length!==0&&$(add_on_image_wrapper).hasClass('checked') ){
$('.' + layer_id).find('img').attr('src', swatch_src);
}else if(! $(add_on_image_wrapper).hasClass('checked') ){
$('.' + layer_id).remove();
}
if(add_on_image_field!=''&&! $('.' + pewc_vars.layer_parent).hasClass(add_on_image_field) ){
$product_img.closest('.' + pewc_vars.layer_parent).addClass(add_on_image_field);
}
if(add_on_image_option!=''&&! $('.' + pewc_vars.layer_parent).hasClass(add_on_image_option) ){
$product_img.closest('.' + pewc_vars.layer_parent).addClass(add_on_image_option);
}}else if(add_on_image_src&&turn=='on'){
add_on_images.save_original_src($product_img);
$product_img.attr('data-pewc-from-field', $(field_wrapper).attr('data-id') );
$product_img.attr('src', add_on_image_src);
$product_img.attr('srcset', add_on_image_srcset);
$product_img.attr('data-src', add_on_image_src);
$product_img.attr('data-large_image', add_on_image_large_image);
$product_img.attr('data-large_image_width', add_on_image_large_image_width);
$product_img.attr('data-large_image_height', add_on_image_large_image_height);
var zoomImg=$product_img.closest(pewc_vars.product_img_wrap).find(pewc_vars.product_img_zoom).eq(0);
if(zoomImg){
zoomImg.attr('src', add_on_image_src);
}
if(add_on_image_field!=''&&! $('.' + pewc_vars.layer_parent).hasClass(add_on_image_field) ){
$product_img.closest('.' + pewc_vars.layer_parent).addClass(add_on_image_field);
}
if(add_on_image_option!=''&&! $('.' + pewc_vars.layer_parent).hasClass(add_on_image_option) ){
$product_img.closest('.' + pewc_vars.layer_parent).addClass(add_on_image_option);
}}else{
$product_img.closest('.' + pewc_vars.layer_parent).removeClass(function(index, className){
return (className.match (/(^|\s)pewc\-add\-on\-image\-\S+/g)||[]).join(' ');
});
add_on_images.replace_main_with_default($product_img, false);
}
if(pewc_vars.replace_image_focus=='yes'){
var control_list_selector='.' + pewc_vars.control_container + ' ' + pewc_vars.control_list;
$(control_list_selector).first().find(pewc_vars.control_element).trigger('click');
$('body').trigger('pewc_update_add_on_image_focus_on_main_image');
}},
change_child: function(e){
var parent_swatch=e.target;
var parent_index=$(parent_swatch).closest('.pewc-item').find('.pewc-radio-image-wrapper.checked input').attr('data-option-index');
if(! isNaN(parent_index) ){
$('.pewc-swatch-child').addClass('pewc-visibility-hidden');
$('.pewc-swatch-child-' + parent_index).removeClass('pewc-visibility-hidden');
var active_layer_id=$('.pewc-swatch-child-' + parent_index).attr('data-field-id');
var selected_input=$('.pewc-swatch-child').not('.pewc-visibility-hidden').closest('.pewc-item').find('.pewc-radio-image-wrapper.checked input');
var index=$(selected_input).attr('data-option-index');
$('.pewc-swatch-child-' + parent_index).find('.pewc-radio-image-wrapper.pewc-radio-form-field').prop('checked', false);
$('.pewc-layer-' + active_layer_id).show();
var child_swatch_ids=JSON.parse(pewc_vars.child_swatch_ids);
for(var i in child_swatch_ids){
if(child_swatch_ids[i]!=active_layer_id){
$('.pewc-layer-' + child_swatch_ids[i]).fadeOut(150);
}}
$('.pewc-swatch-child-' + parent_index).find('.pewc-radio-image-wrapper-' + index + ' input').addClass('here-' + parent_index + '-' + index).trigger('click');
$('.pewc-swatch-child-' + parent_index).find('.pewc-radio-image-wrapper-' + index + ' input').trigger('change');
}},
sync_children: function(e){
var parent_index=$('.pewc-swatch-parent').find('.pewc-radio-image-wrapper.checked input').attr('data-option-index');
var child_swatch=e.target;
var index=$(child_swatch).closest('.pewc-item').find('.pewc-radio-image-wrapper.checked input').attr('data-option-index');
if(! isNaN(index) ){
$('.pewc-swatch-child').find('.pewc-radio-image-wrapper').removeClass('checked');
$('.pewc-swatch-child').find('.pewc-radio-image-wrapper-' + index).addClass('checked').find('input');
var input=$('.pewc-swatch-child-' + parent_index).find('.pewc-radio-image-wrapper-' + index + ' input');
$('.pewc-swatch-child-' + parent_index).find('.pewc-radio-image-wrapper-' + index + ' input').trigger('click');
}},
check_if_src_hidden: function($product_img){
if($product_img.attr('data-pewc-from-field')!=''){
var pewc_from_field=$(".pewc-item."+$product_img.attr('data-pewc-from-field'));
if(pewc_from_field.hasClass('pewc-hidden-field')||pewc_from_field.closest('.pewc-group-wrap').hasClass('pewc-group-hidden')||(pewc_from_field.hasClass('pewc-variation-dependent')&&! pewc_from_field.hasClass('active') )){
add_on_images.replace_main_with_default($product_img);
}}
},
reset_main_image: function($product_img){
$product_img.attr('data-pewc-from-field', '');
$product_img.attr('src', $product_img.attr('data-pewc-old-src') );
$product_img.attr('srcset', $product_img.attr('data-pewc-old-srcset') );
$product_img.attr('data-src', $product_img.attr('data-pewc-old-data-src') );
$product_img.attr('data-large_image', $product_img.attr('data-pewc-old-data-large_image') );
$product_img.attr('data-large_image_width', $product_img.attr('data-pewc-old-data-large_image_width') );
$product_img.attr('data-large_image_height', $product_img.attr('data-pewc-old-data-large_image_height') );
var zoomImg=$product_img.closest(pewc_vars.product_img_wrap).find(pewc_vars.product_img_zoom).eq(0);
if(zoomImg){
zoomImg.attr('src', $product_img.attr('data-pewc-old-zoom') );
}},
replace_main_with_default: function($product_img='', is_layered=true){
var replace_fields=[ 'image_swatch', 'select-box', 'checkbox' ];
var replaced=false;
$('.pewc-item').each(function(index, element){
var layered_image=$(this).hasClass('pewc-layered-image');
if(! add_on_images.replace_image($(this))&&! layered_image){
return;
}
if(layered_image&&! is_layered){
return;
}
if(replaced&&! layered_image){
return;
}
if($(this).closest('.pewc-group-wrap').hasClass('pewc-group-hidden') ){
return;
}
if(( $(this).hasClass('pewc-variation-dependent')&&! $(this).hasClass('active') )||$(this).hasClass('pewc-hidden-field') ){
return;
}
if(replace_fields.indexOf($(this).attr('data-field-type') ) > -1&&$(this).attr('data-field-value')!=''){
var field_type=$(this).attr('data-field-type');
if(field_type=='image_swatch'){
$(this).find('.pewc-radio-form-field').each(function(index, element){
if($(this).is(':checked')&&(! replaced||layered_image) ){
if($(this).closest('.pewc-radio-image-wrapper').find('img').attr('data-src') ){
add_on_images.update_add_on_image($(this), $(this).closest('form') );
replaced=true;
return;
}}
});
}else if(field_type=='checkbox'){
if($(this).find('.pewc-form-field').is(':checked')&&$(this).find('.pewc-item-field-image-wrapper').length > 0){
add_on_images.update_add_on_image($(this).find('.pewc-form-field'), $(this).closest('form') );
replaced=true;
return;
}}else if(field_type=='select-box'){
add_on_images.update_add_on_image($(this).find('select.pewc-form-field'), $(this).closest('form') );
replaced=true;
return;
}}
});
if(! replaced&&$product_img!=''){
add_on_images.reset_main_image($product_img);
}},
}
add_on_images.init();
var tooltips={
init: function(){
if(pewc_vars.enable_tooltips=='yes'&&! pewc_vars.dequeue_tooltips){
$('.tooltip').tooltipster({
theme: 'tooltipster-shadow',
side: 'right',
contentAsHTML: pewc_vars.contentAsHTML,
autoClose:pewc_vars.autoClose,
interactive:pewc_vars.interactive,
hideOnClick:pewc_vars.hideOnClick,
trigger:pewc_vars.trigger,
triggerOpen:pewc_vars.triggerOpen,
triggerClose: pewc_vars.triggerClose
}
);
}}
}
tooltips.init();
var quickview={
init: function(){
$('body').on('click', '.pewc-show-quickview', this.show_quickview);
$('body').on('click', '#pewc-quickview-background, .pewc-close-quickview', this.hide_quickview);
},
show_quickview: function(e){
e.stopPropagation();
if(pewc_vars.quickview=='yes'){
e.preventDefault();
$('body').addClass('pewc-quickview-active');
}
$('#pewc-quickview-' + $(this).closest('li.pewc-item').attr('data-id') + '_' + $(this).attr('data-child-product-id') ).css('left', '50%');
},
hide_quickview: function(e){
e.preventDefault();
$('body').removeClass('pewc-quickview-active');
$('.pewc-quickview-product-wrapper').css('left', '-5000px');
}}
quickview.init();
var check_time={
interval_id: null,
init: function(){
var today=new Date();
var loaded=$('.pewc-cl-wrapper').first().attr('data-today');
today.setHours(0,0,0,0);
if(today > loaded){
$('.pewc-cl-wrapper').addClass('disabled');
$('.pewc-cl-wrapper').find('.pewc-radio-form-field').prop('disabled', true);
}
check_time.interval_id=setInterval(
function(){
check_time.check();
},
5000
);
$('.pewc-cl-wrapper').find('input').on('change', this.update_date);
$('form.cart .pewc-item-calendar-list').each(function(){
var $field=$(this);
if($field.find('input[type=radio]:checked').length===0){
var default_val=$field.attr('data-default-value');
var $enabled=$field.find('.pewc-cl-wrapper:not(.disabled) input[type=radio]:enabled');
var $target=(default_val!==''&&default_val!==undefined)
? $enabled.filter('[data-offset="' + default_val + '"]')
: $();
if(! $target.length){
$target=$enabled.first();
}
if($target.length){
$target.prop('checked', true).trigger('change');
}}
});
},
check: function(){
$('.pewc-cl-has-time').each(function(){
var hour=$(this).attr('data-hour');
var min=$(this).attr('data-minute');
if(! hour||! min){
return;
}
if(check_time.is_after(hour, min) ){
clearInterval(check_time.interval_id);
var now=new Date();
var client_minutes=now.getHours() * 60 + now.getMinutes();
var url=new URL(window.location.href);
url.searchParams.set('pewc_client_minutes', client_minutes);
window.location.replace(url.toString());
return false;
}});
},
is_after: function(hour, min){
let ms_today=Date.now() - new Date().setHours(0,0,0,0);
return ms_today > (hour*3.6e6 + min*6e4);
},
update_date: function(){
var field_id=$(this).closest('.pewc-item').attr('data-field-id');
var id=$(this).closest('.pewc-item').attr('data-id');
$('#pewc_cl_' + field_id).val($(this).attr('data-date') );
$('#pewc_cl_price_' + field_id).val($(this).closest('.pewc-item').attr('data-field-price') );
$('#pewc_cl_offset_' + id).val($(this).attr('data-offset') );
}}
check_time.init();
})(jQuery);
function pewc_wc_price_without_currency(price){
var price_settings={
decimal: pewc_vars.decimal_separator,
thousand: pewc_vars.thousand_separator,
precision: pewc_vars.decimals,
format: '%v'
};
if(pewc_vars.price_trim_zeros=='yes'&&price==parseInt(price) ){
price_settings.precision=0;
}
price=accounting.formatMoney(price, price_settings);
return price;
}
function pewc_wc_price(price, price_only=false, update_pewc_total_calc_price=true){
if(update_pewc_total_calc_price){
jQuery('#pewc_total_calc_price').val(price);
}
var currency_html='<span class="woocommerce-Price-currencySymbol">%s</span>';
var currency_format='';
if(price_only){
currency_html='%s';
}
if(pewc_vars.currency_pos=='left'){
currency_format=currency_html+'%v';
}else if(pewc_vars.currency_pos=='right'){
currency_format='%v'+currency_html;
}else if(pewc_vars.currency_pos=='left_space'){
currency_format=currency_html+' %v';
}else if(pewc_vars.currency_pos=='right_space'){
currency_format='%v '+currency_html;
}
var price_settings={
symbol: pewc_vars.currency_symbol,
decimal: pewc_vars.decimal_separator,
thousand: pewc_vars.thousand_separator,
precision: pewc_vars.decimals,
format: currency_format
};
if(pewc_vars.price_trim_zeros=='yes'&&price==parseInt(price) ){
price_settings.precision=0;
}
price=accounting.formatMoney(price, price_settings);
if(! price_only){
return '<span class="woocommerce-Price-amount amount"><bdi>' + price + '</bdi></span>';
}
return price;
}
function pewc_wcfad_apply_discount(){
return typeof pewc_wcfad!=='undefined'&&pewc_wcfad.apply_discount();
}
function pewc_is_booking_product(){
return(jQuery('#num_units_int').length > 0);
}
function pewc_get_quantity(qty=1, type=''){
if(pewc_wcbvp_variation_grid()){
qty=jQuery('#wcbvp_total_variations').val();
if(qty < 1) qty=1;
}else if(jQuery('form.cart .quantity .qty').val()&&'one-only'!==type){
qty=jQuery('form.cart .quantity .qty').val();
}else if(pewc_is_booking_product()){
qty=1;
if(jQuery('#num_bookings').length > 0&&! isNaN(jQuery('#num_bookings').val())&&'linked'===type){
qty=qty * jQuery('#num_bookings').val();
}}
return qty;
}
function pewc_wcbvp_variation_grid(){
return(jQuery('body').find('.wcbvp-grid-quantity-field').length > 0);
}
function pewc_accordion_click(header){
var is_open=jQuery(header).closest('.pewc-group-wrap').hasClass('group-active');
if(jQuery(header).closest('.pewc-group-wrap').hasClass('pewc-disabled-group')){
return;
}
if(pewc_vars.close_accordion=='yes'){
jQuery('.pewc-group-wrap').removeClass('group-active');
}
if(! is_open||pewc_vars.close_accordion!='yes'){
jQuery(header).closest('.pewc-group-wrap').toggleClass('group-active');
}};
!function(){class e{constructor(){this.initSettings(),this.initElements(),this.bindEvents()}initSettings(){this.settings={selectors:{menuToggle:".site-header .site-navigation-toggle",menuToggleHolder:".site-header .site-navigation-toggle-holder",dropdownMenu:".site-header .site-navigation-dropdown"}}}initElements(){this.elements={window:window,menuToggle:document.querySelector(this.settings.selectors.menuToggle),menuToggleHolder:document.querySelector(this.settings.selectors.menuToggleHolder),dropdownMenu:document.querySelector(this.settings.selectors.dropdownMenu)}}bindEvents(){this.elements.menuToggleHolder&&!this.elements.menuToggleHolder?.classList.contains("hide")&&(this.elements.menuToggle.addEventListener("click",()=>this.handleMenuToggle()),this.elements.dropdownMenu.querySelectorAll(".menu-item-has-children > a").forEach(e=>e.addEventListener("click",e=>this.handleMenuChildren(e))))}closeMenuItems(){this.elements.menuToggleHolder.classList.remove("elementor-active"),this.elements.window.removeEventListener("resize",()=>this.closeMenuItems())}handleMenuToggle(){const e=!this.elements.menuToggleHolder.classList.contains("elementor-active");this.elements.menuToggle.setAttribute("aria-expanded",e),this.elements.dropdownMenu.setAttribute("aria-hidden",!e),this.elements.dropdownMenu.inert=!e,this.elements.menuToggleHolder.classList.toggle("elementor-active",e),this.elements.dropdownMenu.querySelectorAll(".elementor-active").forEach(e=>e.classList.remove("elementor-active")),e?this.elements.window.addEventListener("resize",()=>this.closeMenuItems()):this.elements.window.removeEventListener("resize",()=>this.closeMenuItems())}handleMenuChildren(e){const t=e.currentTarget.parentElement;t?.classList&&t.classList.toggle("elementor-active")}}document.addEventListener("DOMContentLoaded",()=>{new e})}();
!function(r){"use strict";var t,e,n;t=[function(r,t,e){e(1),e(53),e(81),e(82),e(93),e(94),e(99),e(100),e(110),e(120),e(122),e(123),e(124),r.exports=e(125)},function(r,t,e){var n=e(2),o=e(4),a=e(48),c=ArrayBuffer.prototype;n&&!("detached"in c)&&o(c,"detached",{configurable:!0,get:function(){return a(this)}})},function(r,t,e){var n=e(3);r.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){var n=e(5),o=e(23);r.exports=function(r,t,e){return e.get&&n(e.get,t,{getter:!0}),e.set&&n(e.set,t,{setter:!0}),o.f(r,t,e)}},function(t,e,n){var o=n(6),a=n(3),c=n(8),i=n(9),u=n(2),s=n(13).CONFIGURABLE,f=n(14),p=n(19),l=p.enforce,y=p.get,v=String,h=Object.defineProperty,g=o("".slice),b=o("".replace),m=o([].join),d=u&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),w=String(String).split("String"),E=t.exports=function(t,e,n){"Symbol("===g(v(e),0,7)&&(e="["+b(v(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||s&&t.name!==e)&&(u?h(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?u&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return i(o,"source")||(o.source=m(w,"string"==typeof e?e:"")),t};Function.prototype.toString=E((function(){return c(this)&&y(this).source||f(this)}),"toString")},function(r,t,e){var n=e(7),o=Function.prototype,a=o.call,c=n&&o.bind.bind(a,a);r.exports=n?c:function(r){return function(){return a.apply(r,arguments)}}},function(r,t,e){var n=e(3);r.exports=!n((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(6),o=e(10),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(11),o=Object;r.exports=function(r){return o(n(r))}},function(r,t,e){var n=e(12),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(2),o=e(9),a=Function.prototype,c=n&&Object.getOwnPropertyDescriptor,i=o(a,"name"),u=i&&"something"===function(){}.name,s=i&&(!n||n&&c(a,"name").configurable);r.exports={EXISTS:i,PROPER:u,CONFIGURABLE:s}},function(r,t,e){var n=e(6),o=e(8),a=e(15),c=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return c(r)}),r.exports=a.inspectSource},function(r,t,e){var n=e(16),o=e(17),a=e(18),c="__core-js_shared__",i=r.exports=o[c]||a(c,{});(i.versions||(i.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=function(r){return r&&r.Math===Math&&r};r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(17),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n,o,a,c=e(20),i=e(17),u=e(21),s=e(22),f=e(9),p=e(15),l=e(46),y=e(47),v="Object already initialized",h=i.TypeError,g=i.WeakMap;if(c||p.state){var b=p.state||(p.state=new g);b.get=b.get,b.has=b.has,b.set=b.set,n=function(r,t){if(b.has(r))throw new h(v);return t.facade=r,b.set(r,t),t},o=function(r){return b.get(r)||{}},a=function(r){return b.has(r)}}else{var m=l("state");y[m]=!0,n=function(r,t){if(f(r,m))throw new h(v);return t.facade=r,s(r,m,t),t},o=function(r){return f(r,m)?r[m]:{}},a=function(r){return f(r,m)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new h("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(17),o=e(8),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(8);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(2),o=e(24),a=e(26),c=e(27),i=e(28),u=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(c(r),t=i(t),c(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=f(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return s(r,t,e)}:s:function(r,t,e){if(c(r),t=i(t),c(e),o)try{return s(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(2),o=e(3),a=e(25);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(17),o=e(21),a=n.document,c=o(a)&&o(a.createElement);r.exports=function(r){return c?a.createElement(r):{}}},function(r,t,e){var n=e(2),o=e(3);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(21),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(r,t,e){var n=e(29),o=e(31);r.exports=function(r){var t=n(r,"string");return o(t)?t:t+""}},function(t,e,n){var o=n(30),a=n(21),c=n(31),i=n(38),u=n(41),s=n(42),f=TypeError,p=s("toPrimitive");t.exports=function(t,e){if(!a(t)||c(t))return t;var n,s=i(t,p);if(s){if(e===r&&(e="default"),n=o(s,t,e),!a(n)||c(n))return n;throw new f("Can't convert object to primitive value")}return e===r&&(e="number"),u(t,e)}},function(r,t,e){var n=e(7),o=Function.prototype.call;r.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(r,t,e){var n=e(32),o=e(8),a=e(33),c=e(34),i=Object;r.exports=c?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,i(r))}},function(t,e,n){var o=n(17),a=n(8);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){var n=e(6);r.exports=n({}.isPrototypeOf)},function(r,t,e){var n=e(35);r.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(36),o=e(3),a=e(17).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(17),c=e(37),i=a.process,u=a.Deno,s=i&&i.versions||u&&u.version,f=s&&s.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&c&&(!(n=c.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=c.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){var n=e(17).navigator,o=n&&n.userAgent;r.exports=o?String(o):""},function(t,e,n){var o=n(39),a=n(12);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(8),o=e(40),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(30),o=e(8),a=e(21),c=TypeError;r.exports=function(r,t){var e,i;if("string"===t&&o(e=r.toString)&&!a(i=n(e,r)))return i;if(o(e=r.valueOf)&&!a(i=n(e,r)))return i;if("string"!==t&&o(e=r.toString)&&!a(i=n(e,r)))return i;throw new c("Can't convert object to primitive value")}},function(r,t,e){var n=e(17),o=e(43),a=e(9),c=e(44),i=e(35),u=e(34),s=n.Symbol,f=o("wks"),p=u?s.for||s:s&&s.withoutSetter||c;r.exports=function(r){return a(f,r)||(f[r]=i&&a(s,r)?s[r]:p("Symbol."+r)),f[r]}},function(r,t,e){var n=e(15);r.exports=function(r,t){return n[r]||(n[r]=t||{})}},function(t,e,n){var o=n(6),a=0,c=Math.random(),i=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+i(++a+c,36)}},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(43),o=e(44),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(17),o=e(49),a=e(51),c=n.ArrayBuffer,i=c&&c.prototype,u=i&&o(i.slice);r.exports=function(r){if(0!==a(r))return!1;if(!u)return!1;try{return u(r,0,0),!1}catch(r){return!0}}},function(r,t,e){var n=e(50),o=e(6);r.exports=function(r){if("Function"===n(r))return o(r)}},function(r,t,e){var n=e(6),o=n({}.toString),a=n("".slice);r.exports=function(r){return a(o(r),8,-1)}},function(r,t,e){var n=e(17),o=e(52),a=e(50),c=n.ArrayBuffer,i=n.TypeError;r.exports=c&&o(c.prototype,"byteLength","get")||function(r){if("ArrayBuffer"!==a(r))throw new i("ArrayBuffer expected");return r.byteLength}},function(r,t,e){var n=e(6),o=e(39);r.exports=function(r,t,e){try{return n(o(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(r){}}},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:r,!0)}})},function(t,e,n){var o=n(17),a=n(55).f,c=n(22),i=n(59),u=n(18),s=n(60),f=n(72);t.exports=function(t,e){var n,p,l,y,v,h=t.target,g=t.global,b=t.stat;if(n=g?o:b?o[h]||u(h,{}):o[h]&&o[h].prototype)for(p in e){if(y=e[p],l=t.dontCallGetSet?(v=a(n,p))&&v.value:n[p],!f(g?p:h+(b?".":"#")+p,t.forced)&&l!==r){if(typeof y==typeof l)continue;s(y,l)}(t.sham||l&&l.sham)&&c(y,"sham",!0),i(n,p,y,t)}}},function(r,t,e){var n=e(2),o=e(30),a=e(56),c=e(45),i=e(57),u=e(28),s=e(9),f=e(24),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=i(r),t=u(t),f)try{return p(r,t)}catch(r){}if(s(r,t))return c(!o(a.f,r,t),r[t])}},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){var t=o(this,r);return!!t&&t.enumerable}:n},function(r,t,e){var n=e(58),o=e(11);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(6),o=e(3),a=e(50),c=Object,i=n("".split);r.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?i(r,""):c(r)}:c},function(t,e,n){var o=n(8),a=n(23),c=n(5),i=n(18);t.exports=function(t,e,n,u){u||(u={});var s=u.enumerable,f=u.name!==r?u.name:e;if(o(n)&&c(n,f,u),u.global)s?t[e]=n:i(e,n);else{try{u.unsafe?t[e]&&(s=!0):delete t[e]}catch(r){}s?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(r,t,e){var n=e(9),o=e(61),a=e(55),c=e(23);r.exports=function(r,t,e){for(var i=o(t),u=c.f,s=a.f,f=0;f<i.length;f++){var p=i[f];n(r,p)||e&&n(e,p)||u(r,p,s(t,p))}}},function(r,t,e){var n=e(32),o=e(6),a=e(62),c=e(71),i=e(27),u=o([].concat);r.exports=n("Reflect","ownKeys")||function(r){var t=a.f(i(r)),e=c.f;return e?u(t,e(r)):t}},function(r,t,e){var n=e(63),o=e(70).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(r){return n(r,o)}},function(r,t,e){var n=e(6),o=e(9),a=e(57),c=e(64).indexOf,i=e(47),u=n([].push);r.exports=function(r,t){var e,n=a(r),s=0,f=[];for(e in n)!o(i,e)&&o(n,e)&&u(f,e);for(;t.length>s;)o(n,e=t[s++])&&(~c(f,e)||u(f,e));return f}},function(r,t,e){var n=e(57),o=e(65),a=e(68),c=function(r){return function(t,e,c){var i=n(t),u=a(i);if(0===u)return!r&&-1;var s,f=o(c,u);if(r&&e!=e){for(;u>f;)if((s=i[f++])!=s)return!0}else for(;u>f;f++)if((r||f in i)&&i[f]===e)return r||f||0;return!r&&-1}};r.exports={includes:c(!0),indexOf:c(!1)}},function(r,t,e){var n=e(66),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(67);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(69);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(66),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(3),o=e(8),a=/#|\.prototype\./,c=function(r,t){var e=u[i(r)];return e===f||e!==s&&(o(t)?n(t):!!t)},i=c.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=c.data={},s=c.NATIVE="N",f=c.POLYFILL="P";r.exports=c},function(t,e,n){var o=n(17),a=n(6),c=n(52),i=n(74),u=n(75),s=n(51),f=n(76),p=n(80),l=o.structuredClone,y=o.ArrayBuffer,v=o.DataView,h=Math.min,g=y.prototype,b=v.prototype,m=a(g.slice),d=c(g,"resizable","get"),w=c(g,"maxByteLength","get"),E=a(b.getInt8),x=a(b.setInt8);t.exports=(p||f)&&function(t,e,n){var o,a=s(t),c=e===r?a:i(e),g=!d||!d(t);if(u(t),p&&(t=l(t,{transfer:[t]}),a===c&&(n||g)))return t;if(a>=c&&(!n||g))o=m(t,0,c);else{var b=n&&!g&&w?{maxByteLength:w(t)}:r;o=new y(c,b);for(var O=new v(t),R=new v(o),S=h(c,a),A=0;A<S;A++)x(R,A,E(O,A))}return p||f(t),o}},function(t,e,n){var o=n(66),a=n(69),c=RangeError;t.exports=function(t){if(t===r)return 0;var e=o(t),n=a(e);if(e!==n)throw new c("Wrong length or index");return n}},function(r,t,e){var n=e(48),o=TypeError;r.exports=function(r){if(n(r))throw new o("ArrayBuffer is detached");return r}},function(r,t,e){var n,o,a,c,i=e(17),u=e(77),s=e(80),f=i.structuredClone,p=i.ArrayBuffer,l=i.MessageChannel,y=!1;if(s)y=function(r){f(r,{transfer:[r]})};else if(p)try{l||(n=u("worker_threads"))&&(l=n.MessageChannel),l&&(o=new l,a=new p(2),c=function(r){o.port1.postMessage(null,[r])},2===a.byteLength&&(c(a),0===a.byteLength&&(y=c)))}catch(r){}r.exports=y},function(r,t,e){var n=e(17),o=e(78);r.exports=function(r){if(o){try{return n.process.getBuiltinModule(r)}catch(r){}try{return Function('return require("'+r+'")')()}catch(r){}}}},function(r,t,e){var n=e(79);r.exports="NODE"===n},function(r,t,e){var n=e(17),o=e(37),a=e(50),c=function(r){return o.slice(0,r.length)===r};r.exports=c("Bun/")?"BUN":c("Cloudflare-Workers")?"CLOUDFLARE":c("Deno/")?"DENO":c("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},function(r,t,e){var n=e(17),o=e(3),a=e(36),c=e(79),i=n.structuredClone;r.exports=!!i&&!o((function(){if("DENO"===c&&a>92||"NODE"===c&&a>94||"BROWSER"===c&&a>97)return!1;var r=new ArrayBuffer(8),t=i(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:r,!1)}})},function(r,t,e){var n=e(54),o=e(6),a=e(39),c=e(11),i=e(83),u=e(92),s=e(16),f=e(3),p=u.Map,l=u.has,y=u.get,v=u.set,h=o([].push),g=s||f((function(){return 1!==p.groupBy("ab",(function(r){return r})).get("a").length}));n({target:"Map",stat:!0,forced:s||g},{groupBy:function(r,t){c(r),a(t);var e=new p,n=0;return i(r,(function(r){var o=t(r,n++);l(e,o)?h(y(e,o),r):v(e,o,[r])})),e}})},function(r,t,e){var n=e(84),o=e(30),a=e(27),c=e(40),i=e(85),u=e(68),s=e(33),f=e(87),p=e(88),l=e(91),y=TypeError,v=function(r,t){this.stopped=r,this.result=t},h=v.prototype;r.exports=function(r,t,e){var g,b,m,d,w,E,x,O=e&&e.that,R=!(!e||!e.AS_ENTRIES),S=!(!e||!e.IS_RECORD),A=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),D=n(t,O),_=function(r){return g&&l(g,"normal",r),new v(!0,r)},I=function(r){return R?(a(r),T?D(r[0],r[1],_):D(r[0],r[1])):T?D(r,_):D(r)};if(S)g=r.iterator;else if(A)g=r;else{if(!(b=p(r)))throw new y(c(r)+" is not iterable");if(i(b)){for(m=0,d=u(r);d>m;m++)if((w=I(r[m]))&&s(h,w))return w;return new v(!1)}g=f(r,b)}for(E=S?r.next:g.next;!(x=o(E,g)).done;){try{w=I(x.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&s(h,w))return w}return new v(!1)}},function(t,e,n){var o=n(49),a=n(39),c=n(7),i=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:c?i(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var o=n(42),a=n(86),c=o("iterator"),i=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||i[c]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(30),o=e(39),a=e(27),c=e(40),i=e(88),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?i(r):t;if(o(e))return a(n(e,r));throw new u(c(r)+" is not iterable")}},function(r,t,e){var n=e(89),o=e(38),a=e(12),c=e(86),i=e(42)("iterator");r.exports=function(r){if(!a(r))return o(r,i)||o(r,"@@iterator")||c[n(r)]}},function(t,e,n){var o=n(90),a=n(8),c=n(50),i=n(42)("toStringTag"),u=Object,s="Arguments"===c(function(){return arguments}());t.exports=o?c:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),i))?n:s?c(e):"Object"===(o=c(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(42)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(30),o=e(27),a=e(38);r.exports=function(r,t,e){var c,i;o(r);try{if(!(c=a(r,"return"))){if("throw"===t)throw e;return e}c=n(c,r)}catch(r){i=!0,c=r}if("throw"===t)throw e;if(i)throw c;return o(c),e}},function(r,t,e){var n=e(6),o=Map.prototype;r.exports={Map:Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(54),o=e(32),a=e(6),c=e(39),i=e(11),u=e(28),s=e(83),f=e(3),p=Object.groupBy,l=o("Object","create"),y=a([].push);n({target:"Object",stat:!0,forced:!p||f((function(){return 1!==p("ab",(function(r){return r})).a.length}))},{groupBy:function(r,t){i(r),c(t);var e=l(null),n=0;return s(r,(function(r){var o=u(t(r,n++));o in e?y(e[o],r):e[o]=[r]})),e}})},function(t,e,n){var o=n(54),a=n(17),c=n(95),i=n(96),u=n(97),s=n(39),f=n(98),p=a.Promise,l=!1;o({target:"Promise",stat:!0,forced:!p||!p.try||f((function(){p.try((function(r){l=8===r}),8)})).error||!l},{try:function(t){var e=arguments.length>1?i(arguments,1):[],n=u.f(this),o=f((function(){return c(s(t),r,e)}));return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(r,t,e){var n=e(7),o=Function.prototype,a=o.apply,c=o.call;r.exports="object"==typeof Reflect&&Reflect.apply||(n?c.bind(a):function(){return c.apply(a,arguments)})},function(r,t,e){var n=e(6);r.exports=n([].slice)},function(t,e,n){var o=n(39),a=TypeError,c=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new c(r)}},function(r,t,e){r.exports=function(r){try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}}},function(r,t,e){var n=e(54),o=e(97);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(t,e,n){var o=n(54),a=n(17),c=n(32),i=n(45),u=n(23).f,s=n(9),f=n(101),p=n(102),l=n(106),y=n(108),v=n(109),h=n(2),g=n(16),b="DOMException",m=c("Error"),d=c(b),w=function(){f(this,E);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new d(e,n),a=new m(e);return a.name=b,u(o,"stack",i(1,v(a.stack,1))),p(o,this,w),o},E=w.prototype=d.prototype,x="stack"in new m(b),O="stack"in new d(1,2),R=d&&h&&Object.getOwnPropertyDescriptor(a,b),S=!(!R||R.writable&&R.configurable),A=x&&!S&&!O;o({global:!0,constructor:!0,forced:g||A},{DOMException:A?w:d});var T=c(b),D=T.prototype;if(D.constructor!==T)for(var _ in g||u(D,"constructor",i(1,T)),y)if(s(y,_)){var I=y[_],j=I.s;s(T,j)||u(T,j,i(6,I.c))}},function(r,t,e){var n=e(33),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(8),o=e(21),a=e(103);r.exports=function(r,t,e){var c,i;return a&&n(c=t.constructor)&&c!==e&&o(i=c.prototype)&&i!==e.prototype&&a(r,i),r}},function(t,e,n){var o=n(52),a=n(21),c=n(11),i=n(104);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return c(e),i(n),a(e)?(t?r(e,n):e.__proto__=n,e):e}}():r)},function(r,t,e){var n=e(105),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(21);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(107);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){var n=e(89),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(6),o=Error,a=n("".replace),c=String(new o("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,u=i.test(c);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,i,"");return r}},function(t,e,n){var o,a=n(16),c=n(54),i=n(17),u=n(32),s=n(6),f=n(3),p=n(44),l=n(8),y=n(111),v=n(12),h=n(21),g=n(31),b=n(83),m=n(27),d=n(89),w=n(9),E=n(112),x=n(22),O=n(68),R=n(113),S=n(114),A=n(92),T=n(116),D=n(117),_=n(76),I=n(119),j=n(80),M=i.Object,k=i.Array,P=i.Date,C=i.Error,L=i.TypeError,B=i.PerformanceMark,N=u("DOMException"),U=A.Map,F=A.has,z=A.get,W=A.set,V=T.Set,H=T.add,G=T.has,Y=u("Object","keys"),Q=s([].push),q=s((!0).valueOf),X=s(1..valueOf),K=s("".valueOf),Z=s(P.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!f((function(){var t=new i.Set([7]),e=r(t),n=r(M(7));return e===t||!e.has(7)||!h(n)||7!=+n}))&&r},er=function(r,t){return!f((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=i.structuredClone,or=a||!er(nr,C)||!er(nr,N)||(o=nr,!!f((function(){var r=o(new i.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new B($,{detail:r}).detail})),cr=tr(nr)||ar,ir=function(r){throw new N("Uncloneable type: "+r,J)},ur=function(r,t){throw new N((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},sr=function(r,t){return cr||ur(t),cr(r)},fr=function(t,e,n){if(F(e,t))return z(e,t);var o,a,c,u,s,f;if("SharedArrayBuffer"===(n||d(t)))o=cr?cr(t):t;else{var p=i.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,c="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,c),u=new p(t),s=new p(o);for(f=0;f<a;f++)s.setUint8(f,u.getUint8(f))}}catch(r){throw new N("ArrayBuffer is detached",J)}}return W(e,t,o),o},pr=function(t,e){if(g(t)&&ir("Symbol"),!h(t))return t;if(e){if(F(e,t))return z(e,t)}else e=new U;var n,o,a,c,s,f,p,y,v=d(t);switch(v){case"Array":a=k(O(t));break;case"Object":a={};break;case"Map":a=new U;break;case"Set":a=new V;break;case"RegExp":a=new RegExp(t.source,S(t));break;case"Error":switch(o=t.name){case"AggregateError":a=new(u(o))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":a=new(u(o));break;case"CompileError":case"LinkError":case"RuntimeError":a=new(u("WebAssembly",o));break;default:a=new C}break;case"DOMException":a=new N(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":a=fr(t,e,v);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":f="DataView"===v?t.byteLength:t.length,a=function(r,t,e,n,o){var a=i[t];return h(a)||ur(t),new a(fr(r.buffer,o),e,n)}(t,v,t.byteOffset,f,e);break;case"DOMQuad":try{a=new DOMQuad(pr(t.p1,e),pr(t.p2,e),pr(t.p3,e),pr(t.p4,e))}catch(r){a=sr(t,v)}break;case"File":if(cr)try{a=cr(t),d(a)!==v&&(a=r)}catch(r){}if(!a)try{a=new File([t],t.name,t)}catch(r){}a||ur(v);break;case"FileList":if(c=function(){var r;try{r=new i.DataTransfer}catch(t){try{r=new i.ClipboardEvent("").clipboardData}catch(r){}}return r&&r.items&&r.files?r:null}()){for(s=0,f=O(t);s<f;s++)c.items.add(pr(t[s],e));a=c.files}else a=sr(t,v);break;case"ImageData":try{a=new ImageData(pr(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){a=sr(t,v)}break;default:if(cr)a=cr(t);else switch(v){case"BigInt":a=M(t.valueOf());break;case"Boolean":a=M(q(t));break;case"Number":a=M(X(t));break;case"String":a=M(K(t));break;case"Date":a=new P(Z(t));break;case"Blob":try{a=t.slice(0,t.size,t.type)}catch(r){ur(v)}break;case"DOMPoint":case"DOMPointReadOnly":n=i[v];try{a=n.fromPoint?n.fromPoint(t):new n(t.x,t.y,t.z,t.w)}catch(r){ur(v)}break;case"DOMRect":case"DOMRectReadOnly":n=i[v];try{a=n.fromRect?n.fromRect(t):new n(t.x,t.y,t.width,t.height)}catch(r){ur(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=i[v];try{a=n.fromMatrix?n.fromMatrix(t):new n(t)}catch(r){ur(v)}break;case"AudioData":case"VideoFrame":l(t.clone)||ur(v);try{a=t.clone()}catch(r){ir(v)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ur(v);default:ir(v)}}switch(W(e,t,a),v){case"Array":case"Object":for(p=Y(t),s=0,f=O(p);s<f;s++)y=p[s],E(a,y,pr(t[y],e));break;case"Map":t.forEach((function(r,t){W(a,pr(t,e),pr(r,e))}));break;case"Set":t.forEach((function(r){H(a,pr(r,e))}));break;case"Error":x(a,"message",pr(t.message,e)),w(t,"cause")&&x(a,"cause",pr(t.cause,e)),"AggregateError"===o?a.errors=pr(t.errors,e):"SuppressedError"===o&&(a.error=pr(t.error,e),a.suppressed=pr(t.suppressed,e));case"DOMException":I&&x(a,"stack",pr(t.stack,e))}return a};c({global:!0,enumerable:!0,sham:!j,forced:or},{structuredClone:function(t){var e,n,o=R(arguments.length,1)>1&&!v(arguments[1])?m(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!h(t))throw new L("Transfer option cannot be converted to a sequence");var n=[];b(t,(function(r){Q(n,m(r))}));for(var o,a,c,u,s,f=0,p=O(n),v=new V;f<p;){if(o=n[f++],"ArrayBuffer"===(a=d(o))?G(v,o):F(e,o))throw new N("Duplicate transferable",J);if("ArrayBuffer"!==a){if(j)u=nr(o,{transfer:[o]});else switch(a){case"ImageBitmap":c=i.OffscreenCanvas,y(c)||ur(a,rr);try{(s=new c(o.width,o.height)).getContext("bitmaprenderer").transferFromImageBitmap(o),u=s.transferToImageBitmap()}catch(r){}break;case"AudioData":case"VideoFrame":l(o.clone)&&l(o.close)||ur(a,rr);try{u=o.clone(),o.close()}catch(r){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":ur(a,rr)}if(u===r)throw new N("This object cannot be transferred: "+a,J);W(e,o,u)}else H(v,o)}return v}(a,e=new U));var c=pr(t,e);return n&&function(r){D(r,(function(r){j?cr(r,{transfer:[r]}):l(r.transfer)?r.transfer():_?_(r):ur("ArrayBuffer",rr)}))}(n),c}})},function(r,t,e){var n=e(6),o=e(3),a=e(8),c=e(89),i=e(32),u=e(14),s=function(){},f=i("Reflect","construct"),p=/^\s*(?:class|function)\b/,l=n(p.exec),y=!p.test(s),v=function(r){if(!a(r))return!1;try{return f(s,[],r),!0}catch(r){return!1}},h=function(r){if(!a(r))return!1;switch(c(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!l(p,u(r))}catch(r){return!0}};h.sham=!0,r.exports=!f||o((function(){var r;return v(v.call)||!v(Object)||!v((function(){r=!0}))||r}))?h:v},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=function(r,t,e){n?o.f(r,t,a(0,e)):r[t]=e}},function(r,t,e){var n=TypeError;r.exports=function(r,t){if(r<t)throw new n("Not enough arguments");return r}},function(t,e,n){var o=n(30),a=n(9),c=n(33),i=n(115),u=RegExp.prototype;t.exports=function(t){var e=t.flags;return e!==r||"flags"in u||a(t,"flags")||!c(u,t)?e:o(i,t)}},function(r,t,e){var n=e(27);r.exports=function(){var r=n(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}},function(r,t,e){var n=e(6),o=Set.prototype;r.exports={Set:Set,add:n(o.add),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(6),o=e(118),a=e(116),c=a.Set,i=a.proto,u=n(i.forEach),s=n(i.keys),f=s(new c).next;r.exports=function(r,t,e){return e?o({iterator:s(r),next:f},t):u(r,t)}},function(t,e,n){var o=n(30);t.exports=function(t,e,n){for(var a,c,i=n?t:t.iterator,u=t.next;!(a=o(u,i)).done;)if((c=e(a.value))!==r)return c}},function(r,t,e){var n=e(3),o=e(45);r.exports=!n((function(){var r=new Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",o(1,7)),7!==r.stack)}))},function(t,e,n){var o=n(54),a=n(32),c=n(3),i=n(113),u=n(107),s=n(121),f=a("URL"),p=s&&c((function(){f.canParse()})),l=c((function(){return 1!==f.canParse.length}));o({target:"URL",stat:!0,forced:!p||l},{canParse:function(t){var e=i(arguments.length,1),n=u(t),o=e<2||arguments[1]===r?r:u(arguments[1]);try{return!!new f(n,o)}catch(r){return!1}}})},function(t,e,n){var o=n(3),a=n(42),c=n(2),i=n(16),u=a("iterator");t.exports=!o((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),o="";return t.pathname="c%20d",e.forEach((function(r,t){e.delete("b"),o+=t+r})),n.delete("a",2),n.delete("b",r),i&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",r)||n.has("b"))||!e.size&&(i||!c)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==o||"x"!==new URL("https://x",r).host}))},function(t,e,n){var o=n(54),a=n(32),c=n(113),i=n(107),u=n(121),s=a("URL");o({target:"URL",stat:!0,forced:!u},{parse:function(t){var e=c(arguments.length,1),n=i(t),o=e<2||arguments[1]===r?r:i(arguments[1]);try{return new s(n,o)}catch(r){return null}}})},function(t,e,n){var o=n(59),a=n(6),c=n(107),i=n(113),u=URLSearchParams,s=u.prototype,f=a(s.append),p=a(s.delete),l=a(s.forEach),y=a([].push),v=new u("a=1&a=2&b=3");v.delete("a",1),v.delete("b",r),v+""!="a=2"&&o(s,"delete",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=[];l(this,(function(r,t){y(o,{key:t,value:r})})),i(e,1);for(var a,u=c(t),s=c(n),v=0,h=0,g=!1,b=o.length;v<b;)a=o[v++],g||a.key===u?(g=!0,p(this,a.key)):h++;for(;h<b;)(a=o[h++]).key===u&&a.value===s||f(this,a.key,a.value)}),{enumerable:!0,unsafe:!0})},function(t,e,n){var o=n(59),a=n(6),c=n(107),i=n(113),u=URLSearchParams,s=u.prototype,f=a(s.getAll),p=a(s.has),l=new u("a=1");!l.has("a",2)&&l.has("a",r)||o(s,"has",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=f(this,t);i(e,1);for(var a=c(n),u=0;u<o.length;)if(o[u++]===a)return!0;return!1}),{enumerable:!0,unsafe:!0})},function(r,t,e){var n=e(2),o=e(6),a=e(4),c=URLSearchParams.prototype,i=o(c.forEach);n&&!("size"in c)&&a(c,"size",{get:function(){var r=0;return i(this,(function(){r++})),r},configurable:!0,enumerable:!0})}],e={},(n=function(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}).m=t,n.c=e,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:e})},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,t){if(1&t&&(r=n(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)n.d(e,o,function(t){return r[t]}.bind(null,o));return e},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=0)}();
(()=>{var e,t,n={941(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(212)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},212(e,t,n){e.exports=function(e){function t(e){let n,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";i++;const o=t.formatters[s];if("function"==typeof o){const t=e[i];n=o.call(r,t),e.splice(i,1),i--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(s=r,o=n,r++):(n++,r++);else{if(-1===s)return!1;r=s+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(s(e,n))return!1;for(const n of t.names)if(s(e,n))return!0;return!1},t.humanize=n(997),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},997(e){var t=1e3,n=60*t,r=60*n,s=24*r,o=7*s,i=365.25*s;function a(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=s)return a(e,o,s,"day");if(o>=r)return a(e,o,r,"hour");if(o>=n)return a(e,o,n,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=s)return Math.round(e/s)+"d";if(o>=r)return Math.round(e/r)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},269(e,t,n){"use strict";n.d(t,{K:()=>i});var r=n(941);const s=n.n(r)()("wc-analytics:consent"),o="statistics";const i=new class{consentListeners=[];isListenerInitialized=!1;isWpConsentApiAvailable(){return"function"==typeof window.wp_has_consent}hasAnalyticsConsent(){if(!this.isWpConsentApiAvailable())return s("WP Consent API not available, defaulting to true for backward compatibility"),!0;const e=window.wp_has_consent(o);return s("Analytics consent status:",e),e}addConsentChangeListener(e){this.consentListeners.push(e),this.initializeConsentListener()}initializeConsentListener(){!this.isListenerInitialized&&this.isWpConsentApiAvailable()&&(s("Initializing consent change listener"),document.addEventListener("wp_listen_for_consent_change",e=>{const t=e.detail;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e===o&&this.notifyListeners("allow"===t[e])}),this.isListenerInitialized=!0)}notifyListeners(e){this.consentListeners.forEach(t=>{try{t(e)}catch(e){s("Error in consent change listener:",e)}})}}},600(e,t,n){"object"==typeof window&&window.wcAnalytics?.assets_url&&(n.p=window.wcAnalytics.assets_url)}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,s),o.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,n)=>(s.f[n](e,t),t),[])),s.u=e=>e+".js?minify=false&ver="+{193:"d0600ea7dd576bb65bec",686:"5723073a00bf7c2955d7"}[e],s.miniCssF=e=>{},(()=>{if(!s.miniCssF)throw new Error("MiniCSSWithRTLPlugin was loaded before MiniCSSExtractPlugin");var e;s.miniCssF=(e=s.miniCssF,t=>{var n="rtl"===document.dir,r=e(t);return n?r.replace(/\.css(?:$|\?)/,".rtl$&"):r})})(),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@automattic/woocommerce-analytics:",s.l=(n,r,o,i)=>{if(e[n])e[n].push(r);else{var a,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+o){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",t+o),a.src=n),e[n]=[r];var f=(t,r)=>{a.onerror=a.onload=null,clearTimeout(C);var s=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach(e=>e(r)),t)return t(r)},C=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={310:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,s)=>r=e[t]=[n,s]);n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,a,c]=n,u=0;if(i.some(t=>0!==e[t])){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(c)c(s)}for(t&&t(n);u<i.length;u++)o=i[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk_automattic_woocommerce_analytics=self.webpackChunk_automattic_woocommerce_analytics||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";s(600);var e=s(269);jQuery(()=>{window.wcAnalytics&&(e.K.hasAnalyticsConsent()?s.e(193).then(s.bind(s,633)):e.K.addConsentChangeListener(e=>{e&&s.e(193).then(s.bind(s,633))}))})})()})();
!function(){var e={795:function(){var e,t;(t=t||(e=[],{getAll:function(){return e},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=null!=t?t:window.performance.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}})).Tween=function(e){var i={},n={},o={},s=1e3,a=!1,r=0,l=null,h=t.Easing.Linear.None,u=t.Interpolation.Linear,p=null,c=!1,d=null,f=null,g=null;for(var m in e)i[m]=parseFloat(e[m],10);this.to=function(e,t){return null!=t&&(s=t),n=e,this},this.start=function(s){for(var h in t.add(this),a=!0,c=!1,l=(null!=s?s:window.performance.now())+r,n){if(n[h]instanceof Array){if(0===n[h].length)continue;n[h]=[e[h]].concat(n[h])}null!=i[h]&&(i[h]=e[h],i[h]instanceof Array==!1&&(i[h]*=1),o[h]=i[h]||0)}return this},this.stop=function(){return a&&(t.remove(this),a=!1,null!=g&&g.call(e)),this},this.complete=function(){return a&&(t.remove(this),a=!1,null!=f&&f.call(e)),this},this.delay=function(e){return r=e,this},this.easing=function(e){return h=null==e?h:e,this},this.onStart=function(e){return p=e,this},this.onUpdate=function(e){return d=e,this},this.onComplete=function(e){return f=e,this},this.onStop=function(e){return g=e,this},this.update=function(t){if(t<l)return!0;for(o in!1===c&&(null!=p&&p.call(e),c=!0),a=(a=(t-l)/s)>1?1:a,r=h(a),n)if(null!=i[o]){var o,a,r,g=i[o]||0,m=n[o];m instanceof Array?e[o]=u(m,r):("string"==typeof m&&(m=m.startsWith("+")||m.startsWith("-")?g+parseFloat(m,10):parseFloat(m,10)),"number"==typeof m&&(e[o]=g+(m-g)*r))}return null!=d&&d.call(e,r),1!==a||(null!=f&&f.call(e),!1)}},t.Easing={Linear:{None:function(e){return e}},Quadratic:{InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)}},Cubic:{InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}},t.Interpolation={Linear:function(e,i){var n=e.length-1,o=n*i,s=Math.floor(o),a=t.Interpolation.Utils.Linear;return i<0?a(e[0],e[1],o):i>1?a(e[n],e[n-1],n-o):a(e[s],e[s+1>n?n:s+1],o-s)},Utils:{Linear:function(e,t,i){return(t-e)*i+e}}},window.TWEEN=t}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}i.amdO={},function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||n(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,i){if(t){if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}}var o,s,a=new WeakMap,r=new WeakMap;function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof l)return e;if(!(this instanceof l))return new l(e,t);if(a.set(this,[]),this.length=0,!e)return this;var i=[];return"string"==typeof e?i=e.trim().startsWith("<")&&e.trim().endsWith(">")?(i=Array.from(document.createRange().createContextualFragment(e.trim()).children)).map(function(e){return e.cloneNode(!0)}):Array.from(document.querySelectorAll(e)):e.nodeType||e===window||e===document?i=[e]:void 0!==e.length&&(i=Array.from(e)),this._setElements(i,t),this}function h(){return!0}function u(){return!1}l.prototype._getElements=function(){return a.get(this)||[]},l.prototype._setElements=function(e,i){var n=this;return a.set(this,e),this.length=e.length,Object.keys(this).forEach(function(e){isNaN(e)||delete n[e]}),e.forEach(function(e,o){if(i.hasOwnProperty("class")){var s;(s=e.classList).add.apply(s,t(i.class.trim().split(" ")))}i.hasOwnProperty("id")&&(e.id=i.id),i.hasOwnProperty("title")&&(e.title=i.title),i.hasOwnProperty("html")&&(e.innerHTML=i.html),n[o]=e}),this},l.prototype.on=function(e,t,i){var n,o;return"string"==typeof t&&"function"==typeof i?(o=t,n=i):(n=t,o=null),this._getElements().forEach(function(t){if(o){var i=function(e){if(e.target){var t=e.target.closest(o);t&&(e.originalEvent=e,n.call(t,e))}};t.addEventListener(e,i),t._queryHandlers||(t._queryHandlers={}),t._queryHandlers[e]||(t._queryHandlers[e]=[]),t._queryHandlers[e].push({original:n,wrapped:i,selector:o})}else{var s=function(e){e.originalEvent=e,n.call(t,e)};t.addEventListener(e,s),t._queryHandlers||(t._queryHandlers={}),t._queryHandlers[e]||(t._queryHandlers[e]=[]),t._queryHandlers[e].push({original:n,wrapped:s})}}),this},l.prototype.off=function(){return this._getElements().forEach(function(e){e._queryHandlers&&(Object.keys(e._queryHandlers).forEach(function(t){e._queryHandlers[t].forEach(function(i){e.removeEventListener(t,i.wrapped)})}),e._queryHandlers={})}),this},l.prototype.trigger=function(e){return this._getElements().forEach(function(t){if("string"==typeof e&&"function"==typeof t[e])t[e]();else{var i=new Event(e,{bubbles:!0});t.dispatchEvent(i)}}),this},l.prototype.addClass=function(e){return e&&this._getElements().forEach(function(i){if(i.classList){var n;(n=i.classList).add.apply(n,t(e.trim().split(" ")))}}),this},l.prototype.removeClass=function(e){return e&&this._getElements().forEach(function(i){if(i.classList){var n;(n=i.classList).remove.apply(n,t(e.trim().split(" ")))}}),this},l.prototype.hasClass=function(e){return this._getElements().some(function(t){return t.classList&&t.classList.contains(e)})},l.prototype.toggleClass=function(e,t){return this._getElements().forEach(function(i){void 0===t?i.classList.toggle(e):t?i.classList.add(e):i.classList.remove(e)}),this},l.prototype.css=function(e){var t=["width","height","min-width","min-height","max-width","max-height","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","top","right","bottom","left","border-width","border-top-width","border-right-width","border-bottom-width","border-left-width","fontSize","lineHeight"];return this._getElements().forEach(function(i){Object.keys(e).forEach(function(n){var o=e[n];null!=o&&""!==o&&!isNaN(parseFloat(o))&&isFinite(o)&&t.includes(n)&&0!==o&&"0"!==o&&"number"==typeof o&&(o+="px"),i.style[n]=o})}),this},l.prototype.prepend=function(e){return e&&this._getElements().forEach(function(t){"string"==typeof e?t.insertAdjacentHTML("afterbegin",e):e instanceof l?e._getElements().forEach(function(e){t.insertBefore(e,t.firstChild)}):e.nodeType&&t.insertBefore(e,t.firstChild)}),this},l.prototype.append=function(e){return e&&this._getElements().forEach(function(t){"string"==typeof e?t.insertAdjacentHTML("beforeend",e):e instanceof l?e._getElements().forEach(function(e){t.contains(e)||t.appendChild(e)}):e.nodeType&&!t.contains(e)&&t.appendChild(e)}),this},l.prototype.appendTo=function(e){var t=e instanceof l?e._getElements()[0]:"string"==typeof e?document.querySelector(e):e;return t&&this._getElements().forEach(function(e){t.contains(e)||t.appendChild(e)}),this},l.prototype.after=function(e){return this._getElements().forEach(function(t){"string"==typeof e?t.insertAdjacentHTML("afterend",e):e instanceof l?e._getElements().forEach(function(e){t.parentNode.insertBefore(e,t.nextSibling)}):e.nodeType&&t.parentNode.insertBefore(e,t.nextSibling)}),this},l.prototype.html=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].innerHTML:"":(this._getElements().forEach(function(t){t.innerHTML=e}),this)},l.prototype.text=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].textContent:"":(this._getElements().forEach(function(t){t.textContent=e}),this)},l.prototype.find=function(e){var i=[];return this._getElements().forEach(function(n){var o=n.querySelectorAll(e);i.push.apply(i,t(Array.from(o)))}),new l(i)},l.prototype.children=function(e){var t=[];return this._getElements().forEach(function(i){Array.from(i.children).forEach(function(i){(!e||i.matches(e))&&t.push(i)})}),new l(t)},l.prototype.is=function(e){return this._getElements().some(function(t){return t.matches(e)})},l.prototype.closest=function(e){var t=[];return this._getElements().forEach(function(i){var n=i.closest(e);n&&!t.includes(n)&&t.push(n)}),new l(t)},l.prototype.contains=function(e){var t=e instanceof l?e._getElements()[0]:e;return this._getElements().some(function(e){return e.contains(t)})},l.prototype.siblings=function(e){var i=[];return this._getElements().forEach(function(n){var o=Array.from(n.parentElement.children).filter(function(e){return e!==n});e&&(o=o.filter(function(t){return t.matches(e)})),i.push.apply(i,t(o))}),new l(i)},l.prototype.parent=function(e){var t=this._getElements().map(function(e){return e.parentElement}).filter(function(e){return null!==e});return e&&(t=t.filter(function(t){return t.matches(e)})),new l(t)},l.prototype.each=function(e){return this._getElements().forEach(function(t,i){e.call(t,i,t)}),this},l.prototype.map=function(e){return this._getElements().map(function(t,i){return e.call(t,i,t)}),this},l.prototype.get=function(){return this._getElements()},l.prototype.attr=function(e,t){return 1==arguments.length?this._getElements()[0]?this._getElements()[0].getAttribute(e):void 0:(void 0===t?this._getElements().forEach(function(t){t.removeAttribute(e)}):this._getElements().forEach(function(i){i.setAttribute(e,t)}),this)},l.prototype.removeAttr=function(e){return this._getElements().forEach(function(t){t.removeAttribute(e)}),this},l.prototype.data=function(e,t){if(void 0===t){var i=this._getElements()[0];if(!i)return;var n=r.get(i)||{};if(void 0!==n[e])return n[e];var o=e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});return i.dataset[o]}return this._getElements().forEach(function(i){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)i.setAttribute("data-".concat(e),t);else if(null===t){i.removeAttribute("data-".concat(e));var n=r.get(i);n&&void 0!==n[e]&&(delete n[e],r.set(i,n))}else if((void 0===t?"undefined":t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"){var o=r.get(i)||{};o[e]=t,r.set(i,o)}}),this},l.prototype.height=function(e){if(void 0===e){if(0===this._getElements().length)return 0;var t=this._getElements()[0];return t===window?window.innerHeight:t.offsetHeight}return this._getElements().forEach(function(t){t.style.height="number"==typeof e?e+"px":e}),this},l.prototype.width=function(e){if(void 0===e){if(0===this._getElements().length)return 0;var t=this._getElements()[0];return t===window?window.innerWidth:t.offsetWidth}return this._getElements().forEach(function(t){t.style.width="number"==typeof e?e+"px":e}),this},l.prototype.offset=function(){return{top:this[0].offsetTop,left:this[0].offsetLeft}},l.prototype.remove=function(){return this._getElements().forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this._setElements([]),this},l.prototype.val=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].value:"":(this._getElements().forEach(function(t){t.value=e}),this)},l.prototype.hide=function(){return this._getElements().forEach(function(e){e.style.display="none"}),this},l.prototype.show=function(){return this._getElements().forEach(function(e){e.style.display="block"}),this},l.prototype.ready=function(e){document.addEventListener("DOMContentLoaded",e)},l.prototype.scrollTop=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].scrollTop:0:(this._getElements().forEach(function(t){t.scrollTop=e}),this)},l.prototype.change=function(e){return this._getElements().forEach(function(t){t.addEventListener("change",e)}),this},l.prototype.click=function(){return this._getElements().forEach(function(e){"function"==typeof e.click&&e.click()}),this},l.extend=function(e,t){for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];if(!t)return{};var a=!0,r=!1,h=void 0;try{for(var u,p=o[Symbol.iterator]();!(a=(u=p.next()).done);a=!0){var c=u.value;if(c){var d=!0,f=!1,g=void 0;try{for(var m,v=Object.entries(c)[Symbol.iterator]();!(d=(m=v.next()).done);d=!0){var y,b=(y=m.value,function(e){if(Array.isArray(e))return e}(y)||function(e,t){var i,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],a=!0,r=!1;try{for(o=o.call(e);!(a=(i=o.next()).done)&&(s.push(i.value),2!==s.length);a=!0);}catch(e){r=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw n}}return s}}(y,2)||n(y,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=b[0],P=b[1];if(P instanceof l)t[w]=P;else switch(Object.prototype.toString.call(P)){case"[object Object]":"[object Object]"===Object.prototype.toString.call(t[w])?t[w]=l.extend(t[w],P):t[w]=l.extend({},P);break;case"[object Array]":t[w]=l.extend(Array(P.length),P);break;default:t[w]=P}}}catch(e){f=!0,g=e}finally{try{d||null==v.return||v.return()}finally{if(f)throw g}}}}}catch(e){r=!0,h=e}finally{try{a||null==p.return||p.return()}finally{if(r)throw h}}return t},l.Event=function(e,t){if(!(this instanceof l.Event))return new l.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?h:u,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&l.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this._eventFixed=!0},l.Event.prototype={constructor:l.Event,isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},l.event={fix:function(e){return e._eventFixed?e:new l.Event(e)}};var p={jQuery:null,version:"2.4.27",autoDetectLocation:!0,_isHashTriggered:!1,slug:void 0,locationVar:"dearViewerLocation",locationFile:void 0,MOUSE_CLICK_ACTIONS:{NONE:"none",NAV:"nav"},ARROW_KEYS_ACTIONS:{NONE:"none",NAV:"nav"},MOUSE_DBL_CLICK_ACTIONS:{NONE:"none",ZOOM:"zoom"},MOUSE_SCROLL_ACTIONS:{NONE:"none",ZOOM:"zoom",NAV:"nav"},PAGE_SCALE:{PAGE_FIT:"fit",PAGE_WIDTH:"width",AUTO:"auto",ACTUAL:"actual",MANUAL:"manual"},READ_DIRECTION:{LTR:"ltr",RTL:"rtl"},TURN_DIRECTION:{LEFT:"left",RIGHT:"right",NONE:"none"},INFO_TYPE:{INFO:"info",ERROR:"error"},FLIPBOOK_PAGE_MODE:{SINGLE:"single",DOUBLE:"double",AUTO:"auto"},FLIPBOOK_SINGLE_PAGE_MODE:{ZOOM:"zoom",BOOKLET:"booklet",AUTO:"auto"},FLIPBOOK_PAGE_SIZE:{AUTO:"auto",SINGLE:"single",DOUBLE_INTERNAL:"dbl_int",DOUBLE:"dbl",DOUBLE_COVER_BACK:"dbl_cover_back"},LINK_TARGET:{NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4},CONTROLS_POSITION:{HIDDEN:"hidden",TOP:"top",BOTTOM:"bottom"},TURN_CORNER:{TL:"tl",TR:"tr",BL:"bl",BR:"br",L:"l",R:"r",NONE:"none"},REQUEST_STATUS:{OFF:"none",ON:"pending",COUNT:"counting"},TEXTURE_TARGET:{THUMB:0,VIEWER:1,ZOOM:2},FLIPBOOK_CENTER_SHIFT:{RIGHT:1,LEFT:-1,NONE:0},FLIPBOOK_COVER_TYPE:{NONE:"none",PLAIN:"plain",BASIC:"basic",RIDGE:"ridge"}};function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}p.fakejQuery=!1,"undefined"==typeof jQuery?(p.fakejQuery=!0,p.jQuery=l):p.jQuery=jQuery,p._defaults={is3D:!0,has3DShadow:!0,color3DCover:"#aaaaaa",color3DSheets:"#fff",cover3DType:p.FLIPBOOK_COVER_TYPE.NONE,flexibility:.9,drag3D:!1,height:"auto",autoOpenOutline:!1,autoOpenThumbnail:!1,showDownloadControl:!0,showSearchControl:!0,showPrintControl:!0,enableSound:!0,duration:800,pageRotation:0,flipbook3DTiltAngleUp:0,flipbook3DTiltAngleLeft:0,readDirection:p.READ_DIRECTION.LTR,pageMode:p.FLIPBOOK_PAGE_MODE.AUTO,singlePageMode:p.FLIPBOOK_SINGLE_PAGE_MODE.AUTO,flipbookFitPages:!1,backgroundColor:"transparent",flipbookHardPages:"none",openPage:1,annotationClass:"",maxTextureSize:3200,minTextureSize:256,rangeChunkSize:524288,disableAutoFetch:!0,disableStream:!0,disableFontFace:!1,calendarMode:!1,icons:{altnext:"df-icon-arrow-right1",altprev:"df-icon-arrow-left1",next:"df-icon-arrow-right1",prev:"df-icon-arrow-left1",end:"df-icon-last-page",start:"df-icon-first-page",share:"df-icon-share","outline-open":"df-icon-arrow-right","outline-close":"df-icon-arrow-down",help:"df-icon-help",more:"df-icon-more",download:"df-icon-download",zoomin:"df-icon-add-circle",zoomout:"df-icon-minus-circle",resetzoom:"df-icon-minus-circle",fullscreen:"df-icon-fullscreen","fullscreen-off":"df-icon-fit-screen",fitscreen:"df-icon-fit-screen",thumbnail:"df-icon-grid-view",outline:"df-icon-list",close:"df-icon-close",doublepage:"df-icon-double-page",singlepage:"df-icon-file",print:"df-icon-print",play:"df-icon-play",pause:"df-icon-pause",search:"df-icon-search",sound:"df-icon-volume","sound-off":"df-icon-volume",facebook:"df-icon-facebook",google:"df-icon-google",twitter:"df-icon-twitter",whatsapp:"df-icon-whatsapp",linkedin:"df-icon-linkedin",pinterest:"df-icon-pinterest",mail:"df-icon-mail"},text:{toggleSound:"Turn on/off Sound",toggleThumbnails:"Toggle Thumbnails",toggleOutline:"Toggle Outline/Bookmark",previousPage:"Previous Page",nextPage:"Next Page",toggleFullscreen:"Toggle Fullscreen",zoomIn:"Zoom In",zoomOut:"Zoom Out",resetZoom:"Reset Zoom",pageFit:"Fit Page",widthFit:"Fit Width",toggleHelp:"Toggle Help",search:"Search in PDF",singlePageMode:"Single Page Mode",doublePageMode:"Double Page Mode",downloadPDFFile:"Download PDF File",gotoFirstPage:"Goto First Page",gotoLastPage:"Goto Last Page",print:"Print",play:"Start AutoPlay",pause:"Pause AutoPlay",share:"Share",close:"Close",mailSubject:"Check out this FlipBook",mailBody:"Check out this site {{url}}",loading:"Loading",thumbTitle:"Thumbnails",outlineTitle:"Table of Contents",searchTitle:"Search",searchPlaceHolder:"Search",searchClear:"Clear",searchSearchingInfo:"Searching Page:",searchResultsFound:"results found",searchResultsNotFound:"No results Found!",searchResultPage:"Page",searchResult:"result",searchResults:"results",searchMinimum:"Minimum 3 letters required!",analyticsEventCategory:"DearFlip",analyticsViewerReady:"Document Ready",analyticsViewerOpen:"Document Opened",analyticsViewerClose:"Document Closed",analyticsFirstPageChange:"First Page Changed"},share:{facebook:"https://www.facebook.com/sharer/sharer.php?u={{url}}&t={{mailsubject}}",twitter:"https://twitter.com/share?url={{url}}&text={{mailsubject}}",mail:void 0,whatsapp:"https://api.whatsapp.com/send/?text={{mailsubject}}+{{url}}&app_absent=0",linkedin:"https://www.linkedin.com/shareArticle?url={{url}}&title={{mailsubject}}",pinterest:"https://www.pinterest.com/pin/create/button/?url={{url}}&media=&description={{mailsubject}}"},allControls:"altPrev,pageNumber,altNext,play,outline,thumbnail,zoomIn,zoomOut,zoom,fullScreen,share,download,search,pageMode,startPage,endPage,sound,search,print,more",moreControls:"download,pageMode,pageFit,startPage,endPage,sound",leftControls:"outline,thumbnail",rightControls:"fullScreen,share,download,more",hideControls:"",hideShareControls:"",controlsPosition:p.CONTROLS_POSITION.BOTTOM,paddingTop:20,paddingLeft:15,paddingRight:15,paddingBottom:20,enableAnalytics:!1,hashNavigationEnabled:!1,zoomRatio:2,maxDPI:2,fakeZoom:1,progressiveZoom:!1,pageScale:p.PAGE_SCALE.PAGE_FIT,controlsFloating:!0,sideMenuOverlay:!0,enableAnnotation:!0,enableAutoLinks:!0,arrowKeysAction:p.ARROW_KEYS_ACTIONS.NAV,clickAction:p.MOUSE_CLICK_ACTIONS.NAV,dblClickAction:p.MOUSE_DBL_CLICK_ACTIONS.NONE,mouseScrollAction:p.MOUSE_SCROLL_ACTIONS.NONE,linkTarget:p.LINK_TARGET.BLANK,soundFile:"sound/turn2.mp3",imagesLocation:"images",imageResourcesPath:"images/pdfjs/",popupThumbPlaceholder:"data:image/svg+xml,"+escape('<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 210 297"><rect width="210" height="297" style="fill:#f1f2f2"/><circle cx="143" cy="95" r="12" style="fill:#e3e8ed"/><polygon points="131 138 120 149 95 124 34 184 176 185 131 138" style="fill:#e3e8ed"/></svg>'),cMapUrl:"js/libs/cmaps/",logo:"",logoUrl:"",sharePrefix:"",pageSize:p.FLIPBOOK_PAGE_SIZE.AUTO,backgroundImage:"",pixelRatio:window.devicePixelRatio||1,spotLightIntensity:.22,ambientLightColor:"#fff",ambientLightIntensity:.8,shadowOpacity:.1,slug:void 0,headerElementSelector:void 0,onReady:function(e){},onPageChanged:function(e){},beforePageChanged:function(e){},onCreate:function(e){},onCreateUI:function(e){},onFlip:function(e){},beforeFlip:function(e){},autoPDFLinktoViewer:!1,autoLightBoxFullscreen:!1,thumbLayout:"book-title-hover",cleanupAfterRender:!0,canvasWillReadFrequently:!0,providerType:"pdf",loadMoreCount:-1,autoPlay:!1,autoPlayDuration:1e3,autoPlayStart:!1,popupBackGroundColor:"#eee",mockupMode:!1,instantTextureProcess:!1,cachePDFTexture:!1,pdfVersion:"default"},p.defaults={},p.jQuery.extend(!0,p.defaults,p._defaults),p.viewers={},p.providers={},p.openFileOptions={},p.executeCallback=function(){};var d=p.jQuery,f="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style,g="onmousedown"in window,m=p.utils={mouseEvents:g?{type:"mouse",start:"mousedown",move:"mousemove",end:"mouseup"}:{type:"touch",start:"touchstart",move:"touchmove",end:"touchend"},html:{div:"<div></div>",a:"<a>",input:"<input type='text'/>",select:"<select></select>"},getSharePrefix:function(){return m.getSharePrefixes()[0]},getSharePrefixes:function(){return(p.defaults.sharePrefix+",dflip-,flipbook-,dearflip-,dearpdf-").split(",").map(function(e){return e.trim()})},toRad:function(e){return e*Math.PI/180},toDeg:function(e){return 180*e/Math.PI},ifdef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null==e?t:e},createBtn:function(e,t,i){var n=d(m.html.div,{class:"df-ui-btn df-ui-"+e,title:i,html:void 0!==i?"<span>"+i+"</span>":""});return void 0!==t&&t.indexOf("<svg")>-1?n.html(t.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg" ')):n.addClass(t),n},transition:function(e,t){return e?t/1e3+"s ease-out":"0s none"},display:function(e){return e?"block":"none"},resetTranslate:function(){return m.translateStr(0,0)},bgImage:function(e){return null==e||"blank"===e?"":' url("'+e+'")'},translateStr:function(e,t){return f?" translate3d("+e+"px,"+t+"px, 0px) ":" translate("+e+"px, "+t+"px) "},httpsCorrection:function(e){try{if(null==e)return null;if("string"!=typeof e)return e;var t=window.location;if(t.href.split(".")[0]===e.split(".")[0])return e;e.split("://")[1].split("/")[0].replace("www.","")===t.hostname.replace("www.","")&&e.indexOf(t.hostname.replace("www.",""))>-1&&(t.href.indexOf("https://")>-1?e=e.replace("http://","https://"):t.href.indexOf("http://")>-1&&(e=e.replace("https://","http://")),t.href.indexOf("://www.")>-1&&-1===e.indexOf("://www.")&&(e=e.replace("://","://www.")),-1===t.href.indexOf("://www.")&&e.indexOf("://www.")>-1&&(e=e.replace("://www.","://")))}catch(t){console.log("Skipping URL correction: "+e)}return e},rotateStr:function(e){return" rotateZ("+e+"deg) "},lowerPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},nearestPowerOfTwo:function(e,t){return Math.min(t||2048,Math.pow(2,Math.ceil(Math.log(e)/Math.LN2)))},getFullscreenElement:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},hasFullscreenEnabled:function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled},fixMouseEvent:function(e){if(!e)return e;var t=e.originalEvent||e;if(!t.changedTouches||!(t.changedTouches.length>0))return e;var i=d.event.fix(e),n=t.changedTouches[0];return i.clientX=n.clientX,i.clientY=n.clientY,i.pageX=n.pageX,i.touches=t.touches,i.pageY=n.pageY,i.movementX=n.movementX,i.movementY=n.movementY,i},limitAt:function(e,t,i){return e<t?t:e>i?i:e},distOrigin:function(e,t){return m.distPoints(0,0,e,t)},distPoints:function(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))},angleByDistance:function(e,t){var i=t/2,n=m.limitAt(e,0,t);return n<i?m.toDeg(Math.asin(n/i)):90+m.toDeg(Math.asin((n-i)/i))},calculateScale:function(e,t){var i=m.distPoints(e[0].x,e[0].y,e[1].x,e[1].y);return m.distPoints(t[0].x,t[0].y,t[1].x,t[1].y)/i},getVectorAvg:function(e){return{x:e.map(function(e){return e.x}).reduce(m.sum)/e.length,y:e.map(function(e){return e.y}).reduce(m.sum)/e.length}},sum:function(e,t){return e+t},getTouches:function(e,t){return t=t||{left:0,top:0},Array.prototype.slice.call(e.touches).map(function(e){return{x:e.pageX-t.left,y:e.pageY-t.top}})},getScriptCallbacks:[],getScript:function(e,t,i,n){var o,s=m.getScriptCallbacks[e];function a(){o.removeEventListener("load",r,!1),o.removeEventListener("readystatechange",r,!1),o.removeEventListener("complete",r,!1),o.removeEventListener("error",l,!1),o.onload=o.onreadystatechange=null,o=null,o=null}function r(e,t){if(null!=o&&(t||!o.readyState||/loaded|complete/.test(o.readyState))){if(!t){for(var n=0;n<s.length;n++)s[n]&&s[n](),s[n]=null;i=null}a()}}function l(){i(),a(),i=null}if(0===d("script[src='"+e+"']").length){(s=m.getScriptCallbacks[e]=[]).push(t),o=document.createElement("script");var h=document.body.getElementsByTagName("script")[0];o.async=!0,o.setAttribute("data-cfasync","false"),!0===n&&o.setAttribute("type","module"),null!=h?(h.parentNode.insertBefore(o,h),h=null):document.body.appendChild(o),o.addEventListener("load",r,!1),o.addEventListener("readystatechange",r,!1),o.addEventListener("complete",r,!1),i&&o.addEventListener("error",l,!1),o.src=e+("MS"===m.prefix.dom?"?"+Math.random():"")}else s.push(t)},loadScript:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(function(i,n){var o=document.createElement("script");o.src=e,o.onload=function(e){t&&o.remove(),i(e)},o.onerror=function(){n(Error("Cannot load script at: ".concat(o.src)))},(document.head||document.documentElement).append(o)})},detectScriptLocation:function(){if(void 0===window[p.locationVar])d("script").each(function(){var e=d(this)[0].src;if((e.indexOf("/"+p.locationFile+".js")>-1||e.indexOf("/"+p.locationFile+".min.js")>-1||e.indexOf("js/"+p.locationFile+".")>-1)&&(e.indexOf("https://")>-1||e.indexOf("http://")>-1)){var t=e.split("/");window[p.locationVar]=t.slice(0,-2).join("/")}});else if(-1==window[p.locationVar].indexOf(":")){var e=document.createElement("a");e.href=window[p.locationVar],window[p.locationVar]=e.href,e=null}void 0!==window[p.locationVar]&&window[p.locationVar].length>2&&"/"!==window[p.locationVar].slice(-1)&&(window.window[p.locationVar]+="/")},disposeObject:function(e){return e&&e.dispose&&e.dispose(),e=null},log:function(){for(var e,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];!0===p.defaults.enableDebugLog&&window.console&&(e=console).log.apply(e,function(e){if(Array.isArray(e))return c(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var i=Object.prototype.toString.call(e).slice(8,-1);if("Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return c(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},color:{getBrightness:function(e){var t=e.replace("#","").match(/.{1,2}/g).map(function(e){return parseInt(e,16)});return .299*t[0]+.587*t[1]+.114*t[2]},isLight:function(e){return!m.color.isDark(e)},isDark:function(e){return 128>m.color.getBrightness(e)}},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isIOS:/(iPad|iPhone|iPod)/g.test(navigator.userAgent),isIPad:"iPad"===navigator.platform||void 0!==navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Mac/.test(navigator.platform),isMac:navigator.platform.toUpperCase().indexOf("MAC")>=0,isSafari:/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||window.safari.pushNotification).toString(),isIEUnsupported:!!navigator.userAgent.match(/(MSIE|Trident)/),isSafariWindows:function(){return!m.isMac&&m.isSafari},hasWebgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch(e){return!1}}(),hasES2022:void 0!==Array.prototype.at,canSupport3D:function(){var e=!0;try{if(!1==m.hasWebgl)e=!1,console.log("Proper Support for Canvas webgl 3D not detected!");else if(!1==m.hasES2022)e=!1,console.log("Proper Support for 3D not extpected in older browser!");else if(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)e=!1,console.log("Proper Support for 3D not detected for IE!");else if(m.isSafariWindows())e=!1,console.log("Proper Support for 3D not detected for Safari!");else{var t=navigator.userAgent.toString().toLowerCase().match(/android\s([0-9\.]*)/i);(t=t?t[1]:void 0)&&(t=parseInt(t,10),!isNaN(t)&&t<9&&(e=!1,console.log("Proper Support for 3D not detected for Android below 9.0!")))}}catch(e){}return e},prefix:(o=window.getComputedStyle(document.documentElement,""),s=Array.prototype.slice.call(o).join("").match(/-(moz|webkit|ms)-/)[1],{dom:"WebKit|Moz|MS".match(RegExp("("+s+")","i"))[1],lowercase:s,css:"-"+s+"-",js:s[0].toUpperCase()+s.substr(1)}),scrollIntoView:function(e,t,i){(t=t||e.parentNode).scrollTop=e.offsetTop+(!1===i?e.offsetHeight-t.offsetHeight:0),t.scrollLeft=e.offsetLeft-t.offsetLeft},getVisibleElements:function(e){var t=e.container,i=e.elements,n=e.visible||[],o=t.scrollTop,s=o+t.clientHeight;if(0==s)return n;var a=0,r=i.length-1,l=i[a],h=l.offsetTop+l.clientTop+l.clientHeight;if(h<o)for(;a<r;){var u=a+r>>1;(h=(l=i[u]).offsetTop+l.clientTop+l.clientHeight)>o?r=u:a=u+1}for(var p=a;p<i.length;p++)if((l=i[p]).offsetTop+l.clientTop<=s)n.push(p+1);else break;return n},getMouseDelta:function(e){var t=0;return null!=e.wheelDelta?t=e.wheelDelta:null!=e.detail&&(t=-e.detail),t},pan:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.startPoint,o=e.app.zoomValue,s=e.left+(!0===i?0:t.raw.x-n.raw.x),a=e.top+(!0===i?0:t.raw.y-n.raw.y);e.left=Math.ceil(m.limitAt(s,-e.shiftWidth,e.shiftWidth)),e.top=Math.ceil(m.limitAt(a,-e.shiftHeight,e.shiftHeight)),1===o&&(e.left=0,e.top=0),!1===i&&(e.startPoint=t)},elementIntersection:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e[0].getBoundingClientRect(),o=t[0].getBoundingClientRect(),s=Math.max(n.left,Math.floor(o.left)),a=Math.max(n.top,Math.floor(o.top)),r=Math.min(n.right,o.right),l=Math.min(n.bottom,o.bottom),h=Math.max(r-s,0),u=Math.max(l-a,0);return i?{left:Math.max(n.left-o.left,0),top:Math.max(n.top-o.top,0),width:h,height:u}:{left:s,top:a,right:r,bottom:l,width:h,height:u}}};m.isChromeExtension=function(){return 0===window.location.href.indexOf("chrome-extension://")};var v=/\x00+/g,y=/[\x01-\x1F]/g;m.removeNullCharacters=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"!=typeof e?(warn("The argument for removeNullCharacters must be a string."),e):(t&&(e=e.replace(y," ")),e.replace(v,""))},p.hashFocusBookFound=!1,m.detectHash=function(){p.preParseHash=window.location.hash;var e=m.getSharePrefixes();-1==e.indexOf("")&&e.push(""),Array.prototype.forEach.call(e,function(e){var t=p.preParseHash,i="#"+e;if(t&&t.indexOf(i)>=0&&!1===p.hashFocusBookFound){i.length>1&&(t=t.split(i)[1]);var n=t.split("/")[0].replace("#","");if(n.length>0)try{var o,s=t.split("/")[1];if(null!=s&&(s=s.split("/")[0]),o=d("[data-df-slug="+n+"]"),0===o.length&&(o=d("[data-slug="+n+"]")),0===o.length&&(o=d("#df-"+n+",#"+n)),0===o.length&&(o=d("[data-_slug="+n+"]")),o.length>0&&o.is("._df_thumb,._df_button,._df_custom,._df_link,._df_book,.df-element,.dp-element")){o=d(o[0]),p.hashFocusBookFound=!0,s=parseInt(s,10),m.focusHash(o);var a=p.activeLightBox&&p.activeLightBox.app||o.data("df-app");if(null!=a)return a.gotoPage(s),m.focusHash(a.element),!1;null!=s&&o.attr("data-hash-page",s),o.addClass("df-hash-focused",!0),null!=o.data("lightbox")||null!=o.data("df-lightbox")?(p._isHashTriggered=!0,o.trigger("click"),p._isHashTriggered=!1):null!=o.attr("href")&&o.attr("href").indexOf(".pdf")>-1&&o.trigger("click")}}catch(e){console.log(e)}}})},m.focusHash=function(e){var t,i;null===(t=(i=e[0]).scrollIntoView)||void 0===t||t.call(i,{behavior:"smooth",block:"nearest",inline:"nearest"})},m.contain=function(e,t,i,n){var o=Math.min(i/e,n/t);return{width:e*o,height:t*o}},m.containUnStretched=function(e,t,i,n){var o=Math.min(1,i/e,n/t);return{width:e*o,height:t*o}},m.fallbackOptions=function(e){return void 0===e.share.mail&&(e.share.mail="mailto:?subject="+e.text.mailSubject+"&body="+e.text.mailBody),e.openPage&&(e.openPage=parseInt(e.openPage,10)),e};var b=function(e){var t={},i={id:"",thumb:"",openPage:"data-hash-page,df-page,data-df-page,data-page,page",target:"",height:"",showDownloadControl:"data-download",source:"pdf-source,df-source,source",is3D:"webgl,is3d",viewerType:"viewertype,viewer-type",pageMode:"pagemode"};for(var n in i)for(var o=(n+","+i[n]).split(","),s=0;s<o.length;s++){var a=o[s];if(""!==a){var r=e.data(a);if(null!==r&&""!==r&&void 0!==r||null!==(r=e.attr(a))&&""!==r&&void 0!==r){t[n]=r;break}}}return e.removeAttr("data-hash-page"),t};m.getOptions=function(e){void 0==(e=d(e)).data("df-option")&void 0==e.data("option")&&e.data("df-option","option_"+e.attr("id")),void 0!==e.attr("source")&&e.data("df-source",e.attr("source"));var t=e.data("df-option")||e.data("option"),i=void 0;i=(void 0===t?"undefined":t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"?t:null==t||""===t||null==window[t]?{}:window[t];var n=b(e);return d.extend(!0,{},i,n)},m.isTrue=function(e){return"true"===e||!0===e},m.parseInt=function(e){return parseInt(e,10)},m.parseFloat=function(e){return parseFloat(e)},m.parseIntIfExists=function(e){return void 0!==e&&(e=parseInt(e,10)),e},m.parseFloatIfExists=function(e){return void 0!==e&&(e=parseFloat(e)),e},m.parseBoolIfExists=function(e){return void 0!==e&&(e=m.isTrue(e)),e},m.getCurveAngle=function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e?(i=t>135?180-(180-t)*2:t>45?t-45:0,i=m.limitAt(i,n,180)):(i=t<45?2*t:t<135?t+45:180,i=m.limitAt(i,0,180-n)),i},m.sanitizeOptions=function(e){if(e.showDownloadControl=m.parseBoolIfExists(e.showDownloadControl),e.showSearchControl=m.parseBoolIfExists(e.showSearchControl),e.showPrintControl=m.parseBoolIfExists(e.showPrintControl),e.flipbook3DTiltAngleLeft=m.parseIntIfExists(e.flipbook3DTiltAngleLeft),e.flipbook3DTiltAngleUp=m.parseIntIfExists(e.flipbook3DTiltAngleUp),e.paddingLeft=m.parseIntIfExists(e.paddingLeft),e.paddingRight=m.parseIntIfExists(e.paddingRight),e.paddingTop=m.parseIntIfExists(e.paddingTop),e.paddingBottom=m.parseIntIfExists(e.paddingBottom),e.duration=m.parseIntIfExists(e.duration),e.rangeChunkSize=m.parseIntIfExists(e.rangeChunkSize),e.maxTextureSize=m.parseIntIfExists(e.maxTextureSize),e.linkTarget=m.parseIntIfExists(e.linkTarget),e.zoomRatio=m.parseFloatIfExists(e.zoomRatio),e.enableAnalytics=m.parseBoolIfExists(e.enableAnalytics),e.autoPlay=m.parseBoolIfExists(e.autoPlay),e.autoPlayStart=m.parseBoolIfExists(e.autoPlayStart),e.autoPlayDuration=m.parseIntIfExists(e.autoPlayDuration),void 0!==e.loadMoreCount&&(e.loadMoreCount=m.parseInt(e.loadMoreCount),(isNaN(e.loadMoreCount)||0===e.loadMoreCount)&&(e.loadMoreCount=-1)),null!=e.source&&(Array===e.source.constructor||Array.isArray(e.source)||e.source instanceof Array))for(var t=0;t<e.source.length;t++)e.source[t]=m.httpsCorrection(e.source[t]);else e.source=m.httpsCorrection(e.source);return e},m.finalizeOptions=function(e){return e},m.urlify=function(e){for(var t,i,n=/[a-zA-Z0-9][^\s,]{3,}\.[^\s,]+[a-zA-Z0-9]/gi,o=[];t=n.exec(e);){var s=t[0];1==(s.match(/@/g)||[]).length?s.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,7})+/gi)&&o.push({index:t.index,length:s.length,text:s}):s.match(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*/g)&&(0===(i=s.toLowerCase()).indexOf("http:")||0===i.indexOf("https:")||0===i.indexOf("www."))&&o.push({index:t.index,length:s.length,text:s})}return o},m.oldurlify=function(e){return e.replace(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/g,function(e,t,i,n,o){var s=e=e.toLowerCase();if(e.indexOf(":")>0&&-1===e.indexOf("http:")&&-1===e.indexOf("https:"))return m.log("AutoLink Rejected: "+s+" for "+e),e;if(0===e.indexOf("www."))s="http://"+e;else if(0===e.indexOf("http://")||0===e.indexOf("https://"));else if(0===e.indexOf("mailto:"));else if(e.indexOf("@")>0&&(s="mailto:"+e,null===e.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/)))return m.log("AutoLink Rejected: "+s+" for "+e),e;return m.log("AutoLink: "+s+" for "+e),'<a href="'+s+'" class="df-autolink" target="_blank">'+e+"</a>"})},m.supportsPassive=!1;try{var w=Object.defineProperty({},"passive",{get:function(){m.supportsPassive=!0}});window.addEventListener("testPassive",null,w),window.removeEventListener("testPassive",null,w)}catch(e){}p.parseCSSElements=function(){d(".dvcss").each(function(){var e,t=d(this),i=function(e){for(var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dvcss_e_",n=e.classList,o=0;o<n.length;o++)if(0===(t=n[o]).indexOf(i))return t;return null}(t[0]);t.removeClass(i).removeClass("dvcss"),i=i.replace("dvcss_e_","");try{e=JSON.parse(atob(i))}catch(e){}if(e){var n="df_option_"+e.id;window[n]=d.extend(!0,{},window[n],e),t.addClass("df-element"),"none"!==e.lightbox&&(t.attr("data-df-lightbox",void 0===e.lightbox?"custom":e.lightbox),"thumb"==e.lightbox&&t.attr("data-df-thumb",e.pdfThumb),e.thumbLayout&&t.attr("data-df-thumb-layout",e.thumbLayout),e.apl&&t.attr("apl",e.apl)),t.data("df-option",n),t.attr("data-df-slug",e.slug),t.attr("id","df_"+e.id)}})},p.parseThumbs=function(e){e.element.html(""),(null==e.thumbURL||""==e.thumbURL.toString().trim())&&(e.element.addClass("df-thumb-not-found"),e.thumbURL=p.defaults.popupThumbPlaceholder);var t=d("<span class='df-book-title'>").html(e.title),i=d("<div class='df-book-wrapper'>").appendTo(e.element);i.append(d("<div class='df-book-page1'>")),i.append(d("<div class='df-book-page2'>"));var n=d("<div class='df-book-cover'>").append(t).appendTo(i),o=e.element.hasClass("df-skip-lazy"),s=d('<img width="210px" height="297px" class="df-lazy" alt="'+e.title+'"/>');n.prepend(s),o?(s.attr("src",e.thumbURL),s.removeClass("df-lazy")):(s.attr("data-src",e.thumbURL),s.attr("src",p.defaults.popupThumbPlaceholder),p.addLazyElement(s[0])),!0===p.defaults.displayLightboxPlayIcon&&n.addClass("df-icon-play-popup"),"book-title-top"===e.thumbLayout?t.prependTo(e.element):("book-title-bottom"===e.thumbLayout||"cover-title"===e.thumbLayout)&&(e.hasShelf?e.thumbLayout="book-title-fixed":t.appendTo(e.element),!0===p.defaults.displayLightboxPlayIcon&&(e.element.removeClass("df-icon-play-popup"),i.addClass("df-icon-play-popup"))),e.element.addClass("df-tl-"+e.thumbLayout),e.element.attr("title",e.title)},p.initId=10,p.embeds=[],p.activeEmbeds=[],p.removeEmbeds=[],p.removeEmbedsLimit=m.isMobile?1:2,p.parseNormalElements=function(){d(".df-posts").each(function(){if(!1!==p.defaults.loadMoreCount&&-1!==p.defaults.loadMoreCount){var e=d(this);if("true"!==e.data("df-parsed")){e.data("df-parsed","true"),e.attr("df-parsed","true");var t=0,i=e.find(".df-element"),n=i.length;i.each(function(){++t>p.defaults.loadMoreCount&&d(this).attr("skip-parse","true")}),n>p.defaults.loadMoreCount&&e.append("<div class='df-load-more-button-wrapper'><div class='df-load-more-button'>Load More..</div></div>")}}}),p.triggerId=10,d(".df-element").each(function(){var e=d(this);if("true"!==e.attr("skip-parse")&&"true"!==e.data("df-parsed")){e.data("df-parsed","true"),e.attr("df-parsed","true");var t=e.data("df-lightbox")||e.data("lightbox");if(void 0===t)e.addClass("df-lazy-embed"),p.addLazyElement(e[0]);else if(e.addClass("df-popup-"+t),"thumb"===t){var i=e.data("df-thumb-layout")||p.defaults.thumbLayout,n=m.httpsCorrection(e.data("df-thumb"));e.removeAttr("data-thumb").removeAttr("data-thumb-layout");var o=e.html().trim();(void 0===o||""===o)&&(o="Click to Open");var s=e.parent().hasClass("df-has-shelf");p.parseThumbs({element:e,thumbURL:n,title:o,thumbLayout:i,hasShelf:s}),s&&e.after(d("<df-post-shelf>"))}else"button"===t&&p.defaults.buttonClass&&e.addClass(p.defaults.buttonClass);var a=e.attr("data-trigger");null!=a&&a.length>1&&(a=a.split(","),p.triggerId++,a.forEach(function(t){e.attr("df-trigger-id",p.triggerId),d("#"+t).addClass("df-trigger").attr("df-trigger",p.triggerId)}))}}),p.handleLazy=function(){var e;if(p.removeEmbeds.length>p.removeEmbedsLimit&&(e=p.removeEmbeds.shift())){var t=d("[initID='"+e+"']");if(t.length>0){var i=t.data("df-app");if(i){t.attr("data-df-page",i.currentPageNumber),m.log("Removed app id "+e),i.dispose(),i=null;var n=p.activeEmbeds.indexOf(e);n>-1&&p.activeEmbeds.splice(n,1)}}}if(e=p.embeds.shift()){var o=d("[initID='"+e+"']");if(o.length>0){if(o.is("img"))o.hasClass("df-lazy")?(o.attr("src",o.attr("data-src")),o.removeAttr("data-src"),o.removeClass("df-lazy"),p.lazyObserver.unobserve(o[0])):m.log("Prevent this"),p.handleLazy();else{var s=o.data("df-app");null==s?new p.Application({element:o}):s.softInit(),m.log("Created app id "+e),p.activeEmbeds.push(e)}}}p.removeEmbeds.length<=p.removeEmbedsLimit&&0==p.embeds.length&&(p.checkRequestQueue=null)}},p.lazyObserver={observe:function(e){(e=d(e)).is("img")?e.hasClass("df-lazy")&&(e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.removeClass("df-lazy")):new p.Application({element:e})}},"function"==typeof IntersectionObserver&&(p.lazyObserver=new IntersectionObserver(function(e,t){e.forEach(function(e){var t,i=d(e.target),n=i.attr("initID");e.isIntersecting?(!i.attr("initID")&&(i.attr("initID",p.initId),n=p.initId.toString(),p.initId++),(t=p.removeEmbeds.indexOf(n))>-1?(p.removeEmbeds.splice(t,1),m.log("Removed id "+n+"from Removal list")):-1==(t=p.embeds.indexOf(n))&&(p.embeds.push(n),m.log("Added id "+n+"to Add list"))):n&&((t=p.embeds.indexOf(n))>-1?(p.embeds.splice(t,1),m.log("Removed id "+n+" from Add list")):-1==(t=p.removeEmbeds.indexOf(n))&&(p.removeEmbeds.push(n),m.log("Added id "+n+" to Removal list"))),P=0,(p.removeEmbeds.length>p.removeEmbedsLimit||p.embeds.length>0)&&null==p.checkRequestQueue&&(p.checkRequestQueue=function(){P++,p.checkRequestQueue&&requestAnimationFrame(function(){p&&p.checkRequestQueue&&p.checkRequestQueue()}),P>20&&(P=0,p.handleLazy())},p.checkRequestQueue())})}));var P=0;p.addLazyElement=function(e){p.lazyObserver.observe(e)},p.parseElements=m.parseElements=function(){p.parseCSSElements(),p.parseNormalElements()},p.initUtils=function(){m.detectScriptLocation();var e=d("body");(m.isSafari||m.isIOS)&&e.addClass("df-ios"),e.on("click",function(){}),e.on("click",".df-posts .df-load-more-button",function(){var e=d(this).closest(".df-posts");if(e.length>0){var t=0;e.find(".df-element").each(function(){var e=d(this);"true"===e.attr("skip-parse")&&(t<p.defaults.loadMoreCount&&e.removeAttr("skip-parse"),t++)}),p.parseNormalElements()}}),p.defaults.shelfImage&&""!=p.defaults.shelfImage&&e.append("<style>.df-has-shelf df-post-shelf:before, .df-has-shelf df-post-shelf:after{background-image: url('"+p.defaults.shelfImage+"');}</style>")};var S=p.jQuery,E=p.utils,x=/*#__PURE__*/function(){var e;function t(e,i){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,t),this.pages=[],this.app=i,this.parentElement=this.app.viewerContainer;var n="df-viewer "+(e.viewerClass||"");this.element=S("<div>",{class:n}),this.parentElement.append(this.element),this.wrapper=S("<div>",{class:"df-viewer-wrapper"}),this.element.append(this.wrapper),this.oldBasePageNumber=0,this.pages=[],this.minZoom=1,this.maxZoom=4,this.swipeThreshold=20,this.stageDOM=null,this.events={},this.arrowKeysAction=e.arrowKeysAction,this.clickAction=e.clickAction,this.scrollAction=e.scrollAction,this.dblClickAction=e.dblClickAction,this.pageBuffer=[],this.pageBufferSize=10,this.afterConstructor()}return e=[{key:"afterConstructor",value:function(){}},{key:"init",value:function(){}},{key:"softDispose",value:function(){}},{key:"updateBuffer",value:function(e){}},{key:"pageResetCallback",value:function(e){}},{key:"initCustomControls",value:function(){}},{key:"_getInnerWidth",value:function(){return this.app.dimensions.containerWidth-this.app.dimensions.padding.width-this.app.dimensions.offset.width}},{key:"_getInnerHeight",value:function(){return this.app.dimensions.maxHeight-this.app.dimensions.padding.height}},{key:"_getOuterHeight",value:function(e){return e}},{key:"dispose",value:function(){this.stageDOM&&(this.stageDOM.removeEventListener("mousemove",this.events.mousemove,!1),this.stageDOM.removeEventListener("mousedown",this.events.mousedown,!1),this.stageDOM.removeEventListener("mouseup",this.events.mouseup,!1),this.stageDOM.removeEventListener("touchmove",this.events.mousemove,!1),this.stageDOM.removeEventListener("touchstart",this.events.mousedown,!1),this.stageDOM.removeEventListener("touchend",this.events.mouseup,!1),this.stageDOM.removeEventListener("dblclick",this.events.dblclick,!1),this.stageDOM.removeEventListener("scroll",this.events.scroll,!1),this.stageDOM.removeEventListener("mousewheel",this.events.mousewheel,!1),this.stageDOM.removeEventListener("DOMMouseScroll",this.events.mousewheel,!1)),this.events=null,this.stageDOM=null,this.element.remove()}},{key:"checkDocumentPageSizes",value:function(){}},{key:"getViewerPageNumber",value:function(e){return e}},{key:"getDocumentPageNumber",value:function(e){return e}},{key:"getRenderContext",value:function(e,t){var i=this.app,n=i.provider,o=t.pageNumber,s=E.ifdef(t.textureTarget,p.TEXTURE_TARGET.VIEWER);i.dimensions.pageFit;var a=n.viewPorts[o],r=i.viewer.getTextureSize(t),l=null;if(l=s===p.TEXTURE_TARGET.THUMB?i.thumbSize:Math.floor(r.height),void 0===n.getCache(o,l)){var h=r.height/a.height,u=document.createElement("canvas"),c=this.filterViewPort(e.getViewport({scale:h,rotation:e._pageInfo.rotate+i.options.pageRotation}),o);s===p.TEXTURE_TARGET.THUMB&&(h=c.width/c.height>180/i.thumbSize?180*h/c.width:h*i.thumbSize/c.height,c=this.filterViewPort(e.getViewport({scale:h,rotation:e._pageInfo.rotate+i.options.pageRotation}),o)),u.height=Math.floor(c.height),u.width=Math.floor(c.width);var d=Math.abs(u.width-r.width)/r.width*100;return d>.001&&d<2&&(u.width=Math.floor(r.width),u.height=Math.floor(r.height)),i.viewer.filterViewPortCanvas(c,u,o),{canvas:u,canvasContext:u.getContext("2d",{willReadFrequently:!0===p.defaults.canvasWillReadFrequently}),viewport:c}}}},{key:"filterViewPort",value:function(e,t){return e}},{key:"getViewPort",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.app.provider.viewPorts[e];return t?null!=i?i:this.app.provider.defaultPage.viewPort:i}},{key:"pagesReady",value:function(){this.app.executeCallback("onPagesReady")}},{key:"onReady",value:function(){}},{key:"filterViewPortCanvas",value:function(e){}},{key:"finalizeAnnotations",value:function(){}},{key:"finalizeTextContent",value:function(){}},{key:"updateTextContent",value:function(e){void 0==e&&(e=this.getBasePage(e)),this.app.provider.processTextContent(e,this.getTextElement(e,!0))}},{key:"isActivePage",value:function(e){return e===this.app.currentPageNumber}},{key:"initEvents",value:function(){var e=this.stageDOM=E.ifdef(this.stageDOM,this.parentElement[0]);e&&(e.addEventListener("mousemove",this.events.mousemove=this.mouseMove.bind(this),!1),e.addEventListener("mousedown",this.events.mousedown=this.mouseDown.bind(this),!1),e.addEventListener("mouseup",this.events.mouseup=this.mouseUp.bind(this),!1),e.addEventListener("touchmove",this.events.mousemove=this.mouseMove.bind(this),!1),e.addEventListener("touchstart",this.events.mousedown=this.mouseDown.bind(this),!1),e.addEventListener("touchend",this.events.mouseup=this.mouseUp.bind(this),!1),e.addEventListener("dblclick",this.events.dblclick=this.dblclick.bind(this),!1),e.addEventListener("scroll",this.events.scroll=this.onScroll.bind(this),!1),e.addEventListener("mousewheel",this.events.mousewheel=this.mouseWheel.bind(this),!1),e.addEventListener("DOMMouseScroll",this.events.mousewheel=this.mouseWheel.bind(this),!1)),this.startTouches=null,this.lastScale=null,this.startPoint=null}},{key:"refresh",value:function(){}},{key:"reset",value:function(){}},{key:"eventToPoint",value:function(e){var t={x:e.clientX,y:e.clientY};return t.x=t.x-this.app.viewerContainer[0].getBoundingClientRect().left,t.y=t.y-this.app.viewerContainer[0].getBoundingClientRect().top,{raw:t}}},{key:"mouseMove",value:function(e){e=E.fixMouseEvent(e),this.pinchMove(e),!0===this.pinchZoomDirty&&e.preventDefault(),this.startPoint&&!0!=this.pinchZoomDirty&&(this.pan(this.eventToPoint(e)),e.preventDefault())}},{key:"mouseDown",value:function(e){e=E.fixMouseEvent(e),this.pinchDown(e),this.startPoint=this.eventToPoint(e)}},{key:"mouseUp",value:function(e){e=E.fixMouseEvent(e),!0===this.pinchZoomDirty&&e.preventDefault();var t=this.eventToPoint(e),i=e.target||e.originalTarget,n=this.startPoint&&t.x===this.startPoint.x&&t.y===this.startPoint.y&&"A"!==i.nodeName;!0===e.ctrlKey&&n&&this.zoomOnPoint(t),this.pinchUp(e),this.startPoint=null}},{key:"pinchDown",value:function(e){null!=e.touches&&2==e.touches.length&&null==this.startTouches&&(this.startTouches=E.getTouches(e),this.app.viewer.zoomCenter=E.getVectorAvg(E.getTouches(e,this.parentElement.offset())),this.lastScale=1)}},{key:"pinchUp",value:function(e){null!=e.touches&&e.touches.length<2&&!0==this.pinchZoomDirty&&(this.app.viewer.lastScale=this.lastScale,this.app.container.removeClass("df-pinch-zoom"),this.updateTemporaryScale(!0),this.app.zoom(),this.lastScale=null,this.app.viewer.canSwipe=!1,this.pinchZoomDirty=!1,this.app.viewer._pinchZoomLastScale=null,this.startTouches=null)}},{key:"pinchMove",value:function(e){if(null!=e.touches&&2==e.touches.length&&null!=this.startTouches){this.pinchZoomDirty=!0,this.app.container.addClass("df-pinch-zoom");var t=E.calculateScale(this.startTouches,E.getTouches(e));this.lastScale,this.lastScale=t,this.app.viewer.pinchZoomUpdateScale=E.limitAt(t,this.app.viewer.minZoom/this.app.zoomValue,this.app.viewer.maxZoom/this.app.zoomValue),this.app.viewer._pinchZoomLastScale!=this.app.viewer.pinchZoomUpdateScale&&(this.app.viewer.pinchZoomRequestStatus=p.REQUEST_STATUS.ON,this.app.viewer._pinchZoomLastScale=this.app.viewer.pinchZoomUpdateScale),e.preventDefault();return}}},{key:"updateTemporaryScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===e)this.parentElement[0].style.transform="none";else if(this.app.viewer.zoomCenter){var t=this.app.viewer.pinchZoomUpdateScale;this.parentElement[0].style.transformOrigin=this.app.viewer.zoomCenter.x+"px "+this.app.viewer.zoomCenter.y+"px",this.parentElement[0].style.transform="scale3d("+t+","+t+",1)"}}},{key:"pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.panRequestStatus=p.REQUEST_STATUS.ON,E.pan(this,e,t)}},{key:"updatePan",value:function(){this.element.css({transform:"translate3d("+this.left+"px,"+this.top+"px,0)"})}},{key:"dblclick",value:function(e){}},{key:"onScroll",value:function(e){}},{key:"mouseWheel",value:function(e){var t=this.app,i=E.getMouseDelta(e),n=!0===e.ctrlKey,o=t.options.mouseScrollAction===p.MOUSE_SCROLL_ACTIONS.ZOOM&&(!0===t.options.isLightBox||!0===t.isFullscreen);n||o?(i>0||i<0)&&(e.preventDefault(),t.viewer.zoomCenter=this.eventToPoint(e).raw,t.zoom(i),t.ui.update()):t.options.mouseScrollAction===p.MOUSE_SCROLL_ACTIONS.NAV&&(i>0?t.next():i<0&&t.prev())}},{key:"zoomOnPoint",value:function(e){this.app.viewer.zoomCenter=e.raw,this.app.zoom(1)}},{key:"getVisiblePages",value:function(){return this.visiblePagesCache=[],{main:this.visiblePagesCache,buffer:[]}}},{key:"getBasePage",value:function(){return this.app.currentPageNumber}},{key:"isFirstPage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),1===e}},{key:"isLastPage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),e===this.app.pageCount}},{key:"isEdgePage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),1===e||e===this.app.pageCount}},{key:"checkRequestQueue",value:function(){var e=p.REQUEST_STATUS;this.panRequestStatus===e.ON&&(this.updatePan(),this.panRequestStatus=e.OFF),this.app.viewer.pinchZoomRequestStatus===e.ON&&(this.app.viewer.updateTemporaryScale(),this.app.viewer.pinchZoomRequestStatus=e.OFF)}},{key:"isAnimating",value:function(){return!1}},{key:"updatePendingStatusClass",value:function(e){void 0===e&&(e=this.isAnimating()),this.app.container.toggleClass("df-pending",e)}},{key:"initPages",value:function(){}},{key:"resize",value:function(){}},{key:"determinePageMode",value:function(){}},{key:"zoom",value:function(){}},{key:"gotoPageCallBack",value:function(){this.requestRefresh()}},{key:"requestRefresh",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.app.refreshRequestStatus=!0===e?p.REQUEST_STATUS.ON:p.REQUEST_STATUS.OFF}},{key:"getPageByNumber",value:function(e){var t=this.pages,i=void 0;if(this.app.isValidPage(e)){for(var n=0;n<t.length;n++)if(e===t[n].pageNumber){i=t[n];break}}return i}},{key:"changeAnnotation",value:function(){return!1}},{key:"getAnnotationElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getPageByNumber(e);if(void 0!==i)return void 0===i.annotationElement&&(i.annotationElement=S("<div class='df-link-content'>"),i.contentLayer.append(i.annotationElement)),!0===t&&i.annotationElement.html(""),i.annotationElement[0]}},{key:"getTextElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getPageByNumber(e);if(void 0!==i)return void 0===i.textElement&&(i.textElement=S("<div class='df-text-content'>"),i.contentLayer.append(i.textElement)),!0===t&&(i.textElement.html(""),i.textElement.siblings(".df-auto-link-content").html("")),i.textElement[0]}},{key:"render",value:function(){}},{key:"checkPageLoading",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!0,i=this.getVisiblePages().main,n=!0===e?i.length:this.isBooklet?1:2;n=Math.min(n,i.length);for(var o=0;o<n;o++){var s=this.getPageByNumber(i[o]);s&&(t=s.textureLoaded&&t)}return this.element.toggleClass("df-loading",!t),t}},{key:"textureLoadedCallback",value:function(e){}},{key:"handleZoom",value:function(){}},{key:"getTextureSize",value:function(e){console.error("Texture calculation missing!")}},{key:"textureHeightLimit",value:function(e){return E.limitAt(e,1,this.app.dimensions.maxTextureHeight)}},{key:"textureWidthLimit",value:function(e){return E.limitAt(e,1,this.app.dimensions.maxTextureWidth)}},{key:"setPage",value:function(e){E.log("Set Page detected",e.pageNumber);var t=this.getPageByNumber(e.pageNumber);return!!t&&(e.callback=this.textureLoadedCallback.bind(this),t.loadTexture(e),this.updateBuffer(t),!0)}},{key:"cleanPage",value:function(e){return!0}},{key:"validatePageChange",value:function(e){return e!==this.app.currentPageNumber}},{key:"afterControlUpdate",value:function(){}},{key:"searchPage",value:function(e){return{include:!0,label:this.app.provider.getLabelforPage(e)}}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function C(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function T(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function k(e,t,i){return t&&T(e.prototype,t),i&&T(e,i),e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var L=p.utils,N=p.jQuery,_=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}(n,e);var t,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=O(n);return e=t?Reflect.construct(i,arguments,O(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)});function n(e){var t;return C(this,n),(t=i.call(this)).canvasMode=null,e&&e.parentElement&&(t.parentElement=e.parentElement),t.init(),t}return k(n,[{key:"init",value:function(){var e=this.element=N("<div>",{class:"df-page"});e[0].appendChild(this.contentLayer[0]),this.texture=new Image,this.parentElement&&this.parentElement[0].append(e[0])}},{key:"resetContent",value:function(){void 0!==this.annotationElement&&this.annotationElement.html(""),void 0!==this.textElement&&this.textElement.html("")}},{key:"setLoading",value:function(){this.element.toggleClass("df-loading",!0!==this.textureLoaded)}},{key:"loadTexture",value:function(e){var t=this,i=e.texture,n=e.callback;function o(){t.textureSrc=i,t.element.css({backgroundImage:L.bgImage(i)}),t.updateTextureLoadStatus(!0),"function"==typeof n&&n(e)}null===t.canvasMode&&i&&"CANVAS"===i.nodeName&&(t.canvasMode=!0),!0===t.canvasMode?(t.element.find("canvas").remove(),i!==t.textureLoadFallback&&(t.textureSrc=i,t.element.append(N(i))),t.updateTextureLoadStatus(!0),"function"==typeof n&&n(e)):i===t.textureLoadFallback?o():(t.texture.onload=o,t.texture.src=i)}},{key:"updateCSS",value:function(e){this.element.css(e)}},{key:"resetCSS",value:function(){this.element.css({transform:"",boxShadow:"",display:"block"})}}]),n}(/*#__PURE__*/function(){function e(){C(this,e),this.textureLoadFallback="blank",this.textureStamp="-1",this.textureLoaded=!1,this.texture="blank",this.textureSrc="blank",this.pageNumber=void 0,this.contentLayer=N("<div>",{class:"df-page-content"})}return k(e,[{key:"reset",value:function(){this.resetTexture(),this.resetContent()}},{key:"resetTexture",value:function(){this.textureLoaded=!1,this.textureStamp="-1",this.loadTexture({texture:this.textureLoadFallback}),this.contentLayer.removeClass("df-content-loaded")}},{key:"clearTexture",value:function(){this.loadTexture({texture:this.textureLoadFallback})}},{key:"resetContent",value:function(){}},{key:"loadTexture",value:function(e){}},{key:"getTexture",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.textureSrc;return!0===e&&t&&t.cloneNode&&(t=t.cloneNode()).getContext&&t.getContext("2d").drawImage(this.textureSrc,0,0),t}},{key:"setLoading",value:function(){}},{key:"updateTextureLoadStatus",value:function(e){this.textureLoaded=!0===e,L.log((!0===this.textureLoaded?"Loaded ":"Loading ")+this.textureStamp+" for "+this.pageNumber),this.contentLayer.toggleClass("df-content-loaded",!0===e),this.setLoading()}},{key:"changeTexture",value:function(e,t){var i=e+"|"+t;return this.textureStamp!==i&&(L.log("Page "+e+":texture changed from - "+this.textureStamp+" to "+i),this.textureLoaded=!1,this.textureStamp=i,this.updateTextureLoadStatus(!1),!0)}}]),e}());function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e,t,i){return(A="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=M(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var D=p.jQuery,F=p.utils,B=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(o,e);var t,i,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=M(o);return e=t?Reflect.construct(i,arguments,M(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:I(this)});function o(e,t){var i;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e.viewerClass="df-reader",t.options.mouseScrollAction=p.MOUSE_SCROLL_ACTIONS.NONE,(i=n.call(this,e,t)).app.jumpStep=1,i.minZoom=.25,i.stackCount=i.app.pageCount,i.app.options.paddingLeft=0,i.app.options.paddingRight=0,i.app.options.paddingTop=10,i.app.options.paddingBottom=!0===i.app.options.controlsFloating?20:10,i.app.pageScaling=i.app.options.pageScale,i.acceptAppMouseEvents=!0,i.scrollStatus=p.REQUEST_STATUS.OFF,i.deltaPanX=0,i.deltaPanY=0,t._viewerPrepared(),i.zoomViewer=I(i),i}return i=[{key:"init",value:function(){A(M(o.prototype),"init",this).call(this),this.initEvents(),this.initPages(),this.initScrollBar()}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],A(M(o.prototype),"initEvents",this).call(this)}},{key:"initPages",value:function(){this.stackCount=this.app.pageCount;for(var e=0;e<this.stackCount;e++){var t=new _({parentElement:this.wrapper});t.index=e,t.viewer=this,this.pages.push(t)}}},{key:"initScrollBar",value:function(){this.scrollBar=D("<div class='df-reader-scrollbar'>"),this.scrollBar.appendTo(this.app.container),this.scrollPageNumber=D("<div class='df-reader-scroll-page-number'>").appendTo(this.app.container),this.scrollPageNumberCurrent=D("<div>").appendTo(this.scrollPageNumber),this.scrollPageNumberTotal=D("<div class='df-reader-scroll-page-number-total'>").appendTo(this.scrollPageNumber)}},{key:"afterControlUpdate",value:function(){if(void 0!==this.scrollBar){var e=this.app.getCurrentLabel();this.scrollBar.text(e),this.app.provider.pageLabels?(this.scrollPageNumberCurrent.text(e),this.scrollPageNumberTotal.text("("+this.app.currentPageNumber+" of "+this.app.pageCount+")")):(this.scrollPageNumberCurrent.text(e),this.scrollPageNumberTotal.text("of "+this.app.pageCount))}}},{key:"updateBuffer",value:function(e){if("-1"!==e.textureStamp&&void 0!==e.pageNumber){for(var t=e.pageNumber,i=e.pageNumber,n=0,o=0;o<this.pageBuffer.length;o++){var s=this.pageBuffer[o].pageNumber;if(t===s){F.log("Page "+t+" already in buffer, skipping");return}Math.abs(this.app.currentPageNumber-s)>Math.abs(this.app.currentPageNumber-i)&&(i=s,n=o)}this.pageBuffer.push(e),this.pageBuffer.length>this.pageBufferSize&&(F.log("Farthest buffer: "+i),this.pageBuffer[n].reset(),this.pageBuffer.splice(n,1))}}},{key:"initCustomControls",value:function(){var e=this.app.ui.controls;e.openRight.hide(),e.openLeft.hide()}},{key:"dispose",value:function(){A(M(o.prototype),"dispose",this).call(this),this.scrollBar&&this.scrollBar.remove(),this.scrollPageNumber&&this.scrollPageNumber.remove(),this.element.remove()}},{key:"_getInnerHeight",value:function(){A(M(o.prototype),"_getInnerHeight",this).call(this);var e=this.app.dimensions.maxHeight-this.app.dimensions.padding.height,t=this.app.dimensions.defaultPage.viewPort,i=this.app.dimensions.containerWidth-20-this.app.dimensions.padding.width;this.app.pageScaling===p.PAGE_SCALE.ACTUAL&&(i=1*this.app.provider.defaultPage.viewPort.width);var n=e;return this.app.pageScaling===p.PAGE_SCALE.PAGE_WIDTH?n=100*t.height:this.app.pageScaling===p.PAGE_SCALE.AUTO?n=1.5*t.height:this.app.pageScaling===p.PAGE_SCALE.ACTUAL&&(n=1*t.height),n-=2,this._containCover=F.contain(t.width,t.height,i,n),n=Math.min(e,this._containCover.height+2),this.app.pageScaleValue=this._containCover.height/t.height,this.app.dimensions.isFixedHeight?e:n}},{key:"handleZoom",value:function(){var e=this.app,t=this.maxZoom=4,i=e.zoomValue;!0===e.pendingZoom&&null!=e.zoomDelta?i=e.zoomDelta>0?i*e.options.zoomRatio:i/e.options.zoomRatio:null!=this.lastScale&&(i*=this.lastScale,this.lastScale=null),i=F.limitAt(i,this.minZoom,t),e.zoomValueChange=i/e.zoomValue,e.zoomChanged=e.zoomValue!==i,e.zoomValue=i}},{key:"resize",value:function(){var e=this.app;e.dimensions;var t=e.dimensions.padding,i=this.shiftHeight=0;this.element.css({top:-i,bottom:-i,right:-0,left:-0,paddingTop:t.top,paddingRight:t.right,paddingBottom:t.bottom,paddingLeft:t.left});for(var n=this.getVisiblePages().main[0]-1,o=(n=this.pages[n].element[0]).getBoundingClientRect(),s=this.parentElement[0].getBoundingClientRect(),a=0;a<this.pages.length;a++){var r=this.pages[a],l=this.getViewPort(a+1,!0),h=r.element[0].style;h.height=Math.floor(l.height*e.pageScaleValue*e.zoomValue)+"px",h.width=Math.floor(l.width*e.pageScaleValue*e.zoomValue)+"px"}if(this.oldScrollHeight!=this.element[0].scrollHeight&&void 0!==this.oldScrollHeight){var u,p=this.element[0].scrollHeight/this.oldScrollHeight;this.skipScrollCheck=!0;var c=n.offsetTop+n.clientTop-(o.top-s.top+n.clientTop)*p,d=n.offsetLeft+n.clientLeft-(o.left-s.left+n.clientLeft)*p;c+=(p-1)*10/2,d+=(p-1)*10/2,this.zoomCenter=null!==(u=this.zoomCenter)&&void 0!==u?u:{x:0,y:0},c+=(p-1)*this.zoomCenter.y,d+=(p-1)*this.zoomCenter.x,this.zoomCenter=null,this.element[0].scrollTop=c,this.element[0].scrollLeft=d,this.skipScrollCheck=!1}this.oldScrollHeight=this.element[0].scrollHeight,this.scrollBar[0].style.transform="none",this.updateScrollBar()}},{key:"onReady",value:function(){this.gotoPageCallBack(),this.oldScrollHeight=this.element[0].scrollHeight}},{key:"refresh",value:function(){for(var e=this.app,t=this.getVisiblePages().main,i=0;i<t.length;i++){var n=void 0,o=t[i];n=this.pages[o-1],o!==n.pageNumber&&(n.resetTexture(),this.app.textureRequestStatus=p.REQUEST_STATUS.ON),n.element.attr("number",o),n.pageNumber=o}this.requestRefresh(!1),e.textureRequestStatus=p.REQUEST_STATUS.ON}},{key:"isAnimating",value:function(){return this.scrollStatus===p.REQUEST_STATUS.ON||this.scrollStatus===p.REQUEST_STATUS.COUNT}},{key:"checkRequestQueue",value:function(){A(M(o.prototype),"checkRequestQueue",this).call(this),this.scrollStatus===p.REQUEST_STATUS.ON&&(this.scrollStatus=p.REQUEST_STATUS.OFF),this.scrollStatus===p.REQUEST_STATUS.COUNT&&(this.scrollStatus=p.REQUEST_STATUS.ON)}},{key:"isActivePage",value:function(e){return void 0!==this.visiblePagesCache&&this.visiblePagesCache.includes(e)}},{key:"getVisiblePages",value:function(){var e=F.getVisibleElements({container:this.element[0],elements:this.wrapper[0].children});return e=0===e.length?[this.app.currentPageNumber]:e.splice(0,this.pageBufferSize),this.visiblePagesCache=e,{main:e,buffer:[]}}},{key:"getPageByNumber",value:function(e){var t=this.pages[e-1];return void 0===t&&F.log("Page Not found for: "+e),t}},{key:"onScroll",value:function(e){for(var t=this.element[0].scrollTop+this.app.dimensions.containerHeight/2,i=this.getVisiblePages().main,n=i[0],o=0;o<i.length;o++){n=i[o];var s=this.pages[n-1].element[0],a=s.offsetTop+s.clientTop;if(a<=t&&s.clientHeight+a>=t)break;if(o>0&&a>t&&s.clientHeight+a>=t){n=i[o-1];break}}this.skipScrollIntoView=!0,this.app.gotoPage(n),this.skipScrollIntoView=!1,this.updateScrollBar(),e.preventDefault&&e.preventDefault(),e.stopPropagation(),this.requestRefresh(),this.scrollStatus=p.REQUEST_STATUS.COUNT,p.handlePopup(this.element,!1)}},{key:"updateScrollBar",value:function(){var e=this.element[0];this.app.container[0],e.scrollLeft;var t=60+(e.offsetHeight-40-60-60)*e.scrollTop/(e.scrollHeight-e.offsetHeight);isNaN(t)&&(t=60),this.scrollBar.lastY=t,this.scrollBar[0].style.transform="translateY("+t+"px)"}},{key:"validatePageChange",value:function(e){}},{key:"gotoPageCallBack",value:function(){if(!0!==this.skipScrollIntoView){var e=this.getPageByNumber(this.app.currentPageNumber);null!=e&&F.scrollIntoView(e.element[0],this.element[0])}this.skipScrollIntoView=!1,this.requestRefresh()}},{key:"getTextureSize",value:function(e){var t=this.app.provider.viewPorts[1];this.app.provider.viewPorts[e.pageNumber]&&(t=this.app.provider.viewPorts[e.pageNumber]);var i=this.app.options.pixelRatio;return{height:t.height*this.app.zoomValue*this.app.pageScaleValue*i,width:t.width*this.app.zoomValue*this.app.pageScaleValue*i}}},{key:"textureLoadedCallback",value:function(e){var t=this.getPageByNumber(e.pageNumber),i=this.app,n=this.getViewPort(e.pageNumber,!0);t.element.height(Math.floor(n.height*i.pageScaleValue*i.zoomValue)).width(Math.floor(n.width*i.pageScaleValue*i.zoomValue)),this.pagesReady()}},{key:"pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.startPoint,n=e.raw.y-i.raw.y,o=e.raw.x-i.raw.x;this.deltaPanY+=n,this.deltaPanX+=o,this.panRequestStatus=p.REQUEST_STATUS.ON,!1===t&&(this.startPoint=e)}},{key:"updatePan",value:function(){this.element[0].scrollTop=this.element[0].scrollTop-this.deltaPanY,this.element[0].scrollLeft=this.element[0].scrollLeft-this.deltaPanX,this.deltaPanY=0,this.deltaPanX=0}},{key:"mouseMove",value:function(e){if(this.startPoint&&this.isScrollBarPressed){var t=F.fixMouseEvent(e),i=this.eventToPoint(t),n=this.element[0],s=this.scrollBar.lastY-(this.startPoint.raw.y-i.raw.y);this.scrollBar.lastY=s,n.scrollTop=(s-60)*(n.scrollHeight-n.offsetHeight)/(n.offsetHeight-40-60-60),this.startPoint=i,e.preventDefault();return}e.touches&&e.touches.length<2||A(M(o.prototype),"mouseMove",this).call(this,e)}},{key:"mouseDown",value:function(e){A(M(o.prototype),"mouseDown",this).call(this,e),e.srcElement===this.scrollBar[0]&&(this.isScrollBarPressed=!0,this.scrollBar.addClass("df-active"),this.scrollPageNumber.addClass("df-active"))}},{key:"mouseUp",value:function(e){A(M(o.prototype),"mouseUp",this).call(this,e),(this.isScrollBarPressed=this.scrollBar)&&(this.isScrollBarPressed=!1,this.scrollBar.removeClass("df-active"),this.scrollPageNumber.removeClass("df-active"))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(o.prototype,i),o}(x);function H(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function U(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function V(e,t,i){return t&&U(e.prototype,t),i&&U(e,i),e}function W(e,t,i){return(W="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=j(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=j(e);return i=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}}var K=p.jQuery,X=p.utils,Q=/*#__PURE__*/function(e){q(i,e);var t=Z(i);function i(e,n){var o,s;return H(this,i),e.viewerClass="df-flipbook "+(e.viewerClass||""),(o=t.call(this,e,n)).isFlipBook=!0,o.sheets=[],o.isRTL=o.app.isRTL,o.foldSense=o.isVertical()?0:50,o.isOneSided=!1,o.stackCount=null!==(s=e.stackCount)&&void 0!==s?s:6,o.annotedPage=null,o.pendingAnnotations=[],o.seamPositionX=0,o.seamPositionY=0,o.dragSheet=null,o.drag=null,o.soundOn=!0===e.enableSound,o.soundFile=null,o.minZoom=1,o.maxZoom=4,o.pureMaxZoom=4,(o.app.options.pageSize===p.FLIPBOOK_PAGE_SIZE.AUTO||o.app.options.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL)&&(o.app.checkSecondPage=!0),o.app.pageScaling=p.PAGE_SCALE.PAGE_FIT,e.viewerClass="",o.zoomViewer=new J(e,n),o}return V(i,[{key:"init",value:function(){W(j(i.prototype),"init",this).call(this),this.initSound();var e=this.app;this.pageMode=e.options.pageMode===p.FLIPBOOK_PAGE_MODE.AUTO?X.isMobile||e.pageCount<=2?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE:e.options.pageMode,this.singlePageMode=e.options.singlePageMode||(X.isMobile?p.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET:p.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM),this.updatePageMode(),this.rightSheetHeight=this.leftSheetHeight=this._defaultPageSize.height,this.leftSheetWidth=this.rightSheetWidth=this._defaultPageSize.width,this.leftSheetTop=this.rightSheetTop=(this.availablePageHeight()-this._defaultPageSize.height)/2,this.topSheetLeft=this.bottomSheetLeft=(this.availablePageWidth()-this._defaultPageSize.width)/2,this.zoomViewer.rightSheetHeight=this.zoomViewer.leftSheetHeight=this._defaultPageSize.height,this.zoomViewer.leftSheetWidth=this.zoomViewer.rightSheetWidth=this._defaultPageSize.width}},{key:"determineHeight",value:function(){}},{key:"initCustomControls",value:function(){W(j(i.prototype),"initCustomControls",this).call(this);var e=this,t=this.app,n=t.ui,o=n.controls,s=t.options.text,a=t.options.icons;o.sound=X.createBtn("sound",a.sound,s.toggleSound).on("click",function(){e.soundOn=!e.soundOn,n.updateSound()}),n.updateSound=function(){!1===e.soundOn?o.sound.addClass("disabled"):o.sound.removeClass("disabled")},n.updateSound()}},{key:"dispose",value:function(){W(j(i.prototype),"dispose",this).call(this);for(var e=0;e<this.sheets.length;e++){var t=this.sheets[e];t&&t.currentTween&&(t.currentTween.stop(),t.currentTween=null)}this.zoomViewer.dispose(),this.soundFile=null}},{key:"determinePageMode",value:function(){var e=this.app,t=this.pageMode;if(this.app.pageCount<3)this.pageMode=p.FLIPBOOK_PAGE_MODE.SINGLE;else if(this.app.options.pageMode===p.FLIPBOOK_PAGE_MODE.AUTO&&!0!=this.pageModeChangedManually){if(!0===X.isMobile){if(this.app.dimensions.isAutoHeight&&!1==this.app.dimensions.isFixedHeight){var i=this._calculateInnerHeight(!0),n=this._calculateInnerHeight(!1),o=e.dimensions.stage.innerWidth+(!0!=e.options.sideMenuOverlay&&e.isSideMenuOpen?220:0);this.pageMode=i>1.1*n&&o<768?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE,this._calculateInnerHeight()}else{var s=e.dimensions.stage.innerWidth+(!0!=e.options.sideMenuOverlay&&e.isSideMenuOpen?220:0);this.pageMode=e.dimensions.stage.innerHeight>1.1*s&&s<768?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE}}this.pageMode!=t&&this.setPageMode({isSingle:this.pageMode==p.FLIPBOOK_PAGE_MODE.SINGLE})}}},{key:"initSound",value:function(){this.soundFile=document.createElement("audio"),this.soundFile.setAttribute("src",this.app.options.soundFile+"?ver="+p.version),this.soundFile.setAttribute("type","audio/mpeg")}},{key:"playSound",value:function(){try{!0===this.app.userHasInteracted&&!0===this.soundOn&&(this.soundFile.currentTime=0,this.soundFile.play())}catch(e){}}},{key:"checkDocumentPageSizes",value:function(){var e=this.app.provider;e.pageSize===p.FLIPBOOK_PAGE_SIZE.AUTO&&(e._page2Ratio&&e._page2Ratio>1.5*e.defaultPage.pageRatio?e.pageSize=p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL:e.pageSize=p.FLIPBOOK_PAGE_SIZE.SINGLE),e.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL&&(e.pageCount=1===e.numPages?1:2*e.numPages-2),(e.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK||e.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE)&&(e.pageCount=2*e.numPages)}},{key:"getViewerPageNumber",value:function(e){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL&&e>2&&(e=2*e-1),this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK&&e>2&&(e=2*e-1),e}},{key:"getDocumentPageNumber",value:function(e){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL&&e>2?Math.ceil((e-1)/2)+1:this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK&&e>1?e===this.app.pageCount?1:Math.ceil((e-1)/2)+1:e}},{key:"getViewPort",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return this.filterViewPort(W(j(i.prototype),"getViewPort",this).call(this,e,t),e,n)}},{key:"isDoubleInternal",value:function(){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL}},{key:"isDoubleCoverBack",value:function(){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK}},{key:"isDoubleInternalPage",value:function(e){return this.isDoubleInternal()&&e>1&&e<this.app.provider.pageCount}},{key:"getDoublePageWidthFix",value:function(e){return this.isDoubleInternalPage(e)||this.isDoubleCoverBack()?2:1}},{key:"isDoublePageFix",value:function(e){var t=!1;return(this.isDoubleCoverBack()||this.isDoubleInternalPage(e))&&(this.app.isRTL?e%2==0&&(t=!0):e%2==1&&(t=!0)),t}},{key:"finalizeAnnotations",value:function(e,t){}},{key:"finalizeTextContent",value:function(e,t){this.app.zoomValue>this.app.viewer.pureMaxZoom&&(this.zoomViewer.leftViewPort&&this.zoomViewer.leftPage.contentLayer[0].style.setProperty("--scale-factor",this.zoomViewer.leftSheetHeight/this.zoomViewer.leftViewPort.height),this.zoomViewer.rightViewPort&&this.zoomViewer.rightPage.contentLayer[0].style.setProperty("--scale-factor",this.zoomViewer.rightSheetHeight/this.zoomViewer.rightViewPort.height))}},{key:"isActivePage",value:function(e){return void 0!==this.visiblePagesCache&&this.visiblePagesCache.includes(e)}},{key:"isSheetCover",value:function(e){var t=this.isBooklet;return 0===e||t&&1===e||e===Math.ceil(this.app.pageCount/(t?1:2))-(t?0:1)}},{key:"isSheetHard",value:function(e){var t=this.app.options.flipbookHardPages;if(this.isBooklet,"cover"===t)return this.isSheetCover(e);if("all"===t)return!0;var i=(","+t+",").indexOf(","+(2*e+1)+",")>-1,n=(","+t+",").indexOf(","+(2*e+2)+",")>-1;return i||n}},{key:"sheetsIndexShift",value:function(e,t,i){e>t?(this.sheets[i-1].skipFlip=!0,this.sheets.unshift(this.sheets.pop())):e<t&&(this.sheets[0].skipFlip=!0,this.sheets.push(this.sheets.shift()))}},{key:"checkSwipe",value:function(e,t){if(!0!==this.pinchZoomDirty&&1===this.app.zoomValue&&!0===this.canSwipe){var i=this.isVertical()?e.y-this.lastPosY:e.x-this.lastPosX;null!=t.touches&&this.isVertical()&&i>5&&t.preventDefault(),Math.abs(i)>this.swipeThreshold&&(i<0?this.app.openRight():this.app.openLeft(),this.canSwipe=!1,t.preventDefault()),this.lastPosX=e.x,this.lastPosY=e.y}}},{key:"checkCenter",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.app,n=p.FLIPBOOK_CENTER_SHIFT,o=i.currentPageNumber%2==0,s=this.getBasePage(),a=this.isRTL,r=this.isSingle;e=0===s||this.isBooklet?this.isRTL?n.RIGHT:n.LEFT:s===i.pageCount?a?n.LEFT:n.RIGHT:r?a?o?n.LEFT:n.RIGHT:o?n.RIGHT:n.LEFT:n.NONE,!0!==this.centerNeedsUpdate&&(this.centerNeedsUpdate=this.centerShift!==e),this.centerNeedsUpdate&&(this.centerShift=e,this.updateCenter(t),this.centerNeedsUpdate=!1)}},{key:"updateCenter",value:function(){console.log("UpdateCenter: missing implementation.")}},{key:"reset",value:function(){for(var e,t=0;t<this.sheets.length;t++)(e=this.sheets[t]).reset(),e.pageNumber=-1,e.frontPage&&(e.frontPage.pageNumber=-1),e.backPage&&(e.backPage.pageNumber=-1),e.resetTexture();this.annotedPage=null,this.oldBasePageNumber=-1,this.centerShift=null,this.refresh()}},{key:"handleZoom",value:function(){var e=this.app;e.dimensions;var t=this.getLeftPageTextureSize({zoom:!1,isAnnotation:!0}),i=this.getRightPageTextureSize({zoom:!1,isAnnotation:!0});this.maxZoom,e.zoomValue,this.pureMaxZoom=e.dimensions.maxTextureSize/Math.max(t.height,t.width,i.height,i.width);var n=this.maxZoom=e.options.fakeZoom*this.pureMaxZoom,o=e.zoomValue,s=!1,a=!1;n<this.minZoom&&(n=this.maxZoom=this.minZoom),!0===e.pendingZoom&&null!=e.zoomDelta?o=e.zoomDelta>0?o*e.options.zoomRatio:o/e.options.zoomRatio:null!=this.lastScale&&(o*=this.lastScale,this.lastScale=null),o=X.limitAt(o,this.minZoom,n),e.zoomValueChange=o/e.zoomValue,(e.zoomChanged=e.zoomValue!==o)&&(1===o||1===e.zoomValue)&&(s=1===o,a=1===e.zoomValue),e.zoomValue=o,(a||s)&&(e.container.toggleClass("df-zoom-active",1!==o),a&&this.enterZoom(),s&&this.exitZoom())}},{key:"refresh",value:function(){var e=this.app,t=this.stackCount,i=this.isRTL,n=this.isBooklet,o=this.getBasePage(),s=n?1:2;i&&(o=e.pageCount-o);var a,r=this.oldBasePageNumber,l=Math.ceil(e.pageCount/s),h=Math.floor(t/2);o!==this.oldBasePageNumber&&(this.pageNumberChanged=!0,this.updatePendingStatusClass(!0),this.zoomViewer.reset()),this.sheetsIndexShift(r,o,t);var u=Math.ceil(o/s);for(a=0;a<t;a++){var c=void 0,d=u-h+a;if(i&&(d=l-d-1),null!=(c=this.sheets[a])){c.targetSide=a<h?p.TURN_DIRECTION.LEFT:p.TURN_DIRECTION.RIGHT;var f=c.side!==c.targetSide,g=d!==c.pageNumber,m=f&&!1===c.skipFlip&&1===e.zoomValue;!f&&g&&c.isFlipping&&c.currentTween&&c.currentTween.stop(),c.isHard=this.isSheetHard(d),c.isCover=this.isSheetCover(d),g&&(c.resetTexture(),(this.app.isRTL?c.backPage:c.frontPage).pageNumber=this.isBooklet?d:2*d+1,(this.app.isRTL?c.frontPage:c.backPage).pageNumber=this.isBooklet?-1:2*d+2,e.textureRequestStatus=p.REQUEST_STATUS.ON),c.pageNumber=d,this.refreshSheet({sheet:c,sheetNumber:d,totalSheets:l,zIndex:this.stackCount+(a<h?a-h:h-a),visible:n?i?a<h||c.isFlipping||m:a>=h||c.isFlipping||m:d>=0&&d<l||n&&d===l,index:a,needsFlip:m,midPoint:h})}}this.requestRefresh(!1),e.textureRequestStatus=p.REQUEST_STATUS.ON,this.oldBasePageNumber=o,this.checkCenter(),this.zoomViewer.refresh(),this.pageNumberChanged=!1}},{key:"validatePageChange",value:function(e){if(e===this.app.currentPageNumber)return!1;var t=this.app,i=!this.isFlipping()||void 0===t.oldPageNumber;return(i=i||t.currentPageNumber<e&&t.oldPageNumber<t.currentPageNumber)||t.currentPageNumber>e&&t.oldPageNumber>t.currentPageNumber}},{key:"getVisiblePages",value:function(){for(var e=[],t=this.getBasePage(),i=this.app.zoomValue>1?1:this.isBooklet&&X.isMobile?Math.min(this.stackCount/2,2):this.stackCount/2,n=0;n<i;n++)e.push(t-n),e.push(t+n+1);return this.visiblePagesCache=e,{main:e,buffer:[]}}},{key:"getBasePage",value:function(e){return(void 0===e&&(e=this.app.currentPageNumber),this.isBooklet)?e:2*Math.floor(e/2)}},{key:"getRightPageNumber",value:function(){return this.getBasePage()+(this.isBooklet?0:this.isRTL?0:1)}},{key:"getLeftPageNumber",value:function(){return this.getBasePage()+(this.isBooklet?0:this.isRTL?1:0)}},{key:"afterFlip",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],!0!==this.isAnimating()&&(this.pagesReady(),this.updatePendingStatusClass())}},{key:"isFlipping",value:function(){var e=!1;return this.sheets.forEach(function(t){!0===t.isFlipping&&(e=!0)}),e}},{key:"isAnimating",value:function(){return this.isFlipping()}},{key:"mouseWheel",value:function(e){this.app.options.mouseScrollAction===p.MOUSE_SCROLL_ACTIONS.ZOOM?this.zoomViewer.mouseWheel(e):W(j(i.prototype),"mouseWheel",this).call(this,e)}},{key:"checkRequestQueue",value:function(){this.app.zoomValue>1?this.zoomViewer.checkRequestQueue():W(j(i.prototype),"checkRequestQueue",this).call(this)}},{key:"updatePan",value:function(){}},{key:"resetPageTween",value:function(){}},{key:"gotoPageCallBack",value:function(){this.resetPageTween(),1!==this.app.zoomValue&&!0===this.app.options.resetZoomBeforeFlip&&this.app.resetZoom(),this.beforeFlip(),this.requestRefresh()}},{key:"beforeFlip",value:function(){this.app.executeCallback("beforeFlip"),1===this.app.zoomValue&&this.getBasePage()!==this.oldBasePageNumber&&this.playSound()}},{key:"onFlip",value:function(){this.app.executeCallback("onFlip")}},{key:"getAnnotationElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=void 0;return(o=this.app.zoomValue>1||!0===n?this.zoomViewer.getAnnotationElement(e,t):W(j(i.prototype),"getAnnotationElement",this).call(this,e,t))&&(o.parentNode.classList.toggle("df-double-internal",this.isDoubleInternalPage(e)),o.parentNode.classList.toggle("df-double-internal-fix",this.isDoublePageFix(e))),o}},{key:"getTextElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.app.zoomValue>1||!0===n?this.zoomViewer.getTextElement(e,t):W(j(i.prototype),"getTextElement",this).call(this,e,t)}},{key:"enterZoom",value:function(){this.exchangeTexture(this,this.zoomViewer)}},{key:"exitZoom",value:function(){this.exchangeTexture(this.zoomViewer,this)}},{key:"exchangeTexture",value:function(e,t){var i=this.getBasePage(),n=e.getPageByNumber(i),o=t.getPageByNumber(i);if(o&&"-1"===o.textureStamp?(o.textureStamp=n.textureStamp,o.loadTexture({texture:n.getTexture(!0)}),X.log("Texture Exchanging at "+i)):X.log("Texture Exchanging Bypassed at "+i),!this.isBooklet){var s=e.getPageByNumber(i+1),a=t.getPageByNumber(i+1);a&&"-1"===a.textureStamp?(a.textureStamp=s.textureStamp,a.loadTexture({texture:s.getTexture(!0)}),X.log("Texture Exchanging at "+(i+1))):X.log("Texture Exchanging Bypassed at "+(i+1))}t.pagesReady()}},{key:"setPageMode",value:function(e){var t=this.app,i=!0===e.isSingle;this.pageMode=i?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE,this.updatePageMode(),t.resizeRequestStart()}},{key:"updatePageMode",value:function(){var e=this.app;this.app.pageCount<3&&(this.pageMode=p.FLIPBOOK_PAGE_MODE.SINGLE),this.isSingle=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE,this.isBooklet=this.isSingle&&this.singlePageMode===p.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET,this.app.jumpStep=this.isSingle?1:2,this.totalSheets=Math.ceil(this.app.pageCount/(this.isBooklet?1:2)),this.sheets.length>0&&this.reset(),e.ui.controls.pageMode&&(e.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.DOUBLE?e.ui.controls.pageMode.removeClass(e.options.icons.doublepage).addClass(e.options.icons.singlepage).attr("title",e.options.text.singlePageMode).html("<span>"+e.options.text.singlePageMode+"</span>"):e.ui.controls.pageMode.addClass(e.options.icons.doublepage).removeClass(e.options.icons.singlepage).attr("title",e.options.text.doublePageMode).html("<span>"+e.options.text.doublePageMode+"</span>"))}},{key:"setPage",value:function(e){return e.textureTarget===p.TEXTURE_TARGET.ZOOM?this.zoomViewer.setPage(e):W(j(i.prototype),"setPage",this).call(this,e)}},{key:"_calculateInnerHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e&&(e=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE);var t=this.app.dimensions.defaultPage.viewPort,i=this.availablePageWidth(!1,!0,e),n=this.app.dimensions.maxHeight-this.app.dimensions.padding.height,o=this.isVertical()&&!1==e?n/2:n;this._defaultPageSize=X.contain(t.width,t.height,i,o),this._pageFitArea={width:i,height:n};var s=this.app.dimensions.isFixedHeight?n:this._pageFitArea.height;return this.app.dimensions.isAutoHeight&&!1==this.app.dimensions.isFixedHeight&&(s=Math.floor(this._defaultPageSize.height)),s}},{key:"_getInnerHeight",value:function(){var e=this._calculateInnerHeight();return this.app.dimensions.stage.width=this.app.dimensions.stage.innerWidth+this.app.dimensions.padding.width,this.app.dimensions.stage.height=e+this.app.dimensions.padding.height,e}},{key:"availablePageWidth",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0===i&&(i=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE);var n=!0===t?this.app.dimensions.offset.width:0,o=this.app.dimensions.stage.innerWidth+n;return Math.floor((o/=!0===i||this.isVertical()?1:2)*(e?this.app.zoomValue:1))}},{key:"availablePageHeight",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;void 0===t&&(t=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE);var i=this.app.dimensions.stage.innerHeight;return!1===t&&this.isVertical()&&(i/=2),Math.floor(i*(e?this.app.zoomValue:1))}},{key:"getTextureSize",value:function(e){var t=this.getViewPort(e.pageNumber,!0),i=this.app.options.pixelRatio,n=!1===e.isRestricted?99999:this.app.options.maxTextureSize,o=X.contain(t.width,t.height,Math.min(i*this.availablePageWidth(e.zoom),n),Math.min(i*this.availablePageHeight(e.zoom),n));return{height:o.height,width:o.width}}},{key:"getLeftPageTextureSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.pageNumber=this.getLeftPageNumber(),this.getTextureSize(e)}},{key:"getRightPageTextureSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.pageNumber=this.getRightPageNumber(),this.getTextureSize(e)}},{key:"filterViewPort",value:function(e,t){var i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(void 0!==e){if(!0!=i)return e;var n=e.clone();return n.width=n.width/this.getDoublePageWidthFix(t),n}}},{key:"filterViewPortCanvas",value:function(e,t,i){this.isDoublePageFix(i)&&(e.transform[4]=e.transform[4]-Math.floor(Math.min(t.width,2*e.width-t.width))),e.widthFix=this.isDoubleInternalPage(i)?2:1}},{key:"isClosedPage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),1===e||e===this.app.jumpStep*Math.ceil(this.app.pageCount/this.app.jumpStep)&&!this.isBooklet}},{key:"isLeftPage",value:function(e){return(void 0===e&&(e=this.app.currentPageNumber),this.isBooklet)?this.isRTL:e%2==(this.isRTL?1:0)}},{key:"cleanPage",value:function(e){if(!this.isDoubleInternalPage(e))return W(j(i.prototype),"cleanPage",this).call(this,e);var t=e+(e%2==1?-1:1);return!1===this.app.provider.requestedPages[e]&&!1===this.app.provider.requestedPages[t]}},{key:"onReady",value:function(){W(j(i.prototype),"onReady",this).call(this)}},{key:"searchPage",value:function(e){return{include:!this.isDoublePageFix(e),label:this.app.provider.getLabelforPage(e)+(this.isDoubleInternalPage(e)?"-"+this.app.provider.getLabelforPage(e+1):"")}}},{key:"isVertical",value:function(){return!1}}]),i}(x),Y=/*#__PURE__*/function(e){q(i,e);var t=Z(i);function i(e){var n;return H(this,i),(n=t.call(this)).zoomStamp="",n.pendingZoomScale=1,n}return V(i,[{key:"resetZoomTexture",value:function(){this.zoomElement&&this.zoomElement.html(""),this.zoomStamp=""}},{key:"resetTexture",value:function(){W(j(i.prototype),"resetTexture",this).call(this),this.resetZoomTexture()}}]),i}(_),J=/*#__PURE__*/function(e){q(i,e);var t=Z(i);function i(e,n){var o;return H(this,i),e.viewerClass="df-zoomview "+(e.viewerClass||""),(o=t.call(this,e,n)).viewer=o.app.viewer,o.events={},o.init(),o.initEvents(),o.left=0,o.top=0,o.zoomUpdateCount=0,o}return V(i,[{key:"init",value:function(){this.leftPage=new Y,this.rightPage=new Y,this.pages.push(this.leftPage),this.pages.push(this.rightPage),this.leftPage.element.addClass("df-page-back"),this.rightPage.element.addClass("df-page-front"),this.wrapper.append(this.leftPage.element),this.wrapper.append(this.rightPage.element),this.bookShadow=K("<div>",{class:"df-book-shadow"}),this.wrapper.append(this.bookShadow),this.wrapper.addClass("df-sheet")}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],W(j(i.prototype),"initEvents",this).call(this)}},{key:"dispose",value:function(){this.element.remove()}},{key:"resize",value:function(){var e=this.app.dimensions,t=e.padding,i=this.app.viewer.availablePageHeight(),n=this.app.viewer.availablePageWidth(),o=this.fullWidth=n*(this.app.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE||this.app.viewer.isVertical()?1:2),s=this.fullHeight=i*(this.app.viewer.isVertical()&&this.app.viewer.pageMode!==p.FLIPBOOK_PAGE_MODE.SINGLE?2:1),a=e.stage.innerWidth,r=e.stage.innerHeight,l=this.shiftHeight=Math.ceil(X.limitAt((s-r)/2,0,s)),h=this.shiftWidth=Math.ceil(X.limitAt((o-a)/2,0,o));if(1===this.app.zoomValue&&(this.left=0,this.top=0),this.element.css({top:-l,bottom:-l,right:-h,left:-h,paddingTop:t.top,paddingRight:t.right,paddingBottom:t.bottom,paddingLeft:t.left,transform:"translate3d("+this.left+"px,"+this.top+"px,0)"}),this.wrapper.css({width:o,height:s,marginTop:e.height-s-t.height>0?(e.height-t.height-s)/2:0}),this.wrapper.height(s).width(o-o%2),!0===this.app.pendingZoom&&this.zoom(),this.app.viewer.annotedPage=null,this.pagesReady(),!0===this.app.options.progressiveZoom){if(this.app.zoomValue>this.app.viewer.pureMaxZoom){if(this.startZoomUpdateRequest(),this.leftPage.zoomElement&&""!=this.leftPage.zoomStamp){var u=this.leftPage.zoomIntersection,c=this.leftSheetHeight/this.leftPage.zoomParentHeight;this.leftPage.zoomElement.css({left:u.left*c,top:u.top*c,width:u.width*c,height:u.height*c}),console.log("Left:"+c+":"+this.leftPage.zoomElement[0].style.cssText)}if(this.rightPage.zoomElement&&""!=this.rightPage.zoomStamp){var d=this.rightPage.zoomIntersection,f=this.rightSheetHeight/this.rightPage.zoomParentHeight;this.rightPage.zoomElement.css({left:d.left*f,top:d.top*f,width:d.width*f,height:d.height*f}),console.log("Right:"+f+":"+this.rightPage.zoomElement[0].style.cssText)}}else this.leftPage.resetZoomTexture(),this.rightPage.resetZoomTexture()}}},{key:"zoom",value:function(){var e=this.app;if(e.zoomChanged){var t=e.dimensions.origin,i=e.zoomValueChange;if(1===e.zoomValue)this.left=0,this.top=0;else{this.left*=i,this.top*=i,e.viewer.zoomCenter||(e.viewer.zoomCenter={x:t.x,y:t.y});var n={raw:e.viewer.zoomCenter},o={raw:{}},s=(n.raw.x-t.x)*i,a=(n.raw.y-t.y)*i;o.raw.x=t.x+s,o.raw.y=t.y+a,this.startPoint=o,this.pan(n),this.startPoint=null,e.container.toggleClass("df-zoom-region-active",this.app.zoomValue>this.app.viewer.pureMaxZoom)}}e.viewer.zoomCenter=null}},{key:"reset",value:function(){this.leftPage.resetTexture(),this.rightPage.resetTexture()}},{key:"refresh",value:function(){var e=this.app,t=e.viewer,i=t.getBasePage(),n=t.isBooklet?!e.isRTL:e.isRTL,o=n?this.rightPage:this.leftPage,s=n?this.leftPage:this.rightPage;o.pageNumber=i,s.pageNumber=i+1,o.updateCSS({display:0===i?"none":"block"}),s.updateCSS({display:s.pageNumber>e.pageCount||t.isBooklet?"none":"block"})}},{key:"updateCenter",value:function(){var e=this.app.viewer.isVertical();if(null!==this&&null!==this.app.viewer){var t=1*this.app.viewer.centerShift*(this.app.viewer.isRTL,this.app.viewer.isLeftPage()?e?this.leftSheetHeight:this.leftSheetWidth:e?this.rightSheetHeight:this.rightSheetWidth)/2;e?this.wrapper[0].style.top=t+"px":this.wrapper[0].style.left=t+"px"}}},{key:"isDoubleInternalPage",value:function(e){return this.app.viewer.isDoubleInternalPage(e)}},{key:"pagesReady",value:function(){if(!this.app.viewer.isFlipping()&&(1!==this.app.zoomValue&&this.app.viewer.updatePendingStatusClass(!1),!1===this.app.options.flipbookFitPages)){var e=this.app.viewer.getBasePage(),t=this.leftViewPort=this.app.viewer.getViewPort(e+(this.app.viewer.isBooklet?0:this.app.viewer.isRTL?1:0)),i=this.rightViewPort=this.app.viewer.getViewPort(e+(this.app.viewer.isBooklet?0:this.app.viewer.isRTL?0:1));if(t){var n=X.contain(t.width,t.height,this.app.viewer.availablePageWidth(),this.app.viewer.availablePageHeight());this.leftSheetWidth=Math.floor(n.width),this.leftSheetHeight=Math.floor(n.height),this.leftSheetTop=(this.app.viewer.availablePageHeight()-this.leftSheetHeight)/2,this.topSheetLeft=(this.app.viewer.availablePageWidth()-this.leftSheetWidth)/2,this.app.zoomValue>this.app.viewer.pureMaxZoom&&this.leftPage.contentLayer[0].style.setProperty("--scale-factor",this.leftSheetHeight/t.height)}if(i){var o=X.contain(i.width,i.height,this.app.viewer.availablePageWidth(),this.app.viewer.availablePageHeight());this.rightSheetWidth=Math.floor(o.width),this.rightSheetHeight=Math.floor(o.height),this.rightSheetTop=(this.app.viewer.availablePageHeight()-this.rightSheetHeight)/2,this.bottomSheetLeft=(this.app.viewer.availablePageWidth()-this.rightSheetWidth)/2,this.app.zoomValue>this.app.viewer.pureMaxZoom&&this.rightPage.contentLayer[0].style.setProperty("--scale-factor",this.rightSheetHeight/i.height)}(void 0!=t||void 0!=i)&&(this.totalSheetsWidth=this.leftSheetWidth+this.rightSheetWidth,this.leftPage.element.height(Math.floor(this.leftSheetHeight)).width(Math.floor(this.leftSheetWidth)),this.rightPage.element.height(Math.floor(this.rightSheetHeight)).width(Math.floor(this.rightSheetWidth)),this.app.viewer.isVertical()?(this.leftPage.element.css({transform:"translateX("+Math.floor(this.topSheetLeft)+"px)"}),this.rightPage.element.css({transform:"translateX("+Math.floor(this.bottomSheetLeft)+"px)"})):(this.leftPage.element.css({transform:"translateY("+Math.floor(this.leftSheetTop)+"px)"}),this.rightPage.element.css({transform:"translateY("+Math.floor(this.rightSheetTop)+"px)"})))}}},{key:"textureLoadedCallback",value:function(e){this.getPageByNumber(e.pageNumber),this.pagesReady()}},{key:"mouseUp",value:function(e){W(j(i.prototype),"mouseUp",this).call(this,e),this.startZoomUpdateRequest()}},{key:"setPage",value:function(e){return this.app,this.app.viewer,W(j(i.prototype),"setPage",this).call(this,e)}},{key:"startZoomUpdateRequest",value:function(){this.zoomUpdateStatus=p.REQUEST_STATUS.COUNT}},{key:"checkRequestQueue",value:function(){W(j(i.prototype),"checkRequestQueue",this).call(this),!0===this.app.options.progressiveZoom&&(this.zoomUpdateStatus===p.REQUEST_STATUS.ON?(this.zoomUpdateStatus=p.REQUEST_STATUS.OFF,this.zoomUpdate()):this.zoomUpdateStatus===p.REQUEST_STATUS.COUNT&&(this.zoomUpdateCount++,this.zoomUpdateCount>3&&(this.zoomUpdateCount=0,this.zoomUpdateStatus=p.REQUEST_STATUS.ON)))}},{key:"zoomUpdate",value:function(){this.zoomUpdatePage({pageNumber:this.app.viewer.getRightPageNumber(),refHeight:this.rightSheetHeight}),this.zoomUpdatePage({pageNumber:this.app.viewer.getLeftPageNumber(),refHeight:this.leftSheetHeight})}},{key:"zoomUpdatePage",value:function(e){var t=this.app,i=this.app.options.pixelRatio,n=this.app.viewer,o="",s=this.getPageByNumber(e.pageNumber);if(void 0!==s){var a=X.elementIntersection(t.element,s.element,!0);if(t.zoomValue>n.pureMaxZoom&&a.width*a.height>0){if(!0===DEARFLIP.skipZoom)return;var r=s.pageNumber+"|"+JSON.stringify(a);if(s.zoomStamp==r){console.log("Rendered "+s.pageNumber+" Duplicate zoom request");return}s.zoomStamp=r;var l=t.viewer.getDocumentPageNumber(e.pageNumber),h=t.provider,u=e.pageNumber,p=performance.now();h.pdfDocument.getPage(l).then(function(n){s.element.offset(),e.isRestricted=!1;var c=t.viewer.getRenderContext(n,e);h.viewPorts[l],c.viewport=n.getViewport({scale:e.refHeight*i/h.viewPorts[l].height}),c.canvas.height=a.height*i,c.canvas.width=a.width*i,o=c.canvas.width+"x"+c.canvas.height+" - of("+c.viewport.width.toFixed(2)+"x"+c.viewport.height.toFixed(2)+")",console.log("Page "+u+" rendering - "+c.canvas.width+"x"+c.canvas.height),c.viewport.transform[4]-=a.left*i,c.viewport.transform[5]-=a.top*i,h.requestedPages+=","+e.trace+"["+l+"|"+c.canvas.height+"]",n.cleanupAfterRender=!1,n.render(c).promise.then(function(){var i=X.elementIntersection(t.element,s.element,!0);if(s.zoomStamp!==r){console.log("Faulty zoom texture detected");return}if(s.zoomStamp!==s.pageNumber+"|"+JSON.stringify(i)){console.log("Faulty zoom texture detected - instant");return}if(void 0===s.zoomElement&&(s.zoomElement=K("<div class='zoom-element'></div>"),s.element.append(s.zoomElement)),s.zoomElement.html(""),s.zoomElement.append(c.canvas),s.zoomElement.css({left:a.left,top:a.top,width:a.width,height:a.height}),s.zoomIntersection=a,s.zoomParentHeight=s.element.height(),!0===t.options.cleanupAfterRender){var d=","+e.trace+"["+l+"|"+c.canvas.height+"]";h.requestedPages.indexOf(d)>-1&&(h.requestedPages=h.requestedPages.replace(d,""),-1==h.requestedPages.indexOf("["+l+"|")&&(h.pagesToClean.push(n),h.pagesToClean.length>0&&h.cleanUpPages()))}c=null,console.log("Rendered "+u+" in "+Math.floor(performance.now()-p)+" ms:"+o+" for "+r)}).catch(function(e){console.log(e)})}).catch(function(e){console.log(e)})}}}}]),i}(x),$=/*#__PURE__*/function(){function e(t){H(this,e),this.parentElement=t.parentElement,this.isFlipping=!1,this.isOneSided=!1,this.viewer=t.viewer,this.frontPage=null,this.backPage=null,this.pageNumber=void 0,this.animateToReset=null}return V(e,[{key:"init",value:function(){}},{key:"flip",value:function(){}},{key:"frontImage",value:function(e){this.frontPage.loadTexture({texture:e.texture,callback:e.callback})}},{key:"backImage",value:function(e){this.backPage.loadTexture({texture:e.texture,callback:e.callback})}},{key:"resetTexture",value:function(){this.frontPage.resetTexture(),this.backPage.resetTexture()}},{key:"reset",value:function(){this.animateToReset=null,this.isFlipping=!1,this.currentTween=null,this.pendingPoint=null,this.magnetic=!1,this.skipFlip=!0,this.animateToReset=null,this.viewer.dragPage=null,this.viewer.flipPage=null,this.viewer.corner=p.TURN_CORNER.NONE}}]),e}();function ee(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function et(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ei(e,t,i){return t&&et(e.prototype,t),i&&et(e,i),e}function en(e,t,i){return(en="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eo(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function eo(e){return(eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function es(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ea(e,t)}function ea(e,t){return(ea=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function er(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=eo(e);return i=t?Reflect.construct(n,arguments,eo(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}}var el=p.jQuery,eh=p.utils,eu=/*#__PURE__*/function(e){es(i,e);var t=er(i);function i(e){var n;return ee(this,i),(n=t.call(this,e)).init(),n}return ei(i,[{key:"init",value:function(){var e="<div>",t=this.element=el(e,{class:"df-sheet"}),i=this.frontPage=new _;i.element.addClass("df-page-front");var n=this.backPage=new _;n.element.addClass("df-page-back");var o=this.wrapper=el(e,{class:"df-sheet-wrapper"}),s=this.foldInnerShadow=el(e,{class:"df-sheet-fold-inner-shadow"}),a=this.foldOuterShadow=el(e,{class:"df-sheet-fold-outer-shadow"});this.parentElement.append(t),t.append(o),t.append(a),o.append(i.element),o.append(n.element),o.append(s)}},{key:"updateCSS",value:function(e){this.element.css(e)}},{key:"resetCSS",value:function(){this.wrapper.css({transform:""}),this.frontPage.resetCSS(),this.backPage.resetCSS()}},{key:"updateSize",value:function(e,t,i,n){e=Math.floor(e),t=Math.floor(t),i=Math.floor(i),n=Math.floor(n),this.wrapper[0].style.height=this.wrapper[0].style.width=Math.ceil(eh.distOrigin(e,t)*this.viewer.app.zoomValue)+"px",this.element[0].style.height=this.frontPage.element[0].style.height=this.backPage.element[0].style.height=this.foldInnerShadow[0].style.height=t+"px",this.element[0].style.width=this.frontPage.element[0].style.width=this.backPage.element[0].style.width=this.foldInnerShadow[0].style.width=e+"px",this.viewer.isVertical()?this.element[0].style.transform="translateX("+n+"px)":this.element[0].style.transform="translateY("+i+"px)"}},{key:"flip",value:function(e){var t=this;if(e=e||t.pendingPoint,null!=t&&null!=t.viewer){t.isFlipping=!0,t.viewer.flipPage=t;var i,n,o=t.viewer.isBooklet,s=t.side===p.TURN_DIRECTION.RIGHT,a=t.viewer.isRTL,r=t.viewer.corner===p.TURN_CORNER.BL||t.viewer.corner===p.TURN_CORNER.BR?t.element.height():0,l=t.viewer.leftSheetWidth+t.viewer.rightSheetWidth,h=0;n=t.end=t&&!0===t.animateToReset?{x:s?l:0,y:r}:{x:s?0:l,y:r},t.flipEasing=t.isHard?TWEEN.Easing.Quadratic.InOut:TWEEN.Easing.Linear.None;var u=t.viewer.app.options.duration;!0===t.isHard?(null!=e&&(h=eh.angleByDistance(e.distance,e.fullWidth)),i=t.init={angle:h*(s?-1:1)},n=t.end=t&&!0===t.animateToReset?{angle:s?0:-0}:{angle:s?-180:180}):null==e?i=t.init=t&&!0===t.animateToReset?{x:s?0:l,y:0}:{x:s?l:0,y:0}:(i=t.init={x:e.x,y:e.y,opacity:1},u=t.viewer.app.options.duration*eh.distPoints(i.x,i.y,n.x,n.y)/t.viewer.fullWidth,u=eh.limitAt(u,t.viewer.app.options.duration/3,t.viewer.duration)),i.index=0,n.index=1,t.isFlipping=!0,o&&(!s&&!a||s&&a)&&(t.element[0].style.opacity=0),!0===t.isHard?t.currentTween=new TWEEN.Tween(i).delay(0).to(n,t.viewer.app.options.duration).onUpdate(function(){t.updateTween(this)}).easing(t.flipEasing).onComplete(t.completeTween.bind(t)).start():null==e?t.currentTween=new TWEEN.Tween(i).delay(0).to(n,t.viewer.app.options.duration).onUpdate(function(){t.updateTween(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(t.completeTween.bind(t)).start():t.currentTween=new TWEEN.Tween(i).delay(0).to(n,u).onUpdate(function(){t.updateTween(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(t.completeTween.bind(t)).start()}}},{key:"updatePoint",value:function(e){if(null!=e){var t=this.element.width(),i=this.element.height(),n=this.viewer.corner!==p.TURN_CORNER.NONE?this.viewer.corner:e.corner,o=p.TURN_CORNER,s=this.side===p.TURN_DIRECTION.RIGHT,a=n===o.BL||n===o.BR;e.rx=!0===s?this.viewer.leftSheetWidth+t-e.x:e.x,e.ry=!0===a?i-e.y:e.y;var r=Math.atan2(e.ry,e.rx);r=Math.PI/2-eh.limitAt(r,0,eh.toRad(90));var l=t-e.rx/2,h=e.ry/2,u=Math.max(0,Math.sin(r-Math.atan2(h,l))*eh.distOrigin(l,h)),c=.5*eh.distOrigin(e.rx,e.ry),d=Math.ceil(t-u*Math.sin(r)),f=Math.ceil(u*Math.cos(r)),g=eh.toDeg(r),m=a?s?180+(90-g):180+g:s?g:90-g,v=a?s?180+(90-g):g:s?g+180:m,y=a?s?90-g:g+90:s?m-90:m+180,b=s?t-d:d,w=a?i+f:-f,P=s?-d:d-t,S=a?-i-f:f,E=eh.limitAt(.5*e.distance/t,0,.5),x=eh.limitAt((this.viewer.leftSheetWidth+t-e.rx)*.5/t,.05,.3);this.element.addClass("df-folding");var C=s?this.backPage.element:this.frontPage.element,T=s?this.frontPage.element:this.backPage.element,k=this.foldOuterShadow,O=this.foldInnerShadow;this.wrapper.css({transform:eh.translateStr(b,w)+eh.rotateStr(m)}),T.css({transform:eh.rotateStr(-m)+eh.translateStr(-b,-w)}),C.css({transform:eh.rotateStr(v)+eh.translateStr(P,S),boxShadow:"rgba(0, 0, 0, "+E+") 0px 0px 20px"}),O.css({transform:eh.rotateStr(v)+eh.translateStr(P,S),opacity:x/2,backgroundImage:eh.prefix.css+"linear-gradient("+y+"deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) "+.7*c+"px, rgb(255, 255, 255) "+c+"px)"}),k.css({opacity:x/2,left:s?"auto":0,right:s?0:"auto",backgroundImage:eh.prefix.css+"linear-gradient("+(-y+180)+"deg, rgba(0, 0, 0,0) "+c/3+"px, rgb(0, 0, 0) "+c+"px)"})}}},{key:"updateAngle",value:function(e,t){if(this.viewer.isVertical()){var i=5*this.element.height();this.wrapper.css({perspective:i,perspectiveOrigin:!0===t?"50% 0%":"50% 100%"}),this.element.addClass("df-folding"),this.backPage.updateCSS({display:!0===t?e<=-90?"block":"none":e<90?"block":"none",transform:("MfS"!==eh.prefix.dom?"":"perspective("+i+"px) ")+(!0===t?"translateY(-100%) ":"")+"rotateX("+((!0===t?180:0)-e)+"deg)"}),this.frontPage.updateCSS({display:!0===t?e>-90?"block":"none":e>=90?"block":"none",transform:("MSd"!==eh.prefix.dom?"":"perspective("+i+"px) ")+(!1===t?"translateY(100%) ":"")+"rotateX("+((!1===t?-180:0)-e)+"deg)"})}else{var n=5*this.element.width();this.wrapper.css({perspective:n,perspectiveOrigin:!0===t?"0% 50%":"100% 50%"}),this.element.addClass("df-folding"),this.backPage.updateCSS({display:!0===t?e<=-90?"block":"none":e<90?"block":"none",transform:("MfS"!==eh.prefix.dom?"":"perspective("+n+"px) ")+(!0===t?"translateX(-100%) ":"")+"rotateY("+((!0===t?180:0)+e)+"deg)"}),this.frontPage.updateCSS({display:!0===t?e>-90?"block":"none":e>=90?"block":"none",transform:("MSd"!==eh.prefix.dom?"":"perspective("+n+"px) ")+(!1===t?"translateX(100%) ":"")+"rotateY("+((!1===t?-180:0)+e)+"deg)"})}}},{key:"updateTween",value:function(e){var t=this.viewer.isBooklet,i=this.side===p.TURN_DIRECTION.RIGHT,n=this.viewer.isRTL,o=!0===this.animateToReset;!0===this.isHard?(this.updateAngle(e.angle,i),this.angle=e.angle):(this.updatePoint({x:e.x,y:e.y}),this.x=e.x,this.y=e.y),t&&!o&&(this.element[0].style.opacity=i&&!n||!i&&n?e.index>.5?2*(1-e.index):1:e.index<.5?2*e.index:1)}},{key:"completeTween",value:function(){!0===this.isHard?(this.updateAngle(this.end.angle),this.backPage.element.css({display:"block"}),this.frontPage.element.css({display:"block"})):this.updatePoint({x:this.end.x,y:this.end.y}),this.element[0].style.opacity=1,!0!==this.animateToReset&&(this.side=this.targetSide),this.reset(),this.viewer.onFlip(),this.viewer.afterFlip(),this.viewer.requestRefresh()}}]),i}($),ep=/*#__PURE__*/function(e){es(i,e);var t=er(i);function i(e,n){var o,s;return ee(this,i),e.viewerClass=null!==(s=e.viewerClass)&&void 0!==s?s:"df-flipbook-2d",e.skipViewerLoaded=!0,(o=t.call(this,e,n)).bookShadow=el("<div>",{class:"df-book-shadow"}),o.wrapper.append(o.bookShadow),o.corner=p.TURN_CORNER.NONE,n._viewerPrepared(),o}return ei(i,[{key:"init",value:function(){en(eo(i.prototype),"init",this).call(this),this.initEvents(),this.initPages()}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],en(eo(i.prototype),"initEvents",this).call(this)}},{key:"dispose",value:function(){en(eo(i.prototype),"dispose",this).call(this),this.element.remove()}},{key:"initPages",value:function(){for(var e=0;e<this.stackCount;e++){var t=new eu({parentElement:this.wrapper});t.index=e,t.viewer=this,this.sheets.push(t),this.pages.push(t.frontPage),this.pages.push(t.backPage)}}},{key:"resize",value:function(){en(eo(i.prototype),"resize",this).call(this);var e=this.app.dimensions,t=e.padding,n=this.availablePageHeight(),o=this.availablePageWidth(),s=this.fullWidth=o*(this.app.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE||this.app.viewer.isVertical()?1:2),a=this.fullHeight=n*(this.app.viewer.isVertical()&&this.app.viewer.pageMode!==p.FLIPBOOK_PAGE_MODE.SINGLE?2:1),r=e.width,l=e.height,h=this.shiftHeight=Math.ceil(eh.limitAt((a-l+t.height)/2,0,a)),u=this.shiftWidth=Math.ceil(eh.limitAt((s-r+t.width)/2,0,s));1===this.app.zoomValue&&(this.left=0,this.top=0),this.element.css({top:-h,bottom:-h,right:-u,left:-u,paddingTop:t.top,paddingRight:t.right,paddingBottom:t.bottom,paddingLeft:t.left,transform:"translate3d("+this.left+"px,"+this.top+"px,0)"}),this.wrapper.css({marginTop:Math.max(e.height-a-t.height)/2,width:s-s%2,height:a}),this.zoomViewer.resize(),this.centerNeedsUpdate=!0,this.checkCenter(!0),this.pagesReady()}},{key:"updateCenter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.isVertical(),i=this.centerShift,n=(this.isRTL,this.isLeftPage()?this.leftSheetHeight:this.rightSheetHeight),o=this.isLeftPage()?this.leftSheetWidth:this.rightSheetWidth,s=t?0:i*o/2,a=t?i*n/2:0;this.wrapperShiftX=s,this.wrapperShiftY=a,this.seamPositionY=(this.app.dimensions.padding.heightDiff+this.app.dimensions.containerHeight)/2+a,this.seamPositionX=(-this.app.dimensions.offset.width+this.app.dimensions.containerWidth)/2+s,t?this.wrapper[0].style.top=this.wrapperShiftY+"px":this.wrapper[0].style.left=this.wrapperShiftX+"px",this.wrapper[0].style.transition=e?"none":"",this.zoomViewer.updateCenter()}},{key:"refreshSheet",value:function(e){var t=e.sheet,i=e.sheetNumber;!1===t.isFlipping&&(e.needsFlip?(t.element.addClass("df-flipping"),t.flip()):(t.skipFlip=!1,t.element.removeClass("df-flipping df-quick-turn df-folding df-left-side df-right-side"),t.element.addClass(t.targetSide===p.TURN_DIRECTION.LEFT?"df-left-side":"df-right-side"),t.side=t.targetSide,t.targetSide===p.TURN_DIRECTION.LEFT?this.isVertical()?t.updateSize(this.leftSheetWidth,this.leftSheetHeight,0,this.topSheetLeft):t.updateSize(this.leftSheetWidth,this.leftSheetHeight,this.leftSheetTop,0):this.isVertical()?t.updateSize(this.rightSheetWidth,this.rightSheetHeight,0,this.bottomSheetLeft):t.updateSize(this.rightSheetWidth,this.rightSheetHeight,this.rightSheetTop,0))),t.visible=e.visible,t.isHard?t.element.addClass("df-hard-sheet"):(t.element.removeClass("df-hard-sheet"),t.frontPage.updateCSS({display:"block"}),t.backPage.updateCSS({display:"block"})),t.updateCSS({display:!0===t.visible?"block":"none",zIndex:e.zIndex}),null==t.pendingPoint&&!1===t.isFlipping&&t.resetCSS(),i!==t.pageNumber&&(t.element.attr("number",i),t.backPage.element.attr("pagenumber",t.backPage.pageNumber),t.frontPage.element.attr("pagenumber",t.frontPage.pageNumber))}},{key:"eventToPoint",value:function(e){var t=this.isVertical();e=eh.fixMouseEvent(e);var i,n,o,s,a,r,l,h,u,c,d=this.wrapper[0].getBoundingClientRect(),f=this.is3D,g=this.sheets,m=(this.app.dimensions,{x:e.clientX,y:e.clientY}),v=this.parentElement[0].getBoundingClientRect();m.x=m.x-v.left,m.y=m.y-v.top,i=(c=this.dragSheet?this.dragSheet.side===p.TURN_DIRECTION.RIGHT:t?m.y>this.seamPositionY:m.x>this.seamPositionX)?this.rightSheetWidth:this.leftSheetWidth,s=c?this.rightSheetHeight:this.leftSheetHeight,n=t?i:this.rightSheetWidth+this.leftSheetWidth,o=t?this.leftSheetHeight+this.rightSheetHeight:s,r=c?this.rightSheetTop:this.leftSheetTop,a=t?m.x-(this.seamPositionX-(c?this.rightSheetWidth:this.leftSheetWidth)/2):m.x-(this.seamPositionX-this.leftSheetWidth),r=m.y-(d.top-v.top)-r,l=this.drag===p.TURN_DIRECTION.NONE?a<i?a:n-a:this.drag===p.TURN_DIRECTION.LEFT?a:n-a,h=c?g[this.stackCount/2]:g[this.stackCount/2-1],u=a<this.foldSense?p.TURN_DIRECTION.LEFT:a>n-this.foldSense?p.TURN_DIRECTION.RIGHT:p.TURN_DIRECTION.NONE;var y,b=r,w=this.foldSense;return y=a>=0&&a<w?b>=0&&b<=w?p.TURN_CORNER.TL:b>=o-w&&b<=o?p.TURN_CORNER.BL:b>w&&b<o-w?p.TURN_CORNER.L:p.TURN_CORNER.NONE:a>=n-w&&a<=n?b>=0&&b<=w?p.TURN_CORNER.TR:b>=o-w&&b<=o?p.TURN_CORNER.BR:b>w&&b<o-w?p.TURN_CORNER.R:p.TURN_CORNER.NONE:p.TURN_CORNER.NONE,{isInsideSheet:a>=0&&a<=n&&b>=0&&b<=o,isInsideCorner:y!==p.TURN_CORNER.NONE&&y!==p.TURN_CORNER.L&&y!==p.TURN_CORNER.R,x:f?m.x:a,y:f?m.y:r,fullWidth:n,sheetWidth:i,sheetHeight:s,rawDistance:n-a,distance:l,sheet:h,drag:u,foldSense:this.foldSense,event:e,raw:m,corner:y}}},{key:"pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];eh.pan(this,e,t)}},{key:"mouseMove",value:function(e){var t=this.eventToPoint(e);if(null!=e.touches&&2==e.touches.length){this.pinchMove(e);return}1!==this.app.zoomValue&&null!=this.startPoint&&!0===this.canSwipe&&(this.pan(t),e.preventDefault());var i=this.dragSheet||t.sheet;if(null==this.flipPage&&(null!=this.dragSheet||!0===t.isInsideCorner)){null!=this.dragSheet||(t.y=eh.limitAt(t.y,1,this.availablePageHeight()-1),t.x=eh.limitAt(t.x,1,t.fullWidth-1));var n=null!=this.dragSheet?this.corner:t.corner;if(i.isHard){var o=n===p.TURN_CORNER.BR||n===p.TURN_CORNER.TR,s=eh.angleByDistance(t.distance,t.fullWidth);i.updateAngle(s*(o?-1:1),o)}else i.updatePoint(t);i.magnetic=!0,i.magneticCorner=t.corner,e.preventDefault()}null==this.dragSheet&&null!=i&&!1===t.isInsideCorner&&!0===i.magnetic&&(i.pendingPoint=t,i.animateToReset=!0,i.magnetic=!1,this.corner=i.magneticCorner,i.flip(i.pendingPoint),i.pendingPoint=null),this.checkSwipe(t,e)}},{key:"mouseUp",value:function(e){if(e.touches||0===e.button){if(null==this.dragSheet&&null!=e.touches&&0==e.touches.length){this.pinchUp(e);return}var t=this.eventToPoint(e),i=e.target||e.originalTarget,n=1===this.app.zoomValue&&t.x===this.startPoint.x&&t.y===this.startPoint.y&&"A"!==i.nodeName;if(!0===e.ctrlKey&&n)this.zoomOnPoint(t);else if(this.dragSheet){e.preventDefault();var o=this.dragSheet;if(o.pendingPoint=t,this.drag=t.drag,n&&(!0===t.isInsideCorner||t.isInsideSheet&&this.clickAction===p.MOUSE_CLICK_ACTIONS.NAV))t.corner.indexOf("l")>-1?this.app.openLeft():this.app.openRight();else{var s=this.getBasePage();t.distance>t.sheetWidth/2&&(t.sheet.side===p.TURN_DIRECTION.LEFT?this.app.openLeft():this.app.openRight()),s===this.getBasePage()&&(o.animateToReset=!0,o.flip(t))}this.dragSheet=null,o.magnetic=!1}else n&&!t.sheet.isFlipping&&t.isInsideSheet&&this.clickAction===p.MOUSE_CLICK_ACTIONS.NAV&&("left"===t.sheet.side?this.app.openLeft():this.app.openRight());this.startPoint=null,this.canSwipe=!1,this.drag=p.TURN_DIRECTION.NONE}}},{key:"mouseDown",value:function(e){if(e.touches||0===e.button){if(null!=e.touches&&2==e.touches.length){this.pinchDown(e);return}var t=this.eventToPoint(e);this.startPoint=t,this.lastPosX=t.x,this.lastPosY=t.y,t.isInsideCorner&&null==this.flipPage?(this.dragSheet=t.sheet,this.drag=t.drag,this.corner=t.corner,0===t.sheet.pageNumber?this.bookShadow.css({width:"50%",left:this.app.isRTL?0:"50%",transitionDelay:""}):t.sheet.pageNumber===Math.ceil(this.app.pageCount/2)-1&&this.bookShadow.css({width:"50%",left:this.app.isRTL?"50%":0,transitionDelay:""})):this.canSwipe=!0}}},{key:"onScroll",value:function(e){}},{key:"resetPageTween",value:function(){for(var e=0;e<this.stackCount;e++){var t=this.sheets[e];t.currentTween&&t.currentTween.complete(!0)}this.requestRefresh()}},{key:"pagesReady",value:function(){if(!this.isFlipping()){if(!1===this.app.options.flipbookFitPages){var e=this.app.viewer.getBasePage(),t=this.leftViewport=this.getViewPort(e+(this.isBooklet?0:this.isRTL?1:0)),i=this.rightViewPort=this.getViewPort(e+(this.isBooklet?0:this.isRTL?0:1));if(t){var n=eh.contain(t.width,t.height,this.availablePageWidth(),this.availablePageHeight());this.leftSheetWidth=Math.floor(n.width),this.leftSheetHeight=Math.floor(n.height),this.leftSheetTop=(this.availablePageHeight()-this.leftSheetHeight)/2,this.topSheetLeft=(this.app.viewer.availablePageWidth()-this.leftSheetWidth)/2}if(i){var o=eh.contain(i.width,i.height,this.availablePageWidth(),this.availablePageHeight());this.rightSheetWidth=Math.floor(o.width),this.rightSheetHeight=Math.floor(o.height),this.rightSheetTop=(this.availablePageHeight()-this.rightSheetHeight)/2,this.bottomSheetLeft=(this.app.viewer.availablePageWidth()-this.rightSheetWidth)/2}this.totalSheetsWidth=this.leftSheetWidth+this.rightSheetWidth;for(var s=0;s<this.sheets.length;s++){var a=this.sheets[s];a.side===p.TURN_DIRECTION.LEFT?this.isVertical()?a.updateSize(this.leftSheetWidth,this.leftSheetHeight,0,this.topSheetLeft):a.updateSize(this.leftSheetWidth,this.leftSheetHeight,this.leftSheetTop,0):this.isVertical()?a.updateSize(this.rightSheetWidth,this.rightSheetHeight,0,this.bottomSheetLeft):a.updateSize(this.rightSheetWidth,this.rightSheetHeight,this.rightSheetTop,0)}}this.updateCenter(),this.updatePendingStatusClass(),this.app.executeCallback("onPagesReady")}}},{key:"textureLoadedCallback",value:function(e){this.getPageByNumber(e.pageNumber),this.pagesReady()}},{key:"isSheetHard",value:function(e){return!!this.isVertical()||en(eo(i.prototype),"isSheetHard",this).call(this,e)}}]),i}(Q);function ec(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ed(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ef(e,t,i){return t&&ed(e.prototype,t),i&&ed(e,i),e}function eg(e,t,i){return(eg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=em(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function em(e){return(em=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ev(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ey(e,t)}function ey(e,t){return(ey=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=em(e);return i=t?Reflect.construct(n,arguments,em(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}}var ew=p.jQuery,eP=p.utils,eS=/*#__PURE__*/function(e){ev(i,e);var t=eb(i);function i(){return ec(this,i),t.apply(this,arguments)}return ef(i,[{key:"init",value:function(){var e=this.element=ew("<div>",{class:"df-sheet"});(this.frontPage=new _).element.addClass("df-page-front").appendTo(this.element),(this.backPage=new _).element.addClass("df-page-back").appendTo(this.element),this.parentElement.append(e),this.frontPage.sheet=this.backPage.sheet=this}},{key:"completeTween",value:function(){this.isFlipping=!1,this.viewer.onFlip(),this.viewer.afterFlip(),this.viewer.requestRefresh(),this.element[0].style.opacity=1}},{key:"flip",value:function(e){this.side=this.targetSide,this.completeTween()}},{key:"updateSize",value:function(e,t,i,n){e=Math.floor(e),t=Math.floor(t),i=Math.floor(i),this.element[0].style.height=this.frontPage.element[0].style.height=t+"px",this.element[0].style.width=this.frontPage.element[0].style.width=e+"px",this.element[0].style.transform="translateX("+this.positionX+"px) translateY("+i+"px)"}}]),i}(eu),eE=/*#__PURE__*/function(e){ev(i,e);var t=eb(i);function i(e,n){var o;return ec(this,i),e.viewerClass="df-slider",e.pageMode=p.FLIPBOOK_PAGE_MODE.SINGLE,e.singlePageMode=p.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET,e.pageSize=p.FLIPBOOK_PAGE_SIZE.SINGLE,(o=t.call(this,e,n)).stackCount=10,o.soundOn=!1,o.foldSense=0,n._viewerPrepared(),o}return ef(i,[{key:"initPages",value:function(){for(var e=0;e<this.stackCount;e++){var t=new eS({parentElement:this.wrapper});t.index=e,t.viewer=this,this.sheets.push(t),this.pages.push(t.frontPage),this.pages.push(t.backPage)}}},{key:"resize",value:function(){eg(em(i.prototype),"resize",this).call(this),this.skipTransition=!0}},{key:"refreshSheet",value:function(e){var t=e.sheet,i=e.sheetNumber;t.element.toggleClass("df-no-transition",t.skipFlip||this.skipTransition),!1===t.isFlipping&&(e.needsFlip?t.flip():(t.skipFlip=!1,t.element.removeClass("df-flipping df-quick-turn df-folding df-left-side df-right-side"),t.element.addClass(t.targetSide===p.TURN_DIRECTION.LEFT?"df-left-side":"df-right-side"),t.side=t.targetSide)),t.visible=e.visible,t.updateCSS({display:e.sheetNumber>0&&e.sheetNumber<=this.app.pageCount?"block":"none",zIndex:e.zIndex}),i!==t.pageNumber&&(t.element.attr("number",i),t.backPage.element.attr("pagenumber",t.backPage.pageNumber),t.frontPage.element.attr("pagenumber",t.frontPage.pageNumber))}},{key:"refresh",value:function(){eg(em(i.prototype),"refresh",this).call(this),this.skipTransition=!1}},{key:"eventToPoint",value:function(e){var t=eg(em(i.prototype),"eventToPoint",this).call(this,e);return t.isInsideSheet=ew(e.srcElement).closest(".df-page").length>0,t.isInsideCorner=!1,t}},{key:"initCustomControls",value:function(){var e=this.app.ui.controls;e.pageMode&&e.pageMode.hide()}},{key:"setPageMode",value:function(e){e.isSingle=!0,eg(em(i.prototype),"setPageMode",this).call(this,e)}},{key:"pagesReady",value:function(){if(!this.isFlipping()){var e=0,t=0,i=this.app;this.stackCount;for(var n=[],o=i.currentPageNumber,s=0;s<this.stackCount/2;s++)n.push(o+s),n.push(o-s-1);for(var a=0;a<this.stackCount;a++){var r=n[a];if(this.getPageByNumber(r)){var l=this.getPageByNumber(r).sheet,h=this.getViewPort(l.pageNumber,!0),u=eP.contain(h.width,h.height,this.availablePageWidth(),this.availablePageHeight());i.currentPageNumber===l.pageNumber&&(this.leftSheetWidth=this.rightSheetWidth=Math.floor(u.width)),i.currentPageNumber>l.pageNumber?(e-=Math.floor(u.width)+10,l.positionX=e):(l.positionX=t,t+=Math.floor(u.width)+10);var p=(this.availablePageHeight()-u.height)/2;l.updateSize(Math.floor(u.width*i.zoomValue),Math.floor(u.height*i.zoomValue),p)}}this.updateCenter(),this.updatePendingStatusClass(),this.app.executeCallback("onPagesReady")}}},{key:"isVertical",value:function(){return!1}}]),i}(ep);function ex(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eC(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function eT(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ek(e,t,i){return t&&eT(e.prototype,t),i&&eT(e,i),e}function eO(e){return(eO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eR(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eL(e,t)}function eL(e,t){return(eL=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eN(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=eO(e);return i=t?Reflect.construct(n,arguments,eO(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:ex(this)}}var e_={};function eI(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eA(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function eM(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ez(e,t,i){return t&&eM(e.prototype,t),i&&eM(e,i),e}function eD(e,t,i){return(eD="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eF(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function eF(e){return(eF=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eB(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eH(e,t)}function eH(e,t){return(eH=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eU(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=eF(e);return i=t?Reflect.construct(n,arguments,eF(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:eI(this)}}e_.init=function(){if(!0!==e_.initialized){var e=window.THREE;e_={init:function(){},initialized:!0,GEOMETRY_TYPE:{PLANE:0,BOX:1,MODEL:2},MATERIAL_FACE:{FRONT:5,BACK:4},WHITE_COLOR:new e.Color("white"),defaults:{anisotropy:8,maxTextureSize:2048,groundTexture:"blank",color:16777215,shininess:15,width:210,height:297,depth:.2,segments:150,textureLoadFallback:"blank"},textureLoader:new e.TextureLoader,clearChild:function(e){var t,i=e.material;if(e.parent.remove(e),e=m.disposeObject(e),null!=i){if(null==i.length)i.map&&(t=i.map,i.dispose(),t.dispose()),i.bumpMap&&(t=i.bumpMap,i.dispose(),t.dispose()),i.normalMap&&(t=i.normalMap,i.dispose(),t.dispose());else for(var n=0;n<i.length;n++)i[n]&&(i[n].map&&(t=i[n].map,i[n].dispose(),t.dispose()),i[n].bumpMap&&(t=i[n].bumpMap,i[n].dispose(),t.dispose()),i[n].normalMap&&(t=i[n].normalMap,i[n].dispose(),t.dispose())),i[n]=null;i=null,t=null}},loadImage:function(t,i,n,o,s){if(null==i){var a=null==t.material[n]?null:t.material[n][o]?t.material[n][o].sourceFile:null;return null==a?null:a.indexOf("data:image")>-1?null:a}var r=null;return"CANVAS"===i.nodeName||"IMG"===i.nodeName?((r=new e.Texture(i)).needsUpdate=!0,e_.loadTexture(r,t,o,n),"function"==typeof s&&s(t,r)):"blank"!==i?(r=null==i?null:e_.textureLoader.load(i,function(e){e.sourceFile=i,e_.loadTexture(e,t,o,n),"function"==typeof s&&s(t,e)},void 0,function(){null==r.image&&e_.loadImage(t,e_.defaults.textureLoadFallback,n,o),e_.loadTextureFailed()}))&&(r.mapping=e.UVMapping):(e_.loadTexture(null,t,o,n),"function"==typeof s&&s(t,r)),0},loadTexture:function(t,i,n,o){if(t){var s=t.image;t.naturalWidth=s.naturalWidth,t.naturalHeight=s.naturalHeight,t.needsUpdate=!0,void 0!=i.textureRotation&&(t.rotation=e.MathUtils.degToRad(i.textureRotation),t.center=i.textureCenter)}null!==t&&"map"===n&&(t.anisotropy=0,e_.defaults.anisotropy>0&&(t.anisotropy=e_.defaults.anisotropy),!0===e.skipPowerOfTwo&&(t.minFilter=e.LinearFilter,t.magFilter=e.LinearFilter),t.name=new Date().toTimeString()),e_.clearTexture(i.material[o][n]),i.material[o][n]=t,"bumpMap"===n&&(i.material[o].bumpScale=i.sheet.getBumpScale(o)),i.material[o].needsUpdate=!0},loadTextureFailed:function(){return null},clearTexture:function(e){if(e){if(e.image&&"CANVAS"===e.image.nodeName){if(e.image.remove)try{e.image.remove()}catch(e){console.log(e)}delete e.image}e=m.disposeObject(e)}}},e.skipPowerOfTwo=!0;var t=/*#__PURE__*/function(t){eR(n,t);var i=eN(n);function n(t){eC(this,n);var o,s=t.width||e_.defaults.width,a=t.height||e_.defaults.height,r=t.color||e_.defaults.color,l=t.segments||e_.defaults.segments,h=t.depth||e_.defaults.depth,u={color:r,flatShading:!1,shininess:t.shininess||e_.defaults.shininess},p=new e.MeshPhongMaterial(u),c=[p,p,p,p,new e.MeshPhongMaterial(u),new e.MeshPhongMaterial(u)];return(o=i.call(this,new e.BoxGeometry(s,a,h,l,1,1),c)).material[5].transparent=!0,o.material[4].transparent=!0,o.baseType="Paper",o.type="Paper",o.castShadow=!0,o.receiveShadow=!0,t.parent3D.add(ex(o)),o}return ek(n,[{key:"loadImage",value:function(e,t,i){e_.loadImage(this,e,t,"map",i)}},{key:"frontImage",value:function(e,t){e_.loadImage(this,e,e_.MATERIAL_FACE.FRONT,"map",t)}},{key:"backImage",value:function(e,t){e_.loadImage(this,e,e_.MATERIAL_FACE.BACK,"map",t)}},{key:"loadBump",value:function(e){e_.loadImage(this,e,e_.MATERIAL_FACE.FRONT,"bumpMap",null),e_.loadImage(this,e,e_.MATERIAL_FACE.BACK,"bumpMap",null)}},{key:"loadNormalMap",value:function(e,t){if(void 0!==t){e_.loadImage(this,e,t,"normalMap",null);return}e_.loadImage(this,e,e_.MATERIAL_FACE.FRONT,"normalMap",null),e_.loadImage(this,e,e_.MATERIAL_FACE.BACK,"normalMap",null)}}]),n}(e.Mesh),i=/*#__PURE__*/function(e){eR(i,e);var t=eN(i);function i(e){var n;return eC(this,i),(n=t.call(this,e)).receiveShadow=!0,n.frontImage(e_.defaults.groundTexture),n.backImage(e_.defaults.groundTexture),n.type="Ground",n}return i}(t),n=/*#__PURE__*/function(t){eR(o,t);var n=eN(o);function o(t){eC(this,o);var s,a=ex(s=n.call(this));a.canvas=t.canvas||document.createElement("canvas"),a.canvas=s.canvas,a.camera=new e.PerspectiveCamera(20,a.width/a.height,4,5e4),a.renderer=new e.WebGLRenderer({canvas:a.canvas,antialias:!0,alpha:!0}),a.renderer.setPixelRatio(t.pixelRatio),a.renderer.setSize(a.width,a.height),a.renderer.setClearColor(16777215,0),a.renderer.shadowMap.enabled=!0,a.renderer.shadowMap.type=1,a.ground=new i({color:16777215,height:a.camera.far/10,width:a.camera.far/10,segments:2,parent3D:a}),a.ambientLight=new e.AmbientLight(4473924),a.add(a.ambientLight);var r=a.spotLight=new e.DirectionalLight(16777215,.25);return r.position.set(0,1,0),!1!==t.castShadow&&(r.castShadow=!0,r.shadow.camera.near=200,r.shadow.camera.far=2e3,r.shadow.camera.top=1350,r.shadow.camera.bottom=-1350,r.shadow.camera.left=-1350,r.shadow.camera.right=1350,r.shadow.radius=2,r.shadow.mapSize.width=1024,r.shadow.mapSize.height=1024,r.shadow.needsUpdate=!0),a.add(r),a.animateCount=0,a.renderCount=0,a.camera.position.set(-300,300,300),a.camera.lookAt(new e.Vector3(0,0,0)),s}return ek(o,[{key:"resizeCanvas",value:function(e,t){this.renderer.setSize(e,t),this.camera.aspect=e/t,this.camera.updateProjectionMatrix()}},{key:"render",value:function(){this.animateCount++,this.renderer.render(this,this.camera),null!=this.stats&&this.stats.update()}},{key:"clearMaterials",value:function(){for(var e=this.children.length,t=e-1;t>=0;t--){var i=this.children[t];if(i.baseType&&"Paper"===i.baseType&&i.material){if(i.material.length)for(var n=0;n<i.material.length;n++)i.material[n].needsUpdate=!0;else i.material.needsUpdate=!0}}}},{key:"clearChild",value:function(){this.spotLight.shadow.map=m.disposeObject(this.spotLight.shadow.map),this.spotLight.castShadow=!1,this.clearMaterials();for(var e=this.children.length,t=e-1;t>=0;t--){var i=this.children[t];if(i.children&&i.children.length>0)for(var n=i.children.length-1;n>=0;n--)e_.clearChild(i.children[n]);e_.clearChild(i),i=null}this.render()}}]),o}(e.Scene);e_.Paper=t,e_.Stage=n;var o=/*#__PURE__*/function(e){eR(i,e);var t=eN(i);function i(e){var n;return eC(this,i),(n=t.call(this)).element=e,n.element.style.position="absolute",n.addEventListener("removed",function(){null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)}),n}return i}(e.Object3D);e.CSS3DObject=o;var s=/*#__PURE__*/function(e){eR(i,e);var t=eN(i);function i(e){return eC(this,i),t.call(this,e)}return i}(e.CSS3DObject);e.CSS3DSprite=s,e.MathUtils&&(e.Math=e.MathUtils),e.CSS3DRenderer=function(){m.log("THREE.CSS3DRenderer",e.REVISION);var t,i,n,o,s=new e.Matrix4,a={camera:{fov:0,style:""},objects:{}},r=document.createElement("div");r.style.overflow="hidden",r.style.WebkitTransformStyle="preserve-3d",r.style.MozTransformStyle="preserve-3d",r.style.oTransformStyle="preserve-3d",r.style.transformStyle="preserve-3d",this.domElement=r;var l=document.createElement("div");l.style.WebkitTransformStyle="preserve-3d",l.style.MozTransformStyle="preserve-3d",l.style.oTransformStyle="preserve-3d",l.style.transformStyle="preserve-3d",r.appendChild(l),this.setClearColor=function(){},this.getSize=function(){return{width:t,height:i}},this.setSize=function(e,s){t=e,i=s,n=t/2,o=i/2,r.style.width=e+"px",r.style.height=s+"px",l.style.width=e+"px",l.style.height=s+"px"};var h=function(e){return Math.abs(e)<Number.EPSILON?0:e},u=function(e){var t=e.elements;return"matrix3d("+h(t[0])+","+h(-t[1])+","+h(t[2])+","+h(t[3])+","+h(t[4])+","+h(-t[5])+","+h(t[6])+","+h(t[7])+","+h(t[8])+","+h(-t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(-t[13])+","+h(t[14])+","+h(t[15])+")"},p=function(e){var t=e.elements;return"translate3d(-50%,-50%,0) matrix3d("+h(t[0])+","+h(t[1])+","+h(t[2])+","+h(t[3])+","+h(-t[4])+","+h(-t[5])+","+h(-t[6])+","+h(-t[7])+","+h(t[8])+","+h(t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(t[13])+","+h(t[14])+","+h(t[15])+")"},c=function(t,i){if(t instanceof e.CSS3DObject){t instanceof e.CSS3DSprite?(s.copy(i.matrixWorldInverse),s.transpose(),s.copyPosition(t.matrixWorld),s.scale(t.scale),s.elements[3]=0,s.elements[7]=0,s.elements[11]=0,s.elements[15]=1,n=p(s)):n=p(t.matrixWorld);var n,o=t.element,r=a.objects[t.id];(void 0===r||r!==n)&&(o.style.WebkitTransform=n,o.style.MozTransform=n,o.style.oTransform=n,o.style.transform=n,a.objects[t.id]=n),o.parentNode!==l&&l.appendChild(o)}for(var h=0,u=t.children.length;h<u;h++)c(t.children[h],i)};this.render=function(t,s){var h=.5/Math.tan(e.Math.degToRad(.5*s.fov))*i;a.camera.fov!==h&&(r.style.WebkitPerspective=h+"px",r.style.MozPerspective=h+"px",r.style.oPerspective=h+"px",r.style.perspective=h+"px",a.camera.fov=h),t.updateMatrixWorld(),null===s.parent&&s.updateMatrixWorld(),s.matrixWorldInverse.invert?s.matrixWorldInverse.copy(s.matrixWorld).invert():s.matrixWorldInverse.getInverse(s.matrixWorld);var p="translate3d(0,0,"+h+"px)"+u(s.matrixWorldInverse)+" translate3d("+n+"px,"+o+"px, 0)";a.camera.style!==p&&(l.style.WebkitTransform=p,l.style.MozTransform=p,l.style.oTransform=p,l.style.transform=p,a.camera.style=p),c(t,s)}}}};var eV=p.jQuery,eW=p.utils,ej=/*#__PURE__*/function(e){eB(i,e);var t=eU(i);function i(e){var n;return eA(this,i),(n=t.call(this,e)).flexibility=e.flexibility,n.sheetAngle=180,n.curveAngle=0,n.parent3D=e.parent3D,n.segments=e.segments||50,n.width=e.width||100,n.height=e.height||100,n.depth=e.depth||.5,n.matColor="white",n.fallbackMatColor=e_.WHITE_COLOR,n.init(),n.bumpScale=[0,0,0,0,1,1],n}return ez(i,[{key:"init",value:function(){this.element=new e_.Paper({parent3D:this.parent3D,segments:this.segments,depth:this.depth,height:this.height,width:this.width,flatShading:0===this.flexibility}),this.element.sheet=this,this.frontPage=new eG({sheet:this,face:5}),this.backPage=new eG({sheet:this,face:4}),this.reset(),this.updateAngle()}},{key:"setMatColor",value:function(e,t){if(this.matColor=new THREE.Color(e),void 0===t)for(var i=0;i<6;i++)this.element.material[i].color=this.matColor;else this.element.material[t].color=this.matColor}},{key:"getBumpScale",value:function(e){return this.bumpScale[e]}},{key:"resetMatColor",value:function(e,t){this.element.material[e].color=t?this.matColor:this.fallbackMatColor}},{key:"frontImage",value:function(e,t){this.element.frontImage(e,t)}},{key:"backImage",value:function(e,t){this.element.backImage(e,t)}},{key:"updateAngle",value:function(){if(void 0!==this.viewer&&null!==this.viewer){var e=!0===this.isHard?0:this.flexibility,t=(this.viewer.isVertical()?this.height:this.width)*(1-Math.sin(e/2*(e/2))/2-e/20);this.element.scale.y=(this.viewer.isVertical()?this.width:this.height)/this.element.geometry.parameters.height;var i=this.segments,n=t/1,o=n*e,s=[],a=[],r=[],l=[],h=[],u=[],p=this.depth,c=0,d=[];d.push(c),h[0]=[],u[0]=[];var f=this.sheetAngle*Math.PI/180;this.viewer.isVertical()||(this.element.position.x=-Math.cos(f)*this.viewer.pageOffset),this.viewer.isVertical()&&(this.element.position.y=Math.cos(f)*this.viewer.pageOffset);var g=!0===this.isHard?f:this.curveAngle*Math.PI/180,m=this.sheetAngle*Math.PI/180,v=m-Math.PI/2,y=Math.sin(v)*p/2;h[0][0]=h[0][1]=new THREE.Vector3(-n*Math.cos(f),0,Math.sin(f)*n-y),u[0][0]=u[0][1]=new THREE.Vector3(h[0][0].x-Math.cos(v)*p,0,h[0][0].z+2*y),h[0][1]=new THREE.Vector3(-n/2*Math.cos(g),0,n/2*Math.sin(g)-y),u[0][1]=new THREE.Vector3(h[0][1].x-Math.cos(v)*p,0,h[0][1].z+2*y),m=(45+this.sheetAngle/2)*Math.PI/180,h[0][2]=new THREE.Vector3(-Math.cos(m)*o/2,0,Math.sin(m)*o-y),u[0][2]=new THREE.Vector3(h[0][2].x+Math.cos(v)*p,0,h[0][2].z+2*y),5e-4>Math.abs(u[0][2].x-0)&&(u[0][2].x=0),h[0][3]=new THREE.Vector3(0,0,-y),u[0][3]=new THREE.Vector3(h[0][3].x-Math.cos(v)*p,0,h[0][3].z+2*y),5e-4>Math.abs(u[0][3].x-0)&&(u[0][3].x=0);for(var b=0;b<1;b++){var w=Math.max(this.segments-1,1);s[b]=new THREE.CubicBezierCurve3(h[b][0],h[b][1],h[b][2],h[b][3]),r[b]=s[b].getPoints(w),w>2&&r[b].push(new THREE.Vector3().copy(r[b][w]));for(var P=void 0,S=r[b][0],E=1;E<r[b].length;E++)c+=(P=r[b][E]).distanceTo(S),d.push(c),S=P;a[b]=new THREE.CubicBezierCurve3(u[b][0],u[b][1],u[b][2],u[b][3]),l[b]=a[b].getPoints(w),w>2&&l[b].push(new THREE.Vector3().copy(l[b][w]))}var x=this.element.geometry;if(void 0!==x.attributes){var C=x.attributes.position,T=x.attributes.uv,k=i+1;C.setZ(0,r[0][i].z),C.setZ(2,r[0][i].z),C.setX(0,r[0][i].x),C.setX(2,r[0][i].x),C.setZ(1,l[0][i].z),C.setZ(3,l[0][i].z),C.setX(1,l[0][i].x),C.setX(3,l[0][i].x),C.setZ(5,r[0][0].z),C.setZ(7,r[0][0].z),C.setX(5,r[0][0].x),C.setX(7,r[0][0].x),C.setZ(4,l[0][0].z),C.setZ(6,l[0][0].z),C.setX(4,l[0][0].x),C.setX(6,l[0][0].x);for(var O=0;O<1;O++)for(var R=0;R<k;R++)C.setZ(8+0*k+R,r[0][R].z),C.setX(8+0*k+R,r[0][R].x),C.setZ(8+1*k+R,l[0][R].z),C.setX(8+1*k+R,l[0][R].x),C.setZ(8+2*k+R,r[0][R].z),C.setX(8+2*k+R,r[0][R].x),C.setZ(8+3*k+R,l[0][R].z),C.setX(8+3*k+R,l[0][R].x),C.setZ(8+4*k+R,r[0][R].z),C.setX(8+4*k+R,r[0][R].x),C.setZ(8+5*k+R,r[0][R].z),C.setX(8+5*k+R,r[0][R].x),T.setX(8+4*k+R,d[R]/c),T.setX(8+5*k+R,d[R]/c),C.setZ(8+6*k+R,l[0][i-R].z),C.setX(8+6*k+R,l[0][i-R].x),C.setZ(8+7*k+R,l[0][i-R].z),C.setX(8+7*k+R,l[0][i-R].x),T.setX(8+6*k+R,1-d[i-R]/c),T.setX(8+7*k+R,1-d[i-R]/c);x.computeBoundingBox(),this.element.scale.x=1*n/c,x.computeBoundingSphere(),C.needsUpdate=!0,T.needsUpdate=!0,x.computeVertexNormals()}else{var L=x.vertices,N=i-1,_=8;L[0].z=L[2].z=r[0][i].z,L[0].x=L[2].x=r[0][i].x,L[1].z=L[3].z=l[0][i].z,L[1].x=L[3].x=l[0][i].x,L[5].z=L[7].z=r[0][0].z,L[5].x=L[7].x=r[0][0].x,L[4].z=L[6].z=l[0][0].z,L[4].x=L[6].x=l[0][0].x;for(var I=0;I<1;I++)for(var A=1;A<i;A++)L[_].z=L[_+3*N].z=l[0][A].z,L[_].x=L[_+3*N].x=l[0][A].x,L[_+N].z=L[_+2*N].z=r[0][A].z,L[_+N].x=L[_+2*N].x=r[0][A].x,_++;for(var M=x.faceVertexUvs[0],z=x.faces,D=0,F=0;F<M.length;F++)if(z[F].materialIndex===e_.MATERIAL_FACE.BACK){var B=d[D]/c;F%2==0?(M[F][0].x=M[F][1].x=M[F+1][0].x=B,D++):M[F-1][2].x=M[F][1].x=M[F][2].x=B}else if(z[F].materialIndex===e_.MATERIAL_FACE.FRONT){var H=1-d[D]/c;F%2==0?(M[F][0].x=M[F][1].x=M[F+1][0].x=H,D--):M[F-1][2].x=M[F][1].x=M[F][2].x=H}x.computeBoundingBox(),this.element.scale.x=1*n/c,x.computeBoundingSphere(),x.verticesNeedUpdate=!0,x.computeFaceNormals(),x.computeVertexNormals(),x.uvsNeedUpdate=!0,x.normalsNeedUpdate=!0}s.forEach(function(e){}),a.forEach(function(e){}),l.forEach(function(e){}),r.forEach(function(e){})}}},{key:"flip",value:function(e,t){var i=this,n=i.viewer.isBooklet;!0===i.isCover&&(0===e&&(e=2.5*i.viewer.flexibility),180===e&&(e-=2.5*i.viewer.flexibility));var o=t-e,s=e>90,a=i.viewer.isRTL,r=s?i.backPage.pageNumber:i.frontPage.pageNumber,l=this.viewer.getViewPort(r);l&&(l=eW.contain(l.width,l.height,i.viewer.availablePageWidth(),i.viewer.availablePageHeight()));var h=-(i.viewer.has3DCover&&i.viewer.isClosedPage()?i.viewer.coverExtraWidth:0),u=-(i.viewer.has3DCover&&i.viewer.isClosedPage()?i.viewer.coverExtraHeight:0);i.init={angle:e,height:s?i.viewer.rightSheetHeight:i.viewer.leftSheetHeight,width:s?i.viewer.rightSheetWidth:i.viewer.leftSheetWidth,index:s&&!a||!s&&a?1:0,_index:0},i.first={angle:e+o/4,index:s&&!a||!s&&a?1:.25},i.mid={angle:e+2*o/4,index:.5},i.mid2={angle:e+3*o/4,index:s&&!a||!s&&a?.25:1},i.end={angle:t,index:s&&!a||!s&&a?0:1,height:u+(l?l.height:i.height),width:h+(l?l.width:i.width)},i.isFlipping=!0;var p=function(e){i.sheetAngle=e.angle,i.curveAngle=i.isHard?e.angle:eW.getCurveAngle(s,e.angle),!0===i.isHard?(i.flexibility=0,i.isCover&&i.viewer.flipCover(i)):i.flexibility=e.angle<90?i.leftFlexibility:i.rightFlexibility,i.element.position.z=(e.angle<90?i.leftPos:i.rightPos)+i.depth,n&&(i.element.material[5].opacity=i.element.material[4].opacity=e.index,i.element.castShadow=e.index>.5),i.height=e.height,i.width=e.width,i.updateAngle(!0)};n&&(!s&&!a||s&&a)&&(i.element.material[5].opacity=i.element.material[4].opacity=0,i.element.castShadow=!1),i.currentTween=new TWEEN.Tween(i.init).to({angle:[i.first.angle,i.mid.angle,i.mid2.angle,i.end.angle],index:[i.first.index,i.mid.index,i.mid2.index,i.end.index],_index:1,height:i.end.height,width:i.end.width},i.viewer.app.options.duration*Math.abs(o)/180).onUpdate(function(e){p(this,e)}).easing(TWEEN.Easing.Sinusoidal.Out).onStop(function(){i.currentTween=null,i.isFlipping=!1,i.isCover&&(i.viewer.leftCover.isFlipping=!1,i.viewer.rightCover.isFlipping=!1),i.element.material[5].opacity=i.element.material[4].opacity=1}).onComplete(function(){i.updateAngle(),i.element.material[5].opacity=i.element.material[4].opacity=1,i.element.castShadow=!0,i.isFlipping=!1,i.isCover&&(i.viewer.leftCover.isFlipping=!1,i.viewer.rightCover.isFlipping=!1),i.side=i.targetSide,i.viewer.onFlip(),i.viewer.afterFlip(),i.currentTween=null,i.viewer&&i.viewer.requestRefresh&&i.viewer.requestRefresh()}).start(),i.currentTween.update(window.performance.now())}}]),i}($),eq=/*#__PURE__*/function(e){eB(i,e);var t=eU(i);function i(e,n){var o,s,a,r,l;return eA(this,i),e.viewerClass="df-flipbook-3d",(o=t.call(this,e,n)).pageOffset=5,o.spiralCount=20,o.groundDistance=null!==(s=e.groundDistance)&&void 0!==s?s:2,o.hasSpiral="true"===e.hasSpiral||!0===e.hasSpiral,o.flexibility=eW.limitAt(null!==(a=e.flexibility)&&void 0!==a?a:.9,0,10),o.hasSpiral&&(o.flexibility=0),0===o.flexibility&&(e.sheetSegments=8),o.drag3D=eW.isTrue(e.drag3D),o.texturePowerOfTwo=!eW.isMobile&&(null===(r=e.texturePowerOfTwo)||void 0===r||r),o.color3DSheets=null!==(l=o.app.options.color3DSheets)&&void 0!==l?l:"white",o.midPosition=0,o.initMOCKUP(function(){n._viewerPrepared()}),o}return ez(i,[{key:"initMOCKUP",value:function(e){var t=this.app;"undefined"==typeof THREE?(t.updateInfo(t.options.text.loading+" WEBGL 3D ..."),"function"==typeof window.define&&window.define.amd&&window.requirejs?(window.requirejs.config({paths:{three:t.options.threejsSrc.replace(".js","")},shim:{three:{exports:"THREE"}}}),window.require(["three"],function(t){return window.THREE=t,e_.init(),"function"==typeof e&&e(),t})):"function"==typeof window.define&&window.define.amd?window.require(["three",t.options.threejsSrc.replace(".js","")],function(t){t(function(){e_.init(),"function"==typeof e&&e()})}):eW.getScript(t.options.threejsSrc+"?ver="+p.version,function(){e_.init(),"function"==typeof e&&e()},function(){t.updateInfo("Unable to load THREE.js...")})):(e_.init(),"function"==typeof e&&e())}},{key:"init",value:function(){var e=this.app;eD(eF(i.prototype),"init",this).call(this),e.provider.defaultPage.pageRatio,this.pageScaleX=1,this.initDepth(),this.initStage(),this.initPages(),this.initEvents(),this.render()}},{key:"updatePageMode",value:function(){eD(eF(i.prototype),"updatePageMode",this).call(this);var e=this.app;this.has3DCover=e.options.cover3DType!==p.FLIPBOOK_COVER_TYPE.NONE&&e.pageCount>7&&!this.isBooklet,this.has3DCover&&"none"===e.options.flipbookHardPages&&(e.options.flipbookHardPages="cover")}},{key:"initDepth",value:function(){var e,t;this.sheetDepth=this.pageScaleX*(null!==(e=this.app.options.sheetDepth)&&void 0!==e?e:.5),this.sheetSegments=null!==(t=this.app.options.sheetSegments)&&void 0!==t?t:20,this.coverDepth=2*this.sheetDepth,this.sheetsDepth=Math.min(10,this.app.pageCount/4)*this.sheetDepth}},{key:"initStage",value:function(){var e=this.stage=new e_.Stage({pixelRatio:this.app.options.pixelRatio});(e.canvas=eV(e.renderer.domElement).addClass("df-3dcanvas")).appendTo(this.element),e.camera.position.set(0,0,600),e.camera.lookAt(new THREE.Vector3(0,0,0)),this.camera=e.camera,e.spotLight.position.set(-220,220,550),e.spotLight.castShadow=!eW.isMobile&&this.app.options.has3DShadow,e.spotLight.shadow&&(e.spotLight.shadow.bias=-.005),e.ambientLight.color=new THREE.Color("#fff"),e.ambientLight.intensity=.82;var t=new THREE.ShadowMaterial;t.opacity=this.app.options.shadowOpacity,e.ground.oldMaterial=e.ground.material,e.ground.material=t,e.ground.position.z=this.has3DCover?-6:-4,e.selectiveRendering=!0;var i=e.cssRenderer=new THREE.CSS3DRenderer;eV(i.domElement).css({position:"absolute",top:0,pointerEvents:"none"}).addClass("df-3dcanvas df-csscanvas"),this.element[0].appendChild(i.domElement),e.cssScene=new THREE.Scene,this.wrapper.remove(),this.wrapper=new THREE.Group,this.stage.add(this.wrapper),this.wrapper.add(e.ground),this.bookWrapper=new THREE.Group,this.bookWrapper.name="bookwrapper",this.wrapper.add(this.bookWrapper),this.bookHelper=e.bookHelper=new THREE.BoxHelper(this.bookWrapper,16776960),e.add(this.bookHelper),this.bookHelper.visible=!1,this.cameraWrapper=new THREE.Group,this.cameraWrapper.add(e.camera),e.add(this.cameraWrapper),this.app.renderRequestStatus=p.REQUEST_STATUS.ON}},{key:"initPages",value:function(){for(var e={parent3D:this.bookWrapper,viewer:this,segments:this.sheetSegments,depth:this.sheetDepth,flexibility:this.flexibility},t=0;t<this.stackCount;t++){var i=new ej(e);i.index=t,i.viewer=this,this.sheets.push(i),i.setMatColor(this.color3DSheets),this.pages.push(i.frontPage),this.pages.push(i.backPage),this.stage.cssScene.add(i.frontPage.cssPage),this.stage.cssScene.add(i.backPage.cssPage)}e.depth=this.sheetsDepth,e.segments=1,e.flexibility=0,this.leftSheets=new ej(e),this.rightSheets=new ej(e),this.leftSheets.setMatColor(this.color3DSheets),this.rightSheets.setMatColor(this.color3DSheets),e.depth=this.coverDepth,this.leftCover=new ej(e),this.rightCover=new ej(e),this.leftCover.isHard=!0,this.rightCover.isHard=!0,this.set3DCoverNormal(),this.setcolor3DCover(this.app.options.color3DCover),this.stage.cssScene.add(this.leftCover.frontPage.cssPage),this.stage.cssScene.add(this.rightCover.backPage.cssPage),this.zoomViewer.leftPage.element.css({backgroundColor:this.color3DSheets}),this.zoomViewer.rightPage.element.css({backgroundColor:this.color3DSheets}),this.isVertical()&&this.bookWrapper.children.forEach(function(e){e.rotateZ(THREE.MathUtils.degToRad(-90)),e.textureCenter=new THREE.Vector2(.5,.5),e.textureRotation=90}),this.initSpiral()}},{key:"initSpiral",value:function(){this.hasSpiral=!1}},{key:"set3DCoverNormal",value:function(){}},{key:"setcolor3DCover",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],eD(eF(i.prototype),"initEvents",this).call(this)}},{key:"dispose",value:function(){eD(eF(i.prototype),"dispose",this).call(this),this.stage&&(this.stage.clearChild(),this.stage.cssRenderer.domElement.parentNode.removeChild(this.stage.cssRenderer.domElement),this.stage.cssRenderer=null,this.stage.orbitControl=eW.disposeObject(this.stage.orbitControl),this.stage.renderer=eW.disposeObject(this.stage.renderer),eV(this.stage.canvas).remove(),this.stage.canvas=null,this.stage=eW.disposeObject(this.stage)),this.centerTween&&this.centerTween.stop&&this.centerTween.stop()}},{key:"render",value:function(){this.stage.render(),this.stage.cssRenderer.render(this.stage.cssScene,this.stage.camera)}},{key:"resize",value:function(){eD(eF(i.prototype),"resize",this).call(this);var e=this,t=e.app,n=e.stage,o=t.dimensions;o.padding,e.isSingle;var s=this.availablePageWidth(),a=this.availablePageHeight();n.resizeCanvas(o.stage.width,o.stage.height),n.cssRenderer.setSize(o.stage.width,o.stage.height),this.pageScaleX=Math.max(Math.max(s,a)/400,1),this.initDepth(),this.sheets.forEach(function(t){t.depth=e.sheetDepth}),t.refreshRequestStart();var r=this.refSize=Math.min(a,s);this.coverExtraWidth=(e.isVertical()?2:1)*r*.025,this.coverExtraHeight=(e.isVertical()?1:2)*r*.025,!0!==this.has3DCover&&(this.coverExtraWidth=0,this.coverExtraHeight=0),e.zoomViewer.resize(),e.cameraPositionDirty=!0,e.centerNeedsUpdate=!0,e.checkCenter(!0),e.pagesReady(),this.pageOffset=(this.hasSpiral?6:0)*Math.min(this._defaultPageSize.width,this._defaultPageSize.height)/1e3}},{key:"fitCameraToCenteredObject",value:function(e,t,i,n){var o=new THREE.Box3;o.setFromObject(t),new THREE.Vector3;var s=new THREE.Vector3;o.getSize(s);var a=this.coverExtraHeight,r=2*this.coverExtraWidth;this.isClosedPage()&&(r=0,a=0),s.x=s.x-r+this.app.dimensions.padding.width,s.y=s.y-a+this.app.dimensions.padding.height;var l=e.fov*(Math.PI/180),h=2*Math.atan(Math.tan(l/2)*e.aspect),u=Math.max(s.z/2+Math.abs(s.x/2/Math.tan(h/2)),s.z/2+Math.abs(s.y/2/Math.tan(l/2)));void 0!==i&&0!==i&&(u*=i),e.position.set(0,0,u);var p=o.min.z,c=p<0?-p+u:u-p;e.far=3*c,e.updateProjectionMatrix(),void 0!==n&&(n.target=new THREE.Vector3(0,0,0),n.maxDistance=2*c)}},{key:"updateShadowSize",value:function(){}},{key:"refresh",value:function(){var e=this.app,t=this.getBasePage();this.refreshRequested=!0;var n=1/e.pageCount*t,o=this.isRTL?1-n:n,s=Math.min(this.stackCount,this.totalSheets),a=eW.limitAt(this.totalSheets,this.stackCount,2*this.stackCount),r=this.isBooklet?0:this.flexibility/a;this.leftFlexibility=r*(1-o),this.rightFlexibility=r*o,this.midPosition=.5*s*this.sheetDepth,eD(eF(i.prototype),"refresh",this).call(this);var l=!0===this.has3DCover;this.leftCover.element.visible=this.rightCover.element.visible=this.leftSheets.element.visible=this.rightSheets.element.visible=l,this.wrapper.position.z=-this.midPosition;var h=0,u=0,p=this.isRTL,c=this.isFirstPage(),d=this.isLastPage(),f=this.isLeftClosed=this.isClosedPage()&&(p&&d||!p&&c),g=this.isRightClosed=this.isClosedPage()&&(!p&&d||p&&c);if(l){this.leftSheets.depth=p?this.sheetsDepth*(1-this.getBasePage()/e.pageCount):this.sheetsDepth*t/e.pageCount,this.leftSheets.element.visible=p?e.pageCount-this.getBasePage()>2:t>2,h-=this.leftSheets.depth/2,this.leftSheets.element.position.z=h,h-=this.coverDepth+(this.leftSheets.element.visible?this.leftSheets.depth/2:0)+3*this.coverDepth,this.leftCover.depth=this.rightCover.depth=this.coverDepth;var m=Math.max(this.leftSheetHeight,this.rightSheetHeight);g&&(m=this.leftSheetHeight),f&&(m=this.rightSheetHeight),!0!==this.leftCover.isFlipping&&(this.leftCover.element.position.z=f?this.midPosition+this.coverDepth:h+this.coverDepth/2,this.leftCover.element.position.z=Math.max(this.leftCover.element.position.z,-(.05*this.refSize)),this.leftCover.element.position.x=0,this.leftSheets.sheetAngle=this.leftCover.sheetAngle=f?180:0,this.leftSheets.curveAngle=this.leftCover.curveAngle=f?180:0,!0===this.rightCover.isFlipping||(this.leftCover.height=m,this.leftCover.width=this.leftCover.sheetAngle<90?this.leftSheetWidth:this.rightSheetWidth,this.isClosedPage()||(this.leftCover.width+=this.coverExtraWidth,this.leftCover.height+=this.coverExtraHeight)),this.leftSheets.updateAngle(),this.leftCover.updateAngle()),this.rightSheets.depth=this.sheetsDepth-this.leftSheets.depth,this.rightSheets.element.visible=p?t>2:e.pageCount-this.getBasePage()>2,u-=this.rightSheets.depth/2,this.rightSheets.element.position.z=u,u-=this.coverDepth+(this.rightSheets.element.visible?this.rightSheets.depth/2:0)+3*this.coverDepth,!0!==this.rightCover.isFlipping&&(this.rightCover.element.position.z=g?this.midPosition+this.coverDepth:u+this.coverDepth/2,this.rightCover.element.position.z=Math.max(this.rightCover.element.position.z,-(.05*this.refSize)),this.rightCover.element.position.x=0,this.rightSheets.sheetAngle=this.rightCover.sheetAngle=g?0:180,this.rightSheets.curveAngle=this.rightCover.curveAngle=g?0:180,!0===this.leftCover.isFlipping||(this.rightCover.height=m,this.rightCover.width=this.rightCover.sheetAngle<90?this.leftSheetWidth:this.rightSheetWidth,this.isClosedPage()||(this.rightCover.width+=this.coverExtraWidth,this.rightCover.height+=this.coverExtraHeight)),this.rightSheets.updateAngle(),this.rightCover.updateAngle()),this.updateSheets(),this.stage.ground.position.z=Math.min(h,u)-this.refSize*this.groundDistance/100,this.stage.ground.position.z=Math.max(this.stage.ground.position.z,-(.1*this.refSize))}else this.stage.ground.position.z=-this.midPosition-15*this.sheetDepth;!0===this.cameraPositionDirty&&this.updateCameraPosition(),this.refreshSpiral()}},{key:"refreshSpiral",value:function(){}},{key:"updateCameraPosition",value:function(){var e=this.app,t=this.stage,i=e.dimensions,n=i.padding,o=1/(2*Math.tan(Math.PI*t.camera.fov*.5/180)/(i.stage.height/e.zoomValue))+2.2;this.updateShadowSize(),this.stage.spotLight.position.x=-(330*this.pageScaleX),this.stage.spotLight.position.y=330*this.pageScaleX,this.stage.spotLight.position.z=550*this.pageScaleX,this.stage.spotLight.shadow.camera.far=1200*this.pageScaleX,this.stage.spotLight.shadow.camera.updateProjectionMatrix();var s=(n.top-n.bottom)/e.zoomValue/2,a=-(n.left-n.right)/e.zoomValue/2;t.camera.position.z!==o&&!0===e.pendingZoom&&(t.camera.position.z=o),1===e.zoomValue&&(this.bookWrapper.rotation.set(0,0,0),this.bookHelper.rotation.set(0,0,0),this.cameraWrapper.rotation.set(0,0,0),0!==e.options.flipbook3DTiltAngleUp||0!==e.options.flipbook3DTiltAngleLeft?(t.camera.aspect=i.stage.width/i.stage.height,t.camera.updateProjectionMatrix(),this.bookWrapper.rotateZ(THREE.Math.degToRad(-e.options.flipbook3DTiltAngleLeft)),this.bookWrapper.rotateX(THREE.Math.degToRad(-e.options.flipbook3DTiltAngleUp)),this.isVertical()?this.bookWrapper.scale.y=1/(this.isSingle?2:1):this.bookWrapper.scale.x=1/(this.isSingle?2:1),this.bookHelper.update(),this.fitCameraToCenteredObject(t.camera,this.bookWrapper),this.bookWrapper.rotation.set(0,0,0),this.bookWrapper.scale.x=1,this.bookWrapper.scale.y=1,t.camera.position.set(a,s,t.camera.position.z+t.ground.position.z),this.camera.aspect=i.stage.width/i.stage.height,this.camera.updateProjectionMatrix(),this.cameraWrapper.rotateX(THREE.Math.degToRad(e.options.flipbook3DTiltAngleUp)),this.cameraWrapper.rotateZ(THREE.Math.degToRad(e.options.flipbook3DTiltAngleLeft))):t.camera.position.set(a,s,o)),t.camera.updateProjectionMatrix(),this.app.renderRequestStatus=p.REQUEST_STATUS.ON,this.cameraPositionDirty=!1}},{key:"refreshSheet",value:function(e){var t,i=e.sheet,n=e.index,o=i.sheetAngle,s=!(i.isHard||0===this.flexibility);i.leftFlexibility=s?this.leftFlexibility:0,i.rightFlexibility=s?this.rightFlexibility:0,i.leftPos=this.midPosition+(n-e.midPoint+1)*this.sheetDepth-this.sheetDepth/2,i.rightPos=this.midPosition-(n-e.midPoint)*this.sheetDepth-this.sheetDepth/2,t=i.targetSide===p.TURN_DIRECTION.LEFT?0:180,!1===i.isFlipping&&(e.needsFlip?(i.isFlipping=!0,i.isCover&&0===e.sheetNumber&&(this.isRTL?this.rightCover.isFlipping=!0:this.leftCover.isFlipping=!0),i.isCover&&this.totalSheets-e.sheetNumber==1&&(this.isRTL?this.leftCover.isFlipping=!0:this.rightCover.isFlipping=!0),i.element.position.z=Math.max(o<90?i.leftPos:i.rightPos,this.midPosition)+this.sheetDepth,i.flexibility=o<90?i.leftFlexibility:i.rightFlexibility,i.flip(o,t)):(i.skipFlip=!1,i.sheetAngle=i.curveAngle=t,i.flexibility=t<90?i.leftFlexibility:i.rightFlexibility,i.element.position.z=t<90?i.leftPos:i.rightPos,i.side=i.targetSide,i.height=t<90?this.leftSheetHeight:this.rightSheetHeight,i.width=t<90?this.leftSheetWidth:this.rightSheetWidth),i.updateAngle(),this.app.renderRequestStatus=p.REQUEST_STATUS.ON),i.element.visible=e.visible}},{key:"updateCenter",value:function(){var e=this,t=this.app,i=this.isVertical(),n=i?e.wrapper.position.y:e.wrapper.position.x,o=(this.isVertical()?-1:1)*e.centerShift*(this.isLeftPage()?i?this.leftSheetHeight:this.leftSheetWidth:i?this.rightSheetHeight:this.rightSheetWidth)/2;e.seamPositionY=(t.dimensions.padding.heightDiff+t.dimensions.containerHeight)/2-o,e.seamPositionX=(-t.dimensions.offset.width+t.dimensions.containerWidth)/2+o,o!==e.centerEnd&&(e.centerTween&&e.centerTween.stop&&e.centerTween.stop(),e.onCenterStartAnimation(this),e.centerTween=new TWEEN.Tween({x:n}).delay(0).to({x:o},1===t.zoomValue&&!0!==e.skipCenterAnimation?e.app.options.duration:1).onStart(function(){}).onUpdate(function(){e.onCenterUpdateAnimation(this)}).onComplete(function(){e.onCenterCompleteAnimation(this)}).onStop(function(){e.onCenterStopAnimation(this)}).easing(TWEEN.Easing.Cubic.InOut).start(),this.updatePendingStatusClass(),e.skipCenterAnimation=!1,e.centerEnd=o),e.renderRequestStatus=p.REQUEST_STATUS.ON,this.zoomViewer.updateCenter()}},{key:"onCenterUpdateAnimation",value:function(e){this.isVertical()?(this.wrapper.position.y=e.x,this.stage&&this.stage.cssScene&&(this.stage.cssScene.position.y=e.x)):(this.wrapper.position.x=e.x,this.stage&&this.stage.cssScene&&(this.stage.cssScene.position.x=e.x))}},{key:"onCenterStartAnimation",value:function(e){}},{key:"onCenterStopAnimation",value:function(e){}},{key:"onCenterCompleteAnimation",value:function(e){}},{key:"flipCover",value:function(e){var t,i,n=null;0===e.pageNumber||this.isBooklet&&1===e.pageNumber?(n=this.isRTL?this.rightCover:this.leftCover,t=this.isRTL?1:-1):e.pageNumber===this.totalSheets-1&&(n=this.isRTL?this.leftCover:this.rightCover,t=this.isRTL?-1:1),null!==n&&(i=n.depth+e.depth+1,n.sheetAngle=e.sheetAngle,n.curveAngle=e.curveAngle,this.rightCover.height=this.leftCover.height=e.height+this.coverExtraHeight,this.rightCover.width=this.leftCover.width=e.width+this.coverExtraWidth,n.flexibility=e.flexibility,this.rightCover.updateAngle(),this.leftCover.updateAngle(),n.element.position.x=e.element.position.x+t*Math.sin(e.sheetAngle*Math.PI/180)*i,n.element.position.z=e.element.position.z+t*Math.cos(e.sheetAngle*Math.PI/180)*i)}},{key:"pagesReady",value:function(){if(!this.isAnimating()&&!0===this.refreshRequested){if(!1===this.app.options.flipbookFitPages){var e=this.app.viewer.getBasePage(),t=this.leftViewport=this.getViewPort(e+(this.isBooklet?0:this.isRTL?1:0)),i=this.rightViewPort=this.getViewPort(e+(this.isBooklet?0:this.isRTL?0:1));if(t){var n=eW.contain(t.width,t.height,this.availablePageWidth(),this.availablePageHeight());(this.leftSheetWidth!=Math.floor(n.width)||this.leftSheetHeight!=Math.floor(n.height))&&(this.cameraPositionDirty=!0),this.leftSheetWidth=Math.floor(n.width),this.leftSheetHeight=Math.floor(n.height)}if(i){var o=eW.contain(i.width,i.height,this.availablePageWidth(),this.availablePageHeight());(this.rightSheetWidth!=Math.floor(o.width)||this.rightSheetWidth!=Math.floor(o.height))&&(this.cameraPositionDirty=!0),this.rightSheetWidth=Math.floor(o.width),this.rightSheetHeight=Math.floor(o.height)}for(var s=0;s<this.sheets.length;s++){var a=this.sheets[s];a.side===p.TURN_DIRECTION.LEFT?(a.height=this.leftSheetHeight,a.width=this.leftSheetWidth):(a.height=this.rightSheetHeight,a.width=this.rightSheetWidth),a.updateAngle()}if(this.isClosedPage()){var r=this.isRTL&&this.isLastPage()||!this.isRTL&&this.isFirstPage();this.leftCover.width=this.rightCover.width=r?this.rightSheetWidth:this.leftSheetWidth,this.leftCover.height=this.rightCover.height=r?this.rightSheetHeight:this.leftSheetHeight}else this.leftCover.height=this.rightCover.height=this.coverExtraHeight+Math.max(this.leftSheetHeight,this.rightSheetHeight),this.leftCover.width=this.coverExtraWidth+this.leftSheetWidth,this.rightCover.width=this.coverExtraWidth+this.rightSheetWidth;this.leftSheets.width=this.leftSheetWidth,this.leftSheets.height=this.leftSheetHeight,this.rightSheets.height=this.rightSheetHeight,this.rightSheets.width=this.rightSheetWidth,this.leftCover.updateAngle(),this.leftSheets.updateAngle(),this.rightCover.updateAngle(),this.rightSheets.updateAngle(),this.updateSheets(!0)}this.updateCenter(),this.updateCSSLayer(),this.updatePendingStatusClass(),this.refreshSpiral(),!0===this.cameraPositionDirty&&this.updateCameraPosition(),this.app.executeCallback("onPagesReady")}}},{key:"updateSheets",value:function(e){if(!0!==this.isClosedPage()){var t=this.getPageByNumber(this.getRightPageNumber());if(!0!==this.rightCover.isFlipping&&t&&t.sheet.element.geometry.attributes){var i=this.rightSheets.element.geometry.attributes.position,n=e?t.sheet.element.geometry.boundingBox.max.x*t.sheet.element.scale.x:this.rightSheets.lastSlopeX;i.setX(21,n),i.setX(23,n),i.setX(4,n),i.setX(6,n),i.setX(10,n),i.setX(14,n),i.needsUpdate=!0,this.rightSheets.element.geometry.attributes.uv.needsUpdate=!0,this.rightSheets.element.geometry.computeVertexNormals(),e&&(this.rightSheets.lastSlopeX=n)}var o=this.getPageByNumber(this.getLeftPageNumber());if(!0!==this.leftCover.isFlipping&&o&&o.sheet.element.geometry.attributes){var s=this.leftSheets.element.geometry.attributes.position,a=e?o.sheet.element.geometry.boundingBox.min.x*o.sheet.element.scale.x:this.leftSheets.lastSlopeX;s.setX(16,a),s.setX(18,a),s.setX(5,a),s.setX(7,a),s.setX(8,a),s.setX(12,a),s.needsUpdate=!0,this.leftSheets.element.geometry.attributes.uv.needsUpdate=!0,this.leftSheets.element.geometry.computeVertexNormals(),e&&(this.leftSheets.lastSlopeX=a)}}}},{key:"updateCSSLayer",value:function(){}},{key:"mouseMove",value:function(e){if(e=eW.fixMouseEvent(e),this.app.renderRequestStatus=p.REQUEST_STATUS.ON,null!=e.touches&&2===e.touches.length){this.pinchMove(e);return}var t=this.eventToPoint(e);if(null!==this.dragSheet&&!1!==this.drag3D&&Math.abs(t.x-this.startPoint.x)>2){!0!==this.isDragging&&(this.updatePendingStatusClass(!0),this.isDragging=!0);var i=this.dragSheet.width,n=t.x-(this.app.dimensions.origin.x+this.centerEnd-i),o=eW.limitAt(1-n/i,-1,1),s=eW.toDeg(Math.acos(o)),a=this.dragSheet,r=this.drag===p.TURN_DIRECTION.LEFT;a.sheetAngle=s;var l=eW.getCurveAngle(r,s,45);a.isCover&&a.viewer.flipCover(a),a.curveAngle=a.isHard?s:l,a.updateAngle()}this.checkSwipe(t,e)}},{key:"mouseUp",value:function(e){if((e=eW.fixMouseEvent(e)).touches||0===e.button){if(null==this.dragSheet&&null!=e.touches&&0===e.touches.length){this.pinchUp(e);return}var t=this.eventToPoint(e);if(1===this.app.zoomValue){if(null!==this.dragSheet){var i=t.x-this.startPoint.x;Math.abs(i)>2*this.swipeThreshold&&(this.drag===p.TURN_DIRECTION.LEFT&&i>0?this.app.openLeft():this.drag===p.TURN_DIRECTION.RIGHT&&i<0&&this.app.openRight()),this.requestRefresh(),this.updatePendingStatusClass()}var n=e.target||e.originalTarget,o=this.startPoint&&t.x===this.startPoint.x&&t.y===this.startPoint.y&&"A"!==n.nodeName;!0===e.ctrlKey&&o?this.zoomOnPoint(t):o&&t.sheet&&this.clickAction===p.MOUSE_CLICK_ACTIONS.NAV&&(t.sheet.sheetAngle>90?this.app.openRight():this.app.openLeft())}this.dragSheet=null,this.drag=null,!0===this.isDragging&&(this.isDragging=!1),this.startPoint=null,this.canSwipe=!1,this.app.renderRequestStatus=p.REQUEST_STATUS.ON}}},{key:"raycastCLick",value:function(e){this.mouse=new THREE.Vector2,this.raycaster=new THREE.Raycaster,this.mouse.x=e.offsetX/this.app.dimensions.stage.width*2-1,this.mouse.y=1-e.offsetY/this.app.dimensions.stage.height*2,this.raycaster.setFromCamera(this.mouse,this.camera);var t=this.raycaster.intersectObjects(this.bookWrapper.children,!0);if(t.length>0){var i,n=0;do{if((i=null!=t[n]?t[n].object:null).sheet&&i.sheet.index&&!0!==i.sheet.isFlipping)return i;n++}while(n<t.length)}}},{key:"mouseDown",value:function(e){if((e=eW.fixMouseEvent(e)).touches||0===e.button){if(null!=e.touches&&2===e.touches.length)this.pinchDown(e);else{e=eW.fixMouseEvent(e);var t=this.eventToPoint(e);this.startPoint=t,this.lastPosX=t.x,this.lastPosY=t.y;var i=this.raycastCLick(e),n=t.sheet?t.sheet.width-Math.abs(t.x-(this.app.dimensions.origin.x+this.centerEnd)):0;t.sheet&&i&&t.isInsideSheet&&n<t.sheet.width/2?(this.dragSheet=i.sheet,this.drag=t.sheet.sheetAngle<90?p.TURN_DIRECTION.LEFT:p.TURN_DIRECTION.RIGHT):this.canSwipe=!0}}}},{key:"eventToPoint",value:function(e){var t=this.app.dimensions,i={x:(e=eW.fixMouseEvent(e)).clientX,y:e.clientY};i.x=i.x-this.parentElement[0].getBoundingClientRect().left,i.y=i.y-this.parentElement[0].getBoundingClientRect().top;var n=(-t.offset.width+t.containerWidth)/2-t.stage.width/2,o=(-t.offset.width+t.containerWidth)/2+t.stage.width/2,s=t.padding.top,a=t.padding.top+this.availablePageHeight(),r=this.isVertical()?i.y<this.seamPositionY:i.x<this.seamPositionX,l=this.getBasePage()+(r?0:1),h=this.getPageByNumber(l);h&&(h=h.sheet);var u=i.x>n&&i.x<o&&i.y>s&&i.y<a;return{isInsideSheet:u,isInsideDragZone:u&&i.x-n<this.foldSense||o-i.x<this.foldSense,x:i.x,y:i.y,left:n,top:s,right:o,bottom:a,raw:i,isLeftSheet:r,sheet:h}}},{key:"textureLoadedCallback",value:function(e){this.app.renderRequestStart(),this.pagesReady()}},{key:"getTextureSize",value:function(e){var t=eD(eF(i.prototype),"getTextureSize",this).call(this,e);if(1!==this.app.zoomValue||!0===e.isAnnotation)return t;var n=eW.nearestPowerOfTwo(t.height),o=t.width*n/t.height;return this.texturePowerOfTwo?{height:n,width:o}:t}},{key:"getPageByNumber",value:function(e){if(this.has3DCover){var t=!this.isBooklet&&e===this.app.pageCount&&e%2==0,n=1===e;if(!this.isRTL&&n||this.isRTL&&t)return this.leftCover.frontPage;if(!this.isRTL&&t||this.isRTL&&n)return this.rightCover.backPage}return eD(eF(i.prototype),"getPageByNumber",this).call(this,e)}},{key:"setPage",value:function(e){return eD(eF(i.prototype),"setPage",this).call(this,e)}},{key:"beforeFlip",value:function(){eD(eF(i.prototype),"beforeFlip",this).call(this)}}]),i}(Q),eG=/*#__PURE__*/function(e){eB(i,e);var t=eU(i);function i(e){eA(this,i);var n,o=eI(n=t.call(this,e));return o.element=null,o.face=e.face,o.parent3D=e.sheet,o.sheet=e.sheet,o.cssPage=new THREE.CSS3DObject(o.contentLayer[0]),n}return ez(i,[{key:"setLoading",value:function(){this.sheet.viewer.checkPageLoading()}},{key:"clearMap",value:function(){this.sheet.element.material[this.face].map=null,this.sheet.element.material[this.face].needsUpdate=!0}},{key:"loadTexture",value:function(e){var t=this,i=e.texture,n=e.callback;function o(i,o){t.updateTextureLoadStatus(!0),t.sheet.resetMatColor(t.face,e.texture===t.textureLoadFallback),"function"==typeof n&&n(e)}t.textureSrc=i,"function"==typeof p.defaults.beforeLoadTexture&&p.defaults.beforeLoadTexture({texture:i,page:t}),4===this.face?this.sheet.backImage(i,o):this.sheet.frontImage(i,o)}}]),i}(_);function eZ(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eK(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function eX(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eQ(e,t,i){return t&&eX(e.prototype,t),i&&eX(e,i),e}function eY(e){return(eY=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eJ(e,t){return(eJ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function e$(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}p.defaults.maxTextureSize=2048,p.viewers={},p.viewers.flipbook=function e(t,i){return(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),!1==p.utils.canSupport3D()&&(t.is3D=!1),p.utils.isTrue(t.is3D))?new eq(t,i):new ep(t,i)},p.viewers.default=p.viewers.reader=B,p.viewers.slider=eE;var e0=p.jQuery,e1=p.utils,e2=/*#__PURE__*/function(){function e(){eK(this,e),this.baseUrl=null,this.pdfDocument=null,this.pdfApp=null,this.pdfHistory=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._pagesRefCache=null}return eQ(e,[{key:"dispose",value:function(){this.baseUrl=null,this.pdfDocument=null,this.pdfApp=null,this.pdfHistory=null,this._pagesRefCache=null}},{key:"setDocument",value:function(e,t){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}},{key:"setViewer",value:function(e){this.pdfApp=e,this.externalLinkTarget=e.options.linkTarget}},{key:"setHistory",value:function(e){this.pdfHistory=e}},{key:"pagesCount",get:function(){return this.pdfDocument.numPages}},{key:"page",get:function(){return this.pdfApp.currentPageNumber},set:function(e){this.pdfApp.gotoPage(e)}},{key:"navigateTo",value:function(e){this.goToDestination(e)}},{key:"addLinkAttributes",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];var i=this.externalLinkTarget,n=this.externalLinkRel,o=this.externalLinkEnabled;if(!t||"string"!=typeof t)throw Error('A valid "url" parameter must provided.');var s=(0,e1.removeNullCharacters)(t);o?e.href=e.title=s:(e.href="",e.title="Disabled: ".concat(s),e.onclick=function(){return!1});var a="";switch(i){case p.LINK_TARGET.NONE:break;case p.LINK_TARGET.SELF:a="_self";break;case p.LINK_TARGET.BLANK:a="_blank";break;case p.LINK_TARGET.PARENT:a="_parent";break;case p.LINK_TARGET.TOP:a="_top"}e.target=a,e.rel="string"==typeof n?n:"noopener noreferrer nofollow"}},{key:"goToDestination",value:function(e){var t,i="",n=this,o=function(t){e1.log("Requested: ",t);var s=t instanceof Object?n._pagesRefCache[t.num+" "+t.gen+" R"]:t+1;s?((s=n.pdfApp.viewer.getViewerPageNumber(s))>n.pdfApp.pageCount&&(s=n.pdfApp.pageCount),e1.log("Loading for:",t," at page ",s),n.pdfApp.requestDestRefKey===t.num+" "+t.gen+" R"?(n.pdfApp.gotoPage(s),n.pdfHistory&&n.pdfHistory.push({dest:e,hash:i,page:s})):e1.log("Expired Request for ",s," with ",t)):(n.pdfApp.container.addClass("df-fetch-pdf"),n.pdfDocument.getPageIndex(t).then(function(e){var i=t.num+" "+t.gen+" R";n._pagesRefCache[i]=e+1,o(t)}))};"string"==typeof e?(i=e,t=this.pdfDocument.getDestination(e)):t=Promise.resolve(e),t.then(function(t){e1.log("Started:",t),e=t,t instanceof Array&&(n.pdfApp.requestDestRefKey=t[0].num+" "+t[0].gen+" R",o(t[0]))})}},{key:"customNavigateTo",value:function(e){if(""!==e&&null!=e&&"null"!==e){var t=null;if(isNaN(Math.floor(e))){if("string"==typeof e&&isNaN(t=parseInt(e.replace("#",""),10))){window.open(e,this.pdfApp.options.linkTarget===p.LINK_TARGET.SELF?"_self":"_blank");return}}else t=e;null!=t&&this.pdfApp.gotoPage(t)}}},{key:"getDestinationHash",value:function(e){if("string"==typeof e)return this.getAnchorUrl("#"+escape(e));if(e instanceof Array){var t=e[0],i=t instanceof Object?this._pagesRefCache[t.num+" "+t.gen+" R"]:t+1;if(i){var n=this.getAnchorUrl("#page="+i),o=e[1];if((void 0===o?"undefined":e$(o))==="object"&&"name"in o&&"XYZ"===o.name){var s=e[4]||this.pdfApp.pageScaleValue,a=parseFloat(s);a&&(s=100*a),n+="&zoom="+s,(e[2]||e[3])&&(n+=","+(e[2]||0)+","+(e[3]||0))}return n}}return this.getAnchorUrl("")}},{key:"getCustomDestinationHash",value:function(e){return"#"+escape(e)}},{key:"getAnchorUrl",value:function(e){return(this.baseUrl||"")+e}},{key:"executeNamedAction",value:function(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page++;break;case"PrevPage":this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}var t=document.createEvent("CustomEvent");t.initCustomEvent("namedaction",!0,!0,{action:e}),this.pdfApp.container.dispatchEvent(t)}},{key:"cachePageRef",value:function(e,t){var i=t.num+" "+t.gen+" R";this._pagesRefCache[i]=e}}]),e}(),e3=/*#__PURE__*/function(){function e(t,i){eK(this,e),this.props=t,this.app=i,this.textureCache=[],this.pageCount=0,this.numPages=0,this.outline=[],this.viewPorts=[],this.requestedPages="",this.requestIndex=0,this.pagesToClean=[],this.defaultPage=void 0,this.pageSize=this.app.options.pageSize,this._page1Pass=!1,this._page2Pass=!1,this.pageLabels=void 0,this.textSearchLength=0,this.textSearch="",this.textContentSearch=[],this.textContentJoinedSearch=[],this.textOffsetSearch=[],this.textContent=[],this.textContentJoined=[],this.textOffset=[],this.autoLinkItemsCache=[],this.autoLinkHitsCache=[],this.searchHitItemsCache=[],this.searchHits=[],this.PDFLinkItemsCache=[],this.canPrint=!0,this.textPostion=[],this.renderTime=0}return eQ(e,[{key:"finalize",value:function(){}},{key:"dispose",value:function(){}},{key:"softDispose",value:function(){}},{key:"setCache",value:function(e,t,i){i&&(void 0===this.textureCache[i]&&(this.textureCache[i]=[]),this.textureCache[i][e]=t)}},{key:"getCache",value:function(e,t){return void 0===this.textureCache[t]?void 0:this.textureCache[t][e]}},{key:"_isValidPage",value:function(e){return e>0&&e<=this.pageCount}},{key:"getLabelforPage",value:function(e){return this.pageLabels&&void 0!==this.pageLabels[e-1]?this.pageLabels[e-1]:e}},{key:"getThumbLabel",value:function(e){var t=this.getLabelforPage(e);return t!==e?t+" ("+e+")":e}},{key:"getPageNumberForLabel",value:function(e){if(!this.pageLabels)return e;var t=this.pageLabels.indexOf(e);return t<0?null:t+1}},{key:"processPage",value:function(e){}},{key:"cleanUpPages",value:function(){}},{key:"checkRequestQueue",value:function(){}},{key:"processAnnotations",value:function(){}},{key:"processTextContent",value:function(){}},{key:"loadDocument",value:function(){}},{key:"pagesLoaded",value:function(){this._page1Pass&&this._page2Pass&&(this.app.viewer.checkDocumentPageSizes(),this.finalize())}},{key:"_documentLoaded",value:function(){this.finalizeOutLine(),this.app&&this.app.dimensions&&void 0===this.app.dimensions.pageFit&&e1.log("Provider needs to initialize page properties for the app"),this.app._documentLoaded()}},{key:"finalizeOutLine",value:function(){if(null!==this.app&&null!==this.app.options){var e=this.app.options.outline;if(e)for(var t=0;t<e.length;t++)e[t].custom=!0,e[t].dest=e[t].dest.replace(/javascript:/g,""),this.outline.push(e[t])}}},{key:"search",value:function(){}}]),e}(),e5=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eJ(e,t)}(o,e);var t,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=eY(o);return e=t?Reflect.construct(i,arguments,eY(this).constructor):i.apply(this,arguments),e&&("object"===e$(e)||"function"==typeof e)?e:eZ(this)});function o(e,t){eK(this,o);var i,s=(i=n.call(this,e,t)).app,a=eZ(i);return a.pdfDocument=void 0,a._page2Ratio=void 0,a.cacheBustParameters="?ver="+p.version+"&pdfver="+s.options.pdfVersion,!0!==e.skipInit&&i.init(),i}return eQ(o,[{key:"init",value:function(){var e,t=this.app,n=this;function o(e){t.updateInfo(t.options.text.loading+" PDF Worker ...");var i=document.createElement("a");i.href=t.options.pdfjsWorkerSrc+n.cacheBustParameters,i.hostname!==window.location.hostname&&!0===p.loadCorsPdfjsWorker?(t.updateInfo(t.options.text.loading+" PDF Worker CORS ..."),e0.ajax({url:t.options.pdfjsWorkerSrc+n.cacheBustParameters,cache:!0,success:function(i){t.options.pdfjsWorkerSrc=e1.createObjectURL(i,"text/javascript"),"function"==typeof e&&e()}})):"function"==typeof e&&e()}e=function(){pdfjsLib.GlobalWorkerOptions.workerSrc=t.options.pdfjsWorkerSrc+n.cacheBustParameters,pdfjsLib.canvasWillReadFrequently=p.defaults.canvasWillReadFrequently,n.loadDocument()},"undefined"==typeof pdfjsLib?(t.updateInfo(t.options.text.loading+" PDF Service ..."),e1.getScript(t.options.pdfjsSrc+n.cacheBustParameters,function(){"function"==typeof define&&i.amdO&&window.requirejs&&window.require&&window.require.config?(t.updateInfo(t.options.text.loading+" PDF Service (require) ..."),window.require.config({paths:{"pdfjs-dist/build/pdf.worker":t.options.pdfjsWorkerSrc.replace(".js","")}}),window.require(["pdfjs-dist/build/pdf"],function(t){window.pdfjsLib=t,o(e)})):o(e)},function(){t.updateInfo("Unable to load PDF service.."),n.dispose()},t.options.pdfjsSrc.indexOf("pdfjs-4")>1||t.options.pdfjsSrc.indexOf("pdfjs-5")>1)):"function"==typeof e&&e()}},{key:"dispose",value:function(){this.pdfDocument&&this.pdfDocument.destroy(),this.linkService=e1.disposeObject(this.linkService),this.pdfLoadProgress&&this.pdfLoadProgress.destroy(),this.pdfLoadProgress=null,this.pdfDocument=null}},{key:"loadDocument",value:function(){var e=this.app,t=this.app.options,i=this,n=t.pdfParameters||{};if(n.url=e1.httpsCorrection(n.url||t.source),n.rangeChunkSize=t.rangeChunkSize,n.cMapPacked=!0,n.disableAutoFetch=t.disableAutoFetch,n.disableStream=t.disableStream,n.disableRange=!0===t.disableRange,n.disableFontFace=t.disableFontFace,n.isEvalSupported=!1,n.cMapUrl=t.cMapUrl,n.imagesLocation=t.imagesLocation,n.imageResourcesPath=t.imageResourcesPath,!n.url&&!n.data&&!n.range){e.updateInfo("ERROR:No PDF File provided! ","df-error");return}var o=i.pdfLoadProgress=pdfjsLib.getDocument(n);o._worker.promise.then(function(t){e.updateInfo(e.options.text.loading+" PDF ...")}),o.onPassword=function(e,t){switch(t){case pdfjsLib.PasswordResponses.NEED_PASSWORD:var i=prompt("Enter the password to open the PDF file.");if(null===i)throw Error("No password givsen.");e(i);break;case pdfjsLib.PasswordResponses.INCORRECT_PASSWORD:var i=prompt("Invalid password. Please try again.");if(!i)throw Error("No password givaen.");e(i)}},o.promise.then(function(n){i.pdfDocument=n,n.getPage(1).then(function(o){i.defaultPage=o;var s,a=i.defaultPage.viewPort=o.getViewport({scale:1,rotation:o._pageInfo.rotate+e.options.pageRotation}),r=i.defaultPage.pageRatio=a.width/a.height;i.viewPorts[1]=a,e.dimensions.defaultPage={ratio:r,viewPort:a,width:a.width,height:a.height},e.dimensions.maxTextureHeight=(null!==(s=t.maxTextureSize)&&void 0!==s?s:3200)/(r>1?r:1),e.dimensions.maxTextureWidth=e.dimensions.maxTextureHeight*r,e.dimensions.autoHeightRatio=1/r,i.pageCount=n.numPages,i.numPages=n.numPages,i._page1Pass=!0,i.pagesLoaded()}),n.numPages>1&&!0===e.checkSecondPage?n.getPage(2).then(function(t){var n=t.getViewport({scale:1,rotation:t._pageInfo.rotate+e.options.pageRotation});i._page2Ratio=n.width/n.height,i.viewPorts[2]=n,i._page2Pass=!0,i.pagesLoaded()}):(i._page2Pass=!0,i.pagesLoaded())}).catch(function(t){if(null!==e&&null!=e.options){var n,o="",s=document.createElement("a");s.href=e.options.source,s.hostname===window.location.hostname||-1!==s.href.indexOf("file://")||e1.isChromeExtension()||-1!==s.href.indexOf("blob:")||(o="<strong>CROSS ORIGIN!! </strong>");var a=(null===(n=e.options)||void 0===n?void 0:n.fileName)||s.href;e.updateInfo(o+"<strong>Error: Cannot access file!  </strong>"+a+"<br><br>"+t.message,"df-error"),console.log(t),e.container.removeClass("df-loading").addClass("df-error"),i.dispose()}}),o.getTotalLength=function(){return i.pdfLoadProgress._transport._networkStream._fullRequestReader.contentLength},o.onProgress=function(t){if(null!==e){var i=100*t.loaded/o.getTotalLength();isNaN(i)?t&&t.loaded?(void 0===o.lastLoaded||o.lastLoaded+25e4<t.loaded)&&(o.lastLoaded=t.loaded,e.updateInfo(e.options.text.loading+" PDF "+(Math.ceil(t.loaded/1e4)/100).toFixed(2).toString()+"MB ...")):e.updateInfo(e.options.text.loading+" PDF ..."):e.updateInfo(e.options.text.loading+" PDF "+Math.ceil(Math.min(100,i)).toString().split(".")[0]+"% ...")}}}},{key:"pdfFetchStarted",value:function(){this.pdfFetchStatusCount=0,this.app.container.addClass("df-fetch-pdf"),this.pdfFetchStatus=p.REQUEST_STATUS.COUNT}},{key:"checkRequestQueue",value:function(){}},{key:"finalize",value:function(){var e=this.app,t=this;null!==e&&null!==e.options&&(t.linkService=new e2,t.linkService.setDocument(t.pdfDocument,null),t.linkService.setViewer(e),t.pdfDocument.getOutline().then(function(i){!0===e.options.overwritePDFOutline&&(i=[]),i=i||[],t.outline=i}).finally(function(){t._getLabels()}))}},{key:"_getLabels",value:function(){var e=this.app,t=this;t.pdfDocument.getPageLabels().then(function(i){if(i&&!0!==e.options.disablePageLabels){for(var n=i.length,o=0,s=0,a=0;a<n;a++){var r=i[a];if(r===(a+1).toString())o++;else if(""===r)s++;else break}o>=n||s>=n||(t.pageLabels=i)}}).finally(function(){t._getPermissions()})}},{key:"_getPermissions",value:function(){var e=this.app,t=this;t.pdfDocument.getPermissions().then(function(i){null!==i&&Array.isArray(i)&&(t.canPrint=i.indexOf(pdfjsLib.PermissionFlag.PRINT)>-1,!1==t.canPrint&&(console.log("PDF printing is disabled."),e.options.showPrintControl=e.options.showPrintControl&&t.canPrint))}).finally(function(){t._documentLoaded()})}},{key:"processPage",value:function(e){var t=this.app,i=this,n=e.pageNumber,o=0,s="",a=t.viewer.getTextureSize(e);if(!0===DEARFLIP.defaults.cachePDFTexture&&void 0!==this.getCache(n,a.height)){t.applyTexture(this.getCache(n,a.height),e),e1.log("Texture loaded from cache for:"+n);return}var r=t.viewer.getDocumentPageNumber(n);e1.log("Requesting PDF Page:"+r),i.pdfDocument.getPage(r).then(function(l){i.viewPorts[n]||(e.isFreshPage=!0,i.viewPorts[n]=l.getViewport({scale:1,rotation:l._pageInfo.rotate+t.options.pageRotation}));var h,u=t.viewer.getRenderContext(l,e);i.viewPorts[n].lastScale=u.viewport.scale,i.viewPorts[n].lastHeight=u.canvas.height,e.isFreshPage&&(null===(h=t.viewer.getPageByNumber(e.pageNumber))||void 0===h||h.changeTexture(e.pageNumber,u.canvas.height)),s=u.canvas.width+"x"+u.canvas.height,e1.log("Page "+n+" rendering - "+s),e.trace=i.requestIndex++,i.requestedPages+=","+e.trace+"["+r+"|"+u.canvas.height+"]",l.cleanupAfterRender=!1,o=performance.now(),l.render(u).promise.then(function(){if(t.applyTexture(u.canvas,e),!0===DEARFLIP.defaults.cachePDFTexture&&i.setCache(e.pageNumber,u.canvas,a.height),!0===t.options.cleanupAfterRender){var h=","+e.trace+"["+r+"|"+u.canvas.height+"]";i.requestedPages.indexOf(h)>-1&&(i.requestedPages=i.requestedPages.replace(h,""),-1==i.requestedPages.indexOf("["+r+"|")&&(i.pagesToClean.push(l),i.pagesToClean.length>0&&i.cleanUpPages()))}u=null;var p=performance.now()-o;i.renderTime+=p,e1.log("Rendered "+n+" in "+p+" ms:"+s)}).catch(function(e){console.log(e)})}).catch(function(e){console.log(e)})}},{key:"cleanUpPages",value:function(){for(;this.pagesToClean.length>0;)this.pagesToClean.splice(-1)[0].cleanup()}},{key:"clearSearch",value:function(){this.searchHits=[],this.searchHitItemsCache=[],this.totalHits=0,this.app.searchResults.html(""),this.app.container.removeClass("df-search-open"),this.textSearch="",this.app.container.find(".df-search-hits").remove()}},{key:"search",value:function(e){if(this.textSearch!==e){if(this.clearSearch(),e.length<3&&""!=e){this.app.updateSearchInfo(this.app.options.text.searchMinimum);return}this.textSearch=e,this.textSearchLength=e.length,this.app.searchContainer.addClass("df-searching"),this.app.container.addClass("df-fetch-pdf"),this._search(e,1)}}},{key:"_search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this;i.app.updateSearchInfo(i.app.options.text.searchSearchingInfo+" "+t),i.searchPage(t).then(function(n){for(var o,s=RegExp(e,"gi"),a=[];o=s.exec(n);)a.push({index:o.index,length:i.textSearchLength});if(i.searchHits[t]=a,a.length>0){var r=i.app.viewer.searchPage(t);!0===r.include&&(i.totalHits+=a.length,i.app.searchResults.append('<div class="df-search-result '+(i.app.currentPageNumber===t?"df-active":"")+'" data-df-page="'+t+'"><span>'+i.app.options.text.searchResultPage+" "+r.label+"</span><span>"+a.length+" "+(a.length>1?i.app.options.text.searchResults:i.app.options.text.searchResult)+"</span></div>"))}i.app.viewer.isActivePage(t)&&(i.processTextContent(t,i.app.viewer.getTextElement(t,!0)),i.app.ui.update()),i._search(e,t+1)}).catch(function(){}).finally(function(){0===i.totalHits?i.app.updateSearchInfo(i.app.options.text.searchResultsNotFound):i.app.updateSearchInfo(i.totalHits+" "+i.app.options.text.searchResultsFound),i.app.searchContainer.removeClass("df-searching"),i.app.container.removeClass("df-fetch-pdf")})}},{key:"prepareTextContent",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this;if(void 0==n.textContentJoinedSearch[t]||i){var o,n=this,s=0,a=0,r=0;n.textContentSearch[t]=[],n.textContent[t]=[],n.textOffsetSearch[t]=[],n.textOffset[t]=[],n.textContentJoinedSearch[t]=[],n.textContentJoined[t]=[];for(var l=0;l<e.items.length;l++)o=e.items[l],n.textContentSearch[t].push(!0===o.hasEOL?o.str+" ":o.str),n.textContent[t].push(o.str+" "),a+=r=(o.str.length||0)+(!0===o.hasEOL?1:0),n.textOffsetSearch[t].push({length:r,offset:a-r}),s+=r=(o.str.length||0)+1,n.textOffset[t].push({length:r,offset:s-r});n.textContentJoinedSearch[t]=n.textContentSearch[t].join(""),n.textContentJoined[t]=n.textContent[t].join("")}}},{key:"searchPage",value:function(e){var t=this;return new Promise(function(i,n){if(t._isValidPage(e))try{var o=t.app.viewer.getDocumentPageNumber(e);void 0==t.textContentJoinedSearch[o]?t.pdfDocument.getPage(o).then(function(e){e.getTextContent().then(function(e){t.prepareTextContent(e,o),i(t.textContentJoinedSearch[o])})}):i(t.textContentJoinedSearch[o])}catch(e){e1.log(e),n(e)}else n()})}}]),o}(e3);function e8(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e9(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function e4(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function e7(e,t,i){return t&&e4(e.prototype,t),i&&e4(e,i),e}function e6(e){return(e6=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e,t){return(te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}p.providers.pdf=e5;var tt=p.jQuery,ti=p.utils,tn=/*#__PURE__*/function(){function e(t){e9(this,e),this._viewPort=new ts(0,0),this._pageInfo={rotate:0},this.src=t.src}return e7(e,[{key:"getViewport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{scale:1};return new ts(this._viewPort.height*e.scale,this._viewPort.width*e.scale,e.scale)}}]),e}(),to=/*#__PURE__*/function(){function e(t){e9(this,e),this.source=[],this.pages=[],this.numPages=t.length;for(var i=0;i<t.length;i++)this.source[i]=ti.httpsCorrection(t[i].toString()),this.pages.push(new tn({src:this.source[i]}))}return e7(e,[{key:"getPage",value:function(e){var t=this;return new Promise(function(i,n){try{var o=tt("<img/>");o.attr("src",t.source[e-1]),o[0].crossOrigin="Anonymous",o.on("load",function(){tt(this).off();var e=new tn({src:this.src});e._viewPort.height=this.height,e._viewPort.width=this.width,e._viewPort.scale=1,e.image=this,i(e)})}catch(e){n(e)}})}}]),e}(),ts=/*#__PURE__*/function(){function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;e9(this,e),this.scale=n,this.height=t,this.width=i,this.scale=n,this.transform=[0,0,0,0,0,this.height]}return e7(e,[{key:"clone",value:function(){return new e(this.height,this.width,this.scale)}}]),e}(),ta=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(n,e);var t,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=e6(n);return e=t?Reflect.construct(i,arguments,e6(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:e8(this)});function n(e,t){e9(this,n);var o,s=(o=i.call(this,e,t)).app,a=e8(o);return a.document=new to(s.options.source),a.pageCount=a.document.numPages,a.numPages=a.document.numPages,a.loadDocument(),o}return e7(n,[{key:"dispose",value:function(){}},{key:"loadDocument",value:function(){var e=this.app,t=this.app.options,i=this;i.document.getPage(1).then(function(n){i.defaultPage=n;var o,s=i.defaultPage.viewPort=n._viewPort,a=i.defaultPage.pageRatio=s.width/s.height;i.viewPorts[1]=s,e.dimensions.defaultPage={ratio:a,viewPort:s,width:s.width,height:s.height},e.dimensions.maxTextureHeight=(null!==(o=t.maxTextureSize)&&void 0!==o?o:3200)/(a>1?a:1),e.dimensions.maxTextureWidth=e.dimensions.maxTextureHeight*a,e.dimensions.autoHeightRatio=1/a,i._page1Pass=!0,i.pagesLoaded()}),i.pageCount>1&&!0===e.checkSecondPage?i.document.getPage(2).then(function(e){var t=e._viewPort;i._page2Ratio=t.width/t.height,i.viewPorts[2]=t,i._page2Pass=!0,i.pagesLoaded()}):(i._page2Pass=!0,i.pagesLoaded())}},{key:"finalize",value:function(){var e=this.app;null!==e&&null!==e.options&&(this.linkService=new e2,this.linkService.setViewer(e),this._documentLoaded())}},{key:"processPage",value:function(e){var t=this.app,i=this,n=e.pageNumber,o=performance.now(),s=t.viewer.getDocumentPageNumber(n);ti.log("Requesting PDF Page:"+s),i.document.getPage(s).then(function(s){i.viewPorts[n]||(e.isFreshPage=!0,i.viewPorts[n]=s._viewPort);var a,r,l=t.viewer.getRenderContext(s,e);(e.isFreshPage&&(null===(a=t.viewer.getPageByNumber(e.pageNumber))||void 0===a||a.changeTexture(e.pageNumber,l.canvas.height)),e.preferCanvas=!0,!0===e.preferCanvas)?(l.canvas.getContext("2d").drawImage(s.image,l.viewport.transform[4],0,l.canvas.width*(null!==(r=l.viewport.widthFix)&&void 0!==r?r:1),l.canvas.height),t.applyTexture(l.canvas,e)):t.applyTexture({src:s.src,height:l.canvas.height,width:l.canvas.width},e),ti.log("Rendered "+n+" in "+(performance.now()-o)+" milliseconds")})}}]),n}(e3);function tr(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function tl(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function th(e,t,i){return t&&tl(e.prototype,t),i&&tl(e,i),e}function tu(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}p.providers.image=ta,i(795);var tp=p.jQuery,tc=p.utils,td=p.REQUEST_STATUS,tf=/*#__PURE__*/function(){function e(t,i){tr(this,e),this.options=t,this.app=i,this.parentElement=this.app.container,this.element=tp("<div>",{class:"df-ui"}),this.leftElement=tp("<div>",{class:"df-ui-left"}).appendTo(this.element),this.centerElement=tp("<div>",{class:"df-ui-center"}).appendTo(this.element),this.rightElement=tp("<div>",{class:"df-ui-right"}).appendTo(this.element),this.parentElement.append(this.element),this.events={},this.controls={}}return th(e,[{key:"init",value:function(){var e=this,t="<div>",i=this.app,n=this.controls,o=i.options.text,s=i.options.icons;e.createLogo(),this.openRight=n.openRight=tp(t,{class:"df-ui-nav df-ui-next",title:i.isRTL?o.previousPage:o.nextPage,html:'<div class="df-ui-btn '+s.next+'"></div>'}).on("click",function(){i.openRight()}),this.openLeft=n.openLeft=tp(t,{class:"df-ui-nav df-ui-prev",title:i.isRTL?o.nextPage:o.previousPage,html:'<div class="df-ui-btn '+s.prev+'"></div>'}).on("click",function(){i.openLeft()}),!0==i.options.autoPlay&&(this.play=n.play=tc.createBtn("play",s.play,o.play).on("click",function(){var e=tp(this);i.setAutoPlay(!e.hasClass(i.options.icons.pause))}),i.setAutoPlay(i.options.autoPlayStart)),this.pageNumber=n.pageNumber=tc.createBtn("page").on("change",function(){i.gotoPageLabel(n.pageInput.val())}).on("keyup",function(e){13===e.keyCode&&i.gotoPageLabel(n.pageInput.val())});var a="df_book_page_number_"+Math.ceil(performance.now()/10);this.pageInput=n.pageInput=tp('<input id="'+a+'" type="text"/>').appendTo(n.pageNumber),this.pageLabel=n.pageLabel=tp('<label for="'+a+'"></label>').appendTo(n.pageNumber),this.thumbnail=n.thumbnail=tc.createBtn("thumbnail",s.thumbnail,o.toggleThumbnails),n.thumbnail.on("click",function(){var t=tp(this);null==i.thumblist&&i.initThumbs(),i.thumbContainer.toggleClass("df-sidemenu-visible"),t.toggleClass("df-active"),t.hasClass("df-active")&&(t.siblings(".df-active").trigger("click"),i.thumbRequestStatus=td.ON),e.update(),!1===i.options.sideMenuOverlay&&i.resizeRequestStart()}).addClass("df-sidemenu-trigger"),i.hasOutline()&&(this.outline=n.outline=tc.createBtn("outline",s.outline,o.toggleOutline),n.outline.on("click",function(){var t=tp(this);if(null==i.outlineViewer&&i.initOutline(),i.outlineContainer){var n=i.outlineContainer;t.toggleClass("df-active"),n.toggleClass("df-sidemenu-visible"),t.hasClass("df-active")&&t.siblings(".df-active").trigger("click"),e.update(),!1===i.options.sideMenuOverlay&&i.resizeRequestStart()}}).addClass("df-sidemenu-trigger")),!0===i.options.showSearchControl&&!0!==tc.isMobile&&"string"==typeof i.options.source&&(n.search=tc.createBtn("search",s.search,o.search),n.search.on("click",function(){var t=tp(this);if(null==i.searchContainer&&i.initSearch(),i.searchContainer){var n=i.searchContainer;t.toggleClass("df-active"),n.toggleClass("df-sidemenu-visible"),t.hasClass("df-active")&&(t.siblings(".df-active").trigger("click"),i.searchBox[0].focus()),e.update(),!1===i.options.sideMenuOverlay&&i.resizeRequestStart()}}).addClass("df-sidemenu-trigger"));var r=e.element;if(this.zoomIn=n.zoomIn=tc.createBtn("zoomin",s.zoomin,o.zoomIn).on("click",function(){i.zoom(1),e.update()}),this.zoomOut=n.zoomOut=tc.createBtn("zoomout",s.zoomout,o.zoomOut).on("click",function(){i.zoom(-1),e.update()}),this.resetZoom=n.resetZoom=tc.createBtn("resetzoom",s.resetzoom,o.resetZoom).on("click",function(){i.resetZoom(-1),e.update()}),i.viewer.isFlipBook){if(i.pageCount>2){var l=i.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE;this.pageMode=n.pageMode=tc.createBtn("pagemode",s[l?"doublepage":"singlepage"],l?o.doublePageMode:o.singlePageMode).on("click",function(){var e=tp(this);i.viewer.setPageMode({isSingle:!e.hasClass(s.doublepage)}),i.viewer.pageModeChangedManually=!0})}}else this.pageFit=n.pageFit=tc.createBtn("pagefit",s.pagefit,o.pageFit).on("click",function(){var e=n.pageFit;!0==!e.hasClass(s.widthfit)?(e.addClass(s.widthfit),e.html("<span>"+o.widthFit+"</span>"),e.attr("title",o.widthFit)):(e.removeClass(s.widthfit),e.html("<span>"+o.pageFit+"</span>"),e.attr("title",o.pageFit))});if(this.share=n.share=tc.createBtn("share",s.share,o.share).on("click",function(){null==e.shareBox&&(e.shareBox=new tg(i.container,i.options)),!0===e.shareBox.isOpen?e.shareBox.close():(e.shareBox.update(i.getURLHash()),e.shareBox.show())}),this.more=n.more=tc.createBtn("more",s.more).on("click",function(t){!0!==e.moreContainerOpen&&(tp(this).addClass("df-active"),e.moreContainerOpen=!0,t.stopPropagation())}),this.startPage=n.startPage=tc.createBtn("start",s.start,o.gotoFirstPage).on("click",function(){i.start()}),this.endPage=n.endPage=tc.createBtn("end",s.end,o.gotoLastPage).on("click",function(){i.end()}),!0===i.options.showPrintControl&&!0!==tc.isMobile&&"string"==typeof i.options.source&&(this.print=n.print=tc.createBtn("print",s.print,o.print).on("click",function(){p.printHandler=p.printHandler||new tv,p.printHandler.printPDF(i.options.source)})),!0===i.options.showDownloadControl&&"string"==typeof i.options.source){var h="df-ui-btn df-ui-download "+s.download;this.download=n.download=tp('<a download target="_blank" class="'+h+'"><span>'+o.downloadPDFFile+"</span></a>"),n.download.attr("href",tc.httpsCorrection(i.options.source)).attr("title",o.downloadPDFFile)}e.moreContainer=tp(t,{class:"df-more-container"}),n.more.append(e.moreContainer),!0===i.options.isLightBox&&!0!==i.fullscreenSupported||(this.fullScreen=n.fullScreen=tc.createBtn("fullscreen",s.fullscreen,o.toggleFullscreen).on("click",i.switchFullscreen.bind(i))),i.viewer.initCustomControls();var u=i.options.allControls.replace(/ /g,"").split(","),c=","+i.options.moreControls.replace(/ /g,"")+",",d=","+i.options.hideControls.replace(/ /g,"")+",";i.options.leftControls.replace(/ /g,""),i.options.rightControls.replace(/ /g,""),d+=",";for(var f=0;f<u.length;f++){var g=u[f];if(0>d.indexOf(","+g+",")){var m=n[g];null!=m&&(void 0===m?"undefined":tu(m))=="object"&&(c.indexOf(","+g+",")>-1&&"more"!==g&&"pageNumber"!==g?e.moreContainer.append(m):!0==i.options.controlsFloating?r.append(m):this.centerElement.append(m))}}0==e.moreContainer.children().length&&this.more.addClass("df-hidden"),i.container.append(r),i.container.append(n.openLeft),i.container.append(this.controls.openRight),window.addEventListener("click",e.events.closePanels=e.closePanels.bind(e),!1),window.addEventListener("keyup",e.events.keyup=e.keyUp.bind(e),!1),document.addEventListener("fullscreenchange",e.events.fullscreenChange=e.fullscreenChange.bind(e),!1),!0===i.options.autoOpenThumbnail&&e.controls.thumbnail.trigger("click"),i.hasOutline()&&!0===i.options.autoOpenOutline&&e.controls.outline.trigger("click"),i.executeCallback("onCreateUI")}},{key:"closePanels",value:function(e){if(!0===this.moreContainerOpen){var t;null===(t=this.controls.more)||void 0===t||t.removeClass("df-active"),this.moreContainerOpen=!1}}},{key:"fullscreenChange",value:function(e){void 0===tc.getFullscreenElement()&&!0===this.app.isFullscreen&&this.app.switchFullscreen()}},{key:"keyUp",value:function(e){var t=this.app;if("INPUT"!==e.target.nodeName){var i=!1;switch(t.options.arrowKeysAction===p.ARROW_KEYS_ACTIONS.NAV&&((!0===t.isFullscreen||!0===t.options.isLightBox)&&(i=!0),!0!=t.options.isLightBox&&p.activeEmbeds.length<2&&!1===tp("body").hasClass("df-lightbox-open")&&(i=!0)),e.keyCode){case 27:p.activeLightBox&&p.activeLightBox.app&&!tc.isChromeExtension()&&p.activeLightBox.closeButton.trigger("click");break;case 37:i&&t.openLeft();break;case 39:i&&t.openRight();break;case 38:i&&t.viewer.isVertical()&&t.openLeft();break;case 40:i&&t.viewer.isVertical()&&t.openRight()}}}},{key:"createLogo",value:function(){var e=this.app,t=null;e.options.logo.indexOf("<")>-1?t=tp(e.options.logo).addClass("df-logo df-logo-html"):e.options.logo.trim().length>2&&(t=tp('<a class="df-logo df-logo-img" target="_blank" href="'+e.options.logoUrl+'"><img alt="" src="'+e.options.logo+'"/>')),this.element.append(t)}},{key:"dispose",value:function(){for(var e in this.controls)if(this.controls.hasOwnProperty(e)){var t=this.controls[e];null!==t&&(void 0===t?"undefined":tu(t))=="object"&&t.off().remove()}this.element.remove(),this.shareBox=tc.disposeObject(this.shareBox),window.removeEventListener("click",this.events.closePanels,!1),window.removeEventListener("keyup",this.events.keyup,!1),document.removeEventListener("fullscreenchange",this.events.fullscreenChange,!1)}},{key:"update",value:function(){var e=this.app,t=this.controls;!0!==this._pageLabelWidthSet&&(this.pageLabel.width(""),e.provider.pageLabels?this.pageLabel.text("88888888888888888".substring(0,3*e.pageCount.toString().length+4)):this.pageLabel.text("88888888888".substring(0,2*e.pageCount.toString().length+3)),this.pageNumber.width(this.pageLabel.width()),this.pageLabel.width(this.pageLabel.width()),this.pageLabel.text(""),this._pageLabelWidthSet=!0);var i=e.getCurrentLabel();if(i.toString()!==e.currentPageNumber.toString()?t.pageLabel.text(i+"("+e.currentPageNumber+"/"+e.pageCount+")"):t.pageLabel.text(i+"/"+e.pageCount),t.pageInput.val(i),e.container.toggleClass("df-sidemenu-open",e.container.find(".df-sidemenu-visible").length>0),this.isSearchOpen=e.provider.totalHits>0&&e.container.find(".df-sidemenu-visible.df-search-container").length>0,e.container.toggleClass("df-search-open",this.isSearchOpen),this.isSearchOpen){var n=e.searchContainer.find(".df-search-result[data-df-page='"+e.currentPageNumber+"']");if(e.searchContainer.find(".df-search-result.df-active").removeClass("df-active"),n.length>0&&!n.hasClass(".df-active")){n.addClass("df-active");var o=e.searchResults[0],s=o.scrollTop;s+o.getBoundingClientRect().height<(n=n[0]).offsetTop+n.scrollHeight?tc.scrollIntoView(n,null,!1):s>n.offsetTop&&tc.scrollIntoView(n)}}t.zoomIn.toggleClass("disabled",e.zoomValue===e.viewer.maxZoom),t.zoomOut.toggleClass("disabled",e.zoomValue===e.viewer.minZoom);var a=e.isRTL,r=e.currentPageNumber===e.startPage,l=e.currentPageNumber===e.endPage,h=r&&!a||l&&a,u=l&&!a||r&&a;t.openRight.toggleClass("df-hidden",u),t.openLeft.toggleClass("df-hidden",h),e.viewer.afterControlUpdate()}}]),e}(),tg=/*#__PURE__*/function(){function e(t,i){tr(this,e),this.isOpen=!1,this.shareUrl="",this.init(t,i)}return th(e,[{key:"init",value:function(e,t){var i=this;for(var n in i.wrapper=tp('<div class="df-share-wrapper" style="display: none;">').on("click",function(){i.close()}),i.box=tp('<div class="df-share-box">'),i.box.on("click",function(e){e.preventDefault(),e.stopPropagation()}),i.box.appendTo(i.wrapper).html('<span class="df-share-title">'+t.text.share+"</span>"),i.urlInput=tp('<textarea name="df-share-url" class="df-share-url">').on("click",function(){this.select()}),i.box.append(i.urlInput),t.share)!function(e){if(t.share.hasOwnProperty(e)&&0>t.hideShareControls.indexOf(e)){var n=t.share[e];null!==n&&(i[e]=tp("<div>",{class:"df-share-button df-share-"+e+" "+t.icons[e]}).on("click",function(e){e.preventDefault(),window.open(n.replace("{{url}}",encodeURIComponent(i.shareUrl)).replace("{{mailsubject}}",t.text.mailSubject),"Sharer","width=500,height=400"),e.stopPropagation()}),i.box.append(i[e]))}}(n);tp(e).append(i.wrapper)}},{key:"show",value:function(){this.wrapper.show(),this.urlInput.val(this.shareUrl),this.urlInput.trigger("click"),this.isOpen=!0}},{key:"dispose",value:function(){for(var e in this)this.hasOwnProperty(e)&&this[e]&&this[e].off&&this[e].off();this.wrapper.remove()}},{key:"close",value:function(){this.wrapper.hide(),this.isOpen=!1}},{key:"update",value:function(e){this.shareUrl=e}}]),e}(),tm=/*#__PURE__*/function(){function e(t){tr(this,e),this.duration=300;var i=this;return i.lightboxWrapper=tp("<div>").addClass("df-lightbox-wrapper"),i.backGround=tp("<div>").addClass("df-lightbox-bg").appendTo(i.lightboxWrapper),i.element=tp("<div>").addClass("df-app").appendTo(i.lightboxWrapper),i.controls=tp("<div>").addClass("df-lightbox-controls").appendTo(i.lightboxWrapper),i.closeButton=tp("<div>").addClass("df-lightbox-close df-ui-btn "+p.defaults.icons.close).on("click",function(){i.close(t)}).appendTo(i.controls),i.lightboxWrapper.append(i.element),i}return th(e,[{key:"show",value:function(e){return 0===this.lightboxWrapper.parent().length&&tp("body").append(this.lightboxWrapper),tp("html,body").addClass("df-lightbox-open"),this.lightboxWrapper.show(),"function"==typeof e&&e(),this}},{key:"close",value:function(e){return this.lightboxWrapper.hide(),Array.prototype.forEach.call(p.utils.getSharePrefixes(),function(e){0===window.location.hash.indexOf("#"+e)&&!0==p.defaults.hashNavigationEnabled&&history.replaceState(void 0,void 0,"#_")}),"function"==typeof e&&setTimeout(e,this.duration),tp("html,body").removeClass("df-lightbox-open"),this.element.attr("class","df-app").attr("style",""),this.lightboxWrapper.attr("class","df-lightbox-wrapper").attr("style","display:none"),this.backGround.attr("style",""),this}}]),e}(),tv=/*#__PURE__*/function(){function e(){tr(this,e);var t=this;return t.frame=tp('<iframe id="df-print-frame" style="display:none" src="about:blank">').appendTo(tp("body")),t.frame.on("load",function(){try{t.frame[0].contentWindow.print()}catch(e){console.log(e)}}),t}return th(e,[{key:"printPDF",value:function(e){-1==e.indexOf("?")?e+="?print=true":e+="&print=true",this.frame[0].src=e}}]),e}(),ty=/*#__PURE__*/function(){function e(t,i){tr(this,e),this.options=t,this.app=i,this.parentElement=t.parentElement,this.element=tp("<div>",{class:"df-sidemenu-wrapper"}),this.parentElement.append(this.element),this.buttons=tp("<div>",{class:"df-sidemenu-buttons df-ui-wrapper"}).appendTo(this.element),this.close=tc.createBtn("close",i.options.icons.close,i.options.text.close),this.buttons.append(this.close)}return th(e,[{key:"dispose",value:function(){this.element.remove()}}]),e}(),tb=/*#__PURE__*/function(){function e(t){tr(this,e),this.outline=null,this.lastToggleIsShow=!0,this.container=t.container,this.linkService=t.linkService,this.outlineItemClass=t.outlineItemClass||"outlineItem",this.outlineToggleClass=t.outlineToggleClass||"outlineItemToggler",this.outlineToggleHiddenClass=t.outlineToggleHiddenClass||"outlineItemsHidden"}return th(e,[{key:"dispose",value:function(){this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.linkService=null}},{key:"reset",value:function(){this.outline=null,this.lastToggleIsShow=!0;for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild)}},{key:"_dispatchEvent",value:function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("outlineloaded",!0,!0,{outlineCount:e}),this.container.dispatchEvent(t)}},{key:"_bindLink",value:function(e,t){var i=this.linkService;if(!0===t.custom)e.href=i.getCustomDestinationHash(t.dest),e.onclick=function(){return i.customNavigateTo(t.dest),!1};else{if(t.url){pdfjsLib.addLinkAttributes(e,{url:t.url});return}e.href=i.getDestinationHash(t.dest),e.onclick=function(){return i.navigateTo(t.dest),!1}}}},{key:"_addToggleButton",value:function(e){var t=this,i=document.createElement("div");i.className=this.outlineToggleClass+" "+this.outlineToggleHiddenClass,i.onclick=(function(n){if(n.stopPropagation(),i.classList.toggle(this.outlineToggleHiddenClass),n.shiftKey){var o=!i.classList.contains(this.outlineToggleHiddenClass);t._toggleOutlineItem(e,o)}}).bind(this),e.insertBefore(i,e.firstChild)}},{key:"_toggleOutlineItem",value:function(e,t){this.lastToggleIsShow=t;for(var i=e.querySelectorAll("."+this.outlineToggleClass),n=0,o=i.length;n<o;++n)i[n].classList[t?"remove":"add"](this.outlineToggleHiddenClass)}},{key:"render",value:function(e){var t=e&&e.outline||null,i=0;if(this.outline&&this.reset(),this.outline=t,t){for(var n=document.createDocumentFragment(),o=[{parent:n,items:this.outline,custom:!1}],s=!1;o.length>0;)for(var a=o.shift(),r=a.custom,l=0,h=a.items.length;l<h;l++){var u=a.items[l],p=document.createElement("div");p.className=this.outlineItemClass;var c=document.createElement("a");if(null==u.custom&&null!=r&&(u.custom=r),this._bindLink(c,u),c.textContent=u.title.replace(/\x00/g,""),p.appendChild(c),u.items&&u.items.length>0){s=!0,this._addToggleButton(p);var d=document.createElement("div");d.className=this.outlineItemClass+"s",p.appendChild(d),o.push({parent:d,custom:u.custom,items:u.items})}a.parent.appendChild(p),i++}s&&(null!=this.container.classList?this.container.classList.add(this.outlineItemClass+"s"):null!=this.container.className&&(this.container.className+=" picWindow")),this.container.appendChild(n),this._dispatchEvent(i)}}}]),e}(),tw=/*#__PURE__*/function(){function e(t){tr(this,e);var i=function(){s.thumbRequestCount=0,s.thumbRequestStatus=td.COUNT},n=this.itemHeight=t.itemHeight,o=this.itemWidth=t.itemWidth,s=this.app=t.app;this.items=t.items,this.generatorFn=t.generatorFn,this.totalRows=t.totalRows||t.items&&t.items.length,this.addFn=t.addFn,this.scrollFn=t.scrollFn,this.container=document.createElement("div");for(var a=this,r=0;r<this.totalRows;r++){var l=document.createElement("div"),h=r+1;l.id="df-thumb"+h;var u=document.createElement("div"),p=document.createElement("div"),c=document.createElement("div");c.className="df-wrapper",p.className="df-thumb-number",l.className="df-thumb",u.className="df-bg-image",c.style.height=n+"px",c.style.width=o+"px",p.innerText=s.provider.getLabelforPage(h),l.appendChild(c),c.appendChild(p),c.appendChild(u),this.container.appendChild(l)}a.dispose=function(){a.container&&a.container.parentNode&&a.container.parentNode.removeChild(a.container),a.container.removeEventListener("scroll",i)},a.container.addEventListener("scroll",i)}return th(e,[{key:"processThumbRequest",value:function(){tc.log("Thumb Request Initiated");var e=this.app;if(e.thumbRequestStatus=td.OFF,e.activeThumb!==e.currentPageNumber&&null!=e.thumbContainer&&e.thumbContainer.hasClass("df-sidemenu-visible")){var t=e.thumblist.container,i=t.scrollTop,n=t.getBoundingClientRect().height,o=e.thumbContainer.find("#df-thumb"+e.currentPageNumber);o.length>0?(e.thumbContainer.find(".df-selected").removeClass("df-selected"),o.addClass("df-selected"),i+n<(o=o[0]).offsetTop+o.scrollHeight?tc.scrollIntoView(o,null,!1):i>o.offsetTop&&tc.scrollIntoView(o),e.activeThumb=e.currentPageNumber):(tp(t).scrollTop(124*e.currentPageNumber),e.thumbRequestStatus=td.ON)}if(0===e.thumblist.container.getElementsByClassName("df-thumb-requested").length){var s=tc.getVisibleElements({container:e.thumblist.container,elements:e.thumblist.container.children});-1===s.indexOf(e.activeThumb)&&s.unshift(e.activeThumb);for(var a=0;a<s.length;a++){var r=e.thumblist.container.children[s[a]-1];if(void 0!==r&&!1===r.classList.contains("df-thumb-loaded")&&!1===r.classList.contains("df-thumb-requested"))return r.classList.add("df-thumb-requested"),tc.log("Thumb Requested for "+s[a]),e.provider.processPage({pageNumber:s[a],textureTarget:p.TEXTURE_TARGET.THUMB}),!1}}}},{key:"setPage",value:function(e){var t=this.app,i=e.pageNumber,n=e.texture;if(e.textureTarget===p.TEXTURE_TARGET.THUMB){var o=t.container.find("#df-thumb"+i);o.find(".df-wrapper").css({height:e.height,width:e.width}),o.find(".df-bg-image").css({backgroundImage:tc.bgImage(n)}),o.addClass("df-thumb-loaded").removeClass("df-thumb-requested")}tc.log("Thumbnail set for "+e.pageNumber),t.thumbRequestStatus=td.ON}}]),e}();function tP(){if(void 0===p.openLocalFileInput){var e=p.openLocalFileInput=tp('<input type="file" accept=".pdf" style="display:none">').appendTo(tp("body")).data("df-option",p.openFileOptions);e.change(function(){var t,i=e[0].files;i.length&&(t=i[0],e.val(""),p.openFile(t))})}}p.openLightBox=function(e){p.activeLightBox||(p.activeLightBox=new tm(function(){p.activeLightBox.app&&(p.activeLightBox.app.closeRequested=!0,p.activeLightBox.app.analytics({eventAction:p.activeLightBox.app.options.analyticsViewerClose,options:p.activeLightBox.app.options})),p.activeLightBox.app=tc.disposeObject(p.activeLightBox.app)})),p.activeLightBox.duration=300,(void 0===p.activeLightBox.app||null===p.activeLightBox.app||!0===p.activeLightBox.app.closeRequested||p.openLocalFileInput==e)&&(p.activeLightBox.app=tc.disposeObject(p.activeLightBox.app),null===p.activeLightBox.app&&p.activeLightBox.show(function(){p.activeLightBox.app=new p.Application({transparent:!1,isLightBox:!0,height:"100%",dataElement:e,element:p.activeLightBox.element}),!0!==p._isHashTriggered&&!0==p.defaults.hashNavigationEnabled&&history.pushState(null,null,"#"),p.activeLightBox.lightboxWrapper.toggleClass("df-lightbox-padded",!1===p.activeLightBox.app.options.popupFullsize),p.activeLightBox.lightboxWrapper.toggleClass("df-rtl",p.activeLightBox.app.options.readDirection===p.READ_DIRECTION.RTL),p.activeLightBox.backGround.css({backgroundColor:"transparent"===p.activeLightBox.app.options.backgroundColor?p.defaults.popupBackGroundColor:p.activeLightBox.app.options.backgroundColor})}))},p.checkBrowserURLforDefaults=function(){if(!tc.isIEUnsupported){var e=new URL(location.href).searchParams.get("viewer-type")||new URL(location.href).searchParams.get("viewertype"),t=new URL(location.href).searchParams.get("is-3d")||new URL(location.href).searchParams.get("is3d");e&&(p.defaults.viewerType=e),("true"===t||"false"===t)&&(p.defaults.is3D="true"===t)}},p.fileDropHandler=function(e,t){var i=e[0];"application/pdf"===i.type&&(t.preventDefault(),t.stopPropagation(),p.openFile(i))},p.openFile=function(e){if(e){var t;p.oldLocalFileObjectURL&&window.URL.revokeObjectURL(p.oldLocalFileObjectURL),p.oldLocalFileObjectURL=window.URL.createObjectURL(e),null===(t=p.openFileSelected)||void 0===t||t.call(p,{url:p.oldLocalFileObjectURL,file:e}),p.openURL(p.oldLocalFileObjectURL)}else p.openURL()},p.openURL=function(e){tP(),e&&(p.openFileOptions.source=e,p.openFileOptions.pdfParameters=null),p.openLightBox(p.openLocalFileInput)},p.openBase64=function(e){p.openFileOptions.source=null,p.openFileOptions.pdfParameters={data:atob(e)},p.openURL()},p.openLocalFile=function(){tP(),p.openLocalFileInput.click()},p.initControls=function(){var e=tp("body");if(!1!==p.defaults.autoPDFLinktoViewer&&e.on("click",'a[href$=".pdf"]',function(e){var t=tp(this);void 0!==t.attr("download")||"_blank"===t.attr("target")||t.hasClass("df-ui-btn")||t.parents(".df-app").length>0||(e.preventDefault(),t.data("df-source",t.attr("href")),p.openLightBox(t))}),window.addEventListener("popstate",function(e){p.activeLightBox&&p.activeLightBox.app&&!tc.isChromeExtension()&&p.activeLightBox.closeButton.trigger("click")}),e.on("click",".df-open-local-file",function(e){p.openLocalFile()}),e.on("click",".df-sidemenu-buttons .df-ui-close",function(){tp(this).closest(".df-app").find(".df-ui-btn.df-active").trigger("click")}),e.on("mouseout",".df-link-content section.squareAnnotation, .df-link-content section.textAnnotation, .df-link-content section.freeTextAnnotation",function(){var e=tp(this);p.handlePopup(e,!1)}),e.on("mouseover",".df-link-content section.squareAnnotation, .df-link-content section.textAnnotation, .df-link-content section.freeTextAnnotation",function(){var e=tp(this);p.handlePopup(e,!0)}),p.handlePopup=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=e.closest(".df-container"),n=i.find(".df-comment-popup");if(n.toggleClass("df-active",t),t){var o=e[0].getBoundingClientRect(),s=i[0].getBoundingClientRect(),a=e.find(".popupWrapper").first();if(e.hasClass("popupTriggerArea")){var r=e.data("annotation-id");void 0!==r&&(a=e.siblings("[data-annotation-id=popup_"+r+"]"))}n.html(a.html());var l=o.left-s.left;l+360>s.width?l=s.width-360-10:l<10&&(l=10);var h=o.top-s.top+o.height+5;h+n.height()>s.height?h=o.top-n.height()-o.height-10:h<10&&(h=10),n.css({left:l,top:h})}},void 0!=p.fileDropElement){var t=tp(p.fileDropElement);t.length>0&&(t.on("dragover",function(e){e.preventDefault(),e.stopPropagation(),tp(this).addClass("df-dragging")}),t.on("dragleave",function(e){e.preventDefault(),e.stopPropagation(),tp(this).removeClass("df-dragging")}),t.on("drop",function(e){var t=e.originalEvent.dataTransfer.files;t.length&&p.fileDropHandler(t,e)}))}};var tS=p.jQuery,tE=p.REQUEST_STATUS,tx=p.utils,tC=/*#__PURE__*/function(){var e;function t(e){var i,n,o;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,t),this.options=e,this.viewerType=this.options.viewerType,this.startPage=1,this.endPage=1,this.element=tS(this.options.element),e.maxTextureSize=null!==(i=e.maxTextureSize)&&void 0!==i?i:2048,tx.isMobile&&(e.maxTextureSize=4096===e.maxTextureSize?3200:e.maxTextureSize),this.dimensions={padding:{},offset:{},pageFit:{},stage:{},isAutoHeight:"auto"===e.height,maxTextureSize:e.maxTextureSize},this.is3D=e.is3D,this.options.pixelRatio=tx.limitAt(this.options.pixelRatio,1,this.options.maxDPI),this.options.fakeZoom=null!==(n=this.options.fakeZoom)&&void 0!==n?n:1,this.events={},this.links=e.links,this.thumbSize=128,this.pendingZoom=!0,this.currentPageNumber=this.options.openPage||this.startPage,this.hashNavigationEnabled=!0===this.options.hashNavigationEnabled,this.pendingZoom=!0,this.zoomValue=1,this.pageScaling=p.PAGE_SCALE.MANUAL,this.isRTL=e.readDirection===p.READ_DIRECTION.RTL,this.jumpStep=1,this.resizeRequestStatus=tE.OFF,this.refreshRequestStatus=tE.OFF,this.refreshRequestCount=0,this.resizeRequestCount=0,this.fullscreenSupported=tx.hasFullscreenEnabled(),this.thumbRequestCount=0,this.isExternalReady=null===(o=this.options.isExternalReady)||void 0===o||o,this.init(),!0===this.options.autoLightBoxFullscreen&&!0===this.options.isLightBox&&this.switchFullscreen(),this.executeCallback("onCreate"),this.target=this}return e=[{key:"init",value:function(){var e=this.options;if(this.initDOM(),this.initResourcesLocation(),this.initInfo(),(null==e.source||0===e.source.length)&&null==e.pdfParameters){this.updateInfo("ERROR: Set a Valid Document Source.",p.INFO_TYPE.ERROR),this.container.removeClass("df-loading").addClass("df-error");return}if(tx.isIEUnsupported){this.updateInfo("Your browser (Internet Explorer) is out of date! <br><a href='https://browsehappy.com/'>Upgrade to a new browser.</a>","df-old-browser"),this.container.removeClass("df-loading").addClass("df-error");return}this.commentPopup=tS('<div class="df-comment-popup">').appendTo(this.container),this.viewer=new this.viewerType(e,this),this.sideMenu=new ty({parentElement:this.container},this),this.provider=new p.providers[e.providerType](e,this),this.state="loading",this.checkRequestQueue()}},{key:"initDOM",value:function(){this.element.addClass("df-app").removeClass("df-container df-loading"),this.container=tS("<div>").appendTo(this.element),this.container.addClass("df-container df-loading df-init"+(!0===this.options.controlsFloating?" df-float":" df-float-off")+" df-controls-"+this.options.controlsPosition+("transparent"===this.options.backgroundColor?" df-transparent":"")+(!0===this.isRTL?" df-rtl":"")+(!0===tx.isIOS||!0===tx.isIPad?" df-ios":"")),this._offsetParent=this.container[0].offsetParent,this.backGround=tS("<div class='df-bg'>").appendTo(this.container).css({backgroundColor:this.options.backgroundColor,backgroundImage:this.options.backgroundImage?"url('"+this.options.backgroundImage+"')":""}),this.viewerContainer=tS("<div>").appendTo(this.container),this.viewerContainer.addClass("df-viewer-container")}},{key:"initResourcesLocation",value:function(){var e=this.options;if(void 0!==window[p.locationVar]){if(e.pdfjsSrc=window[p.locationVar]+"js/libs/pdf.min.js",e.threejsSrc=window[p.locationVar]+"js/libs/three.min.js",e.pdfjsWorkerSrc=window[p.locationVar]+"js/libs/pdf.worker.min.js",e.soundFile=window[p.locationVar]+e.soundFile,e.imagesLocation=window[p.locationVar]+e.imagesLocation,e.imageResourcesPath=window[p.locationVar]+e.imageResourcesPath,e.cMapUrl=window[p.locationVar]+e.cMapUrl,void 0!==e.pdfVersion){var t="";"latest"==e.pdfVersion||"beta"==e.pdfVersion?t="latest":"stable"==e.pdfVersion&&(t="stable"),("latest"==e.pdfVersion||"default"==e.pdfVersion)&&(Array.prototype.at,void 0===Array.prototype.at&&(t="stable",console.log("Proper Support for Latest version PDF.js 3.7 not available. Switching to PDF.js 2.5!"))),"default"!==t&&""!==t&&(e.pdfjsSrc=window[p.locationVar]+"js/libs/pdfjs/"+t+"/pdf.min.js",e.pdfjsWorkerSrc=window[p.locationVar]+"js/libs/pdfjs/"+t+"/pdf.worker.min.js"),"stable"===t&&(this.options.fakeZoom=1)}}else console.warn("DEARVIEWER locationVar not found!");this.executeCallback("onInitResourcesLocation")}},{key:"initEvents",value:function(){var e=this.container[0];window.addEventListener("resize",this.events.resize=this.resetResizeRequest.bind(this),!1),e.addEventListener("mousemove",this.events.mousemove=this.mouseMove.bind(this),!1),e.addEventListener("mousedown",this.events.mousedown=this.mouseDown.bind(this),!1),window.addEventListener("mouseup",this.events.mouseup=this.mouseUp.bind(this),!1),e.addEventListener("touchmove",this.events.touchmove=this.mouseMove.bind(this),!1),e.addEventListener("touchstart",this.events.touchstart=this.mouseDown.bind(this),!1),window.addEventListener("touchend",this.events.touchend=this.mouseUp.bind(this),!1)}},{key:"mouseMove",value:function(e){e.touches&&e.touches.length>1&&e.preventDefault(),!0===this.viewer.acceptAppMouseEvents&&this.viewer.mouseMove(e)}},{key:"mouseDown",value:function(e){this.userHasInteracted=!0,!0===this.viewer.acceptAppMouseEvents&&0===tS(e.srcElement).closest(".df-sidemenu").length&&this.viewer.mouseDown(e)}},{key:"mouseUp",value:function(e){this.viewer&&!0===this.viewer.acceptAppMouseEvents&&this.viewer.mouseUp(e)}},{key:"softDispose",value:function(){this.softDisposed=!0,this.provider.dispose(),this.viewer.dispose()}},{key:"softInit",value:function(){this.viewer=new this.viewerType(this.options,this),this.provider=new p.providers[this.options.providerType](this.options,this),this.softDisposed=!1}},{key:"dispose",value:function(){var e,t,i,n,o,s=this.container[0];clearInterval(this.autoPlayTimer),this.autoPlayTimer=null,this.autoPlayFunction=null,this.provider=tx.disposeObject(this.provider),this.contentProvider=null,this.target=null,this.viewer=tx.disposeObject(this.viewer),this.sideMenu=tx.disposeObject(this.sideMenu),this.ui=tx.disposeObject(this.ui),this.thumblist=tx.disposeObject(this.thumblist),this.outlineViewer=tx.disposeObject(this.outlineViewer),this.events&&(window.removeEventListener("resize",this.events.resize,!1),s.removeEventListener("mousemove",this.events.mousemove,!1),s.removeEventListener("mousedown",this.events.mousedown,!1),window.removeEventListener("mouseup",this.events.mouseup,!1),s.removeEventListener("touchmove",this.events.touchmove,!1),s.removeEventListener("touchstart",this.events.touchstart,!1),window.removeEventListener("touchend",this.events.touchend,!1)),this.events=null,this.options=null,this.element.removeClass("df-app"),this.viewerType=null,this.checkRequestQueue=null,null===(e=this.info)||void 0===e||e.remove(),this.info=null,null===(t=this.loadingIcon)||void 0===t||t.remove(),this.loadingIcon=null,null===(i=this.backGround)||void 0===i||i.remove(),this.backGround=null,null===(n=this.outlineContainer)||void 0===n||n.remove(),this.outlineContainer=null,null===(o=this.commentPopup)||void 0===o||o.remove(),this.commentPopup=null,this.viewerContainer.off(),this.viewerContainer.remove(),this.viewerContainer=null,this.container.off(),this.container.remove(),this.container=null,this.element.off(),this.element.data("df-app",null),this.element=null,this._offsetParent=null,this.dimensions=null}},{key:"resetResizeRequest",value:function(){this.resizeRequestStatus=tE.COUNT,this.resizeRequestCount=0,this.container.addClass("df-pendingresize"),this.pendingResize=!0}},{key:"initInfo",value:function(){this.info=tS("<div>",{class:"df-loading-info"}),this.container.append(this.info),this.info.html(this.options.text.loading+"..."),this.loadingIcon=tS("<div>",{class:"df-loading-icon"}).appendTo(this.container)}},{key:"updateInfo",value:function(e,t){tx.log(e),void 0!==this.info&&this.info.html(e)}},{key:"_documentLoaded",value:function(){tx.log("Document Loaded"),this.isDocumentReady=!0,this.contentProvider=this.provider,this.executeCallback("onDocumentLoad"),this.endPage=this.pageCount=this.provider.pageCount,this.currentPageNumber=this.getValidPage(this.currentPageNumber)}},{key:"_viewerPrepared",value:function(){tx.log("Viewer Prepared"),this.isViewerPrepared=!0,this.executeCallback("onViewerLoad")}},{key:"requestFinalize",value:function(){!0===this.isDocumentReady&&!0===this.isViewerPrepared&&!0===this.isExternalReady&&!0!==this.finalizeRequested&&(this.finalizeRequested=!0,this.finalize())}},{key:"finalizeComponents",value:function(){this.ui=new tf({},this),this.ui.init(),this.calculateLayout(),this.viewer.init()}},{key:"finalize",value:function(){this.resize(),this.ui.update(),this.initEvents(),!0==this.options.isLightBox&&this.analytics({eventAction:this.options.analyticsViewerOpen,options:this.options}),this.container.removeClass("df-loading df-init"),this.viewer.onReady(),this.analytics({eventAction:this.options.analyticsViewerReady,options:this.options}),this.executeCallback("onReady"),!0===this.options.dataElement.hasClass("df-hash-focused")&&(tx.focusHash(this.options.dataElement),this.options.dataElement.removeClass("df-hash-focused")),!0===this.hashNavigationEnabled&&this.getURLHash(),tx.log("App Finalized")}},{key:"initOutline",value:function(){var e=tS("<div>").addClass("df-outline-container df-sidemenu");e.append('<div class="df-sidemenu-title">'+this.options.text.outlineTitle+"</div>");var t=tS("<div>").addClass("df-wrapper");e.append(t),this.sideMenu.element.append(e),this.outlineContainer=e,this.outlineViewer=new tb({container:t[0],linkService:this.provider.linkService,outlineItemClass:"df-outline-item",outlineToggleClass:"df-outline-toggle",outlineToggleHiddenClass:"df-outlines-hidden"}),this.outlineViewer.render({outline:this.provider.outline})}},{key:"initThumbs",value:function(){var e=this;e.thumblist=new tw({app:e,addFn:function(e){},scrollFn:function(){e.thumbRequestStatus=tE.ON},itemHeight:e.thumbSize,itemWidth:tx.limitAt(Math.floor(e.dimensions.defaultPage.ratio*e.thumbSize),32,180),totalRows:e.pageCount}),e.thumblist.lastScrolled=Date.now(),e.thumbRequestStatus=tE.ON;var t=tS("<div>").addClass("df-thumb-container df-sidemenu");t.append('<div class="df-sidemenu-title">'+this.options.text.thumbTitle+"</div>"),t.append(tS(e.thumblist.container).addClass("df-wrapper")),e.thumbContainer=t,e.sideMenu.element.append(t),e.container.on("click",".df-thumb-container .df-thumb",function(t){t.stopPropagation();var i=tS(this).attr("id").replace("df-thumb","");e.gotoPage(parseInt(i,10))})}},{key:"initSearch",value:function(){var e=this,t=tS("<div>").addClass("df-search-container df-sidemenu");t.append('<div class="df-sidemenu-title">'+this.options.text.searchTitle+"</div>"),e.searchForm=tS('<div class="df-search-form">').appendTo(t),e.searchBox=tS('<input type="text" class="df-search-text" placeholder="'+this.options.text.searchPlaceHolder+'">').on("keyup",function(t){13===t.keyCode&&e.search()}).appendTo(e.searchForm),e.searchButton=tS('<div class="df-ui-btn df-search-btn df-icon-search">').on("click",function(t){e.search()}).appendTo(e.searchForm),e.clearButton=tS('<a class="df-search-clear">'+this.options.text.searchClear+"</a>").on("click",function(t){e.clearSearch()}).appendTo(e.searchForm),e.searchInfo=tS('<div class="df-search-info">').appendTo(t),e.searchResults=tS('<div class="df-wrapper df-search-results">').appendTo(t),e.searchContainer=t,e.sideMenu.element.append(t),e.container.on("click",".df-search-result",function(t){t.stopPropagation();var i=tS(this).data("df-page");e.gotoPage(parseInt(i,10))})}},{key:"search",value:function(e){void 0==e&&(e=this.searchBox.val()),this.provider.search(e.trim())}},{key:"clearSearch",value:function(){this.searchBox.val(""),this.searchInfo.html(""),this.provider.clearSearch()}},{key:"updateSearchInfo",value:function(e){tx.log(e),void 0!==this.searchInfo&&this.searchInfo.html(e)}},{key:"checkRequestQueue",value:function(){var e=this;if(e.checkRequestQueue&&requestAnimationFrame(function(){e&&e.checkRequestQueue&&e.checkRequestQueue()}),!e.softDisposed){if("ready"!=e.state){"loading"===e.state&&!0===this.isDocumentReady&&!0===this.isViewerPrepared&&!0===this.isExternalReady&&(e.state="finalizing",this.finalizeComponents()),"finalizing"===e.state&&(e.state="ready",e.finalize());return}e.container&&e.container[0]&&e._offsetParent!==e.container[0].offsetParent&&(e._offsetParent=e.container[0].offsetParent,null!==e._offsetParent&&(e.resize(),e.resizeRequestStatus=tE.OFF),tx.log("Visibility Resize Detected")),(null!==e._offsetParent||e.isFullscreen)&&(TWEEN.getAll().length>0&&(TWEEN.update(),e.renderRequestStatus=tE.ON),e.resizeRequestStatus===tE.ON?(e.resizeRequestStatus=tE.OFF,e.resize()):e.resizeRequestStatus===tE.COUNT&&(e.resizeRequestCount++,e.resizeRequestCount>10&&(e.resizeRequestCount=0,e.resizeRequestStatus=tE.ON)),e.refreshRequestStatus===tE.ON?(e.refreshRequestStatus=tE.OFF,e.pendingResize=!1,e.viewer.refresh(),e.container.removeClass("df-pendingresize")):e.refreshRequestStatus===tE.COUNT&&(e.refreshRequestCount++,e.refreshRequestCount>3&&(e.refreshRequestCount=0,e.refreshRequestStatus=tE.ON)),e.textureRequestStatus===tE.ON&&e.processTextureRequest(),e.thumbRequestStatus===tE.ON?e.processThumbRequest():e.thumbRequestStatus===tE.COUNT&&(e.thumbRequestCount++,e.thumbRequestCount>3&&(e.thumbRequestCount=0,e.thumbRequestStatus=tE.ON)),e.renderRequestStatus===tE.ON&&(e.viewer.render(),e.renderRequestStatus=tE.OFF),e.provider.checkRequestQueue(),e.viewer.checkRequestQueue())}}},{key:"processTextureRequest",value:function(){var e,t,i=this.viewer,n=this.provider,o=i.getVisiblePages().main,s=0,a=this.zoomValue>1;if(i.isAnimating()&&!0!==DEARFLIP.defaults.instantTextureProcess)this.textureRequestStatus=tE.ON;else{tx.log("Texture Request Working");for(var r=0;r<o.length;r++){s=0;var l=o[r];if(l>0&&l<=this.pageCount){if(e=a?i.zoomViewer.getPageByNumber(l):i.getPageByNumber(l)){t=i.getTextureSize({pageNumber:l});var h={pageNumber:l,textureTarget:a?p.TEXTURE_TARGET.ZOOM:p.TEXTURE_TARGET.VIEWER};e.changeTexture(l,Math.floor(t.height))&&(n.processPage(h),s++,this.viewer.getAnnotationElement(l,!0)),!0===this.options.progressiveZoom&&this.zoomValue>1.1*i.pureMaxZoom&&this.viewer.zoomViewer.startZoomUpdateRequest()}if(s>0)break}}0===s&&(this.textureRequestStatus=tE.OFF)}return s}},{key:"applyTexture",value:function(e,t){var i=void 0!==e.toDataURL;if(t.textureTarget===p.TEXTURE_TARGET.THUMB){if(t.height=e.height,t.width=e.width,i){var n=e.toDataURL("image/png");this.provider.setCache(t.pageNumber,n,this.thumbSize),t.texture=n}else t.texture=e.src;this.thumblist.setPage(t)}else t.texture=i?e:e.src,!0===this.viewer.setPage(t)&&(this.provider.processAnnotations(t.pageNumber,this.viewer.getAnnotationElement(t.pageNumber,!0)),this.provider.processTextContent(t.pageNumber,this.viewer.getTextElement(t.pageNumber,!0)))}},{key:"processThumbRequest",value:function(){null!==this.thumblist&&void 0!==this.thumblist&&this.thumblist.processThumbRequest()}},{key:"refreshRequestStart",value:function(){this.refreshRequestStatus=tE.COUNT,this.refreshRequestCount=0}},{key:"renderRequestStart",value:function(){this.renderRequestStatus=tE.ON}},{key:"resizeRequestStart",value:function(){this.resizeRequestStatus=tE.ON}},{key:"zoom",value:function(e){this.pendingZoom=!0,this.zoomDelta=e,this.resize()}},{key:"resetZoom",value:function(){1!==this.zoomValue&&(this.zoomValue=1.001,this.zoom(-1))}},{key:"calculateLayout",value:function(){var e,t,i=this.isSideMenuOpen=this.container.hasClass("df-sidemenu-open"),n=this.dimensions,o=this.dimensions.padding,s=tS(window).height();n.offset={top:0,left:this.options.sideMenuOverlay||!i||this.isRTL?0:220,right:!this.options.sideMenuOverlay&&i&&this.isRTL?220:0,bottom:0,width:!this.options.sideMenuOverlay&&i?220:0},this.viewerContainer.css({left:n.offset.left,right:n.offset.right});var a=n.controlsHeight=this.container.find(".df-ui").height();if(o.top=this.options.paddingTop+(this.options.controlsPosition===p.CONTROLS_POSITION.TOP?a:0),o.left=this.options.paddingLeft,o.right=this.options.paddingRight,o.bottom=this.options.paddingBottom+(this.options.controlsPosition===p.CONTROLS_POSITION.BOTTOM?a:0),o.height=o.top+o.bottom,o.width=o.left+o.right,o.heightDiff=o.top-o.bottom,o.widthDiff=o.left-o.right,n.isFullSize=!0===this.isFullscreen,n.isFixedHeight=n.isFullSize||!n.isAutoHeight,n.containerWidth=n.isFullSize?tS(window).width():this.element.width(),this.container.toggleClass("df-xs",n.containerWidth<400).toggleClass("df-xss",n.containerWidth<320),n.maxHeight=s-(n.containerWidth>600&&null!==(t=tS(null!==(e=this.options.headerElementSelector)&&void 0!==e?e:"#wpadminbar").height())&&void 0!==t?t:0),n.isFixedHeight){if(n.isFullSize)n.maxHeight=s;else{this.element.height(this.options.height);var r=this.element.height();n.maxHeight=Math.min(r,n.maxHeight)}}n.width,n.stage.innerWidth=this.viewer._getInnerWidth();var l=n.stage.innerHeight=this.viewer._getInnerHeight(),h=this.viewer._getOuterHeight(l+n.padding.height);n.containerHeight=n.isFullSize?s:h,this.element.height(n.containerHeight);var u=this.element.height();n.isFullSize||u==n.containerHeight||(n.containerHeight=u,n.stage.innerHeight=u-n.padding.height,n.stage.height=u),n.origin={x:(o.widthDiff+n.containerWidth-n.offset.left-n.offset.right)/2,y:(o.heightDiff+n.containerHeight)/2},this.viewer.determinePageMode()}},{key:"resize",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];tx.log("Resize Request Initiated"),this.calculateLayout(),this.viewer.handleZoom(),this.viewer.resize(),!1!==e&&(this.pendingZoom?(this.viewer.refresh(),tx.log("Pending Zoom updated")):this.refreshRequestStart(),this.ui.update(),this.renderRequestStatus=tE.ON,this.zoomChanged=!1,this.pendingZoom=!1,this.executeCallback("afterResize"))}},{key:"hasOutline",value:function(){if(this.provider.outline.length>0)return!0}},{key:"switchFullscreen",value:function(){var e,t,i=this,n=i.container[0];if(i.container.toggleClass("df-fullscreen",!0!==i.isFullscreen),(null==i?void 0:null===(t=i.ui)||void 0===t?void 0:null===(e=t.controls)||void 0===e?void 0:e.fullscreen)&&i.ui.controls.fullScreen.toggleClass(i.options.icons["fullscreen-off"],!0!==i.isFullscreen),!0!==i.isFullscreen){var o=null;n.requestFullscreen?o=n.requestFullscreen():n.msRequestFullscreen?o=n.msRequestFullscreen():n.mozRequestFullScreen?o=n.mozRequestFullScreen():n.webkitRequestFullscreen&&(o=n.webkitRequestFullscreen()),o&&o.then&&o.then(function(){i.refreshRequestStatus,tE.ON,i.resize()}),i.isFullscreen=!0}else i.isFullscreen=!1,document.exitFullscreen?document.fullscreenElement&&document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),tx.hasFullscreenEnabled()||i.container[0].scrollIntoView();tx.hasFullscreenEnabled()||(i.resizeRequestStatus=tE.ON)}},{key:"next",value:function(){this.jumpBy(this.jumpStep)}},{key:"prev",value:function(){this.jumpBy(-this.jumpStep)}},{key:"jumpBy",value:function(e){var t=this.currentPageNumber+e;t=tx.limitAt(t,this.startPage,this.endPage),!0!=this.anyFirstPageChanged&&(this.analytics({eventAction:this.options.analyticsFirstPageChange,options:this.options}),this.anyFirstPageChanged=!0),this.gotoPage(t),this.ui.update()}},{key:"openRight",value:function(){this.isRTL?this.prev():this.next()}},{key:"openLeft",value:function(){this.isRTL?this.next():this.prev()}},{key:"start",value:function(){this.gotoPage(this.startPage)}},{key:"end",value:function(){this.gotoPage(this.endPage)}},{key:"gotoPage",value:function(e){e=this.getValidPage(parseInt(e,10)),null!==this.viewer&&!1!==this.viewer.validatePageChange(e)&&(this.executeCallback("beforePageChanged"),this.requestDestRefKey=void 0,this.container.removeClass("df-fetch-pdf"),this.oldPageNumber=this.currentPageNumber,this.currentPageNumber=e,this.thumbRequestStatus=tE.ON,this.viewer.gotoPageCallBack&&this.viewer.gotoPageCallBack(),this.ui.update(),!0==this.autoPlay&&this.setAutoPlay(this.autoPlay),!0===this.hashNavigationEnabled&&this.getURLHash(),this.executeCallback("onPageChanged"))}},{key:"gotoPageLabel",value:function(e){this.gotoPage(this.provider.getPageNumberForLabel(e.toString().trim()))}},{key:"getCurrentLabel",value:function(){return this.provider.getLabelforPage(this.currentPageNumber)}},{key:"autoPlayFunction",value:function(){this&&this.autoPlay&&(tx.limitAt(this.currentPageNumber+this.jumpStep,this.startPage,this.endPage)!==this.currentPageNumber?this.next():this.setAutoPlay(!1))}},{key:"setAutoPlay",value:function(e){if(this.options.autoPlay){var t=(e=!0==e)?this.options.text.pause:this.options.text.play;this.ui.controls.play.toggleClass(this.options.icons.pause,e),this.ui.controls.play.html("<span>"+t+"</span>"),this.ui.controls.play.attr("title",t),clearInterval(this.autoPlayTimer),e&&(this.autoPlayTimer=setInterval(this.autoPlayFunction.bind(this),this.options.autoPlayDuration)),this.autoPlay=e}}},{key:"isValidPage",value:function(e){return this.provider._isValidPage(e)}},{key:"getValidPage",value:function(e){return isNaN(e)?e=this.currentPageNumber:e<1?e=1:e>this.pageCount&&(e=this.pageCount),e}},{key:"getURLHash",value:function(){if(null!=this.options.id){var e=tx.getSharePrefix(this.options.sharePrefix)+(null!=this.options.slug?this.options.slug:this.options.id)+"/";null!=this.currentPageNumber&&(e+=this.currentPageNumber+"/"),history.replaceState(void 0,void 0,"#"+e)}return window.location.href}},{key:"executeCallback",value:function(e){}},{key:"analytics",value:function(e){}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();p.prepareOptions=function(e){e.element instanceof tS||(e.element=tS(e.element));var t=e.element;null==e.dataElement&&(e.dataElement=t);var i=e.dataElement,n=p.utils.getOptions(i),o=tS.extend(!0,{},p.defaults,e,n);o=tx.fallbackOptions(o),tx.log(o);var s=tS.extend(!0,{},p._defaults,o);return tx.isMobile&&"function"==typeof p.viewers[s.mobileViewerType]&&(s.viewerType=s.mobileViewerType),"function"!=typeof p.viewers[s.viewerType]?(console.warn("Invalid Viewer Type! "+s.viewerType+" | Using default Viewer!"),s.viewerType=p.viewers.default):s.viewerType=p.viewers[s.viewerType],s=tx.finalizeOptions(tx.sanitizeOptions(s))},p.Application=function(e){var t=p.prepareOptions(e),i=new tC(t);return e.element.data("df-app",i),null!=t.id&&!0!==t.isLightBox&&(window[t.id.toString()]=i),i},void 0!==window.jQuery&&!1==p.fakejQuery&&tS.fn.extend({dearviewer_options:function(e){return null==e&&(e={}),e.element=tS(this),new p.prepareOptions(e)},dearviewer:function(e){return null==e&&(e={}),e.element=tS(this),new p.Application(e)}});var tT=p.jQuery,tk=window.DFLIP=window.DEARFLIP=p;tk.defaults.viewerType="flipbook",tk.slug="dflip",tk.locationVar="dFlipLocation",tk.locationFile="dflip",tk.PAGE_MODE={SINGLE:1,DOUBLE:2,AUTO:null},tk.SINGLE_PAGE_MODE={ZOOM:1,BOOKLET:2,AUTO:null},tk.CONTROLSPOSITION={HIDDEN:"hide",TOP:"top",BOTTOM:"bottom"},tk.DIRECTION={LTR:1,RTL:2},tk.PAGE_SIZE={AUTO:0,SINGLE:1,DOUBLEINTERNAL:2},tk.parseFallBack=function(){tT(".df-posts").addClass("dflip-books"),tT(".dflip-books").addClass("df-posts"),tT("._df_button, ._df_thumb, ._df_book").each(function(){var e=tT(this);"true"!==e.data("df-parsed")&&(e.addClass("df-element"),e.hasClass("_df_book")||(e.hasClass("_df_thumb")?(e.attr("data-df-lightbox","thumb"),void 0!==e.attr("thumb")&&e.data("df-thumb",e.attr("thumb"))):e.attr("data-df-lightbox","button")))})},tk.parseBooks=function(){tk.parseFallBack(),tk.parseElements()};var tO=function(e){return null!=e.source&&(Array===e.source.constructor||Array.isArray(e.source)||e.source instanceof Array)&&(e.providerType="image"),null!=e.cover3DType&&(!0==e.cover3DType||"true"==e.cover3DType?e.cover3DType=tk.FLIPBOOK_COVER_TYPE.BASIC:(!1==e.cover3DType||"false"==e.cover3DType)&&(e.cover3DType=tk.FLIPBOOK_COVER_TYPE.NONE)),void 0!==e.pageSize&&("1"===e.pageSize||1===e.pageSize||e.pageSize===tk.FLIPBOOK_PAGE_SIZE.SINGLE?e.pageSize=tk.FLIPBOOK_PAGE_SIZE.SINGLE:"2"===e.pageSize||2===e.pageSize||e.pageSize===tk.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL?e.pageSize=tk.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL:e.pageSize===tk.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK||(e.pageSize=tk.FLIPBOOK_PAGE_SIZE.AUTO)),void 0!==e.pageMode&&("1"===e.pageMode||1===e.pageMode||e.pageMode===tk.FLIPBOOK_PAGE_MODE.SINGLE?e.pageMode=tk.FLIPBOOK_PAGE_MODE.SINGLE:"2"===e.pageMode||2===e.pageMode||e.pageMode===tk.FLIPBOOK_PAGE_MODE.DOUBLE?e.pageMode=tk.FLIPBOOK_PAGE_MODE.DOUBLE:e.pageMode=tk.FLIPBOOK_PAGE_MODE.AUTO),void 0!==e.singlePageMode&&("1"===e.singlePageMode||1===e.singlePageMode||e.singlePageMode===tk.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM?e.singlePageMode=tk.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM:"2"===e.singlePageMode||2===e.singlePageMode||e.singlePageMode===tk.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET?e.singlePageMode=tk.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET:e.singlePageMode=tk.FLIPBOOK_SINGLE_PAGE_MODE.AUTO),void 0!==e.controlsPosition&&"hide"===e.controlsPosition&&(e.controlsPosition=tk.CONTROLS_POSITION.HIDDEN),void 0!==e.overwritePDFOutline&&(e.overwritePDFOutline=m.isTrue(e.overwritePDFOutline)),void 0!==e.webgl&&(e.is3D=e.webgl=e.webgl,delete e.webgl),void 0!==e.webglShadow&&(e.has3DShadow=m.isTrue(e.webglShadow),delete e.webglShadow),void 0!==e.scrollWheel&&(m.isTrue(e.scrollWheel)&&(e.mouseScrollAction=tk.MOUSE_SCROLL_ACTIONS.ZOOM),delete e.scrollWheel),void 0!==e.stiffness&&delete e.stiffness,void 0!==e.soundEnable&&(e.enableSound=m.isTrue(e.soundEnable),delete e.soundEnable),void 0!==e.enableDownload&&(e.showDownloadControl=m.isTrue(e.enableDownload),delete e.enableDownload),void 0!==e.autoEnableOutline&&(e.autoOpenOutline=m.isTrue(e.autoEnableOutline),delete e.autoEnableOutline),void 0!==e.autoEnableThumbnail&&(e.autoOpenThumbnail=m.isTrue(e.autoEnableThumbnail),delete e.autoEnableThumbnail),void 0!==e.direction&&("2"===e.direction||2===e.direction||e.direction===tk.READ_DIRECTION.RTL?e.readDirection=tk.READ_DIRECTION.RTL:e.readDirection=tk.READ_DIRECTION.LTR,delete e.direction),void 0!==e.hard&&(e.flipbookHardPages=e.hard,"hard"===e.flipbookHardPages&&(e.flipbookHardPages="all"),delete e.hard),void 0!==e.forceFit&&delete e.forceFit,m.sanitizeOptions(e)};tT.fn.extend({flipBook:function(e,t){return null==t&&(t={}),t.source=e,t.element=tT(this),new p.Application(t)}}),tT(document).ready(function(){var e=tT("body");tk.executeCallback("beforeDearFlipInit"),void 0!==window.dFlipWPGlobal&&tT.extend(!0,tk.defaults,tO(window.dFlipWPGlobal)),tk.initUtils(),tk.initControls(),e.on("click",".df-element[data-df-lightbox],.df-element[data-lightbox]",function(e){var t=tT(this);e.preventDefault(),e.stopPropagation(),tk.openLightBox(t)}),tk.checkBrowserURLforDefaults(),tk.parseCSSElements(),tk.parseFallBack(),m.detectHash(),tk.parseNormalElements(),tk.executeCallback("afterDearFlipInit")}),m.finalizeOptions=function(e){return tO(e)},tk.executeCallback("onDearFlipLoad")}()}();
(()=>{"use strict";var e,r,_,t,a,n={},i={};function __webpack_require__(e){var r=i[e];if(void 0!==r)return r.exports;var _=i[e]={exports:{}};return n[e].call(_.exports,_,_.exports,__webpack_require__),_.exports}__webpack_require__.m=n,e=[],__webpack_require__.O=(r,_,t,a)=>{if(!_){var n=1/0;for(b=0;b<e.length;b++){for(var[_,t,a]=e[b],i=!0,c=0;c<_.length;c++)(!1&a||n>=a)&&Object.keys(__webpack_require__.O).every(e=>__webpack_require__.O[e](_[c]))?_.splice(c--,1):(i=!1,a<n&&(n=a));if(i){e.splice(b--,1);var o=t();void 0!==o&&(r=o)}}return r}a=a||0;for(var b=e.length;b>0&&e[b-1][2]>a;b--)e[b]=e[b-1];e[b]=[_,t,a]},_=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);__webpack_require__.r(a);var n={};r=r||[null,_({}),_([]),_(_)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~r.indexOf(i);i=_(i))Object.getOwnPropertyNames(i).forEach(r=>n[r]=()=>e[r]);return n.default=()=>e,__webpack_require__.d(a,n),a},__webpack_require__.d=(e,r)=>{for(var _ in r)__webpack_require__.o(r,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:r[_]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((r,_)=>(__webpack_require__.f[_](e,r),r),[])),__webpack_require__.u=e=>786===e?"397f2d183c19202777d6.bundle.min.js":216===e?"lightbox.570c05c5a283cfb6b223.bundle.min.js":30===e?"text-path.a67c1f3a78d208bc7e1b.bundle.min.js":131===e?"accordion.8b0db5058afeb74622f5.bundle.min.js":707===e?"alert.42cc1d522ef5c60bf874.bundle.min.js":457===e?"counter.12335f45aaa79d244f24.bundle.min.js":234===e?"progress.0ea083b809812c0e3aa1.bundle.min.js":575===e?"tabs.18344b05d8d1ea0702bc.bundle.min.js":775===e?"toggle.2a177a3ef4785d3dfbc5.bundle.min.js":180===e?"video.86d44e46e43d0807e708.bundle.min.js":177===e?"image-carousel.6167d20b95b33386757b.bundle.min.js":212===e?"text-editor.45609661e409413f1cef.bundle.min.js":211===e?"wp-audio.c9624cb6e5dc9de86abd.bundle.min.js":215===e?"nested-tabs.a2401356d329f179475e.bundle.min.js":915===e?"nested-accordion.294d40984397351fd0f5.bundle.min.js":1===e?"contact-buttons.e98d0220ce8c38404e7e.bundle.min.js":336===e?"floating-bars.740d06d17cea5cebdb61.bundle.min.js":557===e?"shared-frontend-handlers.03caa53373b56d3bab67.bundle.min.js":396===e?"shared-editor-handlers.cacdcbed391abf4b48b0.bundle.min.js":768===e?"container-editor-handlers.a2e8e48d28c5544fb183.bundle.min.js":77===e?"section-frontend-handlers.d85ab872da118940910d.bundle.min.js":220===e?"section-editor-handlers.53ffedef32043348b99b.bundle.min.js":304===e?"nested-title-keyboard-handler.2a67d3cc630e11815acc.bundle.min.js":void 0,__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a="elementorFrontend:",__webpack_require__.l=(e,r,_,n)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==_)for(var o=document.getElementsByTagName("script"),b=0;b<o.length;b++){var u=o[b];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==a+_){i=u;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",a+_),i.src=e),t[e]=[r];var onScriptComplete=(r,_)=>{i.onerror=i.onload=null,clearTimeout(d);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(_)),r)return r(_)},d=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=onScriptComplete.bind(null,i.onerror),i.onload=onScriptComplete.bind(null,i.onload),c&&document.head.appendChild(i)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var r=__webpack_require__.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var _=r.getElementsByTagName("script");if(_.length)for(var t=_.length-1;t>-1&&(!e||!/^http(s?):/.test(e));)e=_[t--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={76:0};__webpack_require__.f.j=(r,_)=>{var t=__webpack_require__.o(e,r)?e[r]:void 0;if(0!==t)if(t)_.push(t[2]);else if(76!=r){var a=new Promise((_,a)=>t=e[r]=[_,a]);_.push(t[2]=a);var n=__webpack_require__.p+__webpack_require__.u(r),i=new Error;__webpack_require__.l(n,_=>{if(__webpack_require__.o(e,r)&&(0!==(t=e[r])&&(e[r]=void 0),t)){var a=_&&("load"===_.type?"missing":_.type),n=_&&_.target&&_.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,t[1](i)}},"chunk-"+r,r)}else e[r]=0},__webpack_require__.O.j=r=>0===e[r];var webpackJsonpCallback=(r,_)=>{var t,a,[n,i,c]=_,o=0;if(n.some(r=>0!==e[r])){for(t in i)__webpack_require__.o(i,t)&&(__webpack_require__.m[t]=i[t]);if(c)var b=c(__webpack_require__)}for(r&&r(_);o<n.length;o++)a=n[o],__webpack_require__.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return __webpack_require__.O(b)},r=self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[];r.forEach(webpackJsonpCallback.bind(null,0)),r.push=webpackJsonpCallback.bind(null,r.push.bind(r))})()})();
(self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[]).push([[941],{1:(e,t,r)=>{"use strict";var n=r(5578),i=r(7255),s=r(5755),o=r(1866),a=r(6029),c=r(5022),l=n.Symbol,u=i("wks"),p=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=a&&s(l,e)?l[e]:p("Symbol."+e)),u[e]}},41:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},169:(e,t,r)=>{"use strict";var n=r(4762),i=r(8473),s=r(1483),o=r(5755),a=r(382),c=r(2048).CONFIGURABLE,l=r(7268),u=r(4483),p=u.enforce,d=u.get,h=String,f=Object.defineProperty,g=n("".slice),m=n("".replace),v=n([].join),y=a&&!i(function(){return 8!==f(function(){},"length",{value:8}).length}),w=String(String).split("String"),b=e.exports=function(e,t,r){"Symbol("===g(h(t),0,7)&&(t="["+m(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||c&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&o(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=p(e);return o(n,"source")||(n.source=v(w,"string"==typeof t?t:"")),e};Function.prototype.toString=b(function toString(){return s(this)&&d(this).source||l(this)},"toString")},274:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},348:(e,t,r)=>{"use strict";var n=r(1807),i=r(1483),s=r(1704),o=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!s(a=n(r,e)))return a;if(i(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!s(a=n(r,e)))return a;throw new o("Can't convert object to primitive value")}},382:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},641:(e,t,r)=>{"use strict";r(5724),r(4846),r(7458),r(9655);const Module=function(){const e=jQuery,t=arguments,r=this,n={};let i;this.getItems=function(e,t){if(t){const r=t.split("."),n=r.splice(0,1);if(!r.length)return e[n];if(!e[n])return;return this.getItems(e[n],r.join("."))}return e},this.getSettings=function(e){return this.getItems(i,e)},this.setSettings=function(t,n,s){if(s||(s=i),"object"==typeof t)return e.extend(s,t),r;const o=t.split("."),a=o.splice(0,1);return o.length?(s[a]||(s[a]={}),r.setSettings(o.join("."),n,s[a])):(s[a]=n,r)},this.getErrorMessage=function(e,t){let r;if("forceMethodImplementation"===e)r=`The method '${t}' must to be implemented in the inheritor child.`;else r="An error occurs";return r},this.forceMethodImplementation=function(e){throw new Error(this.getErrorMessage("forceMethodImplementation",e))},this.on=function(t,i){if("object"==typeof t)return e.each(t,function(e){r.on(e,this)}),r;return t.split(" ").forEach(function(e){n[e]||(n[e]=[]),n[e].push(i)}),r},this.off=function(e,t){if(!n[e])return r;if(!t)return delete n[e],r;const i=n[e].indexOf(t);return-1!==i&&(delete n[e][i],n[e]=n[e].filter(e=>e)),r},this.trigger=function(t){const i="on"+t[0].toUpperCase()+t.slice(1),s=Array.prototype.slice.call(arguments,1);r[i]&&r[i].apply(r,s);const o=n[t];return o?(e.each(o,function(e,t){t.apply(r,s)}),r):r},r.__construct.apply(r,t),e.each(r,function(e){const t=r[e];"function"==typeof t&&(r[e]=function(){return t.apply(r,arguments)})}),function(){i=r.getDefaultSettings();const n=t[0];n&&e.extend(!0,i,n)}(),r.trigger("init")};Module.prototype.__construct=function(){},Module.prototype.getDefaultSettings=function(){return{}},Module.prototype.getConstructorID=function(){return this.constructor.name},Module.extend=function(e){const t=jQuery,r=this,child=function(){return r.apply(this,arguments)};return t.extend(child,r),(child.prototype=Object.create(t.extend({},r.prototype,e))).constructor=child,child.__super__=r.prototype,child},e.exports=Module},670:(e,t,r)=>{"use strict";var n=r(382),i=r(5835),s=r(7738);e.exports=function(e,t,r){n?i.f(e,t,s(0,r)):e[t]=r}},751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724),r(4846),r(9655);class InstanceType{static[Symbol.hasInstance](e){let t=super[Symbol.hasInstance](e);if(e&&!e.constructor.getInstanceType)return t;if(e&&(e.instanceTypes||(e.instanceTypes=[]),t||this.getInstanceType()===e.constructor.getInstanceType()&&(t=!0),t)){const t=this.getInstanceType===InstanceType.getInstanceType?"BaseInstanceType":this.getInstanceType();-1===e.instanceTypes.indexOf(t)&&e.instanceTypes.push(t)}return!t&&e&&(t=e.instanceTypes&&Array.isArray(e.instanceTypes)&&-1!==e.instanceTypes.indexOf(this.getInstanceType())),t}static getInstanceType(){elementorModules.ForceMethodImplementation()}constructor(){let e=new.target;const t=[];for(;e.__proto__&&e.__proto__.name;)t.push(e.__proto__),e=e.__proto__;t.reverse().forEach(e=>this instanceof e)}}t.default=InstanceType},1091:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},1265:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(641)),s=n(r(2425)),o=n(r(2946)),a=n(r(3980)),c=n(r(2970)),l=n(r(8685)),u=r(9031),p=r(1462);const d={Module:i.default,ViewModule:s.default,ArgsObject:o.default,ForceMethodImplementation:l.default,utils:{Masonry:a.default,Scroll:c.default},importExport:{createGetInitialState:u.createGetInitialState,customizationDialogsRegistry:p.customizationDialogsRegistry}};window.elementorModules?Object.assign(window.elementorModules,d):window.elementorModules=d;t.default=window.elementorModules},1278:(e,t,r)=>{"use strict";var n=r(4762),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},1409:(e,t,r)=>{"use strict";var n=r(5578),i=r(1483);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},1423:(e,t,r)=>{"use strict";var n=r(1409),i=r(1483),s=r(4815),o=r(5022),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,a(e))}},1462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customizationDialogsRegistry=void 0;var n=r(7958);t.customizationDialogsRegistry=new n.BaseRegistry},1483:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},1506:(e,t,r)=>{"use strict";var n=r(2914),i=r(1807),s=r(2293),o=r(8761),a=r(5299),c=r(6960),l=r(4815),u=r(4887),p=r(6665),d=r(6721),h=TypeError,Result=function(e,t){this.stopped=e,this.result=t},f=Result.prototype;e.exports=function(e,t,r){var g,m,v,y,w,b,S,x=r&&r.that,E=!(!r||!r.AS_ENTRIES),I=!(!r||!r.IS_RECORD),_=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),O=n(t,x),stop=function(e){return g&&d(g,"normal"),new Result(!0,e)},callFn=function(e){return E?(s(e),C?O(e[0],e[1],stop):O(e[0],e[1])):C?O(e,stop):O(e)};if(I)g=e.iterator;else if(_)g=e;else{if(!(m=p(e)))throw new h(o(e)+" is not iterable");if(a(m)){for(v=0,y=c(e);y>v;v++)if((w=callFn(e[v]))&&l(f,w))return w;return new Result(!1)}g=u(e,m)}for(b=I?e.next:g.next;!(S=i(b,g)).done;){try{w=callFn(S.value)}catch(e){d(g,"throw",e)}if("object"==typeof w&&w&&l(f,w))return w}return new Result(!1)}},1507:e=>{"use strict";e.exports={}},1703:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function trunc(e){var n=+e;return(n>0?r:t)(n)}},1704:(e,t,r)=>{"use strict";var n=r(1483);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1799:(e,t,r)=>{"use strict";var n=r(382),i=r(8473),s=r(3145);e.exports=!n&&!i(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},1807:(e,t,r)=>{"use strict";var n=r(274),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},1831:(e,t,r)=>{"use strict";var n=r(9557),i=r(5578),s=r(2095),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.46.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},1851:(e,t,r)=>{"use strict";var n,i,s,o=r(8473),a=r(1483),c=r(1704),l=r(5290),u=r(3181),p=r(7914),d=r(1),h=r(9557),f=d("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(n=i):g=!0),!c(n)||o(function(){var e={};return n[f].call(e)!==e})?n={}:h&&(n=l(n)),a(n[f])||p(n,f,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},1866:(e,t,r)=>{"use strict";var n=r(4762),i=0,s=Math.random(),o=n(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+s,36)}},1975:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(8120),o=r(2293),a=r(41),c=r(8660),l=r(8901),u=r(9557),p=r(6721),d=r(7486),h=r(5267),f=!u&&!d("filter",function(){}),g=!u&&!f&&h("filter",TypeError),m=u||f||g,v=c(function(){for(var e,t,r=this.iterator,n=this.predicate,s=this.next;;){if(e=o(i(s,r)),this.done=!!e.done)return;if(t=e.value,l(r,n,[t,this.counter++],!0))return t}});n({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function filter(e){o(this);try{s(e)}catch(e){p(this,"throw",e)}return g?i(g,this,e):new v(a(this),{predicate:e})}})},1983:(e,t,r)=>{"use strict";var n=r(6721);e.exports=function(e,t,r){for(var i=e.length-1;i>=0;i--)if(void 0!==e[i])try{r=n(e[i].iterator,t,r)}catch(e){t="throw",r=e}if("throw"===t)throw r;return r}},2048:(e,t,r)=>{"use strict";var n=r(382),i=r(5755),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),c=a&&"something"===function something(){}.name,l=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:l}},2095:(e,t,r)=>{"use strict";var n=r(5578),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},2121:(e,t,r)=>{"use strict";var n=r(4762),i=r(8473),s=r(1278),o=Object,a=n("".split);e.exports=i(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?a(e,""):o(e)}:o},2278:(e,t,r)=>{"use strict";var n=r(6742),i=r(4741).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,i)}},2293:(e,t,r)=>{"use strict";var n=r(1704),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not an object")}},2313:(e,t,r)=>{"use strict";var n=r(7914);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},2347:(e,t,r)=>{"use strict";var n=r(3312),i=Object;e.exports=function(e){return i(n(e))}},2355:(e,t,r)=>{"use strict";var n=r(1807),i=r(1704),s=r(1423),o=r(2564),a=r(348),c=r(1),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,c=o(e,u);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!i(r)||s(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},2425:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(641));t.default=i.default.extend({elements:null,getDefaultElements:()=>({}),bindEvents(){},onInit(){this.initElements(),this.bindEvents()},initElements(){this.elements=this.getDefaultElements()}})},2564:(e,t,r)=>{"use strict";var n=r(8120),i=r(5983);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},2811:(e,t,r)=>{"use strict";var n=r(1409);e.exports=n("document","documentElement")},2890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211);class _default extends elementorModules.ViewModule{getDefaultSettings(){return{selectors:{elements:".elementor-element",nestedDocumentElements:".elementor .elementor-element"},classes:{editMode:"elementor-edit-mode"}}}getDefaultElements(){const e=this.getSettings("selectors");return{$elements:this.$element.find(e.elements).not(this.$element.find(e.nestedDocumentElements))}}getDocumentSettings(e){let t;if(this.isEdit){t={};const e=elementor.settings.page.model;jQuery.each(e.getActiveControls(),r=>{t[r]=e.attributes[r]})}else t=this.$element.data("elementor-settings")||{};return this.getItems(t,e)}runElementsHandlers(){this.elements.$elements.each((e,t)=>setTimeout(()=>elementorFrontend.elementsHandler.runReadyTrigger(t)))}onInit(){this.$element=this.getSettings("$element"),super.onInit(),this.isEdit=this.$element.hasClass(this.getSettings("classes.editMode")),this.isEdit?elementor.on("document:loaded",()=>{elementor.settings.page.model.on("change",this.onSettingsChange.bind(this))}):this.runElementsHandlers()}onSettingsChange(){}}t.default=_default},2914:(e,t,r)=>{"use strict";var n=r(3786),i=r(8120),s=r(274),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},2946:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(751)),s=n(r(5213));class ArgsObject extends i.default{static getInstanceType(){return"ArgsObject"}constructor(e){super(),this.args=e}requireArgument(e,t=this.args){if(!Object.prototype.hasOwnProperty.call(t,e))throw Error(`${e} is required.`)}requireArgumentType(e,t,r=this.args){if(this.requireArgument(e,r),typeof r[e]!==t)throw Error(`${e} invalid type: ${t}.`)}requireArgumentInstance(e,t,r=this.args){if(this.requireArgument(e,r),!(r[e]instanceof t||(0,s.default)(r[e],t)))throw Error(`${e} invalid instance.`)}requireArgumentConstructor(e,t,r=this.args){if(this.requireArgument(e,r),r[e].constructor.toString()!==t.prototype.constructor.toString())throw Error(`${e} invalid constructor type.`)}}t.default=ArgsObject},2970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724);t.default=class Scroll{static scrollObserver(e){let t=0;const r={root:e.root||null,rootMargin:e.offset||"0px",threshold:((e=0)=>{const t=[];if(e>0&&e<=100){const r=100/e;for(let e=0;e<=100;e+=r)t.push(e/100)}else t.push(0);return t})(e.sensitivity)};return new IntersectionObserver(function handleIntersect(r){const n=r[0].boundingClientRect.y,i=r[0].isIntersecting,s=n<t?"down":"up",o=Math.abs(parseFloat((100*r[0].intersectionRatio).toFixed(2)));e.callback({sensitivity:e.sensitivity,isInViewport:i,scrollPercentage:o,intersectionScrollDirection:s}),t=n},r)}static getElementViewportPercentage(e,t={}){const r=e[0].getBoundingClientRect(),n=t.start||0,i=t.end||0,s=window.innerHeight*n/100,o=window.innerHeight*i/100,a=r.top-window.innerHeight,c=0-a+s,l=r.top+s+e.height()-a+o,u=Math.max(0,Math.min(c/l,1));return parseFloat((100*u).toFixed(2))}static getPageScrollPercentage(e={},t){const r=e.start||0,n=e.end||0,i=t||document.documentElement.scrollHeight-document.documentElement.clientHeight,s=i*r/100,o=i+s+i*n/100;return(document.documentElement.scrollTop+document.body.scrollTop+s)/o*100}}},3005:(e,t,r)=>{"use strict";var n=r(1703);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3145:(e,t,r)=>{"use strict";var n=r(5578),i=r(1704),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},3181:(e,t,r)=>{"use strict";var n=r(5755),i=r(1483),s=r(2347),o=r(5409),a=r(9441),c=o("IE_PROTO"),l=Object,u=l.prototype;e.exports=a?l.getPrototypeOf:function(e){var t=s(e);if(n(t,c))return t[c];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof l?u:null}},3242:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(1506),o=r(8120),a=r(2293),c=r(41),l=r(6721),u=r(5267)("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{find:function find(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}if(u)return i(u,this,e);var t=c(this),r=0;return s(t,function(t,n){if(e(t,r++))return n(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},3312:(e,t,r)=>{"use strict";var n=r(5983),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},3392:(e,t,r)=>{"use strict";var n=r(3005),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},3617:(e,t,r)=>{"use strict";var n=r(8612),i=r(5578),s=r(6021),o=r(2293),a=r(1483),c=r(3181),l=r(3864),u=r(670),p=r(8473),d=r(5755),h=r(1),f=r(1851).IteratorPrototype,g=r(382),m=r(9557),v="constructor",y="Iterator",w=h("toStringTag"),b=TypeError,S=i[y],x=m||!a(S)||S.prototype!==f||!p(function(){S({})}),E=function Iterator(){if(s(this,f),c(this)===f)throw new b("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(e,t){g?l(f,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===f)throw new b("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):f[e]=t};d(f,w)||defineIteratorPrototypeAccessor(w,y),!x&&d(f,v)&&f[v]!==Object||defineIteratorPrototypeAccessor(v,E),E.prototype=f,n({global:!0,constructor:!0,forced:x},{Iterator:E})},3658:(e,t,r)=>{"use strict";var n=r(6742),i=r(4741);e.exports=Object.keys||function keys(e){return n(e,i)}},3786:(e,t,r)=>{"use strict";var n=r(1278),i=r(4762);e.exports=function(e){if("Function"===n(e))return i(e)}},3815:(e,t,r)=>{"use strict";var n=r(2355),i=r(1423);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},3864:(e,t,r)=>{"use strict";var n=r(169),i=r(5835);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},3896:(e,t,r)=>{"use strict";var n=r(382),i=r(8473);e.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},3980:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724);var i=n(r(2425));t.default=i.default.extend({getDefaultSettings:()=>({container:null,items:null,columnsCount:3,verticalSpaceBetween:30}),getDefaultElements(){return{$container:jQuery(this.getSettings("container")),$items:jQuery(this.getSettings("items"))}},run(){var e=[],t=this.elements.$container.position().top,r=this.getSettings(),n=r.columnsCount;t+=parseInt(this.elements.$container.css("margin-top"),10),this.elements.$items.each(function(i){var s=Math.floor(i/n),o=jQuery(this),a=o[0].getBoundingClientRect().height+r.verticalSpaceBetween;if(s){var c=o.position(),l=i%n,u=c.top-t-e[l];u-=parseInt(o.css("margin-top"),10),u*=-1,o.css("margin-top",u+"px"),e[l]+=a}else e.push(a)})}})},3991:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(8120),o=r(2293),a=r(41),c=r(8660),l=r(8901),u=r(6721),p=r(7486),d=r(5267),h=r(9557),f=!h&&!p("map",function(){}),g=!h&&!f&&d("map",TypeError),m=h||f||g,v=c(function(){var e=this.iterator,t=o(i(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:m},{map:function map(e){o(this);try{s(e)}catch(e){u(this,"throw",e)}return g?i(g,this,e):new v(a(this),{mapper:e})}})},4338:(e,t,r)=>{"use strict";var n={};n[r(1)("toStringTag")]="z",e.exports="[object z]"===String(n)},4347:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},4364:(e,t,r)=>{"use strict";r(3991)},4483:(e,t,r)=>{"use strict";var n,i,s,o=r(4644),a=r(5578),c=r(1704),l=r(9037),u=r(5755),p=r(1831),d=r(5409),h=r(1507),f="Object already initialized",g=a.TypeError,m=a.WeakMap;if(o||p.state){var v=p.state||(p.state=new m);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw new g(f);return t.facade=e,v.set(e,t),t},i=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var y=d("state");h[y]=!0,n=function(e,t){if(u(e,y))throw new g(f);return t.facade=e,l(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},s=function(e){return u(e,y)}}e.exports={set:n,get:i,has:s,enforce:function(e){return s(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},4644:(e,t,r)=>{"use strict";var n=r(5578),i=r(1483),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},4741:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},4762:(e,t,r)=>{"use strict";var n=r(274),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},4815:(e,t,r)=>{"use strict";var n=r(4762);e.exports=n({}.isPrototypeOf)},4846:(e,t,r)=>{"use strict";r(3617)},4887:(e,t,r)=>{"use strict";var n=r(1807),i=r(8120),s=r(2293),o=r(8761),a=r(6665),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return s(n(r,e));throw new c(o(e)+" is not iterable")}},4914:(e,t,r)=>{"use strict";var n=r(1278);e.exports=Array.isArray||function isArray(e){return"Array"===n(e)}},4946:(e,t,r)=>{"use strict";var n=r(6784),i=n(r(1265)),s=n(r(2890)),o=n(r(7955)),a=n(r(8140)),c=n(r(7224)),l=n(r(5633)),u=n(r(9603));i.default.frontend={Document:s.default,tools:{StretchElement:o.default},handlers:{Base:c.default,StretchedElement:a.default,SwiperBase:l.default,CarouselBase:u.default}}},4961:(e,t,r)=>{"use strict";var n=r(382),i=r(1807),s=r(7611),o=r(7738),a=r(5599),c=r(3815),l=r(5755),u=r(1799),p=Object.getOwnPropertyDescriptor;t.f=n?p:function getOwnPropertyDescriptor(e,t){if(e=a(e),t=c(t),u)try{return p(e,t)}catch(e){}if(l(e,t))return o(!i(s.f,e,t),e[t])}},5022:(e,t,r)=>{"use strict";var n=r(6029);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=(e,t)=>{t=Array.isArray(t)?t:[t];for(const r of t)if(e.constructor.name===r.prototype[Symbol.toStringTag])return!0;return!1}},5247:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},5267:(e,t,r)=>{"use strict";var n=r(5578);e.exports=function(e,t){var r=n.Iterator,i=r&&r.prototype,s=i&&i[e],o=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(e){e instanceof t||(o=!1)}if(!o)return s}},5290:(e,t,r)=>{"use strict";var n,i=r(2293),s=r(5799),o=r(4741),a=r(1507),c=r(2811),l=r(3145),u=r(5409),p="prototype",d="script",h=u("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+d+">"+e+"</"+d+">"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):(t=l("iframe"),r="java"+d+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(n);for(var i=o.length;i--;)delete NullProtoObject[p][o[i]];return NullProtoObject()};a[h]=!0,e.exports=Object.create||function create(e,t){var r;return null!==e?(EmptyConstructor[p]=i(e),r=new EmptyConstructor,EmptyConstructor[p]=null,r[h]=e):r=NullProtoObject(),void 0===t?r:s.f(r,t)}},5299:(e,t,r)=>{"use strict";var n=r(1),i=r(6775),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},5409:(e,t,r)=>{"use strict";var n=r(7255),i=r(1866),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},5578:function(e,t,r){"use strict";var check=function(e){return e&&e.Math===Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof r.g&&r.g)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5599:(e,t,r)=>{"use strict";var n=r(2121),i=r(3312);e.exports=function(e){return n(i(e))}},5633:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(7224));class SwiperHandlerBase extends i.default{getInitialSlide(){const e=this.getEditSettings();return e.activeItemIndex?e.activeItemIndex-1:0}getSlidesCount(){return this.elements.$slides.length}togglePauseOnHover(e){e?this.elements.$swiperContainer.on({mouseenter:()=>{this.swiper.autoplay.stop()},mouseleave:()=>{this.swiper.autoplay.start()}}):this.elements.$swiperContainer.off("mouseenter mouseleave")}handleKenBurns(){const e=this.getSettings();this.$activeImageBg&&this.$activeImageBg.removeClass(e.classes.kenBurnsActive),this.activeItemIndex=this.swiper?this.swiper.activeIndex:this.getInitialSlide(),this.swiper?this.$activeImageBg=jQuery(this.swiper.slides[this.activeItemIndex]).children("."+e.classes.slideBackground):this.$activeImageBg=jQuery(this.elements.$slides[0]).children("."+e.classes.slideBackground),this.$activeImageBg.addClass(e.classes.kenBurnsActive)}}t.default=SwiperHandlerBase},5724:(e,t,r)=>{"use strict";var n=r(8612),i=r(2347),s=r(6960),o=r(9273),a=r(1091);n({target:"Array",proto:!0,arity:1,forced:r(8473)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function push(e){var t=i(this),r=s(t),n=arguments.length;a(r+n);for(var c=0;c<n;c++)t[r]=arguments[c],r++;return o(t,r),r}})},5755:(e,t,r)=>{"use strict";var n=r(4762),i=r(2347),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return s(i(e),t)}},5799:(e,t,r)=>{"use strict";var n=r(382),i=r(3896),s=r(5835),o=r(2293),a=r(5599),c=r(3658);t.f=n&&!i?Object.defineProperties:function defineProperties(e,t){o(e);for(var r,n=a(t),i=c(t),l=i.length,u=0;l>u;)s.f(e,r=i[u++],n[r]);return e}},5835:(e,t,r)=>{"use strict";var n=r(382),i=r(1799),s=r(3896),o=r(2293),a=r(3815),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p="enumerable",d="configurable",h="writable";t.f=n?s?function defineProperty(e,t,r){if(o(e),t=a(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=u(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:p in r?r[p]:n[p],writable:!1})}return l(e,t,r)}:l:function defineProperty(e,t,r){if(o(e),t=a(t),o(r),i)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},5983:e=>{"use strict";e.exports=function(e){return null==e}},6021:(e,t,r)=>{"use strict";var n=r(4815),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},6029:(e,t,r)=>{"use strict";var n=r(6477),i=r(8473),s=r(5578).String;e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},6145:(e,t,r)=>{"use strict";var n=r(4338),i=r(1483),s=r(1278),o=r(1)("toStringTag"),a=Object,c="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?r:c?s(t):"Object"===(n=s(t))&&i(t.callee)?"Arguments":n}},6211:(e,t,r)=>{"use strict";r(3242)},6477:(e,t,r)=>{"use strict";var n,i,s=r(5578),o=r(9461),a=s.process,c=s.Deno,l=a&&a.versions||c&&c.version,u=l&&l.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},6651:(e,t,r)=>{"use strict";var n=r(5599),i=r(3392),s=r(6960),createMethod=function(e){return function(t,r,o){var a=n(t),c=s(a);if(0===c)return!e&&-1;var l,u=i(o,c);if(e&&r!=r){for(;c>u;)if((l=a[u++])!=l)return!0}else for(;c>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},6665:(e,t,r)=>{"use strict";var n=r(6145),i=r(2564),s=r(5983),o=r(6775),a=r(1)("iterator");e.exports=function(e){if(!s(e))return i(e,a)||i(e,"@@iterator")||o[n(e)]}},6721:(e,t,r)=>{"use strict";var n=r(1807),i=r(2293),s=r(2564);e.exports=function(e,t,r){var o,a;i(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw r;if(a)throw o;return i(o),r}},6726:(e,t,r)=>{"use strict";var n=r(5755),i=r(9497),s=r(4961),o=r(5835);e.exports=function(e,t,r){for(var a=i(t),c=o.f,l=s.f,u=0;u<a.length;u++){var p=a[u];n(e,p)||r&&n(r,p)||c(e,p,l(t,p))}}},6742:(e,t,r)=>{"use strict";var n=r(4762),i=r(5755),s=r(5599),o=r(6651).indexOf,a=r(1507),c=n([].push);e.exports=function(e,t){var r,n=s(e),l=0,u=[];for(r in n)!i(a,r)&&i(n,r)&&c(u,r);for(;t.length>l;)i(n,r=t[l++])&&(~o(u,r)||c(u,r));return u}},6775:e=>{"use strict";e.exports={}},6784:e=>{e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6960:(e,t,r)=>{"use strict";var n=r(8324);e.exports=function(e){return n(e.length)}},7224:(e,t,r)=>{"use strict";r(5724),r(4846),r(7458),r(6211),r(9655),e.exports=elementorModules.ViewModule.extend({$element:null,editorListeners:null,onElementChange:null,onEditSettingsChange:null,onPageSettingsChange:null,isEdit:null,__construct(e){this.isActive(e)&&(this.$element=e.$element,this.isEdit=this.$element.hasClass("elementor-element-edit-mode"),this.isEdit&&this.addEditorListeners())},isActive:()=>!0,isElementInTheCurrentDocument(){return!!elementorFrontend.isEditMode()&&elementor.documents.currentDocument.id.toString()===this.$element[0].closest(".elementor").dataset.elementorId},findElement(e){var t=this.$element;return t.find(e).filter(function(){return jQuery(this).parent().closest(".elementor-element").is(t)})},getUniqueHandlerID(e,t){return e||(e=this.getModelCID()),t||(t=this.$element),e+t.attr("data-element_type")+this.getConstructorID()},initEditorListeners(){var e=this;if(e.editorListeners=[{event:"element:destroy",to:elementor.channels.data,callback(t){t.cid===e.getModelCID()&&e.onDestroy()}}],e.onElementChange){const t=e.getWidgetType()||e.getElementType();let r="change";"global"!==t&&(r+=":"+t),e.editorListeners.push({event:r,to:elementor.channels.editor,callback(t,r){e.getUniqueHandlerID(r.model.cid,r.$el)===e.getUniqueHandlerID()&&e.onElementChange(t.model.get("name"),t,r)}})}e.onEditSettingsChange&&e.editorListeners.push({event:"change:editSettings",to:elementor.channels.editor,callback(t,r){if(r.model.cid!==e.getModelCID())return;const n=Object.keys(t.changed)[0];e.onEditSettingsChange(n,t.changed[n])}}),["page"].forEach(function(t){var r="on"+t[0].toUpperCase()+t.slice(1)+"SettingsChange";e[r]&&e.editorListeners.push({event:"change",to:elementor.settings[t].model,callback(t){e[r](t.changed)}})})},getEditorListeners(){return this.editorListeners||this.initEditorListeners(),this.editorListeners},addEditorListeners(){var e=this.getUniqueHandlerID();this.getEditorListeners().forEach(function(t){elementorFrontend.addListenerOnce(e,t.event,t.callback,t.to)})},removeEditorListeners(){var e=this.getUniqueHandlerID();this.getEditorListeners().forEach(function(t){elementorFrontend.removeListeners(e,t.event,null,t.to)})},getElementType(){return this.$element.data("element_type")},getWidgetType(){const e=this.$element.data("widget_type");if(e)return e.split(".")[0]},getID(){return this.$element.data("id")},getModelCID(){return this.$element.data("model-cid")},getElementSettings(e){let t={};const r=this.getModelCID();if(this.isEdit&&r){const e=elementorFrontend.config.elements.data[r],n=e.attributes;let i=n.widgetType||n.elType;n.isInner&&(i="inner-"+i);let s=elementorFrontend.config.elements.keys[i];s||(s=elementorFrontend.config.elements.keys[i]=[],jQuery.each(e.controls,(e,t)=>{(t.frontend_available||t.editor_available)&&s.push(e)})),jQuery.each(e.getActiveControls(),function(e){if(-1!==s.indexOf(e)){let r=n[e];r.toJSON&&(r=r.toJSON()),t[e]=r}})}else t=this.$element.data("settings")||{};return this.getItems(t,e)},getEditSettings(e){var t={};return this.isEdit&&(t=elementorFrontend.config.elements.editSettings[this.getModelCID()].attributes),this.getItems(t,e)},getCurrentDeviceSetting(e){return elementorFrontend.getCurrentDeviceSetting(this.getElementSettings(),e)},onInit(){this.isActive(this.getSettings())&&elementorModules.ViewModule.prototype.onInit.apply(this,arguments)},onDestroy(){this.isEdit&&this.removeEditorListeners(),this.unbindEvents&&this.unbindEvents()}})},7255:(e,t,r)=>{"use strict";var n=r(1831);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},7268:(e,t,r)=>{"use strict";var n=r(4762),i=r(1483),s=r(1831),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},7458:(e,t,r)=>{"use strict";r(1975)},7486:e=>{"use strict";e.exports=function(e,t){var r="function"==typeof Iterator&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch(e){return!0}}},7611:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:r},7738:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7914:(e,t,r)=>{"use strict";var n=r(1483),i=r(5835),s=r(169),o=r(2095);e.exports=function(e,t,r,a){a||(a={});var c=a.enumerable,l=void 0!==a.name?a.name:t;if(n(r)&&s(r,l,a),a.global)c?e[t]=r:o(t,r);else{try{a.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},7955:e=>{"use strict";e.exports=elementorModules.ViewModule.extend({getDefaultSettings:()=>({element:null,direction:elementorFrontend.config.is_rtl?"right":"left",selectors:{container:window},considerScrollbar:!1,cssOutput:"inline"}),getDefaultElements(){return{$element:jQuery(this.getSettings("element"))}},stretch(){const e=this.getSettings();let t;try{t=jQuery(e.selectors.container)}catch(e){}t&&t.length||(t=jQuery(this.getDefaultSettings().selectors.container)),this.reset();var r=this.elements.$element,n=t.innerWidth(),i=r.offset().left,s="fixed"===r.css("position"),o=s?0:i,a=window===t[0];if(!a){var c=t.offset().left;s&&(o=c),i>c&&(o=i-c)}if(e.considerScrollbar&&a){o-=window.innerWidth-n}s||(elementorFrontend.config.is_rtl&&(o=n-(r.outerWidth()+o)),o=-o),e.margin&&(o+=e.margin);var l={};let u=n;e.margin&&(u-=2*e.margin),l.width=u+"px",l[e.direction]=o+"px","variables"!==e.cssOutput?r.css(l):this.applyCssVariables(r,l)},reset(){const e={},t=this.getSettings(),r=this.elements.$element;"variables"!==t.cssOutput?(e.width="",e[t.direction]="",r.css(e)):this.resetCssVariables(r)},applyCssVariables(e,t){e.css("--stretch-width",t.width),t.left?e.css("--stretch-left",t.left):e.css("--stretch-right",t.right)},resetCssVariables(e){e.css({"--stretch-width":"","--stretch-left":"","--stretch-right":""})}})},7958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRegistry=void 0,r(4846),r(7458),r(9655),r(4364);t.BaseRegistry=class BaseRegistry{constructor(){this.sections=new Map}register(e){if(!e.key||!e.title)throw new Error("Template type must have key and title");const t=this.get(e.key)||this.formatSection(e);if(e.children)if(t.children){const r=new Map(t.children.map(e=>[e.key,e]));e.children.forEach(e=>{const t=this.formatSection(e);r.set(e.key,t)}),t.children=Array.from(r.values())}else t.children=e.children.map(e=>this.formatSection(e));this.sections.set(e.key,t)}formatSection({children:e,...t}){return{key:t.key,title:t.title,description:t.description||"",useParentDefault:!1!==t.useParentDefault,getInitialState:t.getInitialState||null,component:t.component||null,order:t.order||10,isAvailable:t.isAvailable||(()=>!0),...t}}getAll(){return Array.from(this.sections.values()).filter(e=>e.isAvailable()).map(e=>e.children?{...e,children:[...e.children].sort((e,t)=>e.order-t.order)}:e).sort((e,t)=>e.order-t.order)}get(e){return this.sections.get(e)}}},8120:(e,t,r)=>{"use strict";var n=r(1483),i=r(8761),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a function")}},8140:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211);var i=n(r(7224));class StretchedElement extends i.default{getStretchedClass(){return"e-stretched"}getStretchSettingName(){return"stretch_element"}getStretchActiveValue(){return"yes"}bindEvents(){const e=this.getUniqueHandlerID();elementorFrontend.addListenerOnce(e,"resize",this.stretch),elementorFrontend.addListenerOnce(e,"sticky:stick",this.stretch,this.$element),elementorFrontend.addListenerOnce(e,"sticky:unstick",this.stretch,this.$element),elementorFrontend.isEditMode()&&(this.onKitChangeStretchContainerChange=this.onKitChangeStretchContainerChange.bind(this),elementor.channels.editor.on("kit:change:stretchContainer",this.onKitChangeStretchContainerChange))}unbindEvents(){elementorFrontend.removeListeners(this.getUniqueHandlerID(),"resize",this.stretch),elementorFrontend.isEditMode()&&elementor.channels.editor.off("kit:change:stretchContainer",this.onKitChangeStretchContainerChange)}isActive(e){return elementorFrontend.isEditMode()||e.$element.hasClass(this.getStretchedClass())}getStretchElementForConfig(e=null){return e?this.$element.find(e):this.$element}getStretchElementConfig(){return{element:this.getStretchElementForConfig(),selectors:{container:this.getStretchContainer()},considerScrollbar:elementorFrontend.isEditMode()&&elementorFrontend.config.is_rtl}}initStretch(){this.stretch=this.stretch.bind(this),this.stretchElement=new elementorModules.frontend.tools.StretchElement(this.getStretchElementConfig())}getStretchContainer(){return elementorFrontend.getKitSettings("stretched_section_container")||window}isStretchSettingEnabled(){return this.getElementSettings(this.getStretchSettingName())===this.getStretchActiveValue()}stretch(){this.isStretchSettingEnabled()&&this.stretchElement.stretch()}onInit(...e){this.isActive(this.getSettings())&&(this.initStretch(),super.onInit(...e),this.stretch())}onElementChange(e){this.getStretchSettingName()===e&&(this.isStretchSettingEnabled()?this.stretch():this.stretchElement.reset())}onKitChangeStretchContainerChange(){this.stretchElement.setSettings("selectors.container",this.getStretchContainer()),this.stretch()}}t.default=StretchedElement},8324:(e,t,r)=>{"use strict";var n=r(3005),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8473:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},8612:(e,t,r)=>{"use strict";var n=r(5578),i=r(4961).f,s=r(9037),o=r(7914),a=r(2095),c=r(6726),l=r(8730);e.exports=function(e,t){var r,u,p,d,h,f=e.target,g=e.global,m=e.stat;if(r=g?n:m?n[f]||a(f,{}):n[f]&&n[f].prototype)for(u in t){if(d=t[u],p=e.dontCallGetSet?(h=i(r,u))&&h.value:r[u],!l(g?u:f+(m?".":"#")+u,e.forced)&&void 0!==p){if(typeof d==typeof p)continue;c(d,p)}(e.sham||p&&p.sham)&&s(d,"sham",!0),o(r,u,d,e)}}},8660:(e,t,r)=>{"use strict";var n=r(1807),i=r(5290),s=r(9037),o=r(2313),a=r(1),c=r(4483),l=r(2564),u=r(1851).IteratorPrototype,p=r(5247),d=r(6721),h=r(1983),f=a("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",v="normal",y="throw",w=c.set,createIteratorProxyPrototype=function(e){var t=c.getterFor(e?m:g);return o(i(u),{next:function next(){var r=t(this);if(e)return r.nextHandler();if(r.done)return p(void 0,!0);try{var n=r.nextHandler();return r.returnHandlerResult?n:p(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),i=r.iterator;if(r.done=!0,e){var s=l(i,"return");return s?n(s,i):p(void 0,!0)}if(r.inner)try{d(r.inner.iterator,v)}catch(e){return d(i,y,e)}if(r.openIters)try{h(r.openIters,v)}catch(e){return d(i,y,e)}return i&&d(i,v),p(void 0,!0)}})},b=createIteratorProxyPrototype(!0),S=createIteratorProxyPrototype(!1);s(S,f,"Iterator Helper"),e.exports=function(e,t,r){var n=function Iterator(n,i){i?(i.iterator=n.iterator,i.next=n.next):i=n,i.type=t?m:g,i.returnHandlerResult=!!r,i.nextHandler=e,i.counter=0,i.done=!1,w(this,i)};return n.prototype=t?b:S,n}},8685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ForceMethodImplementation=void 0;class ForceMethodImplementation extends Error{constructor(e={},t={}){super(`${e.isStatic?"static ":""}${e.fullName}() should be implemented, please provide '${e.functionName||e.fullName}' functionality.`,t),Object.keys(t).length&&console.error(t),Error.captureStackTrace(this,ForceMethodImplementation)}}t.ForceMethodImplementation=ForceMethodImplementation;t.default=e=>{const t=Error().stack.split("\n")[2].trim(),r=t.startsWith("at new")?"constructor":t.split(" ")[1],n={};if(n.functionName=r,n.fullName=r,n.functionName.includes(".")){const e=n.functionName.split(".");n.className=e[0],n.functionName=e[1]}else n.isStatic=!0;throw new ForceMethodImplementation(n,e)}},8730:(e,t,r)=>{"use strict";var n=r(8473),i=r(1483),s=/#|\.prototype\./,isForced=function(e,t){var r=a[o(e)];return r===l||r!==c&&(i(t)?n(t):!!t)},o=isForced.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=isForced.data={},c=isForced.NATIVE="N",l=isForced.POLYFILL="P";e.exports=isForced},8761:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},8901:(e,t,r)=>{"use strict";var n=r(2293),i=r(6721);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},9031:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGetInitialState=function createGetInitialState(e,t={}){return(r,n)=>{let i=n;if(r.hasOwnProperty("uploadedData")){i=!1;const t=r.uploadedData.manifest.templates,n=elementorAppConfig?.["import-export-customization"]?.exportGroups||{};for(const r in t){if(n[t[r].doc_type]===e){i=!0;break}}}return{enabled:i,...t}}}},9037:(e,t,r)=>{"use strict";var n=r(382),i=r(5835),s=r(7738);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},9273:(e,t,r)=>{"use strict";var n=r(382),i=r(4914),s=TypeError,o=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!o(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},9441:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},9461:(e,t,r)=>{"use strict";var n=r(5578).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},9497:(e,t,r)=>{"use strict";var n=r(1409),i=r(4762),s=r(2278),o=r(4347),a=r(2293),c=i([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=s.f(a(e)),r=o.f;return r?c(t,r(e)):t}},9557:e=>{"use strict";e.exports=!1},9603:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211),r(9655);var i=n(r(5633));class CarouselHandlerBase extends i.default{getDefaultSettings(){return{selectors:{carousel:".swiper",swiperWrapper:".swiper-wrapper",slideContent:".swiper-slide",swiperArrow:".elementor-swiper-button",paginationWrapper:".swiper-pagination",paginationBullet:".swiper-pagination-bullet",paginationBulletWrapper:".swiper-pagination-bullets"}}}getDefaultElements(){const e=this.getSettings("selectors"),t={$swiperContainer:this.$element.find(e.carousel),$swiperWrapper:this.$element.find(e.swiperWrapper),$swiperArrows:this.$element.find(e.swiperArrow),$paginationWrapper:this.$element.find(e.paginationWrapper),$paginationBullets:this.$element.find(e.paginationBullet),$paginationBulletWrapper:this.$element.find(e.paginationBulletWrapper)};return t.$slides=t.$swiperContainer.find(e.slideContent),t}getSwiperSettings(){const e=this.getElementSettings(),t=+e.slides_to_show||3,r=1===t,n=elementorFrontend.config.responsive.activeBreakpoints,i={mobile:1,tablet:r?1:2},s={slidesPerView:t,loop:"yes"===e.infinite,speed:e.speed,handleElementorBreakpoints:!0,breakpoints:{}};let o=t;Object.keys(n).reverse().forEach(t=>{const r=i[t]?i[t]:o;s.breakpoints[n[t].value]={slidesPerView:+e["slides_to_show_"+t]||r,slidesPerGroup:+e["slides_to_scroll_"+t]||1},e.image_spacing_custom&&(s.breakpoints[n[t].value].spaceBetween=this.getSpaceBetween(t)),o=+e["slides_to_show_"+t]||r}),"yes"===e.autoplay&&(s.autoplay={delay:e.autoplay_speed,disableOnInteraction:"yes"===e.pause_on_interaction}),r?(s.effect=e.effect,"fade"===e.effect&&(s.fadeEffect={crossFade:!0})):s.slidesPerGroup=+e.slides_to_scroll||1,e.image_spacing_custom&&(s.spaceBetween=this.getSpaceBetween());const a="arrows"===e.navigation||"both"===e.navigation,c="dots"===e.navigation||"both"===e.navigation||e.pagination;return a&&(s.navigation={prevEl:".elementor-swiper-button-prev",nextEl:".elementor-swiper-button-next"}),c&&(s.pagination={el:`.elementor-element-${this.getID()} .swiper-pagination`,type:e.pagination?e.pagination:"bullets",clickable:!0,renderBullet:(e,t)=>`<span class="${t}" role="button" tabindex="0" data-bullet-index="${e}" aria-label="${elementorFrontend.config.i18n.a11yCarouselPaginationBulletMessage} ${e+1}"></span>`}),"yes"===e.lazyload&&(s.lazy={loadPrevNext:!0,loadPrevNextAmount:1}),s.a11y={enabled:!0,prevSlideMessage:elementorFrontend.config.i18n.a11yCarouselPrevSlideMessage,nextSlideMessage:elementorFrontend.config.i18n.a11yCarouselNextSlideMessage,firstSlideMessage:elementorFrontend.config.i18n.a11yCarouselFirstSlideMessage,lastSlideMessage:elementorFrontend.config.i18n.a11yCarouselLastSlideMessage},s.on={slideChange:()=>{this.a11ySetPaginationTabindex(),this.handleElementHandlers(),this.a11ySetSlideAriaHidden()},init:()=>{this.a11ySetPaginationTabindex(),this.a11ySetSlideAriaHidden("initialisation")}},this.applyOffsetSettings(e,s,t),s}getOffsetWidth(){const e=elementorFrontend.getCurrentDeviceMode();return elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(),"offset_width","size",e)||0}applyOffsetSettings(e,t,r){const n=e.offset_sides;if(!(elementorFrontend.isEditMode()&&"NestedCarousel"===this.constructor.name)&&n&&"none"!==n)switch(n){case"right":this.forceSliderToShowNextSlideWhenOnLast(t,r),this.addClassToSwiperContainer("offset-right");break;case"left":this.addClassToSwiperContainer("offset-left");break;case"both":this.forceSliderToShowNextSlideWhenOnLast(t,r),this.addClassToSwiperContainer("offset-both")}}forceSliderToShowNextSlideWhenOnLast(e,t){e.slidesPerView=t+.001}addClassToSwiperContainer(e){this.getDefaultElements().$swiperContainer[0].classList.add(e)}async onInit(...e){if(super.onInit(...e),!this.elements.$swiperContainer.length||2>this.elements.$slides.length)return;await this.initSwiper();"yes"===this.getElementSettings().pause_on_hover&&this.togglePauseOnHover(!0)}async initSwiper(){const e=elementorFrontend.utils.swiper;this.swiper=await new e(this.elements.$swiperContainer,this.getSwiperSettings()),this.elements.$swiperContainer.data("swiper",this.swiper)}bindEvents(){this.elements.$swiperArrows.on("keydown",this.onDirectionArrowKeydown.bind(this)),this.elements.$paginationWrapper.on("keydown",".swiper-pagination-bullet",this.onDirectionArrowKeydown.bind(this)),this.elements.$swiperContainer.on("keydown",".swiper-slide",this.onDirectionArrowKeydown.bind(this)),this.$element.find(":focusable").on("focus",this.onFocusDisableAutoplay.bind(this)),elementorFrontend.elements.$window.on("resize",this.getSwiperSettings.bind(this))}unbindEvents(){this.elements.$swiperArrows.off(),this.elements.$paginationWrapper.off(),this.elements.$swiperContainer.off(),this.$element.find(":focusable").off(),elementorFrontend.elements.$window.off("resize")}onDirectionArrowKeydown(e){const t=elementorFrontend.config.is_rtl,r=e.originalEvent.code,n=t?"ArrowLeft":"ArrowRight";if(!(-1!==["ArrowLeft","ArrowRight"].indexOf(r)))return!0;(t?"ArrowRight":"ArrowLeft")===r?this.swiper.slidePrev():n===r&&this.swiper.slideNext()}onFocusDisableAutoplay(){this.swiper.autoplay.stop()}updateSwiperOption(e){const t=this.getElementSettings()[e],r=this.swiper.params;switch(e){case"autoplay_speed":r.autoplay.delay=t;break;case"speed":r.speed=t}this.swiper.update()}getChangeableProperties(){return{pause_on_hover:"pauseOnHover",autoplay_speed:"delay",speed:"speed",arrows_position:"arrows_position"}}onElementChange(e){if(0===e.indexOf("image_spacing_custom"))return void this.updateSpaceBetween(e);if(this.getChangeableProperties()[e])if("pause_on_hover"===e){const e=this.getElementSettings("pause_on_hover");this.togglePauseOnHover("yes"===e)}else this.updateSwiperOption(e)}onEditSettingsChange(e){"activeItemIndex"===e&&this.swiper.slideToLoop(this.getEditSettings("activeItemIndex")-1)}getSpaceBetween(e=null){const t=elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(),"image_spacing_custom","size",e);return Number(t)||0}updateSpaceBetween(e){const t=e.match("image_spacing_custom_(.*)"),r=t?t[1]:"desktop",n=this.getSpaceBetween(r);"desktop"!==r&&(this.swiper.params.breakpoints[elementorFrontend.config.responsive.activeBreakpoints[r].value].spaceBetween=n),this.swiper.params.spaceBetween=n,this.swiper.update()}getPaginationBullets(e="array"){const t=this.$element.find(this.getSettings("selectors").paginationBullet);return"array"===e?Array.from(t):t}a11ySetPaginationTabindex(){const e=this.swiper?.params?.pagination.bulletClass,t=this.swiper?.params?.pagination.bulletActiveClass;this.getPaginationBullets().forEach(e=>{e.classList?.contains(t)||e.removeAttribute("tabindex")});const r="ArrowLeft"===event?.code||"ArrowRight"===event?.code;event?.target?.classList?.contains(e)&&r&&this.$element.find(`.${t}`).trigger("focus")}getSwiperWrapperTranformXValue(){let e=this.elements.$swiperWrapper[0]?.style.transform;return e=e.replace("translate3d(",""),e=e.split(","),e=parseInt(e[0].replace("px","")),e||0}a11ySetSlideAriaHidden(e=""){if("number"!=typeof("initialisation"===e?0:this.swiper?.activeIndex))return;const t=this.getSwiperWrapperTranformXValue(),r=this.elements.$swiperWrapper[0].clientWidth;this.elements.$swiperContainer.find(this.getSettings("selectors").slideContent).each((e,n)=>{0<=n.offsetLeft+t&&r>n.offsetLeft+t?(n.removeAttribute("aria-hidden"),n.removeAttribute("inert")):(n.setAttribute("aria-hidden",!0),n.setAttribute("inert",""))})}handleElementHandlers(){}}t.default=CarouselHandlerBase},9655:(e,t,r)=>{"use strict";r(9930)},9930:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(1506),o=r(8120),a=r(2293),c=r(41),l=r(6721),u=r(5267)("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function forEach(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}if(u)return i(u,this,e);var t=c(this),r=0;s(t,function(t){e(t,r++)},{IS_RECORD:!0})}})}},e=>{var t;t=4946,e(e.s=t)}]);