ui.shipaid.com 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/widget.umd.js +577 -0
- package/dist-types/src/shipaid-widget.d.ts +3 -3
- package/package.json +8 -8
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShipAidWidget={})}(this,(function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,i,o)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[i]=o,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&a(t,i,e[i]);if(r)for(var i of r(e))n.call(e,i)&&a(t,i,e[i]);return t},p=(t,e)=>i(t,o(e))
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/;const d=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?p(l({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/function h(t){return(e,i)=>{return void 0!==i?(o=t,r=i,void e.constructor.createProperty(r,o)):d(t,e);
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*/var o,r}}function c(t){return h(p(l({},t),{state:!0}))}
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2021 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*/var u;null===(u=window.HTMLSlotElement)||void 0===u||u.prototype.assignedElements;
|
|
22
|
+
/**
|
|
23
|
+
* @license
|
|
24
|
+
* Copyright 2019 Google LLC
|
|
25
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
26
|
+
*/
|
|
27
|
+
const f=window,v=f.ShadowRoot&&(void 0===f.ShadyCSS||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,m=Symbol(),g=new WeakMap;class C{constructor(t,e,i){if(this._$cssResult$=!0,i!==m)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(v&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=g.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&g.set(e,t))}return t}toString(){return this.cssText}}const _=v?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new C("string"==typeof t?t:t+"",void 0,m))(e)})(t):t
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*/;var y;const L=window,w=L.trustedTypes,$=w?w.emptyScript:"",A=L.reactiveElementPolyfillSupport,b={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{i=null}}return i}},S=(t,e)=>e!==t&&(e==e||t==t),x={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:S};class E extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),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=x){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)||x}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),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(_(t))}else void 0!==t&&e.push(_(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}u(){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)=>{v?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=f.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=x){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:b).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:b;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||S)(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
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2017 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*/
|
|
38
|
+
var P;E.finalized=!0,E.elementProperties=new Map,E.elementStyles=[],E.shadowRootOptions={mode:"open"},null==A||A({ReactiveElement:E}),(null!==(y=L.reactiveElementVersions)&&void 0!==y?y:L.reactiveElementVersions=[]).push("1.4.1");const M=window,k=M.trustedTypes,O=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,T=`lit$${(Math.random()+"").slice(9)}$`,U="?"+T,z=`<${U}>`,N=document,I=(t="")=>N.createComment(t),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,W=Array.isArray,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,D=/>/g,B=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),F=/'/g,Z=/"/g,V=/^(?:script|style|textarea|title)$/i,q=(X=1,(t,...e)=>({_$litType$:X,strings:t,values:e})),J=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),K=new WeakMap,G=N.createTreeWalker(N,129,null,!1);var X;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,[l,p]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=H;for(let l=0;l<i;l++){const e=t[l];let i,a,p=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===H?"!--"===a[1]?n=j:void 0!==a[1]?n=D:void 0!==a[2]?(V.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=B):void 0!==a[3]&&(n=B):n===B?">"===a[0]?(n=null!=r?r:H,p=-1):void 0===a[1]?p=-2:(p=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?B:'"'===a[3]?Z:F):n===Z||n===F?n=B:n===j||n===D?n=H:(n=B,r=void 0);const h=n===B&&t[l+1].startsWith("/>")?" ":"";s+=n===H?e+z:p>=0?(o.push(i),e.slice(0,p)+"$lit$"+e.slice(p)+T+h):e+T+(-2===p?(o.push(void 0),l):h)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==O?O.createHTML(a):a,o]})(t,e);if(this.el=Q.createElement(l,i),G.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=G.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(T)){const i=p[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(T),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?rt:"?"===e[1]?nt:"@"===e[1]?at:ot})}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(T),e=t.length-1;if(e>0){o.textContent=k?k.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],I()),G.nextNode(),a.push({type:2,index:++r});o.append(t[e],I())}}}else if(8===o.nodeType)if(o.data===U)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(T,t+1));)a.push({type:7,index:r}),t+=T.length-1}r++}}static createElement(t,e){const i=N.createElement("template");return i.innerHTML=t,i}}function tt(t,e,i=t,o){var r,s,n,a;if(e===J)return e;let l=void 0!==o?null===(r=i._$Cl)||void 0===r?void 0:r[o]:i._$Cu;const p=R(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==p&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===p?l=void 0:(l=new p(t),l._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Cl)&&void 0!==n?n:a._$Cl=[])[o]=l:i._$Cu=l),void 0!==l&&(e=tt(t,l._$AS(t,e.values),l,o)),e}class et{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:N).importNode(i,!0);G.currentNode=r;let s=G.nextNode(),n=0,a=0,l=o[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new it(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new lt(s,this,t)),this.v.push(e),l=o[++a]}n!==(null==l?void 0:l.index)&&(s=G.nextNode(),n++)}return r}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class it{constructor(t,e,i,o){var r;this.type=2,this._$AH=Y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$C_=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._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=tt(this,t,e),R(t)?t===Y||null==t||""===t?(this._$AH!==Y&&this._$AR(),this._$AH=Y):t!==this._$AH&&t!==J&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>W(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.O(t):this.$(t)}S(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}$(t){this._$AH!==Y&&R(this._$AH)?this._$AA.nextSibling.data=t:this.k(N.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Q.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.m(i);else{const t=new et(r,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=K.get(t.strings);return void 0===e&&K.set(t.strings,e=new Q(t)),e}O(t){W(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 it(this.S(I()),this.S(I()),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._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class ot{constructor(t,e,i,o,r){this.type=1,this._$AH=Y,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=Y}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=tt(this,t,e,0),s=!R(t)||t!==this._$AH&&t!==J,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=tt(this,o[i+n],e,n),a===J&&(a=this._$AH[n]),s||(s=!R(a)||a!==this._$AH[n]),a===Y?t=Y:t!==Y&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.P(t)}P(t){t===Y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class rt extends ot{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===Y?void 0:t}}const st=k?k.emptyScript:"";class nt extends ot{constructor(){super(...arguments),this.type=4}P(t){t&&t!==Y?this.element.setAttribute(this.name,st):this.element.removeAttribute(this.name)}}class at extends ot{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=tt(this,t,e,0))&&void 0!==i?i:Y)===J)return;const o=this._$AH,r=t===Y&&o!==Y||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==Y&&(o===Y||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 lt{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){tt(this,t)}}const pt=M.litHtmlPolyfillSupport;
|
|
39
|
+
/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2017 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/
|
|
44
|
+
var dt,ht;null==pt||pt(Q,it),(null!==(P=M.litHtmlVersions)&&void 0!==P?P:M.litHtmlVersions=[]).push("2.3.1");class ct extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=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._$Dt=((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 it(e.insertBefore(I(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return J}}ct.finalized=!0,ct._$litElement$=!0,null===(dt=globalThis.litElementHydrateSupport)||void 0===dt||dt.call(globalThis,{LitElement:ct});const ut=globalThis.litElementPolyfillSupport;null==ut||ut({LitElement:ct}),(null!==(ht=globalThis.litElementVersions)&&void 0!==ht?ht:globalThis.litElementVersions=[]).push("3.2.0");const ft="__registered_effects";function vt(t){const e=t;if(e[ft])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[ft]={index:0,count:0,effects:[]},i.updated=t=>(e[ft].index=0,o(t)),e}function mt(t,e,i){const o=function(t,e){const i=vt(t),{index:o,count:r}=i[ft];return o===r?(i[ft].index++,i[ft].count++,i[ft].effects.push(e),e):(i[ft].index++,i[ft].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
|
|
45
|
+
/**
|
|
46
|
+
* @license
|
|
47
|
+
* Copyright 2021 Google LLC
|
|
48
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
|
+
*/
|
|
50
|
+
function gt(t,e,i){return t?e():null==i?void 0:i()}var Ct=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new C(i,t,m)})`
|
|
51
|
+
:host {
|
|
52
|
+
--shipaid-primary: #002bd6;
|
|
53
|
+
--shipaid-secondary: #0076ff;
|
|
54
|
+
--shipaid-danger: #f44336;
|
|
55
|
+
--shipaid-text: #000000;
|
|
56
|
+
--shipaid-text-muted: #cccccc;
|
|
57
|
+
--shipaid-text-grey: #aaaaaa;
|
|
58
|
+
--shipaid-light-grey: #ebecf0;
|
|
59
|
+
--shipaid-font: "Lato", sans-serif;
|
|
60
|
+
--shipaid-font-xs: 12px;
|
|
61
|
+
--shipaid-font-sm: 14px;
|
|
62
|
+
--shipaid-font-base: 16px;
|
|
63
|
+
--shipaid-font-lg: 18px;
|
|
64
|
+
--shipaid-font-regular: 400;
|
|
65
|
+
--shipaid-font-heavy: 700;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
* {
|
|
69
|
+
font-family: var(--shipaid-font);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.error {
|
|
73
|
+
color: var(--shipaid-danger);
|
|
74
|
+
font-size: var(--shipaid-font-sm);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Popups */
|
|
78
|
+
|
|
79
|
+
.shipaid-popup {
|
|
80
|
+
position: fixed;
|
|
81
|
+
top: 0;
|
|
82
|
+
bottom: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
right: 0;
|
|
85
|
+
margin: auto;
|
|
86
|
+
max-width: 500px;
|
|
87
|
+
max-height: 100vh;
|
|
88
|
+
height: fit-content;
|
|
89
|
+
border: var(--shipaid-light-grey) 1px solid;
|
|
90
|
+
background-color: #fff;
|
|
91
|
+
z-index: 10000;
|
|
92
|
+
overflow: auto;
|
|
93
|
+
visibility: hidden;
|
|
94
|
+
opacity: 0;
|
|
95
|
+
transition: all 250ms ease-in-out;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.shipaid-popup.active {
|
|
99
|
+
visibility: visible;
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (max-width: 600px) {
|
|
104
|
+
.shipaid-popup {
|
|
105
|
+
width: 100vw;
|
|
106
|
+
height: 100vh;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.shipaid-popup .popup {
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 1rem;
|
|
114
|
+
padding: 5rem;
|
|
115
|
+
height: fit-content;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (max-width: 600px) {
|
|
119
|
+
.shipaid-popup .popup {
|
|
120
|
+
padding: 3rem;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.popup .popup-close {
|
|
125
|
+
width: fit-content;
|
|
126
|
+
margin-left: auto;
|
|
127
|
+
background-color: transparent;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
border: none;
|
|
130
|
+
font-family: var(--shipaid-font);
|
|
131
|
+
font-weight: var(--shipaid-font-heavy);
|
|
132
|
+
text-transform: uppercase;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.popup .popup-title {
|
|
136
|
+
font-size: clamp(1rem, 2vw + 1rem, 2.2rem);
|
|
137
|
+
letter-spacing: 1px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.popup .popup-top-image {
|
|
141
|
+
margin: 0 auto;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.popup p {
|
|
145
|
+
font-size: clamp(1rem, 1vw + 1rem, 1.4rem);
|
|
146
|
+
margin: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.popup .popup-disclaimer {
|
|
150
|
+
font-size: 10px;
|
|
151
|
+
color: var(--shipaid-text-muted);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.popup .popup-footer {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: row;
|
|
157
|
+
justify-content: space-between;
|
|
158
|
+
align-items: flex-start;
|
|
159
|
+
margin-top: 2rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media (max-width: 600px) {
|
|
163
|
+
.popup .popup-footer {
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.popup .popup-footer .footer-links {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: row;
|
|
171
|
+
gap: 2rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.popup .popup-footer .footer-links a {
|
|
175
|
+
font-family: var(--shipaid-font);
|
|
176
|
+
font-size: var(--shipaid-font-sm);
|
|
177
|
+
color: var(--shipaid-text-muted);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.popup .popup-footer .footer-date p {
|
|
181
|
+
font-family: var(--shipaid-font);
|
|
182
|
+
font-weight: var(--shipaid-font-heavy);
|
|
183
|
+
font-size: var(--shipaid-font-sm);
|
|
184
|
+
color: var(--shipaid-text);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Widget */
|
|
188
|
+
|
|
189
|
+
.shipaid-prompt {
|
|
190
|
+
width: 400px;
|
|
191
|
+
max-width: 100%;
|
|
192
|
+
font-family: var(--shipaid-font);
|
|
193
|
+
font-size: var(--shipaid-font-base);
|
|
194
|
+
color: var(--shipaid-text);
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
gap: 1rem;
|
|
198
|
+
margin: 2rem 0px 4rem auto;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@media (max-width: 600px) {
|
|
202
|
+
.shipaid-prompt {
|
|
203
|
+
width: 100%;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.shipaid-prompt p,
|
|
208
|
+
.shipaid-prompt a {
|
|
209
|
+
margin: 0;
|
|
210
|
+
line-height: 1;
|
|
211
|
+
}
|
|
212
|
+
.shipaid-prompt .prompt-title {
|
|
213
|
+
text-align: center;
|
|
214
|
+
font-size: var(--shipaid-font-lg);
|
|
215
|
+
font-weight: var(--shipaid-font-heavy);
|
|
216
|
+
}
|
|
217
|
+
.shipaid-prompt .prompt-product {
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-direction: row;
|
|
220
|
+
gap: 1.2rem;
|
|
221
|
+
height: 55px;
|
|
222
|
+
margin-top: 1rem;
|
|
223
|
+
}
|
|
224
|
+
.shipaid-prompt .prompt-product .prompt-product-image {
|
|
225
|
+
position: relative;
|
|
226
|
+
}
|
|
227
|
+
.shipaid-prompt .prompt-product .prompt-product-image svg {
|
|
228
|
+
height: 35px;
|
|
229
|
+
width: auto;
|
|
230
|
+
}
|
|
231
|
+
.shipaid-prompt
|
|
232
|
+
.prompt-product
|
|
233
|
+
.prompt-product-details
|
|
234
|
+
.prompt-product-details-title {
|
|
235
|
+
font-size: var(--shipaid-font-sm);
|
|
236
|
+
font-weight: var(--shipaid-font-heavy);
|
|
237
|
+
}
|
|
238
|
+
.shipaid-prompt
|
|
239
|
+
.prompt-product
|
|
240
|
+
.prompt-product-details
|
|
241
|
+
.prompt-product-details-description {
|
|
242
|
+
font-size: var(--shipaid-font-xs);
|
|
243
|
+
margin-top: 0.65rem;
|
|
244
|
+
}
|
|
245
|
+
.shipaid-prompt .prompt-product .prompt-product-actions {
|
|
246
|
+
margin-left: auto;
|
|
247
|
+
display: flex;
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
justify-content: space-between;
|
|
250
|
+
text-align: right;
|
|
251
|
+
}
|
|
252
|
+
.shipaid-prompt
|
|
253
|
+
.prompt-product
|
|
254
|
+
.prompt-product-actions
|
|
255
|
+
.prompt-product-actions-price {
|
|
256
|
+
color: var(--shipaid-text-muted);
|
|
257
|
+
font-size: var(--shipaid-font-base);
|
|
258
|
+
}
|
|
259
|
+
.shipaid-prompt
|
|
260
|
+
.prompt-product
|
|
261
|
+
.prompt-product-actions
|
|
262
|
+
.prompt-product-actions-button {
|
|
263
|
+
background-color: transparent;
|
|
264
|
+
border: none;
|
|
265
|
+
color: var(--shipaid-primary);
|
|
266
|
+
text-transform: uppercase;
|
|
267
|
+
font-weight: var(--shipaid-font-heavy);
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
}
|
|
270
|
+
.shipaid-prompt .prompt-footer {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: row;
|
|
273
|
+
justify-content: flex-end;
|
|
274
|
+
align-items: center;
|
|
275
|
+
}
|
|
276
|
+
.shipaid-prompt .prompt-footer .prompt-footer-about {
|
|
277
|
+
color: var(--shipaid-text);
|
|
278
|
+
cursor: pointer;
|
|
279
|
+
font-size: 10px;
|
|
280
|
+
background-color: transparent;
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
border: 1px solid var(--shipaid-text);
|
|
283
|
+
border-radius: 10px;
|
|
284
|
+
margin-left: 0.5rem;
|
|
285
|
+
}
|
|
286
|
+
.shipaid-prompt .prompt-footer .prompt-footer-badge {
|
|
287
|
+
background-color: var(--shipaid-light-grey);
|
|
288
|
+
color: var(--shipaid-text);
|
|
289
|
+
padding: 0.5rem 1.5rem;
|
|
290
|
+
border-radius: 30px;
|
|
291
|
+
cursor: pointer;
|
|
292
|
+
text-decoration: none;
|
|
293
|
+
font-size: var(--shipaid-font-xs);
|
|
294
|
+
display: inline-flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
gap: 0.8rem;
|
|
297
|
+
}
|
|
298
|
+
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
299
|
+
height: 9px;
|
|
300
|
+
}
|
|
301
|
+
.shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
|
|
302
|
+
text-transform: uppercase;
|
|
303
|
+
color: var(--shipaid-secondary);
|
|
304
|
+
font-weight: var(--shipaid-font-heavy);
|
|
305
|
+
}
|
|
306
|
+
.shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
|
|
307
|
+
text-transform: uppercase;
|
|
308
|
+
color: var(--shipaid-text-grey);
|
|
309
|
+
font-weight: var(--shipaid-font-heavy);
|
|
310
|
+
}
|
|
311
|
+
`,_t=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(_t||{}),yt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,wt=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?Lt(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&&yt(e,i,s),s};const $t=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.")}},At=t=>console.warn(`[ShipAid] ${t}`),bt=t=>console.error(`[ShipAid] ${t}`),St="shipaid-protection";t.ShipAidWidget=class extends ct{constructor(){var t;super(...arguments),this.disablePolling=!1,this.pollingInterval=2500,this.disableRefresh=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._shouldShowWidget=!0,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>$t(t),post:(t,e)=>$t(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}get shouldRefreshOnUpdate(){var t;return!(null==(t=window.Shopify)||!t.Checkout)||!(this.disablePolling||this.disableRefresh)}get planActive(){var t,e;return!(null==(t=window.Shopify)||!t.designMode)||!(null==(e=this._store)||!e.planActive)}_currencyFormat(t){var e,i,o,r,s;return new Intl.NumberFormat(null!=(i=null==(e=window.Shopify)?void 0:e.locale)?i:void 0,{currency:(null==(o=this._store)?void 0:o.currency)||(null==(s=null==(r=window.Shopify)?void 0:r.currency)?void 0:s.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(_t.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){var e,i,o,r,s;if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing store settings.");const n=null==(e=this._store)?void 0:e.protectionSettings;if(!n||!n.product)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const a=((null==(i=this._store)?void 0:i.excludedProductSkus)&&t.items?t.items.reduce(((t,e)=>e.sku&&this._store.excludedProductSkus.find((t=>t===e.sku))?t-e.final_price:t),t.total_price):t.total_price)-(null!=(r=null==(o=t.items)?void 0:o.filter((t=>{var e,i,o;return null==(o=null==(i=null==(e=n.product)?void 0:e.variants)?void 0:i.edges)?void 0:o.some((({node:e})=>{var i;return null==(i=null==e?void 0:e.id)?void 0:i.includes(t.variant_id.toString())}))})))?r:[]).reduce(((t,e)=>t+e.final_line_price),0);if("FIXED"===n.protectionType){if(!n.defaultFee)throw new Error("Missing default fee amount.");if(null==(s=n.rules)||!s.length)return n.defaultFee;const t=a/100,e=n.rules.sort(((t,e)=>t.rangeLower&&e.rangeLower?t.rangeLower-e.rangeLower:0)).find((e=>{const i=Boolean(e.rangeLower&&e.rangeLower<t);return e.rangeUpper?i&&e.rangeUpper>=t:i}));return"number"==typeof(null==e?void 0:e.fee)?e.fee:n.defaultFee}if("PERCENTAGE"===n.protectionType){const t=a*n.percentage/100;return t>=n.minimumFee?t:n.minimumFee}throw new Error("No protection type handler found for this store.")}_findProtectionVariant(t){var e,i,o;const r=null==(e=this._store)?void 0:e.protectionSettings;if(!r||null==(o=null==(i=r.product)?void 0:i.variants)||!o.edges)throw new Error("Missing product and variants from protection settings.");const s=r.product.variants.edges.flatMap((({node:t})=>{if(!t||!t.price)return[];const e=Number(t.price);return[p(l({},t),{formattedPrice:e})]})).sort(((t,e)=>t.formattedPrice-e.formattedPrice));return s.find((e=>e.formattedPrice>=t))||s[s.length-1]}_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;const o=null==(t=window.Shopify)?void 0:t.shop;if(!o)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const r={query:"query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetShowCart\n excludedProductSkus\n protectionSettings\n }\n}",variables:{store:o}},s=await this._fetch.post(t.toString(),r);if(!s)throw new Error("Missing response for store query.");if(null!=(e=s.errors)&&e.length)throw new Error(s.errors[0].message);if(null==(i=s.data)||!i.store)throw new Error("Missing store from store query response.");return s.data.store}catch(r){throw console.error(r),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(X){throw bt(X.message),new Error("Could not fetch cart 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)||!t.items)throw new Error("Cart has not been loaded.");if(null==(e=this._protectionVariant)||!e.id)throw new Error("No protection variant found.");this._setState("loading");const i={id:this._protectionVariant.id.replace("gid://shopify/ProductVariant/",""),quantity:1,sections:"main-cart-items,main-cart-footer"},o=await this._fetch.post("/cart/add.js",i);await this._handleRefresh(o),this._lastAction="added",this._setState("success")}catch(i){bt(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={id:this._protectionCartItem.key,quantity:0,sections:"main-cart-items,main-cart-footer"},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._lastAction="removed",this._cart=e,this._setState("success")}catch(X){bt(X.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}render(){var t;((t,e)=>{mt(t,e,[])})(this,(async()=>{var t,e;const i=document.createElement("link");i.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),i.setAttribute("rel","stylesheet"),document.head.appendChild(i);try{const t=sessionStorage.getItem(St),{lastAction:e}=t?JSON.parse(t):{};e&&(this._lastAction=e)}catch{At("Failed to parse local storage.")}try{const[t,e]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=t,this._cart=e}catch{return this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)}return this.planActive?null!=(e=null==(t=this._store)?void 0:t.protectionSettings)&&e.protectionType?(this._hasFinishedSetup=!0,this._shouldShowWidget=!0,this._dispatchEvent(_t.LOADED,this._store),setTimeout((async()=>{var t,e;const i=sessionStorage.getItem(St),{lastAction:o}=i?JSON.parse(i):{};"removed"!==o&&!this._hasProtectionInCart&&(null==(t=this._cart)?void 0:t.item_count)&&(null==(e=this._store)?void 0:e.widgetAutoOptIn)&&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))):(At("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(At("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))})),mt(this,(()=>{const t={hasProtection:this._hasProtectionInCart,lastAction:this._lastAction};sessionStorage.setItem(St,JSON.stringify(t))}),[this._lastAction]),mt(this,(async()=>{var t,e,i,o,r;if(this._cartLastUpdated=new Date,null==(t=this._cart)||!t.items)return;const s=null!=(i=null==(e=this._cart.items)?void 0:e.findIndex((t=>{var e,i,o,r,s;return null==(s=null==(r=null==(o=null==(i=null==(e=this._store)?void 0:e.protectionSettings)?void 0:i.product)?void 0:o.variants)?void 0:r.edges)?void 0:s.some((({node:e})=>{var i;return null==(i=null==e?void 0:e.id)?void 0:i.includes(t.variant_id.toString())}))})))?i:[],n=null==(o=this._cart)?void 0:o.items[s];if(this._hasProtectionInCart=!!n,1===this._cart.item_count&&n){const t={id:n.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const a=await this.calculateProtectionTotal(this._cart),d=this._findProtectionVariant(a);if(this._protectionVariant=d,null==d||!d.id)return this._shouldShowWidget=!1,void bt("No matching protection variant found.");if(!n)return;if(null!=(r=d.id)&&r.includes(n.id.toString()))return void(this._protectionCartItem=p(l({},n),{index:s,position:s+1}));const h={id:n.key,quantity:0};await this._fetch.post("/cart/change.js",h);const c={id:d.id.replace("gid://shopify/ProductVariant/",""),quantity:1,sections:"main-cart-items"},u=await this._fetch.post("/cart/add.js",c);await this._handleRefresh(u)}),[this._store,this._cart]);const e=q`
|
|
312
|
+
<div class=${`shipaid-popup ${"learn-more"===this._popup&&"active"}`}>
|
|
313
|
+
<div class="popup">
|
|
314
|
+
<button
|
|
315
|
+
class="popup-close"
|
|
316
|
+
@click=${()=>{this._popup=null}}
|
|
317
|
+
>
|
|
318
|
+
Close
|
|
319
|
+
</button>
|
|
320
|
+
<p class="popup-title">Instant Package Protection</p>
|
|
321
|
+
<p>
|
|
322
|
+
We empower your favorite brands to protect their packages, because
|
|
323
|
+
every order is precious!
|
|
324
|
+
</p>
|
|
325
|
+
<img
|
|
326
|
+
src="https://res.cloudinary.com/dxyz34kfj/image/upload/v1660782754/shipaid-image_hoz6k8.jpg"
|
|
327
|
+
alt="shipaid protected parcel"
|
|
328
|
+
height="auto"
|
|
329
|
+
width="90%"
|
|
330
|
+
class="popup-top-image"
|
|
331
|
+
/>
|
|
332
|
+
<p class="popup-title">Shop Worry-Free</p>
|
|
333
|
+
<p>
|
|
334
|
+
Brands and shipment carriers cannot always guarantee your order will
|
|
335
|
+
arrive at your doorstep safely. Things happen! We allow the brand
|
|
336
|
+
you are purchasing from to protect your order in the chance of an
|
|
337
|
+
issue in transit. If you encounter an issue, simply reach out to the
|
|
338
|
+
brand and they will handle your claim as soon as possible
|
|
339
|
+
</p>
|
|
340
|
+
<p class="popup-disclaimer">
|
|
341
|
+
By purchasing this protection, you are agreeing to our Terms Of
|
|
342
|
+
Service and Privacy Policy. You are not obligated to purchase this
|
|
343
|
+
protection. This protection is NOT insurance. Purchasing this
|
|
344
|
+
protection does not guarantee you will be reimbursed for any product
|
|
345
|
+
or shipping costs. The claim process and decision for compensation
|
|
346
|
+
is strictly decided by the brand you a purchasing from.
|
|
347
|
+
</p>
|
|
348
|
+
<div class="popup-footer">
|
|
349
|
+
<div class="footer-links">
|
|
350
|
+
<a
|
|
351
|
+
href="https://www.shipaid.com/terms-of-service"
|
|
352
|
+
target="_blank"
|
|
353
|
+
rel="noreferrer"
|
|
354
|
+
>Terms of Service</a
|
|
355
|
+
>
|
|
356
|
+
<a
|
|
357
|
+
href="https://www.shipaid.com/privacy-policy"
|
|
358
|
+
target="_blank"
|
|
359
|
+
rel="noreferrer"
|
|
360
|
+
>Privacy Policy</a
|
|
361
|
+
>
|
|
362
|
+
</div>
|
|
363
|
+
<div class="footer-date">
|
|
364
|
+
<p>ShipAid © ${(new Date).getFullYear()}</p>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
`,i=q`
|
|
370
|
+
<div class="shipaid-prompt">
|
|
371
|
+
<div class="prompt-product">
|
|
372
|
+
<div class="prompt-product-image">
|
|
373
|
+
${gt(this._hasProtectionInCart,(()=>q`<svg
|
|
374
|
+
viewBox="0 0 384 383.999986"
|
|
375
|
+
preserveAspectRatio="xMidYMid meet"
|
|
376
|
+
>
|
|
377
|
+
<defs>
|
|
378
|
+
<clipPath id="id1">
|
|
379
|
+
<path
|
|
380
|
+
d="M 22.078125 0.753906 L 361.777344 0.753906 L 361.777344 383.4375 L 22.078125 383.4375 Z M 22.078125 0.753906 "
|
|
381
|
+
clip-rule="nonzero"
|
|
382
|
+
/>
|
|
383
|
+
</clipPath>
|
|
384
|
+
<clipPath id="id2">
|
|
385
|
+
<path
|
|
386
|
+
d="M 37.261719 0 L 347.011719 0 L 347.011719 353 L 37.261719 353 Z M 37.261719 0 "
|
|
387
|
+
clip-rule="nonzero"
|
|
388
|
+
/>
|
|
389
|
+
</clipPath>
|
|
390
|
+
</defs>
|
|
391
|
+
<g clip-path="url(#id1)">
|
|
392
|
+
<path
|
|
393
|
+
fill="#2e343d"
|
|
394
|
+
d="M 351.222656 50.539062 L 196.8125 1.5 C 193.632812 0.484375 190.222656 0.484375 187.042969 1.5 L 32.632812 50.539062 C 26.390625 52.28125 22.078125 57.988281 22.078125 64.484375 C 24.226562 117.867188 39.199219 277.527344 39.199219 277.527344 C 39.679688 283.640625 42.972656 289.175781 48.125 292.507812 L 186.605469 381.867188 C 189.839844 383.957031 194.015625 383.957031 197.253906 381.867188 L 335.730469 292.507812 C 340.882812 289.175781 344.175781 283.640625 344.65625 277.527344 C 344.65625 277.527344 359.632812 117.867188 361.777344 64.484375 C 361.777344 57.988281 357.46875 52.28125 351.222656 50.539062 "
|
|
395
|
+
fill-opacity="1"
|
|
396
|
+
fill-rule="nonzero"
|
|
397
|
+
/>
|
|
398
|
+
</g>
|
|
399
|
+
<path
|
|
400
|
+
fill="#ffffff"
|
|
401
|
+
d="M 292.539062 118.640625 C 291.910156 117.488281 291.085938 116.351562 289.371094 115.484375 L 264.84375 101.324219 C 264.503906 101.132812 264.140625 100.984375 263.753906 100.886719 C 263.632812 100.855469 263.511719 100.855469 263.378906 100.835938 C 263.125 100.792969 262.871094 100.746094 262.617188 100.75 L 262.570312 100.746094 L 262.570312 100.757812 C 261.84375 100.773438 261.128906 100.96875 260.5 101.328125 L 205.3125 133.175781 L 205.265625 133.078125 L 200.8125 135.65625 C 195.441406 138.75 188.832031 138.75 183.460938 135.65625 L 159.335938 121.738281 C 158 120.960938 157.171875 119.53125 157.171875 117.980469 C 157.171875 116.429688 158 115 159.335938 114.222656 L 183.460938 100.3125 C 188.832031 97.214844 195.441406 97.214844 200.8125 100.3125 L 206.621094 103.664062 C 207.964844 104.4375 209.609375 104.4375 210.953125 103.664062 L 233.421875 90.703125 C 234.765625 89.929688 235.585938 88.5 235.585938 86.949219 C 235.585938 85.402344 234.765625 83.96875 233.421875 83.195312 L 200.8125 64.375 C 195.441406 61.28125 188.832031 61.28125 183.460938 64.375 L 103.578125 110.472656 C 97.796875 113.8125 97.796875 122.148438 103.578125 125.484375 L 183.460938 171.582031 C 188.832031 174.679688 195.441406 174.679688 200.8125 171.582031 L 262.570312 135.945312 L 262.570312 217.125 L 242.726562 228.609375 L 200.8125 252.867188 C 199.480469 253.628906 198.066406 254.210938 196.589844 254.609375 C 192.160156 255.785156 187.441406 255.15625 183.460938 252.867188 L 126.035156 219.734375 C 123.351562 218.1875 121.699219 215.320312 121.699219 212.226562 L 121.699219 164.90625 C 121.699219 163.359375 120.871094 161.921875 119.53125 161.160156 L 97.070312 148.183594 C 95.726562 147.410156 94.074219 147.410156 92.730469 148.183594 C 91.390625 148.957031 90.5625 150.394531 90.5625 151.945312 L 90.5625 230.195312 C 90.5625 233.292969 92.21875 236.144531 94.902344 237.703125 L 183.460938 288.808594 C 186.0625 290.308594 189.015625 291.09375 192.015625 291.117188 L 192.078125 291.117188 C 192.5 291.117188 192.921875 291.070312 193.347656 291.046875 C 193.671875 291.019531 194 291.019531 194.328125 290.984375 C 194.773438 290.925781 195.222656 290.816406 195.65625 290.730469 C 195.960938 290.660156 196.261719 290.621094 196.554688 290.550781 C 197.039062 290.429688 197.496094 290.246094 197.957031 290.078125 C 198.222656 289.980469 198.476562 289.921875 198.71875 289.824219 C 199.433594 289.535156 200.132812 289.195312 200.800781 288.808594 L 277.210938 244.71875 L 289.320312 237.851562 C 292.03125 236.3125 293.714844 233.4375 293.714844 230.316406 L 293.714844 122.980469 C 293.714844 121.433594 293.289062 119.941406 292.539062 118.640625 "
|
|
402
|
+
fill-opacity="1"
|
|
403
|
+
fill-rule="nonzero"
|
|
404
|
+
/>
|
|
405
|
+
<g clip-path="url(#id2)">
|
|
406
|
+
<path
|
|
407
|
+
fill="#2e343d"
|
|
408
|
+
d="M 200.59375 38.453125 C 198.015625 36.96875 195.113281 36.175781 192.136719 36.148438 C 189.171875 36.175781 186.257812 36.972656 183.679688 38.453125 L 76.964844 100.03125 C 71.613281 103.121094 68.316406 108.828125 68.3125 115.003906 L 68.3125 238.167969 C 68.3125 244.347656 71.609375 250.054688 76.964844 253.140625 L 183.679688 314.714844 C 186.292969 316.226562 189.246094 317.023438 192.257812 317.035156 C 195.269531 317.023438 198.234375 316.226562 200.847656 314.726562 L 307.09375 253.417969 C 312.441406 250.332031 315.746094 244.625 315.746094 238.445312 L 315.746094 202.859375 C 315.734375 201.308594 316.570312 199.882812 317.898438 199.109375 L 340.527344 186.0625 C 341.855469 185.285156 343.515625 185.285156 344.847656 186.0625 C 346.1875 186.835938 347.011719 188.261719 347.011719 189.808594 L 347.011719 256.089844 C 347 258.917969 346.296875 261.699219 344.96875 264.191406 C 344.628906 265.824219 342.847656 267.746094 340.332031 269.71875 C 340.285156 269.765625 340.210938 269.8125 340.152344 269.863281 C 333.761719 274.832031 323.1875 279.960938 321.3125 281.046875 L 200.847656 350.558594 C 198.148438 352.105469 195.078125 352.902344 191.96875 352.867188 L 191.835938 352.867188 L 191.835938 352.855469 C 188.964844 352.78125 186.160156 351.984375 183.679688 350.558594 L 45.914062 271.058594 C 40.558594 267.976562 37.261719 262.269531 37.261719 256.089844 L 37.261719 97.09375 C 37.261719 94.320312 37.613281 91.492188 38.832031 89.097656 C 39 88.476562 40.667969 85.421875 44.109375 82.910156 C 45.40625 82.039062 47.699219 80.863281 49.847656 79.621094 L 183.292969 2.625 C 185.980469 1.078125 189.039062 0.28125 192.136719 0.320312 C 195.246094 0.28125 198.296875 1.078125 200.984375 2.625 L 324.121094 73.667969 C 324.398438 73.839844 324.617188 74.042969 324.859375 74.238281 L 326.417969 75.132812 C 330.605469 77.351562 337.164062 80.730469 340.722656 83.429688 L 341.011719 83.648438 C 341.058594 83.6875 341.109375 83.722656 341.15625 83.753906 C 341.277344 83.859375 341.363281 83.960938 341.484375 84.070312 C 342.789062 85.164062 343.902344 86.445312 344.761719 87.878906 C 344.785156 87.898438 344.800781 87.921875 344.824219 87.945312 L 344.8125 87.949219 C 346.25 90.351562 347.011719 93.097656 347.011719 95.894531 L 347.011719 154.113281 C 347.011719 155.660156 346.191406 157.085938 344.847656 157.859375 L 322.222656 170.921875 C 320.890625 171.683594 319.230469 171.683594 317.902344 170.921875 C 316.558594 170.144531 315.734375 168.71875 315.734375 167.171875 L 315.734375 114.671875 C 315.734375 108.484375 312.433594 102.773438 307.070312 99.6875 L 200.597656 38.453125 L 200.597656 38.457031 Z M 200.59375 38.453125 "
|
|
409
|
+
fill-opacity="1"
|
|
410
|
+
fill-rule="nonzero"
|
|
411
|
+
/>
|
|
412
|
+
</g>
|
|
413
|
+
</svg>`),(()=>q`<svg
|
|
414
|
+
viewBox="0 0 384 383.999986"
|
|
415
|
+
preserveAspectRatio="xMidYMid meet"
|
|
416
|
+
>
|
|
417
|
+
<defs>
|
|
418
|
+
<clipPath id="id1">
|
|
419
|
+
<path
|
|
420
|
+
d="M 22.078125 0.753906 L 361.777344 0.753906 L 361.777344 383.4375 L 22.078125 383.4375 Z M 22.078125 0.753906 "
|
|
421
|
+
clip-rule="nonzero"
|
|
422
|
+
/>
|
|
423
|
+
</clipPath>
|
|
424
|
+
<clipPath id="id2">
|
|
425
|
+
<path
|
|
426
|
+
d="M 37.261719 0 L 347.011719 0 L 347.011719 353 L 37.261719 353 Z M 37.261719 0 "
|
|
427
|
+
clip-rule="nonzero"
|
|
428
|
+
/>
|
|
429
|
+
</clipPath>
|
|
430
|
+
</defs>
|
|
431
|
+
<g clip-path="url(#id1)">
|
|
432
|
+
<path
|
|
433
|
+
fill="#0056d6"
|
|
434
|
+
d="M 351.222656 50.539062 L 196.8125 1.5 C 193.632812 0.484375 190.222656 0.484375 187.042969 1.5 L 32.632812 50.539062 C 26.390625 52.28125 22.078125 57.988281 22.078125 64.484375 C 24.226562 117.867188 39.199219 277.527344 39.199219 277.527344 C 39.679688 283.640625 42.972656 289.175781 48.125 292.507812 L 186.605469 381.867188 C 189.839844 383.957031 194.015625 383.957031 197.253906 381.867188 L 335.730469 292.507812 C 340.882812 289.175781 344.175781 283.640625 344.65625 277.527344 C 344.65625 277.527344 359.632812 117.867188 361.777344 64.484375 C 361.777344 57.988281 357.46875 52.28125 351.222656 50.539062 "
|
|
435
|
+
fill-opacity="1"
|
|
436
|
+
fill-rule="nonzero"
|
|
437
|
+
/>
|
|
438
|
+
</g>
|
|
439
|
+
<path
|
|
440
|
+
fill="#ffffff"
|
|
441
|
+
d="M 292.539062 118.640625 C 291.910156 117.488281 291.085938 116.351562 289.371094 115.484375 L 264.84375 101.324219 C 264.503906 101.132812 264.140625 100.984375 263.753906 100.886719 C 263.632812 100.855469 263.511719 100.855469 263.378906 100.835938 C 263.125 100.792969 262.871094 100.746094 262.617188 100.75 L 262.570312 100.746094 L 262.570312 100.757812 C 261.84375 100.773438 261.128906 100.96875 260.5 101.328125 L 205.3125 133.175781 L 205.265625 133.078125 L 200.8125 135.65625 C 195.441406 138.75 188.832031 138.75 183.460938 135.65625 L 159.335938 121.738281 C 158 120.960938 157.171875 119.53125 157.171875 117.980469 C 157.171875 116.429688 158 115 159.335938 114.222656 L 183.460938 100.3125 C 188.832031 97.214844 195.441406 97.214844 200.8125 100.3125 L 206.621094 103.664062 C 207.964844 104.4375 209.609375 104.4375 210.953125 103.664062 L 233.421875 90.703125 C 234.765625 89.929688 235.585938 88.5 235.585938 86.949219 C 235.585938 85.402344 234.765625 83.96875 233.421875 83.195312 L 200.8125 64.375 C 195.441406 61.28125 188.832031 61.28125 183.460938 64.375 L 103.578125 110.472656 C 97.796875 113.8125 97.796875 122.148438 103.578125 125.484375 L 183.460938 171.582031 C 188.832031 174.679688 195.441406 174.679688 200.8125 171.582031 L 262.570312 135.945312 L 262.570312 217.125 L 242.726562 228.609375 L 200.8125 252.867188 C 199.480469 253.628906 198.066406 254.210938 196.589844 254.609375 C 192.160156 255.785156 187.441406 255.15625 183.460938 252.867188 L 126.035156 219.734375 C 123.351562 218.1875 121.699219 215.320312 121.699219 212.226562 L 121.699219 164.90625 C 121.699219 163.359375 120.871094 161.921875 119.53125 161.160156 L 97.070312 148.183594 C 95.726562 147.410156 94.074219 147.410156 92.730469 148.183594 C 91.390625 148.957031 90.5625 150.394531 90.5625 151.945312 L 90.5625 230.195312 C 90.5625 233.292969 92.21875 236.144531 94.902344 237.703125 L 183.460938 288.808594 C 186.0625 290.308594 189.015625 291.09375 192.015625 291.117188 L 192.078125 291.117188 C 192.5 291.117188 192.921875 291.070312 193.347656 291.046875 C 193.671875 291.019531 194 291.019531 194.328125 290.984375 C 194.773438 290.925781 195.222656 290.816406 195.65625 290.730469 C 195.960938 290.660156 196.261719 290.621094 196.554688 290.550781 C 197.039062 290.429688 197.496094 290.246094 197.957031 290.078125 C 198.222656 289.980469 198.476562 289.921875 198.71875 289.824219 C 199.433594 289.535156 200.132812 289.195312 200.800781 288.808594 L 277.210938 244.71875 L 289.320312 237.851562 C 292.03125 236.3125 293.714844 233.4375 293.714844 230.316406 L 293.714844 122.980469 C 293.714844 121.433594 293.289062 119.941406 292.539062 118.640625 "
|
|
442
|
+
fill-opacity="1"
|
|
443
|
+
fill-rule="nonzero"
|
|
444
|
+
/>
|
|
445
|
+
<g clip-path="url(#id2)">
|
|
446
|
+
<path
|
|
447
|
+
fill="#0056d6"
|
|
448
|
+
d="M 200.59375 38.453125 C 198.015625 36.96875 195.113281 36.175781 192.136719 36.148438 C 189.171875 36.175781 186.257812 36.972656 183.679688 38.453125 L 76.964844 100.03125 C 71.613281 103.121094 68.316406 108.828125 68.3125 115.003906 L 68.3125 238.167969 C 68.3125 244.347656 71.609375 250.054688 76.964844 253.140625 L 183.679688 314.714844 C 186.292969 316.226562 189.246094 317.023438 192.257812 317.035156 C 195.269531 317.023438 198.234375 316.226562 200.847656 314.726562 L 307.09375 253.417969 C 312.441406 250.332031 315.746094 244.625 315.746094 238.445312 L 315.746094 202.859375 C 315.734375 201.308594 316.570312 199.882812 317.898438 199.109375 L 340.527344 186.0625 C 341.855469 185.285156 343.515625 185.285156 344.847656 186.0625 C 346.1875 186.835938 347.011719 188.261719 347.011719 189.808594 L 347.011719 256.089844 C 347 258.917969 346.296875 261.699219 344.96875 264.191406 C 344.628906 265.824219 342.847656 267.746094 340.332031 269.71875 C 340.285156 269.765625 340.210938 269.8125 340.152344 269.863281 C 333.761719 274.832031 323.1875 279.960938 321.3125 281.046875 L 200.847656 350.558594 C 198.148438 352.105469 195.078125 352.902344 191.96875 352.867188 L 191.835938 352.867188 L 191.835938 352.855469 C 188.964844 352.78125 186.160156 351.984375 183.679688 350.558594 L 45.914062 271.058594 C 40.558594 267.976562 37.261719 262.269531 37.261719 256.089844 L 37.261719 97.09375 C 37.261719 94.320312 37.613281 91.492188 38.832031 89.097656 C 39 88.476562 40.667969 85.421875 44.109375 82.910156 C 45.40625 82.039062 47.699219 80.863281 49.847656 79.621094 L 183.292969 2.625 C 185.980469 1.078125 189.039062 0.28125 192.136719 0.320312 C 195.246094 0.28125 198.296875 1.078125 200.984375 2.625 L 324.121094 73.667969 C 324.398438 73.839844 324.617188 74.042969 324.859375 74.238281 L 326.417969 75.132812 C 330.605469 77.351562 337.164062 80.730469 340.722656 83.429688 L 341.011719 83.648438 C 341.058594 83.6875 341.109375 83.722656 341.15625 83.753906 C 341.277344 83.859375 341.363281 83.960938 341.484375 84.070312 C 342.789062 85.164062 343.902344 86.445312 344.761719 87.878906 C 344.785156 87.898438 344.800781 87.921875 344.824219 87.945312 L 344.8125 87.949219 C 346.25 90.351562 347.011719 93.097656 347.011719 95.894531 L 347.011719 154.113281 C 347.011719 155.660156 346.191406 157.085938 344.847656 157.859375 L 322.222656 170.921875 C 320.890625 171.683594 319.230469 171.683594 317.902344 170.921875 C 316.558594 170.144531 315.734375 168.71875 315.734375 167.171875 L 315.734375 114.671875 C 315.734375 108.484375 312.433594 102.773438 307.070312 99.6875 L 200.597656 38.453125 L 200.597656 38.457031 Z M 200.59375 38.453125 "
|
|
449
|
+
fill-opacity="1"
|
|
450
|
+
fill-rule="nonzero"
|
|
451
|
+
/>
|
|
452
|
+
</g>
|
|
453
|
+
</svg>`))}
|
|
454
|
+
</div>
|
|
455
|
+
<div class="prompt-product-details">
|
|
456
|
+
<p class="prompt-product-details-title">
|
|
457
|
+
Instant Package Protection
|
|
458
|
+
</p>
|
|
459
|
+
<p class="prompt-product-details-description">
|
|
460
|
+
Resolve shipping issues care-free
|
|
461
|
+
</p>
|
|
462
|
+
</div>
|
|
463
|
+
<div class="prompt-product-actions">
|
|
464
|
+
<p class="prompt-product-actions-price">
|
|
465
|
+
${(null==(t=this._protectionVariant)?void 0:t.price)&&this._currencyFormat(this._protectionVariant.price)}
|
|
466
|
+
</p>
|
|
467
|
+
<button
|
|
468
|
+
class="prompt-product-actions-button"
|
|
469
|
+
@click=${this._updateProtection}
|
|
470
|
+
?disabled=${this._state.loading}
|
|
471
|
+
>
|
|
472
|
+
${this._state.loading?"Loading...":this._hasProtectionInCart?"Remove":"+ Add"}
|
|
473
|
+
</button>
|
|
474
|
+
</div>
|
|
475
|
+
</div>
|
|
476
|
+
${gt(this._state.error,(()=>q`<p class="error">${this._state.error}</p>`))}
|
|
477
|
+
<div class="prompt-footer">
|
|
478
|
+
<a
|
|
479
|
+
class="prompt-footer-badge"
|
|
480
|
+
@click=${()=>{this._popup="learn-more"}}
|
|
481
|
+
>
|
|
482
|
+
<span>Powered by</span>
|
|
483
|
+
<svg
|
|
484
|
+
viewBox="0 0 423 62"
|
|
485
|
+
version="1.1"
|
|
486
|
+
xml:space="preserve"
|
|
487
|
+
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
|
|
488
|
+
>
|
|
489
|
+
<g transform="matrix(1,0,0,1,-45.4439,-231.396)">
|
|
490
|
+
<g transform="matrix(1,0,0,1,41.8553,292.5)">
|
|
491
|
+
<g>
|
|
492
|
+
<path
|
|
493
|
+
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"
|
|
494
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
495
|
+
/>
|
|
496
|
+
</g>
|
|
497
|
+
</g>
|
|
498
|
+
<g transform="matrix(1,0,0,1,111.569,292.5)">
|
|
499
|
+
<g>
|
|
500
|
+
<path
|
|
501
|
+
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"
|
|
502
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
503
|
+
/>
|
|
504
|
+
</g>
|
|
505
|
+
</g>
|
|
506
|
+
<g transform="matrix(1,0,0,1,190.435,292.5)">
|
|
507
|
+
<g>
|
|
508
|
+
<path
|
|
509
|
+
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"
|
|
510
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
511
|
+
/>
|
|
512
|
+
</g>
|
|
513
|
+
</g>
|
|
514
|
+
<g transform="matrix(1,0,0,1,232.067,292.5)">
|
|
515
|
+
<g>
|
|
516
|
+
<path
|
|
517
|
+
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"
|
|
518
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
519
|
+
/>
|
|
520
|
+
</g>
|
|
521
|
+
</g>
|
|
522
|
+
<g transform="matrix(1,0,0,1,298.418,292.5)">
|
|
523
|
+
<g>
|
|
524
|
+
<path
|
|
525
|
+
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"
|
|
526
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
527
|
+
/>
|
|
528
|
+
</g>
|
|
529
|
+
</g>
|
|
530
|
+
<g transform="matrix(1,0,0,1,373.874,292.5)">
|
|
531
|
+
<g>
|
|
532
|
+
<path
|
|
533
|
+
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"
|
|
534
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
535
|
+
/>
|
|
536
|
+
</g>
|
|
537
|
+
</g>
|
|
538
|
+
<g transform="matrix(1,0,0,1,412.904,292.5)">
|
|
539
|
+
<g>
|
|
540
|
+
<path
|
|
541
|
+
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"
|
|
542
|
+
style="fill:rgb(47,52,61);fill-rule:nonzero;"
|
|
543
|
+
/>
|
|
544
|
+
</g>
|
|
545
|
+
</g>
|
|
546
|
+
<path
|
|
547
|
+
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"
|
|
548
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
549
|
+
/>
|
|
550
|
+
<path
|
|
551
|
+
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"
|
|
552
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
553
|
+
/>
|
|
554
|
+
<path
|
|
555
|
+
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"
|
|
556
|
+
style="fill:white;fill-rule:nonzero;"
|
|
557
|
+
/>
|
|
558
|
+
<path
|
|
559
|
+
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"
|
|
560
|
+
style="fill:rgb(0,86,214);fill-rule:nonzero;"
|
|
561
|
+
/>
|
|
562
|
+
</g>
|
|
563
|
+
</svg>
|
|
564
|
+
</a>
|
|
565
|
+
<button
|
|
566
|
+
class="prompt-footer-about"
|
|
567
|
+
@click=${()=>{this._popup="learn-more"}}
|
|
568
|
+
>
|
|
569
|
+
i
|
|
570
|
+
</button>
|
|
571
|
+
</div>
|
|
572
|
+
</div>
|
|
573
|
+
`;return q`
|
|
574
|
+
<div class="shipaid">
|
|
575
|
+
${gt(this._hasFinishedSetup,(()=>{var t;return gt(this._shouldShowWidget&&this.planActive&&(null==(t=this._store)?void 0:t.widgetShowCart),(()=>[e,i]),(()=>q``))}),(()=>q`<p><slot>Loading ShipAid Widget...</slot></p>`))}
|
|
576
|
+
</div>
|
|
577
|
+
`}},t.ShipAidWidget.styles=Ct,wt([h({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disablePolling",2),wt([h({type:Number,attribute:!0})],t.ShipAidWidget.prototype,"pollingInterval",2),wt([h({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableRefresh",2),wt([c()],t.ShipAidWidget.prototype,"_storeDomain",2),wt([c()],t.ShipAidWidget.prototype,"_store",2),wt([c()],t.ShipAidWidget.prototype,"_cart",2),wt([c()],t.ShipAidWidget.prototype,"_cartLastUpdated",2),wt([c()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),wt([c()],t.ShipAidWidget.prototype,"_shouldShowWidget",2),wt([c()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),wt([c()],t.ShipAidWidget.prototype,"_lastAction",2),wt([c()],t.ShipAidWidget.prototype,"_protectionCartItem",2),wt([c()],t.ShipAidWidget.prototype,"_protectionVariant",2),wt([c()],t.ShipAidWidget.prototype,"_state",2),wt([c()],t.ShipAidWidget.prototype,"_popup",2),t.ShipAidWidget=wt([(t=>e=>{return"function"==typeof e?(i=t,o=e,customElements.define(i,o),o):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){customElements.define(t,e)}}})(t,e);var i,o})("shipaid-widget")],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from
|
|
2
|
-
import type { ShopifyCart } from
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { ShopifyCart } from '../types/shopify';
|
|
3
3
|
/**
|
|
4
4
|
* ShipAid Widget.
|
|
5
5
|
*
|
|
@@ -80,6 +80,6 @@ export declare class ShipAidWidget extends LitElement {
|
|
|
80
80
|
}
|
|
81
81
|
declare global {
|
|
82
82
|
interface HTMLElementTagNameMap {
|
|
83
|
-
|
|
83
|
+
'shipaid-widget': ShipAidWidget;
|
|
84
84
|
}
|
|
85
85
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui.shipaid.com",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
7
|
-
"unpkg": "dist/
|
|
8
|
-
"module": "dist/
|
|
6
|
+
"main": "dist/widget.umd.js",
|
|
7
|
+
"unpkg": "dist/widget.iife.js",
|
|
8
|
+
"module": "dist/widget.es.js",
|
|
9
9
|
"exports": {
|
|
10
|
-
".": "./dist/
|
|
10
|
+
".": "./dist/widget.es.js"
|
|
11
11
|
},
|
|
12
12
|
"types": "dist-types/src/shipaid-widget.d.ts",
|
|
13
13
|
"files": [
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@typescript-eslint/eslint-plugin": "^5.35.1",
|
|
29
29
|
"@typescript-eslint/parser": "^5.35.1",
|
|
30
|
-
"eslint": "^
|
|
30
|
+
"eslint": "^8.23.0",
|
|
31
31
|
"eslint-config-standard": "^17.0.0",
|
|
32
32
|
"eslint-plugin-html": "^7.1.0",
|
|
33
33
|
"eslint-plugin-import": "^2.26.0",
|
|
34
34
|
"eslint-plugin-lit": "^1.6.1",
|
|
35
35
|
"eslint-plugin-lit-a11y": "^2.2.2",
|
|
36
|
-
"eslint-plugin-
|
|
37
|
-
"eslint-plugin-promise": "^
|
|
36
|
+
"eslint-plugin-n": "^15.2.5",
|
|
37
|
+
"eslint-plugin-promise": "^6.0.1",
|
|
38
38
|
"typescript": "^4.8.2",
|
|
39
39
|
"vite": "^2.9.15"
|
|
40
40
|
}
|