ui.shipaid.com 0.3.64 → 0.3.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/widget.es.js +71 -86
- package/dist/widget.iife.js +20 -30
- package/dist/widget.umd.js +20 -30
- package/dist-types/widget/src/shipaid-widget.d.ts +0 -4
- package/package.json +1 -1
package/dist/widget.es.js
CHANGED
|
@@ -2002,7 +2002,7 @@ class CheckoutPackageProtection extends s$1 {
|
|
|
2002
2002
|
}
|
|
2003
2003
|
render() {
|
|
2004
2004
|
return x`
|
|
2005
|
-
<div class="container">
|
|
2005
|
+
<div class="shipaid-container">
|
|
2006
2006
|
<div class="protection-info">
|
|
2007
2007
|
<div class="protection-text">
|
|
2008
2008
|
${this.logo}
|
|
@@ -2317,7 +2317,6 @@ const POLL_INTERVAL_DEFAULT = 2500;
|
|
|
2317
2317
|
const LOCAL_STORAGE_KEY = "shipaid-protection";
|
|
2318
2318
|
const LOCAL_STORAGE_POLL_KEY = "polling-shipaid-protection";
|
|
2319
2319
|
const LOCAL_STORAGE_SHIPAID_POPUP_KEY = "shipaid-protection-popup-show";
|
|
2320
|
-
const POPUP_CONFIRMATION_LAST_ACTION = "shipaid-confirmation-last-action";
|
|
2321
2320
|
const PRODUCT_HANDLE = "shipaid-protection";
|
|
2322
2321
|
const PREVIEW_FLAG = "shipaid-test";
|
|
2323
2322
|
const StoreQuery = `query StoreByDomain ($store: String!) {
|
|
@@ -2332,6 +2331,7 @@ const StoreQuery = `query StoreByDomain ($store: String!) {
|
|
|
2332
2331
|
excludedCustomersIdsAutoOptIn
|
|
2333
2332
|
protectionSettings
|
|
2334
2333
|
widgetConfigurations
|
|
2334
|
+
useCustomApp
|
|
2335
2335
|
}
|
|
2336
2336
|
}`;
|
|
2337
2337
|
const SellinPlanGroupFromVariant = `query SellingPlanFromVariant($store: String!, $variantId: String!){
|
|
@@ -2379,7 +2379,6 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2379
2379
|
this._storeDomain = ((_a = window.Shopify) == null ? void 0 : _a.shop) ?? ((_c = (_b = window.Shopify) == null ? void 0 : _b.Checkout) == null ? void 0 : _c.apiHost);
|
|
2380
2380
|
this._hasFinishedSetup = false;
|
|
2381
2381
|
this._shouldShowWidget = false;
|
|
2382
|
-
this._isCartVisibleOnScreen = false;
|
|
2383
2382
|
this._hasProtectionInCart = false;
|
|
2384
2383
|
this.hasLoadedStrings = false;
|
|
2385
2384
|
this.fetchInterceptorCleanup = () => {
|
|
@@ -2853,14 +2852,11 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2853
2852
|
((_f = this._cart) == null ? void 0 : _f.item_count) && // And that we are actually showing the widget
|
|
2854
2853
|
this._store.widgetShowCart
|
|
2855
2854
|
) {
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
JSON.stringify({ loaded: true })
|
|
2862
|
-
);
|
|
2863
|
-
}
|
|
2855
|
+
await this.addProtection();
|
|
2856
|
+
sessionStorage.setItem(
|
|
2857
|
+
LOCAL_STORAGE_KEY,
|
|
2858
|
+
JSON.stringify({ loaded: true })
|
|
2859
|
+
);
|
|
2864
2860
|
}
|
|
2865
2861
|
}
|
|
2866
2862
|
async handleMultipleProtectionVariants() {
|
|
@@ -2918,34 +2914,34 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2918
2914
|
></shipaid-popup-confirmation>
|
|
2919
2915
|
`;
|
|
2920
2916
|
}
|
|
2921
|
-
confirmShipAidCart() {
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
}
|
|
2917
|
+
// confirmShipAidCart () {
|
|
2918
|
+
// return html`
|
|
2919
|
+
// <shipaid-cart-confirmation
|
|
2920
|
+
// .open=${this._popup === 'shipaid-confirm-cart'}
|
|
2921
|
+
// .product=${this._protectionProduct?.title}
|
|
2922
|
+
// .imageUrl=${this._protectionProduct?.image?.src}
|
|
2923
|
+
// .priceOfVariant=${this._protectionVariant?.price}
|
|
2924
|
+
// .quantity=${1}
|
|
2925
|
+
// @dismiss-shipaid-cart=${() => {
|
|
2926
|
+
// sessionStorage.setItem(POPUP_CONFIRMATION_LAST_ACTION, 'dismiss')
|
|
2927
|
+
// this._popup = null
|
|
2928
|
+
// if (this.intervalId) {
|
|
2929
|
+
// clearInterval(this.intervalId)
|
|
2930
|
+
// }
|
|
2931
|
+
// }}
|
|
2932
|
+
// @confirm-shipaid-cart=${async () => {
|
|
2933
|
+
// sessionStorage.setItem(POPUP_CONFIRMATION_LAST_ACTION, 'add')
|
|
2934
|
+
// await this.addProtection()
|
|
2935
|
+
// // let's create our session after we have added the protection
|
|
2936
|
+
// sessionStorage.setItem(
|
|
2937
|
+
// LOCAL_STORAGE_KEY,
|
|
2938
|
+
// JSON.stringify({ loaded: true })
|
|
2939
|
+
// )
|
|
2940
|
+
// this._popup = null
|
|
2941
|
+
// }}
|
|
2942
|
+
// ></shipaid-cart-confirmation>
|
|
2943
|
+
// `
|
|
2944
|
+
// }
|
|
2949
2945
|
contactlessCheckoutButtonTemplate() {
|
|
2950
2946
|
if (!document.getElementById("shipaid-styles")) {
|
|
2951
2947
|
const style = document.createElement("style");
|
|
@@ -2993,7 +2989,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2993
2989
|
font-family: Arial, sans-serif;
|
|
2994
2990
|
width: 100%;
|
|
2995
2991
|
}
|
|
2996
|
-
.container button {
|
|
2992
|
+
.shipaid-container button {
|
|
2997
2993
|
width: 100%;
|
|
2998
2994
|
}
|
|
2999
2995
|
.shipaid-loader {
|
|
@@ -3122,7 +3118,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3122
3118
|
width: 100%;
|
|
3123
3119
|
}
|
|
3124
3120
|
|
|
3125
|
-
.container button {
|
|
3121
|
+
.shipaid-container button {
|
|
3126
3122
|
width: 100%;
|
|
3127
3123
|
}
|
|
3128
3124
|
|
|
@@ -3190,7 +3186,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3190
3186
|
}
|
|
3191
3187
|
</style>
|
|
3192
3188
|
|
|
3193
|
-
<div class="container">
|
|
3189
|
+
<div class="shipaid-container">
|
|
3194
3190
|
<div class="protection-info">
|
|
3195
3191
|
<div class="protection-text">
|
|
3196
3192
|
${ShipAidReducedLogo}
|
|
@@ -3239,8 +3235,6 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3239
3235
|
return this.confirmationPopupTemplate();
|
|
3240
3236
|
case "learn-more":
|
|
3241
3237
|
return this.learnMorePopupTemplate();
|
|
3242
|
-
case "shipaid-confirm-cart":
|
|
3243
|
-
return this.confirmShipAidCart();
|
|
3244
3238
|
default:
|
|
3245
3239
|
return null;
|
|
3246
3240
|
}
|
|
@@ -3452,38 +3446,36 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3452
3446
|
);
|
|
3453
3447
|
await this._handleRefresh(cart);
|
|
3454
3448
|
}
|
|
3455
|
-
runCartPageDetection() {
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
}
|
|
3470
|
-
triggerShipAidAddToCartConfirm() {
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
}
|
|
3449
|
+
// protected runCartPageDetection () {
|
|
3450
|
+
// const cart = document.querySelector("button[class*='checkout'], a[href*='checkout']")
|
|
3451
|
+
// if (cart) {
|
|
3452
|
+
// const observer = new IntersectionObserver((entries) => {
|
|
3453
|
+
// entries.forEach(entry => {
|
|
3454
|
+
// if (entry.isIntersecting) {
|
|
3455
|
+
// this._isCartVisibleOnScreen = true
|
|
3456
|
+
// } else {
|
|
3457
|
+
// this._isCartVisibleOnScreen = false
|
|
3458
|
+
// }
|
|
3459
|
+
// })
|
|
3460
|
+
// })
|
|
3461
|
+
// observer.observe(cart)
|
|
3462
|
+
// }
|
|
3463
|
+
// }
|
|
3464
|
+
// protected triggerShipAidAddToCartConfirm () {
|
|
3465
|
+
// const dontShowAgain = Boolean(sessionStorage.getItem('shipaid-confirmation-dontshow'))
|
|
3466
|
+
// if (dontShowAgain) return false
|
|
3467
|
+
// const showAddToCartConfirmation = this._store?.widgetConfigurations?.widget?.showAddToCartConfirmation
|
|
3468
|
+
// if (showAddToCartConfirmation) {
|
|
3469
|
+
// if (this._isCartVisibleOnScreen) {
|
|
3470
|
+
// this._popup = 'shipaid-confirm-cart'
|
|
3471
|
+
// }
|
|
3472
|
+
// return true
|
|
3473
|
+
// }
|
|
3474
|
+
// return false
|
|
3475
|
+
// }
|
|
3483
3476
|
render() {
|
|
3484
3477
|
useOnce(this, async () => {
|
|
3485
3478
|
var _a, _b, _c, _d, _e, _f;
|
|
3486
|
-
this.runCartPageDetection();
|
|
3487
3479
|
const linkEl = document.createElement("link");
|
|
3488
3480
|
linkEl.setAttribute(
|
|
3489
3481
|
"href",
|
|
@@ -3544,14 +3536,11 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3544
3536
|
((_d2 = this._cart) == null ? void 0 : _d2.item_count) && // And that we are actually showing the widget
|
|
3545
3537
|
this._store.widgetShowCart
|
|
3546
3538
|
) {
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
JSON.stringify({ loaded: true })
|
|
3553
|
-
);
|
|
3554
|
-
}
|
|
3539
|
+
await this.addProtection();
|
|
3540
|
+
sessionStorage.setItem(
|
|
3541
|
+
LOCAL_STORAGE_KEY,
|
|
3542
|
+
JSON.stringify({ loaded: true })
|
|
3543
|
+
);
|
|
3555
3544
|
}
|
|
3556
3545
|
}, 500);
|
|
3557
3546
|
if (this.disablePolling) return;
|
|
@@ -3863,7 +3852,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3863
3852
|
${n(
|
|
3864
3853
|
this._hasFinishedSetup,
|
|
3865
3854
|
() => {
|
|
3866
|
-
var _a, _b, _c, _d, _e
|
|
3855
|
+
var _a, _b, _c, _d, _e;
|
|
3867
3856
|
const dbContactlessCheckoutSelector = (_d = (_c = (_b = (_a = this._store) == null ? void 0 : _a.widgetConfigurations) == null ? void 0 : _b.widget) == null ? void 0 : _c.theme_checkout) == null ? void 0 : _d.checkoutButtonSelector;
|
|
3868
3857
|
const inSessionStorageCheckoutButtonSelector = sessionStorage.getItem("shipaidWidgetTheme");
|
|
3869
3858
|
if (!inSessionStorageCheckoutButtonSelector && dbContactlessCheckoutSelector) {
|
|
@@ -3876,7 +3865,6 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3876
3865
|
if (configOk) {
|
|
3877
3866
|
return inSessionStorageCheckoutButtonSelector ? this.contactlessCheckoutButtonTemplate() : this.promptTemplate();
|
|
3878
3867
|
}
|
|
3879
|
-
console.log("Showing nothing ==========================>", this._shouldShowWidget, this.planActive, (_f = this._store) == null ? void 0 : _f.widgetShowCart);
|
|
3880
3868
|
return A;
|
|
3881
3869
|
},
|
|
3882
3870
|
() => sessionStorage.getItem("shipaidWidgetTheme") ? this.contactlessCheckoutButtonTemplate() : this.promptTemplate()
|
|
@@ -3963,9 +3951,6 @@ __decorateClass([
|
|
|
3963
3951
|
__decorateClass([
|
|
3964
3952
|
t$3()
|
|
3965
3953
|
], ShipAidWidget.prototype, "_shouldShowWidget");
|
|
3966
|
-
__decorateClass([
|
|
3967
|
-
t$3()
|
|
3968
|
-
], ShipAidWidget.prototype, "_isCartVisibleOnScreen");
|
|
3969
3954
|
__decorateClass([
|
|
3970
3955
|
t$3()
|
|
3971
3956
|
], ShipAidWidget.prototype, "_hasProtectionInCart");
|
package/dist/widget.iife.js
CHANGED
|
@@ -30,7 +30,7 @@ const d=window,p=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"
|
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
32
|
*/
|
|
33
|
-
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,
|
|
33
|
+
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,M=`<${E}>`,I=document,T=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,U=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,F=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),W=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,K=I.createTreeWalker(I,129,null,!1);var Q;function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const s=t.length-1,a=this.parts,[d,p]=((t,e)=>{const i=t.length-1,o=[];let r,n=2===e?"<svg>":"",s=O;for(let a=0;a<i;a++){const e=t[a];let i,d,p=-1,l=0;for(;l<e.length&&(s.lastIndex=l,d=s.exec(e),null!==d);)l=s.lastIndex,s===O?"!--"===d[1]?s=V:void 0!==d[1]?s=R:void 0!==d[2]?(F.test(d[2])&&(r=RegExp("</"+d[2],"g")),s=U):void 0!==d[3]&&(s=U):s===U?">"===d[0]?(s=null!=r?r:O,p=-1):void 0===d[1]?p=-2:(p=s.lastIndex-d[2].length,i=d[1],s=void 0===d[3]?U:'"'===d[3]?D:B):s===D||s===B?s=U:s===V||s===R?s=O:(s=U,r=void 0);const c=s===U&&t[a+1].startsWith("/>")?" ":"";n+=s===O?e+M:p>=0?(o.push(i),e.slice(0,p)+L+e.slice(p)+z+c):e+z+(-2===p?(o.push(void 0),a):c)}return[Y(t,n+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=J.createElement(d,i),K.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=K.nextNode())&&a.length<s;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(L)||e.startsWith(z)){const i=p[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+L).split(z),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?nt:"@"===e[1]?st:it})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(F.test(o.tagName)){const t=o.textContent.split(z),e=t.length-1;if(e>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),K.nextNode(),a.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===E)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(z,t+1));)a.push({type:7,index:r}),t+=z.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var r,n,s,a;if(e===W)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const p=q(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==p&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===p?d=void 0:(d=new p(t),d._$AT(t,i,o)),void 0!==o?(null!==(s=(a=i)._$Co)&&void 0!==s?s:a._$Co=[])[o]=d:i._$Cl=d),void 0!==d&&(e=X(t,d._$AS(t,e.values),d,o)),e}class tt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:I).importNode(i,!0);K.currentNode=r;let n=K.nextNode(),s=0,a=0,d=o[0];for(;void 0!==d;){if(s===d.index){let e;2===d.type?e=new et(n,n.nextSibling,this,t):1===d.type?e=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(e=new at(n,this,t)),this._$AV.push(e),d=o[++a]}s!==(null==d?void 0:d.index)&&(n=K.nextNode(),s++)}return K.currentNode=I,r}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,o){var r;this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),q(t)?t===Z||null==t||""===t?(this._$AH!==Z&&this._$AR(),this._$AH=Z):t!==this._$AH&&t!==W&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Z&&q(this._$AH)?this._$AA.nextSibling.data=t:this.$(I.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=J.createElement(Y(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.v(i);else{const t=new tt(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new J(t)),e}T(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new et(this.k(T()),this.k(T()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,o,r){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let n=!1;if(void 0===r)t=X(this,t,e,0),n=!q(t)||t!==this._$AH&&t!==W,n&&(this._$AH=t);else{const o=t;let s,a;for(t=r[0],s=0;s<r.length-1;s++)a=X(this,o[i+s],e,s),a===W&&(a=this._$AH[s]),n||(n=!q(a)||a!==this._$AH[s]),a===Z?t=Z:t!==Z&&(t+=(null!=a?a:"")+r[s+1]),this._$AH[s]=a}n&&!o&&this.j(t)}j(t){t===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ot extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Z?void 0:t}}const rt=A?A.emptyScript:"";class nt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Z?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class st extends it{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:Z)===W)return;const o=this._$AH,r=t===Z&&o!==Z||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==Z&&(o===Z||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const dt=S.litHtmlPolyfillSupport;null==dt||dt(J,et),(null!==(k=S.litHtmlVersions)&&void 0!==k?k:S.litHtmlVersions=[]).push("2.8.0");const pt=(t,e,i)=>{var o,r;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let s=n._$litPart$;if(void 0===s){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=s=new et(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s};
|
|
34
34
|
/**
|
|
35
35
|
* @license
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
@@ -56,7 +56,7 @@ const _t=2;class wt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i)
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/class Et extends wt{constructor(t){if(super(t),this.et=Z,t.type!==_t)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Z||null==t)return this.ft=void 0,this.et=t;if(t===W)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Et.directiveName="unsafeHTML",Et.resultType=1;const
|
|
59
|
+
*/class Et extends wt{constructor(t){if(super(t),this.et=Z,t.type!==_t)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Z||null==t)return this.ft=void 0,this.et=t;if(t===W)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Et.directiveName="unsafeHTML",Et.resultType=1;const Mt="__registered_effects";function It(t){const e=t;if(e[Mt])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),o=i.updated;return e[Mt]={index:0,count:0,effects:[]},i.updated=t=>(e[Mt].index=0,o(t)),e}function Tt(t,e,i){const o=function(t,e){const i=It(t),{index:o,count:r}=i[Mt];return o===r?(i[Mt].index++,i[Mt].count++,i[Mt].effects.push(e),e):(i[Mt].index++,i[Mt].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
|
|
60
60
|
/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2021 Google LLC
|
|
@@ -266,7 +266,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
266
266
|
background: transparent;
|
|
267
267
|
z-index: -1;
|
|
268
268
|
}
|
|
269
|
-
`,
|
|
269
|
+
`,Nt=H`
|
|
270
270
|
<svg
|
|
271
271
|
version="1.0"
|
|
272
272
|
width="50.000000pt"
|
|
@@ -287,7 +287,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
287
287
|
/>
|
|
288
288
|
</g>
|
|
289
289
|
</svg>
|
|
290
|
-
`,
|
|
290
|
+
`,Ot=H`
|
|
291
291
|
<svg
|
|
292
292
|
version="1.0"
|
|
293
293
|
width="50.000000pt"
|
|
@@ -497,7 +497,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
497
497
|
/>
|
|
498
498
|
</g>
|
|
499
499
|
</svg>
|
|
500
|
-
`,
|
|
500
|
+
`,Bt=H`
|
|
501
501
|
<svg
|
|
502
502
|
version="1.0"
|
|
503
503
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -522,7 +522,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
522
522
|
/>
|
|
523
523
|
</g>
|
|
524
524
|
</svg>
|
|
525
|
-
`,
|
|
525
|
+
`,Dt=H`
|
|
526
526
|
<svg
|
|
527
527
|
version="1.0"
|
|
528
528
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -604,11 +604,11 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
604
604
|
<div class="popup-logo">${Ut}</div>
|
|
605
605
|
<p class="popup-title">${zt("learn-more-popup.title")}</p>
|
|
606
606
|
<div class="popup-disclaimer-subtitle">
|
|
607
|
-
<div class="popup-icon">${
|
|
607
|
+
<div class="popup-icon">${Bt}</div>
|
|
608
608
|
<p>${zt("learn-more-popup.disclaimer.subtitle-enable")}</p>
|
|
609
609
|
</div>
|
|
610
610
|
<div class="popup-disclaimer-subtitle">
|
|
611
|
-
<div class="popup-icon">${
|
|
611
|
+
<div class="popup-icon">${Dt}</div>
|
|
612
612
|
<p>${zt("learn-more-popup.disclaimer.subtitle-monitor")}</p>
|
|
613
613
|
</div>
|
|
614
614
|
<div class="popup-disclaimer-subtitle">
|
|
@@ -799,7 +799,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
799
799
|
background: transparent;
|
|
800
800
|
z-index: -1;
|
|
801
801
|
}
|
|
802
|
-
`;var
|
|
802
|
+
`;var Qt=Object.defineProperty;const Yt=class extends ht{constructor(){super(...arguments),this.active=!1}handleClosePopup(){const t=new Event("close");this.dispatchEvent(t)}handleRemoveProtection(){const t=new Event("remove-protection");this.dispatchEvent(t)}render(){return H`
|
|
803
803
|
<div class=${`shipaid-confirmation-popup ${this.active&&"active"}`}>
|
|
804
804
|
<p class="popup-title">Are you sure?</p>
|
|
805
805
|
<div class="popup-subtitle">
|
|
@@ -823,7 +823,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
823
823
|
</div>
|
|
824
824
|
</div>
|
|
825
825
|
<div class="blocker" @click=${this.handleClosePopup}></div>
|
|
826
|
-
`}};
|
|
826
|
+
`}};Yt.styles=Kt;let Jt=Yt;((t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);n&&Qt(e,i,n)})([n({type:Boolean,attribute:!0})],Jt.prototype,"active"),customElements.get("shipaid-popup-confirmation")||customElements.define("shipaid-popup-confirmation",Jt);var Xt=Object.defineProperty,te=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&Xt(e,i,n),n};const ee=class extends ht{constructor(){super(...arguments),this.open=!1,this.product=null,this.imageUrl=null,this.priceOfVariant=null,this.quantity=1,this.dontShowAgain="yes"===sessionStorage.getItem("shipaid-confirmation-dontshow")}handleDismiss(){this.dispatchEvent(new Event("dismiss-shipaid-cart"))}handleDontShowAgain(t){t.target.checked?sessionStorage.setItem("shipaid-confirmation-dontshow","yes"):sessionStorage.removeItem("shipaid-confirmation-dontshow")}handleConfirm(){this.dispatchEvent(new Event("confirm-shipaid-cart"))}render(){return H`
|
|
827
827
|
<div class=${"shipaid-cart-popup "+(this.open?"open":"")}>
|
|
828
828
|
<div class="popup-heading">
|
|
829
829
|
<slot name="shipaid-cart-popup-heading">Protect Your Order Instantly</slot>
|
|
@@ -987,7 +987,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
987
987
|
stroke: var(--shipaid-svg-stroke);
|
|
988
988
|
}
|
|
989
989
|
`;let ie=ee;te([n({type:Boolean,attribute:!0})],ie.prototype,"open"),te([n({type:String,attribute:!0})],ie.prototype,"product"),te([n({type:String,attribute:!0})],ie.prototype,"imageUrl"),te([n({type:String,attribute:!0})],ie.prototype,"priceOfVariant"),te([n({type:String,attribute:!0})],ie.prototype,"quantity"),te([n({type:Boolean})],ie.prototype,"dontShowAgain"),customElements.get("shipaid-cart-confirmation")||customElements.define("shipaid-cart-confirmation",ie);var oe=Object.defineProperty,re=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&oe(e,i,n),n};class ne extends ht{constructor(){super(...arguments),this.protectionPrice=0,this.checkoutTotal=0,this.logo="",this.originalClasses=""}createRenderRoot(){return this}handleAbout(){this.dispatchEvent(new Event("shipaid-about"))}handleCheckoutWithProtection(){this.dispatchEvent(new Event("shipaid-add-protection"))}handleCheckoutWithoutProtection(){this.dispatchEvent(new Event("shipaid-remove-protection"))}render(){return H`
|
|
990
|
-
<div class="container">
|
|
990
|
+
<div class="shipaid-container">
|
|
991
991
|
<div class="protection-info">
|
|
992
992
|
<div class="protection-text">
|
|
993
993
|
${this.logo}
|
|
@@ -1168,7 +1168,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1168
1168
|
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
1169
1169
|
height:var(--shipaid-footer-badge-logo-height, 9px);
|
|
1170
1170
|
}
|
|
1171
|
-
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-confirmation-last-action",$e="shipaid-protection",ke="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n }\n}",Se=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>je)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Je)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>oi)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>li)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>vi)).then((t=>t.default))});var Ae;Ae={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(Se,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Ae);const Pe=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._isCartVisibleOnScreen=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,s;const a=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(s=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:s.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",a)}return new Intl.NumberFormat(void 0,{currency:a,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request(ke,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:ke,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,s,a,d,p,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(s=o.data)?void 0:s.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(p=g[0])?void 0:p.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,s,a;try{let d;if(this.useCustomStoreFront){const p=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:$e});if(null==p?void 0:p.product){const l=p.product;d={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(a=null==(s=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:s.node)?void 0:a.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else d=(await this._fetch.get(`/products/${$e}.json`)).product;return d}catch(d){throw _e(d.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,s;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);s=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:s}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:s};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn)||!this._store.useCustomApp)return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const s=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(r=this._cart)?void 0:r.items[s];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;if(!!!sessionStorage.getItem(we)&&!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart){this.triggerShipAidAddToCartConfirm()||"dismiss"===sessionStorage.getItem(xe)||(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1171
|
+
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-protection",$e="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n useCustomApp\n }\n}",ke=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>qe)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>ii)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>pi)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>fi)).then((t=>t.default))});var Se;Se={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(ke,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Se);const Ae=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,s;const a=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(s=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:s.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",a)}return new Intl.NumberFormat(void 0,{currency:a,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request($e,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:$e,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,s,a,d,p,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(s=o.data)?void 0:s.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(p=g[0])?void 0:p.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,s,a;try{let d;if(this.useCustomStoreFront){const p=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:xe});if(null==p?void 0:p.product){const l=p.product;d={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(a=null==(s=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:s.node)?void 0:a.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else d=(await this._fetch.get(`/products/${xe}.json`)).product;return d}catch(d){throw _e(d.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,s;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);s=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:s}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:s};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn)||!this._store.useCustomApp)return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const s=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(r=this._cart)?void 0:r.items[s];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1172
1172
|
<shipaid-popup-learn-more
|
|
1173
1173
|
?active=${"learn-more"===this._popup}
|
|
1174
1174
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
@@ -1179,16 +1179,6 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1179
1179
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1180
1180
|
@remove-protection=${()=>{this.removeProtection(),this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1181
1181
|
></shipaid-popup-confirmation>
|
|
1182
|
-
`}confirmShipAidCart(){var t,e,i,o;return H`
|
|
1183
|
-
<shipaid-cart-confirmation
|
|
1184
|
-
.open=${"shipaid-confirm-cart"===this._popup}
|
|
1185
|
-
.product=${null==(t=this._protectionProduct)?void 0:t.title}
|
|
1186
|
-
.imageUrl=${null==(i=null==(e=this._protectionProduct)?void 0:e.image)?void 0:i.src}
|
|
1187
|
-
.priceOfVariant=${null==(o=this._protectionVariant)?void 0:o.price}
|
|
1188
|
-
.quantity=${1}
|
|
1189
|
-
@dismiss-shipaid-cart=${()=>{sessionStorage.setItem(xe,"dismiss"),this._popup=null,this.intervalId&&clearInterval(this.intervalId)}}
|
|
1190
|
-
@confirm-shipaid-cart=${async()=>{sessionStorage.setItem(xe,"add"),await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})),this._popup=null}}
|
|
1191
|
-
></shipaid-cart-confirmation>
|
|
1192
1182
|
`}contactlessCheckoutButtonTemplate(){if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const t=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(t.length)return t.forEach(((t,e)=>{var i,o;const r=`shipaid-checkout-container-${e}`;t.setAttribute("shipaid-hidden","");const n=t.className;let s=document.getElementById(r);s||(s=document.createElement("div"),s.id=r,s.style.width="100%",t.insertAdjacentElement("afterend",s));const a=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,p=this._hasProtectionInCart?d:a+d,l=H`
|
|
1193
1183
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1194
1184
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
@@ -1203,7 +1193,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1203
1193
|
font-family: Arial, sans-serif;
|
|
1204
1194
|
width: 100%;
|
|
1205
1195
|
}
|
|
1206
|
-
.container button {
|
|
1196
|
+
.shipaid-container button {
|
|
1207
1197
|
width: 100%;
|
|
1208
1198
|
}
|
|
1209
1199
|
.shipaid-loader {
|
|
@@ -1289,7 +1279,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1289
1279
|
width: 100%;
|
|
1290
1280
|
}
|
|
1291
1281
|
|
|
1292
|
-
.container button {
|
|
1282
|
+
.shipaid-container button {
|
|
1293
1283
|
width: 100%;
|
|
1294
1284
|
}
|
|
1295
1285
|
|
|
@@ -1357,7 +1347,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1357
1347
|
}
|
|
1358
1348
|
</style>
|
|
1359
1349
|
|
|
1360
|
-
<div class="container">
|
|
1350
|
+
<div class="shipaid-container">
|
|
1361
1351
|
<div class="protection-info">
|
|
1362
1352
|
<div class="protection-text">
|
|
1363
1353
|
${Vt}
|
|
@@ -1383,7 +1373,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1383
1373
|
<slot name="link-continue">Continue without delivery guarantee</slot>
|
|
1384
1374
|
</a>
|
|
1385
1375
|
</div>
|
|
1386
|
-
`}renderPopups(){switch(this.persistPopup&&(this._popup=this.shouldPersistPopup()),this._popup){case"confirmation":return this.confirmationPopupTemplate();case"learn-more":return this.learnMorePopupTemplate();
|
|
1376
|
+
`}renderPopups(){switch(this.persistPopup&&(this._popup=this.shouldPersistPopup()),this._popup){case"confirmation":return this.confirmationPopupTemplate();case"learn-more":return this.learnMorePopupTemplate();default:return null}}promptTemplate(){var t,e,i;if(this.useShipAidCheckout&&this.dataSelector)return this.checkoutButtonTemplate();const{useToggle:o,useCheckbox:r,leftCheckbox:n}=(null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)||{useToggle:!1,useCheckbox:!1,leftCheckbox:!1};return H`
|
|
1387
1377
|
<div class="shipaid-prompt">
|
|
1388
1378
|
<div class="prompt-product">
|
|
1389
1379
|
${qt(!this.disableActions&&n,(()=>H`
|
|
@@ -1393,7 +1383,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1393
1383
|
</label>
|
|
1394
1384
|
`))}
|
|
1395
1385
|
<div class="prompt-product-image">
|
|
1396
|
-
${qt(this._hasProtectionInCart,(()=>
|
|
1386
|
+
${qt(this._hasProtectionInCart,(()=>Ot),(()=>Nt))}
|
|
1397
1387
|
</div>
|
|
1398
1388
|
<div class="prompt-product-details">
|
|
1399
1389
|
<p class="prompt-product-details-title">
|
|
@@ -1440,7 +1430,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1440
1430
|
</a>
|
|
1441
1431
|
</div>
|
|
1442
1432
|
</div>
|
|
1443
|
-
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(s){console.warn(s)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const s=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',a=document.querySelector(s);if(console.log("q",a),a){a.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{a.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!s,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&s&&(this._cart.total_price===(null==s?void 0:s.final_line_price)||!a)){const t=await this.updateCartProtectionVariant(0,s);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void _e("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!s)return;if(this.supportSubscriptions){const t=this._cart.items.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));let i=null;if(!t&&(null==s?void 0:s.selling_plan_allocation))i={id:s.key,quantity:1,selling_plan:null};else if(t&&!(null==s?void 0:s.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:s.key,quantity:1,selling_plan:r}}if(i){const t=await this.updateCartProtectionVariant(i.quantity,s,i.selling_plan);await this._handleRefresh(t)}}if(d.id===s.variant_id){if(this._protectionCartItem={...s,index:n,position:n+1},1===s.quantity)return;const t=await this.updateCartProtectionVariant(1,s);return this._handleRefreshCart(),await this._handleRefresh(t)}const p={updates:{[s.variant_id]:0,[d.id]:1}},l=await this._fetch.post("/cart/update.js",p);await this._handleRefresh(l)}
|
|
1433
|
+
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(s){console.warn(s)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const s=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',a=document.querySelector(s);if(console.log("q",a),a){a.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{a.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!s,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&s&&(this._cart.total_price===(null==s?void 0:s.final_line_price)||!a)){const t=await this.updateCartProtectionVariant(0,s);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void _e("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!s)return;if(this.supportSubscriptions){const t=this._cart.items.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));let i=null;if(!t&&(null==s?void 0:s.selling_plan_allocation))i={id:s.key,quantity:1,selling_plan:null};else if(t&&!(null==s?void 0:s.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:s.key,quantity:1,selling_plan:r}}if(i){const t=await this.updateCartProtectionVariant(i.quantity,s,i.selling_plan);await this._handleRefresh(t)}}if(d.id===s.variant_id){if(this._protectionCartItem={...s,index:n,position:n+1},1===s.quantity)return;const t=await this.updateCartProtectionVariant(1,s);return this._handleRefreshCart(),await this._handleRefresh(t)}const p={updates:{[s.variant_id]:0,[d.id]:1}},l=await this._fetch.post("/cart/update.js",p);await this._handleRefresh(l)}render(){return Tt(this,(async()=>{var t,e,i,o,r,n;const s=document.createElement("link");s.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),s.setAttribute("rel","stylesheet"),document.head.appendChild(s);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(a){return _e(a.message),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)}return this.planActive?(null==(e=null==(t=this._store)?void 0:t.protectionSettings)?void 0:e.protectionType)?this._protectionProduct?(this._hasFinishedSetup=!0,this._dispatchEvent(me.LOADED,this._store),setTimeout((async()=>{var t,e,i,o;(null==(t=this._store)?void 0:t.widgetAutoOptIn)&&this._store.useCustomApp&&(null==(e=this._cart)?void 0:e.item_count)&&(this.customerId&&this._store.excludedCustomersIdsAutoOptIn&&(null==(i=this._store.excludedCustomersIdsAutoOptIn)?void 0:i.length)&&this._store.excludedCustomersIdsAutoOptIn.includes(`gid://shopify/Customer/${this.customerId}`)||sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0}))))}),500),void(this.disablePolling||(setInterval((async()=>{const t=this._cartLastUpdated;t&&(new Date).getTime()-t.getTime()<this.pollingInterval||await this.updateCart()}),this.pollingInterval),(null==(i=this._store)?void 0:i.widgetPollProtection)&&!this.intervalId&&(this.intervalId=setInterval((async()=>{await this.attemptAddProtection()}),400),localStorage.setItem(`polling-shipaid-protection_${this.intervalId}`,`${this.intervalId}`)),(null==(n=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:n.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(ye("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{await this.updateProtection()}),[this._store,this._cart]),Tt(this,(async()=>{pt(this.renderPopups(),document.body)}),[this._popup]),H`
|
|
1444
1434
|
<style>
|
|
1445
1435
|
:host {
|
|
1446
1436
|
--shipaid-primary: #002bd6;
|
|
@@ -1710,7 +1700,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1710
1700
|
}
|
|
1711
1701
|
</style>
|
|
1712
1702
|
<div class="shipaid">
|
|
1713
|
-
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r
|
|
1703
|
+
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r;const n=null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.checkoutButtonSelector,s=sessionStorage.getItem("shipaidWidgetTheme");!s&&n&&sessionStorage.setItem("shipaidWidgetTheme",n),!this.useShipAidCheckout&&n||sessionStorage.removeItem("shipaidWidgetTheme");return this._shouldShowWidget&&this.planActive&&(null==(r=this._store)?void 0:r.widgetShowCart)?s?this.contactlessCheckoutButtonTemplate():this.promptTemplate():Z}),(()=>sessionStorage.getItem("shipaidWidgetTheme")?this.contactlessCheckoutButtonTemplate():this.promptTemplate()))}
|
|
1714
1704
|
</div>
|
|
1715
1705
|
|
|
1716
|
-
`}};Pe.styles=ue;let Le=Pe;fe([n({type:String,attribute:!0})],Le.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Le.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Le.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Le.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Le.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Le.prototype,"lang"),fe([n({type:String,attribute:!0})],Le.prototype,"currency"),fe([n({type:String,attribute:!0})],Le.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Le.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Le.prototype,"useShipAidCheckout"),fe([s()],Le.prototype,"_storeDomain"),fe([s()],Le.prototype,"_store"),fe([s()],Le.prototype,"_cart"),fe([s()],Le.prototype,"_protectionProduct"),fe([s()],Le.prototype,"_cartLastUpdated"),fe([s()],Le.prototype,"_hasFinishedSetup"),fe([s()],Le.prototype,"_shouldShowWidget"),fe([s()],Le.prototype,"_isCartVisibleOnScreen"),fe([s()],Le.prototype,"_hasProtectionInCart"),fe([s()],Le.prototype,"_protectionCartItem"),fe([s()],Le.prototype,"_protectionVariant"),fe([s()],Le.prototype,"hasLoadedStrings"),fe([s()],Le.prototype,"fetchInterceptorCleanup"),fe([s()],Le.prototype,"intervalId"),fe([s()],Le.prototype,"_state"),fe([s()],Le.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Le);const ze="Laden des ShipAid-Widgets...",Ee="Liefergarantie",Ie="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Te={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},qe={loading:ze,title:Ee,description:Ie,footer:Me,actions:Te,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},je=Object.freeze(Object.defineProperty({__proto__:null,actions:Te,default:qe,description:Ie,footer:Me,loading:ze,title:Ee},Symbol.toStringTag,{value:"Module"})),Oe="Cargando el widget ShipAid...",Ne="Garantía de entrega",Ve="en caso de Pérdida, Daño o Robo",Re={button:"Energizado por"},Ue={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},De={loading:Oe,title:Ne,description:Ve,footer:Re,actions:Ue,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Ue,default:De,description:Ve,footer:Re,loading:Oe,title:Ne},Symbol.toStringTag,{value:"Module"})),Fe="Chargement du widget ShipAid...",He="Garantie de livraison",We="en cas de Perte, Dommages ou Vol",Ze={button:"Propulsé par"},Ge={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ke={loading:Fe,title:He,description:We,footer:Ze,actions:Ge,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Je=Object.freeze(Object.defineProperty({__proto__:null,actions:Ge,default:Ke,description:We,footer:Ze,loading:Fe,title:He},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Xe="in caso di Perdita, Danno o Furto",ti={button:"Offerto da"},ei={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ii={loading:Qe,title:Ye,description:Xe,footer:ti,actions:ei,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},oi=Object.freeze(Object.defineProperty({__proto__:null,actions:ei,default:ii,description:Xe,footer:ti,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),ri="Laad ShipAid Widget...",ni="Bezorggarantie",si="in geval van verlies, schade of diefstal",ai={button:"Aangedreven door"},di={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},pi={loading:ri,title:ni,description:si,footer:ai,actions:di,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},li=Object.freeze(Object.defineProperty({__proto__:null,actions:di,default:pi,description:si,footer:ai,loading:ri,title:ni},Symbol.toStringTag,{value:"Module"})),ci="Carregando o widget ShipAid...",hi="Garantia de entrega",ui="em caso de Perda, Danos ou Roubo",mi={button:"Distribuído por"},gi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},fi={loading:ci,title:hi,description:ui,footer:mi,actions:gi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},vi=Object.freeze(Object.defineProperty({__proto__:null,actions:gi,default:fi,description:ui,footer:mi,loading:ci,title:hi},Symbol.toStringTag,{value:"Module"}));return t.ShipAidWidget=Le,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
|
1706
|
+
`}};Ae.styles=ue;let Pe=Ae;fe([n({type:String,attribute:!0})],Pe.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Pe.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Pe.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Pe.prototype,"lang"),fe([n({type:String,attribute:!0})],Pe.prototype,"currency"),fe([n({type:String,attribute:!0})],Pe.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Pe.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Pe.prototype,"useShipAidCheckout"),fe([s()],Pe.prototype,"_storeDomain"),fe([s()],Pe.prototype,"_store"),fe([s()],Pe.prototype,"_cart"),fe([s()],Pe.prototype,"_protectionProduct"),fe([s()],Pe.prototype,"_cartLastUpdated"),fe([s()],Pe.prototype,"_hasFinishedSetup"),fe([s()],Pe.prototype,"_shouldShowWidget"),fe([s()],Pe.prototype,"_hasProtectionInCart"),fe([s()],Pe.prototype,"_protectionCartItem"),fe([s()],Pe.prototype,"_protectionVariant"),fe([s()],Pe.prototype,"hasLoadedStrings"),fe([s()],Pe.prototype,"fetchInterceptorCleanup"),fe([s()],Pe.prototype,"intervalId"),fe([s()],Pe.prototype,"_state"),fe([s()],Pe.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Pe);const Le="Laden des ShipAid-Widgets...",ze="Liefergarantie",Ee="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Ie={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},Te={loading:Le,title:ze,description:Ee,footer:Me,actions:Ie,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},qe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ie,default:Te,description:Ee,footer:Me,loading:Le,title:ze},Symbol.toStringTag,{value:"Module"})),je="Cargando el widget ShipAid...",Ne="Garantía de entrega",Oe="en caso de Pérdida, Daño o Robo",Ve={button:"Energizado por"},Re={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},Ue={loading:je,title:Ne,description:Oe,footer:Ve,actions:Re,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Re,default:Ue,description:Oe,footer:Ve,loading:je,title:Ne},Symbol.toStringTag,{value:"Module"})),De="Chargement du widget ShipAid...",Fe="Garantie de livraison",He="en cas de Perte, Dommages ou Vol",We={button:"Propulsé par"},Ze={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ge={loading:De,title:Fe,description:He,footer:We,actions:Ze,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Ke=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,default:Ge,description:He,footer:We,loading:De,title:Fe},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Je="in caso di Perdita, Danno o Furto",Xe={button:"Offerto da"},ti={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ei={loading:Qe,title:Ye,description:Je,footer:Xe,actions:ti,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},ii=Object.freeze(Object.defineProperty({__proto__:null,actions:ti,default:ei,description:Je,footer:Xe,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),oi="Laad ShipAid Widget...",ri="Bezorggarantie",ni="in geval van verlies, schade of diefstal",si={button:"Aangedreven door"},ai={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},di={loading:oi,title:ri,description:ni,footer:si,actions:ai,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},pi=Object.freeze(Object.defineProperty({__proto__:null,actions:ai,default:di,description:ni,footer:si,loading:oi,title:ri},Symbol.toStringTag,{value:"Module"})),li="Carregando o widget ShipAid...",ci="Garantia de entrega",hi="em caso de Perda, Danos ou Roubo",ui={button:"Distribuído por"},mi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},gi={loading:li,title:ci,description:hi,footer:ui,actions:mi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},fi=Object.freeze(Object.defineProperty({__proto__:null,actions:mi,default:gi,description:hi,footer:ui,loading:li,title:ci},Symbol.toStringTag,{value:"Module"}));return t.ShipAidWidget=Pe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/widget.umd.js
CHANGED
|
@@ -30,7 +30,7 @@ const d=window,p=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"
|
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
32
|
*/
|
|
33
|
-
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,
|
|
33
|
+
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,M=`<${E}>`,I=document,T=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,U=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,F=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),W=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,K=I.createTreeWalker(I,129,null,!1);var Q;function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const s=t.length-1,a=this.parts,[d,p]=((t,e)=>{const i=t.length-1,o=[];let r,n=2===e?"<svg>":"",s=O;for(let a=0;a<i;a++){const e=t[a];let i,d,p=-1,l=0;for(;l<e.length&&(s.lastIndex=l,d=s.exec(e),null!==d);)l=s.lastIndex,s===O?"!--"===d[1]?s=V:void 0!==d[1]?s=R:void 0!==d[2]?(F.test(d[2])&&(r=RegExp("</"+d[2],"g")),s=U):void 0!==d[3]&&(s=U):s===U?">"===d[0]?(s=null!=r?r:O,p=-1):void 0===d[1]?p=-2:(p=s.lastIndex-d[2].length,i=d[1],s=void 0===d[3]?U:'"'===d[3]?D:B):s===D||s===B?s=U:s===V||s===R?s=O:(s=U,r=void 0);const c=s===U&&t[a+1].startsWith("/>")?" ":"";n+=s===O?e+M:p>=0?(o.push(i),e.slice(0,p)+L+e.slice(p)+z+c):e+z+(-2===p?(o.push(void 0),a):c)}return[Y(t,n+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=J.createElement(d,i),K.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=K.nextNode())&&a.length<s;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(L)||e.startsWith(z)){const i=p[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+L).split(z),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?nt:"@"===e[1]?st:it})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(F.test(o.tagName)){const t=o.textContent.split(z),e=t.length-1;if(e>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),K.nextNode(),a.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===E)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(z,t+1));)a.push({type:7,index:r}),t+=z.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var r,n,s,a;if(e===W)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const p=q(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==p&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===p?d=void 0:(d=new p(t),d._$AT(t,i,o)),void 0!==o?(null!==(s=(a=i)._$Co)&&void 0!==s?s:a._$Co=[])[o]=d:i._$Cl=d),void 0!==d&&(e=X(t,d._$AS(t,e.values),d,o)),e}class tt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:I).importNode(i,!0);K.currentNode=r;let n=K.nextNode(),s=0,a=0,d=o[0];for(;void 0!==d;){if(s===d.index){let e;2===d.type?e=new et(n,n.nextSibling,this,t):1===d.type?e=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(e=new at(n,this,t)),this._$AV.push(e),d=o[++a]}s!==(null==d?void 0:d.index)&&(n=K.nextNode(),s++)}return K.currentNode=I,r}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,o){var r;this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),q(t)?t===Z||null==t||""===t?(this._$AH!==Z&&this._$AR(),this._$AH=Z):t!==this._$AH&&t!==W&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Z&&q(this._$AH)?this._$AA.nextSibling.data=t:this.$(I.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=J.createElement(Y(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.v(i);else{const t=new tt(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new J(t)),e}T(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new et(this.k(T()),this.k(T()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,o,r){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let n=!1;if(void 0===r)t=X(this,t,e,0),n=!q(t)||t!==this._$AH&&t!==W,n&&(this._$AH=t);else{const o=t;let s,a;for(t=r[0],s=0;s<r.length-1;s++)a=X(this,o[i+s],e,s),a===W&&(a=this._$AH[s]),n||(n=!q(a)||a!==this._$AH[s]),a===Z?t=Z:t!==Z&&(t+=(null!=a?a:"")+r[s+1]),this._$AH[s]=a}n&&!o&&this.j(t)}j(t){t===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ot extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Z?void 0:t}}const rt=A?A.emptyScript:"";class nt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Z?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class st extends it{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:Z)===W)return;const o=this._$AH,r=t===Z&&o!==Z||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==Z&&(o===Z||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const dt=S.litHtmlPolyfillSupport;null==dt||dt(J,et),(null!==(k=S.litHtmlVersions)&&void 0!==k?k:S.litHtmlVersions=[]).push("2.8.0");const pt=(t,e,i)=>{var o,r;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let s=n._$litPart$;if(void 0===s){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=s=new et(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s};
|
|
34
34
|
/**
|
|
35
35
|
* @license
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
@@ -56,7 +56,7 @@ const _t=2;class wt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i)
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/class Et extends wt{constructor(t){if(super(t),this.et=Z,t.type!==_t)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Z||null==t)return this.ft=void 0,this.et=t;if(t===W)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Et.directiveName="unsafeHTML",Et.resultType=1;const
|
|
59
|
+
*/class Et extends wt{constructor(t){if(super(t),this.et=Z,t.type!==_t)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Z||null==t)return this.ft=void 0,this.et=t;if(t===W)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Et.directiveName="unsafeHTML",Et.resultType=1;const Mt="__registered_effects";function It(t){const e=t;if(e[Mt])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),o=i.updated;return e[Mt]={index:0,count:0,effects:[]},i.updated=t=>(e[Mt].index=0,o(t)),e}function Tt(t,e,i){const o=function(t,e){const i=It(t),{index:o,count:r}=i[Mt];return o===r?(i[Mt].index++,i[Mt].count++,i[Mt].effects.push(e),e):(i[Mt].index++,i[Mt].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
|
|
60
60
|
/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2021 Google LLC
|
|
@@ -266,7 +266,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
266
266
|
background: transparent;
|
|
267
267
|
z-index: -1;
|
|
268
268
|
}
|
|
269
|
-
`,
|
|
269
|
+
`,Nt=H`
|
|
270
270
|
<svg
|
|
271
271
|
version="1.0"
|
|
272
272
|
width="50.000000pt"
|
|
@@ -287,7 +287,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
287
287
|
/>
|
|
288
288
|
</g>
|
|
289
289
|
</svg>
|
|
290
|
-
`,
|
|
290
|
+
`,Ot=H`
|
|
291
291
|
<svg
|
|
292
292
|
version="1.0"
|
|
293
293
|
width="50.000000pt"
|
|
@@ -497,7 +497,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
497
497
|
/>
|
|
498
498
|
</g>
|
|
499
499
|
</svg>
|
|
500
|
-
`,
|
|
500
|
+
`,Bt=H`
|
|
501
501
|
<svg
|
|
502
502
|
version="1.0"
|
|
503
503
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -522,7 +522,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
522
522
|
/>
|
|
523
523
|
</g>
|
|
524
524
|
</svg>
|
|
525
|
-
`,
|
|
525
|
+
`,Dt=H`
|
|
526
526
|
<svg
|
|
527
527
|
version="1.0"
|
|
528
528
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -604,11 +604,11 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
604
604
|
<div class="popup-logo">${Ut}</div>
|
|
605
605
|
<p class="popup-title">${zt("learn-more-popup.title")}</p>
|
|
606
606
|
<div class="popup-disclaimer-subtitle">
|
|
607
|
-
<div class="popup-icon">${
|
|
607
|
+
<div class="popup-icon">${Bt}</div>
|
|
608
608
|
<p>${zt("learn-more-popup.disclaimer.subtitle-enable")}</p>
|
|
609
609
|
</div>
|
|
610
610
|
<div class="popup-disclaimer-subtitle">
|
|
611
|
-
<div class="popup-icon">${
|
|
611
|
+
<div class="popup-icon">${Dt}</div>
|
|
612
612
|
<p>${zt("learn-more-popup.disclaimer.subtitle-monitor")}</p>
|
|
613
613
|
</div>
|
|
614
614
|
<div class="popup-disclaimer-subtitle">
|
|
@@ -799,7 +799,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
799
799
|
background: transparent;
|
|
800
800
|
z-index: -1;
|
|
801
801
|
}
|
|
802
|
-
`;var
|
|
802
|
+
`;var Qt=Object.defineProperty;const Yt=class extends ht{constructor(){super(...arguments),this.active=!1}handleClosePopup(){const t=new Event("close");this.dispatchEvent(t)}handleRemoveProtection(){const t=new Event("remove-protection");this.dispatchEvent(t)}render(){return H`
|
|
803
803
|
<div class=${`shipaid-confirmation-popup ${this.active&&"active"}`}>
|
|
804
804
|
<p class="popup-title">Are you sure?</p>
|
|
805
805
|
<div class="popup-subtitle">
|
|
@@ -823,7 +823,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
823
823
|
</div>
|
|
824
824
|
</div>
|
|
825
825
|
<div class="blocker" @click=${this.handleClosePopup}></div>
|
|
826
|
-
`}};
|
|
826
|
+
`}};Yt.styles=Kt;let Jt=Yt;((t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);n&&Qt(e,i,n)})([n({type:Boolean,attribute:!0})],Jt.prototype,"active"),customElements.get("shipaid-popup-confirmation")||customElements.define("shipaid-popup-confirmation",Jt);var Xt=Object.defineProperty,te=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&Xt(e,i,n),n};const ee=class extends ht{constructor(){super(...arguments),this.open=!1,this.product=null,this.imageUrl=null,this.priceOfVariant=null,this.quantity=1,this.dontShowAgain="yes"===sessionStorage.getItem("shipaid-confirmation-dontshow")}handleDismiss(){this.dispatchEvent(new Event("dismiss-shipaid-cart"))}handleDontShowAgain(t){t.target.checked?sessionStorage.setItem("shipaid-confirmation-dontshow","yes"):sessionStorage.removeItem("shipaid-confirmation-dontshow")}handleConfirm(){this.dispatchEvent(new Event("confirm-shipaid-cart"))}render(){return H`
|
|
827
827
|
<div class=${"shipaid-cart-popup "+(this.open?"open":"")}>
|
|
828
828
|
<div class="popup-heading">
|
|
829
829
|
<slot name="shipaid-cart-popup-heading">Protect Your Order Instantly</slot>
|
|
@@ -987,7 +987,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
987
987
|
stroke: var(--shipaid-svg-stroke);
|
|
988
988
|
}
|
|
989
989
|
`;let ie=ee;te([n({type:Boolean,attribute:!0})],ie.prototype,"open"),te([n({type:String,attribute:!0})],ie.prototype,"product"),te([n({type:String,attribute:!0})],ie.prototype,"imageUrl"),te([n({type:String,attribute:!0})],ie.prototype,"priceOfVariant"),te([n({type:String,attribute:!0})],ie.prototype,"quantity"),te([n({type:Boolean})],ie.prototype,"dontShowAgain"),customElements.get("shipaid-cart-confirmation")||customElements.define("shipaid-cart-confirmation",ie);var oe=Object.defineProperty,re=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&oe(e,i,n),n};class ne extends ht{constructor(){super(...arguments),this.protectionPrice=0,this.checkoutTotal=0,this.logo="",this.originalClasses=""}createRenderRoot(){return this}handleAbout(){this.dispatchEvent(new Event("shipaid-about"))}handleCheckoutWithProtection(){this.dispatchEvent(new Event("shipaid-add-protection"))}handleCheckoutWithoutProtection(){this.dispatchEvent(new Event("shipaid-remove-protection"))}render(){return H`
|
|
990
|
-
<div class="container">
|
|
990
|
+
<div class="shipaid-container">
|
|
991
991
|
<div class="protection-info">
|
|
992
992
|
<div class="protection-text">
|
|
993
993
|
${this.logo}
|
|
@@ -1168,7 +1168,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1168
1168
|
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
1169
1169
|
height:var(--shipaid-footer-badge-logo-height, 9px);
|
|
1170
1170
|
}
|
|
1171
|
-
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-confirmation-last-action",$e="shipaid-protection",ke="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n }\n}",Se=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>je)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Je)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>oi)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>li)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>vi)).then((t=>t.default))});var Ae;Ae={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(Se,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Ae);const Pe=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._isCartVisibleOnScreen=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,s;const a=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(s=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:s.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",a)}return new Intl.NumberFormat(void 0,{currency:a,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request(ke,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:ke,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,s,a,d,p,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(s=o.data)?void 0:s.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(p=g[0])?void 0:p.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,s,a;try{let d;if(this.useCustomStoreFront){const p=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:$e});if(null==p?void 0:p.product){const l=p.product;d={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(a=null==(s=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:s.node)?void 0:a.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else d=(await this._fetch.get(`/products/${$e}.json`)).product;return d}catch(d){throw _e(d.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,s;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);s=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:s}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:s};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn)||!this._store.useCustomApp)return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const s=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(r=this._cart)?void 0:r.items[s];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;if(!!!sessionStorage.getItem(we)&&!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart){this.triggerShipAidAddToCartConfirm()||"dismiss"===sessionStorage.getItem(xe)||(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1171
|
+
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-protection",$e="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n useCustomApp\n }\n}",ke=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>qe)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>ii)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>pi)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>fi)).then((t=>t.default))});var Se;Se={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(ke,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Se);const Ae=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,s;const a=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(s=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:s.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",a)}return new Intl.NumberFormat(void 0,{currency:a,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request($e,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:$e,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,s,a,d,p,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(s=o.data)?void 0:s.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(p=g[0])?void 0:p.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,s,a;try{let d;if(this.useCustomStoreFront){const p=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:xe});if(null==p?void 0:p.product){const l=p.product;d={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(a=null==(s=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:s.node)?void 0:a.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else d=(await this._fetch.get(`/products/${xe}.json`)).product;return d}catch(d){throw _e(d.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,s;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);s=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:s}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:s};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn)||!this._store.useCustomApp)return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const s=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(r=this._cart)?void 0:r.items[s];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1172
1172
|
<shipaid-popup-learn-more
|
|
1173
1173
|
?active=${"learn-more"===this._popup}
|
|
1174
1174
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
@@ -1179,16 +1179,6 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1179
1179
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1180
1180
|
@remove-protection=${()=>{this.removeProtection(),this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1181
1181
|
></shipaid-popup-confirmation>
|
|
1182
|
-
`}confirmShipAidCart(){var t,e,i,o;return H`
|
|
1183
|
-
<shipaid-cart-confirmation
|
|
1184
|
-
.open=${"shipaid-confirm-cart"===this._popup}
|
|
1185
|
-
.product=${null==(t=this._protectionProduct)?void 0:t.title}
|
|
1186
|
-
.imageUrl=${null==(i=null==(e=this._protectionProduct)?void 0:e.image)?void 0:i.src}
|
|
1187
|
-
.priceOfVariant=${null==(o=this._protectionVariant)?void 0:o.price}
|
|
1188
|
-
.quantity=${1}
|
|
1189
|
-
@dismiss-shipaid-cart=${()=>{sessionStorage.setItem(xe,"dismiss"),this._popup=null,this.intervalId&&clearInterval(this.intervalId)}}
|
|
1190
|
-
@confirm-shipaid-cart=${async()=>{sessionStorage.setItem(xe,"add"),await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})),this._popup=null}}
|
|
1191
|
-
></shipaid-cart-confirmation>
|
|
1192
1182
|
`}contactlessCheckoutButtonTemplate(){if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const t=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(t.length)return t.forEach(((t,e)=>{var i,o;const r=`shipaid-checkout-container-${e}`;t.setAttribute("shipaid-hidden","");const n=t.className;let s=document.getElementById(r);s||(s=document.createElement("div"),s.id=r,s.style.width="100%",t.insertAdjacentElement("afterend",s));const a=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,p=this._hasProtectionInCart?d:a+d,l=H`
|
|
1193
1183
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1194
1184
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
@@ -1203,7 +1193,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1203
1193
|
font-family: Arial, sans-serif;
|
|
1204
1194
|
width: 100%;
|
|
1205
1195
|
}
|
|
1206
|
-
.container button {
|
|
1196
|
+
.shipaid-container button {
|
|
1207
1197
|
width: 100%;
|
|
1208
1198
|
}
|
|
1209
1199
|
.shipaid-loader {
|
|
@@ -1289,7 +1279,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1289
1279
|
width: 100%;
|
|
1290
1280
|
}
|
|
1291
1281
|
|
|
1292
|
-
.container button {
|
|
1282
|
+
.shipaid-container button {
|
|
1293
1283
|
width: 100%;
|
|
1294
1284
|
}
|
|
1295
1285
|
|
|
@@ -1357,7 +1347,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1357
1347
|
}
|
|
1358
1348
|
</style>
|
|
1359
1349
|
|
|
1360
|
-
<div class="container">
|
|
1350
|
+
<div class="shipaid-container">
|
|
1361
1351
|
<div class="protection-info">
|
|
1362
1352
|
<div class="protection-text">
|
|
1363
1353
|
${Vt}
|
|
@@ -1383,7 +1373,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1383
1373
|
<slot name="link-continue">Continue without delivery guarantee</slot>
|
|
1384
1374
|
</a>
|
|
1385
1375
|
</div>
|
|
1386
|
-
`}renderPopups(){switch(this.persistPopup&&(this._popup=this.shouldPersistPopup()),this._popup){case"confirmation":return this.confirmationPopupTemplate();case"learn-more":return this.learnMorePopupTemplate();
|
|
1376
|
+
`}renderPopups(){switch(this.persistPopup&&(this._popup=this.shouldPersistPopup()),this._popup){case"confirmation":return this.confirmationPopupTemplate();case"learn-more":return this.learnMorePopupTemplate();default:return null}}promptTemplate(){var t,e,i;if(this.useShipAidCheckout&&this.dataSelector)return this.checkoutButtonTemplate();const{useToggle:o,useCheckbox:r,leftCheckbox:n}=(null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)||{useToggle:!1,useCheckbox:!1,leftCheckbox:!1};return H`
|
|
1387
1377
|
<div class="shipaid-prompt">
|
|
1388
1378
|
<div class="prompt-product">
|
|
1389
1379
|
${qt(!this.disableActions&&n,(()=>H`
|
|
@@ -1393,7 +1383,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1393
1383
|
</label>
|
|
1394
1384
|
`))}
|
|
1395
1385
|
<div class="prompt-product-image">
|
|
1396
|
-
${qt(this._hasProtectionInCart,(()=>
|
|
1386
|
+
${qt(this._hasProtectionInCart,(()=>Ot),(()=>Nt))}
|
|
1397
1387
|
</div>
|
|
1398
1388
|
<div class="prompt-product-details">
|
|
1399
1389
|
<p class="prompt-product-details-title">
|
|
@@ -1440,7 +1430,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1440
1430
|
</a>
|
|
1441
1431
|
</div>
|
|
1442
1432
|
</div>
|
|
1443
|
-
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(s){console.warn(s)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const s=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',a=document.querySelector(s);if(console.log("q",a),a){a.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{a.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!s,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&s&&(this._cart.total_price===(null==s?void 0:s.final_line_price)||!a)){const t=await this.updateCartProtectionVariant(0,s);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void _e("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!s)return;if(this.supportSubscriptions){const t=this._cart.items.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));let i=null;if(!t&&(null==s?void 0:s.selling_plan_allocation))i={id:s.key,quantity:1,selling_plan:null};else if(t&&!(null==s?void 0:s.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:s.key,quantity:1,selling_plan:r}}if(i){const t=await this.updateCartProtectionVariant(i.quantity,s,i.selling_plan);await this._handleRefresh(t)}}if(d.id===s.variant_id){if(this._protectionCartItem={...s,index:n,position:n+1},1===s.quantity)return;const t=await this.updateCartProtectionVariant(1,s);return this._handleRefreshCart(),await this._handleRefresh(t)}const p={updates:{[s.variant_id]:0,[d.id]:1}},l=await this._fetch.post("/cart/update.js",p);await this._handleRefresh(l)}
|
|
1433
|
+
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(s){console.warn(s)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const s=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',a=document.querySelector(s);if(console.log("q",a),a){a.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{a.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!s,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&s&&(this._cart.total_price===(null==s?void 0:s.final_line_price)||!a)){const t=await this.updateCartProtectionVariant(0,s);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void _e("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!s)return;if(this.supportSubscriptions){const t=this._cart.items.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));let i=null;if(!t&&(null==s?void 0:s.selling_plan_allocation))i={id:s.key,quantity:1,selling_plan:null};else if(t&&!(null==s?void 0:s.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:s.key,quantity:1,selling_plan:r}}if(i){const t=await this.updateCartProtectionVariant(i.quantity,s,i.selling_plan);await this._handleRefresh(t)}}if(d.id===s.variant_id){if(this._protectionCartItem={...s,index:n,position:n+1},1===s.quantity)return;const t=await this.updateCartProtectionVariant(1,s);return this._handleRefreshCart(),await this._handleRefresh(t)}const p={updates:{[s.variant_id]:0,[d.id]:1}},l=await this._fetch.post("/cart/update.js",p);await this._handleRefresh(l)}render(){return Tt(this,(async()=>{var t,e,i,o,r,n;const s=document.createElement("link");s.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),s.setAttribute("rel","stylesheet"),document.head.appendChild(s);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(a){return _e(a.message),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)}return this.planActive?(null==(e=null==(t=this._store)?void 0:t.protectionSettings)?void 0:e.protectionType)?this._protectionProduct?(this._hasFinishedSetup=!0,this._dispatchEvent(me.LOADED,this._store),setTimeout((async()=>{var t,e,i,o;(null==(t=this._store)?void 0:t.widgetAutoOptIn)&&this._store.useCustomApp&&(null==(e=this._cart)?void 0:e.item_count)&&(this.customerId&&this._store.excludedCustomersIdsAutoOptIn&&(null==(i=this._store.excludedCustomersIdsAutoOptIn)?void 0:i.length)&&this._store.excludedCustomersIdsAutoOptIn.includes(`gid://shopify/Customer/${this.customerId}`)||sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0}))))}),500),void(this.disablePolling||(setInterval((async()=>{const t=this._cartLastUpdated;t&&(new Date).getTime()-t.getTime()<this.pollingInterval||await this.updateCart()}),this.pollingInterval),(null==(i=this._store)?void 0:i.widgetPollProtection)&&!this.intervalId&&(this.intervalId=setInterval((async()=>{await this.attemptAddProtection()}),400),localStorage.setItem(`polling-shipaid-protection_${this.intervalId}`,`${this.intervalId}`)),(null==(n=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:n.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(ye("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{await this.updateProtection()}),[this._store,this._cart]),Tt(this,(async()=>{pt(this.renderPopups(),document.body)}),[this._popup]),H`
|
|
1444
1434
|
<style>
|
|
1445
1435
|
:host {
|
|
1446
1436
|
--shipaid-primary: #002bd6;
|
|
@@ -1710,7 +1700,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1710
1700
|
}
|
|
1711
1701
|
</style>
|
|
1712
1702
|
<div class="shipaid">
|
|
1713
|
-
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r
|
|
1703
|
+
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r;const n=null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.checkoutButtonSelector,s=sessionStorage.getItem("shipaidWidgetTheme");!s&&n&&sessionStorage.setItem("shipaidWidgetTheme",n),!this.useShipAidCheckout&&n||sessionStorage.removeItem("shipaidWidgetTheme");return this._shouldShowWidget&&this.planActive&&(null==(r=this._store)?void 0:r.widgetShowCart)?s?this.contactlessCheckoutButtonTemplate():this.promptTemplate():Z}),(()=>sessionStorage.getItem("shipaidWidgetTheme")?this.contactlessCheckoutButtonTemplate():this.promptTemplate()))}
|
|
1714
1704
|
</div>
|
|
1715
1705
|
|
|
1716
|
-
`}};Pe.styles=ue;let Le=Pe;fe([n({type:String,attribute:!0})],Le.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Le.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Le.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Le.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Le.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Le.prototype,"lang"),fe([n({type:String,attribute:!0})],Le.prototype,"currency"),fe([n({type:String,attribute:!0})],Le.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Le.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Le.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Le.prototype,"useShipAidCheckout"),fe([s()],Le.prototype,"_storeDomain"),fe([s()],Le.prototype,"_store"),fe([s()],Le.prototype,"_cart"),fe([s()],Le.prototype,"_protectionProduct"),fe([s()],Le.prototype,"_cartLastUpdated"),fe([s()],Le.prototype,"_hasFinishedSetup"),fe([s()],Le.prototype,"_shouldShowWidget"),fe([s()],Le.prototype,"_isCartVisibleOnScreen"),fe([s()],Le.prototype,"_hasProtectionInCart"),fe([s()],Le.prototype,"_protectionCartItem"),fe([s()],Le.prototype,"_protectionVariant"),fe([s()],Le.prototype,"hasLoadedStrings"),fe([s()],Le.prototype,"fetchInterceptorCleanup"),fe([s()],Le.prototype,"intervalId"),fe([s()],Le.prototype,"_state"),fe([s()],Le.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Le);const ze="Laden des ShipAid-Widgets...",Ee="Liefergarantie",Ie="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Te={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},qe={loading:ze,title:Ee,description:Ie,footer:Me,actions:Te,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},je=Object.freeze(Object.defineProperty({__proto__:null,actions:Te,default:qe,description:Ie,footer:Me,loading:ze,title:Ee},Symbol.toStringTag,{value:"Module"})),Oe="Cargando el widget ShipAid...",Ne="Garantía de entrega",Ve="en caso de Pérdida, Daño o Robo",Re={button:"Energizado por"},Ue={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},De={loading:Oe,title:Ne,description:Ve,footer:Re,actions:Ue,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Ue,default:De,description:Ve,footer:Re,loading:Oe,title:Ne},Symbol.toStringTag,{value:"Module"})),Fe="Chargement du widget ShipAid...",He="Garantie de livraison",We="en cas de Perte, Dommages ou Vol",Ze={button:"Propulsé par"},Ge={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ke={loading:Fe,title:He,description:We,footer:Ze,actions:Ge,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Je=Object.freeze(Object.defineProperty({__proto__:null,actions:Ge,default:Ke,description:We,footer:Ze,loading:Fe,title:He},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Xe="in caso di Perdita, Danno o Furto",ti={button:"Offerto da"},ei={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ii={loading:Qe,title:Ye,description:Xe,footer:ti,actions:ei,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},oi=Object.freeze(Object.defineProperty({__proto__:null,actions:ei,default:ii,description:Xe,footer:ti,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),ri="Laad ShipAid Widget...",ni="Bezorggarantie",si="in geval van verlies, schade of diefstal",ai={button:"Aangedreven door"},di={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},pi={loading:ri,title:ni,description:si,footer:ai,actions:di,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},li=Object.freeze(Object.defineProperty({__proto__:null,actions:di,default:pi,description:si,footer:ai,loading:ri,title:ni},Symbol.toStringTag,{value:"Module"})),ci="Carregando o widget ShipAid...",hi="Garantia de entrega",ui="em caso de Perda, Danos ou Roubo",mi={button:"Distribuído por"},gi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},fi={loading:ci,title:hi,description:ui,footer:mi,actions:gi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},vi=Object.freeze(Object.defineProperty({__proto__:null,actions:gi,default:fi,description:ui,footer:mi,loading:ci,title:hi},Symbol.toStringTag,{value:"Module"}));t.ShipAidWidget=Le,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
1706
|
+
`}};Ae.styles=ue;let Pe=Ae;fe([n({type:String,attribute:!0})],Pe.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Pe.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Pe.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Pe.prototype,"lang"),fe([n({type:String,attribute:!0})],Pe.prototype,"currency"),fe([n({type:String,attribute:!0})],Pe.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Pe.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Pe.prototype,"useShipAidCheckout"),fe([s()],Pe.prototype,"_storeDomain"),fe([s()],Pe.prototype,"_store"),fe([s()],Pe.prototype,"_cart"),fe([s()],Pe.prototype,"_protectionProduct"),fe([s()],Pe.prototype,"_cartLastUpdated"),fe([s()],Pe.prototype,"_hasFinishedSetup"),fe([s()],Pe.prototype,"_shouldShowWidget"),fe([s()],Pe.prototype,"_hasProtectionInCart"),fe([s()],Pe.prototype,"_protectionCartItem"),fe([s()],Pe.prototype,"_protectionVariant"),fe([s()],Pe.prototype,"hasLoadedStrings"),fe([s()],Pe.prototype,"fetchInterceptorCleanup"),fe([s()],Pe.prototype,"intervalId"),fe([s()],Pe.prototype,"_state"),fe([s()],Pe.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Pe);const Le="Laden des ShipAid-Widgets...",ze="Liefergarantie",Ee="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Ie={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},Te={loading:Le,title:ze,description:Ee,footer:Me,actions:Ie,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},qe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ie,default:Te,description:Ee,footer:Me,loading:Le,title:ze},Symbol.toStringTag,{value:"Module"})),je="Cargando el widget ShipAid...",Ne="Garantía de entrega",Oe="en caso de Pérdida, Daño o Robo",Ve={button:"Energizado por"},Re={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},Ue={loading:je,title:Ne,description:Oe,footer:Ve,actions:Re,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Re,default:Ue,description:Oe,footer:Ve,loading:je,title:Ne},Symbol.toStringTag,{value:"Module"})),De="Chargement du widget ShipAid...",Fe="Garantie de livraison",He="en cas de Perte, Dommages ou Vol",We={button:"Propulsé par"},Ze={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ge={loading:De,title:Fe,description:He,footer:We,actions:Ze,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Ke=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,default:Ge,description:He,footer:We,loading:De,title:Fe},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Je="in caso di Perdita, Danno o Furto",Xe={button:"Offerto da"},ti={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ei={loading:Qe,title:Ye,description:Je,footer:Xe,actions:ti,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},ii=Object.freeze(Object.defineProperty({__proto__:null,actions:ti,default:ei,description:Je,footer:Xe,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),oi="Laad ShipAid Widget...",ri="Bezorggarantie",ni="in geval van verlies, schade of diefstal",si={button:"Aangedreven door"},ai={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},di={loading:oi,title:ri,description:ni,footer:si,actions:ai,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},pi=Object.freeze(Object.defineProperty({__proto__:null,actions:ai,default:di,description:ni,footer:si,loading:oi,title:ri},Symbol.toStringTag,{value:"Module"})),li="Carregando o widget ShipAid...",ci="Garantia de entrega",hi="em caso de Perda, Danos ou Roubo",ui={button:"Distribuído por"},mi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},gi={loading:li,title:ci,description:hi,footer:ui,actions:mi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},fi=Object.freeze(Object.defineProperty({__proto__:null,actions:mi,default:gi,description:hi,footer:ui,loading:li,title:ci},Symbol.toStringTag,{value:"Module"}));t.ShipAidWidget=Pe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -49,7 +49,6 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
49
49
|
/** Can be used to hide all widget content */
|
|
50
50
|
private _shouldShowWidget;
|
|
51
51
|
/** Can be used to check if page is on Cart */
|
|
52
|
-
private _isCartVisibleOnScreen;
|
|
53
52
|
/** Whether the ShipAid protection product is currently added to the cart */
|
|
54
53
|
private _hasProtectionInCart;
|
|
55
54
|
/** The protection item from the Shopify cart */
|
|
@@ -129,7 +128,6 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
129
128
|
/** Templates */
|
|
130
129
|
learnMorePopupTemplate(): import("lit").TemplateResult<1>;
|
|
131
130
|
confirmationPopupTemplate(): import("lit").TemplateResult<1>;
|
|
132
|
-
confirmShipAidCart(): import("lit").TemplateResult<1>;
|
|
133
131
|
contactlessCheckoutButtonTemplate(): typeof nothing | undefined;
|
|
134
132
|
createRenderRoot(): Element | ShadowRoot;
|
|
135
133
|
checkoutButtonTemplate(): import("lit").TemplateResult<1> | undefined;
|
|
@@ -138,8 +136,6 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
138
136
|
connectedCallback(): Promise<void>;
|
|
139
137
|
disconnectedCallback(): void;
|
|
140
138
|
updateProtection(): Promise<void>;
|
|
141
|
-
protected runCartPageDetection(): void;
|
|
142
|
-
protected triggerShipAidAddToCartConfirm(): boolean;
|
|
143
139
|
protected render(): import("lit").TemplateResult<1>;
|
|
144
140
|
}
|
|
145
141
|
declare global {
|