ui.shipaid.com 0.3.9 → 0.3.11
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/README.md +1 -0
- package/dist/widget.es.js +97 -4
- package/dist/widget.iife.js +113 -29
- package/dist/widget.umd.js +111 -27
- package/dist-types/common/types/ShipAid.d.ts +1 -0
- package/dist-types/widget/src/assets/icons.d.ts +1 -0
- package/dist-types/widget/src/shipaid-widget.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ This is a list of props that can be used to configure the widget:
|
|
|
71
71
|
| `disablePolling` | Sets whether the cart should disable polling (enabled by default) - should be disabled if integrating manually with an ajax cart. | `boolean` |
|
|
72
72
|
| `pollingInterval` | If polling is enabled, it sets the interval (in ms) between API updates. | `number` in milliseconds |
|
|
73
73
|
| `disableRefresh ` | Sets whether the store cart should be updated when the protection item is added/removed. Add if you want to initially hide the protection product from the cart, even if it has just been added. | `boolean` |
|
|
74
|
+
| `customerId ` | Passes the information of the customer to the widget. Add if merchant wants to disable auto opt-in for some customers based on the customer tags. | `boolean` |
|
|
74
75
|
| `lang ` | Sets the widget language (see the translations section below). This value can be any supported [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). | `string` defaults to `en` |
|
|
75
76
|
|
|
76
77
|
### Events
|
package/dist/widget.es.js
CHANGED
|
@@ -1291,6 +1291,91 @@ const ShipAidLogoText = x`
|
|
|
1291
1291
|
</g>
|
|
1292
1292
|
</svg>
|
|
1293
1293
|
`;
|
|
1294
|
+
const ShipAidLogoPopUp = x`
|
|
1295
|
+
<svg
|
|
1296
|
+
width="300.000000pt"
|
|
1297
|
+
height="75.000000pt"
|
|
1298
|
+
viewBox="-25 -40 550 125"
|
|
1299
|
+
version="1.1"
|
|
1300
|
+
xml:space="preserve"
|
|
1301
|
+
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
|
|
1302
|
+
>
|
|
1303
|
+
<g transform="matrix(1,0,0,1,-45.4439,-231.396)">
|
|
1304
|
+
<g transform="matrix(1,0,0,1,41.8553,292.5)">
|
|
1305
|
+
<g>
|
|
1306
|
+
<path
|
|
1307
|
+
d="M25.484,0.536C36.161,0.536 47.828,-4.755 47.646,-17.047C47.646,-37.958 14.089,-31.047 14.177,-43.427C14.089,-47.646 18.036,-51.328 25.125,-51.328C31.318,-51.328 34.724,-50.068 39.302,-47.646C40.021,-47.286 40.828,-47.021 41.547,-47.021C43.88,-47.021 46.12,-48.995 46.12,-51.505C46.214,-53.391 45.047,-54.734 43.88,-55.453C39.75,-58.234 31.854,-61.104 25.125,-61.104C13.729,-61.104 3.589,-55.094 3.589,-42.979C3.589,-20.995 37.146,-27.906 37.146,-16.333C37.146,-11.932 32.214,-8.885 25.036,-9.062C19.474,-9.151 15.432,-11.036 11.667,-12.922C10.859,-13.37 9.87,-13.547 9.422,-13.547C6.911,-13.547 4.484,-11.484 4.396,-8.526C4.307,-6.729 5.385,-5.292 6.818,-4.307C10.766,-1.703 18.125,0.63 25.484,0.536Z"
|
|
1308
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1309
|
+
/>
|
|
1310
|
+
</g>
|
|
1311
|
+
</g>
|
|
1312
|
+
<g transform="matrix(1,0,0,1,111.569,292.5)">
|
|
1313
|
+
<g>
|
|
1314
|
+
<path
|
|
1315
|
+
d="M48.901,-60.656C45.943,-60.656 43.609,-58.234 43.609,-55.365L43.609,-34.547L16.87,-34.547L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-24.943L43.609,-24.943L43.609,-5.292C43.609,-2.333 45.943,0 48.901,0C51.776,0 54.198,-2.333 54.198,-5.292L54.198,-55.365C54.198,-58.234 51.776,-60.656 48.901,-60.656Z"
|
|
1316
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1317
|
+
/>
|
|
1318
|
+
</g>
|
|
1319
|
+
</g>
|
|
1320
|
+
<g transform="matrix(1,0,0,1,190.435,292.5)">
|
|
1321
|
+
<g>
|
|
1322
|
+
<path
|
|
1323
|
+
d="M11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0Z"
|
|
1324
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1325
|
+
/>
|
|
1326
|
+
</g>
|
|
1327
|
+
</g>
|
|
1328
|
+
<g transform="matrix(1,0,0,1,232.067,292.5)">
|
|
1329
|
+
<g>
|
|
1330
|
+
<path
|
|
1331
|
+
d="M25.125,-60.656L11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-23.151L25.125,-23.151C35.714,-23.151 44.328,-30.865 44.328,-41.906C44.328,-52.849 35.714,-60.656 25.125,-60.656ZM24.766,-32.844L16.87,-32.844L16.87,-50.969L24.766,-50.969C29.703,-50.969 33.74,-47.198 33.74,-41.906C33.74,-36.521 29.703,-32.844 24.766,-32.844Z"
|
|
1332
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1333
|
+
/>
|
|
1334
|
+
</g>
|
|
1335
|
+
</g>
|
|
1336
|
+
<g transform="matrix(1,0,0,1,298.418,292.5)">
|
|
1337
|
+
<g>
|
|
1338
|
+
<path
|
|
1339
|
+
d="M54.198,-4.844L32.214,-58.417C31.583,-59.849 30.151,-60.839 28.536,-60.745C26.917,-60.839 25.396,-59.849 24.854,-58.417L2.87,-4.844C2.063,-2.87 3.052,-0.63 4.938,0.089C6.729,0.896 9.063,0.177 9.87,-1.974L15.255,-15.344L41.724,-15.344L47.109,-1.974C47.917,-0.089 50.161,0.99 52.135,0.089C54.016,-0.63 54.917,-2.964 54.198,-4.844ZM18.125,-22.432L28.536,-48.276L38.854,-22.432L18.125,-22.432Z"
|
|
1340
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
1341
|
+
/>
|
|
1342
|
+
</g>
|
|
1343
|
+
</g>
|
|
1344
|
+
<g transform="matrix(1,0,0,1,373.874,292.5)">
|
|
1345
|
+
<g>
|
|
1346
|
+
<path
|
|
1347
|
+
d="M10.318,0C12.474,0 14.177,-1.703 14.177,-3.859L14.177,-56.797C14.177,-58.865 12.474,-60.656 10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0Z"
|
|
1348
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
1349
|
+
/>
|
|
1350
|
+
</g>
|
|
1351
|
+
</g>
|
|
1352
|
+
<g transform="matrix(1,0,0,1,412.904,292.5)">
|
|
1353
|
+
<g>
|
|
1354
|
+
<path
|
|
1355
|
+
d="M24.854,-60.656L10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0L24.854,0C41.724,0 55.005,-12.38 55.005,-30.328C55.005,-48.187 41.724,-60.656 24.854,-60.656ZM24.854,-7.089L14.177,-7.089L14.177,-53.568L24.854,-53.568C37.417,-53.568 47.286,-44.057 47.286,-30.328C47.286,-16.51 37.417,-7.089 24.854,-7.089Z"
|
|
1356
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
1357
|
+
/>
|
|
1358
|
+
</g>
|
|
1359
|
+
</g>
|
|
1360
|
+
<path
|
|
1361
|
+
d="M255.854,234.453C247.292,234.453 240.354,241.391 240.354,249.953C240.354,258.51 247.292,265.453 255.854,265.453C264.417,265.453 271.354,258.51 271.354,249.953C271.354,241.391 264.417,234.453 255.854,234.453ZM253.01,257.911L246.188,251.089L248.458,248.813L253.01,253.365L263.25,243.125L265.521,245.401L253.01,257.911Z"
|
|
1362
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1363
|
+
/>
|
|
1364
|
+
<path
|
|
1365
|
+
d="M270.385,238.443L256.297,233.974C256.005,233.88 255.698,233.88 255.406,233.974L241.318,238.443C240.745,238.599 240.354,239.12 240.354,239.714C240.552,244.578 241.917,259.135 241.917,259.135C241.958,259.693 242.26,260.193 242.729,260.5L255.365,268.646C255.661,268.833 256.042,268.833 256.339,268.646L268.974,260.5C269.443,260.193 269.745,259.693 269.786,259.135C269.786,259.135 271.151,244.578 271.349,239.714C271.349,239.12 270.958,238.599 270.385,238.443"
|
|
1366
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1367
|
+
/>
|
|
1368
|
+
<path
|
|
1369
|
+
d="M266.224,245.536C266.167,245.427 266.094,245.323 265.938,245.24L263.719,243.922C263.688,243.901 263.656,243.885 263.62,243.88C263.609,243.875 263.599,243.875 263.589,243.875C263.563,243.87 263.542,243.865 263.516,243.865C263.448,243.87 263.385,243.885 263.328,243.922L258.339,246.896L258.333,246.885L257.932,247.125C257.448,247.417 256.849,247.417 256.365,247.125L254.182,245.823C254.063,245.755 253.984,245.62 253.984,245.474C253.984,245.328 254.063,245.198 254.182,245.125L256.365,243.823C256.849,243.536 257.448,243.536 257.932,243.823L258.458,244.135C258.578,244.208 258.724,244.208 258.849,244.135L260.88,242.927C261,242.854 261.073,242.724 261.073,242.578C261.073,242.432 261,242.297 260.88,242.224L257.932,240.469C257.448,240.182 256.849,240.182 256.365,240.469L249.141,244.776C248.62,245.083 248.62,245.865 249.141,246.177L256.365,250.479C256.849,250.771 257.448,250.771 257.932,250.479L263.516,247.151L263.516,254.734L261.719,255.807L257.932,258.073C257.813,258.141 257.682,258.198 257.547,258.234C257.151,258.344 256.724,258.286 256.365,258.073L251.172,254.979C250.927,254.833 250.781,254.563 250.781,254.276L250.781,249.854C250.781,249.714 250.703,249.578 250.583,249.505L248.552,248.297C248.432,248.224 248.281,248.224 248.161,248.297C248.042,248.37 247.964,248.5 247.964,248.646L247.964,255.953C247.964,256.245 248.115,256.51 248.359,256.656L256.365,261.427C256.599,261.568 256.865,261.641 257.135,261.641L257.141,261.641C257.177,261.641 257.219,261.641 257.255,261.635C257.286,261.635 257.318,261.635 257.344,261.63C257.385,261.625 257.427,261.615 257.464,261.604C257.495,261.599 257.521,261.599 257.547,261.589C257.589,261.578 257.63,261.563 257.672,261.547C257.698,261.536 257.719,261.531 257.74,261.521C257.807,261.495 257.87,261.464 257.932,261.427L264.839,257.307L265.932,256.667C266.177,256.526 266.328,256.255 266.328,255.964L266.328,245.943C266.328,245.797 266.292,245.656 266.224,245.536"
|
|
1370
|
+
style="fill:white;fill-rule:nonzero;"
|
|
1371
|
+
/>
|
|
1372
|
+
<path
|
|
1373
|
+
d="M257.911,238.047C257.677,237.911 257.417,237.833 257.146,237.833C256.88,237.833 256.615,237.911 256.38,238.047L246.734,243.797C246.25,244.089 245.953,244.62 245.953,245.198L245.953,256.698C245.953,257.276 246.25,257.807 246.734,258.094L256.38,263.844C256.62,263.99 256.885,264.063 257.156,264.063C257.432,264.063 257.698,263.99 257.932,263.849L267.536,258.12C268.021,257.833 268.323,257.302 268.323,256.724L268.323,253.401C268.318,253.255 268.396,253.125 268.516,253.052L270.563,251.833C270.682,251.76 270.828,251.76 270.953,251.833C271.073,251.906 271.146,252.036 271.146,252.182L271.146,258.37C271.146,258.635 271.083,258.896 270.964,259.13C270.932,259.281 270.771,259.458 270.542,259.646C270.536,259.651 270.531,259.651 270.526,259.656C269.948,260.12 268.995,260.599 268.823,260.703L257.932,267.193C257.693,267.339 257.411,267.411 257.13,267.411L257.12,267.411L257.12,267.406C256.859,267.401 256.604,267.328 256.38,267.193L243.927,259.771C243.443,259.479 243.146,258.948 243.146,258.37L243.146,243.526C243.146,243.266 243.177,243 243.286,242.776C243.302,242.719 243.453,242.432 243.766,242.198C243.885,242.12 244.089,242.01 244.286,241.891L256.349,234.703C256.589,234.557 256.865,234.484 257.146,234.49C257.427,234.484 257.703,234.557 257.948,234.703L269.078,241.339C269.104,241.354 269.12,241.37 269.146,241.391L269.286,241.474C269.661,241.682 270.255,241.995 270.578,242.25L270.604,242.271C270.609,242.271 270.615,242.276 270.62,242.276C270.63,242.286 270.635,242.297 270.646,242.307C270.766,242.411 270.865,242.531 270.943,242.661C270.948,242.667 270.948,242.667 270.948,242.672C271.078,242.896 271.146,243.151 271.146,243.411L271.146,248.849C271.146,248.995 271.073,249.125 270.953,249.198L268.906,250.417C268.786,250.49 268.635,250.49 268.516,250.417C268.396,250.344 268.318,250.214 268.318,250.068L268.318,245.167C268.318,244.589 268.021,244.052 267.536,243.766L257.911,238.047Z"
|
|
1374
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
1375
|
+
/>
|
|
1376
|
+
</g>
|
|
1377
|
+
</svg>
|
|
1378
|
+
`;
|
|
1294
1379
|
const CheckmarkRibbon = x`
|
|
1295
1380
|
<svg
|
|
1296
1381
|
version="1.0"
|
|
@@ -1421,7 +1506,7 @@ let LearnMorePopup = class extends s$1 {
|
|
|
1421
1506
|
>
|
|
1422
1507
|
${translate("learn-more-popup.close")}
|
|
1423
1508
|
</button>
|
|
1424
|
-
<div class="popup-logo">${
|
|
1509
|
+
<div class="popup-logo">${ShipAidLogoPopUp}</div>
|
|
1425
1510
|
<p class="popup-title">${translate("learn-more-popup.title")}</p>
|
|
1426
1511
|
<div class="popup-disclaimer-subtitle">
|
|
1427
1512
|
<div class="popup-icon">${CheckmarkRibbon}</div>
|
|
@@ -1725,6 +1810,7 @@ const StoreQuery = `query StoreByDomain ($store: String!) {
|
|
|
1725
1810
|
widgetPollProtection
|
|
1726
1811
|
widgetShowCart
|
|
1727
1812
|
excludedProductSkus
|
|
1813
|
+
excludedCustomersIdsAutoOptIn
|
|
1728
1814
|
protectionSettings
|
|
1729
1815
|
}
|
|
1730
1816
|
}`;
|
|
@@ -1752,6 +1838,7 @@ let ShipAidWidget = class extends s$1 {
|
|
|
1752
1838
|
this.disableRefresh = false;
|
|
1753
1839
|
this.lang = "en";
|
|
1754
1840
|
this.currency = void 0;
|
|
1841
|
+
this.customerId = void 0;
|
|
1755
1842
|
this._apiEndpoint = "/apps/shipaid";
|
|
1756
1843
|
this._storeDomain = ((_a = window.Shopify) == null ? void 0 : _a.shop) ?? ((_c = (_b = window.Shopify) == null ? void 0 : _b.Checkout) == null ? void 0 : _c.apiHost);
|
|
1757
1844
|
this._hasFinishedSetup = false;
|
|
@@ -2157,11 +2244,14 @@ let ShipAidWidget = class extends s$1 {
|
|
|
2157
2244
|
this._shouldShowWidget = true;
|
|
2158
2245
|
this._dispatchEvent(Events.LOADED, this._store);
|
|
2159
2246
|
setTimeout(async () => {
|
|
2160
|
-
var _a2, _b2, _c2;
|
|
2247
|
+
var _a2, _b2, _c2, _d;
|
|
2161
2248
|
if (!((_a2 = this._store) == null ? void 0 : _a2.widgetAutoOptIn))
|
|
2162
2249
|
return;
|
|
2163
2250
|
if (!((_b2 = this._cart) == null ? void 0 : _b2.item_count))
|
|
2164
2251
|
return;
|
|
2252
|
+
if (this.customerId && this._store.excludedCustomersIdsAutoOptIn && ((_c2 = this._store.excludedCustomersIdsAutoOptIn) == null ? void 0 : _c2.length) && this._store.excludedCustomersIdsAutoOptIn.includes(`gid://shopify/Customer/${this.customerId}`)) {
|
|
2253
|
+
return;
|
|
2254
|
+
}
|
|
2165
2255
|
const hasSessionPayload = !!sessionStorage.getItem(LOCAL_STORAGE_KEY);
|
|
2166
2256
|
if (hasSessionPayload)
|
|
2167
2257
|
return;
|
|
@@ -2172,7 +2262,7 @@ let ShipAidWidget = class extends s$1 {
|
|
|
2172
2262
|
if (
|
|
2173
2263
|
// If we first check that no protection items are in the cart
|
|
2174
2264
|
!this._hasProtectionInCart && // Then check we have some items in the cart
|
|
2175
|
-
((
|
|
2265
|
+
((_d = this._cart) == null ? void 0 : _d.item_count) && // And that we are actually showing the widget
|
|
2176
2266
|
this._store.widgetShowCart
|
|
2177
2267
|
) {
|
|
2178
2268
|
await this.addProtection();
|
|
@@ -2193,7 +2283,7 @@ let ShipAidWidget = class extends s$1 {
|
|
|
2193
2283
|
if (((_c = this._store) == null ? void 0 : _c.widgetPollProtection) && !this.intervalId) {
|
|
2194
2284
|
this.intervalId = setInterval(async () => {
|
|
2195
2285
|
await this.attemptAddProtection();
|
|
2196
|
-
},
|
|
2286
|
+
}, 400);
|
|
2197
2287
|
localStorage.setItem(`${LOCAL_STORAGE_POLL_KEY}_${this.intervalId}`, `${this.intervalId}`);
|
|
2198
2288
|
}
|
|
2199
2289
|
});
|
|
@@ -2306,6 +2396,9 @@ __decorateClass([
|
|
|
2306
2396
|
__decorateClass([
|
|
2307
2397
|
n$7({ type: String, attribute: true })
|
|
2308
2398
|
], ShipAidWidget.prototype, "currency", 2);
|
|
2399
|
+
__decorateClass([
|
|
2400
|
+
n$7({ type: String, attribute: true })
|
|
2401
|
+
], ShipAidWidget.prototype, "customerId", 2);
|
|
2309
2402
|
__decorateClass([
|
|
2310
2403
|
t$3()
|
|
2311
2404
|
], ShipAidWidget.prototype, "_storeDomain", 2);
|
package/dist/widget.iife.js
CHANGED
|
@@ -29,45 +29,45 @@ const d=window,l=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"
|
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
-
*/;var
|
|
32
|
+
*/;var g;const m=window,v=m.trustedTypes,_=v?v.emptyScript:"",C=m.reactiveElementPolyfillSupport,y={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},b=(t,e)=>e!==t&&(e==e||t==t),w={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:b},$="finalized";let A=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||w}static finalize(){if(this.hasOwnProperty($))return!1;this[$]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(f(t))}else void 0!==t&&e.push(f(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{l?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=d.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=w){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:y).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:y;this._$El=r,this[r]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||b)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(o){throw e=!1,this._$Ek(),o}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
37
|
*/
|
|
38
|
-
var
|
|
38
|
+
var L;A[$]=!0,A.elementProperties=new Map,A.elementStyles=[],A.shadowRootOptions={mode:"open"},null==C||C({ReactiveElement:A}),(null!==(g=m.reactiveElementVersions)&&void 0!==g?g:m.reactiveElementVersions=[]).push("1.6.3");const S=window,x=S.trustedTypes,E=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,M="?"+z,k=`<${M}>`,T=document,O=()=>T.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,q=Array.isArray,N="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,R=/>/g,W=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,D=/"/g,V=/^(?:script|style|textarea|title)$/i,B=(J=1,(t,...e)=>({_$litType$:J,strings:t,values:e})),Z=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),G=new WeakMap,Y=T.createTreeWalker(T,129,null,!1);var J;function K(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}class Q{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[d,l]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=U;for(let a=0;a<i;a++){const e=t[a];let i,d,l=-1,p=0;for(;p<e.length&&(n.lastIndex=p,d=n.exec(e),null!==d);)p=n.lastIndex,n===U?"!--"===d[1]?n=j:void 0!==d[1]?n=R:void 0!==d[2]?(V.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=W):void 0!==d[3]&&(n=W):n===W?">"===d[0]?(n=null!=r?r:U,l=-1):void 0===d[1]?l=-2:(l=n.lastIndex-d[2].length,i=d[1],n=void 0===d[3]?W:'"'===d[3]?D:H):n===D||n===H?n=W:n===j||n===R?n=U:(n=W,r=void 0);const c=n===W&&t[a+1].startsWith("/>")?" ":"";s+=n===U?e+k:l>=0?(o.push(i),e.slice(0,l)+P+e.slice(l)+z+c):e+z+(-2===l?(o.push(void 0),a):c)}return[K(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=Q.createElement(d,i),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(P)||e.startsWith(z)){const i=l[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+P).split(z),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?st:"@"===e[1]?nt:it})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(V.test(o.tagName)){const t=o.textContent.split(z),e=t.length-1;if(e>0){o.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],O()),Y.nextNode(),a.push({type:2,index:++r});o.append(t[e],O())}}}else if(8===o.nodeType)if(o.data===M)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=T.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var r,s,n,a;if(e===Z)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const l=I(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==l&&(null===(s=null==d?void 0:d._$AO)||void 0===s||s.call(d,!1),void 0===l?d=void 0:(d=new l(t),d._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n: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:T).importNode(i,!0);Y.currentNode=r;let s=Y.nextNode(),n=0,a=0,d=o[0];for(;void 0!==d;){if(n===d.index){let e;2===d.type?e=new et(s,s.nextSibling,this,t):1===d.type?e=new d.ctor(s,d.name,d.strings,this,t):6===d.type&&(e=new at(s,this,t)),this._$AV.push(e),d=o[++a]}n!==(null==d?void 0:d.index)&&(s=Y.nextNode(),n++)}return Y.currentNode=T,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=F,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),I(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>q(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!==F&&I(this._$AH)?this._$AA.nextSibling.data=t:this.$(T.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=Q.createElement(K(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 Q(t)),e}T(t){q(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(O()),this.k(O()),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=F,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=F}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=X(this,t,e,0),s=!I(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=X(this,o[i+n],e,n),a===Z&&(a=this._$AH[n]),s||(s=!I(a)||a!==this._$AH[n]),a===F?t=F:t!==F&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===F?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===F?void 0:t}}const rt=x?x.emptyScript:"";class st extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==F?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class nt 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:F)===Z)return;const o=this._$AH,r=t===F&&o!==F||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==F&&(o===F||r);r&&this.element.removeEventListener(this.name,this,o),s&&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(Q,et),(null!==(L=S.litHtmlVersions)&&void 0!==L?L:S.litHtmlVersions=[]).push("2.8.0");const lt=(t,e,i)=>{var o,r;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=s._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=n=new et(e.insertBefore(O(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n};
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/var pt,ct;let ht=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return
|
|
43
|
+
*/var pt,ct;let ht=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return Z}};ht.finalized=!0,ht._$litElement$=!0,null===(pt=globalThis.litElementHydrateSupport)||void 0===pt||pt.call(globalThis,{LitElement:ht});const ut=globalThis.litElementPolyfillSupport;null==ut||ut({LitElement:ht}),(null!==(ct=globalThis.litElementVersions)&&void 0!==ct?ct:globalThis.litElementVersions=[]).push("3.3.3");const ft="langChanged";function gt(t,e,i){return Object.entries(vt(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[ ]*${e}[ ]*}}`,"gm"),String(vt(i)))),t)}function mt(t,e){const i=t.split(".");let o=e.strings;for(;null!=o&&i.length>0;)o=o[i.shift()];return null!=o?o.toString():null}function vt(t){return"function"==typeof t?t():t}let _t={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:mt,interpolate:gt,translationCache:{}};function Ct(t,e,i=_t){var o;o={previousStrings:i.strings,previousLang:i.lang,lang:i.lang=t,strings:i.strings=e},window.dispatchEvent(new CustomEvent(ft,{detail:o}))}
|
|
44
44
|
/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2017 Google LLC
|
|
47
47
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
49
|
+
const yt=2;class bt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2020 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const
|
|
54
|
+
*/const wt=(t,e)=>{var i,o;const r=t._$AN;if(void 0===r)return!1;for(const s of r)null===(o=(i=s)._$AO)||void 0===o||o.call(i,e,!1),wt(s,e);return!0},$t=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===(null==i?void 0:i.size))},At=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),xt(e)}};
|
|
55
55
|
/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/function
|
|
59
|
+
*/function Lt(t){void 0!==this._$AN?($t(this),this._$AM=t,At(this)):this._$AM=t}function St(t,e=!1,i=0){const o=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(o))for(let s=i;s<o.length;s++)wt(o[s],!1),$t(o[s]);else null!=o&&(wt(o,!1),$t(o));else wt(this,t)}const xt=t=>{var e,i,o,r;t.type==yt&&(null!==(e=(o=t)._$AP)&&void 0!==e||(o._$AP=St),null!==(i=(r=t)._$AQ)&&void 0!==i||(r._$AQ=Lt))};class Et extends bt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),At(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,o;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(o=this.disconnected)||void 0===o||o.call(this)),e&&(wt(this,t),$t(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class Pt extends Et{constructor(){super(...arguments),this.langChangedSubscription=null,this.getValue=()=>""}renderValue(t){return this.getValue=t,this.subscribe(),this.getValue()}langChanged(t){this.setValue(this.getValue(t))}subscribe(){null==this.langChangedSubscription&&(this.langChangedSubscription=function(t,e){const i=e=>t(e.detail);return window.addEventListener(ft,i,e),()=>window.removeEventListener(ft,i)}(this.langChanged.bind(this)))}unsubscribe(){null!=this.langChangedSubscription&&this.langChangedSubscription()}disconnected(){this.unsubscribe()}reconnected(){this.subscribe()}}const zt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends Pt{render(t,e,i){return this.renderValue((()=>function(t,e,i=_t){let o=i.translationCache[t]||(i.translationCache[t]=i.lookup(t,i)||i.empty(t,i));return null!=(e=null!=e?vt(e):null)?i.interpolate(o,e,i):o}(t,e,i)))}});
|
|
60
60
|
/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2017 Google LLC
|
|
63
63
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
64
|
-
*/class Mt extends
|
|
64
|
+
*/class Mt extends bt{constructor(t){if(super(t),this.et=F,t.type!==yt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===F||null==t)return this.ft=void 0,this.et=t;if(t===Z)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:[]}}}Mt.directiveName="unsafeHTML",Mt.resultType=1;const kt="__registered_effects";function Tt(t){const e=t;if(e[kt])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[kt]={index:0,count:0,effects:[]},i.updated=t=>(e[kt].index=0,o(t)),e}function Ot(t,e,i){const o=function(t,e){const i=Tt(t),{index:o,count:r}=i[kt];return o===r?(i[kt].index++,i[kt].count++,i[kt].effects.push(e),e):(i[kt].index++,i[kt].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
|
|
65
65
|
/**
|
|
66
66
|
* @license
|
|
67
67
|
* Copyright 2021 Google LLC
|
|
68
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
69
69
|
*/
|
|
70
|
-
function
|
|
70
|
+
function It(t,e,i){return t?e():null==i?void 0:i()}const qt=u`
|
|
71
71
|
:host {
|
|
72
72
|
--shipaid-primary: #0056d6;
|
|
73
73
|
--shipaid-secondary: #0076ff;
|
|
@@ -267,7 +267,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
267
267
|
background: transparent;
|
|
268
268
|
z-index: -1;
|
|
269
269
|
}
|
|
270
|
-
`,
|
|
270
|
+
`,Nt=B`
|
|
271
271
|
<svg
|
|
272
272
|
version="1.0"
|
|
273
273
|
width="50.000000pt"
|
|
@@ -288,7 +288,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
288
288
|
/>
|
|
289
289
|
</g>
|
|
290
290
|
</svg>
|
|
291
|
-
`,
|
|
291
|
+
`,Ut=B`
|
|
292
292
|
<svg
|
|
293
293
|
version="1.0"
|
|
294
294
|
width="50.000000pt"
|
|
@@ -309,7 +309,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
309
309
|
/>
|
|
310
310
|
</g>
|
|
311
311
|
</svg>
|
|
312
|
-
`,
|
|
312
|
+
`,jt=B`
|
|
313
313
|
<svg
|
|
314
314
|
width="50.000000pt"
|
|
315
315
|
height="50.000000pt"
|
|
@@ -393,7 +393,91 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
393
393
|
/>
|
|
394
394
|
</g>
|
|
395
395
|
</svg>
|
|
396
|
-
`,
|
|
396
|
+
`,Rt=B`
|
|
397
|
+
<svg
|
|
398
|
+
width="300.000000pt"
|
|
399
|
+
height="75.000000pt"
|
|
400
|
+
viewBox="-25 -40 550 125"
|
|
401
|
+
version="1.1"
|
|
402
|
+
xml:space="preserve"
|
|
403
|
+
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
|
|
404
|
+
>
|
|
405
|
+
<g transform="matrix(1,0,0,1,-45.4439,-231.396)">
|
|
406
|
+
<g transform="matrix(1,0,0,1,41.8553,292.5)">
|
|
407
|
+
<g>
|
|
408
|
+
<path
|
|
409
|
+
d="M25.484,0.536C36.161,0.536 47.828,-4.755 47.646,-17.047C47.646,-37.958 14.089,-31.047 14.177,-43.427C14.089,-47.646 18.036,-51.328 25.125,-51.328C31.318,-51.328 34.724,-50.068 39.302,-47.646C40.021,-47.286 40.828,-47.021 41.547,-47.021C43.88,-47.021 46.12,-48.995 46.12,-51.505C46.214,-53.391 45.047,-54.734 43.88,-55.453C39.75,-58.234 31.854,-61.104 25.125,-61.104C13.729,-61.104 3.589,-55.094 3.589,-42.979C3.589,-20.995 37.146,-27.906 37.146,-16.333C37.146,-11.932 32.214,-8.885 25.036,-9.062C19.474,-9.151 15.432,-11.036 11.667,-12.922C10.859,-13.37 9.87,-13.547 9.422,-13.547C6.911,-13.547 4.484,-11.484 4.396,-8.526C4.307,-6.729 5.385,-5.292 6.818,-4.307C10.766,-1.703 18.125,0.63 25.484,0.536Z"
|
|
410
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
411
|
+
/>
|
|
412
|
+
</g>
|
|
413
|
+
</g>
|
|
414
|
+
<g transform="matrix(1,0,0,1,111.569,292.5)">
|
|
415
|
+
<g>
|
|
416
|
+
<path
|
|
417
|
+
d="M48.901,-60.656C45.943,-60.656 43.609,-58.234 43.609,-55.365L43.609,-34.547L16.87,-34.547L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-24.943L43.609,-24.943L43.609,-5.292C43.609,-2.333 45.943,0 48.901,0C51.776,0 54.198,-2.333 54.198,-5.292L54.198,-55.365C54.198,-58.234 51.776,-60.656 48.901,-60.656Z"
|
|
418
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
419
|
+
/>
|
|
420
|
+
</g>
|
|
421
|
+
</g>
|
|
422
|
+
<g transform="matrix(1,0,0,1,190.435,292.5)">
|
|
423
|
+
<g>
|
|
424
|
+
<path
|
|
425
|
+
d="M11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0Z"
|
|
426
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
427
|
+
/>
|
|
428
|
+
</g>
|
|
429
|
+
</g>
|
|
430
|
+
<g transform="matrix(1,0,0,1,232.067,292.5)">
|
|
431
|
+
<g>
|
|
432
|
+
<path
|
|
433
|
+
d="M25.125,-60.656L11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-23.151L25.125,-23.151C35.714,-23.151 44.328,-30.865 44.328,-41.906C44.328,-52.849 35.714,-60.656 25.125,-60.656ZM24.766,-32.844L16.87,-32.844L16.87,-50.969L24.766,-50.969C29.703,-50.969 33.74,-47.198 33.74,-41.906C33.74,-36.521 29.703,-32.844 24.766,-32.844Z"
|
|
434
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
435
|
+
/>
|
|
436
|
+
</g>
|
|
437
|
+
</g>
|
|
438
|
+
<g transform="matrix(1,0,0,1,298.418,292.5)">
|
|
439
|
+
<g>
|
|
440
|
+
<path
|
|
441
|
+
d="M54.198,-4.844L32.214,-58.417C31.583,-59.849 30.151,-60.839 28.536,-60.745C26.917,-60.839 25.396,-59.849 24.854,-58.417L2.87,-4.844C2.063,-2.87 3.052,-0.63 4.938,0.089C6.729,0.896 9.063,0.177 9.87,-1.974L15.255,-15.344L41.724,-15.344L47.109,-1.974C47.917,-0.089 50.161,0.99 52.135,0.089C54.016,-0.63 54.917,-2.964 54.198,-4.844ZM18.125,-22.432L28.536,-48.276L38.854,-22.432L18.125,-22.432Z"
|
|
442
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
443
|
+
/>
|
|
444
|
+
</g>
|
|
445
|
+
</g>
|
|
446
|
+
<g transform="matrix(1,0,0,1,373.874,292.5)">
|
|
447
|
+
<g>
|
|
448
|
+
<path
|
|
449
|
+
d="M10.318,0C12.474,0 14.177,-1.703 14.177,-3.859L14.177,-56.797C14.177,-58.865 12.474,-60.656 10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0Z"
|
|
450
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
451
|
+
/>
|
|
452
|
+
</g>
|
|
453
|
+
</g>
|
|
454
|
+
<g transform="matrix(1,0,0,1,412.904,292.5)">
|
|
455
|
+
<g>
|
|
456
|
+
<path
|
|
457
|
+
d="M24.854,-60.656L10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0L24.854,0C41.724,0 55.005,-12.38 55.005,-30.328C55.005,-48.187 41.724,-60.656 24.854,-60.656ZM24.854,-7.089L14.177,-7.089L14.177,-53.568L24.854,-53.568C37.417,-53.568 47.286,-44.057 47.286,-30.328C47.286,-16.51 37.417,-7.089 24.854,-7.089Z"
|
|
458
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
459
|
+
/>
|
|
460
|
+
</g>
|
|
461
|
+
</g>
|
|
462
|
+
<path
|
|
463
|
+
d="M255.854,234.453C247.292,234.453 240.354,241.391 240.354,249.953C240.354,258.51 247.292,265.453 255.854,265.453C264.417,265.453 271.354,258.51 271.354,249.953C271.354,241.391 264.417,234.453 255.854,234.453ZM253.01,257.911L246.188,251.089L248.458,248.813L253.01,253.365L263.25,243.125L265.521,245.401L253.01,257.911Z"
|
|
464
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
465
|
+
/>
|
|
466
|
+
<path
|
|
467
|
+
d="M270.385,238.443L256.297,233.974C256.005,233.88 255.698,233.88 255.406,233.974L241.318,238.443C240.745,238.599 240.354,239.12 240.354,239.714C240.552,244.578 241.917,259.135 241.917,259.135C241.958,259.693 242.26,260.193 242.729,260.5L255.365,268.646C255.661,268.833 256.042,268.833 256.339,268.646L268.974,260.5C269.443,260.193 269.745,259.693 269.786,259.135C269.786,259.135 271.151,244.578 271.349,239.714C271.349,239.12 270.958,238.599 270.385,238.443"
|
|
468
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
469
|
+
/>
|
|
470
|
+
<path
|
|
471
|
+
d="M266.224,245.536C266.167,245.427 266.094,245.323 265.938,245.24L263.719,243.922C263.688,243.901 263.656,243.885 263.62,243.88C263.609,243.875 263.599,243.875 263.589,243.875C263.563,243.87 263.542,243.865 263.516,243.865C263.448,243.87 263.385,243.885 263.328,243.922L258.339,246.896L258.333,246.885L257.932,247.125C257.448,247.417 256.849,247.417 256.365,247.125L254.182,245.823C254.063,245.755 253.984,245.62 253.984,245.474C253.984,245.328 254.063,245.198 254.182,245.125L256.365,243.823C256.849,243.536 257.448,243.536 257.932,243.823L258.458,244.135C258.578,244.208 258.724,244.208 258.849,244.135L260.88,242.927C261,242.854 261.073,242.724 261.073,242.578C261.073,242.432 261,242.297 260.88,242.224L257.932,240.469C257.448,240.182 256.849,240.182 256.365,240.469L249.141,244.776C248.62,245.083 248.62,245.865 249.141,246.177L256.365,250.479C256.849,250.771 257.448,250.771 257.932,250.479L263.516,247.151L263.516,254.734L261.719,255.807L257.932,258.073C257.813,258.141 257.682,258.198 257.547,258.234C257.151,258.344 256.724,258.286 256.365,258.073L251.172,254.979C250.927,254.833 250.781,254.563 250.781,254.276L250.781,249.854C250.781,249.714 250.703,249.578 250.583,249.505L248.552,248.297C248.432,248.224 248.281,248.224 248.161,248.297C248.042,248.37 247.964,248.5 247.964,248.646L247.964,255.953C247.964,256.245 248.115,256.51 248.359,256.656L256.365,261.427C256.599,261.568 256.865,261.641 257.135,261.641L257.141,261.641C257.177,261.641 257.219,261.641 257.255,261.635C257.286,261.635 257.318,261.635 257.344,261.63C257.385,261.625 257.427,261.615 257.464,261.604C257.495,261.599 257.521,261.599 257.547,261.589C257.589,261.578 257.63,261.563 257.672,261.547C257.698,261.536 257.719,261.531 257.74,261.521C257.807,261.495 257.87,261.464 257.932,261.427L264.839,257.307L265.932,256.667C266.177,256.526 266.328,256.255 266.328,255.964L266.328,245.943C266.328,245.797 266.292,245.656 266.224,245.536"
|
|
472
|
+
style="fill:white;fill-rule:nonzero;"
|
|
473
|
+
/>
|
|
474
|
+
<path
|
|
475
|
+
d="M257.911,238.047C257.677,237.911 257.417,237.833 257.146,237.833C256.88,237.833 256.615,237.911 256.38,238.047L246.734,243.797C246.25,244.089 245.953,244.62 245.953,245.198L245.953,256.698C245.953,257.276 246.25,257.807 246.734,258.094L256.38,263.844C256.62,263.99 256.885,264.063 257.156,264.063C257.432,264.063 257.698,263.99 257.932,263.849L267.536,258.12C268.021,257.833 268.323,257.302 268.323,256.724L268.323,253.401C268.318,253.255 268.396,253.125 268.516,253.052L270.563,251.833C270.682,251.76 270.828,251.76 270.953,251.833C271.073,251.906 271.146,252.036 271.146,252.182L271.146,258.37C271.146,258.635 271.083,258.896 270.964,259.13C270.932,259.281 270.771,259.458 270.542,259.646C270.536,259.651 270.531,259.651 270.526,259.656C269.948,260.12 268.995,260.599 268.823,260.703L257.932,267.193C257.693,267.339 257.411,267.411 257.13,267.411L257.12,267.411L257.12,267.406C256.859,267.401 256.604,267.328 256.38,267.193L243.927,259.771C243.443,259.479 243.146,258.948 243.146,258.37L243.146,243.526C243.146,243.266 243.177,243 243.286,242.776C243.302,242.719 243.453,242.432 243.766,242.198C243.885,242.12 244.089,242.01 244.286,241.891L256.349,234.703C256.589,234.557 256.865,234.484 257.146,234.49C257.427,234.484 257.703,234.557 257.948,234.703L269.078,241.339C269.104,241.354 269.12,241.37 269.146,241.391L269.286,241.474C269.661,241.682 270.255,241.995 270.578,242.25L270.604,242.271C270.609,242.271 270.615,242.276 270.62,242.276C270.63,242.286 270.635,242.297 270.646,242.307C270.766,242.411 270.865,242.531 270.943,242.661C270.948,242.667 270.948,242.667 270.948,242.672C271.078,242.896 271.146,243.151 271.146,243.411L271.146,248.849C271.146,248.995 271.073,249.125 270.953,249.198L268.906,250.417C268.786,250.49 268.635,250.49 268.516,250.417C268.396,250.344 268.318,250.214 268.318,250.068L268.318,245.167C268.318,244.589 268.021,244.052 267.536,243.766L257.911,238.047Z"
|
|
476
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
477
|
+
/>
|
|
478
|
+
</g>
|
|
479
|
+
</svg>
|
|
480
|
+
`,Wt=B`
|
|
397
481
|
<svg
|
|
398
482
|
version="1.0"
|
|
399
483
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -418,7 +502,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
418
502
|
/>
|
|
419
503
|
</g>
|
|
420
504
|
</svg>
|
|
421
|
-
`,
|
|
505
|
+
`,Ht=B`
|
|
422
506
|
<svg
|
|
423
507
|
version="1.0"
|
|
424
508
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -437,7 +521,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
437
521
|
/>
|
|
438
522
|
</g>
|
|
439
523
|
</svg>
|
|
440
|
-
`,
|
|
524
|
+
`,Dt=B`
|
|
441
525
|
<svg
|
|
442
526
|
version="1.0"
|
|
443
527
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -462,7 +546,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
462
546
|
/>
|
|
463
547
|
</g>
|
|
464
548
|
</svg>
|
|
465
|
-
`,
|
|
549
|
+
`,Vt=B`
|
|
466
550
|
<svg
|
|
467
551
|
xmlns="http://www.w3.org/2000/svg"
|
|
468
552
|
version="1.0"
|
|
@@ -488,7 +572,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
488
572
|
/>
|
|
489
573
|
</g>
|
|
490
574
|
</svg>
|
|
491
|
-
`;var
|
|
575
|
+
`;var Bt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Ft=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?Zt(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&Bt(e,i,s),s};let Gt=class extends ht{constructor(){super(...arguments),this.active=!1}handleClosePopup(){const t=new Event("close");this.dispatchEvent(t)}render(){return B`
|
|
492
576
|
<div class=${`shipaid-popup ${this.active&&"active"}`}>
|
|
493
577
|
<div class="blocker" @click=${this.handleClosePopup}></div>
|
|
494
578
|
<button
|
|
@@ -501,19 +585,19 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
501
585
|
<div class="popup-logo">${Rt}</div>
|
|
502
586
|
<p class="popup-title">${zt("learn-more-popup.title")}</p>
|
|
503
587
|
<div class="popup-disclaimer-subtitle">
|
|
504
|
-
<div class="popup-icon">${
|
|
588
|
+
<div class="popup-icon">${Wt}</div>
|
|
505
589
|
<p>${zt("learn-more-popup.disclaimer.subtitle-enable")}</p>
|
|
506
590
|
</div>
|
|
507
591
|
<div class="popup-disclaimer-subtitle">
|
|
508
|
-
<div class="popup-icon">${
|
|
592
|
+
<div class="popup-icon">${Ht}</div>
|
|
509
593
|
<p>${zt("learn-more-popup.disclaimer.subtitle-monitor")}</p>
|
|
510
594
|
</div>
|
|
511
595
|
<div class="popup-disclaimer-subtitle">
|
|
512
|
-
<div class="popup-icon-b">${
|
|
596
|
+
<div class="popup-icon-b">${Vt}</div>
|
|
513
597
|
<p>${zt("learn-more-popup.disclaimer.subtitle-notify")}</p>
|
|
514
598
|
</div>
|
|
515
599
|
<div class="popup-disclaimer-subtitle">
|
|
516
|
-
<div class="popup-icon-bell">${
|
|
600
|
+
<div class="popup-icon-bell">${Dt}</div>
|
|
517
601
|
<p>
|
|
518
602
|
${zt("learn-more-popup.disclaimer.subtitle-resolution")}
|
|
519
603
|
</p>
|
|
@@ -548,7 +632,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
548
632
|
</div>
|
|
549
633
|
</div>
|
|
550
634
|
</div>
|
|
551
|
-
`}};
|
|
635
|
+
`}};Gt.styles=qt,Ft([s({type:Boolean,attribute:!0})],Gt.prototype,"active",2),Gt=Ft([i("shipaid-popup-learn-more")],Gt);const Yt="Loading ShipAid Widget...",Jt="Delivery Guarantee",Kt="in case of Loss, Damage or Theft",Qt={button:"Powered by"},Xt={add:"Add",remove:"Remove",loading:"Loading..."},te={loading:Yt,title:Jt,description:Kt,footer:Qt,actions:Xt,"learn-more-popup":{close:"Close",title:"Delivery Guarantee",disclaimer:{"subtitle-enable":"We enable your favorite brands to provide a delivery guarantee because we know that every order is precious, and things happen!","subtitle-monitor":"We continuously monitor your package and offer a convenient portal for you to track your order's progress at any moment!","subtitle-notify":"You'll be notified throughout the entire shipping process, ensuring you stay up to date every step of the way.","subtitle-resolution":"In case of any issues during transit, we offer a quick and easy method to report the problem directly to the brand, for a swift resolution.",text:"By purchasing this delivery guarantee, you agree to our Terms Of Service and Privacy Policy. You are not obligated to purchase this guarantee. This guarantee is NOT insurance and does not provide indemnification against loss, damage, or liability arising from a contingent or unknown event, but rather, through ShipAid brands provide a delivery guarantee whereby if the product you ordered is not delivered in satisfactory condition, the brand from which you ordered the product may replace the product free of charge. ShipAid does not provide any products or services directly to consumers, but instead provides a service that allow brands to facilitate product replacement to their customers. Purchasing this guarantee does not mean that you will automatically be reimbursed for any product or shipping costs because the resolution process and decision for compensation is strictly decided by the brand you a purchasing from. The brand will require proof of damage or undelivered product."},links:{terms:"Terms of Service",privacy:"Privacy Policy"}}},ee=Object.freeze(Object.defineProperty({__proto__:null,actions:Xt,default:te,description:Kt,footer:Qt,loading:Yt,title:Jt},Symbol.toStringTag,{value:"Module"})),ie=u`
|
|
552
636
|
:host {
|
|
553
637
|
--shipaid-primary: #002bd6;
|
|
554
638
|
--shipaid-secondary: #0076ff;
|
|
@@ -703,7 +787,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
703
787
|
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
704
788
|
height: 9px;
|
|
705
789
|
}
|
|
706
|
-
`;var
|
|
790
|
+
`;var oe=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(oe||{}),re=Object.defineProperty,se=Object.getOwnPropertyDescriptor,ne=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?se(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&re(e,i,s),s};const ae=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.")}},de=t=>console.warn(`[ShipAid] ${t}`),le=t=>console.error(`[ShipAid] ${t}`),pe="shipaid-protection",ce=Object.assign({"./lang/en.json":()=>Promise.resolve().then((()=>ee)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Ce)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>Se)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>Te)).then((t=>t.default))});var he;he={loader:async t=>{if("en"===t)return te;const e=Reflect.get(ce,`./lang/${t}.json`);return e?await e():te}},_t=Object.assign(Object.assign({},_t),he),t.ShipAidWidget=class extends ht{constructor(){var t,e,i;super(...arguments),this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,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=!0,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.intervalId=0,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>ae(t),post:(t,e)=>ae(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}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")?(de("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o;return new Intl.NumberFormat(void 0,{currency:this.currency||(null==(e=this._store)?void 0:e.currency)||(null==(o=null==(i=window.Shopify)?void 0:i.currency)?void 0:o.active)||"USD",style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(oe.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 e.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 e.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;const s=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost);if(!s)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const e={query:"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 }\n}",variables:{store:s}},i=await this._fetch.post(t.toString(),e);if(!i)throw new Error("Missing response for store query.");if(null==(o=i.errors)?void 0:o.length)throw new Error(i.errors[0].message);if(!(null==(r=i.data)?void 0:r.store))throw new Error("Missing store from store query response.");return i.data.store}catch(n){throw console.error(n),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw le(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){try{const{product:t}=await this._fetch.get("/products/shipaid-protection.json");return t}catch(t){throw le(t.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 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={quantity:1,id:this._protectionVariant.id},o=await this._fetch.post("/cart/add.js",i);await this._handleRefresh(o),this._setState("success")}catch(i){le(i.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}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={quantity:0,id:this._protectionCartItem.key},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._cart=e,this._setState("success")}catch(t){le(t.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async attemptAddProtection(){var t,e,i,o,r,s;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn))return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const n=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[n];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(pe)||(sessionStorage.setItem(pe,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(s=this._cart)?void 0:s.item_count)&&this._store.widgetShowCart&&await this.addProtection())}learnMorePopupTemplate(){return B`
|
|
707
791
|
<shipaid-popup-learn-more
|
|
708
792
|
?active=${"learn-more"===this._popup}
|
|
709
793
|
@close=${()=>{this._popup=null}}
|
|
@@ -712,7 +796,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
712
796
|
<div class="shipaid-prompt">
|
|
713
797
|
<div class="prompt-product">
|
|
714
798
|
<div class="prompt-product-image">
|
|
715
|
-
${
|
|
799
|
+
${It(this._hasProtectionInCart,(()=>Ut),(()=>Nt))}
|
|
716
800
|
</div>
|
|
717
801
|
<div class="prompt-product-details">
|
|
718
802
|
<p class="prompt-product-details-title">
|
|
@@ -726,7 +810,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
726
810
|
<p class="prompt-product-actions-price">
|
|
727
811
|
${(null==(t=this._protectionVariant)?void 0:t.price)&&this._currencyFormat(this._protectionVariant.price)}
|
|
728
812
|
</p>
|
|
729
|
-
${
|
|
813
|
+
${It(!this.disableActions,(()=>B`
|
|
730
814
|
<button
|
|
731
815
|
class="prompt-product-actions-button"
|
|
732
816
|
@click=${this._updateProtection}
|
|
@@ -737,14 +821,14 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
737
821
|
`))}
|
|
738
822
|
</div>
|
|
739
823
|
</div>
|
|
740
|
-
${
|
|
824
|
+
${It(this._state.error,(()=>B`<p class="error">${this._state.error}</p>`))}
|
|
741
825
|
<div class="prompt-footer">
|
|
742
826
|
<a
|
|
743
827
|
class="prompt-footer-badge"
|
|
744
828
|
@click=${()=>{this._popup="learn-more"}}
|
|
745
829
|
>
|
|
746
830
|
<span>${zt("footer.button")}</span>
|
|
747
|
-
${
|
|
831
|
+
${jt}
|
|
748
832
|
<button
|
|
749
833
|
class="prompt-footer-about"
|
|
750
834
|
@click=${()=>{this._popup="learn-more"}}
|
|
@@ -754,10 +838,10 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
754
838
|
</a>
|
|
755
839
|
</div>
|
|
756
840
|
</div>
|
|
757
|
-
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=_t){const i=await e.loader(t,e);e.translationCache={},
|
|
841
|
+
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=_t){const i=await e.loader(t,e);e.translationCache={},Ct(t,i,e)}(this.lang),this.hasLoadedStrings=!0}render(){return Ot(this,(async()=>{var t,e,i;const o=document.createElement("link");o.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),o.setAttribute("rel","stylesheet"),document.head.appendChild(o);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(r){return le(r.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._shouldShowWidget=!0,this._dispatchEvent(oe.LOADED,this._store),setTimeout((async()=>{var t,e,i,o;(null==(t=this._store)?void 0:t.widgetAutoOptIn)&&(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(pe)||(sessionStorage.setItem(pe,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&await this.addProtection()))}),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}`))))):(de("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(de("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(de("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Ot(this,(async()=>{var t,e,i;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const o=null==(e=this._cart.items)?void 0:e.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))})),r=null==(i=this._cart)?void 0:i.items[o];if(this._hasProtectionInCart=!!r,1===this._cart.item_count&&r){const t={id:r.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return sessionStorage.removeItem(pe),await this._handleRefresh(e)}const s=await this.calculateProtectionTotal(this._cart),n=this._findProtectionVariant(s);if(this._protectionVariant=n,!(null==n?void 0:n.id))return this._shouldShowWidget=!1,void le("No matching protection variant found.");if(!r)return;if(n.id===r.variant_id){if(this._protectionCartItem={...r,index:o,position:o+1},1===r.quantity)return;const t={id:r.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const a={updates:{[r.variant_id]:0,[n.id]:1}},d=await this._fetch.post("/cart/update.js",a);await this._handleRefresh(d)}),[this._store,this._cart]),lt(this.learnMorePopupTemplate(),document.body),B`
|
|
758
842
|
<div class="shipaid">
|
|
759
|
-
${
|
|
843
|
+
${It(this._hasFinishedSetup,(()=>{var t;return It(this._shouldShowWidget&&this.planActive&&(null==(t=this._store)?void 0:t.widgetShowCart),(()=>this.promptTemplate()),(()=>F))}),(()=>B`<p>
|
|
760
844
|
<slot name="loading" default>${zt("loading")}</slot>
|
|
761
845
|
</p>`))}
|
|
762
846
|
</div>
|
|
763
|
-
`}},t.ShipAidWidget.styles=
|
|
847
|
+
`}},t.ShipAidWidget.styles=ie,ne([s({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disablePolling",2),ne([s({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableActions",2),ne([s({type:Number,attribute:!0})],t.ShipAidWidget.prototype,"pollingInterval",2),ne([s({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableRefresh",2),ne([s({type:String,attribute:!0})],t.ShipAidWidget.prototype,"lang",2),ne([s({type:String,attribute:!0})],t.ShipAidWidget.prototype,"currency",2),ne([s({type:String,attribute:!0})],t.ShipAidWidget.prototype,"customerId",2),ne([n()],t.ShipAidWidget.prototype,"_storeDomain",2),ne([n()],t.ShipAidWidget.prototype,"_store",2),ne([n()],t.ShipAidWidget.prototype,"_cart",2),ne([n()],t.ShipAidWidget.prototype,"_protectionProduct",2),ne([n()],t.ShipAidWidget.prototype,"_cartLastUpdated",2),ne([n()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),ne([n()],t.ShipAidWidget.prototype,"_shouldShowWidget",2),ne([n()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),ne([n()],t.ShipAidWidget.prototype,"_protectionCartItem",2),ne([n()],t.ShipAidWidget.prototype,"_protectionVariant",2),ne([n()],t.ShipAidWidget.prototype,"hasLoadedStrings",2),ne([n()],t.ShipAidWidget.prototype,"intervalId",2),ne([n()],t.ShipAidWidget.prototype,"_state",2),ne([n()],t.ShipAidWidget.prototype,"_popup",2),t.ShipAidWidget=ne([i("shipaid-widget")],t.ShipAidWidget);const ue="Cargando el widget ShipAid...",fe="Garantía de entrega",ge="en caso de Pérdida, Daño o Robo",me={button:"Energizado por"},ve={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},_e={loading:ue,title:fe,description:ge,footer:me,actions:ve,"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"}}},Ce=Object.freeze(Object.defineProperty({__proto__:null,actions:ve,default:_e,description:ge,footer:me,loading:ue,title:fe},Symbol.toStringTag,{value:"Module"})),ye="Caricamento del widget ShipAid...",be="Garanzia di consegna",we="in caso di Perdita, Danno o Furto",$e={button:"Offerto da"},Ae={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},Le={loading:ye,title:be,description:we,footer:$e,actions:Ae,"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"}}},Se=Object.freeze(Object.defineProperty({__proto__:null,actions:Ae,default:Le,description:we,footer:$e,loading:ye,title:be},Symbol.toStringTag,{value:"Module"})),xe="Carregando o widget ShipAid...",Ee="Garantia de entrega",Pe="em caso de Perda, Danos ou Roubo",ze={button:"Distribuído por"},Me={add:"Adicionar",remove:"Remover",loading:"Carregando..."},ke={loading:xe,title:Ee,description:Pe,footer:ze,actions:Me,"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"}}},Te=Object.freeze(Object.defineProperty({__proto__:null,actions:Me,default:ke,description:Pe,footer:ze,loading:xe,title:Ee},Symbol.toStringTag,{value:"Module"}));return Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/widget.umd.js
CHANGED
|
@@ -29,45 +29,45 @@ const d=window,l=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"
|
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
-
*/;var
|
|
32
|
+
*/;var g;const m=window,v=m.trustedTypes,_=v?v.emptyScript:"",C=m.reactiveElementPolyfillSupport,y={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},b=(t,e)=>e!==t&&(e==e||t==t),w={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:b},$="finalized";let A=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||w}static finalize(){if(this.hasOwnProperty($))return!1;this[$]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(f(t))}else void 0!==t&&e.push(f(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{l?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=d.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=w){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:y).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:y;this._$El=r,this[r]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||b)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(o){throw e=!1,this._$Ek(),o}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
37
|
*/
|
|
38
|
-
var
|
|
38
|
+
var L;A[$]=!0,A.elementProperties=new Map,A.elementStyles=[],A.shadowRootOptions={mode:"open"},null==C||C({ReactiveElement:A}),(null!==(g=m.reactiveElementVersions)&&void 0!==g?g:m.reactiveElementVersions=[]).push("1.6.3");const S=window,x=S.trustedTypes,E=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,M="?"+z,k=`<${M}>`,T=document,O=()=>T.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,q=Array.isArray,N="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,R=/>/g,W=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,D=/"/g,V=/^(?:script|style|textarea|title)$/i,B=(J=1,(t,...e)=>({_$litType$:J,strings:t,values:e})),Z=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),G=new WeakMap,Y=T.createTreeWalker(T,129,null,!1);var J;function K(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}class Q{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[d,l]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=U;for(let a=0;a<i;a++){const e=t[a];let i,d,l=-1,p=0;for(;p<e.length&&(n.lastIndex=p,d=n.exec(e),null!==d);)p=n.lastIndex,n===U?"!--"===d[1]?n=j:void 0!==d[1]?n=R:void 0!==d[2]?(V.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=W):void 0!==d[3]&&(n=W):n===W?">"===d[0]?(n=null!=r?r:U,l=-1):void 0===d[1]?l=-2:(l=n.lastIndex-d[2].length,i=d[1],n=void 0===d[3]?W:'"'===d[3]?D:H):n===D||n===H?n=W:n===j||n===R?n=U:(n=W,r=void 0);const c=n===W&&t[a+1].startsWith("/>")?" ":"";s+=n===U?e+k:l>=0?(o.push(i),e.slice(0,l)+P+e.slice(l)+z+c):e+z+(-2===l?(o.push(void 0),a):c)}return[K(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=Q.createElement(d,i),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(P)||e.startsWith(z)){const i=l[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+P).split(z),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?st:"@"===e[1]?nt:it})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(V.test(o.tagName)){const t=o.textContent.split(z),e=t.length-1;if(e>0){o.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],O()),Y.nextNode(),a.push({type:2,index:++r});o.append(t[e],O())}}}else if(8===o.nodeType)if(o.data===M)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=T.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var r,s,n,a;if(e===Z)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const l=I(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==l&&(null===(s=null==d?void 0:d._$AO)||void 0===s||s.call(d,!1),void 0===l?d=void 0:(d=new l(t),d._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n: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:T).importNode(i,!0);Y.currentNode=r;let s=Y.nextNode(),n=0,a=0,d=o[0];for(;void 0!==d;){if(n===d.index){let e;2===d.type?e=new et(s,s.nextSibling,this,t):1===d.type?e=new d.ctor(s,d.name,d.strings,this,t):6===d.type&&(e=new at(s,this,t)),this._$AV.push(e),d=o[++a]}n!==(null==d?void 0:d.index)&&(s=Y.nextNode(),n++)}return Y.currentNode=T,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=F,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),I(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>q(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!==F&&I(this._$AH)?this._$AA.nextSibling.data=t:this.$(T.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=Q.createElement(K(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 Q(t)),e}T(t){q(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(O()),this.k(O()),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=F,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=F}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=X(this,t,e,0),s=!I(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=X(this,o[i+n],e,n),a===Z&&(a=this._$AH[n]),s||(s=!I(a)||a!==this._$AH[n]),a===F?t=F:t!==F&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===F?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===F?void 0:t}}const rt=x?x.emptyScript:"";class st extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==F?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class nt 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:F)===Z)return;const o=this._$AH,r=t===F&&o!==F||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==F&&(o===F||r);r&&this.element.removeEventListener(this.name,this,o),s&&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(Q,et),(null!==(L=S.litHtmlVersions)&&void 0!==L?L:S.litHtmlVersions=[]).push("2.8.0");const lt=(t,e,i)=>{var o,r;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=s._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=n=new et(e.insertBefore(O(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n};
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/var pt,ct;let ht=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return
|
|
43
|
+
*/var pt,ct;let ht=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return Z}};ht.finalized=!0,ht._$litElement$=!0,null===(pt=globalThis.litElementHydrateSupport)||void 0===pt||pt.call(globalThis,{LitElement:ht});const ut=globalThis.litElementPolyfillSupport;null==ut||ut({LitElement:ht}),(null!==(ct=globalThis.litElementVersions)&&void 0!==ct?ct:globalThis.litElementVersions=[]).push("3.3.3");const ft="langChanged";function gt(t,e,i){return Object.entries(vt(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[ ]*${e}[ ]*}}`,"gm"),String(vt(i)))),t)}function mt(t,e){const i=t.split(".");let o=e.strings;for(;null!=o&&i.length>0;)o=o[i.shift()];return null!=o?o.toString():null}function vt(t){return"function"==typeof t?t():t}let _t={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:mt,interpolate:gt,translationCache:{}};function Ct(t,e,i=_t){var o;o={previousStrings:i.strings,previousLang:i.lang,lang:i.lang=t,strings:i.strings=e},window.dispatchEvent(new CustomEvent(ft,{detail:o}))}
|
|
44
44
|
/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2017 Google LLC
|
|
47
47
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
49
|
+
const yt=2;class bt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2020 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const
|
|
54
|
+
*/const wt=(t,e)=>{var i,o;const r=t._$AN;if(void 0===r)return!1;for(const s of r)null===(o=(i=s)._$AO)||void 0===o||o.call(i,e,!1),wt(s,e);return!0},$t=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===(null==i?void 0:i.size))},At=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),xt(e)}};
|
|
55
55
|
/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/function
|
|
59
|
+
*/function Lt(t){void 0!==this._$AN?($t(this),this._$AM=t,At(this)):this._$AM=t}function St(t,e=!1,i=0){const o=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(o))for(let s=i;s<o.length;s++)wt(o[s],!1),$t(o[s]);else null!=o&&(wt(o,!1),$t(o));else wt(this,t)}const xt=t=>{var e,i,o,r;t.type==yt&&(null!==(e=(o=t)._$AP)&&void 0!==e||(o._$AP=St),null!==(i=(r=t)._$AQ)&&void 0!==i||(r._$AQ=Lt))};class Et extends bt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),At(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,o;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(o=this.disconnected)||void 0===o||o.call(this)),e&&(wt(this,t),$t(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class Pt extends Et{constructor(){super(...arguments),this.langChangedSubscription=null,this.getValue=()=>""}renderValue(t){return this.getValue=t,this.subscribe(),this.getValue()}langChanged(t){this.setValue(this.getValue(t))}subscribe(){null==this.langChangedSubscription&&(this.langChangedSubscription=function(t,e){const i=e=>t(e.detail);return window.addEventListener(ft,i,e),()=>window.removeEventListener(ft,i)}(this.langChanged.bind(this)))}unsubscribe(){null!=this.langChangedSubscription&&this.langChangedSubscription()}disconnected(){this.unsubscribe()}reconnected(){this.subscribe()}}const zt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends Pt{render(t,e,i){return this.renderValue((()=>function(t,e,i=_t){let o=i.translationCache[t]||(i.translationCache[t]=i.lookup(t,i)||i.empty(t,i));return null!=(e=null!=e?vt(e):null)?i.interpolate(o,e,i):o}(t,e,i)))}});
|
|
60
60
|
/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2017 Google LLC
|
|
63
63
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
64
|
-
*/class Mt extends
|
|
64
|
+
*/class Mt extends bt{constructor(t){if(super(t),this.et=F,t.type!==yt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===F||null==t)return this.ft=void 0,this.et=t;if(t===Z)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:[]}}}Mt.directiveName="unsafeHTML",Mt.resultType=1;const kt="__registered_effects";function Tt(t){const e=t;if(e[kt])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[kt]={index:0,count:0,effects:[]},i.updated=t=>(e[kt].index=0,o(t)),e}function Ot(t,e,i){const o=function(t,e){const i=Tt(t),{index:o,count:r}=i[kt];return o===r?(i[kt].index++,i[kt].count++,i[kt].effects.push(e),e):(i[kt].index++,i[kt].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
|
|
65
65
|
/**
|
|
66
66
|
* @license
|
|
67
67
|
* Copyright 2021 Google LLC
|
|
68
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
69
69
|
*/
|
|
70
|
-
function
|
|
70
|
+
function It(t,e,i){return t?e():null==i?void 0:i()}const qt=u`
|
|
71
71
|
:host {
|
|
72
72
|
--shipaid-primary: #0056d6;
|
|
73
73
|
--shipaid-secondary: #0076ff;
|
|
@@ -267,7 +267,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
267
267
|
background: transparent;
|
|
268
268
|
z-index: -1;
|
|
269
269
|
}
|
|
270
|
-
`,
|
|
270
|
+
`,Nt=B`
|
|
271
271
|
<svg
|
|
272
272
|
version="1.0"
|
|
273
273
|
width="50.000000pt"
|
|
@@ -288,7 +288,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
288
288
|
/>
|
|
289
289
|
</g>
|
|
290
290
|
</svg>
|
|
291
|
-
`,
|
|
291
|
+
`,Ut=B`
|
|
292
292
|
<svg
|
|
293
293
|
version="1.0"
|
|
294
294
|
width="50.000000pt"
|
|
@@ -394,6 +394,90 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
394
394
|
</g>
|
|
395
395
|
</svg>
|
|
396
396
|
`,Rt=B`
|
|
397
|
+
<svg
|
|
398
|
+
width="300.000000pt"
|
|
399
|
+
height="75.000000pt"
|
|
400
|
+
viewBox="-25 -40 550 125"
|
|
401
|
+
version="1.1"
|
|
402
|
+
xml:space="preserve"
|
|
403
|
+
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
|
|
404
|
+
>
|
|
405
|
+
<g transform="matrix(1,0,0,1,-45.4439,-231.396)">
|
|
406
|
+
<g transform="matrix(1,0,0,1,41.8553,292.5)">
|
|
407
|
+
<g>
|
|
408
|
+
<path
|
|
409
|
+
d="M25.484,0.536C36.161,0.536 47.828,-4.755 47.646,-17.047C47.646,-37.958 14.089,-31.047 14.177,-43.427C14.089,-47.646 18.036,-51.328 25.125,-51.328C31.318,-51.328 34.724,-50.068 39.302,-47.646C40.021,-47.286 40.828,-47.021 41.547,-47.021C43.88,-47.021 46.12,-48.995 46.12,-51.505C46.214,-53.391 45.047,-54.734 43.88,-55.453C39.75,-58.234 31.854,-61.104 25.125,-61.104C13.729,-61.104 3.589,-55.094 3.589,-42.979C3.589,-20.995 37.146,-27.906 37.146,-16.333C37.146,-11.932 32.214,-8.885 25.036,-9.062C19.474,-9.151 15.432,-11.036 11.667,-12.922C10.859,-13.37 9.87,-13.547 9.422,-13.547C6.911,-13.547 4.484,-11.484 4.396,-8.526C4.307,-6.729 5.385,-5.292 6.818,-4.307C10.766,-1.703 18.125,0.63 25.484,0.536Z"
|
|
410
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
411
|
+
/>
|
|
412
|
+
</g>
|
|
413
|
+
</g>
|
|
414
|
+
<g transform="matrix(1,0,0,1,111.569,292.5)">
|
|
415
|
+
<g>
|
|
416
|
+
<path
|
|
417
|
+
d="M48.901,-60.656C45.943,-60.656 43.609,-58.234 43.609,-55.365L43.609,-34.547L16.87,-34.547L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-24.943L43.609,-24.943L43.609,-5.292C43.609,-2.333 45.943,0 48.901,0C51.776,0 54.198,-2.333 54.198,-5.292L54.198,-55.365C54.198,-58.234 51.776,-60.656 48.901,-60.656Z"
|
|
418
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
419
|
+
/>
|
|
420
|
+
</g>
|
|
421
|
+
</g>
|
|
422
|
+
<g transform="matrix(1,0,0,1,190.435,292.5)">
|
|
423
|
+
<g>
|
|
424
|
+
<path
|
|
425
|
+
d="M11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0Z"
|
|
426
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
427
|
+
/>
|
|
428
|
+
</g>
|
|
429
|
+
</g>
|
|
430
|
+
<g transform="matrix(1,0,0,1,232.067,292.5)">
|
|
431
|
+
<g>
|
|
432
|
+
<path
|
|
433
|
+
d="M25.125,-60.656L11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-23.151L25.125,-23.151C35.714,-23.151 44.328,-30.865 44.328,-41.906C44.328,-52.849 35.714,-60.656 25.125,-60.656ZM24.766,-32.844L16.87,-32.844L16.87,-50.969L24.766,-50.969C29.703,-50.969 33.74,-47.198 33.74,-41.906C33.74,-36.521 29.703,-32.844 24.766,-32.844Z"
|
|
434
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
435
|
+
/>
|
|
436
|
+
</g>
|
|
437
|
+
</g>
|
|
438
|
+
<g transform="matrix(1,0,0,1,298.418,292.5)">
|
|
439
|
+
<g>
|
|
440
|
+
<path
|
|
441
|
+
d="M54.198,-4.844L32.214,-58.417C31.583,-59.849 30.151,-60.839 28.536,-60.745C26.917,-60.839 25.396,-59.849 24.854,-58.417L2.87,-4.844C2.063,-2.87 3.052,-0.63 4.938,0.089C6.729,0.896 9.063,0.177 9.87,-1.974L15.255,-15.344L41.724,-15.344L47.109,-1.974C47.917,-0.089 50.161,0.99 52.135,0.089C54.016,-0.63 54.917,-2.964 54.198,-4.844ZM18.125,-22.432L28.536,-48.276L38.854,-22.432L18.125,-22.432Z"
|
|
442
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
443
|
+
/>
|
|
444
|
+
</g>
|
|
445
|
+
</g>
|
|
446
|
+
<g transform="matrix(1,0,0,1,373.874,292.5)">
|
|
447
|
+
<g>
|
|
448
|
+
<path
|
|
449
|
+
d="M10.318,0C12.474,0 14.177,-1.703 14.177,-3.859L14.177,-56.797C14.177,-58.865 12.474,-60.656 10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0Z"
|
|
450
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
451
|
+
/>
|
|
452
|
+
</g>
|
|
453
|
+
</g>
|
|
454
|
+
<g transform="matrix(1,0,0,1,412.904,292.5)">
|
|
455
|
+
<g>
|
|
456
|
+
<path
|
|
457
|
+
d="M24.854,-60.656L10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0L24.854,0C41.724,0 55.005,-12.38 55.005,-30.328C55.005,-48.187 41.724,-60.656 24.854,-60.656ZM24.854,-7.089L14.177,-7.089L14.177,-53.568L24.854,-53.568C37.417,-53.568 47.286,-44.057 47.286,-30.328C47.286,-16.51 37.417,-7.089 24.854,-7.089Z"
|
|
458
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
459
|
+
/>
|
|
460
|
+
</g>
|
|
461
|
+
</g>
|
|
462
|
+
<path
|
|
463
|
+
d="M255.854,234.453C247.292,234.453 240.354,241.391 240.354,249.953C240.354,258.51 247.292,265.453 255.854,265.453C264.417,265.453 271.354,258.51 271.354,249.953C271.354,241.391 264.417,234.453 255.854,234.453ZM253.01,257.911L246.188,251.089L248.458,248.813L253.01,253.365L263.25,243.125L265.521,245.401L253.01,257.911Z"
|
|
464
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
465
|
+
/>
|
|
466
|
+
<path
|
|
467
|
+
d="M270.385,238.443L256.297,233.974C256.005,233.88 255.698,233.88 255.406,233.974L241.318,238.443C240.745,238.599 240.354,239.12 240.354,239.714C240.552,244.578 241.917,259.135 241.917,259.135C241.958,259.693 242.26,260.193 242.729,260.5L255.365,268.646C255.661,268.833 256.042,268.833 256.339,268.646L268.974,260.5C269.443,260.193 269.745,259.693 269.786,259.135C269.786,259.135 271.151,244.578 271.349,239.714C271.349,239.12 270.958,238.599 270.385,238.443"
|
|
468
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
469
|
+
/>
|
|
470
|
+
<path
|
|
471
|
+
d="M266.224,245.536C266.167,245.427 266.094,245.323 265.938,245.24L263.719,243.922C263.688,243.901 263.656,243.885 263.62,243.88C263.609,243.875 263.599,243.875 263.589,243.875C263.563,243.87 263.542,243.865 263.516,243.865C263.448,243.87 263.385,243.885 263.328,243.922L258.339,246.896L258.333,246.885L257.932,247.125C257.448,247.417 256.849,247.417 256.365,247.125L254.182,245.823C254.063,245.755 253.984,245.62 253.984,245.474C253.984,245.328 254.063,245.198 254.182,245.125L256.365,243.823C256.849,243.536 257.448,243.536 257.932,243.823L258.458,244.135C258.578,244.208 258.724,244.208 258.849,244.135L260.88,242.927C261,242.854 261.073,242.724 261.073,242.578C261.073,242.432 261,242.297 260.88,242.224L257.932,240.469C257.448,240.182 256.849,240.182 256.365,240.469L249.141,244.776C248.62,245.083 248.62,245.865 249.141,246.177L256.365,250.479C256.849,250.771 257.448,250.771 257.932,250.479L263.516,247.151L263.516,254.734L261.719,255.807L257.932,258.073C257.813,258.141 257.682,258.198 257.547,258.234C257.151,258.344 256.724,258.286 256.365,258.073L251.172,254.979C250.927,254.833 250.781,254.563 250.781,254.276L250.781,249.854C250.781,249.714 250.703,249.578 250.583,249.505L248.552,248.297C248.432,248.224 248.281,248.224 248.161,248.297C248.042,248.37 247.964,248.5 247.964,248.646L247.964,255.953C247.964,256.245 248.115,256.51 248.359,256.656L256.365,261.427C256.599,261.568 256.865,261.641 257.135,261.641L257.141,261.641C257.177,261.641 257.219,261.641 257.255,261.635C257.286,261.635 257.318,261.635 257.344,261.63C257.385,261.625 257.427,261.615 257.464,261.604C257.495,261.599 257.521,261.599 257.547,261.589C257.589,261.578 257.63,261.563 257.672,261.547C257.698,261.536 257.719,261.531 257.74,261.521C257.807,261.495 257.87,261.464 257.932,261.427L264.839,257.307L265.932,256.667C266.177,256.526 266.328,256.255 266.328,255.964L266.328,245.943C266.328,245.797 266.292,245.656 266.224,245.536"
|
|
472
|
+
style="fill:white;fill-rule:nonzero;"
|
|
473
|
+
/>
|
|
474
|
+
<path
|
|
475
|
+
d="M257.911,238.047C257.677,237.911 257.417,237.833 257.146,237.833C256.88,237.833 256.615,237.911 256.38,238.047L246.734,243.797C246.25,244.089 245.953,244.62 245.953,245.198L245.953,256.698C245.953,257.276 246.25,257.807 246.734,258.094L256.38,263.844C256.62,263.99 256.885,264.063 257.156,264.063C257.432,264.063 257.698,263.99 257.932,263.849L267.536,258.12C268.021,257.833 268.323,257.302 268.323,256.724L268.323,253.401C268.318,253.255 268.396,253.125 268.516,253.052L270.563,251.833C270.682,251.76 270.828,251.76 270.953,251.833C271.073,251.906 271.146,252.036 271.146,252.182L271.146,258.37C271.146,258.635 271.083,258.896 270.964,259.13C270.932,259.281 270.771,259.458 270.542,259.646C270.536,259.651 270.531,259.651 270.526,259.656C269.948,260.12 268.995,260.599 268.823,260.703L257.932,267.193C257.693,267.339 257.411,267.411 257.13,267.411L257.12,267.411L257.12,267.406C256.859,267.401 256.604,267.328 256.38,267.193L243.927,259.771C243.443,259.479 243.146,258.948 243.146,258.37L243.146,243.526C243.146,243.266 243.177,243 243.286,242.776C243.302,242.719 243.453,242.432 243.766,242.198C243.885,242.12 244.089,242.01 244.286,241.891L256.349,234.703C256.589,234.557 256.865,234.484 257.146,234.49C257.427,234.484 257.703,234.557 257.948,234.703L269.078,241.339C269.104,241.354 269.12,241.37 269.146,241.391L269.286,241.474C269.661,241.682 270.255,241.995 270.578,242.25L270.604,242.271C270.609,242.271 270.615,242.276 270.62,242.276C270.63,242.286 270.635,242.297 270.646,242.307C270.766,242.411 270.865,242.531 270.943,242.661C270.948,242.667 270.948,242.667 270.948,242.672C271.078,242.896 271.146,243.151 271.146,243.411L271.146,248.849C271.146,248.995 271.073,249.125 270.953,249.198L268.906,250.417C268.786,250.49 268.635,250.49 268.516,250.417C268.396,250.344 268.318,250.214 268.318,250.068L268.318,245.167C268.318,244.589 268.021,244.052 267.536,243.766L257.911,238.047Z"
|
|
476
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
477
|
+
/>
|
|
478
|
+
</g>
|
|
479
|
+
</svg>
|
|
480
|
+
`,Wt=B`
|
|
397
481
|
<svg
|
|
398
482
|
version="1.0"
|
|
399
483
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -418,7 +502,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
418
502
|
/>
|
|
419
503
|
</g>
|
|
420
504
|
</svg>
|
|
421
|
-
`,
|
|
505
|
+
`,Ht=B`
|
|
422
506
|
<svg
|
|
423
507
|
version="1.0"
|
|
424
508
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -437,7 +521,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
437
521
|
/>
|
|
438
522
|
</g>
|
|
439
523
|
</svg>
|
|
440
|
-
`,
|
|
524
|
+
`,Dt=B`
|
|
441
525
|
<svg
|
|
442
526
|
version="1.0"
|
|
443
527
|
viewBox="0 0 500.000000 500.000000"
|
|
@@ -462,7 +546,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
462
546
|
/>
|
|
463
547
|
</g>
|
|
464
548
|
</svg>
|
|
465
|
-
`,
|
|
549
|
+
`,Vt=B`
|
|
466
550
|
<svg
|
|
467
551
|
xmlns="http://www.w3.org/2000/svg"
|
|
468
552
|
version="1.0"
|
|
@@ -488,7 +572,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
488
572
|
/>
|
|
489
573
|
</g>
|
|
490
574
|
</svg>
|
|
491
|
-
`;var
|
|
575
|
+
`;var Bt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Ft=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?Zt(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&Bt(e,i,s),s};let Gt=class extends ht{constructor(){super(...arguments),this.active=!1}handleClosePopup(){const t=new Event("close");this.dispatchEvent(t)}render(){return B`
|
|
492
576
|
<div class=${`shipaid-popup ${this.active&&"active"}`}>
|
|
493
577
|
<div class="blocker" @click=${this.handleClosePopup}></div>
|
|
494
578
|
<button
|
|
@@ -498,22 +582,22 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
498
582
|
>
|
|
499
583
|
${zt("learn-more-popup.close")}
|
|
500
584
|
</button>
|
|
501
|
-
<div class="popup-logo">${
|
|
585
|
+
<div class="popup-logo">${Rt}</div>
|
|
502
586
|
<p class="popup-title">${zt("learn-more-popup.title")}</p>
|
|
503
587
|
<div class="popup-disclaimer-subtitle">
|
|
504
|
-
<div class="popup-icon">${
|
|
588
|
+
<div class="popup-icon">${Wt}</div>
|
|
505
589
|
<p>${zt("learn-more-popup.disclaimer.subtitle-enable")}</p>
|
|
506
590
|
</div>
|
|
507
591
|
<div class="popup-disclaimer-subtitle">
|
|
508
|
-
<div class="popup-icon">${
|
|
592
|
+
<div class="popup-icon">${Ht}</div>
|
|
509
593
|
<p>${zt("learn-more-popup.disclaimer.subtitle-monitor")}</p>
|
|
510
594
|
</div>
|
|
511
595
|
<div class="popup-disclaimer-subtitle">
|
|
512
|
-
<div class="popup-icon-b">${
|
|
596
|
+
<div class="popup-icon-b">${Vt}</div>
|
|
513
597
|
<p>${zt("learn-more-popup.disclaimer.subtitle-notify")}</p>
|
|
514
598
|
</div>
|
|
515
599
|
<div class="popup-disclaimer-subtitle">
|
|
516
|
-
<div class="popup-icon-bell">${
|
|
600
|
+
<div class="popup-icon-bell">${Dt}</div>
|
|
517
601
|
<p>
|
|
518
602
|
${zt("learn-more-popup.disclaimer.subtitle-resolution")}
|
|
519
603
|
</p>
|
|
@@ -548,7 +632,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
548
632
|
</div>
|
|
549
633
|
</div>
|
|
550
634
|
</div>
|
|
551
|
-
`}};
|
|
635
|
+
`}};Gt.styles=qt,Ft([s({type:Boolean,attribute:!0})],Gt.prototype,"active",2),Gt=Ft([i("shipaid-popup-learn-more")],Gt);const Yt="Loading ShipAid Widget...",Jt="Delivery Guarantee",Kt="in case of Loss, Damage or Theft",Qt={button:"Powered by"},Xt={add:"Add",remove:"Remove",loading:"Loading..."},te={loading:Yt,title:Jt,description:Kt,footer:Qt,actions:Xt,"learn-more-popup":{close:"Close",title:"Delivery Guarantee",disclaimer:{"subtitle-enable":"We enable your favorite brands to provide a delivery guarantee because we know that every order is precious, and things happen!","subtitle-monitor":"We continuously monitor your package and offer a convenient portal for you to track your order's progress at any moment!","subtitle-notify":"You'll be notified throughout the entire shipping process, ensuring you stay up to date every step of the way.","subtitle-resolution":"In case of any issues during transit, we offer a quick and easy method to report the problem directly to the brand, for a swift resolution.",text:"By purchasing this delivery guarantee, you agree to our Terms Of Service and Privacy Policy. You are not obligated to purchase this guarantee. This guarantee is NOT insurance and does not provide indemnification against loss, damage, or liability arising from a contingent or unknown event, but rather, through ShipAid brands provide a delivery guarantee whereby if the product you ordered is not delivered in satisfactory condition, the brand from which you ordered the product may replace the product free of charge. ShipAid does not provide any products or services directly to consumers, but instead provides a service that allow brands to facilitate product replacement to their customers. Purchasing this guarantee does not mean that you will automatically be reimbursed for any product or shipping costs because the resolution process and decision for compensation is strictly decided by the brand you a purchasing from. The brand will require proof of damage or undelivered product."},links:{terms:"Terms of Service",privacy:"Privacy Policy"}}},ee=Object.freeze(Object.defineProperty({__proto__:null,actions:Xt,default:te,description:Kt,footer:Qt,loading:Yt,title:Jt},Symbol.toStringTag,{value:"Module"})),ie=u`
|
|
552
636
|
:host {
|
|
553
637
|
--shipaid-primary: #002bd6;
|
|
554
638
|
--shipaid-secondary: #0076ff;
|
|
@@ -703,7 +787,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
703
787
|
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
704
788
|
height: 9px;
|
|
705
789
|
}
|
|
706
|
-
`;var
|
|
790
|
+
`;var oe=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(oe||{}),re=Object.defineProperty,se=Object.getOwnPropertyDescriptor,ne=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?se(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&re(e,i,s),s};const ae=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.")}},de=t=>console.warn(`[ShipAid] ${t}`),le=t=>console.error(`[ShipAid] ${t}`),pe="shipaid-protection",ce=Object.assign({"./lang/en.json":()=>Promise.resolve().then((()=>ee)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Ce)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>Se)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>Te)).then((t=>t.default))});var he;he={loader:async t=>{if("en"===t)return te;const e=Reflect.get(ce,`./lang/${t}.json`);return e?await e():te}},_t=Object.assign(Object.assign({},_t),he),t.ShipAidWidget=class extends ht{constructor(){var t,e,i;super(...arguments),this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,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=!0,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.intervalId=0,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>ae(t),post:(t,e)=>ae(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}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")?(de("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o;return new Intl.NumberFormat(void 0,{currency:this.currency||(null==(e=this._store)?void 0:e.currency)||(null==(o=null==(i=window.Shopify)?void 0:i.currency)?void 0:o.active)||"USD",style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(oe.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 e.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 e.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;const s=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost);if(!s)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const e={query:"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 }\n}",variables:{store:s}},i=await this._fetch.post(t.toString(),e);if(!i)throw new Error("Missing response for store query.");if(null==(o=i.errors)?void 0:o.length)throw new Error(i.errors[0].message);if(!(null==(r=i.data)?void 0:r.store))throw new Error("Missing store from store query response.");return i.data.store}catch(n){throw console.error(n),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw le(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){try{const{product:t}=await this._fetch.get("/products/shipaid-protection.json");return t}catch(t){throw le(t.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 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={quantity:1,id:this._protectionVariant.id},o=await this._fetch.post("/cart/add.js",i);await this._handleRefresh(o),this._setState("success")}catch(i){le(i.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}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={quantity:0,id:this._protectionCartItem.key},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._cart=e,this._setState("success")}catch(t){le(t.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async attemptAddProtection(){var t,e,i,o,r,s;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn))return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const n=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[n];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(pe)||(sessionStorage.setItem(pe,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(s=this._cart)?void 0:s.item_count)&&this._store.widgetShowCart&&await this.addProtection())}learnMorePopupTemplate(){return B`
|
|
707
791
|
<shipaid-popup-learn-more
|
|
708
792
|
?active=${"learn-more"===this._popup}
|
|
709
793
|
@close=${()=>{this._popup=null}}
|
|
@@ -712,7 +796,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
712
796
|
<div class="shipaid-prompt">
|
|
713
797
|
<div class="prompt-product">
|
|
714
798
|
<div class="prompt-product-image">
|
|
715
|
-
${
|
|
799
|
+
${It(this._hasProtectionInCart,(()=>Ut),(()=>Nt))}
|
|
716
800
|
</div>
|
|
717
801
|
<div class="prompt-product-details">
|
|
718
802
|
<p class="prompt-product-details-title">
|
|
@@ -726,7 +810,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
726
810
|
<p class="prompt-product-actions-price">
|
|
727
811
|
${(null==(t=this._protectionVariant)?void 0:t.price)&&this._currencyFormat(this._protectionVariant.price)}
|
|
728
812
|
</p>
|
|
729
|
-
${
|
|
813
|
+
${It(!this.disableActions,(()=>B`
|
|
730
814
|
<button
|
|
731
815
|
class="prompt-product-actions-button"
|
|
732
816
|
@click=${this._updateProtection}
|
|
@@ -737,7 +821,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
737
821
|
`))}
|
|
738
822
|
</div>
|
|
739
823
|
</div>
|
|
740
|
-
${
|
|
824
|
+
${It(this._state.error,(()=>B`<p class="error">${this._state.error}</p>`))}
|
|
741
825
|
<div class="prompt-footer">
|
|
742
826
|
<a
|
|
743
827
|
class="prompt-footer-badge"
|
|
@@ -754,10 +838,10 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=u`
|
|
|
754
838
|
</a>
|
|
755
839
|
</div>
|
|
756
840
|
</div>
|
|
757
|
-
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=_t){const i=await e.loader(t,e);e.translationCache={},
|
|
841
|
+
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=_t){const i=await e.loader(t,e);e.translationCache={},Ct(t,i,e)}(this.lang),this.hasLoadedStrings=!0}render(){return Ot(this,(async()=>{var t,e,i;const o=document.createElement("link");o.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),o.setAttribute("rel","stylesheet"),document.head.appendChild(o);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(r){return le(r.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._shouldShowWidget=!0,this._dispatchEvent(oe.LOADED,this._store),setTimeout((async()=>{var t,e,i,o;(null==(t=this._store)?void 0:t.widgetAutoOptIn)&&(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(pe)||(sessionStorage.setItem(pe,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&await this.addProtection()))}),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}`))))):(de("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(de("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(de("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Ot(this,(async()=>{var t,e,i;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const o=null==(e=this._cart.items)?void 0:e.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))})),r=null==(i=this._cart)?void 0:i.items[o];if(this._hasProtectionInCart=!!r,1===this._cart.item_count&&r){const t={id:r.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return sessionStorage.removeItem(pe),await this._handleRefresh(e)}const s=await this.calculateProtectionTotal(this._cart),n=this._findProtectionVariant(s);if(this._protectionVariant=n,!(null==n?void 0:n.id))return this._shouldShowWidget=!1,void le("No matching protection variant found.");if(!r)return;if(n.id===r.variant_id){if(this._protectionCartItem={...r,index:o,position:o+1},1===r.quantity)return;const t={id:r.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const a={updates:{[r.variant_id]:0,[n.id]:1}},d=await this._fetch.post("/cart/update.js",a);await this._handleRefresh(d)}),[this._store,this._cart]),lt(this.learnMorePopupTemplate(),document.body),B`
|
|
758
842
|
<div class="shipaid">
|
|
759
|
-
${
|
|
843
|
+
${It(this._hasFinishedSetup,(()=>{var t;return It(this._shouldShowWidget&&this.planActive&&(null==(t=this._store)?void 0:t.widgetShowCart),(()=>this.promptTemplate()),(()=>F))}),(()=>B`<p>
|
|
760
844
|
<slot name="loading" default>${zt("loading")}</slot>
|
|
761
845
|
</p>`))}
|
|
762
846
|
</div>
|
|
763
|
-
`}},t.ShipAidWidget.styles=
|
|
847
|
+
`}},t.ShipAidWidget.styles=ie,ne([s({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disablePolling",2),ne([s({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableActions",2),ne([s({type:Number,attribute:!0})],t.ShipAidWidget.prototype,"pollingInterval",2),ne([s({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableRefresh",2),ne([s({type:String,attribute:!0})],t.ShipAidWidget.prototype,"lang",2),ne([s({type:String,attribute:!0})],t.ShipAidWidget.prototype,"currency",2),ne([s({type:String,attribute:!0})],t.ShipAidWidget.prototype,"customerId",2),ne([n()],t.ShipAidWidget.prototype,"_storeDomain",2),ne([n()],t.ShipAidWidget.prototype,"_store",2),ne([n()],t.ShipAidWidget.prototype,"_cart",2),ne([n()],t.ShipAidWidget.prototype,"_protectionProduct",2),ne([n()],t.ShipAidWidget.prototype,"_cartLastUpdated",2),ne([n()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),ne([n()],t.ShipAidWidget.prototype,"_shouldShowWidget",2),ne([n()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),ne([n()],t.ShipAidWidget.prototype,"_protectionCartItem",2),ne([n()],t.ShipAidWidget.prototype,"_protectionVariant",2),ne([n()],t.ShipAidWidget.prototype,"hasLoadedStrings",2),ne([n()],t.ShipAidWidget.prototype,"intervalId",2),ne([n()],t.ShipAidWidget.prototype,"_state",2),ne([n()],t.ShipAidWidget.prototype,"_popup",2),t.ShipAidWidget=ne([i("shipaid-widget")],t.ShipAidWidget);const ue="Cargando el widget ShipAid...",fe="Garantía de entrega",ge="en caso de Pérdida, Daño o Robo",me={button:"Energizado por"},ve={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},_e={loading:ue,title:fe,description:ge,footer:me,actions:ve,"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"}}},Ce=Object.freeze(Object.defineProperty({__proto__:null,actions:ve,default:_e,description:ge,footer:me,loading:ue,title:fe},Symbol.toStringTag,{value:"Module"})),ye="Caricamento del widget ShipAid...",be="Garanzia di consegna",we="in caso di Perdita, Danno o Furto",$e={button:"Offerto da"},Ae={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},Le={loading:ye,title:be,description:we,footer:$e,actions:Ae,"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"}}},Se=Object.freeze(Object.defineProperty({__proto__:null,actions:Ae,default:Le,description:we,footer:$e,loading:ye,title:be},Symbol.toStringTag,{value:"Module"})),xe="Carregando o widget ShipAid...",Ee="Garantia de entrega",Pe="em caso de Perda, Danos ou Roubo",ze={button:"Distribuído por"},Me={add:"Adicionar",remove:"Remover",loading:"Carregando..."},ke={loading:xe,title:Ee,description:Pe,footer:ze,actions:Me,"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"}}},Te=Object.freeze(Object.defineProperty({__proto__:null,actions:Me,default:ke,description:Pe,footer:ze,loading:xe,title:Ee},Symbol.toStringTag,{value:"Module"}));Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -45,6 +45,7 @@ export interface ShipAidStore {
|
|
|
45
45
|
widgetPollProtection?: boolean;
|
|
46
46
|
widgetShowCart?: boolean;
|
|
47
47
|
excludedProductSkus?: string[];
|
|
48
|
+
excludedCustomersIdsAutoOptIn?: string[] | null;
|
|
48
49
|
planActive: boolean;
|
|
49
50
|
protectionSettings: ProtectionSettingsFixed | ProtectionSettingsPercentage;
|
|
50
51
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const CheckmarkIcon: import("lit").TemplateResult<1>;
|
|
2
2
|
export declare const ShipAidLogo: import("lit").TemplateResult<1>;
|
|
3
3
|
export declare const ShipAidLogoText: import("lit").TemplateResult<1>;
|
|
4
|
+
export declare const ShipAidLogoPopUp: import("lit").TemplateResult<1>;
|
|
4
5
|
export declare const CheckmarkRibbon: import("lit").TemplateResult<1>;
|
|
5
6
|
export declare const MapIcon: import("lit").TemplateResult<1>;
|
|
6
7
|
export declare const BoxIcon: import("lit").TemplateResult<1>;
|