@posiwise/app-config-service 0.0.109 → 0.0.111

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.
@@ -1,13 +1,13 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Inject, Injectable, InjectionToken, Optional, PLATFORM_ID } from "@angular/core";
2
+ import { Injectable, InjectionToken, PLATFORM_ID, inject } from "@angular/core";
3
3
  import { isPlatformServer } from "@angular/common";
4
+ import { HttpClient } from "@angular/common/http";
5
+ import { Router } from "@angular/router";
4
6
  import isEmpty from "lodash/isEmpty";
5
7
  import merge from "lodash/merge";
6
8
  import { BehaviorSubject, of, throwError } from "rxjs";
7
9
  import { distinctUntilChanged } from "rxjs/operators";
8
10
  import { getDomain } from "tldts";
9
- import * as i1 from "@angular/common/http";
10
- import * as i2 from "@angular/router";
11
11
  const SERVER_DOMAIN_CONFIG = new InjectionToken("SERVER_DOMAIN_CONFIG");
12
12
  function buildServerStubConfig(environment) {
13
13
  return {
@@ -34,18 +34,6 @@ function buildServerStubConfig(environment) {
34
34
  subscription_id: 0,
35
35
  product_id: 0
36
36
  },
37
- cs: {
38
- crm_source_id: 0,
39
- pdf_source_id: 0,
40
- subscription_id: 0,
41
- product_id: 0
42
- },
43
- coming_soon: {
44
- crm_source_id: 0,
45
- pdf_source_id: 0,
46
- subscription_id: 0,
47
- product_id: 0
48
- },
49
37
  integrations: {
50
38
  google_api_key: "",
51
39
  google_analytics: "",
@@ -84,8 +72,6 @@ function buildServerStubConfig(environment) {
84
72
  login: {},
85
73
  register: {},
86
74
  trial: {},
87
- cs: {},
88
- coming_soon: {},
89
75
  join: {},
90
76
  about_us: {}
91
77
  },
@@ -122,11 +108,11 @@ async function decryptWindowConfig(encrypted, keyString) {
122
108
  return new TextDecoder().decode(plaintext);
123
109
  }
124
110
  var AppConfigService = class AppConfigService {
125
- constructor(api, router, platformId, serverConfig) {
126
- this.api = api;
127
- this.router = router;
128
- this.platformId = platformId;
129
- this.serverConfig = serverConfig;
111
+ constructor() {
112
+ this.api = inject(HttpClient);
113
+ this.router = inject(Router);
114
+ this.platformId = inject(PLATFORM_ID, { optional: true });
115
+ this.serverConfig = inject(SERVER_DOMAIN_CONFIG, { optional: true });
130
116
  this.appConfigSubject$ = new BehaviorSubject({
131
117
  integrations: { google_api_key: "" },
132
118
  social_login_enabled: false,
@@ -215,18 +201,7 @@ var AppConfigService = class AppConfigService {
215
201
  version: "22.2.3",
216
202
  ngImport: i0,
217
203
  type: AppConfigService,
218
- deps: [
219
- { token: i1.HttpClient },
220
- { token: i2.Router },
221
- {
222
- token: PLATFORM_ID,
223
- optional: true
224
- },
225
- {
226
- token: SERVER_DOMAIN_CONFIG,
227
- optional: true
228
- }
229
- ],
204
+ deps: [],
230
205
  target: i0.ɵɵFactoryTarget.Injectable
231
206
  });
232
207
  }
@@ -244,25 +219,7 @@ i0.ɵɵngDeclareClassMetadata({
244
219
  version: "22.2.3",
245
220
  ngImport: i0,
246
221
  type: AppConfigService,
247
- decorators: [{ type: Injectable }],
248
- ctorParameters: () => [
249
- { type: i1.HttpClient },
250
- { type: i2.Router },
251
- {
252
- type: void 0,
253
- decorators: [{ type: Optional }, {
254
- type: Inject,
255
- args: [PLATFORM_ID]
256
- }]
257
- },
258
- {
259
- type: void 0,
260
- decorators: [{ type: Optional }, {
261
- type: Inject,
262
- args: [SERVER_DOMAIN_CONFIG]
263
- }]
264
- }
265
- ]
222
+ decorators: [{ type: Injectable }]
266
223
  });
267
224
  var AppConfigServiceStub = class AppConfigServiceStub extends AppConfigService {
268
225
  constructor() {
@@ -270,18 +227,17 @@ var AppConfigServiceStub = class AppConfigServiceStub extends AppConfigService {
270
227
  this.commonConfigFields = {
271
228
  join_message: null,
272
229
  product_id: 1,
273
- image: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image-default_shard_2022-02-17-newimg-power.png" },
274
- image2: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image2-default_shard_2022-02-17-white-label-2b.png" },
275
- image_bg: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image_bg-default_shard_2022-02-17-banner-bg.jpg" },
276
- image_bg2: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image_bg2-default_shard_2022-02-17-contact-us-bg.jpg" },
230
+ image: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image-default_shard_2022-02-17-newimg-power.png" },
231
+ image2: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image2-default_shard_2022-02-17-white-label-2b.png" },
232
+ image_bg: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image_bg-default_shard_2022-02-17-banner-bg.jpg" },
233
+ image_bg2: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image_bg2-default_shard_2022-02-17-contact-us-bg.jpg" },
277
234
  video_url: "https://www.youtube.com/embed/R7Vk219zbhA",
278
235
  book_demo_url: null,
279
236
  source_id: null,
280
237
  pdf_source_id: null,
281
- pdf_image: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_pdf_image-default_shard_2022-02-21-downloadpdfbook.png" },
238
+ pdf_image: { url: "https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_pdf_image-default_shard_2022-02-21-downloadpdfbook.png" },
282
239
  pdf_download_text: "The rise of SaaS billings in today's marketplace means there has never been a more important time for MSPs to optimise cloud contract management. Download our best practice tips to manage your client contracts efficiently and with zero revenue leakage.",
283
240
  cta_iframe: "\"\\u003ciframe src=\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\"\\u003e\\u003c/iframe\\u003e\"",
284
- cs_cta_iframe: "\"\\u003ciframe src=\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\"\\u003e\\u003c/iframe\\u003e\"",
285
241
  trial_cta_iframe: "\"\\u003ciframe src=\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\"\\u003e\\u003c/iframe\\u003e\""
286
242
  };
287
243
  this.config = {
@@ -373,7 +329,6 @@ var AppConfigServiceStub = class AppConfigServiceStub extends AppConfigService {
373
329
  product_id: 7
374
330
  },
375
331
  signup_config: {
376
- coming_soon: { ...this.commonConfigFields },
377
332
  freemium: { ...this.commonConfigFields },
378
333
  trial: { ...this.commonConfigFields }
379
334
  },
@@ -1 +1 @@
1
- {"version":3,"file":"posiwise-app-config-service.mjs","names":[],"sources":["../../../../libs/app-config-service/src/lib/server-domain-config.ts","../../../../libs/app-config-service/src/lib/server-stub-config.ts","../../../../libs/app-config-service/src/lib/window-config-crypto.ts","../../../../libs/app-config-service/src/lib/app-config.service.ts","../../../../libs/app-config-service/src/lib/app-config.service.stub.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { DecryptedData } from './app-config.interface';\n\n/**\n * Domain metadata for a server render (SSR/prerender).\n *\n * In the browser, server_cicd.js delivers the config as an encrypted window.config.\n * A server render has no window, so the renderer passes the same metadata here\n * instead, as plain data that never leaves the build process.\n */\nexport const SERVER_DOMAIN_CONFIG = new InjectionToken<Partial<DecryptedData>>(\n 'SERVER_DOMAIN_CONFIG'\n);\n","import { DecryptedData } from './app-config.interface';\n\n/**\n * Shape-complete config for a server render that has no domain metadata.\n *\n * Components read config fields at class-field initializer time\n * (e.g. `this.appConfig.crm.source_id`), so every nested object they touch must\n * exist or the render null-derefs. The browser's load() replaces every field.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function buildServerStubConfig(environment: any): DecryptedData {\n return {\n ...environment,\n url: '/',\n domain_id: 0,\n crm: { source_id: 0, subscription_id: 0 },\n master_subscription: {\n subscription_id: 0,\n product_id: 0\n },\n trial: {\n crm_source_id: 0,\n pdf_source_id: 0,\n subscription_id: 0,\n product_id: 0\n },\n freemium: {\n crm_source_id: 0,\n pdf_source_id: 0,\n subscription_id: 0,\n product_id: 0\n },\n cs: {\n crm_source_id: 0,\n pdf_source_id: 0,\n subscription_id: 0,\n product_id: 0\n },\n coming_soon: {\n crm_source_id: 0,\n pdf_source_id: 0,\n subscription_id: 0,\n product_id: 0\n },\n integrations: {\n google_api_key: '',\n google_analytics: '',\n captcha_key_V2: '',\n captcha_key_V3: '',\n fb_app_id: '',\n crisp_code: '',\n hubspot_code: '',\n drift_code: ''\n },\n company: {\n name: '',\n title: '',\n email: '',\n street: '',\n description: '',\n keywords: '',\n logos: { main: { url: '' } }\n },\n social: {\n youtube_url: '',\n linkedin_url: '',\n facebook_url: '',\n twitter_url: '',\n instagram_url: ''\n },\n color_codes: {},\n pages_config: {\n ab_tests: [],\n resources: {\n resources_tagline: '',\n resources_image: { url: '' }\n },\n contact_us: { hubspot: [] },\n landing_page: {},\n login: {},\n register: {},\n trial: {},\n cs: {},\n coming_soon: {},\n join: {},\n about_us: {}\n },\n twitter_seo: {},\n links: { frontend_link: '' },\n main_app_title: '',\n main_tos_id: null,\n social_login_enabled: false,\n oauth_login: null\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any;\n}\n","// #4218: browser-side decrypt for the window.config payload.\n//\n// Replaces `AES.decrypt(config, key)` from `crypto-js` (upstream discontinued).\n// AES-256-GCM via the WebCrypto Subtle API. The matching Node encrypt lives\n// in `config/cicd/window-config-crypto.cjs` and uses the same algorithm +\n// payload layout (base64 of IV(12 bytes) || ciphertext || authTag).\n//\n// Key derivation mirrors the encrypt side: SHA-256 of the key string yields\n// the 32-byte AES-256 key, so callers keep passing the same per-boot random\n// hex string (or legacy env override) they passed to crypto-js.\n\nconst IV_BYTES = 12;\n\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\nasync function deriveKey(keyString: string, usages: ('encrypt' | 'decrypt')[]): Promise<CryptoKey> {\n const material = new TextEncoder().encode(keyString);\n const digest = await window.crypto.subtle.digest('SHA-256', material);\n return window.crypto.subtle.importKey('raw', digest, { name: 'AES-GCM' }, false, usages);\n}\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n // fromCharCode is required here (not fromCodePoint) — we're mapping\n // individual bytes (0-255) to the corresponding Latin-1 characters that\n // btoa expects, NOT interpreting them as Unicode code points.\n let binary = '';\n for (const b of bytes) binary += String.fromCharCode(b);\n return btoa(binary);\n}\n\n/**\n * Encrypt `plaintext` under `keyString`, returning the same base64 payload\n * layout the Node encrypt side produces. Exported for tests + prospective\n * browser-only callers; production traffic only uses `decryptWindowConfig`.\n */\nexport async function encryptWindowConfig(plaintext: string, keyString: string): Promise<string> {\n const key = await deriveKey(keyString, ['encrypt']);\n const iv = window.crypto.getRandomValues(new Uint8Array(IV_BYTES));\n const ciphertext = await window.crypto.subtle.encrypt(\n { name: 'AES-GCM', iv },\n key,\n new TextEncoder().encode(plaintext)\n );\n const payload = new Uint8Array(IV_BYTES + ciphertext.byteLength);\n payload.set(iv, 0);\n payload.set(new Uint8Array(ciphertext), IV_BYTES);\n return bytesToBase64(payload);\n}\n\n/**\n * Decrypt `encrypted` (base64 of IV || ciphertext || authTag) under `keyString`.\n * Throws on wrong key, tampered payload, or malformed input — callers must\n * catch and route to their error path (the current callsite navigates to\n * /error-page and clears window.config).\n */\nexport async function decryptWindowConfig(encrypted: string, keyString: string): Promise<string> {\n const payload = base64ToBytes(encrypted);\n if (payload.length <= IV_BYTES) {\n throw new Error('window.config payload too short');\n }\n const iv = payload.slice(0, IV_BYTES);\n const ciphertext = payload.slice(IV_BYTES);\n const key = await deriveKey(keyString, ['decrypt']);\n const plaintext = await window.crypto.subtle.decrypt({ name: 'AES-GCM', iv }, key, ciphertext);\n return new TextDecoder().decode(plaintext);\n}\n","import { isPlatformServer } from '@angular/common';\nimport { HttpClient } from '@angular/common/http';\nimport { Inject, Injectable, Optional, PLATFORM_ID } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { OAuthLogin } from '@posiwise/common-utilities';\n\nimport isEmpty from 'lodash/isEmpty';\nimport merge from 'lodash/merge';\n// Removed PSL import - using native JavaScript instead\nimport { BehaviorSubject, of, throwError } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { getDomain } from 'tldts';\n\nimport { ApiResponse, DecryptedData } from './app-config.interface';\nimport { SERVER_DOMAIN_CONFIG } from './server-domain-config';\nimport { buildServerStubConfig } from './server-stub-config';\nimport { decryptWindowConfig } from './window-config-crypto';\n\ndeclare const window: Window & {\n config?: string;\n config_key?: string;\n oauth_login?: OAuthLogin;\n};\n\n@Injectable()\nexport class AppConfigService {\n private decryptedData;\n private googleApiKey: string;\n\n protected appConfigSubject$ = new BehaviorSubject<DecryptedData>({\n integrations: {\n google_api_key: ''\n },\n social_login_enabled: false, // Default value\n oauth_login: null // Default value\n });\n\n appConfig$ = this.appConfigSubject$.asObservable().pipe(distinctUntilChanged());\n\n constructor(\n private readonly api: HttpClient,\n private readonly router: Router,\n @Optional() @Inject(PLATFORM_ID) private readonly platformId?: object,\n @Optional()\n @Inject(SERVER_DOMAIN_CONFIG)\n private readonly serverConfig?: Partial<DecryptedData> | null\n ) {}\n\n load(environment) {\n return new Promise(resolve => {\n // Server render (SSR/prerender): there is no window, no localStorage and\n // no injected window.config. Use the domain metadata the renderer\n // provided via SERVER_DOMAIN_CONFIG over a shape-complete stub; the\n // browser re-runs load() during hydration with the real window.config.\n if (this.isServerRender()) {\n const config = { ...buildServerStubConfig(environment), ...this.serverConfig };\n this.googleApiKey = config.integrations?.google_api_key;\n this.appConfigSubject$.next(config);\n return resolve(true);\n }\n // Parse domain using native JavaScript instead of PSL\n const domainName =\n getDomain(window.location.host, { allowPrivateDomains: true }) ||\n window.location.host;\n\n if (environment.production) {\n // in case of production, the config is rendered from server_cicd.js which\n // embeds window.config = config from node\n\n let isTimeout = false; // Store the timeout ID\n\n // Wait for window.config to be available\n const waitForConfig = () => {\n if (window.config) {\n // Clear any pending timeout\n isTimeout = true;\n\n // Config is ready, continue with existing logic\n of({}).subscribe(async () => {\n const { config } = window;\n\n if (!config) {\n this.router.navigate(['/error-page'], {\n state: {\n message: 'Missing window.config during app initialization'\n }\n });\n return resolve(false);\n }\n\n // Decrypt configs. The key is injected at runtime by\n // server_cicd.js in the same inline script as\n // window.config (#4179 — the key no longer ships in\n // the JS bundle). environment.metadata_encryption_key\n // remains as a transition fallback for consumers whose\n // serving layer hasn't been updated yet.\n // #4218: decrypt is now AES-256-GCM via WebCrypto\n // (previously crypto-js AES-CBC, upstream discontinued).\n // subtle.decrypt returns a Promise so the callback is\n // async; wrong key / tampered payload / malformed input\n // all reject and land in the catch below.\n const decryptionKey =\n window.config_key || environment.metadata_encryption_key;\n try {\n const plaintext = await decryptWindowConfig(config, decryptionKey);\n this.decryptedData = JSON.parse(plaintext);\n } catch {\n // Wrong key / tampered payload → route to the\n // error page instead of dying inside the subscribe\n // with a white screen.\n this.decryptedData = null;\n } finally {\n // security: never leave the key on the global scope\n delete window.config_key;\n }\n\n if (isEmpty(this.decryptedData)) {\n this.router.navigate(['/error-page'], {\n state: { message: 'This domain seems to be misconfigured' }\n });\n } else {\n this.googleApiKey = this.decryptedData.integrations.google_api_key;\n this.decryptedData = { ...environment, ...this.decryptedData };\n // security: make sure we clean the config after reading it\n delete window.config;\n\n if (this.decryptedData?.social_login_enabled) {\n window['oauth_login'] = this.decryptedData['oauth_login'];\n }\n this.appConfigSubject$.next(this.decryptedData);\n window['main_tos_id'] = this.decryptedData?.main_tos_id;\n localStorage.setItem(\n 'company_title',\n this.decryptedData?.company?.title\n );\n }\n resolve(true);\n });\n } else if (!isTimeout) {\n // Store the timeout ID so we can clear it later\n setTimeout(waitForConfig, 100);\n }\n };\n\n // Start waiting for config\n waitForConfig();\n } else {\n this.api\n .get<ApiResponse>(`/main-api/v1/domains/metadata?host_name=${domainName}`)\n .subscribe({\n next: (data: ApiResponse) => {\n if (data?.type === 'warning') {\n this.router.navigate(['/error-page'], {\n state: { message: 'This domain seems to be misconfigured' }\n });\n } else {\n const config = merge(environment, data);\n if (config?.social_login_enabled) {\n window['oauth_login'] = config['oauth_login'];\n }\n this.googleApiKey = config.integrations.google_api_key;\n this.appConfigSubject$.next(config);\n window['main_tos_id'] = config?.main_tos_id;\n localStorage.setItem('company_title', config?.company?.title);\n }\n resolve(true);\n },\n error: () => {\n return throwError(() => new Error('metadata is not called'));\n }\n });\n }\n });\n }\n\n /** True on platform-server; also true where no window exists (e.g. a bare `new` in a spec). */\n private isServerRender(): boolean {\n return (\n (this.platformId !== undefined && isPlatformServer(this.platformId)) ||\n typeof window === 'undefined'\n );\n }\n\n getGoogleApiKey(): string {\n return this.googleApiKey;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { AppConfigService } from './app-config.service';\n\n@Injectable()\nexport class AppConfigServiceStub extends AppConfigService {\n commonConfigFields = {\n join_message: null,\n product_id: 1,\n image: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image-default_shard_2022-02-17-newimg-power.png'\n },\n image2: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image2-default_shard_2022-02-17-white-label-2b.png'\n },\n image_bg: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image_bg-default_shard_2022-02-17-banner-bg.jpg'\n },\n image_bg2: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_image_bg2-default_shard_2022-02-17-contact-us-bg.jpg'\n },\n video_url: 'https://www.youtube.com/embed/R7Vk219zbhA',\n book_demo_url: null,\n source_id: null,\n pdf_source_id: null,\n pdf_image: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/cs_pdf_image-default_shard_2022-02-21-downloadpdfbook.png'\n },\n pdf_download_text:\n \"The rise of SaaS billings in today's marketplace means there has never been a more important time for MSPs to optimise cloud contract management. Download our best practice tips to manage your client contracts efficiently and with zero revenue leakage.\",\n cta_iframe:\n '\"\\\\u003ciframe src=\\\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\\\"\\\\u003e\\\\u003c/iframe\\\\u003e\"',\n cs_cta_iframe:\n '\"\\\\u003ciframe src=\\\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\\\"\\\\u003e\\\\u003c/iframe\\\\u003e\"',\n trial_cta_iframe:\n '\"\\\\u003ciframe src=\\\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\\\"\\\\u003e\\\\u003c/iframe\\\\u003e\"'\n };\n\n config = {\n links: {\n frontend_link: 'https://www.dev.posiwise.com',\n socket_link: 'wss://main-websocket.dev.posiwise.com/',\n main_api: 'https://api-gateway.dev.posiwise.com/main-api/v1/',\n products_api: 'https://api-gateway.dev.posiwise.com/products-api/v1/',\n integrations_api: 'https://api-gateway.dev.posiwise.com/integrations-api/v1/',\n cloudolive_api: 'https://api-gateway.dev.posiwise.com/cloudolive-api/v1/',\n // Dedicated WS host for the Brain chat push socket (#45). main-api\n // surfaces it as `links.mcp_socket_link`, sourced from\n // `endpoints.brain_api.websocket_url`.\n mcp_socket_link: 'https://brain-api-websocket.dev.posiwise.com/brain-api/v1/'\n },\n url: '/',\n company: {\n number: '55 732 191 094',\n name: 'PosiWise',\n keywords: 'Innovation,Technology,ProofOfConcet,MVP,Business,Demo,Website,MobileApp,API',\n street: 'Rue des Hirondelles 15 - 1000 Brussels - Belgium',\n city: 'Brussels',\n city_code: '1000',\n state: 'Belgium',\n phone_number: '+32 (0)478 68 21 00',\n description:\n 'PosiWise - Creating positive changes in the world through innovation and wise investments.',\n email: 'info@posiwise.com',\n website: 'https://www.posiwise.com',\n blog_product_key: 'Dashboard_Demo1',\n logos: {\n header_squared_main: {\n url: null,\n version_200x200: {\n url: null\n },\n version_100x100: {\n url: null\n },\n version_50x50: {\n url: null\n }\n },\n header_squared_dark: {\n url: null,\n version_200x200: {\n url: null\n },\n version_100x100: {\n url: null\n },\n version_50x50: {\n url: null\n }\n },\n header_squared_contrast: {\n url: null,\n version_200x200: {\n url: null\n },\n version_100x100: {\n url: null\n },\n version_50x50: {\n url: null\n }\n },\n main: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/logo_main-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big.png'\n },\n main_dark: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/logo_main_dark-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big__1_.png',\n version_100x100: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/version_100x100_logo_main_dark-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big__1_.png'\n }\n },\n main_contrast: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/logo_main_contrast-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big__1_.png'\n }\n }\n },\n main_app_title:\n 'PosiWise - Creating positive changes in the world through innovation and wise investments.',\n favicon_path: 'favicon.ico',\n twitter_seo: { card: 'summary', site: '@posiwise', creator: '@posiwise' },\n color_codes: {\n first: '#f006c4',\n second: '#0fed28',\n third: '#fe8c14',\n titles: '#45d292',\n text: '#222',\n tabs_bg: '#0ceedd',\n tabs_text: '#FFFFFF',\n sidebar_bg: '#212529',\n sidebar_text: '#f70917'\n },\n social: {\n linkedin_url: 'https://www.linkedin.com',\n twitter_url: 'https://twitter.com',\n facebook_url: 'https://www.facebook.com',\n youtube_url: 'https://www.youtube.com/embed/5eV0uXjRxRs'\n },\n can_register_through_main_page: true,\n is_product_domain: true,\n social_login_enabled: true,\n main_tos_id: 1,\n crm: { subscription_id: 1, source_id: 1, product_id: 7 },\n master_subscription: { subscription_id: 1, product_id: 7 },\n signup_config: {\n coming_soon: {\n ...this.commonConfigFields\n },\n freemium: {\n ...this.commonConfigFields\n },\n trial: {\n ...this.commonConfigFields\n }\n },\n integrations: {\n sentry_config: { dsn: '' },\n drift_code: '',\n fb_app_id: '',\n captcha_key: '',\n captcha_key_V2: '',\n google_analytics: '',\n google_api_key: ''\n },\n oauth_login: {\n google: {\n client_id: ''\n },\n facebook: { client_id: '' },\n linkedin: { client_id: '' }\n }\n };\n\n override load() {\n return new Promise(resolve => {\n this.appConfigSubject$.next(this.config);\n\n resolve(true);\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,uBAAuB,IAAI,eACpC,sBAAsB;ACF1B,SAAgB,sBAAsB,aAAgB;CAClD,OAAO;EACH,GAAG;EACH,KAAK;EACL,WAAW;EACX,KAAK;GAAE,WAAW;GAAG,iBAAiB;EAAC;EACvC,qBAAqB;GACjB,iBAAiB;GACjB,YAAY;EACf;EACD,OAAO;GACH,eAAe;GACf,eAAe;GACf,iBAAiB;GACjB,YAAY;EACf;EACD,UAAU;GACN,eAAe;GACf,eAAe;GACf,iBAAiB;GACjB,YAAY;EACf;EACD,IAAI;GACA,eAAe;GACf,eAAe;GACf,iBAAiB;GACjB,YAAY;EACf;EACD,aAAa;GACT,eAAe;GACf,eAAe;GACf,iBAAiB;GACjB,YAAY;EACf;EACD,cAAc;GACV,gBAAgB;GAChB,kBAAkB;GAClB,gBAAgB;GAChB,gBAAgB;GAChB,WAAW;GACX,YAAY;GACZ,cAAc;GACd,YAAY;EACf;EACD,SAAS;GACL,MAAM;GACN,OAAO;GACP,OAAO;GACP,QAAQ;GACR,aAAa;GACb,UAAU;GACV,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,EAAE;EAC7B;EACD,QAAQ;GACJ,aAAa;GAC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EAAE,WAAW,GAAE;IACzB,UAAU,EAAE,WAAW,GAAE;GAC5B;EACJ;CASJ;CAPY,OAAI;EACT,OAAO,IAAI,SAAQ,YAAU;GACzB,KAAK,kBAAkB,KAAK,KAAK,MAAM;GAEvC,QAAQ,IAAI;EAChB,CAAC;CACL;CA9KS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAoB,MAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAApB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAoB,CAAA;CAAA;;AAApB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA,EADhC,MAAA,WAAA,CAAA"}
1
+ {"version":3,"file":"posiwise-app-config-service.mjs","names":[],"sources":["../../../../libs/app-config-service/src/lib/server-domain-config.ts","../../../../libs/app-config-service/src/lib/server-stub-config.ts","../../../../libs/app-config-service/src/lib/window-config-crypto.ts","../../../../libs/app-config-service/src/lib/app-config.service.ts","../../../../libs/app-config-service/src/lib/app-config.service.stub.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { DecryptedData } from './app-config.interface';\n\n/**\n * Domain metadata for a server render (SSR/prerender).\n *\n * In the browser, server_cicd.js delivers the config as an encrypted window.config.\n * A server render has no window, so the renderer passes the same metadata here\n * instead, as plain data that never leaves the build process.\n */\nexport const SERVER_DOMAIN_CONFIG = new InjectionToken<Partial<DecryptedData>>(\n 'SERVER_DOMAIN_CONFIG'\n);\n","import { DecryptedData } from './app-config.interface';\n\n/**\n * Shape-complete config for a server render that has no domain metadata.\n *\n * Components read config fields at class-field initializer time\n * (e.g. `this.appConfig.crm.source_id`), so every nested object they touch must\n * exist or the render null-derefs. The browser's load() replaces every field.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function buildServerStubConfig(environment: any): DecryptedData {\n return {\n ...environment,\n url: '/',\n domain_id: 0,\n crm: { source_id: 0, subscription_id: 0 },\n master_subscription: {\n subscription_id: 0,\n product_id: 0\n },\n trial: {\n crm_source_id: 0,\n pdf_source_id: 0,\n subscription_id: 0,\n product_id: 0\n },\n freemium: {\n crm_source_id: 0,\n pdf_source_id: 0,\n subscription_id: 0,\n product_id: 0\n },\n integrations: {\n google_api_key: '',\n google_analytics: '',\n captcha_key_V2: '',\n captcha_key_V3: '',\n fb_app_id: '',\n crisp_code: '',\n hubspot_code: '',\n drift_code: ''\n },\n company: {\n name: '',\n title: '',\n email: '',\n street: '',\n description: '',\n keywords: '',\n logos: { main: { url: '' } }\n },\n social: {\n youtube_url: '',\n linkedin_url: '',\n facebook_url: '',\n twitter_url: '',\n instagram_url: ''\n },\n color_codes: {},\n pages_config: {\n ab_tests: [],\n resources: {\n resources_tagline: '',\n resources_image: { url: '' }\n },\n contact_us: { hubspot: [] },\n landing_page: {},\n login: {},\n register: {},\n trial: {},\n join: {},\n about_us: {}\n },\n twitter_seo: {},\n links: { frontend_link: '' },\n main_app_title: '',\n main_tos_id: null,\n social_login_enabled: false,\n oauth_login: null\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any;\n}\n","// #4218: browser-side decrypt for the window.config payload.\n//\n// Replaces `AES.decrypt(config, key)` from `crypto-js` (upstream discontinued).\n// AES-256-GCM via the WebCrypto Subtle API. The matching Node encrypt lives\n// in `config/cicd/window-config-crypto.cjs` and uses the same algorithm +\n// payload layout (base64 of IV(12 bytes) || ciphertext || authTag).\n//\n// Key derivation mirrors the encrypt side: SHA-256 of the key string yields\n// the 32-byte AES-256 key, so callers keep passing the same per-boot random\n// hex string (or legacy env override) they passed to crypto-js.\n\nconst IV_BYTES = 12;\n\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\nasync function deriveKey(keyString: string, usages: ('encrypt' | 'decrypt')[]): Promise<CryptoKey> {\n const material = new TextEncoder().encode(keyString);\n const digest = await window.crypto.subtle.digest('SHA-256', material);\n return window.crypto.subtle.importKey('raw', digest, { name: 'AES-GCM' }, false, usages);\n}\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n // fromCharCode is required here (not fromCodePoint) — we're mapping\n // individual bytes (0-255) to the corresponding Latin-1 characters that\n // btoa expects, NOT interpreting them as Unicode code points.\n let binary = '';\n for (const b of bytes) binary += String.fromCharCode(b);\n return btoa(binary);\n}\n\n/**\n * Encrypt `plaintext` under `keyString`, returning the same base64 payload\n * layout the Node encrypt side produces. Exported for tests + prospective\n * browser-only callers; production traffic only uses `decryptWindowConfig`.\n */\nexport async function encryptWindowConfig(plaintext: string, keyString: string): Promise<string> {\n const key = await deriveKey(keyString, ['encrypt']);\n const iv = window.crypto.getRandomValues(new Uint8Array(IV_BYTES));\n const ciphertext = await window.crypto.subtle.encrypt(\n { name: 'AES-GCM', iv },\n key,\n new TextEncoder().encode(plaintext)\n );\n const payload = new Uint8Array(IV_BYTES + ciphertext.byteLength);\n payload.set(iv, 0);\n payload.set(new Uint8Array(ciphertext), IV_BYTES);\n return bytesToBase64(payload);\n}\n\n/**\n * Decrypt `encrypted` (base64 of IV || ciphertext || authTag) under `keyString`.\n * Throws on wrong key, tampered payload, or malformed input — callers must\n * catch and route to their error path (the current callsite navigates to\n * /error-page and clears window.config).\n */\nexport async function decryptWindowConfig(encrypted: string, keyString: string): Promise<string> {\n const payload = base64ToBytes(encrypted);\n if (payload.length <= IV_BYTES) {\n throw new Error('window.config payload too short');\n }\n const iv = payload.slice(0, IV_BYTES);\n const ciphertext = payload.slice(IV_BYTES);\n const key = await deriveKey(keyString, ['decrypt']);\n const plaintext = await window.crypto.subtle.decrypt({ name: 'AES-GCM', iv }, key, ciphertext);\n return new TextDecoder().decode(plaintext);\n}\n","import { isPlatformServer } from '@angular/common';\nimport { HttpClient } from '@angular/common/http';\nimport { inject,Injectable, PLATFORM_ID } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { OAuthLogin } from '@posiwise/common-utilities';\n\nimport isEmpty from 'lodash/isEmpty';\nimport merge from 'lodash/merge';\n// Removed PSL import - using native JavaScript instead\nimport { BehaviorSubject, of, throwError } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { getDomain } from 'tldts';\n\nimport { ApiResponse, DecryptedData } from './app-config.interface';\nimport { SERVER_DOMAIN_CONFIG } from './server-domain-config';\nimport { buildServerStubConfig } from './server-stub-config';\nimport { decryptWindowConfig } from './window-config-crypto';\n\ndeclare const window: Window & {\n config?: string;\n config_key?: string;\n oauth_login?: OAuthLogin;\n};\n\n@Injectable()\nexport class AppConfigService {\n private readonly api = inject(HttpClient);\n private readonly router = inject(Router);\n private readonly platformId = inject(PLATFORM_ID, { optional: true });\n private readonly serverConfig = inject<Partial<DecryptedData> | null>(SERVER_DOMAIN_CONFIG, {\n optional: true\n });\n\n private decryptedData;\n private googleApiKey: string;\n\n protected appConfigSubject$ = new BehaviorSubject<DecryptedData>({\n integrations: {\n google_api_key: ''\n },\n social_login_enabled: false, // Default value\n oauth_login: null // Default value\n });\n\n appConfig$ = this.appConfigSubject$.asObservable().pipe(distinctUntilChanged());\n\n load(environment) {\n return new Promise(resolve => {\n // Server render (SSR/prerender): there is no window, no localStorage and\n // no injected window.config. Use the domain metadata the renderer\n // provided via SERVER_DOMAIN_CONFIG over a shape-complete stub; the\n // browser re-runs load() during hydration with the real window.config.\n if (this.isServerRender()) {\n const config = { ...buildServerStubConfig(environment), ...this.serverConfig };\n this.googleApiKey = config.integrations?.google_api_key;\n this.appConfigSubject$.next(config);\n return resolve(true);\n }\n // Parse domain using native JavaScript instead of PSL\n const domainName =\n getDomain(window.location.host, { allowPrivateDomains: true }) ||\n window.location.host;\n\n if (environment.production) {\n // in case of production, the config is rendered from server_cicd.js which\n // embeds window.config = config from node\n\n let isTimeout = false; // Store the timeout ID\n\n // Wait for window.config to be available\n const waitForConfig = () => {\n if (window.config) {\n // Clear any pending timeout\n isTimeout = true;\n\n // Config is ready, continue with existing logic\n of({}).subscribe(async () => {\n const { config } = window;\n\n if (!config) {\n this.router.navigate(['/error-page'], {\n state: {\n message: 'Missing window.config during app initialization'\n }\n });\n return resolve(false);\n }\n\n // Decrypt configs. The key is injected at runtime by\n // server_cicd.js in the same inline script as\n // window.config (#4179 — the key no longer ships in\n // the JS bundle). environment.metadata_encryption_key\n // remains as a transition fallback for consumers whose\n // serving layer hasn't been updated yet.\n // #4218: decrypt is now AES-256-GCM via WebCrypto\n // (previously crypto-js AES-CBC, upstream discontinued).\n // subtle.decrypt returns a Promise so the callback is\n // async; wrong key / tampered payload / malformed input\n // all reject and land in the catch below.\n const decryptionKey =\n window.config_key || environment.metadata_encryption_key;\n try {\n const plaintext = await decryptWindowConfig(config, decryptionKey);\n this.decryptedData = JSON.parse(plaintext);\n } catch {\n // Wrong key / tampered payload → route to the\n // error page instead of dying inside the subscribe\n // with a white screen.\n this.decryptedData = null;\n } finally {\n // security: never leave the key on the global scope\n delete window.config_key;\n }\n\n if (isEmpty(this.decryptedData)) {\n this.router.navigate(['/error-page'], {\n state: { message: 'This domain seems to be misconfigured' }\n });\n } else {\n this.googleApiKey = this.decryptedData.integrations.google_api_key;\n this.decryptedData = { ...environment, ...this.decryptedData };\n // security: make sure we clean the config after reading it\n delete window.config;\n\n if (this.decryptedData?.social_login_enabled) {\n window['oauth_login'] = this.decryptedData['oauth_login'];\n }\n this.appConfigSubject$.next(this.decryptedData);\n window['main_tos_id'] = this.decryptedData?.main_tos_id;\n localStorage.setItem(\n 'company_title',\n this.decryptedData?.company?.title\n );\n }\n resolve(true);\n });\n } else if (!isTimeout) {\n // Store the timeout ID so we can clear it later\n setTimeout(waitForConfig, 100);\n }\n };\n\n // Start waiting for config\n waitForConfig();\n } else {\n this.api\n .get<ApiResponse>(`/main-api/v1/domains/metadata?host_name=${domainName}`)\n .subscribe({\n next: (data: ApiResponse) => {\n if (data?.type === 'warning') {\n this.router.navigate(['/error-page'], {\n state: { message: 'This domain seems to be misconfigured' }\n });\n } else {\n const config = merge(environment, data);\n if (config?.social_login_enabled) {\n window['oauth_login'] = config['oauth_login'];\n }\n this.googleApiKey = config.integrations.google_api_key;\n this.appConfigSubject$.next(config);\n window['main_tos_id'] = config?.main_tos_id;\n localStorage.setItem('company_title', config?.company?.title);\n }\n resolve(true);\n },\n error: () => {\n return throwError(() => new Error('metadata is not called'));\n }\n });\n }\n });\n }\n\n /** True on platform-server; also true where no window exists (e.g. a bare `new` in a spec). */\n private isServerRender(): boolean {\n return (\n (this.platformId !== undefined && isPlatformServer(this.platformId)) ||\n typeof window === 'undefined'\n );\n }\n\n getGoogleApiKey(): string {\n return this.googleApiKey;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { AppConfigService } from './app-config.service';\n\n@Injectable()\nexport class AppConfigServiceStub extends AppConfigService {\n commonConfigFields = {\n join_message: null,\n product_id: 1,\n image: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image-default_shard_2022-02-17-newimg-power.png'\n },\n image2: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image2-default_shard_2022-02-17-white-label-2b.png'\n },\n image_bg: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image_bg-default_shard_2022-02-17-banner-bg.jpg'\n },\n image_bg2: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_image_bg2-default_shard_2022-02-17-contact-us-bg.jpg'\n },\n video_url: 'https://www.youtube.com/embed/R7Vk219zbhA',\n book_demo_url: null,\n source_id: null,\n pdf_source_id: null,\n pdf_image: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/trial_pdf_image-default_shard_2022-02-21-downloadpdfbook.png'\n },\n pdf_download_text:\n \"The rise of SaaS billings in today's marketplace means there has never been a more important time for MSPs to optimise cloud contract management. Download our best practice tips to manage your client contracts efficiently and with zero revenue leakage.\",\n cta_iframe:\n '\"\\\\u003ciframe src=\\\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\\\"\\\\u003e\\\\u003c/iframe\\\\u003e\"',\n trial_cta_iframe:\n '\"\\\\u003ciframe src=\\\\\"https://my.upflowy.com/0jx-cloudolive?mode=standalone\\\\\"\\\\u003e\\\\u003c/iframe\\\\u003e\"'\n };\n\n config = {\n links: {\n frontend_link: 'https://www.dev.posiwise.com',\n socket_link: 'wss://main-websocket.dev.posiwise.com/',\n main_api: 'https://api-gateway.dev.posiwise.com/main-api/v1/',\n products_api: 'https://api-gateway.dev.posiwise.com/products-api/v1/',\n integrations_api: 'https://api-gateway.dev.posiwise.com/integrations-api/v1/',\n cloudolive_api: 'https://api-gateway.dev.posiwise.com/cloudolive-api/v1/',\n // Dedicated WS host for the Brain chat push socket (#45). main-api\n // surfaces it as `links.mcp_socket_link`, sourced from\n // `endpoints.brain_api.websocket_url`.\n mcp_socket_link: 'https://brain-api-websocket.dev.posiwise.com/brain-api/v1/'\n },\n url: '/',\n company: {\n number: '55 732 191 094',\n name: 'PosiWise',\n keywords: 'Innovation,Technology,ProofOfConcet,MVP,Business,Demo,Website,MobileApp,API',\n street: 'Rue des Hirondelles 15 - 1000 Brussels - Belgium',\n city: 'Brussels',\n city_code: '1000',\n state: 'Belgium',\n phone_number: '+32 (0)478 68 21 00',\n description:\n 'PosiWise - Creating positive changes in the world through innovation and wise investments.',\n email: 'info@posiwise.com',\n website: 'https://www.posiwise.com',\n blog_product_key: 'Dashboard_Demo1',\n logos: {\n header_squared_main: {\n url: null,\n version_200x200: {\n url: null\n },\n version_100x100: {\n url: null\n },\n version_50x50: {\n url: null\n }\n },\n header_squared_dark: {\n url: null,\n version_200x200: {\n url: null\n },\n version_100x100: {\n url: null\n },\n version_50x50: {\n url: null\n }\n },\n header_squared_contrast: {\n url: null,\n version_200x200: {\n url: null\n },\n version_100x100: {\n url: null\n },\n version_50x50: {\n url: null\n }\n },\n main: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/logo_main-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big.png'\n },\n main_dark: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/logo_main_dark-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big__1_.png',\n version_100x100: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/version_100x100_logo_main_dark-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big__1_.png'\n }\n },\n main_contrast: {\n url: 'https://posiwise-dev.s3.us-east-2.amazonaws.com/dev/public/default_shard/domain_pictures/3/logo_main_contrast-default_shard_2022-02-17-logo_main_dark-default_shard_2022-02-13-logo_text_big__1_.png'\n }\n }\n },\n main_app_title:\n 'PosiWise - Creating positive changes in the world through innovation and wise investments.',\n favicon_path: 'favicon.ico',\n twitter_seo: { card: 'summary', site: '@posiwise', creator: '@posiwise' },\n color_codes: {\n first: '#f006c4',\n second: '#0fed28',\n third: '#fe8c14',\n titles: '#45d292',\n text: '#222',\n tabs_bg: '#0ceedd',\n tabs_text: '#FFFFFF',\n sidebar_bg: '#212529',\n sidebar_text: '#f70917'\n },\n social: {\n linkedin_url: 'https://www.linkedin.com',\n twitter_url: 'https://twitter.com',\n facebook_url: 'https://www.facebook.com',\n youtube_url: 'https://www.youtube.com/embed/5eV0uXjRxRs'\n },\n can_register_through_main_page: true,\n is_product_domain: true,\n social_login_enabled: true,\n main_tos_id: 1,\n crm: { subscription_id: 1, source_id: 1, product_id: 7 },\n master_subscription: { subscription_id: 1, product_id: 7 },\n signup_config: {\n freemium: {\n ...this.commonConfigFields\n },\n trial: {\n ...this.commonConfigFields\n }\n },\n integrations: {\n sentry_config: { dsn: '' },\n drift_code: '',\n fb_app_id: '',\n captcha_key: '',\n captcha_key_V2: '',\n google_analytics: '',\n google_api_key: ''\n },\n oauth_login: {\n google: {\n client_id: ''\n },\n facebook: { client_id: '' },\n linkedin: { client_id: '' }\n }\n };\n\n override load() {\n return new Promise(resolve => {\n this.appConfigSubject$.next(this.config);\n\n resolve(true);\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,uBAAuB,IAAI,eACpC,sBAAsB;ACF1B,SAAgB,sBAAsB,aAAgB;CAClD,OAAO;EACH,GAAG;EACH,KAAK;EACL,WAAW;EACX,KAAK;GAAE,WAAW;GAAG,iBAAiB;EAAC;EACvC,qBAAqB;GACjB,iBAAiB;GACjB,YAAY;EACf;EACD,OAAO;GACH,eAAe;GACf,eAAe;GACf,iBAAiB;GACjB,YAAY;EACf;EACD,UAAU;GACN,eAAe;GACf,eAAe;GACf,iBAAiB;GACjB,YAAY;EACf;EACD,cAAc;GACV,gBAAgB;GAChB,kBAAkB;GAClB,gBAAgB;GAChB,gBAAgB;GAChB,WAAW;GACX,YAAY;GACZ,cAAc;GACd,YAAY;EACf;EACD,SAAS;GACL,MAAM;GACN,OAAO;GACP,OAAO;GACP,QAAQ;GACR,aAAa;GACb,UAAU;GACV,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,EAAE;EAC7B;EACD,QAAQ;GACJ,aAAa;GACb,cAAc;GACd,cAAc;GACd,aAAa;GACb,eAAe;EAClB;EACD,aAAa,CAAA;EACb,cAAc;GACV,UAAU,CAAA;GACV,WAAW;IACP,mBAAmB;IACnB,iBAAiB,EAAE,KAAK,GAAE;GAC7B;GACD,YAAY,EAAE,SAAS,CAAA,EAAE;GACzB,cAAc,CAAA;GACd,OAAO,CAAA;GACP,UAAU,CAAA;GACV,OAAO,CAAA;GACP,MAAM,CAAA;GACN,UAAU,CAAA;EACb;EACD,aAAa,CAAA;E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
+ "version": "0.0.111",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.2.0",
6
6
  "@angular/core": "^22.2.0"
@@ -1,5 +1,3 @@
1
- import { HttpClient } from "@angular/common/http";
2
- import { Router } from "@angular/router";
3
1
  import { BehaviorSubject } from "rxjs";
4
2
  import * as i0 from "@angular/core";
5
3
  import { InjectionToken } from "@angular/core";
@@ -100,22 +98,17 @@ interface ApiResponse {
100
98
  export declare class AppConfigService {
101
99
  private readonly api;
102
100
  private readonly router;
103
- private readonly platformId?;
104
- private readonly serverConfig?;
101
+ private readonly platformId;
102
+ private readonly serverConfig;
105
103
  private decryptedData;
106
104
  private googleApiKey;
107
105
  protected appConfigSubject$: BehaviorSubject<DecryptedData>;
108
106
  appConfig$: import("rxjs").Observable<DecryptedData>;
109
- constructor(api: HttpClient, router: Router, platformId?: object, serverConfig?: Partial<DecryptedData> | null);
110
107
  load(environment: any): Promise<unknown>;
111
108
  /** True on platform-server; also true where no window exists (e.g. a bare `new` in a spec). */
112
109
  private isServerRender;
113
110
  getGoogleApiKey(): string;
114
- static ɵfac: i0.ɵɵFactoryDeclaration<AppConfigService, [null, null, {
115
- optional: true;
116
- }, {
117
- optional: true;
118
- }]>;
111
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppConfigService, never>;
119
112
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
120
113
  }
121
114
  export declare class AppConfigServiceStub extends AppConfigService {
@@ -143,7 +136,6 @@ export declare class AppConfigServiceStub extends AppConfigService {
143
136
  };
144
137
  pdf_download_text: string;
145
138
  cta_iframe: string;
146
- cs_cta_iframe: string;
147
139
  trial_cta_iframe: string;
148
140
  };
149
141
  config: {
@@ -259,33 +251,6 @@ export declare class AppConfigServiceStub extends AppConfigService {
259
251
  product_id: number;
260
252
  };
261
253
  signup_config: {
262
- coming_soon: {
263
- join_message: any;
264
- product_id: number;
265
- image: {
266
- url: string;
267
- };
268
- image2: {
269
- url: string;
270
- };
271
- image_bg: {
272
- url: string;
273
- };
274
- image_bg2: {
275
- url: string;
276
- };
277
- video_url: string;
278
- book_demo_url: any;
279
- source_id: any;
280
- pdf_source_id: any;
281
- pdf_image: {
282
- url: string;
283
- };
284
- pdf_download_text: string;
285
- cta_iframe: string;
286
- cs_cta_iframe: string;
287
- trial_cta_iframe: string;
288
- };
289
254
  freemium: {
290
255
  join_message: any;
291
256
  product_id: number;
@@ -310,7 +275,6 @@ export declare class AppConfigServiceStub extends AppConfigService {
310
275
  };
311
276
  pdf_download_text: string;
312
277
  cta_iframe: string;
313
- cs_cta_iframe: string;
314
278
  trial_cta_iframe: string;
315
279
  };
316
280
  trial: {
@@ -337,7 +301,6 @@ export declare class AppConfigServiceStub extends AppConfigService {
337
301
  };
338
302
  pdf_download_text: string;
339
303
  cta_iframe: string;
340
- cs_cta_iframe: string;
341
304
  trial_cta_iframe: string;
342
305
  };
343
306
  };