rebill-web-components-sdk 1.10.10-beta.1 → 1.10.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/card-fields-wrapper_11.cjs.entry.js +8 -8
- package/dist/cjs/index-C-VTnc0I.js.map +1 -1
- package/dist/cjs/input-otp.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/rebill-card.rebill-input-email.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-card_2.cjs.entry.js +77 -83
- package/dist/cjs/rebill-container_2.cjs.entry.js +1 -1
- package/dist/cjs/rebill-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/rebill-grid-container.cjs.entry.js +1 -1
- package/dist/cjs/rebill-input-select.cjs.entry.js +2 -2
- package/dist/cjs/rebill-input-text.cjs.entry.js +2 -2
- package/dist/cjs/rebill-mode-sandbox_2.cjs.entry.js +1 -1
- package/dist/cjs/rebill-timeline-debit-day_2.cjs.entry.js +2 -2
- package/dist/cjs/rebill-web-components-sdk.cjs.js +1 -1
- package/dist/collection/components/shared/inputs/input-email/input-email.css +19 -8
- package/dist/collection/components/shared/inputs/input-email/input-email.js +84 -73
- package/dist/collection/components/shared/inputs/input-email/input-email.js.map +1 -1
- package/dist/collection/components/shared/inputs/input-otp/input-otp.js +2 -2
- package/dist/collection/components/shared/inputs/input-phone/input-phone.js +2 -2
- package/dist/collection/components/shared/inputs/input-select/input-select.js +2 -2
- package/dist/collection/components/shared/inputs/input-text/input-text.js +2 -2
- package/dist/collection/components/shared/layouts/generics/container.js +1 -1
- package/dist/collection/components/shared/layouts/generics/flex.js +1 -1
- package/dist/collection/components/shared/layouts/generics/grid.js +1 -1
- package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.js +1 -1
- package/dist/collection/components/shared/selectable-card/selectable-card.js +2 -2
- package/dist/collection/components/shared/singlePaymentMethod/singlePaymentMethod.js +4 -4
- package/dist/collection/components/shared/timeline/timeline-debit-day.js +1 -1
- package/dist/collection/components/shared/timeline/timeline-free-trial.js +1 -1
- package/dist/collection/utils/email-validation.js +11 -1
- package/dist/collection/utils/email-validation.js.map +1 -1
- package/dist/components/card-fields-wrapper.js +1 -1
- package/dist/components/change-card-success.js +1 -1
- package/dist/components/discount-coupon.js +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/otp-component.js +1 -1
- package/dist/components/{p-xKyxKtdF.js → p-30DP4s-1.js} +4 -4
- package/dist/components/{p-xKyxKtdF.js.map → p-30DP4s-1.js.map} +1 -1
- package/dist/components/p-8BpuJ_V5.js.map +1 -1
- package/dist/components/{p-Cg8vTcm1.js → p-B28tIeVs.js} +3 -3
- package/dist/components/{p-Cg8vTcm1.js.map → p-B28tIeVs.js.map} +1 -1
- package/dist/components/{p-PtbrPqLv.js → p-B2zhJUcA.js} +4 -4
- package/dist/components/{p-PtbrPqLv.js.map → p-B2zhJUcA.js.map} +1 -1
- package/dist/components/{p-0K5ek-gN.js → p-B3jFm6B_.js} +4 -4
- package/dist/components/{p-0K5ek-gN.js.map → p-B3jFm6B_.js.map} +1 -1
- package/dist/components/{p-BGrQjFTc.js → p-BOYVvAQB.js} +3 -3
- package/dist/components/{p-BGrQjFTc.js.map → p-BOYVvAQB.js.map} +1 -1
- package/dist/components/{p-BgLkcEoy.js → p-BR18G7Pq.js} +4 -4
- package/dist/components/{p-BgLkcEoy.js.map → p-BR18G7Pq.js.map} +1 -1
- package/dist/components/{p-BwbfTRHn.js → p-Ba3VDw-H.js} +3 -3
- package/dist/components/{p-BwbfTRHn.js.map → p-Ba3VDw-H.js.map} +1 -1
- package/dist/components/{p-h01Qiljf.js → p-Ba8zuq-V.js} +3 -3
- package/dist/components/{p-h01Qiljf.js.map → p-Ba8zuq-V.js.map} +1 -1
- package/dist/components/{p-CiOrml-5.js → p-CFLYpSRc.js} +3 -3
- package/dist/components/{p-CiOrml-5.js.map → p-CFLYpSRc.js.map} +1 -1
- package/dist/components/{p-VlzBlwUc.js → p-CMVxImmw.js} +5 -5
- package/dist/components/{p-VlzBlwUc.js.map → p-CMVxImmw.js.map} +1 -1
- package/dist/components/{p-Cthy0N10.js → p-CP4gYqda.js} +5 -5
- package/dist/components/{p-Cthy0N10.js.map → p-CP4gYqda.js.map} +1 -1
- package/dist/components/{p-CSeC5LGG.js → p-Ch0U0Vmb.js} +3 -3
- package/dist/components/{p-CSeC5LGG.js.map → p-Ch0U0Vmb.js.map} +1 -1
- package/dist/components/{p-CamHvHq5.js → p-ChYpVv-Q.js} +4 -4
- package/dist/components/{p-CamHvHq5.js.map → p-ChYpVv-Q.js.map} +1 -1
- package/dist/components/{p-CtFu9Z9D.js → p-CypPi9fK.js} +4 -4
- package/dist/components/{p-CtFu9Z9D.js.map → p-CypPi9fK.js.map} +1 -1
- package/dist/components/{p-BOYEmkB-.js → p-D19UjlNC.js} +5 -5
- package/dist/components/{p-BOYEmkB-.js.map → p-D19UjlNC.js.map} +1 -1
- package/dist/components/{p-BqeCVajN.js → p-D6CVLxdH.js} +4 -4
- package/dist/components/{p-BqeCVajN.js.map → p-D6CVLxdH.js.map} +1 -1
- package/dist/components/{p-CVq9IPp4.js → p-DPB4aAQa.js} +6 -6
- package/dist/components/{p-CVq9IPp4.js.map → p-DPB4aAQa.js.map} +1 -1
- package/dist/components/{p-DP1RHUGR.js → p-DWbH_VvT.js} +81 -88
- package/dist/components/p-DWbH_VvT.js.map +1 -0
- package/dist/components/{p-B0tiz_Xb.js → p-DcwjZ5a1.js} +4 -4
- package/dist/components/{p-B0tiz_Xb.js.map → p-DcwjZ5a1.js.map} +1 -1
- package/dist/components/{p-6IQljT42.js → p-Dhm2b0J_.js} +7 -7
- package/dist/components/{p-6IQljT42.js.map → p-Dhm2b0J_.js.map} +1 -1
- package/dist/components/{p-Dvnf-j7X.js → p-Dhs3vhG4.js} +5 -5
- package/dist/components/{p-Dvnf-j7X.js.map → p-Dhs3vhG4.js.map} +1 -1
- package/dist/components/{p-DR6_SaU9.js → p-Dp-CUwYp.js} +3 -3
- package/dist/components/{p-DR6_SaU9.js.map → p-Dp-CUwYp.js.map} +1 -1
- package/dist/components/{p-DeStKoNN.js → p-Dsrpb4rI.js} +3 -3
- package/dist/components/{p-DeStKoNN.js.map → p-Dsrpb4rI.js.map} +1 -1
- package/dist/components/{p-De7T_ng8.js → p-G3CHdt_U.js} +6 -6
- package/dist/components/{p-De7T_ng8.js.map → p-G3CHdt_U.js.map} +1 -1
- package/dist/components/{p-CN-2D26g.js → p-Pg_gixIL.js} +3 -3
- package/dist/components/{p-CN-2D26g.js.map → p-Pg_gixIL.js.map} +1 -1
- package/dist/components/{p-d40T-Ru7.js → p-fJpj0Zb5.js} +4 -4
- package/dist/components/{p-d40T-Ru7.js.map → p-fJpj0Zb5.js.map} +1 -1
- package/dist/components/{p-Czjk80qD.js → p-fXuAmVVV.js} +6 -6
- package/dist/components/{p-Czjk80qD.js.map → p-fXuAmVVV.js.map} +1 -1
- package/dist/components/{p-BMlyFJD4.js → p-iM2t1WOr.js} +3 -3
- package/dist/components/{p-BMlyFJD4.js.map → p-iM2t1WOr.js.map} +1 -1
- package/dist/components/{p-C-mZ7tbj.js → p-lrqPOj5Q.js} +3 -3
- package/dist/components/{p-C-mZ7tbj.js.map → p-lrqPOj5Q.js.map} +1 -1
- package/dist/components/{p-Bnocq8Cb.js → p-mSjgruQE.js} +4 -4
- package/dist/components/{p-Bnocq8Cb.js.map → p-mSjgruQE.js.map} +1 -1
- package/dist/components/payment-method-selector.js +1 -1
- package/dist/components/rebill-address-form.js +1 -1
- package/dist/components/rebill-address-search.js +1 -1
- package/dist/components/rebill-address.js +1 -1
- package/dist/components/rebill-bank-selector.js +1 -1
- package/dist/components/rebill-change-card.js +19 -19
- package/dist/components/rebill-checkout-single-column.js +1 -1
- package/dist/components/rebill-checkout.js +26 -26
- package/dist/components/rebill-container.js +1 -1
- package/dist/components/rebill-flex-container.js +1 -1
- package/dist/components/rebill-footer.js +1 -1
- package/dist/components/rebill-grid-container.js +1 -1
- package/dist/components/rebill-input-email.js +1 -1
- package/dist/components/rebill-input-phone.js +1 -1
- package/dist/components/rebill-input-select.js +1 -1
- package/dist/components/rebill-input-text.js +1 -1
- package/dist/components/rebill-installments.js +1 -1
- package/dist/components/rebill-mode-sandbox-mobile.js +1 -1
- package/dist/components/rebill-processing-payment.js +1 -1
- package/dist/components/rebill-renewal.js +19 -19
- package/dist/components/rebill-summary.js +1 -1
- package/dist/components/rebill-timeline-debit-day.js +1 -1
- package/dist/components/rebill-timeline-free-trial.js +1 -1
- package/dist/components/renewal-success-page.js +1 -1
- package/dist/components/renewal-summary.js +1 -1
- package/dist/components/root-component.js +3 -3
- package/dist/components/selectable-card.js +1 -1
- package/dist/components/single-payment-method.js +1 -1
- package/dist/components/success-page.js +1 -1
- package/dist/components/user-information-phone.js +1 -1
- package/dist/components/user-information.js +1 -1
- package/dist/esm/card-fields-wrapper_11.entry.js +8 -8
- package/dist/esm/index-BTZ7D7jU.js.map +1 -1
- package/dist/esm/input-otp.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/rebill-card.rebill-input-email.entry.js.map +1 -1
- package/dist/esm/rebill-card_2.entry.js +77 -83
- package/dist/esm/rebill-container_2.entry.js +1 -1
- package/dist/esm/rebill-flex-container.entry.js +1 -1
- package/dist/esm/rebill-grid-container.entry.js +1 -1
- package/dist/esm/rebill-input-select.entry.js +2 -2
- package/dist/esm/rebill-input-text.entry.js +2 -2
- package/dist/esm/rebill-mode-sandbox_2.entry.js +1 -1
- package/dist/esm/rebill-timeline-debit-day_2.entry.js +2 -2
- package/dist/esm/rebill-web-components-sdk.js +1 -1
- package/dist/rebill-web-components-sdk/{p-2b3cb9b5.entry.js → p-11ee0328.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-24a79725.entry.js → p-130877f9.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-734696df.entry.js → p-16e7646e.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-c6c8bf05.entry.js → p-6eede717.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-98fc2da1.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-98fc2da1.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/p-BTZ7D7jU.js.map +1 -1
- package/dist/rebill-web-components-sdk/{p-a09a0d53.entry.js → p-b350f63e.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-c38319c1.entry.js → p-be004b4f.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-894d7d00.entry.js → p-d73d7c39.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-45d1115b.entry.js → p-dd44d494.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-6ab7c3bc.entry.js → p-e54f571c.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/rebill-card.rebill-input-email.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
- package/dist/types/components/shared/inputs/input-email/input-email.d.ts +8 -17
- package/package.json +1 -1
- package/dist/components/p-DP1RHUGR.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-8a2f420d.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-8a2f420d.entry.js.map +0 -1
- /package/dist/rebill-web-components-sdk/{p-2b3cb9b5.entry.js.map → p-11ee0328.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-24a79725.entry.js.map → p-130877f9.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-734696df.entry.js.map → p-16e7646e.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-c6c8bf05.entry.js.map → p-6eede717.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-a09a0d53.entry.js.map → p-b350f63e.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-c38319c1.entry.js.map → p-be004b4f.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-894d7d00.entry.js.map → p-d73d7c39.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-45d1115b.entry.js.map → p-dd44d494.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-6ab7c3bc.entry.js.map → p-e54f571c.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-BTZ7D7jU.js";import{f as i,e as n,d as r,s,I as a}from"./p-DPLmRWqO.js";import{C as o}from"./p-C5Pu-n-i.js";var l;(function(t){t["CHARGE_FULL"]="charge_full";t["CHARGE_NEXT_CYCLE"]="charge_next_cycle";t["CHARGE_PRORATED"]="charge_prorated"})(l||(l={}));const c=".timeline-container{width:100%;margin:0 auto}.timeline{display:flex;flex-direction:column;gap:4px;padding:16px;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border);border-radius:8px;justify-content:space-evenly}.timeline-event{display:flex;align-items:flex-start;gap:8px;position:relative}.timeline-icon-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;gap:4px}.timeline-connector-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;min-height:45px}.timeline-icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;flex-shrink:0;z-index:2;gap:4px}.timeline-connector-icon{display:block;flex-shrink:0;z-index:1}.event-content{flex:1;display:flex;flex-direction:column}.discount-info{margin-top:8px}.event-date rebill-icon{display:inline-block;vertical-align:text-top;margin:0 4px;width:14px;height:14px;transform:translateY(-1px)}@media (max-width: 1024px){.timeline{border:none;padding:0}.timeline-event{gap:12px;align-items:flex-start}.timeline-icon{width:28px;height:28px}}";const d=class{constructor(e){t(this,e)}currentLanguage;debitDay;totalAmount;planAmount;currency;debitStrategy;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get totalAmountFormatted(){return i(this.totalAmount,this.currency,false)}get planAmountFormatted(){return i(this.planAmount,this.currency,false)}getDurationTranslation(t){return t===1?n.t("summary.month_one"):n.t("summary.month_other",{count:t})}get hasDiscountApplied(){return this.discountApplied&&(this.discountedPercentage>0||this.discountAmount>0)}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const t=s.data.discount.couponCode||s.data.pricing.discountCouponCode;const e=this.discountType===r.PERCENTAGE?`${this.discountedPercentage}%`:i(this.discountAmount,this.currency);if(this.discountDuration){return n.t(`summary.planDiscountDescriptionWithDuration`,{discount:t?`${t} – ${e}`:e,duration:this.getDurationTranslation(this.discountDuration)})}else{return n.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:t?`${t} – ${e}`:e})}}calculateDelayedChargeDate(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getDateForDay(this.debitDay)}const t=new Date;const e=new Date(t);e.setMonth(t.getMonth()+this.discountDuration);e.setDate(this.debitDay);return e.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}componentWillLoad(){this.currentLanguage=this.language||n.language;n.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){n.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||n.language};getDateForDay(t){const e=new Date;const i=new Date(e);if(t===1){return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}else{const t=e.getMonth();if(this.debitDay<e.getDate()){i.setMonth(t+1)}i.setDate(this.debitDay);return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}getNextMonthName(){const t=new Date;const e=new Date(t);e.setMonth(t.getMonth()+1);return e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDebitDay(){const t=new Date;const e=new Date(t);if(this.debitDay<t.getDate()){e.setMonth(t.getMonth()+1)}return e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDelayedCharge(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getNextMonthName()}const t=new Date;const e=new Date(t);e.setMonth(t.getMonth()+this.discountDuration);return e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}buildEvents(){const t=[];const e=this.getNextMonthName();const i=this.calculateDelayedChargeDate();const r=this.hasDiscountApplied?this.getDiscountDescription():undefined;switch(this.debitStrategy){case l.CHARGE_FULL:t.push({day:1,type:"today",date:this.getDateForDay(1),title:n.t("timeline.today"),description:n.t("timeline.chargeFullToday",{amount:`$${this.totalAmountFormatted}`}),icon:"circle-calendar",discountInfo:r});t.push({day:this.debitDay,type:"recurring",date:this.hasDiscountApplied?i:"",title:n.t("timeline.after"),description:n.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():e}),icon:"circle-receipt-active"});break;case l.CHARGE_NEXT_CYCLE:t.push({day:1,type:"today",date:this.getDateForDay(1),title:n.t("timeline.today"),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:r});t.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:n.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});t.push({day:this.debitDay+1,type:"recurring",date:"",title:n.t("timeline.after"),description:n.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():e}),icon:"clock-and-calendar"});break;case l.CHARGE_PRORATED:t.push({day:1,type:"today",date:this.getDateForDay(1),title:n.t("timeline.today"),description:n.t("timeline.proratedCharge",{amount:`$${this.totalAmountFormatted}`,day:this.debitDay,month:this.getMonthNameForDebitDay()}),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:r});t.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:n.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});t.push({day:this.debitDay+1,type:"recurring",date:"",title:n.t("timeline.after"),description:n.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():e}),icon:"clock-and-calendar"});break}return t}renderEvent(t,i,n){const r=this.buildEvents();const s=r.length;return e("div",{key:t.day,class:"timeline-event"},e("div",{class:"timeline-icon-container"},e("rebill-icon",{name:t.icon,style:{marginTop:"3px"}}),e("div",{class:"timeline-connector-container"},!i&&(n?s===2?e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-icon",height:t.discountInfo?"65px":"45px"}):e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-icon",height:t.discountInfo?"65px":"45px",withDot:true}):e("rebill-vertical-divider",{color:o.TIMELINE_CONNECTOR,class:"timeline-connector-icon",height:t.discountInfo?"65px":"45px"})))),e("div",{class:"event-content"},e("rebill-typography",{variant:"subtitle-bold"},t.title),e("div",{class:"event-date"},e("rebill-typography",{variant:"body2"},t.amount?e("span",null,t.date," ",e("rebill-icon",{name:"arrow-right"})," ",t.amount," ",t.description):t.date?`${t.date} - ${t.description}`:t.description)),t.discountInfo&&e("div",{class:"discount-info"},e("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:o.GREEN,alertTitle:t.discountInfo}))))}render(){const t=this.buildEvents();return e("div",{key:"cd9013c62915566d11b8185e75a66171529ea7ae",class:"timeline-container"},e("div",{key:"178e2be3dc4eb0a4070b9885046886d4bf147fdc",class:"timeline"},t.map(((e,i)=>this.renderEvent(e,i===t.length-1,i===0)))))}};d.style=c;const h=".timeline-container{width:100%;margin:0 auto}.timeline{display:flex;flex-direction:column;gap:4px;padding:16px;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border);border-radius:8px;justify-content:space-evenly}.timeline-event{display:flex;align-items:flex-start;gap:8px;position:relative}.timeline-icon-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;gap:4px}.timeline-connector-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;min-height:40px}.timeline-icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;flex-shrink:0;z-index:2;gap:4px}.timeline-connector-divider{display:block;flex-shrink:0;z-index:1}.event-content{flex:1;display:flex;flex-direction:column}.discount-info{margin-top:8px}@media (max-width: 1024px){.timeline{border:none;padding:0}.timeline-event{gap:12px;align-items:flex-start}.timeline-icon{width:28px;height:28px}}";const m=class{constructor(e){t(this,e)}currentLanguage;trialPeriodEndsAt;trialPeriodEndsReminderAt;trialPeriodDays;subtotal;currency;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get amount(){return i(this.subtotal,this.currency,false)}getDurationTranslation(t){return t===1?n.t("summary.month_one"):n.t("summary.month_other",{count:t})}get hasDiscountApplied(){const t=Boolean(s.data.discount?.couponCode||s.data.pricing?.discountCouponCode||s.data.discount?.discountType||this.discountType&&(this.discountedPercentage>0||this.discountAmount>0));return t}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const t=s.data.discount.couponCode||s.data.pricing.discountCouponCode;const e=this.discountType===r.PERCENTAGE?`${this.discountedPercentage}%`:i(this.discountAmount,this.currency);if(this.discountDuration){return n.t(`summary.planDiscountDescriptionWithDuration`,{discount:t?`${t} – ${e}`:e,duration:this.getDurationTranslation(this.discountDuration)})}else{return n.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:t?`${t} – ${e}`:e})}}calculateRenewalDate(){if(!this.discountDuration||!this.trialPeriodEndsAt){return this.trialPeriodEndsAt}const t=new Date(this.trialPeriodEndsAt);const e=new Date(t);e.setMonth(e.getMonth()+this.discountDuration);return e.toISOString()}componentWillLoad(){this.currentLanguage=this.language||a.getCurrentLanguage();n.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){n.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||a.getCurrentLanguage()};getDateForDay(t){if(typeof t==="string"){const e=new Date(t);return e.getDate().toString()+" de "+e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}else{const e=new Date;const i=new Date(e);const n=t||1;i.setDate(e.getDate()+(n-1));return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}buildEvents(){const t=[];t.push({day:1,type:"start",date:this.getDateForDay(null),title:n.t("timeline.dayOne"),description:n.t("timeline.startTrial",{count:this.trialPeriodDays,trialDays:this.trialPeriodDays}),icon:"circle-calendar"});const e=this.trialPeriodDays===1?2:this.trialPeriodDays;const r=this.hasDiscountApplied&&this.subtotal===0?"$0":`$${this.amount}`;const a={day:e,type:"last",date:this.getDateForDay(this.trialPeriodEndsAt),title:n.t("timeline.lastDay",{day:e}),description:n.t("timeline.subscriptionStart",{amount:r}),icon:"circle-receipt",discountInfo:this.hasDiscountApplied?this.getDiscountDescription():undefined};if(this.trialPeriodEndsReminderAt){if(this.trialPeriodDays===3){t.push({day:2,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:n.t("timeline.reminder",{day:2}),description:n.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}else if(this.trialPeriodDays>3){t.push({day:this.trialPeriodDays,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:n.t("timeline.reminder",{day:this.trialPeriodDays-2}),description:n.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}}t.push(a);if(this.hasDiscountApplied&&this.discountDuration!==null){const r=s.data.pricing.planAmount;const a=this.calculateRenewalDate();t.push({day:e+1,type:"renewal",date:this.getDateForDay(a),title:n.t("timeline.subscriptionRenewal"),description:n.t("timeline.renewalAmount",{amount:`$${i(r,this.currency,false)}`}),icon:"renewal",amount:`$${i(r,this.currency,false)}`})}return t}renderEvent(t,i,n,r){return e("div",{key:t.day,class:"timeline-event"},e("div",{class:"timeline-icon-container"},e("rebill-icon",{name:t.icon,style:{marginTop:"3px"}}),e("div",{class:"timeline-connector-container"},!i&&(n?r===2?e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-divider",height:t.discountInfo?"65px":"45px"}):e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-divider",height:t.discountInfo?"65px":"45px",withDot:true}):e("rebill-vertical-divider",{color:o.TIMELINE_CONNECTOR,class:"timeline-connector-divider",height:t.discountInfo?"65px":"45px"})))),e("div",{class:"event-content"},e("rebill-typography",{variant:"subtitle-bold"},t.title),e("div",{class:"event-date"},e("rebill-typography",{variant:"body2"},`${t.date} - ${t.description}`)),t.discountInfo&&e("div",{class:"discount-info"},e("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:o.GREEN,alertTitle:t.discountInfo}))))}render(){const t=this.buildEvents();return e("div",{key:"e98d65f75f58db57b8c15192ebdb0ec3988aabe2",class:"timeline-container"},e("div",{key:"a3a8408576290c7c988663cf3d2c4c83e55b7fc0",class:"timeline"},t.map(((e,i)=>this.renderEvent(e,i===t.length-1,i===0,t.length)))))}};m.style=h;export{d as rebill_timeline_debit_day,m as rebill_timeline_free_trial};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e}from"./p-BTZ7D7jU.js";import{f as i,e as n,d as r,s,I as a}from"./p-DPLmRWqO.js";import{C as o}from"./p-C5Pu-n-i.js";var l;(function(t){t["CHARGE_FULL"]="charge_full";t["CHARGE_NEXT_CYCLE"]="charge_next_cycle";t["CHARGE_PRORATED"]="charge_prorated"})(l||(l={}));const c=".timeline-container{width:100%;margin:0 auto}.timeline{display:flex;flex-direction:column;gap:4px;padding:16px;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border);border-radius:8px;justify-content:space-evenly}.timeline-event{display:flex;align-items:flex-start;gap:8px;position:relative}.timeline-icon-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;gap:4px}.timeline-connector-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;min-height:45px}.timeline-icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;flex-shrink:0;z-index:2;gap:4px}.timeline-connector-icon{display:block;flex-shrink:0;z-index:1}.event-content{flex:1;display:flex;flex-direction:column}.discount-info{margin-top:8px}.event-date rebill-icon{display:inline-block;vertical-align:text-top;margin:0 4px;width:14px;height:14px;transform:translateY(-1px)}@media (max-width: 1024px){.timeline{border:none;padding:0}.timeline-event{gap:12px;align-items:flex-start}.timeline-icon{width:28px;height:28px}}";const d=class{constructor(e){t(this,e)}currentLanguage;debitDay;totalAmount;planAmount;currency;debitStrategy;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get totalAmountFormatted(){return i(this.totalAmount,this.currency,false)}get planAmountFormatted(){return i(this.planAmount,this.currency,false)}getDurationTranslation(t){return t===1?n.t("summary.month_one"):n.t("summary.month_other",{count:t})}get hasDiscountApplied(){return this.discountApplied&&(this.discountedPercentage>0||this.discountAmount>0)}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const t=s.data.discount.couponCode||s.data.pricing.discountCouponCode;const e=this.discountType===r.PERCENTAGE?`${this.discountedPercentage}%`:i(this.discountAmount,this.currency);if(this.discountDuration){return n.t(`summary.planDiscountDescriptionWithDuration`,{discount:t?`${t} – ${e}`:e,duration:this.getDurationTranslation(this.discountDuration)})}else{return n.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:t?`${t} – ${e}`:e})}}calculateDelayedChargeDate(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getDateForDay(this.debitDay)}const t=new Date;const e=new Date(t);e.setMonth(t.getMonth()+this.discountDuration);e.setDate(this.debitDay);return e.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}componentWillLoad(){this.currentLanguage=this.language||n.language;n.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){n.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||n.language};getDateForDay(t){const e=new Date;const i=new Date(e);if(t===1){return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}else{const t=e.getMonth();if(this.debitDay<e.getDate()){i.setMonth(t+1)}i.setDate(this.debitDay);return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}getNextMonthName(){const t=new Date;const e=new Date(t);e.setMonth(t.getMonth()+1);return e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDebitDay(){const t=new Date;const e=new Date(t);if(this.debitDay<t.getDate()){e.setMonth(t.getMonth()+1)}return e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDelayedCharge(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getNextMonthName()}const t=new Date;const e=new Date(t);e.setMonth(t.getMonth()+this.discountDuration);return e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}buildEvents(){const t=[];const e=this.getNextMonthName();const i=this.calculateDelayedChargeDate();const r=this.hasDiscountApplied?this.getDiscountDescription():undefined;switch(this.debitStrategy){case l.CHARGE_FULL:t.push({day:1,type:"today",date:this.getDateForDay(1),title:n.t("timeline.today"),description:n.t("timeline.chargeFullToday",{amount:`$${this.totalAmountFormatted}`}),icon:"circle-calendar",discountInfo:r});t.push({day:this.debitDay,type:"recurring",date:this.hasDiscountApplied?i:"",title:n.t("timeline.after"),description:n.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():e}),icon:"circle-receipt-active"});break;case l.CHARGE_NEXT_CYCLE:t.push({day:1,type:"today",date:this.getDateForDay(1),title:n.t("timeline.today"),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:r});t.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:n.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});t.push({day:this.debitDay+1,type:"recurring",date:"",title:n.t("timeline.after"),description:n.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():e}),icon:"clock-and-calendar"});break;case l.CHARGE_PRORATED:t.push({day:1,type:"today",date:this.getDateForDay(1),title:n.t("timeline.today"),description:n.t("timeline.proratedCharge",{amount:`$${this.totalAmountFormatted}`,day:this.debitDay,month:this.getMonthNameForDebitDay()}),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:r});t.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:n.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});t.push({day:this.debitDay+1,type:"recurring",date:"",title:n.t("timeline.after"),description:n.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():e}),icon:"clock-and-calendar"});break}return t}renderEvent(t,i,n){const r=this.buildEvents();const s=r.length;return e("div",{key:t.day,class:"timeline-event"},e("div",{class:"timeline-icon-container"},e("rebill-icon",{name:t.icon,style:{marginTop:"3px"}}),e("div",{class:"timeline-connector-container"},!i&&(n?s===2?e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-icon",height:t.discountInfo?"65px":"45px"}):e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-icon",height:t.discountInfo?"65px":"45px",withDot:true}):e("rebill-vertical-divider",{color:o.TIMELINE_CONNECTOR,class:"timeline-connector-icon",height:t.discountInfo?"65px":"45px"})))),e("div",{class:"event-content"},e("rebill-typography",{variant:"subtitle-bold"},t.title),e("div",{class:"event-date"},e("rebill-typography",{variant:"body2"},t.amount?e("span",null,t.date," ",e("rebill-icon",{name:"arrow-right"})," ",t.amount," ",t.description):t.date?`${t.date} - ${t.description}`:t.description)),t.discountInfo&&e("div",{class:"discount-info"},e("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:o.GREEN,alertTitle:t.discountInfo}))))}render(){const t=this.buildEvents();return e("div",{key:"fe87dc3ef6ae5d6314205788e1ae723b1db4aba6",class:"timeline-container"},e("div",{key:"e58f1748dff622f4572e37b9ae2151bfeb78e0a7",class:"timeline"},t.map(((e,i)=>this.renderEvent(e,i===t.length-1,i===0)))))}};d.style=c;const h=".timeline-container{width:100%;margin:0 auto}.timeline{display:flex;flex-direction:column;gap:4px;padding:16px;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border);border-radius:8px;justify-content:space-evenly}.timeline-event{display:flex;align-items:flex-start;gap:8px;position:relative}.timeline-icon-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;gap:4px}.timeline-connector-container{display:flex;flex-direction:column;align-items:center;flex-shrink:0;position:relative;min-height:40px}.timeline-icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;flex-shrink:0;z-index:2;gap:4px}.timeline-connector-divider{display:block;flex-shrink:0;z-index:1}.event-content{flex:1;display:flex;flex-direction:column}.discount-info{margin-top:8px}@media (max-width: 1024px){.timeline{border:none;padding:0}.timeline-event{gap:12px;align-items:flex-start}.timeline-icon{width:28px;height:28px}}";const m=class{constructor(e){t(this,e)}currentLanguage;trialPeriodEndsAt;trialPeriodEndsReminderAt;trialPeriodDays;subtotal;currency;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get amount(){return i(this.subtotal,this.currency,false)}getDurationTranslation(t){return t===1?n.t("summary.month_one"):n.t("summary.month_other",{count:t})}get hasDiscountApplied(){const t=Boolean(s.data.discount?.couponCode||s.data.pricing?.discountCouponCode||s.data.discount?.discountType||this.discountType&&(this.discountedPercentage>0||this.discountAmount>0));return t}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const t=s.data.discount.couponCode||s.data.pricing.discountCouponCode;const e=this.discountType===r.PERCENTAGE?`${this.discountedPercentage}%`:i(this.discountAmount,this.currency);if(this.discountDuration){return n.t(`summary.planDiscountDescriptionWithDuration`,{discount:t?`${t} – ${e}`:e,duration:this.getDurationTranslation(this.discountDuration)})}else{return n.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:t?`${t} – ${e}`:e})}}calculateRenewalDate(){if(!this.discountDuration||!this.trialPeriodEndsAt){return this.trialPeriodEndsAt}const t=new Date(this.trialPeriodEndsAt);const e=new Date(t);e.setMonth(e.getMonth()+this.discountDuration);return e.toISOString()}componentWillLoad(){this.currentLanguage=this.language||a.getCurrentLanguage();n.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){n.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||a.getCurrentLanguage()};getDateForDay(t){if(typeof t==="string"){const e=new Date(t);return e.getDate().toString()+" de "+e.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}else{const e=new Date;const i=new Date(e);const n=t||1;i.setDate(e.getDate()+(n-1));return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}buildEvents(){const t=[];t.push({day:1,type:"start",date:this.getDateForDay(null),title:n.t("timeline.dayOne"),description:n.t("timeline.startTrial",{count:this.trialPeriodDays,trialDays:this.trialPeriodDays}),icon:"circle-calendar"});const e=this.trialPeriodDays===1?2:this.trialPeriodDays;const r=this.hasDiscountApplied&&this.subtotal===0?"$0":`$${this.amount}`;const a={day:e,type:"last",date:this.getDateForDay(this.trialPeriodEndsAt),title:n.t("timeline.lastDay",{day:e}),description:n.t("timeline.subscriptionStart",{amount:r}),icon:"circle-receipt",discountInfo:this.hasDiscountApplied?this.getDiscountDescription():undefined};if(this.trialPeriodEndsReminderAt){if(this.trialPeriodDays===3){t.push({day:2,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:n.t("timeline.reminder",{day:2}),description:n.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}else if(this.trialPeriodDays>3){t.push({day:this.trialPeriodDays,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:n.t("timeline.reminder",{day:this.trialPeriodDays-2}),description:n.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}}t.push(a);if(this.hasDiscountApplied&&this.discountDuration!==null){const r=s.data.pricing.planAmount;const a=this.calculateRenewalDate();t.push({day:e+1,type:"renewal",date:this.getDateForDay(a),title:n.t("timeline.subscriptionRenewal"),description:n.t("timeline.renewalAmount",{amount:`$${i(r,this.currency,false)}`}),icon:"renewal",amount:`$${i(r,this.currency,false)}`})}return t}renderEvent(t,i,n,r){return e("div",{key:t.day,class:"timeline-event"},e("div",{class:"timeline-icon-container"},e("rebill-icon",{name:t.icon,style:{marginTop:"3px"}}),e("div",{class:"timeline-connector-container"},!i&&(n?r===2?e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-divider",height:t.discountInfo?"65px":"45px"}):e("rebill-vertical-divider",{connectorActive:true,color:o.INFO_BORDER,class:"timeline-connector-divider",height:t.discountInfo?"65px":"45px",withDot:true}):e("rebill-vertical-divider",{color:o.TIMELINE_CONNECTOR,class:"timeline-connector-divider",height:t.discountInfo?"65px":"45px"})))),e("div",{class:"event-content"},e("rebill-typography",{variant:"subtitle-bold"},t.title),e("div",{class:"event-date"},e("rebill-typography",{variant:"body2"},`${t.date} - ${t.description}`)),t.discountInfo&&e("div",{class:"discount-info"},e("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:o.GREEN,alertTitle:t.discountInfo}))))}render(){const t=this.buildEvents();return e("div",{key:"2cde72b516f13999861cadcdb655adbc4ee06012",class:"timeline-container"},e("div",{key:"3b3906f2ed887a67f992fabefc40cc01ab503c1b",class:"timeline"},t.map(((e,i)=>this.renderEvent(e,i===t.length-1,i===0,t.length)))))}};m.style=h;export{d as rebill_timeline_debit_day,m as rebill_timeline_free_trial};
|
|
2
|
+
//# sourceMappingURL=p-130877f9.entry.js.map
|