@kompasid/lit-web-components 0.1.0 → 0.2.0

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.
Files changed (32) hide show
  1. package/.github/workflows/npm-publish.yml +5 -5
  2. package/README.md +44 -13
  3. package/assets/kompas-icon.svg +362 -0
  4. package/demo/index.html +2 -0
  5. package/dist/assets/font-awesome.d.ts +2 -2
  6. package/dist/src/components/kompas-footer/KompasFooter.d.ts +1 -1
  7. package/dist/src/components/kompas-footer/KompasFooter.js +1 -1
  8. package/dist/src/components/kompas-footer/KompasFooter.js.map +1 -1
  9. package/dist/src/components/kompas-metered-paywall/KompasMeteredPaywall.d.ts +1 -1
  10. package/dist/src/components/kompas-metered-paywall/KompasMeteredPaywall.js.map +1 -1
  11. package/dist/src/components/kompas-paywall/KompasPaywall.d.ts +1 -1
  12. package/dist/src/components/kompas-paywall/KompasPaywall.js.map +1 -1
  13. package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.d.ts +2 -1
  14. package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.js +9 -2
  15. package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.js.map +1 -1
  16. package/dist/src/components/kompas-paywall-body/KompasPaywallBody.d.ts +1 -1
  17. package/dist/src/components/kompas-paywall-body/KompasPaywallBody.js.map +1 -1
  18. package/dist/src/components/kompas-paywall-information-header/KompasPaywallInformationHeader.d.ts +1 -1
  19. package/dist/src/components/kompas-paywall-information-header/KompasPaywallInformationHeader.js.map +1 -1
  20. package/dist/src/components/kompas-paywall-video/KompasPaywallVideo.d.ts +2 -4
  21. package/dist/src/components/kompas-paywall-video/KompasPaywallVideo.js +7 -12
  22. package/dist/src/components/kompas-paywall-video/KompasPaywallVideo.js.map +1 -1
  23. package/dist/tailwind/tailwind.js +1343 -1368
  24. package/dist/tailwind/tailwind.js.map +1 -1
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +3 -3
  27. package/src/components/kompas-footer/KompasFooter.ts +1 -1
  28. package/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.ts +10 -2
  29. package/src/components/kompas-paywall-video/KompasPaywallVideo.ts +7 -6
  30. package/tailwind/tailwind.css +0 -9
  31. package/tailwind/tailwind.ts +1344 -1368
  32. package/tsconfig.json +1 -0
@@ -28,9 +28,7 @@ let KompasPaywallVideo = class KompasPaywallVideo extends LitElement {
28
28
  * prop metered_wall_type = The type of Metered Wall
29
29
  * prop metered_wall_balance = The balance of their metered wall
30
30
  */
31
- this.loginUrl = 'https://account.kompas.id/login';
32
31
  this.subscriptionUrl = 'https://www.kompas.id/berlangganan';
33
- this.registerUrl = 'https://account.kompas.id/register';
34
32
  this.isLogin = false;
35
33
  this.paywall_location = '';
36
34
  this.paywall_subscription_package = '';
@@ -135,7 +133,7 @@ let KompasPaywallVideo = class KompasPaywallVideo extends LitElement {
135
133
  </h5>
136
134
  <div class="flex justify-center mt-4 space-x-3">
137
135
  <button
138
- @click=${() => this.redirectToLogin('Masuk')}
136
+ @click=${() => this.redirectToRegister('Masuk')}
139
137
  class="rounded text-sm text-white px-4 py-1.5 ring-1 ring-grey-100"
140
138
  >
141
139
  Masuk
@@ -152,7 +150,7 @@ let KompasPaywallVideo = class KompasPaywallVideo extends LitElement {
152
150
  >
153
151
  Dapatkan 5 konten premium gratis tiap bulan!
154
152
  <button
155
- @click=${() => this.redirectToLogin('Coba Sekarang')}
153
+ @click=${() => this.redirectToRegister('Coba Sekarang')}
156
154
  target="_blank"
157
155
  class="text-blue-300 font-bold cursor-pointer"
158
156
  >
@@ -162,9 +160,12 @@ let KompasPaywallVideo = class KompasPaywallVideo extends LitElement {
162
160
  </div>
163
161
  `;
164
162
  }
165
- redirectToLogin(triggerClick) {
163
+ redirectToRegister(triggerClick) {
166
164
  this.sendDataLayeronButtonLogin(triggerClick);
167
- window.open(this.loginUrl, '_blank');
165
+ const registerHost = 'https://account.kompas.id/register';
166
+ const nextParams = encodeURIComponent(window.location.href);
167
+ const directUrlRegister = `${registerHost}?next=${nextParams}?status=sukses_login&status_login=login`;
168
+ window.open(directUrlRegister, '_blank');
168
169
  }
169
170
  redirectToBerlangganan() {
170
171
  this.sendDataLayeronButtonBerlangganan();
@@ -181,15 +182,9 @@ let KompasPaywallVideo = class KompasPaywallVideo extends LitElement {
181
182
  }
182
183
  };
183
184
  KompasPaywallVideo.styles = [css ``, TWStyles];
184
- __decorate([
185
- state()
186
- ], KompasPaywallVideo.prototype, "loginUrl", void 0);
187
185
  __decorate([
188
186
  state()
189
187
  ], KompasPaywallVideo.prototype, "subscriptionUrl", void 0);
190
- __decorate([
191
- state()
192
- ], KompasPaywallVideo.prototype, "registerUrl", void 0);
193
188
  __decorate([
194
189
  property({ type: Boolean })
195
190
  ], KompasPaywallVideo.prototype, "isLogin", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"KompasPaywallVideo.js","sourceRoot":"","sources":["../../../../src/components/kompas-paywall-video/KompasPaywallVideo.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAG/C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QAGL;;WAEG;QACH;;;;;;;;;;;;;;;;;WAiBG;QAEc,aAAQ,GAAW,iCAAiC,CAAA;QACpD,oBAAe,GAC9B,oCAAoC,CAAA;QACrB,gBAAW,GAAW,oCAAoC,CAAA;QAE9C,YAAO,GAAG,KAAK,CAAA;QAChB,qBAAgB,GAAG,EAAE,CAAA;QACrB,iCAA4B,GAAG,EAAE,CAAA;QACjC,4BAAuB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;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wEAAkC;AACjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mEAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAAwB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAAgC;AAC/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wEAAiC;AA7CjD,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA0L9B","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport { html, css, LitElement } from 'lit'\nimport { property, customElement, state } from 'lit/decorators.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\nimport { deviceType } from '../../utils/deviceType.js'\n\n@customElement('kompas-paywall-video')\nexport class KompasPaywallVideo extends LitElement {\n static styles = [css``, TWStyles]\n\n /**\n * Props\n */\n /**\n * prop isLogin untuk menghandle apakah user sudah login atau belum\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 page_type = Type of the page\n * prop content_id = ID of article (slug)\n * prop content_type = Whether it's free article or paid article\n * prop content_title = The title of article\n * prop tracker_content_categories = The category of the content\n * prop user_type = Type of user based on their subscription\n * prop subscription_status = Status of their subscription\n * prop page_domain = Page Domain\n * prop metered_wall_type = The type of Metered Wall\n * prop metered_wall_balance = The balance of their metered wall\n */\n\n @state() private loginUrl: string = 'https://account.kompas.id/login'\n @state() private subscriptionUrl: string =\n 'https://www.kompas.id/berlangganan'\n @state() private registerUrl: string = 'https://account.kompas.id/register'\n\n @property({ type: Boolean }) isLogin = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: String }) paywall_subscription_id = ''\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\n private isLoginComponent() {\n return html`\n <div>\n ${this.sendDataLayeronBerlangganan()}\n <h5\n class=\"leading-6 text-white text-center text-base md:text-xl max-w-2xl\"\n >\n Akses konten premium Anda bulan ini sudah habis. Aktifkan langganan\n untuk akses tanpa batas, mulai dari\n <span class=\"font-bold\">Rp50.000/bulan.</span>\n </h5>\n <div class=\"flex justify-between mt-4\">\n <button\n @click=${() => this.redirectToBerlangganan()}\n class=\"bg-green-500 rounded px-4 py-1.5 text-sm text-white font-bold\"\n >\n Berlangganan\n </button>\n </div>\n </div>\n `\n }\n\n private defaultComponent() {\n return html`\n <div>\n ${this.sendDataLayeronNonLogin()} ${this.sendDataLayeronBerlangganan()}\n <h5\n class=\"leading-6 text-white text-center text-base md:text-xl max-w-xl\"\n >\n Langganan untuk akses ke seluruh konten premium, mulai dari\n <span class=\"font-bold\">Rp50.000/bulan.</span>\n </h5>\n <div class=\"flex justify-center mt-4 space-x-3\">\n <button\n @click=${() => this.redirectToLogin('Masuk')}\n class=\"rounded text-sm text-white px-4 py-1.5 ring-1 ring-grey-100\"\n >\n Masuk\n </button>\n <button\n @click=${() => this.redirectToBerlangganan()}\n class=\"bg-green-500 rounded px-4 py-1.5 text-sm text-white font-bold\"\n >\n Berlangganan\n </button>\n </div>\n <p\n class=\"text-center text-sm leading-4 text-white mt-6 max-w-xs md:max-w-none\"\n >\n Dapatkan 5 konten premium gratis tiap bulan!\n <button\n @click=${() => this.redirectToLogin('Coba Sekarang')}\n target=\"_blank\"\n class=\"text-blue-300 font-bold cursor-pointer\"\n >\n Coba Sekarang\n </button>\n </p>\n </div>\n `\n }\n\n private sendDataLayeronNonLogin = (): void => {\n window.dataLayer.push({\n event: 'registrationOfferimppression',\n interface: deviceType(),\n })\n }\n\n private sendDataLayeronBerlangganan = (): void => {\n window.dataLayer.push({\n event: 'paywall_viewed',\n paywall_location: this.paywall_location,\n paywall_subscription_package: this.paywall_subscription_package,\n paywall_subscription_id: this.paywall_subscription_id,\n paywall_subscription_price: this.paywall_subscription_price,\n paywall_position: this.paywall_position,\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 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\n private sendDataLayeronButtonLogin = (triggerClick: string): void => {\n window.dataLayer.push({\n event: 'registrationOfferClick',\n interface: deviceType(),\n buttonClicked: triggerClick,\n })\n }\n\n private sendDataLayeronButtonBerlangganan = (): void => {\n window.dataLayer.push({\n event: 'subscribe_button_clicked',\n paywall_location: this.paywall_location,\n paywall_subscription_package: this.paywall_subscription_package,\n paywall_subscription_id: this.paywall_subscription_id,\n paywall_subscription_price: this.paywall_subscription_price,\n paywall_position: this.paywall_position,\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 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\n private redirectToLogin(triggerClick: string): void {\n this.sendDataLayeronButtonLogin(triggerClick)\n window.open(this.loginUrl, '_blank')\n }\n\n private redirectToBerlangganan(): void {\n this.sendDataLayeronButtonBerlangganan()\n window.open(this.subscriptionUrl, '_blank')\n }\n\n render() {\n return html`\n <div\n class=\"radius absolute z-20 bg-black bg-opacity-50 p-4 top-0 bottom-0 left-0 flex flex-col w-full h-full justify-center items-center\"\n >\n ${this.isLogin ? this.isLoginComponent() : this.defaultComponent()}\n </div>\n `\n }\n}\n"]}
1
+ {"version":3,"file":"KompasPaywallVideo.js","sourceRoot":"","sources":["../../../../src/components/kompas-paywall-video/KompasPaywallVideo.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA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,CAAC;uEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wEAAiC;AA3CjD,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA2L9B;SA3LY,kBAAkB","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport { html, css, LitElement } from 'lit'\nimport { property, customElement, state } from 'lit/decorators.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\nimport { deviceType } from '../../utils/deviceType.js'\n\n@customElement('kompas-paywall-video')\nexport class KompasPaywallVideo extends LitElement {\n static styles = [css``, TWStyles]\n\n /**\n * Props\n */\n /**\n * prop isLogin untuk menghandle apakah user sudah login atau belum\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 page_type = Type of the page\n * prop content_id = ID of article (slug)\n * prop content_type = Whether it's free article or paid article\n * prop content_title = The title of article\n * prop tracker_content_categories = The category of the content\n * prop user_type = Type of user based on their subscription\n * prop subscription_status = Status of their subscription\n * prop page_domain = Page Domain\n * prop metered_wall_type = The type of Metered Wall\n * prop metered_wall_balance = The balance of their metered wall\n */\n\n @state() private subscriptionUrl: string =\n 'https://www.kompas.id/berlangganan'\n\n @property({ type: Boolean }) isLogin = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: String }) paywall_subscription_id = ''\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\n private isLoginComponent() {\n return html`\n <div>\n ${this.sendDataLayeronBerlangganan()}\n <h5\n class=\"leading-6 text-white text-center text-base md:text-xl max-w-2xl\"\n >\n Akses konten premium Anda bulan ini sudah habis. Aktifkan langganan\n untuk akses tanpa batas, mulai dari\n <span class=\"font-bold\">Rp50.000/bulan.</span>\n </h5>\n <div class=\"flex justify-between mt-4\">\n <button\n @click=${() => this.redirectToBerlangganan()}\n class=\"bg-green-500 rounded px-4 py-1.5 text-sm text-white font-bold\"\n >\n Berlangganan\n </button>\n </div>\n </div>\n `\n }\n\n private defaultComponent() {\n return html`\n <div>\n ${this.sendDataLayeronNonLogin()} ${this.sendDataLayeronBerlangganan()}\n <h5\n class=\"leading-6 text-white text-center text-base md:text-xl max-w-xl\"\n >\n Langganan untuk akses ke seluruh konten premium, mulai dari\n <span class=\"font-bold\">Rp50.000/bulan.</span>\n </h5>\n <div class=\"flex justify-center mt-4 space-x-3\">\n <button\n @click=${() => this.redirectToRegister('Masuk')}\n class=\"rounded text-sm text-white px-4 py-1.5 ring-1 ring-grey-100\"\n >\n Masuk\n </button>\n <button\n @click=${() => this.redirectToBerlangganan()}\n class=\"bg-green-500 rounded px-4 py-1.5 text-sm text-white font-bold\"\n >\n Berlangganan\n </button>\n </div>\n <p\n class=\"text-center text-sm leading-4 text-white mt-6 max-w-xs md:max-w-none\"\n >\n Dapatkan 5 konten premium gratis tiap bulan!\n <button\n @click=${() => this.redirectToRegister('Coba Sekarang')}\n target=\"_blank\"\n class=\"text-blue-300 font-bold cursor-pointer\"\n >\n Coba Sekarang\n </button>\n </p>\n </div>\n `\n }\n\n private sendDataLayeronNonLogin = (): void => {\n window.dataLayer.push({\n event: 'registrationOfferimppression',\n interface: deviceType(),\n })\n }\n\n private sendDataLayeronBerlangganan = (): void => {\n window.dataLayer.push({\n event: 'paywall_viewed',\n paywall_location: this.paywall_location,\n paywall_subscription_package: this.paywall_subscription_package,\n paywall_subscription_id: this.paywall_subscription_id,\n paywall_subscription_price: this.paywall_subscription_price,\n paywall_position: this.paywall_position,\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 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\n private sendDataLayeronButtonLogin = (triggerClick: string): void => {\n window.dataLayer.push({\n event: 'registrationOfferClick',\n interface: deviceType(),\n buttonClicked: triggerClick,\n })\n }\n\n private sendDataLayeronButtonBerlangganan = (): void => {\n window.dataLayer.push({\n event: 'subscribe_button_clicked',\n paywall_location: this.paywall_location,\n paywall_subscription_package: this.paywall_subscription_package,\n paywall_subscription_id: this.paywall_subscription_id,\n paywall_subscription_price: this.paywall_subscription_price,\n paywall_position: this.paywall_position,\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 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\n private redirectToRegister(triggerClick: string): void {\n this.sendDataLayeronButtonLogin(triggerClick)\n const registerHost: string = 'https://account.kompas.id/register'\n const nextParams: string = encodeURIComponent(window.location.href)\n const directUrlRegister: string = `${registerHost}?next=${nextParams}?status=sukses_login&status_login=login`\n window.open(directUrlRegister, '_blank')\n }\n\n private redirectToBerlangganan(): void {\n this.sendDataLayeronButtonBerlangganan()\n window.open(this.subscriptionUrl, '_blank')\n }\n\n render() {\n return html`\n <div\n class=\"radius absolute z-20 bg-black bg-opacity-50 p-4 top-0 bottom-0 left-0 flex flex-col w-full h-full justify-center items-center\"\n >\n ${this.isLogin ? this.isLoginComponent() : this.defaultComponent()}\n </div>\n `\n }\n}\n"]}