rebill-web-components-sdk 1.8.8-beta.1 → 1.8.8-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/apm-checkout_17.cjs.entry.js +1 -1
- package/dist/cjs/discount-coupon_3.cjs.entry.js +2 -2
- package/dist/collection/components/shared/singlePaymentMethod/singlePaymentMethod.js +2 -1
- package/dist/collection/components/shared/singlePaymentMethod/singlePaymentMethod.js.map +1 -1
- 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/components/{p-DXKLGhDh.js → p-8QydEdM3.js} +3 -3
- package/dist/components/{p-DXKLGhDh.js.map → p-8QydEdM3.js.map} +1 -1
- package/dist/components/{p-LqNiPJXJ.js → p-BFrSAJDJ.js} +4 -4
- package/dist/components/{p-LqNiPJXJ.js.map → p-BFrSAJDJ.js.map} +1 -1
- package/dist/components/{p-5ojxJDke.js → p-BIlS1HQZ.js} +3 -3
- package/dist/components/{p-5ojxJDke.js.map → p-BIlS1HQZ.js.map} +1 -1
- package/dist/components/{p-CQg6lI7s.js → p-CBI0uoLx.js} +3 -3
- package/dist/components/{p-CQg6lI7s.js.map → p-CBI0uoLx.js.map} +1 -1
- package/dist/components/{p-DI_-013M.js → p-Cj2aAJh-.js} +4 -4
- package/dist/components/p-Cj2aAJh-.js.map +1 -0
- package/dist/components/payment-method-selector.js +1 -1
- package/dist/components/rebill-checkout.js +5 -5
- package/dist/components/rebill-renewal.js +2 -2
- 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/single-payment-method.js +1 -1
- package/dist/esm/apm-checkout_17.entry.js +1 -1
- package/dist/esm/discount-coupon_3.entry.js +2 -2
- package/dist/rebill-web-components-sdk/{p-78a41ca6.entry.js → p-4af8501b.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-fabb90fa.entry.js → p-73e884ce.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-fabb90fa.entry.js.map → p-73e884ce.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-DI_-013M.js.map +0 -1
- /package/dist/rebill-web-components-sdk/{p-78a41ca6.entry.js.map → p-4af8501b.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-CQg6lI7s.js","mappings":";;;;;;;;AAAA,IAAY,mBAIX;AAJD,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,mBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,mBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAI9B,EAAA,CAAA,CAAA;;ACJD,MAAM,mBAAmB,GAAG,0nCAA0nC;;MCwBzoC,gBAAgB,iBAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAAC,CAAA,CAAA;;;;;;;AAClB,IAAA,eAAe;AAEhB,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,QAAQ;AACR,IAAA,aAAa;AACb,IAAA,QAAQ;IACR,eAAe,GAAY,KAAK;AAChC,IAAA,YAAY;IACZ,oBAAoB,GAAW,CAAC;IAChC,gBAAgB,GAAW,CAAC;IAC5B,cAAc,GAAW,CAAC;AAElC,IAAA,IAAY,oBAAoB,GAAA;AAC9B,QAAA,OAAO,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;;AAG7D,IAAA,IAAY,mBAAmB,GAAA;AAC7B,QAAA,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,K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AA,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KACvB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAClE,CACG,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18n","sessionState"],"sources":["src/models/enums/debit-strategy.enum.ts","src/components/shared/timeline/timeline-debit-day.css?tag=rebill-timeline-debit-day","src/components/shared/timeline/timeline-debit-day.tsx"],"sourcesContent":["export enum DEBIT_STRATEGY_ENUM {\n CHARGE_FULL = 'charge_full',\n CHARGE_NEXT_CYCLE = 'charge_next_cycle',\n CHARGE_PRORATED = 'charge_prorated',\n}\n",".timeline-container {\n width: 100%;\n margin: 0 auto;\n}\n\n.timeline {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 16px;\n background: var(--rebill-color-background);\n border: 1px solid var(--rebill-color-border);\n border-radius: 8px;\n justify-content: space-evenly;\n}\n\n.timeline-event {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n position: relative;\n}\n\n.timeline-icon-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-shrink: 0;\n position: relative;\n gap: 4px;\n}\n.timeline-connector-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-shrink: 0;\n position: relative;\n min-height: 45px;\n}\n.timeline-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n flex-shrink: 0;\n z-index: 2;\n gap: 4px;\n}\n\n.timeline-connector-icon {\n display: block;\n flex-shrink: 0;\n z-index: 1;\n}\n\n.event-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.discount-info {\n margin-top: 8px;\n}\n\n.event-date rebill-icon {\n display: inline-block;\n vertical-align: text-top;\n margin: 0 4px;\n width: 14px;\n height: 14px;\n transform: translateY(-1px);\n}\n\n@media (max-width: 1024px) {\n .timeline {\n border: none;\n padding: 0;\n }\n\n .timeline-event {\n gap: 12px;\n align-items: flex-start;\n }\n\n .timeline-icon {\n width: 28px;\n height: 28px;\n }\n}\n","import { Component, h, Prop, State } from '@stencil/core';\nimport i18n from '../../../i18n/i18n.config';\nimport { DEBIT_STRATEGY_ENUM } from '../../../models/enums/debit-strategy.enum';\nimport { SESSION_DISCOUNT_TYPE_ENUM } from '../../../models/enums/session.enum';\nimport { sessionState } from '../../../store/session.store';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { formatAmount } from '../../../utils/currency-formatter';\n\ninterface TimelineEvent {\n day: number;\n type: 'today' | 'first_charge' | 'recurring';\n date: string;\n title: string;\n description?: string;\n icon: string;\n amount?: string;\n discountInfo?: string;\n}\n\n@Component({\n tag: 'rebill-timeline-debit-day',\n styleUrl: 'timeline-debit-day.css',\n shadow: false,\n})\nexport class TimelineDebitDay {\n @State() currentLanguage: string;\n\n @Prop() debitDay: number;\n @Prop() totalAmount: number;\n @Prop() planAmount: number;\n @Prop() currency: string;\n @Prop() debitStrategy: DEBIT_STRATEGY_ENUM;\n @Prop() language?: string;\n @Prop() discountApplied: boolean = false;\n @Prop() discountType: SESSION_DISCOUNT_TYPE_ENUM;\n @Prop() discountedPercentage: number = 0;\n @Prop() discountDuration: number = 0;\n @Prop() discountAmount: number = 0;\n\n private get totalAmountFormatted() {\n return formatAmount(this.totalAmount, this.currency, false);\n }\n\n private get planAmountFormatted() {\n return formatAmount(this.planAmount, this.currency, false);\n }\n\n private getDurationTranslation(duration: number): string {\n return duration === 1\n ? i18n.t('summary.month_one')\n : i18n.t('summary.month_other', { count: duration });\n }\n\n private get hasDiscountApplied(): boolean {\n return this.discountApplied && (this.discountedPercentage > 0 || this.discountAmount > 0);\n }\n\n private getDiscountDescription(): string {\n if (!this.hasDiscountApplied) return '';\n\n const couponCode =\n sessionState.data.discount.couponCode || sessionState.data.pricing.discountCouponCode;\n const discount =\n this.discountType === SESSION_DISCOUNT_TYPE_ENUM.PERCENTAGE\n ? `${this.discountedPercentage}%`\n : formatAmount(this.discountAmount, this.currency);\n\n if (this.discountDuration) {\n return i18n.t(`summary.planDiscountDescriptionWithDuration`, {\n discount: couponCode ? `${couponCode} – ${discount}` : discount,\n duration: this.getDurationTranslation(this.discountDuration),\n });\n } else {\n return i18n.t(`summary.planDiscountDescriptionWithoutDuration`, {\n discount: couponCode ? `${couponCode} – ${discount}` : discount,\n });\n }\n }\n\n private calculateDelayedChargeDate(): string {\n if (!this.hasDiscountApplied || !this.discountDuration) {\n return this.getDateForDay(this.debitDay);\n }\n\n const today = new Date();\n const targetDate = new Date(today);\n\n targetDate.setMonth(today.getMonth() + this.discountDuration);\n targetDate.setDate(this.debitDay);\n\n return targetDate.toLocaleDateString(this.currentLanguage, {\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n componentWillLoad() {\n this.currentLanguage = this.language || i18n.language;\n i18n.on('languageChanged', this.handleLanguageChange);\n }\n\n disconnectedCallback() {\n i18n.off('languageChanged', this.handleLanguageChange);\n }\n\n private handleLanguageChange = () => {\n this.currentLanguage = this.language || i18n.language;\n };\n\n private getDateForDay(dayNumber: number): string {\n const today = new Date();\n const targetDate = new Date(today);\n\n if (dayNumber === 1) {\n // Día 1 es siempre hoy\n return targetDate.toLocaleDateString(this.currentLanguage, {\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n } else {\n const currentMonth = today.getMonth();\n\n if (this.debitDay < today.getDate()) {\n targetDate.setMonth(currentMonth + 1);\n }\n\n targetDate.setDate(this.debitDay);\n return targetDate.toLocaleDateString(this.currentLanguage, {\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n }\n }\n\n private getNextMonthName(): string {\n const today = new Date();\n const nextMonth = new Date(today);\n nextMonth.setMonth(today.getMonth() + 1);\n return nextMonth.toLocaleDateString(this.currentLanguage, {\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n private getMonthNameForDebitDay(): string {\n const today = new Date();\n const targetDate = new Date(today);\n if (this.debitDay < today.getDate()) {\n targetDate.setMonth(today.getMonth() + 1);\n }\n\n return targetDate.toLocaleDateString(this.currentLanguage, {\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n private getMonthNameForDelayedCharge(): string {\n if (!this.hasDiscountApplied || !this.discountDuration) {\n return this.getNextMonthName();\n }\n\n const today = new Date();\n const targetDate = new Date(today);\n targetDate.setMonth(today.getMonth() + this.discountDuration);\n\n return targetDate.toLocaleDateString(this.currentLanguage, {\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n private buildEvents(): TimelineEvent[] {\n const events: TimelineEvent[] = [];\n const nextMonthName = this.getNextMonthName();\n const delayedChargeDate = this.calculateDelayedChargeDate();\n const discountInfo = this.hasDiscountApplied ? this.getDiscountDescription() : undefined;\n\n switch (this.debitStrategy) {\n case DEBIT_STRATEGY_ENUM.CHARGE_FULL:\n events.push({\n day: 1,\n type: 'today',\n date: this.getDateForDay(1),\n title: i18n.t('timeline.today'),\n description: i18n.t('timeline.chargeFullToday', {\n amount: `$${this.totalAmountFormatted}`,\n }),\n icon: 'circle-calendar',\n discountInfo,\n });\n\n events.push({\n day: this.debitDay,\n type: 'recurring',\n date: this.hasDiscountApplied ? delayedChargeDate : '',\n title: i18n.t('timeline.after'),\n description: i18n.t('timeline.recurringCharge', {\n day: this.debitDay,\n amount: `$${this.planAmountFormatted}`,\n month: this.hasDiscountApplied ? this.getMonthNameForDelayedCharge() : nextMonthName,\n }),\n icon: 'circle-receipt-active',\n });\n break;\n\n case DEBIT_STRATEGY_ENUM.CHARGE_NEXT_CYCLE:\n events.push({\n day: 1,\n type: 'today',\n date: this.getDateForDay(1),\n title: i18n.t('timeline.today'),\n icon: 'circle-calendar',\n amount: `$${this.totalAmountFormatted}`,\n discountInfo,\n });\n\n events.push({\n day: this.debitDay,\n type: 'first_charge',\n date: this.hasDiscountApplied ? delayedChargeDate : this.getDateForDay(this.debitDay),\n title: i18n.t('timeline.firstCharge'),\n description: '',\n icon: 'circle-receipt',\n amount: `$${this.planAmountFormatted}`,\n });\n\n events.push({\n day: this.debitDay + 1,\n type: 'recurring',\n date: '',\n title: i18n.t('timeline.after'),\n description: i18n.t('timeline.recurringCharge', {\n day: this.debitDay,\n amount: `$${this.planAmountFormatted}`,\n month: this.hasDiscountApplied ? this.getMonthNameForDelayedCharge() : nextMonthName,\n }),\n icon: 'clock-and-calendar',\n });\n break;\n\n case DEBIT_STRATEGY_ENUM.CHARGE_PRORATED:\n events.push({\n day: 1,\n type: 'today',\n date: this.getDateForDay(1),\n title: i18n.t('timeline.today'),\n description: i18n.t('timeline.proratedCharge', {\n amount: `$${this.totalAmountFormatted}`,\n day: this.debitDay,\n month: this.getMonthNameForDebitDay(),\n }),\n icon: 'circle-calendar',\n amount: `$${this.totalAmountFormatted}`,\n discountInfo,\n });\n\n events.push({\n day: this.debitDay,\n type: 'first_charge',\n date: this.hasDiscountApplied ? delayedChargeDate : this.getDateForDay(this.debitDay),\n title: i18n.t('timeline.firstCharge'),\n description: '',\n icon: 'circle-receipt',\n amount: `$${this.planAmountFormatted}`,\n });\n\n events.push({\n day: this.debitDay + 1,\n type: 'recurring',\n date: '',\n title: i18n.t('timeline.after'),\n description: i18n.t('timeline.recurringCharge', {\n day: this.debitDay,\n amount: `$${this.planAmountFormatted}`,\n month: this.hasDiscountApplied ? this.getMonthNameForDelayedCharge() : nextMonthName,\n }),\n icon: 'clock-and-calendar',\n });\n break;\n }\n\n return events;\n }\n\n private renderEvent(event: TimelineEvent, isLast: boolean, isFirst: boolean) {\n const events = this.buildEvents();\n const totalEvents = events.length;\n\n return (\n <div key={event.day} class=\"timeline-event\">\n <div class=\"timeline-icon-container\">\n <rebill-icon name={event.icon} style={{ marginTop: '3px' }} />\n <div class=\"timeline-connector-container\">\n {!isLast &&\n (isFirst ? (\n totalEvents === 2 ? (\n <rebill-vertical-divider\n connectorActive\n color={COLORS_ENUM.INFO_BORDER}\n class=\"timeline-connector-icon\"\n height={event.discountInfo ? '65px' : '45px'}\n />\n ) : (\n <rebill-vertical-divider\n connectorActive\n color={COLORS_ENUM.INFO_BORDER}\n class=\"timeline-connector-icon\"\n height={event.discountInfo ? '65px' : '45px'}\n withDot\n />\n )\n ) : (\n <rebill-vertical-divider\n color={COLORS_ENUM.TIMELINE_CONNECTOR}\n class=\"timeline-connector-icon\"\n height={event.discountInfo ? '65px' : '45px'}\n />\n ))}\n </div>\n </div>\n <div class=\"event-content\">\n <rebill-typography variant=\"subtitle-bold\">{event.title}</rebill-typography>\n <div class=\"event-date\">\n <rebill-typography variant=\"body2\">\n {event.amount ? (\n <span>\n {event.date} <rebill-icon name=\"arrow-right\" /> {event.amount} {event.description}\n </span>\n ) : event.date ? (\n `${event.date} - ${event.description}`\n ) : (\n event.description\n )}\n </rebill-typography>\n </div>\n {event.discountInfo && (\n <div class=\"discount-info\">\n <rebill-alert\n variant=\"filled\"\n type=\"coupon\"\n icon=\"tag-green\"\n size=\"small\"\n colorIcon={COLORS_ENUM.GREEN}\n alertTitle={event.discountInfo}\n />\n </div>\n )}\n </div>\n </div>\n );\n }\n\n render() {\n const events = this.buildEvents();\n\n return (\n <div class=\"timeline-container\">\n <div class=\"timeline\">\n {events.map((event, index) =>\n this.renderEvent(event, index === events.length - 1, index === 0),\n )}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-CBI0uoLx.js","mappings":";;;;;;;;AAAA,IAAY,mBAIX;AAJD,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,mBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,mBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAI9B,EAAA,CAAA,CAAA;;ACJD,MAAM,mBAAmB,GAAG,0nCAA0nC;;M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AK,CAAC,YAAY,KACjB,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,eAAe,EAAA,EACxB,CAAA,CAAA,cAAA,EAAA,EACE,OAAO,EAAC,QAAQ,EAChB,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,WAAW,CAAC,KAAK,EAC5B,UAAU,EAAE,KAAK,CAAC,YAAY,GAC9B,CACE,CACP,CACG,CACF;;IAIV,MAAM,GAAA;AACJ,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE;AAEjC,QAAA,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,oBAAoB,EAAA,EAC7B,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,UAAU,EAClB,EAAA,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KACvB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAClE,CACG,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18n","sessionState"],"sources":["src/models/enums/debit-strategy.enum.ts","src/components/shared/timeline/timeline-debit-day.css?tag=rebill-timeline-debit-day","src/components/shared/timeline/timeline-debit-day.tsx"],"sourcesContent":["export enum DEBIT_STRATEGY_ENUM {\n CHARGE_FULL = 'charge_full',\n CHARGE_NEXT_CYCLE = 'charge_next_cycle',\n CHARGE_PRORATED = 'charge_prorated',\n}\n",".timeline-container {\n width: 100%;\n margin: 0 auto;\n}\n\n.timeline {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 16px;\n background: var(--rebill-color-background);\n border: 1px solid var(--rebill-color-border);\n border-radius: 8px;\n justify-content: space-evenly;\n}\n\n.timeline-event {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n position: relative;\n}\n\n.timeline-icon-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-shrink: 0;\n position: relative;\n gap: 4px;\n}\n.timeline-connector-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-shrink: 0;\n position: relative;\n min-height: 45px;\n}\n.timeline-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n flex-shrink: 0;\n z-index: 2;\n gap: 4px;\n}\n\n.timeline-connector-icon {\n display: block;\n flex-shrink: 0;\n z-index: 1;\n}\n\n.event-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.discount-info {\n margin-top: 8px;\n}\n\n.event-date rebill-icon {\n display: inline-block;\n vertical-align: text-top;\n margin: 0 4px;\n width: 14px;\n height: 14px;\n transform: translateY(-1px);\n}\n\n@media (max-width: 1024px) {\n .timeline {\n border: none;\n padding: 0;\n }\n\n .timeline-event {\n gap: 12px;\n align-items: flex-start;\n }\n\n .timeline-icon {\n width: 28px;\n height: 28px;\n }\n}\n","import { Component, h, Prop, State } from '@stencil/core';\nimport i18n from '../../../i18n/i18n.config';\nimport { DEBIT_STRATEGY_ENUM } from '../../../models/enums/debit-strategy.enum';\nimport { SESSION_DISCOUNT_TYPE_ENUM } from '../../../models/enums/session.enum';\nimport { sessionState } from '../../../store/session.store';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { formatAmount } from '../../../utils/currency-formatter';\n\ninterface TimelineEvent {\n day: number;\n type: 'today' | 'first_charge' | 'recurring';\n date: string;\n title: string;\n description?: string;\n icon: string;\n amount?: string;\n discountInfo?: string;\n}\n\n@Component({\n tag: 'rebill-timeline-debit-day',\n styleUrl: 'timeline-debit-day.css',\n shadow: false,\n})\nexport class TimelineDebitDay {\n @State() currentLanguage: string;\n\n @Prop() debitDay: number;\n @Prop() totalAmount: number;\n @Prop() planAmount: number;\n @Prop() currency: string;\n @Prop() debitStrategy: DEBIT_STRATEGY_ENUM;\n @Prop() language?: string;\n @Prop() discountApplied: boolean = false;\n @Prop() discountType: SESSION_DISCOUNT_TYPE_ENUM;\n @Prop() discountedPercentage: number = 0;\n @Prop() discountDuration: number = 0;\n @Prop() discountAmount: number = 0;\n\n private get totalAmountFormatted() {\n return formatAmount(this.totalAmount, this.currency, false);\n }\n\n private get planAmountFormatted() {\n return formatAmount(this.planAmount, this.currency, false);\n }\n\n private getDurationTranslation(duration: number): string {\n return duration === 1\n ? i18n.t('summary.month_one')\n : i18n.t('summary.month_other', { count: duration });\n }\n\n private get hasDiscountApplied(): boolean {\n return this.discountApplied && (this.discountedPercentage > 0 || this.discountAmount > 0);\n }\n\n private getDiscountDescription(): string {\n if (!this.hasDiscountApplied) return '';\n\n const couponCode =\n sessionState.data.discount.couponCode || sessionState.data.pricing.discountCouponCode;\n const discount =\n this.discountType === SESSION_DISCOUNT_TYPE_ENUM.PERCENTAGE\n ? `${this.discountedPercentage}%`\n : formatAmount(this.discountAmount, this.currency);\n\n if (this.discountDuration) {\n return i18n.t(`summary.planDiscountDescriptionWithDuration`, {\n discount: couponCode ? `${couponCode} – ${discount}` : discount,\n duration: this.getDurationTranslation(this.discountDuration),\n });\n } else {\n return i18n.t(`summary.planDiscountDescriptionWithoutDuration`, {\n discount: couponCode ? `${couponCode} – ${discount}` : discount,\n });\n }\n }\n\n private calculateDelayedChargeDate(): string {\n if (!this.hasDiscountApplied || !this.discountDuration) {\n return this.getDateForDay(this.debitDay);\n }\n\n const today = new Date();\n const targetDate = new Date(today);\n\n targetDate.setMonth(today.getMonth() + this.discountDuration);\n targetDate.setDate(this.debitDay);\n\n return targetDate.toLocaleDateString(this.currentLanguage, {\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n componentWillLoad() {\n this.currentLanguage = this.language || i18n.language;\n i18n.on('languageChanged', this.handleLanguageChange);\n }\n\n disconnectedCallback() {\n i18n.off('languageChanged', this.handleLanguageChange);\n }\n\n private handleLanguageChange = () => {\n this.currentLanguage = this.language || i18n.language;\n };\n\n private getDateForDay(dayNumber: number): string {\n const today = new Date();\n const targetDate = new Date(today);\n\n if (dayNumber === 1) {\n // Día 1 es siempre hoy\n return targetDate.toLocaleDateString(this.currentLanguage, {\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n } else {\n const currentMonth = today.getMonth();\n\n if (this.debitDay < today.getDate()) {\n targetDate.setMonth(currentMonth + 1);\n }\n\n targetDate.setDate(this.debitDay);\n return targetDate.toLocaleDateString(this.currentLanguage, {\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n }\n }\n\n private getNextMonthName(): string {\n const today = new Date();\n const nextMonth = new Date(today);\n nextMonth.setMonth(today.getMonth() + 1);\n return nextMonth.toLocaleDateString(this.currentLanguage, {\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n private getMonthNameForDebitDay(): string {\n const today = new Date();\n const targetDate = new Date(today);\n if (this.debitDay < today.getDate()) {\n targetDate.setMonth(today.getMonth() + 1);\n }\n\n return targetDate.toLocaleDateString(this.currentLanguage, {\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n private getMonthNameForDelayedCharge(): string {\n if (!this.hasDiscountApplied || !this.discountDuration) {\n return this.getNextMonthName();\n }\n\n const today = new Date();\n const targetDate = new Date(today);\n targetDate.setMonth(today.getMonth() + this.discountDuration);\n\n return targetDate.toLocaleDateString(this.currentLanguage, {\n month: 'long',\n timeZone: 'UTC',\n });\n }\n\n private buildEvents(): TimelineEvent[] {\n const events: TimelineEvent[] = [];\n const nextMonthName = this.getNextMonthName();\n const delayedChargeDate = this.calculateDelayedChargeDate();\n const discountInfo = this.hasDiscountApplied ? this.getDiscountDescription() : undefined;\n\n switch (this.debitStrategy) {\n case DEBIT_STRATEGY_ENUM.CHARGE_FULL:\n events.push({\n day: 1,\n type: 'today',\n date: this.getDateForDay(1),\n title: i18n.t('timeline.today'),\n description: i18n.t('timeline.chargeFullToday', {\n amount: `$${this.totalAmountFormatted}`,\n }),\n icon: 'circle-calendar',\n discountInfo,\n });\n\n events.push({\n day: this.debitDay,\n type: 'recurring',\n date: this.hasDiscountApplied ? delayedChargeDate : '',\n title: i18n.t('timeline.after'),\n description: i18n.t('timeline.recurringCharge', {\n day: this.debitDay,\n amount: `$${this.planAmountFormatted}`,\n month: this.hasDiscountApplied ? this.getMonthNameForDelayedCharge() : nextMonthName,\n }),\n icon: 'circle-receipt-active',\n });\n break;\n\n case DEBIT_STRATEGY_ENUM.CHARGE_NEXT_CYCLE:\n events.push({\n day: 1,\n type: 'today',\n date: this.getDateForDay(1),\n title: i18n.t('timeline.today'),\n icon: 'circle-calendar',\n amount: `$${this.totalAmountFormatted}`,\n discountInfo,\n });\n\n events.push({\n day: this.debitDay,\n type: 'first_charge',\n date: this.hasDiscountApplied ? delayedChargeDate : this.getDateForDay(this.debitDay),\n title: i18n.t('timeline.firstCharge'),\n description: '',\n icon: 'circle-receipt',\n amount: `$${this.planAmountFormatted}`,\n });\n\n events.push({\n day: this.debitDay + 1,\n type: 'recurring',\n date: '',\n title: i18n.t('timeline.after'),\n description: i18n.t('timeline.recurringCharge', {\n day: this.debitDay,\n amount: `$${this.planAmountFormatted}`,\n month: this.hasDiscountApplied ? this.getMonthNameForDelayedCharge() : nextMonthName,\n }),\n icon: 'clock-and-calendar',\n });\n break;\n\n case DEBIT_STRATEGY_ENUM.CHARGE_PRORATED:\n events.push({\n day: 1,\n type: 'today',\n date: this.getDateForDay(1),\n title: i18n.t('timeline.today'),\n description: i18n.t('timeline.proratedCharge', {\n amount: `$${this.totalAmountFormatted}`,\n day: this.debitDay,\n month: this.getMonthNameForDebitDay(),\n }),\n icon: 'circle-calendar',\n amount: `$${this.totalAmountFormatted}`,\n discountInfo,\n });\n\n events.push({\n day: this.debitDay,\n type: 'first_charge',\n date: this.hasDiscountApplied ? delayedChargeDate : this.getDateForDay(this.debitDay),\n title: i18n.t('timeline.firstCharge'),\n description: '',\n icon: 'circle-receipt',\n amount: `$${this.planAmountFormatted}`,\n });\n\n events.push({\n day: this.debitDay + 1,\n type: 'recurring',\n date: '',\n title: i18n.t('timeline.after'),\n description: i18n.t('timeline.recurringCharge', {\n day: this.debitDay,\n amount: `$${this.planAmountFormatted}`,\n month: this.hasDiscountApplied ? this.getMonthNameForDelayedCharge() : nextMonthName,\n }),\n icon: 'clock-and-calendar',\n });\n break;\n }\n\n return events;\n }\n\n private renderEvent(event: TimelineEvent, isLast: boolean, isFirst: boolean) {\n const events = this.buildEvents();\n const totalEvents = events.length;\n\n return (\n <div key={event.day} class=\"timeline-event\">\n <div class=\"timeline-icon-container\">\n <rebill-icon name={event.icon} style={{ marginTop: '3px' }} />\n <div class=\"timeline-connector-container\">\n {!isLast &&\n (isFirst ? (\n totalEvents === 2 ? (\n <rebill-vertical-divider\n connectorActive\n color={COLORS_ENUM.INFO_BORDER}\n class=\"timeline-connector-icon\"\n height={event.discountInfo ? '65px' : '45px'}\n />\n ) : (\n <rebill-vertical-divider\n connectorActive\n color={COLORS_ENUM.INFO_BORDER}\n class=\"timeline-connector-icon\"\n height={event.discountInfo ? '65px' : '45px'}\n withDot\n />\n )\n ) : (\n <rebill-vertical-divider\n color={COLORS_ENUM.TIMELINE_CONNECTOR}\n class=\"timeline-connector-icon\"\n height={event.discountInfo ? '65px' : '45px'}\n />\n ))}\n </div>\n </div>\n <div class=\"event-content\">\n <rebill-typography variant=\"subtitle-bold\">{event.title}</rebill-typography>\n <div class=\"event-date\">\n <rebill-typography variant=\"body2\">\n {event.amount ? (\n <span>\n {event.date} <rebill-icon name=\"arrow-right\" /> {event.amount} {event.description}\n </span>\n ) : event.date ? (\n `${event.date} - ${event.description}`\n ) : (\n event.description\n )}\n </rebill-typography>\n </div>\n {event.discountInfo && (\n <div class=\"discount-info\">\n <rebill-alert\n variant=\"filled\"\n type=\"coupon\"\n icon=\"tag-green\"\n size=\"small\"\n colorIcon={COLORS_ENUM.GREEN}\n alertTitle={event.discountInfo}\n />\n </div>\n )}\n </div>\n </div>\n );\n }\n\n render() {\n const events = this.buildEvents();\n\n return (\n <div class=\"timeline-container\">\n <div class=\"timeline\">\n {events.map((event, index) =>\n this.renderEvent(event, index === events.length - 1, index === 0),\n )}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, H, h } from './p-8BpuJ_V5.js';
|
|
2
|
-
import { I as I18nService } from './p-DR1t3gvh.js';
|
|
2
|
+
import { P as PAYMENT_METHOD_ENUM, I as I18nService } from './p-DR1t3gvh.js';
|
|
3
3
|
import { C as COLORS_ENUM } from './p-DA598vBj.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-CTgkZUJ9.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './p-C_txMekS.js';
|
|
@@ -18,7 +18,7 @@ const SinglePaymentMethod = /*@__PURE__*/ proxyCustomElement(class SinglePayment
|
|
|
18
18
|
paymentMethodDetails;
|
|
19
19
|
icons = [];
|
|
20
20
|
render() {
|
|
21
|
-
return (h("div", { key: '912251af4177b26d44d1395bfe775b75f327958b', class: "single-payment-method" }, h("div", { key: 'a0b5ef36fe047eeef69e20576343b7ceac3deda2', class: "payment-method" }, h("rebill-icon", { key: '
|
|
21
|
+
return (h("div", { key: '912251af4177b26d44d1395bfe775b75f327958b', class: "single-payment-method" }, h("div", { key: 'a0b5ef36fe047eeef69e20576343b7ceac3deda2', class: "payment-method" }, this.paymentMethod === PAYMENT_METHOD_ENUM.CARD && h("rebill-icon", { key: '2b09cdf13b03dff1bfb195f8845d057c44d63c16', name: "card" }), this.paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && h("rebill-icon", { key: '5d022e76ea9d284ef024a63dc4452181ec20f34f', name: "bank" }), h("rebill-typography", { key: '2c9f59deccb7731477f6b063f92a4925f0ee41be', variant: "body2-small", color: COLORS_ENUM.NEUTRALS_700 }, I18nService.translate(`paymentMethods.${this.paymentMethod}`))), this.paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && (h("div", { key: '790ffaa2b0998dd98853c1bf159b60a0fa5e15fd', class: "icon-container" }, this.icons.length > 0 ? (this.icons.map(iconName => h("rebill-icon", { name: iconName, key: iconName }))) : (h("rebill-icon", { name: "card" }))))));
|
|
22
22
|
}
|
|
23
23
|
static get style() { return singlePaymentMethodCss; }
|
|
24
24
|
}, [256, "single-payment-method", {
|
|
@@ -53,6 +53,6 @@ function defineCustomElement() {
|
|
|
53
53
|
defineCustomElement();
|
|
54
54
|
|
|
55
55
|
export { SinglePaymentMethod as S, defineCustomElement as d };
|
|
56
|
-
//# sourceMappingURL=p-
|
|
56
|
+
//# sourceMappingURL=p-Cj2aAJh-.js.map
|
|
57
57
|
|
|
58
|
-
//# sourceMappingURL=p-
|
|
58
|
+
//# sourceMappingURL=p-Cj2aAJh-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-Cj2aAJh-.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,wfAAwf;;MCW1gB,mBAAmB,iBAAAA,kBAAA,CAAA,MAAA,mBAAA,SAAAC,CAAA,CAAA;;;;;;;AACtB,IAAA,aAAa;AACb,IAAA,eAAe;AACf,IAAA,oBAAoB;IACpB,KAAK,GAAa,EAAE;IAC5B,MAAM,GAAA;AACJ,QAAA,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,uBAAuB,EAAA,EAChC,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,gBAAgB,EAAA,EACxB,IAAI,CAAC,aAAa,KAAK,mBAAmB,CAAC,IAAI,IAAI,CAAa,CAAA,aAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,MAAM,EAAG,CAAA,EAC9E,IAAI,CAAC,aAAa,KAAK,mBAAmB,CAAC,aAAa,IAAI,CAAa,CAAA,aAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,MAAM,EAAG,CAAA,EACxF,CAAmB,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,WAAW,CAAC,YAAY,EAAA,EACrE,WAAW,CAAC,SAAS,CAAC,kBAAkB,IAAI,CAAC,aAAa,CAAE,CAAA,CAAC,CAC5C,CAChB,EAEL,IAAI,CAAC,aAAa,KAAK,mBAAmB,CAAC,aAAa,KACvD,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,gBAAgB,EAAA,EACxB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IACpB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAA,CAAA,aAAA,EAAA,EAAa,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAA,CAAI,CAAC,KAE1E,CAAa,CAAA,aAAA,EAAA,EAAA,IAAI,EAAC,MAAM,EAAG,CAAA,CAC5B,CACG,CACP,CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/shared/singlePaymentMethod/single-payment-method.css?tag=single-payment-method","src/components/shared/singlePaymentMethod/singlePaymentMethod.tsx"],"sourcesContent":[".single-payment-method {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n height: 40px;\n width: 100%;\n border-radius: 8px;\n background-color: var(--rebill-color-background-right);\n padding: 2px 4px 2px 4px;\n box-sizing: border-box;\n}\n\n.payment-method {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.icon-container {\n height: 32px;\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.icon-container rebill-icon {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { PaymentMethodDetails } from '../../../store/session.store';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\n\n@Component({\n tag: 'single-payment-method',\n styleUrl: 'single-payment-method.css',\n shadow: false,\n})\nexport class SinglePaymentMethod {\n @Prop() paymentMethod: PAYMENT_METHOD_ENUM;\n @Prop() currencyCountry: string;\n @Prop() paymentMethodDetails: PaymentMethodDetails[];\n @Prop() icons: string[] = [];\n render() {\n return (\n <div class=\"single-payment-method\">\n <div class=\"payment-method\">\n {this.paymentMethod === PAYMENT_METHOD_ENUM.CARD && <rebill-icon name=\"card\" />}\n {this.paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && <rebill-icon name=\"bank\" />}\n <rebill-typography variant=\"body2-small\" color={COLORS_ENUM.NEUTRALS_700}>\n {I18nService.translate(`paymentMethods.${this.paymentMethod}`)}\n </rebill-typography>\n </div>\n\n {this.paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && (\n <div class=\"icon-container\">\n {this.icons.length > 0 ? (\n this.icons.map(iconName => <rebill-icon name={iconName} key={iconName} />)\n ) : (\n <rebill-icon name=\"card\" />\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PaymentMethodSelector$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { P as PaymentMethodSelector$1, d as defineCustomElement$1 } from './p-BIlS1HQZ.js';
|
|
2
2
|
|
|
3
3
|
const PaymentMethodSelector = PaymentMethodSelector$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -5,7 +5,7 @@ import { m as mapRequiredFields, g as generateIdempotencyKey, P as PaymentMessag
|
|
|
5
5
|
import { P as PaymentMethodMapper, S as STATUS_REQ_CHECKOUT_APM, d as defineCustomElement$N } from './p-C-otItwe.js';
|
|
6
6
|
import { d as defineCustomElement$D } from './p-BFW7cPvA.js';
|
|
7
7
|
import { d as defineCustomElement$e } from './p-DQja8GIc.js';
|
|
8
|
-
import { d as defineCustomElement$d } from './p-
|
|
8
|
+
import { d as defineCustomElement$d } from './p-BFrSAJDJ.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './p-BxANvGc6.js';
|
|
10
10
|
import { d as defineCustomElement$F } from './p-DSgE2Das.js';
|
|
11
11
|
import { s as state, S as SESSION_TYPE_ENUM, I as I18nService, a as SessionStore, i as initializeI18nWithSessionLanguage, P as PAYMENT_METHOD_ENUM, o as onChange, b as SESSION_ITEM_TYPE_ENUM } from './p-DR1t3gvh.js';
|
|
@@ -20,7 +20,7 @@ import { d as defineCustomElement$I } from './p-DWKdh2yQ.js';
|
|
|
20
20
|
import { d as defineCustomElement$H } from './p-BnwyBJnh.js';
|
|
21
21
|
import { d as defineCustomElement$G } from './p-CjLCcaJT.js';
|
|
22
22
|
import { d as defineCustomElement$E } from './p-Bbv8DFQV.js';
|
|
23
|
-
import { d as defineCustomElement$C } from './p-
|
|
23
|
+
import { d as defineCustomElement$C } from './p-BIlS1HQZ.js';
|
|
24
24
|
import { d as defineCustomElement$B } from './p-B4jBpnaA.js';
|
|
25
25
|
import { d as defineCustomElement$A } from './p-BL1UfQF3.js';
|
|
26
26
|
import { d as defineCustomElement$z } from './p-PPrdK-H6.js';
|
|
@@ -42,13 +42,13 @@ import { d as defineCustomElement$j } from './p-CCuYHwTH.js';
|
|
|
42
42
|
import { d as defineCustomElement$i } from './p-DPLa2TqM.js';
|
|
43
43
|
import { d as defineCustomElement$h } from './p-CP3fzamj.js';
|
|
44
44
|
import { d as defineCustomElement$f } from './p-CD0JDwI8.js';
|
|
45
|
-
import { d as defineCustomElement$c } from './p-
|
|
46
|
-
import { d as defineCustomElement$b } from './p-
|
|
45
|
+
import { d as defineCustomElement$c } from './p-CBI0uoLx.js';
|
|
46
|
+
import { d as defineCustomElement$b } from './p-8QydEdM3.js';
|
|
47
47
|
import { d as defineCustomElement$a } from './p-C_txMekS.js';
|
|
48
48
|
import { d as defineCustomElement$9 } from './p-FQYyAgg1.js';
|
|
49
49
|
import { d as defineCustomElement$8 } from './p-BD5pAH0V.js';
|
|
50
50
|
import { d as defineCustomElement$7 } from './p-CJfuw7NA.js';
|
|
51
|
-
import { d as defineCustomElement$6 } from './p-
|
|
51
|
+
import { d as defineCustomElement$6 } from './p-Cj2aAJh-.js';
|
|
52
52
|
import { d as defineCustomElement$5 } from './p-D6qj-aDx.js';
|
|
53
53
|
import { d as defineCustomElement$4 } from './p-lz17QseM.js';
|
|
54
54
|
import { d as defineCustomElement$3 } from './p-Cfjs0nZw.js';
|
|
@@ -16,7 +16,7 @@ import { d as defineCustomElement$y } from './p-DypoldDs.js';
|
|
|
16
16
|
import { d as defineCustomElement$x } from './p-DWKdh2yQ.js';
|
|
17
17
|
import { d as defineCustomElement$w } from './p-DSgE2Das.js';
|
|
18
18
|
import { d as defineCustomElement$v } from './p-BFW7cPvA.js';
|
|
19
|
-
import { d as defineCustomElement$u } from './p-
|
|
19
|
+
import { d as defineCustomElement$u } from './p-BIlS1HQZ.js';
|
|
20
20
|
import { d as defineCustomElement$t } from './p-B4jBpnaA.js';
|
|
21
21
|
import { d as defineCustomElement$s } from './p-BL1UfQF3.js';
|
|
22
22
|
import { d as defineCustomElement$r } from './p-PPrdK-H6.js';
|
|
@@ -40,7 +40,7 @@ import { d as defineCustomElement$8 } from './p-BD5pAH0V.js';
|
|
|
40
40
|
import { d as defineCustomElement$7 } from './p-BKHkC1rC.js';
|
|
41
41
|
import { d as defineCustomElement$6 } from './p-Dse87Vrk.js';
|
|
42
42
|
import { d as defineCustomElement$5 } from './p-CJfuw7NA.js';
|
|
43
|
-
import { d as defineCustomElement$4 } from './p-
|
|
43
|
+
import { d as defineCustomElement$4 } from './p-Cj2aAJh-.js';
|
|
44
44
|
import { d as defineCustomElement$3 } from './p-Cfjs0nZw.js';
|
|
45
45
|
import { d as defineCustomElement$2 } from './p-BxANvGc6.js';
|
|
46
46
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TimelineDebitDay, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { T as TimelineDebitDay, d as defineCustomElement$1 } from './p-CBI0uoLx.js';
|
|
2
2
|
|
|
3
3
|
const RebillTimelineDebitDay = TimelineDebitDay;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SinglePaymentMethod$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { S as SinglePaymentMethod$1, d as defineCustomElement$1 } from './p-Cj2aAJh-.js';
|
|
2
2
|
|
|
3
3
|
const SinglePaymentMethod = SinglePaymentMethod$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -4634,7 +4634,7 @@ const SinglePaymentMethod = class {
|
|
|
4634
4634
|
paymentMethodDetails;
|
|
4635
4635
|
icons = [];
|
|
4636
4636
|
render() {
|
|
4637
|
-
return (h("div", { key: '912251af4177b26d44d1395bfe775b75f327958b', class: "single-payment-method" }, h("div", { key: 'a0b5ef36fe047eeef69e20576343b7ceac3deda2', class: "payment-method" }, h("rebill-icon", { key: '
|
|
4637
|
+
return (h("div", { key: '912251af4177b26d44d1395bfe775b75f327958b', class: "single-payment-method" }, h("div", { key: 'a0b5ef36fe047eeef69e20576343b7ceac3deda2', class: "payment-method" }, this.paymentMethod === PAYMENT_METHOD_ENUM.CARD && h("rebill-icon", { key: '2b09cdf13b03dff1bfb195f8845d057c44d63c16', name: "card" }), this.paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && h("rebill-icon", { key: '5d022e76ea9d284ef024a63dc4452181ec20f34f', name: "bank" }), h("rebill-typography", { key: '2c9f59deccb7731477f6b063f92a4925f0ee41be', variant: "body2-small", color: COLORS_ENUM.NEUTRALS_700 }, I18nService.translate(`paymentMethods.${this.paymentMethod}`))), this.paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && (h("div", { key: '790ffaa2b0998dd98853c1bf159b60a0fa5e15fd', class: "icon-container" }, this.icons.length > 0 ? (this.icons.map(iconName => h("rebill-icon", { name: iconName, key: iconName }))) : (h("rebill-icon", { name: "card" }))))));
|
|
4638
4638
|
}
|
|
4639
4639
|
};
|
|
4640
4640
|
SinglePaymentMethod.style = singlePaymentMethodCss;
|
|
@@ -364,7 +364,7 @@ const TimelineDebitDay = class {
|
|
|
364
364
|
}
|
|
365
365
|
render() {
|
|
366
366
|
const events = this.buildEvents();
|
|
367
|
-
return (h("div", { key: '
|
|
367
|
+
return (h("div", { key: 'f8f359f16049d37a4a45254f65964059f8d678ca', class: "timeline-container" }, h("div", { key: '9ba1af80fb3239bb763b09bb6796abd39387d8a4', class: "timeline" }, events.map((event, index) => this.renderEvent(event, index === events.length - 1, index === 0)))));
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
TimelineDebitDay.style = timelineDebitDayCss;
|
|
@@ -532,7 +532,7 @@ const Timeline = class {
|
|
|
532
532
|
}
|
|
533
533
|
render() {
|
|
534
534
|
const events = this.buildEvents();
|
|
535
|
-
return (h("div", { key: '
|
|
535
|
+
return (h("div", { key: '86e41b40c8d44c943c7a5d28a663a91fd654bb44', class: "timeline-container" }, h("div", { key: 'a99e90355fc9d0e86900ab0d6642729aff363840', class: "timeline" }, events.map((event, index) => this.renderEvent(event, index === events.length - 1, index === 0, events.length)))));
|
|
536
536
|
}
|
|
537
537
|
};
|
|
538
538
|
Timeline.style = timelineFreeTrialCss;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,g as i,h as n}from"./p-D8cwEAmw.js";import{a as s}from"./p-CTo1s54i.js";import{s as a,a as o,I as r,g as l,f as c,e as d,d as h}from"./p-D2fx4va5.js";import{C as p}from"./p-DA598vBj.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const u=".summary-row{gap:12px}.coupon-chip{display:flex;align-items:center;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border-primary);justify-content:space-between;border-radius:6px;padding:4px 8px;gap:8px;width:fit-content}.coupon-icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;vertical-align:middle}.coupon-close{cursor:pointer}.coupon-content{display:flex;flex-direction:row;align-items:flex-start;gap:4px}";var m;(function(e){e["EDITING"]="editing";e["APPLIED"]="applied";e["NOT_APPLIED"]="not_applied"})(m||(m={}));const f=class{constructor(i){e(this,i);this.discountApplied=t(this,"discountApplied")}get el(){return i(this)}hideLabel=false;couponCode="";actionStatus=m.NOT_APPLIED;isLoading=false;isError=false;currentLocale=a.currentLocale;discountApplied;inputRef;unsubscribeCurrentLocaleStore;componentWillLoad(){this.unsubscribeCurrentLocaleStore=o.onChange("currentLocale",(()=>{this.currentLocale=a.currentLocale}));if(a.data.pricing.discountCouponCode&&a.data.pricing.discountAmount>0){this.actionStatus=m.APPLIED;this.couponCode=a.data.pricing.discountCouponCode}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}}componentDidUpdate(){if(this.actionStatus===m.EDITING&&this.inputRef){setTimeout((async()=>{const e=await this.inputRef.getInputElement();if(e){e.focus()}}),0)}}async onApplyCoupon(){const e=a.data.sessionId;if(!e){return}this.isLoading=true;try{const t=await s.discountCoupon.applyDiscountCoupon({couponCode:this.couponCode,quantity:1,sessionId:e,organizationId:a.data.organization.id});this.actionStatus=m.APPLIED;o.setDiscount({couponCode:this.couponCode,amount:t.amount,discountType:t.discountType,discountAmount:t.discountedAmount,discountedPercentage:t?.discountedPercentage||0,discountDuration:t?.discountDuration||null});this.discountApplied.emit(true)}catch(e){this.actionStatus=m.EDITING;this.discountApplied.emit(false);this.isError=true;o.setDiscount(null)}finally{this.isLoading=false}}onCancelCoupon(){this.actionStatus=m.NOT_APPLIED;this.couponCode="";this.isError=false}render(){return n("div",{key:"ef9910d94bd7936af48070c05434eec5f5e31f33"},n("div",{key:"605a758c1d2e5e2ef8f2f04906f204c3bd193b59",class:"summary-row",style:{alignItems:this.actionStatus===m.EDITING?"flex-start":"center",display:"flex"}},!this.hideLabel&&n("rebill-typography",{key:"fd55d1bc2b4914c994c7b3b34a2cc735d5d58796",variant:"body2",style:{marginTop:this.actionStatus===m.EDITING?"7px":"0px"}},r.translate("discountCoupons.discount")),this.actionStatus===m.NOT_APPLIED&&n("rebill-button",{key:"284ef7431bf622fd4a436605346a2379a0131887",variant:"filled",size:"small",theme:"primary-dark",onClick:()=>this.actionStatus=m.EDITING},r.translate("discountCoupons.addDiscount")),this.actionStatus===m.EDITING&&n("div",{key:"82dafe4da59827c75402e4337a9017df4cd37aa6",class:"summary-row",style:{alignItems:"flex-start",display:"flex"}},n("rebill-input-text",{key:"f24f9bbf2eb91a616284a4e48b1e4cb8c96ce064",ref:e=>this.inputRef=e,id:"discountCoupon",value:this.couponCode,placeholder:r.translate("discountCoupons.addDiscount"),disabled:this.isLoading,error:this.isError?r.translate("discountCoupons.error"):"",clearable:true,uppercase:true,onInput:e=>{e.stopPropagation();if(e.detail&&e.detail.value!==undefined){this.couponCode=e.detail.value}},onBlur:()=>{if(!this.couponCode.trim()){this.onCancelCoupon()}}}),n("rebill-button",{key:"2f4c3b2b5e3e53053ff074421e24a3cd7cc27ec0",variant:"filled",theme:"primary-dark",size:"small",loading:this.isLoading,disabled:this.isLoading||!this.couponCode.trim(),onClick:()=>this.onApplyCoupon(),style:{marginTop:this.actionStatus===m.EDITING?"3px":"0px"}},r.translate("discountCoupons.apply"))),this.actionStatus===m.APPLIED&&n("div",{key:"74f807951759f260010306d117513b27d204aafb",class:"coupon-chip"},n("rebill-icon",{key:"1c5c5f8943fa84918b5e71da393dba111fde0bf3",name:"tag-sale",size:"16px"}),n("div",{key:"1137b8cd931d694599d485a3d1049264f1a6757e",class:"coupon-content",onClick:()=>this.actionStatus=m.EDITING},n("rebill-typography",{key:"5c8187a6f051241f6a9a02f7f72bae86401d25c3",variant:"overline",color:p.PRIMARY_DARK_TEXT},a.data.pricing.discountCouponCode),n("rebill-typography",{key:"9e85a922b58899a09965f95d6231fecfc7ef4b7e",variant:"overline",color:p.GREEN},"-$",l(a.data.pricing.discountAmount,a.data.pricing.currency))),n("div",{key:"8ed4f8ff3f33becd8e400be08bca722505913e92",class:"coupon-close",onClick:()=>{this.actionStatus=m.NOT_APPLIED;this.couponCode="";o.setDiscount(null);this.discountApplied.emit(false)}},n("rebill-icon",{key:"ed796f5626be2615e6d1f9d9fe9b6815a63442a7",name:"x",size:"20px",color:p.PRIMARY_DARK_TEXT})))))}};f.style=u;var y;(function(e){e["CHARGE_FULL"]="charge_full";e["CHARGE_NEXT_CYCLE"]="charge_next_cycle";e["CHARGE_PRORATED"]="charge_prorated"})(y||(y={}));const g=".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 b=class{constructor(t){e(this,t)}currentLanguage;debitDay;totalAmount;planAmount;currency;debitStrategy;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get totalAmountFormatted(){return c(this.totalAmount,this.currency,false)}get planAmountFormatted(){return c(this.planAmount,this.currency,false)}getDurationTranslation(e){return e===1?d.t("summary.month_one"):d.t("summary.month_other",{count:e})}get hasDiscountApplied(){return this.discountApplied&&(this.discountedPercentage>0||this.discountAmount>0)}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const e=a.data.discount.couponCode||a.data.pricing.discountCouponCode;const t=this.discountType===h.PERCENTAGE?`${this.discountedPercentage}%`:c(this.discountAmount,this.currency);if(this.discountDuration){return d.t(`summary.planDiscountDescriptionWithDuration`,{discount:e?`${e} – ${t}`:t,duration:this.getDurationTranslation(this.discountDuration)})}else{return d.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:e?`${e} – ${t}`:t})}}calculateDelayedChargeDate(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getDateForDay(this.debitDay)}const e=new Date;const t=new Date(e);t.setMonth(e.getMonth()+this.discountDuration);t.setDate(this.debitDay);return t.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}componentWillLoad(){this.currentLanguage=this.language||d.language;d.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){d.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||d.language};getDateForDay(e){const t=new Date;const i=new Date(t);if(e===1){return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}else{const e=t.getMonth();if(this.debitDay<t.getDate()){i.setMonth(e+1)}i.setDate(this.debitDay);return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}getNextMonthName(){const e=new Date;const t=new Date(e);t.setMonth(e.getMonth()+1);return t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDebitDay(){const e=new Date;const t=new Date(e);if(this.debitDay<e.getDate()){t.setMonth(e.getMonth()+1)}return t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDelayedCharge(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getNextMonthName()}const e=new Date;const t=new Date(e);t.setMonth(e.getMonth()+this.discountDuration);return t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}buildEvents(){const e=[];const t=this.getNextMonthName();const i=this.calculateDelayedChargeDate();const n=this.hasDiscountApplied?this.getDiscountDescription():undefined;switch(this.debitStrategy){case y.CHARGE_FULL:e.push({day:1,type:"today",date:this.getDateForDay(1),title:d.t("timeline.today"),description:d.t("timeline.chargeFullToday",{amount:`$${this.totalAmountFormatted}`}),icon:"circle-calendar",discountInfo:n});e.push({day:this.debitDay,type:"recurring",date:this.hasDiscountApplied?i:"",title:d.t("timeline.after"),description:d.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():t}),icon:"circle-receipt-active"});break;case y.CHARGE_NEXT_CYCLE:e.push({day:1,type:"today",date:this.getDateForDay(1),title:d.t("timeline.today"),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:n});e.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:d.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});e.push({day:this.debitDay+1,type:"recurring",date:"",title:d.t("timeline.after"),description:d.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():t}),icon:"clock-and-calendar"});break;case y.CHARGE_PRORATED:e.push({day:1,type:"today",date:this.getDateForDay(1),title:d.t("timeline.today"),description:d.t("timeline.proratedCharge",{amount:`$${this.totalAmountFormatted}`,day:this.debitDay,month:this.getMonthNameForDebitDay()}),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:n});e.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:d.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});e.push({day:this.debitDay+1,type:"recurring",date:"",title:d.t("timeline.after"),description:d.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():t}),icon:"clock-and-calendar"});break}return e}renderEvent(e,t,i){const s=this.buildEvents();const a=s.length;return n("div",{key:e.day,class:"timeline-event"},n("div",{class:"timeline-icon-container"},n("rebill-icon",{name:e.icon,style:{marginTop:"3px"}}),n("div",{class:"timeline-connector-container"},!t&&(i?a===2?n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-icon",height:e.discountInfo?"65px":"45px"}):n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-icon",height:e.discountInfo?"65px":"45px",withDot:true}):n("rebill-vertical-divider",{color:p.TIMELINE_CONNECTOR,class:"timeline-connector-icon",height:e.discountInfo?"65px":"45px"})))),n("div",{class:"event-content"},n("rebill-typography",{variant:"subtitle-bold"},e.title),n("div",{class:"event-date"},n("rebill-typography",{variant:"body2"},e.amount?n("span",null,e.date," ",n("rebill-icon",{name:"arrow-right"})," ",e.amount," ",e.description):e.date?`${e.date} - ${e.description}`:e.description)),e.discountInfo&&n("div",{class:"discount-info"},n("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:p.GREEN,alertTitle:e.discountInfo}))))}render(){const e=this.buildEvents();return n("div",{key:"fad875b4d2a557fd21a3daa14e3dfa9ab2f77db5",class:"timeline-container"},n("div",{key:"07b5c932379fb498b623d64044b6739371634f8b",class:"timeline"},e.map(((t,i)=>this.renderEvent(t,i===e.length-1,i===0)))))}};b.style=g;const x=".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 v=class{constructor(t){e(this,t)}currentLanguage;trialPeriodEndsAt;trialPeriodEndsReminderAt;trialPeriodDays;subtotal;currency;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get amount(){return c(this.subtotal,this.currency,false)}getDurationTranslation(e){return e===1?d.t("summary.month_one"):d.t("summary.month_other",{count:e})}get hasDiscountApplied(){const e=Boolean(a.data.discount?.couponCode||a.data.pricing?.discountCouponCode||a.data.discount?.discountType||this.discountType&&(this.discountedPercentage>0||this.discountAmount>0));return e}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const e=a.data.discount.couponCode||a.data.pricing.discountCouponCode;const t=this.discountType===h.PERCENTAGE?`${this.discountedPercentage}%`:c(this.discountAmount,this.currency);if(this.discountDuration){return d.t(`summary.planDiscountDescriptionWithDuration`,{discount:e?`${e} – ${t}`:t,duration:this.getDurationTranslation(this.discountDuration)})}else{return d.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:e?`${e} – ${t}`:t})}}calculateRenewalDate(){if(!this.discountDuration||!this.trialPeriodEndsAt){return this.trialPeriodEndsAt}const e=new Date(this.trialPeriodEndsAt);const t=new Date(e);t.setMonth(t.getMonth()+this.discountDuration);return t.toISOString()}componentWillLoad(){this.currentLanguage=this.language||r.getCurrentLanguage();d.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){d.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||r.getCurrentLanguage()};getDateForDay(e){if(typeof e==="string"){const t=new Date(e);return t.getDate().toString()+" de "+t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}else{const t=new Date;const i=new Date(t);const n=e||1;i.setDate(t.getDate()+(n-1));return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}buildEvents(){const e=[];e.push({day:1,type:"start",date:this.getDateForDay(null),title:d.t("timeline.dayOne"),description:d.t("timeline.startTrial",{count:this.trialPeriodDays,trialDays:this.trialPeriodDays}),icon:"circle-calendar"});const t=this.trialPeriodDays===1?2:this.trialPeriodDays;const i=this.hasDiscountApplied&&this.subtotal===0?"$0":`$${this.amount}`;const n={day:t,type:"last",date:this.getDateForDay(this.trialPeriodEndsAt),title:d.t("timeline.lastDay",{day:t}),description:d.t("timeline.subscriptionStart",{amount:i}),icon:"circle-receipt",discountInfo:this.hasDiscountApplied?this.getDiscountDescription():undefined};if(this.trialPeriodEndsReminderAt){if(this.trialPeriodDays===3){e.push({day:2,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:d.t("timeline.reminder",{day:2}),description:d.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}else if(this.trialPeriodDays>3){e.push({day:this.trialPeriodDays,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:d.t("timeline.reminder",{day:this.trialPeriodDays-2}),description:d.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}}e.push(n);if(this.hasDiscountApplied&&this.discountDuration!==null){const i=a.data.pricing.planAmount;const n=this.calculateRenewalDate();e.push({day:t+1,type:"renewal",date:this.getDateForDay(n),title:d.t("timeline.subscriptionRenewal"),description:d.t("timeline.renewalAmount",{amount:`$${c(i,this.currency,false)}`}),icon:"renewal",amount:`$${c(i,this.currency,false)}`})}return e}renderEvent(e,t,i,s){return n("div",{key:e.day,class:"timeline-event"},n("div",{class:"timeline-icon-container"},n("rebill-icon",{name:e.icon,style:{marginTop:"3px"}}),n("div",{class:"timeline-connector-container"},!t&&(i?s===2?n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-divider",height:e.discountInfo?"65px":"45px"}):n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-divider",height:e.discountInfo?"65px":"45px",withDot:true}):n("rebill-vertical-divider",{color:p.TIMELINE_CONNECTOR,class:"timeline-connector-divider",height:e.discountInfo?"65px":"45px"})))),n("div",{class:"event-content"},n("rebill-typography",{variant:"subtitle-bold"},e.title),n("div",{class:"event-date"},n("rebill-typography",{variant:"body2"},`${e.date} - ${e.description}`)),e.discountInfo&&n("div",{class:"discount-info"},n("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:p.GREEN,alertTitle:e.discountInfo}))))}render(){const e=this.buildEvents();return n("div",{key:"c9e7d50a46d5753802ac9bc0f6235cdd49b36b7a",class:"timeline-container"},n("div",{key:"a53ce13b2f7488a623c084696d878a55ca6993b7",class:"timeline"},e.map(((t,i)=>this.renderEvent(t,i===e.length-1,i===0,e.length)))))}};v.style=x;export{f as discount_coupon,b as rebill_timeline_debit_day,v as rebill_timeline_free_trial};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,g as i,h as n}from"./p-D8cwEAmw.js";import{a as s}from"./p-CTo1s54i.js";import{s as a,a as o,I as r,g as l,f as c,e as d,d as h}from"./p-D2fx4va5.js";import{C as p}from"./p-DA598vBj.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const u=".summary-row{gap:12px}.coupon-chip{display:flex;align-items:center;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border-primary);justify-content:space-between;border-radius:6px;padding:4px 8px;gap:8px;width:fit-content}.coupon-icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;vertical-align:middle}.coupon-close{cursor:pointer}.coupon-content{display:flex;flex-direction:row;align-items:flex-start;gap:4px}";var m;(function(e){e["EDITING"]="editing";e["APPLIED"]="applied";e["NOT_APPLIED"]="not_applied"})(m||(m={}));const f=class{constructor(i){e(this,i);this.discountApplied=t(this,"discountApplied")}get el(){return i(this)}hideLabel=false;couponCode="";actionStatus=m.NOT_APPLIED;isLoading=false;isError=false;currentLocale=a.currentLocale;discountApplied;inputRef;unsubscribeCurrentLocaleStore;componentWillLoad(){this.unsubscribeCurrentLocaleStore=o.onChange("currentLocale",(()=>{this.currentLocale=a.currentLocale}));if(a.data.pricing.discountCouponCode&&a.data.pricing.discountAmount>0){this.actionStatus=m.APPLIED;this.couponCode=a.data.pricing.discountCouponCode}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}}componentDidUpdate(){if(this.actionStatus===m.EDITING&&this.inputRef){setTimeout((async()=>{const e=await this.inputRef.getInputElement();if(e){e.focus()}}),0)}}async onApplyCoupon(){const e=a.data.sessionId;if(!e){return}this.isLoading=true;try{const t=await s.discountCoupon.applyDiscountCoupon({couponCode:this.couponCode,quantity:1,sessionId:e,organizationId:a.data.organization.id});this.actionStatus=m.APPLIED;o.setDiscount({couponCode:this.couponCode,amount:t.amount,discountType:t.discountType,discountAmount:t.discountedAmount,discountedPercentage:t?.discountedPercentage||0,discountDuration:t?.discountDuration||null});this.discountApplied.emit(true)}catch(e){this.actionStatus=m.EDITING;this.discountApplied.emit(false);this.isError=true;o.setDiscount(null)}finally{this.isLoading=false}}onCancelCoupon(){this.actionStatus=m.NOT_APPLIED;this.couponCode="";this.isError=false}render(){return n("div",{key:"ef9910d94bd7936af48070c05434eec5f5e31f33"},n("div",{key:"605a758c1d2e5e2ef8f2f04906f204c3bd193b59",class:"summary-row",style:{alignItems:this.actionStatus===m.EDITING?"flex-start":"center",display:"flex"}},!this.hideLabel&&n("rebill-typography",{key:"fd55d1bc2b4914c994c7b3b34a2cc735d5d58796",variant:"body2",style:{marginTop:this.actionStatus===m.EDITING?"7px":"0px"}},r.translate("discountCoupons.discount")),this.actionStatus===m.NOT_APPLIED&&n("rebill-button",{key:"284ef7431bf622fd4a436605346a2379a0131887",variant:"filled",size:"small",theme:"primary-dark",onClick:()=>this.actionStatus=m.EDITING},r.translate("discountCoupons.addDiscount")),this.actionStatus===m.EDITING&&n("div",{key:"82dafe4da59827c75402e4337a9017df4cd37aa6",class:"summary-row",style:{alignItems:"flex-start",display:"flex"}},n("rebill-input-text",{key:"f24f9bbf2eb91a616284a4e48b1e4cb8c96ce064",ref:e=>this.inputRef=e,id:"discountCoupon",value:this.couponCode,placeholder:r.translate("discountCoupons.addDiscount"),disabled:this.isLoading,error:this.isError?r.translate("discountCoupons.error"):"",clearable:true,uppercase:true,onInput:e=>{e.stopPropagation();if(e.detail&&e.detail.value!==undefined){this.couponCode=e.detail.value}},onBlur:()=>{if(!this.couponCode.trim()){this.onCancelCoupon()}}}),n("rebill-button",{key:"2f4c3b2b5e3e53053ff074421e24a3cd7cc27ec0",variant:"filled",theme:"primary-dark",size:"small",loading:this.isLoading,disabled:this.isLoading||!this.couponCode.trim(),onClick:()=>this.onApplyCoupon(),style:{marginTop:this.actionStatus===m.EDITING?"3px":"0px"}},r.translate("discountCoupons.apply"))),this.actionStatus===m.APPLIED&&n("div",{key:"74f807951759f260010306d117513b27d204aafb",class:"coupon-chip"},n("rebill-icon",{key:"1c5c5f8943fa84918b5e71da393dba111fde0bf3",name:"tag-sale",size:"16px"}),n("div",{key:"1137b8cd931d694599d485a3d1049264f1a6757e",class:"coupon-content",onClick:()=>this.actionStatus=m.EDITING},n("rebill-typography",{key:"5c8187a6f051241f6a9a02f7f72bae86401d25c3",variant:"overline",color:p.PRIMARY_DARK_TEXT},a.data.pricing.discountCouponCode),n("rebill-typography",{key:"9e85a922b58899a09965f95d6231fecfc7ef4b7e",variant:"overline",color:p.GREEN},"-$",l(a.data.pricing.discountAmount,a.data.pricing.currency))),n("div",{key:"8ed4f8ff3f33becd8e400be08bca722505913e92",class:"coupon-close",onClick:()=>{this.actionStatus=m.NOT_APPLIED;this.couponCode="";o.setDiscount(null);this.discountApplied.emit(false)}},n("rebill-icon",{key:"ed796f5626be2615e6d1f9d9fe9b6815a63442a7",name:"x",size:"20px",color:p.PRIMARY_DARK_TEXT})))))}};f.style=u;var y;(function(e){e["CHARGE_FULL"]="charge_full";e["CHARGE_NEXT_CYCLE"]="charge_next_cycle";e["CHARGE_PRORATED"]="charge_prorated"})(y||(y={}));const g=".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 b=class{constructor(t){e(this,t)}currentLanguage;debitDay;totalAmount;planAmount;currency;debitStrategy;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get totalAmountFormatted(){return c(this.totalAmount,this.currency,false)}get planAmountFormatted(){return c(this.planAmount,this.currency,false)}getDurationTranslation(e){return e===1?d.t("summary.month_one"):d.t("summary.month_other",{count:e})}get hasDiscountApplied(){return this.discountApplied&&(this.discountedPercentage>0||this.discountAmount>0)}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const e=a.data.discount.couponCode||a.data.pricing.discountCouponCode;const t=this.discountType===h.PERCENTAGE?`${this.discountedPercentage}%`:c(this.discountAmount,this.currency);if(this.discountDuration){return d.t(`summary.planDiscountDescriptionWithDuration`,{discount:e?`${e} – ${t}`:t,duration:this.getDurationTranslation(this.discountDuration)})}else{return d.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:e?`${e} – ${t}`:t})}}calculateDelayedChargeDate(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getDateForDay(this.debitDay)}const e=new Date;const t=new Date(e);t.setMonth(e.getMonth()+this.discountDuration);t.setDate(this.debitDay);return t.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}componentWillLoad(){this.currentLanguage=this.language||d.language;d.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){d.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||d.language};getDateForDay(e){const t=new Date;const i=new Date(t);if(e===1){return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}else{const e=t.getMonth();if(this.debitDay<t.getDate()){i.setMonth(e+1)}i.setDate(this.debitDay);return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}getNextMonthName(){const e=new Date;const t=new Date(e);t.setMonth(e.getMonth()+1);return t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDebitDay(){const e=new Date;const t=new Date(e);if(this.debitDay<e.getDate()){t.setMonth(e.getMonth()+1)}return t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}getMonthNameForDelayedCharge(){if(!this.hasDiscountApplied||!this.discountDuration){return this.getNextMonthName()}const e=new Date;const t=new Date(e);t.setMonth(e.getMonth()+this.discountDuration);return t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}buildEvents(){const e=[];const t=this.getNextMonthName();const i=this.calculateDelayedChargeDate();const n=this.hasDiscountApplied?this.getDiscountDescription():undefined;switch(this.debitStrategy){case y.CHARGE_FULL:e.push({day:1,type:"today",date:this.getDateForDay(1),title:d.t("timeline.today"),description:d.t("timeline.chargeFullToday",{amount:`$${this.totalAmountFormatted}`}),icon:"circle-calendar",discountInfo:n});e.push({day:this.debitDay,type:"recurring",date:this.hasDiscountApplied?i:"",title:d.t("timeline.after"),description:d.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():t}),icon:"circle-receipt-active"});break;case y.CHARGE_NEXT_CYCLE:e.push({day:1,type:"today",date:this.getDateForDay(1),title:d.t("timeline.today"),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:n});e.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:d.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});e.push({day:this.debitDay+1,type:"recurring",date:"",title:d.t("timeline.after"),description:d.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():t}),icon:"clock-and-calendar"});break;case y.CHARGE_PRORATED:e.push({day:1,type:"today",date:this.getDateForDay(1),title:d.t("timeline.today"),description:d.t("timeline.proratedCharge",{amount:`$${this.totalAmountFormatted}`,day:this.debitDay,month:this.getMonthNameForDebitDay()}),icon:"circle-calendar",amount:`$${this.totalAmountFormatted}`,discountInfo:n});e.push({day:this.debitDay,type:"first_charge",date:this.hasDiscountApplied?i:this.getDateForDay(this.debitDay),title:d.t("timeline.firstCharge"),description:"",icon:"circle-receipt",amount:`$${this.planAmountFormatted}`});e.push({day:this.debitDay+1,type:"recurring",date:"",title:d.t("timeline.after"),description:d.t("timeline.recurringCharge",{day:this.debitDay,amount:`$${this.planAmountFormatted}`,month:this.hasDiscountApplied?this.getMonthNameForDelayedCharge():t}),icon:"clock-and-calendar"});break}return e}renderEvent(e,t,i){const s=this.buildEvents();const a=s.length;return n("div",{key:e.day,class:"timeline-event"},n("div",{class:"timeline-icon-container"},n("rebill-icon",{name:e.icon,style:{marginTop:"3px"}}),n("div",{class:"timeline-connector-container"},!t&&(i?a===2?n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-icon",height:e.discountInfo?"65px":"45px"}):n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-icon",height:e.discountInfo?"65px":"45px",withDot:true}):n("rebill-vertical-divider",{color:p.TIMELINE_CONNECTOR,class:"timeline-connector-icon",height:e.discountInfo?"65px":"45px"})))),n("div",{class:"event-content"},n("rebill-typography",{variant:"subtitle-bold"},e.title),n("div",{class:"event-date"},n("rebill-typography",{variant:"body2"},e.amount?n("span",null,e.date," ",n("rebill-icon",{name:"arrow-right"})," ",e.amount," ",e.description):e.date?`${e.date} - ${e.description}`:e.description)),e.discountInfo&&n("div",{class:"discount-info"},n("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:p.GREEN,alertTitle:e.discountInfo}))))}render(){const e=this.buildEvents();return n("div",{key:"f8f359f16049d37a4a45254f65964059f8d678ca",class:"timeline-container"},n("div",{key:"9ba1af80fb3239bb763b09bb6796abd39387d8a4",class:"timeline"},e.map(((t,i)=>this.renderEvent(t,i===e.length-1,i===0)))))}};b.style=g;const x=".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 v=class{constructor(t){e(this,t)}currentLanguage;trialPeriodEndsAt;trialPeriodEndsReminderAt;trialPeriodDays;subtotal;currency;language;discountApplied=false;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;get amount(){return c(this.subtotal,this.currency,false)}getDurationTranslation(e){return e===1?d.t("summary.month_one"):d.t("summary.month_other",{count:e})}get hasDiscountApplied(){const e=Boolean(a.data.discount?.couponCode||a.data.pricing?.discountCouponCode||a.data.discount?.discountType||this.discountType&&(this.discountedPercentage>0||this.discountAmount>0));return e}getDiscountDescription(){if(!this.hasDiscountApplied)return"";const e=a.data.discount.couponCode||a.data.pricing.discountCouponCode;const t=this.discountType===h.PERCENTAGE?`${this.discountedPercentage}%`:c(this.discountAmount,this.currency);if(this.discountDuration){return d.t(`summary.planDiscountDescriptionWithDuration`,{discount:e?`${e} – ${t}`:t,duration:this.getDurationTranslation(this.discountDuration)})}else{return d.t(`summary.planDiscountDescriptionWithoutDuration`,{discount:e?`${e} – ${t}`:t})}}calculateRenewalDate(){if(!this.discountDuration||!this.trialPeriodEndsAt){return this.trialPeriodEndsAt}const e=new Date(this.trialPeriodEndsAt);const t=new Date(e);t.setMonth(t.getMonth()+this.discountDuration);return t.toISOString()}componentWillLoad(){this.currentLanguage=this.language||r.getCurrentLanguage();d.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){d.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=this.language||r.getCurrentLanguage()};getDateForDay(e){if(typeof e==="string"){const t=new Date(e);return t.getDate().toString()+" de "+t.toLocaleDateString(this.currentLanguage,{month:"long",timeZone:"UTC"})}else{const t=new Date;const i=new Date(t);const n=e||1;i.setDate(t.getDate()+(n-1));return i.toLocaleDateString(this.currentLanguage,{day:"numeric",month:"long",timeZone:"UTC"})}}buildEvents(){const e=[];e.push({day:1,type:"start",date:this.getDateForDay(null),title:d.t("timeline.dayOne"),description:d.t("timeline.startTrial",{count:this.trialPeriodDays,trialDays:this.trialPeriodDays}),icon:"circle-calendar"});const t=this.trialPeriodDays===1?2:this.trialPeriodDays;const i=this.hasDiscountApplied&&this.subtotal===0?"$0":`$${this.amount}`;const n={day:t,type:"last",date:this.getDateForDay(this.trialPeriodEndsAt),title:d.t("timeline.lastDay",{day:t}),description:d.t("timeline.subscriptionStart",{amount:i}),icon:"circle-receipt",discountInfo:this.hasDiscountApplied?this.getDiscountDescription():undefined};if(this.trialPeriodEndsReminderAt){if(this.trialPeriodDays===3){e.push({day:2,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:d.t("timeline.reminder",{day:2}),description:d.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}else if(this.trialPeriodDays>3){e.push({day:this.trialPeriodDays,type:"reminder",date:this.getDateForDay(this.trialPeriodEndsReminderAt),title:d.t("timeline.reminder",{day:this.trialPeriodDays-2}),description:d.t("timeline.lastDaysReminder",{days:2}),icon:"bell"})}}e.push(n);if(this.hasDiscountApplied&&this.discountDuration!==null){const i=a.data.pricing.planAmount;const n=this.calculateRenewalDate();e.push({day:t+1,type:"renewal",date:this.getDateForDay(n),title:d.t("timeline.subscriptionRenewal"),description:d.t("timeline.renewalAmount",{amount:`$${c(i,this.currency,false)}`}),icon:"renewal",amount:`$${c(i,this.currency,false)}`})}return e}renderEvent(e,t,i,s){return n("div",{key:e.day,class:"timeline-event"},n("div",{class:"timeline-icon-container"},n("rebill-icon",{name:e.icon,style:{marginTop:"3px"}}),n("div",{class:"timeline-connector-container"},!t&&(i?s===2?n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-divider",height:e.discountInfo?"65px":"45px"}):n("rebill-vertical-divider",{connectorActive:true,color:p.INFO_BORDER,class:"timeline-connector-divider",height:e.discountInfo?"65px":"45px",withDot:true}):n("rebill-vertical-divider",{color:p.TIMELINE_CONNECTOR,class:"timeline-connector-divider",height:e.discountInfo?"65px":"45px"})))),n("div",{class:"event-content"},n("rebill-typography",{variant:"subtitle-bold"},e.title),n("div",{class:"event-date"},n("rebill-typography",{variant:"body2"},`${e.date} - ${e.description}`)),e.discountInfo&&n("div",{class:"discount-info"},n("rebill-alert",{variant:"filled",type:"coupon",icon:"tag-green",size:"small",colorIcon:p.GREEN,alertTitle:e.discountInfo}))))}render(){const e=this.buildEvents();return n("div",{key:"86e41b40c8d44c943c7a5d28a663a91fd654bb44",class:"timeline-container"},n("div",{key:"a99e90355fc9d0e86900ab0d6642729aff363840",class:"timeline"},e.map(((t,i)=>this.renderEvent(t,i===e.length-1,i===0,e.length)))))}};v.style=x;export{f as discount_coupon,b as rebill_timeline_debit_day,v as rebill_timeline_free_trial};
|
|
2
|
+
//# sourceMappingURL=p-4af8501b.entry.js.map
|