@htmlbricks/hb-checkout 0.19.16 → 0.19.17

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@htmlbricks/hb-checkout",
3
3
  "displayName": "Svelte Payment WebComponent",
4
4
  "description": "Svelte Payment WebComponent",
5
- "version": "0.19.16",
5
+ "version": "0.19.17",
6
6
  "main": "release/release.js",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -71,8 +71,8 @@
71
71
  },
72
72
  "dependencies": {
73
73
  "@google-pay/button-element": "^3.0.0",
74
- "@htmlbricks/hb-form": "^0.19.16",
75
- "@htmlbricks/hb-payment-paypal": "^0.19.16",
74
+ "@htmlbricks/hb-form": "^0.19.17",
75
+ "@htmlbricks/hb-payment-paypal": "^0.19.17",
76
76
  "dayjs": "^1.10.7",
77
77
  "debounce": "^1.2.1"
78
78
  },
@@ -83,5 +83,5 @@
83
83
  "html5-webcomponents"
84
84
  ],
85
85
  "contributors": [],
86
- "gitHead": "f4faadb18f8f6cae711dd9f5e79307896966b286"
86
+ "gitHead": "249d220ad446f28ec12f891a85ddc5b7574197f7"
87
87
  }
@@ -511,5 +511,5 @@
511
511
  "size": {},
512
512
  "iifePath": "release/release.js",
513
513
  "repoName": "@htmlbricks/hb-checkout",
514
- "version": "0.19.16"
514
+ "version": "0.19.17"
515
515
  }
@@ -1,2 +1,2 @@
1
- var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode&&t.parentNode.removeChild(t)}function d(t){return document.createElement(t)}function c(t){return document.createTextNode(t)}function u(){return c(" ")}function p(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function h(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function m(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:h(t,e,n)}function f(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function y(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function b(t){const e={};for(const n of t)e[n.name]=n.value;return e}let g;function v(t){g=t}function w(){if(!g)throw new Error("Function called outside component initialization");return g}function $(){const t=w();return(e,n,{cancelable:o=!1}={})=>{const i=t.$$.callbacks[e];if(i){const r=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,o,e),i}(e,n,{cancelable:o});return i.slice().forEach((e=>{e.call(t,r)})),!r.defaultPrevented}return!0}}const C=[],x=[],k=[],M=[],P=Promise.resolve();let _=!1;function T(t){k.push(t)}const S=new Set;let E=0;function N(){if(0!==E)return;const t=g;do{try{for(;E<C.length;){const t=C[E];E++,v(t),D(t.$$)}}catch(t){throw C.length=0,E=0,t}for(v(null),C.length=0,E=0;x.length;)x.pop()();for(let t=0;t<k.length;t+=1){const e=k[t];S.has(e)||(S.add(e),e())}k.length=0}while(C.length);for(;M.length;)M.pop()();_=!1,S.clear(),v(t)}function D(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const I=new Set;function A(t,e){t&&t.i&&(I.delete(t),t.i(e))}function L(t,e){t.d(1),e.delete(t.key)}function R(t,e){-1===t.$$.dirty[0]&&(C.push(t),_||(_=!0,P.then(N)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function O(r,a,s,d,c,u,p,h=[-1]){const m=g;v(r);const f=r.$$={fragment:null,ctx:[],props:u,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(m?m.$$.context:[])),callbacks:n(),dirty:h,skip_bound:!1,root:a.target||m.$$.root};p&&p(f.root);let y=!1;if(f.ctx=s?s(r,a.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return f.ctx&&c(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),y&&R(r,t)),e})):[],f.update(),y=!0,o(f.before_update),f.fragment=!!d&&d(f.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);f.fragment&&f.fragment.l(t),t.forEach(l)}else f.fragment&&f.fragment.c();a.intro&&A(r.$$.fragment),function(t,n,r,a){const{fragment:s,after_update:l}=t.$$;s&&s.m(n,r),a||T((()=>{const n=t.$$.on_mount.map(e).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),l.forEach(T)}(r,a.target,a.anchor,a.customElement),N()}v(m)}let z;"function"==typeof HTMLElement&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.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 q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function j(t){var e={exports:{}};return t(e,e.exports),e.exports}j((function(t,e){t.exports=function(){function t(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function n(t){return t.replace(/[A-Z]+/g,(t=>`-${t}`)).replace(/^-/,"").toLowerCase()}function o(t){return function(e,o){const i=t||n(o);e.addObservedAttribute&&e.addObservedAttribute(i),Object.defineProperty(e,o,{get(){return this.getAttribute(i)},set(t){null==t?this.removeAttribute(i):this.setAttribute(i,t),this.notifyPropertyChanged(o)},enumerable:!0,configurable:!0})}}function i(t){return t?o(t):function(t,e){Object.defineProperty(t,e,{get(){return this[`$__${e}`]},set(t){this[`$__${e}`]=t,this.notifyPropertyChanged(e)},enumerable:!0,configurable:!0})}}function r(t){return function(e,n){Object.defineProperty(e,t,{get(){return this[n]},set(t){this[n]=t},enumerable:!0,configurable:!1})}}let a={};function s(t){const e=a[t];if(e)return e;const n=new Promise(((e,n)=>{const o=document.createElement("script");o.src=t,o.async=!0;const i=()=>{e()},r=()=>{o.removeEventListener("load",i),o.removeEventListener("error",r),delete a[t],o.remove(),n(new Error(`Unable to load script ${t}`))};o.addEventListener("load",i),o.addEventListener("error",r),document.body.appendChild(o)}));return a[t]=n,n}class l{constructor(t){this.handleClick=t=>e(this,void 0,void 0,(function*(){const e=this.config;if(!e)throw new Error("google-pay-button: Missing configuration");const n=this.createLoadPaymentDataRequest(e);try{if(e.onClick&&e.onClick(t),t.defaultPrevented)return;const o=yield this.client.loadPaymentData(n);e.onLoadPaymentData&&e.onLoadPaymentData(o)}catch(t){"CANCELED"===t.statusCode?e.onCancel&&e.onCancel(t):e.onError?e.onError(t):console.error(t)}})),this.options=t}getElement(){return this.element}isGooglePayLoaded(){var t,e;return"google"in(window||q)&&!!(null===(e=null===(t=null===google||void 0===google?void 0:google.payments)||void 0===t?void 0:t.api)||void 0===e?void 0:e.PaymentsClient)}mount(t){var n;return e(this,void 0,void 0,(function*(){if(!this.isGooglePayLoaded())try{yield s("https://pay.google.com/gp/p/js/pay.js")}catch(t){(null===(n=this.config)||void 0===n?void 0:n.onError)?this.config.onError(t):console.error(t)}this.element=t,t&&(this.appendStyles(),this.config&&this.updateElement())}))}unmount(){this.element=void 0}configure(t){let e;return this.config=t,this.oldInvalidationValues&&!this.isClientInvalidated(t)||(e=this.updateElement()),this.oldInvalidationValues=this.getInvalidationValues(t),null!=e?e:Promise.resolve()}createClientOptions(t){const e={environment:t.environment,merchantInfo:this.createMerchantInfo(t)};return(t.onPaymentDataChanged||t.onPaymentAuthorized)&&(e.paymentDataCallbacks={},t.onPaymentDataChanged&&(e.paymentDataCallbacks.onPaymentDataChanged=e=>t.onPaymentDataChanged(e)||{}),t.onPaymentAuthorized&&(e.paymentDataCallbacks.onPaymentAuthorized=e=>t.onPaymentAuthorized(e)||{})),e}createIsReadyToPayRequest(t){const e=t.paymentRequest;return{apiVersion:e.apiVersion,apiVersionMinor:e.apiVersionMinor,allowedPaymentMethods:e.allowedPaymentMethods,existingPaymentMethodRequired:t.existingPaymentMethodRequired}}createLoadPaymentDataRequest(t){return Object.assign(Object.assign({},t.paymentRequest),{merchantInfo:this.createMerchantInfo(t)})}createMerchantInfo(t){const e=Object.assign({},t.paymentRequest.merchantInfo);return e.softwareInfo||(e.softwareInfo={id:this.options.softwareInfoId,version:this.options.softwareInfoVersion}),e}isMounted(){return null!=this.element&&!1!==this.element.isConnected}removeButton(){if(this.element instanceof ShadowRoot||this.element instanceof Element)for(const t of Array.from(this.element.children))"STYLE"!==t.tagName&&t.remove()}updateElement(){return e(this,void 0,void 0,(function*(){if(!this.isMounted())return;const t=this.getElement();if(!this.config)throw new Error("google-pay-button: Missing configuration");this.removeButton(),this.client=new google.payments.api.PaymentsClient(this.createClientOptions(this.config));const e={buttonType:this.config.buttonType,buttonColor:this.config.buttonColor,buttonSizeMode:this.config.buttonSizeMode,buttonLocale:this.config.buttonLocale,onClick:this.handleClick,allowedPaymentMethods:this.config.paymentRequest.allowedPaymentMethods},n=t.getRootNode();n instanceof ShadowRoot&&(e.buttonRootNode=n);const o=this.client.createButton(e);this.setClassName(t,[t.className,"not-ready"]),t.appendChild(o);let i,r=!1;try{i=yield this.client.isReadyToPay(this.createIsReadyToPayRequest(this.config)),r=i.result&&!this.config.existingPaymentMethodRequired||i.result&&i.paymentMethodPresent&&this.config.existingPaymentMethodRequired||!1}catch(t){this.config.onError?this.config.onError(t):console.error(t)}if(this.isMounted()){if(r){try{this.client.prefetchPaymentData(this.createLoadPaymentDataRequest(this.config))}catch(t){console.log("Error with prefetch",t)}this.setClassName(t,(t.className||"").split(" ").filter((t=>t&&"not-ready"!==t)))}if((this.isReadyToPay!==(null==i?void 0:i.result)||this.paymentMethodPresent!==(null==i?void 0:i.paymentMethodPresent))&&(this.isReadyToPay=!!(null==i?void 0:i.result),this.paymentMethodPresent=null==i?void 0:i.paymentMethodPresent,this.config.onReadyToPayChange)){const t={isButtonVisible:r,isReadyToPay:this.isReadyToPay};this.paymentMethodPresent&&(t.paymentMethodPresent=this.paymentMethodPresent),this.config.onReadyToPayChange(t)}}}))}setClassName(t,e){const n=e.filter((t=>t)).join(" ");n?t.className=n:t.removeAttribute("class")}appendStyles(){var t,e,n;if("undefined"==typeof document)return;const o=null===(t=this.element)||void 0===t?void 0:t.getRootNode(),i=`default-google-style-${this.options.cssSelector.replace(/[^\w-]+/g,"")}-${null===(e=this.config)||void 0===e?void 0:e.buttonLocale}`;if(o&&!(null===(n=o.getElementById)||void 0===n?void 0:n.call(o,i))){const t=document.createElement("style");t.id=i,t.type="text/css",t.innerHTML=`\n ${this.options.cssSelector} {\n display: inline-block;\n }\n ${this.options.cssSelector}.not-ready {\n width: 0;\n height: 0;\n overflow: hidden;\n }\n `,o instanceof Document&&o.head?o.head.appendChild(t):o.appendChild(t)}}isClientInvalidated(t){return!this.oldInvalidationValues||this.getInvalidationValues(t).some(((t,e)=>t!==this.oldInvalidationValues[e]))}getInvalidationValues(t){var e,n;return[t.environment,t.existingPaymentMethodRequired,!!t.onPaymentDataChanged,!!t.onPaymentAuthorized,t.buttonColor,t.buttonType,t.buttonLocale,t.buttonSizeMode,t.paymentRequest.merchantInfo.merchantId,t.paymentRequest.merchantInfo.merchantName,null===(e=t.paymentRequest.merchantInfo.softwareInfo)||void 0===e?void 0:e.id,null===(n=t.paymentRequest.merchantInfo.softwareInfo)||void 0===n?void 0:n.version,t.paymentRequest.allowedPaymentMethods]}}function d(t,e=0){let n;return function(...o){return window.clearTimeout(n),new Promise((i=>{n=window.setTimeout((()=>{const e=(n=void 0,t(...o));i(e)}),e)}))}}class c extends HTMLElement{constructor(){super(...arguments),this.manager=new l({cssSelector:"google-pay-button",softwareInfoId:"@google-pay/button-element",softwareInfoVersion:"3.0.5"}),this.initializeButton=d((()=>{if(!this.assertRequiredProperty("paymentRequest"))return;if(!this.assertRequiredProperty("environment"))return;const t={paymentRequest:this.paymentRequest,environment:this.environment,existingPaymentMethodRequired:this.existingPaymentMethodRequired,onPaymentDataChanged:this.onPaymentDataChanged,onPaymentAuthorized:this.onPaymentAuthorized,buttonColor:this.buttonColor,buttonType:this.buttonType,buttonSizeMode:this.buttonSizeMode,buttonLocale:this.buttonLocale,onReadyToPayChange:t=>{this.onReadyToPayChange&&this.onReadyToPayChange(t),this.dispatch("readytopaychange",t)},onCancel:t=>{this.onCancel&&this.onCancel(t),this.dispatch("cancel",t)},onError:t=>{var e;this.onError&&(null===(e=this.onError)||void 0===e||e.call(this,t)),this.dispatchEvent(new ErrorEvent("error",{error:t}))},onLoadPaymentData:t=>{this.onLoadPaymentData&&this.onLoadPaymentData(t),this.dispatch("loadpaymentdata",t)},onClick:t=>{var e;this.onClick&&(null===(e=this.onClick)||void 0===e||e.call(this,t))}};this.manager.configure(t)}))}get isReadyToPay(){return this.manager.isReadyToPay}assertRequiredProperty(t){return null!=this[t]||(this.throwError(Error(`Required property not set: ${t}`)),!1)}throwError(t){throw t}static get observedAttributes(){return c._observedAttributes}addObservedAttribute(t){c._observedAttributes.push(t)}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!1,detail:e}))}connectedCallback(){return e(this,void 0,void 0,(function*(){return yield this.manager.mount(this),this.initializeButton()}))}disconnectedCallback(){this.manager.unmount()}attributeChangedCallback(t){return this.initializeButton()}notifyPropertyChanged(t){return this.initializeButton()}}return c._observedAttributes=[],t([i(),r("paymentrequest")],c.prototype,"paymentRequest",void 0),t([o()],c.prototype,"environment",void 0),t([function(t,e){const o=n(e);t.addObservedAttribute&&t.addObservedAttribute(o),Object.defineProperty(t,e,{get(){return this.hasAttribute(o)},set(t){t?this.setAttribute(o,""):this.removeAttribute(o),this.notifyPropertyChanged(e)},enumerable:!0,configurable:!0})},r("existingpaymentmethodrequired")],c.prototype,"existingPaymentMethodRequired",void 0),t([o(),r("buttoncolor")],c.prototype,"buttonColor",void 0),t([o(),r("buttontype")],c.prototype,"buttonType",void 0),t([o(),r("buttonsizemode")],c.prototype,"buttonSizeMode",void 0),t([o(),r("buttonlocale")],c.prototype,"buttonLocale",void 0),t([i(),r("paymentDataChangedCallback"),r("paymentdatachangedcallback"),r("onpaymentdatachanged")],c.prototype,"onPaymentDataChanged",void 0),t([i(),r("paymentAuthorizedCallback"),r("paymentauthorizedcallback"),r("onpaymentauthorized")],c.prototype,"onPaymentAuthorized",void 0),t([r("readyToPayChangeCallback"),r("readytopaychangecallback"),r("onreadytopaychange")],c.prototype,"onReadyToPayChange",void 0),t([r("loadPaymentDataCallback"),r("loadpaymentdatacallback"),r("onloadpaymentdata")],c.prototype,"onLoadPaymentData",void 0),t([r("cancelCallback"),r("cancelcallback"),r("oncancel")],c.prototype,"onCancel",void 0),t([r("errorCallback"),r("errorcallback"),r("onerror")],c.prototype,"onError",void 0),t([r("clickCallback"),r("clickcallback"),r("onclick")],c.prototype,"onClick",void 0),customElements.define("google-pay-button",c),c}()}));var V={name:"@htmlbricks/hb-checkout",displayName:"Svelte Payment WebComponent",description:"Svelte Payment WebComponent",version:"0.19.16",main:"release/release.js",publishConfig:{access:"public"},author:"Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",authorUrl:"https://dariocaruso.info",license:"MIT","license-docs":"CC BY 4.0","license-translations":"CC BY 4.0","license-images":"CC BY-NC 4.0",engines:{node:">=16.0.0"},scripts:{start:"sirv dist",dev:"rm -rf ./dist && rollup -c -w",build:"rm -rf ./dist && rollup -c","generate-manifest":"npm run generate-schemes && monorepo-wc-packages-manifester --dir $PWD","generate-component-schema":"ts-json-schema-generator --type 'Component' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json","generate-events-schema":"ts-json-schema-generator --type 'Events' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent_events.type.d.json","generate-schemes":"npm run generate-events-schema && npm run generate-component-schema",copydest:"rm -rf release && mkdir -p release && mkdir -p release && cp dist/* ./release/","build-extra":"tsc --moduleResolution node --module es2020 --esModuleInterop true --outDir dist --sourceMap --skipLibCheck extra/*","build:release":"PRODUCTION=true npm run build && npm run build-extra && npm run generate-manifest && npm run copydest",prepublish:"npm run build:release"},devDependencies:{"@rollup/plugin-alias":"^3.1.2","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^4.0.0","@rollup/plugin-typescript":"^8.2.1","@tsconfig/svelte":"^1.0.10","@types/node":"^16.7.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0",eslint:"^7.25.0","eslint-plugin-jsdoc":"^33.0.0","eslint-plugin-svelte3":"^3.2.0","monorepo-wc-packages-manifester":"^0.0.3","node-sass":"^6.0.1",postcss:"^8.2.13","postcss-load-config":"^3.0.1",prettier:"^2.8.4",rollup:"^2.46.0","rollup-plugin-copy":"^3.4.0","rollup-plugin-css-only":"^3.1.0","rollup-plugin-livereload":"^2.0.0","rollup-plugin-svelte":"^7.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-ts-paths":"^1.0.5","rollup-plugin-typescript2":"^0.31.1",sass:"^1.32.12","sirv-cli":"^1.0.11",svelte:"^3.46.2","svelte-check":"^1.5.2","svelte-preprocess":"^4.7.2","ts-json-schema-generator":"^0.98.0","ts-node":"^9.1.1",tslib:"^2.2.0",ttypescript:"^1.5.12",typescript:"^4.2.4","typescript-transform-paths":"^2.2.3","wc-js-utils":"^0.0.1"},dependencies:{"@google-pay/button-element":"^3.0.0","@htmlbricks/hb-form":"^0.19.16","@htmlbricks/hb-payment-paypal":"^0.19.16",dayjs:"^1.10.7",debounce:"^1.2.1"},keywords:["svelte","svelte-webcomponents","webcomponents","html5-webcomponents"],contributors:[],gitHead:"f4faadb18f8f6cae711dd9f5e79307896966b286"};const H=[{type:"text",placeholder:"Insert your full Name name here...",id:"fullName",required:!0,label:"Full Name",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert your Credit Card Number here...",id:"cardNumber",required:!0,label:"Card Number",validationTip:"This field cannot be empty."},{id:"name-row2",type:"row",params:{columns:[{type:"text",placeholder:"Insert card CVV here...",id:"CVV",required:!0,label:"CVV",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert card expiration here...",id:"expiration",required:!0,label:"Scadenza",validationTip:"This field cannot be empty."}]}}],Y=[{type:"text",placeholder:"Insert your Full Name here...",id:"fullName",required:!0,label:"Full Name",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert your Street/Square address with number...",id:"addressWithNumber",required:!0,label:"Street/Square/...",validationTip:"This field cannot be empty."},{id:"name-row2",type:"row",params:{columns:[{type:"text",placeholder:"Insert your nationality here...",id:"nationality",required:!0,label:"Nationality",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert your city name here...",id:"city",required:!0,label:"City",validationTip:"This field cannot be empty."},{type:"number",placeholder:"Insert your zip code here...",id:"zip",required:!0,label:"Zip",validationTip:"This field cannot be empty."}]}}];var W=j((function(t,e){t.exports=function(){var t=1e3,e=6e4,n=36e5,o="millisecond",i="second",r="minute",a="hour",s="day",l="week",d="month",c="quarter",u="year",p="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},b=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},g={s:b,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+b(o,2,"0")+":"+b(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var o=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(o,d),r=n-i<0,a=e.clone().add(o+(r?-1:1),d);return+(-(o+(n-i)/(r?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:d,y:u,w:l,d:s,D:p,h:a,m:r,s:i,ms:o,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",w={};w[v]=y;var $=function(t){return t instanceof M},C=function t(e,n,o){var i;if(!e)return v;if("string"==typeof e){var r=e.toLowerCase();w[r]&&(i=r),n&&(w[r]=n,i=r);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var s=e.name;w[s]=e,i=s}return!o&&i&&(v=i),i||!o&&v},x=function(t,e){if($(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new M(n)},k=g;k.l=C,k.i=$,k.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var M=function(){function y(t){this.$L=C(t.locale,null,!0),this.parse(t)}var b=y.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(m);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return k},b.isValid=function(){return!(this.$d.toString()===h)},b.isSame=function(t,e){var n=x(t);return this.startOf(e)<=n&&n<=this.endOf(e)},b.isAfter=function(t,e){return x(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<x(t)},b.$g=function(t,e,n){return k.u(t)?this[e]:this.set(n,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var n=this,o=!!k.u(e)||e,c=k.p(t),h=function(t,e){var i=k.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return o?i:i.endOf(s)},m=function(t,e){return k.w(n.toDate()[t].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},f=this.$W,y=this.$M,b=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case u:return o?h(1,0):h(31,11);case d:return o?h(1,y):h(0,y+1);case l:var v=this.$locale().weekStart||0,w=(f<v?f+7:f)-v;return h(o?b-w:b+(6-w),y);case s:case p:return m(g+"Hours",0);case a:return m(g+"Minutes",1);case r:return m(g+"Seconds",2);case i:return m(g+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var n,l=k.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[p]=c+"Date",n[d]=c+"Month",n[u]=c+"FullYear",n[a]=c+"Hours",n[r]=c+"Minutes",n[i]=c+"Seconds",n[o]=c+"Milliseconds",n)[l],m=l===s?this.$D+(e-this.$W):e;if(l===d||l===u){var f=this.clone().set(p,1);f.$d[h](m),f.init(),this.$d=f.set(p,Math.min(this.$D,f.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[k.p(t)]()},b.add=function(o,c){var p,h=this;o=Number(o);var m=k.p(c),f=function(t){var e=x(h);return k.w(e.date(e.date()+Math.round(t*o)),h)};if(m===d)return this.set(d,this.$M+o);if(m===u)return this.set(u,this.$y+o);if(m===s)return f(1);if(m===l)return f(7);var y=(p={},p[r]=e,p[a]=n,p[i]=t,p)[m]||1,b=this.$d.getTime()+o*y;return k.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=t||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),r=this.$H,a=this.$m,s=this.$M,l=n.weekdays,d=n.months,c=function(t,n,i,r){return t&&(t[n]||t(e,o))||i[n].slice(0,r)},u=function(t){return k.s(r%12||12,t,"0")},p=n.meridiem||function(t,e,n){var o=t<12?"AM":"PM";return n?o.toLowerCase():o},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:k.s(s+1,2,"0"),MMM:c(n.monthsShort,s,d,3),MMMM:c(d,s),D:this.$D,DD:k.s(this.$D,2,"0"),d:String(this.$W),dd:c(n.weekdaysMin,this.$W,l,2),ddd:c(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(r),HH:k.s(r,2,"0"),h:u(1),hh:u(2),a:p(r,a,!0),A:p(r,a,!1),m:String(a),mm:k.s(a,2,"0"),s:String(this.$s),ss:k.s(this.$s,2,"0"),SSS:k.s(this.$ms,3,"0"),Z:i};return o.replace(f,(function(t,e){return e||m[t]||i.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(o,p,h){var m,f=k.p(p),y=x(o),b=(y.utcOffset()-this.utcOffset())*e,g=this-y,v=k.m(this,y);return v=(m={},m[u]=v/12,m[d]=v,m[c]=v/3,m[l]=(g-b)/6048e5,m[s]=(g-b)/864e5,m[a]=g/n,m[r]=g/e,m[i]=g/t,m)[f]||g,h?v:k.a(v)},b.daysInMonth=function(){return this.endOf(d).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),o=C(t,e,!0);return o&&(n.$L=o),n},b.clone=function(){return k.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},y}(),P=M.prototype;return x.prototype=P,[["$ms",o],["$s",i],["$m",r],["$H",a],["$W",s],["$M",d],["$y",u],["$D",p]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),x.extend=function(t,e){return t.$i||(t(e,M,x),t.$i=!0),x},x.locale=C,x.isDayjs=$,x.unix=function(t){return x(1e3*t)},x.en=w[v],x.Ls=w,x.p={},x}()})),U=j((function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,i="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var r=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(i+="".concat(n,":").concat(t[n],";"))},a=0,s=Object.keys(t);a<s.length;a++){r(s[a])}return i},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var i=document.createElement("script");i.id=n+"-script",i.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(i.src="".concat(t.local)),document.head.appendChild(i)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,i,r="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(r=null===(i=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===i?void 0:i.toLowerCase()),r},t.getDictionaryWord=function(e,n,o){var i;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(i=n[o])||void 0===i?void 0:i[e]))return n[o][e];var r="",a=t.getDefaultLang();if(!o||a!==o){var s=null==n?void 0:n[a];(null==s?void 0:s[e])&&(r=s[e])}return r},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n})),F=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,B=/\n/g,J=/^\s*/,G=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Z=/^:\s*/,K=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Q=/^[;\s]*/,X=/^\s+|\s+$/g,tt="\n",et="/",nt="*",ot="",it="comment",rt="declaration",at=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function i(t){var e=t.match(B);e&&(n+=e.length);var i=t.lastIndexOf(tt);o=~i?t.length-i:o+t.length}function r(){var t={line:n,column:o};return function(e){return e.position=new a(t),d(),e}}function a(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function s(i){var r=new Error(e.source+":"+n+":"+o+": "+i);if(r.reason=i,r.filename=e.source,r.line=n,r.column=o,r.source=t,!e.silent)throw r}function l(e){var n=e.exec(t);if(n){var o=n[0];return i(o),t=t.slice(o.length),n}}function d(){l(J)}function c(t){var e;for(t=t||[];e=u();)!1!==e&&t.push(e);return t}function u(){var e=r();if(et==t.charAt(0)&&nt==t.charAt(1)){for(var n=2;ot!=t.charAt(n)&&(nt!=t.charAt(n)||et!=t.charAt(n+1));)++n;if(n+=2,ot===t.charAt(n-1))return s("End of comment missing");var a=t.slice(2,n-2);return o+=2,i(a),t=t.slice(n),o+=2,e({type:it,comment:a})}}function p(){var t=r(),e=l(G);if(e){if(u(),!l(Z))return s("property missing ':'");var n=l(K),o=t({type:rt,property:st(e[0].replace(F,ot)),value:n?st(n[0].replace(F,ot)):ot});return l(Q),o}}return a.prototype.content=t,d(),function(){var t,e=[];for(c(e);t=p();)!1!==t&&(e.push(t),c(e));return e}()};function st(t){return t?t.replace(X,ot):ot}var lt=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var i,r,a=at(t),s="function"==typeof e,l=0,d=a.length;l<d;l++)i=(n=a[l]).property,r=n.value,s?e(i,r,n):r&&(o||(o={}),o[i]=r);return o},dt={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[{name:"invalid-feedback",description:""},{name:"main_button",description:""},{name:"button_container",description:""}]},ct={vars:[{name:"--hb-checkout-border",defaultValue:"0.5px solid rgba(197, 197, 197, 0.808)",description:"",valueType:"string"}],parts:[{name:"btn",description:"paypal button css"}]};function ut(t,e,n){const o=t.slice();return o[35]=e[n],o}function pt(t){let e,n,i,r,c,f,b,g,v,w;return{c(){e=d("h4"),e.textContent="Address",n=u(),i=d("div"),r=d("hb-form"),f=u(),b=d("div"),g=d("button"),g.textContent="continue",h(e,"class","subtitle"),h(e,"part","subtitle"),m(r,"hide_submit","yes"),m(r,"style",t[6]),m(r,"schema",c=JSON.stringify(t[5])),m(r,"submitted",t[11]),y(g,"width","100%"),y(g,"margin-bottom","10px"),h(g,"class","btn btn-primary")},m(o,l){s(o,e,l),s(o,n,l),s(o,i,l),a(i,r),a(i,f),a(i,b),a(b,g),v||(w=[p(r,"submit",t[23]),p(g,"click",t[24])],v=!0)},p(t,e){64&e[0]&&m(r,"style",t[6]),32&e[0]&&c!==(c=JSON.stringify(t[5]))&&m(r,"schema",c),2048&e[0]&&m(r,"submitted",t[11])},d(t){t&&l(e),t&&l(n),t&&l(i),v=!1,o(w)}}}function ht(t){let e,n,o,i,r,m,y,b,g,v,w,$,C,x,k,M=t[1].fullName+"",P=`${t[1].addressWithNumber}, ${t[1].city}, ${t[1].zip},${t[1].nationality}`;return{c(){e=d("h4"),n=d("button"),n.textContent="edit",o=u(),i=d("div"),r=d("div"),m=d("span"),m.textContent="Name",y=d("span"),b=c(M),g=u(),v=d("div"),w=d("span"),w.textContent="Address",$=d("span"),C=c(P),h(n,"class","btn btn-sm detail_btn"),h(e,"class","subtitle"),h(e,"part","subtitle"),h(m,"class","dataentry_key"),h(y,"class","dataentry_value"),h(r,"class","dataentry"),h(w,"class","dataentry_key"),h($,"class","dataentry_value"),h(v,"class","dataentry"),h(i,"class","dataentrycontainer")},m(l,d){s(l,e,d),a(e,n),s(l,o,d),s(l,i,d),a(i,r),a(r,m),a(r,y),a(y,b),a(i,g),a(i,v),a(v,w),a(v,$),a($,C),x||(k=p(n,"click",t[16]),x=!0)},p(t,e){2&e[0]&&M!==(M=t[1].fullName+"")&&f(b,M),2&e[0]&&P!==(P=`${t[1].addressWithNumber}, ${t[1].city}, ${t[1].zip},${t[1].nationality}`)&&f(C,P)},d(t){t&&l(e),t&&l(o),t&&l(i),x=!1,k()}}}function mt(t){let e,n,o=t[1].fullName&&ft(t);return{c(){e=d("div"),n=d("slot"),o&&o.c(),h(n,"name","userinfo"),h(e,"class","dataentrycontainer")},m(t,i){s(t,e,i),a(e,n),o&&o.m(n,null)},p(t,e){t[1].fullName?o?o.p(t,e):(o=ft(t),o.c(),o.m(n,null)):o&&(o.d(1),o=null)},d(t){t&&l(e),o&&o.d()}}}function ft(t){let e,n,o,i=t[1].fullName+"";return{c(){e=d("div"),n=d("span"),o=c(i),h(n,"class","dataentry_value"),h(e,"class","dataentry")},m(t,i){s(t,e,i),a(e,n),a(n,o)},p(t,e){2&e[0]&&i!==(i=t[1].fullName+"")&&f(o,i)},d(t){t&&l(e)}}}function yt(t){let e,n;function o(t,e){return 1025&e[0]&&(n=null),(t[1]?.fullName&&t[1]?.addressWithNumber||t[1]?.fixed)&&!t[9]?gt:(null==n&&(n=!(t[10]||!t[0].find(Dt)&&!t[0].find(It))),n?bt:void 0)}let i=o(t,[-1,-1]),r=i&&i(t);return{c(){e=d("div"),r&&r.c(),h(e,"id","shipment_separator")},m(t,n){s(t,e,n),r&&r.m(e,null)},p(t,n){i===(i=o(t,n))&&r?r.p(t,n):(r&&r.d(1),r=i&&i(t),r&&(r.c(),r.m(e,null)))},d(t){t&&l(e),r&&r.d()}}}function bt(t){let e,n,o,i,r,m,b,g,v,w,$,C,x,k,M,P,_=(t[0].find(zt)||t[0].find(qt)).price+"",T=(t[0].find(jt)||t[0].find(Vt)).arriveDate+"";return{c(){e=d("h4"),n=d("span"),n.innerHTML='<i class="bi bi-truck"></i> Shipment Service',o=d("button"),o.textContent="edit",i=u(),r=d("div"),m=d("div"),b=d("span"),b.textContent="Shipping Fee",g=d("span"),v=c(_),w=u(),$=d("div"),C=d("span"),C.textContent="Shipping Time",x=d("span"),k=c(T),h(n,"class","detail_label"),h(o,"class","btn btn-sm detail_btn"),y(e,"margin-top","20px"),h(e,"class","subtitle"),h(e,"part","subtitle"),h(b,"class","dataentry_key"),h(g,"class","dataentry_value"),h(m,"class","dataentry"),h(C,"class","dataentry_key"),h(x,"class","dataentry_value"),h($,"class","dataentry"),h(r,"class","dataentrycontainer")},m(l,d){s(l,e,d),a(e,n),a(e,o),s(l,i,d),s(l,r,d),a(r,m),a(m,b),a(m,g),a(g,v),a(r,w),a(r,$),a($,C),a($,x),a(x,k),M||(P=p(o,"click",t[17]),M=!0)},p(t,e){1&e[0]&&_!==(_=(t[0].find(zt)||t[0].find(qt)).price+"")&&f(v,_),1&e[0]&&T!==(T=(t[0].find(jt)||t[0].find(Vt)).arriveDate+"")&&f(k,T)},d(t){t&&l(e),t&&l(i),t&&l(r),M=!1,P()}}}function gt(t){let e,n;function o(t,n){return 1025&n[0]&&(e=null),null==e&&(e=!(t[10]||!t[0].find(Et)&&!t[0].find(Nt))),e?wt:vt}let i=o(t,[-1,-1]),r=i(t);return{c(){r.c(),n=c("")},m(t,e){r.m(t,e),s(t,n,e)},p(t,e){i===(i=o(t,e))&&r?r.p(t,e):(r.d(1),r=i(t),r&&(r.c(),r.m(n.parentNode,n)))},d(t){r.d(t),t&&l(n)}}}function vt(t){let e,n,i,r,c,f,b,g,v,w;return{c(){e=d("h4"),e.innerHTML='<i class="bi bi-truck"></i> Shipment Service',n=u(),i=d("div"),r=d("hb-form"),f=u(),b=d("div"),g=d("button"),g.textContent="continue",h(e,"class","subtitle"),h(e,"part","subtitle"),y(e,"margin-top","20px"),m(r,"hide_submit","yes"),m(r,"style",t[6]),m(r,"schema",c=JSON.stringify(t[8])),m(r,"submitted",t[12]),y(g,"width","100%"),h(g,"class","btn btn-primary")},m(o,l){s(o,e,l),s(o,n,l),s(o,i,l),a(i,r),a(i,f),a(i,b),a(b,g),v||(w=[p(r,"submit",t[25]),p(g,"click",t[26])],v=!0)},p(t,e){64&e[0]&&m(r,"style",t[6]),256&e[0]&&c!==(c=JSON.stringify(t[8]))&&m(r,"schema",c),4096&e[0]&&m(r,"submitted",t[12])},d(t){t&&l(e),t&&l(n),t&&l(i),v=!1,o(w)}}}function wt(t){let e,n,o,i,r,m,b,g,v,w,$,C,x,k,M,P,_=(t[0].find(At)||t[0].find(Lt)).price+"",T=W((t[0].find(Rt)||t[0].find(Ot)).arriveDate).format()+"";return{c(){e=d("h4"),n=d("span"),n.innerHTML='<i class="bi bi-truck"></i> Shipment Service',o=d("button"),o.textContent="edit",i=u(),r=d("div"),m=d("div"),b=d("span"),b.textContent="Shipping Fee",g=d("span"),v=c(_),w=u(),$=d("div"),C=d("span"),C.textContent="Arrive",x=d("span"),k=c(T),h(n,"class","detail_label"),h(o,"class","btn btn-sm detail_btn"),y(e,"margin-top","20px"),h(e,"class","subtitle"),h(e,"part","subtitle"),h(b,"class","dataentry_key"),h(g,"class","dataentry_value"),h(m,"class","dataentry"),h(C,"class","dataentry_key"),h(x,"class","dataentry_value"),h($,"class","dataentry"),h(r,"class","dataentrycontainer")},m(l,d){s(l,e,d),a(e,n),a(e,o),s(l,i,d),s(l,r,d),a(r,m),a(m,b),a(m,g),a(g,v),a(r,w),a(r,$),a($,C),a($,x),a(x,k),M||(P=p(o,"click",t[17]),M=!0)},p(t,e){1&e[0]&&_!==(_=(t[0].find(At)||t[0].find(Lt)).price+"")&&f(v,_),1&e[0]&&T!==(T=W((t[0].find(Rt)||t[0].find(Ot)).arriveDate).format()+"")&&f(k,T)},d(t){t&&l(e),t&&l(i),t&&l(r),M=!1,P()}}}function $t(t){let e,n,o,i,r,p,m,y,b,g=t[3].total+"";return{c(){e=d("slot"),n=d("div"),o=d("div"),o.textContent="payment completed",i=u(),r=d("div"),p=c("Total: "),m=c(g),y=u(),b=d("div"),b.innerHTML='<button class="btn btn-link">invoice</button>',h(o,"id","payment_completed_title"),h(r,"id","payment_completed_content"),h(b,"id","payment_completed_footer"),h(n,"id","payment_completed_content"),h(e,"name","payment_completed")},m(t,l){s(t,e,l),a(e,n),a(n,o),a(n,i),a(n,r),a(r,p),a(r,m),a(n,y),a(n,b)},p(t,e){8&e[0]&&g!==(g=t[3].total+"")&&f(m,g)},d(t){t&&l(e)}}}function Ct(t){let e,n,o,i,r=!t[9]&&!t[10]&&(t[0]?.length&&t[0].find(Tt)||t[0].find(St)||!t[0]?.length),a=r&&xt(t);return{c(){e=d("h3"),e.innerHTML='<i class="bi bi-wallet2"></i> Payment Method',n=u(),a&&a.c(),o=u(),i=d("div"),i.innerHTML='<slot name="payment_terms">By Clicking..<button class="btn btn-default">Terms and conditions</button></slot>',h(e,"class","subtitle"),h(e,"part","subtitle"),h(i,"class","footer_note")},m(t,r){s(t,e,r),s(t,n,r),a&&a.m(t,r),s(t,o,r),s(t,i,r)},p(t,e){1537&e[0]&&(r=!t[9]&&!t[10]&&(t[0]?.length&&t[0].find(Tt)||t[0].find(St)||!t[0]?.length)),r?a?a.p(t,e):(a=xt(t),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(t){t&&l(e),t&&l(n),a&&a.d(t),t&&l(o),t&&l(i)}}}function xt(t){let e,n=[],o=new Map,i=t[2];const r=t=>t[35].id;for(let e=0;e<i.length;e+=1){let a=ut(t,i,e),s=r(a);o.set(s,n[e]=Pt(s,a))}return{c(){e=d("div");for(let t=0;t<n.length;t+=1)n[t].c();h(e,"id","payment_btn_container")},m(t,o){s(t,e,o);for(let t=0;t<n.length;t+=1)n[t].m(e,null)},p(t,a){270476&a[0]&&(i=t[2],n=function(t,e,n,o,i,r,a,s,l,d,c,u){let p=t.length,h=r.length,m=p;const f={};for(;m--;)f[t[m].key]=m;const y=[],b=new Map,g=new Map;for(m=h;m--;){const t=u(i,r,m),s=n(t);let l=a.get(s);l?o&&l.p(t,e):(l=d(s,t),l.c()),b.set(s,y[m]=l),s in f&&g.set(s,Math.abs(m-f[s]))}const v=new Set,w=new Set;function $(t){A(t,1),t.m(s,c),a.set(t.key,t),c=t.first,h--}for(;p&&h;){const e=y[h-1],n=t[p-1],o=e.key,i=n.key;e===n?(c=e.first,p--,h--):b.has(i)?!a.has(o)||v.has(o)?$(e):w.has(i)?p--:g.get(o)>g.get(i)?(w.add(o),$(e)):(v.add(i),p--):(l(n,a),p--)}for(;p--;){const e=t[p];b.has(e.key)||l(e,a)}for(;h;)$(y[h-1]);return y}(n,a,r,1,t,i,o,e,L,Pt,null,ut))},d(t){t&&l(e);for(let t=0;t<n.length;t+=1)n[t].d()}}}function kt(t){let e,n,o,i,r;return{c(){e=d("google-pay-button"),m(e,"class","payment_button"),m(e,"environment","TEST"),m(e,"button-type",n=t[3].type.toLowerCase()),m(e,"button-color","black"),m(e,"button-size-mode","fill"),m(e,"paymentrequest",o={apiVersion:2,apiVersionMinor:0,merchantInfo:{merchantName:t[3].merchantName,merchantId:t[35].gatewayMerchantId},allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:t[35].cardNetworks},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:t[35].gatewayId,gatewayMerchantId:t[35].gatewayMerchantId}}}],transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:t[3]?.total?.toString(),currencyCode:t[3]?.currencyCode?.toUpperCase(),countryCode:t[3]?.countryCode?.toUpperCase(),checkoutOption:"COMPLETE_IMMEDIATE_PURCHASE"}})},m(n,o){s(n,e,o),i||(r=p(e,"loadpaymentdata",t[29]),i=!0)},p(t,i){8&i[0]&&n!==(n=t[3].type.toLowerCase())&&m(e,"button-type",n),12&i[0]&&o!==(o={apiVersion:2,apiVersionMinor:0,merchantInfo:{merchantName:t[3].merchantName,merchantId:t[35].gatewayMerchantId},allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:t[35].cardNetworks},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:t[35].gatewayId,gatewayMerchantId:t[35].gatewayMerchantId}}}],transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:t[3]?.total?.toString(),currencyCode:t[3]?.currencyCode?.toUpperCase(),countryCode:t[3]?.countryCode?.toUpperCase(),checkoutOption:"COMPLETE_IMMEDIATE_PURCHASE"}})&&m(e,"paymentrequest",o)},d(t){t&&l(e),i=!1,r()}}}function Mt(t){let e,n,i,r,a;return{c(){e=d("hb-payment-paypal"),m(e,"style",t[7]),m(e,"class","payment_button"),m(e,"paypalid",n=t[35].paypalid),m(e,"total",i=t[3]?.total?.toString())},m(n,o){s(n,e,o),r||(a=[p(e,"paymentCompleted",t[27]),p(e,"cardChange",t[28])],r=!0)},p(t,o){128&o[0]&&m(e,"style",t[7]),4&o[0]&&n!==(n=t[35].paypalid)&&m(e,"paypalid",n),8&o[0]&&i!==(i=t[3]?.total?.toString())&&m(e,"total",i)},d(t){t&&l(e),r=!1,o(a)}}}function Pt(t,e){let n,o;function i(t,e){return"paypal"===t[35].id?Mt:"google"===t[35].id&&t[3].countryCode?kt:void 0}let r=i(e),c=r&&r(e);return{key:t,first:null,c(){n=d("div"),c&&c.c(),o=u(),h(n,"class","payment_button_container"),this.first=n},m(t,e){s(t,n,e),c&&c.m(n,null),a(n,o)},p(t,a){r===(r=i(e=t))&&c?c.p(e,a):(c&&c.d(1),c=r&&r(e),c&&(c.c(),c.m(n,o)))},d(t){t&&l(n),c&&c.d()}}}function _t(e){let n,o,i,r,c,p,m,f,y,b,g;function v(t,e){return t[1]?.fixed&&!t[9]?mt:t[1]?.fullName&&t[1]?.addressWithNumber&&!t[9]?ht:pt}let w=v(e),$=w(e),C=e[0]?.length&&yt(e);function x(t,e){return"yes"!==t[4]?Ct:$t}let k=x(e),M=k(e);return{c(){n=d("link"),o=u(),i=d("slot"),i.innerHTML='<h1 class="title" part="title">Checkout</h1>',r=u(),c=d("div"),p=d("div"),m=d("h3"),m.innerHTML='<i class="bi bi-send-fill"></i> Delivery',f=u(),$.c(),y=u(),C&&C.c(),b=u(),g=d("div"),M.c(),this.c=t,h(n,"rel","stylesheet"),h(n,"href","https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css"),h(i,"name","title"),h(m,"class","subtitle"),h(m,"part","subtitle"),h(c,"id","border_top"),h(g,"class","payment_title")},m(t,e){a(document.head,n),s(t,o,e),s(t,i,e),s(t,r,e),s(t,c,e),a(c,p),a(p,m),a(p,f),$.m(p,null),a(c,y),C&&C.m(c,null),s(t,b,e),s(t,g,e),M.m(g,null)},p(t,e){w===(w=v(t))&&$?$.p(t,e):($.d(1),$=w(t),$&&($.c(),$.m(p,null))),t[0]?.length?C?C.p(t,e):(C=yt(t),C.c(),C.m(c,null)):C&&(C.d(1),C=null),k===(k=x(t))&&M?M.p(t,e):(M.d(1),M=k(t),M&&(M.c(),M.m(g,null)))},i:t,o:t,d(t){l(n),t&&l(o),t&&l(i),t&&l(r),t&&l(c),$.d(),C&&C.d(),t&&l(b),t&&l(g),M.d()}}}const Tt=t=>t.selected,St=t=>t.standard,Et=t=>t.selected,Nt=t=>t.standard,Dt=t=>t.selected,It=t=>t.standard,At=t=>t.selected,Lt=t=>t.standard,Rt=t=>t.selected,Ot=t=>t.standard,zt=t=>t.selected,qt=t=>t.standard,jt=t=>t.selected,Vt=t=>t.standard;function Ht(t,e,n){var o;let i,{style:r}=e,a="",s="",{id:l}=e,{shipments:d}=e,{user:c}=e,{gateways:u}=e,{payment:p}=e,{completed:h}=e;const m=[{type:"radio",placeholder:"Insert your Full Name here...",id:"shipmentsolution",required:!0,label:"Shipment",validationTip:"This field cannot be empty.",params:{options:[]}}];let f,y,b="no",g="no";const v={type:"plain",total:0,currencyCode:"EUR",countryCode:"IT",merchantName:"merchant"};function C(t){for(const e of["fullName","cardNumber","CVV","expiration"])if(H.find((t=>t.id===e)))H[H.findIndex((t=>t.id===e))].value=t[e];else if(H.find((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))}))){const n=H.findIndex((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))})),o=H[n].params.columns.findIndex((t=>t.id===e));H[n].params.columns[o].value=t[e]}}function x(t){console.log("saveuser",t);const e={fullName:t.fullName,addressWithNumber:t.addressWithNumber,city:t.city,zip:t.zip,nationality:t.nationality};for(const e of Object.keys(t))if(Y.find((t=>t.id===e)))n(5,Y[Y.findIndex((t=>t.id===e))].value=t[e],Y);else if(Y.find((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))}))){const o=Y.findIndex((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))})),i=Y[o].params.columns.findIndex((t=>t.id===e));n(5,Y[o].params.columns[i].value=t[e],Y)}n(1,c=e),n(9,f=!1),n(11,b="no"),console.log("edited"),_("saveUser",c)}function k(t){console.log("saveShipment",t);const e=null==t?void 0:t.shipmentsolution;if(e&&d.find((t=>t.id===e))){d.forEach((t=>t.selected=!1));const t=d.findIndex((t=>t.id===e));n(0,d[t].selected=!0,d),n(10,y=!1),n(8,m[0].value=e,m),_("saveShipment",d[t])}n(12,g="no")}const M=w(),P=$();function _(t,e){P(t,e),M.dispatchEvent&&M.dispatchEvent(new CustomEvent(t,{detail:e}))}function T(t){n(4,h="yes"),_("paymentCompleted",{total:null==p?void 0:p.total,method:t,completed:!0})}U.addComponent({repoName:"@htmlbricks/hb-form",version:V.version}),U.addComponent({repoName:"@htmlbricks/hb-payment-paypal",version:V.version});return t.$$set=t=>{"style"in t&&n(20,r=t.style),"id"in t&&n(19,l=t.id),"shipments"in t&&n(0,d=t.shipments),"user"in t&&n(1,c=t.user),"gateways"in t&&n(2,u=t.gateways),"payment"in t&&n(3,p=t.payment),"completed"in t&&n(4,h=t.completed)},t.$$.update=()=>{if(7864383&t.$$.dirty[0]){if(r&&(n(22,i=lt(r)),n(6,a=U.getChildStyleToPass(i,null==dt?void 0:dt.vars)),n(7,s=U.getChildStyleToPass(i,null==ct?void 0:ct.vars))),l||n(19,l=null),h||n(4,h="no"),p?"string"==typeof p&&n(3,p=JSON.parse(p)||v):n(3,p=v),d?"string"==typeof d&&n(0,d=JSON.parse(d)||[]):n(0,d=[]),u){if("string"==typeof u){n(2,u=JSON.parse(u)||[]);for(const t of u)(null===n(21,o=t.cardNetworks)||void 0===o?void 0:o.length)||(t.cardNetworks=["VISA","MASTERCARD"])}}else n(2,u=[]);if(p.type||n(3,p.type="buy",p),c){if("string"==typeof c){n(1,c=JSON.parse(c));for(const t of Object.keys(c))if(Y.find((e=>e.id===t)))n(5,Y[Y.findIndex((e=>e.id===t))].value=c[t],Y);else if(Y.find((e=>{var n,o;return(null===(o=null===(n=e.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&e.params.columns.find((e=>e.id===t))}))){const e=Y.findIndex((e=>{var n,o;return(null===(o=null===(n=e.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&e.params.columns.find((e=>e.id===t))})),o=Y[e].params.columns.findIndex((e=>e.id===t));n(5,Y[e].params.columns[o].value=c[t],Y)}}}else n(1,c=null);n(8,m[0].params.options=d.map((t=>({value:t.id,label:t.label+" "+t.price+t.currency}))),m),(d.find((t=>t.selected))||d.find((t=>t.standard)))&&n(8,m[0].value=(d.find((t=>t.selected))||d.find((t=>t.standard))).id,m)}},[d,c,u,p,h,Y,a,s,m,f,y,b,g,C,x,k,function(){n(9,f=!0),n(10,y=!1)},function(){n(9,f=!1),n(10,y=!0)},T,l,r,o,i,t=>{x(t.detail)},()=>{n(11,b="yes"),setTimeout((()=>{n(11,b="no")}),200)},t=>{k(t.detail)},()=>{n(12,g="yes"),setTimeout((()=>{n(12,g="no")}),200)},t=>T("paypal"),t=>C(t.detail),t=>{T("google")}]}class Yt extends z{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");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{--bs-blue:var(--bs-primary,#07689f);--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:var(--bs-danger,#f67280);--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:var(--bs-warning,#ffc107);--bs-teal:#20c997;--bs-cyan:var(--bs-info,#a2d5f2);--bs-white:#fff;--bs-gray:var(--bs-secondary,#c9d6df);--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:var(--bs-secondary,#c9d6df);--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:var(--bs-primary,#07689f);--bs-secondary:var(--bs-secondary,#c9d6df);--bs-success:var(--bs-warning,#ffc107);--bs-info:var(--bs-info,#a2d5f2);--bs-warning:#ffc107;--bs-danger:var(--bs-danger,#f67280);--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--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}}h4,h3,h1{margin-top:0;margin-bottom:0.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media(min-width: 1200px){h1{font-size:2.5rem}}@media(min-width: 1200px){}h3{font-size:calc(1.3rem + 0.6vw)}@media(min-width: 1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + 0.3vw)}@media(min-width: 1200px){h4{font-size:1.5rem}}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button{text-transform:none}button{-webkit-appearance:button}button:not(:disabled){cursor:pointer}::-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){}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}.btn{display:inline-block;font-weight:400;line-height:1.5;color:#212529;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:#212529}.btn:focus{outline:0;box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25)}.btn:disabled{pointer-events:none;opacity:0.65}.btn-primary{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-primary:hover{color:#fff;background-color:#0b5ed7;border-color:#0a58ca}.btn-primary:focus{color:#fff;background-color:#0b5ed7;border-color:#0a58ca;box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:active{color:#fff;background-color:#0a58ca;border-color:#0a53be}.btn-primary:active:focus{box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:disabled{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-link{font-weight:400;color:var(--bs-primary,#07689f);text-decoration:underline}.btn-link:hover{color:#0a58ca}.btn-link:disabled{color:var(--bs-secondary,#c9d6df)}.btn-sm{padding:0.25rem 0.5rem;font-size:0.875rem;border-radius:0.2rem}@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{}:host{--edit-color:blue;--paypal-button-color:yellow;--hb-checkout-border:0.5px solid rgba(197, 197, 197, 0.808);font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px}#payment_completed_content{text-align:center}#payment_completed_title{margin:30px;text-transform:capitalize;font-size:2em;font-weight:bold}#payment_btn_container{display:flex}.payment_button_container{flex:1;margin:15px;display:inline-block;text-align:center}.payment_button{height:40px;width:100%;max-width:50vw}.detail_label{font-size:0.8em;font-weight:bold}.dataentry_key{margin-right:3px}.dataentry_key::after{content:":"}.detail_btn{float:right;margin-right:10px;color:var(--edit-color);font-weight:bold;text-transform:capitalize}.dataentry{line-height:30px}.footer_note{text-align:center;font-size:12px;padding:5px;line-height:30px}.subtitle{margin-bottom:30px}.title{text-align:center;border-bottom:var(--hb-checkout-border);padding-bottom:20px}.payment_title{margin-top:20px;border-top:var(--hb-checkout-border);padding-top:10px}</style>',O(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},Ht,_t,r,{style:20,id:19,shipments:0,user:1,gateways:2,payment:3,completed:4},null,[-1,-1]),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),N()))}static get observedAttributes(){return["style","id","shipments","user","gateways","payment","completed"]}get style(){return this.$$.ctx[20]}set style(t){this.$$set({style:t}),N()}get id(){return this.$$.ctx[19]}set id(t){this.$$set({id:t}),N()}get shipments(){return this.$$.ctx[0]}set shipments(t){this.$$set({shipments:t}),N()}get user(){return this.$$.ctx[1]}set user(t){this.$$set({user:t}),N()}get gateways(){return this.$$.ctx[2]}set gateways(t){this.$$set({gateways:t}),N()}get payment(){return this.$$.ctx[3]}set payment(t){this.$$set({payment:t}),N()}get completed(){return this.$$.ctx[4]}set completed(t){this.$$set({completed:t}),N()}}return customElements.define("hb-checkout",Yt),Yt}();
1
+ var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode&&t.parentNode.removeChild(t)}function d(t){return document.createElement(t)}function c(t){return document.createTextNode(t)}function u(){return c(" ")}function p(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function h(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function m(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:h(t,e,n)}function f(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function y(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function b(t){const e={};for(const n of t)e[n.name]=n.value;return e}let g;function v(t){g=t}function w(){if(!g)throw new Error("Function called outside component initialization");return g}function $(){const t=w();return(e,n,{cancelable:o=!1}={})=>{const i=t.$$.callbacks[e];if(i){const r=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,o,e),i}(e,n,{cancelable:o});return i.slice().forEach((e=>{e.call(t,r)})),!r.defaultPrevented}return!0}}const C=[],x=[],k=[],M=[],P=Promise.resolve();let _=!1;function T(t){k.push(t)}const S=new Set;let E=0;function N(){if(0!==E)return;const t=g;do{try{for(;E<C.length;){const t=C[E];E++,v(t),D(t.$$)}}catch(t){throw C.length=0,E=0,t}for(v(null),C.length=0,E=0;x.length;)x.pop()();for(let t=0;t<k.length;t+=1){const e=k[t];S.has(e)||(S.add(e),e())}k.length=0}while(C.length);for(;M.length;)M.pop()();_=!1,S.clear(),v(t)}function D(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const I=new Set;function A(t,e){t&&t.i&&(I.delete(t),t.i(e))}function L(t,e){t.d(1),e.delete(t.key)}function R(t,e){-1===t.$$.dirty[0]&&(C.push(t),_||(_=!0,P.then(N)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function O(r,a,s,d,c,u,p,h=[-1]){const m=g;v(r);const f=r.$$={fragment:null,ctx:[],props:u,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(m?m.$$.context:[])),callbacks:n(),dirty:h,skip_bound:!1,root:a.target||m.$$.root};p&&p(f.root);let y=!1;if(f.ctx=s?s(r,a.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return f.ctx&&c(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),y&&R(r,t)),e})):[],f.update(),y=!0,o(f.before_update),f.fragment=!!d&&d(f.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);f.fragment&&f.fragment.l(t),t.forEach(l)}else f.fragment&&f.fragment.c();a.intro&&A(r.$$.fragment),function(t,n,r,a){const{fragment:s,after_update:l}=t.$$;s&&s.m(n,r),a||T((()=>{const n=t.$$.on_mount.map(e).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),l.forEach(T)}(r,a.target,a.anchor,a.customElement),N()}v(m)}let z;"function"==typeof HTMLElement&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.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 q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function j(t){var e={exports:{}};return t(e,e.exports),e.exports}j((function(t,e){t.exports=function(){function t(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function n(t){return t.replace(/[A-Z]+/g,(t=>`-${t}`)).replace(/^-/,"").toLowerCase()}function o(t){return function(e,o){const i=t||n(o);e.addObservedAttribute&&e.addObservedAttribute(i),Object.defineProperty(e,o,{get(){return this.getAttribute(i)},set(t){null==t?this.removeAttribute(i):this.setAttribute(i,t),this.notifyPropertyChanged(o)},enumerable:!0,configurable:!0})}}function i(t){return t?o(t):function(t,e){Object.defineProperty(t,e,{get(){return this[`$__${e}`]},set(t){this[`$__${e}`]=t,this.notifyPropertyChanged(e)},enumerable:!0,configurable:!0})}}function r(t){return function(e,n){Object.defineProperty(e,t,{get(){return this[n]},set(t){this[n]=t},enumerable:!0,configurable:!1})}}let a={};function s(t){const e=a[t];if(e)return e;const n=new Promise(((e,n)=>{const o=document.createElement("script");o.src=t,o.async=!0;const i=()=>{e()},r=()=>{o.removeEventListener("load",i),o.removeEventListener("error",r),delete a[t],o.remove(),n(new Error(`Unable to load script ${t}`))};o.addEventListener("load",i),o.addEventListener("error",r),document.body.appendChild(o)}));return a[t]=n,n}class l{constructor(t){this.handleClick=t=>e(this,void 0,void 0,(function*(){const e=this.config;if(!e)throw new Error("google-pay-button: Missing configuration");const n=this.createLoadPaymentDataRequest(e);try{if(e.onClick&&e.onClick(t),t.defaultPrevented)return;const o=yield this.client.loadPaymentData(n);e.onLoadPaymentData&&e.onLoadPaymentData(o)}catch(t){"CANCELED"===t.statusCode?e.onCancel&&e.onCancel(t):e.onError?e.onError(t):console.error(t)}})),this.options=t}getElement(){return this.element}isGooglePayLoaded(){var t,e;return"google"in(window||q)&&!!(null===(e=null===(t=null===google||void 0===google?void 0:google.payments)||void 0===t?void 0:t.api)||void 0===e?void 0:e.PaymentsClient)}mount(t){var n;return e(this,void 0,void 0,(function*(){if(!this.isGooglePayLoaded())try{yield s("https://pay.google.com/gp/p/js/pay.js")}catch(t){(null===(n=this.config)||void 0===n?void 0:n.onError)?this.config.onError(t):console.error(t)}this.element=t,t&&(this.appendStyles(),this.config&&this.updateElement())}))}unmount(){this.element=void 0}configure(t){let e;return this.config=t,this.oldInvalidationValues&&!this.isClientInvalidated(t)||(e=this.updateElement()),this.oldInvalidationValues=this.getInvalidationValues(t),null!=e?e:Promise.resolve()}createClientOptions(t){const e={environment:t.environment,merchantInfo:this.createMerchantInfo(t)};return(t.onPaymentDataChanged||t.onPaymentAuthorized)&&(e.paymentDataCallbacks={},t.onPaymentDataChanged&&(e.paymentDataCallbacks.onPaymentDataChanged=e=>t.onPaymentDataChanged(e)||{}),t.onPaymentAuthorized&&(e.paymentDataCallbacks.onPaymentAuthorized=e=>t.onPaymentAuthorized(e)||{})),e}createIsReadyToPayRequest(t){const e=t.paymentRequest;return{apiVersion:e.apiVersion,apiVersionMinor:e.apiVersionMinor,allowedPaymentMethods:e.allowedPaymentMethods,existingPaymentMethodRequired:t.existingPaymentMethodRequired}}createLoadPaymentDataRequest(t){return Object.assign(Object.assign({},t.paymentRequest),{merchantInfo:this.createMerchantInfo(t)})}createMerchantInfo(t){const e=Object.assign({},t.paymentRequest.merchantInfo);return e.softwareInfo||(e.softwareInfo={id:this.options.softwareInfoId,version:this.options.softwareInfoVersion}),e}isMounted(){return null!=this.element&&!1!==this.element.isConnected}removeButton(){if(this.element instanceof ShadowRoot||this.element instanceof Element)for(const t of Array.from(this.element.children))"STYLE"!==t.tagName&&t.remove()}updateElement(){return e(this,void 0,void 0,(function*(){if(!this.isMounted())return;const t=this.getElement();if(!this.config)throw new Error("google-pay-button: Missing configuration");this.removeButton(),this.client=new google.payments.api.PaymentsClient(this.createClientOptions(this.config));const e={buttonType:this.config.buttonType,buttonColor:this.config.buttonColor,buttonSizeMode:this.config.buttonSizeMode,buttonLocale:this.config.buttonLocale,onClick:this.handleClick,allowedPaymentMethods:this.config.paymentRequest.allowedPaymentMethods},n=t.getRootNode();n instanceof ShadowRoot&&(e.buttonRootNode=n);const o=this.client.createButton(e);this.setClassName(t,[t.className,"not-ready"]),t.appendChild(o);let i,r=!1;try{i=yield this.client.isReadyToPay(this.createIsReadyToPayRequest(this.config)),r=i.result&&!this.config.existingPaymentMethodRequired||i.result&&i.paymentMethodPresent&&this.config.existingPaymentMethodRequired||!1}catch(t){this.config.onError?this.config.onError(t):console.error(t)}if(this.isMounted()){if(r){try{this.client.prefetchPaymentData(this.createLoadPaymentDataRequest(this.config))}catch(t){console.log("Error with prefetch",t)}this.setClassName(t,(t.className||"").split(" ").filter((t=>t&&"not-ready"!==t)))}if((this.isReadyToPay!==(null==i?void 0:i.result)||this.paymentMethodPresent!==(null==i?void 0:i.paymentMethodPresent))&&(this.isReadyToPay=!!(null==i?void 0:i.result),this.paymentMethodPresent=null==i?void 0:i.paymentMethodPresent,this.config.onReadyToPayChange)){const t={isButtonVisible:r,isReadyToPay:this.isReadyToPay};this.paymentMethodPresent&&(t.paymentMethodPresent=this.paymentMethodPresent),this.config.onReadyToPayChange(t)}}}))}setClassName(t,e){const n=e.filter((t=>t)).join(" ");n?t.className=n:t.removeAttribute("class")}appendStyles(){var t,e,n;if("undefined"==typeof document)return;const o=null===(t=this.element)||void 0===t?void 0:t.getRootNode(),i=`default-google-style-${this.options.cssSelector.replace(/[^\w-]+/g,"")}-${null===(e=this.config)||void 0===e?void 0:e.buttonLocale}`;if(o&&!(null===(n=o.getElementById)||void 0===n?void 0:n.call(o,i))){const t=document.createElement("style");t.id=i,t.type="text/css",t.innerHTML=`\n ${this.options.cssSelector} {\n display: inline-block;\n }\n ${this.options.cssSelector}.not-ready {\n width: 0;\n height: 0;\n overflow: hidden;\n }\n `,o instanceof Document&&o.head?o.head.appendChild(t):o.appendChild(t)}}isClientInvalidated(t){return!this.oldInvalidationValues||this.getInvalidationValues(t).some(((t,e)=>t!==this.oldInvalidationValues[e]))}getInvalidationValues(t){var e,n;return[t.environment,t.existingPaymentMethodRequired,!!t.onPaymentDataChanged,!!t.onPaymentAuthorized,t.buttonColor,t.buttonType,t.buttonLocale,t.buttonSizeMode,t.paymentRequest.merchantInfo.merchantId,t.paymentRequest.merchantInfo.merchantName,null===(e=t.paymentRequest.merchantInfo.softwareInfo)||void 0===e?void 0:e.id,null===(n=t.paymentRequest.merchantInfo.softwareInfo)||void 0===n?void 0:n.version,t.paymentRequest.allowedPaymentMethods]}}function d(t,e=0){let n;return function(...o){return window.clearTimeout(n),new Promise((i=>{n=window.setTimeout((()=>{const e=(n=void 0,t(...o));i(e)}),e)}))}}class c extends HTMLElement{constructor(){super(...arguments),this.manager=new l({cssSelector:"google-pay-button",softwareInfoId:"@google-pay/button-element",softwareInfoVersion:"3.0.5"}),this.initializeButton=d((()=>{if(!this.assertRequiredProperty("paymentRequest"))return;if(!this.assertRequiredProperty("environment"))return;const t={paymentRequest:this.paymentRequest,environment:this.environment,existingPaymentMethodRequired:this.existingPaymentMethodRequired,onPaymentDataChanged:this.onPaymentDataChanged,onPaymentAuthorized:this.onPaymentAuthorized,buttonColor:this.buttonColor,buttonType:this.buttonType,buttonSizeMode:this.buttonSizeMode,buttonLocale:this.buttonLocale,onReadyToPayChange:t=>{this.onReadyToPayChange&&this.onReadyToPayChange(t),this.dispatch("readytopaychange",t)},onCancel:t=>{this.onCancel&&this.onCancel(t),this.dispatch("cancel",t)},onError:t=>{var e;this.onError&&(null===(e=this.onError)||void 0===e||e.call(this,t)),this.dispatchEvent(new ErrorEvent("error",{error:t}))},onLoadPaymentData:t=>{this.onLoadPaymentData&&this.onLoadPaymentData(t),this.dispatch("loadpaymentdata",t)},onClick:t=>{var e;this.onClick&&(null===(e=this.onClick)||void 0===e||e.call(this,t))}};this.manager.configure(t)}))}get isReadyToPay(){return this.manager.isReadyToPay}assertRequiredProperty(t){return null!=this[t]||(this.throwError(Error(`Required property not set: ${t}`)),!1)}throwError(t){throw t}static get observedAttributes(){return c._observedAttributes}addObservedAttribute(t){c._observedAttributes.push(t)}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!1,detail:e}))}connectedCallback(){return e(this,void 0,void 0,(function*(){return yield this.manager.mount(this),this.initializeButton()}))}disconnectedCallback(){this.manager.unmount()}attributeChangedCallback(t){return this.initializeButton()}notifyPropertyChanged(t){return this.initializeButton()}}return c._observedAttributes=[],t([i(),r("paymentrequest")],c.prototype,"paymentRequest",void 0),t([o()],c.prototype,"environment",void 0),t([function(t,e){const o=n(e);t.addObservedAttribute&&t.addObservedAttribute(o),Object.defineProperty(t,e,{get(){return this.hasAttribute(o)},set(t){t?this.setAttribute(o,""):this.removeAttribute(o),this.notifyPropertyChanged(e)},enumerable:!0,configurable:!0})},r("existingpaymentmethodrequired")],c.prototype,"existingPaymentMethodRequired",void 0),t([o(),r("buttoncolor")],c.prototype,"buttonColor",void 0),t([o(),r("buttontype")],c.prototype,"buttonType",void 0),t([o(),r("buttonsizemode")],c.prototype,"buttonSizeMode",void 0),t([o(),r("buttonlocale")],c.prototype,"buttonLocale",void 0),t([i(),r("paymentDataChangedCallback"),r("paymentdatachangedcallback"),r("onpaymentdatachanged")],c.prototype,"onPaymentDataChanged",void 0),t([i(),r("paymentAuthorizedCallback"),r("paymentauthorizedcallback"),r("onpaymentauthorized")],c.prototype,"onPaymentAuthorized",void 0),t([r("readyToPayChangeCallback"),r("readytopaychangecallback"),r("onreadytopaychange")],c.prototype,"onReadyToPayChange",void 0),t([r("loadPaymentDataCallback"),r("loadpaymentdatacallback"),r("onloadpaymentdata")],c.prototype,"onLoadPaymentData",void 0),t([r("cancelCallback"),r("cancelcallback"),r("oncancel")],c.prototype,"onCancel",void 0),t([r("errorCallback"),r("errorcallback"),r("onerror")],c.prototype,"onError",void 0),t([r("clickCallback"),r("clickcallback"),r("onclick")],c.prototype,"onClick",void 0),customElements.define("google-pay-button",c),c}()}));var V={name:"@htmlbricks/hb-checkout",displayName:"Svelte Payment WebComponent",description:"Svelte Payment WebComponent",version:"0.19.17",main:"release/release.js",publishConfig:{access:"public"},author:"Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",authorUrl:"https://dariocaruso.info",license:"MIT","license-docs":"CC BY 4.0","license-translations":"CC BY 4.0","license-images":"CC BY-NC 4.0",engines:{node:">=16.0.0"},scripts:{start:"sirv dist",dev:"rm -rf ./dist && rollup -c -w",build:"rm -rf ./dist && rollup -c","generate-manifest":"npm run generate-schemes && monorepo-wc-packages-manifester --dir $PWD","generate-component-schema":"ts-json-schema-generator --type 'Component' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json","generate-events-schema":"ts-json-schema-generator --type 'Events' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent_events.type.d.json","generate-schemes":"npm run generate-events-schema && npm run generate-component-schema",copydest:"rm -rf release && mkdir -p release && mkdir -p release && cp dist/* ./release/","build-extra":"tsc --moduleResolution node --module es2020 --esModuleInterop true --outDir dist --sourceMap --skipLibCheck extra/*","build:release":"PRODUCTION=true npm run build && npm run build-extra && npm run generate-manifest && npm run copydest",prepublish:"npm run build:release"},devDependencies:{"@rollup/plugin-alias":"^3.1.2","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^4.0.0","@rollup/plugin-typescript":"^8.2.1","@tsconfig/svelte":"^1.0.10","@types/node":"^16.7.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0",eslint:"^7.25.0","eslint-plugin-jsdoc":"^33.0.0","eslint-plugin-svelte3":"^3.2.0","monorepo-wc-packages-manifester":"^0.0.3","node-sass":"^6.0.1",postcss:"^8.2.13","postcss-load-config":"^3.0.1",prettier:"^2.8.4",rollup:"^2.46.0","rollup-plugin-copy":"^3.4.0","rollup-plugin-css-only":"^3.1.0","rollup-plugin-livereload":"^2.0.0","rollup-plugin-svelte":"^7.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-ts-paths":"^1.0.5","rollup-plugin-typescript2":"^0.31.1",sass:"^1.32.12","sirv-cli":"^1.0.11",svelte:"^3.46.2","svelte-check":"^1.5.2","svelte-preprocess":"^4.7.2","ts-json-schema-generator":"^0.98.0","ts-node":"^9.1.1",tslib:"^2.2.0",ttypescript:"^1.5.12",typescript:"^4.2.4","typescript-transform-paths":"^2.2.3","wc-js-utils":"^0.0.1"},dependencies:{"@google-pay/button-element":"^3.0.0","@htmlbricks/hb-form":"^0.19.17","@htmlbricks/hb-payment-paypal":"^0.19.17",dayjs:"^1.10.7",debounce:"^1.2.1"},keywords:["svelte","svelte-webcomponents","webcomponents","html5-webcomponents"],contributors:[],gitHead:"249d220ad446f28ec12f891a85ddc5b7574197f7"};const H=[{type:"text",placeholder:"Insert your full Name name here...",id:"fullName",required:!0,label:"Full Name",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert your Credit Card Number here...",id:"cardNumber",required:!0,label:"Card Number",validationTip:"This field cannot be empty."},{id:"name-row2",type:"row",params:{columns:[{type:"text",placeholder:"Insert card CVV here...",id:"CVV",required:!0,label:"CVV",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert card expiration here...",id:"expiration",required:!0,label:"Scadenza",validationTip:"This field cannot be empty."}]}}],Y=[{type:"text",placeholder:"Insert your Full Name here...",id:"fullName",required:!0,label:"Full Name",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert your Street/Square address with number...",id:"addressWithNumber",required:!0,label:"Street/Square/...",validationTip:"This field cannot be empty."},{id:"name-row2",type:"row",params:{columns:[{type:"text",placeholder:"Insert your nationality here...",id:"nationality",required:!0,label:"Nationality",validationTip:"This field cannot be empty."},{type:"text",placeholder:"Insert your city name here...",id:"city",required:!0,label:"City",validationTip:"This field cannot be empty."},{type:"number",placeholder:"Insert your zip code here...",id:"zip",required:!0,label:"Zip",validationTip:"This field cannot be empty."}]}}];var W=j((function(t,e){t.exports=function(){var t=1e3,e=6e4,n=36e5,o="millisecond",i="second",r="minute",a="hour",s="day",l="week",d="month",c="quarter",u="year",p="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},b=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},g={s:b,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+b(o,2,"0")+":"+b(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var o=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(o,d),r=n-i<0,a=e.clone().add(o+(r?-1:1),d);return+(-(o+(n-i)/(r?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:d,y:u,w:l,d:s,D:p,h:a,m:r,s:i,ms:o,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",w={};w[v]=y;var $=function(t){return t instanceof M},C=function t(e,n,o){var i;if(!e)return v;if("string"==typeof e){var r=e.toLowerCase();w[r]&&(i=r),n&&(w[r]=n,i=r);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var s=e.name;w[s]=e,i=s}return!o&&i&&(v=i),i||!o&&v},x=function(t,e){if($(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new M(n)},k=g;k.l=C,k.i=$,k.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var M=function(){function y(t){this.$L=C(t.locale,null,!0),this.parse(t)}var b=y.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(m);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return k},b.isValid=function(){return!(this.$d.toString()===h)},b.isSame=function(t,e){var n=x(t);return this.startOf(e)<=n&&n<=this.endOf(e)},b.isAfter=function(t,e){return x(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<x(t)},b.$g=function(t,e,n){return k.u(t)?this[e]:this.set(n,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var n=this,o=!!k.u(e)||e,c=k.p(t),h=function(t,e){var i=k.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return o?i:i.endOf(s)},m=function(t,e){return k.w(n.toDate()[t].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},f=this.$W,y=this.$M,b=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case u:return o?h(1,0):h(31,11);case d:return o?h(1,y):h(0,y+1);case l:var v=this.$locale().weekStart||0,w=(f<v?f+7:f)-v;return h(o?b-w:b+(6-w),y);case s:case p:return m(g+"Hours",0);case a:return m(g+"Minutes",1);case r:return m(g+"Seconds",2);case i:return m(g+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var n,l=k.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[p]=c+"Date",n[d]=c+"Month",n[u]=c+"FullYear",n[a]=c+"Hours",n[r]=c+"Minutes",n[i]=c+"Seconds",n[o]=c+"Milliseconds",n)[l],m=l===s?this.$D+(e-this.$W):e;if(l===d||l===u){var f=this.clone().set(p,1);f.$d[h](m),f.init(),this.$d=f.set(p,Math.min(this.$D,f.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[k.p(t)]()},b.add=function(o,c){var p,h=this;o=Number(o);var m=k.p(c),f=function(t){var e=x(h);return k.w(e.date(e.date()+Math.round(t*o)),h)};if(m===d)return this.set(d,this.$M+o);if(m===u)return this.set(u,this.$y+o);if(m===s)return f(1);if(m===l)return f(7);var y=(p={},p[r]=e,p[a]=n,p[i]=t,p)[m]||1,b=this.$d.getTime()+o*y;return k.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=t||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),r=this.$H,a=this.$m,s=this.$M,l=n.weekdays,d=n.months,c=function(t,n,i,r){return t&&(t[n]||t(e,o))||i[n].slice(0,r)},u=function(t){return k.s(r%12||12,t,"0")},p=n.meridiem||function(t,e,n){var o=t<12?"AM":"PM";return n?o.toLowerCase():o},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:k.s(s+1,2,"0"),MMM:c(n.monthsShort,s,d,3),MMMM:c(d,s),D:this.$D,DD:k.s(this.$D,2,"0"),d:String(this.$W),dd:c(n.weekdaysMin,this.$W,l,2),ddd:c(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(r),HH:k.s(r,2,"0"),h:u(1),hh:u(2),a:p(r,a,!0),A:p(r,a,!1),m:String(a),mm:k.s(a,2,"0"),s:String(this.$s),ss:k.s(this.$s,2,"0"),SSS:k.s(this.$ms,3,"0"),Z:i};return o.replace(f,(function(t,e){return e||m[t]||i.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(o,p,h){var m,f=k.p(p),y=x(o),b=(y.utcOffset()-this.utcOffset())*e,g=this-y,v=k.m(this,y);return v=(m={},m[u]=v/12,m[d]=v,m[c]=v/3,m[l]=(g-b)/6048e5,m[s]=(g-b)/864e5,m[a]=g/n,m[r]=g/e,m[i]=g/t,m)[f]||g,h?v:k.a(v)},b.daysInMonth=function(){return this.endOf(d).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),o=C(t,e,!0);return o&&(n.$L=o),n},b.clone=function(){return k.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},y}(),P=M.prototype;return x.prototype=P,[["$ms",o],["$s",i],["$m",r],["$H",a],["$W",s],["$M",d],["$y",u],["$D",p]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),x.extend=function(t,e){return t.$i||(t(e,M,x),t.$i=!0),x},x.locale=C,x.isDayjs=$,x.unix=function(t){return x(1e3*t)},x.en=w[v],x.Ls=w,x.p={},x}()})),U=j((function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,i="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var r=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(i+="".concat(n,":").concat(t[n],";"))},a=0,s=Object.keys(t);a<s.length;a++){r(s[a])}return i},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var i=document.createElement("script");i.id=n+"-script",i.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(i.src="".concat(t.local)),document.head.appendChild(i)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,i,r="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(r=null===(i=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===i?void 0:i.toLowerCase()),r},t.getDictionaryWord=function(e,n,o){var i;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(i=n[o])||void 0===i?void 0:i[e]))return n[o][e];var r="",a=t.getDefaultLang();if(!o||a!==o){var s=null==n?void 0:n[a];(null==s?void 0:s[e])&&(r=s[e])}return r},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n})),F=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,B=/\n/g,J=/^\s*/,G=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Z=/^:\s*/,K=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Q=/^[;\s]*/,X=/^\s+|\s+$/g,tt="\n",et="/",nt="*",ot="",it="comment",rt="declaration",at=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function i(t){var e=t.match(B);e&&(n+=e.length);var i=t.lastIndexOf(tt);o=~i?t.length-i:o+t.length}function r(){var t={line:n,column:o};return function(e){return e.position=new a(t),d(),e}}function a(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function s(i){var r=new Error(e.source+":"+n+":"+o+": "+i);if(r.reason=i,r.filename=e.source,r.line=n,r.column=o,r.source=t,!e.silent)throw r}function l(e){var n=e.exec(t);if(n){var o=n[0];return i(o),t=t.slice(o.length),n}}function d(){l(J)}function c(t){var e;for(t=t||[];e=u();)!1!==e&&t.push(e);return t}function u(){var e=r();if(et==t.charAt(0)&&nt==t.charAt(1)){for(var n=2;ot!=t.charAt(n)&&(nt!=t.charAt(n)||et!=t.charAt(n+1));)++n;if(n+=2,ot===t.charAt(n-1))return s("End of comment missing");var a=t.slice(2,n-2);return o+=2,i(a),t=t.slice(n),o+=2,e({type:it,comment:a})}}function p(){var t=r(),e=l(G);if(e){if(u(),!l(Z))return s("property missing ':'");var n=l(K),o=t({type:rt,property:st(e[0].replace(F,ot)),value:n?st(n[0].replace(F,ot)):ot});return l(Q),o}}return a.prototype.content=t,d(),function(){var t,e=[];for(c(e);t=p();)!1!==t&&(e.push(t),c(e));return e}()};function st(t){return t?t.replace(X,ot):ot}var lt=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var i,r,a=at(t),s="function"==typeof e,l=0,d=a.length;l<d;l++)i=(n=a[l]).property,r=n.value,s?e(i,r,n):r&&(o||(o={}),o[i]=r);return o},dt={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[{name:"invalid-feedback",description:""},{name:"main_button",description:""},{name:"button_container",description:""}]},ct={vars:[{name:"--hb-checkout-border",defaultValue:"0.5px solid rgba(197, 197, 197, 0.808)",description:"",valueType:"string"}],parts:[{name:"btn",description:"paypal button css"}]};function ut(t,e,n){const o=t.slice();return o[35]=e[n],o}function pt(t){let e,n,i,r,c,f,b,g,v,w;return{c(){e=d("h4"),e.textContent="Address",n=u(),i=d("div"),r=d("hb-form"),f=u(),b=d("div"),g=d("button"),g.textContent="continue",h(e,"class","subtitle"),h(e,"part","subtitle"),m(r,"hide_submit","yes"),m(r,"style",t[6]),m(r,"schema",c=JSON.stringify(t[5])),m(r,"submitted",t[11]),y(g,"width","100%"),y(g,"margin-bottom","10px"),h(g,"class","btn btn-primary")},m(o,l){s(o,e,l),s(o,n,l),s(o,i,l),a(i,r),a(i,f),a(i,b),a(b,g),v||(w=[p(r,"submit",t[23]),p(g,"click",t[24])],v=!0)},p(t,e){64&e[0]&&m(r,"style",t[6]),32&e[0]&&c!==(c=JSON.stringify(t[5]))&&m(r,"schema",c),2048&e[0]&&m(r,"submitted",t[11])},d(t){t&&l(e),t&&l(n),t&&l(i),v=!1,o(w)}}}function ht(t){let e,n,o,i,r,m,y,b,g,v,w,$,C,x,k,M=t[1].fullName+"",P=`${t[1].addressWithNumber}, ${t[1].city}, ${t[1].zip},${t[1].nationality}`;return{c(){e=d("h4"),n=d("button"),n.textContent="edit",o=u(),i=d("div"),r=d("div"),m=d("span"),m.textContent="Name",y=d("span"),b=c(M),g=u(),v=d("div"),w=d("span"),w.textContent="Address",$=d("span"),C=c(P),h(n,"class","btn btn-sm detail_btn"),h(e,"class","subtitle"),h(e,"part","subtitle"),h(m,"class","dataentry_key"),h(y,"class","dataentry_value"),h(r,"class","dataentry"),h(w,"class","dataentry_key"),h($,"class","dataentry_value"),h(v,"class","dataentry"),h(i,"class","dataentrycontainer")},m(l,d){s(l,e,d),a(e,n),s(l,o,d),s(l,i,d),a(i,r),a(r,m),a(r,y),a(y,b),a(i,g),a(i,v),a(v,w),a(v,$),a($,C),x||(k=p(n,"click",t[16]),x=!0)},p(t,e){2&e[0]&&M!==(M=t[1].fullName+"")&&f(b,M),2&e[0]&&P!==(P=`${t[1].addressWithNumber}, ${t[1].city}, ${t[1].zip},${t[1].nationality}`)&&f(C,P)},d(t){t&&l(e),t&&l(o),t&&l(i),x=!1,k()}}}function mt(t){let e,n,o=t[1].fullName&&ft(t);return{c(){e=d("div"),n=d("slot"),o&&o.c(),h(n,"name","userinfo"),h(e,"class","dataentrycontainer")},m(t,i){s(t,e,i),a(e,n),o&&o.m(n,null)},p(t,e){t[1].fullName?o?o.p(t,e):(o=ft(t),o.c(),o.m(n,null)):o&&(o.d(1),o=null)},d(t){t&&l(e),o&&o.d()}}}function ft(t){let e,n,o,i=t[1].fullName+"";return{c(){e=d("div"),n=d("span"),o=c(i),h(n,"class","dataentry_value"),h(e,"class","dataentry")},m(t,i){s(t,e,i),a(e,n),a(n,o)},p(t,e){2&e[0]&&i!==(i=t[1].fullName+"")&&f(o,i)},d(t){t&&l(e)}}}function yt(t){let e,n;function o(t,e){return 1025&e[0]&&(n=null),(t[1]?.fullName&&t[1]?.addressWithNumber||t[1]?.fixed)&&!t[9]?gt:(null==n&&(n=!(t[10]||!t[0].find(Dt)&&!t[0].find(It))),n?bt:void 0)}let i=o(t,[-1,-1]),r=i&&i(t);return{c(){e=d("div"),r&&r.c(),h(e,"id","shipment_separator")},m(t,n){s(t,e,n),r&&r.m(e,null)},p(t,n){i===(i=o(t,n))&&r?r.p(t,n):(r&&r.d(1),r=i&&i(t),r&&(r.c(),r.m(e,null)))},d(t){t&&l(e),r&&r.d()}}}function bt(t){let e,n,o,i,r,m,b,g,v,w,$,C,x,k,M,P,_=(t[0].find(zt)||t[0].find(qt)).price+"",T=(t[0].find(jt)||t[0].find(Vt)).arriveDate+"";return{c(){e=d("h4"),n=d("span"),n.innerHTML='<i class="bi bi-truck"></i> Shipment Service',o=d("button"),o.textContent="edit",i=u(),r=d("div"),m=d("div"),b=d("span"),b.textContent="Shipping Fee",g=d("span"),v=c(_),w=u(),$=d("div"),C=d("span"),C.textContent="Shipping Time",x=d("span"),k=c(T),h(n,"class","detail_label"),h(o,"class","btn btn-sm detail_btn"),y(e,"margin-top","20px"),h(e,"class","subtitle"),h(e,"part","subtitle"),h(b,"class","dataentry_key"),h(g,"class","dataentry_value"),h(m,"class","dataentry"),h(C,"class","dataentry_key"),h(x,"class","dataentry_value"),h($,"class","dataentry"),h(r,"class","dataentrycontainer")},m(l,d){s(l,e,d),a(e,n),a(e,o),s(l,i,d),s(l,r,d),a(r,m),a(m,b),a(m,g),a(g,v),a(r,w),a(r,$),a($,C),a($,x),a(x,k),M||(P=p(o,"click",t[17]),M=!0)},p(t,e){1&e[0]&&_!==(_=(t[0].find(zt)||t[0].find(qt)).price+"")&&f(v,_),1&e[0]&&T!==(T=(t[0].find(jt)||t[0].find(Vt)).arriveDate+"")&&f(k,T)},d(t){t&&l(e),t&&l(i),t&&l(r),M=!1,P()}}}function gt(t){let e,n;function o(t,n){return 1025&n[0]&&(e=null),null==e&&(e=!(t[10]||!t[0].find(Et)&&!t[0].find(Nt))),e?wt:vt}let i=o(t,[-1,-1]),r=i(t);return{c(){r.c(),n=c("")},m(t,e){r.m(t,e),s(t,n,e)},p(t,e){i===(i=o(t,e))&&r?r.p(t,e):(r.d(1),r=i(t),r&&(r.c(),r.m(n.parentNode,n)))},d(t){r.d(t),t&&l(n)}}}function vt(t){let e,n,i,r,c,f,b,g,v,w;return{c(){e=d("h4"),e.innerHTML='<i class="bi bi-truck"></i> Shipment Service',n=u(),i=d("div"),r=d("hb-form"),f=u(),b=d("div"),g=d("button"),g.textContent="continue",h(e,"class","subtitle"),h(e,"part","subtitle"),y(e,"margin-top","20px"),m(r,"hide_submit","yes"),m(r,"style",t[6]),m(r,"schema",c=JSON.stringify(t[8])),m(r,"submitted",t[12]),y(g,"width","100%"),h(g,"class","btn btn-primary")},m(o,l){s(o,e,l),s(o,n,l),s(o,i,l),a(i,r),a(i,f),a(i,b),a(b,g),v||(w=[p(r,"submit",t[25]),p(g,"click",t[26])],v=!0)},p(t,e){64&e[0]&&m(r,"style",t[6]),256&e[0]&&c!==(c=JSON.stringify(t[8]))&&m(r,"schema",c),4096&e[0]&&m(r,"submitted",t[12])},d(t){t&&l(e),t&&l(n),t&&l(i),v=!1,o(w)}}}function wt(t){let e,n,o,i,r,m,b,g,v,w,$,C,x,k,M,P,_=(t[0].find(At)||t[0].find(Lt)).price+"",T=W((t[0].find(Rt)||t[0].find(Ot)).arriveDate).format()+"";return{c(){e=d("h4"),n=d("span"),n.innerHTML='<i class="bi bi-truck"></i> Shipment Service',o=d("button"),o.textContent="edit",i=u(),r=d("div"),m=d("div"),b=d("span"),b.textContent="Shipping Fee",g=d("span"),v=c(_),w=u(),$=d("div"),C=d("span"),C.textContent="Arrive",x=d("span"),k=c(T),h(n,"class","detail_label"),h(o,"class","btn btn-sm detail_btn"),y(e,"margin-top","20px"),h(e,"class","subtitle"),h(e,"part","subtitle"),h(b,"class","dataentry_key"),h(g,"class","dataentry_value"),h(m,"class","dataentry"),h(C,"class","dataentry_key"),h(x,"class","dataentry_value"),h($,"class","dataentry"),h(r,"class","dataentrycontainer")},m(l,d){s(l,e,d),a(e,n),a(e,o),s(l,i,d),s(l,r,d),a(r,m),a(m,b),a(m,g),a(g,v),a(r,w),a(r,$),a($,C),a($,x),a(x,k),M||(P=p(o,"click",t[17]),M=!0)},p(t,e){1&e[0]&&_!==(_=(t[0].find(At)||t[0].find(Lt)).price+"")&&f(v,_),1&e[0]&&T!==(T=W((t[0].find(Rt)||t[0].find(Ot)).arriveDate).format()+"")&&f(k,T)},d(t){t&&l(e),t&&l(i),t&&l(r),M=!1,P()}}}function $t(t){let e,n,o,i,r,p,m,y,b,g=t[3].total+"";return{c(){e=d("slot"),n=d("div"),o=d("div"),o.textContent="payment completed",i=u(),r=d("div"),p=c("Total: "),m=c(g),y=u(),b=d("div"),b.innerHTML='<button class="btn btn-link">invoice</button>',h(o,"id","payment_completed_title"),h(r,"id","payment_completed_content"),h(b,"id","payment_completed_footer"),h(n,"id","payment_completed_content"),h(e,"name","payment_completed")},m(t,l){s(t,e,l),a(e,n),a(n,o),a(n,i),a(n,r),a(r,p),a(r,m),a(n,y),a(n,b)},p(t,e){8&e[0]&&g!==(g=t[3].total+"")&&f(m,g)},d(t){t&&l(e)}}}function Ct(t){let e,n,o,i,r=!t[9]&&!t[10]&&(t[0]?.length&&t[0].find(Tt)||t[0].find(St)||!t[0]?.length),a=r&&xt(t);return{c(){e=d("h3"),e.innerHTML='<i class="bi bi-wallet2"></i> Payment Method',n=u(),a&&a.c(),o=u(),i=d("div"),i.innerHTML='<slot name="payment_terms">By Clicking..<button class="btn btn-default">Terms and conditions</button></slot>',h(e,"class","subtitle"),h(e,"part","subtitle"),h(i,"class","footer_note")},m(t,r){s(t,e,r),s(t,n,r),a&&a.m(t,r),s(t,o,r),s(t,i,r)},p(t,e){1537&e[0]&&(r=!t[9]&&!t[10]&&(t[0]?.length&&t[0].find(Tt)||t[0].find(St)||!t[0]?.length)),r?a?a.p(t,e):(a=xt(t),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(t){t&&l(e),t&&l(n),a&&a.d(t),t&&l(o),t&&l(i)}}}function xt(t){let e,n=[],o=new Map,i=t[2];const r=t=>t[35].id;for(let e=0;e<i.length;e+=1){let a=ut(t,i,e),s=r(a);o.set(s,n[e]=Pt(s,a))}return{c(){e=d("div");for(let t=0;t<n.length;t+=1)n[t].c();h(e,"id","payment_btn_container")},m(t,o){s(t,e,o);for(let t=0;t<n.length;t+=1)n[t].m(e,null)},p(t,a){270476&a[0]&&(i=t[2],n=function(t,e,n,o,i,r,a,s,l,d,c,u){let p=t.length,h=r.length,m=p;const f={};for(;m--;)f[t[m].key]=m;const y=[],b=new Map,g=new Map;for(m=h;m--;){const t=u(i,r,m),s=n(t);let l=a.get(s);l?o&&l.p(t,e):(l=d(s,t),l.c()),b.set(s,y[m]=l),s in f&&g.set(s,Math.abs(m-f[s]))}const v=new Set,w=new Set;function $(t){A(t,1),t.m(s,c),a.set(t.key,t),c=t.first,h--}for(;p&&h;){const e=y[h-1],n=t[p-1],o=e.key,i=n.key;e===n?(c=e.first,p--,h--):b.has(i)?!a.has(o)||v.has(o)?$(e):w.has(i)?p--:g.get(o)>g.get(i)?(w.add(o),$(e)):(v.add(i),p--):(l(n,a),p--)}for(;p--;){const e=t[p];b.has(e.key)||l(e,a)}for(;h;)$(y[h-1]);return y}(n,a,r,1,t,i,o,e,L,Pt,null,ut))},d(t){t&&l(e);for(let t=0;t<n.length;t+=1)n[t].d()}}}function kt(t){let e,n,o,i,r;return{c(){e=d("google-pay-button"),m(e,"class","payment_button"),m(e,"environment","TEST"),m(e,"button-type",n=t[3].type.toLowerCase()),m(e,"button-color","black"),m(e,"button-size-mode","fill"),m(e,"paymentrequest",o={apiVersion:2,apiVersionMinor:0,merchantInfo:{merchantName:t[3].merchantName,merchantId:t[35].gatewayMerchantId},allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:t[35].cardNetworks},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:t[35].gatewayId,gatewayMerchantId:t[35].gatewayMerchantId}}}],transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:t[3]?.total?.toString(),currencyCode:t[3]?.currencyCode?.toUpperCase(),countryCode:t[3]?.countryCode?.toUpperCase(),checkoutOption:"COMPLETE_IMMEDIATE_PURCHASE"}})},m(n,o){s(n,e,o),i||(r=p(e,"loadpaymentdata",t[29]),i=!0)},p(t,i){8&i[0]&&n!==(n=t[3].type.toLowerCase())&&m(e,"button-type",n),12&i[0]&&o!==(o={apiVersion:2,apiVersionMinor:0,merchantInfo:{merchantName:t[3].merchantName,merchantId:t[35].gatewayMerchantId},allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:t[35].cardNetworks},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:t[35].gatewayId,gatewayMerchantId:t[35].gatewayMerchantId}}}],transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:"Total",totalPrice:t[3]?.total?.toString(),currencyCode:t[3]?.currencyCode?.toUpperCase(),countryCode:t[3]?.countryCode?.toUpperCase(),checkoutOption:"COMPLETE_IMMEDIATE_PURCHASE"}})&&m(e,"paymentrequest",o)},d(t){t&&l(e),i=!1,r()}}}function Mt(t){let e,n,i,r,a;return{c(){e=d("hb-payment-paypal"),m(e,"style",t[7]),m(e,"class","payment_button"),m(e,"paypalid",n=t[35].paypalid),m(e,"total",i=t[3]?.total?.toString())},m(n,o){s(n,e,o),r||(a=[p(e,"paymentCompleted",t[27]),p(e,"cardChange",t[28])],r=!0)},p(t,o){128&o[0]&&m(e,"style",t[7]),4&o[0]&&n!==(n=t[35].paypalid)&&m(e,"paypalid",n),8&o[0]&&i!==(i=t[3]?.total?.toString())&&m(e,"total",i)},d(t){t&&l(e),r=!1,o(a)}}}function Pt(t,e){let n,o;function i(t,e){return"paypal"===t[35].id?Mt:"google"===t[35].id&&t[3].countryCode?kt:void 0}let r=i(e),c=r&&r(e);return{key:t,first:null,c(){n=d("div"),c&&c.c(),o=u(),h(n,"class","payment_button_container"),this.first=n},m(t,e){s(t,n,e),c&&c.m(n,null),a(n,o)},p(t,a){r===(r=i(e=t))&&c?c.p(e,a):(c&&c.d(1),c=r&&r(e),c&&(c.c(),c.m(n,o)))},d(t){t&&l(n),c&&c.d()}}}function _t(e){let n,o,i,r,c,p,m,f,y,b,g;function v(t,e){return t[1]?.fixed&&!t[9]?mt:t[1]?.fullName&&t[1]?.addressWithNumber&&!t[9]?ht:pt}let w=v(e),$=w(e),C=e[0]?.length&&yt(e);function x(t,e){return"yes"!==t[4]?Ct:$t}let k=x(e),M=k(e);return{c(){n=d("link"),o=u(),i=d("slot"),i.innerHTML='<h1 class="title" part="title">Checkout</h1>',r=u(),c=d("div"),p=d("div"),m=d("h3"),m.innerHTML='<i class="bi bi-send-fill"></i> Delivery',f=u(),$.c(),y=u(),C&&C.c(),b=u(),g=d("div"),M.c(),this.c=t,h(n,"rel","stylesheet"),h(n,"href","https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css"),h(i,"name","title"),h(m,"class","subtitle"),h(m,"part","subtitle"),h(c,"id","border_top"),h(g,"class","payment_title")},m(t,e){a(document.head,n),s(t,o,e),s(t,i,e),s(t,r,e),s(t,c,e),a(c,p),a(p,m),a(p,f),$.m(p,null),a(c,y),C&&C.m(c,null),s(t,b,e),s(t,g,e),M.m(g,null)},p(t,e){w===(w=v(t))&&$?$.p(t,e):($.d(1),$=w(t),$&&($.c(),$.m(p,null))),t[0]?.length?C?C.p(t,e):(C=yt(t),C.c(),C.m(c,null)):C&&(C.d(1),C=null),k===(k=x(t))&&M?M.p(t,e):(M.d(1),M=k(t),M&&(M.c(),M.m(g,null)))},i:t,o:t,d(t){l(n),t&&l(o),t&&l(i),t&&l(r),t&&l(c),$.d(),C&&C.d(),t&&l(b),t&&l(g),M.d()}}}const Tt=t=>t.selected,St=t=>t.standard,Et=t=>t.selected,Nt=t=>t.standard,Dt=t=>t.selected,It=t=>t.standard,At=t=>t.selected,Lt=t=>t.standard,Rt=t=>t.selected,Ot=t=>t.standard,zt=t=>t.selected,qt=t=>t.standard,jt=t=>t.selected,Vt=t=>t.standard;function Ht(t,e,n){var o;let i,{style:r}=e,a="",s="",{id:l}=e,{shipments:d}=e,{user:c}=e,{gateways:u}=e,{payment:p}=e,{completed:h}=e;const m=[{type:"radio",placeholder:"Insert your Full Name here...",id:"shipmentsolution",required:!0,label:"Shipment",validationTip:"This field cannot be empty.",params:{options:[]}}];let f,y,b="no",g="no";const v={type:"plain",total:0,currencyCode:"EUR",countryCode:"IT",merchantName:"merchant"};function C(t){for(const e of["fullName","cardNumber","CVV","expiration"])if(H.find((t=>t.id===e)))H[H.findIndex((t=>t.id===e))].value=t[e];else if(H.find((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))}))){const n=H.findIndex((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))})),o=H[n].params.columns.findIndex((t=>t.id===e));H[n].params.columns[o].value=t[e]}}function x(t){console.log("saveuser",t);const e={fullName:t.fullName,addressWithNumber:t.addressWithNumber,city:t.city,zip:t.zip,nationality:t.nationality};for(const e of Object.keys(t))if(Y.find((t=>t.id===e)))n(5,Y[Y.findIndex((t=>t.id===e))].value=t[e],Y);else if(Y.find((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))}))){const o=Y.findIndex((t=>{var n,o;return(null===(o=null===(n=t.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&t.params.columns.find((t=>t.id===e))})),i=Y[o].params.columns.findIndex((t=>t.id===e));n(5,Y[o].params.columns[i].value=t[e],Y)}n(1,c=e),n(9,f=!1),n(11,b="no"),console.log("edited"),_("saveUser",c)}function k(t){console.log("saveShipment",t);const e=null==t?void 0:t.shipmentsolution;if(e&&d.find((t=>t.id===e))){d.forEach((t=>t.selected=!1));const t=d.findIndex((t=>t.id===e));n(0,d[t].selected=!0,d),n(10,y=!1),n(8,m[0].value=e,m),_("saveShipment",d[t])}n(12,g="no")}const M=w(),P=$();function _(t,e){P(t,e),M.dispatchEvent&&M.dispatchEvent(new CustomEvent(t,{detail:e}))}function T(t){n(4,h="yes"),_("paymentCompleted",{total:null==p?void 0:p.total,method:t,completed:!0})}U.addComponent({repoName:"@htmlbricks/hb-form",version:V.version}),U.addComponent({repoName:"@htmlbricks/hb-payment-paypal",version:V.version});return t.$$set=t=>{"style"in t&&n(20,r=t.style),"id"in t&&n(19,l=t.id),"shipments"in t&&n(0,d=t.shipments),"user"in t&&n(1,c=t.user),"gateways"in t&&n(2,u=t.gateways),"payment"in t&&n(3,p=t.payment),"completed"in t&&n(4,h=t.completed)},t.$$.update=()=>{if(7864383&t.$$.dirty[0]){if(r&&(n(22,i=lt(r)),n(6,a=U.getChildStyleToPass(i,null==dt?void 0:dt.vars)),n(7,s=U.getChildStyleToPass(i,null==ct?void 0:ct.vars))),l||n(19,l=null),h||n(4,h="no"),p?"string"==typeof p&&n(3,p=JSON.parse(p)||v):n(3,p=v),d?"string"==typeof d&&n(0,d=JSON.parse(d)||[]):n(0,d=[]),u){if("string"==typeof u){n(2,u=JSON.parse(u)||[]);for(const t of u)(null===n(21,o=t.cardNetworks)||void 0===o?void 0:o.length)||(t.cardNetworks=["VISA","MASTERCARD"])}}else n(2,u=[]);if(p.type||n(3,p.type="buy",p),c){if("string"==typeof c){n(1,c=JSON.parse(c));for(const t of Object.keys(c))if(Y.find((e=>e.id===t)))n(5,Y[Y.findIndex((e=>e.id===t))].value=c[t],Y);else if(Y.find((e=>{var n,o;return(null===(o=null===(n=e.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&e.params.columns.find((e=>e.id===t))}))){const e=Y.findIndex((e=>{var n,o;return(null===(o=null===(n=e.params)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)&&e.params.columns.find((e=>e.id===t))})),o=Y[e].params.columns.findIndex((e=>e.id===t));n(5,Y[e].params.columns[o].value=c[t],Y)}}}else n(1,c=null);n(8,m[0].params.options=d.map((t=>({value:t.id,label:t.label+" "+t.price+t.currency}))),m),(d.find((t=>t.selected))||d.find((t=>t.standard)))&&n(8,m[0].value=(d.find((t=>t.selected))||d.find((t=>t.standard))).id,m)}},[d,c,u,p,h,Y,a,s,m,f,y,b,g,C,x,k,function(){n(9,f=!0),n(10,y=!1)},function(){n(9,f=!1),n(10,y=!0)},T,l,r,o,i,t=>{x(t.detail)},()=>{n(11,b="yes"),setTimeout((()=>{n(11,b="no")}),200)},t=>{k(t.detail)},()=>{n(12,g="yes"),setTimeout((()=>{n(12,g="no")}),200)},t=>T("paypal"),t=>C(t.detail),t=>{T("google")}]}class Yt extends z{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");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{--bs-blue:var(--bs-primary,#07689f);--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:var(--bs-danger,#f67280);--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:var(--bs-warning,#ffc107);--bs-teal:#20c997;--bs-cyan:var(--bs-info,#a2d5f2);--bs-white:#fff;--bs-gray:var(--bs-secondary,#c9d6df);--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:var(--bs-secondary,#c9d6df);--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:var(--bs-primary,#07689f);--bs-secondary:var(--bs-secondary,#c9d6df);--bs-success:var(--bs-warning,#ffc107);--bs-info:var(--bs-info,#a2d5f2);--bs-warning:#ffc107;--bs-danger:var(--bs-danger,#f67280);--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--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}}h4,h3,h1{margin-top:0;margin-bottom:0.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media(min-width: 1200px){h1{font-size:2.5rem}}@media(min-width: 1200px){}h3{font-size:calc(1.3rem + 0.6vw)}@media(min-width: 1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + 0.3vw)}@media(min-width: 1200px){h4{font-size:1.5rem}}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button{text-transform:none}button{-webkit-appearance:button}button:not(:disabled){cursor:pointer}::-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){}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}.btn{display:inline-block;font-weight:400;line-height:1.5;color:#212529;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:#212529}.btn:focus{outline:0;box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25)}.btn:disabled{pointer-events:none;opacity:0.65}.btn-primary{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-primary:hover{color:#fff;background-color:#0b5ed7;border-color:#0a58ca}.btn-primary:focus{color:#fff;background-color:#0b5ed7;border-color:#0a58ca;box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:active{color:#fff;background-color:#0a58ca;border-color:#0a53be}.btn-primary:active:focus{box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:disabled{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-link{font-weight:400;color:var(--bs-primary,#07689f);text-decoration:underline}.btn-link:hover{color:#0a58ca}.btn-link:disabled{color:var(--bs-secondary,#c9d6df)}.btn-sm{padding:0.25rem 0.5rem;font-size:0.875rem;border-radius:0.2rem}@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{}:host{--edit-color:blue;--paypal-button-color:yellow;--hb-checkout-border:0.5px solid rgba(197, 197, 197, 0.808);font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px}#payment_completed_content{text-align:center}#payment_completed_title{margin:30px;text-transform:capitalize;font-size:2em;font-weight:bold}#payment_btn_container{display:flex}.payment_button_container{flex:1;margin:15px;display:inline-block;text-align:center}.payment_button{height:40px;width:100%;max-width:50vw}.detail_label{font-size:0.8em;font-weight:bold}.dataentry_key{margin-right:3px}.dataentry_key::after{content:":"}.detail_btn{float:right;margin-right:10px;color:var(--edit-color);font-weight:bold;text-transform:capitalize}.dataentry{line-height:30px}.footer_note{text-align:center;font-size:12px;padding:5px;line-height:30px}.subtitle{margin-bottom:30px}.title{text-align:center;border-bottom:var(--hb-checkout-border);padding-bottom:20px}.payment_title{margin-top:20px;border-top:var(--hb-checkout-border);padding-top:10px}</style>',O(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},Ht,_t,r,{style:20,id:19,shipments:0,user:1,gateways:2,payment:3,completed:4},null,[-1,-1]),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),N()))}static get observedAttributes(){return["style","id","shipments","user","gateways","payment","completed"]}get style(){return this.$$.ctx[20]}set style(t){this.$$set({style:t}),N()}get id(){return this.$$.ctx[19]}set id(t){this.$$set({id:t}),N()}get shipments(){return this.$$.ctx[0]}set shipments(t){this.$$set({shipments:t}),N()}get user(){return this.$$.ctx[1]}set user(t){this.$$set({user:t}),N()}get gateways(){return this.$$.ctx[2]}set gateways(t){this.$$set({gateways:t}),N()}get payment(){return this.$$.ctx[3]}set payment(t){this.$$set({payment:t}),N()}get completed(){return this.$$.ctx[4]}set completed(t){this.$$set({completed:t}),N()}}return customElements.define("hb-checkout",Yt),Yt}();
2
2
  //# sourceMappingURL=release.js.map