@htmlbricks/hb-page-checkout 0.6.21 → 0.6.23
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/package.json +3 -3
- package/release/release.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@htmlbricks/hb-page-checkout",
|
|
3
3
|
"displayName": "Svelte Page Payment WebComponent",
|
|
4
4
|
"description": "Svelte Page Payment WebComponent",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.23",
|
|
6
6
|
"main": "release/release.js",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepublish": "npm run build:release"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@htmlbricks/hb-jsutils": "^0.6.
|
|
30
|
+
"@htmlbricks/hb-jsutils": "^0.6.23",
|
|
31
31
|
"@rollup/plugin-alias": "^3.1.2",
|
|
32
32
|
"@rollup/plugin-commonjs": "^18.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"html5-webcomponents"
|
|
76
76
|
],
|
|
77
77
|
"contributors": [],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "b9b491d6a464d4116c77b7ee940be0d8e2e22b27"
|
|
79
79
|
}
|
package/release/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function l(){return t=" ",document.createTextNode(t);var t}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function u(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:m(t,e,n)}function h(t,e,n,i){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function f(t){const e={};for(const n of t)e[n.name]=n.value;return e}let b;function g(t){b=t}function y(){if(!b)throw new Error("Function called outside component initialization");return b}function w(){const t=y();return(e,n)=>{const i=t.$$.callbacks[e];if(i){const o=function(t,e,n=!1){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,!1,e),i}(e,n);i.slice().forEach((e=>{e.call(t,o)}))}}}const x=[],$=[],v=[],k=[],E=Promise.resolve();let C=!1;function S(t){v.push(t)}const _=new Set;let N=0;function O(){const t=b;do{for(;N<x.length;){const t=x[N];N++,g(t),J(t.$$)}for(g(null),x.length=0,N=0;$.length;)$.pop()();for(let t=0;t<v.length;t+=1){const e=v[t];_.has(e)||(_.add(e),e())}v.length=0}while(x.length);for(;k.length;)k.pop()();C=!1,_.clear(),g(t)}function J(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(S)}}const M=new Set;function j(t,e){-1===t.$$.dirty[0]&&(x.push(t),C||(C=!0,E.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(r,s,a,c,l,p,m,u=[-1]){const h=b;g(r);const f=r.$$={fragment:null,ctx:null,props:p,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:s.target||h.$$.root};m&&m(f.root);let y=!1;if(f.ctx=a?a(r,s.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return f.ctx&&l(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),y&&j(r,t)),e})):[],f.update(),y=!0,i(f.before_update),f.fragment=!!c&&c(f.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);f.fragment&&f.fragment.l(t),t.forEach(d)}else f.fragment&&f.fragment.c();s.intro&&((w=r.$$.fragment)&&w.i&&(M.delete(w),w.i(x))),function(t,n,r,s){const{fragment:a,on_mount:d,on_destroy:c,after_update:l}=t.$$;a&&a.m(n,r),s||S((()=>{const n=d.map(e).filter(o);c?c.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(S)}(r,s.target,s.anchor,s.customElement),O()}var w,x;g(h)}let R;"function"==typeof HTMLElement&&(R=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var A="0.6.21";function L(e){let n,o,r,f,b,g,y,w,x,$,v,k,E;return{c(){n=c("div"),o=c("div"),r=c("div"),f=c("hb-checkout"),w=l(),x=c("div"),$=c("hb-checkout-shopping-cart"),this.c=t,u(f,"completed",e[4]),u(f,"user",e[1]),u(f,"shipments",b=JSON.stringify(e[0])),u(f,"gateways",g=JSON.stringify(e[3])),u(f,"payment",y=JSON.stringify(e[2])),m(r,"class","col-7"),h(r,"padding-right","30px"),u($,"completed",e[4]),u($,"payment",v=JSON.stringify(e[2])),m(x,"class","col-5"),h(x,"padding-left","30px"),m(o,"class","row"),m(n,"class","container")},m(t,i){a(t,n,i),s(n,o),s(o,r),s(r,f),s(o,w),s(o,x),s(x,$),k||(E=[p(f,"paymentCompleted",e[10]),p(f,"saveUser",e[11]),p(f,"saveShipment",e[12])],k=!0)},p(t,[e]){16&e&&u(f,"completed",t[4]),2&e&&u(f,"user",t[1]),1&e&&b!==(b=JSON.stringify(t[0]))&&u(f,"shipments",b),8&e&&g!==(g=JSON.stringify(t[3]))&&u(f,"gateways",g),4&e&&y!==(y=JSON.stringify(t[2]))&&u(f,"payment",y),16&e&&u($,"completed",t[4]),4&e&&v!==(v=JSON.stringify(t[2]))&&u($,"payment",v)},i:t,o:t,d(t){t&&d(n),k=!1,i(E)}}}function F(t,e,n){var i;let{id:o}=e,{shipments:r}=e,{user:s}=e,{payment:a}=e,{gateways:d}=e,{completed:c}=e;const l={merchantName:"merchant",countryCode:"IT",total:0,currencyCode:"EUR",items:[]},p=y(),m=w();function u(t,e){m(t,e),p.dispatchEvent&&p.dispatchEvent(new CustomEvent(t,{detail:e}))}function h(t){if(!document.getElementById("hb-"+t+"-script")){const e=document.createElement("script");e.id="hb-"+t+"-script",e.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-${t}@${A}/release/release.js`,location.href.includes("localhost")&&(e.src=`http://localhost:6006/${t}/dist/release.js`),document.head.appendChild(e)}}function f(t){const e=r.findIndex((e=>e.id===t.id)),i=r[e];r.forEach((t=>t.selected=!1)),i.selected=!0,n(2,a.shipmentFee=i.price,a),console.log("sss",i,t)}function b(t){t.completed?(n(4,c="yes"),u("paymentCompleted",t)):console.warn(t)}h("checkout-shopping-cart"),h("checkout");return t.$$set=t=>{"id"in t&&n(8,o=t.id),"shipments"in t&&n(0,r=t.shipments),"user"in t&&n(1,s=t.user),"payment"in t&&n(2,a=t.payment),"gateways"in t&&n(3,d=t.gateways),"completed"in t&&n(4,c=t.completed)},t.$$.update=()=>{if(799&t.$$.dirty){o||n(8,o=null),c||n(4,c="no"),r?"string"==typeof r&&n(0,r=JSON.parse(r)||[]):n(0,r=[]),d?"string"==typeof d&&n(3,d=JSON.parse(d)||[]):n(3,d=[]),a?"string"==typeof a&&n(2,a=JSON.parse(a)):n(2,a=l),(r.find((t=>t.selected))||r.find((t=>t.standard)))&&n(2,a.shipmentFee=(r.find((t=>t.selected))||r.find((t=>t.standard))).price,a),s||n(1,s=null);let t,e=(null==a?void 0:a.shipmentFee)||0;for(const t of a.items)e+=t.unitaryPrice*(t.quantity||1)+Math.round(.01*t.taxPercentage*t.unitaryPrice*(t.quantity||1)*100)/100;null===n(9,i=null==a?void 0:a.countryCode)||void 0===i||i.toUpperCase(),t="EUR",n(2,a.total=Math.round(100*e)/100,a),n(2,a.currencyCode=t,a)}},[r,s,a,d,c,u,f,b,o,i,t=>b(t.detail),t=>u("saveUser",t.detail),t=>f(t.detail)]}class I extends R{constructor(t){super(),this.shadowRoot.innerHTML='<style>@charset "UTF-8";@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px;--hb-checkout-border:0.5px solid rgba(197, 197, 197, 0.808)}:host{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#07689f;--bs-secondary:#c9d6df;--bs-success:#11d3bc;--bs-info:#a2d5f2;--bs-warning:#ff7e67;--bs-danger:#f67280;--bs-light:#fafafa;--bs-dark:#4e4e4e;--bs-primary-rgb:7, 104, 159;--bs-secondary-rgb:201, 214, 223;--bs-success-rgb:17, 211, 188;--bs-info-rgb:162, 213, 242;--bs-warning-rgb:255, 126, 103;--bs-danger-rgb:246, 114, 128;--bs-light-rgb:250, 250, 250;--bs-dark-rgb:78, 78, 78;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:33, 37, 41;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-bg:#fff}*,*::before,*::after{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){:host{scroll-behavior:smooth}}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}::-moz-focus-inner{padding:0;border-style:none}@media(min-width: 1200px){}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}.container{width:100%;padding-right:var(--bs-gutter-x, 0.75rem);padding-left:var(--bs-gutter-x, 0.75rem);margin-right:auto;margin-left:auto}@media(min-width: 576px){.container{max-width:540px}}@media(min-width: 768px){.container{max-width:720px}}@media(min-width: 992px){.container{max-width:960px}}@media(min-width: 1200px){.container{max-width:1140px}}@media(min-width: 1400px){.container{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-0.5 * var(--bs-gutter-x));margin-left:calc(-0.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * 0.5);padding-left:calc(var(--bs-gutter-x) * 0.5);margin-top:var(--bs-gutter-y)}.col-5{flex:0 0 auto;width:41.66666667%}.col-7{flex:0 0 auto;width:58.33333333%}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(prefers-reduced-motion: reduce){}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(min-width: 1200px){}@media print{}hb-checkout-shopping-cart{border:var(--hb-checkout-border);--hb-checkout-border:0.5px solid rgba(197, 197, 197, 0.808)}</style>',U(this,{target:this.shadowRoot,props:f(this.attributes),customElement:!0},F,L,r,{id:8,shipments:0,user:1,payment:2,gateways:3,completed:4},null),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["id","shipments","user","payment","gateways","completed"]}get id(){return this.$$.ctx[8]}set id(t){this.$$set({id:t}),O()}get shipments(){return this.$$.ctx[0]}set shipments(t){this.$$set({shipments:t}),O()}get user(){return this.$$.ctx[1]}set user(t){this.$$set({user:t}),O()}get payment(){return this.$$.ctx[2]}set payment(t){this.$$set({payment:t}),O()}get gateways(){return this.$$.ctx[3]}set gateways(t){this.$$set({gateways:t}),O()}get completed(){return this.$$.ctx[4]}set completed(t){this.$$set({completed:t}),O()}}return customElements.define("hb-page-checkout",I),I}();
|
|
1
|
+
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function l(){return t=" ",document.createTextNode(t);var t}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function u(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:m(t,e,n)}function h(t,e,n,i){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function f(t){const e={};for(const n of t)e[n.name]=n.value;return e}let b;function g(t){b=t}function y(){if(!b)throw new Error("Function called outside component initialization");return b}function w(){const t=y();return(e,n)=>{const i=t.$$.callbacks[e];if(i){const o=function(t,e,n=!1){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,!1,e),i}(e,n);i.slice().forEach((e=>{e.call(t,o)}))}}}const x=[],$=[],v=[],k=[],E=Promise.resolve();let C=!1;function S(t){v.push(t)}const _=new Set;let N=0;function O(){const t=b;do{for(;N<x.length;){const t=x[N];N++,g(t),J(t.$$)}for(g(null),x.length=0,N=0;$.length;)$.pop()();for(let t=0;t<v.length;t+=1){const e=v[t];_.has(e)||(_.add(e),e())}v.length=0}while(x.length);for(;k.length;)k.pop()();C=!1,_.clear(),g(t)}function J(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(S)}}const M=new Set;function j(t,e){-1===t.$$.dirty[0]&&(x.push(t),C||(C=!0,E.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(r,s,a,c,l,p,m,u=[-1]){const h=b;g(r);const f=r.$$={fragment:null,ctx:null,props:p,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:s.target||h.$$.root};m&&m(f.root);let y=!1;if(f.ctx=a?a(r,s.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return f.ctx&&l(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),y&&j(r,t)),e})):[],f.update(),y=!0,i(f.before_update),f.fragment=!!c&&c(f.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);f.fragment&&f.fragment.l(t),t.forEach(d)}else f.fragment&&f.fragment.c();s.intro&&((w=r.$$.fragment)&&w.i&&(M.delete(w),w.i(x))),function(t,n,r,s){const{fragment:a,on_mount:d,on_destroy:c,after_update:l}=t.$$;a&&a.m(n,r),s||S((()=>{const n=d.map(e).filter(o);c?c.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(S)}(r,s.target,s.anchor,s.customElement),O()}var w,x;g(h)}let R;"function"==typeof HTMLElement&&(R=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var A="0.6.23";function L(e){let n,o,r,f,b,g,y,w,x,$,v,k,E;return{c(){n=c("div"),o=c("div"),r=c("div"),f=c("hb-checkout"),w=l(),x=c("div"),$=c("hb-checkout-shopping-cart"),this.c=t,u(f,"completed",e[4]),u(f,"user",e[1]),u(f,"shipments",b=JSON.stringify(e[0])),u(f,"gateways",g=JSON.stringify(e[3])),u(f,"payment",y=JSON.stringify(e[2])),m(r,"class","col-7"),h(r,"padding-right","30px"),u($,"completed",e[4]),u($,"payment",v=JSON.stringify(e[2])),m(x,"class","col-5"),h(x,"padding-left","30px"),m(o,"class","row"),m(n,"class","container")},m(t,i){a(t,n,i),s(n,o),s(o,r),s(r,f),s(o,w),s(o,x),s(x,$),k||(E=[p(f,"paymentCompleted",e[10]),p(f,"saveUser",e[11]),p(f,"saveShipment",e[12])],k=!0)},p(t,[e]){16&e&&u(f,"completed",t[4]),2&e&&u(f,"user",t[1]),1&e&&b!==(b=JSON.stringify(t[0]))&&u(f,"shipments",b),8&e&&g!==(g=JSON.stringify(t[3]))&&u(f,"gateways",g),4&e&&y!==(y=JSON.stringify(t[2]))&&u(f,"payment",y),16&e&&u($,"completed",t[4]),4&e&&v!==(v=JSON.stringify(t[2]))&&u($,"payment",v)},i:t,o:t,d(t){t&&d(n),k=!1,i(E)}}}function F(t,e,n){var i;let{id:o}=e,{shipments:r}=e,{user:s}=e,{payment:a}=e,{gateways:d}=e,{completed:c}=e;const l={merchantName:"merchant",countryCode:"IT",total:0,currencyCode:"EUR",items:[]},p=y(),m=w();function u(t,e){m(t,e),p.dispatchEvent&&p.dispatchEvent(new CustomEvent(t,{detail:e}))}function h(t){if(!document.getElementById("hb-"+t+"-script")){const e=document.createElement("script");e.id="hb-"+t+"-script",e.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-${t}@${A}/release/release.js`,location.href.includes("localhost")&&(e.src=`http://localhost:6006/${t}/dist/release.js`),document.head.appendChild(e)}}function f(t){const e=r.findIndex((e=>e.id===t.id)),i=r[e];r.forEach((t=>t.selected=!1)),i.selected=!0,n(2,a.shipmentFee=i.price,a),console.log("sss",i,t)}function b(t){t.completed?(n(4,c="yes"),u("paymentCompleted",t)):console.warn(t)}h("checkout-shopping-cart"),h("checkout");return t.$$set=t=>{"id"in t&&n(8,o=t.id),"shipments"in t&&n(0,r=t.shipments),"user"in t&&n(1,s=t.user),"payment"in t&&n(2,a=t.payment),"gateways"in t&&n(3,d=t.gateways),"completed"in t&&n(4,c=t.completed)},t.$$.update=()=>{if(799&t.$$.dirty){o||n(8,o=null),c||n(4,c="no"),r?"string"==typeof r&&n(0,r=JSON.parse(r)||[]):n(0,r=[]),d?"string"==typeof d&&n(3,d=JSON.parse(d)||[]):n(3,d=[]),a?"string"==typeof a&&n(2,a=JSON.parse(a)):n(2,a=l),(r.find((t=>t.selected))||r.find((t=>t.standard)))&&n(2,a.shipmentFee=(r.find((t=>t.selected))||r.find((t=>t.standard))).price,a),s||n(1,s=null);let t,e=(null==a?void 0:a.shipmentFee)||0;for(const t of a.items)e+=t.unitaryPrice*(t.quantity||1)+Math.round(.01*t.taxPercentage*t.unitaryPrice*(t.quantity||1)*100)/100;null===n(9,i=null==a?void 0:a.countryCode)||void 0===i||i.toUpperCase(),t="EUR",n(2,a.total=Math.round(100*e)/100,a),n(2,a.currencyCode=t,a)}},[r,s,a,d,c,u,f,b,o,i,t=>b(t.detail),t=>u("saveUser",t.detail),t=>f(t.detail)]}class I extends R{constructor(t){super(),this.shadowRoot.innerHTML='<style>@charset "UTF-8";@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px;--hb-checkout-border:0.5px solid rgba(197, 197, 197, 0.808)}:host{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#07689f;--bs-secondary:#c9d6df;--bs-success:#11d3bc;--bs-info:#a2d5f2;--bs-warning:#ff7e67;--bs-danger:#f67280;--bs-light:#fafafa;--bs-dark:#4e4e4e;--bs-primary-rgb:7, 104, 159;--bs-secondary-rgb:201, 214, 223;--bs-success-rgb:17, 211, 188;--bs-info-rgb:162, 213, 242;--bs-warning-rgb:255, 126, 103;--bs-danger-rgb:246, 114, 128;--bs-light-rgb:250, 250, 250;--bs-dark-rgb:78, 78, 78;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:33, 37, 41;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-bg:#fff}*,*::before,*::after{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){:host{scroll-behavior:smooth}}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}::-moz-focus-inner{padding:0;border-style:none}@media(min-width: 1200px){}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}.container{width:100%;padding-right:var(--bs-gutter-x, 0.75rem);padding-left:var(--bs-gutter-x, 0.75rem);margin-right:auto;margin-left:auto}@media(min-width: 576px){.container{max-width:540px}}@media(min-width: 768px){.container{max-width:720px}}@media(min-width: 992px){.container{max-width:960px}}@media(min-width: 1200px){.container{max-width:1140px}}@media(min-width: 1400px){.container{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-0.5 * var(--bs-gutter-x));margin-left:calc(-0.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * 0.5);padding-left:calc(var(--bs-gutter-x) * 0.5);margin-top:var(--bs-gutter-y)}.col-5{flex:0 0 auto;width:41.66666667%}.col-7{flex:0 0 auto;width:58.33333333%}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(prefers-reduced-motion: reduce){}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(min-width: 1200px){}@media print{}hb-checkout-shopping-cart{border:var(--hb-checkout-border);--hb-checkout-border:0.5px solid rgba(197, 197, 197, 0.808)}</style>',U(this,{target:this.shadowRoot,props:f(this.attributes),customElement:!0},F,L,r,{id:8,shipments:0,user:1,payment:2,gateways:3,completed:4},null),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["id","shipments","user","payment","gateways","completed"]}get id(){return this.$$.ctx[8]}set id(t){this.$$set({id:t}),O()}get shipments(){return this.$$.ctx[0]}set shipments(t){this.$$set({shipments:t}),O()}get user(){return this.$$.ctx[1]}set user(t){this.$$set({user:t}),O()}get payment(){return this.$$.ctx[2]}set payment(t){this.$$set({payment:t}),O()}get gateways(){return this.$$.ctx[3]}set gateways(t){this.$$set({gateways:t}),O()}get completed(){return this.$$.ctx[4]}set completed(t){this.$$set({completed:t}),O()}}return customElements.define("hb-page-checkout",I),I}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|