(()=>{var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var r in a)t.o(a,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var a=globalThis.document;if(!e&&a&&(a.currentScript&&"SCRIPT"===a.currentScript.tagName.toUpperCase()&&(e=a.currentScript.src),!e)){var r=a.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e})(),t.p=window.wcpayAssets.url,(()=>{"use strict";const e=window.wp.i18n,a=window.wp.hooks,r=t=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[t]?wcpayConfig[t]:n(t),n=t=>{let e=null;if("undefined"!=typeof wcpay_upe_config)e=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;e=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return e[t]||null},o=t=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(t)?wcpayExpressCheckoutParams[t]:null;class s{constructor(t,e){this.options=t,this.stripe=null,this.stripePlatform=null,this.request=e}createStripe(t,e,a="",r=[]){const n={locale:e};return a&&(n.stripeAccount=a),r&&(n.betas=r),new Stripe(t,n)}async getStripeForUPE(t){return this.options.forceNetworkSavedCards=n("paymentMethodsConfig")[t].forceNetworkSavedCards,this.getStripe()}async getStripe(t=!1){let e=0;for(;!window.Stripe;)if(await new Promise(t=>setTimeout(t,100)),e+=100,e>6e5)throw new Error("Stripe object not found");return this.__getStripe(t)}__getStripe(t=!1){const{publishableKey:e,accountId:a,forceNetworkSavedCards:r,locale:n,isStripeLinkEnabled:o}=this.options;if(r&&!t)return this.stripePlatform||(this.stripePlatform=this.createStripe(e,n)),this.stripePlatform;if(!this.stripe){let t=["card_country_event_beta_1"];o&&(t=t.concat(["link_autofill_modal_beta_1"])),this.stripe=this.createStripe(e,n,a,t)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(t){return{error:t}}}confirmIntent(t,e=!1){const a=t.match(/#wcpay-confirm-(pi|si):([^:]+):([^:]+):([^:]+)(?::(.+))?$/);if(!a)return!0;const n="si"===a[1];let s=a[2];const i=a[3],c=a[4],p=a[5]||null,u=t.indexOf("order-pay"),l=u>-1&&t.substring(u).match(/\d+/);return l&&(s=l[0]),(async()=>{const{locale:t,publishableKey:e}=this.options,a=r("accountIdForIntentConfirmation");if(n){const t=await this.getStripe(!0);return p?t.confirmSetup({clientSecret:i,confirmParams:{confirmation_token:p},redirect:"if_required"}):t.handleNextAction({clientSecret:i})}return a?this.createStripe(e,t,a).confirmCardPayment(i):(await this.getStripe(!0)).handleNextAction({clientSecret:i})})().then(t=>{let a=null;t.paymentIntent?.last_payment_error&&(a={message:t.paymentIntent.last_payment_error.message}),"requires_action"===t.paymentIntent?.status&&(a={message:"Payment requires additional action."});const n=t.paymentIntent&&t.paymentIntent.id||t.setupIntent&&t.setupIntent.id||t.error&&t.error.payment_intent&&t.error.payment_intent.id||t.error.setup_intent&&t.error.setup_intent.id,i=o("ajax_url")??r("ajaxUrl"),p=r("isChangingPayment");return[this.request(i,{action:"update_order_status",order_id:s,_ajax_nonce:c,intent_id:n,should_save_payment_method:e?"true":"false",is_changing_payment:p?"true":"false"}),a,t.error]}).then(([t,e,a])=>{if(a)throw a;return t.then(t=>{const a="string"==typeof t?JSON.parse(t):t;if(a.error)throw a.error;if(e)throw e;return a.return_url})})}async setupIntent(t,e=""){const a=await this.request(r("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":t,_ajax_nonce:r("createSetupIntentNonce"),"wcpay-fraud-prevention-token":window.wcpayFraudPreventionToken??"","wcpay-fingerprint":e});if(!a.success)throw a.data.error;if("succeeded"===a.data.status)return a.data;const n=await this.getStripe(),o=await n.confirmCardSetup(a.data.client_secret),{setupIntent:s,error:i}=o;if(i)throw i;return s}expressCheckoutAddToCart(t){const e=r("wcAjaxUrl"),a=r("addToCartNonce");return this.request(((t,e,a="wcpay_")=>t.toString().replace("%%endpoint%%",a+e))(e,"add_to_cart"),{security:a,...t})}}jQuery(t=>{t("input[name=wc_deposit_option],input[name=wc_deposit_payment_plan]").on("change",()=>{(0,a.doAction)("wcpay.express-checkout.update-button-data")})}),(0,a.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",t=>{const e={};return jQuery("input[name=wc_deposit_option]").length&&(e.wc_deposit_option=jQuery("input[name=wc_deposit_option]:checked").val()),jQuery("input[name=wc_deposit_payment_plan]").length&&(e.wc_deposit_payment_plan=jQuery("input[name=wc_deposit_payment_plan]:checked").val()),{...t,...e}});const i="wcpay-express-checkout__order-attribution-inputs",c=()=>{(()=>{if(document.getElementById(i))return;const t=document.createElement("wc-order-attribution-inputs");t.id=i,document.body.appendChild(t)})(),window?.wc_order_attribution?.setOrderTracking(window?.wc_order_attribution?.params?.allowTracking)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c(),(0,a.addFilter)("wcpay.express-checkout.cart-place-order-extension-data","automattic/wcpay/express-checkout",t=>{const e=jQuery("#wcpay-express-checkout__order-attribution-inputs input");if(!e.length)return t;const a={};return e.each(function(){const t=jQuery(this).attr("name").replace("wc_order_attribution_",""),e=jQuery(this).val();t&&e&&(a[t]=e)}),{...t,"woocommerce/order-attribution":a}});let p=null,u=null;const l=()=>jQuery(u),d={init:({elementId:t,$separator:e})=>{u=t,p=e},getButtonSeparator:()=>p,blockButton:()=>{l().data("blockUI.isBlocked")||l().block({message:null})},unblockButton:()=>{d.showContainer(),l().unblock()},renderButton:t=>{l()?.length&&t.mount(u)},hideContainer:()=>{l().removeClass("is-ready").hide()},showContainer:()=>{l().addClass("is-ready").show()}},m=d,y=(t,e,a=!1)=>{let r;return function(){const n=this,o=arguments,s=a&&!r;clearTimeout(r),r=setTimeout(()=>{r=null,a||e.apply(n,o)},t),s&&e.apply(n,o)}},_=t=>void 0!==window.wcpayExpressCheckoutParams?window.wcpayExpressCheckoutParams[t]??null:void 0!==window.wc?.wcSettings?window.wc.wcSettings.getSetting("ece_data")?.[t]??null:null,h=()=>document.querySelector(".single_add_to_cart_button")||document.querySelector('.wp-block-add-to-cart-with-options button[type="submit"]'),w=()=>{const t=document.querySelector(".single_add_to_cart_button");if(t)return t.value;const e=document.querySelector('.wp-block-add-to-cart-with-options input[name="add-to-cart"]');return e?.value},g=()=>{const t=document.querySelector(".quantity .qty");return t&&parseInt(t.value,10)||1},f=()=>!!document.querySelector(".wp-block-add-to-cart-with-options"),b=()=>document.querySelectorAll(".wp-block-add-to-cart-with-options .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute"),k=()=>{const t=[];return b().forEach(e=>{let a;try{a=JSON.parse(e.dataset.wpContext)?.name}catch(t){a=void 0}if(!a)return;const r=e.querySelector("select"),n=r?r.value:e.querySelector('[aria-checked="true"]')?.value;n&&t.push({attribute:a,value:n})}),t},x=()=>{if(f()){const t=document.querySelector(".wp-block-add-to-cart-with-options");return!!t&&t.classList.contains("is-invalid")}const t=h();return!!t&&t.classList.contains("disabled")};jQuery(t=>{t(document.body).on("woocommerce_variation_has_changed",async()=>{(0,a.doAction)("wcpay.express-checkout.update-button-data")});const e=b();if(e.length){let t=null;const r=new MutationObserver(y(250,()=>{const e=JSON.stringify(k());e!==t&&(t=e,(0,a.doAction)("wcpay.express-checkout.update-button-data"))}));e.forEach(t=>r.observe(t,{subtree:!0,childList:!0,attributes:!0}))}}),jQuery(t=>{if("product"!==_("button_context"))return;const e=t(".quantity");e.on("input",".qty",()=>{m.blockButton()}),e.on("input",".qty",y(250,async()=>{(0,a.doAction)("wcpay.express-checkout.update-button-data")}))}),(0,a.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",t=>{const e={...t},a=document.querySelector('.single_variation_wrap input[name="product_id"]');a&&(e.id=parseInt(a.value,10));const r=f()?k():(()=>{const t=document.querySelector(".variations_form");if(!t)return[];const e=[];return t.querySelectorAll(".variations select").forEach(t=>{const a=t.dataset.attribute_name||t.dataset.name;if(!a)return;const r=document.querySelector(`label[for="${a.replace("attribute_","")}"]`);r&&e.push({attribute:Array.from(r.childNodes)[0].textContent,value:t.value||""}),e.push({attribute:a,value:t.value||""})}),e})();return r.length&&(e.variation=[...t.variation,...r]),e}),(0,a.addFilter)("wcpay.express-checkout.map-line-items","automattic/wcpay/express-checkout",t=>({...t,items:t.items.filter(t=>!t.extensions?.bundles?.bundled_by)}));const v=window.wp.htmlEntities,C=(t,e)=>{const a=_("checkout")?.stripe_minor_unit??2,r=t*10**(a-e.currency_minor_unit);return a<e.currency_minor_unit?Math.round(r):r},S=t=>{const r=_("checkout").display_prices_with_tax,n=(0,a.applyFilters)("wcpay.express-checkout.map-line-items",t),o=n.items.map(t=>({amount:C(r&&t.totals?parseInt(t.totals.line_subtotal,10)+parseInt(t.totals.line_subtotal_tax,10):parseInt(t.totals?.line_subtotal||t.prices.price,10),t.totals||t.prices),name:[t.name,t.quantity>1&&`(x${t.quantity})`,t.variation&&t.variation.length>0&&"-",t.variation&&t.variation.map(t=>`${t.attribute}: ${t.value}`).join(", "),t.item_data&&t.item_data.length>0&&"-",t.item_data&&t.item_data.map(t=>`${t.name||t.key}: ${t.value}`).join(", ")].filter(Boolean).map(v.decodeEntities).join(" ")})),s=parseInt(n.totals.total_shipping||"0",10);s&&o.push({amount:C(r?s+parseInt(n.totals.total_shipping_tax||"0",10):s,n.totals),name:(0,e.__)("Shipping","woocommerce-payments")});const i=parseInt(n.totals.total_discount||"0",10);i&&o.push({amount:-C(r?i+parseInt(n.totals.total_discount_tax||"0",10):i,n.totals),name:(0,e.__)("Discount","woocommerce-payments")});const c=parseInt(n.totals.total_fees||"0",10);c&&o.push({amount:C(r?c+parseInt(n.totals.total_fees_tax||"0",10):c,n.totals),name:(0,e.__)("Fees","woocommerce-payments")});const p=parseInt(n.totals.total_tax||"0",10);p&&!r&&o.push({amount:C(p,n.totals),name:(0,e.__)("Tax","woocommerce-payments")});const u=parseInt(n.totals.total_refund||"0",10);return u&&o.push({amount:-C(u,n.totals),name:(0,e.__)("Refund","woocommerce-payments")}),C(parseInt(n.totals.total_price,10)-parseInt(n.totals.total_refund||0,10),n.totals)<o.reduce((t,{amount:e})=>t+e,0)?[]:o},P=t=>{const e=_("checkout").display_prices_with_tax,r=t.shipping_rates?.[0]?.shipping_rates||[],n=(0,a.applyFilters)("wcpay.express-checkout.shipping-rates",r,t);return n&&0!==n.length?n.sort((t,e)=>t.selected===e.selected?0:t.selected?-1:1).slice(0,9).map(t=>({id:t.rate_id,displayName:(0,v.decodeEntities)(t.name),amount:C(e?parseInt(t.price,10)+parseInt(t.taxes,10):parseInt(t.price,10),t),deliveryEstimate:[t.meta_data.find(t=>"pickup_address"===t.key)?.value,t.meta_data.find(t=>"pickup_details"===t.key)?.value].filter(Boolean).map(v.decodeEntities).join(" - ")})):[]},I=t=>{const e=t?.extensions?.subscriptions;return!!e&&e.trial_length>0},T=t=>{const e=t?.extensions?.subscriptions;if(!e||!Array.isArray(e))return null;for(const t of e){const e=t.shipping_rates?.[0]?.shipping_rates;if(e?.length>0)return e}return null},q=t=>!(!t?.items||!t?.extensions?.subscriptions)&&(!!t.items.some(I)&&(!(t.shipping_rates?.[0]?.shipping_rates?.length>0)&&null!==T(t))),E=t=>!(!t?.items||!t?.extensions?.subscriptions)&&t.items.some(I),j=t=>!!E(t)&&0===parseInt(t.totals?.total_price||"0",10),A=t=>{const e=t?.extensions?.subscriptions;if(!e||!Array.isArray(e))return null;let a=0,r=0,n=0,o=0,s=0,i=2;const c=[];if(e.forEach(t=>{if(!t.totals?.total_price)return;a+=parseInt(t.totals.total_price,10),r+=parseInt(t.totals.total_items||"0",10),n+=parseInt(t.totals.total_tax||"0",10);const e=t.shipping_rates?.[0]?.shipping_rates?.find(t=>t.selected);e?(o+=parseInt(e.price||"0",10),s+=parseInt(e.taxes||"0",10)):(o+=parseInt(t.totals.total_shipping||"0",10),s+=parseInt(t.totals.total_shipping_tax||"0",10)),i=t.totals.currency_minor_unit??i,t.totals.tax_lines&&c.push(...t.totals.tax_lines)}),0===a)return null;const p=e[0]?.totals||t.totals;return{amount:a,currencyMinorUnit:i,totals:{...p,total_price:String(a),total_items:String(r),total_tax:String(n),total_shipping:String(o),total_shipping_tax:String(s),tax_lines:c}}},F=t=>{const a=t.totals,r=parseInt(a.total_price,10),n=a.currency_minor_unit??2,o=a.currency_prefix??"",s=a.currency_suffix??"",i=a.currency_decimal_separator??".",c=a.currency_thousand_separator??",",p=(r/Math.pow(10,n)).toFixed(n).split("."),u=p[0].replace(/\B(?=(\d{3})+(?!\d))/g,c),l=`${o}${p[1]?`${u}${i}${p[1]}`:u}${s}`,d=(m=t.billing_period,(y=t.billing_interval??1)>1?{day:(0,e.sprintf)((0,e._n)("%d day","%d days",y,"woocommerce-payments"),y),week:(0,e.sprintf)((0,e._n)("%d week","%d weeks",y,"woocommerce-payments"),y),month:(0,e.sprintf)((0,e._n)("%d month","%d months",y,"woocommerce-payments"),y),year:(0,e.sprintf)((0,e._n)("%d year","%d years",y,"woocommerce-payments"),y)}[m]||`${y} ${m}s`:{day:(0,e.__)("day","woocommerce-payments"),week:(0,e.__)("week","woocommerce-payments"),month:(0,e.__)("month","woocommerce-payments"),year:(0,e.__)("year","woocommerce-payments")}[m]||m);var m,y;return(0,e.sprintf)((0,e.__)("%1$s / %2$s","woocommerce-payments"),l,d)};(0,a.addFilter)("wcpay.express-checkout.total-amount","automattic/wcpay/express-checkout/wc-subscriptions",(t,e)=>{if(!j(e))return t;const a=A(e);return a?C(a.amount,a.totals):t}),(0,a.addFilter)("wcpay.express-checkout.is-cart-eligible","automattic/wcpay/express-checkout/wc-subscriptions",(t,e)=>{if(t)return!0;if(j(e)){const t=A(e);return null!==t&&t.amount>0}return t}),(0,a.addFilter)("wcpay.express-checkout.shipping-rates","automattic/wcpay/express-checkout/wc-subscriptions",(t,e)=>t&&t.length>0?t:q(e)&&T(e)||t),(0,a.addFilter)("wcpay.express-checkout.shipping-package-id","automattic/wcpay/express-checkout/wc-subscriptions",(t,e,a)=>{if(!q(e))return t;const r=e?.extensions?.subscriptions;if(!r||!Array.isArray(r))return t;for(const t of r){const e=t.shipping_rates;if(e&&Array.isArray(e))for(const t of e){const e=t?.shipping_rates?.some(t=>t.rate_id===a);if(e&&t.package_id)return t.package_id}}return t}),(0,a.addFilter)("wcpay.express-checkout.map-line-items","automattic/wcpay/express-checkout/wc-subscriptions",t=>{if(!E(t))return t;const a=t?.extensions?.subscriptions;if(!a||!Array.isArray(a))return t;const r=0===parseInt(t.totals?.total_price||"0",10),n=[...t.items],o=(0,e.__)("Recurring total","woocommerce-payments");if(a.forEach(a=>{const s=t.items.filter(t=>t.extensions?.subscriptions?.billing_period===a.billing_period).length;if(0===s)return;const i=Math.round(parseInt(a.totals?.total_items||"0",10)/s);n.forEach((t,s)=>{const c=t.extensions?.subscriptions;c&&c.trial_length>0&&c.billing_period===a.billing_period&&((t.item_data||[]).some(t=>t.name===o)||(n[s]={...t,name:`${t.name} (${(0,e.__)("recurring","woocommerce-payments")})`,...r&&{totals:{...t.totals,line_subtotal:String(i),line_total:String(i)}},item_data:[...t.item_data||[],{name:(0,e.__)("Recurring total","woocommerce-payments"),value:(0,e.sprintf)((0,e.__)("%1$s on %2$s","woocommerce-payments"),F(a),a.next_payment_date)}]}))})}),!r)return{...t,items:n};const s=A(t);return s?{...t,items:n,totals:{...t.totals,total_price:String(s.amount),total_items:s.totals.total_items||"0",total_tax:s.totals.total_tax||"0",total_shipping:s.totals.total_shipping||"0",total_shipping_tax:s.totals.total_shipping_tax||"0",tax_lines:s.totals.tax_lines||[]}}:{...t,items:n}}),(0,a.addFilter)("wcpay.express-checkout.resolved-currency","automattic/wcpay/express-checkout/wcpbc",t=>"undefined"!=typeof wc_price_based_country_ajax_geo_params?(t=>new Promise(e=>{const a=jQuery(document.body),r=[],n=t=>{r.forEach(t=>t()),e(t)},o=(t,e)=>{e?.code&&n(String(e.code).toLowerCase())};a.on("wc_price_based_country_set_currency_params",o),r.push(()=>a.off("wc_price_based_country_set_currency_params",o));const s=setTimeout(()=>a.triggerHandler("wc_price_based_country_ajax_geolocation"),3e3);r.push(()=>clearTimeout(s));const i=setTimeout(async()=>n(await t),6e3);r.push(()=>clearTimeout(i))}))(t):t),(0,a.addFilter)("wcpay.express-checkout.resolved-currency","automattic/wcpay/express-checkout/mccy-async",t=>{if("undefined"==typeof wcpayAsyncPriceConfig)return t;const e=window.wcpayAsyncCurrency?.ready;return e&&"function"==typeof e.then?new Promise(a=>{const r=setTimeout(async()=>a(await t),6e3);e.then(e=>{clearTimeout(r),a(e?String(e).toLowerCase():t)})}):t});const $=t=>{let e="undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10);const a=_("button");return e=a?.radius??e,void 0!==t&&(e=Number(t?.borderRadius)??e),{variables:{borderRadius:`${e}px`,spacingUnit:"6px"}}};let R=null;const N=t=>R||t;let B=null;const M=()=>B,O=t=>(t=>{const e=t?.extensions?.subscriptions;if(Array.isArray(e)&&e.length>0)return!0;const a=t?.items;return!!Array.isArray(a)&&a.some(t=>(t=>{if(Array.isArray(t))return t.length>0;if("object"!=typeof t||null===t)return!1;const e=t.billing_period,a=t.billing_interval;return"string"==typeof e&&e.length>0&&"number"==typeof a&&a>0})(t?.extensions?.subscriptions))})(t)?"off_session":null;function U(){return _("flags")?.isEceUsingConfirmationTokens??!0}const L=t=>{if(!t)return"";const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstChild?e.firstChild.textContent:""},Q=(t,e,a)=>{const r=document.querySelector(`${t} [name="${e}"]`);if(r)if("SELECT"===r.tagName&&/country|state/.test(e)){const t=Array.from(r.options).find(t=>t.value===a||t.textContent.trim().toLowerCase()===a.toLowerCase());t&&(r.value=t.value,jQuery(r).trigger("change").trigger("close"))}else r.value=a,jQuery(r).trigger("change")},z=window.lodash;window.wp.domReady;const D=(t,e={})=>{if(!1===(r("isShopperTrackingEnabled")??o("is_shopper_tracking_enabled")))return;const a=r("platformTrackerNonce")??o("nonce")?.platform_tracker,n=r("ajaxUrl")??o("ajax_url"),s=new FormData;s.append("tracksNonce",a),s.append("action","platform_tracks"),s.append("tracksEventName",t),s.append("tracksEventProp",JSON.stringify(e)),fetch(n,{method:"post",body:s}).then(t=>t.json())},H=(0,z.debounce)(({source:t})=>{D("applepay_button_load",{source:t})},1e3),W=(0,z.debounce)(({source:t})=>{D("gpay_button_load",{source:t})},1e3),X=window.wp.apiFetch;var G=t.n(X);const J=window.wp.url;class K{cartRequestHeaders={};async _request(t){const e=await G()({...t,parse:!1,path:(0,J.addQueryArgs)(t.path,{currency:N(_("checkout").currency_code).toUpperCase()}),headers:(0,z.omitBy)({Nonce:_("nonce").store_api_nonce,"X-WooPayments-Tokenized-Cart-Nonce":_("nonce").tokenized_cart_nonce,"X-WooPayments-Tokenized-Cart-Session-Nonce":"product"===_("button_context")?_("nonce").tokenized_cart_session_nonce:void 0,...this.cartRequestHeaders,...t.headers},z.isNil)});return this.cartRequestHeaders=(0,z.omitBy)({Nonce:e.headers.get("Nonce"),"X-WooPayments-Tokenized-Cart-Session":e.headers.get("X-WooPayments-Tokenized-Cart-Session")},z.isNil),e.json()}async placeOrder(t){const e=M();return await this._request({method:"POST",path:"/wc/store/v1/checkout",headers:{"X-WooPayments-Tokenized-Cart":!0,...e&&{"X-WooPayments-Payment-Currency":e},...this.cartRequestHeaders},data:t})}async getCart(){return await this._request({method:"GET",path:"/wc/store/v1/cart"})}useSeparateCart(){this.cartRequestHeaders={"X-WooPayments-Tokenized-Cart-Session":""}}deleteAfterRequest(){this.cartRequestHeaders={"X-WooPayments-Tokenized-Cart-Is-Ephemeral-Cart":"1"}}async updateCustomer(t){return await this._request({method:"POST",path:"/wc/store/v1/cart/update-customer",headers:{"X-WooPayments-Tokenized-Cart":!0,...this.cartRequestHeaders},data:t})}async selectShippingRate(t){return await this._request({method:"POST",path:"/wc/store/v1/cart/select-shipping-rate",data:t})}async addProductToCart(){const t={id:w(),quantity:g(),variation:[]};return await this._request({method:"POST",path:"/wc/store/v1/cart/add-item",data:(0,a.applyFilters)("wcpay.express-checkout.cart-add-item",t)})}async emptyCart(){try{let t=await this._request({method:"GET",path:"/wc/store/v1/cart"});for(;t.items.length>0;)t=await this._request({method:"POST",path:"/wc/store/v1/cart/remove-item",data:{key:t.items[0].key}})}catch(t){}}}const V=(t,e)=>({first_name:t?.split(" ")?.slice(0,1)?.join(" ")??"",last_name:t?.split(" ")?.slice(1)?.join(" ")??"",company:e.organization??"",address_1:e.line1??"",address_2:e.line2??"",city:e.city??"",state:e.state??"",postcode:e.postal_code??"",country:e.country??""}),Y=(t,e,a=!0,r=[])=>{const n=t.billingDetails?.name||"",o=t.billingDetails?.address??{},s=t.billingDetails?.phone?.replace(/[() -]/g,"")??t.payerPhone?.replace(/[() -]/g,"")??"";return{customer_note:t.order_comments,billing_address:{first_name:n.split(" ")?.slice(0,1)?.join(" ")??"",last_name:n.split(" ")?.slice(1)?.join(" ")||"-",company:o.organization??"",address_1:o.line1??"",address_2:o.line2??"",city:o.city??"",state:o.state??"",postcode:o.postal_code??"",country:o.country??"",email:t.billingDetails?.email??"",phone:s},shipping_address:t.shippingAddress?{...V(t.shippingAddress.name||"",t.shippingAddress.address),phone:s}:void 0,payment_method:"woocommerce_payments",payment_data:[{key:"payment_method",value:"card"},{key:"wcpay-fraud-prevention-token",value:window.wcpayFraudPreventionToken??""},{key:a?"wcpay-confirmation-token":"wcpay-payment-method",value:e},{key:"express_payment_type",value:t.expressPaymentType},{key:"wcpay-express-payment-method-types",value:JSON.stringify(r)}]}};let Z=null,tt=null,et=new K;const at=()=>et,rt=t=>{const e=M(),a=t?.totals?.currency_code?.toLowerCase();return Boolean(e&&a&&e!==a)},nt=t=>(0,e.sprintf)((0,e.__)("This express payment started in %1$s and cannot switch to %2$s for the address you selected. Choose a different shipping address, or use the regular checkout to pay in %2$s.","woocommerce-payments"),M().toUpperCase(),t.totals.currency_code.toUpperCase()),ot=t=>({amount:(0,a.applyFilters)("wcpay.express-checkout.total-amount",C(parseInt(t.totals.total_price,10)-parseInt(t.totals.total_refund||0,10),t.totals),t),...U()?{setupFutureUsage:O(t)}:{}}),st=()=>{jQuery.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},it=()=>{jQuery.unblockUI()};class ct{orderId;key;billingEmail="";cachedCartData={};constructor({orderId:t,key:e,billingEmail:a=""}){this.orderId=t,this.key=e,this.billingEmail=a}async placeOrder(t){return await G()({method:"POST",path:`/wc/store/v1/checkout/${this.orderId}`,headers:{Nonce:_("nonce").store_api_nonce},data:{...t,key:this.key,billing_email:this.billingEmail,billing_address:this.cachedCartData.billing_address,shipping_address:this.cachedCartData.shipping_address}})}async getCart(){return this.cachedCartData=await G()({method:"GET",path:(0,J.addQueryArgs)(`/wc/store/v1/order/${this.orderId}`,{key:this.key,billing_email:this.billingEmail})})}}let pt=null;const ut=async()=>{if("product"!==_("button_context"))return await at().getCart();const t=new K;return t.useSeparateCart(),t.deleteAfterRequest(),await t.addProductToCart()},lt=()=>pt?(0,a.applyFilters)("wcpay.express-checkout.total-amount",C(parseInt(pt.totals.total_price,10)-parseInt(pt.totals.total_refund||0,10),pt.totals),pt):"product"===_("button_context")&&_("product")?_("product")?.total.amount:void 0;let dt;jQuery(t=>{if(_("has_block")&&"pay_for_order"!==_("button_context"))return;const n=_("stripe").publishableKey;if(!n)return;const o=new s({publishableKey:n,accountId:_("stripe").accountId,locale:_("stripe").locale},(t,e)=>new Promise((a,r)=>{jQuery.post(t,e).then(a).fail(r)}));var i;"pay_for_order"===_("button_context")&&(i=new ct({orderId:r("order_id"),key:r("key"),billingEmail:r("billing_email")}),et=i),m.init({elementId:"#wcpay-express-checkout-element",$separator:jQuery("#wcpay-express-checkout-button-separator")});const c={abortPayment:e=>{it(),t(".woocommerce-error").remove();const a=t(".woocommerce-notices-wrapper").first();a.length&&(a.append(t('<div class="woocommerce-error" />').text(e)),t("html, body").animate({scrollTop:a.find(".woocommerce-error").offset().top},600))},completePayment:t=>{st(),window.location=t},startExpressCheckoutElement:async t=>{let r="",n=Promise.resolve();const s=await o.getStripe(),i=_("flags")?.isEceUsingConfirmationTokens??!0,p=_("is_manual_capture")??!1,u=_("has_subscription")??!1,{setupFutureUsage:l=(u?"off_session":null)}=t,d=t.enabledMethods??_("enabled_methods")??[],y=[d.includes("payment_request")&&"card",d.includes("amazon_pay")&&"amazon_pay"].filter(Boolean);var w;dt=s.elements({mode:"payment",amount:t.total,currency:(w=t.currency,B=w||null),...i?{paymentMethodTypes:y}:{paymentMethodCreation:"manual"},...i&&p?{captureMethod:"manual"}:{},...i&&l?{setupFutureUsage:l}:{},appearance:$(),locale:_("stripe")?.locale??"en"});const g=dt.create("expressCheckout",(()=>{const t=_("button"),e=_("enabled_methods")??[],a=(t,e)=>{switch(e){case"dark":default:return"black";case"light":return"white";case"light-outline":return"googlePay"===t?"white":"white-outline"}},r="default"===t?.type?"plain":t?.type??"buy",n="default"===t?.type?"plain":t?.type??"plain",o=e.includes("payment_request");return{paymentMethods:{applePay:o?"always":"never",googlePay:o?"always":"never",amazonPay:e.includes("amazon_pay")?"auto":"never",link:"never",paypal:"never",klarna:"never"},layout:{overflow:"never"},buttonTheme:{googlePay:a("googlePay",t?.theme??"black"),applePay:a("applePay",t?.theme??"black")},buttonType:{googlePay:r,applePay:n},buttonHeight:Math.min(Math.max(parseInt(t?.height??"48",10),40),55)}})());m.renderButton(g),g.on("loaderror",()=>{document.getElementById("wcpay-woopay-button")||m.getButtonSeparator().hide()}),g.on("click",function(t){if(r="",_("login_confirmation"))return void(t=>{const e=_("login_confirmation");if(!e)return;let a=e.message;a=a.replace(/\*\*.*?\*\*/,{apple_pay:"Apple Pay",google_pay:"Google Pay",amazon_pay:"Amazon Pay",paypal:"PayPal",link:"Link"}[t]),a=a.replace(/\*\*/g,""),confirm(a)&&(window.location.href=e.redirect_url)})(t.expressPaymentType);if("product"===_("button_context")){if(x())return void window.alert((()=>{if(f())return!1;const t=h();return!!t&&t.classList.contains("wc-variation-is-unavailable")})()?window?.wc_add_to_cart_variation_params?.i18n_unavailable_text||(0,e.__)("Sorry, this product is unavailable. Please choose a different combination.","woocommerce-payments"):(0,e.__)("Please select your product options before proceeding.","woocommerce-payments"));at().useSeparateCart(),n=at().addProductToCart(),n.catch(()=>{r=(0,e.__)("There was an error processing the product with this payment method. Please add the product to the cart, instead.","woocommerce-payments"),at().emptyCart(),g.unmount(),dt=null,c.abortPayment(r),m.hideContainer(),m.getButtonSeparator().hide()}).finally(()=>{n=Promise.resolve()})}const a=pt?{shippingAddressRequired:"pay_for_order"!==_("button_context")&&pt.needs_shipping,shippingRates:P(pt),phoneNumberRequired:_("checkout")?.needs_payer_phone??!1,lineItems:S(pt)}:"product"===_("button_context")&&_("product")?{shippingAddressRequired:_("product")?.needs_shipping??!1,phoneNumberRequired:_("checkout")?.needs_payer_phone??!1,lineItems:(_("product")?.displayItems??[]).map(({label:t,amount:e})=>({name:t,amount:e}))}:void 0,o=a.shippingRates&&0!==a.shippingRates.length?a.shippingRates:[{id:"pending",displayName:(0,e.__)("Pending","woocommerce-payments"),amount:0}];(async function({expressPaymentType:t}){st(),((t,e)=>{const a={google_pay:"gpay_button_click",apple_pay:"applepay_button_click"}[t];a&&D(a,{source:e})})(t,_("button_context"))})(t),t.resolve({business:{name:_("store_name")},emailRequired:!0,...a,shippingRates:a.shippingAddressRequired?o:void 0,allowedShippingCountries:_("checkout").allowed_shipping_countries})}),g.on("shippingaddresschange",async t=>(await n,r?t.resolve():(async(t,e,a)=>{Z=t.address;try{const r=await et.updateCustomer({shipping_address:V(t.name,t.address)});if(rt(r))return a?.(nt(r)),void t.reject();const n=P(r);if(0===n.length)return void t.reject();await e.update(ot(r)),tt=r,t.resolve({shippingRates:n,lineItems:S(r)})}catch(e){t.reject()}})(t,dt,c.abortPayment))),g.on("shippingratechange",async t=>(async(t,e,r=null,n)=>{const o=tt||r;try{const r=await et.selectShippingRate({package_id:(0,a.applyFilters)("wcpay.express-checkout.shipping-package-id",0,o,t.shippingRate.id),rate_id:t.shippingRate.id});if(rt(r))return n?.(nt(r)),void t.reject();tt=r,await e.update(ot(r)),t.resolve({lineItems:S(r)})}catch(e){t.reject()}})(t,dt,pt,c.abortPayment)),g.on("confirm",async t=>{if(!r)return(async(t,r,n,o,s,i,c=[])=>{const{error:p}=await n.submit();if(p)return s(p.message);const u=U();let l;try{l=await async function(t,e,a){if(a){const{confirmationToken:a,error:r}=await t.createConfirmationToken({elements:e});if(r)throw r;return a.id}const{paymentMethod:r,error:n}=await t.createPaymentMethod({elements:e});if(n)throw n;return r.id}(r,n,u)}catch(t){return s(t.message)}try{const e=await et.placeOrder({...Y(i,l,u,c),extensions:(0,a.applyFilters)("wcpay.express-checkout.cart-place-order-extension-data",{})});if("success"!==e.payment_result.payment_status)return s(L(e.message??e.payment_result?.payment_details.find(t=>"errorMessage"===t.key)?.value??""));let r=e.payment_result.redirect_url;if(!r){const t=e.payment_result.payment_details?.find(t=>"redirect"===t.key);r=t?.value||""}const n=t.confirmIntent(r);o(!0===n?r:await n)}catch(t){return t.json&&(t=await Promise.resolve(t.json())),s(L(t.message||t.payment_result?.payment_details.find(t=>"errorMessage"===t.key)?.value||(0,e.__)("There was a problem processing the order.","woocommerce-payments")))}})(o,s,dt,c.completePayment,c.abortPayment,t,y);c.abortPayment(r)}),g.on("cancel",()=>{"product"===_("button_context")&&n.finally(()=>{at().emptyCart()}),Z&&(t=>{const e=_("button_context"),a=_("has_block");var r;["cart","checkout"].includes(e)&&(a?wc?.blocksCheckout?.extensionCartUpdate({namespace:"woopayments/express-checkout/refresh-ui",data:{}}):(r=t.country,["CA","GB"].includes(r)||(t=>{const e=_("button_context"),a=(r=t,{first_name:r?.recipient?.split(" ")?.slice(0,1)?.join(" ")??"",last_name:r?.recipient?.split(" ")?.slice(1)?.join(" ")??"",company:"",address_1:r?.addressLine?.[0]??"",address_2:r?.addressLine?.[1]??"",city:r?.city??"",state:r?.state??"",country:r?.country??"",postcode:r?.postal_code??""});var r;const n=["country","state","city","postcode"];"cart"===e?(n.forEach(t=>{a[t]&&Q("form.woocommerce-shipping-calculator",`calc_shipping_${t}`,a[t])}),document.querySelector('form.woocommerce-shipping-calculator [name="calc_shipping"]')?.click()):"checkout"===e&&n.forEach(t=>{a[t]&&Q("form.woocommerce-checkout",`billing_${t}`,a[t])})})(t)))})(Z),Z=null,it()}),g.on("ready",t=>{(async function({availablePaymentMethods:t}){t&&(({paymentMethods:t,source:e})=>{const a={googlePay:W,applePay:H};for(const r of t){const t=a[r];t&&t({source:e})}})({paymentMethods:Object.entries(t).filter(([t,e])=>e).map(([t,e])=>t),source:_("button_context")})})(t),t?.availablePaymentMethods&&Object.values(t.availablePaymentMethods).filter(Boolean).length&&(m.showContainer(),m.getButtonSeparator().show())})},init:async()=>{(0,a.removeAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout");const e="product"===_("button_context"),r=(_("product")?.currency||_("checkout")?.currency_code||"").toLowerCase();e&&await async function(t,e){const r=(t||"").toLowerCase(),n=(0,a.applyFilters)("wcpay.express-checkout.resolved-currency",Promise.resolve(r),e);let o=r;try{const t=await n;"string"==typeof t&&t&&(o=t.toLowerCase())}catch(t){}return R=o||null,o}(r,{buttonContext:"product"}),e&&"bundle"===_("product")?.product_type&&(wcpayExpressCheckoutParams.product=void 0);const n=e&&N(r)!==r;if(!pt&&(!_("product")||n))try{pt=await ut()}catch(t){}pt&&(wcpayExpressCheckoutParams.product=void 0);const o=lt(),s=(0,a.applyFilters)("wcpay.express-checkout.is-cart-eligible",o>0,pt),i=pt?.extensions?.wcpay?.express_checkout_methods;let p;Array.isArray(i)?p=(t=>{const e=_("methods_enabled_at_location")??[];return t.filter(t=>e.includes(t))})(i):n&&(p=(_("enabled_methods")??[]).includes("payment_request")?["payment_request"]:[]);const u=n&&Array.isArray(p)&&0===p.length;!s||u?(m.hideContainer(),m.getButtonSeparator().hide()):pt?await c.startExpressCheckoutElement({total:o,currency:pt.totals.currency_code.toLowerCase(),enabledMethods:p,setupFutureUsage:O(pt)}):e&&_("product")?await c.startExpressCheckoutElement({total:o,currency:N(r),enabledMethods:p,setupFutureUsage:_("has_subscription")?"off_session":null}):(m.hideContainer(),m.getButtonSeparator().hide()),(0,a.addAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout",async()=>{if("product"===_("button_context")&&x())m.unblockButton();else{t(".woocommerce-error").remove();try{m.blockButton();const t=lt();pt=await ut(),wcpayExpressCheckoutParams.product=null,m.unblockButton();const e=lt(),r={..._("flags")?.isEceUsingConfirmationTokens??1?{setupFutureUsage:O(pt)}:{},...e!==t&&e>0?{amount:e}:{}};dt?Object.keys(r).length&&await dt.update(r):c.init(),(0,a.applyFilters)("wcpay.express-checkout.is-cart-eligible",e>0,pt)?(m.showContainer(),m.getButtonSeparator().show()):(m.hideContainer(),m.getButtonSeparator().hide())}catch(t){m.hideContainer()}}})}};"checkout"===_("button_context")&&"pay_for_order"!==_("button_context")||c.init(),t(document.body).on("updated_cart_totals",()=>{pt=null,c.init()}),t(document.body).on("updated_checkout",()=>{pt=null,c.init()})})})()})();
document.body.classList.contains("woocommerce-cart")||document.body.classList.contains("woocommerce-checkout")||window.innerWidth<768||!document.getElementById("site-header-cart")||window.addEventListener("load",function(){document.querySelector(".site-header-cart").addEventListener("mouseover",function(){var e=window.outerHeight,t=this.querySelector(".widget_shopping_cart_content").getBoundingClientRect().bottom+this.offsetHeight,o=this.querySelector(".cart_list");e<t&&(o.style.maxHeight="15em",o.style.overflowY="auto")})});
document.addEventListener("DOMContentLoaded",function(){if(0!==document.getElementsByClassName("storefront-handheld-footer-bar").length){[].forEach.call(document.querySelectorAll(".storefront-handheld-footer-bar .search > a"),function(t){t.addEventListener("click",function(e){t.parentElement.classList.toggle("active"),e.preventDefault()})});var t=document.getElementsByClassName("storefront-handheld-footer-bar"),n=document.forms,o=function(t){return function(e){t&&-1!==e.target.tabIndex?document.body.classList.add("sf-input-focused"):document.body.classList.remove("sf-input-focused")}};if(t.length&&n.length)for(let e=0;e<n.length;e++)t[0].contains(n[e])||(n[e].addEventListener("focus",o(!0),!0),n[e].addEventListener("blur",o(!1),!0))}});
document.addEventListener("DOMContentLoaded",function(){let i=document.getElementsByClassName("brands_index");if(i.length){let n=document.body.classList.contains("admin-bar")?32:0,t=document.getElementById("brands_a_z").scrollHeight,e=i[0].scrollHeight+40,d=function(){768<window.innerWidth&&i[0].getBoundingClientRect().top<0?i[0].style.paddingTop=Math.min(Math.abs(i[0].getBoundingClientRect().top)+20+n,t-e)+"px":i[0].style.paddingTop=0};d(),window.addEventListener("scroll",function(){d()})}});
(()=>{var e={};(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var o=globalThis.document;if(!t&&o&&(o.currentScript&&"SCRIPT"===o.currentScript.tagName.toUpperCase()&&(t=o.currentScript.src),!t)){var r=o.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";const e=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:t(e),t=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},o=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t);class r{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t}createStripe(e,t,o="",r=[]){const n={locale:t};return o&&(n.stripeAccount=o),r&&(n.betas=r),new Stripe(e,n)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=t("paymentMethodsConfig")[e].forceNetworkSavedCards,this.getStripe()}async getStripe(e=!1){let t=0;for(;!window.Stripe;)if(await new Promise(e=>setTimeout(e,100)),t+=100,t>6e5)throw new Error("Stripe object not found");return this.__getStripe(e)}__getStripe(e=!1){const{publishableKey:t,accountId:o,forceNetworkSavedCards:r,locale:n,isStripeLinkEnabled:a}=this.options;if(r&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,n)),this.stripePlatform;if(!this.stripe){let e=["card_country_event_beta_1"];a&&(e=e.concat(["link_autofill_modal_beta_1"])),this.stripe=this.createStripe(t,n,o,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(t,o=!1){const r=t.match(/#wcpay-confirm-(pi|si):([^:]+):([^:]+):([^:]+)(?::(.+))?$/);if(!r)return!0;const n="si"===r[1];let a=r[2];const i=r[3],c=r[4],s=r[5]||null,l=t.indexOf("order-pay"),u=l>-1&&t.substring(l).match(/\d+/);return u&&(a=u[0]),(async()=>{const{locale:t,publishableKey:o}=this.options,r=e("accountIdForIntentConfirmation");if(n){const e=await this.getStripe(!0);return s?e.confirmSetup({clientSecret:i,confirmParams:{confirmation_token:s},redirect:"if_required"}):e.handleNextAction({clientSecret:i})}return r?this.createStripe(o,t,r).confirmCardPayment(i):(await this.getStripe(!0)).handleNextAction({clientSecret:i})})().then(t=>{let r=null;t.paymentIntent?.last_payment_error&&(r={message:t.paymentIntent.last_payment_error.message}),"requires_action"===t.paymentIntent?.status&&(r={message:"Payment requires additional action."});const n=t.paymentIntent&&t.paymentIntent.id||t.setupIntent&&t.setupIntent.id||t.error&&t.error.payment_intent&&t.error.payment_intent.id||t.error.setup_intent&&t.error.setup_intent.id,i=(s="ajax_url",("object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(s)?wcpayExpressCheckoutParams[s]:null)??e("ajaxUrl"));var s;const l=e("isChangingPayment");return[this.request(i,{action:"update_order_status",order_id:a,_ajax_nonce:c,intent_id:n,should_save_payment_method:o?"true":"false",is_changing_payment:l?"true":"false"}),r,t.error]}).then(([e,t,o])=>{if(o)throw o;return e.then(e=>{const o="string"==typeof e?JSON.parse(e):e;if(o.error)throw o.error;if(t)throw t;return o.return_url})})}async setupIntent(t,o=""){const r=await this.request(e("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":t,_ajax_nonce:e("createSetupIntentNonce"),"wcpay-fraud-prevention-token":window.wcpayFraudPreventionToken??"","wcpay-fingerprint":o});if(!r.success)throw r.data.error;if("succeeded"===r.data.status)return r.data;const n=await this.getStripe(),a=await n.confirmCardSetup(r.data.client_secret),{setupIntent:i,error:c}=a;if(c)throw c;return i}expressCheckoutAddToCart(t){const r=e("wcAjaxUrl"),n=e("addToCartNonce");return this.request(o(r,"add_to_cart"),{security:n,...t})}}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var a=/^\s+/,i=/\s+$/;function c(e,t){if(t=t||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,t);var o=function(e){var t,o,r,c={r:0,g:0,b:0},s=1,l=null,u=null,h=null,d=!1,p=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(i,"").toLowerCase();var t,o=!1;if(x[e])e=x[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=B.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=B.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=B.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=B.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=B.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=B.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=B.hex8.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),a:R(t[4]),format:o?"name":"hex8"}:(t=B.hex6.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),format:o?"name":"hex"}:(t=B.hex4.exec(e))?{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=B.hex3.exec(e))&&{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==n(e)&&(N(e.r)&&N(e.g)&&N(e.b)?(t=e.r,o=e.g,r=e.b,c={r:255*M(t,255),g:255*M(o,255),b:255*M(r,255)},d=!0,p="%"===String(e.r).substr(-1)?"prgb":"rgb"):N(e.h)&&N(e.s)&&N(e.v)?(l=F(e.s),u=F(e.v),c=function(e,t,o){e=6*M(e,360),t=M(t,100),o=M(o,100);var r=Math.floor(e),n=e-r,a=o*(1-t),i=o*(1-n*t),c=o*(1-(1-n)*t),s=r%6;return{r:255*[o,i,a,a,c,o][s],g:255*[c,o,o,i,a,a][s],b:255*[a,a,c,o,o,i][s]}}(e.h,l,u),d=!0,p="hsv"):N(e.h)&&N(e.s)&&N(e.l)&&(l=F(e.s),h=F(e.l),c=function(e,t,o){var r,n,a;function i(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=M(e,360),t=M(t,100),o=M(o,100),0===t)r=n=a=o;else{var c=o<.5?o*(1+t):o+t-o*t,s=2*o-c;r=i(s,c,e+1/3),n=i(s,c,e),a=i(s,c,e-1/3)}return{r:255*r,g:255*n,b:255*a}}(e.h,l,h),d=!0,p="hsl"),e.hasOwnProperty("a")&&(s=e.a)),s=T(s),{ok:d,format:e.format||p,r:Math.min(255,Math.max(c.r,0)),g:Math.min(255,Math.max(c.g,0)),b:Math.min(255,Math.max(c.b,0)),a:s}}(e);this._originalInput=e,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||o.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function s(e,t,o){e=M(e,255),t=M(t,255),o=M(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),c=(a+i)/2;if(a==i)r=n=0;else{var s=a-i;switch(n=c>.5?s/(2-a-i):s/(a+i),a){case e:r=(t-o)/s+(t<o?6:0);break;case t:r=(o-e)/s+2;break;case o:r=(e-t)/s+4}r/=6}return{h:r,s:n,l:c}}function l(e,t,o){e=M(e,255),t=M(t,255),o=M(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),c=a,s=a-i;if(n=0===a?0:s/a,a==i)r=0;else{switch(a){case e:r=(t-o)/s+(t<o?6:0);break;case t:r=(o-e)/s+2;break;case o:r=(e-t)/s+4}r/=6}return{h:r,s:n,v:c}}function u(e,t,o,r){var n=[L(Math.round(e).toString(16)),L(Math.round(t).toString(16)),L(Math.round(o).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function h(e,t,o,r){return[L(P(r)),L(Math.round(e).toString(16)),L(Math.round(t).toString(16)),L(Math.round(o).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var o=c(e).toHsl();return o.s-=t/100,o.s=A(o.s),c(o)}function p(e,t){t=0===t?0:t||10;var o=c(e).toHsl();return o.s+=t/100,o.s=A(o.s),c(o)}function f(e){return c(e).desaturate(100)}function m(e,t){t=0===t?0:t||10;var o=c(e).toHsl();return o.l+=t/100,o.l=A(o.l),c(o)}function b(e,t){t=0===t?0:t||10;var o=c(e).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(-t/100*255))),o.g=Math.max(0,Math.min(255,o.g-Math.round(-t/100*255))),o.b=Math.max(0,Math.min(255,o.b-Math.round(-t/100*255))),c(o)}function g(e,t){t=0===t?0:t||10;var o=c(e).toHsl();return o.l-=t/100,o.l=A(o.l),c(o)}function y(e,t){var o=c(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,c(o)}function w(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function _(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=c(e).toHsl(),r=[c(e)],n=360/t,a=1;a<t;a++)r.push(c({h:(o.h+a*n)%360,s:o.s,l:o.l}));return r}function S(e){var t=c(e).toHsl(),o=t.h;return[c(e),c({h:(o+72)%360,s:t.s,l:t.l}),c({h:(o+216)%360,s:t.s,l:t.l})]}function k(e,t,o){t=t||6,o=o||30;var r=c(e).toHsl(),n=360/o,a=[c(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(c(r));return a}function v(e,t){t=t||6;for(var o=c(e).toHsv(),r=o.h,n=o.s,a=o.v,i=[],s=1/t;t--;)i.push(c({h:r,s:n,v:a})),a=(a+s)%1;return i}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,o,r=this.toRgb();return e=r.r/255,t=r.g/255,o=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+r+"%)":"hsva("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+r+"%)":"hsla("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return u(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,o,r,n){var a=[L(Math.round(e).toString(16)),L(Math.round(t).toString(16)),L(Math.round(o).toString(16)),L(P(r))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*M(this._r,255))+"%",g:Math.round(100*M(this._g,255))+"%",b:Math.round(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*M(this._r,255))+"%, "+Math.round(100*M(this._g,255))+"%, "+Math.round(100*M(this._b,255))+"%)":"rgba("+Math.round(100*M(this._r,255))+"%, "+Math.round(100*M(this._g,255))+"%, "+Math.round(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType=1, ":"";if(e){var n=c(e);o="#"+h(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+o+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(b,arguments)},darken:function(){return this._applyModification(g,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(f,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(v,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(_,[3])},tetrad:function(){return this._applyCombination(_,[4])}},c.fromRatio=function(e,t){if("object"==n(e)){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]="a"===r?e[r]:F(e[r]));e=o}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},c.mix=function(e,t,o){o=0===o?0:o||50;var r=c(e).toRgb(),n=c(t).toRgb(),a=o/100;return c({r:(n.r-r.r)*a+r.r,g:(n.g-r.g)*a+r.g,b:(n.b-r.b)*a+r.b,a:(n.a-r.a)*a+r.a})},c.readability=function(e,t){var o=c(e),r=c(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},c.isReadable=function(e,t,o){var r,n,a,i,s,l=c.readability(e,t);switch(n=!1,(a=o,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(s=(a.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:i,size:s}).level+r.size){case"AAsmall":case"AAAlarge":n=l>=4.5;break;case"AAlarge":n=l>=3;break;case"AAAsmall":n=l>=7}return n},c.mostReadable=function(e,t,o){var r,n,a,i,s=null,l=0;n=(o=o||{}).includeFallbackColors,a=o.level,i=o.size;for(var u=0;u<t.length;u++)(r=c.readability(e,t[u]))>l&&(l=r,s=c(t[u]));return c.isReadable(e,s,{level:a,size:i})||!n?s:(o.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],o))};var x=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=c.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(x);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var o=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function A(e){return Math.min(1,Math.max(0,e))}function I(e){return parseInt(e,16)}function L(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function P(e){return Math.round(255*parseFloat(e)).toString(16)}function R(e){return I(e)/255}var q,E,H,B=(E="[\\s|\\(]+("+(q="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",H="[\\s|\\(]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",{CSS_UNIT:new RegExp(q),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function N(e){return!!B.CSS_UNIT.exec(e)}const j=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],O=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],V=["backgroundColor","border","borderTop","borderRight","borderBottom","borderLeft","borderRadius","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","outline","outlineOffset","boxShadow"],z={".Label":[...j,...O],".Text":[...j,...O],".Input":[...j,...O,...V],".Error":[...j,...O,...V],".Tab":[...j,...O,...V],".TabIcon":[...j],".TabLabel":[...j,...O],".Block":[...j.slice(1),...V.slice(1)],".Container":[...V],".Header":[...j,...V,...O],".Footer":[...j,...V,...O]},$={".Label":z[".Label"],".Label--floating":[...z[".Label"],"transform"],".Input":[...z[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":z[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...V],".TabIcon":z[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":z[".TabLabel"],".Block":z[".Block"],".Container":z[".Container"],".Header":z[".Header"],".Footer":z[".Footer"],".Footer--link":z[".Text"],".Text":z[".Text"],".Text--redirect":z[".Text"]},W=(e,t=document)=>{let o=null,r=0;for(;!o&&r<e.length;){let n;try{n=t.querySelector(e[r])}catch(e){r++;continue}if(!n){r++;continue}const a=(t.defaultView||window).getComputedStyle(n).backgroundColor;a&&c(a).getAlpha()>=.5&&(o=a),r++}return o||"#ffffff"},U=e=>{const t=c(e),o=t.getAlpha();if(o<1){const e=t.toRgb();return c({r:Math.round(e.r*o+255*(1-o)),g:Math.round(e.g*o+255*(1-o)),b:Math.round(e.b*o+255*(1-o))}).getBrightness()>125}return t.getBrightness()>125},D={default:{hiddenContainer:"#wcpay-hidden-div",hiddenInput:"#wcpay-hidden-input",hiddenInvalidInput:"#wcpay-hidden-invalid-input",hiddenValidActiveLabel:"#wcpay-hidden-valid-active-label"},classicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:["#payment .payment_methods li .payment_box fieldset",".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["li.wc_payment_method .wc-payment-form","li.wc_payment_method .payment_box","#payment","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"]},blocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"]},bnplProductPage:{appendTarget:".product .cart .quantity",upeThemeInputSelector:".product .cart .quantity .qty",upeThemeLabelSelector:".product .cart .quantity label",upeThemeTextSelectors:[".product .cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main > .product > div.summary.entry-summary","#main > .product","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".single_add_to_cart_button"]},bnplClassicCart:{appendTarget:".cart .quantity",upeThemeInputSelector:".cart .quantity .qty",upeThemeLabelSelector:".cart .quantity label",upeThemeTextSelectors:[".cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main .entry-content .cart_totals","#main .entry-content","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".checkout-button"],containerSelectors:[".shop_table"]},bnplCartBlock:{appendTarget:".wc-block-cart .wc-block-components-quantity-selector",upeThemeInputSelector:".wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input",upeThemeLabelSelector:".wc-block-components-text-input",upeThemeTextSelectors:[".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input"],invalidClasses:["wc-block-components-text-input","has-error"],backgroundSelectors:[".wc-block-components-bnpl-wrapper",".wc-block-components-order-meta",".wc-block-components-totals-wrapper",".wp-block-woocommerce-cart-order-summary-block",".wp-block-woocommerce-cart-totals-block",".wp-block-woocommerce-cart .wc-block-cart",".wp-block-woocommerce-cart","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-cart__submit-button"],containerSelectors:[".wp-block-woocommerce-cart-line-items-block"]},wooPayClassicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:[".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["form.checkout a",".woocommerce a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},wooPayBlocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],linkSelectors:[".wc-block-checkout a",".wc-block-components-main a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach(o=>{const[r,n]=o,a=e[r];if(Array.isArray(a))a.some(e=>{try{return t.querySelector(e)}catch(e){return!1}})||(e[r]=n);else try{t.querySelector(e[r])||(e[r]=n)}catch(t){e[r]=n}}),delete e.alternateSelectors),e},getSelectors:function(e,t){let o=this.blocksCheckout;switch(e){case"blocks_checkout":o=this.blocksCheckout;break;case"shortcode_checkout":o=this.classicCheckout;break;case"bnpl_product_page":o=this.bnplProductPage;break;case"bnpl_classic_cart":o=this.bnplClassicCart;break;case"bnpl_cart_block":o=this.bnplCartBlock;break;case"woopay_shortcode_checkout":o=this.wooPayClassicCheckout;break;case"woopay_blocks_checkout":o=this.wooPayBlocksCheckout}return{...this.default,...this.updateSelectors(o,t)}}},J={getHiddenContainer:function(e,t){const o=t.createElement("div");return o.setAttribute("id",this.getIDFromSelector(e)),o.style.border=0,o.style.clip="rect(0 0 0 0)",o.style.height="1px",o.style.margin="-1px",o.style.overflow="hidden",o.style.padding="0",o.style.position="absolute",o.style.width="1px",o},createRow:function(e,t=[],o){const r=o.createElement(e);return t.length&&r.classList.add(...t),r},appendClone:function(e,t,o,r){const n=r.querySelector(t);if(n){const t=n.cloneNode(!0);t.id=this.getIDFromSelector(o),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const o=D.getSelectors(e),r=t.querySelector(o.appendTarget),n=t.querySelector(o.upeThemeInputSelector);if(!r||!n)return;t.querySelector(o.hiddenContainer)&&this.cleanup(t);const a=this.getHiddenContainer(o.hiddenContainer,t);r.appendChild(a);const i=this.createRow(o.rowElement,o.validClasses,t);a.appendChild(i);const c=this.createRow(o.rowElement,o.invalidClasses,t);a.appendChild(c),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(c,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(c,o.upeThemeLabelSelector,o.hiddenInvalidInput,t),t.querySelector(o.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(D.default.hiddenContainer);t&&t.remove()}},K=(e,t,o=null,r)=>{const n=(Array.isArray(e)?e:[e]).map(e=>{try{return r.querySelector(e)}catch(e){return null}}).filter(Boolean);if(!n.length)return{};const a=r.defaultView||window,i=$[t],c=n[0],s=a.getComputedStyle(c),l={};if(i.forEach(e=>{const t=e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),o=s.getPropertyValue(t);if(o)if("color"!==e)if("lineHeight"!==e||"0"!==o&&"0px"!==o)l[e]=o;else for(let t=1;t<n.length;t++){const o=a.getComputedStyle(n[t]).getPropertyValue("line-height");if("0"!==o&&"0px"!==o){l[e]=o;break}}else l[e]=(e=>{const t=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0?(\.\d+)?|1?(\.0+)?)\s*\)$/);if(t){const o=t[4]||1;e=`rgb(${t.slice(1,4).map(e=>Math.round(e*o+255*(1-o))).join(", ")})`}return e})(o)}),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const u=s.getPropertyValue("text-indent");return"0px"!==u&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=u,l.paddingRight=u),".Block"===t&&(l.backgroundColor=o),l},G=(e=document)=>{const t=[],o=e.styleSheets,r=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"];for(let e=0;e<o.length;e++){if(!o[e].href)continue;const n=new URL(o[e].href);-1!==r.indexOf(n.hostname)&&t.push({cssSrc:o[e].href})}return t},Q={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},X=(e,t=!1,o=document)=>{const r=t?Q[e]??e:e,n=D.getSelectors(r,o);J.init(r,o);const a=K(n.hiddenInput,".Input",null,o),i=K(n.hiddenInvalidInput,".Input",null,o),s=K(n.upeThemeLabelSelector,".Label",null,o),l={fontSize:s.fontSize},u=K(n.upeThemeTextSelectors,".Text",null,o),h=K(n.upeThemeInputSelector,".Tab",null,o),d=K(n.hiddenInput,".Tab--selected",null,o),p=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=c(e),n=c(t);if(!r.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=r.getBrightness()>50?c(r).darken(7):c(r).lighten(7),i=c.mostReadable(a,[n],{includeFallbackColors:!0});return o.backgroundColor=a.toRgbString(),o.color=i.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(h),f={color:p.color},m={color:d.color},b=W(n.backgroundSelectors,o),g=K(n.upeThemeLabelSelector,".Block",b,o),y={colorBackground:b,colorText:u.color,fontFamily:u.fontFamily,fontSizeBase:u.fontSize},w=("blocks_checkout"===e||"woopay_blocks_checkout"===r)&&((e,t=document)=>{let o;try{o=t.querySelector(e)}catch(e){return!0}if(!o)return!0;const r=(t.defaultView||window).getComputedStyle(o).getPropertyValue("position");return!r||"absolute"===r||"fixed"===r})(n.hiddenValidActiveLabel,o);let _={variables:y,theme:U(b)?"stripe":"night",labels:w?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":a,".Input--invalid":i,".Label":s,".Label--resting":l,".Block":g,".Tab":h,".Tab:hover":p,".Tab--selected":d,".TabIcon:hover":f,".TabIcon--selected":m,".Text":u,".Text--redirect":u}))};if(w&&(_=((e,t)=>{if(e.rules[".Label--floating"]=t,e.rules[".Label--floating"].transform&&"none"!==e.rules[".Label--floating"].transform){const t=e.rules[".Label--floating"].transform.match(/matrix\((.+)\)/);if(t&&t[1]){const o=t[1].split(", "),r=(parseFloat(o[0])+parseFloat(o[3]))/2,n=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(n*r);e.rules[".Label--floating"].lineHeight=`${a}px`,e.rules[".Label--floating"].fontSize=`${a}px`}delete e.rules[".Label--floating"].transform}if(e.rules[".Input"].paddingTop&&(e.rules[".Input"].paddingTop=`calc(${e.rules[".Input"].paddingTop} - ${e.rules[".Label--floating"].lineHeight} - 4px - 1px)`),e.rules[".Input"].paddingBottom){const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const o=e.rules[".Label"].marginTop??"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=o}return e})(_,K(n.hiddenValidActiveLabel,".Label--floating",null,o))),t){const e=K(n.headerSelectors,".Header",null,o),t=K(n.footerSelectors,".Footer",null,o);(!e.backgroundColor||c(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=W([...n.headerSelectors??[],"body"],o)),(!t.backgroundColor||c(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=W([...n.footerSelectors??[],"body"],o)),_.rules={..._.rules,".Heading":K(n.headingSelectors,".Label",null,o),".Header":e,".Footer":t,".Footer-link":K(n.footerLink,".Footer--link",null,o),".Button":K(n.buttonSelectors,".Input",null,o),".Link":K(n.linkSelectors,".Label",null,o),".Container":K(n.containerSelectors,".Container",null,o)}}return J.cleanup(o),_};function Z(e){return"wcpay_appearance_"+e}function Y(e,t="",o){for(const r in e){const n=e[r],a=t?t+"["+r+"]":r;"string"==typeof n||"number"==typeof n?o.append(a,n):"object"==typeof n&&Y(n,a,o)}return o}async function ee(e,t,o){const r=Y(t,"",new FormData),n=await fetch(e,{method:"POST",body:r,...o});return await n.json()}const te={bnplProductPage:"bnpl_product_page",bnplClassicCart:"bnpl_classic_cart"},oe=async()=>{const{productVariations:e,country:t,locale:o,accountId:n,publishableKey:a,paymentMethods:i,currencyCode:c,isCart:s,cartTotal:l,shouldShowPMME:u}=window.wcpayStripeSiteMessaging;let h,d="bnplProductPage";const p=document.getElementById("payment-method-message");s?(h=parseInt(l,10)||0,d="bnplClassicCart"):(h=parseInt(e.base_product.amount,10)||0,u||p.style.setProperty("display","none"));const f=new r({publishableKey:a,accountId:n,locale:o},ee),m={amount:h,currency:c||"USD",paymentMethodTypes:i||[],countryCode:t},b=te[d],g=window.wcpayStripeSiteMessaging.stylesCacheVersion;let y=function(e,t){try{const o=localStorage.getItem(Z(e));if(!o)return null;const r=JSON.parse(o);if(r?.version===t)return r.appearance}catch{}return null}(b,g);y||(y=X(b),function(e,t){document.dispatchEvent(new CustomEvent("wcpay_elements_appearance",{detail:{appearance:e,elementsLocation:t}}))}(y,b),function(e,t,o){try{localStorage.setItem(Z(e),JSON.stringify({version:t,appearance:o}))}catch{}}(b,g,y));const w={appearance:y,fonts:G()},_=(await f.getStripe()).elements(w).create("paymentMethodMessaging",m);function S(e,t){const o=e.slice(-2),r=parseFloat(e);switch(o){case"em":return r*t+"px";case"px":return e;default:return"0px"}}_.mount("#payment-method-message");const k=document.querySelector(".price")||document.querySelector(".wp-block-woocommerce-product-price"),v=document.querySelector(".cart_totals .shop_table");if(k||v){const e=k||v,t=window.getComputedStyle(e);let o=t.marginBottom;const r=parseFloat(t.fontSize),n=parseFloat(window.getComputedStyle(document.documentElement).fontSize);let a;o.endsWith("em")?o=S(o,r):o.endsWith("rem")&&(o=S(o,n)),p.style.setProperty("--wc-bnpl-margin-bottom",o),s||(a=document.createElement("div"),a.classList.add("pmme-loading"),p.prepend(a)),_.on("ready",()=>{if(s){p.classList.add("ready");const e=document.querySelector(".cart-collaterals");if(getComputedStyle(e).getPropertyValue("--wc-bnpl-height").trim())return;const t=document.getElementById("payment-method-message"),r=document.querySelector(".cart_totals .__PrivateStripeElement");setTimeout(()=>{const n=window.getComputedStyle(t),a=parseFloat(n.height),i=parseFloat(o),c=a+i,s=window.getComputedStyle(r),l=parseFloat(s.height);e.style.setProperty("--wc-bnpl-height",c+"px"),e.style.setProperty("--wc-bnpl-container-height",l-12+"px"),e.style.setProperty("--wc-bnpl-loader-margin",i+2+"px"),t.style.setProperty("--wc-bnpl-margin-bottom","-4px")},2e3)}else a?.remove()})}return _};jQuery(async function(e){if(!window.wcpayStripeSiteMessaging||window.wcpayStripeSiteMessaging.isCartBlock)return;const{shouldInitializePMME:t}=window.wcpayStripeSiteMessaging;if(!t)return void document.getElementById("payment-method-message").style.setProperty("display","none");const{productVariations:r,productId:n,isCart:a}=window.wcpayStripeSiteMessaging;let i,c;if(!a){const{amount:e,currency:t}=r[n];i=e||0,c=t}const s=e(".quantity input[type=number]"),l=await oe(),u=Object.keys(r).length>1,h=e=>{const t=parseInt(e,10);return isNaN(t)?0:t},d=async(e,t,o=1)=>{const r=h(e)*h(o);r<=0||!t||await(l?.update({amount:r,currency:t}))},p=()=>{d(i,c,s.val())};s.on("change",async t=>{let n=i;const a=e('input[name="variation_id"]').val();u&&r.hasOwnProperty(a)&&(n=r[a]?.amount),d(n,c,t.target.value);try{const r=await(s=n*t.target.value,l=c,h=window.wcpayStripeSiteMessaging.country,ee(o(window.wcpayStripeSiteMessaging.wcAjaxUrl,"check_bnpl_availability"),{security:window.wcpayStripeSiteMessaging.nonce.is_bnpl_available,price:s,currency:l,country:h}));r.success&&r.data.is_available?e("#payment-method-message").slideDown():e("#payment-method-message").slideUp()}catch{}var s,l,h}),e(document.body).on("updated_cart_totals",()=>{e("#payment-method-message").before('<div class="pmme-loading"></div>'),e("#payment-method-message").hide(),ee(o(window.wcpayStripeSiteMessaging.wcAjaxUrl,"get_cart_total"),{security:window.wcpayStripeSiteMessaging.nonce.get_cart_total}).then(t=>{window.wcpayStripeSiteMessaging.cartTotal=t.total,oe().then(()=>{setTimeout(()=>{e(".pmme-loading").remove(),e("#payment-method-message").show(),e("#payment-method-message").addClass("pmme-updated")},1e3)})})}),u&&(e(".single_variation_wrap").on("show_variation",(e,t)=>{r[t.variation_id]&&d(r[t.variation_id].amount,c,s.val())}),e(".variations").on("change",e=>{""===e.target.value&&p()}),e(".reset_variations").on("click",p))})})()})();
(()=>{var e={};(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var r=globalThis.document;if(!t&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(t=r.currentScript.src),!t)){var a=r.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=a[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";window.wp.domReady;const e=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:t(e),t=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},r=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,a=(t,a={})=>{if(!1===(e("isShopperTrackingEnabled")??r("is_shopper_tracking_enabled")))return;const n=e("platformTrackerNonce")??r("nonce")?.platform_tracker,o=e("ajaxUrl")??r("ajax_url"),c=new FormData;c.append("tracksNonce",n),c.append("action","platform_tracks"),c.append("tracksEventName",t),c.append("tracksEventProp",JSON.stringify(a)),fetch(o,{method:"post",body:c}).then(e=>e.json())};if(window.wcPayFrontendTracks&&window.wcPayFrontendTracks.length){for(const e of window.wcPayFrontendTracks)a(e.event,e.properties);window.wcPayFrontendTracks=[]}})()})();