var mailchimp,mailchimp_cart,mailchimp_billing_email,mailchimp_username_email,mailchimp_registration_email,mailchimp_submitted_email=false,mailchimpReady=function(a){/in/.test(document.readyState)?setTimeout(()=>{mailchimpReady(a)},9):a()};function mailchimpGetCurrentUserByHash(a){try{if(!mailchimp_public_data.allowed_to_set_cookies)return;var b=mailchimp_public_data.ajax_url+"?action=mailchimp_get_user_by_hash&hash="+a,c=new XMLHttpRequest;c.open("POST",b,!0),c.onload=function(){if(c.status>=200&&c.status<400){var a=JSON.parse(c.responseText);if(!a)return;mailchimp_cart.valueEmail(a.email)&&mailchimp_cart.setEmail(a.email)}};c.onerror=function(){console.log("mailchimp.get_email_by_hash.request.error",c.responseText)};c.setRequestHeader("Content-Type","application/json");c.setRequestHeader("Accept","application/json");c.send()}catch(a){console.log("mailchimp.get_email_by_hash.error",a)}}function mailchimpHandleBillingEmail(selector){try{if(!mailchimp_public_data.allowed_to_set_cookies)return;if(mailchimp_public_data.disable_carts)return;var subscribed=document.querySelector("#mailchimp_woocommerce_newsletter");if(!subscribed)subscribed=document.querySelector("#subscribe-to-newsletter");if(!selector)selector="#billing_email";var a=document.querySelector(selector);var b=void 0!==a?a.value:"";if(!mailchimp_cart.valueEmail(b)||mailchimp_submitted_email===b){return false}mailchimp_cart.setEmail(b);var c=mailchimp_public_data.ajax_url+"?action=mailchimp_set_user_by_email";var d=new XMLHttpRequest;d.open("POST",c,!0);d.onload=function(){var successful=d.status>=200&&d.status<400;var msg=successful?"mailchimp.handle_billing_email.request.success":"mailchimp.handle_billing_email.request.error";if(successful){mailchimp_submitted_email=b}console.log(msg,d.responseText)};d.onerror=function(){console.log("mailchimp.handle_billing_email.request.error",d.responseText)};d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.setRequestHeader("Accept","application/json");d.send("email="+b+"&mc_language="+mailchimp_public_data.language+"&subscribed="+(subscribed&&subscribed.checked?"1":"0"));return true}catch(a){console.log("mailchimp.handle_billing_email.error",a);mailchimp_submitted_email=!1}}!function(){"use strict";function mailchimpCart(){this.email_types="input[type=email]";this.regex_email=/^([A-Za-z0-9_+\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;this.current_email=null;this.previous_email=null;this.expireUser=function(){this.current_email=null;if(!mailchimp_public_data.allowed_to_set_cookies)return;mailchimp.storage.expire("mailchimp.cart.current_email")};this.expireSaved=function(){if(!mailchimp_public_data.allowed_to_set_cookies)return;mailchimp.storage.expire("mailchimp.cart.items")};this.setEmail=function(a){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(!this.valueEmail(a))return false;this.setPreviousEmail(this.getEmail());mailchimp.storage.set("mailchimp.cart.current_email",this.current_email=a)};this.getEmail=function(){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(this.current_email)return this.current_email;var a=mailchimp.storage.get("mailchimp.cart.current_email",!1);if(!a||!this.valueEmail(a))return false;return this.current_email=a};this.setPreviousEmail=function(a){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(!this.valueEmail(a))return false;mailchimp.storage.set("mailchimp.cart.previous_email",this.previous_email=a)};this.valueEmail=function(a){return this.regex_email.test(a)};return this}var g={extend:function(a,b){for(var c in b||{})b.hasOwnProperty(c)&&(a[c]=b[c]);return a},getQueryStringVars:function(){var a=window.location.search||"",b=[],c={};if(a=a.substr(1),a.length){b=a.split("&");for(var d in b){var e=b[d];if("string"==typeof e){var f=e.split("="),g=f[0],h=f[1];g.length&&("undefined"==typeof c[g]&&(c[g]=[]),c[g].push(h))}}}return c},unEscape:function(a){return decodeURIComponent(a)},escape:function(a){return encodeURIComponent(a)},createDate:function(a,b){a||(a=0);var c=new Date,d=b?c.getDate()-a:c.getDate()+a;return c.setDate(d),c},arrayUnique:function(a){for(var b=a.concat(),c=0;c<b.length;++c)for(var d=c+1;d<b.length;++d)b[c]===b[d]&&b.splice(d,1);return b},objectCombineUnique:function(a){for(var b=a[0],c=1;c<a.length;c++){var d=a[c];for(var e in d)b[e]=d[e]}return b}},h=function(a,b){var c=function(a,b,d){return 1===arguments.length?c.get(a):c.set(a,b,d)};return c.get=function(b,d){return a.cookie!==c._cacheString&&c._populateCache(),void 0==c._cache[b]?d:c._cache[b]},c.defaults={path:"/",secure:true,samesite:"strict"},c.set=function(d,e,f){switch(f={path:f&&f.path||c.defaults.path,domain:f&&f.domain||c.defaults.domain,expires:f&&f.expires||c.defaults.expires,secure:f&&f.secure!==b?f.secure:c.defaults.secure,samesite:f&&f.samesite||c.defaults.samesite},e===b&&(f.expires=-1),typeof f.expires){case"number":f.expires=new Date((new Date).getTime()+1e3*f.expires);break;case"string":f.expires=new Date(f.expires)}return d=encodeURIComponent(d)+"="+(e+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent),d+=f.path?";path="+f.path:"",d+=f.domain?";domain="+f.domain:"",d+=f.expires?";expires="+f.expires.toGMTString():"",d+=f.secure?";secure":"",d+=f.samesite?";samesite="+f.samesite:"",a.cookie=d,c},c.expire=function(a,d){return c.set(a,b,d)},c._populateCache=function(){c._cache={};try{c._cacheString=a.cookie;for(var d=c._cacheString.split("; "),e=0;e<d.length;e++){var f=d[e].indexOf("="),g=decodeURIComponent(d[e].substr(0,f)),f=decodeURIComponent(d[e].substr(f+1));c._cache[g]===b&&(c._cache[g]=f)}}catch(a){console.log(a)}},c.enabled=function(){var a="1"===c.set("cookies.js","1").get("cookies.js");return c.expire("cookies.js"),a}(),c}(document);mailchimp={storage:h,utils:g};mailchimp_cart=new mailchimpCart}();mailchimpReady(function(){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(mailchimp_public_data.disable_carts)return;if(void 0===a){var a={site_url:document.location.origin,defaulted:!0,ajax_url:document.location.origin+"/wp-admin?admin-ajax.php"}}try{var b=mailchimp.utils.getQueryStringVars();void 0!==b.mc_cart_id&&mailchimpGetCurrentUserByHash(b.mc_cart_id);var subscribed=document.querySelector("#mailchimp_woocommerce_newsletter");var blockSubscribed=document.querySelector("#subscribe-to-newsletter");if(subscribed){subscribed.onchange=function(){mailchimp_submitted_email=null;mailchimpHandleBillingEmail("#billing_email")}}else if(blockSubscribed){blockSubscribed.onchange=function(){mailchimp_submitted_email=null;mailchimpHandleBillingEmail('#contact-fields input[type="email"]')}}mailchimp_username_email=document.querySelector("#username");mailchimp_billing_email=document.querySelector("#billing_email");mailchimp_registration_email=document.querySelector("#reg_email");var mailchimp_username_email_block=document.querySelector('#contact-fields input[type="email"]');if(mailchimp_billing_email){mailchimp_billing_email.onblur=function(){mailchimpHandleBillingEmail("#billing_email")};mailchimp_billing_email.onfocus=function(){mailchimpHandleBillingEmail("#billing_email")}}if(mailchimp_username_email){mailchimp_username_email.onblur=function(){mailchimpHandleBillingEmail("#username")};mailchimp_username_email.onfocus=function(){mailchimpHandleBillingEmail("#username")}}if(mailchimp_registration_email){mailchimp_registration_email.onblur=function(){mailchimpHandleBillingEmail("#reg_email")};mailchimp_registration_email.onfocus=function(){mailchimpHandleBillingEmail("#reg_email")}}if(mailchimp_username_email_block){mailchimp_username_email_block.onblur=function(){mailchimpHandleBillingEmail('#contact-fields input[type="email"]')};mailchimp_username_email_block.onfocus=function(){mailchimpHandleBillingEmail('#contact-fields input[type="email"]')};var typingTimer;mailchimp_username_email_block.addEventListener("keyup",function(){typingTimer&&clearTimeout(typingTimer);typingTimer=setTimeout(function(){if(mailchimp_cart.valueEmail(mailchimp_username_email_block.value)){mailchimpHandleBillingEmail('#contact-fields input[type="email"]')}},2e3)});mailchimp_username_email_block.addEventListener("keydown",function(){typingTimer&&clearTimeout(typingTimer)})}}catch(e){console.log("mailchimp ready error",e)}});
(function ($){
'use strict';
const PIXEL_SDK_WAIT_CONFIG={
initialDelayMs: 100,
maxDelayMs: 5000,
maxAttempts: 20
};
const MailchimpPixelTracking={
_atcTimer: null,
_rfcTimer: null,
_atcFetching: false,
_rfcFetching: false,
init: function (){
const self=this;
this.waitForPixelSDK(PIXEL_SDK_WAIT_CONFIG)
.then(function (){
self.sendPageEvents();
self.attachCartEventListeners();
self.interceptStoreApiRequests();
console.log('Mailchimp Pixel SDK loaded.');
})
.catch(function (e){
console.log('Mailchimp Pixel SDK not loaded within timeout. Tracking disabled.', e);
});
},
waitForPixelSDK: function (options){
const config=options||{};
const initialDelayMs=config.initialDelayMs!==undefined ? config.initialDelayMs:PIXEL_SDK_WAIT_CONFIG.initialDelayMs;
const maxDelayMs=config.maxDelayMs!==undefined ? config.maxDelayMs:PIXEL_SDK_WAIT_CONFIG.maxDelayMs;
const maxAttempts=config.maxAttempts!==undefined ? config.maxAttempts:PIXEL_SDK_WAIT_CONFIG.maxAttempts;
function isSDKReady(){
return typeof window.$mcSite!=='undefined' &&
window.$mcSite.pixel &&
typeof window.$mcSite.pixel.api!=='undefined' &&
typeof window.$mcSite.pixel.api.track==='function' &&
window.$mcSite.pixel.installed===true;
}
return new Promise(function (resolve, reject){
let attempt=0;
function scheduleCheck(){
if(isSDKReady()){
console.warn('Pixel SDK - remediation for pixel ready issue')
setTimeout(function (){
resolve();
}, 1000);
return;
}
if(attempt >=maxAttempts){
reject(new Error('Pixel SDK not available'));
return;
}
const delay=Math.min(initialDelayMs * Math.pow(2, attempt),
maxDelayMs
);
attempt +=1;
setTimeout(scheduleCheck, delay);
}
scheduleCheck();
});
},
isPixelSDKReady: function (){
return typeof window.$mcSite!=='undefined' &&
window.$mcSite.pixel &&
typeof window.$mcSite.pixel.api!=='undefined' &&
typeof window.$mcSite.pixel.api.track==='function';
},
getCartId: function (){
return window.mcPixel&&window.mcPixel.cartId ? window.mcPixel.cartId:'';
},
getRestBase: function (){
return (window.mcPixelConfig&&window.mcPixelConfig.restBase)||'/wp-json/mailchimp-for-woocommerce/v1/';
},
sendPageEvents: function (){
if(!window.mcPixel||!window.mcPixel.data){
return;
}
const data=window.mcPixel.data;
const events=data.events||[];
events.forEach((eventType)=> {
switch (eventType){
case 'PRODUCT_ADDED_TO_CART':
if(data.added_to_cart){
var atcItems=Array.isArray(data.added_to_cart) ? data.added_to_cart:[data.added_to_cart];
for (var ai=0; ai < atcItems.length; ai++){
this.sendProductAddedToCart(atcItems[ai]);
}}
break;
case 'PRODUCT_REMOVED_FROM_CART':
if(data.removed_from_cart){
var rfcItems=Array.isArray(data.removed_from_cart) ? data.removed_from_cart:[data.removed_from_cart];
for (var ri=0; ri < rfcItems.length; ri++){
this.sendProductRemovedFromCart(rfcItems[ri]);
}}
break;
case 'IDENTITY':
if(data.identity&&data.identity.email){
this.sendIdentityEvent(data.identity.email);
}
break;
case 'PRODUCT_VIEWED':
if(data.product){
const viewedId=String(data.product.productId||data.product.id);
const atcArr=Array.isArray(data.added_to_cart) ? data.added_to_cart:(data.added_to_cart ? [data.added_to_cart]:[]);
const rfcArr=Array.isArray(data.removed_from_cart) ? data.removed_from_cart:(data.removed_from_cart ? [data.removed_from_cart]:[]);
const atcMatch=atcArr.some(function (p){ return String(p.productId||p.id)===viewedId; });
const rfcMatch=rfcArr.some(function (p){ return String(p.productId||p.id)===viewedId; });
if((events.includes('PRODUCT_ADDED_TO_CART')&&atcMatch) ||
(events.includes('PRODUCT_REMOVED_FROM_CART')&&rfcMatch)
){
break;
}
this.sendProductViewed(data.product);
}
break;
case 'CART_VIEWED':
if(data.cart){
this.sendCartViewed(data.cart);
}
break;
case 'CHECKOUT_STARTED':
if(data.checkout){
this.sendCheckoutStarted(data.checkout);
window.mcPixel._handled.checkout=true;
}
break;
case 'PURCHASED':
if(data.order){
this.sendPurchased(data.order);
}
break;
case 'PRODUCT_CATEGORY_VIEWED':
if(data.category){
this.sendCategoryViewed(data.category);
window.mcPixel._handled.category=true;
}
break;
case 'SEARCH_SUBMITTED':
if(data.search){
this.sendSearchSubmitted(data.search);
window.mcPixel._handled.search=true;
}
break;
}});
},
sendProductViewed: function (product){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.track('PRODUCT_VIEWED', {
product: product
}).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking PRODUCT_VIEWED', error);
});
},
sendProductAddedToCart: function (product){
if(!this.isPixelSDKReady()) return;
const cartId=this.getCartId();
const eventData={
cartId: cartId,
product: {
item: {
id: product.id,
productId: product.productId,
title: product.title,
price: product.price,
currency: product.currency,
sku: product.sku||''
},
quantity: product.quantity||1,
price: product.price * (product.quantity||1),
currency: product.currency
}};
window.$mcSite.pixel.api.track('PRODUCT_ADDED_TO_CART', eventData).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking PRODUCT_ADDED_TO_CART', error);
});
},
sendProductRemovedFromCart: function (product){
if(!this.isPixelSDKReady()) return;
const cartId=this.getCartId();
const eventData={
cartId: cartId,
product: {
item: {
id: product.id,
productId: product.productId,
title: product.title,
price: product.price,
currency: product.currency,
sku: product.sku||''
},
quantity: product.quantity||1,
price: product.price * (product.quantity||1),
currency: product.currency
}};
window.$mcSite.pixel.api.track('PRODUCT_REMOVED_FROM_CART', eventData).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking PRODUCT_REMOVED_FROM_CART', error);
});
},
sendCartViewed: function (cart){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.track('CART_VIEWED', {
cart: cart
}).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking CART_VIEWED', error);
});
},
sendCheckoutStarted: function (checkout){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.track('CHECKOUT_STARTED', {
checkout: checkout
}).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking CHECKOUT_STARTED', error);
});
},
sendIdentityEvent: function(email){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.identify({
type: 'EMAIL',
value: email
});
},
sendPurchased: function (order){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.track('PURCHASED', {
order: order
}).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking PURCHASED', error);
});
},
sendCategoryViewed: function (category){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.track('PRODUCT_CATEGORY_VIEWED', category).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking PRODUCT_CATEGORY_VIEWED', error);
});
},
sendSearchSubmitted: function (search){
if(!this.isPixelSDKReady()) return;
window.$mcSite.pixel.api.track('SEARCH_SUBMITTED', search).catch((error)=> {
console.error('Mailchimp Pixel: Error tracking SEARCH_SUBMITTED', error);
});
},
findProductById: function (productId){
if(!window.mcPixel||!window.mcPixel.data||!window.mcPixel.data.products){
return null;
}
const products=window.mcPixel.data.products;
const id=String(productId);
for (let i=0; i < products.length; i++){
if(String(products[i].id)===id){
return products[i];
}}
return null;
},
fetchAndTrackAddToCart: function (){
var self=this;
if(!this.isPixelSDKReady()) return;
clearTimeout(this._atcTimer);
this._atcTimer=setTimeout(function (){
self._drainAddToCartQueue();
}, 600);
},
_drainAddToCartQueue: async function (){
if(this._atcFetching) return;
this._atcFetching=true;
try {
var res=await fetch(this.getRestBase() + 'pixel/atc', {
method: 'GET',
credentials: 'same-origin',
headers: { 'Accept': 'application/json' },
});
if(!res.ok) return;
var data=await res.json();
if(!data) return;
var items=Array.isArray(data) ? data:[data];
for (var i=0; i < items.length; i++){
this.sendProductAddedToCart(items[i]);
}} catch (e){
} finally {
this._atcFetching=false;
}},
fetchAndTrackRemoveFromCart: function (){
var self=this;
if(!this.isPixelSDKReady()) return;
clearTimeout(this._rfcTimer);
this._rfcTimer=setTimeout(function (){
self._drainRemoveFromCartQueue();
}, 600);
},
_drainRemoveFromCartQueue: async function (){
if(this._rfcFetching) return;
this._rfcFetching=true;
try {
var res=await fetch(this.getRestBase() + 'pixel/rfc', {
method: 'GET',
credentials: 'same-origin',
headers: { 'Accept': 'application/json' },
});
if(!res.ok) return;
var data=await res.json();
if(!data) return;
var items=Array.isArray(data) ? data:[data];
for (var i=0; i < items.length; i++){
this.sendProductRemovedFromCart(items[i]);
}} catch (e){
} finally {
this._rfcFetching=false;
}},
attachCartEventListeners: function (){
const self=this;
$(document.body).on('added_to_cart', function (){
self.fetchAndTrackAddToCart();
});
$(document.body).on('removed_from_cart', function (){
self.fetchAndTrackRemoveFromCart();
});
document.body.addEventListener('wc-blocks_added_to_cart', function (){
self.fetchAndTrackAddToCart();
});
document.body.addEventListener('wc-blocks_removed_from_cart', function (){
self.fetchAndTrackRemoveFromCart();
});
},
interceptStoreApiRequests: function (){
const self=this;
const originalFetch=window.fetch;
window.fetch=function (input, init){
var promise=originalFetch.apply(this, arguments);
promise.then(function (response){
try {
if(!response.ok) return;
var method=(init&&init.method) ? init.method.toUpperCase() :
(input instanceof Request ? input.method.toUpperCase():'GET');
if(method!=='POST') return;
var url=typeof input==='string' ? input :
(input instanceof Request ? input.url:String(input));
if(/wc\/store\/v1\/cart\/add-item/.test(url)||/wc\/store\/v1\/cart\/update-item/.test(url)){
self.fetchAndTrackAddToCart();
}else if(/wc\/store\/v1\/cart\/remove-item/.test(url)){
self.fetchAndTrackRemoveFromCart();
}} catch (e){
}}).catch(function (){
});
return promise;
};},
};
$(document).ready(function (){
MailchimpPixelTracking.init();
});
})(jQuery);
!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)}();
(()=>{"use strict";const e=window.wp.hooks,t="mailchimp-woocommerce";let i=!1;function c(){return void 0!==window.$mcSite&&window.$mcSite.pixel&&void 0!==window.$mcSite.pixel.api&&"function"==typeof window.$mcSite.pixel.api.track}function r(){return window.mcPixel&&window.mcPixel.cartId?window.mcPixel.cartId:""}function n(e,t){i&&c()&&window.$mcSite.pixel.api.track(e,t).catch(function(t){console.error("Mailchimp Pixel Blocks: Error tracking "+e,t)})}function o(e){const t=e.prices||{},i=t.currency_minor_unit||2,c=Math.pow(10,i),r=t.price?parseInt(t.price,10)/c:0;return{id:String(e.id),productId:String(e.id),title:e.name||"",price:r,currency:(t.currency_code||"").toUpperCase(),sku:e.sku||"",imageUrl:e.images&&e.images.length>0?e.images[0].src:"",productUrl:e.permalink||"",vendor:"",categories:[]}}function d(e){const t=e.prices||{},i=t.currency_minor_unit||2,c=Math.pow(10,i),r=t.line_total?parseInt(t.line_total,10)/c:0;return{item:o(e),quantity:e.quantity||1,price:r,currency:(t.currency_code||"").toUpperCase()}}(0,e.addAction)("experimental__woocommerce_blocks-cart-add-item",t,function(e){if(!i)return;if(window.mcPixel&&window.mcPixel._handled.addToCart)return;const t=e.product;if(!t)return;const c=function(e){const t=e.prices||{},i=t.currency_minor_unit||2,c=Math.pow(10,i),r=t.price?parseInt(t.price,10)/c:0;return{id:String(e.id),productId:String(e.id),title:e.name||"",price:r,currency:(t.currency_code||"").toUpperCase(),sku:e.sku||"",imageUrl:e.images&&e.images.length>0?e.images[0].src:"",productUrl:e.permalink||"",vendor:"",categories:(e.categories||[]).map(function(e){return e.name||""})}}(t),o=e.quantity||1;n("PRODUCT_ADDED_TO_CART",{cartId:r(),product:{item:{id:c.id,productId:c.productId,title:c.title,price:c.price,currency:c.currency,sku:c.sku},quantity:o,price:c.price*o,currency:c.currency}}),window.mcPixel&&(window.mcPixel._handled.addToCart=!0,setTimeout(function(){window.mcPixel._handled.addToCart=!1},1e3))}),(0,e.addAction)("experimental__woocommerce_blocks-cart-remove-item",t,function(e){if(!i)return;if(window.mcPixel&&window.mcPixel._handled.removeFromCart)return;const t=e.product;if(!t)return;const c=o(t),d=e.quantity||1;n("PRODUCT_REMOVED_FROM_CART",{cartId:r(),product:{item:{id:c.id,productId:c.productId,title:c.title,price:c.price,currency:c.currency,sku:c.sku},quantity:d,price:c.price*d,currency:c.currency}}),window.mcPixel&&(window.mcPixel._handled.removeFromCart=!0,setTimeout(function(){window.mcPixel._handled.removeFromCart=!1},1e3))}),(0,e.addAction)("experimental__woocommerce_blocks-checkout-render-checkout-form",t,function(e){if(!i)return;if(window.mcPixel&&window.mcPixel._handled.checkout)return;const t=e.storeCart;t&&t.cartItems&&0!==t.cartItems.length&&(n("CHECKOUT_STARTED",{checkout:function(e){const t=e.cartTotals||{},i=t.currency_minor_unit||2,c=Math.pow(10,i),n=(e.cartItems||[]).map(d),o=r();return{id:"checkout_"+o,cartId:o,lineItems:n,subtotalPrice:t.total_items?parseInt(t.total_items,10)/c:0,totalTax:t.total_tax?parseInt(t.total_tax,10)/c:0,totalShipping:t.total_shipping?parseInt(t.total_shipping,10)/c:0,totalPrice:t.total_price?parseInt(t.total_price,10)/c:0,currency:(t.currency_code||"").toUpperCase()}}(t)}),window.mcPixel&&(window.mcPixel._handled.checkout=!0))}),(0,e.addAction)("experimental__woocommerce_blocks-product-list-render",t,function(){i&&(window.mcPixel&&window.mcPixel._handled.category||window.mcPixel&&window.mcPixel.data&&window.mcPixel.data.category&&(n("PRODUCT_CATEGORY_VIEWED",window.mcPixel.data.category),window.mcPixel&&(window.mcPixel._handled.category=!0)))}),(0,e.addAction)("experimental__woocommerce_blocks-product-search",t,function(e){if(!i)return;if(window.mcPixel&&window.mcPixel._handled.search)return;const t=e.searchTerm||"";t&&(n("SEARCH_SUBMITTED",{query:t}),window.mcPixel&&(window.mcPixel._handled.search=!0))}),function(){let e=0;!function t(){if(c())return void setTimeout(function(){i=!0},1e3);if(e>=20)return;const r=Math.min(100*Math.pow(2,e),5e3);e+=1,setTimeout(t,r)}()}()})();
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
(function($){
$.fn.niceSelect=function(method){
if(typeof method=='string'){
if(method=='update'){
this.each(function(){
var $select=$(this);
var $dropdown=$(this).next('.nice-select');
var open=$dropdown.hasClass('open');
if($dropdown.length){
$dropdown.remove();
create_nice_select($select);
if(open){
$select.next().trigger('click');
}}
});
}else if(method=='destroy'){
this.each(function(){
var $select=$(this);
var $dropdown=$(this).next('.nice-select');
if($dropdown.length){
$dropdown.remove();
$select.css('display', '');
}});
if($('.nice-select').length==0){
$(document).off('.nice_select');
}}else{
console.log('Method "' + method + '" does not exist.')
}
return this;
}
this.hide();
this.each(function(){
var $select=$(this);
if(!$select.next().hasClass('nice-select')){
create_nice_select($select);
}});
function create_nice_select($select){
$select.after($('<div></div>')
.addClass('nice-select')
.addClass($select.attr('class')||'')
.addClass($select.attr('disabled') ? 'disabled':'')
.attr('tabindex', $select.attr('disabled') ? null:'0')
.html('<span class="current"></span><ul class="list"></ul>')
);
var $dropdown=$select.next();
var $options=$select.find('option');
var $selected=$select.find('option:selected');
$dropdown.find('.current').html($selected.data('display')|| $selected.text());
$options.each(function(i){
var $option=$(this);
var display=$option.data('display');
$dropdown.find('ul').append($('<li></li>')
.attr('data-value', $option.val())
.attr('data-display', (display||null))
.addClass('option' +
($option.is(':selected') ? ' selected':'') +
($option.is(':disabled') ? ' disabled':''))
.html($option.text())
);
});
}
$(document).off('.nice_select');
$(document).on('click.nice_select', '.nice-select', function(event){
var $dropdown=$(this);
$('.nice-select').not($dropdown).removeClass('open');
$dropdown.toggleClass('open');
if($dropdown.hasClass('open')){
$dropdown.find('.option');
$dropdown.find('.focus').removeClass('focus');
$dropdown.find('.selected').addClass('focus');
}else{
$dropdown.focus();
}});
$(document).on('click.nice_select', function(event){
if($(event.target).closest('.nice-select').length===0){
$('.nice-select').removeClass('open').find('.option');
}});
$(document).on('click.nice_select', '.nice-select .option:not(.disabled)', function(event){
var $option=$(this);
var $dropdown=$option.closest('.nice-select');
$dropdown.find('.selected').removeClass('selected');
$option.addClass('selected');
var text=$option.data('display')||$option.text();
$dropdown.find('.current').text(text);
$dropdown.prev('select').val($option.data('value')).trigger('change');
});
$(document).on('keydown.nice_select', '.nice-select', function(event){
var $dropdown=$(this);
var $focused_option=$($dropdown.find('.focus')||$dropdown.find('.list .option.selected'));
if(event.keyCode==32||event.keyCode==13){
if($dropdown.hasClass('open')){
$focused_option.trigger('click');
}else{
$dropdown.trigger('click');
}
return false;
}else if(event.keyCode==40){
if(!$dropdown.hasClass('open')){
$dropdown.trigger('click');
}else{
var $next=$focused_option.nextAll('.option:not(.disabled)').first();
if($next.length > 0){
$dropdown.find('.focus').removeClass('focus');
$next.addClass('focus');
}}
return false;
}else if(event.keyCode==38){
if(!$dropdown.hasClass('open')){
$dropdown.trigger('click');
}else{
var $prev=$focused_option.prevAll('.option:not(.disabled)').first();
if($prev.length > 0){
$dropdown.find('.focus').removeClass('focus');
$prev.addClass('focus');
}}
return false;
}else if(event.keyCode==27){
if($dropdown.hasClass('open')){
$dropdown.trigger('click');
}}else if(event.keyCode==9){
if($dropdown.hasClass('open')){
return false;
}}
});
var style=document.createElement('a').style;
style.cssText='pointer-events:auto';
if(style.pointerEvents!=='auto'){
$('html').addClass('no-csspointerevents');
}
return this;
};}(jQuery));
!function(a,b){if("function"==typeof define&&define.amd)define(["module","exports"],b);else if("undefined"!=typeof exports)b(module,exports);else{var c={exports:{}};b(c,c.exports),a.WOW=c.exports}}(this,function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){return b.indexOf(a)>=0}function e(a,b){for(var c in b)if(null==a[c]){var d=b[c];a[c]=d}return a}function f(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)}function g(a){var b=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],c=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],d=arguments.length<=3||void 0===arguments[3]?null:arguments[3],e=void 0;return null!=document.createEvent?(e=document.createEvent("CustomEvent"),e.initCustomEvent(a,b,c,d)):null!=document.createEventObject?(e=document.createEventObject(),e.eventType=a):e.eventName=a,e}function h(a,b){null!=a.dispatchEvent?a.dispatchEvent(b):b in(null!=a)?a[b]():"on"+b in(null!=a)&&a["on"+b]()}function i(a,b,c){null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c}function j(a,b,c){null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]}function k(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight}Object.defineProperty(b,"__esModule",{value:!0});var l,m,n=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),o=window.WeakMap||window.MozWeakMap||function(){function a(){c(this,a),this.keys=[],this.values=[]}return n(a,[{key:"get",value:function(a){for(var b=0;b<this.keys.length;b++){var c=this.keys[b];if(c===a)return this.values[b]}}},{key:"set",value:function(a,b){for(var c=0;c<this.keys.length;c++){var d=this.keys[c];if(d===a)return this.values[c]=b,this}return this.keys.push(a),this.values.push(b),this}}]),a}(),p=window.MutationObserver||window.WebkitMutationObserver||window.MozMutationObserver||(m=l=function(){function a(){c(this,a),"undefined"!=typeof console&&null!==console&&(console.warn("MutationObserver is not supported by your browser."),console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content."))}return n(a,[{key:"observe",value:function(){}}]),a}(),l.notSupported=!0,m),q=window.getComputedStyle||function(a){var b=/(\-([a-z]){1})/g;return{getPropertyValue:function(c){"float"===c&&(c="styleFloat"),b.test(c)&&c.replace(b,function(a,b){return b.toUpperCase()});var d=a.currentStyle;return(null!=d?d[c]:void 0)||null}}},r=function(){function a(){var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c(this,a),this.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null,scrollContainer:null,resetAnimation:!0},this.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),this.vendors=["moz","webkit"],this.start=this.start.bind(this),this.resetAnimation=this.resetAnimation.bind(this),this.scrollHandler=this.scrollHandler.bind(this),this.scrollCallback=this.scrollCallback.bind(this),this.scrolled=!0,this.config=e(b,this.defaults),null!=b.scrollContainer&&(this.config.scrollContainer=document.querySelector(b.scrollContainer)),this.animationNameCache=new o,this.wowEvent=g(this.config.boxClass)}return n(a,[{key:"init",value:function(){this.element=window.document.documentElement,d(document.readyState,["interactive","complete"])?this.start():i(document,"DOMContentLoaded",this.start),this.finished=[]}},{key:"start",value:function(){var a=this;if(this.stopped=!1,this.boxes=[].slice.call(this.element.querySelectorAll("."+this.config.boxClass)),this.all=this.boxes.slice(0),this.boxes.length)if(this.disabled())this.resetStyle();else for(var b=0;b<this.boxes.length;b++){var c=this.boxes[b];this.applyStyle(c,!0)}if(this.disabled()||(i(this.config.scrollContainer||window,"scroll",this.scrollHandler),i(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live){var d=new p(function(b){for(var c=0;c<b.length;c++)for(var d=b[c],e=0;e<d.addedNodes.length;e++){var f=d.addedNodes[e];a.doSync(f)}});d.observe(document.body,{childList:!0,subtree:!0})}}},{key:"stop",value:function(){this.stopped=!0,j(this.config.scrollContainer||window,"scroll",this.scrollHandler),j(window,"resize",this.scrollHandler),null!=this.interval&&clearInterval(this.interval)}},{key:"sync",value:function(){p.notSupported&&this.doSync(this.element)}},{key:"doSync",value:function(a){if("undefined"!=typeof a&&null!==a||(a=this.element),1===a.nodeType){a=a.parentNode||a;for(var b=a.querySelectorAll("."+this.config.boxClass),c=0;c<b.length;c++){var e=b[c];d(e,this.all)||(this.boxes.push(e),this.all.push(e),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(e,!0),this.scrolled=!0)}}}},{key:"show",value:function(a){return this.applyStyle(a),a.className=a.className+" "+this.config.animateClass,null!=this.config.callback&&this.config.callback(a),h(a,this.wowEvent),this.config.resetAnimation&&(i(a,"animationend",this.resetAnimation),i(a,"oanimationend",this.resetAnimation),i(a,"webkitAnimationEnd",this.resetAnimation),i(a,"MSAnimationEnd",this.resetAnimation)),a}},{key:"applyStyle",value:function(a,b){var c=this,d=a.getAttribute("data-wow-duration"),e=a.getAttribute("data-wow-delay"),f=a.getAttribute("data-wow-iteration");return this.animate(function(){return c.customStyle(a,b,d,e,f)})}},{key:"resetStyle",value:function(){for(var a=0;a<this.boxes.length;a++){var b=this.boxes[a];b.style.visibility="visible"}}},{key:"resetAnimation",value:function(a){if(a.type.toLowerCase().indexOf("animationend")>=0){var b=a.target||a.srcElement;b.className=b.className.replace(this.config.animateClass,"").trim()}}},{key:"customStyle",value:function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a}},{key:"vendorSet",value:function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];a[""+c]=d;for(var e=0;e<this.vendors.length;e++){var f=this.vendors[e];a[""+f+c.charAt(0).toUpperCase()+c.substr(1)]=d}}}},{key:"vendorCSS",value:function(a,b){for(var c=q(a),d=c.getPropertyCSSValue(b),e=0;e<this.vendors.length;e++){var f=this.vendors[e];d=d||c.getPropertyCSSValue("-"+f+"-"+b)}return d}},{key:"animationName",value:function(a){var b=void 0;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=q(a).getPropertyValue("animation-name")}return"none"===b?"":b}},{key:"cacheAnimationName",value:function(a){return this.animationNameCache.set(a,this.animationName(a))}},{key:"cachedAnimationName",value:function(a){return this.animationNameCache.get(a)}},{key:"scrollHandler",value:function(){this.scrolled=!0}},{key:"scrollCallback",value:function(){if(this.scrolled){this.scrolled=!1;for(var a=[],b=0;b<this.boxes.length;b++){var c=this.boxes[b];if(c){if(this.isVisible(c)){this.show(c);continue}a.push(c)}}this.boxes=a,this.boxes.length||this.config.live||this.stop()}}},{key:"offsetTop",value:function(a){for(;void 0===a.offsetTop;)a=a.parentNode;for(var b=a.offsetTop;a.offsetParent;)a=a.offsetParent,b+=a.offsetTop;return b}},{key:"isVisible",value:function(a){var b=a.getAttribute("data-wow-offset")||this.config.offset,c=this.config.scrollContainer&&this.config.scrollContainer.scrollTop||window.pageYOffset,d=c+Math.min(this.element.clientHeight,k())-b,e=this.offsetTop(a),f=e+a.clientHeight;return d>=e&&f>=c}},{key:"disabled",value:function(){return!this.config.mobile&&f(navigator.userAgent)}}]),a}();b["default"]=r,a.exports=b["default"]});
var wow=new WOW(
{
boxClass:     'wow',
animateClass: 'animated',
offset:       0,
mobile:       true,
live:         true,
callback:     function(box){
},
scrollContainer: null,
resetAnimation: true,
}
);
wow.init();
(function(){
var COUNT_FRAMERATE, COUNT_MS_PER_FRAME, DIGIT_FORMAT, DIGIT_HTML, DIGIT_SPEEDBOOST, DURATION, FORMAT_MARK_HTML, FORMAT_PARSER, FRAMERATE, FRAMES_PER_VALUE, MS_PER_FRAME, MutationObserver, Odometer, RIBBON_HTML, TRANSITION_END_EVENTS, TRANSITION_SUPPORT, VALUE_HTML, addClass, createFromHTML, fractionalPart, now, removeClass, requestAnimationFrame, round, transitionCheckStyles, trigger, truncate, wrapJQuery, _jQueryWrapped, _old, _ref, _ref1,
__slice=[].slice;
VALUE_HTML='<span class="pxl-counterslide-value"></span>';
RIBBON_HTML='<span class="pxl-counterslide-ribbon"><span class="pxl-counterslide-ribbon-inner">' + VALUE_HTML + '</span></span>';
DIGIT_HTML='<span class="pxl-counterslide-digit"><span class="pxl-counterslide-digit-spacer">8</span><span class="pxl-counterslide-digit-inner">' + RIBBON_HTML + '</span></span>';
FORMAT_MARK_HTML='<span class="pxl-counterslide-formatting-mark"></span>';
DIGIT_FORMAT='(,ddd).dd';
FORMAT_PARSER=/^\(?([^)]*)\)?(?:(.)(d+))?$/;
FRAMERATE=30;
DURATION=2000;
COUNT_FRAMERATE=20;
FRAMES_PER_VALUE=2;
DIGIT_SPEEDBOOST=.5;
MS_PER_FRAME=1000 / FRAMERATE;
COUNT_MS_PER_FRAME=1000 / COUNT_FRAMERATE;
TRANSITION_END_EVENTS='transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd';
transitionCheckStyles=document.createElement('div').style;
TRANSITION_SUPPORT=(transitionCheckStyles.transition!=null)||(transitionCheckStyles.webkitTransition!=null)||(transitionCheckStyles.mozTransition!=null)||(transitionCheckStyles.oTransition!=null);
requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;
MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;
createFromHTML=function(html){
var el;
el=document.createElement('div');
el.innerHTML=html;
return el.children[0];
};
removeClass=function(el, name){
return el.className=el.className.replace(new RegExp("(^|)" + (name.split(' ').join('|')) + "(|$)", 'gi'), ' ');
};
addClass=function(el, name){
removeClass(el, name);
return el.className +=" " + name;
};
trigger=function(el, name){
var evt;
if(document.createEvent!=null){
evt=document.createEvent('HTMLEvents');
evt.initEvent(name, true, true);
return el.dispatchEvent(evt);
}};
now=function(){
var _ref, _ref1;
return (_ref=(_ref1=window.performance)!=null ? typeof _ref1.now==="function" ? _ref1.now():void 0:void 0)!=null ? _ref:+(new Date);
};
round=function(val, precision){
if(precision==null){
precision=0;
}
if(!precision){
return Math.round(val);
}
val *=Math.pow(10, precision);
val +=0.5;
val=Math.floor(val);
return val /=Math.pow(10, precision);
};
truncate=function(val){
if(val < 0){
return Math.ceil(val);
}else{
return Math.floor(val);
}};
fractionalPart=function(val){
return val - round(val);
};
_jQueryWrapped=false;
(wrapJQuery=function(){
var property, _i, _len, _ref, _results;
if(_jQueryWrapped){
return;
}
if(window.jQuery!=null){
_jQueryWrapped=true;
_ref=['html', 'text'];
_results=[];
for (_i=0, _len=_ref.length; _i < _len; _i++){
property=_ref[_i];
_results.push((function(property){
var old;
old=window.jQuery.fn[property];
return window.jQuery.fn[property]=function(val){
var _ref1;
if((val==null)||(((_ref1=this[0])!=null ? _ref1.odometer:void 0)==null)){
return old.apply(this, arguments);
}
return this[0].odometer.update(val);
};})(property));
}
return _results;
}})();
setTimeout(wrapJQuery, 0);
Odometer=(function(){
function Odometer(options){
var e, k, property, v, _base, _i, _len, _ref, _ref1, _ref2,
_this=this;
this.options=options;
this.el=this.options.el;
if(this.el.odometer!=null){
return this.el.odometer;
}
this.el.odometer=this;
_ref=Odometer.options;
for (k in _ref){
v=_ref[k];
if(this.options[k]==null){
this.options[k]=v;
}}
if((_base=this.options).duration==null){
_base.duration=DURATION;
}
this.MAX_VALUES=((this.options.duration / MS_PER_FRAME) / FRAMES_PER_VALUE) | 0;
this.resetFormat();
this.value=this.cleanValue((_ref1=this.options.value)!=null ? _ref1:'');
this.renderInside();
this.render();
try {
_ref2=['innerHTML', 'innerText', 'textContent'];
for (_i=0, _len=_ref2.length; _i < _len; _i++){
property=_ref2[_i];
if(this.el[property]!=null){
(function(property){
return Object.defineProperty(_this.el, property, {
get: function(){
var _ref3;
if(property==='innerHTML'){
return _this.inside.outerHTML;
}else{
return (_ref3=_this.inside.innerText)!=null ? _ref3:_this.inside.textContent;
}},
set: function(val){
return _this.update(val);
}});
})(property);
}}
} catch (_error){
e=_error;
this.watchForMutations();
}
this;
}
Odometer.prototype.renderInside=function(){
this.inside=document.createElement('div');
this.inside.className='pxl-counterslide-inside';
this.el.innerHTML='';
return this.el.appendChild(this.inside);
};
Odometer.prototype.watchForMutations=function(){
var e,
_this=this;
if(MutationObserver==null){
return;
}
try {
if(this.observer==null){
this.observer=new MutationObserver(function(mutations){
var newVal;
newVal=_this.el.innerText;
_this.renderInside();
_this.render(_this.value);
return _this.update(newVal);
});
}
this.watchMutations=true;
return this.startWatchingMutations();
} catch (_error){
e=_error;
}};
Odometer.prototype.startWatchingMutations=function(){
if(this.watchMutations){
return this.observer.observe(this.el, {
childList: true
});
}};
Odometer.prototype.stopWatchingMutations=function(){
var _ref;
return (_ref=this.observer)!=null ? _ref.disconnect():void 0;
};
Odometer.prototype.cleanValue=function(val){
var _ref;
if(typeof val==='string'){
val=val.replace((_ref=this.format.radix)!=null ? _ref:'.', '<radix>');
val=val.replace(/[.,]/g, '');
val=val.replace('<radix>', '.');
val=parseFloat(val, 10)||0;
}
return round(val, this.format.precision);
};
Odometer.prototype.bindTransitionEnd=function(){
var event, renderEnqueued, _i, _len, _ref, _results,
_this=this;
if(this.transitionEndBound){
return;
}
this.transitionEndBound=true;
renderEnqueued=false;
_ref=TRANSITION_END_EVENTS.split(' ');
_results=[];
for (_i=0, _len=_ref.length; _i < _len; _i++){
event=_ref[_i];
_results.push(this.el.addEventListener(event, function(){
if(renderEnqueued){
return true;
}
renderEnqueued=true;
setTimeout(function(){
_this.render();
renderEnqueued=false;
return trigger(_this.el, 'odometerdone');
}, 0);
return true;
}, false));
}
return _results;
};
Odometer.prototype.resetFormat=function(){
var format, fractional, parsed, precision, radix, repeating, _ref, _ref1;
format=(_ref=this.options.format)!=null ? _ref:DIGIT_FORMAT;
format||(format='d');
parsed=FORMAT_PARSER.exec(format);
if(!parsed){
throw new Error("Odometer: Unparsable digit format");
}
_ref1=parsed.slice(1, 4), repeating=_ref1[0], radix=_ref1[1], fractional=_ref1[2];
precision=(fractional!=null ? fractional.length:void 0)||0;
return this.format={
repeating: repeating,
radix: radix,
precision: precision
};};
Odometer.prototype.render=function(value){
var classes, cls, digit, match, newClasses, theme, wholePart, _i, _j, _len, _len1, _ref;
if(value==null){
value=this.value;
}
this.stopWatchingMutations();
this.resetFormat();
this.inside.innerHTML='';
theme=this.options.theme;
classes=this.el.className.split(' ');
newClasses=[];
for (_i=0, _len=classes.length; _i < _len; _i++){
cls=classes[_i];
if(!cls.length){
continue;
}
if(match=/^pxl-counterslide-theme-(.+)$/.exec(cls)){
theme=match[1];
continue;
}
if(/^pxl-counterslide(-|$)/.test(cls)){
continue;
}
newClasses.push(cls);
}
newClasses.push('pxl-counterslide');
if(!TRANSITION_SUPPORT){
newClasses.push('pxl-counterslide-no-transitions');
}
if(theme){
newClasses.push("pxl-counterslide-theme-" + theme);
}else{
newClasses.push("pxl-counterslide-auto-theme");
}
this.el.className=newClasses.join(' ');
this.ribbons={};
this.digits=[];
wholePart = !this.format.precision||!fractionalPart(value)||false;
_ref=value.toString().split('').reverse();
for (_j=0, _len1=_ref.length; _j < _len1; _j++){
digit=_ref[_j];
if(digit==='.'){
wholePart=true;
}
this.addDigit(digit, wholePart);
}
return this.startWatchingMutations();
};
Odometer.prototype.update=function(newValue){
var diff,
_this=this;
newValue=this.cleanValue(newValue);
if(!(diff=newValue - this.value)){
return;
}
removeClass(this.el, 'pxl-counterslide-animating-up pxl-counterslide-animating-down pxl-counterslide-animating');
if(diff > 0){
addClass(this.el, 'pxl-counterslide-animating-up');
}else{
addClass(this.el, 'pxl-counterslide-animating-down');
}
this.stopWatchingMutations();
this.animate(newValue);
this.startWatchingMutations();
setTimeout(function(){
_this.el.offsetHeight;
return addClass(_this.el, 'pxl-counterslide-animating');
}, 0);
return this.value=newValue;
};
Odometer.prototype.renderDigit=function(){
return createFromHTML(DIGIT_HTML);
};
Odometer.prototype.insertDigit=function(digit, before){
if(before!=null){
return this.inside.insertBefore(digit, before);
}else if(!this.inside.children.length){
return this.inside.appendChild(digit);
}else{
return this.inside.insertBefore(digit, this.inside.children[0]);
}};
Odometer.prototype.addSpacer=function(chr, before, extraClasses){
var spacer;
spacer=createFromHTML(FORMAT_MARK_HTML);
spacer.innerHTML=chr;
if(extraClasses){
addClass(spacer, extraClasses);
}
return this.insertDigit(spacer, before);
};
Odometer.prototype.addDigit=function(value, repeating){
var chr, digit, resetted, _ref;
if(repeating==null){
repeating=true;
}
if(value==='-'){
return this.addSpacer(value, null, 'pxl-counterslide-negation-mark');
}
if(value==='.'){
return this.addSpacer((_ref=this.format.radix)!=null ? _ref:'.', null, 'pxl-counterslide-radix-mark');
}
if(repeating){
resetted=false;
while (true){
if(!this.format.repeating.length){
if(resetted){
throw new Error("Bad PXL format without digits");
}
this.resetFormat();
resetted=true;
}
chr=this.format.repeating[this.format.repeating.length - 1];
this.format.repeating=this.format.repeating.substring(0, this.format.repeating.length - 1);
if(chr==='d'){
break;
}
this.addSpacer(chr);
}}
digit=this.renderDigit();
digit.querySelector('.pxl-counterslide-value').innerHTML=value;
this.digits.push(digit);
return this.insertDigit(digit);
};
Odometer.prototype.animate=function(newValue){
if(!TRANSITION_SUPPORT||this.options.animation==='count'){
return this.animateCount(newValue);
}else{
return this.animateSlide(newValue);
}};
Odometer.prototype.animateCount=function(newValue){
var cur, diff, last, start, tick,
_this=this;
if(!(diff=+newValue - this.value)){
return;
}
start=last=now();
cur=this.value;
return (tick=function(){
var delta, dist, fraction;
if((now() - start) > _this.options.duration){
_this.value=newValue;
_this.render();
trigger(_this.el, 'odometerdone');
return;
}
delta=now() - last;
if(delta > COUNT_MS_PER_FRAME){
last=now();
fraction=delta / _this.options.duration;
dist=diff * fraction;
cur +=dist;
_this.render(Math.round(cur));
}
if(requestAnimationFrame!=null){
return requestAnimationFrame(tick);
}else{
return setTimeout(tick, COUNT_MS_PER_FRAME);
}})();
};
Odometer.prototype.getDigitCount=function(){
var i, max, value, values, _i, _len;
values=1 <=arguments.length ? __slice.call(arguments, 0):[];
for (i=_i=0, _len=values.length; _i < _len; i=++_i){
value=values[i];
values[i]=Math.abs(value);
}
max=Math.max.apply(Math, values);
return Math.ceil(Math.log(max + 1) / Math.log(10));
};
Odometer.prototype.getFractionalDigitCount=function(){
var i, parser, parts, value, values, _i, _len;
values=1 <=arguments.length ? __slice.call(arguments, 0):[];
parser=/^\-?\d*\.(\d*?)0*$/;
for (i=_i=0, _len=values.length; _i < _len; i=++_i){
value=values[i];
values[i]=value.toString();
parts=parser.exec(values[i]);
if(parts==null){
values[i]=0;
}else{
values[i]=parts[1].length;
}}
return Math.max.apply(Math, values);
};
Odometer.prototype.resetDigits=function(){
this.digits=[];
this.ribbons=[];
this.inside.innerHTML='';
return this.resetFormat();
};
Odometer.prototype.animateSlide=function(newValue){
var boosted, cur, diff, digitCount, digits, dist, end, fractionalCount, frame, frames, i, incr, j, mark, numEl, oldValue, start, _base, _i, _j, _k, _l, _len, _len1, _len2, _m, _ref, _results;
oldValue=this.value;
fractionalCount=this.getFractionalDigitCount(oldValue, newValue);
if(fractionalCount){
newValue=newValue * Math.pow(10, fractionalCount);
oldValue=oldValue * Math.pow(10, fractionalCount);
}
if(!(diff=newValue - oldValue)){
return;
}
this.bindTransitionEnd();
digitCount=this.getDigitCount(oldValue, newValue);
digits=[];
boosted=0;
for (i=_i=0; 0 <=digitCount ? _i < digitCount:_i > digitCount; i=0 <=digitCount ? ++_i:--_i){
start=truncate(oldValue / Math.pow(10, digitCount - i - 1));
end=truncate(newValue / Math.pow(10, digitCount - i - 1));
dist=end - start;
if(Math.abs(dist) > this.MAX_VALUES){
frames=[];
incr=dist / (this.MAX_VALUES + this.MAX_VALUES * boosted * DIGIT_SPEEDBOOST);
cur=start;
while ((dist > 0&&cur < end)||(dist < 0&&cur > end)){
frames.push(Math.round(cur));
cur +=incr;
}
if(frames[frames.length - 1]!==end){
frames.push(end);
}
boosted++;
}else{
frames=(function(){
_results=[];
for (var _j=start; start <=end ? _j <=end:_j >=end; start <=end ? _j++:_j--){ _results.push(_j); }
return _results;
}).apply(this);
}
for (i=_k=0, _len=frames.length; _k < _len; i=++_k){
frame=frames[i];
frames[i]=Math.abs(frame % 10);
}
digits.push(frames);
}
this.resetDigits();
_ref=digits.reverse();
for (i=_l=0, _len1=_ref.length; _l < _len1; i=++_l){
frames=_ref[i];
if(!this.digits[i]){
this.addDigit(' ', i >=fractionalCount);
}
if((_base=this.ribbons)[i]==null){
_base[i]=this.digits[i].querySelector('.pxl-counterslide-ribbon-inner');
}
this.ribbons[i].innerHTML='';
if(diff < 0){
frames=frames.reverse();
}
for (j=_m=0, _len2=frames.length; _m < _len2; j=++_m){
frame=frames[j];
numEl=document.createElement('div');
numEl.className='pxl-counterslide-value';
numEl.innerHTML=frame;
this.ribbons[i].appendChild(numEl);
if(j===frames.length - 1){
addClass(numEl, 'pxl-counterslide-last-value');
}
if(j===0){
addClass(numEl, 'pxl-counterslide-first-value');
}}
}
if(start < 0){
this.addDigit('-');
}
mark=this.inside.querySelector('.pxl-counterslide-radix-mark');
if(mark!=null){
mark.parent.removeChild(mark);
}
if(fractionalCount){
return this.addSpacer(this.format.radix, this.digits[fractionalCount - 1], 'pxl-counterslide-radix-mark');
}};
return Odometer;
})();
Odometer.options=(_ref=window.odometerOptions)!=null ? _ref:{};
setTimeout(function(){
var k, v, _base, _ref1, _results;
if(window.odometerOptions){
_ref1=window.odometerOptions;
_results=[];
for (k in _ref1){
v=_ref1[k];
_results.push((_base=Odometer.options)[k]!=null ? (_base=Odometer.options)[k]:_base[k]=v);
}
return _results;
}}, 0);
Odometer.init=function(){
var el, elements, _i, _len, _ref1, _results;
if(document.querySelectorAll==null){
return;
}
elements=document.querySelectorAll(Odometer.options.selector||'.pxl-counterslide');
_results=[];
for (_i=0, _len=elements.length; _i < _len; _i++){
el=elements[_i];
_results.push(el.odometer=new Odometer({
el: el,
value: (_ref1=el.innerText)!=null ? _ref1:el.textContent
}));
}
return _results;
};
if((((_ref1=document.documentElement)!=null ? _ref1.doScroll:void 0)!=null)&&(document.createEventObject!=null)){
_old=document.onreadystatechange;
document.onreadystatechange=function(){
if(document.readyState==='complete'&&Odometer.options.auto!==false){
Odometer.init();
}
return _old!=null ? _old.apply(this, arguments):void 0;
};}else{
document.addEventListener('DOMContentLoaded', function(){
if(Odometer.options.auto!==false){
return Odometer.init();
}}, false);
}
if(typeof define==='function'&&define.amd){
define(['jquery'], function(){
return Odometer;
});
}else if(typeof exports===!'undefined'){
module.exports=Odometer;
}else{
window.Odometer=Odometer;
}}).call(this);
function _get(e,t,i){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=_superPropBase(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(i):s.value}})(e,t,i||e)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new 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&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var s=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(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 _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,(function(e){"use strict";var t=0;function i(){if(!(t>100)){if(100===t)console.warn("Curtains: too many warnings thrown, stop logging.");else{var e=Array.prototype.slice.call(arguments);console.warn.apply(console,e)}t++}}function r(){var e=Array.prototype.slice.call(arguments);console.error.apply(console,e)}function s(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16).toUpperCase()}))}function n(e){return 0==(e&e-1)}var a=function(){function e(t){if(_classCallCheck(this,e),this.type="Scene",t&&"Renderer"===t.type){if(!t.gl)return void r(this.type+": Renderer WebGL context is undefined",t)}else r(this.type+": Renderer not passed as first argument",t);this.renderer=t,this.gl=t.gl,this.initStacks()}return _createClass(e,[{key:"initStacks",value:function(){this.stacks={pingPong:[],renderTargets:[],opaque:[],transparent:[],renderPasses:[],scenePasses:[]}}},{key:"resetPlaneStacks",value:function(){this.stacks.pingPong=[],this.stacks.renderTargets=[],this.stacks.opaque=[],this.stacks.transparent=[];for(var e=0;e<this.renderer.planes.length;e++)this.addPlane(this.renderer.planes[e])}},{key:"resetShaderPassStacks",value:function(){this.stacks.scenePasses=[],this.stacks.renderPasses=[];for(var e=0;e<this.renderer.shaderPasses.length;e++)this.renderer.shaderPasses[e].index=e,this.renderer.shaderPasses[e]._isScenePass?this.stacks.scenePasses.push(this.renderer.shaderPasses[e]):this.stacks.renderPasses.push(this.renderer.shaderPasses[e]);0===this.stacks.scenePasses.length&&(this.renderer.state.scenePassIndex=null)}},{key:"addToRenderTargetsStack",value:function(e){var t=this.renderer.planes.filter((function(t){return"PingPongPlane"!==t.type&&t.target&&t.uuid!==e.uuid})),i=-1;if(e.target._depth){for(var r=t.length-1;r>=0;r--)if(t[r].target.uuid===e.target.uuid){i=r+1;break}}else i=t.findIndex((function(t){return t.target.uuid===e.target.uuid}));i=Math.max(0,i),t.splice(i,0,e),e.target._depth?(t.sort((function(e,t){return e.index-t.index})),t.sort((function(e,t){return t.renderOrder-e.renderOrder}))):(t.sort((function(e,t){return t.index-e.index})),t.sort((function(e,t){return e.renderOrder-t.renderOrder}))),t.sort((function(e,t){return e.target.index-t.target.index})),this.stacks.renderTargets=t}},{key:"addToRegularPlaneStack",value:function(e){for(var t=this.renderer.planes.filter((function(t){return"PingPongPlane"!==t.type&&!t.target&&t._transparent===e._transparent&&t.uuid!==e.uuid})),i=-1,r=t.length-1;r>=0;r--)if(t[r]._geometry.definition.id===e._geometry.definition.id){i=r+1;break}return i=Math.max(0,i),t.splice(i,0,e),t.sort((function(e,t){return e.index-t.index})),t}},{key:"addPlane",value:function(e){if("PingPongPlane"===e.type)this.stacks.pingPong.push(e);else if(e.target)this.addToRenderTargetsStack(e);else if(e._transparent){var t=this.addToRegularPlaneStack(e);t.sort((function(e,t){return t.relativeTranslation.z-e.relativeTranslation.z})),t.sort((function(e,t){return t.renderOrder-e.renderOrder})),this.stacks.transparent=t}else{var i=this.addToRegularPlaneStack(e);i.sort((function(e,t){return t.renderOrder-e.renderOrder})),this.stacks.opaque=i}}},{key:"removePlane",value:function(e){"PingPongPlane"===e.type?this.stacks.pingPong=this.stacks.pingPong.filter((function(t){return t.uuid!==e.uuid})):e.target?this.stacks.renderTargets=this.stacks.renderTargets.filter((function(t){return t.uuid!==e.uuid})):e._transparent?this.stacks.transparent=this.stacks.transparent.filter((function(t){return t.uuid!==e.uuid})):this.stacks.opaque=this.stacks.opaque.filter((function(t){return t.uuid!==e.uuid}))}},{key:"setPlaneRenderOrder",value:function(e){if("ShaderPass"===e.type)this.sortShaderPassStack(e._isScenePass?this.stacks.scenePasses:this.stacks.renderPasses);else if("PingPongPlane"===e.type)return;if(e.target)e.target._depth?(this.stacks.renderTargets.sort((function(e,t){return e.index-t.index})),this.stacks.renderTargets.sort((function(e,t){return t.renderOrder-e.renderOrder}))):(this.stacks.renderTargets.sort((function(e,t){return t.index-e.index})),this.stacks.renderTargets.sort((function(e,t){return e.renderOrder-t.renderOrder}))),this.stacks.renderTargets.sort((function(e,t){return e.target.index-t.target.index}));else{var t=e._transparent?this.stacks.transparent:this.stacks.opaque,i=this.stacks.scenePasses.find((function(e,t){return e._isScenePass&&!e._depth&&0===t}));!this.renderer.depth||i?(t.sort((function(e,t){return t.index-e.index})),e._transparent&&t.sort((function(e,t){return e.relativeTranslation.z-t.relativeTranslation.z})),t.sort((function(e,t){return e.renderOrder-t.renderOrder}))):(t.sort((function(e,t){return e.index-t.index})),e._transparent&&t.sort((function(e,t){return t.relativeTranslation.z-e.relativeTranslation.z})),t.sort((function(e,t){return t.renderOrder-e.renderOrder})))}}},{key:"addShaderPass",value:function(e){e._isScenePass?(this.stacks.scenePasses.push(e),this.sortShaderPassStack(this.stacks.scenePasses)):(this.stacks.renderPasses.push(e),this.sortShaderPassStack(this.stacks.renderPasses))}},{key:"removeShaderPass",value:function(e){this.resetShaderPassStacks()}},{key:"sortShaderPassStack",value:function(e){e.sort((function(e,t){return e.index-t.index})),e.sort((function(e,t){return e.renderOrder-t.renderOrder}))}},{key:"enableShaderPass",value:function(){this.stacks.scenePasses.length&&0===this.stacks.renderPasses.length&&this.renderer.planes.length&&(this.renderer.state.scenePassIndex=0,this.renderer.bindFrameBuffer(this.stacks.scenePasses[0].target))}},{key:"drawRenderPasses",value:function(){this.stacks.scenePasses.length&&this.stacks.renderPasses.length&&this.renderer.planes.length&&(this.renderer.state.scenePassIndex=0,this.renderer.bindFrameBuffer(this.stacks.scenePasses[0].target));for(var e=0;e<this.stacks.renderPasses.length;e++)this.stacks.renderPasses[e]._startDrawing(),this.renderer.clearDepth()}},{key:"drawScenePasses",value:function(){for(var e=0;e<this.stacks.scenePasses.length;e++)this.stacks.scenePasses[e]._startDrawing()}},{key:"drawPingPongStack",value:function(){for(var e=0;e<this.stacks.pingPong.length;e++){var t=this.stacks.pingPong[e];t&&t._startDrawing()}}},{key:"drawStack",value:function(e){for(var t=0;t<this.stacks[e].length;t++){var i=this.stacks[e][t];i&&i._startDrawing()}}},{key:"draw",value:function(){this.drawPingPongStack(),this.enableShaderPass(),this.drawStack("renderTargets"),this.drawRenderPasses(),this.renderer.setBlending(!1),this.drawStack("opaque"),this.stacks.transparent.length&&(this.renderer.setBlending(!0),this.drawStack("transparent")),this.drawScenePasses()}}]),e}(),o=function(){function e(){_classCallCheck(this,e),this.geometries=[],this.clear()}return _createClass(e,[{key:"clear",value:function(){this.textures=[],this.programs=[]}},{key:"getGeometryFromID",value:function(e){return this.geometries.find((function(t){return t.id===e}))}},{key:"addGeometry",value:function(e,t,i){this.geometries.push({id:e,vertices:t,uvs:i})}},{key:"isSameShader",value:function(e,t){return 0===e.localeCompare(t)}},{key:"getProgramFromShaders",value:function(e,t){var i=this;return this.programs.find((function(r){return i.isSameShader(r.vsCode,e)&&i.isSameShader(r.fsCode,t)}))}},{key:"addProgram",value:function(e){this.programs.push(e)}},{key:"getTextureFromSource",value:function(e){var t="string"==typeof e?e:e.src;return this.textures.find((function(e){return e.source&&e.source.src===t}))}},{key:"addTexture",value:function(e){this.getTextureFromSource(e.source)||this.textures.push(e)}},{key:"removeTexture",value:function(e){this.textures=this.textures.filter((function(t){return t.uuid!==e.uuid}))}}]),e}(),h=function(){function e(){_classCallCheck(this,e),this.clear()}return _createClass(e,[{key:"clear",value:function(){this.queue=[]}},{key:"add",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={callback:e,keep:i,timeout:null};return r.timeout=setTimeout((function(){t.queue.push(r)}),0),r}},{key:"execute",value:function(){var e=this;this.queue.map((function(t){t.callback&&t.callback(),clearTimeout(e.queue.timeout)})),this.queue=this.queue.filter((function(e){return e.keep}))}}]),e}(),l=function(){function e(t){var r=t.alpha,s=t.antialias,n=t.premultipliedAlpha,a=t.depth,o=t.failIfMajorPerformanceCaveat,h=t.preserveDrawingBuffer,l=t.stencil,u=t.container,d=t.pixelRatio,c=t.renderingScale,p=t.production,f=t.onError,g=t.onSuccess,_=t.onContextLost,m=t.onContextRestored,v=t.onDisposed,y=t.onSceneChange;_classCallCheck(this,e),this.type="Renderer",this.alpha=r,this.antialias=s,this.premultipliedAlpha=n,this.depth=a,this.failIfMajorPerformanceCaveat=o,this.preserveDrawingBuffer=h,this.stencil=l,this.container=u,this.pixelRatio=d,this._renderingScale=c,this.production=p,this.onError=f,this.onSuccess=g,this.onContextLost=_,this.onContextRestored=m,this.onDisposed=v,this.onSceneChange=y,this.initState(),this.canvas=document.createElement("canvas");var x={alpha:this.alpha,premultipliedAlpha:this.premultipliedAlpha,antialias:this.antialias,depth:this.depth,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.preserveDrawingBuffer,stencil:this.stencil};if(this.gl=this.canvas.getContext("webgl2",x),this._isWebGL2=!!this.gl,this.gl||(this.gl=this.canvas.getContext("webgl",x)||this.canvas.getContext("experimental-webgl",x)),!this.gl)return this.production||i(this.type+": WebGL context could not be created"),this.state.isActive=!1,void(this.onError&&this.onError());this.onSuccess&&this.onSuccess(),this.initRenderer()}return _createClass(e,[{key:"initState",value:function(){this.state={isActive:!0,isContextLost:!0,drawingEnabled:!0,forceRender:!1,currentProgramID:null,currentGeometryID:null,forceBufferUpdate:!1,depthTest:null,blending:null,cullFace:null,frameBufferID:null,scenePassIndex:null,activeTexture:null,unpackAlignment:null,flipY:null,premultiplyAlpha:null}}},{key:"initCallbackQueueManager",value:function(){this.nextRender=new h}},{key:"initRenderer",value:function(){this.planes=[],this.renderTargets=[],this.shaderPasses=[],this.state.isContextLost=!1,this.state.maxTextureSize=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.initCallbackQueueManager(),this.setBlendFunc(),this.setDepthFunc(),this.setDepthTest(!0),this.cache=new o,this.scene=new a(this),this.getExtensions(),this._contextLostHandler=this.contextLost.bind(this),this.canvas.addEventListener("webglcontextlost",this._contextLostHandler,!1),this._contextRestoredHandler=this.contextRestored.bind(this),this.canvas.addEventListener("webglcontextrestored",this._contextRestoredHandler,!1)}},{key:"getExtensions",value:function(){this.extensions=[],this._isWebGL2?(this.extensions.EXT_color_buffer_float=this.gl.getExtension("EXT_color_buffer_float"),this.extensions.OES_texture_float_linear=this.gl.getExtension("OES_texture_float_linear"),this.extensions.EXT_texture_filter_anisotropic=this.gl.getExtension("EXT_texture_filter_anisotropic"),this.extensions.WEBGL_lose_context=this.gl.getExtension("WEBGL_lose_context")):(this.extensions.OES_vertex_array_object=this.gl.getExtension("OES_vertex_array_object"),this.extensions.OES_texture_float=this.gl.getExtension("OES_texture_float"),this.extensions.OES_texture_float_linear=this.gl.getExtension("OES_texture_float_linear"),this.extensions.OES_texture_half_float=this.gl.getExtension("OES_texture_half_float"),this.extensions.OES_texture_half_float_linear=this.gl.getExtension("OES_texture_half_float_linear"),this.extensions.EXT_texture_filter_anisotropic=this.gl.getExtension("EXT_texture_filter_anisotropic"),this.extensions.OES_element_index_uint=this.gl.getExtension("OES_element_index_uint"),this.extensions.OES_standard_derivatives=this.gl.getExtension("OES_standard_derivatives"),this.extensions.EXT_sRGB=this.gl.getExtension("EXT_sRGB"),this.extensions.WEBGL_depth_texture=this.gl.getExtension("WEBGL_depth_texture"),this.extensions.WEBGL_draw_buffers=this.gl.getExtension("WEBGL_draw_buffers"),this.extensions.WEBGL_lose_context=this.gl.getExtension("WEBGL_lose_context"))}},{key:"contextLost",value:function(e){var t=this;this.state.isContextLost=!0,this.state.isActive&&(e.preventDefault(),this.nextRender.add((function(){return t.onContextLost&&t.onContextLost()})))}},{key:"restoreContext",value:function(){this.state.isActive&&(this.initState(),this.gl&&this.extensions.WEBGL_lose_context?this.extensions.WEBGL_lose_context.restoreContext():(this.gl||this.production?this.extensions.WEBGL_lose_context||this.production||i(this.type+": Could not restore the context because the restore context extension is not defined"):i(this.type+": Could not restore the context because the context is not defined"),this.onError&&this.onError()))}},{key:"isContextexFullyRestored",value:function(){for(var e=!0,t=0;t<this.renderTargets.length;t++){this.renderTargets[t].textures[0]._canDraw||(e=!1);break}if(e)for(var i=0;i<this.planes.length;i++){if(!this.planes[i]._canDraw){e=!1;break}for(var r=0;r<this.planes[i].textures.length;r++)if(!this.planes[i].textures[r]._canDraw){e=!1;break}}if(e)for(var s=0;s<this.shaderPasses.length;s++){if(!this.shaderPasses[s]._canDraw){e=!1;break}for(var n=0;n<this.shaderPasses[s].textures.length;n++)if(!this.shaderPasses[s].textures[n]._canDraw){e=!1;break}}return e}},{key:"contextRestored",value:function(){var e=this;this.getExtensions(),this.setBlendFunc(),this.setDepthFunc(),this.setDepthTest(!0),this.cache.clear(),this.scene.initStacks();for(var t=0;t<this.renderTargets.length;t++)this.renderTargets[t]._restoreContext();for(var i=0;i<this.planes.length;i++)this.planes[i]._restoreContext();for(var r=0;r<this.shaderPasses.length;r++)this.shaderPasses[r]._restoreContext();var s=this.nextRender.add((function(){e.isContextexFullyRestored()&&(s.keep=!1,e.state.isContextLost=!1,e.onContextRestored&&e.onContextRestored(),e.onSceneChange(),e.needRender())}),!0)}},{key:"setPixelRatio",value:function(e){this.pixelRatio=e}},{key:"setSize",value:function(){if(this.gl){var e=this.container.getBoundingClientRect();this._boundingRect={width:e.width*this.pixelRatio,height:e.height*this.pixelRatio,top:e.top*this.pixelRatio,left:e.left*this.pixelRatio};var t=!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),i=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;if(t&&i){this._boundingRect.top=function(e){for(var t=0;e&&!isNaN(e.offsetTop);)t+=e.offsetTop-e.scrollTop,e=e.offsetParent;return t}(this.container)*this.pixelRatio}this.canvas.style.width=Math.floor(this._boundingRect.width/this.pixelRatio)+"px",this.canvas.style.height=Math.floor(this._boundingRect.height/this.pixelRatio)+"px",this.canvas.width=Math.floor(this._boundingRect.width*this._renderingScale),this.canvas.height=Math.floor(this._boundingRect.height*this._renderingScale),this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}}},{key:"resize",value:function(){for(var e=0;e<this.planes.length;e++)this.planes[e]._canDraw&&this.planes[e].resize();for(var t=0;t<this.shaderPasses.length;t++)this.shaderPasses[t]._canDraw&&this.shaderPasses[t].resize();for(var i=0;i<this.renderTargets.length;i++)this.renderTargets[i].resize();this.needRender()}},{key:"clear",value:function(){this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},{key:"clearDepth",value:function(){this.gl.clear(this.gl.DEPTH_BUFFER_BIT)}},{key:"clearColor",value:function(){this.gl.clear(this.gl.COLOR_BUFFER_BIT)}},{key:"bindFrameBuffer",value:function(e,t){var i=null;e?(i=e.index)!==this.state.frameBufferID&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e._frameBuffer),this.gl.viewport(0,0,e._size.width,e._size.height),e._shouldClear&&!t&&this.clear()):null!==this.state.frameBufferID&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)),this.state.frameBufferID=i}},{key:"setDepthTest",value:function(e){e&&!this.state.depthTest?(this.state.depthTest=e,this.gl.enable(this.gl.DEPTH_TEST)):!e&&this.state.depthTest&&(this.state.depthTest=e,this.gl.disable(this.gl.DEPTH_TEST))}},{key:"setDepthFunc",value:function(){this.gl.depthFunc(this.gl.LEQUAL)}},{key:"setBlending",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&!this.state.blending?(this.state.blending=e,this.gl.enable(this.gl.BLEND)):!e&&this.state.blending&&(this.state.blending=e,this.gl.disable(this.gl.BLEND))}},{key:"setBlendFunc",value:function(){this.gl.enable(this.gl.BLEND),this.premultipliedAlpha?this.gl.blendFuncSeparate(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA)}},{key:"setFaceCulling",value:function(e){if(this.state.cullFace!==e)if(this.state.cullFace=e,"none"===e)this.gl.disable(this.gl.CULL_FACE);else{var t="front"===e?this.gl.FRONT:this.gl.BACK;this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(t)}}},{key:"useProgram",value:function(e){null!==this.state.currentProgramID&&this.state.currentProgramID===e.id||(this.gl.useProgram(e.program),this.state.currentProgramID=e.id)}},{key:"removePlane",value:function(e){this.gl&&(this.planes=this.planes.filter((function(t){return t.uuid!==e.uuid})),this.scene.removePlane(e),e=null,this.gl&&this.clear(),this.onSceneChange())}},{key:"removeRenderTarget",value:function(e){if(this.gl){for(var t=this.planes.find((function(t){return"PingPongPlane"!==t.type&&t.target&&t.target.uuid===e.uuid})),i=0;i<this.planes.length;i++)this.planes[i].target&&this.planes[i].target.uuid===e.uuid&&(this.planes[i].target=null);this.renderTargets=this.renderTargets.filter((function(t){return t.uuid!==e.uuid}));for(var r=0;r<this.renderTargets.length;r++)this.renderTargets[r].index=r;e=null,this.gl&&this.clear(),t&&this.scene.resetPlaneStacks(),this.onSceneChange()}}},{key:"removeShaderPass",value:function(e){this.gl&&(this.shaderPasses=this.shaderPasses.filter((function(t){return t.uuid!==e.uuid})),this.scene.removeShaderPass(e),e=null,this.gl&&this.clear(),this.onSceneChange())}},{key:"enableDrawing",value:function(){this.state.drawingEnabled=!0}},{key:"disableDrawing",value:function(){this.state.drawingEnabled=!1}},{key:"needRender",value:function(){this.state.forceRender=!0}},{key:"render",value:function(){this.gl&&(this.clear(),this.state.currentGeometryID=null,this.scene.draw())}},{key:"deletePrograms",value:function(){for(var e=0;e<this.cache.programs.length;e++){var t=this.cache.programs[e];this.gl.deleteProgram(t.program)}}},{key:"dispose",value:function(){var e=this;if(this.gl){for(this.state.isActive=!1;this.planes.length>0;)this.removePlane(this.planes[0]);for(;this.shaderPasses.length>0;)this.removeShaderPass(this.shaderPasses[0]);for(;this.renderTargets.length>0;)this.removeRenderTarget(this.renderTargets[0]);var t=this.nextRender.add((function(){0===e.planes.length&&0===e.shaderPasses.length&&0===e.renderTargets.length&&(t.keep=!1,e.deletePrograms(),e.clear(),e.canvas.removeEventListener("webgllost",e._contextLostHandler,!1),e.canvas.removeEventListener("webglrestored",e._contextRestoredHandler,!1),e.gl&&e.extensions.WEBGL_lose_context&&e.extensions.WEBGL_lose_context.loseContext(),e.canvas.width=e.canvas.width,e.gl=null,e.container.removeChild(e.canvas),e.container=null,e.canvas=null,e.onDisposed&&e.onDisposed())}),!0)}}}]),e}(),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.xOffset,r=void 0===i?0:i,s=t.yOffset,n=void 0===s?0:s,a=t.lastXDelta,o=void 0===a?0:a,h=t.lastYDelta,l=void 0===h?0:h,u=t.shouldWatch,d=void 0===u||u,c=t.onScroll,p=void 0===c?function(){}:c;_classCallCheck(this,e),this.xOffset=r,this.yOffset=n,this.lastXDelta=o,this.lastYDelta=l,this.shouldWatch=d,this.onScroll=p,this.handler=this.scroll.bind(this,!0),this.shouldWatch&&window.addEventListener("scroll",this.handler,{passive:!0})}return _createClass(e,[{key:"scroll",value:function(){this.updateScrollValues(window.pageXOffset,window.pageYOffset)}},{key:"updateScrollValues",value:function(e,t){var i=this.xOffset;this.xOffset=e,this.lastXDelta=i-this.xOffset;var r=this.yOffset;this.yOffset=t,this.lastYDelta=r-this.yOffset,this.onScroll&&this.onScroll(this.lastXDelta,this.lastYDelta)}},{key:"dispose",value:function(){this.shouldWatch&&window.removeEventListener("scroll",this.handler,{passive:!0})}}]),e}(),d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.container,s=t.alpha,n=void 0===s||s,a=t.premultipliedAlpha,o=void 0!==a&&a,h=t.antialias,l=void 0===h||h,u=t.depth,d=void 0===u||u,c=t.failIfMajorPerformanceCaveat,p=void 0===c||c,f=t.preserveDrawingBuffer,g=void 0!==f&&f,_=t.stencil,m=void 0!==_&&_,v=t.autoResize,y=void 0===v||v,x=t.autoRender,b=void 0===x||x,k=t.watchScroll,R=void 0===k||k,P=t.pixelRatio,w=void 0===P?window.devicePixelRatio||1:P,T=t.renderingScale,S=void 0===T?1:T,C=t.production,E=void 0!==C&&C;_classCallCheck(this,e),this.type="Curtains",this._autoResize=y,this._autoRender=b,this._watchScroll=R,this.pixelRatio=w,S=isNaN(S)?1:parseFloat(S),this._renderingScale=Math.max(.25,Math.min(1,S)),this.premultipliedAlpha=o,this.alpha=n,this.antialias=l,this.depth=d,this.failIfMajorPerformanceCaveat=p,this.preserveDrawingBuffer=g,this.stencil=m,this.production=E,this.errors=!1,r?this.setContainer(r):this.production||i(this.type+": no container provided in the initial parameters. Use setContainer() method to set one later and initialize the WebGL context")}return _createClass(e,[{key:"setContainer",value:function(e){if(e)if("string"==typeof e)if(e=document.getElementById(e))this.container=e;else{var t=document.createElement("div");t.setAttribute("id","curtains-canvas"),document.body.appendChild(t),this.container=t,this.production||i('Curtains: no valid container HTML element or ID provided, created a div with "curtains-canvas" ID instead')}else e instanceof Element&&(this.container=e);else{var r=document.createElement("div");r.setAttribute("id","curtains-canvas"),document.body.appendChild(r),this.container=r,this.production||i('Curtains: no valid container HTML element or ID provided, created a div with "curtains-canvas" ID instead')}this._initCurtains()}},{key:"_initCurtains",value:function(){this.planes=[],this.renderTargets=[],this.shaderPasses=[],this._initRenderer(),this.gl&&(this._initScroll(),this._setSize(),this._addListeners(),this.container.appendChild(this.canvas),this._animationFrameID=null,this._autoRender&&this._animate())}},{key:"_initRenderer",value:function(){var e=this;this.renderer=new l({alpha:this.alpha,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,depth:this.depth,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.preserveDrawingBuffer,stencil:this.stencil,container:this.container,pixelRatio:this.pixelRatio,renderingScale:this._renderingScale,production:this.production,onError:function(){return e._onRendererError()},onSuccess:function(){return e._onRendererSuccess()},onContextLost:function(){return e._onRendererContextLost()},onContextRestored:function(){return e._onRendererContextRestored()},onDisposed:function(){return e._onRendererDisposed()},onSceneChange:function(){return e._keepSync()}}),this.gl=this.renderer.gl,this.canvas=this.renderer.canvas}},{key:"restoreContext",value:function(){this.renderer.restoreContext()}},{key:"_animate",value:function(){this.render(),this._animationFrameID=window.requestAnimationFrame(this._animate.bind(this))}},{key:"enableDrawing",value:function(){this.renderer.enableDrawing()}},{key:"disableDrawing",value:function(){this.renderer.disableDrawing()}},{key:"needRender",value:function(){this.renderer.needRender()}},{key:"nextRender",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.renderer.nextRender.add(e,t)}},{key:"clear",value:function(){this.renderer&&this.renderer.clear()}},{key:"clearDepth",value:function(){this.renderer&&this.renderer.clearDepth()}},{key:"clearColor",value:function(){this.renderer&&this.renderer.clearColor()}},{key:"isWebGL2",value:function(){return!!this.gl&&this.renderer._isWebGL2}},{key:"render",value:function(){this.renderer.nextRender.execute(),(this.renderer.state.drawingEnabled||this.renderer.state.forceRender)&&(this.renderer.state.forceRender&&(this.renderer.state.forceRender=!1),this._onRenderCallback&&this._onRenderCallback(),this.renderer.render())}},{key:"_addListeners",value:function(){this._resizeHandler=null,this._autoResize&&(this._resizeHandler=this.resize.bind(this,!0),window.addEventListener("resize",this._resizeHandler,!1))}},{key:"setPixelRatio",value:function(e,t){this.pixelRatio=parseFloat(Math.max(e,1))||1,this.renderer.setPixelRatio(e),this.resize(t)}},{key:"_setSize",value:function(){this.renderer.setSize(),this._scrollManager.shouldWatch&&(this._scrollManager.xOffset=window.pageXOffset,this._scrollManager.yOffset=window.pageYOffset)}},{key:"getBoundingRect",value:function(){return this.renderer._boundingRect}},{key:"resize",value:function(e){var t=this;this.gl&&(this._setSize(),this.renderer.resize(),this.nextRender((function(){t._onAfterResizeCallback&&e&&t._onAfterResizeCallback()})))}},{key:"_initScroll",value:function(){var e=this;this._scrollManager=new u({xOffset:window.pageXOffset,yOffset:window.pageYOffset,lastXDelta:0,lastYDelta:0,shouldWatch:this._watchScroll,onScroll:function(t,i){return e._updateScroll(t,i)}})}},{key:"_updateScroll",value:function(e,t){for(var i=0;i<this.planes.length;i++)this.planes[i].watchScroll&&this.planes[i].updateScrollPosition(e,t);this.renderer.needRender(),this._onScrollCallback&&this._onScrollCallback()}},{key:"updateScrollValues",value:function(e,t){this._scrollManager.updateScrollValues(e,t)}},{key:"getScrollDeltas",value:function(){return{x:this._scrollManager.lastXDelta,y:this._scrollManager.lastYDelta}}},{key:"getScrollValues",value:function(){return{x:this._scrollManager.xOffset,y:this._scrollManager.yOffset}}},{key:"_keepSync",value:function(){this.planes=this.renderer.planes,this.shaderPasses=this.renderer.shaderPasses,this.renderTargets=this.renderer.renderTargets}},{key:"lerp",value:function(e,t,i){return function(e,t,i){return(1-i)*e+i*t}(e,t,i)}},{key:"onAfterResize",value:function(e){return e&&(this._onAfterResizeCallback=e),this}},{key:"onError",value:function(e){return e&&(this._onErrorCallback=e),this}},{key:"_onRendererError",value:function(){var e=this;setTimeout((function(){e._onErrorCallback&&!e.errors&&e._onErrorCallback(),e.errors=!0}),0)}},{key:"onSuccess",value:function(e){return e&&(this._onSuccessCallback=e),this}},{key:"_onRendererSuccess",value:function(){var e=this;setTimeout((function(){e._onSuccessCallback&&e._onSuccessCallback()}),0)}},{key:"onContextLost",value:function(e){return e&&(this._onContextLostCallback=e),this}},{key:"_onRendererContextLost",value:function(){this._onContextLostCallback&&this._onContextLostCallback()}},{key:"onContextRestored",value:function(e){return e&&(this._onContextRestoredCallback=e),this}},{key:"_onRendererContextRestored",value:function(){this._onContextRestoredCallback&&this._onContextRestoredCallback()}},{key:"onRender",value:function(e){return e&&(this._onRenderCallback=e),this}},{key:"onScroll",value:function(e){return e&&(this._onScrollCallback=e),this}},{key:"dispose",value:function(){this.renderer.dispose()}},{key:"_onRendererDisposed",value:function(){this._animationFrameID&&window.cancelAnimationFrame(this._animationFrameID),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler,!1),this._scrollManager&&this._scrollManager.dispose()}}]),e}(),c=function(){function e(t,i,s){if(_classCallCheck(this,e),this.type="Uniforms",t&&"Renderer"===t.type){if(!t.gl)return void r(this.type+": Renderer WebGL context is undefined",t)}else r(this.type+": Renderer not passed as first argument",t);if(this.renderer=t,this.gl=t.gl,this.program=i,this.uniforms={},s)for(var n in s){var a=s[n];this.uniforms[n]={name:a.name,type:a.type,value:a.value.clone&&"function"==typeof a.value.clone?a.value.clone():a.value,update:null}}}return _createClass(e,[{key:"handleUniformSetting",value:function(e){switch(e.type){case"1i":e.update=this.setUniform1i.bind(this);break;case"1iv":e.update=this.setUniform1iv.bind(this);break;case"1f":e.update=this.setUniform1f.bind(this);break;case"1fv":e.update=this.setUniform1fv.bind(this);break;case"2i":e.update=this.setUniform2i.bind(this);break;case"2iv":e.update=this.setUniform2iv.bind(this);break;case"2f":e.update=this.setUniform2f.bind(this);break;case"2fv":e.update=this.setUniform2fv.bind(this);break;case"3i":e.update=this.setUniform3i.bind(this);break;case"3iv":e.update=this.setUniform3iv.bind(this);break;case"3f":e.update=this.setUniform3f.bind(this);break;case"3fv":e.update=this.setUniform3fv.bind(this);break;case"4i":e.update=this.setUniform4i.bind(this);break;case"4iv":e.update=this.setUniform4iv.bind(this);break;case"4f":e.update=this.setUniform4f.bind(this);break;case"4fv":e.update=this.setUniform4fv.bind(this);break;case"mat2":e.update=this.setUniformMatrix2fv.bind(this);break;case"mat3":e.update=this.setUniformMatrix3fv.bind(this);break;case"mat4":e.update=this.setUniformMatrix4fv.bind(this);break;default:this.renderer.production||i(this.type+": This uniform type is not handled:",e.type)}}},{key:"setInternalFormat",value:function(e){"Vec2"===e.value.type?(e._internalFormat="Vec2",e.lastValue=e.value.clone()):"Vec3"===e.value.type?(e._internalFormat="Vec3",e.lastValue=e.value.clone()):"Mat4"===e.value.type?(e._internalFormat="Mat4",e.lastValue=e.value.clone()):"Quat"===e.value.type?(e._internalFormat="Quat",e.lastValue=e.value.clone()):Array.isArray(e.value)?(e._internalFormat="array",e.lastValue=Array.from(e.value)):e.value.constructor===Float32Array?(e._internalFormat="mat",e.lastValue=e.value):(e._internalFormat="float",e.lastValue=e.value)}},{key:"setUniforms",value:function(){if(this.uniforms)for(var e in this.uniforms){var t=this.uniforms[e];t.location=this.gl.getUniformLocation(this.program,t.name),t._internalFormat||this.setInternalFormat(t),t.type||("Vec2"===t._internalFormat?t.type="2f":"Vec3"===t._internalFormat?t.type="3f":"Mat4"===t._internalFormat?t.type="mat4":"array"===t._internalFormat?4===t.value.length?(t.type="4f",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a 4f (array of 4 floats) uniform type")):3===t.value.length?(t.type="3f",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a 3f (array of 3 floats) uniform type")):2===t.value.length&&(t.type="2f",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a 2f (array of 2 floats) uniform type")):"mat"===t._internalFormat?16===t.value.length?(t.type="mat4",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a mat4 (4x4 matrix array) uniform type")):9===t.value.length?(t.type="mat3",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a mat3 (3x3 matrix array) uniform type")):4===t.value.length&&(t.type="mat2",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a mat2 (2x2 matrix array) uniform type")):(t.type="1f",this.renderer.production||i(this.type+": No uniform type declared for "+t.name+", applied a 1f (float) uniform type"))),this.handleUniformSetting(t),t.update&&t.update(t)}}},{key:"updateUniforms",value:function(){if(this.uniforms)for(var e in this.uniforms){var t=this.uniforms[e],i=!1;"Vec2"===t._internalFormat||"Vec3"===t._internalFormat||"Quat"===t._internalFormat?t.value.equals(t.lastValue)||(i=!0,t.lastValue.copy(t.value)):t.value.length?JSON.stringify(t.value)!==JSON.stringify(t.lastValue)&&(i=!0,t.lastValue=Array.from(t.value)):t.value!==t.lastValue&&(i=!0,t.lastValue=t.value),i&&t.update&&t.update(t)}}},{key:"setUniform1i",value:function(e){this.gl.uniform1i(e.location,e.value)}},{key:"setUniform1iv",value:function(e){this.gl.uniform1iv(e.location,e.value)}},{key:"setUniform1f",value:function(e){this.gl.uniform1f(e.location,e.value)}},{key:"setUniform1fv",value:function(e){this.gl.uniform1fv(e.location,e.value)}},{key:"setUniform2i",value:function(e){"Vec2"===e._internalFormat?this.gl.uniform2i(e.location,e.value.x,e.value.y):this.gl.uniform2i(e.location,e.value[0],e.value[1])}},{key:"setUniform2iv",value:function(e){"Vec2"===e._internalFormat?this.gl.uniform2iv(e.location,[e.value.x,e.value.y]):this.gl.uniform2iv(e.location,e.value)}},{key:"setUniform2f",value:function(e){"Vec2"===e._internalFormat?this.gl.uniform2f(e.location,e.value.x,e.value.y):this.gl.uniform2f(e.location,e.value[0],e.value[1])}},{key:"setUniform2fv",value:function(e){"Vec2"===e._internalFormat?this.gl.uniform2fv(e.location,[e.value.x,e.value.y]):this.gl.uniform2fv(e.location,e.value)}},{key:"setUniform3i",value:function(e){"Vec3"===e._internalFormat?this.gl.uniform3i(e.location,e.value.x,e.value.y,e.value.z):this.gl.uniform3i(e.location,e.value[0],e.value[1],e.value[2])}},{key:"setUniform3iv",value:function(e){"Vec3"===e._internalFormat?this.gl.uniform3iv(e.location,[e.value.x,e.value.y,e.value.z]):this.gl.uniform3iv(e.location,e.value)}},{key:"setUniform3f",value:function(e){"Vec3"===e._internalFormat?this.gl.uniform3f(e.location,e.value.x,e.value.y,e.value.z):this.gl.uniform3f(e.location,e.value[0],e.value[1],e.value[2])}},{key:"setUniform3fv",value:function(e){"Vec3"===e._internalFormat?this.gl.uniform3fv(e.location,[e.value.x,e.value.y,e.value.z]):this.gl.uniform3fv(e.location,e.value)}},{key:"setUniform4i",value:function(e){"Quat"===e._internalFormat?this.gl.uniform4i(e.location,e.value.elements[0],e.value.elements[1],e.value.elements[2],e.value[3]):this.gl.uniform4i(e.location,e.value[0],e.value[1],e.value[2],e.value[3])}},{key:"setUniform4iv",value:function(e){"Quat"===e._internalFormat?this.gl.uniform4iv(e.location,[e.value.elements[0],e.value.elements[1],e.value.elements[2],e.value[3]]):this.gl.uniform4iv(e.location,e.value)}},{key:"setUniform4f",value:function(e){"Quat"===e._internalFormat?this.gl.uniform4f(e.location,e.value.elements[0],e.value.elements[1],e.value.elements[2],e.value[3]):this.gl.uniform4f(e.location,e.value[0],e.value[1],e.value[2],e.value[3])}},{key:"setUniform4fv",value:function(e){"Quat"===e._internalFormat?this.gl.uniform4fv(e.location,[e.value.elements[0],e.value.elements[1],e.value.elements[2],e.value[3]]):this.gl.uniform4fv(e.location,e.value)}},{key:"setUniformMatrix2fv",value:function(e){this.gl.uniformMatrix2fv(e.location,!1,e.value)}},{key:"setUniformMatrix3fv",value:function(e){this.gl.uniformMatrix3fv(e.location,!1,e.value)}},{key:"setUniformMatrix4fv",value:function(e){"Mat4"===e._internalFormat?this.gl.uniformMatrix4fv(e.location,!1,e.value.elements):this.gl.uniformMatrix4fv(e.location,!1,e.value)}}]),e}(),p="\nprecision mediump float;\n".replace(/\n/g,""),f="\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\n".replace(/\n/g,""),g="\nvarying vec3 vVertexPosition;\nvarying vec2 vTextureCoord;\n".replace(/\n/g,""),_=(p+f+g+"\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\n\nvoid main(){\n    vTextureCoord=aTextureCoord;\n    vVertexPosition=aVertexPosition;\n    \n    gl_Position=uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\n}\n").replace(/\n/g,""),m=(p+g+"\nvoid main(){\n    gl_FragColor=vec4(0.0, 0.0, 0.0, 1.0);\n}\n").replace(/\n/g,""),v=(p+f+g+"\nvoid main(){\n    vTextureCoord=aTextureCoord;\n    vVertexPosition=aVertexPosition;\n    \n    gl_Position=vec4(aVertexPosition, 1.0);\n}\n").replace(/\n/g,""),y=(p+g+"\nuniform sampler2D uRenderTexture;\n\nvoid main(){\n    gl_FragColor=texture2D(uRenderTexture, vTextureCoord);\n}\n").replace(/\n/g,""),x=0,b=function(){function e(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=s.parent,a=s.vertexShader,o=s.fragmentShader;if(_classCallCheck(this,e),this.type="Program",t&&"Renderer"===t.type){if(!t.gl)return void r(this.type+": Renderer WebGL context is undefined",t)}else r(this.type+": Renderer not passed as first argument",t);this.renderer=t,this.gl=this.renderer.gl,this.parent=n,this.defaultVsCode="Plane"===this.parent.type?_:v,this.defaultFsCode="Plane"===this.parent.type?m:y,a?this.vsCode=a:(this.renderer.production||"Plane"!==this.parent.type||i(this.parent.type+": No vertex shader provided, will use a default one"),this.vsCode=this.defaultVsCode),o?this.fsCode=o:(this.renderer.production||i(this.parent.type+": No fragment shader provided, will use a default one"),this.fsCode=this.defaultFsCode),this.compiled=!0,this.setupProgram()}return _createClass(e,[{key:"createShader",value:function(e,t){var s=this.gl.createShader(t);if(this.gl.shaderSource(s,e),this.gl.compileShader(s),!this.renderer.production&&!this.gl.getShaderParameter(s,this.gl.COMPILE_STATUS)){for(var n=t===this.gl.VERTEX_SHADER?"vertex shader":"fragment shader",a=this.gl.getShaderSource(s).split("\n"),o=0;o<a.length;o++)a[o]=o+1+": "+a[o];return a=a.join("\n"),i(this.type+": Errors occurred while compiling the",n,":\n",this.gl.getShaderInfoLog(s)),r(a),i(this.type+": Will use a default",n),this.createShader(t===this.gl.VERTEX_SHADER?this.defaultVsCode:this.defaultFsCode,t)}return s}},{key:"useNewShaders",value:function(){this.vertexShader=this.createShader(this.vsCode,this.gl.VERTEX_SHADER),this.fragmentShader=this.createShader(this.fsCode,this.gl.FRAGMENT_SHADER),this.vertexShader&&this.fragmentShader||this.renderer.production||i(this.type+": Unable to find or compile the vertex or fragment shader")}},{key:"setupProgram",value:function(){var e=this.renderer.cache.getProgramFromShaders(this.vsCode,this.fsCode);e?(this.vertexShader=e.vertexShader,this.fragmentShader=e.fragmentShader,this.activeUniforms=e.activeUniforms,this.activeAttributes=e.activeAttributes,this.createProgram()):(this.useNewShaders(),this.compiled&&(this.createProgram(),this.renderer.cache.addProgram(this)))}},{key:"createProgram",value:function(){if(x++,this.id=x,this.program=this.gl.createProgram(),this.gl.attachShader(this.program,this.vertexShader),this.gl.attachShader(this.program,this.fragmentShader),this.gl.linkProgram(this.program),!this.renderer.production&&!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return i(this.type+": Unable to initialize the shader program: "+this.gl.getProgramInfoLog(this.program)),i(this.type+": Will use default vertex and fragment shaders"),this.vertexShader=this.createShader(this.defaultVsCode,this.gl.VERTEX_SHADER),this.fragmentShader=this.createShader(this.defaultFsCode,this.gl.FRAGMENT_SHADER),void this.createProgram();if(this.gl.deleteShader(this.vertexShader),this.gl.deleteShader(this.fragmentShader),!this.activeUniforms||!this.activeAttributes){this.activeUniforms={textures:[],textureMatrices:[]};for(var e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS),t=0;t<e;t++){var r=this.gl.getActiveUniform(this.program,t);r.type===this.gl.SAMPLER_2D&&this.activeUniforms.textures.push(r.name),r.type===this.gl.FLOAT_MAT4&&"uMVMatrix"!==r.name&&"uPMatrix"!==r.name&&this.activeUniforms.textureMatrices.push(r.name)}this.activeAttributes=[];for(var s=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),n=0;n<s;n++){var a=this.gl.getActiveAttrib(this.program,n);this.activeAttributes.push(a.name)}}}},{key:"createUniforms",value:function(e){this.uniformsManager=new c(this.renderer,this.program,e),this.setUniforms()}},{key:"setUniforms",value:function(){this.renderer.useProgram(this),this.uniformsManager.setUniforms()}},{key:"updateUniforms",value:function(){this.renderer.useProgram(this),this.uniformsManager.updateUniforms()}}]),e}(),k=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=(i.program,i.width),n=void 0===s?1:s,a=i.height,o=void 0===a?1:a;if(_classCallCheck(this,e),this.type="Geometry",t&&"Renderer"===t.type){if(!t.gl)return void r(this.type+": Renderer WebGL context is undefined",t)}else r(this.type+": Renderer not passed as first argument",t);this.renderer=t,this.gl=this.renderer.gl,this.definition={id:n*o+n,width:n,height:o},this.setDefaultAttributes(),this.setVerticesUVs()}return _createClass(e,[{key:"restoreContext",value:function(e){this.program=null,this.setDefaultAttributes(),this.setVerticesUVs(),this.setProgram(e)}},{key:"setDefaultAttributes",value:function(){this.attributes={vertexPosition:{name:"aVertexPosition",size:3,isActive:!1},textureCoord:{name:"aTextureCoord",size:3,isActive:!1}}}},{key:"setVerticesUVs",value:function(){var e=this.renderer.cache.getGeometryFromID(this.definition.id);e?(this.attributes.vertexPosition.array=e.vertices,this.attributes.textureCoord.array=e.uvs):(this.computeVerticesUVs(),this.renderer.cache.addGeometry(this.definition.id,this.attributes.vertexPosition.array,this.attributes.textureCoord.array))}},{key:"setProgram",value:function(e){this.program=e,this.initAttributes(),this.renderer._isWebGL2?(this._vao=this.gl.createVertexArray(),this.gl.bindVertexArray(this._vao)):this.renderer.extensions.OES_vertex_array_object&&(this._vao=this.renderer.extensions.OES_vertex_array_object.createVertexArrayOES(),this.renderer.extensions.OES_vertex_array_object.bindVertexArrayOES(this._vao)),this.initializeBuffers()}},{key:"initAttributes",value:function(){for(var e in this.attributes){if(this.attributes[e].isActive=this.program.activeAttributes.includes(this.attributes[e].name),!this.attributes[e].isActive)return;this.attributes[e].location=this.gl.getAttribLocation(this.program.program,this.attributes[e].name),this.attributes[e].buffer=this.gl.createBuffer(),this.attributes[e].numberOfItems=this.definition.width*this.definition.height*this.attributes[e].size*2}}},{key:"computeVerticesUVs",value:function(){this.attributes.vertexPosition.array=[],this.attributes.textureCoord.array=[];for(var e=this.attributes.vertexPosition.array,t=this.attributes.textureCoord.array,i=0;i<this.definition.height;i++)for(var r=i/this.definition.height,s=0;s<this.definition.width;s++){var n=s/this.definition.width;t.push(n),t.push(r),t.push(0),e.push(2*(n-.5)),e.push(2*(r-.5)),e.push(0),t.push(n+1/this.definition.width),t.push(r),t.push(0),e.push(2*(n+1/this.definition.width-.5)),e.push(2*(r-.5)),e.push(0),t.push(n),t.push(r+1/this.definition.height),t.push(0),e.push(2*(n-.5)),e.push(2*(r+1/this.definition.height-.5)),e.push(0),t.push(n),t.push(r+1/this.definition.height),t.push(0),e.push(2*(n-.5)),e.push(2*(r+1/this.definition.height-.5)),e.push(0),t.push(n+1/this.definition.width),t.push(r),t.push(0),e.push(2*(n+1/this.definition.width-.5)),e.push(2*(r-.5)),e.push(0),t.push(n+1/this.definition.width),t.push(r+1/this.definition.height),t.push(0),e.push(2*(n+1/this.definition.width-.5)),e.push(2*(r+1/this.definition.height-.5)),e.push(0)}}},{key:"initializeBuffers",value:function(){if(this.attributes){for(var e in this.attributes){if(!this.attributes[e].isActive)return;this.gl.enableVertexAttribArray(this.attributes[e].location),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.attributes[e].buffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(this.attributes[e].array),this.gl.STATIC_DRAW),this.gl.vertexAttribPointer(this.attributes[e].location,this.attributes[e].size,this.gl.FLOAT,!1,0,0)}this.renderer.state.currentGeometryID=this.definition.id}}},{key:"bindBuffers",value:function(){if(this._vao)this.renderer._isWebGL2?this.gl.bindVertexArray(this._vao):this.renderer.extensions.OES_vertex_array_object.bindVertexArrayOES(this._vao);else for(var e in this.attributes){if(!this.attributes[e].isActive)return;this.gl.enableVertexAttribArray(this.attributes[e].location),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.attributes[e].buffer),this.gl.vertexAttribPointer(this.attributes[e].location,this.attributes[e].size,this.gl.FLOAT,!1,0,0)}this.renderer.state.currentGeometryID=this.definition.id}},{key:"draw",value:function(){this.gl.drawArrays(this.gl.TRIANGLES,0,this.attributes.vertexPosition.numberOfItems)}},{key:"dispose",value:function(){for(var e in this._vao&&(this.renderer._isWebGL2?this.gl.deleteVertexArray(this._vao):this.renderer.extensions.OES_vertex_array_object.deleteVertexArrayOES(this._vao)),this.attributes){if(!this.attributes[e].isActive)return;this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.attributes[e].buffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,1,this.gl.STATIC_DRAW),this.gl.deleteBuffer(this.attributes[e].buffer)}this.attributes=null,this.renderer.state.currentGeometryID=null}}]),e}(),R=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);_classCallCheck(this,e),this.type="Mat4",this.elements=t}return _createClass(e,[{key:"setFromArray",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t]=e[t];return this}},{key:"copy",value:function(e){var t=e.elements;return this.elements[0]=t[0],this.elements[1]=t[1],this.elements[2]=t[2],this.elements[3]=t[3],this.elements[4]=t[4],this.elements[5]=t[5],this.elements[6]=t[6],this.elements[7]=t[7],this.elements[8]=t[8],this.elements[9]=t[9],this.elements[10]=t[10],this.elements[11]=t[11],this.elements[12]=t[12],this.elements[13]=t[13],this.elements[14]=t[14],this.elements[15]=t[15],this}},{key:"clone",value:function(){return(new e).copy(this)}},{key:"multiply",value:function(t){var i=this.elements,r=t.elements,s=new e;return s.elements[0]=r[0]*i[0]+r[1]*i[4]+r[2]*i[8]+r[3]*i[12],s.elements[1]=r[0]*i[1]+r[1]*i[5]+r[2]*i[9]+r[3]*i[13],s.elements[2]=r[0]*i[2]+r[1]*i[6]+r[2]*i[10]+r[3]*i[14],s.elements[3]=r[0]*i[3]+r[1]*i[7]+r[2]*i[11]+r[3]*i[15],s.elements[4]=r[4]*i[0]+r[5]*i[4]+r[6]*i[8]+r[7]*i[12],s.elements[5]=r[4]*i[1]+r[5]*i[5]+r[6]*i[9]+r[7]*i[13],s.elements[6]=r[4]*i[2]+r[5]*i[6]+r[6]*i[10]+r[7]*i[14],s.elements[7]=r[4]*i[3]+r[5]*i[7]+r[6]*i[11]+r[7]*i[15],s.elements[8]=r[8]*i[0]+r[9]*i[4]+r[10]*i[8]+r[11]*i[12],s.elements[9]=r[8]*i[1]+r[9]*i[5]+r[10]*i[9]+r[11]*i[13],s.elements[10]=r[8]*i[2]+r[9]*i[6]+r[10]*i[10]+r[11]*i[14],s.elements[11]=r[8]*i[3]+r[9]*i[7]+r[10]*i[11]+r[11]*i[15],s.elements[12]=r[12]*i[0]+r[13]*i[4]+r[14]*i[8]+r[15]*i[12],s.elements[13]=r[12]*i[1]+r[13]*i[5]+r[14]*i[9]+r[15]*i[13],s.elements[14]=r[12]*i[2]+r[13]*i[6]+r[14]*i[10]+r[15]*i[14],s.elements[15]=r[12]*i[3]+r[13]*i[7]+r[14]*i[11]+r[15]*i[15],s}},{key:"getInverse",value:function(){var t=this.elements,i=new e,r=i.elements,s=t[0],n=t[1],a=t[2],o=t[3],h=t[4],l=t[5],u=t[6],d=t[7],c=t[8],p=t[9],f=t[10],g=t[11],_=t[12],m=t[13],v=t[14],y=t[15],x=s*l-n*h,b=s*u-a*h,k=s*d-o*h,R=n*u-a*l,P=n*d-o*l,w=a*d-o*u,T=c*m-p*_,S=c*v-f*_,C=c*y-g*_,E=p*v-f*m,M=p*y-g*m,A=f*y-g*v,F=x*A-b*M+k*E+R*C-P*S+w*T;return F?(F=1/F,r[0]=(l*A-u*M+d*E)*F,r[1]=(a*M-n*A-o*E)*F,r[2]=(m*w-v*P+y*R)*F,r[3]=(f*P-p*w-g*R)*F,r[4]=(u*C-h*A-d*S)*F,r[5]=(s*A-a*C+o*S)*F,r[6]=(v*k-_*w-y*b)*F,r[7]=(c*w-f*k+g*b)*F,r[8]=(h*M-l*C+d*T)*F,r[9]=(n*C-s*M-o*T)*F,r[10]=(_*P-m*k+y*x)*F,r[11]=(p*k-c*P-g*x)*F,r[12]=(l*S-h*E-u*T)*F,r[13]=(s*E-n*S+a*T)*F,r[14]=(m*b-_*R-v*x)*F,r[15]=(c*R-p*b+f*x)*F,i):null}},{key:"scale",value:function(e){var t=this.elements;return t[0]*=e.x,t[1]*=e.x,t[2]*=e.x,t[3]*=e.x,t[4]*=e.y,t[5]*=e.y,t[6]*=e.y,t[7]*=e.y,t[8]*=e.z,t[9]*=e.z,t[10]*=e.z,t[11]*=e.z,this}},{key:"compose",value:function(e,t,i){var r=this.elements,s=t.elements[0],n=t.elements[1],a=t.elements[2],o=t.elements[3],h=s+s,l=n+n,u=a+a,d=s*h,c=s*l,p=s*u,f=n*l,g=n*u,_=a*u,m=o*h,v=o*l,y=o*u,x=i.x,b=i.y,k=i.z;return r[0]=(1-(f+_))*x,r[1]=(c+y)*x,r[2]=(p-v)*x,r[3]=0,r[4]=(c-y)*b,r[5]=(1-(d+_))*b,r[6]=(g+m)*b,r[7]=0,r[8]=(p+v)*k,r[9]=(g-m)*k,r[10]=(1-(d+f))*k,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"composeFromOrigin",value:function(e,t,i,r){var s=this.elements,n=t.elements[0],a=t.elements[1],o=t.elements[2],h=t.elements[3],l=n+n,u=a+a,d=o+o,c=n*l,p=n*u,f=n*d,g=a*u,_=a*d,m=o*d,v=h*l,y=h*u,x=h*d,b=i.x,k=i.y,R=i.z,P=r.x,w=r.y,T=r.z,S=(1-(g+m))*b,C=(p+x)*b,E=(f-y)*b,M=(p-x)*k,A=(1-(c+m))*k,F=(_+v)*k,O=(f+y)*R,D=(_-v)*R,z=(1-(c+g))*R;return s[0]=S,s[1]=C,s[2]=E,s[3]=0,s[4]=M,s[5]=A,s[6]=F,s[7]=0,s[8]=O,s[9]=D,s[10]=z,s[11]=0,s[12]=e.x+P-(S*P+M*w+O*T),s[13]=e.y+w-(C*P+A*w+D*T),s[14]=e.z+T-(E*P+F*w+z*T),s[15]=1,this}}]),e}(),P=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;_classCallCheck(this,e),this.type="Vec2",this._x=t,this._y=i}return _createClass(e,[{key:"x",get:function(){return this._x},set:function(e){var t=e!==this._x;this._x=e,t&&this._onChangeCallback&&this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){var t=e!==this._y;this._y=e,t&&this._onChangeCallback&&this._onChangeCallback()}},{key:"onChange",value:function(e){return e&&(this._onChangeCallback=e),this}},{key:"set",value:function(e,t){return this._x=e,this._y=t,this}},{key:"add",value:function(e){return this._x+=e.x,this._y+=e.y,this}},{key:"addScalar",value:function(e){return this._x+=e,this._y+=e,this}},{key:"sub",value:function(e){return this._x-=e.x,this._y-=e.y,this}},{key:"subScalar",value:function(e){return this._x-=e,this._y-=e,this}},{key:"multiply",value:function(e){return this._x*=e.x,this._y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this._x*=e,this._y*=e,this}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this}},{key:"clone",value:function(){return new e(this._x,this._y)}},{key:"sanitizeNaNValuesWith",value:function(e){return this._x=isNaN(this._x)?e.x:parseFloat(this._x),this._y=isNaN(this._y)?e.y:parseFloat(this._y),this}},{key:"max",value:function(e){return this._x=Math.max(this._x,e.x),this._y=Math.max(this._y,e.y),this}},{key:"min",value:function(e){return this._x=Math.min(this._x,e.x),this._y=Math.min(this._y,e.y),this}},{key:"equals",value:function(e){return this._x===e.x&&this._y===e.y}},{key:"normalize",value:function(){var e=this._x*this._x+this._y*this._y;return e>0&&(e=1/Math.sqrt(e)),this._x*=e,this._y*=e,this}},{key:"dot",value:function(e){return this._x*e.x+this._y*e.y}}]),e}(),w=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;_classCallCheck(this,e),this.type="Vec3",this._x=t,this._y=i,this._z=r}return _createClass(e,[{key:"x",get:function(){return this._x},set:function(e){var t=e!==this._x;this._x=e,t&&this._onChangeCallback&&this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){var t=e!==this._y;this._y=e,t&&this._onChangeCallback&&this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){var t=e!==this._z;this._z=e,t&&this._onChangeCallback&&this._onChangeCallback()}},{key:"onChange",value:function(e){return e&&(this._onChangeCallback=e),this}},{key:"set",value:function(e,t,i){return this._x=e,this._y=t,this._z=i,this}},{key:"add",value:function(e){return this._x+=e.x,this._y+=e.y,this._z+=e.z,this}},{key:"addScalar",value:function(e){return this._x+=e,this._y+=e,this._z+=e,this}},{key:"sub",value:function(e){return this._x-=e.x,this._y-=e.y,this._z-=e.z,this}},{key:"subScalar",value:function(e){return this._x-=e,this._y-=e,this._z-=e,this}},{key:"multiply",value:function(e){return this._x*=e.x,this._y*=e.y,this._z*=e.z,this}},{key:"multiplyScalar",value:function(e){return this._x*=e,this._y*=e,this._z*=e,this}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this}},{key:"clone",value:function(){return new e(this._x,this._y,this._z)}},{key:"sanitizeNaNValuesWith",value:function(e){return this._x=isNaN(this._x)?e.x:parseFloat(this._x),this._y=isNaN(this._y)?e.y:parseFloat(this._y),this._z=isNaN(this._z)?e.z:parseFloat(this._z),this}},{key:"max",value:function(e){return this._x=Math.max(this._x,e.x),this._y=Math.max(this._y,e.y),this._z=Math.max(this._z,e.z),this}},{key:"min",value:function(e){return this._x=Math.min(this._x,e.x),this._y=Math.min(this._y,e.y),this._z=Math.min(this._z,e.z),this}},{key:"equals",value:function(e){return this._x===e.x&&this._y===e.y&&this._z===e.z}},{key:"normalize",value:function(){var e=this._x*this._x+this._y*this._y+this._z*this._z;return e>0&&(e=1/Math.sqrt(e)),this._x*=e,this._y*=e,this._z*=e,this}},{key:"dot",value:function(e){return this._x*e.x+this._y*e.y+this._z*e.z}},{key:"applyMat4",value:function(e){var t=this._x,i=this._y,r=this._z,s=e.elements,n=s[3]*t+s[7]*i+s[11]*r+s[15];return n=n||1,this._x=(s[0]*t+s[4]*i+s[8]*r+s[12])/n,this._y=(s[1]*t+s[5]*i+s[9]*r+s[13])/n,this._z=(s[2]*t+s[6]*i+s[10]*r+s[14])/n,this}},{key:"applyQuat",value:function(e){var t=this._x,i=this._y,r=this._z,s=e.elements[0],n=e.elements[1],a=e.elements[2],o=e.elements[3],h=o*t+n*r-a*i,l=o*i+a*t-s*r,u=o*r+s*i-n*t,d=-s*t-n*i-a*r;return this._x=h*o+d*-s+l*-a-u*-n,this._y=l*o+d*-n+u*-s-h*-a,this._z=u*o+d*-a+h*-n-l*-s,this}},{key:"project",value:function(e){return this.applyMat4(e.viewMatrix).applyMat4(e.projectionMatrix),this}},{key:"unproject",value:function(e){return this.applyMat4(e.projectionMatrix.getInverse()).applyMat4(e.worldMatrix),this}}]),e}(),T=new P,S=new w,C=new R,E=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.isFBOTexture,o=void 0!==a&&a,h=n.fromTexture,l=void 0!==h&&h,u=n.loader,d=n.sampler,c=n.floatingPoint,p=void 0===c?"none":c,f=n.premultiplyAlpha,g=void 0!==f&&f,_=n.anisotropy,m=void 0===_?1:_,v=n.generateMipmap,y=void 0===v?null:v,x=n.wrapS,b=n.wrapT,k=n.minFilter,w=n.magFilter;if(_classCallCheck(this,e),this.type="Texture",(t=t&&t.renderer||t)&&"Renderer"===t.type){if(!t.gl)return void(t.production||r(this.type+": Unable to create a "+this.type+" because the Renderer WebGL context is not defined"))}else r(this.type+": Renderer not passed as first argument",t);if(this.renderer=t,this.gl=this.renderer.gl,this.uuid=s(),this._globalParameters={unpackAlignment:4,flipY:!o,premultiplyAlpha:!1,shouldPremultiplyAlpha:g,floatingPoint:p,type:this.gl.UNSIGNED_BYTE,internalFormat:this.gl.RGBA,format:this.gl.RGBA},this.parameters={anisotropy:m,generateMipmap:y,wrapS:x||this.gl.CLAMP_TO_EDGE,wrapT:b||this.gl.CLAMP_TO_EDGE,minFilter:k||this.gl.LINEAR,magFilter:w||this.gl.LINEAR,_shouldUpdate:!0},this._initState(),this.sourceType=o?"fbo":"empty",this._useCache=!0,this._samplerName=d,this._sampler={isActive:!1,isTextureBound:!1,texture:this.gl.createTexture()},this._textureMatrix={matrix:new R,isActive:!1},this._size={width:1,height:1},this.scale=new P(1),this.scale.onChange((function(){return i.resize()})),this.offset=new P,this.offset.onChange((function(){return i.resize()})),this._loader=u,this._sourceLoaded=!1,this._uploaded=!1,this._willUpdate=!1,this.shouldUpdate=!1,this._forceUpdate=!1,this.userData={},this._canDraw=!1,l)return this._copyOnInit=!0,void(this._copiedFrom=l);this._copyOnInit=!1,this._initTexture()}return _createClass(e,[{key:"_initState",value:function(){this._state={anisotropy:1,generateMipmap:!1,wrapS:null,wrapT:null,minFilter:null,magFilter:this.gl.LINEAR}}},{key:"_initTexture",value:function(){this.gl.bindTexture(this.gl.TEXTURE_2D,this._sampler.texture),"empty"===this.sourceType&&(this._globalParameters.flipY=!1,this._updateGlobalTexParameters(),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,1,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,new Uint8Array([0,0,0,255])),this._canDraw=!0)}},{key:"_restoreFromTexture",value:function(){this._copyOnInit||this._initTexture(),this._parent&&(this._setTextureUniforms(),this._setSize()),this.copy(this._copiedFrom),this._canDraw=!0}},{key:"_restoreContext",value:function(){var e=this;if(this._canDraw=!1,this._sampler.texture=this.gl.createTexture(),this._sampler.isActive=!1,this._sampler.isTextureBound=!1,this._textureMatrix.isActive=!1,this._initState(),this._state.generateMipmap=!1,this.parameters._shouldUpdate=!0,this._copiedFrom)var t=this.renderer.nextRender.add((function(){e._copiedFrom._canDraw&&(e._restoreFromTexture(),t.keep=!1)}),!0);else this._initTexture(),this._parent&&this._setParent(),this.source&&(this.setSource(this.source),"image"===this.sourceType?this.renderer.cache.addTexture(this):this.needUpdate()),this._canDraw=!0}},{key:"addParent",value:function(e){!e||"Plane"!==e.type&&"PingPongPlane"!==e.type&&"ShaderPass"!==e.type&&"RenderTarget"!==e.type?this.renderer.production||i(this.type+": cannot add texture as a child of ",e," because it is not a valid parent"):(this._parent=e,this.index=this._parent.textures.length,this._parent.textures.push(this),this._setParent())}},{key:"_setParent",value:function(){var e=this;if(this._sampler.name=this._samplerName||"uSampler"+this.index,this._textureMatrix.name=this._samplerName?this._samplerName+"Matrix":"uTextureMatrix"+this.index,this._parent._program){if(!this._parent._program.compiled)return void(this.renderer.production||i(this.type+": Unable to create the texture because the program is not valid"));if(this._setTextureUniforms(),this._copyOnInit){var t=this.renderer.nextRender.add((function(){e._copiedFrom._canDraw&&e._copiedFrom._uploaded&&(e.copy(e._copiedFrom),t.keep=!1)}),!0);return}this.source?this._parent.loader&&this._parent.loader._addSourceToParent(this.source,this.sourceType):this._size={width:this._parent._boundingRect.document.width,height:this._parent._boundingRect.document.height},this._setSize()}else"RenderTarget"===this._parent.type&&(this._size={width:this._parent._size&&this._parent._size.width||this.renderer._boundingRect.width,height:this._parent._size&&this._parent._size.height||this.renderer._boundingRect.height},this._upload(),this._updateTexParameters(),this._canDraw=!0)}},{key:"hasParent",value:function(){return!!this._parent}},{key:"_setTextureUniforms",value:function(){for(var e=this,t=this._parent._program.activeUniforms,i=0;i<t.textures.length;i++){if(t.textures[i]===this._sampler.name)this._sampler.isActive=!0,this.renderer.useProgram(this._parent._program),this._sampler.location=this.gl.getUniformLocation(this._parent._program.program,this._sampler.name),t.textureMatrices.find((function(t){return t===e._textureMatrix.name}))&&(this._textureMatrix.isActive=!0,this._textureMatrix.location=this.gl.getUniformLocation(this._parent._program.program,this._textureMatrix.name)),this.gl.uniform1i(this._sampler.location,this.index)}}},{key:"copy",value:function(e){e&&"Texture"===e.type?(this._globalParameters=Object.assign({},e._globalParameters),this._state=Object.assign({},e._state),this.parameters.generateMipmap=e.parameters.generateMipmap,this._state.generateMipmap=null,this._size=e._size,!this._sourceLoaded&&e._sourceLoaded&&this._onSourceLoadedCallback&&this._onSourceLoadedCallback(),this._sourceLoaded=e._sourceLoaded,!this._uploaded&&e._uploaded&&this._onSourceUploadedCallback&&this._onSourceUploadedCallback(),this._uploaded=e._uploaded,this.sourceType=e.sourceType,this.source=e.source,this._videoFrameCallbackID=e._videoFrameCallbackID,this._sampler.texture=e._sampler.texture,this._copiedFrom=e,!this._parent||!this._parent._program||this._canDraw&&this._textureMatrix.matrix||(this._setSize(),this._canDraw=!0),this._updateTexParameters(),this.renderer.needRender()):this.renderer.production||i(this.type+": Unable to set the texture from texture:",e)}},{key:"setSource",value:function(e){var t=this;this._sourceLoaded||this.renderer.nextRender.add((function(){return t._onSourceLoadedCallback&&t._onSourceLoadedCallback()}));var r="IMG"===e.tagName.toUpperCase()?"image":e.tagName.toLowerCase();if("video"!==r&&"canvas"!==r||(this._useCache=!1),this._useCache){var s=this.renderer.cache.getTextureFromSource(e);if(s&&s.uuid!==this.uuid)return this._uploaded||(this.renderer.nextRender.add((function(){return t._onSourceUploadedCallback&&t._onSourceUploadedCallback()})),this._uploaded=!0),this.copy(s),void this.resize()}if("empty"===this.sourceType||this.sourceType!==r)if("video"===r)this._willUpdate=!1,this.shouldUpdate=!0;else if("canvas"===r)this._willUpdate=!0,this.shouldUpdate=!0;else{if("image"!==r)return void(this.renderer.production||i(this.type+": this HTML tag could not be converted into a texture:",e.tagName));this._willUpdate=!1,this.shouldUpdate=!1}this.source=e,this.sourceType=r,this._size={width:this.source.naturalWidth||this.source.width||this.source.videoWidth,height:this.source.naturalHeight||this.source.height||this.source.videoHeight},this._sourceLoaded=!0,this.gl.bindTexture(this.gl.TEXTURE_2D,this._sampler.texture),this.resize(),this._globalParameters.flipY=!0,this._globalParameters.premultiplyAlpha=this._globalParameters.shouldPremultiplyAlpha,"image"===this.sourceType&&(this.parameters.generateMipmap=this.parameters.generateMipmap||null===this.parameters.generateMipmap,this.parameters._shouldUpdate=this.parameters.generateMipmap,this._state.generateMipmap=!1,this._upload()),this.renderer.needRender()}},{key:"_updateGlobalTexParameters",value:function(){this.renderer.state.unpackAlignment!==this._globalParameters.unpackAlignment&&(this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,this._globalParameters.unpackAlignment),this.renderer.state.unpackAlignment=this._globalParameters.unpackAlignment),this.renderer.state.flipY!==this._globalParameters.flipY&&(this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,this._globalParameters.flipY),this.renderer.state.flipY=this._globalParameters.flipY),this.renderer.state.premultiplyAlpha!==this._globalParameters.premultiplyAlpha&&(this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._globalParameters.premultiplyAlpha),this.renderer.state.premultiplyAlpha=this._globalParameters.premultiplyAlpha),"half-float"===this._globalParameters.floatingPoint?this.renderer._isWebGL2&&this.renderer.extensions.EXT_color_buffer_float?(this._globalParameters.internalFormat=this.gl.RGBA16F,this._globalParameters.type=this.gl.HALF_FLOAT):this.renderer.extensions.OES_texture_half_float?this._globalParameters.type=this.renderer.extensions.OES_texture_half_float.HALF_FLOAT_OES:this.renderer.production||i(this.type+": could not use half-float textures because the extension is not available"):"float"===this._globalParameters.floatingPoint&&(this.renderer._isWebGL2&&this.renderer.extensions.EXT_color_buffer_float?(this._globalParameters.internalFormat=this.gl.RGBA16F,this._globalParameters.type=this.gl.FLOAT):this.renderer.extensions.OES_texture_float?this._globalParameters.type=this.renderer.extensions.OES_texture_half_float.FLOAT:this.renderer.production||i(this.type+": could not use float textures because the extension is not available"))}},{key:"_updateTexParameters",value:function(){this.index&&this.renderer.state.activeTexture!==this.index&&this._bindTexture(),this.parameters.wrapS!==this._state.wrapS&&(this.renderer._isWebGL2||n(this._size.width)&&n(this._size.height)||(this.parameters.wrapS=this.gl.CLAMP_TO_EDGE),this.parameters.wrapS!==this.gl.REPEAT&&this.parameters.wrapS!==this.gl.CLAMP_TO_EDGE&&this.parameters.wrapS!==this.gl.MIRRORED_REPEAT&&(this.renderer.production||i(this.type+": Wrong wrapS value",this.parameters.wrapS,"for this texture:",this,"\ngl.CLAMP_TO_EDGE wrapping will be used instead"),this.parameters.wrapS=this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.parameters.wrapS),this._state.wrapS=this.parameters.wrapS),this.parameters.wrapT!==this._state.wrapT&&(this.renderer._isWebGL2||n(this._size.width)&&n(this._size.height)||(this.parameters.wrapT=this.gl.CLAMP_TO_EDGE),this.parameters.wrapT!==this.gl.REPEAT&&this.parameters.wrapT!==this.gl.CLAMP_TO_EDGE&&this.parameters.wrapT!==this.gl.MIRRORED_REPEAT&&(this.renderer.production||i(this.type+": Wrong wrapT value",this.parameters.wrapT,"for this texture:",this,"\ngl.CLAMP_TO_EDGE wrapping will be used instead"),this.parameters.wrapT=this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.parameters.wrapT),this._state.wrapT=this.parameters.wrapT),this.parameters.generateMipmap&&!this._state.generateMipmap&&this.source&&(this.renderer._isWebGL2||n(this._size.width)&&n(this._size.height)?this.gl.generateMipmap(this.gl.TEXTURE_2D):this.parameters.generateMipmap=!1,this._state.generateMipmap=this.parameters.generateMipmap),this.parameters.minFilter!==this._state.minFilter&&(this.renderer._isWebGL2||n(this._size.width)&&n(this._size.height)||(this.parameters.minFilter=this.gl.LINEAR),this.parameters.generateMipmap||null===this.parameters.generateMipmap||(this.parameters.minFilter=this.gl.LINEAR),this.parameters.minFilter!==this.gl.LINEAR&&this.parameters.minFilter!==this.gl.NEAREST&&this.parameters.minFilter!==this.gl.NEAREST_MIPMAP_NEAREST&&this.parameters.minFilter!==this.gl.LINEAR_MIPMAP_NEAREST&&this.parameters.minFilter!==this.gl.NEAREST_MIPMAP_LINEAR&&this.parameters.minFilter!==this.gl.LINEAR_MIPMAP_LINEAR&&(this.renderer.production||i(this.type+": Wrong minFilter value",this.parameters.minFilter,"for this texture:",this,"\ngl.LINEAR filtering will be used instead"),this.parameters.minFilter=this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.parameters.minFilter),this._state.minFilter=this.parameters.minFilter),this.parameters.magFilter!==this._state.magFilter&&(this.renderer._isWebGL2||n(this._size.width)&&n(this._size.height)||(this.parameters.magFilter=this.gl.LINEAR),this.parameters.magFilter!==this.gl.LINEAR&&this.parameters.magFilter!==this.gl.NEAREST&&(this.renderer.production||i(this.type+": Wrong magFilter value",this.parameters.magFilter,"for this texture:",this,"\ngl.LINEAR filtering will be used instead"),this.parameters.magFilter=this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.parameters.magFilter),this._state.magFilter=this.parameters.magFilter);var e=this.renderer.extensions.EXT_texture_filter_anisotropic;if(e&&this.parameters.anisotropy!==this._state.anisotropy){var t=this.gl.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT);this.parameters.anisotropy=Math.max(1,Math.min(this.parameters.anisotropy,t)),this.gl.texParameterf(this.gl.TEXTURE_2D,e.TEXTURE_MAX_ANISOTROPY_EXT,this.parameters.anisotropy),this._state.anisotropy=this.parameters.anisotropy}}},{key:"setWrapS",value:function(e){this.parameters.wrapS!==e&&(this.parameters.wrapS=e,this.parameters._shouldUpdate=!0)}},{key:"setWrapT",value:function(e){this.parameters.wrapT!==e&&(this.parameters.wrapT=e,this.parameters._shouldUpdate=!0)}},{key:"setMinFilter",value:function(e){this.parameters.minFilter!==e&&(this.parameters.minFilter=e,this.parameters._shouldUpdate=!0)}},{key:"setMagFilter",value:function(e){this.parameters.magFilter!==e&&(this.parameters.magFilter=e,this.parameters._shouldUpdate=!0)}},{key:"setAnisotropy",value:function(e){e=isNaN(e)?this.parameters.anisotropy:e,this.parameters.anisotropy!==e&&(this.parameters.anisotropy=e,this.parameters._shouldUpdate=!0)}},{key:"needUpdate",value:function(){this._forceUpdate=!0}},{key:"_videoFrameCallback",value:function(){var e=this;this._willUpdate=!0,this.source.requestVideoFrameCallback((function(){return e._videoFrameCallback()}))}},{key:"_upload",value:function(){var e=this;this._updateGlobalTexParameters(),this.source?this.gl.texImage2D(this.gl.TEXTURE_2D,0,this._globalParameters.internalFormat,this._globalParameters.format,this._globalParameters.type,this.source):"fbo"===this.sourceType&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,this._globalParameters.internalFormat,this._size.width,this._size.height,0,this._globalParameters.format,this._globalParameters.type,this.source||null),this._uploaded||(this.renderer.nextRender.add((function(){return e._onSourceUploadedCallback&&e._onSourceUploadedCallback()})),this._uploaded=!0)}},{key:"_getSizes",value:function(){if("fbo"===this.sourceType)return{parentWidth:this._parent._boundingRect.document.width,parentHeight:this._parent._boundingRect.document.height,sourceWidth:this._parent._boundingRect.document.width,sourceHeight:this._parent._boundingRect.document.height,xOffset:0,yOffset:0};var e=this._parent.scale?T.set(this._parent.scale.x,this._parent.scale.y):T.set(1,1),t=this._parent._boundingRect.document.width*e.x,i=this._parent._boundingRect.document.height*e.y,r=this._size.width,s=this._size.height,n=r/s,a=t/i,o=0,h=0;return a>n?h=Math.min(0,i-t*(1/n)):a<n&&(o=Math.min(0,t-i*n)),{parentWidth:t,parentHeight:i,sourceWidth:r,sourceHeight:s,xOffset:o,yOffset:h}}},{key:"setScale",value:function(e){e.type&&"Vec2"===e.type?(e.sanitizeNaNValuesWith(this.scale).max(T.set(.001,.001)),e.equals(this.scale)||(this.scale.copy(e),this.resize())):this.renderer.production||i(this.type+": Cannot set scale because the parameter passed is not of Vec2 type:",e)}},{key:"setOffset",value:function(e){e.type&&"Vec2"===e.type?(e.sanitizeNaNValuesWith(this.offset),e.equals(this.offset)||(this.offset.copy(e),this.resize())):this.renderer.production||i(this.type+": Cannot set offset because the parameter passed is not of Vec2 type:",scale)}},{key:"_setSize",value:function(){if(this._parent&&this._parent._program){var e=this._getSizes();this._updateTextureMatrix(e)}}},{key:"resize",value:function(){"fbo"===this.sourceType?(this._size={width:this._parent._size&&this._parent._size.width||this._parent._boundingRect.document.width,height:this._parent._size&&this._parent._size.height||this._parent._boundingRect.document.height},this._copiedFrom||(this.gl.bindTexture(this.gl.TEXTURE_2D,this._sampler.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this._globalParameters.internalFormat,this._size.width,this._size.height,0,this._globalParameters.format,this._globalParameters.type,null))):this.source&&(this._size={width:this.source.naturalWidth||this.source.width||this.source.videoWidth,height:this.source.naturalHeight||this.source.height||this.source.videoHeight}),this._setSize()}},{key:"_updateTextureMatrix",value:function(e){var t=S.set(e.parentWidth/(e.parentWidth-e.xOffset),e.parentHeight/(e.parentHeight-e.yOffset),1);t.x/=this.scale.x,t.y/=this.scale.y,this._textureMatrix.matrix=C.setFromArray([t.x,0,0,0,0,t.y,0,0,0,0,1,0,(1-t.x)/2+this.offset.x,(1-t.y)/2+this.offset.y,0,1]),this._updateMatrixUniform()}},{key:"_updateMatrixUniform",value:function(){this._textureMatrix.isActive&&(this.renderer.useProgram(this._parent._program),this.gl.uniformMatrix4fv(this._textureMatrix.location,!1,this._textureMatrix.matrix.elements))}},{key:"_onSourceLoaded",value:function(e){this.setSource(e),"image"===this.sourceType&&this.renderer.cache.addTexture(this)}},{key:"_bindTexture",value:function(){this._canDraw&&(this.renderer.state.activeTexture!==this.index&&(this.gl.activeTexture(this.gl.TEXTURE0+this.index),this.renderer.state.activeTexture=this.index),this.gl.bindTexture(this.gl.TEXTURE_2D,this._sampler.texture),this._sampler.isTextureBound||(this._sampler.isTextureBound=!!this.gl.getParameter(this.gl.TEXTURE_BINDING_2D),this._sampler.isTextureBound&&this.renderer.needRender()))}},{key:"_draw",value:function(){this._sampler.isActive&&(this._bindTexture(),"video"===this.sourceType&&this.source&&!this._videoFrameCallbackID&&this.source.readyState>=this.source.HAVE_CURRENT_DATA&&!this.source.paused&&(this._willUpdate=!0),(this._forceUpdate||this._willUpdate&&this.shouldUpdate)&&(this._state.generateMipmap=!1,this._upload()),"video"===this.sourceType&&(this._willUpdate=!1),this._forceUpdate=!1),this.parameters._shouldUpdate&&(this._updateTexParameters(),this.parameters._shouldUpdate=!1)}},{key:"onSourceLoaded",value:function(e){return e&&(this._onSourceLoadedCallback=e),this}},{key:"onSourceUploaded",value:function(e){return e&&(this._onSourceUploadedCallback=e),this}},{key:"_dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];"video"===this.sourceType||"image"===this.sourceType&&!this.renderer.state.isActive?(this._loader&&this._loader._removeSource(this),this.source=null):"canvas"===this.sourceType&&(this.source.width=this.source.width,this.source=null),this._parent=null;var t=this.gl&&!this._copiedFrom&&(e||"image"!==this.sourceType||!this.renderer.state.isActive);t&&(this._canDraw=!1,this.renderer.cache.removeTexture(this),this.gl.activeTexture(this.gl.TEXTURE0+this.index),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.deleteTexture(this._sampler.texture))}}]),e}(),M=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"anonymous";if(_classCallCheck(this,e),this.type="TextureLoader",(t=t&&t.renderer||t)&&"Renderer"===t.type){if(!t.gl)return void r(this.type+": Renderer WebGL context is undefined",t)}else r(this.type+": Renderer not passed as first argument",t);this.renderer=t,this.gl=this.renderer.gl,this.crossOrigin=i,this.elements=[]}return _createClass(e,[{key:"_addElement",value:function(e,t,i,r){var s={source:e,texture:t,load:this._sourceLoaded.bind(this,e,t,i),error:this._sourceLoadError.bind(this,e,r)};return this.elements.push(s),s}},{key:"_sourceLoadError",value:function(e,t,i){t&&t(e,i)}},{key:"_sourceLoaded",value:function(e,t,i){var r=this;t._sourceLoaded||(t._onSourceLoaded(e),this._parent&&(this._increment&&this._increment(),this.renderer.nextRender.add((function(){return r._parent._onLoadingCallback&&r._parent._onLoadingCallback(t)}))),i&&i(t))}},{key:"_getSourceType",value:function(e){var t;return"string"==typeof e?null!==e.match(/\.(jpeg|jpg|jfif|pjpeg|pjp|gif|bmp|png|webp|svg|avif|apng)$/)?t="image":null!==e.match(/\.(webm|mp4|mpg|mpeg|avi|ogg|ogm|ogv|mov|av1)$/)&&(t="video"):"IMG"===e.tagName.toUpperCase()?t="image":"VIDEO"===e.tagName.toUpperCase()?t="video":"CANVAS"===e.tagName.toUpperCase()&&(t="canvas"),t}},{key:"_createImage",value:function(e){if("string"!=typeof e&&e.hasAttribute("crossOrigin"))return e;var t=new Image;return t.crossOrigin=this.crossOrigin,"string"==typeof e?t.src=e:(t.src=e.src,e.hasAttribute("data-sampler")&&t.setAttribute("data-sampler",e.getAttribute("data-sampler"))),t}},{key:"_createVideo",value:function(e){if("string"==typeof e||null===e.getAttribute("crossOrigin")){var t=document.createElement("video");return t.crossOrigin=this.crossOrigin,"string"==typeof e?t.src=e:(t.src=e.src,e.hasAttribute("data-sampler")&&t.setAttribute("data-sampler",e.getAttribute("data-sampler"))),t}return e}},{key:"loadSource",value:function(e,t,i,r){switch(this._getSourceType(e)){case"image":this.loadImage(e,t,i,r);break;case"video":this.loadVideo(e,t,i,r);break;case"canvas":this.loadCanvas(e,t,i);break;default:this._sourceLoadError(e,r,"this source could not be converted into a texture: "+e)}}},{key:"loadSources",value:function(e,t,i,r){for(var s=0;s<e.length;s++)this.loadSource(e[s],t,i,r)}},{key:"loadImage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=this.renderer.cache.getTextureFromSource(e),n=Object.assign({},t);if(this._parent&&(n=Object.assign(n,this._parent._texturesOptions)),n.loader=this,s){n.sampler="string"!=typeof e&&e.hasAttribute("data-sampler")?e.getAttribute("data-sampler"):n.sampler,n.fromTexture=s;var a=new E(this.renderer,n);return this._sourceLoaded(s.source,a,i),void(this._parent&&this._addToParent(a,s.source,"image"))}var o=this._createImage(e);n.sampler=o.hasAttribute("data-sampler")?o.getAttribute("data-sampler"):n.sampler;var h=new E(this.renderer,n),l=this._addElement(o,h,i,r);o.complete?this._sourceLoaded(o,h,i):o.decode?o.decode().then(this._sourceLoaded.bind(this,o,h,i)).catch((function(){o.addEventListener("load",l.load,!1),o.addEventListener("error",l.error,!1)})):(o.addEventListener("load",l.load,!1),o.addEventListener("error",l.error,!1)),this._parent&&this._addToParent(h,o,"image")}},{key:"loadImages",value:function(e,t,i,r){for(var s=0;s<e.length;s++)this.loadImage(e[s],t,i,r)}},{key:"loadVideo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=this._createVideo(e);s.preload=!0,s.muted=!0,s.loop=!0,s.setAttribute("playsinline",""),s.crossOrigin=this.crossOrigin;var n=Object.assign({},t);this._parent&&(n=Object.assign(t,this._parent._texturesOptions)),n.loader=this,n.sampler=s.hasAttribute("data-sampler")?s.getAttribute("data-sampler"):n.sampler;var a=new E(this.renderer,n),o=this._addElement(s,a,i,r);s.addEventListener("canplaythrough",o.load,!1),s.addEventListener("error",o.error,!1),s.readyState>=s.HAVE_FUTURE_DATA&&i&&this._sourceLoaded(s,a,i),s.load(),this._addToParent&&this._addToParent(a,s,"video"),"requestVideoFrameCallback"in HTMLVideoElement.prototype&&(o.videoFrameCallback=a._videoFrameCallback.bind(a),a._videoFrameCallbackID=s.requestVideoFrameCallback(o.videoFrameCallback))}},{key:"loadVideos",value:function(e,t,i,r){for(var s=0;s<e.length;s++)this.loadVideo(e[s],t,i,r)}},{key:"loadCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=Object.assign({},t);this._parent&&(r=Object.assign(t,this._parent._texturesOptions)),r.loader=this,r.sampler=e.hasAttribute("data-sampler")?e.getAttribute("data-sampler"):r.sampler;var s=new E(this.renderer,r);this._addElement(e,s,i,null),this._sourceLoaded(e,s,i),this._parent&&this._addToParent(s,e,"canvas")}},{key:"loadCanvases",value:function(e,t,i){for(var r=0;r<e.length;r++)this.loadCanvas(e[r],t,i)}},{key:"_removeSource",value:function(e){var t=this.elements.find((function(t){return t.texture.uuid===e.uuid}));t&&("image"===e.sourceType?t.source.removeEventListener("load",t.load,!1):"video"===e.sourceType&&(t.videoFrameCallback&&e._videoFrameCallbackID&&t.source.cancelVideoFrameCallback(e._videoFrameCallbackID),t.source.removeEventListener("canplaythrough",t.load,!1),t.source.pause(),t.source.removeAttribute("src"),t.source.load()),t.source.removeEventListener("error",t.error,!1))}}]),e}(),A=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,s){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.sourcesLoaded,h=void 0===o?0:o,l=a.sourcesToLoad,u=void 0===l?0:l,d=a.complete,c=void 0!==d&&d,p=a.onComplete,f=void 0===p?function(){}:p;return _classCallCheck(this,r),(n=t.call(this,e,s.crossOrigin)).type="PlaneTextureLoader",n._parent=s,"Plane"!==n._parent.type&&"PingPongPlane"!==n._parent.type&&"ShaderPass"!==n._parent.type&&(i(n.type+": Wrong parent type assigned to this loader"),n._parent=null),n.sourcesLoaded=h,n.sourcesToLoad=u,n.complete=c,n.onComplete=f,n}return _createClass(r,[{key:"_setLoaderSize",value:function(e){var t=this;this.sourcesToLoad=e,0===this.sourcesToLoad&&(this.complete=!0,this.renderer.nextRender.add((function(){return t.onComplete&&t.onComplete()})))}},{key:"_increment",value:function(){var e=this;this.sourcesLoaded++,this.sourcesLoaded>=this.sourcesToLoad&&!this.complete&&(this.complete=!0,this.renderer.nextRender.add((function(){return e.onComplete&&e.onComplete()})))}},{key:"_addSourceToParent",value:function(e,t){if("image"===t){var i=this._parent.images;!i.find((function(t){return t.src===e.src}))&&i.push(e)}else if("video"===t){var r=this._parent.videos;!r.find((function(t){return t.src===e.src}))&&r.push(e)}else if("canvas"===t){var s=this._parent.canvases;!s.find((function(t){return t.isSameNode(e)}))&&s.push(e)}}},{key:"_addToParent",value:function(e,t,i){this._addSourceToParent(t,i),this._parent&&e.addParent(this._parent)}}]),r}(M),F=function(){function e(t){var i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Mesh",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.vertexShaderID,o=n.fragmentShaderID,h=n.vertexShader,l=n.fragmentShader,u=n.uniforms,d=void 0===u?{}:u,c=n.widthSegments,p=void 0===c?1:c,f=n.heightSegments,g=void 0===f?1:f,_=n.renderOrder,m=void 0===_?0:_,v=n.depthTest,y=void 0===v||v,x=n.cullFace,R=void 0===x?"back":x,P=n.texturesOptions,w=void 0===P?{}:P,T=n.crossOrigin,S=void 0===T?"anonymous":T;if(_classCallCheck(this,e),this.type=s,(t=t&&t.renderer||t)&&"Renderer"===t.type||(r(this.type+": Curtains not passed as first argument or Curtains Renderer is missing",t),setTimeout((function(){i._onErrorCallback&&i._onErrorCallback()}),0)),this.renderer=t,this.gl=this.renderer.gl,!this.gl)return this.renderer.production||r(this.type+": Unable to create a "+this.type+" because the Renderer WebGL context is not defined"),void setTimeout((function(){i._onErrorCallback&&i._onErrorCallback()}),0);this._canDraw=!1,this.renderOrder=m,this._depthTest=y,this.cullFace=R,"back"!==this.cullFace&&"front"!==this.cullFace&&"none"!==this.cullFace&&(this.cullFace="back"),this.textures=[],this._texturesOptions=Object.assign({premultiplyAlpha:!1,anisotropy:1,floatingPoint:"none",wrapS:this.gl.CLAMP_TO_EDGE,wrapT:this.gl.CLAMP_TO_EDGE,minFilter:this.gl.LINEAR,magFilter:this.gl.LINEAR},w),this.crossOrigin=S,!h&&a&&document.getElementById(a)&&(h=document.getElementById(a).innerHTML),!l&&o&&document.getElementById(o)&&(l=document.getElementById(o).innerHTML),this._initMesh(),p=parseInt(p),g=parseInt(g),this._geometry=new k(this.renderer,{width:p,height:g}),this._program=new b(this.renderer,{parent:this,vertexShader:h,fragmentShader:l}),this._program.compiled?(this._program.createUniforms(d),this.uniforms=this._program.uniformsManager.uniforms,this._geometry.setProgram(this._program),this.renderer.onSceneChange()):this.renderer.nextRender.add((function(){return i._onErrorCallback&&i._onErrorCallback()}))}return _createClass(e,[{key:"_initMesh",value:function(){var e=this;this.uuid=s(),this.loader=new A(this.renderer,this,{sourcesLoaded:0,initSourcesToLoad:0,complete:!1,onComplete:function(){e._onReadyCallback&&e._onReadyCallback(),e.renderer.needRender()}}),this.images=[],this.videos=[],this.canvases=[],this.userData={},this._canDraw=!0}},{key:"_restoreContext",value:function(){this._canDraw=!1,this._matrices&&(this._matrices=null),this._program=new b(this.renderer,{parent:this,vertexShader:this._program.vsCode,fragmentShader:this._program.fsCode}),this._program.compiled&&(this._geometry.restoreContext(this._program),this._program.createUniforms(this.uniforms),this.uniforms=this._program.uniformsManager.uniforms,this._programRestored())}},{key:"setRenderTarget",value:function(e){e&&"RenderTarget"===e.type?("Plane"===this.type&&this.renderer.scene.removePlane(this),this.target=e,"Plane"===this.type&&this.renderer.scene.addPlane(this)):this.renderer.production||i(this.type+": Could not set the render target because the argument passed is not a RenderTarget class object",e)}},{key:"setRenderOrder",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(e=isNaN(e)?this.renderOrder:parseInt(e))!==this.renderOrder&&(this.renderOrder=e,this.renderer.scene.setPlaneRenderOrder(this))}},{key:"createTexture",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new E(this.renderer,Object.assign(e,this._texturesOptions));return t.addParent(this),t}},{key:"addTexture",value:function(e){e&&"Texture"===e.type?e.addParent(this):this.renderer.production||i(this.type+": cannot add ",e," to this "+this.type+" because it is not a valid texture")}},{key:"loadSources",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=0;s<e.length;s++)this.loadSource(e[s],t,i,r)}},{key:"loadSource",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.loader.loadSource(e,Object.assign(r,this._texturesOptions),(function(e){s&&s(e)}),(function(e,r){t.renderer.production||i(t.type+": this HTML tag could not be converted into a texture:",e.tagName),n&&n(e,r)}))}},{key:"loadImage",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.loader.loadImage(e,Object.assign(r,this._texturesOptions),(function(e){s&&s(e)}),(function(e,r){t.renderer.production||i(t.type+": There has been an error:\n",r,"\nwhile loading this image:\n",e),n&&n(e,r)}))}},{key:"loadVideo",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.loader.loadVideo(e,Object.assign(r,this._texturesOptions),(function(e){s&&s(e)}),(function(e,r){t.renderer.production||i(t.type+": There has been an error:\n",r,"\nwhile loading this video:\n",e),n&&n(e,r)}))}},{key:"loadCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;this.loader.loadCanvas(e,Object.assign(t,this._texturesOptions),(function(e){i&&i(e)}))}},{key:"loadImages",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=0;s<e.length;s++)this.loadImage(e[s],t,i,r)}},{key:"loadVideos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=0;s<e.length;s++)this.loadVideo(e[s],t,i,r)}},{key:"loadCanvases",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=0;r<e.length;r++)this.loadCanvas(e[r],t,i)}},{key:"playVideos",value:function(){for(var e=this,t=0;t<this.textures.length;t++){var r=this.textures[t];if("video"===r.sourceType){var s=r.source.play();void 0!==s&&s.catch((function(t){e.renderer.production||i(e.type+": Could not play the video:",t)}))}}}},{key:"_draw",value:function(){this.renderer.setDepthTest(this._depthTest),this.renderer.setFaceCulling(this.cullFace),this._program.updateUniforms(),this._geometry.bindBuffers(),this.renderer.state.forceBufferUpdate=!1;for(var e=0;e<this.textures.length;e++)if(this.textures[e]._draw(),this.textures[e]._sampler.isActive&&!this.textures[e]._sampler.isTextureBound)return;this._geometry.draw(),this.renderer.state.activeTexture=null,this._onAfterRenderCallback&&this._onAfterRenderCallback()}},{key:"onError",value:function(e){return e&&(this._onErrorCallback=e),this}},{key:"onLoading",value:function(e){return e&&(this._onLoadingCallback=e),this}},{key:"onReady",value:function(e){return e&&(this._onReadyCallback=e),this}},{key:"onRender",value:function(e){return e&&(this._onRenderCallback=e),this}},{key:"onAfterRender",value:function(e){return e&&(this._onAfterRenderCallback=e),this}},{key:"remove",value:function(){this._canDraw=!1,this.target&&this.renderer.bindFrameBuffer(null),this._dispose(),"Plane"===this.type?this.renderer.removePlane(this):"ShaderPass"===this.type&&(this.target&&(this.target._shaderPass=null,this.target.remove(),this.target=null),this.renderer.removeShaderPass(this))}},{key:"_dispose",value:function(){if(this.gl){this._geometry&&this._geometry.dispose(),this.target&&"ShaderPass"===this.type&&(this.renderer.removeRenderTarget(this.target),this.textures.shift());for(var e=0;e<this.textures.length;e++)this.textures[e]._dispose();this.textures=[]}}}]),e}(),O=new P,D=new P,z=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,s){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"DOMMesh",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=o.widthSegments,l=o.heightSegments,u=o.renderOrder,d=o.depthTest,c=o.cullFace,p=o.uniforms,f=o.vertexShaderID,g=o.fragmentShaderID,_=o.vertexShader,m=o.fragmentShader,v=o.texturesOptions,y=o.crossOrigin;return _classCallCheck(this,r),f=f||s&&s.getAttribute("data-vs-id"),g=g||s&&s.getAttribute("data-fs-id"),(n=t.call(this,e,a,{widthSegments:h,heightSegments:l,renderOrder:u,depthTest:d,cullFace:c,uniforms:p,vertexShaderID:f,fragmentShaderID:g,vertexShader:_,fragmentShader:m,texturesOptions:v,crossOrigin:y})).gl?(n.htmlElement=s,n.htmlElement&&0!==n.htmlElement.length||n.renderer.production||i(n.type+": The HTML element you specified does not currently exists in the DOM"),n._setDocumentSizes(),n):_possibleConstructorReturn(n)}return _createClass(r,[{key:"_setDocumentSizes",value:function(){var e=this.htmlElement.getBoundingClientRect();this._boundingRect||(this._boundingRect={}),this._boundingRect.document={width:e.width*this.renderer.pixelRatio,height:e.height*this.renderer.pixelRatio,top:e.top*this.renderer.pixelRatio,left:e.left*this.renderer.pixelRatio}}},{key:"getBoundingRect",value:function(){return{width:this._boundingRect.document.width,height:this._boundingRect.document.height,top:this._boundingRect.document.top,left:this._boundingRect.document.left,right:this._boundingRect.document.left+this._boundingRect.document.width,bottom:this._boundingRect.document.top+this._boundingRect.document.height}}},{key:"resize",value:function(){var e=this;this._setDocumentSizes(),"Plane"===this.type&&(this.setPerspective(this.camera.fov,this.camera.near,this.camera.far),this._setWorldSizes(),this._applyWorldPositions());for(var t=0;t<this.textures.length;t++)this.textures[t].resize();this.renderer.nextRender.add((function(){return e._onAfterResizeCallback&&e._onAfterResizeCallback()}))}},{key:"mouseToPlaneCoords",value:function(e){var t=this.scale?this.scale:D.set(1,1),i=O.set((this._boundingRect.document.width-this._boundingRect.document.width*t.x)/2,(this._boundingRect.document.height-this._boundingRect.document.height*t.y)/2),r=this._boundingRect.document.width*t.x/this.renderer.pixelRatio,s=this._boundingRect.document.height*t.y/this.renderer.pixelRatio,n=(this._boundingRect.document.top+i.y)/this.renderer.pixelRatio,a=(this._boundingRect.document.left+i.x)/this.renderer.pixelRatio;return O.set((e.x-a)/r*2-1,1-(e.y-n)/s*2)}},{key:"onAfterResize",value:function(e){return e&&(this._onAfterResizeCallback=e),this}}]),r}(F),L=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.fov,r=void 0===i?50:i,s=t.near,n=void 0===s?.1:s,a=t.far,o=void 0===a?150:a,h=t.width,l=t.height,u=t.pixelRatio,d=void 0===u?1:u;_classCallCheck(this,e),this.position=new w,this.projectionMatrix=new R,this.worldMatrix=new R,this.viewMatrix=new R,this._shouldUpdate=!1,this.setSize(),this.setPerspective(r,n,o,h,l,d)}return _createClass(e,[{key:"setFov",value:function(e){e=isNaN(e)?this.fov:parseFloat(e),(e=Math.max(1,Math.min(e,179)))!==this.fov&&(this.fov=e,this.setPosition(),this._shouldUpdate=!0),this.setCSSPerspective()}},{key:"setNear",value:function(e){e=isNaN(e)?this.near:parseFloat(e),(e=Math.max(e,.01))!==this.near&&(this.near=e,this._shouldUpdate=!0)}},{key:"setFar",value:function(e){e=isNaN(e)?this.far:parseFloat(e),(e=Math.max(e,50))!==this.far&&(this.far=e,this._shouldUpdate=!0)}},{key:"setPixelRatio",value:function(e){e!==this.pixelRatio&&(this._shouldUpdate=!0),this.pixelRatio=e}},{key:"setSize",value:function(e,t){e===this.width&&t===this.height||(this._shouldUpdate=!0),this.width=e,this.height=t}},{key:"setPerspective",value:function(e,t,i,r,s,n){this.setPixelRatio(n),this.setSize(r,s),this.setFov(e),this.setNear(t),this.setFar(i),this._shouldUpdate&&this.updateProjectionMatrix()}},{key:"setPosition",value:function(){this.position.set(0,0,1),this.worldMatrix.setFromArray([1,0,0,0,0,1,0,0,0,0,1,0,this.position.x,this.position.y,this.position.z,1]),this.viewMatrix=this.viewMatrix.copy(this.worldMatrix).getInverse()}},{key:"setCSSPerspective",value:function(){this.CSSPerspective=Math.pow(Math.pow(this.width/(2*this.pixelRatio),2)+Math.pow(this.height/(2*this.pixelRatio),2),.5)/Math.tan(.5*this.fov*Math.PI/180)}},{key:"getScreenRatiosFromFov",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.position.z;e<t?e-=t:e+=t;var i=this.fov*Math.PI/180,r=2*Math.tan(i/2)*Math.abs(e);return{width:r*this.width/this.height,height:r}}},{key:"updateProjectionMatrix",value:function(){var e=this.width/this.height,t=this.near*Math.tan(Math.PI/180*.5*this.fov),i=2*t,r=e*i,s=-.5*r,n=s+r,a=t-i,o=2*this.near/(n-s),h=2*this.near/(t-a),l=(n+s)/(n-s),u=(t+a)/(t-a),d=-(this.far+this.near)/(this.far-this.near),c=-2*this.far*this.near/(this.far-this.near);this.projectionMatrix.setFromArray([o,0,0,0,0,h,0,0,l,u,d,-1,0,0,c,0])}},{key:"forceUpdate",value:function(){this._shouldUpdate=!0}},{key:"cancelUpdate",value:function(){this._shouldUpdate=!1}}]),e}(),U=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Float32Array([0,0,0,1]),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"XYZ";_classCallCheck(this,e),this.type="Quat",this.elements=t,this.axisOrder=i}return _createClass(e,[{key:"setFromArray",value:function(e){return this.elements[0]=e[0],this.elements[1]=e[1],this.elements[2]=e[2],this.elements[3]=e[3],this}},{key:"setAxisOrder",value:function(e){switch(e=e.toUpperCase()){case"XYZ":case"YXZ":case"ZXY":case"ZYX":case"YZX":case"XZY":this.axisOrder=e;break;default:this.axisOrder="XYZ"}return this}},{key:"copy",value:function(e){return this.elements=e.elements,this.axisOrder=e.axisOrder,this}},{key:"clone",value:function(){return(new e).copy(this)}},{key:"equals",value:function(e){return this.elements[0]===e.elements[0]&&this.elements[1]===e.elements[1]&&this.elements[2]===e.elements[2]&&this.elements[3]===e.elements[3]&&this.axisOrder===e.axisOrder}},{key:"setFromVec3",value:function(e){var t=.5*e.x,i=.5*e.y,r=.5*e.z,s=Math.cos(t),n=Math.cos(i),a=Math.cos(r),o=Math.sin(t),h=Math.sin(i),l=Math.sin(r);return"XYZ"===this.axisOrder?(this.elements[0]=o*n*a+s*h*l,this.elements[1]=s*h*a-o*n*l,this.elements[2]=s*n*l+o*h*a,this.elements[3]=s*n*a-o*h*l):"YXZ"===this.axisOrder?(this.elements[0]=o*n*a+s*h*l,this.elements[1]=s*h*a-o*n*l,this.elements[2]=s*n*l-o*h*a,this.elements[3]=s*n*a+o*h*l):"ZXY"===this.axisOrder?(this.elements[0]=o*n*a-s*h*l,this.elements[1]=s*h*a+o*n*l,this.elements[2]=s*n*l+o*h*a,this.elements[3]=s*n*a-o*h*l):"ZYX"===this.axisOrder?(this.elements[0]=o*n*a-s*h*l,this.elements[1]=s*h*a+o*n*l,this.elements[2]=s*n*l-o*h*a,this.elements[3]=s*n*a+o*h*l):"YZX"===this.axisOrder?(this.elements[0]=o*n*a+s*h*l,this.elements[1]=s*h*a+o*n*l,this.elements[2]=s*n*l-o*h*a,this.elements[3]=s*n*a-o*h*l):"XZY"===this.axisOrder&&(this.elements[0]=o*n*a-s*h*l,this.elements[1]=s*h*a-o*n*l,this.elements[2]=s*n*l+o*h*a,this.elements[3]=s*n*a+o*h*l),this}}]),e}(),I=new P,N=new w,V=new w,B=new w,W=new w,G=new w,X=new w,j=new w,H=new w,Y=new U,q=new w(.5,.5,0),Q=new w,Z=new w,K=new w,J=new w,$=new P,ee=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,i){var s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.widthSegments,o=n.heightSegments,h=n.renderOrder,l=n.depthTest,u=n.cullFace,d=n.uniforms,c=n.vertexShaderID,p=n.fragmentShaderID,f=n.vertexShader,g=n.fragmentShader,_=n.texturesOptions,m=n.crossOrigin,v=n.alwaysDraw,y=void 0!==v&&v,x=n.visible,b=void 0===x||x,k=n.transparent,R=void 0!==k&&k,P=n.drawCheckMargins,w=void 0===P?{top:0,right:0,bottom:0,left:0}:P,T=n.autoloadSources,S=void 0===T||T,C=n.watchScroll,E=void 0===C||C,M=n.fov,A=void 0===M?50:M;return _classCallCheck(this,r),(s=t.call(this,e,i,"Plane",{widthSegments:a,heightSegments:o,renderOrder:h,depthTest:l,cullFace:u,uniforms:d,vertexShaderID:c,fragmentShaderID:p,vertexShader:f,fragmentShader:g,texturesOptions:_,crossOrigin:m})).gl?(s.index=s.renderer.planes.length,s.target=null,s.alwaysDraw=y,s._shouldDraw=!0,s.visible=b,s._transparent=R,s.drawCheckMargins=w,s.autoloadSources=S,s.watchScroll=E,s._updateMVMatrix=!1,s.camera=new L({fov:A,width:s.renderer._boundingRect.width,height:s.renderer._boundingRect.height,pixelRatio:s.renderer.pixelRatio}),s._program.compiled&&(s._initPlane(),s.renderer.scene.addPlane(_assertThisInitialized(s)),s.renderer.planes.push(_assertThisInitialized(s))),s):_possibleConstructorReturn(s)}return _createClass(r,[{key:"_programRestored",value:function(){this.target&&this.setRenderTarget(this.renderer.renderTargets[this.target.index]),this._initMatrices(),this.setPerspective(this.camera.fov,this.camera.near,this.camera.far),this._setWorldSizes(),this._applyWorldPositions(),this.renderer.scene.addPlane(this);for(var e=0;e<this.textures.length;e++)this.textures[e]._parent=this,this.textures[e]._restoreContext();this._canDraw=!0}},{key:"_initPlane",value:function(){this._initTransformValues(),this._initPositions(),this.setPerspective(this.camera.fov,this.camera.near,this.camera.far),this._initSources()}},{key:"_initTransformValues",value:function(){var e=this;this.rotation=new w,this.rotation.onChange((function(){return e._applyRotation()})),this.quaternion=new U,this.relativeTranslation=new w,this.relativeTranslation.onChange((function(){return e._setTranslation()})),this._translation=new w,this.scale=new w(1),this.scale.onChange((function(){e.scale.z=1,e._applyScale()})),this.transformOrigin=new w(.5,.5,0),this.transformOrigin.onChange((function(){e._setWorldTransformOrigin(),e._updateMVMatrix=!0}))}},{key:"resetPlane",value:function(e){this._initTransformValues(),this._setWorldTransformOrigin(),null!==e&&e?(this.htmlElement=e,this.resize()):e||this.renderer.production||i(this.type+": You are trying to reset a plane with a HTML element that does not exist. The old HTML element will be kept instead.")}},{key:"removeRenderTarget",value:function(){this.target&&(this.renderer.scene.removePlane(this),this.target=null,this.renderer.scene.addPlane(this))}},{key:"_initPositions",value:function(){this._initMatrices(),this._setWorldSizes(),this._applyWorldPositions()}},{key:"_initMatrices",value:function(){var e=new R;this._matrices={world:{matrix:e},modelView:{name:"uMVMatrix",matrix:e,location:this.gl.getUniformLocation(this._program.program,"uMVMatrix")},projection:{name:"uPMatrix",matrix:e,location:this.gl.getUniformLocation(this._program.program,"uPMatrix")},modelViewProjection:{matrix:e}}}},{key:"_setPerspectiveMatrix",value:function(){this.camera._shouldUpdate&&(this.renderer.useProgram(this._program),this.gl.uniformMatrix4fv(this._matrices.projection.location,!1,this._matrices.projection.matrix.elements)),this.camera.cancelUpdate()}},{key:"setPerspective",value:function(e,t,i){this.camera.setPerspective(e,t,i,this.renderer._boundingRect.width,this.renderer._boundingRect.height,this.renderer.pixelRatio),this.renderer.state.isContextLost&&this.camera.forceUpdate(),this._matrices.projection.matrix=this.camera.projectionMatrix,this.camera._shouldUpdate&&(this._setWorldSizes(),this._applyWorldPositions(),this._translation.z=this.relativeTranslation.z/this.camera.CSSPerspective),this._updateMVMatrix=this.camera._shouldUpdate}},{key:"_setMVMatrix",value:function(){this._updateMVMatrix&&(this._matrices.world.matrix=this._matrices.world.matrix.composeFromOrigin(this._translation,this.quaternion,this.scale,this._boundingRect.world.transformOrigin),this._matrices.world.matrix.scale({x:this._boundingRect.world.width,y:this._boundingRect.world.height,z:1}),this._matrices.modelView.matrix.copy(this._matrices.world.matrix),this._matrices.modelView.matrix.elements[14]-=this.camera.position.z,this._matrices.modelViewProjection.matrix=this._matrices.projection.matrix.multiply(this._matrices.modelView.matrix),this.alwaysDraw||this._shouldDrawCheck(),this.renderer.useProgram(this._program),this.gl.uniformMatrix4fv(this._matrices.modelView.location,!1,this._matrices.modelView.matrix.elements)),this._updateMVMatrix=!1}},{key:"_setWorldTransformOrigin",value:function(){this._boundingRect.world.transformOrigin=new w((2*this.transformOrigin.x-1)*this._boundingRect.world.width,-(2*this.transformOrigin.y-1)*this._boundingRect.world.height,this.transformOrigin.z)}},{key:"_documentToWorldSpace",value:function(e){return V.set(e.x*this.renderer.pixelRatio/this.renderer._boundingRect.width*this._boundingRect.world.ratios.width,-e.y*this.renderer.pixelRatio/this.renderer._boundingRect.height*this._boundingRect.world.ratios.height,e.z)}},{key:"_setWorldSizes",value:function(){var e=this.camera.getScreenRatiosFromFov();this._boundingRect.world={width:this._boundingRect.document.width/this.renderer._boundingRect.width*e.width/2,height:this._boundingRect.document.height/this.renderer._boundingRect.height*e.height/2,ratios:e},this._setWorldTransformOrigin()}},{key:"_setWorldPosition",value:function(){var e=this._boundingRect.document.width/2+this._boundingRect.document.left,t=this._boundingRect.document.height/2+this._boundingRect.document.top,i=this.renderer._boundingRect.width/2+this.renderer._boundingRect.left,r=this.renderer._boundingRect.height/2+this.renderer._boundingRect.top;this._boundingRect.world.top=(r-t)/this.renderer._boundingRect.height*this._boundingRect.world.ratios.height,this._boundingRect.world.left=(e-i)/this.renderer._boundingRect.width*this._boundingRect.world.ratios.width}},{key:"setScale",value:function(e){e.type&&"Vec2"===e.type?(e.sanitizeNaNValuesWith(this.scale).max(I.set(.001,.001)),e.x===this.scale.x&&e.y===this.scale.y||(this.scale.set(e.x,e.y,1),this._applyScale())):this.renderer.production||i(this.type+": Cannot set scale because the parameter passed is not of Vec2 type:",e)}},{key:"_applyScale",value:function(){for(var e=0;e<this.textures.length;e++)this.textures[e].resize();this._updateMVMatrix=!0}},{key:"setRotation",value:function(e){e.type&&"Vec3"===e.type?(e.sanitizeNaNValuesWith(this.rotation),e.equals(this.rotation)||(this.rotation.copy(e),this._applyRotation())):this.renderer.production||i(this.type+": Cannot set rotation because the parameter passed is not of Vec3 type:",e)}},{key:"_applyRotation",value:function(){this.quaternion.setFromVec3(this.rotation),this._updateMVMatrix=!0}},{key:"setTransformOrigin",value:function(e){e.type&&"Vec3"===e.type?(e.sanitizeNaNValuesWith(this.transformOrigin),e.equals(this.transformOrigin)||(this.transformOrigin.copy(e),this._setWorldTransformOrigin(),this._updateMVMatrix=!0)):this.renderer.production||i(this.type+": Cannot set transform origin because the parameter passed is not of Vec3 type:",e)}},{key:"_setTranslation",value:function(){var e=N.set(0,0,0);this.relativeTranslation.equals(e)||(e=this._documentToWorldSpace(this.relativeTranslation)),this._translation.set(this._boundingRect.world.left+e.x,this._boundingRect.world.top+e.y,this.relativeTranslation.z/this.camera.CSSPerspective),this._updateMVMatrix=!0}},{key:"setRelativeTranslation",value:function(e){e.type&&"Vec3"===e.type?(e.sanitizeNaNValuesWith(this.relativeTranslation),e.equals(this.relativeTranslation)||(this.relativeTranslation.copy(e),this._setTranslation())):this.renderer.production||i(this.type+": Cannot set translation because the parameter passed is not of Vec3 type:",e)}},{key:"_applyWorldPositions",value:function(){this._setWorldPosition(),this._setTranslation()}},{key:"updatePosition",value:function(){this._setDocumentSizes(),this._applyWorldPositions()}},{key:"updateScrollPosition",value:function(e,t){(e||t)&&(this._boundingRect.document.top+=t*this.renderer.pixelRatio,this._boundingRect.document.left+=e*this.renderer.pixelRatio,this._applyWorldPositions())}},{key:"_getIntersection",value:function(e,t){for(var i=t.clone().sub(e),r=e.clone();r.z>-1;)r.add(i);return r}},{key:"_getNearPlaneIntersections",value:function(e,t,i){var r=this._matrices.modelViewProjection.matrix;if(1===i.length)0===i[0]?(t[0]=this._getIntersection(t[1],j.set(.95,1,0).applyMat4(r)),t.push(this._getIntersection(t[3],H.set(-1,-.95,0).applyMat4(r)))):1===i[0]?(t[1]=this._getIntersection(t[0],j.set(-.95,1,0).applyMat4(r)),t.push(this._getIntersection(t[2],H.set(1,-.95,0).applyMat4(r)))):2===i[0]?(t[2]=this._getIntersection(t[3],j.set(-.95,-1,0).applyMat4(r)),t.push(this._getIntersection(t[1],H.set(1,.95,0).applyMat4(r)))):3===i[0]&&(t[3]=this._getIntersection(t[2],j.set(.95,-1,0).applyMat4(r)),t.push(this._getIntersection(t[0],H.set(-1,.95,0).applyMat4(r))));else if(2===i.length)0===i[0]&&1===i[1]?(t[0]=this._getIntersection(t[3],j.set(-1,-.95,0).applyMat4(r)),t[1]=this._getIntersection(t[2],H.set(1,-.95,0).applyMat4(r))):1===i[0]&&2===i[1]?(t[1]=this._getIntersection(t[0],j.set(-.95,1,0).applyMat4(r)),t[2]=this._getIntersection(t[3],H.set(-.95,-1,0).applyMat4(r))):2===i[0]&&3===i[1]?(t[2]=this._getIntersection(t[1],j.set(1,.95,0).applyMat4(r)),t[3]=this._getIntersection(t[0],H.set(-1,.95,0).applyMat4(r))):0===i[0]&&3===i[1]&&(t[0]=this._getIntersection(t[1],j.set(.95,1,0).applyMat4(r)),t[3]=this._getIntersection(t[2],H.set(.95,-1,0).applyMat4(r)));else if(3===i.length){for(var s=0,n=0;n<e.length;n++)i.includes(n)||(s=n);t=[t[s]],0===s?(t.push(this._getIntersection(t[0],j.set(-.95,1,0).applyMat4(r))),t.push(this._getIntersection(t[0],H.set(-1,.95,0).applyMat4(r)))):1===s?(t.push(this._getIntersection(t[0],j.set(.95,1,0).applyMat4(r))),t.push(this._getIntersection(t[0],H.set(1,.95,0).applyMat4(r)))):2===s?(t.push(this._getIntersection(t[0],j.set(.95,-1,0).applyMat4(r))),t.push(this._getIntersection(t[0],H.set(1,-.95,0).applyMat4(r)))):3===s&&(t.push(this._getIntersection(t[0],j.set(-.95,-1,0).applyMat4(r))),t.push(this._getIntersection(t[0],H.set(-1.95,0).applyMat4(r))))}else for(var a=0;a<e.length;a++)t[a][0]=1e4,t[a][1]=1e4;return t}},{key:"_getWorldCoords",value:function(){for(var e=[B.set(-1,1,0),W.set(1,1,0),G.set(1,-1,0),X.set(-1,-1,0)],t=[],i=[],r=0;r<e.length;r++){var s=e[r].applyMat4(this._matrices.modelViewProjection.matrix);t.push(s),Math.abs(s.z)>1&&i.push(r)}i.length&&(t=this._getNearPlaneIntersections(e,t,i));for(var n=1/0,a=-1/0,o=1/0,h=-1/0,l=0;l<t.length;l++){var u=t[l];u.x<n&&(n=u.x),u.x>a&&(a=u.x),u.y<o&&(o=u.y),u.y>h&&(h=u.y)}return{top:h,right:a,bottom:o,left:n}}},{key:"_computeWebGLBoundingRect",value:function(){var e=this._getWorldCoords(),t={top:1-(e.top+1)/2,right:(e.right+1)/2,bottom:1-(e.bottom+1)/2,left:(e.left+1)/2};t.width=t.right-t.left,t.height=t.bottom-t.top,this._boundingRect.worldToDocument={width:t.width*this.renderer._boundingRect.width,height:t.height*this.renderer._boundingRect.height,top:t.top*this.renderer._boundingRect.height+this.renderer._boundingRect.top,left:t.left*this.renderer._boundingRect.width+this.renderer._boundingRect.left,right:t.left*this.renderer._boundingRect.width+this.renderer._boundingRect.left+t.width*this.renderer._boundingRect.width,bottom:t.top*this.renderer._boundingRect.height+this.renderer._boundingRect.top+t.height*this.renderer._boundingRect.height}}},{key:"getWebGLBoundingRect",value:function(){return this._matrices.modelViewProjection?(this._boundingRect.worldToDocument&&!this.alwaysDraw||this._computeWebGLBoundingRect(),this._boundingRect.worldToDocument):this._boundingRect.document}},{key:"_getWebGLDrawRect",value:function(){return this._computeWebGLBoundingRect(),{top:this._boundingRect.worldToDocument.top-this.drawCheckMargins.top,right:this._boundingRect.worldToDocument.right+this.drawCheckMargins.right,bottom:this._boundingRect.worldToDocument.bottom+this.drawCheckMargins.bottom,left:this._boundingRect.worldToDocument.left-this.drawCheckMargins.left}}},{key:"_shouldDrawCheck",value:function(){var e=this,t=this._getWebGLDrawRect();Math.round(t.right)<=this.renderer._boundingRect.left||Math.round(t.left)>=this.renderer._boundingRect.left+this.renderer._boundingRect.width||Math.round(t.bottom)<=this.renderer._boundingRect.top||Math.round(t.top)>=this.renderer._boundingRect.top+this.renderer._boundingRect.height?this._shouldDraw&&(this._shouldDraw=!1,this.renderer.nextRender.add((function(){return e._onLeaveViewCallback&&e._onLeaveViewCallback()}))):(this._shouldDraw||this.renderer.nextRender.add((function(){return e._onReEnterViewCallback&&e._onReEnterViewCallback()})),this._shouldDraw=!0)}},{key:"isDrawn",value:function(){return this._canDraw&&this.visible&&(this._shouldDraw||this.alwaysDraw)}},{key:"enableDepthTest",value:function(e){this._depthTest=e}},{key:"_initSources",value:function(){var e=0;if(this.autoloadSources){var t=this.htmlElement.getElementsByTagName("img"),i=this.htmlElement.getElementsByTagName("video"),r=this.htmlElement.getElementsByTagName("canvas");t.length&&this.loadImages(t),i.length&&this.loadVideos(i),r.length&&this.loadCanvases(r),e=t.length+i.length+r.length}this.loader._setLoaderSize(e),this._canDraw=!0}},{key:"_startDrawing",value:function(){this._canDraw&&(this._onRenderCallback&&this._onRenderCallback(),this.target?this.renderer.bindFrameBuffer(this.target):null===this.renderer.state.scenePassIndex&&this.renderer.bindFrameBuffer(null),this._setPerspectiveMatrix(),this._setMVMatrix(),(this.alwaysDraw||this._shouldDraw)&&this.visible&&this._draw())}},{key:"mouseToPlaneCoords",value:function(e){if(Y.setAxisOrder(this.quaternion.axisOrder),Y.equals(this.quaternion)&&q.equals(this.transformOrigin))return _get(_getPrototypeOf(r.prototype),"mouseToPlaneCoords",this).call(this,e);var t={x:e.x/(this.renderer._boundingRect.width/this.renderer.pixelRatio)*2-1,y:2*(1-e.y/(this.renderer._boundingRect.height/this.renderer.pixelRatio))-1},i=this.camera.position.clone(),s=Q.set(t.x,t.y,-.5);s.unproject(this.camera),s.sub(i).normalize();var n=Z.set(0,0,-1);n.applyQuat(this.quaternion).normalize();var a=J.set(0,0,0),o=n.dot(s);if(Math.abs(o)>=1e-4){var h=this._matrices.world.matrix.getInverse().multiply(this.camera.viewMatrix),l=this._boundingRect.world.transformOrigin.clone().add(this._translation),u=K.set(this._translation.x-l.x,this._translation.y-l.y,this._translation.z-l.z);u.applyQuat(this.quaternion),l.add(u);var d=n.dot(l.clone().sub(i))/o;a.copy(i.add(s.multiplyScalar(d))),a.applyMat4(h)}else a.set(1/0,1/0,1/0);return $.set(a.x,a.y)}},{key:"onReEnterView",value:function(e){return e&&(this._onReEnterViewCallback=e),this}},{key:"onLeaveView",value:function(e){return e&&(this._onLeaveViewCallback=e),this}}]),r}(z),te=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.shaderPass,a=i.depth,o=void 0!==a&&a,h=i.clear,l=void 0===h||h,u=i.maxWidth,d=i.maxHeight,c=i.minWidth,p=void 0===c?1024:c,f=i.minHeight,g=void 0===f?1024:f,_=i.texturesOptions,m=void 0===_?{}:_;if(_classCallCheck(this,e),this.type="RenderTarget",(t=t&&t.renderer||t)&&"Renderer"===t.type){if(!t.gl)return void(t.production||r(this.type+": Unable to create a "+this.type+" because the Renderer WebGL context is not defined"))}else r(this.type+": Renderer not passed as first argument",t);this.renderer=t,this.gl=this.renderer.gl,this.index=this.renderer.renderTargets.length,this._shaderPass=n,this._depth=o,this._shouldClear=l,this._maxSize={width:u?Math.min(this.renderer.state.maxTextureSize/4,u):this.renderer.state.maxTextureSize/4,height:d?Math.min(this.renderer.state.maxTextureSize/4,d):this.renderer.state.maxTextureSize/4},this._minSize={width:p*this.renderer.pixelRatio,height:g*this.renderer.pixelRatio},m=Object.assign({sampler:"uRenderTexture",isFBOTexture:!0,premultiplyAlpha:!1,anisotropy:1,generateMipmap:!1,floatingPoint:"none",wrapS:this.gl.CLAMP_TO_EDGE,wrapT:this.gl.CLAMP_TO_EDGE,minFilter:this.gl.LINEAR,magFilter:this.gl.LINEAR},m),this._texturesOptions=m,this.userData={},this.uuid=s(),this.renderer.renderTargets.push(this),this.renderer.onSceneChange(),this._initRenderTarget()}return _createClass(e,[{key:"_initRenderTarget",value:function(){this._setSize(),this.textures=[],this._createFrameBuffer()}},{key:"_restoreContext",value:function(){this._setSize(),this._createFrameBuffer()}},{key:"_setSize",value:function(){this._shaderPass&&this._shaderPass._isScenePass?this._size={width:this.renderer._boundingRect.width,height:this.renderer._boundingRect.height}:this._size={width:Math.min(this._maxSize.width,Math.max(this._minSize.width,this.renderer._boundingRect.width)),height:Math.min(this._maxSize.height,Math.max(this._minSize.height,this.renderer._boundingRect.height))}}},{key:"resize",value:function(){this._shaderPass&&(this._setSize(),this.textures[0].resize(),this.renderer.bindFrameBuffer(this,!0),this._depth&&this._bindDepthBuffer(),this.renderer.bindFrameBuffer(null))}},{key:"_bindDepthBuffer",value:function(){this._depthBuffer&&(this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,this._depthBuffer),this.gl.renderbufferStorage(this.gl.RENDERBUFFER,this.gl.DEPTH_COMPONENT16,this._size.width,this._size.height),this.gl.framebufferRenderbuffer(this.gl.FRAMEBUFFER,this.gl.DEPTH_ATTACHMENT,this.gl.RENDERBUFFER,this._depthBuffer))}},{key:"_createFrameBuffer",value:function(){(this._frameBuffer=this.gl.createFramebuffer(),this.renderer.bindFrameBuffer(this,!0),this.textures.length)?(this.textures[0]._parent=this,this.textures[0]._restoreContext()):new E(this.renderer,this._texturesOptions).addParent(this);this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this.textures[0]._sampler.texture,0),this._depth&&(this._depthBuffer=this.gl.createRenderbuffer(),this._bindDepthBuffer()),this.renderer.bindFrameBuffer(null)}},{key:"getTexture",value:function(){return this.textures[0]}},{key:"remove",value:function(){this._shaderPass?this.renderer.production||i(this.type+": You're trying to remove a RenderTarget attached to a ShaderPass. You should remove that ShaderPass instead:",this._shaderPass):(this._dispose(),this.renderer.removeRenderTarget(this))}},{key:"_dispose",value:function(){this._frameBuffer&&(this.gl.deleteFramebuffer(this._frameBuffer),this._frameBuffer=null),this._depthBuffer&&(this.gl.deleteRenderbuffer(this._depthBuffer),this._depthBuffer=null),this.textures[0]._dispose(),this.textures=[]}}]),e}(),ie=function(e){_inherits(i,e);var t=_createSuper(i);function i(e){var r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=s.widthSegments,a=s.heightSegments,o=s.renderOrder,h=s.depthTest,l=s.cullFace,u=s.uniforms,d=s.vertexShaderID,c=s.fragmentShaderID,p=s.vertexShader,f=s.fragmentShader,g=s.texturesOptions,_=s.crossOrigin,m=s.depth,v=void 0!==m&&m,y=s.clear,x=void 0===y||y,b=s.renderTarget;return _classCallCheck(this,i),n=1,a=1,l="back",(r=t.call(this,e,e.container,"ShaderPass",{widthSegments:n,heightSegments:a,renderOrder:o,depthTest:h,cullFace:l,uniforms:u,vertexShaderID:d,fragmentShaderID:c,vertexShader:p,fragmentShader:f,texturesOptions:g,crossOrigin:_})).gl?(r._isScenePass=!0,r.index=r.renderer.shaderPasses.length,r._depth=v,r._shouldClear=x,r.target=b,r.target&&(r._isScenePass=!1,r._shouldClear=r.target._shouldClear),r._program.compiled&&(r._initShaderPass(),r.renderer.shaderPasses.push(_assertThisInitialized(r)),r.renderer.nextRender.add((function(){r.renderer.scene.addShaderPass(_assertThisInitialized(r))}))),r):_possibleConstructorReturn(r)}return _createClass(i,[{key:"_programRestored",value:function(){this.renderer.scene.addShaderPass(this);for(var e=0;e<this.textures.length;e++)this.textures[e]._parent=this,this.textures[e]._restoreContext();this._canDraw=!0}},{key:"_initShaderPass",value:function(){this.target?(this.setRenderTarget(this.target),this.target._shaderPass=this):this._createFrameBuffer(),new E(this.renderer,{sampler:"uRenderTexture",isFBOTexture:!0,fromTexture:this.target.getTexture()}).addParent(this),this.loader._setLoaderSize(0),this._canDraw=!0,this.renderer.needRender()}},{key:"_createFrameBuffer",value:function(){var e=new te(this.renderer,{shaderPass:this,clear:this._shouldClear,depth:this._depth,texturesOptions:this._texturesOptions});this.setRenderTarget(e)}},{key:"_startDrawing",value:function(){this._canDraw&&(this._onRenderCallback&&this._onRenderCallback(),this._isScenePass?this.renderer.state.scenePassIndex+1<this.renderer.scene.stacks.scenePasses.length?(this.renderer.bindFrameBuffer(this.renderer.scene.stacks.scenePasses[this.renderer.state.scenePassIndex+1].target),this.renderer.state.scenePassIndex++):this.renderer.bindFrameBuffer(null):null===this.renderer.state.scenePassIndex&&this.renderer.bindFrameBuffer(null),this.renderer.state.forceBufferUpdate=!0,this._draw())}}]),i}(z),re=function(e){_inherits(i,e);var t=_createSuper(i);function i(e,r){var s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.sampler,o=void 0===a?"uPingPongTexture":a,h=n.widthSegments,l=n.heightSegments,u=n.renderOrder,d=n.depthTest,c=n.cullFace,p=n.uniforms,f=n.vertexShaderID,g=n.fragmentShaderID,_=n.vertexShader,m=n.fragmentShader,v=n.texturesOptions,y=n.crossOrigin,x=n.alwaysDraw,b=n.visible,k=n.transparent,R=n.drawCheckMargins,P=n.autoloadSources,w=n.watchScroll,T=n.fov;if(_classCallCheck(this,i),d=!1,P=!1,!(s=t.call(this,e,r,{widthSegments:h,heightSegments:l,renderOrder:u,depthTest:d,cullFace:c,uniforms:p,vertexShaderID:f,fragmentShaderID:g,vertexShader:_,fragmentShader:m,texturesOptions:v,crossOrigin:y,alwaysDraw:x,visible:b,transparent:k,drawCheckMargins:R,autoloadSources:P,watchScroll:w,fov:T})).gl)return _possibleConstructorReturn(s);s.renderer.scene.removePlane(_assertThisInitialized(s)),s.type="PingPongPlane",s.renderer.scene.addPlane(_assertThisInitialized(s)),s.readPass=new te(e,{depth:!1,clear:!1,texturesOptions:v}),s.writePass=new te(e,{depth:!1,clear:!1,texturesOptions:v}),s.createTexture({sampler:o});var S=0;return s.readPass.getTexture().onSourceUploaded((function(){S++,s._checkIfReady(S)})),s.writePass.getTexture().onSourceUploaded((function(){S++,s._checkIfReady(S)})),s.setRenderTarget(s.readPass),s._onRenderCallback=function(){s.readPass&&s.writePass&&s.textures[0]&&s.textures[0]._uploaded&&s.setRenderTarget(s.writePass),s._onPingPongRenderCallback&&s._onPingPongRenderCallback()},s._onAfterRenderCallback=function(){s.readPass&&s.writePass&&s.textures[0]&&s.textures[0]._uploaded&&s._swapPasses(),s._onPingPongAfterRenderCallback&&s._onPingPongAfterRenderCallback()},s}return _createClass(i,[{key:"_checkIfReady",value:function(e){var t=this;2===e&&this.renderer.nextRender.add((function(){t.textures[0].copy(t.target.getTexture())}))}},{key:"_swapPasses",value:function(){var e=this.readPass;this.readPass=this.writePass,this.writePass=e,this.textures[0].copy(this.readPass.getTexture())}},{key:"getTexture",value:function(){return this.textures[0]}},{key:"onRender",value:function(e){return e&&(this._onPingPongRenderCallback=e),this}},{key:"onAfterRender",value:function(e){return e&&(this._onPingPongAfterRenderCallback=e),this}},{key:"remove",value:function(){this.target=null,this.renderer.bindFrameBuffer(null),this.writePass&&(this.writePass.remove(),this.writePass=null),this.readPass&&(this.readPass.remove(),this.readPass=null),_get(_getPrototypeOf(i.prototype),"remove",this).call(this)}}]),i}(ee),se=function(e){_inherits(i,e);var t=_createSuper(i);function i(e){var r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=s.renderOrder,a=s.depthTest,o=s.texturesOptions,h=s.crossOrigin,l=s.depth,u=s.clear,d=s.renderTarget;_classCallCheck(this,i);var c="\n            precision mediump float;\n            \n            varying vec3 vVertexPosition;\n            varying vec2 vTextureCoord;\n        \n            uniform sampler2D uRenderTexture;\n            \n            uniform vec2 uResolution;\n            \n            #define FXAA_REDUCE_MIN   (1.0/128.0)\n            #define FXAA_REDUCE_MUL   (1.0/8.0)\n            #define FXAA_SPAN_MAX     8.0\n            \n            void main(){\n                vec2 res=1.0 / uResolution;\n            \n                vec3 rgbNW=texture2D(uRenderTexture, (vTextureCoord.xy + vec2(-1.0, -1.0) * res)).xyz;\n                vec3 rgbNE=texture2D(uRenderTexture, (vTextureCoord.xy + vec2(1.0, -1.0) * res)).xyz;\n                vec3 rgbSW=texture2D(uRenderTexture, (vTextureCoord.xy + vec2(-1.0, 1.0) * res)).xyz;\n                vec3 rgbSE=texture2D(uRenderTexture, (vTextureCoord.xy + vec2(1.0, 1.0) * res)).xyz;\n                vec4 rgbaM=texture2D(uRenderTexture, vTextureCoord.xy * res);\n                vec3 rgbM=rgbaM.xyz;\n                vec3 luma=vec3(0.299, 0.587, 0.114);\n            \n                float lumaNW=dot(rgbNW, luma);\n                float lumaNE=dot(rgbNE, luma);\n                float lumaSW=dot(rgbSW, luma);\n                float lumaSE=dot(rgbSE, luma);\n                float lumaM=dot(rgbM,  luma);\n                float lumaMin=min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n                float lumaMax=max(lumaM, max(max(lumaNW, lumaNE) , max(lumaSW, lumaSE)));\n            \n                vec2 dir;\n                dir.x=-((lumaNW + lumaNE) - (lumaSW + lumaSE));\n                dir.y=((lumaNW + lumaSW) - (lumaNE + lumaSE));\n            \n                float dirReduce=max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n            \n                float rcpDirMin=1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n                dir=min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n                      max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n                            dir * rcpDirMin)) * res;\n                vec4 rgbA=(1.0/2.0) * (\n                texture2D(uRenderTexture, vTextureCoord.xy + dir * (1.0/3.0 - 0.5)) +\n                texture2D(uRenderTexture, vTextureCoord.xy + dir * (2.0/3.0 - 0.5)));\n                vec4 rgbB=rgbA * (1.0/2.0) + (1.0/4.0) * (\n                texture2D(uRenderTexture, vTextureCoord.xy + dir * (0.0/3.0 - 0.5)) +\n                texture2D(uRenderTexture, vTextureCoord.xy + dir * (3.0/3.0 - 0.5)));\n                float lumaB=dot(rgbB, vec4(luma, 0.0));\n            \n                if((lumaB < lumaMin)||(lumaB > lumaMax)){\n                    gl_FragColor=rgbA;\n                }else{\n                    gl_FragColor=rgbB;\n                }\n            }\n        ",p={resolution:{name:"uResolution",type:"2f",value:[0,0]}};return(r=t.call(this,e,{fragmentShader:c,uniforms:p,renderOrder:n,depthTest:a,texturesOptions:o,crossOrigin:h,depth:l,clear:u,renderTarget:d})).gl?(r.uniforms.resolution.value=[r.renderer._boundingRect.width,r.renderer._boundingRect.height],r._onAfterResizeCallback=function(){r.uniforms.resolution.value=[r.renderer._boundingRect.width,r.renderer._boundingRect.height],r._onFXAAPassAfterResizeCallback&&r._onFXAAPassAfterResizeCallback()},r):_possibleConstructorReturn(r)}return _createClass(i,[{key:"onAfterResize",value:function(e){return e&&(this._onFXAAPassAfterResizeCallback=e),this}}]),i}(ie);e.Curtains=d,e.FXAAPass=se,e.Mat4=R,e.PingPongPlane=re,e.Plane=ee,e.Quat=U,e.RenderTarget=te,e.ShaderPass=ie,e.Texture=E,e.TextureLoader=M,e.Vec2=P,e.Vec3=w,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","../keycode","../version","../widget"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.slider",o.ui.mouse,{version:"1.13.3",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,t=this.options,i=this.element.find(".ui-slider-handle"),s=[],a=t.values&&t.values.length||1;for(i.length>a&&(i.slice(a).remove(),i=i.slice(0,a)),e=i.length;e<a;e++)s.push("<span tabindex='0'></span>");this.handles=i.add(o(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){o(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:Array.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=o("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==e.range&&"max"!==e.range||this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,a,n,t,h,l=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var t=Math.abs(i-l.values(e));(t<s||s===t&&(e===l._lastChangedValue||l.values(e)===u.min))&&(s=t,a=o(this),n=e)}),!1!==this._start(e,n))&&(this._mouseSliding=!0,this._handleIndex=n,this._addClass(a,null,"ui-state-active"),a.trigger("focus"),t=a.offset(),h=!o(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-t.left-a.width()/2,top:e.pageY-t.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,n,i),this._animateOff=!0)},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},t=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,t),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,e="horizontal"===this.orientation?(t=this.elementSize.width,e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),e=e/t;return(e=1<e?1:e)<0&&(e=0),"vertical"===this.orientation&&(e=1-e),t=this._valueMax()-this._valueMin(),e=this._valueMin()+e*t,this._trimAlignValue(e)},_uiHash:function(e,t,i){var s={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==t?t:this.values(e),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,i){var s,a=this.value(),n=this.values();this._hasMultipleValues()&&(s=this.values(t?0:1),a=this.values(t),2===this.options.values.length&&!0===this.options.range&&(i=0===t?Math.min(s,i):Math.max(s,i)),n[t]=i),i!==a&&!1!==this._trigger("slide",e,this._uiHash(t,i,n))&&(this._hasMultipleValues()?this.values(t,i):this.value(i))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){if(!arguments.length)return this._value();this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0)},values:function(e,t){var i,s,a;if(1<arguments.length)this.options.values[e]=this._trimAlignValue(t),this._refreshValue(),this._change(null,e);else{if(!arguments.length)return this._values();if(!Array.isArray(e))return this._hasMultipleValues()?this._values(e):this.value();for(i=this.options.values,s=e,a=0;a<i.length;a+=1)i[a]=this._trimAlignValue(s[a]),this._change(null,a);this._refreshValue()}},_setOption:function(e,t){var i,s=0;switch("range"===e&&!0===this.options.range&&("min"===t?(this.options.value=this._values(0),this.options.values=null):"max"===t&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(e,t),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(t),this.handles.css("horizontal"===t?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return this._trimAlignValue(e)},_values:function(e){var t,i;if(arguments.length)return e=this.options.values[e],this._trimAlignValue(e);if(this._hasMultipleValues()){for(t=this.options.values.slice(),i=0;i<t.length;i+=1)t[i]=this._trimAlignValue(t[i]);return t}return[]},_trimAlignValue:function(e){var t,i;return e<=this._valueMin()?this._valueMin():e>=this._valueMax()?this._valueMax():(t=0<this.options.step?this.options.step:1,i=e-(e=(e-this._valueMin())%t),2*Math.abs(e)>=t&&(i+=0<e?t:-t),parseFloat(i.toFixed(5)))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step;(e=Math.round((e-t)/i)*i+t)>this.options.max&&(e-=i),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return e=null!==this.options.min?Math.max(e,this._precisionOf(this.options.min)):e},_precisionOf:function(e){var e=e.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,i,e,s,a,n=this.options.range,h=this.options,l=this,u=!this._animateOff&&h.animate,r={};this._hasMultipleValues()?this.handles.each(function(e){i=(l.values(e)-l._valueMin())/(l._valueMax()-l._valueMin())*100,r["horizontal"===l.orientation?"left":"bottom"]=i+"%",o(this).stop(1,1)[u?"animate":"css"](r,h.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===e&&l.range.stop(1,1)[u?"animate":"css"]({left:i+"%"},h.animate),1===e&&l.range[u?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:h.animate})):(0===e&&l.range.stop(1,1)[u?"animate":"css"]({bottom:i+"%"},h.animate),1===e&&l.range[u?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:h.animate}))),t=i}):(e=this.value(),s=this._valueMin(),a=this._valueMax(),i=a!==s?(e-s)/(a-s)*100:0,r["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[u?"animate":"css"](r,h.animate),"min"===n&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:i+"%"},h.animate),"max"===n&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:100-i+"%"},h.animate),"min"===n&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:i+"%"},h.animate),"max"===n&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:100-i+"%"},h.animate))},_handleEvents:{keydown:function(e){var t,i,s,a=o(e.target).data("ui-slider-handle-index");switch(e.keyCode){case o.ui.keyCode.HOME:case o.ui.keyCode.END:case o.ui.keyCode.PAGE_UP:case o.ui.keyCode.PAGE_DOWN:case o.ui.keyCode.UP:case o.ui.keyCode.RIGHT:case o.ui.keyCode.DOWN:case o.ui.keyCode.LEFT:if(e.preventDefault(),this._keySliding||(this._keySliding=!0,this._addClass(o(e.target),null,"ui-state-active"),!1!==this._start(e,a)))break;return}switch(s=this.options.step,t=i=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case o.ui.keyCode.HOME:i=this._valueMin();break;case o.ui.keyCode.END:i=this._valueMax();break;case o.ui.keyCode.PAGE_UP:i=this._trimAlignValue(t+(this._valueMax()-this._valueMin())/this.numPages);break;case o.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(t-(this._valueMax()-this._valueMin())/this.numPages);break;case o.ui.keyCode.UP:case o.ui.keyCode.RIGHT:if(t===this._valueMax())return;i=this._trimAlignValue(t+s);break;case o.ui.keyCode.DOWN:case o.ui.keyCode.LEFT:if(t===this._valueMin())return;i=this._trimAlignValue(t-s)}this._slide(e,a,i)},keyup:function(e){var t=o(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,t),this._change(e,t),this._removeClass(o(e.target),null,"ui-state-active"))}}})});
var VanillaTilt=function(){"use strict";class t{constructor(e,i={}){if(!(e instanceof Node))throw"Can't initialize VanillaTilt because "+e+" is not a Node.";this.width=null,this.height=null,this.clientWidth=null,this.clientHeight=null,this.left=null,this.top=null,this.gammazero=null,this.betazero=null,this.lastgammazero=null,this.lastbetazero=null,this.transitionTimeout=null,this.updateCall=null,this.event=null,this.updateBind=this.update.bind(this),this.resetBind=this.reset.bind(this),this.element=e,this.settings=this.extendSettings(i),this.reverse=this.settings.reverse?-1:1,this.glare=t.isSettingTrue(this.settings.glare),this.glarePrerender=t.isSettingTrue(this.settings["glare-prerender"]),this.fullPageListening=t.isSettingTrue(this.settings["full-page-listening"]),this.gyroscope=t.isSettingTrue(this.settings.gyroscope),this.gyroscopeSamples=this.settings.gyroscopeSamples,this.elementListener=this.getElementListener(),this.glare&&this.prepareGlare(),this.fullPageListening&&this.updateClientSize(),this.addEventListeners(),this.reset(),this.updateInitialPosition()}static isSettingTrue(t){return""===t||!0===t||1===t}getElementListener(){if(this.fullPageListening)return window.document;if("string"==typeof this.settings["mouse-event-element"]){const t=document.querySelector(this.settings["mouse-event-element"]);if(t)return t}return this.settings["mouse-event-element"]instanceof Node?this.settings["mouse-event-element"]:this.element}addEventListeners(){this.onMouseEnterBind=this.onMouseEnter.bind(this),this.onMouseMoveBind=this.onMouseMove.bind(this),this.onMouseLeaveBind=this.onMouseLeave.bind(this),this.onWindowResizeBind=this.onWindowResize.bind(this),this.onDeviceOrientationBind=this.onDeviceOrientation.bind(this),this.elementListener.addEventListener("mouseenter",this.onMouseEnterBind),this.elementListener.addEventListener("mouseleave",this.onMouseLeaveBind),this.elementListener.addEventListener("mousemove",this.onMouseMoveBind),(this.glare||this.fullPageListening)&&window.addEventListener("resize",this.onWindowResizeBind),this.gyroscope&&window.addEventListener("deviceorientation",this.onDeviceOrientationBind)}removeEventListeners(){this.elementListener.removeEventListener("mouseenter",this.onMouseEnterBind),this.elementListener.removeEventListener("mouseleave",this.onMouseLeaveBind),this.elementListener.removeEventListener("mousemove",this.onMouseMoveBind),this.gyroscope&&window.removeEventListener("deviceorientation",this.onDeviceOrientationBind),(this.glare||this.fullPageListening)&&window.removeEventListener("resize",this.onWindowResizeBind)}destroy(){clearTimeout(this.transitionTimeout),null!==this.updateCall&&cancelAnimationFrame(this.updateCall),this.reset(),this.removeEventListeners(),this.element.vanillaTilt=null,delete this.element.vanillaTilt,this.element=null}onDeviceOrientation(t){if(null===t.gamma||null===t.beta)return;this.updateElementPosition(),this.gyroscopeSamples>0&&(this.lastgammazero=this.gammazero,this.lastbetazero=this.betazero,null===this.gammazero?(this.gammazero=t.gamma,this.betazero=t.beta):(this.gammazero=(t.gamma+this.lastgammazero)/2,this.betazero=(t.beta+this.lastbetazero)/2),this.gyroscopeSamples-=1);const e=this.settings.gyroscopeMaxAngleX-this.settings.gyroscopeMinAngleX,i=this.settings.gyroscopeMaxAngleY-this.settings.gyroscopeMinAngleY,s=e/this.width,n=i/this.height,l=(t.gamma-(this.settings.gyroscopeMinAngleX+this.gammazero))/s,a=(t.beta-(this.settings.gyroscopeMinAngleY+this.betazero))/n;null!==this.updateCall&&cancelAnimationFrame(this.updateCall),this.event={clientX:l+this.left,clientY:a+this.top},this.updateCall=requestAnimationFrame(this.updateBind)}onMouseEnter(){this.updateElementPosition(),this.element.style.willChange="transform",this.setTransition()}onMouseMove(t){null!==this.updateCall&&cancelAnimationFrame(this.updateCall),this.event=t,this.updateCall=requestAnimationFrame(this.updateBind)}onMouseLeave(){this.setTransition(),this.settings.reset&&requestAnimationFrame(this.resetBind)}reset(){this.event={clientX:this.left+this.width/2,clientY:this.top+this.height/2},this.element&&this.element.style&&(this.element.style.transform=`perspective(${this.settings.perspective}px) `+"rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"),this.resetGlare()}resetGlare(){this.glare&&(this.glareElement.style.transform="rotate(180deg) translate(-50%, -50%)",this.glareElement.style.opacity="0")}updateInitialPosition(){if(0===this.settings.startX&&0===this.settings.startY)return;this.onMouseEnter(),this.fullPageListening?this.event={clientX:(this.settings.startX+this.settings.max)/(2*this.settings.max)*this.clientWidth,clientY:(this.settings.startY+this.settings.max)/(2*this.settings.max)*this.clientHeight}:this.event={clientX:this.left+(this.settings.startX+this.settings.max)/(2*this.settings.max)*this.width,clientY:this.top+(this.settings.startY+this.settings.max)/(2*this.settings.max)*this.height};let t=this.settings.scale;this.settings.scale=1,this.update(),this.settings.scale=t,this.resetGlare()}getValues(){let t,e;return this.fullPageListening?(t=this.event.clientX/this.clientWidth,e=this.event.clientY/this.clientHeight):(t=(this.event.clientX-this.left)/this.width,e=(this.event.clientY-this.top)/this.height),t=Math.min(Math.max(t,0),1),e=Math.min(Math.max(e,0),1),{tiltX:(this.reverse*(this.settings.max-t*this.settings.max*2)).toFixed(2),tiltY:(this.reverse*(e*this.settings.max*2-this.settings.max)).toFixed(2),percentageX:100*t,percentageY:100*e,angle:Math.atan2(this.event.clientX-(this.left+this.width/2),-(this.event.clientY-(this.top+this.height/2)))*(180/Math.PI)}}updateElementPosition(){let t=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=t.left,this.top=t.top}update(){let t=this.getValues();this.element.style.transform="perspective("+this.settings.perspective+"px) rotateX("+("x"===this.settings.axis?0:t.tiltY)+"deg) rotateY("+("y"===this.settings.axis?0:t.tiltX)+"deg) scale3d("+this.settings.scale+", "+this.settings.scale+", "+this.settings.scale+")",this.glare&&(this.glareElement.style.transform=`rotate(${t.angle}deg) translate(-50%, -50%)`,this.glareElement.style.opacity=`${t.percentageY*this.settings["max-glare"]/100}`),this.element.dispatchEvent(new CustomEvent("tiltChange",{detail:t})),this.updateCall=null}prepareGlare(){if(!this.glarePrerender){const t=document.createElement("div");t.classList.add("js-tilt-glare");const e=document.createElement("div");e.classList.add("js-tilt-glare-inner"),t.appendChild(e),this.element.appendChild(t)}this.glareElementWrapper=this.element.querySelector(".js-tilt-glare"),this.glareElement=this.element.querySelector(".js-tilt-glare-inner"),this.glarePrerender||(Object.assign(this.glareElementWrapper.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden","pointer-events":"none"}),Object.assign(this.glareElement.style,{position:"absolute",top:"50%",left:"50%","pointer-events":"none","background-image":"linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",transform:"rotate(180deg) translate(-50%, -50%)","transform-origin":"0% 0%",opacity:"0"}),this.updateGlareSize())}updateGlareSize(){if(this.glare){const t=2*(this.element.offsetWidth>this.element.offsetHeight?this.element.offsetWidth:this.element.offsetHeight);Object.assign(this.glareElement.style,{width:`${t}px`,height:`${t}px`})}}updateClientSize(){this.clientWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,this.clientHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}onWindowResize(){this.updateGlareSize(),this.updateClientSize()}setTransition(){clearTimeout(this.transitionTimeout),this.element.style.transition=this.settings.speed+"ms "+this.settings.easing,this.glare&&(this.glareElement.style.transition=`opacity ${this.settings.speed}ms ${this.settings.easing}`),this.transitionTimeout=setTimeout(()=>{this.element.style.transition="",this.glare&&(this.glareElement.style.transition="")},this.settings.speed)}extendSettings(t){let e={reverse:!1,max:15,startX:0,startY:0,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:1,speed:300,transition:!0,axis:null,glare:!1,"max-glare":1,"glare-prerender":!1,"full-page-listening":!1,"mouse-event-element":null,reset:!0,gyroscope:!0,gyroscopeMinAngleX:-45,gyroscopeMaxAngleX:45,gyroscopeMinAngleY:-45,gyroscopeMaxAngleY:45,gyroscopeSamples:10},i={};for(var s in e)if(s in t)i[s]=t[s];else if(this.element.hasAttribute("data-tilt-"+s)){let t=this.element.getAttribute("data-tilt-"+s);try{i[s]=JSON.parse(t)}catch(e){i[s]=t}}else i[s]=e[s];return i}static init(e,i){e instanceof Node&&(e=[e]),e instanceof NodeList&&(e=[].slice.call(e)),e instanceof Array&&e.forEach(e=>{"vanillaTilt"in e||(e.vanillaTilt=new t(e,i))})}}return"undefined"!=typeof document&&(window.VanillaTilt=t,t.init(document.querySelectorAll("[data-tilt]"))),t}();
;(function ($){
"use strict";
var Pxl_Cursor=function(){
var cursor=$(".pxl-cursor"),
follower=$(".pxl-cursor-follower"),
cursor_arrow_prev=$(".pxl-cursor-arrow-prev"),
cursor_arrow_next=$(".pxl-cursor-arrow-next"),
cursor_drag=$(".pxl-cursor-drag"),
cursor_map=$(".pxl-cursor-map"),
cursor_text=$(".pxl-cursor-text"),
cursor_icon=$(".pxl-cursor-icon");
var posX=0,
posY=0;
var posX1=0,
posY1=0;
var mouseX=0,
mouseY=0;
if(cursor.length <=0) return false;
document.body.classList.add('pxl-cursor-init');
$(document).on("mousemove", function(e){
mouseX=e.clientX;
mouseY=e.clientY;
});
initCursor();
extraCursor();
function initCursor(){
var cursor_width=cursor.width();
var cursor_follower_width=follower.width();
var cursor_prev_width=cursor_arrow_prev.width();
var cursor_next_width=cursor_arrow_next.width();
var cursor_drag_width=cursor_drag.width();
var cursor_map_width=cursor_map.width();
TweenMax.to({}, 0.01, {
repeat: -1,
onRepeat: function(){
posX +=(mouseX - posX) / 9;
posY +=(mouseY - posY) / 9;
posX1 +=(mouseX - posX1);
posY1 +=(mouseY - posY1);
if(follower.length > 0){
TweenMax.set(follower, {
css: {
left: posX - (cursor_follower_width / 2) - 2,
top: posY - (cursor_follower_width / 2) - 2
}});
}
if(cursor.length > 0){
TweenMax.set(cursor, {
css: {
left: mouseX - (cursor_width / 2),
top: mouseY - (cursor_width / 2)
}});
}
if(cursor_arrow_prev.length > 0){
TweenMax.set(cursor_arrow_prev, {
css: {
left: posX1 - (cursor_prev_width / 2),
top: posY1 - (cursor_prev_width / 2)
}});
}
if(cursor_arrow_next.length > 0){
TweenMax.set(cursor_arrow_next, {
css: {
left: posX1 - (cursor_next_width / 2),
top: posY1 - (cursor_next_width / 2)
}});
}
if(cursor_drag.length > 0){
TweenMax.set(cursor_drag, {
css: {
left: posX1 - (cursor_drag_width / 2),
top: posY1 - (cursor_drag_width / 2)
}});
}
if(cursor_map.length > 0){
TweenMax.set(cursor_map, {
css: {
left: posX - (cursor_map_width / 2),
top: posY - (cursor_map_width / 2)
}});
}}
});
}
function show_cursor(cur, bool){
cur.addClass("active");
if(bool==true){
cursor.removeClass("active").addClass('hide');
follower.removeClass("active").addClass('hide');
}}
function hide_cursor(cur, bool){
cur.removeClass("active");
if(bool==true){
cursor.removeClass("hide");
follower.removeClass("hide");
}}
function show_cursor_inner(e){
if($(e).parents('.cursor-drag-area').length > 0){
cursor_drag.removeClass("active");
cursor.removeClass("hide");
follower.removeClass("hide");
}
if($(e).parents('.cursor-map-target').length > 0){
cursor_map.removeClass("active");
cursor.removeClass("hide");
follower.removeClass("hide");
}}
function hide_cursor_inner(e){
if($(e).parents('.cursor-drag-area').length > 0){
cursor_drag.addClass("active");
cursor.addClass("hide");
follower.addClass("hide");
}
if($(e).parents('.cursor-map-target').length > 0){
cursor_map.addClass("active");
cursor.addClass("hide");
follower.addClass("hide");
}}
function extraCursor(){
$('a').on("mouseenter", function(){
show_cursor(cursor, false);
show_cursor(follower, false);
});
$('a').on("mouseleave", function(){
hide_cursor(cursor, false);
hide_cursor(follower, false);
});
$('.pxl-video-btn').on("mouseenter", function(){
show_cursor(cursor, false);
show_cursor(follower, false);
});
$('.pxl-video-btn').on("mouseleave", function(){
hide_cursor(cursor, false);
hide_cursor(follower, false);
});
$('.pxl-anchor').on("mouseenter", function(){
show_cursor(cursor, false);
show_cursor(follower, false);
});
$('.pxl-anchor').on("mouseleave", function(){
hide_cursor(cursor, false);
hide_cursor(follower, false);
});
$('.pxl-swiper-thumbs').on("mouseenter", function(){
show_cursor(cursor, false);
show_cursor(follower, false);
});
$('.pxl-swiper-thumbs').on("mouseleave", function(){
hide_cursor(cursor, false);
hide_cursor(follower, false);
});
$('.cursor-arrow-prev').on("mouseenter", function(){
show_cursor(cursor_arrow_prev, true);
});
$('.cursor-arrow-prev').on("mouseleave", function(){
hide_cursor(cursor_arrow_prev, true);
});
$('.cursor-arrow-next').on("mouseenter", function(){
show_cursor(cursor_arrow_next, true);
});
$('.cursor-arrow-next').on("mouseleave", function(){
hide_cursor(cursor_arrow_next, true);
});
$('.cursor-drag-area').on("mouseenter", function(){
show_cursor(cursor_drag, true);
});
$('.cursor-drag-area').on("mouseleave", function(){
hide_cursor(cursor_drag, true);
});
$(document).on('mousedown','.cursor-drag-area',function(){
cursor_drag.addClass("clicked");
});
$(document).on('mouseup','.cursor-drag-area',function(){
cursor_drag.removeClass("clicked");
});
$('.cursor-map-target').on("mouseenter", function(){
show_cursor(cursor_map, true);
});
$('.cursor-map-target').on("mouseleave", function(){
hide_cursor(cursor_map, true);
});
}};
if($(document).find('.pxl-cursor').length > 0){
if($(window).innerWidth() >=1200){
Pxl_Cursor();
}}
})(jQuery);
;(function ($){
"use strict";
var pxl_scroll_top;
var pxl_window_height;
var pxl_window_width;
var pxl_scroll_status='';
var pxl_last_scroll_top=0;
$(window).on('load', function (){
pxl_window_width=$(window).width();
digicove_loader();
digicove_col_offset();
digicove_header_sticky();
digicove_scroll_to_top();
digicove_footer_fixed();
digicove_quantity_icon();
backtotopIndicator();
digicove_panel_anchor_toggle();
digicove_webgl_effects();
digicove_document_click();
});
$(window).on('scroll', function (){
pxl_scroll_top=$(window).scrollTop();
pxl_window_height=$(window).height();
pxl_window_width=$(window).width();
if(pxl_scroll_top < pxl_last_scroll_top){
pxl_scroll_status='up';
}else{
pxl_scroll_status='down';
}
pxl_last_scroll_top=pxl_scroll_top;
digicove_header_sticky();
digicove_scroll_to_top();
digicove_footer_fixed();
});
$(document).ready(function (){
$('.pxl-circle-svg svg').each(function(){
var linearGradient=$(this).find('.linear-dot1');
if(linearGradient.length > 0){
var linearGradientId=linearGradient.attr('id');
}
var linearGradient1=$(this).find('.linear-dot2');
if(linearGradient1.length > 0){
var linearGradientId1=linearGradient1.attr('id');
}
digicove_circle_svg(this,linearGradientId,linearGradientId1);
});
const websiteUrlInput=$('#website-url');
const userEmailInput=$('#user-email');
const submitButton=$('#submit-button');
const resultContainer=$('#result-container');
if(websiteUrlInput.length&&userEmailInput.length&&submitButton.length&&resultContainer.length){
updateSubmitButtonState();
websiteUrlInput.on('input', updateSubmitButtonState);
userEmailInput.on('input', updateSubmitButtonState);
submitButton.on('click', function(){
const websiteUrl=websiteUrlInput.val().trim();
const userEmail=userEmailInput.val().trim();
if(websiteUrl&&userEmail){
resultContainer.css('display', 'block');
resultContainer.html('Loading...');
$.ajax({
url: `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${websiteUrl}`,
method: 'GET',
dataType: 'json',
success: function(data){
const performanceScore=data.lighthouseResult.categories.performance.score * 100;
const firstContentfulPaint=data.lighthouseResult.audits['first-contentful-paint'].displayValue;
const largestContentfulPaint=data.lighthouseResult.audits['largest-contentful-paint'].displayValue;
const totalBlockingTime=data.lighthouseResult.audits['total-blocking-time'].displayValue;
resultContainer.html(`
SEO Score for ${websiteUrl}: ${performanceScore}<br>
First Contentful Paint: ${firstContentfulPaint}<br>
Largest Contentful Paint: ${largestContentfulPaint}<br>
Total Blocking Time: ${totalBlockingTime}
`);
},
error: function(error){
resultContainer.html('Error loading data. Please try again later.');
console.error('Error calling the SEO score API:', error);
}});
}});
}
function updateSubmitButtonState(){
const websiteUrl=websiteUrlInput.val().trim();
const userEmail=userEmailInput.val().trim();
if(websiteUrl&&userEmail){
submitButton.prop('disabled', false);
}else{
submitButton.prop('disabled', true);
}}
var $digicove_menu=$('.pxl-header-elementor-main');
$digicove_menu.find('.pxl-menu-primary li').each(function (){
var $digicove_submenu=$(this).find('> ul.sub-menu');
if($digicove_submenu.length==1){
$(this).hover(function (){
if($digicove_submenu.offset().left + $digicove_submenu.width() > $(window).width()){
$digicove_submenu.addClass('pxl-sub-reverse');
}else if($digicove_submenu.offset().left < 0){
$digicove_submenu.addClass('pxl-sub-reverse');
}}, function (){
$digicove_submenu.removeClass('pxl-sub-reverse');
});
}});
var parallaxImg=$('.pxl-img-text .pxl-img');
if(pxl_window_width < 1200){
parallaxImg.removeAttr('data-parallax');
}
$('.pxl-header-menu li.menu-item-has-children, .pxl-nav-hidden li.menu-item-has-children, .pxl-menu-primary li.menu-item-has-children').append('<span class="pxl-menu-toggle"></span>');
$('.pxl-menu-toggle').on('click', function (){
if($(this).hasClass('active')){
$(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active');
$(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle();
}else{
$(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active');
$(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle();
$(this).toggleClass('active');
$(this).parent().find('> .sub-menu').toggleClass('active');
$(this).parent().find('> .sub-menu').slideToggle();
}});
$("#pxl-nav-mobile").on('click', function (){
$(this).toggleClass('active');
$('.pxl-header-menu').toggleClass('active');
});
$(".pxl-menu-close, .pxl-header-menu-backdrop").on('click', function (){
$(this).parents('.pxl-header-main').find('.pxl-header-menu').removeClass('active');
$('#pxl-nav-mobile').removeClass('active');
});
$('.pxl-nice-select, .woocommerce .woocommerce-ordering .orderby, #wp-block-archives-1, #wp-block-categories-1').each(function (){
$(this).niceSelect();
});
$('.woocommerce div.product form.cart .variations select').each(function (){
$(this).niceSelect();
});
var woo_nice_select=document.querySelectorAll('.woocommerce .nice-select');
woo_nice_select.forEach(function(){
var default_width=$('.woocommerce .woocommerce-product-inner').width();
$('.woocommerce .nice-select').css("min-width", default_width);
$(window).resize(function(){
var default_width=$('.woocommerce .woocommerce-product-inner').width();
$('.woocommerce .nice-select').css("min-width", default_width);
});
});
$('.pxl-type-header-clip > .elementor-container').append('<div class="pxl-header-shape"><span></span></div>');
$('.pxl-scroll-top').click(function (){
$('html, body').animate({scrollTop: 0}, 800);
return false;
});
$('.pxl-grid-masonry').each(function (){
var eltime=100;
var elt_inner=$(this).children().length;
var _elt=elt_inner - 1;
$(this).find('> .pxl-grid-item > .wow').each(function (index, obj){
$(this).css('animation-delay', eltime + 'ms');
if(_elt===index){
eltime=100;
_elt=_elt + elt_inner;
}else{
eltime=eltime + 60;
}});
});
var video_laptop=$('.pxl-video-player2');
if(video_laptop){
$(this).find('iframe').addClass('parallax-inner');
}
$(document).ready(function(){
const elements=document.querySelectorAll('.pxl-mask-bg-parallax');
elements.forEach(element=> {
const dataColor=element.getAttribute('data-color');
if(dataColor){
const { x, y, z }=JSON.parse(dataColor);
const gradient=`linear-gradient(${z}deg, ${x}, ${y})`;
element.style.background=gradient;
}});
});
$('.btn-video, .pxl-video-popup').magnificPopup({
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
$('.comment-reply a').append('<i class="common icon-arrow-forward-ne1"></i>');
if($('.pxl-page-title-default-bg').hasClass('pxl--parallax')){
$(this).stellar();
}
$('.btn-hover').each(function (){
$(this).hover(function (){
$(this).parents('.item-feature').find('.btn-hover').removeClass('active');
$(this).addClass('active');
});
});
$('.pxl--widget-hover').each(function (){
$(this).hover(function (){
$(this).parents('.elementor-row').find('.pxl--widget-hover').removeClass('pxl--item-active');
$(this).parents('.elementor-container').find('.pxl--widget-hover').removeClass('pxl--item-active');
$(this).addClass('pxl--item-active');
});
});
$('.btn-plus-text').hover(function (){
$(this).find('span').toggle(300);
});
$(".pxl-nav-button").on('click', function (){
$(this).toggleClass('active');
$(this).parent().find('.pxl-nav-wrap').toggle(400);
});
var boxEls=$('.el-bounce, .pxl-image-effect1');
$.each(boxEls, function(boxIndex, boxEl){
loopToggleClass(boxEl, 'bounce-active');
});
function loopToggleClass(el, toggleClass){
el=$(el);
let counter=0;
if(el.hasClass(toggleClass)){
waitFor(function (){
counter++;
return counter==2;
}, function (){
counter=0;
el.removeClass(toggleClass);
loopToggleClass(el, toggleClass);
}, 'Deactivate', 1000);
}else{
waitFor(function (){
counter++;
return counter==3;
}, function (){
counter=0;
el.addClass(toggleClass);
loopToggleClass(el, toggleClass);
}, 'Activate', 1000);
}}
function waitFor(condition, callback, message, time){
if(message==null||message==''||typeof message=='undefined'){
message='Timeout';
}
if(time==null||time==''||typeof time=='undefined'){
time=100;
}
var cond=condition();
if(cond){
callback();
}else{
setTimeout(function(){
console.log(message);
waitFor(condition, callback, message, time);
}, time);
}}
var btn_comment=$('#comments .form-submit');
if(btn_comment){
btn_comment.append('<span class="button-arrow-hover"><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none"><path d="M20.2202 0.845311L7.31632 0.646853C6.97468 0.647537 6.6511 0.782449 6.41528 1.02253C6.17946 1.26262 6.05027 1.58866 6.05552 1.93045C6.06078 2.27223 6.20007 2.60241 6.44339 2.84986C6.6867 3.09731 7.01458 3.24224 7.35641 3.25344L17.1136 3.4035L1.15375 19.3633C0.913059 19.604 0.780827 19.9335 0.786144 20.2792C0.79146 20.6249 0.933891 20.9585 1.1821 21.2068C1.43031 21.455 1.76397 21.5974 2.10968 21.6027C2.45539 21.608 2.78482 21.4758 3.02552 21.2351L18.9854 5.27527L19.1354 15.0325C19.1351 15.2055 19.1692 15.3779 19.2358 15.5396C19.3024 15.7014 19.4002 15.8492 19.5234 15.9745C19.6467 16.0998 19.7929 16.2001 19.9535 16.2695C20.1141 16.3389 20.286 16.376 20.4591 16.3786C20.6322 16.3813 20.803 16.3495 20.9616 16.285C21.1202 16.2205 21.2634 16.1247 21.3828 16.0031C21.5022 15.8815 21.5955 15.7366 21.6572 15.5769C21.7188 15.4171 21.7477 15.2456 21.742 15.0725L21.5436 2.16865C21.5382 1.82301 21.3958 1.48943 21.1476 1.24127C20.8994 0.993105 20.5659 0.850679 20.2202 0.845311Z" fill="#FDFDFD"/></svg><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none"><path d="M20.2202 0.845311L7.31632 0.646853C6.97468 0.647537 6.6511 0.782449 6.41528 1.02253C6.17946 1.26262 6.05027 1.58866 6.05552 1.93045C6.06078 2.27223 6.20007 2.60241 6.44339 2.84986C6.6867 3.09731 7.01458 3.24224 7.35641 3.25344L17.1136 3.4035L1.15375 19.3633C0.913059 19.604 0.780827 19.9335 0.786144 20.2792C0.79146 20.6249 0.933891 20.9585 1.1821 21.2068C1.43031 21.455 1.76397 21.5974 2.10968 21.6027C2.45539 21.608 2.78482 21.4758 3.02552 21.2351L18.9854 5.27527L19.1354 15.0325C19.1351 15.2055 19.1692 15.3779 19.2358 15.5396C19.3024 15.7014 19.4002 15.8492 19.5234 15.9745C19.6467 16.0998 19.7929 16.2001 19.9535 16.2695C20.1141 16.3389 20.286 16.376 20.4591 16.3786C20.6322 16.3813 20.803 16.3495 20.9616 16.285C21.1202 16.2205 21.2634 16.1247 21.3828 16.0031C21.5022 15.8815 21.5955 15.7366 21.6572 15.5769C21.7188 15.4171 21.7477 15.2456 21.742 15.0725L21.5436 2.16865C21.5382 1.82301 21.3958 1.48943 21.1476 1.24127C20.8994 0.993105 20.5659 0.850679 20.2202 0.845311Z" fill="#FDFDFD"/></svg></span>');
}
if($('.pxl-image-tilt').length){
$('.pxl-image-tilt').parents('.elementor-top-section').addClass('pxl-image-tilt-active');
$('.pxl-image-tilt').each(function (){
var pxl_maxtilt=$(this).data('maxtilt'),
pxl_speedtilt=$(this).data('speedtilt'),
pxl_perspectivetilt=$(this).data('perspectivetilt');
VanillaTilt.init(this, {
max: pxl_maxtilt,
speed: pxl_speedtilt,
perspective: pxl_perspectivetilt
});
});
}
$('.wpcf7-select').each(function(){
var $this=$(this), numberOfOptions=$(this).children('option').length;
$this.addClass('pxl-select-hidden');
$this.wrap('<div class="pxl-select"></div>');
$this.after('<div class="pxl-select-higthlight"></div>');
var $styledSelect=$this.next('div.pxl-select-higthlight');
$styledSelect.text($this.children('option').eq(0).text());
var $list=$('<ul />', {
'class': 'pxl-select-options'
}).insertAfter($styledSelect);
for (var i=0; i < numberOfOptions; i++){
$('<li />', {
text: $this.children('option').eq(i).text(),
rel: $this.children('option').eq(i).val()
}).appendTo($list);
}
var $listItems=$list.children('li');
$styledSelect.click(function(e){
e.stopPropagation();
$('div.pxl-select-higthlight.active').not(this).each(function(){
$(this).removeClass('active').next('ul.pxl-select-options').addClass('pxl-select-lists-hide');
});
$(this).toggleClass('active');
});
$listItems.click(function(e){
e.stopPropagation();
$styledSelect.text($(this).text()).removeClass('active');
$this.val($(this).attr('rel'));
});
$(document).click(function(){
$styledSelect.removeClass('active');
});
});
$('#pxl-sidebar-area select').each(function(){
var $this=$(this), numberOfOptions=$(this).children('option').length;
$this.addClass('pxl-select-hidden');
$this.wrap('<div class="pxl-select"></div>');
$this.after('<div class="pxl-select-higthlight"></div>');
var $styledSelect=$this.next('div.pxl-select-higthlight');
$styledSelect.text($this.children('option').eq(0).text());
var $list=$('<ul />', {
'class': 'pxl-select-options'
}).insertAfter($styledSelect);
for (var i=0; i < numberOfOptions; i++){
$('<li />', {
text: $this.children('option').eq(i).text(),
rel: $this.children('option').eq(i).val()
}).appendTo($list);
}
var $listItems=$list.children('li');
$styledSelect.click(function(e){
e.stopPropagation();
$('div.pxl-select-higthlight.active').not(this).each(function(){
$(this).removeClass('active').next('ul.pxl-select-options').addClass('pxl-select-lists-hide');
});
$(this).toggleClass('active');
});
$listItems.click(function(e){
e.stopPropagation();
$styledSelect.text($(this).text()).removeClass('active');
$this.val($(this).attr('rel'));
});
$(document).click(function(){
$styledSelect.removeClass('active');
});
});
$(document).ready(function(){
var element=$('#preloader');
var qodefClipValue=0;
var loadTime=performance.now();
var step=100 / (loadTime / 1000);
var interval=setInterval(function(){
qodefClipValue +=step;
element.css('--pxl-clip', qodefClipValue);
if(qodefClipValue >=100){
clearInterval(interval);
}}, 30);
});
if($('.pxl-title--typewriter').length){
function typewriterOut(elements, callback){
if(elements.length){
elements.eq(0).addClass('is-active');
elements.eq(0).delay(3000);
elements.eq(0).removeClass('is-active');
typewriterOut(elements.slice(1), callback);
}else{
callback();
}}
function typewriterIn(elements, callback){
if(elements.length){
elements.eq(0).addClass('is-active');
elements.eq(0).delay(3000).slideDown(3000, function(){
elements.eq(0).removeClass('is-active');
typewriterIn(elements.slice(1), callback);
});
}else{
callback();
}}
function typewriterInfinite(){
typewriterOut($('.pxl-title--typewriter .pxl-item--text'), function(){
typewriterIn($('.pxl-title--typewriter .pxl-item--text'), function(){
typewriterInfinite();
});
});
}
$(function(){
typewriterInfinite();
});
}
$('.pxl-row-divider-angle-top').append('<svg class="pxl-row-angle" style="fill:#ffffff" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 100 100" version="1.1" preserveAspectRatio="none" height="130px"><path stroke="" stroke-width="0" d="M0 100 L100 0 L200 100"></path></svg>');
setTimeout(function(){
$('.md-align-center').parents('.rs-parallax-wrap').addClass('pxl-group-center');
}, 300);
});
function digicove_circle_svg(element, linearGradientId, linearGradientId1){
var activeWidth=window.innerWidth||document.documentElement.clientWidth;
if(activeWidth <=1200){
return;
}
var svgEl=Snap(element);
if(!svgEl){
return;
}
var size=13;
var filter=svgEl.filter(Snap.filter.shadow(0, 4, 30, 'rgba(0, 255, 255, 0.6)')).addClass('filter1');
var filter1=svgEl.filter(Snap.filter.shadow(0, 4, 30, 'rgba(0, 255, 255, 0.1)')).addClass('filter2');
var circle1=svgEl.circle(0, 0, size * 1);
var linearGradient=svgEl.select('.pxl-circle-svg svg .' + linearGradientId);
circle1.attr({ id: 'circle1', class: 'dot', fill: 'url(#' + linearGradientId + ')' });
circle1.attr({ filter: filter });
var circle2=svgEl.circle(0, 0, size * 1);
circle2.attr({ id: 'circle2', class: 'dot', fill: 'url(#' + linearGradientId1 + ')' });
circle2.attr({ filter: filter1 });
var dotEl1=svgEl.select('#circle1');
var dotEl2=svgEl.select('#circle2');
var motionPath1=svgEl.select('path').getTotalLength();
var motionPath2=svgEl.select('path').getTotalLength();
var motionPath1Partial=motionPath1 * 0.7;
var motionPath2Partial=motionPath2 * 0.7;
dotEl1.transform('t0,0');
dotEl2.transform('t0,0');
var carouselInnerEl=$(".pxl-carousel-inner,.pxl-swiper-arrow");
var animation1, animation2;
var isHovered=false;
function animateDot1(forward){
var fromVal, toVal;
if(forward){
fromVal=0;
toVal=motionPath1;
}else{
fromVal=motionPath2;
toVal=0;
}
animation1=Snap.animate(fromVal, toVal, function (val){
var point=svgEl.select("path").getPointAtLength(val);
dotEl1.attr({ cx: point.x, cy: point.y });
}, 15000, function (){
if(!isHovered){
dotEl1.transform('t0,0');
animateDot1(true);
}});
}
function animateDot2(forward){
var fromVal, toVal;
if(forward){
fromVal=motionPath1;
toVal=0;
}else{
fromVal=0;
toVal=motionPath2;
}
animation2=Snap.animate(fromVal, toVal, function (val){
var point=svgEl.select("path").getPointAtLength(motionPath2 - val);
dotEl2.attr({ cx: point.x, cy: point.y });
}, 15000, function (){
if(!isHovered){
dotEl2.transform('t0,0');
animateDot2(false);
}});
}
carouselInnerEl.on("mouseenter", function (){
isHovered=true;
if(animation1){
animation1.pause();
}
if(animation2){
animation2.pause();
}});
carouselInnerEl.on("mouseleave", function (){
isHovered=false;
if(animation1){
animation1.stop();
}
if(animation2){
animation2.stop();
}
dotEl1.transform('t0,0');
dotEl2.transform('t0,0');
animateDot1(true);
animateDot2(false);
});
animateDot1(true);
animateDot2(false);
}
function digicove_panel_anchor_toggle(){
'use strict';
$(document).on('click','.pxl-anchor.side-panel',function(e){
e.preventDefault();
e.stopPropagation();
var target=$(this).attr('data-target');
$(this).toggleClass('cliked');
$(target).toggleClass('open');
$('body').toggleClass('side-panel-open');
$('.pxl-overlay-drop').toggleClass('panel-open');
setTimeout(function(){
$(document).find('.pxl-search-form input[name="s"]').focus();
$(document).find('.search-form input[name="s"]').focus();
},1000);
});
$(document).on('click','.custom-link.anchor',function(e){
e.preventDefault();
e.stopPropagation();
var target=$(this).attr('data-target');
$(this).toggleClass('cliked');
$(target).toggleClass('anchor-target-open');
$('.pxl-anchor-bg').toggleClass('anchor-bg-open');
});
$('.pxl-menu-primary li').each(function (){
var $submenu=$(this).find('> ul.sub-menu');
if($submenu.length==1){
$(this).hover(function (){
if($submenu.offset().left + $submenu.width() > $(window).width()){
$submenu.addClass('back');
}else if($submenu.offset().left < 0){
$submenu.addClass('back');
}}, function (){
$submenu.removeClass('back');
});
}});
}
function digicove_loader(){
if($('#pxl-loadding').hasClass('style-text')){
$('#pxl-loadding').addClass('hide');
$(".loading-text").addClass("fadeout");
}else{
$(".pxl-loader").fadeOut("slow");
}}
function digicove_document_click(){
$(document).on('click',function (e){
var target=$(e.target);
var check='.btn-nav-mobile';
if(!(target.is(check))&&target.closest('.pxl-hidden-template').length <=0&&$('body').hasClass('side-panel-open')){
$('.btn-nav-mobile').removeClass('cliked');
$('.pxl-hidden-template').removeClass('open');
$('body').removeClass('side-panel-open');
}});
$(document).on('click','.pxl-close',function(e){
e.preventDefault();
e.stopPropagation();
$(this).closest('.pxl-hidden-template').toggleClass('open');
$('.btn-nav-mobile').removeClass('cliked');
$('body').toggleClass('side-panel-open');
});
$('.pxl-widget-cart-overlay').click(function (e){
e.preventDefault();
$(this).parent().toggleClass('open');
$(this).parents('body').removeClass('ov-hidden');
});
}
$('.pxl-swiper-arrow-custom').parents('.pxl-swiper-sliders').addClass('pxl--hide-arrow');
$('.pxl-navigation-carousel').parents('.elementor-section').addClass('pxl--hide-arrow');
setTimeout(function(){
$('.pxl-swiper-arrow-custom.pxl-swiper-arrow-next').on('click', function (){
$(this).parents('.pxl-swiper-sliders').find('.pxl-swiper-arrow-main.pxl-swiper-arrow-next').trigger('click');
});
$('.pxl-swiper-arrow-custom.pxl-swiper-arrow-prev').on('click', function (){
$(this).parents('.pxl-swiper-sliders').find('.pxl-swiper-arrow-main.pxl-swiper-arrow-prev').trigger('click');
});
}, 300);
setTimeout(function(){
$('.pxl-navigation-carousel .pxl-navigation-arrow-prev').on('click', function (){
$(this).parents('.elementor-section').find('.pxl-swiper-arrow.pxl-swiper-arrow-prev').trigger('click');
});
$('.pxl-navigation-carousel .pxl-navigation-arrow-next').on('click', function (){
$(this).parents('.elementor-section').find('.pxl-swiper-arrow.pxl-swiper-arrow-next').trigger('click');
});
}, 300);
function digicove_header_sticky(){
if($('#pxl-header-elementor').hasClass('is-sticky')){
if(pxl_scroll_top > 100){
$('.pxl-header-elementor-sticky.pxl-sticky-stb').addClass('pxl-header-fixed');
}else{
$('.pxl-header-elementor-sticky.pxl-sticky-stb').removeClass('pxl-header-fixed');
}
if(pxl_scroll_status=='up'&&pxl_scroll_top > 100){
$('.pxl-header-elementor-sticky.pxl-sticky-stt').addClass('pxl-header-fixed');
}else{
$('.pxl-header-elementor-sticky.pxl-sticky-stt').removeClass('pxl-header-fixed');
}}
$('.pxl-header-elementor-sticky').parents('body').addClass('pxl-header-sticky');
}
function digicove_col_offset(){
var w_vc_row_lg=($('#pxl-main').width() - 1620) / 2;
if(pxl_window_width > 1200){
$('body:not(.rtl) .col-offset-left.elementor-column > .elementor-widget-wrap').css('padding-left', w_vc_row_lg + 'px');
$('body:not(.rtl) .col-offset-right.elementor-column > .elementor-widget-wrap').css('padding-right', w_vc_row_lg + 'px');
$('.rtl .col-offset-left.elementor-column > .elementor-widget-wrap').css('padding-right', w_vc_row_lg + 'px');
$('.rtl .col-offset-right.elementor-column > .elementor-widget-wrap').css('padding-left', w_vc_row_lg + 'px');
}}
function digicove_scroll_to_top(){
if(pxl_scroll_top < pxl_window_height){
$('.pxl-scroll-top').addClass('pxl-off').removeClass('pxl-on');
}
if(pxl_scroll_top > pxl_window_height){
$('.pxl-scroll-top').addClass('pxl-on').removeClass('pxl-off');
}}
function digicove_quantity_icon(){
$('#pxl-main .quantity').append('<span class="quantity-icon"><i class="quantity-down">-</i><i class="quantity-up">+</i></span>');
$('.quantity-up').on('click', function (){
$(this).parents('.quantity').find('input[type="number"]').get(0).stepUp();
$(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled');
});
$('.quantity-down').on('click', function (){
$(this).parents('.quantity').find('input[type="number"]').get(0).stepDown();
$(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled');
});
$('.woocommerce-cart-form .actions .button').removeAttr('disabled');
}
function digicove_webgl_effects(){
class WebglHover {
constructor(set){
this.canvas=set.canvas
this.webGLCurtain=new Curtains({
container: this.canvas,
watchScroll: false,
pixelRatio: Math.min(1.5, window.devicePixelRatio)
})
this.planeElement=set.planeElement
this.mouse={
x: 0,
y: 0
}
this.params={
vertexShader: document.getElementById("vs").textContent,
fragmentShader: document.getElementById("fs").textContent,
widthSegments: 40,
heightSegments: 40,
uniforms: {
time: {
name: "uTime",
type: "1f",
value: 0
},
mousepos: {
name: "uMouse",
type: "2f",
value: [0, 0]
},
resolution: {
name: "uReso",
type: "2f",
value: [innerWidth, innerHeight]
},
progress: {
name: "uProgress",
type: "1f",
value: 0
}}
}
this.initPlane()
}
initPlane(){
this.plane=new Plane(this.webGLCurtain, this.planeElement, this.params)
if(this.plane){
this.plane.onReady(()=> {
this.update()
this.initEvent()
})
}}
update(){
this.plane.onRender(()=> {
this.plane.uniforms.time.value +=0.01
this.plane.uniforms.resolution.value=[innerWidth, innerHeight]
})
}
initEvent(){
this.planeElement.addEventListener("mouseenter", ()=> {
gsap.to(this.plane.uniforms.progress, .8, {
value: 1
})
})
this.planeElement.addEventListener("mouseout", ()=> {
gsap.to(this.plane.uniforms.progress, .8, {
value: 0
})
})
}}
$('.pxl-case-grid.layout3 .pxl-grid-item').each(function(){
const $this=$(this);
const item_image_height=$this.find('.image-front').height();
$this.find('.canvas canvas').css('height', item_image_height + 'px');
const initialized=$this.data('initialized');
if(!initialized){
$this.data('initialized', true);
const canvas=$this.find('.canvas')[0];
const planeElement=$this.find('.item--image')[0];
new WebglHover({
canvas: canvas,
planeElement: planeElement
});
}});
}
setTimeout(()=> {
var wobbleElements=document.querySelectorAll('.pxl-wobble');
wobbleElements.forEach(function(el){
el.addEventListener('mouseover', function(){
if(!el.classList.contains('animating')&&!el.classList.contains('mouseover')){
el.classList.add('animating','mouseover');
var letters=el.innerText.split('');
setTimeout(function(){ el.classList.remove('animating'); }, (letters.length + 1) * 50);
var animationName=el.dataset.animation;
if(!animationName){ animationName="pxl-jump"; }
el.innerText='';
letters.forEach(function(letter){
if(letter==" "){
letter="&nbsp;";
}
el.innerHTML +='<span class="letter">'+letter+'</span>';
});
var letterElements=el.querySelectorAll('.letter');
letterElements.forEach(function(letter, i){
setTimeout(function(){
letter.classList.add(animationName);
}, 50 * i);
});
}});
el.addEventListener('mouseout', function(){
el.classList.remove('mouseover');
});
});
}, 100);
function backtotopIndicator(){
var $isHome=$('body .pxl-scroll-top');
if($isHome.length){
var progressPath=document.querySelector('.pxl-progress-circle path');
var pathLength=progressPath.getTotalLength();
progressPath.style.transition=progressPath.style.WebkitTransition='none';
progressPath.style.strokeDasharray=pathLength + ' ' + pathLength;
progressPath.style.strokeDashoffset=pathLength;
progressPath.getBoundingClientRect();
progressPath.style.transition=progressPath.style.WebkitTransition='stroke-dashoffset 10ms linear';
var updateProgress=function (){
var scroll=$(window).scrollTop();
var height=$(document).height() - $(window).height();
var progress=pathLength - (scroll * pathLength / height);
progressPath.style.strokeDashoffset=progress;
}
updateProgress();
$(window).scroll(updateProgress);
}}
function digicove_footer_fixed(){
setTimeout(function(){
var h_footer=$('.pxl-footer-fixed #pxl-footer-elementor').outerHeight() - 1;
$('.pxl-footer-fixed #pxl-main').css('margin-bottom', h_footer + 'px');
}, 600);
}
$(document).ajaxComplete(function(){
digicove_webgl_effects();
});
})(jQuery);
;(function ($){
"use strict";
$(document).ready(function (){
$('.widget_product_search .search-field').find("input[type='text']").each(function (ev){
if(!$(this).val()){
$(this).attr("placeholder", "Search and Press Enter");
}});
$('.product-layout-list').parents('ul.products').addClass('products-list');
$('.single_variation_wrap').addClass('clearfix');
$('.woocommerce-variation-add-to-cart').addClass('clearfix');
var  wooc_product_meta=$('.woocommerce .wooc-product-meta');
var  wooc_product_form=$('.woocommerce form.cart');
if(wooc_product_meta){
wooc_product_meta.append(wooc_product_form);
}
var  wooc_checkout_meta=$('.woocommerce .woocommerce-form-coupon-toggle .woocommerce-info');
var  wooc_checkout_form=$('.woocommerce .woocommerce-form-coupon');
if(wooc_checkout_meta){
wooc_checkout_meta.append(wooc_checkout_form);
wooc_checkout_meta.find('.showcoupon').css('display','none');
wooc_checkout_form.css('display','inline-flex');
}
$('.cart-total-wrap').on('click', function (){
$('.widget-cart-sidebar').toggleClass('open');
$(this).toggleClass('cart-open');
$('.site-overlay').toggleClass('open');
});
$('.site-overlay').on('click', function (){
$(this).removeClass('open');
$(this).parents('#page').find('.widget-cart-sidebar').removeClass('open');
});
$('.woocommerce-tab-heading').on('click', function (){
$(this).toggleClass('open');
$(this).parent().find('.woocommerce-tab-content').slideToggle('');
});
$('.site-menu-right .h-btn-cart, .mobile-menu-cart .h-btn-cart').on('click', function (e){
e.preventDefault();
$(this).parents('#pxl-header-wrap').find('.widget_shopping_cart').toggleClass('open');
$('.pxl-hidden-sidebar').removeClass('open');
$('.pxl-search-popup').removeClass('open');
});
$('.woocommerce-add-to-cart a.button:not(".no-animate")').append('<i>+</i>');
$('.page #pxl-wapper #pxl-main #reviews').remove();
$('.woocommerce-add-to-cart a.button').on('click', function (){
$(this).parents('.woocommerce-product-inner').addClass('cart-added');
});
$('.woocommerce-archive-layout .layout-grid').on('click', function (){
$(this).addClass('active');
$(this).parent().find('.layout-list').removeClass('active');
$(this).parents('.site-main').find('ul.products').addClass('pxl-products-grid').removeClass('pxl-products-list');
});
$('.woocommerce-archive-layout .layout-list').on('click', function (){
$(this).addClass('active');
$(this).parent().find('.layout-grid').removeClass('active');
$(this).parents('.site-main').find('ul.products').addClass('pxl-products-list').removeClass('pxl-products-grid');
});
$('.woocommerce-archive-layout .layout-list.active').parents('.site-main').find('ul.products').addClass('pxl-products-list').removeClass('pxl-products-grid');
});
})(jQuery);
((r,d,l)=>{l={$div:null,settings:null,store:null,chatbox:!1,showed_at:0,is_ready:!1,is_mobile:/Mobile|Android|iPhone|iPad/i.test(navigator.userAgent),can_qr:r.QrCreator&&"function"==typeof QrCreator.render,...l},(r.joinchat_obj=l).$=function(t){return this.$div.querySelector(t)},l.$$=function(t){return this.$div.querySelectorAll(t)},l.send_event=function(o){if((o={event_category:this.settings.event_category||"JoinChat",event_label:"",event_action:"",chat_channel:"whatsapp",chat_id:"--",is_mobile:this.is_mobile?"yes":"no",page_location:location.href,page_title:d.title||"no title",...o}).event_label=o.event_label||o.link||"",o.event_action=o.event_action||o.chat_channel+": "+o.chat_id,delete o.link,d.dispatchEvent(new CustomEvent("joinchat:event",{detail:o,cancelable:!0}))){let t=r[this.settings.data_layer]||r[r.gtm4wp_datalayer_name]||r.dataLayerPYS||r.dataLayer;if("object"==typeof t){let n=r.gtag||function(){t.push(arguments)},s=void 0!==this.settings.ga_event?this.settings.ga_event:"generate_lead";if(s){let e={transport_type:"beacon",...o},i=(Object.keys(e).forEach(t=>{"page_location"===t?e[t]=e[t].substring(0,1e3):"page_referrer"===t?e[t]=e[t].substring(0,420):"page_title"===t?e[t]=e[t].substring(0,300):"string"==typeof e[t]&&(e[t]=e[t].substring(0,100))}),[]),a=t=>{i.includes(t)||(t.startsWith("G-")||t.startsWith("GT-"))&&(i.push(t),n("event",s,{send_to:t,...e}))};if(r.google_tag_data&&google_tag_data.tidr&&google_tag_data.tidr.destination)for(var h in google_tag_data.tidr.destination)a(h);t.forEach(t=>{"config"===t[0]&&t[1]&&a(t[1])})}this.settings.gads&&n("event","conversion",{send_to:this.settings.gads})}var e,i,a=o.event_category;delete o.event_category,"object"==typeof t&&t.push({event:a,...o}),"function"==typeof fbq&&("whatsapp"===o.chat_channel&&(i=""+(e=o.chat_id).substring(0,3)+"X".repeat(e.length-5)+e.substring(e.length-2),o.chat_id=i,o.event_label=o.event_label.replace(e,i),o.event_action=o.event_action.replace(e,i)),fbq("trackCustom",a,o))}},l.get_wa_link=function(t,e,i){e=void 0!==e?e:this.settings.message_send||"",i=void 0!==i?i:this.settings.whatsapp_web&&!this.is_mobile;i=new URL((i?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+(t||this.settings.telephone));return e&&i.searchParams.set("text",e),i.toString()},l.track_click=function(t){var e;this.settings.tracking_url&&(e={trigger:t.trigger||"unknown",chat_channel:t.chat_channel||"",chat_id:t.chat_id||"",is_mobile:this.is_mobile?"1":"0"},d.dispatchEvent(new CustomEvent("joinchat:track",{detail:{params:t,payload:e},cancelable:!0})))&&(t=new URLSearchParams(e),this.settings.tracking_nonce&&t.set("nonce",this.settings.tracking_nonce),"function"==typeof navigator.sendBeacon?navigator.sendBeacon(this.settings.tracking_url,t):fetch(this.settings.tracking_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:t.toString(),keepalive:!0,credentials:"same-origin"}).catch(()=>{}))},l.show=function(t){this.$div.removeAttribute("hidden"),this.$div.classList.add("joinchat--show"),t&&this.$div.classList.add("joinchat--tooltip")},l.hide=function(){this.$div.classList.remove("joinchat--show")},l.chatbox_show=function(t="unknown"){this.chatbox||(this.chatbox=!0,this.showed_at=Date.now(),clearTimeout(this.open_text_anim_timeout),this.$div.classList.add("joinchat--chatbox"),this.$div.classList.add("joinchat--opening"),this.open_text_anim_timeout=setTimeout(()=>this.$div.classList.remove("joinchat--opening"),550),this.settings.message_badge&&this.$(".joinchat__badge").classList.replace("joinchat__badge--in","joinchat__badge--out"),d.dispatchEvent(new CustomEvent("joinchat:show",{detail:{trigger:t}})))},l.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,clearTimeout(this.open_text_anim_timeout),this.$div.classList.remove("joinchat--chatbox","joinchat--tooltip","joinchat--opening"),this.settings.message_badge&&this.$(".joinchat__badge").classList.remove("joinchat__badge--out"),d.dispatchEvent(new Event("joinchat:hide")))},l.save_hash=function(){var t;!this.settings.message_hash||this.settings.message_delay<0||(t=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean)).includes(this.settings.message_hash)||(t.push(this.settings.message_hash),this.store.setItem("joinchat_hashes",t.join(",")))},l.open_whatsapp=function(t,e,i="unknown"){t=t||this.settings.telephone,e=void 0!==e?e:this.settings.message_send||"";t={link:this.get_wa_link(t,e),chat_channel:"whatsapp",chat_id:t,chat_message:e,trigger:i};d.dispatchEvent(new CustomEvent("joinchat:open",{detail:t,cancelable:!0}))&&(this.track_click(t),this.send_event(t),r.open(t.link,"joinchat","noopener"))},l.need_optin=function(){return this.$div.classList.contains("joinchat--optout")},l.use_qr=function(){return!!this.settings.qr&&this.can_qr&&!this.is_mobile},l.open=function(t,e,i,a="unknown"){t&&!this.need_optin()||!l.$(".joinchat__chatbox")?Date.now()<l.showed_at+600||(this.save_hash(),this.open_whatsapp(e,i,a)):this.chatbox_show(a)},l.close=function(){this.save_hash(),this.chatbox_hide()},l.rand_text=function(t){t.querySelectorAll("jc-rand").forEach(t=>{var e=t.children;t.insertAdjacentHTML("afterend",e[Math.floor(Math.random()*e.length)].innerHTML),t.remove()})},l.qr=function(t,e){var i=d.createElement("CANVAS");return QrCreator.render(Object.assign({text:t,radius:.4,background:"#FFF",size:200*(r.devicePixelRatio||1)},this.settings.qr||{},e||{}),i),i};var t=()=>{if(l.$div=d.querySelector(".joinchat"),l.$div){l.settings=JSON.parse(l.$div.dataset.settings);try{localStorage.test=2,l.store=localStorage}catch(t){l.store={_data:{},setItem:function(t,e){this._data[t]=String(e)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if(l.settings&&l.settings.telephone){if(l.is_mobile||!l.settings.mobile_only){d.dispatchEvent(new Event("joinchat:starting"));var e=1e3*l.settings.button_delay,n=Math.max(0,1e3*l.settings.message_delay);let c=!!l.settings.message_hash;var s=parseInt(l.store.getItem("joinchat_views")||1)>=l.settings.message_views,o=(l.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);let i=void 0!==l.settings.cta_viewed?l.settings.cta_viewed:-1!==o.indexOf(l.settings.message_hash||"none"),t=!i&&(l.settings.message_badge||!c||!n||!s),a=(setTimeout(()=>l.show(t),e),(t,e=!1)=>l.open(e,void 0,void 0,t));if(c&&!i&&n){let t;l.settings.message_badge?t=setTimeout(()=>l.$(".joinchat__badge").classList.add("joinchat__badge--in"),e+n):s&&(t=setTimeout(()=>a("auto"),e+n)),d.addEventListener("joinchat:show",()=>clearTimeout(t),{once:!0})}if(o=l.$(".joinchat__button"),!l.is_mobile){let t;o.addEventListener("mouseenter",()=>{l.$(".joinchat__chatbox")&&(t=setTimeout(()=>a("hover"),1500))}),o.addEventListener("mouseleave",()=>{clearTimeout(t)})}if(o.addEventListener("click",()=>a("button")),l.$(".joinchat__open")?.addEventListener("click",()=>a("contact",!0)),l.$(".joinchat__close")?.addEventListener("click",()=>l.close()),l.$("#joinchat_optin")?.addEventListener("change",t=>{t=t.target.checked;l.$div.classList.toggle("joinchat--optout",!t),d.dispatchEvent(new CustomEvent("joinchat:optin",{detail:{optin:t}}))}),l.is_mobile){let e,t,i=()=>{var t=(d.activeElement.type||"").toLowerCase();["date","datetime","email","month","number","password","search","tel","text","textarea","time","url","week"].includes(t)?l.chatbox?(l.chatbox_hide(),setTimeout(()=>l.hide(),400)):l.hide():l.show()};["focusin","focusout"].forEach(t=>d.addEventListener(t,t=>{t.target.matches("input, textarea")&&!l.$div.contains(t.target)&&(clearTimeout(e),e=setTimeout(i,200))})),r.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{l.$div.style.setProperty("--vh",r.innerHeight+"px")},200)}),r.dispatchEvent(new Event("resize"))}if(l.use_qr()?l.$(".joinchat__qr").appendChild(l.qr(l.get_wa_link(void 0,void 0,!1))):l.$(".joinchat__qr")?.remove(),n&&!s&&l.store.setItem("joinchat_views",parseInt(l.store.getItem("joinchat_views")||0)+1),d.addEventListener("joinchat:show",()=>{let a=l.$(".joinchat__scroll"),n=l.$(".joinchat__chat"),s=l.$$(".joinchat__bubble");var t=r.matchMedia("(prefers-reduced-motion)").matches;if(!n)return;if(c&&l.rand_text(n),l.$$("[data-src]").forEach(t=>{t.setAttribute("src",t.dataset.src),t.removeAttribute("data-src")}),!t){1<s.length&&(s.forEach(t=>t.classList.add("joinchat--hidden")),l.$(".joinchat__optin")?.classList.add("joinchat--hidden"));let e=n.offsetHeight,i;new MutationObserver(()=>{var t;a.scrollHeight>a.offsetHeight||(t=n.offsetHeight,clearTimeout(i),n.style.height=e+"px",n.offsetHeight,n.style.height=t+"px",e=t,i=setTimeout(()=>{n.style.height="",e=n.offsetHeight},205))}).observe(n,{childList:!0,attributes:!0,attributeFilter:["class"]})}if(s.length<=1||t)return void setTimeout(()=>n.dispatchEvent(new Event("joinchat:bubbles")),1);let e=0,i=(t,e)=>Math.round(Math.random()*(e-t)+t),o=(t,e)=>{l.$(".joinchat__bubble--loading")?.remove(),t.classList.remove("joinchat--hidden"),setTimeout(h,e)},h=()=>{if(e>=s.length)l.$(".joinchat__optin")?.classList.remove("joinchat--hidden"),n.dispatchEvent(new Event("joinchat:bubbles"));else{let t=s[e++];t.classList.contains("joinchat__bubble--note")?o(t,210):(n.insertAdjacentHTML("beforeend",'<div class="joinchat__bubble joinchat__bubble--loading"></div>'),setTimeout(()=>o(t,i(400,600)),Math.min(60*t.textContent.split(/\s+/).length+210,3e3)))}};h()},{once:!0}),"#joinchat"!==(e=new URL(r.location)).hash&&!e.searchParams.has("joinchat")||(o=1e3*(parseInt(e.searchParams.get("joinchat"))||0),setTimeout(()=>l.show(),o),setTimeout(()=>l.chatbox_show("url"),700+o)),d.addEventListener("click",t=>{var e=t.target.closest('.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]');e&&(t.preventDefault(),t=e===e.closest('.joinchat_app, a[href="#whatsapp"]'),l.open(t,e.dataset.phone,e.dataset.message,"trigger"))}),d.addEventListener("click",t=>{t.target.closest(".joinchat_close")&&(t.preventDefault(),l.close())}),n=d.querySelectorAll(".joinchat_show, .joinchat_force_show"),c&&n&&"IntersectionObserver"in r){let e=new IntersectionObserver(t=>{t.forEach(t=>{t.intersectionRatio<=0||i&&!t.target.classList.contains("joinchat_force_show")||(e.disconnect(),a("screen"))})});n.forEach(t=>e.observe(t))}l.is_ready=!0,d.dispatchEvent(new Event("joinchat:start"))}else l.hide(),d.addEventListener("click",t=>{var e=t.target.closest('.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]');e&&(t.preventDefault(),l.open_whatsapp(e.dataset.phone,e.dataset.message,"trigger"))});if(l.can_qr&&!l.is_mobile?d.querySelectorAll(".joinchat-button__qr").forEach(t=>t.appendChild(l.qr(l.get_wa_link(t.dataset.phone,t.dataset.message,!1)))):d.querySelectorAll(".wp-block-joinchat-button figure").forEach(t=>t.remove()),void 0!==l.settings.sku&&"function"==typeof jQuery){let a=l.settings.message_send;jQuery("form.variations_form").on("found_variation reset_data",function(t,e){let i=e&&e.sku||l.settings.sku;l.$$(".joinchat__chat jc-sku").forEach(t=>t.textContent=i),l.settings.message_send=a.replace(/<jc-sku>.*<\/jc-sku>/g,i)})}}}};"loading"!==d.readyState?t():d.addEventListener("DOMContentLoaded",t)})(window,document,window.joinchat_obj||{});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);
window.addEventListener("load",function(){function e(){var e=document.querySelector("[fncls='fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99']");e&&e.parentNode&&e.parentNode.removeChild(e),(e=document.createElement("script")).id="fconfig",e.type="application/json",e.setAttribute("fncls","fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99");var t={f:FraudNetConfig.f,s:FraudNetConfig.s};"1"===FraudNetConfig.sandbox&&(t.sandbox=!0),e.text=JSON.stringify(t),document.body.appendChild(e);var n=document.forms.order_review;if(n){var d=document.createElement("input");d.setAttribute("type","hidden"),d.setAttribute("name","pui_pay_for_order_session_id"),d.setAttribute("value",FraudNetConfig.f),n.appendChild(d)}!function(){var e=document.createElement("script");e.src="https://c.paypal.com/da/r/fb.js",document.body.appendChild(e)}()}document.addEventListener("hosted_fields_loaded",function(t){PAYPAL.asyncData&&"function"==typeof PAYPAL.asyncData.initAndCollect&&PAYPAL.asyncData.initAndCollect(),e()}),e()});
(()=>{"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){if(Array.isArray(e))return e}const l="email",a="phone",u="name",c={[l]:["email","e-mail","mail","email address"],[a]:["phone","tel","mobile","cell","telephone","phone number"],[u]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function f(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function s(e){const t=f(e),r=t.lastIndexOf("@");if(-1===r)return t;const n=t.slice(r+1);if(["gmail.com","googlemail.com"].includes(n)){const e=t.slice(0,r).replace(/\./g,"");return"".concat(e,"@").concat(n)}return t}function m(e){const t=f(e),r=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(r):r}function y(l){const a=l.filter(e=>e.type===u).map(e=>f(e.value)).filter(Boolean);if(!a.length)return;const c=o(y=1===a.length?a[0].split(" "):a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(y)||n(y)||r(),s=c[0],m=i(c).slice(1);var y;return function(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){t(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}({first_name:s},(null==m?void 0:m.length)>0?{last_name:m.join(" ")}:{})}function p(e){var t;return null===(t=e.find(e=>e.type===l))||void 0===t?void 0:t.value}function v(e){var t;return null===(t=e.find(e=>e.type===a))||void 0===t?void 0:t.value}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}globalThis.document.addEventListener("wpcf7mailsent",e=>{var t,i,h;const O=(null===(t=globalThis._googlesitekit)||void 0===t?void 0:t.gtagUserData)?function(e){if(!(e&&e instanceof HTMLFormElement))return;const t=new FormData(e);return function(e){const t=[["address",y(e)],["email",p(e)],["phone_number",v(e)]].filter(e=>{return(t=e,i=2,o(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(t,i)||n(t,i)||r())[1];var t,i});if(0!==t.length)return Object.fromEntries(t)}(Array.from(t.entries()).map(t=>{var r;let n=(p=2,function(e){if(Array.isArray(e))return e}(y=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(y,p)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(y,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=n[0],o=n[1];var y,p;const v=e.querySelector("[name='".concat(i,"']")),d=null==v?void 0:v.type;return"hidden"===d||"submit"===d?null:function(e){let t=e||{},r=t.type,n=t.name,i=t.value,o=t.label;switch(r=f(r),n=f(n),i=f(i),o=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(o),r){case"email":return{type:l,value:s(i)};case"tel":return{type:a,value:m(i)}}return function(e){if(!e)return!1;const t=s(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(i)||c[l].includes(n)||c[l].includes(o)?{type:l,value:s(i)}:c[a].includes(n)||c[a].includes(o)?{type:a,value:m(i)}:c[u].includes(n)||c[u].includes(o)?{type:u,value:f(i)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=m(e);if(!/^\+?\d{7,}$/.test(t))return!1;const r=/[\s\-()+.]/.test(e),n=e.trim().startsWith("+");return!(!r&&!n)}(i)?{type:a,value:m(i)}:null}({type:d,label:null!=v&&v.id?null===(r=e.querySelector("label[for='".concat(null==v?void 0:v.id,"']")))||void 0===r?void 0:r.textContent:void 0,name:i,value:o})}).filter(Boolean))}(e.target):null,j=e.detail.contactFormId;null===(i=globalThis._googlesitekit)||void 0===i||null===(h=i.gtagEvent)||void 0===h||h.call(i,"contact",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){g(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({event_category:j,event_label:e.detail.unitTag,googlesitekit_event_provider:"contact-form-7",googlesitekit_form_id:String(j)},O?{user_data:O}:{}))})})();
(()=>{var e={9885(e){function t(){this.listeners={}}t.prototype.emit=function(e,t){this.listeners[e]=this.listeners[e]??[],this.listeners[e].forEach(e=>e.apply(null,t))},t.prototype.on=function(e,t){this.listeners[e]=this.listeners[e]??[],this.listeners[e].push(t)},e.exports=t},5626(){function e(e){const t=!!e.getAttribute("data-show-if"),n=t?e.getAttribute("data-show-if").split(":"):e.getAttribute("data-hide-if").split(":"),r=n[0],i=(n.length>1?n[1]:"*").split("|"),o=function(e,t){const n=[],r=e.querySelectorAll('input[name="'+t+'"],select[name="'+t+'"],textarea[name="'+t+'"]');for(let e=0;e<r.length;e++)("radio"!==r[e].type&&"checkbox"!==r[e].type||r[e].checked)&&n.push(r[e].value);return n}(function(e){let t=e;for(;t.parentElement;)if(t=t.parentElement,"FORM"===t.tagName)return t;return null}(e),r);let s=!1;for(let e=0;e<o.length&&!s;e++)s=i.indexOf(o[e])>-1||i.indexOf("*")>-1&&o[e].length>0;e.style.display=t?s?"":"none":s?"none":"";const a=e.querySelectorAll("input,select,textarea");for(let e=0;e<a.length;e++)(s||t)&&a[e].getAttribute("data-was-required")&&(a[e].required=!0,a[e].removeAttribute("data-was-required")),s&&t||!a[e].required||(a[e].setAttribute("data-was-required","true"),a[e].required=!1)}function t(){const t=document.querySelectorAll(".mc4wp-form [data-show-if],.mc4wp-form [data-hide-if]");for(let n=0;n<t.length;n++)e(t[n])}function n(t){if(!t.target||!t.target.form||t.target.form.className.indexOf("mc4wp-form")<0)return;const n=t.target.form.querySelectorAll("[data-show-if],[data-hide-if]");for(let t=0;t<n.length;t++)e(n[t])}document.addEventListener("keyup",n,!0),document.addEventListener("change",n,!0),document.addEventListener("mc4wp-refresh",t,!0),window.addEventListener("load",t),t()},6942(e,t,n){const r=n(2076),i=n(6564),o=function(e,t){this.id=e,this.element=t||document.createElement("form"),this.name=this.element.getAttribute("data-name")||"Form #"+this.id,this.errors=[],this.started=!1};o.prototype.setData=function(e){try{i(this.element,e)}catch(e){console.error(e)}},o.prototype.getData=function(){return r(this.element,{hash:!0,empty:!0})},o.prototype.getSerializedData=function(){return r(this.element,{hash:!1,empty:!0})},o.prototype.setResponse=function(e){this.element.querySelector(".mc4wp-response").innerHTML=e},o.prototype.reset=function(){this.setResponse(""),this.element.querySelector(".mc4wp-form-fields").style.display="",this.element.reset()},e.exports=o},9685(e,t,n){const r=n(6942),i=[],o=new(n(9885));function s(e,t){t=t||parseInt(e.getAttribute("data-id"))||0;const n=new r(t,e);return i.push(n),n}e.exports={get:function(e){e=parseInt(e);for(let t=0;t<i.length;t++)if(i[t].id===e)return i[t];return s(document.querySelector(".mc4wp-form-"+e),e)},getByElement:function(e){const t=e.form||e;for(let e=0;e<i.length;e++)if(i[e].element===t)return i[e];return s(t)},on:function(e,t){o.on(e,t)},trigger:function(e,t){"submit"===e||e.indexOf(".submit")>0?(o.emit(t[0].id+"."+e,t),o.emit(e,t)):window.setTimeout(function(){o.emit(t[0].id+"."+e,t),o.emit(e,t)},10)}}},2076(e){var t=/^(?:submit|button|image|reset|file)$/i,n=/^(?:input|select|textarea|keygen)/i,r=/(\[[^\[\]]*\])/g;function i(e,t,n){if(0===t.length)return n;var r=t.shift(),o=r.match(/^\[(.+?)\]$/);if("[]"===r)return e=e||[],Array.isArray(e)?e.push(i(null,t,n)):(e._values=e._values||[],e._values.push(i(null,t,n))),e;if(o){var s=o[1],a=+s;isNaN(a)?(e=e||{})[s]=i(e[s],t,n):(e=e||[])[a]=i(e[a],t,n)}else e[r]=i(e[r],t,n);return e}function o(e,t,n){if(t.match(r))i(e,function(e){var t=[],n=new RegExp(r),i=/^([^\[\]]*)/.exec(e);for(i[1]&&t.push(i[1]);null!==(i=n.exec(e));)t.push(i[1]);return t}(t),n);else{var o=e[t];o?(Array.isArray(o)||(e[t]=[o]),e[t].push(n)):e[t]=n}return e}function s(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}e.exports=function(e,r){"object"!=typeof r?r={hash:!!r}:void 0===r.hash&&(r.hash=!0);for(var i=r.hash?{}:"",a=r.serializer||(r.hash?o:s),c=e&&e.elements?e.elements:[],l=Object.create(null),u=0;u<c.length;++u){var f=c[u];if((r.disabled||!f.disabled)&&f.name&&n.test(f.nodeName)&&!t.test(f.type)){var d=f.name,h=f.value;if("checkbox"!==f.type&&"radio"!==f.type||f.checked||(h=void 0),r.empty){if("checkbox"!==f.type||f.checked||(h=""),"radio"===f.type&&(l[f.name]||f.checked?f.checked&&(l[f.name]=!0):l[f.name]=!1),null==h&&"radio"==f.type)continue}else if(!h)continue;if("select-multiple"!==f.type)i=a(i,d,h);else{h=[];for(var p=f.options,m=!1,g=0;g<p.length;++g){var y=p[g],v=r.empty&&!y.value,w=y.value||v;y.selected&&w&&(m=!0,i=r.hash&&"[]"!==d.slice(d.length-2)?a(i,d+"[]",y.value):a(i,d,y.value))}!m&&r.empty&&(i=a(i,d,""))}}}if(r.empty)for(var d in l)l[d]||(i=a(i,d,""));return i}},6564(e){e.exports&&(e.exports=function e(t,n,r){for(const i in n){if(!n.hasOwnProperty(i))continue;const o=i;let s=n[i];if(void 0===s&&(s=""),null===s&&(s=""),void 0!==r&&(o=r+"["+i+"]"),s.constructor===Array)o+="[]";else if("object"==typeof s){e(t,s,o);continue}const a=t.elements.namedItem(o);if(!a)continue;const c=a.type||a[0].type;switch(c){default:a.value=s;break;case"radio":case"checkbox":{const e=s.constructor===Array?s:[s];for(let t=0;t<a.length;t++)a[t].checked=e.indexOf(a[t].value)>-1}break;case"select-multiple":{const e=s.constructor===Array?s:[s];for(let t=0;t<a.options.length;t++)a.options[t].selected=e.indexOf(a.options[t].value)>-1}break;case"select":case"select-one":a.value=s.toString()||s;break;case"date":a.value=new Date(s).toISOString().split("T")[0]}const l=new Event("change",{bubbles:!0});switch(c){default:a.dispatchEvent(l);break;case"radio":case"checkbox":for(let e=0;e<a.length;e++)a[e].checked&&a[e].dispatchEvent(l)}}})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}const r=window.mc4wp||{},i=n(9685);function o(e,t){document.addEventListener(e,e=>{if(!e.target)return;const n=e.target;("string"==typeof n.className&&n.className.indexOf("mc4wp-form")>-1||"function"==typeof n.matches&&n.matches(".mc4wp-form *"))&&t.call(e,e)},!0)}n(5626),o("submit",function(e){if(e.defaultPrevented)return;const t=i.getByElement(e.target);i.trigger("submit",[t,e])}),o("focus",function(e){const t=i.getByElement(e.target);t.started||(i.trigger("started",[t,e]),t.started=!0)}),o("change",function(e){const t=i.getByElement(e.target);i.trigger("change",[t,e])}),r.listeners&&([].forEach.call(r.listeners,function(e){i.on(e.event,e.callback)}),delete r.listeners),r.forms=i,window.mc4wp=r})();
(()=>{"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){if(Array.isArray(e))return e}const l="email",a="phone",u="name",c={[l]:["email","e-mail","mail","email address"],[a]:["phone","tel","mobile","cell","telephone","phone number"],[u]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function f(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function s(e){const t=f(e),r=t.lastIndexOf("@");if(-1===r)return t;const n=t.slice(r+1);if(["gmail.com","googlemail.com"].includes(n)){const e=t.slice(0,r).replace(/\./g,"");return"".concat(e,"@").concat(n)}return t}function m(e){const t=f(e),r=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(r):r}function y(l){const a=l.filter(e=>e.type===u).map(e=>f(e.value)).filter(Boolean);if(!a.length)return;const c=o(y=1===a.length?a[0].split(" "):a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(y)||n(y)||r(),s=c[0],m=i(c).slice(1);var y;return function(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){t(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}({first_name:s},(null==m?void 0:m.length)>0?{last_name:m.join(" ")}:{})}function p(e){var t;return null===(t=e.find(e=>e.type===l))||void 0===t?void 0:t.value}function v(e){var t;return null===(t=e.find(e=>e.type===a))||void 0===t?void 0:t.value}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h;(h=globalThis.mc4wp)&&h.forms.on("subscribed",(e,t)=>{var i,h,O;const j=(null===(i=globalThis._googlesitekit)||void 0===i?void 0:i.gtagUserData)?function(e,t){if(!(e&&e instanceof HTMLFormElement))return;return function(e){const t=[["address",y(e)],["email",p(e)],["phone_number",v(e)]].filter(e=>{return(t=e,i=2,o(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(t,i)||n(t,i)||r())[1];var t,i});if(0!==t.length)return Object.fromEntries(t)}(Object.entries(t).map(r=>{var n;let i=(v=2,function(e){if(Array.isArray(e))return e}(p=r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(p,v)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(p,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],y=i[1];var p,v;if("NAME"===o&&("FNAME"in t||"LNAME"in t))return null;const g=e.querySelector("[name='".concat(o,"']"));return function(e){let t=e||{},r=t.type,n=t.name,i=t.value,o=t.label;switch(r=f(r),n=f(n),i=f(i),o=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(o),r){case"email":return{type:l,value:s(i)};case"tel":return{type:a,value:m(i)}}return function(e){if(!e)return!1;const t=s(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(i)||c[l].includes(n)||c[l].includes(o)?{type:l,value:s(i)}:c[a].includes(n)||c[a].includes(o)?{type:a,value:m(i)}:c[u].includes(n)||c[u].includes(o)?{type:u,value:f(i)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=m(e);if(!/^\+?\d{7,}$/.test(t))return!1;const r=/[\s\-()+.]/.test(e),n=e.trim().startsWith("+");return!(!r&&!n)}(i)?{type:a,value:m(i)}:null}({type:null==g?void 0:g.type,label:null!=g&&g.id?null===(n=e.querySelector("label[for='".concat(null==g?void 0:g.id,"']")))||void 0===n?void 0:n.textContent:void 0,name:o,value:y})}).filter(Boolean))}(e.element,t):null;null===(h=globalThis._googlesitekit)||void 0===h||null===(O=h.gtagEvent)||void 0===O||O.call(h,"submit_lead_form",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({event_category:"mailchimp",googlesitekit_event_provider:"mailchimp",googlesitekit_form_id:String(e.id)},j?{user_data:j}:{}))})})();