@kompasid/lit-web-components 0.8.6 → 0.8.8
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/demo/index.html +13 -14
- package/dist/src/components/kompasid-grace-period/KompasGracePeriod.d.ts +1 -0
- package/dist/src/components/kompasid-grace-period/KompasGracePeriod.js +20 -6
- package/dist/src/components/kompasid-grace-period/KompasGracePeriod.js.map +1 -1
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js +2 -1
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js.map +1 -1
- package/dist/src/components/kompasid-widget-recirculations-default/KompasWidgetRecirculationsDefault.d.ts +0 -4
- package/dist/src/components/kompasid-widget-recirculations-default/KompasWidgetRecirculationsDefault.js +13 -12
- package/dist/src/components/kompasid-widget-recirculations-default/KompasWidgetRecirculationsDefault.js.map +1 -1
- package/dist/src/components/kompasid-widget-recirculations-list/KompasWidgetRecirculationsList.d.ts +1 -1
- package/dist/src/components/kompasid-widget-recirculations-list/KompasWidgetRecirculationsList.js +15 -10
- package/dist/src/components/kompasid-widget-recirculations-list/KompasWidgetRecirculationsList.js.map +1 -1
- package/dist/src/utils/useTimeDIfference.d.ts +1 -0
- package/dist/src/utils/useTimeDIfference.js +27 -0
- package/dist/src/utils/useTimeDIfference.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/kompasid-grace-period/KompasGracePeriod.ts +24 -6
- package/src/components/kompasid-paywall-body/KompasPaywallBody.ts +2 -1
- package/src/components/kompasid-widget-recirculations-default/KompasWidgetRecirculationsDefault.ts +13 -12
- package/src/components/kompasid-widget-recirculations-list/KompasWidgetRecirculationsList.ts +19 -15
- package/src/utils/useTimeDIfference.ts +37 -0
package/demo/index.html
CHANGED
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
const widgetOtherPost = {
|
|
125
|
-
titleName: 'Lainnya Dalam
|
|
126
|
-
titleLink: '/kategori/
|
|
125
|
+
titleName: 'Lainnya Dalam ekonomi',
|
|
126
|
+
titleLink: '/kategori/ekonomi',
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
render(
|
|
@@ -165,23 +165,22 @@
|
|
|
165
165
|
></kompasid-header-account>
|
|
166
166
|
</div>
|
|
167
167
|
</header>
|
|
168
|
-
|
|
169
|
-
<kompasid-widget-recirculations-default
|
|
170
|
-
.permalinkArticle=${widgetRelatedPost.permalinkArticle}
|
|
171
|
-
.slugs=${widgetRelatedPost.slugs}
|
|
172
|
-
></kompasid-widget-recirculations-default>
|
|
173
|
-
|
|
174
168
|
<kompasid-widget-recirculations-list
|
|
175
169
|
widgetTitle="Terpopuler"
|
|
176
170
|
apiSlug="popular-article"
|
|
177
171
|
>
|
|
178
172
|
</kompasid-widget-recirculations-list>
|
|
179
173
|
|
|
174
|
+
<kompasid-widget-recirculations-default
|
|
175
|
+
.permalinkArticle=${widgetRelatedPost.permalinkArticle}
|
|
176
|
+
.slugs=${widgetRelatedPost.slugs}
|
|
177
|
+
></kompasid-widget-recirculations-default>
|
|
178
|
+
|
|
180
179
|
<kompasid-widget-recirculations-default
|
|
181
180
|
.titleName=${widgetOtherPost.titleName}
|
|
182
181
|
.titleLink=${widgetOtherPost.titleLink}
|
|
183
182
|
type="otherArticle"
|
|
184
|
-
mainCategory="
|
|
183
|
+
mainCategory="ekonomi"
|
|
185
184
|
></kompasid-widget-recirculations-default>
|
|
186
185
|
|
|
187
186
|
<kompasid-paywall
|
|
@@ -259,7 +258,7 @@
|
|
|
259
258
|
.tracker_metered_wall_balance=${trackerMeteredWallBalance}
|
|
260
259
|
>
|
|
261
260
|
</kompasid-freewall>
|
|
262
|
-
<kompasid-metered-wall-register
|
|
261
|
+
<!-- <kompasid-metered-wall-register
|
|
263
262
|
.id=${'metered-wall-register'}
|
|
264
263
|
.countdownArticle=${countdownArticle}
|
|
265
264
|
.tracker_page_title=${trackerPageTitle}
|
|
@@ -278,10 +277,10 @@
|
|
|
278
277
|
.tracker_metered_wall_balance=${trackerMeteredWallBalance}
|
|
279
278
|
.tracker_page_domain=${trackerPageDomain}
|
|
280
279
|
source="kompasid"
|
|
281
|
-
></kompasid-metered-wall-register>
|
|
280
|
+
></kompasid-metered-wall-register> -->
|
|
282
281
|
|
|
283
|
-
|
|
284
|
-
totalGracePeriod="
|
|
282
|
+
<kompasid-grace-period
|
|
283
|
+
totalGracePeriod="1"
|
|
285
284
|
isShowButton="true"
|
|
286
285
|
.paywall_location=${paywallLocation}
|
|
287
286
|
.paywall_subscription_id=${productId}
|
|
@@ -298,7 +297,7 @@
|
|
|
298
297
|
.tracker_metered_wall_type=${meteredWallType}
|
|
299
298
|
.tracker_subscription_status=${trackerSubscriptionStatus}
|
|
300
299
|
.tracker_metered_wall_balance=${trackerMeteredWallBalance}
|
|
301
|
-
></kompasid-grace-period>
|
|
300
|
+
></kompasid-grace-period>
|
|
302
301
|
`,
|
|
303
302
|
document.querySelector('#demo')
|
|
304
303
|
)
|
|
@@ -54,6 +54,7 @@ export declare class KompasGracePeriod extends LitElement {
|
|
|
54
54
|
private subscriptionPage;
|
|
55
55
|
private checkoutPage;
|
|
56
56
|
private getCountdownGracePeriod;
|
|
57
|
+
private redirectToKnowledgeBase;
|
|
57
58
|
private redirectToBerlangganan;
|
|
58
59
|
private redirectToCheckout;
|
|
59
60
|
private getGtmParams;
|
|
@@ -65,22 +65,36 @@ let KompasGracePeriod = class KompasGracePeriod extends LitElement {
|
|
|
65
65
|
if (totalGracePeriod === 7) {
|
|
66
66
|
return html `
|
|
67
67
|
<p>
|
|
68
|
-
Anda dalam
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
Anda dalam
|
|
69
|
+
<a
|
|
70
|
+
href="#"
|
|
71
|
+
class="text-orange-500 underline font-bold cursor-pointer"
|
|
72
|
+
@click=${this.redirectToKnowledgeBase}
|
|
73
|
+
>
|
|
74
|
+
hari terakhir
|
|
75
|
+
</a>
|
|
76
|
+
masa tenggang langganan. Segera perbarui paket langganan untuk tetap
|
|
77
|
+
mengakses konten premium tanpa batas.
|
|
71
78
|
</p>
|
|
72
79
|
`;
|
|
73
80
|
}
|
|
74
81
|
return html `
|
|
75
82
|
<p>
|
|
76
83
|
Masa tenggang langganan Anda tersisa
|
|
77
|
-
<
|
|
78
|
-
|
|
84
|
+
<a
|
|
85
|
+
href="#"
|
|
86
|
+
class="text-orange-500 underline font-bold cursor-pointer"
|
|
87
|
+
@click=${this.redirectToKnowledgeBase}
|
|
88
|
+
>
|
|
89
|
+
${maxGracePeriod - totalGracePeriod + 1} hari lagi </a
|
|
79
90
|
>. Segera perbarui paket langganan untuk tetap mengakses konten premium
|
|
80
91
|
tanpa batas.
|
|
81
92
|
</p>
|
|
82
93
|
`;
|
|
83
94
|
}
|
|
95
|
+
redirectToKnowledgeBase() {
|
|
96
|
+
window.open('https://kb.kompas.id/baca/berlangganan-kompas-id/masa-tenggang-atau-grace-period-langganan/', '_blank');
|
|
97
|
+
}
|
|
84
98
|
redirectToBerlangganan() {
|
|
85
99
|
this.dataLayeronPerbaruiLanggananButton();
|
|
86
100
|
this.sendGtmEvent('subscribe_button_clicked', true);
|
|
@@ -214,7 +228,7 @@ let KompasGracePeriod = class KompasGracePeriod extends LitElement {
|
|
|
214
228
|
render() {
|
|
215
229
|
const bgClass = !this.isBackgroundOnContentOnly ? 'bg-orange-100' : '';
|
|
216
230
|
return html `
|
|
217
|
-
<div class="sticky bottom-0 h-full w-full ${bgClass}">
|
|
231
|
+
<div class="sticky bottom-0 h-full w-full z-20 ${bgClass}">
|
|
218
232
|
${this.totalGracePeriod > 0 ? this.gracePeriodTemplate() : nothing}
|
|
219
233
|
</div>
|
|
220
234
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KompasGracePeriod.js","sourceRoot":"","sources":["../../../../src/components/kompasid-grace-period/KompasGracePeriod.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EA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QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAwB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qEAAgC;AAC/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAA4B;AAK9C;IAAR,KAAK,EAAE;yDAA2B;AAC1B;IAAR,KAAK,EAAE;2DAAgE;AAC/D;IAAR,KAAK,EAAE;uDAAsD;AAtEnD,iBAAiB;IAD7B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,iBAAiB,CAmQ7B;SAnQY,iBAAiB","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { deviceType } from '../../utils/deviceType.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\n\n@customElement('kompasid-grace-period')\nexport class KompasGracePeriod extends LitElement {\n static styles = [\n css`\n :host {\n font-family: 'PT Sans', sans-serif;\n }\n\n .body {\n position: sticky;\n top: 0;\n height: 100%;\n width: 100%;\n }\n `,\n TWStyles,\n ]\n\n /**\n * Props\n */\n /**\n * property totalGracePeriod = how many days are left in grace period\n * property isColumn = changes how the component looks on different screen sizes\n * property isShowButton = shows or hides a subscription button\n * property isEpaper = is paywall opened in epaper page\n * property paywall_location = the location where user encounter the paywall\n * property paywall_subscription_package = the name of the subscription package viewed by user\n * property paywall_subscription_id = the ID of the subscription package viewed by user\n * property paywall_subscription_price = the price of the subscriprtion package viewed by user\n * property paywall_position = the position of the subscription package viewed by user\n * property tracker_page_type = type of the page\n * property tracker_content_id = ID of article (slug)\n * property tracker_content_type = whether it's free article or paid article\n * property tracker_content_title = the title of article\n * property tracker_content_categories = the category of the content\n * property tracker_user_type = type of user based on their subscription\n * property tracker_subscription_status = status of their subscription\n * property tracker_page_domain = page Domain\n * property tracker_metered_wall_type = the type of Metered Wall\n * property tracker_metered_wall_balance = the balance of their metered wall\n * property tracker_epaper_edition = the edition of epaper viewed by user\n */\n\n @property({ type: Number }) totalGracePeriod = 0\n @property({ type: Boolean }) isColumn = false\n @property({ type: Boolean }) isShowButton = true\n @property({ type: Boolean }) isEpaper = false\n @property({ type: Boolean }) isBackgroundOnContentOnly = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: Number }) paywall_subscription_id = 0\n @property({ type: Number }) paywall_subscription_price = 0\n @property({ type: Number }) paywall_position = 0\n @property({ type: String }) tracker_page_type = ''\n @property({ type: String }) tracker_content_id = ''\n @property({ type: String }) tracker_content_title = ''\n @property({ type: String }) tracker_content_categories = ''\n @property({ type: String }) tracker_content_type = ''\n @property({ type: String }) tracker_user_type = ''\n @property({ type: String }) tracker_subscription_status = ''\n @property({ type: String }) tracker_page_domain = ''\n @property({ type: String }) tracker_metered_wall_type = ''\n @property({ type: Number }) tracker_metered_wall_balance = 0\n @property({ type: String }) tracker_epaper_edition = ''\n\n /**\n * State\n */\n @state() private maxGracePeriod = 7\n @state() private subscriptionPage = 'https://www.kompas.id/berlangganan'\n @state() private checkoutPage = 'https://checkoutv2.kompas.id'\n\n private getCountdownGracePeriod() {\n const { totalGracePeriod } = this\n const { maxGracePeriod } = this\n if (totalGracePeriod === 7) {\n return html`\n <p>\n Anda dalam <b class=\"text-orange-500\"> hari terakhir</b> masa tenggang\n langganan. Segera perbarui paket langganan untuk tetap mengakses\n konten premium tanpa batas.\n </p>\n `\n }\n return html`\n <p>\n Masa tenggang langganan Anda tersisa\n <b class=\"text-orange-500\"\n >${maxGracePeriod - totalGracePeriod + 1} hari lagi</b\n >. Segera perbarui paket langganan untuk tetap mengakses konten premium\n tanpa batas.\n </p>\n `\n }\n\n private redirectToBerlangganan(): void {\n this.dataLayeronPerbaruiLanggananButton()\n this.sendGtmEvent('subscribe_button_clicked', true)\n\n window.open(this.subscriptionPage)\n }\n\n private redirectToCheckout(): void {\n this.dataLayeronPerbaruiLanggananButton()\n const originHost: string = encodeURIComponent(window.location.href)\n\n this.sendGtmEvent('subscribe_button_clicked')\n\n window.open(\n `${this.checkoutPage}/kdp?productId=${this.paywall_subscription_id}&referrer=${originHost}&source=article`\n )\n }\n\n private getGtmParams(\n excludeSubscriptionParams: boolean = false\n ): Record<string, any> {\n const gtmParams: Record<string, any> = {}\n\n if (!this.isEpaper) {\n gtmParams.content_title = this.tracker_content_title\n gtmParams.content_id = this.tracker_content_id\n gtmParams.content_categories = this.tracker_content_categories\n gtmParams.content_type = this.tracker_content_type\n gtmParams.page_type = this.tracker_page_type\n } else {\n gtmParams.epaper_edition = this.tracker_epaper_edition\n }\n\n if (!excludeSubscriptionParams) {\n gtmParams.paywall_subscription_package = this.paywall_subscription_package\n gtmParams.paywall_subscription_id = this.paywall_subscription_id\n gtmParams.paywall_subscription_price = this.paywall_subscription_price\n }\n\n gtmParams.paywall_location = this.paywall_location\n gtmParams.paywall_position = this.paywall_position\n gtmParams.user_type = this.tracker_user_type\n gtmParams.subscription_status = this.tracker_subscription_status\n gtmParams.page_domain = this.tracker_page_domain || 'Kompas.id'\n gtmParams.metered_wall_type = this.tracker_metered_wall_type || 'GP'\n gtmParams.metered_wall_balance = this.tracker_metered_wall_balance\n\n return gtmParams\n }\n\n private sendGtmEvent(\n event: string,\n excludeSubscriptionParams: boolean = false\n ) {\n let gtmParams: Record<string, any> = { event }\n\n if (event === 'paywall_viewed') {\n gtmParams.impressions = [\n {\n ...this.getGtmParams(excludeSubscriptionParams),\n },\n ]\n } else {\n gtmParams = {\n ...gtmParams,\n ...this.getGtmParams(excludeSubscriptionParams),\n }\n }\n\n window.dataLayer.push(gtmParams)\n }\n\n private dataLayeronPerbaruiLanggananButton(): void {\n window.dataLayer.push({\n event: 'gracePeriodClick',\n interface: deviceType(),\n dayLeft: this.maxGracePeriod - this.totalGracePeriod,\n urlName: window.location.href,\n })\n }\n\n private dataLayeronGracePeriod(): void {\n window.dataLayer.push({\n event: 'gracePeriodImpression',\n interface: deviceType(),\n dayLeft: this.maxGracePeriod - this.totalGracePeriod,\n urlName: window.location.href,\n })\n }\n\n private gracePeriodTemplate() {\n const { isColumn, isBackgroundOnContentOnly } = this\n\n const wrapperColumnClass = isColumn\n ? 'rounded-lg'\n : 'md:flex-row lg:px-8 md:space-x-4 px-4 py-4'\n const buttonColumnClass = isColumn\n ? ''\n : 'md:w-1/2 justify-end md:flex-row pt-4 md:pt-0'\n const otherBtnColumnClass = isColumn ? '' : 'md:w-auto'\n const wrapperBgClass = !isBackgroundOnContentOnly ? 'p-4' : ''\n const contentBgClass = isBackgroundOnContentOnly\n ? 'bg-orange-100 p-4 rounded-lg mb-4'\n : ''\n\n return html`\n <div\n class=\"bottom-0 mx-auto flex w-full max-w-7xl flex-col justify-end ${wrapperColumnClass} ${wrapperBgClass}\"\n >\n <div\n class=\"self-center text-left text-sm text-grey-600 md:text-base ${contentBgClass}\"\n >\n ${this.getCountdownGracePeriod()}\n </div>\n ${this.isShowButton\n ? html`\n <div\n class=\"flex w-full flex-col gap-4 self-center ${buttonColumnClass}\"\n >\n <button\n @click=${this.redirectToCheckout}\n class=\"w-full rounded-md bg-green-500 p-2 px-5 text-sm font-bold text-grey-100 md:w-auto md:text-base\"\n >\n Perbarui Langganan\n </button>\n <div class=\"md:block hidden\">\n <button\n @click=${this.redirectToBerlangganan}\n class=\"bg-transparent w-full rounded-md border border-green-500 p-1.5 px-5 text-sm font-bold text-green-500 md:text-base ${otherBtnColumnClass}\"\n >\n Paket Lainnya\n </button>\n </div>\n <div class=\"md:hidden block\">\n <button\n @click=${this.redirectToBerlangganan}\n class=\"bg-transparent w-full rounded-md border border-green-500 p-1.5 px-5 text-sm font-bold text-green-500 md:text-base ${otherBtnColumnClass}\"\n >\n Lihat Paket Lainnya\n </button>\n </div>\n </div>\n `\n : nothing}\n </div>\n `\n }\n\n override async connectedCallback() {\n super.connectedCallback()\n\n this.sendGtmEvent('paywall_viewed')\n\n this.dataLayeronGracePeriod()\n }\n\n render() {\n const bgClass = !this.isBackgroundOnContentOnly ? 'bg-orange-100' : ''\n return html`\n <div class=\"sticky bottom-0 h-full w-full ${bgClass}\">\n ${this.totalGracePeriod > 0 ? this.gracePeriodTemplate() : nothing}\n </div>\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"KompasGracePeriod.js","sourceRoot":"","sources":["../../../../src/components/kompasid-grace-period/KompasGracePeriod.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAGjD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QAiBL;;WAEG;QACH;;;;;;;;;;;;;;;;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AE,MAAM,EAAE,CAAC;6DAAwB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qEAAgC;AAC/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAA4B;AAK9C;IAAR,KAAK,EAAE;yDAA2B;AAC1B;IAAR,KAAK,EAAE;2DAAgE;AAC/D;IAAR,KAAK,EAAE;uDAAsD;AAtEnD,iBAAiB;IAD7B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,iBAAiB,CAqR7B;SArRY,iBAAiB","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { deviceType } from '../../utils/deviceType.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\n\n@customElement('kompasid-grace-period')\nexport class KompasGracePeriod extends LitElement {\n static styles = [\n css`\n :host {\n font-family: 'PT Sans', sans-serif;\n }\n\n .body {\n position: sticky;\n top: 0;\n height: 100%;\n width: 100%;\n }\n `,\n TWStyles,\n ]\n\n /**\n * Props\n */\n /**\n * property totalGracePeriod = how many days are left in grace period\n * property isColumn = changes how the component looks on different screen sizes\n * property isShowButton = shows or hides a subscription button\n * property isEpaper = is paywall opened in epaper page\n * property paywall_location = the location where user encounter the paywall\n * property paywall_subscription_package = the name of the subscription package viewed by user\n * property paywall_subscription_id = the ID of the subscription package viewed by user\n * property paywall_subscription_price = the price of the subscriprtion package viewed by user\n * property paywall_position = the position of the subscription package viewed by user\n * property tracker_page_type = type of the page\n * property tracker_content_id = ID of article (slug)\n * property tracker_content_type = whether it's free article or paid article\n * property tracker_content_title = the title of article\n * property tracker_content_categories = the category of the content\n * property tracker_user_type = type of user based on their subscription\n * property tracker_subscription_status = status of their subscription\n * property tracker_page_domain = page Domain\n * property tracker_metered_wall_type = the type of Metered Wall\n * property tracker_metered_wall_balance = the balance of their metered wall\n * property tracker_epaper_edition = the edition of epaper viewed by user\n */\n\n @property({ type: Number }) totalGracePeriod = 0\n @property({ type: Boolean }) isColumn = false\n @property({ type: Boolean }) isShowButton = true\n @property({ type: Boolean }) isEpaper = false\n @property({ type: Boolean }) isBackgroundOnContentOnly = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: Number }) paywall_subscription_id = 0\n @property({ type: Number }) paywall_subscription_price = 0\n @property({ type: Number }) paywall_position = 0\n @property({ type: String }) tracker_page_type = ''\n @property({ type: String }) tracker_content_id = ''\n @property({ type: String }) tracker_content_title = ''\n @property({ type: String }) tracker_content_categories = ''\n @property({ type: String }) tracker_content_type = ''\n @property({ type: String }) tracker_user_type = ''\n @property({ type: String }) tracker_subscription_status = ''\n @property({ type: String }) tracker_page_domain = ''\n @property({ type: String }) tracker_metered_wall_type = ''\n @property({ type: Number }) tracker_metered_wall_balance = 0\n @property({ type: String }) tracker_epaper_edition = ''\n\n /**\n * State\n */\n @state() private maxGracePeriod = 7\n @state() private subscriptionPage = 'https://www.kompas.id/berlangganan'\n @state() private checkoutPage = 'https://checkoutv2.kompas.id'\n\n private getCountdownGracePeriod() {\n const { totalGracePeriod } = this\n const { maxGracePeriod } = this\n if (totalGracePeriod === 7) {\n return html`\n <p>\n Anda dalam\n <a\n href=\"#\"\n class=\"text-orange-500 underline font-bold cursor-pointer\"\n @click=${this.redirectToKnowledgeBase}\n >\n hari terakhir\n </a>\n masa tenggang langganan. Segera perbarui paket langganan untuk tetap\n mengakses konten premium tanpa batas.\n </p>\n `\n }\n return html`\n <p>\n Masa tenggang langganan Anda tersisa\n <a\n href=\"#\"\n class=\"text-orange-500 underline font-bold cursor-pointer\"\n @click=${this.redirectToKnowledgeBase}\n >\n ${maxGracePeriod - totalGracePeriod + 1} hari lagi </a\n >. Segera perbarui paket langganan untuk tetap mengakses konten premium\n tanpa batas.\n </p>\n `\n }\n\n private redirectToKnowledgeBase(): void {\n window.open(\n 'https://kb.kompas.id/baca/berlangganan-kompas-id/masa-tenggang-atau-grace-period-langganan/',\n '_blank'\n )\n }\n\n private redirectToBerlangganan(): void {\n this.dataLayeronPerbaruiLanggananButton()\n this.sendGtmEvent('subscribe_button_clicked', true)\n\n window.open(this.subscriptionPage)\n }\n\n private redirectToCheckout(): void {\n this.dataLayeronPerbaruiLanggananButton()\n const originHost: string = encodeURIComponent(window.location.href)\n\n this.sendGtmEvent('subscribe_button_clicked')\n\n window.open(\n `${this.checkoutPage}/kdp?productId=${this.paywall_subscription_id}&referrer=${originHost}&source=article`\n )\n }\n\n private getGtmParams(\n excludeSubscriptionParams: boolean = false\n ): Record<string, any> {\n const gtmParams: Record<string, any> = {}\n\n if (!this.isEpaper) {\n gtmParams.content_title = this.tracker_content_title\n gtmParams.content_id = this.tracker_content_id\n gtmParams.content_categories = this.tracker_content_categories\n gtmParams.content_type = this.tracker_content_type\n gtmParams.page_type = this.tracker_page_type\n } else {\n gtmParams.epaper_edition = this.tracker_epaper_edition\n }\n\n if (!excludeSubscriptionParams) {\n gtmParams.paywall_subscription_package = this.paywall_subscription_package\n gtmParams.paywall_subscription_id = this.paywall_subscription_id\n gtmParams.paywall_subscription_price = this.paywall_subscription_price\n }\n\n gtmParams.paywall_location = this.paywall_location\n gtmParams.paywall_position = this.paywall_position\n gtmParams.user_type = this.tracker_user_type\n gtmParams.subscription_status = this.tracker_subscription_status\n gtmParams.page_domain = this.tracker_page_domain || 'Kompas.id'\n gtmParams.metered_wall_type = this.tracker_metered_wall_type || 'GP'\n gtmParams.metered_wall_balance = this.tracker_metered_wall_balance\n\n return gtmParams\n }\n\n private sendGtmEvent(\n event: string,\n excludeSubscriptionParams: boolean = false\n ) {\n let gtmParams: Record<string, any> = { event }\n\n if (event === 'paywall_viewed') {\n gtmParams.impressions = [\n {\n ...this.getGtmParams(excludeSubscriptionParams),\n },\n ]\n } else {\n gtmParams = {\n ...gtmParams,\n ...this.getGtmParams(excludeSubscriptionParams),\n }\n }\n\n window.dataLayer.push(gtmParams)\n }\n\n private dataLayeronPerbaruiLanggananButton(): void {\n window.dataLayer.push({\n event: 'gracePeriodClick',\n interface: deviceType(),\n dayLeft: this.maxGracePeriod - this.totalGracePeriod,\n urlName: window.location.href,\n })\n }\n\n private dataLayeronGracePeriod(): void {\n window.dataLayer.push({\n event: 'gracePeriodImpression',\n interface: deviceType(),\n dayLeft: this.maxGracePeriod - this.totalGracePeriod,\n urlName: window.location.href,\n })\n }\n\n private gracePeriodTemplate() {\n const { isColumn, isBackgroundOnContentOnly } = this\n\n const wrapperColumnClass = isColumn\n ? 'rounded-lg'\n : 'md:flex-row lg:px-8 md:space-x-4 px-4 py-4'\n const buttonColumnClass = isColumn\n ? ''\n : 'md:w-1/2 justify-end md:flex-row pt-4 md:pt-0'\n const otherBtnColumnClass = isColumn ? '' : 'md:w-auto'\n const wrapperBgClass = !isBackgroundOnContentOnly ? 'p-4' : ''\n const contentBgClass = isBackgroundOnContentOnly\n ? 'bg-orange-100 p-4 rounded-lg mb-4'\n : ''\n\n return html`\n <div\n class=\"bottom-0 mx-auto flex w-full max-w-7xl flex-col justify-end ${wrapperColumnClass} ${wrapperBgClass}\"\n >\n <div\n class=\"self-center text-left text-sm text-grey-600 md:text-base ${contentBgClass}\"\n >\n ${this.getCountdownGracePeriod()}\n </div>\n ${this.isShowButton\n ? html`\n <div\n class=\"flex w-full flex-col gap-4 self-center ${buttonColumnClass}\"\n >\n <button\n @click=${this.redirectToCheckout}\n class=\"w-full rounded-md bg-green-500 p-2 px-5 text-sm font-bold text-grey-100 md:w-auto md:text-base\"\n >\n Perbarui Langganan\n </button>\n <div class=\"md:block hidden\">\n <button\n @click=${this.redirectToBerlangganan}\n class=\"bg-transparent w-full rounded-md border border-green-500 p-1.5 px-5 text-sm font-bold text-green-500 md:text-base ${otherBtnColumnClass}\"\n >\n Paket Lainnya\n </button>\n </div>\n <div class=\"md:hidden block\">\n <button\n @click=${this.redirectToBerlangganan}\n class=\"bg-transparent w-full rounded-md border border-green-500 p-1.5 px-5 text-sm font-bold text-green-500 md:text-base ${otherBtnColumnClass}\"\n >\n Lihat Paket Lainnya\n </button>\n </div>\n </div>\n `\n : nothing}\n </div>\n `\n }\n\n override async connectedCallback() {\n super.connectedCallback()\n\n this.sendGtmEvent('paywall_viewed')\n\n this.dataLayeronGracePeriod()\n }\n\n render() {\n const bgClass = !this.isBackgroundOnContentOnly ? 'bg-orange-100' : ''\n return html`\n <div class=\"sticky bottom-0 h-full w-full z-20 ${bgClass}\">\n ${this.totalGracePeriod > 0 ? this.gracePeriodTemplate() : nothing}\n </div>\n `\n }\n}\n"]}
|
|
@@ -469,7 +469,8 @@ let KompasIdPaywallBody = class KompasIdPaywallBody extends LitElement {
|
|
|
469
469
|
let buttonContent;
|
|
470
470
|
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600';
|
|
471
471
|
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600';
|
|
472
|
-
|
|
472
|
+
const isPrevHistoryExist = window.history.length > 1;
|
|
473
|
+
if (type === 'epaper' && isPrevHistoryExist) {
|
|
473
474
|
buttonContent = html ` <button
|
|
474
475
|
@click=${this.redirectToPrevUrl}
|
|
475
476
|
class="hidden md:block w-8 h-8 pl-4 ${textColorClass}"
|
|
@@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D;IAAR,KAAK,EAAE;sDAAsB;AA9FnB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAusC/B;SAvsCY,mBAAmB","sourcesContent":["/* eslint-disable no-return-assign */\n\nimport { html, css, LitElement, nothing } from 'lit'\nimport { property, state, customElement } from 'lit/decorators.js'\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\nimport {\n PaywallProduct,\n Product,\n Packages,\n PaymentImage,\n PaywallType,\n} from '../kompasid-paywall/types.js'\nimport { getFontAwesomeIcon } from '../../utils/fontawesome-setup.js'\nimport { deviceType } from '../../utils/deviceType.js'\nimport { formatRupiah } from '../../utils/formatRupiah.js'\nimport { addGoogleFonts } from '../../utils/googleFont.js'\nimport { redirectToRegister, redirectToLogin } from '../../utils/cta.js'\nimport { cryptos } from '../../utils/crypt.js'\n\n@customElement('kompasid-paywall-body')\nexport class KompasIdPaywallBody extends LitElement {\n static styles = [\n css`\n .wrapper-body {\n display: flex;\n flex-direction: column;\n justify-items: center;\n align-items: center;\n }\n\n .z-index-max {\n z-index: 999999;\n }\n\n .font-lora {\n font-family: 'Lora', 'Georgia', 'serif';\n }\n `,\n TWStyles,\n ]\n\n /**\n * Props\n */\n /**\n * prop slug untuk menghandle slug\n * prop isLogin untuk menghandle apakah user sudah login atau belum\n * prop type untuk menghandle tipe epaper\n * prop paywallData untuk menghandle data paywall\n * prop userGuid untuk menghandle user Guid\n * prop subscriptionStatus untuk menghandle status subscription user\n * prop countdownArticle untuk menghandle count artikel\n * prop swgEnable untuk menghandle swg apakah di aktifkan atau tidak\n * prop paywall_location = The location where user encounter the paywall\n * prop paywall_subscription_package = The name of the subscription package viewed by user\n * prop paywall_subscription_id = The ID of the subscription package viewed by user\n * prop paywall_subscription_price = The price of the subscriprtion package viewed by user\n * prop paywall_position = The position of the subscription package viewed by user\n * prop tracker_page_type = Type of the page\n * prop tracker_content_id = ID of article (slug)\n * prop tracker_content_type = Whether it's free article or paid article\n * prop tracker_content_title = The title of article\n * prop tracker_content_categories = The category of the content\n * prop tracker_user_type = Type of user based on their subscription\n * prop tracker_subscription_status = Status of their subscription\n * prop tracker_page_domain = Page Domain\n * prop tracker_metered_wall_type = The type of Metered Wall\n * prop tracker_metered_wall_balance = The balance of their metered wall\n * prop tracker_metered_wall_balance = The edition of epaper viewed by user\n * prop theme = The theme of the paywall component\n */\n\n @property({ type: String }) slug = ''\n @property({ type: Boolean }) isLogin = false\n @property({ type: String }) type: PaywallType = 'reguler'\n @property({ type: Object }) paywallData: PaywallProduct | undefined =\n undefined\n @property({ type: String }) userGuid = ''\n @property({ type: String }) subscriptionStatus = ''\n @property({ type: Number }) countdownArticle = 0\n @property({ type: Boolean }) swgEnable = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: Number }) paywall_subscription_id = 0\n @property({ type: Number }) paywall_subscription_price = 0\n @property({ type: Number }) paywall_position = 0\n @property({ type: String }) tracker_page_type = ''\n @property({ type: String }) tracker_content_id = ''\n @property({ type: String }) tracker_content_title = ''\n @property({ type: String }) tracker_content_categories = ''\n @property({ type: String }) tracker_content_type = ''\n @property({ type: String }) tracker_user_type = ''\n @property({ type: String }) tracker_subscription_status = ''\n @property({ type: String }) tracker_page_domain = ''\n @property({ type: String }) tracker_metered_wall_type = ''\n @property({ type: Number }) tracker_metered_wall_balance = 0\n @property({ type: String }) tracker_epaper_edition = ''\n @property({ type: String }) theme = ''\n @property() togglePaywall = () => {}\n\n /**\n * State\n */\n\n @state() private isExtensionsOpened = false\n @state() private kompasAkunHost = 'https://akun.kompas.id'\n @state() private kompasApigenHost = 'https://apigen.kompas.id'\n @state() private kompasApiWcmHost = 'https://apiwcm.kompas.id'\n @state() private kompasLoginHost = 'https://account.kompas.id/login'\n @state() private kompasApiSubsHost = 'https://apisubs.kompas.id'\n @state() private epaperHost = 'https://epaper.kompas.id'\n @state() private swgPublisherName = 'Harian Kompas'\n @state() private swgPublisherId = 'kompas.id'\n @state() private swgProductId = 'kompas.id:kompas_digital_premium'\n @state() private errorFlag = 0\n\n _packages!: Packages\n buttonElement!: HTMLButtonElement\n targetElement!: HTMLElement\n\n /**\n * Getter\n */\n\n get loginUrl() {\n return `${this.kompasLoginHost}?next=${encodeURIComponent(\n this.epaperHost + window.location.pathname\n )}&loc=hard_paywall`\n }\n\n get isDark() {\n return this.theme === 'dark'\n }\n\n get isEntitledForIntroductoryPrice(): boolean {\n return !this.isLogin || this.tracker_subscription_status === 'IA'\n }\n\n get packages(): Packages {\n return this._packages\n }\n\n /**\n * Logic Function\n */\n\n private redirectToCheckout(\n url: string,\n name: string,\n id: string,\n price: number,\n position: number\n ): void {\n this.sendDataLayeronButtonBuyPackage(name, id, price, position)\n const originHost: string = encodeURIComponent(window.location.href)\n let source: string\n\n switch (this.type) {\n case 'epaper':\n source = 'epaper'\n break\n case 'audio':\n source = 'news_audio'\n break\n default:\n source = 'article'\n }\n\n const directUrlCheckout: string = `${url}${originHost}&source=${source}`\n window.open(directUrlCheckout)\n }\n\n private redirectToPrevUrl(): void {\n window.history.back()\n }\n\n private redirectToSubscriber(): void {\n this.sendDataLayer()\n window.open('https://www.kompas.id/berlangganan')\n }\n\n private redirectToHelpdesk(): void {\n this.sendDataLayeronHelpDesk()\n window.open(\n 'https://api.whatsapp.com/send/?phone=6281290050800&text=Halo,%20saya%20perlu%20informasi%20mengenai%20kompas.id'\n )\n }\n\n private handleClickOutside() {\n if (this.targetElement?.classList.contains('wrapper-body')) {\n this.togglePaywall()\n }\n\n if (this.targetElement?.id === 'freeTrialPopup') {\n this.closeFreeTrialPopup()\n }\n }\n\n private parsePrice(price: string): number {\n const lowerCasePrice = price.toLowerCase()\n\n if (lowerCasePrice.startsWith('rp')) {\n return parseFloat(price.replace(/[^0-9,]/g, ''))\n }\n\n return parseFloat(price.replace(/[^0-9.]/g, ''))\n }\n\n private async getRegisterToken(path: string, payload: any): Promise<string> {\n return fetch(`${this.kompasApigenHost}/v1/user/register/token/${path}`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n },\n })\n .then(response => response.json())\n .then((data: any) => data.result.token)\n .catch(error => {\n throw error\n })\n }\n\n private async getUserToken(path: string, payload: any): Promise<string> {\n return fetch(`${this.kompasApigenHost}/v1/user/token/${path}`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n },\n })\n .then(response => response.json())\n .then((data: any) => data.result.token)\n .catch(error => {\n throw error\n })\n }\n\n private async getSubscriptionToken(\n path: string,\n payload: any\n ): Promise<string> {\n return fetch(`${this.kompasAkunHost}/api/subscription/login/${path}`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n },\n })\n .then(response => response.json())\n .then((data: any) => {\n this.errorFlag = 0\n return data.access_token\n })\n .catch(async error => {\n const errorCode = error.response.status\n if (errorCode === 500 && this.errorFlag < 5) {\n // eslint-disable-next-line no-plusplus\n this.errorFlag++\n setTimeout(async () => {\n await this.getSubscriptionToken(path, payload)\n }, 2000)\n } else {\n this.errorFlag = 0\n throw error\n }\n })\n }\n\n private async createSwG(payload: any) {\n const crypto = await cryptos()\n await fetch(`${this.kompasApiSubsHost}/membership/swg`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n 'x-signature': crypto.xSignature,\n datetime: crypto.datetime,\n },\n })\n .then(response => response.json())\n .catch(error => {\n throw error\n })\n }\n\n private subscribeWithGoogleButton(): any {\n // @ts-ignore\n // eslint-disable-next-line no-restricted-globals\n ;(self.SWG = self.SWG || []).push((subscriptions: any) => {\n // set entitlement\n subscriptions.setOnEntitlementsResponse(() => {\n // subscriptions attach button\n subscriptions.attachButton(\n this.buttonElement,\n { theme: 'light', lang: 'en' },\n async () => {\n subscriptions.showOffers({ isClosable: true })\n subscriptions.setOnLoginRequest(() => {\n window.location.href = this.loginUrl\n })\n const offers = await subscriptions.getOffers()\n subscriptions.setOnFlowStarted((callback: any) => {\n if (callback.flow === 'showOffers') {\n window.dataLayer.push(this.swgPackageViewedDataLayer(offers))\n } else if (callback.flow === 'subscribe') {\n const selectedOfferSkuId = callback.data.skuId\n const selectedOffer = offers.find(\n (offer: any) => offer.skuId === selectedOfferSkuId\n )\n window.dataLayer.push(\n this.swgSubscribeButtonClicked(\n selectedOffer,\n offers.indexOf(selectedOffer)\n )\n )\n }\n })\n subscriptions.setOnPaymentResponse(async (paymentResponse: any) => {\n const response = await paymentResponse\n const raw = JSON.parse(response.purchaseData.raw)\n const { productId, purchaseToken, packageName } = raw\n const { email } = response.userData.data\n const swgMembershipChannelId = 2\n const payload = {\n email,\n purchase_token: purchaseToken,\n product_id: productId,\n package_name: packageName,\n membershipChannelId: swgMembershipChannelId,\n }\n\n await this.createSwG(payload)\n response.complete().then(() => {\n window.location.href = this.loginUrl\n })\n })\n }\n )\n })\n })\n }\n\n private jsonScript() {\n const jsonData = {\n '@context': 'https://schema.org',\n '@type': ['WebSite', 'WebPage'],\n isAccessibleForFree: false,\n url: this.epaperHost + window.location.pathname,\n name: this.swgPublisherName,\n hasPart: {\n '@type': 'WebPageElement',\n },\n isPartOf: {\n '@type': ['CreativeWork', 'Product'],\n name: this.swgPublisherId,\n productID: this.swgProductId,\n },\n }\n const str = JSON.stringify(jsonData)\n const jsonScript = document.createElement('script')\n jsonScript.type = 'application/ld+json'\n jsonScript.text = str\n jsonScript.defer = true\n const jsonHead = document.querySelector('head')\n if (jsonHead) {\n jsonHead.appendChild(jsonScript)\n }\n }\n\n constructor() {\n super()\n this.handleClickOutside = this.handleClickOutside.bind(this)\n }\n\n protected createRenderRoot() {\n const root = super.createRenderRoot()\n root.addEventListener(\n 'click',\n (e: Event) => (this.targetElement = e.target as HTMLElement)\n )\n return root\n }\n\n override async connectedCallback() {\n this._packages = this.paywallData?.packages ?? ({} as Packages)\n\n super.connectedCallback()\n await this.updateComplete\n\n if (this.packages.swgEnable) {\n this.jsonScript()\n const appendSWGButton = () => {\n this.buttonElement = this.shadowRoot?.getElementById(\n 'subscribe-with-google'\n ) as HTMLButtonElement\n if (this.buttonElement) {\n const head = document.querySelector('head')\n const script = document.createElement('script')\n script.src = 'https://news.google.com/swg/js/v1/swg.js'\n script.defer = true\n script.onload = this.subscribeWithGoogleButton()\n if (head) {\n head.appendChild(script)\n }\n }\n }\n setTimeout(appendSWGButton, 500)\n }\n addGoogleFonts(['pt-sans', 'lora'])\n document.addEventListener('click', this.handleClickOutside)\n }\n\n override async disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener('click', this.handleClickOutside)\n }\n\n private otherPackagesClicked() {\n this.sendDataLayerOtherPackagesClicked()\n this.redirectToSubscriber()\n }\n\n private customerServiceClicked() {\n this.sendDataLayerCustomerServiceClicked()\n this.redirectToHelpdesk()\n }\n\n /**\n * Data Layer\n */\n\n private buildGtmParams(\n event: string,\n impressions: Record<string, any>[],\n index: number = 0\n ) {\n const gtmParams: Record<string, any> = {\n event,\n impressions: impressions.map((impression, i) => ({\n paywall_location: this.paywall_location || '',\n paywall_subscription_package: impression.package,\n paywall_subscription_id: impression.subscription_id,\n paywall_subscription_price: this.parsePrice(impression.price),\n paywall_position: index + i + 1,\n user_type: this.tracker_user_type,\n subscription_status: this.tracker_subscription_status,\n page_domain: this.tracker_page_domain || 'Kompas.id',\n metered_wall_type: this.tracker_metered_wall_type || 'HP',\n metered_wall_balance: this.tracker_metered_wall_balance,\n ...(this.type === 'epaper'\n ? { epaper_edition: this.tracker_epaper_edition }\n : {\n page_type: this.tracker_page_type,\n content_id: this.tracker_content_id,\n content_title: this.tracker_content_title,\n content_categories: this.tracker_content_categories,\n content_type: this.tracker_content_type,\n }),\n })),\n }\n\n return gtmParams\n }\n\n private generalPaywallDataLayer(event: string): Record<string, any> {\n const packages = this.paywallData?.packages ?? ({} as Packages)\n\n const impressions = packages.memberships.map(membership => ({\n package: membership.package,\n subscription_id: membership.subscriptionId,\n price: membership.price.toString(),\n }))\n\n return this.buildGtmParams(event, impressions)\n }\n\n private sendDataLayer(): void {\n window.dataLayer.push({\n event: 'halamanBerlanggananClick',\n subscriptionStatus: '',\n GUID: '',\n interface: deviceType(),\n })\n }\n\n private sendDataLayeronHelpDesk(): void {\n window.dataLayer.push({\n event: 'helpOfferClick',\n userType: this.subscriptionStatus,\n GUID: this.userGuid,\n interface: deviceType(),\n })\n }\n\n private sendDataLayeronButtonBuyPackage(\n name: string,\n id: string,\n price: number,\n position: number\n ): void {\n const gtmParams: Record<string, any> = {\n event: 'subscribe_button_clicked',\n paywall_location: this.paywall_location,\n paywall_subscription_package: name,\n paywall_subscription_id: id,\n paywall_subscription_price: price,\n paywall_position: position,\n user_type: this.tracker_user_type,\n subscription_status: this.tracker_subscription_status,\n page_domain: this.tracker_page_domain || 'Kompas.id',\n metered_wall_type: this.tracker_metered_wall_type || 'HP',\n metered_wall_balance: this.tracker_metered_wall_balance,\n }\n\n if (this.type !== 'epaper') {\n gtmParams.content_title = this.tracker_content_title\n gtmParams.content_id = this.tracker_content_id\n gtmParams.content_categories = this.tracker_content_categories\n gtmParams.content_type = this.tracker_content_type\n gtmParams.page_type = this.tracker_page_type\n } else {\n gtmParams.epaper_edition = this.tracker_epaper_edition\n }\n\n window.dataLayer.push(gtmParams)\n }\n\n private sendDataLayeronPaywallBody(): void {\n const gtmParams = this.generalPaywallDataLayer('paywall_viewed')\n window.dataLayer.push(gtmParams)\n }\n\n private sendDataLayerOtherPackagesClicked(): void {\n const gtmParams = this.generalPaywallDataLayer('other_packages_clicked')\n window.dataLayer.push(gtmParams)\n }\n\n private sendDataLayerCustomerServiceClicked(): void {\n const gtmParams = this.generalPaywallDataLayer('customer_service_clicked')\n window.dataLayer.push(gtmParams)\n }\n\n private swgPackageViewedDataLayer(data: any): Record<string, any> {\n const impressions = data.map(\n (item: {\n title: string\n skuId: string\n price: string\n introductoryPrice: string\n }) => ({\n package: item.title,\n subscription_id: item.skuId,\n price: item.introductoryPrice || item.price,\n })\n )\n\n return this.buildGtmParams('subscription_package_viewed', impressions)\n }\n\n private swgSubscribeButtonClicked(item: any, index: number) {\n const gtmParams: any = {\n event: 'subscribe_button_clicked',\n paywall_location: this.paywall_location || '',\n paywall_subscription_package: item.title,\n paywall_subscription_id: item.skuId,\n paywall_subscription_price: this.parsePrice(\n item.introductoryPrice || item.price\n ),\n paywall_position: index + 1,\n user_type: this.tracker_user_type,\n subscription_status: this.tracker_subscription_status,\n page_domain: this.tracker_page_domain || 'Kompas.id',\n metered_wall_type: this.tracker_metered_wall_type || 'HP',\n metered_wall_balance: this.tracker_metered_wall_balance,\n }\n\n if (this.type === 'epaper') {\n gtmParams.epaper_edition = this.tracker_epaper_edition\n } else {\n gtmParams.page_type = this.tracker_page_type\n gtmParams.content_id = this.tracker_content_id\n gtmParams.content_title = this.tracker_content_title\n gtmParams.content_categories = this.tracker_content_categories\n gtmParams.content_type = this.tracker_content_type\n }\n\n return gtmParams\n }\n\n /**\n * Component\n */\n\n private headerSection(type: PaywallType, title: string) {\n let buttonContent\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n if (type === 'epaper') {\n buttonContent = html` <button\n @click=${this.redirectToPrevUrl}\n class=\"hidden md:block w-8 h-8 pl-4 ${textColorClass}\"\n >\n ${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left'))}\n </button>`\n } else if (type === 'audio') {\n buttonContent = html` <button\n @click=${this.togglePaywall}\n class=\"hidden md:block w-8 h-8 pl-4 ${textColorClass}\"\n >\n ${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}\n </button>`\n } else {\n buttonContent = nothing\n }\n\n const headerClass = `text-base flex justify-center self-center md:block md:text-xl ${buttonTextColorClass} text-center font-lora font-bold tracking-wide md:tracking-normal max-w-xs sm:max-w-lg md:w-full md:max-w-full ${\n type === 'audio' && 'sm:px-16 md:px-20'\n }`\n\n return html`\n <div class=\"flex w-full items-start justify-center\">\n ${buttonContent}\n <h4 class=${headerClass}>${title}</h4>\n ${type === 'epaper' || type === 'audio'\n ? html`<div class=\"w-10 hidden md:flex\"></div>`\n : nothing}\n </div>\n `\n }\n\n private descriptionSection(data: Array<string>) {\n const spaceYClass =\n this.type === 'audio' ? 'space-y-2 md:space-y-1' : 'space-y-2'\n const textColorClass = this.isDark ? 'text-green-400' : 'text-green-500'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n return html` <div class=\" flex flex-col items-center\">\n <div class=\"flex flex-col md:max-w-[464px] mt-2.5 md:mt-3 ${spaceYClass}\">\n ${data.map(\n item =>\n html`\n <div class=\"flex items-center\">\n <div class=\"${textColorClass}\">\n ${unsafeSVG(getFontAwesomeIcon('fas', 'check', 12, 12))}\n </div>\n <h6\n class=\"text-xs md:text-base ml-0.5 md:ml-1 ${buttonTextColorClass}\"\n >\n ${item}\n </h6>\n </div>\n `\n )}\n </div>\n </div>`\n }\n\n private informationPackages() {\n const marginTopClass = this.type === 'audio' ? 'mt-4 md:mt-2' : 'mt-4'\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n\n return html` <div class=\"flex justify-center ${marginTopClass}\">\n <button\n @click=${this.otherPackagesClicked}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Lihat Paket Lainnya\n </button>\n </div>`\n }\n\n private epaperRegistrationSection() {\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n return html`\n <div>\n <button\n @click=${() =>\n redirectToLogin({\n loc: 'hard_paywall',\n next: this.epaperHost + window.location.pathname,\n })}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Masuk\n </button>\n <span class=\"${buttonTextColorClass}\">jika sudah berlangganan.</span>\n </div>\n `\n }\n\n private regulerRegistrationSection() {\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n return html`\n <div class=\"flex flex-col items-center justify-center\">\n <div>\n <button\n @click=${() => redirectToRegister('hard_paywall')}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Daftar\n </button>\n <span class=\"${buttonTextColorClass}\"\n >untuk kuota artikel gratis</span\n >\n </div>\n <div>\n <span class=\"${buttonTextColorClass}\">atau</span>\n <button\n @click=${() => redirectToLogin({ loc: 'hard_paywall' })}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Masuk\n </button>\n <span class=\"${buttonTextColorClass}\">jika sudah punya akun.</span>\n </div>\n </div>\n `\n }\n\n private registrationSection(type: PaywallType) {\n return type === 'epaper'\n ? this.epaperRegistrationSection()\n : this.regulerRegistrationSection()\n }\n\n private paymentMobileExtension(data: Array<PaymentImage>) {\n return html`\n <div\n class=\"w-full max-w-xs mb-1 ml-8 md:hidden absolute px-4 ${this.isDark\n ? '-bottom-6'\n : 'bottom-0'}\"\n >\n <div\n class=\"w-full rounded p-3 max-w-xs ${this.isDark\n ? 'bg-dark-6 border-dark-6'\n : 'bg-white border-white'}\"\n >\n <svg\n class=\"right-0 h-4 mr-10 -mt-7 z-0 transform rotate-180 absolute ${this\n .isDark\n ? 'text-dark-6 border-dark-6'\n : 'text-white border-white '}\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 255 255\"\n >\n <polygon class=\"fill-current\" points=\"0,0 127.5,127.5 255,0\" />\n </svg>\n <div\n class=\"grid place-items-center items-center grid-flow-row grid-cols-5 grid-rows-2 gap-y-4\"\n >\n ${data.map(\n item =>\n html`<img\n class=\"object-cover\"\n src=${item.link}\n alt=\"${item.name}-logo-payment\"\n />`\n )}\n </div>\n </div>\n </div>\n `\n }\n\n private primaryPackages(product: Product) {\n const { isDark } = this\n const isAudio = this.type === 'audio'\n\n const containerClass = `flex flex-wrap justify-between h-[68px] items-center rounded-lg md:mx-0 w-full max-w-xs md:max-w-sm md:w-3/5 mt-2.5${\n isDark ? ' bg-grey-600' : ' bg-white'\n }${isAudio ? ' md:mt-3' : ' md:mt-4'} border border-yellow-400 relative`\n\n const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600'\n\n const buttonClass = `h-8 rounded mr-4 flex items-center${\n isDark ? ' bg-green-300 border border-green-400' : ' bg-green-500'\n }`\n\n const buttonTextClass = `text-xs md:text-sm font-bold py-2 px-4${\n isDark ? ' text-black' : ' text-white'\n }`\n\n return html`\n <div class=\"${containerClass}\">\n <div class=\"flex flex-col py-3 px-4\">\n <div class=\"flex flex-none items-center\">\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">\n ${formatRupiah(product.price)}\n </h5>\n <h6 class=\"text-xs md:text-base font-bold pl-1 ${textColorClass}\">\n / ${product.periode}\n </h6>\n </div>\n ${product.savingPrice\n ? html`\n <div class=\"flex items-center\">\n <p class=\"text-xs ${textColorClass}\">\n hanya\n <span class=\"text-orange-400\"\n >${formatRupiah(product.savingPrice)}</span\n >\n / bulan\n </p>\n </div>\n `\n : nothing}\n </div>\n <button\n class=\"${buttonClass}\"\n @click=${() =>\n this.redirectToCheckout(\n product.url,\n product.package,\n product.subscriptionId,\n product.price,\n product.position\n )}\n >\n <h6 class=\"${buttonTextClass}\">Langganan</h6>\n </button>\n <div class=\"absolute -top-2 left-4\">\n <div class=\"rounded bg-yellow-300 px-2 py-0.5 text-xs\">\n <b class=\"text-grey-600\">Harga Terbaik</b>\n </div>\n </div>\n </div>\n `\n }\n\n private secondaryPackages(product: Product) {\n const { isDark } = this\n const isAudio = this.type === 'audio'\n\n const containerClass = `flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${\n isDark ? ' bg-grey-600' : ' bg-white'\n }${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`\n\n const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600'\n\n const buttonClass = `h-8 rounded border border-green-500${\n isDark ? ' text-green-300' : ' bg-white text-green-500'\n }`\n\n const buttonTextClass = `text-xs md:text-sm font-bold px-4${\n isDark ? ' text-green-300' : ' text-green-500'\n }`\n\n return html`\n <div class=\"${containerClass}\">\n <div class=\"flex flex-col\">\n <div class=\"flex items-center\">\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">\n ${formatRupiah(product.price)}\n </h5>\n <h6 class=\"text-xs md:text-base font-bold pl-1 ${textColorClass}\">\n / ${product.periode}\n </h6>\n </div>\n ${product.savingPrice\n ? html`\n <div class=\"flex items-center\">\n <p class=\"text-xs ${textColorClass}\">\n hanya\n <span class=\"text-orange-400\"\n >${formatRupiah(product.savingPrice)}</span\n >\n / bulan\n </p>\n </div>\n `\n : nothing}\n </div>\n <button\n @click=${() =>\n this.redirectToCheckout(\n product.url,\n product.package,\n product.subscriptionId,\n product.price,\n product.position\n )}\n class=\"${buttonClass}\"\n >\n <h6 class=\"${buttonTextClass}\">Langganan</h6>\n </button>\n </div>\n `\n }\n\n private packagesSection(data: Packages) {\n return html`\n <div class=\"flex flex-col w-full items-center mt-8 md:mt-2 px-4\">\n ${data.memberships.map(item =>\n item.isHighlight\n ? this.primaryPackages(item)\n : this.secondaryPackages(item)\n )}\n ${this.freeTrialPackageSection()} ${this.freeTrialPopUp()}\n ${this.packages.swgEnable ? this.swgPackageSection() : nothing}\n </div>\n `\n }\n\n private topNavigator(type: PaywallType) {\n let icon: string\n let buttonText: string\n let clickAction: Function\n\n if (type === 'audio') {\n icon = getFontAwesomeIcon('fas', 'xmark')\n buttonText = 'Tutup'\n clickAction = this.togglePaywall.bind(this)\n } else {\n icon = getFontAwesomeIcon('fas', 'arrow-left')\n buttonText = 'Kembali'\n clickAction = this.redirectToPrevUrl.bind(this)\n }\n\n return html`\n <div class=\"flex md:hidden w-full pb-4\">\n <button\n @click=${clickAction}\n class=\"text-xs md:text-lg text-white flex flex-row\"\n >\n <div class=\"icon-lg icon-white w-4 h-4 mr-3.5 md:mr-5 pt-0.5\">\n ${unsafeSVG(icon)}\n </div>\n ${buttonText}\n </button>\n </div>\n `\n }\n\n private helpDesk() {\n const textColorClass = this.isDark ? 'text-dark-7' : 'text-white'\n\n return html`\n <div class=\"self-center text-xs md:text-sm ${textColorClass}\">\n Butuh bantuan? Hubungi\n <button\n @click=${this.customerServiceClicked}\n class=\"font-bold underline\"\n >\n Layanan Pelanggan.\n </button>\n </div>\n `\n }\n\n private userAction() {\n const isAudio = this.type === 'audio'\n const paddingClass = isAudio ? 'md:py-3.5' : 'md:py-6'\n const marginClass = isAudio ? 'md:mt-4' : 'md:mt-8'\n const backgroundClass = this.isDark ? 'bg-dark-4' : 'bg-blue-600'\n\n return html`\n <div\n class=\"flex py-5 px-8 w-full justify-evenly rounded-b-xl mt-6 relative ${paddingClass} ${marginClass} ${backgroundClass}\"\n >\n ${this.helpDesk()}\n </div>\n `\n }\n\n private introductoryPrice() {\n const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600'\n return html` <div\n class=\"flex space-x-1 h-5 md:h-max overflow-hidden md:flex-col md:space-x-0 items-center md:items-start md:justify-center\"\n >\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">Rp 10.000</h5>\n <p class=\"text-xs ${textColorClass}\">untuk 1 bulan pertama</p>\n </div>`\n }\n\n private swgRegonText() {\n const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600'\n return html`<p class=\"text-xs leading-4 md:max-w-[137px] ${textColorClass}\">\n Berlangganan lebih mudah dengan Google\n </p>`\n }\n\n private swgPackageSection() {\n const { isDark } = this\n const isAudio = this.type === 'audio'\n\n const containerClass = `flex flex-col space-y-2 md:space-x-2 md:space-y-0 md:flex-row justify-between items-center py-3 px-4 rounded-lg md:mx-0 w-full h-[76px] md:h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${\n isDark ? ' bg-grey-600' : ' bg-white'\n }${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`\n\n const buttonClass = `border space-x-2 justify-center border-grey-400 rounded-md px-[22px] md:px-6 shadow-sm flex h-max flex-row flex-nowrap py-[5.6px] md:py-1.5 items-center${\n isDark ? ' bg-grey-600' : ' bg-grey-100 border-grey-100'\n }`\n\n const textColorClass = isDark ? 'text-dark-7' : 'text-grey-500'\n\n const googleImageSrc = isDark\n ? 'https://cdn-www.kompas.id/paywall-asset/google-white.png'\n : 'https://cdn-www.kompas.id/paywall-asset/google.png'\n\n return html`\n <div class=\"${containerClass}\">\n ${this.isEntitledForIntroductoryPrice\n ? this.introductoryPrice()\n : this.swgRegonText()}\n <div>\n <button class=\"${buttonClass}\" id=\"subscribe-with-google\">\n <p\n class=\"text-[11px] md:text-xs whitespace-nowrap w-full ${textColorClass}\"\n >\n Subscribe with\n </p>\n <img\n class=\"object-scale-down h-[17px] md:h-5\"\n src=${googleImageSrc}\n alt=\"subscribe with google\"\n />\n </button>\n </div>\n </div>\n `\n }\n\n private openFreeTrialPopup() {\n const popup = this.shadowRoot?.getElementById('freeTrialPopup')\n popup?.classList.remove('hidden')\n }\n\n private closeFreeTrialPopup() {\n const popup = this.shadowRoot?.getElementById('freeTrialPopup')\n popup?.classList.add('hidden')\n }\n\n private freeTrialPopUp() {\n const { isDark } = this\n\n const googlePlayBadgeSrc = isDark\n ? 'https://cdn-www.kompas.id/web-component/Button_Download%20Google%20Play_Dark%20Mode.svg'\n : 'https://cdn-www.kompas.id/web-component/Button_Download%20Google%20Play_Light%20Mode.svg'\n\n const appStoreBadgeSrc = isDark\n ? 'https://cdn-www.kompas.id/web-component/Button_Download%20App%20Store_Dark%20Mode.svg'\n : 'https://cdn-www.kompas.id/web-component/Button_Download%20App%20Store_Light%20Mode.svg'\n\n return html`\n <div\n id=\"freeTrialPopup\"\n class=\"fixed w-full h-full inset-0 flex justify-center items-center z-50 bg-black bg-opacity-75 hidden\"\n >\n <div\n class=\"rounded w-11/12 sm:w-3/4 md:w-1/2 lg:w-1/3 2xl:w-1/4 p-6 text-center ${isDark\n ? 'bg-dark-4'\n : 'bg-white'}\"\n >\n <div class=\"w-full flex justify-end px-2\">\n <button\n @click=${this.closeFreeTrialPopup}\n class=\"w-8 h-8 pl-4 ${isDark ? 'text-grey-300' : 'text-grey-400'}\"\n >\n ${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}\n </button>\n </div>\n <div class=\"w-full flex justify-center\">\n <div class=\"w-3/4 lg:w-1/2\">\n <img\n src=\"https://cdn-www.kompas.id/web-component/kompas-free-trial.png\"\n alt=\"Free Trial\"\n />\n </div>\n </div>\n <p\n class=\"font-bold text-lg mt-4 ${isDark\n ? 'text-white'\n : 'text-grey-600'}\"\n >\n Coba Gratis Kompas.id di Aplikasi\n </p>\n <div\n class=\"hidden lg:block lg:flex flex rounded mt-4 px-8 py-4 items-center ${isDark\n ? 'bg-dark-3 border border-dark-9'\n : 'bg-white border border-grey-300'}\"\n >\n <div class=\"w-1/3 flex mr-6\">\n <img\n src=\"https://cdn-www.kompas.id/web-component/free-trial-qr-code.png\"\n alt=\"QR Code Deep Link\"\n />\n </div>\n <div\n class=\"w-2/3 text-base text-left ${isDark\n ? 'text-dark-7'\n : 'text-grey-600'}\"\n >\n ${this.packages.freeTrial?.desktopText}\n </div>\n </div>\n <div\n class=\"text-base text-center lg:hidden px-2 md:px-8 ${isDark\n ? 'text-dark-7'\n : 'text-grey-600'}\"\n >\n ${this.packages.freeTrial?.mobileText}\n </div>\n <div class=\"lg:flex flex justify-center mt-4 hidden lg:block gap-4\">\n <a\n href=\"https://play.google.com/store/apps/details?id=id.kompas.app\"\n target=\"_blank\"\n ><img src=\"${googlePlayBadgeSrc}\" alt=\"Google Play Badge\"\n /></a>\n <a\n href=\"https://apps.apple.com/id/app/kompas-id/id1242195037?l=id\"\n target=\"_blank\"\n ><img src=\"${appStoreBadgeSrc}\" alt=\"iOS App Store Badge\"\n /></a>\n </div>\n <button\n onclick=\"window.open('https://app.komp.as/langganan', '_blank')\"\n class=\"h-12 rounded-md mt-4 flex w-full items-center justify-center lg:hidden ${isDark\n ? 'bg-green-300'\n : 'bg-green-500'}\"\n >\n <h6 class=\"font-bold p-4 ${isDark ? 'text-dark-5' : 'text-white'}\">\n Unduh Sekarang\n </h6>\n </button>\n </div>\n </div>\n `\n }\n\n private freeTrialPackageSection() {\n if (this.packages.freeTrial) {\n return html`\n <div\n class=\"flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3 md:mt-4 ${this\n .isDark\n ? 'bg-grey-600'\n : 'bg-white'}\"\n >\n <div class=\"flex flex-col\">\n <div class=\"flex items-center\">\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">\n ${formatRupiah(0)}\n </h5>\n </div>\n <div class=\"flex items-center\">\n <p\n class=\"text-xs ${this.isDark ? 'text-dark-7' : 'text-grey-600'}\"\n >\n ${this.packages.freeTrial?.packageText}\n </p>\n </div>\n </div>\n <button\n @click=${this.openFreeTrialPopup}\n class=\"h-8 border border-green-500 rounded ${!this.isDark &&\n 'bg-white'}\"\n >\n <h6\n class=\"text-xs md:text-sm font-bold px-4 ${this.isDark\n ? 'text-green-300'\n : 'text-green-500'}\"\n >\n Coba Gratis\n </h6>\n </button>\n </div>\n `\n }\n return nothing\n }\n\n /**\n * Render Statement\n */\n\n render() {\n const isEpaper = this.type === 'epaper'\n const isAudio = this.type === 'audio'\n const { isDark } = this\n const { isLogin } = this\n\n const wrapperBodyClass = `wrapper-body\n ${isEpaper ? 'bg-transparent mx-2' : ''}\n ${\n isAudio\n ? 'fixed w-full h-full inset-0 flex justify-center items-center z-index-max bg-black bg-opacity-75'\n : ''\n }`\n .trim()\n .replace(/\\s+/g, ' ')\n\n const containerClass = `flex w-full flex-col items-center justify-center rounded-xl pt-6 relative ${\n isDark ? 'bg-dark-3' : 'bg-blue-100'\n } ${isAudio ? 'md:pt-5' : 'md:pt-8'}`\n\n const borderClass = isDark ? 'border-dark-8' : 'border-blue-200'\n\n return html`\n <div class=\"${wrapperBodyClass}\">\n <div\n class=\"flex flex-col justify-center items-center w-full max-w-screen-sm my-5 px-2 relative\"\n >\n ${isEpaper || isAudio ? this.topNavigator(this.type) : nothing}\n <div class=\"${containerClass}\">\n ${this.headerSection(\n this.type,\n this.paywallData?.informations?.title ?? ''\n )}\n ${this.descriptionSection(\n this.paywallData?.informations?.description ?? []\n )}\n ${this.packagesSection(\n this.paywallData?.packages ?? ({} as Packages)\n )}\n ${this.informationPackages()}\n ${!isLogin\n ? html`\n <div\n class=\"border-b w-1/5 flex justify-center ${borderClass} ${isAudio\n ? 'my-4 md:my-3'\n : 'my-4'}\"\n ></div>\n ${this.registrationSection(this.type)}\n `\n : nothing}\n ${this.userAction()} ${this.sendDataLayeronPaywallBody()}\n </div>\n ${this.isExtensionsOpened\n ? this.paymentMobileExtension(\n this.paywallData?.payment?.ekstension ?? []\n )\n : nothing}\n </div>\n </div>\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"KompasPaywallBody.js","sourceRoot":"","sources":["../../../../src/components/kompasid-paywall-body/KompasPaywallBody.ts"],"names":[],"mappings":"AAAA,qCAAqC;;AAErC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAQxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AA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E,CAAC;sEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mEAA4B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAW;AAC1B;IAAX,QAAQ,EAAE;0DAAyB;AAM3B;IAAR,KAAK,EAAE;+DAAmC;AAClC;IAAR,KAAK,EAAE;2DAAkD;AACjD;IAAR,KAAK,EAAE;6DAAsD;AACrD;IAAR,KAAK,EAAE;6DAAsD;AACrD;IAAR,KAAK,EAAE;4DAA4D;AAC3D;IAAR,KAAK,EAAE;8DAAwD;AACvD;IAAR,KAAK,EAAE;uDAAgD;AAC/C;IAAR,KAAK,EAAE;6DAA2C;AAC1C;IAAR,KAAK,EAAE;2DAAqC;AACpC;IAAR,KAAK,EAAE;yDAA0D;AACzD;IAAR,KAAK,EAAE;sDAAsB;AA9FnB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAwsC/B;SAxsCY,mBAAmB","sourcesContent":["/* eslint-disable no-return-assign */\n\nimport { html, css, LitElement, nothing } from 'lit'\nimport { property, state, customElement } from 'lit/decorators.js'\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\nimport {\n PaywallProduct,\n Product,\n Packages,\n PaymentImage,\n PaywallType,\n} from '../kompasid-paywall/types.js'\nimport { getFontAwesomeIcon } from '../../utils/fontawesome-setup.js'\nimport { deviceType } from '../../utils/deviceType.js'\nimport { formatRupiah } from '../../utils/formatRupiah.js'\nimport { addGoogleFonts } from '../../utils/googleFont.js'\nimport { redirectToRegister, redirectToLogin } from '../../utils/cta.js'\nimport { cryptos } from '../../utils/crypt.js'\n\n@customElement('kompasid-paywall-body')\nexport class KompasIdPaywallBody extends LitElement {\n static styles = [\n css`\n .wrapper-body {\n display: flex;\n flex-direction: column;\n justify-items: center;\n align-items: center;\n }\n\n .z-index-max {\n z-index: 999999;\n }\n\n .font-lora {\n font-family: 'Lora', 'Georgia', 'serif';\n }\n `,\n TWStyles,\n ]\n\n /**\n * Props\n */\n /**\n * prop slug untuk menghandle slug\n * prop isLogin untuk menghandle apakah user sudah login atau belum\n * prop type untuk menghandle tipe epaper\n * prop paywallData untuk menghandle data paywall\n * prop userGuid untuk menghandle user Guid\n * prop subscriptionStatus untuk menghandle status subscription user\n * prop countdownArticle untuk menghandle count artikel\n * prop swgEnable untuk menghandle swg apakah di aktifkan atau tidak\n * prop paywall_location = The location where user encounter the paywall\n * prop paywall_subscription_package = The name of the subscription package viewed by user\n * prop paywall_subscription_id = The ID of the subscription package viewed by user\n * prop paywall_subscription_price = The price of the subscriprtion package viewed by user\n * prop paywall_position = The position of the subscription package viewed by user\n * prop tracker_page_type = Type of the page\n * prop tracker_content_id = ID of article (slug)\n * prop tracker_content_type = Whether it's free article or paid article\n * prop tracker_content_title = The title of article\n * prop tracker_content_categories = The category of the content\n * prop tracker_user_type = Type of user based on their subscription\n * prop tracker_subscription_status = Status of their subscription\n * prop tracker_page_domain = Page Domain\n * prop tracker_metered_wall_type = The type of Metered Wall\n * prop tracker_metered_wall_balance = The balance of their metered wall\n * prop tracker_metered_wall_balance = The edition of epaper viewed by user\n * prop theme = The theme of the paywall component\n */\n\n @property({ type: String }) slug = ''\n @property({ type: Boolean }) isLogin = false\n @property({ type: String }) type: PaywallType = 'reguler'\n @property({ type: Object }) paywallData: PaywallProduct | undefined =\n undefined\n @property({ type: String }) userGuid = ''\n @property({ type: String }) subscriptionStatus = ''\n @property({ type: Number }) countdownArticle = 0\n @property({ type: Boolean }) swgEnable = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: Number }) paywall_subscription_id = 0\n @property({ type: Number }) paywall_subscription_price = 0\n @property({ type: Number }) paywall_position = 0\n @property({ type: String }) tracker_page_type = ''\n @property({ type: String }) tracker_content_id = ''\n @property({ type: String }) tracker_content_title = ''\n @property({ type: String }) tracker_content_categories = ''\n @property({ type: String }) tracker_content_type = ''\n @property({ type: String }) tracker_user_type = ''\n @property({ type: String }) tracker_subscription_status = ''\n @property({ type: String }) tracker_page_domain = ''\n @property({ type: String }) tracker_metered_wall_type = ''\n @property({ type: Number }) tracker_metered_wall_balance = 0\n @property({ type: String }) tracker_epaper_edition = ''\n @property({ type: String }) theme = ''\n @property() togglePaywall = () => {}\n\n /**\n * State\n */\n\n @state() private isExtensionsOpened = false\n @state() private kompasAkunHost = 'https://akun.kompas.id'\n @state() private kompasApigenHost = 'https://apigen.kompas.id'\n @state() private kompasApiWcmHost = 'https://apiwcm.kompas.id'\n @state() private kompasLoginHost = 'https://account.kompas.id/login'\n @state() private kompasApiSubsHost = 'https://apisubs.kompas.id'\n @state() private epaperHost = 'https://epaper.kompas.id'\n @state() private swgPublisherName = 'Harian Kompas'\n @state() private swgPublisherId = 'kompas.id'\n @state() private swgProductId = 'kompas.id:kompas_digital_premium'\n @state() private errorFlag = 0\n\n _packages!: Packages\n buttonElement!: HTMLButtonElement\n targetElement!: HTMLElement\n\n /**\n * Getter\n */\n\n get loginUrl() {\n return `${this.kompasLoginHost}?next=${encodeURIComponent(\n this.epaperHost + window.location.pathname\n )}&loc=hard_paywall`\n }\n\n get isDark() {\n return this.theme === 'dark'\n }\n\n get isEntitledForIntroductoryPrice(): boolean {\n return !this.isLogin || this.tracker_subscription_status === 'IA'\n }\n\n get packages(): Packages {\n return this._packages\n }\n\n /**\n * Logic Function\n */\n\n private redirectToCheckout(\n url: string,\n name: string,\n id: string,\n price: number,\n position: number\n ): void {\n this.sendDataLayeronButtonBuyPackage(name, id, price, position)\n const originHost: string = encodeURIComponent(window.location.href)\n let source: string\n\n switch (this.type) {\n case 'epaper':\n source = 'epaper'\n break\n case 'audio':\n source = 'news_audio'\n break\n default:\n source = 'article'\n }\n\n const directUrlCheckout: string = `${url}${originHost}&source=${source}`\n window.open(directUrlCheckout)\n }\n\n private redirectToPrevUrl(): void {\n window.history.back()\n }\n\n private redirectToSubscriber(): void {\n this.sendDataLayer()\n window.open('https://www.kompas.id/berlangganan')\n }\n\n private redirectToHelpdesk(): void {\n this.sendDataLayeronHelpDesk()\n window.open(\n 'https://api.whatsapp.com/send/?phone=6281290050800&text=Halo,%20saya%20perlu%20informasi%20mengenai%20kompas.id'\n )\n }\n\n private handleClickOutside() {\n if (this.targetElement?.classList.contains('wrapper-body')) {\n this.togglePaywall()\n }\n\n if (this.targetElement?.id === 'freeTrialPopup') {\n this.closeFreeTrialPopup()\n }\n }\n\n private parsePrice(price: string): number {\n const lowerCasePrice = price.toLowerCase()\n\n if (lowerCasePrice.startsWith('rp')) {\n return parseFloat(price.replace(/[^0-9,]/g, ''))\n }\n\n return parseFloat(price.replace(/[^0-9.]/g, ''))\n }\n\n private async getRegisterToken(path: string, payload: any): Promise<string> {\n return fetch(`${this.kompasApigenHost}/v1/user/register/token/${path}`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n },\n })\n .then(response => response.json())\n .then((data: any) => data.result.token)\n .catch(error => {\n throw error\n })\n }\n\n private async getUserToken(path: string, payload: any): Promise<string> {\n return fetch(`${this.kompasApigenHost}/v1/user/token/${path}`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n },\n })\n .then(response => response.json())\n .then((data: any) => data.result.token)\n .catch(error => {\n throw error\n })\n }\n\n private async getSubscriptionToken(\n path: string,\n payload: any\n ): Promise<string> {\n return fetch(`${this.kompasAkunHost}/api/subscription/login/${path}`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n },\n })\n .then(response => response.json())\n .then((data: any) => {\n this.errorFlag = 0\n return data.access_token\n })\n .catch(async error => {\n const errorCode = error.response.status\n if (errorCode === 500 && this.errorFlag < 5) {\n // eslint-disable-next-line no-plusplus\n this.errorFlag++\n setTimeout(async () => {\n await this.getSubscriptionToken(path, payload)\n }, 2000)\n } else {\n this.errorFlag = 0\n throw error\n }\n })\n }\n\n private async createSwG(payload: any) {\n const crypto = await cryptos()\n await fetch(`${this.kompasApiSubsHost}/membership/swg`, {\n method: 'POST',\n body: JSON.stringify(payload),\n headers: {\n 'content-type': 'application/json',\n 'x-signature': crypto.xSignature,\n datetime: crypto.datetime,\n },\n })\n .then(response => response.json())\n .catch(error => {\n throw error\n })\n }\n\n private subscribeWithGoogleButton(): any {\n // @ts-ignore\n // eslint-disable-next-line no-restricted-globals\n ;(self.SWG = self.SWG || []).push((subscriptions: any) => {\n // set entitlement\n subscriptions.setOnEntitlementsResponse(() => {\n // subscriptions attach button\n subscriptions.attachButton(\n this.buttonElement,\n { theme: 'light', lang: 'en' },\n async () => {\n subscriptions.showOffers({ isClosable: true })\n subscriptions.setOnLoginRequest(() => {\n window.location.href = this.loginUrl\n })\n const offers = await subscriptions.getOffers()\n subscriptions.setOnFlowStarted((callback: any) => {\n if (callback.flow === 'showOffers') {\n window.dataLayer.push(this.swgPackageViewedDataLayer(offers))\n } else if (callback.flow === 'subscribe') {\n const selectedOfferSkuId = callback.data.skuId\n const selectedOffer = offers.find(\n (offer: any) => offer.skuId === selectedOfferSkuId\n )\n window.dataLayer.push(\n this.swgSubscribeButtonClicked(\n selectedOffer,\n offers.indexOf(selectedOffer)\n )\n )\n }\n })\n subscriptions.setOnPaymentResponse(async (paymentResponse: any) => {\n const response = await paymentResponse\n const raw = JSON.parse(response.purchaseData.raw)\n const { productId, purchaseToken, packageName } = raw\n const { email } = response.userData.data\n const swgMembershipChannelId = 2\n const payload = {\n email,\n purchase_token: purchaseToken,\n product_id: productId,\n package_name: packageName,\n membershipChannelId: swgMembershipChannelId,\n }\n\n await this.createSwG(payload)\n response.complete().then(() => {\n window.location.href = this.loginUrl\n })\n })\n }\n )\n })\n })\n }\n\n private jsonScript() {\n const jsonData = {\n '@context': 'https://schema.org',\n '@type': ['WebSite', 'WebPage'],\n isAccessibleForFree: false,\n url: this.epaperHost + window.location.pathname,\n name: this.swgPublisherName,\n hasPart: {\n '@type': 'WebPageElement',\n },\n isPartOf: {\n '@type': ['CreativeWork', 'Product'],\n name: this.swgPublisherId,\n productID: this.swgProductId,\n },\n }\n const str = JSON.stringify(jsonData)\n const jsonScript = document.createElement('script')\n jsonScript.type = 'application/ld+json'\n jsonScript.text = str\n jsonScript.defer = true\n const jsonHead = document.querySelector('head')\n if (jsonHead) {\n jsonHead.appendChild(jsonScript)\n }\n }\n\n constructor() {\n super()\n this.handleClickOutside = this.handleClickOutside.bind(this)\n }\n\n protected createRenderRoot() {\n const root = super.createRenderRoot()\n root.addEventListener(\n 'click',\n (e: Event) => (this.targetElement = e.target as HTMLElement)\n )\n return root\n }\n\n override async connectedCallback() {\n this._packages = this.paywallData?.packages ?? ({} as Packages)\n\n super.connectedCallback()\n await this.updateComplete\n\n if (this.packages.swgEnable) {\n this.jsonScript()\n const appendSWGButton = () => {\n this.buttonElement = this.shadowRoot?.getElementById(\n 'subscribe-with-google'\n ) as HTMLButtonElement\n if (this.buttonElement) {\n const head = document.querySelector('head')\n const script = document.createElement('script')\n script.src = 'https://news.google.com/swg/js/v1/swg.js'\n script.defer = true\n script.onload = this.subscribeWithGoogleButton()\n if (head) {\n head.appendChild(script)\n }\n }\n }\n setTimeout(appendSWGButton, 500)\n }\n addGoogleFonts(['pt-sans', 'lora'])\n document.addEventListener('click', this.handleClickOutside)\n }\n\n override async disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener('click', this.handleClickOutside)\n }\n\n private otherPackagesClicked() {\n this.sendDataLayerOtherPackagesClicked()\n this.redirectToSubscriber()\n }\n\n private customerServiceClicked() {\n this.sendDataLayerCustomerServiceClicked()\n this.redirectToHelpdesk()\n }\n\n /**\n * Data Layer\n */\n\n private buildGtmParams(\n event: string,\n impressions: Record<string, any>[],\n index: number = 0\n ) {\n const gtmParams: Record<string, any> = {\n event,\n impressions: impressions.map((impression, i) => ({\n paywall_location: this.paywall_location || '',\n paywall_subscription_package: impression.package,\n paywall_subscription_id: impression.subscription_id,\n paywall_subscription_price: this.parsePrice(impression.price),\n paywall_position: index + i + 1,\n user_type: this.tracker_user_type,\n subscription_status: this.tracker_subscription_status,\n page_domain: this.tracker_page_domain || 'Kompas.id',\n metered_wall_type: this.tracker_metered_wall_type || 'HP',\n metered_wall_balance: this.tracker_metered_wall_balance,\n ...(this.type === 'epaper'\n ? { epaper_edition: this.tracker_epaper_edition }\n : {\n page_type: this.tracker_page_type,\n content_id: this.tracker_content_id,\n content_title: this.tracker_content_title,\n content_categories: this.tracker_content_categories,\n content_type: this.tracker_content_type,\n }),\n })),\n }\n\n return gtmParams\n }\n\n private generalPaywallDataLayer(event: string): Record<string, any> {\n const packages = this.paywallData?.packages ?? ({} as Packages)\n\n const impressions = packages.memberships.map(membership => ({\n package: membership.package,\n subscription_id: membership.subscriptionId,\n price: membership.price.toString(),\n }))\n\n return this.buildGtmParams(event, impressions)\n }\n\n private sendDataLayer(): void {\n window.dataLayer.push({\n event: 'halamanBerlanggananClick',\n subscriptionStatus: '',\n GUID: '',\n interface: deviceType(),\n })\n }\n\n private sendDataLayeronHelpDesk(): void {\n window.dataLayer.push({\n event: 'helpOfferClick',\n userType: this.subscriptionStatus,\n GUID: this.userGuid,\n interface: deviceType(),\n })\n }\n\n private sendDataLayeronButtonBuyPackage(\n name: string,\n id: string,\n price: number,\n position: number\n ): void {\n const gtmParams: Record<string, any> = {\n event: 'subscribe_button_clicked',\n paywall_location: this.paywall_location,\n paywall_subscription_package: name,\n paywall_subscription_id: id,\n paywall_subscription_price: price,\n paywall_position: position,\n user_type: this.tracker_user_type,\n subscription_status: this.tracker_subscription_status,\n page_domain: this.tracker_page_domain || 'Kompas.id',\n metered_wall_type: this.tracker_metered_wall_type || 'HP',\n metered_wall_balance: this.tracker_metered_wall_balance,\n }\n\n if (this.type !== 'epaper') {\n gtmParams.content_title = this.tracker_content_title\n gtmParams.content_id = this.tracker_content_id\n gtmParams.content_categories = this.tracker_content_categories\n gtmParams.content_type = this.tracker_content_type\n gtmParams.page_type = this.tracker_page_type\n } else {\n gtmParams.epaper_edition = this.tracker_epaper_edition\n }\n\n window.dataLayer.push(gtmParams)\n }\n\n private sendDataLayeronPaywallBody(): void {\n const gtmParams = this.generalPaywallDataLayer('paywall_viewed')\n window.dataLayer.push(gtmParams)\n }\n\n private sendDataLayerOtherPackagesClicked(): void {\n const gtmParams = this.generalPaywallDataLayer('other_packages_clicked')\n window.dataLayer.push(gtmParams)\n }\n\n private sendDataLayerCustomerServiceClicked(): void {\n const gtmParams = this.generalPaywallDataLayer('customer_service_clicked')\n window.dataLayer.push(gtmParams)\n }\n\n private swgPackageViewedDataLayer(data: any): Record<string, any> {\n const impressions = data.map(\n (item: {\n title: string\n skuId: string\n price: string\n introductoryPrice: string\n }) => ({\n package: item.title,\n subscription_id: item.skuId,\n price: item.introductoryPrice || item.price,\n })\n )\n\n return this.buildGtmParams('subscription_package_viewed', impressions)\n }\n\n private swgSubscribeButtonClicked(item: any, index: number) {\n const gtmParams: any = {\n event: 'subscribe_button_clicked',\n paywall_location: this.paywall_location || '',\n paywall_subscription_package: item.title,\n paywall_subscription_id: item.skuId,\n paywall_subscription_price: this.parsePrice(\n item.introductoryPrice || item.price\n ),\n paywall_position: index + 1,\n user_type: this.tracker_user_type,\n subscription_status: this.tracker_subscription_status,\n page_domain: this.tracker_page_domain || 'Kompas.id',\n metered_wall_type: this.tracker_metered_wall_type || 'HP',\n metered_wall_balance: this.tracker_metered_wall_balance,\n }\n\n if (this.type === 'epaper') {\n gtmParams.epaper_edition = this.tracker_epaper_edition\n } else {\n gtmParams.page_type = this.tracker_page_type\n gtmParams.content_id = this.tracker_content_id\n gtmParams.content_title = this.tracker_content_title\n gtmParams.content_categories = this.tracker_content_categories\n gtmParams.content_type = this.tracker_content_type\n }\n\n return gtmParams\n }\n\n /**\n * Component\n */\n\n private headerSection(type: PaywallType, title: string) {\n let buttonContent\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n const isPrevHistoryExist = window.history.length > 1\n\n if (type === 'epaper' && isPrevHistoryExist) {\n buttonContent = html` <button\n @click=${this.redirectToPrevUrl}\n class=\"hidden md:block w-8 h-8 pl-4 ${textColorClass}\"\n >\n ${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left'))}\n </button>`\n } else if (type === 'audio') {\n buttonContent = html` <button\n @click=${this.togglePaywall}\n class=\"hidden md:block w-8 h-8 pl-4 ${textColorClass}\"\n >\n ${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}\n </button>`\n } else {\n buttonContent = nothing\n }\n\n const headerClass = `text-base flex justify-center self-center md:block md:text-xl ${buttonTextColorClass} text-center font-lora font-bold tracking-wide md:tracking-normal max-w-xs sm:max-w-lg md:w-full md:max-w-full ${\n type === 'audio' && 'sm:px-16 md:px-20'\n }`\n\n return html`\n <div class=\"flex w-full items-start justify-center\">\n ${buttonContent}\n <h4 class=${headerClass}>${title}</h4>\n ${type === 'epaper' || type === 'audio'\n ? html`<div class=\"w-10 hidden md:flex\"></div>`\n : nothing}\n </div>\n `\n }\n\n private descriptionSection(data: Array<string>) {\n const spaceYClass =\n this.type === 'audio' ? 'space-y-2 md:space-y-1' : 'space-y-2'\n const textColorClass = this.isDark ? 'text-green-400' : 'text-green-500'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n return html` <div class=\" flex flex-col items-center\">\n <div class=\"flex flex-col md:max-w-[464px] mt-2.5 md:mt-3 ${spaceYClass}\">\n ${data.map(\n item =>\n html`\n <div class=\"flex items-center\">\n <div class=\"${textColorClass}\">\n ${unsafeSVG(getFontAwesomeIcon('fas', 'check', 12, 12))}\n </div>\n <h6\n class=\"text-xs md:text-base ml-0.5 md:ml-1 ${buttonTextColorClass}\"\n >\n ${item}\n </h6>\n </div>\n `\n )}\n </div>\n </div>`\n }\n\n private informationPackages() {\n const marginTopClass = this.type === 'audio' ? 'mt-4 md:mt-2' : 'mt-4'\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n\n return html` <div class=\"flex justify-center ${marginTopClass}\">\n <button\n @click=${this.otherPackagesClicked}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Lihat Paket Lainnya\n </button>\n </div>`\n }\n\n private epaperRegistrationSection() {\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n return html`\n <div>\n <button\n @click=${() =>\n redirectToLogin({\n loc: 'hard_paywall',\n next: this.epaperHost + window.location.pathname,\n })}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Masuk\n </button>\n <span class=\"${buttonTextColorClass}\">jika sudah berlangganan.</span>\n </div>\n `\n }\n\n private regulerRegistrationSection() {\n const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'\n const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'\n\n return html`\n <div class=\"flex flex-col items-center justify-center\">\n <div>\n <button\n @click=${() => redirectToRegister('hard_paywall')}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Daftar\n </button>\n <span class=\"${buttonTextColorClass}\"\n >untuk kuota artikel gratis</span\n >\n </div>\n <div>\n <span class=\"${buttonTextColorClass}\">atau</span>\n <button\n @click=${() => redirectToLogin({ loc: 'hard_paywall' })}\n class=\"text-sm md:text-base font-bold underline ${textColorClass}\"\n >\n Masuk\n </button>\n <span class=\"${buttonTextColorClass}\">jika sudah punya akun.</span>\n </div>\n </div>\n `\n }\n\n private registrationSection(type: PaywallType) {\n return type === 'epaper'\n ? this.epaperRegistrationSection()\n : this.regulerRegistrationSection()\n }\n\n private paymentMobileExtension(data: Array<PaymentImage>) {\n return html`\n <div\n class=\"w-full max-w-xs mb-1 ml-8 md:hidden absolute px-4 ${this.isDark\n ? '-bottom-6'\n : 'bottom-0'}\"\n >\n <div\n class=\"w-full rounded p-3 max-w-xs ${this.isDark\n ? 'bg-dark-6 border-dark-6'\n : 'bg-white border-white'}\"\n >\n <svg\n class=\"right-0 h-4 mr-10 -mt-7 z-0 transform rotate-180 absolute ${this\n .isDark\n ? 'text-dark-6 border-dark-6'\n : 'text-white border-white '}\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 255 255\"\n >\n <polygon class=\"fill-current\" points=\"0,0 127.5,127.5 255,0\" />\n </svg>\n <div\n class=\"grid place-items-center items-center grid-flow-row grid-cols-5 grid-rows-2 gap-y-4\"\n >\n ${data.map(\n item =>\n html`<img\n class=\"object-cover\"\n src=${item.link}\n alt=\"${item.name}-logo-payment\"\n />`\n )}\n </div>\n </div>\n </div>\n `\n }\n\n private primaryPackages(product: Product) {\n const { isDark } = this\n const isAudio = this.type === 'audio'\n\n const containerClass = `flex flex-wrap justify-between h-[68px] items-center rounded-lg md:mx-0 w-full max-w-xs md:max-w-sm md:w-3/5 mt-2.5${\n isDark ? ' bg-grey-600' : ' bg-white'\n }${isAudio ? ' md:mt-3' : ' md:mt-4'} border border-yellow-400 relative`\n\n const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600'\n\n const buttonClass = `h-8 rounded mr-4 flex items-center${\n isDark ? ' bg-green-300 border border-green-400' : ' bg-green-500'\n }`\n\n const buttonTextClass = `text-xs md:text-sm font-bold py-2 px-4${\n isDark ? ' text-black' : ' text-white'\n }`\n\n return html`\n <div class=\"${containerClass}\">\n <div class=\"flex flex-col py-3 px-4\">\n <div class=\"flex flex-none items-center\">\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">\n ${formatRupiah(product.price)}\n </h5>\n <h6 class=\"text-xs md:text-base font-bold pl-1 ${textColorClass}\">\n / ${product.periode}\n </h6>\n </div>\n ${product.savingPrice\n ? html`\n <div class=\"flex items-center\">\n <p class=\"text-xs ${textColorClass}\">\n hanya\n <span class=\"text-orange-400\"\n >${formatRupiah(product.savingPrice)}</span\n >\n / bulan\n </p>\n </div>\n `\n : nothing}\n </div>\n <button\n class=\"${buttonClass}\"\n @click=${() =>\n this.redirectToCheckout(\n product.url,\n product.package,\n product.subscriptionId,\n product.price,\n product.position\n )}\n >\n <h6 class=\"${buttonTextClass}\">Langganan</h6>\n </button>\n <div class=\"absolute -top-2 left-4\">\n <div class=\"rounded bg-yellow-300 px-2 py-0.5 text-xs\">\n <b class=\"text-grey-600\">Harga Terbaik</b>\n </div>\n </div>\n </div>\n `\n }\n\n private secondaryPackages(product: Product) {\n const { isDark } = this\n const isAudio = this.type === 'audio'\n\n const containerClass = `flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${\n isDark ? ' bg-grey-600' : ' bg-white'\n }${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`\n\n const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600'\n\n const buttonClass = `h-8 rounded border border-green-500${\n isDark ? ' text-green-300' : ' bg-white text-green-500'\n }`\n\n const buttonTextClass = `text-xs md:text-sm font-bold px-4${\n isDark ? ' text-green-300' : ' text-green-500'\n }`\n\n return html`\n <div class=\"${containerClass}\">\n <div class=\"flex flex-col\">\n <div class=\"flex items-center\">\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">\n ${formatRupiah(product.price)}\n </h5>\n <h6 class=\"text-xs md:text-base font-bold pl-1 ${textColorClass}\">\n / ${product.periode}\n </h6>\n </div>\n ${product.savingPrice\n ? html`\n <div class=\"flex items-center\">\n <p class=\"text-xs ${textColorClass}\">\n hanya\n <span class=\"text-orange-400\"\n >${formatRupiah(product.savingPrice)}</span\n >\n / bulan\n </p>\n </div>\n `\n : nothing}\n </div>\n <button\n @click=${() =>\n this.redirectToCheckout(\n product.url,\n product.package,\n product.subscriptionId,\n product.price,\n product.position\n )}\n class=\"${buttonClass}\"\n >\n <h6 class=\"${buttonTextClass}\">Langganan</h6>\n </button>\n </div>\n `\n }\n\n private packagesSection(data: Packages) {\n return html`\n <div class=\"flex flex-col w-full items-center mt-8 md:mt-2 px-4\">\n ${data.memberships.map(item =>\n item.isHighlight\n ? this.primaryPackages(item)\n : this.secondaryPackages(item)\n )}\n ${this.freeTrialPackageSection()} ${this.freeTrialPopUp()}\n ${this.packages.swgEnable ? this.swgPackageSection() : nothing}\n </div>\n `\n }\n\n private topNavigator(type: PaywallType) {\n let icon: string\n let buttonText: string\n let clickAction: Function\n\n if (type === 'audio') {\n icon = getFontAwesomeIcon('fas', 'xmark')\n buttonText = 'Tutup'\n clickAction = this.togglePaywall.bind(this)\n } else {\n icon = getFontAwesomeIcon('fas', 'arrow-left')\n buttonText = 'Kembali'\n clickAction = this.redirectToPrevUrl.bind(this)\n }\n\n return html`\n <div class=\"flex md:hidden w-full pb-4\">\n <button\n @click=${clickAction}\n class=\"text-xs md:text-lg text-white flex flex-row\"\n >\n <div class=\"icon-lg icon-white w-4 h-4 mr-3.5 md:mr-5 pt-0.5\">\n ${unsafeSVG(icon)}\n </div>\n ${buttonText}\n </button>\n </div>\n `\n }\n\n private helpDesk() {\n const textColorClass = this.isDark ? 'text-dark-7' : 'text-white'\n\n return html`\n <div class=\"self-center text-xs md:text-sm ${textColorClass}\">\n Butuh bantuan? Hubungi\n <button\n @click=${this.customerServiceClicked}\n class=\"font-bold underline\"\n >\n Layanan Pelanggan.\n </button>\n </div>\n `\n }\n\n private userAction() {\n const isAudio = this.type === 'audio'\n const paddingClass = isAudio ? 'md:py-3.5' : 'md:py-6'\n const marginClass = isAudio ? 'md:mt-4' : 'md:mt-8'\n const backgroundClass = this.isDark ? 'bg-dark-4' : 'bg-blue-600'\n\n return html`\n <div\n class=\"flex py-5 px-8 w-full justify-evenly rounded-b-xl mt-6 relative ${paddingClass} ${marginClass} ${backgroundClass}\"\n >\n ${this.helpDesk()}\n </div>\n `\n }\n\n private introductoryPrice() {\n const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600'\n return html` <div\n class=\"flex space-x-1 h-5 md:h-max overflow-hidden md:flex-col md:space-x-0 items-center md:items-start md:justify-center\"\n >\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">Rp 10.000</h5>\n <p class=\"text-xs ${textColorClass}\">untuk 1 bulan pertama</p>\n </div>`\n }\n\n private swgRegonText() {\n const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600'\n return html`<p class=\"text-xs leading-4 md:max-w-[137px] ${textColorClass}\">\n Berlangganan lebih mudah dengan Google\n </p>`\n }\n\n private swgPackageSection() {\n const { isDark } = this\n const isAudio = this.type === 'audio'\n\n const containerClass = `flex flex-col space-y-2 md:space-x-2 md:space-y-0 md:flex-row justify-between items-center py-3 px-4 rounded-lg md:mx-0 w-full h-[76px] md:h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${\n isDark ? ' bg-grey-600' : ' bg-white'\n }${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`\n\n const buttonClass = `border space-x-2 justify-center border-grey-400 rounded-md px-[22px] md:px-6 shadow-sm flex h-max flex-row flex-nowrap py-[5.6px] md:py-1.5 items-center${\n isDark ? ' bg-grey-600' : ' bg-grey-100 border-grey-100'\n }`\n\n const textColorClass = isDark ? 'text-dark-7' : 'text-grey-500'\n\n const googleImageSrc = isDark\n ? 'https://cdn-www.kompas.id/paywall-asset/google-white.png'\n : 'https://cdn-www.kompas.id/paywall-asset/google.png'\n\n return html`\n <div class=\"${containerClass}\">\n ${this.isEntitledForIntroductoryPrice\n ? this.introductoryPrice()\n : this.swgRegonText()}\n <div>\n <button class=\"${buttonClass}\" id=\"subscribe-with-google\">\n <p\n class=\"text-[11px] md:text-xs whitespace-nowrap w-full ${textColorClass}\"\n >\n Subscribe with\n </p>\n <img\n class=\"object-scale-down h-[17px] md:h-5\"\n src=${googleImageSrc}\n alt=\"subscribe with google\"\n />\n </button>\n </div>\n </div>\n `\n }\n\n private openFreeTrialPopup() {\n const popup = this.shadowRoot?.getElementById('freeTrialPopup')\n popup?.classList.remove('hidden')\n }\n\n private closeFreeTrialPopup() {\n const popup = this.shadowRoot?.getElementById('freeTrialPopup')\n popup?.classList.add('hidden')\n }\n\n private freeTrialPopUp() {\n const { isDark } = this\n\n const googlePlayBadgeSrc = isDark\n ? 'https://cdn-www.kompas.id/web-component/Button_Download%20Google%20Play_Dark%20Mode.svg'\n : 'https://cdn-www.kompas.id/web-component/Button_Download%20Google%20Play_Light%20Mode.svg'\n\n const appStoreBadgeSrc = isDark\n ? 'https://cdn-www.kompas.id/web-component/Button_Download%20App%20Store_Dark%20Mode.svg'\n : 'https://cdn-www.kompas.id/web-component/Button_Download%20App%20Store_Light%20Mode.svg'\n\n return html`\n <div\n id=\"freeTrialPopup\"\n class=\"fixed w-full h-full inset-0 flex justify-center items-center z-50 bg-black bg-opacity-75 hidden\"\n >\n <div\n class=\"rounded w-11/12 sm:w-3/4 md:w-1/2 lg:w-1/3 2xl:w-1/4 p-6 text-center ${isDark\n ? 'bg-dark-4'\n : 'bg-white'}\"\n >\n <div class=\"w-full flex justify-end px-2\">\n <button\n @click=${this.closeFreeTrialPopup}\n class=\"w-8 h-8 pl-4 ${isDark ? 'text-grey-300' : 'text-grey-400'}\"\n >\n ${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}\n </button>\n </div>\n <div class=\"w-full flex justify-center\">\n <div class=\"w-3/4 lg:w-1/2\">\n <img\n src=\"https://cdn-www.kompas.id/web-component/kompas-free-trial.png\"\n alt=\"Free Trial\"\n />\n </div>\n </div>\n <p\n class=\"font-bold text-lg mt-4 ${isDark\n ? 'text-white'\n : 'text-grey-600'}\"\n >\n Coba Gratis Kompas.id di Aplikasi\n </p>\n <div\n class=\"hidden lg:block lg:flex flex rounded mt-4 px-8 py-4 items-center ${isDark\n ? 'bg-dark-3 border border-dark-9'\n : 'bg-white border border-grey-300'}\"\n >\n <div class=\"w-1/3 flex mr-6\">\n <img\n src=\"https://cdn-www.kompas.id/web-component/free-trial-qr-code.png\"\n alt=\"QR Code Deep Link\"\n />\n </div>\n <div\n class=\"w-2/3 text-base text-left ${isDark\n ? 'text-dark-7'\n : 'text-grey-600'}\"\n >\n ${this.packages.freeTrial?.desktopText}\n </div>\n </div>\n <div\n class=\"text-base text-center lg:hidden px-2 md:px-8 ${isDark\n ? 'text-dark-7'\n : 'text-grey-600'}\"\n >\n ${this.packages.freeTrial?.mobileText}\n </div>\n <div class=\"lg:flex flex justify-center mt-4 hidden lg:block gap-4\">\n <a\n href=\"https://play.google.com/store/apps/details?id=id.kompas.app\"\n target=\"_blank\"\n ><img src=\"${googlePlayBadgeSrc}\" alt=\"Google Play Badge\"\n /></a>\n <a\n href=\"https://apps.apple.com/id/app/kompas-id/id1242195037?l=id\"\n target=\"_blank\"\n ><img src=\"${appStoreBadgeSrc}\" alt=\"iOS App Store Badge\"\n /></a>\n </div>\n <button\n onclick=\"window.open('https://app.komp.as/langganan', '_blank')\"\n class=\"h-12 rounded-md mt-4 flex w-full items-center justify-center lg:hidden ${isDark\n ? 'bg-green-300'\n : 'bg-green-500'}\"\n >\n <h6 class=\"font-bold p-4 ${isDark ? 'text-dark-5' : 'text-white'}\">\n Unduh Sekarang\n </h6>\n </button>\n </div>\n </div>\n `\n }\n\n private freeTrialPackageSection() {\n if (this.packages.freeTrial) {\n return html`\n <div\n class=\"flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3 md:mt-4 ${this\n .isDark\n ? 'bg-grey-600'\n : 'bg-white'}\"\n >\n <div class=\"flex flex-col\">\n <div class=\"flex items-center\">\n <h5 class=\"text-base md:text-lg font-bold text-orange-400\">\n ${formatRupiah(0)}\n </h5>\n </div>\n <div class=\"flex items-center\">\n <p\n class=\"text-xs ${this.isDark ? 'text-dark-7' : 'text-grey-600'}\"\n >\n ${this.packages.freeTrial?.packageText}\n </p>\n </div>\n </div>\n <button\n @click=${this.openFreeTrialPopup}\n class=\"h-8 border border-green-500 rounded ${!this.isDark &&\n 'bg-white'}\"\n >\n <h6\n class=\"text-xs md:text-sm font-bold px-4 ${this.isDark\n ? 'text-green-300'\n : 'text-green-500'}\"\n >\n Coba Gratis\n </h6>\n </button>\n </div>\n `\n }\n return nothing\n }\n\n /**\n * Render Statement\n */\n\n render() {\n const isEpaper = this.type === 'epaper'\n const isAudio = this.type === 'audio'\n const { isDark } = this\n const { isLogin } = this\n\n const wrapperBodyClass = `wrapper-body\n ${isEpaper ? 'bg-transparent mx-2' : ''}\n ${\n isAudio\n ? 'fixed w-full h-full inset-0 flex justify-center items-center z-index-max bg-black bg-opacity-75'\n : ''\n }`\n .trim()\n .replace(/\\s+/g, ' ')\n\n const containerClass = `flex w-full flex-col items-center justify-center rounded-xl pt-6 relative ${\n isDark ? 'bg-dark-3' : 'bg-blue-100'\n } ${isAudio ? 'md:pt-5' : 'md:pt-8'}`\n\n const borderClass = isDark ? 'border-dark-8' : 'border-blue-200'\n\n return html`\n <div class=\"${wrapperBodyClass}\">\n <div\n class=\"flex flex-col justify-center items-center w-full max-w-screen-sm my-5 px-2 relative\"\n >\n ${isEpaper || isAudio ? this.topNavigator(this.type) : nothing}\n <div class=\"${containerClass}\">\n ${this.headerSection(\n this.type,\n this.paywallData?.informations?.title ?? ''\n )}\n ${this.descriptionSection(\n this.paywallData?.informations?.description ?? []\n )}\n ${this.packagesSection(\n this.paywallData?.packages ?? ({} as Packages)\n )}\n ${this.informationPackages()}\n ${!isLogin\n ? html`\n <div\n class=\"border-b w-1/5 flex justify-center ${borderClass} ${isAudio\n ? 'my-4 md:my-3'\n : 'my-4'}\"\n ></div>\n ${this.registrationSection(this.type)}\n `\n : nothing}\n ${this.userAction()} ${this.sendDataLayeronPaywallBody()}\n </div>\n ${this.isExtensionsOpened\n ? this.paymentMobileExtension(\n this.paywallData?.payment?.ekstension ?? []\n )\n : nothing}\n </div>\n </div>\n `\n }\n}\n"]}
|
|
@@ -23,10 +23,6 @@ export declare class KompasWidgetRecirculationsDefault extends LitElement {
|
|
|
23
23
|
relatedArticles(): Promise<void>;
|
|
24
24
|
otherArticles(): Promise<void>;
|
|
25
25
|
handleFetchError(error: unknown): void;
|
|
26
|
-
/**
|
|
27
|
-
* Function to format date
|
|
28
|
-
*/
|
|
29
|
-
formatDate(date: string): string;
|
|
30
26
|
/**
|
|
31
27
|
* Render widget components
|
|
32
28
|
*/
|