@solvimon/solvimon-web 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -42
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js → BillingInformation.vue_vue_type_script_setup_true_lang-BouYyZhD.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CvUwy_tp.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-DczcgSrt.js → ContentWithAsideLayout-BjJufFeN.js} +1 -1
- package/dist/{ContentWithAsideLayout-CRsFr9TH.mjs → ContentWithAsideLayout-CKbnuXMU.mjs} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DaEPSNrY.mjs} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-sbmK2un9.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CLU-8-Ao.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-NRmK7iN3.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ck_1lRDB.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DFCX2tcj.mjs} +3 -3
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js → PricingGroupContent.vue_vue_type_script_setup_true_lang-BOZurit_.js} +1 -1
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-DAwMy1l8.mjs} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Cj4cnM8z.mjs} +4 -4
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-D49i1DHa.js} +1 -1
- package/dist/{component-DEo_ndpK.mjs → component-B0RYS5uK.mjs} +5 -7
- package/dist/component-BeqkeC9h.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +3 -3
- package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +2 -2
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -3
- package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +26 -49
- package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +11 -6
- package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +4 -4
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +2 -2
- package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -4
- package/dist/components/WalletBalances/WalletBalances.ce.d.ts +1 -1
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +2 -2
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{invoices-BW1notiX.js → invoices-CUrXmVXe.js} +1 -1
- package/dist/{invoices-M5oYVch6.mjs → invoices-CoEBP5UT.mjs} +1 -1
- package/dist/{paymentMethods-CqKUfc3w.mjs → paymentMethods-C2gWIbEr.mjs} +1 -1
- package/dist/{paymentMethods-BX80t2zk.js → paymentMethods-D_rYLg3F.js} +1 -1
- package/dist/{payments-BHv4hCeJ.js → payments-ClJySb0d.js} +1 -1
- package/dist/{payments-CosaPZwo.mjs → payments-DLjkq_hN.mjs} +1 -1
- package/dist/{registry-BwKEYOf7.js → registry-EPF-VAYZ.js} +1 -1
- package/dist/{registry-Cag1Jj7P.mjs → registry-bo_7pcbl.mjs} +2 -2
- package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +8 -8
- package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +9 -9
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +5 -5
- package/dist/{subscriptions-Bs4DIE8f.mjs → subscriptions-BepBTXR5.mjs} +1 -1
- package/dist/{subscriptions-CnxvsBXd.js → subscriptions-DERHtyHo.js} +1 -1
- package/dist/{useActionDispatchProvider-CgRcOqv3.mjs → useActionDispatchProvider-B_SkyymZ.mjs} +1 -1
- package/dist/{useActionDispatchProvider-Cru69mAl.js → useActionDispatchProvider-D4OtXsNA.js} +1 -1
- package/dist/{useCustomer-DlcjY3fP.mjs → useCustomer-C0RKKfGJ.mjs} +1 -1
- package/dist/{useCustomer-B0NK96dA.js → useCustomer-CEFUPIDZ.js} +1 -1
- package/dist/{useCustomerPaymentMethodOptions-C-8BLzqb.js → useCustomerPaymentMethodOptions-BgCFkLeQ.js} +1 -1
- package/dist/{useCustomerPaymentMethodOptions-BzEquyUV.mjs → useCustomerPaymentMethodOptions-BlFH4zxG.mjs} +3 -3
- package/dist/{useIncrementalLoading-C7ToTmZK.mjs → useIncrementalLoading-BqD4k_-r.mjs} +1 -1
- package/dist/{useIncrementalLoading-D60Vttil.js → useIncrementalLoading-CDpeHhKs.js} +1 -1
- package/dist/{useInvoiceData-CcueV3We.mjs → useInvoiceData-7mqBeSPa.mjs} +2 -2
- package/dist/{useInvoiceData-DstXfI7t.js → useInvoiceData-DvNf2402.js} +1 -1
- package/dist/{useInvoicesList-CXng3aUm.mjs → useInvoicesList-B5vYDRyl.mjs} +4 -4
- package/dist/{useInvoicesList-DmzjgMlW.js → useInvoicesList-CBqZG_rw.js} +1 -1
- package/dist/{usePaymentMethods-Db-1R6rI.mjs → usePaymentMethods-4Io2ZHlo.mjs} +2 -2
- package/dist/{usePaymentMethods-DCGVRXA4.js → usePaymentMethods-BdZkt6re.js} +1 -1
- package/dist/{useWalletBalanceItems-CHkLaccm.mjs → useWalletBalanceItems-B0NZuM3W.mjs} +1 -1
- package/dist/{useWalletBalanceItems-BZyiAhcV.js → useWalletBalanceItems-CzV3PcJH.js} +1 -1
- package/package.json +3 -3
- package/dist/component-XHQYFLA_.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonBillingInformation: import('
|
|
1
|
+
export declare const SolvimonBillingInformation: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonBillingInformation: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BouYyZhD.js"),t=require("../../useCustomer-CEFUPIDZ.js"),n=require("../../component-BeqkeC9h.js"),r=e.defineComponent({__name:"BillingInformation.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(o){const n=o.portalObject.customer_id,r=t.useCustomer({customerId:n});return(o,t)=>e.renderSlot(o.$slots,"default",{customer:e.unref(r)})}}),l=e.defineComponent({__name:"BillingInformation.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(l,i)=>{var p,s,m,c;return e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{"custom-element-name":e.unref(a),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(p=t.branding)?void 0:p.colors)?void 0:s.primary,"secondary-color":null==(c=null==(m=t.branding)?void 0:m.colors)?void 0:c.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:i[0]||(i[0]=e=>l.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(r,e.normalizeProps(e.guardReactiveProps(l.$props)),{default:e.withCtx(({customer:t})=>[t.customer.value?(e.openBlock(),e.createBlock(o._sfc_main,{key:0,"is-loading":t.get.isPending.value,customer:t.customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),i=n.defineCustomElement(l),a=n.getComponentName("billing-information");exports.COMPONENT_NAME=a,exports.SolvimonBillingInformation=i,exports.defineSolvimonBillingInformation=()=>{customElements.get(a)||customElements.define(a,i)};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, renderSlot, unref, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps, createCommentVNode } from "vue";
|
|
2
|
-
import { _ as _sfc_main$3 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
4
|
-
import { p as _sfc_main$2, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
2
|
+
import { _ as _sfc_main$3 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CvUwy_tp.mjs";
|
|
3
|
+
import { u as useCustomer } from "../../useCustomer-C0RKKfGJ.mjs";
|
|
4
|
+
import { p as _sfc_main$2, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
5
5
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "BillingInformation.entry.view",
|
|
7
7
|
props: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonBillingInformationForm: import('
|
|
1
|
+
export declare const SolvimonBillingInformationForm: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonBillingInformationForm: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-XHQYFLA_.js"),a=require("../../index-DRdBmZ2-.js"),o=require("../../cloneDeep-DranHQkY.js"),r=require("../../useCustomer-B0NK96dA.js"),l={type:"INDIVIDUAL",email:"",country:"",addressLine1:"",postalCode:"",city:"",state:""};function n({initialState:r={},onSubmit:n}){const{form:s,validation:u,changes:c,hasChanges:m,updateInitialState:p,initialState:f}=(({initialState:a,validationRules:r,nullifyEmptyValues:l=!1,mode:n="shallow"})=>{const i=e.shallowRef(o.cloneDeep(a)),d=e.shallowRef(o.cloneDeep(a)),s=t.useValidation(r??{},d),u=e.computed(()=>t.objectDiff({from:i.value,to:d.value,mode:n,nullifyEmptyValues:l})),c=e.computed(()=>Object.entries(u.value).length>0);return{form:d,validation:s,changes:u,hasChanges:c,reset:()=>{d.value=o.cloneDeep(a),s.value.$reset()},updateInitialState:e=>{d.value=o.cloneDeep(e),i.value=o.cloneDeep(e)},initialState:i}})({initialState:{...l,...r},validationRules:{email:{required:a.required,email:a.email}},nullifyEmptyValues:!0,mode:"deep"});return{form:s,isOrganization:t.isOrganization,validation:u,changes:c,hasChanges:m,updateInitialState:e=>{p(i(e))},submit:(e,t=s.value)=>n({customerId:e,payload:d(t)}),initialState:f}}const i=e=>{var a,o,r,l;if(t.isIndividual(e)){const t=e.individual.residential_address;return{type:"INDIVIDUAL",email:e.email??"",country:(null==t?void 0:t.country)??"",addressLine1:(null==t?void 0:t.line1)??"",addressLine2:(null==t?void 0:t.line2)??"",postalCode:(null==t?void 0:t.postal_code)??"",city:(null==t?void 0:t.city)??"",state:(null==t?void 0:t.state)??"",firstName:(null==(a=e.individual.name)?void 0:a.first_name)??"",lastName:(null==(o=e.individual.name)?void 0:o.last_name)??""}}const n=e.organization.registered_address;return{type:"ORGANIZATION",email:e.email??"",country:(null==n?void 0:n.country)??"",addressLine1:(null==n?void 0:n.line1)??"",addressLine2:(null==n?void 0:n.line2)??"",postalCode:(null==n?void 0:n.postal_code)??"",city:(null==n?void 0:n.city)??"",state:(null==n?void 0:n.state)??"",companyLegalName:e.organization.legal_name??"",companyVatNumber:(null==(l=null==(r=e.organization.tax_ids)?void 0:r[0])?void 0:l.id)??""}},d=e=>"ORGANIZATION"===e.type?{type:"ORGANIZATION",email:e.email,organization:{legal_name:e.companyLegalName??"",tax_ids:e.companyVatNumber?[{id:e.companyVatNumber,type:"GENERIC_TAX_ID"}]:void 0,registered_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}}:{type:"INDIVIDUAL",email:e.email,individual:{name:{first_name:e.firstName??"",last_name:e.lastName??""},residential_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}},s={class:"grid grid-cols-1 gap-4"},u={class:"flex grow flex-col"},c={class:"mt-6 flex items-center justify-between gap-4"},m={class:"flex flex-col gap-2"},p={key:0,class:"grid grid-cols-2 gap-2"},f={class:"grid grid-cols-3 gap-2"},h=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},isLoading:{type:Boolean},apiError:{type:null},updateCustomer:{type:Function}},setup(a){const o=a,{$t:r}=t.useIntl(),{validation:l,form:i,updateInitialState:d,submit:h,hasChanges:g}=n({onSubmit:({customerId:e,payload:t})=>o.updateCustomer({customerId:e,payload:t})}),y=e.ref(!1),_=e.computed(()=>"ORGANIZATION"===i.value.type),v=e.computed(()=>!y.value),b=e.computed({get:()=>_.value,set:e=>i.value.type=e?"ORGANIZATION":"INDIVIDUAL"}),V=async()=>{var e;await l.value.$validate();!l.value.$invalid&&(null==(e=o.customer)?void 0:e.id)&&await h(o.customer.id)};return e.watch(()=>o.customer,e=>{e&&!y.value&&(d(e),y.value=!0)},{immediate:!0}),(o,n)=>{var d,h,y,N,k,C,E,S,I,L,T,x,B;return e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(V,["prevent"])},[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})),1)]),_:1}),e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).email,"onUpdate:modelValue":n[0]||(n[0]=t=>e.unref(i).email=t),required:"",type:"email",label:e.unref(r)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"}),error:(null==(d=e.unref(l).value.email)?void 0:d.$errors)||(null==(h=a.apiError)?void 0:h.email)},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$1$),{"single-model-value":e.unref(i).country,"onUpdate:singleModelValue":n[1]||(n[1]=t=>e.unref(i).country=t),label:e.unref(r)({defaultMessage:"Country",id:"checkout.country.label",description:"The country of the customer in the checkout form"}),error:null==(y=a.apiError)?void 0:y.country},null,8,["single-model-value","label","error"]),v.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$20),{key:0,modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e),"label-position":"before"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",u,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).companyVatNumber,"onUpdate:modelValue":n[3]||(n[3]=t=>e.unref(i).companyVatNumber=t),name:"vat_number",label:e.unref(r)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:null==(N=a.apiError)?void 0:N.vat_number},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).companyLegalName,"onUpdate:modelValue":n[4]||(n[4]=t=>e.unref(i).companyLegalName=t),required:"",name:"legal_name",label:e.unref(r)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"}),error:null==(k=a.apiError)?void 0:k.legal_name},null,8,["modelValue","label","placeholder","error"])],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Billing details",id:"checkout.billing_information_block.title",description:"The title of the billing information block in the checkout form"})),1)]),_:1})]),e.createElementVNode("div",m,[_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).firstName,"onUpdate:modelValue":n[5]||(n[5]=t=>e.unref(i).firstName=t),name:"first_name",label:e.unref(r)({defaultMessage:"First name",id:"checkout.first_name.label",description:"The first name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"First name...",id:"checkout.first_name.placeholder",description:"The first name of the customer in the checkout form"}),error:null==(C=a.apiError)?void 0:C.first_name},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).lastName,"onUpdate:modelValue":n[6]||(n[6]=t=>e.unref(i).lastName=t),name:"last_name",label:e.unref(r)({defaultMessage:"Last name",id:"checkout.last_name.label",description:"The last name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Last name...",id:"checkout.last_name.placeholder",description:"The last name of the customer in the checkout form"}),error:null==(E=a.apiError)?void 0:E.last_name},null,8,["modelValue","label","placeholder","error"])])),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).addressLine1,"onUpdate:modelValue":n[7]||(n[7]=t=>e.unref(i).addressLine1=t),name:"address_line_1",label:e.unref(r)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"}),error:null==(S=a.apiError)?void 0:S.address_line_1},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).addressLine2,"onUpdate:modelValue":n[8]||(n[8]=t=>e.unref(i).addressLine2=t),name:"address_line_2",placeholder:e.unref(r)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"}),error:null==(I=a.apiError)?void 0:I.address_line_2},null,8,["modelValue","placeholder","error"]),e.createElementVNode("div",f,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).postalCode,"onUpdate:modelValue":n[9]||(n[9]=t=>e.unref(i).postalCode=t),name:"postal_code",placeholder:e.unref(r)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"}),error:null==(L=a.apiError)?void 0:L.postal_code},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).city,"onUpdate:modelValue":n[10]||(n[10]=t=>e.unref(i).city=t),name:"city",placeholder:e.unref(r)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"}),error:null==(T=a.apiError)?void 0:T.city},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).state,"onUpdate:modelValue":n[11]||(n[11]=t=>e.unref(i).state=t),name:"state",placeholder:e.unref(r)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"}),error:null==(x=a.apiError)?void 0:x.state},null,8,["modelValue","placeholder","error"])])]),(null==(B=a.apiError)?void 0:B._generic)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:0,class:"mt-4",title:a.apiError._generic},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2H),{type:"submit",color:"primary",disabled:!e.unref(g),loading:a.isLoading,class:"mt-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Save changes",id:"billing_information_form.submit_button.label",description:"The label for the submit button of the billing information form"})),1)]),_:1},8,["disabled","loading"])],32)}}}),g=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},apiError:{type:null},updateCustomer:{type:Function},isLoading:{type:Boolean}},setup:t=>(a,o)=>(e.openBlock(),e.createBlock(h,{customer:t.customer,"update-customer":t.updateCustomer,"is-loading":t.isLoading,"api-error":t.apiError},null,8,["customer","update-customer","is-loading","api-error"]))}),y=e.defineComponent({__name:"BillingInformationForm.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object}},setup(a){const o=a.portalObject.customer_id,{customer:l,get:n,update:i}=r.useCustomer({customerId:o});return e.onMounted(async()=>{await n.execute()}),(a,o)=>e.renderSlot(a.$slots,"default",{customer:e.unref(l),isLoading:e.unref(n).isPending.value||e.unref(i).isPending.value,updateCustomer:e.unref(i),apiError:e.unref(t.getApiError)(e.unref(i).error)})}}),_=e.defineComponent({__name:"BillingInformationForm.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object}},emits:["error"],setup:a=>(o,r)=>{var l,n,i,d;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(b),environment:a.environment,locale:a.locale,"portal-object":a.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(l=a.branding)?void 0:l.colors)?void 0:n.primary,"secondary-color":null==(d=null==(i=a.branding)?void 0:i.colors)?void 0:d.secondary,"experimental-features":a.experimentalFeatures,"log-level":a.logLevel,"on-log":a.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({customer:t,updateCustomer:a,isLoading:o,apiError:r})=>[t?(e.openBlock(),e.createBlock(g,{key:0,customer:t,"is-loading":o,"update-customer":({payload:e})=>a.execute(e),"api-error":r},null,8,["customer","is-loading","update-customer","api-error"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=t.defineCustomElement(_),b=t.getComponentName("billing-information-form");exports.COMPONENT_NAME=b,exports.SolvimonBillingInformationForm=v,exports.defineSolvimonBillingInformationForm=()=>{customElements.get(b)||customElements.define(b,v)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-BeqkeC9h.js"),a=require("../../index-DRdBmZ2-.js"),o=require("../../cloneDeep-DranHQkY.js"),r=require("../../useCustomer-CEFUPIDZ.js"),l={type:"INDIVIDUAL",email:"",country:"",addressLine1:"",postalCode:"",city:"",state:""};function n({initialState:r={},onSubmit:n}){const{form:s,validation:u,changes:c,hasChanges:m,updateInitialState:p,initialState:f}=(({initialState:a,validationRules:r,nullifyEmptyValues:l=!1,mode:n="shallow"})=>{const i=e.shallowRef(o.cloneDeep(a)),d=e.shallowRef(o.cloneDeep(a)),s=t.useValidation(r??{},d),u=e.computed(()=>t.objectDiff({from:i.value,to:d.value,mode:n,nullifyEmptyValues:l})),c=e.computed(()=>Object.entries(u.value).length>0);return{form:d,validation:s,changes:u,hasChanges:c,reset:()=>{d.value=o.cloneDeep(a),s.value.$reset()},updateInitialState:e=>{d.value=o.cloneDeep(e),i.value=o.cloneDeep(e)},initialState:i}})({initialState:{...l,...r},validationRules:{email:{required:a.required,email:a.email}},nullifyEmptyValues:!0,mode:"deep"});return{form:s,isOrganization:t.isOrganization,validation:u,changes:c,hasChanges:m,updateInitialState:e=>{p(i(e))},submit:(e,t=s.value)=>n({customerId:e,payload:d(t)}),initialState:f}}const i=e=>{var a,o,r,l;if(t.isIndividual(e)){const t=e.individual.residential_address;return{type:"INDIVIDUAL",email:e.email??"",country:(null==t?void 0:t.country)??"",addressLine1:(null==t?void 0:t.line1)??"",addressLine2:(null==t?void 0:t.line2)??"",postalCode:(null==t?void 0:t.postal_code)??"",city:(null==t?void 0:t.city)??"",state:(null==t?void 0:t.state)??"",firstName:(null==(a=e.individual.name)?void 0:a.first_name)??"",lastName:(null==(o=e.individual.name)?void 0:o.last_name)??""}}const n=e.organization.registered_address;return{type:"ORGANIZATION",email:e.email??"",country:(null==n?void 0:n.country)??"",addressLine1:(null==n?void 0:n.line1)??"",addressLine2:(null==n?void 0:n.line2)??"",postalCode:(null==n?void 0:n.postal_code)??"",city:(null==n?void 0:n.city)??"",state:(null==n?void 0:n.state)??"",companyLegalName:e.organization.legal_name??"",companyVatNumber:(null==(l=null==(r=e.organization.tax_ids)?void 0:r[0])?void 0:l.id)??""}},d=e=>"ORGANIZATION"===e.type?{type:"ORGANIZATION",email:e.email,organization:{legal_name:e.companyLegalName??"",tax_ids:e.companyVatNumber?[{id:e.companyVatNumber,type:"GENERIC_TAX_ID"}]:void 0,registered_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}}:{type:"INDIVIDUAL",email:e.email,individual:{name:{first_name:e.firstName??"",last_name:e.lastName??""},residential_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}},s={class:"grid grid-cols-1 gap-4"},u={class:"flex grow flex-col"},c={class:"mt-6 flex items-center justify-between gap-4"},m={class:"flex flex-col gap-2"},p={key:0,class:"grid grid-cols-2 gap-2"},f={class:"grid grid-cols-3 gap-2"},h=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},isLoading:{type:Boolean},apiError:{type:null},updateCustomer:{type:Function}},setup(a){const o=a,{$t:r}=t.useIntl(),{validation:l,form:i,updateInitialState:d,submit:h,hasChanges:g}=n({onSubmit:({customerId:e,payload:t})=>o.updateCustomer({customerId:e,payload:t})}),y=e.ref(!1),_=e.computed(()=>"ORGANIZATION"===i.value.type),v=e.computed(()=>!y.value),b=e.computed({get:()=>_.value,set:e=>i.value.type=e?"ORGANIZATION":"INDIVIDUAL"}),V=async()=>{var e;await l.value.$validate();!l.value.$invalid&&(null==(e=o.customer)?void 0:e.id)&&await h(o.customer.id)};return e.watch(()=>o.customer,e=>{e&&!y.value&&(d(e),y.value=!0)},{immediate:!0}),(o,n)=>{var d,h,y,N,k,C,E,S,I,L,T,x,B;return e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(V,["prevent"])},[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})),1)]),_:1}),e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).email,"onUpdate:modelValue":n[0]||(n[0]=t=>e.unref(i).email=t),required:"",type:"email",label:e.unref(r)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"}),error:(null==(d=e.unref(l).value.email)?void 0:d.$errors)||(null==(h=a.apiError)?void 0:h.email)},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$1$),{"single-model-value":e.unref(i).country,"onUpdate:singleModelValue":n[1]||(n[1]=t=>e.unref(i).country=t),label:e.unref(r)({defaultMessage:"Country",id:"checkout.country.label",description:"The country of the customer in the checkout form"}),error:null==(y=a.apiError)?void 0:y.country},null,8,["single-model-value","label","error"]),v.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$20),{key:0,modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e),"label-position":"before"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",u,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).companyVatNumber,"onUpdate:modelValue":n[3]||(n[3]=t=>e.unref(i).companyVatNumber=t),name:"vat_number",label:e.unref(r)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:null==(N=a.apiError)?void 0:N.vat_number},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).companyLegalName,"onUpdate:modelValue":n[4]||(n[4]=t=>e.unref(i).companyLegalName=t),required:"",name:"legal_name",label:e.unref(r)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"}),error:null==(k=a.apiError)?void 0:k.legal_name},null,8,["modelValue","label","placeholder","error"])],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Billing details",id:"checkout.billing_information_block.title",description:"The title of the billing information block in the checkout form"})),1)]),_:1})]),e.createElementVNode("div",m,[_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).firstName,"onUpdate:modelValue":n[5]||(n[5]=t=>e.unref(i).firstName=t),name:"first_name",label:e.unref(r)({defaultMessage:"First name",id:"checkout.first_name.label",description:"The first name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"First name...",id:"checkout.first_name.placeholder",description:"The first name of the customer in the checkout form"}),error:null==(C=a.apiError)?void 0:C.first_name},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).lastName,"onUpdate:modelValue":n[6]||(n[6]=t=>e.unref(i).lastName=t),name:"last_name",label:e.unref(r)({defaultMessage:"Last name",id:"checkout.last_name.label",description:"The last name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Last name...",id:"checkout.last_name.placeholder",description:"The last name of the customer in the checkout form"}),error:null==(E=a.apiError)?void 0:E.last_name},null,8,["modelValue","label","placeholder","error"])])),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).addressLine1,"onUpdate:modelValue":n[7]||(n[7]=t=>e.unref(i).addressLine1=t),name:"address_line_1",label:e.unref(r)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"}),error:null==(S=a.apiError)?void 0:S.address_line_1},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).addressLine2,"onUpdate:modelValue":n[8]||(n[8]=t=>e.unref(i).addressLine2=t),name:"address_line_2",placeholder:e.unref(r)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"}),error:null==(I=a.apiError)?void 0:I.address_line_2},null,8,["modelValue","placeholder","error"]),e.createElementVNode("div",f,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).postalCode,"onUpdate:modelValue":n[9]||(n[9]=t=>e.unref(i).postalCode=t),name:"postal_code",placeholder:e.unref(r)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"}),error:null==(L=a.apiError)?void 0:L.postal_code},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).city,"onUpdate:modelValue":n[10]||(n[10]=t=>e.unref(i).city=t),name:"city",placeholder:e.unref(r)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"}),error:null==(T=a.apiError)?void 0:T.city},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:e.unref(i).state,"onUpdate:modelValue":n[11]||(n[11]=t=>e.unref(i).state=t),name:"state",placeholder:e.unref(r)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"}),error:null==(x=a.apiError)?void 0:x.state},null,8,["modelValue","placeholder","error"])])]),(null==(B=a.apiError)?void 0:B._generic)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:0,class:"mt-4",title:a.apiError._generic},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2H),{type:"submit",color:"primary",disabled:!e.unref(g),loading:a.isLoading,class:"mt-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Save changes",id:"billing_information_form.submit_button.label",description:"The label for the submit button of the billing information form"})),1)]),_:1},8,["disabled","loading"])],32)}}}),g=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},apiError:{type:null},updateCustomer:{type:Function},isLoading:{type:Boolean}},setup:t=>(a,o)=>(e.openBlock(),e.createBlock(h,{customer:t.customer,"update-customer":t.updateCustomer,"is-loading":t.isLoading,"api-error":t.apiError},null,8,["customer","update-customer","is-loading","api-error"]))}),y=e.defineComponent({__name:"BillingInformationForm.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object}},setup(a){const o=a.portalObject.customer_id,{customer:l,get:n,update:i}=r.useCustomer({customerId:o});return e.onMounted(async()=>{await n.execute()}),(a,o)=>e.renderSlot(a.$slots,"default",{customer:e.unref(l),isLoading:e.unref(n).isPending.value||e.unref(i).isPending.value,updateCustomer:e.unref(i),apiError:e.unref(t.getApiError)(e.unref(i).error)})}}),_=e.defineComponent({__name:"BillingInformationForm.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object}},emits:["error"],setup:a=>(o,r)=>{var l,n,i,d;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(b),environment:a.environment,locale:a.locale,"portal-object":a.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(l=a.branding)?void 0:l.colors)?void 0:n.primary,"secondary-color":null==(d=null==(i=a.branding)?void 0:i.colors)?void 0:d.secondary,"experimental-features":a.experimentalFeatures,"log-level":a.logLevel,"on-log":a.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({customer:t,updateCustomer:a,isLoading:o,apiError:r})=>[t?(e.openBlock(),e.createBlock(g,{key:0,customer:t,"is-loading":o,"update-customer":({payload:e})=>a.execute(e),"api-error":r},null,8,["customer","is-loading","update-customer","api-error"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=t.defineCustomElement(_),b=t.getComponentName("billing-information-form");exports.COMPONENT_NAME=b,exports.SolvimonBillingInformationForm=v,exports.defineSolvimonBillingInformationForm=()=>{customElements.get(b)||customElements.define(b,v)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { shallowRef, computed, defineComponent, ref, watch, openBlock, createElementBlock, withModifiers, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createBlock, createCommentVNode, Fragment, onMounted, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { G as useValidation, H as objectDiff, I as isOrganization, J as isIndividual, b as useIntl, _ as _sfc_main$2$1, K as _sfc_main$2a, L as _sfc_main$1$, M as _sfc_main$20, D as _sfc_main$16, m as _sfc_main$2H, N as getApiError, p as _sfc_main$4, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
2
|
+
import { G as useValidation, H as objectDiff, I as isOrganization, J as isIndividual, b as useIntl, _ as _sfc_main$2$1, K as _sfc_main$2a, L as _sfc_main$1$, M as _sfc_main$20, D as _sfc_main$16, m as _sfc_main$2H, N as getApiError, p as _sfc_main$4, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
3
3
|
import { e as email, r as required } from "../../index-CzL1ZcGi.mjs";
|
|
4
4
|
import { c as cloneDeep } from "../../cloneDeep-sm9cY-u2.mjs";
|
|
5
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
5
|
+
import { u as useCustomer } from "../../useCustomer-C0RKKfGJ.mjs";
|
|
6
6
|
const useForm = ({
|
|
7
7
|
initialState,
|
|
8
8
|
validationRules,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonCustomerPaymentMethods: import('
|
|
1
|
+
export declare const SolvimonCustomerPaymentMethods: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonCustomerPaymentMethods: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../useCustomerPaymentMethodOptions-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../useCustomerPaymentMethodOptions-BgCFkLeQ.js"),t=require("../../component-BeqkeC9h.js"),n=require("../../useLoadInitialData-BRg7IWqW.js"),r=require("../../usePaymentMethods-BdZkt6re.js"),a=e.defineComponent({__name:"CustomerPaymentMethods.entry.view",props:{portalObject:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(a){var l;const i=a,m=i.portalObject.customer_id,p=r.usePaymentMethods({customerId:m,pageSize:(null==(l=i.configuration)?void 0:l.maxItems)||3}),c=o.useCustomerPaymentMethodOptions({customerId:m}),{isLoading:u}=n.useLoadInitialData(p.fetchInitial(),c.fetch());return(o,n)=>{var r,l,i,m;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(s),environment:a.environment,locale:a.locale,"portal-object":a.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(r=a.branding)?void 0:r.colors)?void 0:l.primary,"secondary-color":null==(m=null==(i=a.branding)?void 0:i.colors)?void 0:m.secondary,"experimental-features":a.experimentalFeatures,"log-level":a.logLevel,"on-log":a.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{paymentMethods:e.unref(p).items.value,paymentMethodsOptions:e.unref(c).items.value,isLoading:e.unref(u)})]),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),l=e.defineComponent({__name:"CustomerPaymentMethods.entry",props:{portalObject:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:n=>(r,l)=>{var i,m,p,c;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(s),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(m=null==(i=n.branding)?void 0:i.colors)?void 0:m.primary,"secondary-color":null==(c=null==(p=n.branding)?void 0:p.colors)?void 0:c.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:l[0]||(l[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(r.$props)),{default:e.withCtx(({paymentMethods:t,paymentMethodsOptions:r,isLoading:a})=>[e.createVNode(o._sfc_main,{configuration:n.configuration,"payment-methods":t,"payment-methods-options":r,"is-loading":a},null,8,["configuration","payment-methods","payment-methods-options","is-loading"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),i=t.defineCustomElement(l),s=t.getComponentName("customer-payment-methods");exports.COMPONENT_NAME=s,exports.SolvimonCustomerPaymentMethods=i,exports.defineSolvimonCustomerPaymentMethods=()=>{customElements.get(s)||customElements.define(s,i)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$3 } from "../../useCustomerPaymentMethodOptions-
|
|
3
|
-
import { p as _sfc_main$2, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
2
|
+
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$3 } from "../../useCustomerPaymentMethodOptions-BlFH4zxG.mjs";
|
|
3
|
+
import { p as _sfc_main$2, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
4
4
|
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
5
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
5
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-4Io2ZHlo.mjs";
|
|
6
6
|
const DEFAULT_MAX_ITEMS = 3;
|
|
7
7
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "CustomerPaymentMethods.entry.view",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonInvoice: import('
|
|
1
|
+
export declare const SolvimonInvoice: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonInvoice: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-BRg7IWqW.js"),o=require("../../invoices-BW1notiX.js"),n=require("../../useService-D-CUtlp3.js"),i=require("../../payments-BHv4hCeJ.js"),a=require("../../component-XHQYFLA_.js"),r=require("../../index-CWSXne1Q.js"),l=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js"),c=require("../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js");const s=e.defineComponent({__name:"Invoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(a){const r=a,l=function({invoiceId:e}){const{getInvoice:t,getInvoicePdf:i}=o.createInvoicesService(),{data:a,execute:r,apiStatus:l,error:c,isPending:s}=n.useService({service:()=>t(e)});return{invoice:a,downloadInvoicePdf:i,apiStatus:l,error:c,get:r,isPending:s}}({invoiceId:r.configuration.invoiceId}),c=function(){const{getPayments:e}=i.createPaymentsService(),{data:t,execute:o,error:a,apiStatus:r,isPending:l}=n.useService({service:e,isCollection:!0});return{payments:t,get:o,error:a,apiStatus:r,isPending:l}}(),{isLoading:s}=t.useLoadInitialData(l.get(),c.get(r.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(l).invoice.value,invoiceDownloadService:e.unref(l).downloadInvoicePdf,payments:e.unref(c),isLoading:e.unref(s)})}}),d={key:0,class:"mt-8"},u={class:"flex flex-col gap-6"},p=["onClick","onKeyup"],m={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},f={key:0},v={class:"p-0"},g={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},y=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:i,formatMessage:r,formatNumber:l}=a.useIntl(),{getIsOpen:c,toggle:s}=a.useToggleList(),y=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),_=e=>r({defaultMessage:"Service period - {startAt} - {endAt}",id:"kFCxC4",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),w=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=y.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:r({defaultMessage:"Credits",id:"K2fM1n",description:"Fallback label for wallet balance credit types when no name is available"})},b=e=>e?l(Number(e)):r({defaultMessage:"-",id:"dHb0fN",description:"Placeholder shown when a wallet balance quantity is missing"}),h=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var i,a,r,l;const c=new Map,s=new Map;for(const t of e.groups??[])for(const d of t.lines??[]){const u=null==(i=null==d?void 0:d.details)?void 0:i.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),f={id:`${e.period_order}-${t.group_order}-${d.line_order}`,label:m,used:n(null==(a=u.used_wallet_credits)?void 0:a.quantity),left:n(null==(r=u.left_wallet_credits)?void 0:r.quantity),available:n(null==(l=u.available_wallet_credits)?void 0:l.quantity)},v=`${f.label}-${f.used}-${f.left}-${f.available}`,g=s.get(m)??new Set;if(g.has(v))continue;g.add(v),s.set(m,g);const y=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:f.available,rows:[]};y.rows.push(f),c.set(m,y)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:_,getCreditTypeLabel:w,formatQuantity:b}));return(t,o)=>h.value.length>0?(e.openBlock(),e.createElementBlock("section",d,[e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(a._sfc_main$2q),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main$2),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(a.InvoiceTable),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(a._sfc_main$t),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Wallet balance",id:"j2d7b2",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(s)(t.id),onKeyup:[e.withKeys(o=>e.unref(s)(t.id),["enter"]),e.withKeys(o=>e.unref(s)(t.id),["space"])]},[e.createVNode(e.unref(a._sfc_main$u),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main$4),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(c)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",m,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,p),e.unref(c)(t.id)?(e.openBlock(),e.createElementBlock("tr",f,[e.createElementVNode("td",v,[e.createElementVNode("div",g,[e.createVNode(e.unref(a.InvoiceTable),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(a._sfc_main$t),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Credit breakdown",id:"65I4e4",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Balance",id:"4UjRe6",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Used",id:"rUy4Lk",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Remaining",id:"C8F4/r",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(a._sfc_main$u),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),_=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=a.useIntl(),{width:n}=r.useWindowSize(),i=e.computed(()=>n.value<=768);return(n,r)=>(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1g),{title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"}),class:"grow"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"p-6 pt-2":!i.value})},[i.value?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1J),{key:0,variant:"default","has-icon":"",class:"justify-center bg-gray-50 border-gray-100 text-gray-800 font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(a._sfc_main$e),{invoice:t.invoice,"is-expandable":!i.value},{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(y,{invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),w={class:"flex flex-col gap-3 lg:flex-row lg:gap-6"},b={class:"flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},h=e.defineComponent({__name:"InvoiceDetail",props:{invoice:{type:Object},paymentAttempts:{default:()=>[],type:Array},downloadService:{type:Function},showDownloadButton:{type:Boolean,default:!0},showCustomerBillingInformation:{type:Boolean,default:!0},showPaymentAttempts:{type:Boolean,default:!0}},setup(t){const{$t:o}=a.useIntl();return(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(a._sfc_main$w),{class:"mb-6","payment-attempts":t.paymentAttempts,invoice:t.invoice,"download-service":()=>t.downloadService(t.invoice.id),"show-download-button":t.showDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",w,[t.invoice?(e.openBlock(),e.createBlock(_,{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",b,[e.createVNode(l._sfc_main,{invoice:t.invoice},null,8,["invoice"]),t.showPaymentAttempts&&t.paymentAttempts.length?(e.openBlock(),e.createBlock(c._sfc_main,{key:0,"payment-attempts":t.paymentAttempts,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.showCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$z),{key:1,customer:t.invoice.customer,title:e.unref(o)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])],64))}}),x=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup:t=>(o,n)=>{var i,a,r;return e.openBlock(),e.createBlock(h,{invoice:t.invoice,"payment-attempts":t.payments,"download-service":t.invoiceDownloadService,"show-download-button":null==(i=t.configuration)?void 0:i.enableDownloadButton,"show-customer-billing-information":null==(a=t.configuration)?void 0:a.enableCustomerBillingInformation,"show-payment-attempts":null==(r=t.configuration)?void 0:r.enablePaymentAttempts},null,8,["invoice","payment-attempts","download-service","show-download-button","show-customer-billing-information","show-payment-attempts"])}}),k=e.defineComponent({__name:"Invoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){var o;const n=t;if(!(null==(o=n.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const i=e.computed(()=>({...n,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...n.configuration}}));return(o,n)=>{var r,l,c,d;return e.openBlock(),e.createBlock(e.unref(a._sfc_main$1),{"custom-element-name":e.unref(N),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(r=t.branding)?void 0:r.colors)?void 0:l.primary,"secondary-color":null==(d=null==(c=t.branding)?void 0:c.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(s,e.normalizeProps(e.guardReactiveProps(i.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:i,invoiceDownloadService:a})=>[o?(e.openBlock(),e.createBlock(x,{key:0,"is-loading":i,invoice:o,"invoice-download-service":a,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),C=a.defineCustomElement(k),N=a.getComponentName("invoice");exports.COMPONENT_NAME=N,exports.SolvimonInvoice=C,exports.defineSolvimonInvoice=()=>{customElements.get(N)||customElements.define(N,C)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-BRg7IWqW.js"),o=require("../../invoices-CUrXmVXe.js"),n=require("../../useService-D-CUtlp3.js"),i=require("../../payments-ClJySb0d.js"),a=require("../../component-BeqkeC9h.js"),r=require("../../index-CWSXne1Q.js"),l=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-sbmK2un9.js"),c=require("../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-NRmK7iN3.js");const s=e.defineComponent({__name:"Invoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(a){const r=a,l=function({invoiceId:e}){const{getInvoice:t,getInvoicePdf:i}=o.createInvoicesService(),{data:a,execute:r,apiStatus:l,error:c,isPending:s}=n.useService({service:()=>t(e)});return{invoice:a,downloadInvoicePdf:i,apiStatus:l,error:c,get:r,isPending:s}}({invoiceId:r.configuration.invoiceId}),c=function(){const{getPayments:e}=i.createPaymentsService(),{data:t,execute:o,error:a,apiStatus:r,isPending:l}=n.useService({service:e,isCollection:!0});return{payments:t,get:o,error:a,apiStatus:r,isPending:l}}(),{isLoading:s}=t.useLoadInitialData(l.get(),c.get(r.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(l).invoice.value,invoiceDownloadService:e.unref(l).downloadInvoicePdf,payments:e.unref(c),isLoading:e.unref(s)})}}),d={key:0,class:"mt-8"},u={class:"flex flex-col gap-6"},p=["onClick","onKeyup"],m={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},f={key:0},v={class:"p-0"},g={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},y=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:i,formatMessage:r,formatNumber:l}=a.useIntl(),{getIsOpen:c,toggle:s}=a.useToggleList(),y=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),_=e=>r({defaultMessage:"Service period - {startAt} - {endAt}",id:"kFCxC4",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),w=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=y.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:r({defaultMessage:"Credits",id:"K2fM1n",description:"Fallback label for wallet balance credit types when no name is available"})},b=e=>e?l(Number(e)):r({defaultMessage:"-",id:"dHb0fN",description:"Placeholder shown when a wallet balance quantity is missing"}),x=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var i,a,r,l;const c=new Map,s=new Map;for(const t of e.groups??[])for(const d of t.lines??[]){const u=null==(i=null==d?void 0:d.details)?void 0:i.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),f={id:`${e.period_order}-${t.group_order}-${d.line_order}`,label:m,used:n(null==(a=u.used_wallet_credits)?void 0:a.quantity),left:n(null==(r=u.left_wallet_credits)?void 0:r.quantity),available:n(null==(l=u.available_wallet_credits)?void 0:l.quantity)},v=`${f.label}-${f.used}-${f.left}-${f.available}`,g=s.get(m)??new Set;if(g.has(v))continue;g.add(v),s.set(m,g);const y=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:f.available,rows:[]};y.rows.push(f),c.set(m,y)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:_,getCreditTypeLabel:w,formatQuantity:b}));return(t,o)=>x.value.length>0?(e.openBlock(),e.createElementBlock("section",d,[e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(a._sfc_main$2q),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main$2),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(a.InvoiceTable),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(a._sfc_main$t),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Wallet balance",id:"j2d7b2",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(s)(t.id),onKeyup:[e.withKeys(o=>e.unref(s)(t.id),["enter"]),e.withKeys(o=>e.unref(s)(t.id),["space"])]},[e.createVNode(e.unref(a._sfc_main$u),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main$4),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(c)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",m,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,p),e.unref(c)(t.id)?(e.openBlock(),e.createElementBlock("tr",f,[e.createElementVNode("td",v,[e.createElementVNode("div",g,[e.createVNode(e.unref(a.InvoiceTable),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(a._sfc_main$t),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Credit breakdown",id:"65I4e4",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Balance",id:"4UjRe6",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Used",id:"rUy4Lk",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Remaining",id:"C8F4/r",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(a._sfc_main$u),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),_=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=a.useIntl(),{width:n}=r.useWindowSize(),i=e.computed(()=>n.value<=768);return(n,r)=>(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1g),{title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"}),class:"grow"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"p-6 pt-2":!i.value})},[i.value?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1J),{key:0,variant:"default","has-icon":"",class:"justify-center bg-gray-50 border-gray-100 text-gray-800 font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(a._sfc_main$e),{invoice:t.invoice,"is-expandable":!i.value},{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(y,{invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),w={class:"flex flex-col gap-3 lg:flex-row lg:gap-6"},b={class:"flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},x=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(t){const{$t:o}=a.useIntl();return(n,i)=>{var r,s;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(a._sfc_main$w),{class:"mb-6","payment-attempts":t.payments??[],invoice:t.invoice,"download-service":()=>t.invoiceDownloadService(t.invoice.id),"show-download-button":t.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",w,[t.invoice?(e.openBlock(),e.createBlock(_,{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",b,[e.createVNode(l._sfc_main,{invoice:t.invoice},null,8,["invoice"]),(null==(r=t.configuration)?void 0:r.enablePaymentAttempts)&&(null==(s=t.payments)?void 0:s.length)?(e.openBlock(),e.createBlock(c._sfc_main,{key:0,"payment-attempts":t.payments,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.configuration.enableCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$z),{key:1,customer:t.invoice.customer,title:e.unref(o)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])],64)}}}),h=e.defineComponent({__name:"Invoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){var o;const n=t;if(!(null==(o=n.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const i=e.computed(()=>({...n,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...n.configuration}}));return(o,n)=>{var r,l,c,d;return e.openBlock(),e.createBlock(e.unref(a._sfc_main$1),{"custom-element-name":e.unref(C),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(r=t.branding)?void 0:r.colors)?void 0:l.primary,"secondary-color":null==(d=null==(c=t.branding)?void 0:c.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(s,e.normalizeProps(e.guardReactiveProps(i.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:i,invoiceDownloadService:a})=>[o?(e.openBlock(),e.createBlock(x,{key:0,"is-loading":i,invoice:o,"invoice-download-service":a,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),k=a.defineCustomElement(h),C=a.getComponentName("invoice");exports.COMPONENT_NAME=C,exports.SolvimonInvoice=k,exports.defineSolvimonInvoice=()=>{customElements.get(C)||customElements.define(C,k)};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent, renderSlot, unref, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, withCtx, createTextVNode, toDisplayString, withKeys, normalizeClass, createCommentVNode, createBlock, normalizeProps, guardReactiveProps } from "vue";
|
|
2
2
|
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
3
|
-
import { c as createInvoicesService } from "../../invoices-
|
|
3
|
+
import { c as createInvoicesService } from "../../invoices-CoEBP5UT.mjs";
|
|
4
4
|
import { u as useService } from "../../useService-B4qv5N2D.mjs";
|
|
5
|
-
import { c as createPaymentsService } from "../../payments-
|
|
6
|
-
import { b as useIntl, R as useToggleList, S as _sfc_main$2q, _ as _sfc_main$2$1, U as InvoiceTable, V as _sfc_main$t, W as _sfc_main$u, n as _sfc_main$4$1, d as _sfc_main$1g, X as _sfc_main$1J, Y as _sfc_main$e, Z as _sfc_main$w, l as _sfc_main$z, p as _sfc_main$
|
|
5
|
+
import { c as createPaymentsService } from "../../payments-DLjkq_hN.mjs";
|
|
6
|
+
import { b as useIntl, R as useToggleList, S as _sfc_main$2q, _ as _sfc_main$2$1, U as InvoiceTable, V as _sfc_main$t, W as _sfc_main$u, n as _sfc_main$4$1, d as _sfc_main$1g, X as _sfc_main$1J, Y as _sfc_main$e, Z as _sfc_main$w, l as _sfc_main$z, p as _sfc_main$7, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
7
7
|
import { u as useWindowSize } from "../../index-D3v7hAtc.mjs";
|
|
8
|
-
import { _ as _sfc_main$
|
|
9
|
-
import { _ as _sfc_main$
|
|
8
|
+
import { _ as _sfc_main$5 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DaEPSNrY.mjs";
|
|
9
|
+
import { _ as _sfc_main$6 } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CLU-8-Ao.mjs";
|
|
10
10
|
function useInvoice({ invoiceId }) {
|
|
11
11
|
const { getInvoice, getInvoicePdf: downloadInvoicePdf } = createInvoicesService();
|
|
12
12
|
const service = () => getInvoice(invoiceId);
|
|
@@ -36,7 +36,7 @@ function usePayments() {
|
|
|
36
36
|
});
|
|
37
37
|
return { payments: data, get, error, apiStatus, isPending };
|
|
38
38
|
}
|
|
39
|
-
const _sfc_main$
|
|
39
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
40
40
|
__name: "Invoice.entry.view",
|
|
41
41
|
props: {
|
|
42
42
|
environment: { type: String },
|
|
@@ -136,7 +136,7 @@ const _hoisted_4 = { class: "ml-1 inline-flex h-3.5 w-3.5 items-center justify-c
|
|
|
136
136
|
const _hoisted_5 = { key: 0 };
|
|
137
137
|
const _hoisted_6 = { class: "p-0" };
|
|
138
138
|
const _hoisted_7 = { class: "-mx-9 bg-gray-50 px-9 py-3 text-xs" };
|
|
139
|
-
const _sfc_main$
|
|
139
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
140
140
|
__name: "InvoiceCreditsBreakdown",
|
|
141
141
|
props: {
|
|
142
142
|
invoice: { type: Object }
|
|
@@ -370,7 +370,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
});
|
|
373
|
-
const _sfc_main$
|
|
373
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
374
374
|
__name: "InvoiceBlock",
|
|
375
375
|
props: {
|
|
376
376
|
invoice: { type: Object }
|
|
@@ -416,7 +416,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
416
416
|
]),
|
|
417
417
|
_: 3
|
|
418
418
|
}, 8, ["invoice", "is-expandable"]),
|
|
419
|
-
createVNode(_sfc_main$
|
|
419
|
+
createVNode(_sfc_main$3, { invoice: __props.invoice }, null, 8, ["invoice"])
|
|
420
420
|
], 2)
|
|
421
421
|
]),
|
|
422
422
|
_: 3
|
|
@@ -426,41 +426,41 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
426
426
|
});
|
|
427
427
|
const _hoisted_1 = { class: "flex flex-col gap-3 lg:flex-row lg:gap-6" };
|
|
428
428
|
const _hoisted_2 = { class: "flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6" };
|
|
429
|
-
const _sfc_main$
|
|
430
|
-
__name: "
|
|
429
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
430
|
+
__name: "Invoice",
|
|
431
431
|
props: {
|
|
432
|
+
isLoading: { type: Boolean },
|
|
432
433
|
invoice: { type: Object },
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
showCustomerBillingInformation: { type: Boolean, default: true },
|
|
437
|
-
showPaymentAttempts: { type: Boolean, default: true }
|
|
434
|
+
payments: { type: Array },
|
|
435
|
+
invoiceDownloadService: { type: Function },
|
|
436
|
+
configuration: { type: Object }
|
|
438
437
|
},
|
|
439
438
|
setup(__props) {
|
|
440
439
|
const { $t } = useIntl();
|
|
441
440
|
return (_ctx, _cache) => {
|
|
441
|
+
var _a, _b;
|
|
442
442
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
443
443
|
createVNode(unref(_sfc_main$w), {
|
|
444
444
|
class: "mb-6",
|
|
445
|
-
"payment-attempts": __props.
|
|
445
|
+
"payment-attempts": __props.payments ?? [],
|
|
446
446
|
invoice: __props.invoice,
|
|
447
|
-
"download-service": () => __props.
|
|
448
|
-
"show-download-button": __props.
|
|
447
|
+
"download-service": () => __props.invoiceDownloadService(__props.invoice.id),
|
|
448
|
+
"show-download-button": __props.configuration.enableDownloadButton,
|
|
449
449
|
variant: "external"
|
|
450
450
|
}, null, 8, ["payment-attempts", "invoice", "download-service", "show-download-button"]),
|
|
451
451
|
createElementVNode("div", _hoisted_1, [
|
|
452
|
-
__props.invoice ? (openBlock(), createBlock(_sfc_main$
|
|
452
|
+
__props.invoice ? (openBlock(), createBlock(_sfc_main$2, {
|
|
453
453
|
key: 0,
|
|
454
454
|
invoice: __props.invoice
|
|
455
455
|
}, null, 8, ["invoice"])) : createCommentVNode("", true),
|
|
456
456
|
createElementVNode("div", _hoisted_2, [
|
|
457
|
-
createVNode(_sfc_main$
|
|
458
|
-
__props.
|
|
457
|
+
createVNode(_sfc_main$5, { invoice: __props.invoice }, null, 8, ["invoice"]),
|
|
458
|
+
((_a = __props.configuration) == null ? void 0 : _a.enablePaymentAttempts) && ((_b = __props.payments) == null ? void 0 : _b.length) ? (openBlock(), createBlock(_sfc_main$6, {
|
|
459
459
|
key: 0,
|
|
460
|
-
"payment-attempts": __props.
|
|
460
|
+
"payment-attempts": __props.payments,
|
|
461
461
|
customer: __props.invoice.customer
|
|
462
462
|
}, null, 8, ["payment-attempts", "customer"])) : createCommentVNode("", true),
|
|
463
|
-
__props.
|
|
463
|
+
__props.configuration.enableCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$z), {
|
|
464
464
|
key: 1,
|
|
465
465
|
customer: __props.invoice.customer,
|
|
466
466
|
title: unref($t)({
|
|
@@ -475,29 +475,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
});
|
|
478
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
479
|
-
__name: "Invoice",
|
|
480
|
-
props: {
|
|
481
|
-
isLoading: { type: Boolean },
|
|
482
|
-
invoice: { type: Object },
|
|
483
|
-
payments: { type: Array },
|
|
484
|
-
invoiceDownloadService: { type: Function },
|
|
485
|
-
configuration: { type: Object }
|
|
486
|
-
},
|
|
487
|
-
setup(__props) {
|
|
488
|
-
return (_ctx, _cache) => {
|
|
489
|
-
var _a, _b, _c;
|
|
490
|
-
return openBlock(), createBlock(_sfc_main$2, {
|
|
491
|
-
invoice: __props.invoice,
|
|
492
|
-
"payment-attempts": __props.payments,
|
|
493
|
-
"download-service": __props.invoiceDownloadService,
|
|
494
|
-
"show-download-button": (_a = __props.configuration) == null ? void 0 : _a.enableDownloadButton,
|
|
495
|
-
"show-customer-billing-information": (_b = __props.configuration) == null ? void 0 : _b.enableCustomerBillingInformation,
|
|
496
|
-
"show-payment-attempts": (_c = __props.configuration) == null ? void 0 : _c.enablePaymentAttempts
|
|
497
|
-
}, null, 8, ["invoice", "payment-attempts", "download-service", "show-download-button", "show-customer-billing-information", "show-payment-attempts"]);
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
478
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
502
479
|
__name: "Invoice.entry",
|
|
503
480
|
props: {
|
|
@@ -535,7 +512,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
535
512
|
}));
|
|
536
513
|
return (_ctx, _cache) => {
|
|
537
514
|
var _a2, _b, _c, _d;
|
|
538
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
515
|
+
return openBlock(), createBlock(unref(_sfc_main$7), {
|
|
539
516
|
"custom-element-name": unref(COMPONENT_NAME),
|
|
540
517
|
environment: __props.environment,
|
|
541
518
|
locale: __props.locale,
|
|
@@ -549,7 +526,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
549
526
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
550
527
|
}, {
|
|
551
528
|
default: withCtx(() => [
|
|
552
|
-
createVNode(_sfc_main$
|
|
529
|
+
createVNode(_sfc_main$4, normalizeProps(guardReactiveProps(resolvedProps.value)), {
|
|
553
530
|
default: withCtx(({ invoice, payments, isLoading, invoiceDownloadService }) => [
|
|
554
531
|
invoice ? (openBlock(), createBlock(_sfc_main$1, {
|
|
555
532
|
key: 0,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonInvoiceDetails: import('
|
|
1
|
+
export declare const SolvimonInvoiceDetails: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonInvoiceDetails: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-sbmK2un9.js"),t=require("../../Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),n=require("../../useInvoiceData-DvNf2402.js"),i=require("../../component-BeqkeC9h.js"),r=e.defineComponent({__name:"InvoiceDetails",props:{invoice:{type:Object},isLoading:{type:Boolean},configuration:{type:Object}},setup:n=>(i,r)=>n.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"invoice-details-skeleton"})):(e.openBlock(),e.createBlock(o._sfc_main,{key:1,invoice:n.invoice},null,8,["invoice"]))}),a=e.defineComponent({__name:"InvoiceDetails.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(o){const t=o,i=n.useInvoiceData(t.configuration.invoiceId);return(o,t)=>{var n;return e.renderSlot(o.$slots,"default",{invoice:null==(n=e.unref(i).data.value)?void 0:n.invoice,isLoading:e.unref(i).isPending.value})}}}),l=e.defineComponent({__name:"InvoiceDetails.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(o){var t;if(!(null==(t=o.configuration)?void 0:t.invoiceId))throw new Error("Missing invoice id");return(t,n)=>{var l,c,s,u;return e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{"custom-element-name":e.unref(p),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(l=o.branding)?void 0:l.colors)?void 0:c.primary,"secondary-color":null==(u=null==(s=o.branding)?void 0:s.colors)?void 0:u.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:n[0]||(n[0]=e=>t.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(({invoice:t,isLoading:n})=>[t?(e.openBlock(),e.createBlock(r,{key:0,"is-loading":n,invoice:t,configuration:o.configuration},null,8,["is-loading","invoice","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),c=i.defineCustomElement(l),p=i.getComponentName("invoice-details");exports.COMPONENT_NAME=p,exports.SolvimonInvoiceDetails=c,exports.defineSolvimonInvoiceDetails=()=>{customElements.get(p)||customElements.define(p,c)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps, createCommentVNode } from "vue";
|
|
2
|
-
import { _ as _sfc_main$4 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as _sfc_main$4 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DaEPSNrY.mjs";
|
|
3
3
|
import { _ as _sfc_main$3 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs";
|
|
4
|
-
import { u as useInvoiceData } from "../../useInvoiceData-
|
|
5
|
-
import { p as _sfc_main$5, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
4
|
+
import { u as useInvoiceData } from "../../useInvoiceData-7mqBeSPa.mjs";
|
|
5
|
+
import { p as _sfc_main$5, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
6
6
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "InvoiceDetails",
|
|
8
8
|
props: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonInvoicesList: import('
|
|
1
|
+
export declare const SolvimonInvoicesList: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonInvoicesList: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../useInvoicesList-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../useInvoicesList-CBqZG_rw.js"),t=require("../../useLoadInitialData-BRg7IWqW.js"),n=require("../../component-BeqkeC9h.js"),r=e.defineComponent({__name:"InvoicesList.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(n){var r,i;const a=n,l=a.portalObject.customer_id,s=o.useInvoicesList({customerId:l,batchSize:(null==(i=null==(r=a.configuration)?void 0:r.pagination)?void 0:i.batchSize)||15}),{isLoading:c}=t.useLoadInitialData(s.fetchInitial());return(o,t)=>e.renderSlot(o.$slots,"default",{isLoading:e.unref(c),invoices:e.unref(s)})}}),i=e.defineComponent({__name:"InvoicesList.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(i,a)=>{var s,c,p,m;return e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{"custom-element-name":e.unref(l),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(s=t.branding)?void 0:s.colors)?void 0:c.primary,"secondary-color":null==(m=null==(p=t.branding)?void 0:p.colors)?void 0:m.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:a[0]||(a[0]=e=>i.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(r,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({invoices:n,isLoading:r})=>[e.createVNode(o._sfc_main,{configuration:t.configuration,invoices:n.items.value,"is-loading":r,"has-more-items":n.hasNextBatch.value,onLoadMore:n.fetchMore},null,8,["configuration","invoices","is-loading","has-more-items","onLoadMore"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),a=n.defineCustomElement(i),l=n.getComponentName("invoices-list");exports.COMPONENT_NAME=l,exports.SolvimonInvoicesList=a,exports.defineSolvimonInvoicesList=()=>{customElements.get(l)||customElements.define(l,a)};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, renderSlot, unref, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { u as useInvoicesList, _ as _sfc_main$3 } from "../../useInvoicesList-
|
|
3
|
-
import {
|
|
2
|
+
import { u as useInvoicesList, _ as _sfc_main$3 } from "../../useInvoicesList-B5vYDRyl.mjs";
|
|
3
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
4
|
+
import { p as _sfc_main$2, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
4
5
|
const DEFAULT_BATCH_SIZE = 15;
|
|
5
6
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
6
7
|
__name: "InvoicesList.entry.view",
|
|
@@ -30,8 +31,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
30
31
|
customerId,
|
|
31
32
|
batchSize: ((_b = (_a = props.configuration) == null ? void 0 : _a.pagination) == null ? void 0 : _b.batchSize) || DEFAULT_BATCH_SIZE
|
|
32
33
|
});
|
|
34
|
+
const { isLoading } = useLoadInitialData(invoices.fetchInitial());
|
|
33
35
|
return (_ctx, _cache) => {
|
|
34
|
-
return renderSlot(_ctx.$slots, "default", {
|
|
36
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
37
|
+
isLoading: unref(isLoading),
|
|
38
|
+
invoices: unref(invoices)
|
|
39
|
+
});
|
|
35
40
|
};
|
|
36
41
|
}
|
|
37
42
|
});
|
|
@@ -73,11 +78,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
78
|
}, {
|
|
74
79
|
default: withCtx(() => [
|
|
75
80
|
createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
76
|
-
default: withCtx(({ invoices }) => [
|
|
81
|
+
default: withCtx(({ invoices, isLoading }) => [
|
|
77
82
|
createVNode(_sfc_main$3, {
|
|
78
83
|
configuration: __props.configuration,
|
|
79
84
|
invoices: invoices.items.value,
|
|
80
|
-
"is-loading":
|
|
85
|
+
"is-loading": isLoading,
|
|
81
86
|
"has-more-items": invoices.hasNextBatch.value,
|
|
82
87
|
onLoadMore: invoices.fetchMore
|
|
83
88
|
}, null, 8, ["configuration", "invoices", "is-loading", "has-more-items", "onLoadMore"])
|
|
@@ -91,7 +96,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
91
96
|
}
|
|
92
97
|
});
|
|
93
98
|
const SolvimonInvoicesList = defineCustomElement(_sfc_main);
|
|
94
|
-
const COMPONENT_NAME = getComponentName("
|
|
99
|
+
const COMPONENT_NAME = getComponentName("invoices-list");
|
|
95
100
|
const defineSolvimonInvoicesList = () => {
|
|
96
101
|
if (!customElements.get(COMPONENT_NAME)) {
|
|
97
102
|
customElements.define(COMPONENT_NAME, SolvimonInvoicesList);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonPaymentHistory: import('
|
|
1
|
+
export declare const SolvimonPaymentHistory: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonPaymentHistory: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-NRmK7iN3.js"),o=require("../../Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),n=require("../../useInvoiceData-DvNf2402.js"),r=require("../../component-BeqkeC9h.js"),a=e.defineComponent({__name:"PaymentHistory",props:{customer:{type:Object},paymentAttempts:{type:Array},isLoading:{type:Boolean},configuration:{type:Object}},setup:n=>(r,a)=>n.isLoading?(e.openBlock(),e.createBlock(o._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"payment-history-skeleton"})):n.paymentAttempts.length?(e.openBlock(),e.createBlock(t._sfc_main,{key:1,"payment-attempts":n.paymentAttempts,customer:n.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0)}),i=e.defineComponent({__name:"PaymentHistory.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,r=n.useInvoiceData(o.configuration.invoiceId);return(t,o)=>{var n,a;return e.renderSlot(t.$slots,"default",{invoice:null==(n=e.unref(r).data.value)?void 0:n.invoice,paymentAttempts:null==(a=e.unref(r).data.value)?void 0:a.paymentAttempts.data,isLoading:e.unref(r).isPending.value})}}}),l=e.defineComponent({__name:"PaymentHistory.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){var o;if(!(null==(o=t.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");return(o,n)=>{var l,p,m,c;return e.openBlock(),e.createBlock(e.unref(r._sfc_main$1),{"custom-element-name":e.unref(s),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(l=t.branding)?void 0:l.colors)?void 0:p.primary,"secondary-color":null==(c=null==(m=t.branding)?void 0:m.colors)?void 0:c.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(i,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:o,paymentAttempts:n,isLoading:r})=>[o&&n?(e.openBlock(),e.createBlock(a,{key:0,"is-loading":r,customer:o.customer,"payment-attempts":n,configuration:t.configuration},null,8,["is-loading","customer","payment-attempts","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),p=r.defineCustomElement(l),s=r.getComponentName("payment-history");exports.COMPONENT_NAME=s,exports.SolvimonPaymentHistory=p,exports.defineSolvimonPaymentHistory=()=>{customElements.get(s)||customElements.define(s,p)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, createCommentVNode, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$4 } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as _sfc_main$4 } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CLU-8-Ao.mjs";
|
|
3
3
|
import { _ as _sfc_main$3 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs";
|
|
4
|
-
import { u as useInvoiceData } from "../../useInvoiceData-
|
|
5
|
-
import { p as _sfc_main$5, q as defineCustomElement, o as getComponentName } from "../../component-
|
|
4
|
+
import { u as useInvoiceData } from "../../useInvoiceData-7mqBeSPa.mjs";
|
|
5
|
+
import { p as _sfc_main$5, q as defineCustomElement, o as getComponentName } from "../../component-B0RYS5uK.mjs";
|
|
6
6
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "PaymentHistory",
|
|
8
8
|
props: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonPaymentMethodForm: import('
|
|
1
|
+
export declare const SolvimonPaymentMethodForm: import('@vue/runtime-dom').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonPaymentMethodForm: () => void;
|