@posiwise/user-module 0.0.196 → 0.0.197

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 +1 @@
1
- {"version":3,"file":"posiwise-user-module.mjs","names":["i2","map","PasswordValidationComponent_1","PasswordValidationComponent_1","PasswordValidationComponent_1","i2","PasswordValidationComponent_1","PasswordValidationComponent_1","i1","i1","i2"],"sources":["../../../../libs/user-module/src/lib/account/account.component.ts","../../../../libs/user-module/src/lib/account/account.component.html","../../../../libs/user-module/src/lib/account/account-details/account-details.utils.ts","../../../../libs/user-module/src/lib/account/account-details/account-api-credentials.ts","../../../../libs/user-module/src/lib/account/account-details/account-mcp-connections.ts","../../../../libs/user-module/src/lib/account/account-details/account-security-forms.ts","../../../../libs/user-module/src/lib/account/account-details/account-avatar-slug.ts","../../../../libs/user-module/src/lib/account/credentials/credential-helpers.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/clear-masked-on-focus.directive.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/humanize-credential-name.pipe.ts","../../../../libs/user-module/src/lib/account/account-details/account-user-credentials/account-user-credentials.utils.ts","../../../../libs/user-module/src/lib/account/account-details/account-user-credentials/account-user-credentials.component.ts","../../../../libs/user-module/src/lib/account/account-details/account-user-credentials/account-user-credentials.component.html","../../../../libs/user-module/src/lib/account/account-details/account-details.component.ts","../../../../libs/user-module/src/lib/account/account-details/account-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/add-subscription/add-subscription.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/add-subscription/add-subscription.component.html","../../../../libs/user-module/src/lib/account/subscriptions/saved-card-details/saved-card-details.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/saved-card-details/saved-card-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential.utils.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential-actions.service.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential.component.html","../../../../libs/user-module/src/lib/account/subscriptions/subscription-removal/subscription-removal.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-removal/subscription-removal.component.html","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/airwallex-element.helper.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/braintree-dropin.helper.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/secondary-payment-method.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/secondary-payment-method.component.html","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/update-payment-details.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/update-payment-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/upgrade-subscription/upgrade-subscription-payment.ts","../../../../libs/user-module/src/lib/account/subscriptions/upgrade-subscription/upgrade-subscription.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/upgrade-subscription/upgrade-subscription.component.html","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-details.utils.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-api-tokens.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-logos.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-seats.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/user-subscription-details.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/user-subscription-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/user-subscriptions-list/subscription-list-actions.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscriptions-list/user-subscriptions-list.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscriptions-list/user-subscriptions-list.component.html","../../../../libs/user-module/src/lib/account/user-invoice/user-invoice.component.ts","../../../../libs/user-module/src/lib/account/user-invoice/user-invoice.component.html","../../../../libs/user-module/src/lib/settings-tabs/ai-knowledge-tab/ai-knowledge-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/ai-knowledge-tab/ai-knowledge-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/communication-tab/communication-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/communication-tab/communication-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/others-tab/others-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/others-tab/others-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/security-tab/security-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/security-tab/security-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/settings-tabs.component.ts","../../../../libs/user-module/src/lib/settings-tabs/settings-tabs.component.html","../../../../libs/user-module/src/lib/support/support.component.ts","../../../../libs/user-module/src/lib/support/support.component.html","../../../../libs/user-module/src/lib/support/support-details/support-details.component.ts","../../../../libs/user-module/src/lib/support/support-details/support-details.component.html","../../../../libs/user-module/src/lib/user-profile/edit-portfolios/edit-portfolios.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-portfolios/edit-portfolios.component.html","../../../../libs/user-module/src/lib/user-profile/edit-project-modal/edit-project-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-project-modal/edit-project-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-qualifications-modal/edit-qualifications-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-qualifications-modal/edit-qualifications-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-recommendation-modal/edit-recommendation-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-recommendation-modal/edit-recommendation-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-skills-modal/edit-skills-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-skills-modal/edit-skills-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-social-links/edit-social-links.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-social-links/edit-social-links.component.html","../../../../libs/user-module/src/lib/user-profile/edit-user-profile-modal/edit-user-profile-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-user-profile-modal/edit-user-profile-modal.component.html","../../../../libs/user-module/src/lib/user-profile/user-about/user-about.component.ts","../../../../libs/user-module/src/lib/user-profile/user-about/user-about.component.html","../../../../libs/user-module/src/lib/user-profile/user-portfolios/user-portfolios.component.ts","../../../../libs/user-module/src/lib/user-profile/user-portfolios/user-portfolios.component.html","../../../../libs/user-module/src/lib/user-profile/user-profile-avatar.ts","../../../../libs/user-module/src/lib/user-profile/user-profile-jquery.ts","../../../../libs/user-module/src/lib/user-profile/user-projects/user-projects.component.ts","../../../../libs/user-module/src/lib/user-profile/user-projects/user-projects.component.html","../../../../libs/user-module/src/lib/user-profile/user-profile-page.component.ts","../../../../libs/user-module/src/lib/user-profile/user-profile-page.component.html","../../../../libs/user-module/src/lib/user-module.module.ts"],"sourcesContent":["import { Component, inject, ViewChild } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { PwTabsComponent } from '@posiwise/shared-components';\n\nimport { MenuItem } from 'primeng/api';\n\n@Component({\n selector: 'pw-user-account',\n templateUrl: './account.component.html',\n imports: [PwTabsComponent]\n})\nexport class AccountComponent {\n private readonly router = inject(Router);\n\n @ViewChild('menuItems', { static: true }) menu: MenuItem[];\n\n items: MenuItem[];\n\n activeItem: MenuItem;\n\n path: string;\n\n constructor() {\n this.items = [\n {\n id: 'account',\n labelKey: 'User.Tabs.Account',\n icon: 'fa fa-fw fa-list',\n routerLink: ['/account/details']\n },\n {\n id: 'subscription',\n labelKey: 'User.Tabs.Subscriptions',\n icon: 'fa fa-fw fa-file-invoice',\n routerLink: ['/account/subscriptions']\n },\n {\n id: 'invoice',\n labelKey: 'User.Tabs.Invoices',\n icon: 'fa fa-fw fa-tag',\n routerLink: ['/account/invoice']\n }\n ];\n this.activeItem =\n this.items[\n this.items.findIndex(\n record => record.routerLink[0] === this.router.url.split('?')[0]\n )\n ];\n }\n\n activateMenu() {\n this.activeItem = this.menu['activeItem'];\n }\n}\n","<pw-tabs [items]=\"items\"></pw-tabs>\n","import { AbstractControl } from '@angular/forms';\n\nimport { User } from '@posiwise/common-utilities';\n\nimport { getDomain } from 'tldts';\n\nimport { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';\n\n/** Environment segments that may already sit in front of the company domain. */\nconst MCP_ENV_SEGMENTS = ['dev', 'uat', 'staging', 'go'];\n\n/** Segment assumed when the host carries none — PROD is served from the apex too. */\nconst MCP_PROD_SEGMENT = 'go';\n\n/**\n * Company domain prefixed by its environment segment. Resolves the company\n * domain with the same `getDomain` the AppConfigService uses to identify the\n * tenant, so multi-label TLDs (acme.co.uk) and arbitrary subdomains both\n * reduce correctly. Only a recognised environment segment is carried over —\n * anything else (`www`, a custom subdomain) falls back to PROD rather than\n * being prefixed onto the host, which would misroute.\n */\nexport function mcpHostBase(hostname: string): string {\n const companyDomain = getDomain(hostname, { allowPrivateDomains: true });\n if (!companyDomain) {\n // Non-public hosts (localhost, bare IPs) carry no company domain.\n return hostname;\n }\n const prefix = hostname.slice(0, -companyDomain.length).split('.').filter(Boolean);\n const segment = prefix[prefix.length - 1];\n const env = MCP_ENV_SEGMENTS.includes(segment) ? segment : MCP_PROD_SEGMENT;\n return `${env}.${companyDomain}`;\n}\n\n/** `YYYY-MM-DD` date of birth as a datepicker struct; undefined when there is none. */\nexport function toDobStruct(dob: string | undefined): NgbDateStruct {\n let dobObject: NgbDateStruct;\n if (dob) {\n dobObject = {\n day: Number(dob.substring(8, 10)),\n month: Number(dob.substring(5, 7)),\n year: Number(dob.substring(0, 4))\n };\n }\n return dobObject;\n}\n\n/** Copies `user.api_keys` values onto the flat user fields the page reads, when those are unset. */\nexport function copyApiKeysToUser(user: User): void {\n if (user && user.api_keys) {\n if (user.api_keys.api_user_token && !user.api_user_token) {\n user.api_user_token = user.api_keys.api_user_token;\n }\n if (user.api_keys.api_user_id && !user.api_user_id) {\n user.api_user_id = user.api_keys.api_user_id;\n }\n if (user.api_keys.api_hits !== undefined && user.api_hits === undefined) {\n user.api_hits = user.api_keys.api_hits;\n }\n if (user.api_keys.api_hits_max !== undefined && user.api_hits_max === undefined) {\n user.api_hits_max = user.api_keys.api_hits_max;\n }\n }\n}\n\n/** Merges freshly refreshed API keys into `user.api_keys`. */\nexport function mergeRefreshedApiKeys(user: User, result: Pick<User, 'api_keys'> | null): void {\n if (result && result.api_keys) {\n if (!user.api_keys) {\n user.api_keys = {};\n }\n if (result.api_keys.api_user_token) {\n user.api_keys.api_user_token = result.api_keys.api_user_token;\n }\n if (result.api_keys.api_user_id) {\n user.api_keys.api_user_id = result.api_keys.api_user_id;\n }\n if (result.api_keys.api_hits !== undefined) {\n user.api_keys.api_hits = result.api_keys.api_hits;\n }\n if (result.api_keys.api_hits_max !== undefined) {\n user.api_keys.api_hits_max = result.api_keys.api_hits_max;\n }\n }\n}\n\nexport function passwordMatcher(ac: AbstractControl): null {\n const password = ac.get('newPassword').value;\n const confirmPassword = ac.get('confirmPassword').value;\n if (password !== confirmPassword) {\n ac.get('confirmPassword').setErrors({ MatchPassword: true });\n }\n\n return null;\n}\n\nexport function dataUrlToBlob(dataUrl: string): Blob {\n const arr = dataUrl.split(',');\n const mime = /^[A-Z]*[a-z]*:(.*?);[A-Z]*/.exec(arr[0])?.[1];\n const bStr = atob(arr[1]);\n let n = bStr.length;\n const u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bStr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n","import { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { User } from '@posiwise/common-utilities';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\nimport { mergeRefreshedApiKeys } from './account-details.utils';\n\n/** API token and token-scope handling of the account page (undecorated base). */\nexport abstract class AccountApiCredentials extends AppBaseComponent {\n protected readonly cdr = inject(ChangeDetectorRef);\n protected readonly confirmDialog = inject(ConfirmDialogService);\n\n user: User;\n\n showApiToken = false;\n showApiClientId = false;\n refreshingTokens = false;\n updatingScope = false;\n\n protected abstract getUserProfile(): void;\n\n toggleApiTokenVisibility() {\n this.showApiToken = !this.showApiToken;\n }\n\n toggleApiClientIdVisibility() {\n this.showApiClientId = !this.showApiClientId;\n }\n\n refreshApiTokens() {\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmTitle'\n ),\n text: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshWarning'\n ),\n destructive: true,\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmLabel'\n )\n })\n .then(ok => {\n if (ok) {\n this.performTokenRefresh();\n }\n });\n }\n\n private performTokenRefresh() {\n this.refreshingTokens = true;\n this.userService\n .refreshUserApiTokens()\n .subscribe({\n next: ({ result }) => {\n mergeRefreshedApiKeys(this.user, result);\n\n this.showApiToken = false;\n this.showApiClientId = false;\n this.getUserProfile();\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.refreshingTokens = false;\n this.cdr.markForCheck();\n });\n }\n\n get currentApiTokenScope(): string {\n return this.user?.api_keys?.api_token_scope ?? 'read_only';\n }\n\n changeApiTokenScope(scope: string) {\n if (this.updatingScope || scope === this.currentApiTokenScope) {\n return;\n }\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.APICredentials.ScopeConfirmTitle'\n ),\n text: this.translation.translate(\n scope === 'read_write'\n ? 'User.Subscriptions.APICredentials.ScopeWriteWarning'\n : 'User.Subscriptions.APICredentials.ScopeReadWarning'\n ),\n destructive: scope === 'read_write',\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.APICredentials.ScopeConfirmLabel'\n )\n })\n .then(ok => {\n if (ok) {\n this.performScopeUpdate(scope);\n }\n });\n }\n\n private performScopeUpdate(scope: string) {\n this.updatingScope = true;\n this.userService\n .updateApiTokenScope(scope)\n .subscribe({\n next: () => {\n if (!this.user.api_keys) {\n this.user.api_keys = {};\n }\n this.user.api_keys.api_token_scope = scope;\n this.toast.success(\n this.translation.translate('User.Subscriptions.APICredentials.ScopeUpdated')\n );\n this.cdr.markForCheck();\n },\n error: () => {\n this.toast.error(\n this.translation.translate(\n 'User.Subscriptions.APICredentials.ScopeUpdateFailed'\n )\n );\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.updatingScope = false;\n this.cdr.markForCheck();\n });\n }\n}\n","import { API_MCP_ACCESS_FLAG } from '@posiwise/common-services';\n\nimport { AccountApiCredentials } from './account-api-credentials';\nimport { mcpHostBase } from './account-details.utils';\n\n/** MCP endpoint and registered-app connections of the account page (undecorated base). */\nexport abstract class AccountMcpConnections extends AccountApiCredentials {\n connections: {\n id: number;\n client_name: string;\n created_at: string;\n expires_at: string;\n last_used_at: string | null;\n }[] = [];\n loadingConnections = false;\n\n /** Gates both the credentials card and the registered apps card. */\n get apiMcpEnabled(): boolean {\n return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG];\n }\n\n /**\n * Tenant-dynamic MCP endpoint URL, resolved from the host the user is on.\n * The MCP host is always `brain-api-mcp.{env}.{company-domain}`, so the\n * environment segment has to survive the swap:\n * www.dev.posiwise.com -> brain-api-mcp.dev.posiwise.com\n * www.go.posiwise.com -> brain-api-mcp.go.posiwise.com\n * www.posiwise.com -> brain-api-mcp.go.posiwise.com (apex = PROD)\n * Stripping the first label unconditionally (the previous behaviour) broke\n * PROD, where the app is also served from the apex: it produced\n * `brain-api-mcp.posiwise.com`, which does not exist in DNS.\n */\n get mcpEndpointUrl(): string {\n const url = `https://brain-api-mcp.${mcpHostBase(window.location.hostname)}/mcp`;\n const shard = this.user?.user_shard;\n return shard ? `${url}?user_shard=${encodeURIComponent(shard)}` : url;\n }\n\n /** Tenant company name (domain-metadata driven), falling back to PosiWise. */\n get mcpCompanyName(): string {\n return this.appConfig?.company?.name || 'PosiWise';\n }\n\n loadConnections() {\n this.loadingConnections = true;\n this.userService\n .getMcpConnections()\n .subscribe({\n next: response => {\n this.connections = response?.result ?? [];\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.loadingConnections = false;\n this.cdr.markForCheck();\n });\n }\n\n deregisterConnection(id: number) {\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterConfirmTitle'\n ),\n text: this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterConfirmText'\n ),\n destructive: true,\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterConfirmButton'\n )\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n\n this.userService.deleteMcpConnection(id).subscribe({\n next: () => {\n // Success toast comes from the backend response (handled by the\n // HTTP interceptor); no client-side toast to avoid a duplicate.\n this.loadConnections();\n },\n error: () => {\n this.toast.error(\n this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterFailed'\n )\n );\n }\n });\n });\n }\n}\n","import { ElementRef, inject } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\n\nimport { AuthService } from '@posiwise/common-services';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { passwordMatcher } from './account-details.utils';\nimport { AccountMcpConnections } from './account-mcp-connections';\n\n/** E-mail change and password change/reset flows of the account page (undecorated base). */\nexport abstract class AccountSecurityForms extends AccountMcpConnections {\n protected readonly fb = inject(FormBuilder);\n private readonly authService = inject(AuthService);\n\n abstract passwordRef: ElementRef;\n\n emailForm: FormGroup = this.fb.group({\n email: ['', [Validators.required, Validators.email]]\n });\n\n passwordForm: FormGroup = this.fb.group(\n {\n currentPassword: ['', [Validators.required]],\n newPassword: ['', [Validators.required, Validators.minLength(8)]],\n confirmPassword: ['', [Validators.required, Validators.minLength(8)]]\n },\n {\n validators: passwordMatcher\n }\n );\n\n validatedEmail: string;\n\n toggleEmail: boolean;\n togglePassword: boolean;\n\n passwordVerified = false;\n isCurrentPasswordValid = true;\n\n passwordBusyButton = false;\n emailBusyButton = false;\n validatePasswordBusyButton = false;\n\n /**\n * Updates Email Address\n * this needs to be separate and requires the email to be validated from email before it's actually changed\n */\n onEmailFormSubmit() {\n this.emailBusyButton = true;\n const data = this.emailForm.value;\n data.confirmation_path = 'confirm-email';\n\n if (data && this.passwordVerified) {\n this.userService\n .updateEmail(data)\n .subscribe(() => {\n this.emailForm.reset();\n this.passwordVerified = false;\n this.toast.success(\n this.translation.translate('User.Account.Message.VerificationEmailSent', {\n email: data.email\n }),\n '',\n {\n positionClass: 'toast-top-center',\n timeOut: 100000\n }\n );\n this.cdr.markForCheck();\n })\n .add(() => {\n this.emailBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n validatePassword() {\n this.validatePasswordBusyButton = true;\n const password = this.passwordRef.nativeElement.value;\n if (password) {\n this.userService\n .checkPassword({ password })\n .subscribe(data => {\n if (data?.result?.status === StatusCodes.OK) {\n this.passwordVerified = true;\n } else {\n this.toast.error(data['error'].message);\n this.passwordRef.nativeElement.value = '';\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.validatePasswordBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n checkValidity() {\n const password = this.passwordRef.nativeElement.value;\n if (password.length > 5) {\n this.isCurrentPasswordValid = false;\n } else {\n this.isCurrentPasswordValid = true;\n }\n }\n\n onPasswordFormSubmit() {\n if (this.passwordForm.valid) {\n this.passwordBusyButton = true;\n const data = {\n password: this.passwordForm.value['newPassword'],\n password_confirmation: this.passwordForm.value['confirmPassword'],\n old_password: this.passwordForm.value['currentPassword']\n };\n this.userService\n .updatePassword(data)\n .subscribe(response => {\n if (response.status_code === 200) {\n this.toast.success(response.message, '', {\n positionClass: 'toast-top-center'\n });\n this.onTogglePassword();\n } else {\n this.toast.error(response['error'].message);\n }\n this.passwordForm.reset();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.passwordBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n sendMailToResetPassword() {\n this.authService.forgotPassword(this.user.email, 'reset-password').subscribe(() => {\n this.toast.success(this.translation.translate('User.Account.Message.CheckEmail'));\n this.cdr.markForCheck();\n });\n }\n\n onToggleEmail() {\n this.emailForm.reset();\n this.passwordVerified = false;\n this.toggleEmail = false;\n }\n\n onTogglePassword() {\n this.passwordForm.reset();\n this.togglePassword = false;\n }\n\n shouldUserChangeEmail() {\n if (this.user.has_password) {\n this.toggleEmail = !this.toggleEmail;\n } else {\n this.confirmDialog.open({\n textKey: 'User.Account.Email.NoPassword',\n confirmOnly: true\n });\n }\n }\n}\n","import { inject } from '@angular/core';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { dataUrlToBlob } from './account-details.utils';\nimport { AccountSecurityForms } from './account-security-forms';\n\n/** Avatar upload and username (slug) editing of the account page (undecorated base). */\nexport abstract class AccountAvatarSlug extends AccountSecurityForms {\n protected readonly modalService = inject(NgbModal);\n\n image = 'assets/img/icons/male.png';\n\n toggleNickName: boolean;\n\n slug: string;\n\n slugBusyButton = false;\n\n openModal(content) {\n this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });\n }\n\n onUpdateSlug() {\n this.slugBusyButton = true;\n this.userService\n .updateSlug(this.slug)\n .subscribe(response => {\n this.toggleNickName = false;\n if (response?.result?.status === StatusCodes.OK) {\n this.getUserProfile();\n } else {\n this.toast.error('User.Account.UserNameError');\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.slugBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onImageSelection(event) {\n const blob = this.dataURLtoBlob(event);\n const filename = `${`${this.slug.toLocaleLowerCase()}_${Date.parse(\n new Date().toString()\n )}`}.png`;\n const file: File = new File([blob], filename);\n this.userService.addAvatar(file).subscribe(res => {\n this.image = res?.result?.user_avatar[2]?.url;\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n });\n }\n\n dataURLtoBlob(dataUrl: string) {\n return dataUrlToBlob(dataUrl);\n }\n\n onClose() {\n this.modalService.dismissAll();\n }\n}\n","import { forkJoin, Observable, of, throwError } from 'rxjs';\nimport { catchError, switchMap } from 'rxjs/operators';\n\n/** Shared by the subscription credentials page and the account page's \"My credentials\". */\n\n// Compares the label users see (\"partner_id\" → \"partner id\"), so underscores don't skew the order.\nexport function sortByLabel<T>(items: T[], label: (item: T) => string | null | undefined): T[] {\n const text = (item: T) => (label(item) ?? '').replace(/[_-]+/g, ' ').trim();\n return [...items].sort((a, b) =>\n text(a).localeCompare(text(b), undefined, { sensitivity: 'base', numeric: true })\n );\n}\n\n// An empty value keeps the stored one, and a value still starting with \"***\" is the masked copy the API\n// returned, not a new value: neither is sent.\nexport function changedCredentials<T extends { value?: unknown }>(rows: T[]): T[] {\n return rows.filter(row => row?.value && !String(row.value).startsWith('***'));\n}\n\n/** Credentials grouped by their type name, in the order the types first appear. */\nexport function credentialsByName<T extends { name: string }>(items: T[]): Map<string, T[]> {\n const groups = new Map<string, T[]>();\n for (const item of items) {\n groups.set(item.name, [...(groups.get(item.name) ?? []), item]);\n }\n return groups;\n}\n\nclass RequestFailure {\n constructor(readonly error: unknown) {}\n}\n\n/**\n * Emits every response once all requests have finished, or fails with the first error after they have.\n * forkJoin alone would cancel the rest client-side while the server still saves them, so the screen would\n * report a failure for values that were in fact stored. Emits [] when there is nothing to send.\n */\nexport function runAllThenReport(requests: Observable<unknown>[]): Observable<unknown[]> {\n if (!requests.length) {\n return of([]);\n }\n return forkJoin(\n requests.map(request => request.pipe(catchError(error => of(new RequestFailure(error)))))\n ).pipe(\n switchMap(results => {\n const failure = results.find(result => result instanceof RequestFailure);\n return failure ? throwError(() => failure.error) : of(results);\n })\n );\n}\n","import { Directive, HostListener, inject } from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\n@Directive({ selector: 'input[pwClearMaskedOnFocus]' })\nexport class ClearMaskedOnFocusDirective {\n private readonly control = inject(NgControl, { optional: true, self: true });\n\n @HostListener('focus', ['$event'])\n onFocus(event: FocusEvent): void {\n const input = event.target as HTMLInputElement;\n const value = input?.value ?? '';\n if (/\\*{3,}/.test(value)) {\n this.control?.control?.setValue('');\n input.value = '';\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nconst ACRONYMS = new Set([\n 'id',\n 'url',\n 'api',\n 'aws',\n 'smtp',\n 'ssl',\n 'tls',\n 'iam',\n 'sso',\n 'sdk',\n 'jwt',\n 'oauth'\n]);\n\n@Pipe({ name: 'subscriptionNameById' })\nexport class SubscriptionNameByIdPipe implements PipeTransform {\n transform(\n subs:\n | { id: number | string; organisation?: string; organization?: string; name?: string }[]\n | null\n | undefined,\n id: number | string | null | undefined\n ): string {\n if (!subs || id == null) return '';\n const found = subs.find(s => String(s.id) === String(id));\n return (found?.organisation || found?.organization || found?.name || '') as string;\n }\n}\n\n@Pipe({ name: 'credentialAvatarHue' })\nexport class CredentialAvatarHuePipe implements PipeTransform {\n transform(value: string | null | undefined): number {\n if (!value) return 215;\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 31 + value.charCodeAt(i)) | 0;\n }\n return Math.abs(hash) % 360;\n }\n}\n\n@Pipe({ name: 'humanizeCredentialName' })\nexport class HumanizeCredentialNamePipe implements PipeTransform {\n transform(value: string | null | undefined): string {\n if (!value) return '';\n return value\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map(word =>\n ACRONYMS.has(word.toLowerCase())\n ? word.toUpperCase()\n : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()\n )\n .join(' ');\n }\n}\n","import { FormControl, FormGroup } from '@angular/forms';\n\nimport { UserCredentialRow } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\n\nimport {\n changedCredentials,\n credentialsByName,\n sortByLabel\n} from '../../credentials/credential-helpers';\nimport { HumanizeCredentialNamePipe } from '../../subscriptions/subscription-credential/humanize-credential-name.pipe';\n\nexport type CredentialForm = FormGroup<Record<string, FormControl<string | null>>>;\n\n/** The fields of one credential type (e.g. personal_smtp), in the order the API lists them. */\nexport interface CredentialGroup {\n name: string;\n rows: UserCredentialRow[];\n configured: boolean;\n}\n\n/** A translation key with its parameters, rendered through the transloco pipe. */\nexport interface TextRef {\n key: string;\n params?: Record<string, string>;\n}\n\n/**\n * Types and fields with their own translation keys. Any other user-scoped type the API defines still\n * renders through `humanizeCredentialName` and the API's description, so a new type needs no frontend change.\n */\nconst NAME_KEYS: Record<string, string> = { personal_smtp: 'PersonalSmtp' };\nconst FIELD_KEYS: Record<string, string> = {\n address: 'Address',\n port: 'Port',\n user_name: 'UserName',\n password: 'Password',\n from_email: 'FromEmail'\n};\nconst humanize = new HumanizeCredentialNamePipe();\n\nexport function credentialGroups(rows: UserCredentialRow[]): CredentialGroup[] {\n return [...credentialsByName(rows)].map(([name, fields]) => ({\n name,\n rows: fields,\n configured: fields.some(field => field.configured)\n }));\n}\n\nexport function credentialNameKey(name: string, part: 'Title' | 'Description'): string | null {\n return NAME_KEYS[name] ? `User.Credentials.${NAME_KEYS[name]}.${part}` : null;\n}\n\n/** Dropdown options with a finished label, so the option's accessible name is the title, not the object. */\nexport function credentialTypeOptions(\n groups: CredentialGroup[],\n translate: (key: string) => string\n): { name: string; label: string }[] {\n const options = groups.map(({ name }) => {\n const key = credentialNameKey(name, 'Title');\n return { name, label: key ? translate(key) : humanize.transform(name) };\n });\n return sortByLabel(options, option => option.label);\n}\n\nexport function credentialFieldKey(field: string): string | null {\n return FIELD_KEYS[field] ? `User.Credentials.Field.${FIELD_KEYS[field]}.Label` : null;\n}\n\n/** \"Enter the …\" in sentence case (admin-edit-form.md § 4); the port, a number, has none. */\nexport function credentialPlaceholder(field: string): TextRef | null {\n if (field === 'port') {\n return null;\n }\n if (FIELD_KEYS[field]) {\n return { key: `User.Credentials.Field.${FIELD_KEYS[field]}.Placeholder` };\n }\n const noun = humanize\n .transform(field)\n .split(' ')\n .map(word => (word === word.toUpperCase() ? word : word.toLowerCase()))\n .join(' ');\n return { key: 'User.Credentials.Field.GenericPlaceholder', params: { field: noun } };\n}\n\n/** Only the fields the user typed into (shared rule: empty and still-masked values are not sent). */\nexport function enteredValues(\n rows: UserCredentialRow[],\n values: Record<string, unknown>\n): { credentialId: number; value: string }[] {\n return changedCredentials(\n rows.map(row => ({\n credentialId: row.credential_id,\n value: `${values[row.credential_id] ?? ''}`.trim()\n }))\n );\n}\n\n/**\n * One control per field, keyed by credential id, prefilled with the masked value the API returned, as on the\n * subscription credentials page: `pwClearMaskedOnFocus` empties it when clicked, and a value left masked is not sent.\n */\nexport function credentialForm(rows: UserCredentialRow[]): CredentialForm {\n return new FormGroup(\n Object.fromEntries(\n rows.map(row => [\n `${row.credential_id}`,\n new FormControl<string | null>(row.configured ? (row.value ?? '') : '')\n ])\n )\n );\n}\n\n/** A subscription in the picker: organisations repeat (one subscription per product), so its products tell them apart. */\nexport interface SubscriptionOption {\n id: number;\n organisation: string;\n products: string;\n}\n\nexport function subscriptionOptions(subscriptions: Subscription[]): SubscriptionOption[] {\n return subscriptions.map(subscription => ({\n id: subscription.id,\n organisation: subscription.organisation,\n products: (subscription.products ?? [])\n .map(product => product.name)\n .filter(Boolean)\n .join(', ')\n }));\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n inject,\n Input,\n OnInit,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\n\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { UserService } from '@posiwise/common-services';\nimport { ConfirmDialogService, InputContainerComponent } from '@posiwise/shared-components';\n\nimport { Select } from 'primeng/select';\nimport { Observable, Subscription as RxSubscription } from 'rxjs';\nimport { finalize } from 'rxjs/operators';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\n\nimport { runAllThenReport } from '../../credentials/credential-helpers';\nimport { ClearMaskedOnFocusDirective } from '../../subscriptions/subscription-credential/clear-masked-on-focus.directive';\nimport {\n CredentialAvatarHuePipe,\n HumanizeCredentialNamePipe\n} from '../../subscriptions/subscription-credential/humanize-credential-name.pipe';\n\nimport {\n credentialFieldKey,\n CredentialForm,\n credentialForm,\n CredentialGroup,\n credentialGroups,\n credentialNameKey,\n credentialPlaceholder,\n credentialTypeOptions,\n enteredValues,\n SubscriptionOption,\n subscriptionOptions\n} from './account-user-credentials.utils';\n\n/** \"My credentials\" on the account page: the user's own credentials per subscription, shown like subscription credentials. */\n@Component({\n selector: 'pw-account-user-credentials',\n templateUrl: './account-user-credentials.component.html',\n styleUrl: '../../credentials/credential-cards.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n ReactiveFormsModule,\n Select,\n InputContainerComponent,\n AppLoaderComponent,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n ClearMaskedOnFocusDirective,\n TranslocoPipe\n ]\n})\nexport class AccountUserCredentialsComponent implements OnInit {\n private readonly userService = inject(UserService);\n private readonly confirmDialog = inject(ConfirmDialogService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly transloco = inject(TranslocoService);\n private loadRequest?: RxSubscription;\n\n @Input({ required: true }) userId: number;\n\n readonly subscriptions = signal<SubscriptionOption[]>([]);\n readonly groups = signal<CredentialGroup[]>([]);\n readonly selectedName = signal<string | null>(null);\n readonly editing = signal(false);\n readonly showForm = signal(false);\n readonly form = signal<CredentialForm>(credentialForm([]));\n readonly loading = signal(true);\n readonly saving = signal(false);\n readonly subscriptionControl = new FormControl<number | null>(null);\n\n readonly saved = computed(() => this.groups().filter(group => group.configured));\n readonly addable = computed(() => this.groups().filter(group => !group.configured));\n readonly typeOptions = computed(() =>\n credentialTypeOptions(this.addable(), key => this.transloco.translate(key))\n );\n readonly selected = computed(() =>\n this.groups().find(group => group.name === this.selectedName())\n );\n\n readonly nameKey = credentialNameKey;\n readonly fieldKey = credentialFieldKey;\n readonly placeholder = credentialPlaceholder;\n\n ngOnInit() {\n this.subscriptionControl.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(id => this.loadCredentials(id));\n this.userService.getUserSubscriptions(this.userId).subscribe({\n next: ({ result }) => {\n this.subscriptions.set(subscriptionOptions(result?.subscriptions ?? []));\n const first = this.subscriptions()[0]?.id ?? null;\n if (first) {\n this.subscriptionControl.setValue(first);\n } else {\n this.loading.set(false);\n }\n },\n error: () => this.loading.set(false)\n });\n }\n\n /** No group adds a new type (picked from the dropdown); a group edits that saved credential. */\n open(group?: CredentialGroup) {\n this.editing.set(!!group);\n this.select(group?.name ?? null);\n this.showForm.set(true);\n }\n\n select(name: string | null) {\n this.selectedName.set(name);\n this.form.set(credentialForm(this.selected()?.rows ?? []));\n }\n\n cancel() {\n this.showForm.set(false);\n this.selectedName.set(null);\n }\n\n save() {\n const group = this.selected();\n const subscriptionId = this.subscriptionControl.value;\n const entries = group ? enteredValues(group.rows, this.form().getRawValue()) : [];\n if (!entries.length || !subscriptionId) {\n return;\n }\n this.run(\n runAllThenReport(\n entries.map(e =>\n this.userService.saveUserCredential(subscriptionId, e.credentialId, e.value)\n )\n )\n );\n }\n\n remove(group: CredentialGroup) {\n const subscriptionId = this.subscriptionControl.value;\n const saved = group.rows.filter(row => row.configured);\n if (!subscriptionId || !saved.length) {\n return;\n }\n this.confirmDialog\n .confirmDelete({\n titleKey: 'User.Credentials.RemoveTitle',\n textKey: 'User.Credentials.RemoveText',\n confirmLabelKey: 'User.Credentials.Remove'\n })\n .then(ok => {\n if (ok) {\n this.run(\n runAllThenReport(\n saved.map(row =>\n this.userService.deleteUserCredential(\n subscriptionId,\n row.credential_id\n )\n )\n )\n );\n }\n });\n }\n\n /** Success and error toasts come from the API response through the HTTP interceptor. */\n private run(request: Observable<unknown>) {\n this.saving.set(true);\n request.pipe(finalize(() => this.saving.set(false))).subscribe({\n next: () => {\n this.cancel();\n this.loadCredentials(this.subscriptionControl.value);\n }\n });\n }\n\n private loadCredentials(subscriptionId: number | null) {\n if (!subscriptionId) {\n return;\n }\n this.cancel();\n this.loadRequest?.unsubscribe(); // a slower reply for the previous subscription must not land after this one\n this.loading.set(true);\n this.groups.set([]); // a failed load must not leave the previous subscription's credentials on screen\n this.loadRequest = this.userService\n .getUserCredentials(subscriptionId)\n .pipe(finalize(() => this.loading.set(false)))\n .subscribe({ next: ({ result }) => this.groups.set(credentialGroups(result ?? [])) });\n }\n}\n","@if (subscriptions().length > 0) {\n <section id=\"user-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Credentials.Title' | transloco }}</h2>\n <p>{{ 'User.Credentials.Description' | transloco }}</p>\n </div>\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Subscription' | transloco\"\n name=\"credential_subscription\"\n controlId=\"user-credentials-subscription\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-subscription-label'\"\n [options]=\"subscriptions()\"\n optionLabel=\"organisation\"\n optionValue=\"id\"\n appendTo=\"body\"\n [formControl]=\"subscriptionControl\"\n placeholder=\"{{ 'User.Credentials.SelectSubscription' | transloco }}\">\n <ng-template #selectedItem let-option>\n {{ option.organisation }}\n @if (option.products) {\n <span class=\"subscription-option-products\">· {{ option.products }}</span>\n }\n </ng-template>\n <ng-template #item let-option>\n <div class=\"subscription-option\">\n <div>{{ option.organisation }}</div>\n @if (option.products) {\n <div class=\"subscription-option-products\">{{ option.products }}</div>\n }\n </div>\n </ng-template>\n </p-select>\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loading()\"></pw-loader>\n @if (!loading()) {\n @if (groups().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.NoneAvailable' | transloco }}</p>\n } @else if (showForm()) {\n <form class=\"user-credentials-form\"\n [formGroup]=\"form()\"\n (ngSubmit)=\"save()\">\n @if (editing() && selected(); as group) {\n <h3><ng-container *ngTemplateOutlet=\"titleOf; context: { $implicit: group.name }\"></ng-container></h3>\n } @else {\n <div class=\"row\">\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Type' | transloco\"\n name=\"credential_type\"\n controlId=\"user-credentials-type\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-type-label'\"\n [options]=\"typeOptions()\"\n optionLabel=\"label\"\n optionValue=\"name\"\n appendTo=\"body\"\n [placeholder]=\"'User.Credentials.SelectType' | transloco\"\n (onChange)=\"select($event.value)\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n }\n @if (selected(); as group) {\n @if (nameKey(group.name, 'Description'); as descriptionKey) {\n <p class=\"text-muted\">{{ descriptionKey | transloco }}</p>\n } @else if (group.rows[0].description) {\n <p class=\"text-muted\">{{ group.rows[0].description }}</p>\n }\n <div class=\"row\">\n @for (row of group.rows; track row.credential_id) {\n <div class=\"col-12 col-md-4\">\n @let hint = placeholder(row.field);\n <pw-input-container [label]=\"fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName)\"\n [name]=\"row.field\"\n [controlId]=\"'user-credential-' + row.credential_id\">\n <input class=\"form-control\"\n [id]=\"'user-credential-' + row.credential_id\"\n type=\"text\"\n pwClearMaskedOnFocus\n [formControlName]=\"'' + row.credential_id\"\n autocomplete=\"off\"\n [placeholder]=\"hint ? (hint.key | transloco: hint.params) : ''\"/>\n </pw-input-container>\n </div>\n }\n </div>\n }\n <div class=\"d-flex gap-2 mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n [disabled]=\"saving()\"\n (click)=\"cancel()\">\n {{ 'User.Credentials.Cancel' | transloco }}\n </button>\n @if (selected()) {\n <button type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving()\">\n {{ 'User.Credentials.Save' | transloco }}\n </button>\n }\n </div>\n </form>\n } @else {\n @if (saved().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.Empty' | transloco }}</p>\n }\n <ul class=\"credential-grid\">\n @for (group of saved(); track group.name) {\n @let title = nameKey(group.name, 'Title') ? (nameKey(group.name, 'Title')! | transloco) : (group.name | humanizeCredentialName);\n <li class=\"credential-card\">\n <header class=\"credential-card-header\" [style.--avatar-hue]=\"group.name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">{{ title.charAt(0) }}</span>\n <h3 class=\"credential-card-title\">{{ title }}</h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\"\n class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Credentials.Edit' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"open(group)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Credentials.Remove' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"remove(group)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (row of group.rows; track row.credential_id) {\n @if (row.configured) {\n <div class=\"credential-card-row\">\n <dt>{{ fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName) }}</dt>\n <dd><code class=\"credential-card-value\">{{ row.value }}</code></dd>\n </div>\n }\n }\n </dl>\n </li>\n }\n </ul>\n @if (addable().length > 0) {\n <button type=\"button\"\n class=\"btn btn-outline-primary btn-sm mt-3\"\n (click)=\"open()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Credentials.Add' | transloco }}\n </button>\n }\n }\n }\n </div>\n </div>\n </section>\n}\n<ng-template #titleOf let-name>{{ nameKey(name, 'Title') ? (nameKey(name, 'Title') | transloco) : (name | humanizeCredentialName) }}</ng-template>\n","import { AsyncPipe, DatePipe, DecimalPipe, NgClass } from '@angular/common';\nimport { Component, ElementRef, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport {\n NgxGpAutocompleteDirective,\n NgxGpAutocompleteModule\n} from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { GeoService, ProfileService } from '@posiwise/common-services';\nimport { AppUser, Country } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { InputContainerComponent, PwStickyActionsComponent } from '@posiwise/shared-components';\nimport { ProfileImageCropperComponent, ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Select } from 'primeng/select';\nimport { Tooltip } from 'primeng/tooltip';\nimport { combineLatest, map, Observable } from 'rxjs';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { NgbInputDatepicker } from '@ng-bootstrap/ng-bootstrap';\n\nimport { AccountAvatarSlug } from './account-avatar-slug';\nimport { copyApiKeysToUser, toDobStruct } from './account-details.utils';\nimport { AccountUserCredentialsComponent } from './account-user-credentials/account-user-credentials.component';\n\n@Component({\n selector: 'pw-account-details',\n templateUrl: './account-details.component.html',\n styleUrls: ['./account-details.component.scss'],\n imports: [\n Bind,\n ProgressSpinner,\n LazyImgDirective,\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Select,\n NgbInputDatepicker,\n NgxGpAutocompleteModule,\n PwStickyActionsComponent,\n ButtonBusyDirective,\n Tooltip,\n NgClass,\n AppLoaderComponent,\n ProfileImageCropperComponent,\n AccountUserCredentialsComponent,\n AsyncPipe,\n DecimalPipe,\n DatePipe,\n TranslocoPipe\n ]\n})\nexport class AccountDetailsComponent extends AccountAvatarSlug implements OnInit, OnDestroy {\n private readonly geoService = inject(GeoService);\n private readonly profileService = inject(ProfileService);\n private readonly transloco = inject(TranslocoService);\n\n @ViewChild('ngxPlaces') placesRef: NgxGpAutocompleteDirective;\n @ViewChild('password', { static: false }) passwordRef: ElementRef;\n\n profileForm: FormGroup = AppUser.getForm(new AppUser({}));\n\n countries$: Observable<Country[]>;\n\n states: Country[] = [];\n\n selectedState;\n\n isLoaded = false;\n profileBusyButton = false;\n\n ngOnInit() {\n console.log('AccountDetailsComponent.ngOnInit()');\n this.getUserProfile();\n this.loadConnections();\n this.geoService.getCountries().subscribe(() => {\n this.countries$ = combineLatest([\n this.geoService.getCountries(),\n this.transloco.selectTranslate('User.Profile.SelectCountry')\n ]).pipe(\n map(([countries, label]: [Country[], string]) => [\n { name: label, code: null },\n ...countries\n ])\n );\n this.cdr.markForCheck();\n });\n }\n\n handleAddressChange(_event) {\n this.profileForm.patchValue({\n latitude: _event.geometry.location.lat(),\n longitude: _event.geometry.location.lng(),\n location: _event.formatted_address\n });\n }\n\n protected getUserProfile() {\n this.userService\n .getUserInfo()\n .subscribe(user => {\n if (user) {\n this.user = user;\n this.slug = user.slug;\n if (user?.user_avatar?.length) {\n this.image = user?.user_avatar[2]?.url;\n }\n this.getRegion(user.country);\n copyApiKeysToUser(this.user);\n\n this.profileForm.patchValue(this.user);\n this.profileForm.patchValue({ dob: toDobStruct(user.dob) });\n this.validatedEmail = this.user.email;\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n handleImageError(event: Event, fallbackPath): void {\n HelperService.handleImageFallbackPath(event, fallbackPath);\n }\n\n @ValidateForm('profileForm')\n onProfileFormSubmit() {\n this.profileBusyButton = true;\n const data = { ...this.profileForm.value };\n data.dob = HelperService.dateFormat(this.profileForm.get('dob')?.value);\n if (data.location === '') {\n data.location = null;\n }\n Object.entries(data).forEach(([key, val]) => {\n if (val === '' || val === null) {\n delete data[key];\n }\n });\n this.profileService\n .updateUserProfile(data)\n .subscribe(() => {\n this.profileForm.markAsPristine();\n this.toast.success(this.translation.translate('User.Profile.ProfileUpdated'));\n this.cdr.markForCheck();\n })\n .add(() => {\n this.profileBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onAvatarSave() {\n const data = {\n avatar: this.profileForm.get('avatar')?.value\n };\n this.profileService.updateUserProfile(data).subscribe(() => {\n this.profileForm.markAsPristine();\n this.toast.success(this.translation.translate('User.Profile.ProfileUpdated'));\n this.cdr.markForCheck();\n });\n }\n\n getRegion(countryId: number | string) {\n if (countryId) {\n this.geoService.getRegions(countryId).subscribe(response => {\n this.states = [{ code: 0, name: 'Select State' }, ...response] as Country[];\n this.cdr.markForCheck();\n });\n }\n }\n}\n","<div class=\"w-100 text-center\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-4\">\n <section class=\"card p-4 h-100 d-flex flex-column\">\n <h2>{{ 'User.Profile.Avatar' | transloco }}</h2>\n <div class=\"text-center d-flex flex-column justify-content-center flex-grow-1 mt-1\">\n <div class=\"image-container\">\n <img [src]=\"image\"\n width=\"150\"\n height=\"150\"\n class=\"image rounded-circle\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">{{ 'User.Profile.Change' | transloco }}</div>\n </div>\n </div>\n <h4 class=\"mt-2\">{{ user?.first_name }} {{ user?.last_name }}</h4>\n <a [attr.aria-label]=\"'User.Profile.EditAvatar' | transloco\"\n class=\"d-inline-block mb-2\"\n (click)=\"openModal(content)\">\n {{ 'User.Profile.EditAvatar' | transloco }}</a>\n </div>\n </section>\n </div>\n <div class=\"col-md-8\">\n <section id=\"user-profile\"\n class=\"card p-4 overflow-visible h-100\">\n <form [formGroup]=\"profileForm\"\n (ngSubmit)=\"onProfileFormSubmit()\">\n <h2>{{ 'User.Profile.UserProfile' | transloco }}</h2>\n <div class=\"row mt-3\">\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n controlId=\"account-first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n id=\"account-first_name\"\n class=\"form-control\"\n formControlName=\"first_name\"\n autocomplete=\"given-name\" name=\"input_first_name_9\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PreferredName' | transloco\"\n name=\"preferred_name\"\n controlId=\"account-preferred_name\"\n errorMsg=\"User.Account.Details.Validation.PreferredName\">\n <input type=\"text\"\n id=\"account-preferred_name\"\n class=\"form-control\"\n formControlName=\"preferred_name\"\n autocomplete=\"username\" name=\"input_preferred_name_10\"\n [attr.aria-label]=\"'User.Account.Details.PreferredName' | transloco\"/>\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n controlId=\"account-country\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'account-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n placeholder=\"{{ 'User.Profile.SelectCountry' | transloco }}\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [label]=\"'User.Account.Details.Province' | transloco\"\n name=\"province\"\n controlId=\"account-province\"\n errorMsg=\"User.Account.Details.Validation.Province\">\n <input type=\"text\"\n id=\"account-province\"\n class=\"form-control\"\n formControlName=\"province\"\n autocomplete=\"postal-code\" name=\"input_province_11\"\n [attr.aria-label]=\"'User.Account.Details.Province' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.WebsiteUrl' | transloco\"\n name=\"website_url\"\n controlId=\"account-website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n id=\"account-website_url\"\n class=\"form-control\"\n formControlName=\"website_url\"\n autocomplete=\"url\" name=\"input_website_url_12\"\n [attr.aria-label]=\"'User.Account.Details.WebsiteUrl' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n controlId=\"account-last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n id=\"account-last_name\"\n class=\"form-control\"\n formControlName=\"last_name\"\n autocomplete=\"family-name\" name=\"input_last_name_13\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n controlId=\"account-dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"account-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Account.Details.DateOfBirthPlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ day: 1, month: 1, year: 1950 }\"\n [maxDate]=\"{ day: 31, month: 12, year: 2018 }\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n id=\"account-dob-trigger\"\n [attr.aria-label]=\"'User.Account.Details.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n controlId=\"account-state\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'account-state-label'\"\n [options]=\"states\"\n [(ngModel)]=\"selectedState\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n name=\"location\"\n controlId=\"account-location\"\n [useAriaLabelledbyOnly]=\"true\">\n <input ngx-gp-autocomplete\n id=\"account-location\"\n name=\"location\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'account-location-label'\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PhoneNumber' | transloco\"\n name=\"phone_number\"\n controlId=\"account-phone_number\"\n errorMsg=\"User.Account.Details.Validation.PhoneNumber\">\n <input type=\"text\"\n id=\"account-phone_number\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n autocomplete=\"tel\" name=\"input_phone_number_16\"\n [attr.aria-label]=\"'User.Account.Details.PhoneNumber' | transloco\"/>\n </pw-input-container>\n </div>\n <pw-sticky-actions>\n <button class=\"btn btn-raised btn-primary\" [buttonBusy]=\"profileBusyButton\">\n {{ 'Button.Save' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n </section>\n </div>\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-6\">\n <section id=\"email-section\"\n class=\"card p-4 h-100\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.RegisteredEmail' | transloco }}</h2>\n <section id=\"email-form\">\n <form [formGroup]=\"emailForm\"\n (ngSubmit)=\"onEmailFormSubmit()\">\n <!-- Email Address -->\n <div class=\"mt-0\">\n <span id=\"account-primary-email-label\" class=\"me-3 pw-label-style\">{{ 'User.Account.PrimaryEmail' | transloco }}:\n </span>\n <strong>{{ validatedEmail }}</strong>\n <div class=\"mt-1\">\n @if (!toggleEmail) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangeEmail' | transloco\"\n (click)=\"shouldUserChangeEmail()\">\n {{ 'User.Account.ChangeEmail' | transloco }}</a>\n }\n @if (toggleEmail) {\n <div class=\"row\">\n <div class=\"clearfix\"></div>\n <div class=\"col-12 mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\"\n class=\"form-control\"\n id=\"account-email-current-password\"\n name=\"currentPassword\"\n #password\n [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n autocomplete=\"current-password\"\n (keyup)=\"checkValidity()\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n @if (passwordVerified) {\n <input type=\"text\"\n class=\"form-control\"\n id=\"account-new-email\"\n name=\"newEmail\"\n [placeholder]=\"'User.Account.Details.NewEmail' | transloco\"\n autocomplete=\"email\"\n formControlName=\"email\"\n [attr.aria-label]=\"'User.Account.Details.NewEmail' | transloco\" />\n }\n </div>\n <div class=\"col-12\">\n @if (toggleEmail) {\n <a\n class=\"btn btn-raised btn-outline-default my-2 me-2\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"onToggleEmail()\">{{ 'Button.Cancel' | transloco }}</a>\n }\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\"\n type=\"submit\"\n [buttonBusy]=\"validatePasswordBusyButton\"\n (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">\n {{ 'User.Account.Validate' | transloco }}\n </button>\n }\n @if (passwordVerified) {\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [buttonBusy]=\"emailBusyButton\"\n >\n {{\n 'User.Account.SendVerification' | transloco\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n </div>\n <section id=\"slug\"\n class=\"mb-2 mt-3\">\n <div>\n <span class=\"me-3 pw-label-style\" id=\"account-nickname-label\">{{ 'User.Account.NickName' | transloco }}:</span>\n <span class=\"tooltip-wrap me-3\" [pTooltip]=\"'User.Account.HandleTooltip' | transloco\" [appendTo]=\"'body'\" tooltipPosition=\"top\"><i class=\"far fa-info-circle text-muted\"></i></span>\n <strong>{{ slug }}</strong>\n <div class=\"mt-1\">\n @if (!toggleNickName) {\n <a class=\"btn btn-raised btn-outline-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangeNickname' | transloco\"\n (click)=\"toggleNickName = true\">\n {{ 'User.Account.ChangeNickname' | transloco }}</a>\n }\n @if (toggleNickName) {\n <div class=\"mb-3\">\n <input type=\"text\"\n id=\"account-nickname\"\n name=\"nickname\"\n class=\"form-control slug-input\"\n aria-labelledby=\"account-nickname-label\"\n [(ngModel)]=\"slug\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.aria-label]=\"'User.Account.NickName' | transloco\" />\n </div>\n <div>\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default\"\n (click)=\"toggleNickName = false\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"slugBusyButton\"\n [disabled]=\"slug?.length < 2\"\n (click)=\"onUpdateSlug()\">\n {{ 'User.Account.UpdateNickname' | transloco }}\n </button>\n </div>\n }\n </div>\n </div>\n </section>\n </form>\n </section>\n </div>\n </div>\n </section>\n </div>\n <div class=\"col-md-6\">\n <section id=\"password-change\"\n class=\"card p-4 h-100\">\n <form [formGroup]=\"passwordForm\"\n (ngSubmit)=\"onPasswordFormSubmit()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.ChangePassword' | transloco }}</h2>\n </div>\n @if (!user?.has_password) {\n <div class=\"text-danger mx-3 my-2\">\n <div>\n {{ 'User.Account.Details.NoPassword' | transloco }}\n <em>{{ 'User.Account.ChangePassword' | transloco }}</em>.\n </div>\n <div>{{ 'User.Profile.PictureMessage' | transloco }}</div>\n </div>\n }\n @if (user?.has_password) {\n <div class=\"col-12\"\n >\n @if (togglePassword) {\n <div class=\"mb-3\">\n <label for=\"account-current-password\">{{ 'User.Account.CurrentPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-current-password\"\n class=\"form-control\"\n formControlName=\"currentPassword\"\n autocomplete=\"current-password\" name=\"input_currentPassword_4\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\"/>\n @if (\n !passwordForm.get('currentPassword').valid &&\n (passwordForm.get('currentPassword').dirty ||\n passwordForm.get('currentPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >\n {{ 'User.Account.Required' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-new-password\">{{ 'User.Account.NewPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autocomplete=\"new-password\" name=\"input_newPassword_5\"\n [attr.aria-label]=\"'User.Account.NewPassword' | transloco\"/>\n @if (\n !passwordForm.get('newPassword').valid &&\n (passwordForm.get('newPassword').dirty ||\n passwordForm.get('newPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >{{ 'User.Account.Validation.StrongPassword' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-confirm-password\">{{\n 'User.Account.ConfirmPassword' | transloco\n }}</label>\n <input type=\"password\"\n id=\"account-confirm-password\"\n class=\"form-control\"\n formControlName=\"confirmPassword\"\n autocomplete=\"new-password\" name=\"input_confirmPassword_6\"\n [attr.aria-label]=\"'User.Account.ConfirmPassword' | transloco\"/>\n @if (\n passwordForm.get('confirmPassword').touched &&\n passwordForm.get('confirmPassword').errors\n ?.MatchPassword\n ) {\n <div class=\"text-danger\"\n >\n {{ 'User.Account.Validation.PasswordsMatch' | transloco }}\n </div>\n }\n </div>\n <div class=\"mb-3\">\n @if (togglePassword) {\n <a class=\"btn btn-raised btn-outline-default\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n data-bs-target=\"\"\n (click)=\"onTogglePassword()\">\n {{ 'Button.Cancel' | transloco }}</a>\n }\n <button class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"passwordBusyButton\"\n [disabled]=\"!passwordForm.valid\">\n {{ 'User.Account.UpdatePassword' | transloco }}\n </button>\n </div>\n }\n <div>\n @if (!togglePassword) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"togglePassword = !togglePassword\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n }\n </div>\n </div>\n }\n @if (!user?.has_password) {\n <div class=\"col-12\"\n >\n <a class=\"btn btn-raised btn-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"sendMailToResetPassword()\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n </div>\n }\n </div>\n </form>\n </section>\n </div>\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"api-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.APICredentials.Description' | transloco: { company: mcpCompanyName } }}\n </p>\n <p class=\"text-muted small mb-2\">\n <i class=\"fas fa-link me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.McpEndpointNote' | transloco: { url: mcpEndpointUrl, company: mcpCompanyName } }}\n </p>\n <!-- pb (not mb): .card .mb-3:last-child is margin-reset in this component's scss -->\n <p class=\"text-muted small mb-0 pb-3\">\n <i class=\"fas fa-info-circle me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.SubscriptionClientIdNote' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-token\">{{ 'User.Account.APIUserToken' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? user?.api_keys?.api_user_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-client-id\">{{ 'User.Account.APIUserId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? user?.api_keys?.api_user_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (user?.api_keys?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits | number }}</span>\n }\n @if (user?.api_keys?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (user?.api_keys?.api_hits !== null && user?.api_keys?.api_hits_max !== null && user?.api_keys?.api_hits_max > 0) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.8,\n 'text-warning': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.8 && (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.9,\n 'text-danger': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((user.api_keys.api_hits / user.api_keys.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <label class=\"form-label\">{{ 'User.Subscriptions.APICredentials.ScopeLabel' | transloco }}</label>\n <div class=\"d-flex align-items-center flex-wrap gap-2\">\n <div class=\"btn-group\" role=\"group\"\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ScopeLabel' | transloco\">\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_only' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_only')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadOnly' | transloco }}\n </button>\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_write' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_write')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadWrite' | transloco }}\n </button>\n </div>\n <span class=\"text-muted small\">{{ 'User.Subscriptions.APICredentials.ScopeHint' | transloco }}</span>\n </div>\n </div>\n </div>\n </section>\n </div>\n }\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"registered-apps\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.RegisteredApps.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.RegisteredApps.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loadingConnections\"></pw-loader>\n @if (!loadingConnections) {\n @if (connections.length === 0) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.RegisteredApps.NoApps' | transloco }}</p>\n }\n @for (conn of connections; track conn.id) {\n <div class=\"d-flex align-items-center justify-content-between py-2 border-bottom\">\n <div>\n <span class=\"fw-bold me-3\">{{ conn.client_name }}</span>\n <span class=\"text-muted small\">\n {{ 'User.Subscriptions.RegisteredApps.ConnectedOn' | transloco }}\n {{ conn.created_at | date:'mediumDate' }}\n </span>\n <span class=\"text-muted small d-block\">\n {{ 'User.Subscriptions.RegisteredApps.LastUsed' | transloco }}\n @if (conn.last_used_at) {\n {{ conn.last_used_at | date:'medium' }}\n } @else {\n {{ 'User.Subscriptions.RegisteredApps.NeverUsed' | transloco }}\n }\n </span>\n </div>\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n (click)=\"deregisterConnection(conn.id)\">\n {{ 'User.Subscriptions.RegisteredApps.Deregister' | transloco }}\n </button>\n </div>\n }\n }\n </div>\n </div>\n </section>\n </div>\n }\n @if (user?.id) {\n <div class=\"col-12 mt-3\">\n <pw-account-user-credentials [userId]=\"user.id\"></pw-account-user-credentials>\n </div>\n }\n</div>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n","import { DecimalPipe } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnDestroy, OnInit } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProductService } from '@posiwise/common-services';\nimport { Product, PRODUCT_CATEGORY, Subscription, User } from '@posiwise/common-utilities';\nimport { CurrencySymbolPipe } from '@posiwise/pipes';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport sortBy from 'lodash/sortBy';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-add-subscription',\n templateUrl: './add-subscription.component.html',\n styleUrls: ['./add-subscription.component.scss'],\n imports: [RouterLink, NoDataComponent, DecimalPipe, TranslocoPipe, CurrencySymbolPipe]\n})\nexport class AddSubscriptionComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly productService = inject(ProductService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n private readonly singleProducts = [];\n\n private readonly enterpriseProducts = [];\n\n form: FormGroup;\n\n busy: boolean;\n isLoaded: boolean;\n selectedProduct: boolean;\n isPurchaseAttempted: boolean;\n userLoggedIn: boolean;\n\n availableProducts: Product[] = [];\n products: Product[];\n\n user: User;\n\n unitError: string;\n\n category = PRODUCT_CATEGORY;\n\n units = 1;\n\n subscribedPermissionKeys = [];\n\n currentSubscription: Subscription;\n\n subscriptionId: number;\n\n ngOnInit() {\n this.subscriptionId = Number(this.route.snapshot.queryParamMap.get('subscription_id'));\n this.getProducts();\n }\n\n private getProducts() {\n // Gets All the products\n this.productService\n .getProductList({}, this.subscriptionId, { only_relevant: true })\n .subscribe(({ result }) => {\n this.products = result || [];\n if (this.products?.length) {\n this.products = this.products.filter(x => x.active);\n }\n\n this.isLoaded = true;\n this.userStore().subscribe(user => {\n this.user = user;\n if (this.user) {\n const subs: Subscription[] = cloneDeep(this.user.subscriptions);\n subs.forEach(subscription => {\n subscription.products.forEach(product => {\n const prod = this.products.find(x => x.id === product.id);\n if (prod) {\n prod['is_subscribed'] = true;\n prod['purchased_units'] = product?.purchased_units;\n }\n });\n });\n\n this.subscribedPermissionKeys = Array.from(\n new Set([\n ...this.user.subscriptions\n .flatMap(x => x.products)\n .map(product => product.permission_key),\n ...this.addonPermissionKeys(subs)\n ])\n );\n\n // show category only if we have products\n const prodPermissionKeys = this.products.map(p => p.permission_key);\n this.subscribedPermissionKeys = this.subscribedPermissionKeys.filter(x =>\n prodPermissionKeys.includes(x)\n );\n\n // Filtering the product with the existing permission_key\n this.availableProducts = sortBy(\n this.getSingleCategoryProducts(),\n 'is_subscribed'\n );\n }\n this.cdr.markForCheck();\n });\n this.cdr.markForCheck();\n });\n }\n\n /**\n * An add-on joins the subscription it is bought from, so it is offered — and counted as\n * subscribed — by what this subscription holds, not the user's other subscriptions.\n */\n private addonPermissionKeys(subscriptions: Subscription[]): string[] {\n const current = subscriptions.find(x => x.id === this.subscriptionId);\n const heldKeys = (current?.products ?? []).map(p => p.permission_key);\n const heldIds = (current?.products ?? []).map(p => p.id);\n const addons = this.products.filter(p =>\n p.addon_for_permission_keys?.some(key => heldKeys.includes(key))\n );\n addons.forEach(p => (p['is_subscribed'] = heldIds.includes(p.id)));\n return addons.map(p => p.permission_key);\n }\n\n private getSingleCategoryProducts(category = this.subscribedPermissionKeys[0]) {\n return this.products.filter(x => category === x.permission_key);\n }\n\n onChangeCategory(category) {\n this.availableProducts = this.getSingleCategoryProducts(category);\n this.availableProducts = sortBy(this.availableProducts, 'is_subscribed');\n }\n\n onSelection(product) {\n this.router.navigate([\n `account/subscriptions/upgrade/${this.subscriptionId}/${product.id}`\n ]);\n }\n\n trackByProduct(_index: number, item: Product) {\n return item.id;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","@if (isLoaded && !selectedProduct) {\n <div\n class=\"mt-4\">\n <div class=\"d-flex align-items-start category-tabs-row\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n [routerLink]=\"['/account/subscriptions']\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <div class=\"d-flex category-tabs\">\n @for (item of subscribedPermissionKeys; track item; let i = $index) {\n <div class=\"toggle\"\n >\n <input type=\"radio\"\n name=\"sizeBy\"\n value=\"option{{ i + 1 }}\"\n id=\"option{{ i + 1 }}\"\n (change)=\"onChangeCategory(item)\"\n [checked]=\"i === 0\"\n [attr.aria-label]=\"item\" />\n <label for=\"option{{ i + 1 }}\">{{ item }}</label>\n </div>\n }\n </div>\n </div>\n <ul class=\"row animated fadeIn d-flex\">\n @for (product of availableProducts; track trackByProduct($index, product)) {\n <li\n class=\"col-sm-12 col-md-6 col-xl-4 my-3 mt-sm-2\">\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h4 class=\"text-bold-500 primary mb-3\">{{ product.name }}</h4>\n @if (product.price_per_unit) {\n @if (product?.purchased_units) {\n <h5\n class=\"my-3 branding-color-1\">\n {{ 'User.Subscriptions.Add.Currently' | transloco }} {{ product.currency | currencySymbol\n }}{{\n (\n (product.purchased_units * product.price_per_unit) /\n 100\n ) | number:'1.2-2'\n }}&nbsp;/&nbsp;{{ product.billing_frequency }}\n </h5>\n }\n <h5 class=\"my-3\">\n {{ 'User.Subscriptions.Add.Min' | transloco }}\n {{ (product.min_units &gt; 1 ? 'User.Subscriptions.Add.SeatsCount' : 'User.Subscriptions.Add.SeatCount') | transloco: { count: product.min_units } }}\n - {{ product.currency | currencySymbol\n }}{{\n ((product.min_units * product.price_per_unit) / 100) | number:'1.2-2'\n }}&nbsp;/&nbsp;{{ product.billing_frequency }}\n </h5>\n <h5 class=\"d-inline-block text-bold-600 mb-2\">\n {{ product.currency | currencySymbol\n }}{{ (product.price_per_unit / 100) | number:'1.2-2' }}&nbsp;/&nbsp;{{\n product.billing_frequency\n }}&nbsp;/&nbsp;{{ 'User.Subscriptions.Add.PerSeat' | transloco }}\n </h5>\n } @else {\n <div class=\"d-inline-block text-bold-600 mb-2\">{{ 'User.Subscriptions.Free' | transloco }}</div>\n }\n <p class=\"mb-2\"\n [innerHTML]=\"product?.description\"></p>\n </div>\n <div class=\"card-footer px-3\">\n @if (\n !product.is_subscribed &&\n !product.trial_subscription &&\n product.stripe_plan_id\n ) {\n <a [attr.aria-label]=\"'User.Subscriptions.Subscribe' | transloco\"\n (click)=\"onSelection(product)\"\n class=\"card-btn btn btn-raised me-1 btn-primary btn-sm\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </a>\n }\n @if (\n !product.is_subscribed &&\n product.trial_subscription &&\n product.stripe_plan_id\n ) {\n <div class=\"mt-3\"\n >\n <a [attr.aria-label]=\"'Button.Upgrade' | transloco\"\n (click)=\"onSelection(product)\"\n class=\"card-btn btn btn-raised me-1 btn-primary btn-sm\">\n {{ 'Button.Upgrade' | transloco }}\n </a>\n <span class=\"badge bg-secondary position-absolute trial-badge\">{{ 'User.Subscriptions.Trial' | transloco }}\n </span>\n </div>\n }\n @if (\n product.is_subscribed &&\n !product.trial_subscription &&\n !product.is_deleted\n ) {\n <span\n class=\"card-btn badge bg-default text-white\">\n {{ 'User.Subscriptions.Subscribed' | transloco }}\n </span>\n }\n @if (\n product.is_subscribed &&\n product.trial_subscription &&\n product.price_per_unit === 0 &&\n !product.is_deleted &&\n !product.stripe_plan_id\n ) {\n <span\n class=\"card-btn badge bg-default text-white\">\n {{ 'User.Subscriptions.Free' | transloco }}\n </span>\n }\n @if (product.is_deleted) {\n <span\n class=\"card-btn badge bg-default text-white\">\n {{ 'User.Subscriptions.UnsubscribedButActive' | transloco }}\n </span>\n }\n </div>\n </div>\n </div>\n </li>\n }\n </ul>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (availableProducts && availableProducts.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"No products available under this category.\"\n >\n </pw-no-data>\n }\n </div>\n </div>\n </div>\n}\n","/**\n * @summary Shows the saved credit card details of the user\n * @author anikets43\n *\n * Created at : 2020-02-08 16:56:18\n * Last modified : 2020-02-08 17:06:29\n */\n\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-saved-card-details',\n templateUrl: './saved-card-details.component.html',\n styleUrls: ['./saved-card-details.component.scss'],\n imports: [TranslocoPipe]\n})\nexport class SavedCardDetailsComponent {\n /**\n * Credit Card details like brand, exp_month, exp_year, card_number\n */\n @Input() data: {\n brand?: string;\n exp_month?: string;\n exp_year?: string;\n card_number?: string;\n };\n\n /**\n * boolean: change payment option\n */\n @Input() isChangePayment: boolean;\n\n @Input() showNewCard: boolean;\n\n /**\n * Emitter: on payment change request\n */\n @Output() changeEvent: EventEmitter<boolean> = new EventEmitter();\n\n OnPaymentChange(value) {\n this.changeEvent.emit(value);\n }\n}\n","<div class=\"row\">\n @if (!showNewCard) {\n <div class=\"col-12\"\n >\n <h4 class=\"title\">{{ 'User.Subscriptions.SavedCard.Title' | transloco }}</h4>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'User.Subscriptions.SavedCard.Type' | transloco }}</div>\n <div class=\"summary-right\">{{ data?.brand }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'User.Subscriptions.SavedCard.Expiry' | transloco }}</div>\n <div class=\"summary-right\">{{ data.exp_month }} / {{ data.exp_year }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'User.Subscriptions.SavedCard.CardNumber' | transloco }}</div>\n <div class=\"summary-right\">{{ data?.card_number }}</div>\n </div>\n </div>\n }\n\n @if (!showNewCard) {\n <div class=\"col-12 mt-3\"\n >\n <button type=\"button\"\n class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'User.Subscriptions.SavedCard.ChangePaymentOption' | transloco\"\n (click)=\"OnPaymentChange(true)\">\n {{ 'User.Subscriptions.SavedCard.ChangePaymentOption' | transloco }}\n </button>\n </div>\n }\n</div>\n","import { FormArray, Validators } from '@angular/forms';\n\nimport {\n CredentialData,\n SubscriptionCredentialGroup\n} from '../../../shared/interface/user-module.interface';\nimport { credentialsByName, sortByLabel } from '../../credentials/credential-helpers';\n\nexport { changedCredentials, sortByLabel } from '../../credentials/credential-helpers';\n\nexport interface CredentialFormValue {\n credential_id: number;\n value: string;\n id?: number;\n}\n\nexport function uniqueByName(credentials: CredentialData[]): CredentialData[] {\n const seen = new Set<string>();\n const unique = credentials.filter(credential => {\n if (seen.has(credential.name)) {\n return false;\n }\n seen.add(credential.name);\n return true;\n });\n return sortByLabel(unique, credential => credential.name);\n}\n\nexport function groupByCredentialName(\n credentialTypes: CredentialData[],\n stored: CredentialData[]\n): SubscriptionCredentialGroup[] {\n const byName = credentialsByName(stored);\n return credentialTypes\n .map(({ name }) => ({\n credential_name: name,\n credentials: sortByLabel(byName.get(name) ?? [], credential => credential.field)\n }))\n .filter(group => group.credentials.length > 0);\n}\n\nexport function credentialFormRow(credentialType: CredentialData, stored?: CredentialData) {\n return {\n subscription_id: [0, [Validators.required]],\n credential_id: [credentialType?.id],\n field: [credentialType?.field],\n description: [credentialType?.description],\n value: [stored?.value, credentialType?.is_required ? [Validators.required] : []],\n id: [stored?.id]\n };\n}\n\n/** After a partly failed save, gives rows that did save their new id so a retry edits them. */\nexport function applyStoredIds(rows: FormArray, stored: CredentialData[]) {\n rows.controls.forEach(row => {\n const saved = stored.find(s => s.credential_id === row.value.credential_id);\n if (saved && !row.value.id) {\n row.patchValue({ id: saved.id });\n }\n });\n}\n","import { inject, Injectable } from '@angular/core';\n\nimport { SubscriptionService } from '@posiwise/common-services';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\nimport { EMPTY, forkJoin, Observable, timer } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\n\nimport {\n CredentialData,\n SubscriptionCredentialGroup\n} from '../../../shared/interface/user-module.interface';\nimport { changedCredentials, runAllThenReport } from '../../credentials/credential-helpers';\n\nimport { HumanizeCredentialNamePipe } from './humanize-credential-name.pipe';\nimport { CredentialFormValue } from './subscription-credential.utils';\n\n// Provided on the component: SubscriptionService is module-scoped, so a root provider cannot reach it.\n@Injectable()\nexport class SubscriptionCredentialActionsService {\n private readonly confirmDialog = inject(ConfirmDialogService);\n private readonly subscriptionService = inject(SubscriptionService);\n\n private readonly humanize = new HumanizeCredentialNamePipe();\n\n /** The subscription's stored values and the credential types it can configure, fetched together. */\n load(\n subscriptionId: number\n ): Observable<{ stored: CredentialData[]; types: CredentialData[] }> {\n return forkJoin({\n stored: this.storedCredentials(subscriptionId),\n types: this.subscriptionService.getAllCredentials().pipe(map(({ result }) => result))\n });\n }\n\n storedCredentials(subscriptionId: number): Observable<CredentialData[]> {\n return this.subscriptionService\n .getAllSubscriptionCredentials(subscriptionId)\n .pipe(map(({ result }) => result));\n }\n\n /**\n * Emits the saved responses once every changed value is saved, or [] when nothing changed.\n * Every request runs to completion before a failure is reported: forkJoin would otherwise\n * cancel the rest client-side while the server still saves them, and a retry would then\n * create those rows again.\n */\n saveChanged(rows: CredentialFormValue[], subscriptionId: number): Observable<unknown[]> {\n return runAllThenReport(\n changedCredentials(rows).map(row => {\n const data = {\n subscription_id: subscriptionId,\n credential_id: row.credential_id,\n value: row.value\n };\n return row.id\n ? this.subscriptionService.editSubscriptionCredential(row.id, data)\n : this.subscriptionService.postSubscriptionCredential(data);\n })\n );\n }\n\n /** Emits once every stored field of the integration is deleted; completes empty on cancel. */\n confirmAndDelete(group: SubscriptionCredentialGroup, subscriptionId: number): Observable<void> {\n // Opened a tick later: the password modal calls dismissAll() right after it emits\n // success, which would close a confirmation opened synchronously.\n return timer(0).pipe(\n switchMap(() =>\n this.confirmDialog.confirmDelete({\n textKey: 'User.Subscriptions.SubscriptionCredentials.DeleteConfirmText',\n textParams: { name: this.humanize.transform(group.credential_name) }\n })\n ),\n switchMap(ok => (ok ? this.deleteAll(group, subscriptionId) : EMPTY))\n );\n }\n\n private deleteAll(group: SubscriptionCredentialGroup, subscriptionId: number) {\n const requests: Observable<unknown>[] = group.credentials.map(credential =>\n this.subscriptionService.deleteSubscriptionCredential(credential.id, subscriptionId)\n );\n return forkJoin(requests).pipe(map(() => undefined));\n }\n}\n","import { AsyncPipe, NgClass } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport {\n FormArray,\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport {\n InputContainerComponent,\n NoDataComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1\n} from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport {\n CredentialData,\n SubscriptionCredentialGroup\n} from '../../../shared/interface/user-module.interface';\n\nimport { ClearMaskedOnFocusDirective } from './clear-masked-on-focus.directive';\nimport {\n CredentialAvatarHuePipe,\n HumanizeCredentialNamePipe,\n SubscriptionNameByIdPipe\n} from './humanize-credential-name.pipe';\nimport {\n applyStoredIds,\n credentialFormRow,\n groupByCredentialName,\n sortByLabel,\n uniqueByName\n} from './subscription-credential.utils';\nimport { SubscriptionCredentialActionsService } from './subscription-credential-actions.service';\n\n@Component({\n selector: 'pw-subscription-credential',\n templateUrl: './subscription-credential.component.html',\n styleUrls: [\n '../../credentials/credential-cards.scss',\n './subscription-credential.component.scss',\n './subscription-credential-form.scss'\n ],\n providers: [SubscriptionCredentialActionsService],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n Select,\n ClearMaskedOnFocusDirective,\n NgClass,\n ButtonBusyDirective,\n AppLoaderComponent,\n NoDataComponent,\n PasswordValidationComponent_1,\n AsyncPipe,\n TranslocoPipe,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n SubscriptionNameByIdPipe\n ]\n})\nexport class SubscriptionCredentialComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly fb = inject(FormBuilder);\n private readonly credentialActions = inject(SubscriptionCredentialActionsService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n private credentialToEdit: string;\n private credentialToDelete: SubscriptionCredentialGroup;\n\n @ViewChild('passwordValidationModalForEditCredential', { static: false })\n passwordValidationModalForEditCredential: PasswordValidationComponent;\n\n @ViewChild('passwordValidationModalForAddCredential', { static: false })\n passwordValidationModalForAddCredential: PasswordValidationComponent;\n\n @ViewChild('passwordValidationModalForDeleteCredential', { static: false })\n passwordValidationModalForDeleteCredential: PasswordValidationComponent;\n\n form: FormGroup;\n subscriptionId: number;\n\n allSubscriptionCredentials: CredentialData[];\n availableCredentials: CredentialData[] = [];\n credentialsSelect: CredentialData[];\n uniqueCredential: CredentialData[] = [];\n credentials: SubscriptionCredentialGroup[] = [];\n\n isEdit = false;\n submitted = false;\n buttonBusy = false;\n isLoaded = false;\n showForm = false;\n\n constructor() {\n super();\n this.form = this.fb.group({ credentials: this.fb.array([]) });\n }\n\n ngOnInit() {\n this.route.params.subscribe(params => {\n this.subscriptionId = params['subscriptionId'];\n if (this.subscriptionId) {\n this.getAllCredentials();\n }\n this.cdr.markForCheck();\n });\n }\n\n get credentialsGroup() {\n return this.form.get('credentials') as FormArray;\n }\n\n private getAllCredentials() {\n this.credentialActions\n .load(this.subscriptionId)\n .subscribe(({ stored, types }) => {\n this.allSubscriptionCredentials = stored;\n this.availableCredentials = types;\n this.uniqueCredential = uniqueByName(types);\n this.credentials = groupByCredentialName(this.uniqueCredential, stored);\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n selectedOption(event) {\n this.credentialsGroup.clear();\n const credentialName = this.isEdit ? event : event.value;\n this.credentialsSelect = sortByLabel(\n this.availableCredentials.filter(x => x.name === credentialName),\n credential => credential.field\n );\n this.credentialsSelect.forEach(credentialType => {\n const stored = this.allSubscriptionCredentials.find(\n credential => credential?.credential_id === credentialType?.id\n );\n this.credentialsGroup.push(this.fb.group(credentialFormRow(credentialType, stored)));\n });\n }\n\n saveCredentials() {\n this.submitted = true;\n if (!this.credentialsGroup.controls.every(control => control.valid)) {\n return;\n }\n this.buttonBusy = true;\n this.credentialActions\n .saveChanged(this.form.value.credentials, this.subscriptionId)\n .subscribe({\n next: saved => {\n if (saved.length) {\n this.notify('User.Subscriptions.SubscriptionCredentials.UpdateMessage');\n }\n this.onCancel();\n },\n // The HTTP interceptor already shows the error. The typed values stay; rows that did\n // save get their id, so a retry edits them instead of creating them again.\n error: () =>\n this.credentialActions\n .storedCredentials(this.subscriptionId)\n .subscribe(stored => applyStoredIds(this.credentialsGroup, stored))\n })\n .add(() => {\n this.submitted = false;\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n onCancel() {\n this.getAllCredentials();\n this.submitted = false;\n this.form.reset();\n this.showForm = false;\n this.isEdit = false;\n this.credentialsSelect = [];\n }\n\n openCredentialsForAdd() {\n this.passwordValidationModalForAddCredential.open();\n }\n\n openCredentialsForEdit(credentialName: string) {\n this.credentialToEdit = credentialName;\n this.passwordValidationModalForEditCredential.open();\n }\n\n openCredentialsForDelete(credential: SubscriptionCredentialGroup) {\n this.credentialToDelete = credential;\n this.passwordValidationModalForDeleteCredential.open();\n }\n\n editCredentials() {\n this.showForm = true;\n this.isEdit = true;\n this.selectedOption(this.credentialToEdit);\n }\n\n deleteCredentials() {\n this.credentialActions\n .confirmAndDelete(this.credentialToDelete, this.subscriptionId)\n .subscribe({\n next: () => {\n this.notify('User.Subscriptions.SubscriptionCredentials.DeletedMessage');\n this.getAllCredentials();\n },\n // Some fields may have been deleted before the failure, so show what is left.\n error: () => this.getAllCredentials()\n });\n }\n\n showEditForm() {\n this.isEdit = false;\n this.showForm = true;\n }\n\n private notify(messageKey: string) {\n this.toast.success(this.translation.translate(messageKey));\n this.cdr.markForCheck();\n }\n}\n","@let subName = ((userService.getUserState() | async)?.currentUser?.subscriptions | subscriptionNameById: subscriptionId);\n\n@if (showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <span>\n @if (subName) {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitle' : 'User.Subscriptions.SubscriptionCredentials.CreateTitle') | transloco: { name: subName } }}\n } @else {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitleFallback' : 'User.Subscriptions.SubscriptionCredentials.CreateTitleFallback') | transloco }}\n }\n </span>\n </h3>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitleFallback' | transloco }}\n }\n </p>\n\n <section class=\"credential-form-shell\">\n @if (credentialsSelect?.length) {\n <div class=\"credential-form-band\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n {{ (credentialsSelect[0].name | humanizeCredentialName).charAt(0) }}\n </span>\n <span class=\"credential-form-band-name\">\n {{ credentialsSelect[0].name | humanizeCredentialName }}\n </span>\n </div>\n }\n\n <form [formGroup]=\"form\" novalidate (ngSubmit)=\"saveCredentials()\" class=\"credential-form\">\n @if (!isEdit) {\n <div class=\"credential-form-row\">\n <pw-input-container\n [label]=\"'User.Subscriptions.SubscriptionCredentials.CredentialLabel' | transloco\"\n name=\"credentialType\">\n <p-select\n [options]=\"uniqueCredential\"\n [placeholder]=\"'User.Subscriptions.SubscriptionCredentials.CredentialPlaceholder' | transloco\"\n optionLabel=\"name\" optionValue=\"name\" appendTo=\"body\"\n (onChange)=\"selectedOption($event)\">\n </p-select>\n </pw-input-container>\n </div>\n }\n\n @if (credentialsSelect?.length) {\n <div formArrayName=\"credentials\" class=\"credential-form-fields\">\n @for (credential of credentialsGroup.controls; track credential; let i = $index) {\n <div [formGroupName]=\"i\" class=\"credential-form-row\">\n <pw-input-container\n [label]=\"credential.get('field').value | humanizeCredentialName\"\n [showTooltip]=\"!!credential.get('description').value\"\n [tooltipText]=\"credential.get('description').value\"\n tooltipPosition=\"top\"\n name=\"value\"\n errorMsg=\"User.Subscriptions.SubscriptionCredentials.ValueError\">\n <input type=\"text\" class=\"form-control\" formControlName=\"value\" pwClearMaskedOnFocus\n [ngClass]=\"{ 'is-invalid': submitted && credential.get('value').invalid }\"\n [id]=\"'credential-value-' + i\" [name]=\"'credential-value-' + i\"\n [attr.aria-label]=\"credential.get('field').value | humanizeCredentialName\" />\n </pw-input-container>\n </div>\n }\n </div>\n }\n\n <div class=\"credential-form-actions\">\n <button type=\"button\" class=\"btn btn-outline-default\" (click)=\"onCancel()\" (keydown.enter)=\"onCancel()\">\n {{ 'Button.Back' | transloco }}\n </button>\n @if (credentialsSelect?.length) {\n <button type=\"submit\" [buttonBusy]=\"buttonBusy\" class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n </form>\n </section>\n}\n\n@if (!showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"back()\"\n (keydown.enter)=\"back()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h2 class=\"mt-3\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitleFallback' | transloco }}\n }\n </h2>\n </div>\n <div class=\"col-12 col-md-12 text-end\">\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"openCredentialsForAdd()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Subscriptions.SubscriptionCredentials.AddButton' | transloco }}\n </button>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitleFallback' | transloco }}\n }\n </p>\n\n <pw-loader [isVisible]=\"!isLoaded\"></pw-loader>\n\n @if (isLoaded) {\n @if (allSubscriptionCredentials?.length === 0) {\n <div class=\"credential-empty\">\n <pw-no-data [withImage]=\"true\"\n [message]=\"'User.Subscriptions.SubscriptionCredentials.NoDataMessage' | transloco\"></pw-no-data>\n </div>\n } @else {\n <ul class=\"credential-grid\">\n @for (credential of credentials; track credential.credential_name) {\n <li class=\"credential-card\">\n <header class=\"credential-card-header\"\n [style.--avatar-hue]=\"credential.credential_name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">\n {{ (credential.credential_name | humanizeCredentialName).charAt(0) }}\n </span>\n <h3 class=\"credential-card-title\">\n {{ credential.credential_name | humanizeCredentialName }}\n </h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\" class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.EditAriaLabel' | transloco\"\n (click)=\"openCredentialsForEdit(credential.credential_name)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.DeleteAriaLabel' | transloco\"\n (click)=\"openCredentialsForDelete(credential)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (entry of credential.credentials; track entry.id) {\n <div class=\"credential-card-row\">\n <dt>{{ entry.field | humanizeCredentialName }}</dt>\n <dd><code class=\"credential-card-value\">{{ entry?.value }}</code></dd>\n </div>\n }\n </dl>\n </li>\n }\n </ul>\n }\n }\n}\n\n<pw-password-validation #passwordValidationModalForEditCredential (successEvent)=\"editCredentials()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForAddCredential (successEvent)=\"showEditForm()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForDeleteCredential (successEvent)=\"deleteCredentials()\"></pw-password-validation>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppState, GetUser } from '@posiwise/app-store';\nimport { CustomToastService, SubscriptionService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport {\n ConfirmDialogService,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1\n} from '@posiwise/shared-components';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\nimport { Store } from '@ngrx/store';\n\n/** No productId = delete the whole subscription. */\nexport interface SubscriptionRemovalTarget {\n subscriptionId: number;\n productId?: number;\n}\n\n/** Password check → reason → delete one product, or the whole subscription. */\n@Component({\n selector: 'pw-subscription-removal',\n templateUrl: './subscription-removal.component.html',\n imports: [PasswordValidationComponent_1, FormsModule, TranslocoPipe]\n})\nexport class SubscriptionRemovalComponent {\n private readonly subscriptionService = inject(SubscriptionService);\n private readonly modalService = inject(NgbModal);\n private readonly store = inject<Store<AppState>>(Store);\n private readonly toast = inject(CustomToastService);\n private readonly translation = inject(TranslocoService);\n private readonly confirmDialog = inject(ConfirmDialogService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() user: User;\n\n @Output() removed = new EventEmitter<void>();\n\n @ViewChild('passwordValidation', { static: false })\n passwordValidation: PasswordValidationComponent;\n\n @ViewChild('reasonModal', { static: false })\n reasonModal: TemplateRef<unknown>;\n\n target: SubscriptionRemovalTarget;\n\n reasonToCancel = '';\n\n get isWholeSubscription(): boolean {\n return !this.target?.productId;\n }\n\n start(target: SubscriptionRemovalTarget) {\n this.target = target;\n if (this.user?.has_password) {\n this.passwordValidation.open();\n return;\n }\n this.confirmDialog.open({\n titleKey: 'User.Subscriptions.SetPassword.Title',\n textKey: 'User.Subscriptions.SetPassword.Text',\n confirmOnly: true\n });\n }\n\n onPasswordValidated(isSuccess: boolean) {\n if (!isSuccess) {\n return;\n }\n // The password modal closes itself first; opening on the same tick stacks the two.\n setTimeout(() => {\n this.modalService.open(this.reasonModal, {\n centered: true,\n windowClass: 'modal-holder'\n });\n }, 100);\n }\n\n onConfirm() {\n const reason = this.reasonToCancel?.trim();\n if (!reason) {\n this.toast.error(\n this.translation.translate('User.Subscriptions.Validation.ReasonRequired')\n );\n return;\n }\n this.request(reason).subscribe(() => {\n this.store.dispatch(new GetUser());\n this.modalService.dismissAll();\n this.reset();\n this.removed.emit();\n });\n }\n\n reset() {\n this.target = null;\n this.reasonToCancel = '';\n this.cdr.markForCheck();\n }\n\n private request(reason: string) {\n const body = { reason_to_cancel: reason };\n const { subscriptionId, productId } = this.target;\n if (this.isWholeSubscription) {\n return this.subscriptionService.deleteWholeSubscription(subscriptionId, body);\n }\n return this.subscriptionService.deleteSubscription(subscriptionId, productId, body);\n }\n}\n","<pw-password-validation #passwordValidation\n [destructive]=\"true\"\n (successEvent)=\"onPasswordValidated($event)\">\n</pw-password-validation>\n\n<ng-template #reasonModal let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">\n {{ (isWholeSubscription ? 'User.Subscriptions.DeleteSubscription.Title' : 'User.Subscriptions.DeleteProduct.Title') | transloco }}\n </h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss(); reset()\">\n </button>\n </div>\n <div class=\"modal-body\">\n <p>\n {{ (isWholeSubscription ? 'User.Subscriptions.DeleteSubscription.Message' : 'User.Subscriptions.DeleteProduct.Message') | transloco }}\n </p>\n <div class=\"mb-3\">\n <label for=\"reasonToCancel\" class=\"form-label\">\n {{ 'User.Subscriptions.CancelSubscription.ReasonLabel' | transloco }} <span class=\"text-danger\">*</span>\n </label>\n <textarea\n id=\"reasonToCancel\"\n class=\"form-control\"\n rows=\"4\"\n [(ngModel)]=\"reasonToCancel\"\n [placeholder]=\"'User.Subscriptions.CancelSubscription.ReasonPlaceholder' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.CancelSubscription.ReasonPlaceholder' | transloco\"></textarea>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.dismiss(); reset()\">\n {{ 'User.Subscriptions.CancelSubscription.KeepItForNow' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-danger\"\n [disabled]=\"!reasonToCancel || !reasonToCancel.trim()\"\n (click)=\"onConfirm()\">\n {{ (isWholeSubscription ? 'User.Subscriptions.DeleteSubscription' : 'User.Subscriptions.DeleteProduct') | transloco }}\n </button>\n </div>\n</ng-template>\n","// Airwallex Drop-in for saving a backup card: card entry and the 3DS challenge happen\n// inside it. The SDK is imported lazily so it only loads on this page.\nimport type { AirwallexCardFormSetup } from '@posiwise/common-services';\n\nimport type { Payment } from '@airwallex/components-sdk';\n\n// Mirrors integrations-api Airwallex::Core::Environment::PRODUCTION_VALUES.\nconst PRODUCTION_ENVIRONMENTS = ['prod', 'production', 'live'];\nconst READY_TIMEOUT_MS = 20_000;\n\nexport class AirwallexElementHelper {\n private element: Payment.DropInElementType | null = null;\n\n async mount(host: HTMLElement, setup: AirwallexCardFormSetup): Promise<void> {\n this.teardown();\n const sdk = await import('@airwallex/components-sdk');\n await sdk.init({\n env: AirwallexElementHelper.sdkEnv(setup.environment),\n enabledElements: ['payments']\n });\n const element = await sdk.createElement('dropIn', this.options(setup));\n const ready = AirwallexElementHelper.whenReady(host);\n element.mount(host);\n this.element = element;\n await ready;\n }\n\n /**\n * mount() returns before the iframe draws its fields. SDK 1.35 announces readiness as a DOM\n * `onReady` event on the host; element.on('ready') never fires (measured in the demo env).\n */\n private static whenReady(host: HTMLElement): Promise<void> {\n return new Promise((resolve, reject) => {\n const finish = (done: () => void) => () => {\n clearTimeout(timer);\n host.removeEventListener('onReady', onReady);\n host.removeEventListener('onError', onError);\n done();\n };\n const onReady = finish(resolve);\n const onError = finish(() => reject(new Error('airwallex_form_failed')));\n const timer = setTimeout(\n finish(() => reject(new Error('airwallex_ready_timeout'))),\n READY_TIMEOUT_MS\n );\n host.addEventListener('onReady', onReady);\n host.addEventListener('onError', onError);\n });\n }\n\n /** Resolves with the intent id once the card and any 3DS challenge completed. */\n async confirm(): Promise<string> {\n if (!this.element) {\n throw new Error('airwallex_element_not_mounted');\n }\n const intent = await this.element.confirm();\n if (!intent?.id) {\n throw new Error('airwallex_confirm_failed');\n }\n return intent.id;\n }\n\n teardown(): void {\n this.element?.destroy();\n this.element = null;\n }\n\n static sdkEnv(environment: string): 'prod' | 'demo' {\n return PRODUCTION_ENVIRONMENTS.includes((environment || '').trim().toLowerCase())\n ? 'prod'\n : 'demo';\n }\n\n private options(setup: AirwallexCardFormSetup): Payment.DropInElementOptions {\n return {\n intent_id: setup.intent_id,\n client_secret: setup.client_secret,\n currency: setup.currency,\n methods: ['card'],\n showConfirmButton: false,\n payment_consent: {\n next_triggered_by: 'merchant',\n merchant_trigger_reason: 'unscheduled'\n }\n };\n }\n}\n","/**\n * Thin wrapper around the Braintree Web Drop-in script.\n * Mounts a Drop-in instance into a host DOM element and resolves the\n * payment_method_nonce on submit. Loaded as a CDN script (mirrors the Stripe\n * pattern in the same component) — see UpdatePaymentDetailsComponent.\n */\n\nconst DROPIN_CDN_URL = 'https://js.braintreegateway.com/web/dropin/1.43.0/js/dropin.min.js';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const braintree: {\n dropin: {\n create: (options: BraintreeDropinCreateOptions) => Promise<BraintreeDropinInstance>;\n };\n};\n\nexport interface BraintreeDropinCreateOptions {\n authorization: string;\n container: string | HTMLElement;\n card?: { cardholderName?: { required: boolean } };\n}\n\nexport interface BraintreeDropinInstance {\n requestPaymentMethod: () => Promise<{ nonce: string; type: string }>;\n teardown: () => Promise<void>;\n}\n\nexport class BraintreeDropinHelper {\n private dropinInstance: BraintreeDropinInstance | null = null;\n\n /**\n * Loads the Drop-in script into <head> if not already present, then mounts\n * a Drop-in instance bound to clientToken into the host element.\n */\n async mount(host: HTMLElement, clientToken: string): Promise<void> {\n await this.ensureScriptLoaded();\n await this.teardown();\n this.dropinInstance = await braintree.dropin.create({\n authorization: clientToken,\n container: host\n });\n }\n\n async requestNonce(): Promise<string> {\n if (!this.dropinInstance) {\n throw new Error('braintree_dropin_not_mounted');\n }\n const result = await this.dropinInstance.requestPaymentMethod();\n return result.nonce;\n }\n\n async teardown(): Promise<void> {\n if (!this.dropinInstance) {\n return;\n }\n try {\n await this.dropinInstance.teardown();\n } finally {\n this.dropinInstance = null;\n }\n }\n\n private ensureScriptLoaded(): Promise<void> {\n if (typeof window === 'undefined') {\n return Promise.resolve();\n }\n if ((window as unknown as { braintree?: unknown }).braintree) {\n return Promise.resolve();\n }\n const existing = document.querySelector(\n `script[src=\"${DROPIN_CDN_URL}\"]`\n ) as HTMLScriptElement | null;\n if (existing) {\n return new Promise<void>((resolve, reject) => {\n existing.addEventListener('load', () => resolve(), { once: true });\n existing.addEventListener(\n 'error',\n () => reject(new Error('braintree_script_load_failed')),\n { once: true }\n );\n });\n }\n return new Promise<void>((resolve, reject) => {\n const script = document.createElement('script');\n script.src = DROPIN_CDN_URL;\n script.async = true;\n script.addEventListener('load', () => resolve(), { once: true });\n script.addEventListener(\n 'error',\n () => reject(new Error('braintree_script_load_failed')),\n { once: true }\n );\n document.head.appendChild(script);\n });\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n Output,\n ViewChild\n} from '@angular/core';\n\nimport {\n CustomToastService,\n SecondaryCardSummary,\n SecondaryProvider,\n SubscriptionService,\n UserService\n} from '@posiwise/common-services';\nimport { ButtonBusyDirective } from '@posiwise/directives';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Tooltip } from 'primeng/tooltip';\nimport { firstValueFrom, map, Observable } from 'rxjs';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\n\nimport { SavedCardDetailsComponent } from '../saved-card-details/saved-card-details.component';\n\nimport { AirwallexElementHelper } from './airwallex-element.helper';\nimport { BraintreeDropinHelper } from './braintree-dropin.helper';\n\n// Secondary (backup card) column: Braintree or Airwallex, as the backend selected.\n@Component({\n selector: 'pw-secondary-payment-method',\n templateUrl: './secondary-payment-method.component.html',\n styleUrls: ['./secondary-payment-method.component.scss'],\n imports: [\n Tooltip,\n Bind,\n ProgressSpinner,\n SavedCardDetailsComponent,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class SecondaryPaymentMethodComponent implements OnDestroy {\n private readonly subscriptionService = inject(SubscriptionService);\n private readonly userService = inject(UserService);\n private readonly toast = inject(CustomToastService);\n private readonly transloco = inject(TranslocoService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() subscriptionId: number;\n @Input() card: SecondaryCardSummary | null = null;\n @Input() provider: SecondaryProvider = 'airwallex';\n @Input() loading = true;\n @Output() saved = new EventEmitter<void>();\n\n @ViewChild('formHost') formHost?: ElementRef<HTMLDivElement>;\n\n showForm = false;\n mounting = false; // the card form loads after showForm: its host must already exist\n busy = false;\n\n private readonly braintree = new BraintreeDropinHelper();\n private readonly airwallex = new AirwallexElementHelper();\n\n ngOnDestroy() {\n this.teardown();\n }\n\n async startFlow() {\n this.showForm = true;\n this.mounting = true;\n this.cdr.detectChanges(); // the form host only exists once showForm renders\n try {\n await this.mountForm(this.formHost.nativeElement);\n } catch (error) {\n if (!(error instanceof HttpErrorResponse)) {\n this.fail('User.Payments.Secondary.Errors.FormFailed');\n }\n this.showForm = false;\n } finally {\n this.mounting = false;\n this.cdr.markForCheck();\n }\n }\n\n async submit() {\n this.busy = true;\n this.cdr.markForCheck();\n try {\n const response = await firstValueFrom(this.register(await this.collectCard()));\n if (response?.data) {\n this.onSaved(response.message);\n }\n } catch (error) {\n // The HTTP interceptor already toasts a rejected API call.\n if (!(error instanceof HttpErrorResponse)) {\n this.fail('User.Payments.Secondary.Errors.CardNotConfirmed');\n }\n } finally {\n this.busy = false;\n this.cdr.markForCheck();\n }\n }\n\n cancel() {\n this.teardown();\n this.showForm = false;\n this.cdr.markForCheck();\n }\n\n private onSaved(message: string) {\n // Braintree's hand-built response isn't toasted by the interceptor; Airwallex's is.\n if (this.provider === 'braintree') {\n this.toast.success(message);\n }\n // Refresh the user payload so payment_methods_status is re-evaluated\n // and the secondary-payment modal in UserService stops firing.\n this.userService.getUserInfo().subscribe();\n this.teardown();\n this.showForm = false;\n this.saved.emit();\n }\n\n private async mountForm(host: HTMLElement) {\n if (this.provider === 'braintree') {\n const response = await firstValueFrom(\n this.subscriptionService.getBraintreeClientToken(this.subscriptionId)\n );\n await this.braintree.mount(host, response?.result?.data?.client_token);\n return;\n }\n const response = await firstValueFrom(\n this.subscriptionService.getAirwallexIntent(this.subscriptionId)\n );\n await this.airwallex.mount(host, response?.result);\n }\n\n /** Braintree yields a nonce; Airwallex yields the confirmed intent id (after 3DS). */\n private collectCard(): Promise<string> {\n return this.provider === 'braintree'\n ? this.braintree.requestNonce()\n : this.airwallex.confirm();\n }\n\n /** Braintree's hand-built reply nests in `result`; Airwallex's toast keeps `message` on top. */\n private register(\n reference: string\n ): Observable<{ data: SecondaryCardSummary | null; message?: string }> {\n return this.provider === 'braintree'\n ? this.subscriptionService\n .registerBraintreePaymentMethod(this.subscriptionId, reference)\n .pipe(map(({ result }) => result))\n : this.subscriptionService\n .registerAirwallexPaymentMethod(this.subscriptionId, reference)\n .pipe(map(({ result, message }) => ({ data: result, message })));\n }\n\n private teardown() {\n this.braintree.teardown();\n this.airwallex.teardown();\n }\n\n private fail(key: string) {\n this.toast.error(this.transloco.translate(key));\n }\n}\n","<h5 class=\"section-title\">{{ 'User.Payments.Secondary.Title' | transloco }}</h5>\n<p class=\"alert alert-info\" [pTooltip]=\"'User.Payments.Secondary.Tooltip' | transloco\" tooltipPosition=\"top\" appendTo=\"body\">\n {{ 'User.Payments.Secondary.Callout' | transloco }}\n</p>\n\n@if (loading || mounting) {\n <div class=\"text-center\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n\n@if (card && !showForm) {\n <pw-saved-card-details [data]=\"card\"\n (changeEvent)=\"startFlow()\">\n </pw-saved-card-details>\n}\n\n@if (!card && !showForm && !loading) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"startFlow()\">\n {{ 'User.Payments.Secondary.AddCta' | transloco }}\n </button>\n}\n\n@if (showForm) {\n <div #formHost class=\"secondary-card-form\" [class.mt-3]=\"!mounting\" [class.secondary-card-form--mounting]=\"mounting\"\n [attr.data-provider]=\"provider\"></div>\n @if (!mounting) {\n <div class=\"col-12 mt-4 text-end\">\n <button type=\"button\"\n (click)=\"cancel()\"\n class=\"btn btn-outline-default me-2\">\n {{ 'User.Payments.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n [buttonBusy]=\"busy\"\n (click)=\"submit()\">\n {{ 'User.Payments.Submit' | transloco }}\n </button>\n </div>\n }\n}\n","import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n ProductService,\n ScriptLoaderService,\n SecondaryCardSummary,\n SecondaryProvider,\n StripeCardSummary,\n SubscriptionService\n} from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { PwStickyActionsComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { StatusCodes } from 'http-status-codes';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Select } from 'primeng/select';\nimport { forkJoin } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { StripeCardResponse } from '../../../shared/interface/user-module.interface';\nimport { SavedCardDetailsComponent } from '../saved-card-details/saved-card-details.component';\n\nimport { SecondaryPaymentMethodComponent } from './secondary-payment-method.component';\nimport { StripeJsApi } from './update-payment-details.types';\n\ndeclare const Stripe: StripeJsApi;\n\n@Component({\n selector: 'pw-update-payment-details',\n templateUrl: './update-payment-details.component.html',\n styleUrls: ['./update-payment-details.component.scss'],\n imports: [\n SavedCardDetailsComponent,\n Bind,\n ProgressSpinner,\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n Select,\n LazyImgDirective,\n PwStickyActionsComponent,\n ButtonBusyDirective,\n SecondaryPaymentMethodComponent,\n TranslocoPipe\n ]\n})\nexport class UpdatePaymentDetailsComponent extends AppBaseComponent implements OnInit {\n private readonly fb = inject(FormBuilder);\n private readonly scriptLoader = inject(ScriptLoaderService);\n private readonly productService = inject(ProductService);\n private readonly subscriptionService = inject(SubscriptionService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n form: FormGroup;\n\n years = [];\n months = [];\n\n busy: boolean;\n isChangePayment: boolean;\n\n cardDetails: StripeCardSummary | null = null;\n secondaryCard: SecondaryCardSummary | null = null;\n secondaryProvider: SecondaryProvider = 'airwallex';\n\n loading = true;\n\n errorMessage: string;\n stripePublishKey: string;\n errorMsg: string;\n\n subscriptionId: number;\n productId: number;\n\n constructor() {\n super();\n\n this.route.params.subscribe(response => {\n this.subscriptionId = Number(response['subscriptionId']);\n this.productId = Number(response['productId']);\n this.refreshPaymentMethods();\n this.cdr.markForCheck();\n });\n\n this.form = this.fb.group({\n card_number: ['', Validators.required],\n cvc: ['', Validators.required],\n exp_month: ['', Validators.required],\n exp_year: ['', Validators.required]\n });\n }\n\n ngOnInit() {\n this.scriptLoader.loadScriptOnce('head', 'https://js.stripe.com/v2/');\n this.years = HelperService.getYears();\n this.months = HelperService.getMonths();\n }\n\n refreshPaymentMethods() {\n forkJoin({\n paymentMethods: this.subscriptionService.getPaymentMethods(this.subscriptionId),\n product: this.productService.getProductById(this.productId)\n })\n .subscribe(response => {\n this.stripePublishKey = response.product.result.stripe_publishable_key;\n if (response.paymentMethods.result.status === StatusCodes.OK) {\n const data = response.paymentMethods.result.data;\n this.cardDetails = data?.primary || null;\n this.secondaryCard = data?.secondary || null;\n this.secondaryProvider = data?.secondary_provider || 'braintree';\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.loading = false;\n this.cdr.markForCheck();\n });\n }\n\n onUpdatePaymentDetailsCancel() {\n this.router.navigate(['/account/subscriptions']);\n }\n\n @ValidateForm('form')\n onSave() {\n this.busy = true;\n this.errorMsg = '';\n const cardDetails = {\n number: this.form.value.card_number,\n cvc: this.form.value.cvc,\n exp_month: this.form.value.exp_month,\n exp_year: this.form.value.exp_year\n };\n Stripe.setPublishableKey(this.stripePublishKey);\n Stripe.card.createToken(cardDetails, (status, res) => this.onStripeToken(status, res));\n }\n\n private onStripeToken(status: number, res: StripeCardResponse) {\n if (status !== 200) {\n this.toast.error(res?.error?.message);\n this.busy = false;\n this.cdr.markForCheck();\n return;\n }\n this.subscriptionService\n .updateCardDetails(this.form.value, this.subscriptionId)\n .subscribe({\n next: ({ result }) => {\n if (result.error) {\n this.toast.error(result.error.errors[0].message);\n } else if (result.status === StatusCodes.CREATED) {\n this.toast.success(result.message);\n }\n this.form.markAsPristine();\n this.cancel();\n }\n })\n .add(() => {\n this.busy = false;\n this.cdr.markForCheck();\n });\n }\n\n cancel() {\n this.router.navigate(['/account/subscriptions']);\n }\n\n onChange(value) {\n this.isChangePayment = value;\n }\n}\n","<div class=\"container-fluid\">\n <div class=\"card-block\">\n <div class=\"row\">\n <div class=\"col-lg-12 ps-0\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"back()\"\n class=\"previous float-start\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n <h4 class=\"form-section my-3\">\n <i class=\"ft-edit\" aria-hidden=\"true\"></i>\n {{ 'User.Payments.UpdateTitle' | transloco }}\n </h4>\n </div>\n </div>\n\n <div class=\"row g-3 mt-1\">\n <!-- Primary payment method (Stripe) -->\n <div class=\"col-12 col-lg-6\">\n <div class=\"card payment-left p-3 h-100\">\n <div class=\"card-body\">\n <h5 class=\"section-title\">{{ 'User.Payments.Primary.Title' | transloco }}</h5>\n <p class=\"text-muted\">{{ 'User.Payments.Primary.Description' | transloco }}</p>\n\n @if (errorMsg) {\n <div class=\"alert alert-danger\">{{ errorMsg }}</div>\n }\n @if (!isChangePayment && cardDetails) {\n <pw-saved-card-details [data]=\"cardDetails\"\n (changeEvent)=\"onChange($event)\">\n </pw-saved-card-details>\n }\n\n @if (loading) {\n <div class=\"text-center\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n\n @if ((!cardDetails && !loading) || isChangePayment) {\n <form [formGroup]=\"form\" (ngSubmit)=\"onSave()\">\n <h4 class=\"title\">{{ 'User.Payments.Primary.NewCard' | transloco }}</h4>\n <div class=\"row\">\n <div class=\"col-md-9\">\n <div class=\"mb-3\">\n <label for=\"update-payment-card_number\">{{ 'User.Payments.CardNumber' | transloco }}</label>\n <input type=\"text\"\n id=\"update-payment-card_number\"\n class=\"form-control\"\n formControlName=\"card_number\"\n [placeholder]=\"'User.Payments.CardNumber' | transloco\"\n name=\"card_number\"\n [attr.aria-label]=\"'User.Payments.CardNumber' | transloco\" />\n @if (form.get('card_number').touched && form.get('card_number').errors?.required) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.CardNumberRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"mb-3\">\n <label for=\"update-payment-cvc\">{{ 'User.Payments.Cvc' | transloco }}</label>\n <input type=\"text\"\n id=\"update-payment-cvc\"\n class=\"form-control\"\n formControlName=\"cvc\"\n [placeholder]=\"'User.Payments.Cvc' | transloco\"\n name=\"cvc\"\n [attr.aria-label]=\"'User.Payments.Cvc' | transloco\" />\n @if (form.get('cvc').touched && form.get('cvc').errors?.required) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.CvcRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only\" id=\"update-payment-exp_month-label\" class=\"pw-label-style\">{{ 'User.Payments.ExpMonth' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'update-payment-exp_month-label'\"\n [options]=\"months\"\n [appendTo]=\"'body'\"\n formControlName=\"exp_month\"\n [placeholder]=\"'User.Payments.ExpMonth' | transloco\"\n optionValue=\"value\"\n optionLabel=\"value\">\n </p-select>\n @if (form.get('exp_month').touched && form.get('exp_month').errors?.required) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.ExpMonthRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only\" id=\"update-payment-exp_year-label\">{{ 'User.Payments.ExpYear' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'update-payment-exp_year-label'\"\n [options]=\"years\"\n formControlName=\"exp_year\"\n [placeholder]=\"'User.Payments.ExpYear' | transloco\"\n optionValue=\"value\"\n [appendTo]=\"'body'\"\n optionLabel=\"value\">\n </p-select>\n @if (form.get('exp_year')?.touched && form.get('exp_year')?.errors?.['required']) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.ExpYearRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n <div class=\"col-12 text-center mt-4\">\n <img src=\"/assets/img/icons/powered_by_stripe_v2.png\"\n class=\"payment-provider\"\n alt=\"\" />\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n (click)=\"cancel()\"\n class=\"btn btn-outline-default me-2\">\n {{ 'User.Payments.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\"\n [buttonBusy]=\"busy\">\n {{ 'User.Payments.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n }\n </div>\n </div>\n </div>\n\n <!-- Secondary payment method (Braintree or Airwallex, main-api #974) -->\n <div class=\"col-12 col-lg-6\">\n <div class=\"card payment-right p-3 h-100\">\n <div class=\"card-body\">\n <pw-secondary-payment-method\n [subscriptionId]=\"subscriptionId\"\n [card]=\"secondaryCard\"\n [provider]=\"secondaryProvider\"\n [loading]=\"loading\"\n (saved)=\"refreshPaymentMethods()\">\n </pw-secondary-payment-method>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n</div>\n","import { ChangeDetectorRef, inject } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AppState, GetUser } from '@posiwise/app-store';\nimport { SavedStripeCard, SubscriptionService } from '@posiwise/common-services';\nimport { Product, Subscription } from '@posiwise/common-utilities';\nimport { HelperService } from '@posiwise/helper-service';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\nimport { Store } from '@ngrx/store';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare let Stripe;\n\nfunction stripeCard(value) {\n return {\n number: value.card_number,\n cvc: value.cvc,\n exp_month: value.exp_month,\n exp_year: value.exp_year\n };\n}\n\n/** Card, Stripe token and enrolment steps of the upgrade page (undecorated base). */\nexport abstract class UpgradeSubscriptionPayment extends AppBaseComponent {\n protected readonly fb = inject(FormBuilder);\n protected readonly modalService = inject(NgbModal);\n protected readonly subscriptionService = inject(SubscriptionService);\n private readonly store = inject<Store<AppState>>(Store);\n protected readonly cdr = inject(ChangeDetectorRef);\n\n form: FormGroup = this.fb.group({\n card_number: ['', Validators.required],\n units: [],\n cvc: ['', Validators.required],\n exp_month: ['', Validators.required],\n exp_year: ['', Validators.required]\n });\n\n product: Product;\n subscription: Subscription;\n cardDetails: SavedStripeCard | null;\n\n units: number;\n subscriptionId: number;\n\n stripePublishKey: string;\n\n busy: boolean;\n isPurchaseAttempted: boolean;\n\n showNewCard: boolean;\n passwordModalVisible: boolean;\n\n errorMsg;\n\n /** No Stripe plan and no price: nothing to charge, so no card is asked for. */\n get isFree(): boolean {\n return !this.product?.stripe_plan_id && !Number(this.product?.price_per_unit);\n }\n\n private postCreateToken(cardToken) {\n const data = {\n stripe_token: cardToken,\n product_id: this.product.id,\n units: this.form.get('units').value || 1,\n subscription_id: this.subscriptionId\n };\n this.userService\n .addNewSubscriptionUsingStripe(data)\n .subscribe({\n next: () => {\n this.form.markAsPristine();\n this.toast.success(\n this.translation.translate('User.Subscriptions.SubscriptionPurchased')\n );\n this.router.navigate(['/account/subscriptions']);\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n },\n error: () => {\n this.busy = false;\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.busy = false;\n this.cdr.markForCheck();\n });\n }\n\n protected onPurchaseSubmit() {\n this.busy = true;\n this.passwordModalVisible = true;\n if (this.isFree) {\n this.enrollUserToSubscription();\n } else if (this.subscription.stripe_customer_id) {\n if (this.showNewCard) {\n this.updateCardDetails();\n } else {\n this.enrollUserToSubscription();\n }\n } else if (this.form.valid) {\n const cardDetails = stripeCard(this.form.value);\n // Get publishable key from product get id\n Stripe.card.createToken(\n cardDetails,\n (status, response) => {\n if (status === StatusCodes.OK) {\n const cardToken = response.id;\n this.postCreateToken(cardToken);\n } else {\n this.toast.error(response?.error?.message, '', { disableTimeOut: true });\n this.busy = false;\n this.isPurchaseAttempted = false;\n }\n this.cdr.markForCheck();\n },\n () => {\n this.busy = false;\n this.isPurchaseAttempted = false;\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n }\n );\n }\n }\n\n private enrollUserToSubscription() {\n const data = {\n product_id: this.product.id,\n units: this.form.get('units').value,\n subscription_id: this.subscriptionId\n };\n\n this.subscriptionService.postSubscription(data).subscribe({\n next: ({ result }) => {\n this.store.dispatch(new GetUser());\n if (result.id) {\n this.form.markAsPristine();\n this.router.navigate(['/account/subscriptions']);\n this.toast.success(\n this.translation.translate('User.Subscriptions.SubscriptionPurchased')\n );\n this.isPurchaseAttempted = false;\n this.modalService.dismissAll();\n this.back();\n }\n this.cdr.markForCheck();\n },\n error: () => {\n this.busy = false;\n this.isPurchaseAttempted = false;\n this.cdr.markForCheck();\n },\n complete: () => {\n this.busy = !this.busy;\n this.cdr.markForCheck();\n }\n });\n }\n\n @ValidateForm('form')\n updateCardDetails() {\n const cardDetails = stripeCard(this.form.value);\n Stripe.setPublishableKey(this.stripePublishKey);\n\n Stripe.card.createToken(cardDetails, (status, res) => {\n if (status !== 200) {\n this.toast.error(res.error.message);\n } else {\n this.subscriptionService\n .updateCardDetails(this.form.value, this.subscriptionId)\n .subscribe({\n next: ({ result }) => {\n if (result.error) {\n const err = result.error.errors[0].message;\n this.toast.error(err);\n } else if (result.status === StatusCodes.CREATED) {\n this.enrollUserToSubscription();\n this.toast.success(result.message);\n }\n this.cdr.markForCheck();\n },\n error: error => {\n this.errorMsg = HelperService.getErrorMessage(error);\n this.toast.error(this.errorMsg);\n this.cdr.markForCheck();\n }\n });\n }\n this.cdr.markForCheck();\n });\n }\n}\n","import { DecimalPipe } from '@angular/common';\nimport { Component, inject, OnInit, ViewChild } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\n\nimport { FormHelperService, ProductService, ScriptLoaderService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport {\n ConfirmDialogService,\n NumberPickerComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1\n} from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { SavedCardDetailsComponent } from '../saved-card-details/saved-card-details.component';\n\nimport { UpgradeSubscriptionPayment } from './upgrade-subscription-payment';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare let Stripe;\n\n@Component({\n selector: 'pw-upgrade-subscription',\n templateUrl: './upgrade-subscription.component.html',\n styleUrls: ['./upgrade-subscription.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n NumberPickerComponent,\n SavedCardDetailsComponent,\n Bind,\n Select,\n LazyImgDirective,\n RouterLink,\n ButtonBusyDirective,\n PasswordValidationComponent_1,\n DecimalPipe,\n TranslocoPipe\n ]\n})\nexport class UpgradeSubscriptionComponent extends UpgradeSubscriptionPayment implements OnInit {\n private readonly productService = inject(ProductService);\n private readonly scriptLoader = inject(ScriptLoaderService);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n @ViewChild('passwordValidationModal', { static: true })\n passwordValidationModal: PasswordValidationComponent;\n\n user: User;\n\n productId: number;\n\n unitError: string;\n password: string;\n\n months = [];\n years = [];\n\n get totalAmount() {\n if (this.product) {\n const units = Number(this.form.get('units').value);\n // eslint-disable-next-line no-restricted-globals\n if (!Number.isNaN(units)) {\n return (units * this.product.price_per_unit) / 100;\n }\n }\n\n return 0;\n }\n\n ngOnInit(): void {\n this.scriptLoader.loadScriptOnce('head', 'https://js.stripe.com/v2/');\n this.years = HelperService.getYears();\n this.months = HelperService.getMonths();\n\n this.userStore().subscribe(user => {\n this.user = user;\n this.cdr.markForCheck();\n });\n\n this.route.params.subscribe(response => {\n this.subscriptionId = +response['subscriptionId'];\n this.productId = +response['productId'];\n this.getSubscriptionDetails();\n this.getCardDetails(this.subscriptionId);\n this.cdr.markForCheck();\n });\n }\n\n getSubscriptionDetails() {\n this.subscriptionService\n .getById(this.subscriptionId)\n .subscribe(({ result }) => {\n this.subscription = result;\n const product = this.subscription.products.find(x => x.id === this.productId);\n this.form.patchValue({\n units: product?.purchased_units\n });\n\n this.units = this.form.get('units').value;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.getProductDetails();\n });\n }\n\n getProductDetails() {\n this.productService.getProductById(this.productId).subscribe(({ result }) => {\n this.product = result;\n this.stripePublishKey = result?.stripe_publishable_key;\n if (result?.stripe_publishable_key) {\n Stripe.setPublishableKey(result.stripe_publishable_key);\n }\n const prodUnits =\n this.units > this.product.min_units ? this.units : this.product.min_units || 1;\n\n this.form.patchValue({\n units: prodUnits\n });\n\n this.units = this.form.get('units').value;\n this.cdr.markForCheck();\n });\n }\n\n onMaxReached(event) {\n if (event) {\n this.unitError = `Maximum is ${this.units}`;\n }\n }\n\n onMinReached(event) {\n if (event) {\n this.unitError = `Minimum is ${this.subscription.min_units || this.product.min_units}`;\n }\n }\n\n onUnitChange(event) {\n this.units = event;\n this.form.patchValue({\n units: event\n });\n this.unitError = '';\n }\n\n onValidatePassword(isSuccess: boolean) {\n if (isSuccess) {\n this.onPurchaseSubmit();\n this.password = null;\n this.modalService.dismissAll();\n }\n }\n\n attemptPurchase() {\n if (this.user.has_password) {\n this.passwordValidationModal.open();\n } else {\n this.noPasswordModal();\n }\n }\n\n private noPasswordModal() {\n this.confirmDialog.open({\n titleKey: 'User.Subscriptions.SetPassword.Title',\n textKey: 'User.Subscriptions.SetPassword.TextWithLink',\n confirmOnly: true\n });\n }\n\n private getCardDetails(subscriptionId: number) {\n this.subscriptionService.getCardDetails(subscriptionId).subscribe(({ result }) => {\n this.cardDetails = result?.data ?? null;\n this.form.patchValue({\n units: this.units,\n card_number: this.cardDetails?.card_number,\n exp_month: this.cardDetails?.exp_month || '',\n exp_year: this.cardDetails?.exp_year || ''\n });\n this.cdr.markForCheck();\n });\n }\n\n onDiscardToggle() {\n this.form.markAllAsTouched();\n FormHelperService.markFormAsPristine(this.form);\n }\n}\n","<h4 class=\"form-section m-3\">\n <i class=\"ft-check-circle\" aria-hidden=\"true\"></i> {{ 'Button.Payment' | transloco }}\n</h4>\n<div class=\"card-block\">\n <!-- Show Payment Page when there is user.has_stripe_account===false -->\n <ng-container>\n <form class=\"form\"\n (ngSubmit)=\"attemptPurchase()\"\n [formGroup]=\"form\">\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"form-body p-3 payment-left card pb-0\">\n <div class=\"card-body\">\n @if (product?.max_units > 1) {\n <div class=\"row\"\n >\n <div class=\"col-12\">\n <div class=\"mb-3\">\n <h4 class=\"title\">\n {{ 'User.Subscriptions.LicensesRequired' | transloco }}\n </h4>\n <div class=\"row btns-row\">\n <div class=\"col-md-4 col-8\">\n <pw-number-picker name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription.min_units || product.min_units\"\n [max]=\"product.max_units\"\n step=\"1\"\n [postfix]=\"'Label.Seats' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"false\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n </div>\n <div class=\"text-center\">\n <small class=\"form-text text-muted danger\">\n {{ unitError }}\n </small>\n </div>\n </div>\n @if (!isFree) {\n <p>\n {{ 'User.Subscriptions.Upgrade.ChargeNotice' | transloco }}\n <strong>{{ product.currency }}\n {{ totalAmount | number:'1.2-2' }}</strong>\n </p>\n }\n </div>\n </div>\n }\n <!-- Shows Saved Card: Shows when user has card details and not trying to update the card details -->\n @if (cardDetails && !isFree) {\n <pw-saved-card-details [data]=\"cardDetails\"\n (changeEvent)=\"showNewCard = $event\"\n [showNewCard]=\"showNewCard\">\n </pw-saved-card-details>\n }\n <!-- Add New Payment Starts, opens up when user doesn't have stripe account or tries to change the\n card details -->\n @if (!isFree && ((user && !cardDetails) || (cardDetails && showNewCard))) {\n <h4 class=\"title\">\n {{ 'User.Subscriptions.NewCard' | transloco }}?\n </h4>\n <div class=\"row\">\n <div class=\"col-md-9\">\n <div class=\"mb-3\">\n <label for=\"upgrade-subscription-card_number\">{{\n 'User.Subscriptions.CardNumber' | transloco\n }}</label>\n <input type=\"text\"\n id=\"upgrade-subscription-card_number\"\n class=\"form-control\"\n formControlName=\"card_number\"\n [placeholder]=\"'User.Subscriptions.CardNumber' | transloco\"\n name=\"card_number\"\n [attr.aria-label]=\"'User.Subscriptions.CardNumber' | transloco\" />\n @if (\n form.get('card_number').touched &&\n form.get('card_number').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.CardNumberRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"mb-3\">\n <label for=\"upgrade-subscription-cvc\">{{\n 'User.Subscriptions.CVC' | transloco\n }}</label>\n <input type=\"text\"\n id=\"upgrade-subscription-cvc\"\n class=\"form-control\"\n formControlName=\"cvc\"\n [placeholder]=\"'User.Subscriptions.CVC' | transloco\"\n name=\"cvc\"\n [attr.aria-label]=\"'User.Subscriptions.CVC' | transloco\" />\n @if (\n form.get('cvc').touched &&\n form.get('cvc').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.CvcRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only pw-label-style\" id=\"upgrade-subscription-exp_month-label\">{{ 'User.Payments.ExpMonth' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'upgrade-subscription-exp_month-label'\"\n [options]=\"months\"\n formControlName=\"exp_month\"\n [placeholder]=\"'User.Payments.ExpMonth' | transloco\"\n optionValue=\"value\"\n [appendTo]=\"'body'\"\n optionLabel=\"value\">\n </p-select>\n @if (\n form.get('exp_month').touched &&\n form.get('exp_month').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.ExpMonthRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only\" id=\"upgrade-subscription-exp_year-label\">{{ 'User.Payments.ExpYear' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'upgrade-subscription-exp_year-label'\"\n [options]=\"years\"\n formControlName=\"exp_year\"\n [placeholder]=\"'User.Payments.ExpYear' | transloco\"\n [appendTo]=\"'body'\"\n optionValue=\"value\"\n optionLabel=\"value\">\n </p-select>\n @if (\n form.get('exp_year').touched &&\n form.get('exp_year').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.ExpYearRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n @if (cardDetails) {\n <div class=\"col-12 mt-2\"\n >\n <a [attr.aria-label]=\"'User.Subscriptions.Upgrade.UseSavedCard' | transloco\"\n (click)=\"showNewCard = false; onDiscardToggle()\">{{ 'User.Subscriptions.Upgrade.UseSavedCard' | transloco }}</a>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <!-- Purchase Summary -->\n @if (product) {\n <div class=\"col-md-6\"\n >\n <div class=\"purchase-summary card p-3 payment-right\">\n <div class=\"card-body\">\n <h4 class=\"title\">{{ 'Label.PurchaseSummary' | transloco }}</h4>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Plan' | transloco }}:</div>\n <div class=\"summary-right\">{{ product.name }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Price' | transloco }}:</div>\n <div class=\"summary-right\">\n {{ product.currency }}\n {{ (product.price_per_unit / 100) | number:'1.2-2' }}\n </div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Seats' | transloco }}:</div>\n <div class=\"summary-right\">{{ form.get('units').value }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Total' | transloco }}:</div>\n <div class=\"summary-right\">\n {{ product.currency }} {{ totalAmount | number:'1.2-2' }}\n </div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">\n {{ 'Label.Recurrency' | transloco }}:\n </div>\n <div class=\"summary-right\">{{ product.billing_frequency }}</div>\n </div>\n </div>\n <div class=\"text-center\">\n <hr />\n <p>\n {{ 'User.Subscriptions.Upgrade.TermsAcknowledgement' | transloco }}\n </p>\n </div>\n </div>\n </div>\n }\n </div>\n <div class=\"row\">\n <div class=\"col-12 text-center mt-3\">\n <img src=\"/assets/img/icons/powered_by_stripe_v2.png\"\n class=\"payment-provider\"\n alt=\"\" />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"form-actions text-end\">\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default me-1\"\n [disabled]=\"isPurchaseAttempted\"\n routerLink=\"/account/subscriptions\">\n <i class=\"ft-x\" aria-hidden=\"true\"></i>{{ 'Button.Back' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [disabled]=\"isPurchaseAttempted\"\n [buttonBusy]=\"busy\">\n <i class=\"ft-check\" aria-hidden=\"true\"></i>\n {{ 'Button.Purchase' | transloco }}\n </button>\n </div>\n </div>\n </div>\n </form>\n </ng-container>\n</div>\n\n<pw-password-validation #passwordValidationModal\n (successEvent)=\"onValidatePassword($event)\">\n <div class=\"row\">\n <div class=\"col-12\">\n <p>\n @if (!isFree) {\n {{ 'User.Subscriptions.Upgrade.ChargeNotice' | transloco }}\n }\n @if (totalAmount) {\n <strong>{{ product.currency }} {{ totalAmount | number:'1.2-2' }}</strong>\n }\n </p>\n </div>\n </div>\n</pw-password-validation>\n","import {\n AbstractControl,\n FormBuilder,\n ValidationErrors,\n ValidatorFn,\n Validators\n} from '@angular/forms';\n\nimport { ValidationService } from '@posiwise/common-services';\n\nexport function commaSeparatedEmailsValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) {\n return null; // Allow empty values\n }\n\n const value = control.value as string;\n\n // Check if there are spaces around commas (comma-space or space-comma patterns)\n if (value.includes(',') && (value.includes(', ') || value.includes(' ,'))) {\n return { invalidFormat: true };\n }\n\n // Check if any email part contains spaces (after splitting by comma)\n const emailParts = value.split(',');\n if (emailParts.some((part: string) => part.trim() !== part || part.includes(' '))) {\n return { invalidFormat: true };\n }\n\n // Validate each email\n const emails = emailParts.map((email: string) => email.trim());\n for (const email of emails) {\n if (email && !ValidationService.email(email)) {\n return { invalidEmail: true };\n }\n }\n\n return null;\n };\n}\n\nexport function createSubscriptionDetailsForm(fb: FormBuilder) {\n return fb.group({\n organisation: ['', [Validators.required]],\n contact_name: ['', [Validators.required]],\n contact_email: ['', [Validators.required, Validators.email]],\n contact_tel: [''],\n tax_id: [''],\n invoice_recipient_emails: ['', [commaSeparatedEmailsValidator()]],\n address: ['', [Validators.required]],\n country_code: ['', [Validators.required]],\n facebook_handle: [''],\n twitter_handle: [''],\n linkedin_handle: [''],\n reddit_handle: [''],\n company_url: [''],\n enforce_2fa: [false],\n rag_use_own_data: [true],\n rag_keep_pii: [false],\n rag_slack_history: [false]\n });\n}\n\n/** Strips the spaces around each address of a comma-separated e-mail list. */\nexport function trimEmailList(emails: string): string {\n return emails\n .split(',')\n .map((email: string) => email.trim())\n .join(',');\n}\n\n/** `{slug}_{timestamp}.png` file for an uploaded logo image. */\nexport function slugPngFile(slug: string, blob: Blob): File {\n const filename = `${`${slug.toLocaleLowerCase()}_${Date.parse(new Date().toString())}`}.png`;\n return new File([blob], filename);\n}\n","import { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { SubscriptionService } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\n/** API token display and refresh of the subscription details page (undecorated base). */\nexport abstract class SubscriptionApiTokens extends AppBaseComponent {\n protected readonly subscriptionService = inject(SubscriptionService);\n protected readonly cdr = inject(ChangeDetectorRef);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n subscription: Subscription;\n subscriptionId: number;\n\n showApiToken = false;\n showApiClientId = false;\n refreshingTokens = false;\n\n protected abstract fetchData(): void;\n\n toggleApiTokenVisibility() {\n this.showApiToken = !this.showApiToken;\n }\n\n toggleApiClientIdVisibility() {\n this.showApiClientId = !this.showApiClientId;\n }\n\n refreshApiTokens() {\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmTitle'\n ),\n text: this.translation.translate('Common.Confirm.RefreshApiTokens.Text'),\n destructive: true,\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmLabel'\n )\n })\n .then(ok => {\n if (ok) {\n this.performTokenRefresh();\n }\n });\n }\n\n private performTokenRefresh() {\n this.refreshingTokens = true;\n this.subscriptionService\n .refreshApiTokens(this.subscriptionId)\n .subscribe({\n next: ({ result }) => {\n if (result && result.api_access_token) {\n this.subscription.api_access_token = result.api_access_token;\n }\n if (result && result.api_client_id) {\n this.subscription.api_client_id = result.api_client_id;\n }\n\n this.showApiToken = false;\n this.showApiClientId = false;\n this.fetchData();\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.refreshingTokens = false;\n this.cdr.markForCheck();\n });\n }\n}\n","import { inject } from '@angular/core';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { dataUrlToBlob } from '../../account-details/account-details.utils';\n\nimport { SubscriptionApiTokens } from './subscription-api-tokens';\nimport { slugPngFile } from './subscription-details.utils';\n\n/** Full and squared logo upload of the subscription details page (undecorated base). */\nexport abstract class SubscriptionLogos extends SubscriptionApiTokens {\n protected readonly modalService = inject(NgbModal);\n\n squaredLogo: string;\n fullLogo: string;\n fullLogoBroken = false;\n squaredLogoBroken = false;\n slug: string;\n\n openModal(content) {\n this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });\n }\n\n onImageSelection(event) {\n const file = slugPngFile(this.slug, this.dataURLtoBlob(event));\n this.subscriptionService.addFullLogo(this.subscriptionId, file).subscribe(res => {\n this.modalService.dismissAll();\n this.fullLogo = res?.result?.full_logo?.url;\n this.fullLogoBroken = false;\n this.cdr.markForCheck();\n });\n }\n\n uploadSquaredLogo(event) {\n const file = slugPngFile(this.slug, this.dataURLtoBlob(event));\n this.subscriptionService.addSquaredLogo(this.subscriptionId, file).subscribe(res => {\n this.modalService.dismissAll();\n this.squaredLogo = res?.result?.squared_logo?.url;\n this.squaredLogoBroken = false;\n this.cdr.markForCheck();\n });\n }\n\n onClose() {\n this.modalService.dismissAll();\n }\n\n dataURLtoBlob(dataUrl) {\n return dataUrlToBlob(dataUrl);\n }\n}\n","import { PasswordValidationComponent } from '@posiwise/shared-components';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { SubscriptionLogos } from './subscription-logos';\n\n/** Seat (unit) count changes of the subscription details page (undecorated base). */\nexport abstract class SubscriptionSeats extends SubscriptionLogos {\n abstract modal: PasswordValidationComponent;\n\n allowUpdate: boolean;\n hasUnitChanged: boolean;\n\n unitError: string;\n\n units = 1;\n\n totalAmount() {\n const allProductsPrice = this.subscription.products.map(x => x.price_per_unit * this.units);\n\n return allProductsPrice.reduce((a: number, b: number) => a + b, 0) / 100;\n }\n\n /** *\n * Update seats for all the products of subscription\n */\n updateUnits() {\n if (this.subscription.products[0].trial_subscription) {\n return;\n }\n this.modal.open();\n }\n\n onPasswordValidation(_event) {\n this.subscriptionService\n .updateSubscriptionUnit(this.subscription.id, this.units)\n .subscribe(({ result }) => {\n if (result.status === StatusCodes.OK) {\n this.toast.success(\n this.translation.translate('User.Subscriptions.Details.UnitsUpdatedMessage')\n );\n } else {\n this.toast.error(this.translation.translate('GenericMessage.WentWrong'));\n }\n this.cdr.markForCheck();\n });\n }\n\n onMaxReached(event) {\n if (event) {\n this.unitError = this.translation.translate('Register.Units.Maximum', {\n units: this.units\n });\n }\n }\n\n onMinReached(event) {\n if (event) {\n this.unitError = this.translation.translate('Register.Units.Minimum', {\n units: this.units\n });\n }\n }\n\n onUnitChange(event) {\n this.allowUpdate = true;\n this.hasUnitChanged = true;\n this.units = event;\n this.unitError = '';\n }\n}\n","import { AsyncPipe, CurrencyPipe, DecimalPipe, NgClass } from '@angular/common';\nimport { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\nimport { NgxGpAutocompleteModule } from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppState, GetUser } from '@posiwise/app-store';\nimport { AI_ASSISTANT_FLAG, API_MCP_ACCESS_FLAG, GeoService } from '@posiwise/common-services';\nimport { Country, Product, User } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective, RbacAllowDirective } from '@posiwise/directives';\nimport { CurrencySymbolPipe } from '@posiwise/pipes';\nimport {\n InputContainerComponent,\n NumberPickerComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1,\n PwStickyActionsComponent\n} from '@posiwise/shared-components';\nimport { ProfileImageCropperComponent, ValidateForm } from '@posiwise/utils';\n\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\nimport { Tooltip } from 'primeng/tooltip';\nimport { combineLatest, map, Observable } from 'rxjs';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { Store } from '@ngrx/store';\n\nimport { createSubscriptionDetailsForm, trimEmailList } from './subscription-details.utils';\nimport { SubscriptionSeats } from './subscription-seats';\n\n@Component({\n templateUrl: './user-subscription-details.component.html',\n styleUrls: ['./user-subscription-details.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n Select,\n NgxGpAutocompleteModule,\n Tooltip,\n LazyImgDirective,\n RbacAllowDirective,\n NumberPickerComponent,\n NgClass,\n UiSwitchModule,\n PwStickyActionsComponent,\n RouterLink,\n ButtonBusyDirective,\n ProfileImageCropperComponent,\n PasswordValidationComponent_1,\n AsyncPipe,\n DecimalPipe,\n CurrencyPipe,\n TranslocoPipe,\n CurrencySymbolPipe\n ]\n})\nexport class UserSubscriptionDetailsComponent\n extends SubscriptionSeats\n implements OnInit, OnDestroy\n{\n private readonly fb = inject(FormBuilder);\n private readonly geoService = inject(GeoService);\n private readonly store = inject<Store<AppState>>(Store);\n private readonly transloco = inject(TranslocoService);\n\n @ViewChild('modal', { static: true }) modal: PasswordValidationComponent;\n\n busyButton = false;\n\n form: FormGroup;\n\n countries$: Observable<Country[]>;\n\n userId: number;\n\n user: User;\n\n constructor() {\n super();\n this.form = createSubscriptionDetailsForm(this.fb);\n this.route.params.subscribe(params => {\n this.subscriptionId = +params['subscriptionId'];\n this.fetchData();\n this.cdr.markForCheck();\n });\n }\n\n ngOnInit() {\n this.geoService.getCountries().subscribe(() => {\n this.countries$ = combineLatest([\n this.geoService.getCountries(),\n this.transloco.selectTranslate('User.Profile.SelectCountry')\n ]).pipe(\n map(([countries, label]: [Country[], string]) => [\n { name: label, code: null },\n ...countries\n ])\n );\n this.cdr.markForCheck();\n });\n this.userStore().subscribe(user => {\n if (user) {\n this.slug = user.slug;\n this.user = user;\n this.userId = user.id;\n }\n this.cdr.markForCheck();\n });\n }\n\n protected fetchData() {\n this.subscriptionService.getById(this.subscriptionId).subscribe(({ result }) => {\n this.subscription = result;\n this.fullLogo = this.subscription?.full_logo.url;\n this.squaredLogo = this.subscription?.squared_logo?.url;\n this.fullLogoBroken = false;\n this.squaredLogoBroken = false;\n this.form.patchValue(this.subscription);\n this.units = this.subscription?.products[0]?.purchased_units;\n this.form.patchValue({\n units: this.units\n });\n if (this.canManage) {\n this.form.enable({ emitEvent: false });\n } else {\n this.form.disable({ emitEvent: false });\n }\n this.cdr.markForCheck();\n });\n }\n\n /** White-label company name for \"Your {brand} AI assistant\" (same source as the login page and chat widget). */\n get brandName(): string {\n return this.appConfig?.company?.name?.trim() || 'PosiWise';\n }\n\n /** Plain members can view the subscription but only its admins can change it. */\n get canManage(): boolean {\n return !!this.subscription?.can_manage;\n }\n\n get apiMcpEnabled(): boolean {\n return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG];\n }\n\n get aiAssistantEnabled(): boolean {\n return !!this.user?.feature_flags?.[AI_ASSISTANT_FLAG];\n }\n\n @ValidateForm('form')\n onSaveDetails() {\n this.busyButton = true;\n const formValue = { ...this.form.value };\n\n // Process invoice_recipient_emails: remove spaces from comma-separated emails\n if (formValue.invoice_recipient_emails) {\n formValue.invoice_recipient_emails = trimEmailList(formValue.invoice_recipient_emails);\n }\n\n this.subscriptionService\n .updateSubscription(Number(this.subscriptionId), formValue)\n .subscribe(() => {\n this.form.markAsPristine();\n this.toast.success(\n this.translation.translate('User.Subscriptions.Details.UpdatedMessage')\n );\n this.store.dispatch(new GetUser());\n this.back();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.busyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n handleAddressChange(event) {\n this.form.get('address').setValue(event.formatted_address);\n }\n\n trackByProduct(_index: number, item: Product) {\n return item.id;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.allowUpdate = false;\n }\n}\n","<!-- edit Subscription details page -->\n<div class=\"row\">\n <div class=\"col-12\">\n <h3 class=\"my-3\">{{ subscription?.organisation || subscription?.contact_name }}</h3>\n @if (subscription && !canManage) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.Details.ReadOnly' | transloco }}</p>\n }\n </div>\n</div>\n\n@if (subscription) {\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetails()\"\n class=\"row mt-4\"\n >\n <!-- 1. Contact details -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Contact' | transloco }}</h3>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactName' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactName' | transloco\"\n name=\"contact_name\"\n controlId=\"user-subscription-contact_name\"\n errorMsg=\"User.Account.Validation.ContactName\">\n <input type=\"text\"\n id=\"user-subscription-contact_name\"\n class=\"form-control\"\n formControlName=\"contact_name\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactName' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactEmail' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\"\n name=\"contact_email\"\n controlId=\"user-subscription-contact_email\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactEmail\">\n <input type=\"text\"\n id=\"user-subscription-contact_email\"\n class=\"form-control\"\n formControlName=\"contact_email\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Organization' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Organisation' | transloco\"\n name=\"organisation\"\n controlId=\"user-subscription-organisation\"\n errorMsg=\"User.Subscriptions.Details.Validation.Organisation\">\n <input type=\"text\"\n id=\"user-subscription-organisation\"\n class=\"form-control\"\n formControlName=\"organisation\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Organisation' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Phone' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactTel' | transloco\"\n name=\"contact_tel\"\n controlId=\"user-subscription-contact_tel\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactTel\">\n <input type=\"text\"\n id=\"user-subscription-contact_tel\"\n class=\"form-control\"\n formControlName=\"contact_tel\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactTel' | transloco\" />\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Country' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country_code\"\n controlId=\"user-subscription-country_code\"\n [useAriaLabelledbyOnly]=\"true\"\n [isLeftTooltip]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'user-subscription-country_code-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country_code\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Address' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Address' | transloco\"\n name=\"address\"\n controlId=\"user-subscription-address\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Address\">\n <input ngx-gp-autocomplete\n id=\"user-subscription-address\"\n name=\"address\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'user-subscription-address-label'\"\n #places=\"ngx-places\"\n formControlName=\"address\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Address' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.VatNumber' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TaxId' | transloco\"\n name=\"tax_id\"\n controlId=\"user-subscription-tax_id\"\n errorMsg=\"User.Subscriptions.Details.Validation.TaxId\">\n <input type=\"text\"\n id=\"user-subscription-tax_id\"\n class=\"form-control\"\n formControlName=\"tax_id\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TaxId' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.CompanyUrl' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\"\n name=\"company_url\"\n controlId=\"user-subscription-company_url\"\n errorMsg=\"User.Subscriptions.Details.Validation.CompanyUrl\">\n <input type=\"text\"\n id=\"user-subscription-company_url\"\n class=\"form-control\"\n formControlName=\"company_url\"\n [attr.aria-label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.InvoiceRecipientEmails' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\"\n name=\"invoice_recipient_emails\"\n controlId=\"user-subscription-invoice_recipient_emails\"\n errorMsg=\"User.Subscriptions.Details.Validation.InvoiceRecipientEmails\">\n <input type=\"text\"\n id=\"user-subscription-invoice_recipient_emails\"\n class=\"form-control\"\n formControlName=\"invoice_recipient_emails\"\n [placeholder]=\"'User.Subscriptions.Details.Placeholder.InvoiceRecipientEmails' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\" />\n </pw-input-container>\n\n <!-- 2. Branding / Logos -->\n <div class=\"col-12\">\n <div class=\"row branding-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Branding' | transloco }}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.FullLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.FullLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (fullLogo && !fullLogo.includes('no_image_uploaded') && !fullLogoBroken) {\n <img [src]=\"fullLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.FullAlt' | transloco\"\n class=\"image full-logo\"\n role=\"presentation\"\n (error)=\"fullLogoBroken = true\" />\n @if (canManage) {\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n }\n } @else {\n @if (canManage) {\n <div class=\"logo-dropzone full-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadFull' | transloco\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n }\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.SquaredLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (squaredLogo && !squaredLogo.includes('no_image_uploaded') && !squaredLogoBroken) {\n <img [src]=\"squaredLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.SquaredAlt' | transloco\"\n class=\"squared_logo\"\n role=\"presentation\"\n (error)=\"squaredLogoBroken = true\" />\n @if (canManage) {\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n }\n } @else {\n @if (canManage) {\n <div class=\"logo-dropzone squared-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadSquared' | transloco\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 3. Social Media -->\n <ng-container *rbacAllow=\"'SubscriptionSuperAdmin'\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.SocialMedia' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.SocialMedia.Description' | transloco }}\n </p>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.FacebookHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\"\n name=\"facebook_handle\"\n controlId=\"user-subscription-facebook_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.FacebookHandle\">\n <input type=\"text\"\n id=\"user-subscription-facebook_handle\"\n class=\"form-control\"\n formControlName=\"facebook_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.TwitterHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\"\n name=\"twitter_handle\"\n controlId=\"user-subscription-twitter_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.TwitterHandle\">\n <input type=\"text\"\n id=\"user-subscription-twitter_handle\"\n class=\"form-control\"\n formControlName=\"twitter_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.LinkedinHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\"\n name=\"linkedin_handle\"\n controlId=\"user-subscription-linkedin_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.LinkedinHandle\">\n <input type=\"text\"\n id=\"user-subscription-linkedin_handle\"\n class=\"form-control\"\n formControlName=\"linkedin_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RedditHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\"\n name=\"reddit_handle\"\n controlId=\"user-subscription-reddit_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.RedditHandle\">\n <input type=\"text\"\n id=\"user-subscription-reddit_handle\"\n class=\"form-control\"\n formControlName=\"reddit_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\" />\n </pw-input-container>\n </ng-container>\n\n <!-- 4. Seats -->\n <div class=\"col-12\">\n <div class=\"row seats-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</h3>\n <p>{{ 'User.Subscriptions.Details.Seats.Description' | transloco }}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (subscription?.trial_subscription && subscription?.calculated_price) {\n <small\n class=\"text-danger\">{{ 'User.Subscriptions.Details.Seats.UpgradeRequired' | transloco }}</small>\n }\n </div>\n </div>\n <div class=\"row btns-row align-items-center\">\n @if (subscription) {\n <div class=\"col-md-3 col-8\"\n >\n <label for=\"user-subscription-seats\" class=\"visually-hidden\">{{ 'User.Subscriptions.Tooltip.Seats' | transloco }}</label>\n <pw-number-picker [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Seats'|transloco\"\n inputId=\"user-subscription-seats\"\n name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription?.min_units||subscription?.products[0].min_units\"\n [max]=\"subscription?.products[0].max_units\"\n step=\"1\"\n [postfix]=\"'User.Subscriptions.Details.Seats.Postfix' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"!canManage || subscription?.products[0].trial_subscription\"\n [showUpButton]=\"canManage && !subscription?.products[0].trial_subscription\"\n [showDownButton]=\"canManage && !subscription?.products[0].trial_subscription\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n }\n\n @if (subscription) {\n <div class=\"col-md-3 col-4 p-1\"\n >\n @if (canManage && !subscription?.products[0].trial_subscription && allowUpdate) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"updateUnits()\">\n {{ 'User.Subscriptions.UpdateUnits' | transloco }}\n </button>\n } @else {\n <div>\n @if (subscription?.products[0].trial_subscription) {\n <small class=\"text-muted\"\n >{{ 'User.Subscriptions.Details.Seats.PaidOnly' | transloco }}</small>\n }\n </div>\n }\n </div>\n }\n\n @if (hasUnitChanged) {\n <div class=\"col-12 col-md-6\"\n >\n <table class=\"table table-borderless table-sm\"\n aria-describedby=\"Product details\">\n <thead>\n <tr>\n <th scope=\"true\">{{ 'Label.Product' | transloco }}</th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Seats.PricePerSeat' | transloco }} <span>({{subscription?.products[0]?.currency|currencySymbol}})</span></th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</th>\n </tr>\n </thead>\n <tbody>\n @for (product of subscription.products; track trackByProduct($index, product)) {\n <tr>\n <td>{{ product.name }}</td>\n <td>{{ product.price_per_unit / 100 }}</td>\n <td>{{ units }}</td>\n </tr>\n }\n </tbody>\n </table>\n <p>\n {{ 'User.Subscriptions.Details.Seats.NewCost' | transloco }}\n <strong>{{ totalAmount()| currency: subscription?.products[0]?.currency:'symbol-narrow'}}</strong>\n </p>\n </div>\n }\n </div>\n </div>\n\n <!-- 5. API & MCP Credentials -->\n @if (canManage && apiMcpEnabled && subscription?.api_hits_max > 0) {\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.ApiIntro' | transloco }}\n </p>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-token\">\n {{ 'User.Subscriptions.APICredentials.AccessToken' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Details.Tooltip.TokenDiscontinued' | transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? subscription?.api_access_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.AccessToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-client-id\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? subscription?.api_client_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ClientId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (subscription?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits | number }}</span>\n }\n @if (subscription?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (subscription?.api_hits !== null || subscription?.api_hits_max !== null) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (subscription.api_hits / subscription.api_hits_max) <= 0.8,\n 'text-warning': (subscription.api_hits / subscription.api_hits_max) > 0.8 && (subscription.api_hits / subscription.api_hits_max) <= 0.9,\n 'text-danger': (subscription.api_hits / subscription.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((subscription.api_hits / subscription.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- 6. Security -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Security' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.Security.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.Details.Enforce2fa' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Enforce2fa' | transloco\"\n name=\"enforce_2fa\"\n controlId=\"user-subscription-enforce_2fa\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"enforce_2fa\"\n name=\"enforce_2fa\"\n [attr.aria-labelledby]=\"'user-subscription-enforce_2fa-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n\n @if (aiAssistantEnabled) {\n <!-- 7. Brain AI data -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.BrainData.Title' | transloco: { brand: brandName } }}</h3>\n <p>{{ 'User.Subscriptions.BrainData.Description' | transloco: { brand: brandName } }}</p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.UseOwnDataLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagUseOwnData' | transloco: { brand: brandName }\"\n name=\"rag_use_own_data\"\n controlId=\"user-subscription-rag_use_own_data\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_use_own_data\"\n name=\"rag_use_own_data\"\n [attr.aria-labelledby]=\"'user-subscription-rag_use_own_data-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Keeping personal data is a question about WHAT is kept, so it only\n arises while there is something to keep. Hidden rather than disabled:\n a greyed-out switch still reads as an affordance, and the stored value\n survives in the form either way. -->\n @if (form.value.rag_use_own_data) {\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.KeepPiiLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagKeepPii' | transloco: { brand: brandName }\"\n name=\"rag_keep_pii\"\n controlId=\"user-subscription-rag_keep_pii\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_keep_pii\"\n name=\"rag_keep_pii\"\n [attr.aria-labelledby]=\"'user-subscription-rag_keep_pii-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Slack history is also the subscription's own data, so it needs \"Use subscription data\" too. -->\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.SlackHistoryLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagSlackHistory' | transloco: { brand: brandName }\"\n name=\"rag_slack_history\"\n controlId=\"user-subscription-rag_slack_history\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_slack_history\"\n name=\"rag_slack_history\"\n [attr.aria-labelledby]=\"'user-subscription-rag_slack_history-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n } @else {\n <div class=\"col-12 col-sm-6\">\n <p>{{ 'User.Subscriptions.BrainData.KeepPiiNotApplicable' | transloco: { brand: brandName } }}</p>\n </div>\n }\n }\n @if (canManage) {\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n routerLink=\"/account/subscriptions\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n [buttonBusy]=\"busyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n }\n </form>\n}\n\n<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.FullLogo' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"onImageSelection($event)\"\n aspectRatio=\"fullLogo\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<ng-template #squaredLogoContent\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"uploadSquaredLogo($event)\"\n aspectRatio=\"auto\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<pw-password-validation #modal\n(successEvent)=\"onPasswordValidation($event)\"> </pw-password-validation>\n","import { Clipboard } from '@angular/cdk/clipboard';\nimport { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AdminService } from '@posiwise/admin-module-utils';\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n API_MCP_ACCESS_FLAG,\n PermissionService,\n SubscriptionService\n} from '@posiwise/common-services';\nimport { Product, Subscription, User } from '@posiwise/common-utilities';\nimport { ConfirmDialogService, PasswordValidationComponent } from '@posiwise/shared-components';\n\nimport { CurrentItem } from '../../../shared/interface/user-module.interface';\n\n/** API-key reveal/refresh, account deletion and terms dialog of the subscriptions list (undecorated base). */\nexport abstract class SubscriptionListActions extends AppBaseComponent {\n protected readonly subscriptionService = inject(SubscriptionService);\n private readonly adminService = inject(AdminService);\n private readonly clipboard = inject(Clipboard);\n protected readonly cdr = inject(ChangeDetectorRef);\n protected readonly confirmDialog = inject(ConfirmDialogService);\n\n abstract passwordValidationModalForAccountDelete: PasswordValidationComponent;\n abstract passwordValidationModalForKey: PasswordValidationComponent;\n\n showApiKey = true;\n\n productName: string;\n\n user: User;\n\n currentItem: CurrentItem;\n\n showTos = false;\n\n productId: number;\n\n private readonly revealedClientIds = new Set<number>();\n\n protected abstract getSubscribedProduct(): void;\n\n /** Flag only, per product decision; deleted subscriptions are skipped because their ID no longer authenticates. */\n showsClientId(subscription: Subscription & { deleted?: boolean }): boolean {\n return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG] && !subscription.deleted;\n }\n\n isClientIdRevealed(subscriptionId: number): boolean {\n return this.revealedClientIds.has(subscriptionId);\n }\n\n toggleClientId(subscriptionId: number) {\n if (!this.revealedClientIds.delete(subscriptionId)) {\n this.revealedClientIds.add(subscriptionId);\n }\n }\n\n copyClientId(clientId: string) {\n if (this.clipboard.copy(clientId)) {\n this.toast.success(\n this.translation.translate('User.Subscriptions.List.ClientIdCopied')\n );\n }\n }\n\n onClipboardCopy(accessCode: string) {\n this.clipboard.copy(accessCode);\n this.toast.success(this.translation.translate('User.Subscriptions.AccessKeyCopied'));\n }\n\n updateApiKey(subscription, product) {\n this.subscriptionService\n .updateSubscriptionAPIKey(subscription.id, product.id)\n .subscribe(({ result }) => {\n product.api_access_token = result;\n this.toast.success(this.translation.translate('User.Subscriptions.UpdatedKey'));\n this.getSubscribedProduct();\n this.cdr.markForCheck();\n });\n }\n\n showKey(item) {\n this.currentItem = item;\n this.passwordValidationModalForKey.open();\n this.showApiKey = false;\n }\n\n displayApiKey() {\n this.showApiKey = true;\n this.currentItem.masked = this.currentItem?.api_access_token;\n }\n\n showModalForAccountDeletion() {\n this.confirmDialog\n .confirmDelete({\n textKey: 'Common.Confirm.Delete.TextSimple',\n textParams: { entityType: 'account' }\n })\n .then(ok => {\n if (ok) {\n this.passwordValidationModalForAccountDelete.open();\n }\n });\n }\n\n deleteUser(_event) {\n const subscriptionId = PermissionService.selectedSubscription.id;\n this.adminService.deleteUser(this.user.id, subscriptionId).subscribe(() => {\n this.router.navigate(['logout']);\n this.cdr.markForCheck();\n });\n }\n\n showPrivacyAndTos(product: Product) {\n this.productId = product.id;\n this.productName = product.name;\n this.showTos = true;\n }\n\n onCancel() {\n this.showTos = false;\n }\n}\n","import { DecimalPipe, NgClass, UpperCasePipe } from '@angular/common';\nimport { Component, OnInit, ViewChild } from '@angular/core';\nimport { RouterLink, RouterOutlet } from '@angular/router';\n\nimport { isInMobileWebView } from '@posiwise/common-services';\nimport { Product, Subscription } from '@posiwise/common-utilities';\nimport { RbacAllowDirective } from '@posiwise/directives';\nimport { DateFormatPipe } from '@posiwise/pipes';\nimport {\n NoDataComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1,\n PrivacyAndTosComponent\n} from '@posiwise/shared-components';\n\nimport sortBy from 'lodash/sortBy';\nimport { MenuItem } from 'primeng/api';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Tooltip } from 'primeng/tooltip';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { AddSubscriptionComponent } from '../add-subscription/add-subscription.component';\nimport { SubscriptionRemovalComponent } from '../subscription-removal/subscription-removal.component';\n\nimport { SubscriptionListActions } from './subscription-list-actions';\n\n@Component({\n selector: 'pw-user-subscriptions-list',\n templateUrl: './user-subscriptions-list.component.html',\n styleUrls: ['./user-subscriptions-list.component.scss'],\n imports: [\n Bind,\n ProgressSpinner,\n RouterLink,\n Tooltip,\n NgClass,\n RbacAllowDirective,\n NoDataComponent,\n PasswordValidationComponent_1,\n SubscriptionRemovalComponent,\n PrivacyAndTosComponent,\n RouterOutlet,\n UpperCasePipe,\n DecimalPipe,\n TranslocoPipe,\n DateFormatPipe\n ]\n})\nexport class UserSubscriptionListComponent extends SubscriptionListActions implements OnInit {\n // Billing is managed on the website, never inside the mobile app (App Store 3.1.1).\n readonly inMobileApp = isInMobileWebView();\n\n @ViewChild('menuItems', { static: false })\n menu: MenuItem[];\n\n @ViewChild(AddSubscriptionComponent, { static: false })\n changeSubscriptionRef: AddSubscriptionComponent;\n\n @ViewChild('passwordValidationModalForAccountDelete', { static: false })\n passwordValidationModalForAccountDelete: PasswordValidationComponent;\n\n @ViewChild('passwordValidationModalForKey', { static: false })\n passwordValidationModalForKey: PasswordValidationComponent;\n\n @ViewChild(SubscriptionRemovalComponent, { static: false })\n removal: SubscriptionRemovalComponent;\n\n password: string;\n\n subscribedSubscriptions = [];\n\n activeItem: MenuItem;\n\n isAddNew: boolean;\n\n isUpdatePayment: false;\n\n selectedSubscription: { id: number; productId: number };\n\n editing: boolean;\n\n isLoaded = false;\n\n objectKeys = Object.keys;\n\n items: MenuItem[] = [\n { id: 'profile', label: 'Profile', icon: 'fa fa-fw fa-user-cog' },\n { id: 'subscription', label: 'Subscription', icon: 'fa fa-fw fa-book' },\n { id: 'invoice', label: 'Invoice', icon: 'fa fa-file-invoice-dollar' }\n ];\n\n constructor() {\n super();\n this.getSubscribedProduct = this.getSubscribedProduct.bind(this);\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe(params => {\n this.isAddNew = params['isNew'];\n this.getSubscribedProduct();\n this.selectedSubscription = null;\n this.cdr.markForCheck();\n });\n\n [this.activeItem] = this.items;\n }\n\n deleteSubscription(subscription: Subscription) {\n this.removal.start({ subscriptionId: subscription.id });\n }\n\n deleteProduct(subscription: Subscription, product: Product) {\n this.removal.start({ subscriptionId: subscription.id, productId: product.id });\n }\n\n onRemoved() {\n this.getSubscribedProduct();\n }\n\n protected getSubscribedProduct() {\n this.userStore().subscribe(user => {\n this.user = user;\n if (user) {\n this.userService.getUserSubscriptions(user.id).subscribe(response => {\n this.subscribedSubscriptions = sortBy(response.result.subscriptions, 'deleted');\n response?.result?.expired_subscriptions.forEach(subscription => {\n this.subscribedSubscriptions.push(subscription);\n });\n this.subscribedSubscriptions.forEach(subscription => {\n subscription.products.forEach((product: Product) => {\n product.masked = product.api_access_token\n ? '*************************'\n : null;\n });\n });\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n activateMenu() {\n this.activeItem = this.menu['activeItem'];\n if (this.activeItem.id === 'subscription') {\n this.getSubscribedProduct();\n }\n }\n\n discardEdit() {\n this.editing = false;\n this.selectedSubscription = null;\n }\n\n onSaveDetails() {\n this.toast.success(this.translation.translate('User.Subscriptions.UpdatedMessage'));\n this.editing = false;\n }\n\n onUpdatePaymentDetailsCancel() {\n this.router.navigate(['.'], { relativeTo: this.route, queryParams: {} });\n }\n\n attemptUpgrade(subscription: Subscription, product: Product) {\n if (this.user.has_password) {\n this.router.navigate([\n `account/subscriptions/upgrade/${subscription.id}/${product.id}`\n ]);\n } else {\n this.noPasswordModal();\n }\n }\n\n private noPasswordModal() {\n this.confirmDialog.open({\n titleKey: 'User.Subscriptions.SetPassword.Title',\n textKey: 'User.Subscriptions.SetPassword.Text',\n confirmOnly: true\n });\n }\n\n trackBySubscription(_index: number, item: { id: number }) {\n return item.id;\n }\n\n trackByProduct(_index: number, item: { id: number }) {\n return item.id;\n }\n}\n","@if (!showTos) {\n <!-- Subscriptions Tab Content -->\n @if (!editing && !isAddNew) {\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.List.Title' | transloco }}</h2>\n <p>{{ 'User.Subscriptions.List.Description' | transloco }}</p>\n </div>\n </div>\n }\n <!-- Subscribed Product Cards -->\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (\n !editing && !isAddNew && !isUpdatePayment && isLoaded && subscribedSubscriptions.length\n ) {\n <div class=\"row\"\n >\n @for (subscription of subscribedSubscriptions; track trackBySubscription($index, subscription)) {\n <div class=\"col-12 col-md-6 my-3\"\n >\n <div class=\"subscription-details mb-4\">\n <div class=\"subscription-summary d-flex flex-wrap justify-content-between align-items-start gap-2 mb-3\">\n <div class=\"subscription-summary__info\"\n [class.subscription-summary__info--client-id]=\"showsClientId(subscription)\">\n <div>\n <strong>{{ 'User.Subscriptions.List.Organisation' | transloco }}</strong>\n {{ subscription.organisation ? subscription.organisation : subscription.contact_name }}\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.TotalPriceExclTax' | transloco }}:</strong>\n @if (subscription.calculated_price) {\n {{ subscription.products[0]?.currency }} {{ subscription.calculated_price / 100 | number:'1.2-2' }}\n {{ subscription.products[0].trial_subscription ? ('User.Subscriptions.List.AfterTrial' | transloco) : '' }}\n } @else {\n {{ 'User.Subscriptions.Free' | transloco }}\n }\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.SeatsInUse' | transloco }}:</strong>\n {{ subscription.units_in_use || 1 }} / {{ subscription.purchased_units }}\n @if (subscription.purchased_units) {\n <span class=\"seats-usage\"\n [style.--seats-pct]=\"(subscription.units_in_use || 1) / subscription.purchased_units\"></span>\n }\n </div>\n @if (showsClientId(subscription)) {\n <div class=\"subscription-summary__client-id d-flex align-items-baseline gap-1\">\n <strong class=\"flex-shrink-0\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}:</strong>\n @if (subscription.api_client_id) {\n <code class=\"subscription-summary__client-id-value\"\n [attr.aria-hidden]=\"isClientIdRevealed(subscription.id) ? null : 'true'\">{{ isClientIdRevealed(subscription.id) ? subscription.api_client_id : '*************************' }}</code>\n <button type=\"button\"\n class=\"btn btn-sm flex-shrink-0\"\n [attr.aria-label]=\"(isClientIdRevealed(subscription.id) ? 'User.Subscriptions.APICredentials.Hide' : 'User.Subscriptions.APICredentials.View') | transloco\"\n [pTooltip]=\"(isClientIdRevealed(subscription.id) ? 'User.Subscriptions.APICredentials.Hide' : 'User.Subscriptions.APICredentials.View') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-pressed]=\"isClientIdRevealed(subscription.id)\"\n (click)=\"toggleClientId(subscription.id)\">\n <i class=\"fas\" [ngClass]=\"isClientIdRevealed(subscription.id) ? 'fa-eye-slash' : 'fa-eye'\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"btn btn-sm flex-shrink-0\"\n [attr.aria-label]=\"'User.Subscriptions.List.CopyClientId' | transloco\"\n [pTooltip]=\"'User.Subscriptions.List.CopyClientId' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"copyClientId(subscription.api_client_id)\">\n <i class=\"fal fa-copy\" aria-hidden=\"true\"></i>\n </button>\n } @else {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco }}</span>\n }\n </div>\n }\n </div>\n <!-- Subscription-level actions (a subscription may hold multiple products) -->\n @if (\n (subscription.is_subscription_owner || subscription.is_subscription_admin) &&\n subscription.products?.length &&\n !subscription.products[0].deleted &&\n !subscription.products[0].dependency_products?.length\n ) {\n <div class=\"subscription-summary__actions d-flex flex-wrap align-items-center gap-2\">\n <a class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'Button.Edit' | transloco\"\n [routerLink]=\"['../subscriptions', subscription.id]\">\n {{ 'Button.Edit' | transloco }}\n </a>\n @if (!subscription.products[0].expired && !subscription.products[0].trial_subscription) {\n <button [routerLink]=\"['../subscriptions', subscription.id, 'credential']\"\n class=\"btn btn-outline-secondary btn-sm\">\n {{ 'User.Subscriptions.Credentials' | transloco }}\n </button>\n }\n @if (!inMobileApp && !isUpdatePayment && subscription.stripe_customer_id) {\n <a class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"['../subscriptions', subscription.id, 'product', subscription.products[0].id, 'update-payment']\">\n <i class=\"fa fa-edit me-1\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.UpdateCardDetails' | transloco }}</a>\n }\n @if (!inMobileApp) {\n <button class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"'/account/subscriptions/add-new'\"\n [queryParams]=\"{ subscription_id: subscription.id }\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.ManageAllProducts' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <i class=\"fa fa-plus me-1\"></i>{{ 'User.Subscriptions.SeeAllProducts' | transloco }}\n </button>\n }\n @if (!subscription.has_child_subscriptions) {\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"deleteSubscription(subscription)\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.DeleteSubscription' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.DeleteSubscription' | transloco }}\n </button>\n }\n </div>\n }\n </div>\n <!-- Products list -->\n @for (\n product of subscription.products; track trackByProduct($index,\n product); let first = $first) {\n <div class=\"mb-3\">\n <div class=\"card subscription-products-cards\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <div>\n <h4 class=\"mb-3 text-bold-500 primary\">{{ product?.name }}</h4>\n <!-- Frequency -->\n <div>\n <div>\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.Frequency' | transloco\n }}:</strong>\n {{ product?.billing_frequency | uppercase }}\n </div>\n </div>\n <!-- Expiration -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n (product.expired ? 'User.Subscriptions.List.Expired' : 'User.Subscriptions.List.ExpiryDate') | transloco\n }}:</strong>\n {{ product.expires_at | dateFormat }}\n </div>\n <!-- Estimated Price -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.PriceExclTax' | transloco\n }}:</strong>\n {{ product.currency }}\n {{ (product.calculated_price / 100) | number:'1.2-2' }}\n </div>\n <!-- Product API Key (Alpha-only) -->\n <ng-container *rbacAllow=\"'Pages.Alpha'\">\n @if (\n (product.stripe_plan_id && product.max_hits > 0) ||\n product.max_hits_trial > 0\n ) {\n <div class=\"d-flex align-items-center\">\n <strong class=\"d-inline-block w-50\">\n {{ 'User.Subscriptions.ApiKey' | transloco }}:\n <i class=\"far fa-info-circle ms-1 text-muted\"\n aria-hidden=\"true\"\n [pTooltip]=\"'User.Subscriptions.ApiKey.NotUsedHint' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"></i>\n </strong>\n <code class=\"text-truncate me-2\">{{ product.masked }}</code>\n <span class=\"ms-auto d-flex align-items-center flex-shrink-0\">\n <!-- Show Access Key -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ShowKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"showKey(product)\">\n <i class=\"fas fa-eye\" aria-hidden=\"true\"></i>\n </button>\n <!-- Copy To Clipboard -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.CopyKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <i class=\"fal fa-copy\"\n aria-hidden=\"true\"\n (click)=\"onClipboardCopy(product.api_access_token)\"\n (keydown.enter)=\"onClipboardCopy(product.api_access_token)\"></i>\n </button>\n <!-- Update API Key -->\n @if (!product.expired && !product.deleted) {\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ChangeKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"updateApiKey(subscription, product)\">\n <i class=\"fal fa-sync-alt\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </div>\n }\n </ng-container>\n </div>\n </div>\n <div class=\"card-footer px-3 d-flex flex-column gap-2\">\n <div class=\"footer-status d-flex flex-wrap align-items-center gap-2\">\n @if (product.deleted && !product.expired) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.OutdatedMessage' | transloco }}\n </span>\n }\n @if (product.deleted) {\n <span class=\"badge bg-danger\">{{ 'User.Subscriptions.List.Deleted' | transloco }}</span>\n }\n @if (\n product.trial_subscription &&\n product.calculated_price\n ) {\n <span class=\"badge bg-warning\">{{ 'User.Subscriptions.Trial' | transloco }}</span>\n }\n @if (product?.pause_collection && objectKeys(product?.pause_collection)?.length) {\n <span class=\"badge bg-grey\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.PausedCollection'|transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.List.PausedCollection' | transloco }}\n </span>\n }\n @if (!product.calculated_price) {\n <span class=\"badge bg-success\">{{ 'User.Subscriptions.Free' | transloco }}</span>\n }\n @if (!product?.deleted && !subscription.is_subscription_owner) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.List.Invited' | transloco }}\n @if (subscription.is_subscription_admin) {\n <span class=\"badge bg-role-admin ms-1\">{{ 'User.Subscriptions.List.AsAdmin' | transloco }}</span>\n }\n </span>\n }\n </div>\n @if (\n subscription.is_subscription_owner ||\n subscription.is_subscription_admin\n ) {\n <div class=\"footer-actions d-flex flex-wrap align-items-center justify-content-end gap-2\">\n <!-- Secondary products only: the primary goes with the whole subscription -->\n @if (\n subscription.products.length > 1 &&\n !product.is_primary_product &&\n !product?.deleted\n ) {\n <span [pTooltip]=\"product.required_by_product_ids?.length ? ('User.Subscriptions.Tooltip.ProductRequired' | transloco) : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n [disabled]=\"product.required_by_product_ids?.length\"\n (click)=\"deleteProduct(subscription, product)\">\n {{ 'User.Subscriptions.DeleteProduct' | transloco }}\n </button>\n </span>\n }\n @if (!inMobileApp && product.stripe_plan_id && product.active) {\n <!-- Upgrade (single primary CTA) -->\n @if (product.trial_subscription && !product.deleted) {\n <button class=\"btn btn-primary btn-sm\"\n (click)=\"attemptUpgrade(subscription, product)\">\n {{ 'Button.Upgrade' | transloco }}\n </button>\n }\n <!-- Subscribe -->\n @if (subscription.expired && product.stripe_plan_id) {\n <button class=\"btn btn-primary btn-sm\"\n [routerLink]=\"'/account/subscriptions/add-new'\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </button>\n }\n }\n <!-- Privacy & Terms of Service (quiet link, not a button) -->\n @if (product?.product_privacy_service_id) {\n <button class=\"btn btn-link btn-sm p-0 footer-tos-link\"\n (click)=\"showPrivacyAndTos(product)\">\n {{\n 'User.Subscriptions.PrivacyAndTermsOfService'\n | transloco\n }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if (subscription.products.length === 0) {\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <p class=\"text-center\">\n {{ 'User.Subscriptions.List.NoProducts' | transloco }}\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n @if (!editing && !isAddNew && !isUpdatePayment) {\n <div class=\"col-12\"\n >\n @if (subscribedSubscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any subscription.\"\n >\n </pw-no-data>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n <!-- Danger zone (demoted account deletion) -->\n @if (!editing && !isAddNew && !isUpdatePayment && isLoaded) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"danger-zone mt-4\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger danger-zone__action\"\n (click)=\"showModalForAccountDeletion()\"\n [pTooltip]=\"'User.Account.Tooltip.DeleteAccount' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Account.DeleteAccount' | transloco }}\n </button>\n </div>\n </div>\n </div>\n }\n <!--\n Add New Subscription\n -->\n <!-- <ng-template [ngIf]=\"isAddNew && !isUpdatePayment\">\n <pw-subscription-details></pw-subscription-details>\n</ng-template> -->\n<!--\nValidate Password For Account Delete\n-->\n<pw-password-validation #passwordValidationModalForAccountDelete\n [destructive]=\"true\"\n (successEvent)=\"deleteUser($event)\">\n</pw-password-validation>\n<!--\nValidate Password For Display Key\n-->\n<pw-password-validation #passwordValidationModalForKey\n (successEvent)=\"displayApiKey()\">\n</pw-password-validation>\n<pw-subscription-removal [user]=\"user\" (removed)=\"onRemoved()\"></pw-subscription-removal>\n}\n\n@if (showTos) {\n <pw-privacy-and-tos [productId]=\"productId\"></pw-privacy-and-tos>\n}\n\n<router-outlet></router-outlet>\n","import { CurrencyPipe, DatePipe } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnDestroy } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { SkeletonTableComponent } from '@posiwise/app-loader';\nimport { Paging, POLL_TIMEOUT } from '@posiwise/common-utilities';\nimport { DynamicBadgeDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { NoDataComponent, RecordsSummaryComponent } from '@posiwise/shared-components';\n\nimport { LazyLoadEvent } from 'primeng/api';\nimport { Bind } from 'primeng/bind';\nimport { IconField } from 'primeng/iconfield';\nimport { InputIcon } from 'primeng/inputicon';\nimport { InputText } from 'primeng/inputtext';\nimport { ResizableColumn, SortableColumn, SortIcon, Table } from 'primeng/table';\nimport { Tooltip } from 'primeng/tooltip';\nimport { interval, Subscription } from 'rxjs';\nimport { mergeMap } from 'rxjs/operators';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-user-invoice',\n templateUrl: './user-invoice.component.html',\n styleUrls: ['./user-invoice.component.scss'],\n imports: [\n SkeletonTableComponent,\n Bind,\n Table,\n FormsModule,\n InputText,\n IconField,\n InputIcon,\n ResizableColumn,\n SortableColumn,\n SortIcon,\n DynamicBadgeDirective,\n Tooltip,\n NoDataComponent,\n RecordsSummaryComponent,\n CurrencyPipe,\n DatePipe,\n TranslocoPipe\n ]\n})\nexport class UserInvoiceComponent extends AppBaseComponent implements OnDestroy {\n private readonly cdr = inject(ChangeDetectorRef);\n\n invoices = [];\n buttonBusy = false;\n userId: number;\n totalRecordsUnFiltered = 0;\n\n searchText = '';\n subscription: Subscription;\n intervalTimer = interval(POLL_TIMEOUT * 60 * 1000);\n isLoaded = false;\n page = 0;\n totalRecords: number;\n\n invoiceFrequency = ['week', 'month', 'year'];\n\n onLazyLoad(event: LazyLoadEvent) {\n const pageDetails = HelperService.onTableLazyLoad(event);\n this.page = pageDetails.page;\n this.fetchInvoices({\n page: this.page,\n page_size: this.PAGE_SIZE,\n order_by: pageDetails.sortField,\n order_direction: pageDetails.sortOrder,\n search: this.searchText\n });\n }\n\n // isLoaded gates the FIRST paint only — paging/sort/search keep the table on screen.\n private fetchInvoices(paging: Paging) {\n this.userStore().subscribe(user => {\n if (user) {\n this.userId = user.id;\n this.userService\n .getUserInvoices(paging, user.id)\n .subscribe(({ result, page_info }) => {\n this.invoices = result;\n this.totalRecords = page_info.total_count;\n this.totalRecordsUnFiltered = page_info.total_count_unfiltered;\n this.pollForInvoices();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n private pollForInvoices() {\n this.subscription = this.intervalTimer\n .pipe(mergeMap(() => this.userService.getUserInvoices({}, this.userId)))\n .subscribe(({ result }) => {\n this.invoices = result;\n this.cdr.markForCheck();\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n","<div class=\"row\" [class.custom-disable-wrapper]=\"buttonBusy\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center\">\n <h2 class=\"card-title p-0 float-start\">{{ 'User.Invoices.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"6\" [showCaption]=\"true\" />\n </div>\n}\n<div class=\"row primeng-datatable-container actions-collapsed mt-0\" [class.d-none]=\"!isLoaded\" [class.custom-disable-wrapper]=\"buttonBusy\" [class.hideTable]=\"totalRecordsUnFiltered === 0\">\n <div class=\"col-12 px-0\">\n <p-table #tt\n [value]=\"invoices\"\n [paginator]=\"true\" [alwaysShowPaginator]=\"totalRecords !== 0\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n stateKey=\"pw-table.user-invoice\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"search-filter justify-content-end\">\n <div class=\"text-end\">\n <label for=\"user-invoice-search\" class=\"visually-hidden\">{{ 'User.Invoices.Search' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input id=\"user-invoice-search\"\n name=\"user-invoice-search\"\n [(ngModel)]=\"searchText\"\n (input)=\"tt.filterGlobal($event.target.value, 'contains')\"\n type=\"text\"\n pInputText\n [placeholder]=\"'User.Invoices.SearchPlaceholder' | transloco\"\n data-cy=\"incident-search\"\n [attr.aria-label]=\"'User.Invoices.Search' | transloco\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"date\">{{ 'User.Invoices.Date' | transloco }} <p-sort-icon field=\"date\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"frequency\">{{ 'User.Subscriptions.Frequency' | transloco }} <p-sort-icon field=\"frequency\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"seatsPurchased\">{{ 'User.Invoices.SeatsPurchased' | transloco }} <p-sort-icon field=\"seatsPurchased\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"subtotal\">{{ 'User.Invoices.Subtotal' | transloco }} <p-sort-icon field=\"subtotal\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"total\">{{ 'User.Invoices.TotalInclTax' | transloco }} <p-sort-icon field=\"total\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body let-invoice>\n <tr>\n <td>{{ invoice.date | date:'dd-MMM-yyyy' }}</td>\n <td>\n <span class=\"badge\"\n [appDynamicBadge]=\"{\n itemsArray: invoiceFrequency,\n item: invoice.product.billing_frequency\n }\"\n color=\"blue-grey\">{{ invoice.product.billing_frequency }}</span>\n </td>\n <td>{{ invoice?.subscription_product?.purchased_units }}</td>\n <td>{{ (invoice.subtotal_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td class=\"td-total\">{{ (invoice.total_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td>\n @if (invoice?.file?.url) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.file.url\" target=\"_blank\">\n <i class=\"fa fa-download\">&nbsp;{{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else if (invoice?.stripe_invoice_pdf) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.stripe_invoice_pdf\" target=\"_blank\">\n <i class=\"fa fa-download\">&nbsp;{{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-sm btn-primary invoice-download-unavailable\" aria-disabled=\"true\"\n data-cy=\"invoice-download-unavailable\"\n [pTooltip]=\"'User.Invoices.NoFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'User.Invoices.NoFile' | transloco\">\n <i class=\"fa fa-download\">&nbsp;{{ 'User.Invoices.Download' | transloco }}</i>\n </button>\n }\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (totalRecords === 0 && totalRecordsUnFiltered !== 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\" >\n </pw-no-data>\n </div>\n }\n\n @if (totalRecords !== 0) {\n <pw-records-summary [showing]=\"tt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n }\n\n </div>\n</div>\n@if (totalRecordsUnFiltered === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any invoice yet.\">\n </pw-no-data>\n}\n\n","import { Component, inject } from '@angular/core';\n\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { AI_ASSISTANT_PERMISSION, PermissionService } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\nimport {\n AiKnowledgeComponent,\n AiMemoryComponent,\n NoDataComponent\n} from '@posiwise/shared-components';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport {\n NgbNav,\n NgbNavContent,\n NgbNavItem,\n NgbNavLink,\n NgbNavOutlet\n} from '@ng-bootstrap/ng-bootstrap';\n\n/**\n * Settings › AI Knowledge: the member's personal Brain documents, filed under the\n * subscription currently selected in the sidebar. Read live from\n * `PermissionService.selectedSubscription` because the sidebar sets it after this\n * page can render, and switching subscription changes where the files belong.\n */\n@Component({\n selector: 'pw-ai-knowledge-tab',\n templateUrl: './ai-knowledge-tab.component.html',\n imports: [\n AppLoaderComponent,\n NoDataComponent,\n AiKnowledgeComponent,\n AiMemoryComponent,\n NgbNav,\n NgbNavItem,\n NgbNavLink,\n NgbNavContent,\n NgbNavOutlet,\n TranslocoPipe\n ]\n})\nexport class AiKnowledgeTabComponent {\n private readonly permissionService = inject(PermissionService);\n\n activeTab: 'files' | 'notes' = 'files';\n\n /** Permissions arrive after a hard refresh; decide nothing until they have. */\n get ready(): boolean {\n return !!this.permissionService.user;\n }\n\n /** Behind a flag for now. Checked here, not by a route guard — see the route. */\n get isEnabled(): boolean {\n return this.permissionService.evaluatePermissions(AI_ASSISTANT_PERMISSION);\n }\n\n get subscription(): (Subscription & { rag_use_own_data?: boolean }) | null {\n return PermissionService.selectedSubscription ?? null;\n }\n\n /** An absent flag is not consent — same rule as brain-api. */\n get useOwnData(): boolean {\n return this.subscription?.rag_use_own_data === true;\n }\n}\n","@if (!ready) {\n <pw-loader [isVisible]=\"true\"></pw-loader>\n} @else if (!isEnabled) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NotAvailable' | transloco\"></pw-no-data>\n} @else if (subscription) {\n <div class=\"title\">\n <h2>{{ 'AiKnowledge.PersonalTitle' | transloco: { name: subscription.organisation } }}</h2>\n </div>\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"activeTab\" [destroyOnHide]=\"false\" class=\"nav-tabs\">\n <li ngbNavItem=\"files\">\n <a ngbNavLink>{{ 'AiKnowledge.FilesTab' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-knowledge scope=\"personal\"\n [subscriptionId]=\"subscription.id\"\n [subscriptionName]=\"subscription.organisation\"\n [useOwnData]=\"useOwnData\"></pw-ai-knowledge>\n </ng-template>\n </li>\n <li ngbNavItem=\"notes\">\n <a ngbNavLink>{{ 'AiMemory.Title' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-memory [subscriptionId]=\"subscription.id\"></pw-ai-memory>\n </ng-template>\n </li>\n </ul>\n <div class=\"mt-3\" [ngbNavOutlet]=\"nav\"></div>\n} @else {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NoSubscription' | transloco\"></pw-no-data>\n}\n","import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AppState, getUser } from '@posiwise/app-store';\nimport { CommonService, ProfileService, UserNewsletter } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { Store } from '@ngrx/store';\n\n@Component({\n selector: 'pw-communication-tab',\n templateUrl: './communication-tab.component.html',\n styleUrl: './communication-tab.component.scss',\n imports: [Bind, ProgressSpinner, UiSwitchModule, NoDataComponent, TranslocoPipe]\n})\nexport class CommunicationTabComponent extends AppBaseComponent implements OnInit {\n private readonly commonService = inject(CommonService);\n private readonly profileService = inject(ProfileService);\n private readonly store = inject<Store<AppState>>(Store);\n private readonly cdr = inject(ChangeDetectorRef);\n\n subscriptions = [];\n userSubscription: UserNewsletter[] = [];\n\n isLoaded = false;\n\n user: User;\n\n ngOnInit() {\n this.getAllSubscription();\n }\n\n private getAllSubscription() {\n this.commonService.getAllNewsletter().subscribe(({ result }) => {\n this.store.select(getUser).subscribe(user => {\n if (user?.currentUser) {\n this.user = user.currentUser;\n this.profileService\n .getUserObject('user_newsletters', this.user.slug)\n .subscribe(newsletter => {\n this.isLoaded = true;\n this.userSubscription = newsletter.result;\n this.subscriptions = result;\n if (this.userSubscription.length > 0 && this.subscriptions.length > 0) {\n this.subscriptions.forEach(element => {\n const item = this.userSubscription?.find(\n x => x.newsletter_id === element.id\n );\n element.enabled = item ? item.send_newsletters : false;\n });\n } else {\n this.subscriptions.forEach(element => {\n element.enabled = false;\n });\n }\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n });\n }\n\n onValueChange(item, value) {\n const data = {\n send_newsletter: value\n };\n\n if (item.id === 9999) {\n const marketingSubs = {\n id: this.user.id,\n send_marketing_emails: value\n };\n this.profileService.updateUserProfile(marketingSubs).subscribe(() => {\n this.updateUser();\n this.toast.success(this.translation.translate('User.Settings.UpdatedMessage'));\n this.cdr.markForCheck();\n });\n } else {\n this.commonService.toggleNewsletter(item.id, data).subscribe(() => {\n this.updateUser();\n this.toast.success(\n this.translation.translate('User.Settings.Communications.UpdatedMessage')\n );\n this.cdr.markForCheck();\n });\n }\n }\n\n updateUser() {\n // this.userService.getUserInfo().subscribe(resp => {\n // this.localStorage.setItem('user', JSON.stringify(resp)).subscribe();\n // });\n }\n}\n","<div class=\"communication-settings\">\n <h2>{{ 'User.Settings.Communications.Title' | transloco }}</h2>\n\n <p class=\"settings-intro\">{{ 'User.Settings.Communications.Intro1' | transloco }}</p>\n <p class=\"settings-intro\">{{ 'User.Settings.Communications.Intro2' | transloco }}</p>\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n\n @if (isLoaded && subscriptions.length > 0) {\n <ul class=\"pref-list\">\n @for (item of subscriptions; track item; let idx = $index) {\n @if (item.visible || item.enabled) {\n <li class=\"pref-row\">\n <span class=\"pref-name\" [id]=\"'communication-tab-' + idx\">{{ item.name }}</span>\n <ui-switch [checked]=\"item.enabled\"\n [attr.aria-labelledby]=\"'communication-tab-' + idx\"\n (valueChange)=\"onValueChange(item, $event)\">\n </ui-switch>\n </li>\n }\n }\n </ul>\n }\n\n @if (isLoaded && subscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\"\n [message]=\"'User.Settings.Communications.NoDataMessage' | transloco\">\n </pw-no-data>\n }\n</div>\n","import { ChangeDetectorRef, Component, inject, OnDestroy, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { CommonService } from '@posiwise/common-services';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-others-tab',\n templateUrl: './others-tab.component.html',\n imports: [Bind, ProgressSpinner, UiSwitchModule, NoDataComponent, TranslocoPipe]\n})\nexport class OthersTabComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly commonService = inject(CommonService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n subscriptionConfigs = [];\n globalConfigs = [];\n\n userId: number;\n\n isLoaded = false;\n\n ngOnInit(): void {\n this.getGlobalConfigs();\n this.userStore().subscribe(res => {\n if (res) {\n this.userId = res.id;\n }\n this.cdr.markForCheck();\n });\n }\n\n private getGlobalSubscriptionConfig() {\n this.commonService\n .getAllGlobalSubscriptionConfigs()\n .subscribe(({ result }) => {\n this.subscriptionConfigs = result;\n this.globalConfigs.forEach(globalConfig => {\n const config = this.subscriptionConfigs?.find(\n subscriptionConfig =>\n subscriptionConfig.global_config_id === globalConfig?.id\n );\n globalConfig.value = config?.value;\n globalConfig.global_subscription_config_id = config?.id;\n });\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n private getGlobalConfigs() {\n this.commonService.getAllGlobalConfigs().subscribe(({ result }) => {\n this.globalConfigs = result;\n this.getGlobalSubscriptionConfig();\n this.cdr.markForCheck();\n });\n }\n\n onValueChange(item, value) {\n const data = {\n user_id: this.userId,\n value,\n global_config_id: item?.id\n };\n const sub$ = item?.global_subscription_config_id\n ? this.commonService.editGlobalSubscriptionConfig(\n item?.global_subscription_config_id,\n data\n )\n : this.commonService.postGlobalSubscriptionConfig(data);\n sub$.subscribe(() => {\n this.toast.success(this.translation.translate('User.OtherSettings.UpdatedMessage'));\n this.cdr.markForCheck();\n }).add(() => {\n this.getGlobalConfigs();\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Settings.Other.Title' | transloco }}</h2>\n </div>\n</div>\n@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n@if (isLoaded && globalConfigs?.length) {\n <div class=\"row mt-4 pt-1\"\n >\n <div class=\"col-md-6 col-sm-6\">\n @for (item of globalConfigs; track item; let idx = $index) {\n <div class=\"mb-3\">\n <div class=\"row\">\n <div class=\"col-md-10 col-sm-6\">\n <span class=\"pw-label-style\" [id]=\"'others-tab-' + idx\"> {{ item?.name }} </span>\n </div>\n <div class=\"col-md-2 col-sm-6\">\n <ui-switch [checked]=\"item.value === 'true'\"\n [attr.aria-labelledby]=\"'others-tab-' + idx\"\n (valueChange)=\"onValueChange(item, $event)\">\n </ui-switch>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n}\n\n@if (isLoaded && !globalConfigs?.length) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'User.OtherSettings.NoDataMessage' | transloco\"> </pw-no-data>\n </div>\n}\n","import { ChangeDetectorRef, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { LazyImgDirective } from '@posiwise/directives';\n\nimport { StatusCodes } from 'http-status-codes';\nimport { Accordion, AccordionContent, AccordionHeader, AccordionPanel } from 'primeng/accordion';\nimport { Bind } from 'primeng/bind';\nimport { Ripple } from 'primeng/ripple';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-security-tab',\n templateUrl: './security-tab.component.html',\n styleUrls: ['./security-tab.component.scss'],\n imports: [\n Bind,\n Accordion,\n AccordionPanel,\n Ripple,\n AccordionHeader,\n AccordionContent,\n LazyImgDirective,\n TranslocoPipe\n ]\n})\nexport class SecurityTabComponent extends AppBaseComponent implements OnInit {\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('password', { static: false }) passwordRef: ElementRef;\n @ViewChild('verificationCode', { static: false }) verificationCode: ElementRef;\n\n @ViewChild('ssoPassword', { static: false }) ssoPasswordRef: ElementRef;\n\n showSSOSection = false;\n ssoPasswordVerified = false;\n isSSOPasswordInvalid = true;\n\n user;\n\n isCurrentPasswordValid = true;\n passwordVerified = false;\n show2FA = false;\n\n created2faDetails: object;\n\n ngOnInit() {\n this.getUser();\n }\n\n private getUser() {\n this.userService.getUserInfo().subscribe(res => {\n this.user = res;\n this.cdr.markForCheck();\n });\n }\n\n validatePassword() {\n const password = this.passwordRef.nativeElement.value;\n if (password) {\n this.userService.checkPassword({ password }).subscribe({\n next: data => {\n if (data?.result?.status === StatusCodes.OK) {\n if (this.user?.enable_two_factor_authenticator === false) {\n this.passwordVerified = true;\n this.create2FA();\n } else {\n this.disable2FA();\n }\n }\n this.cdr.markForCheck();\n },\n error: err => {\n if (err) {\n this.toast.error(err.error.message);\n this.passwordRef.nativeElement.value = '';\n }\n this.cdr.markForCheck();\n }\n });\n }\n }\n\n checkValidity() {\n const password = this.passwordRef.nativeElement.value;\n if (password.length > 5) {\n this.isCurrentPasswordValid = false;\n } else {\n this.isCurrentPasswordValid = true;\n }\n }\n\n private create2FA() {\n this.userService.createTwoFactorAuthenticator().subscribe(({ result }) => {\n this.created2faDetails = result;\n this.cdr.markForCheck();\n });\n }\n\n verify2FA() {\n this.userService\n .verifyTwoFactorAuthenticator(this.verificationCode.nativeElement.value)\n .subscribe(() => {\n this.enable2FA();\n });\n }\n\n private enable2FA() {\n this.userService\n .enableTwoFactorAuthenticator(this.verificationCode.nativeElement.value)\n .subscribe(_ => {\n this.getUser();\n this.reset();\n this.cdr.markForCheck();\n });\n }\n\n private disable2FA() {\n this.userService.disableTwoFactorAuthenticator().subscribe(_ => {\n this.getUser();\n this.reset();\n this.cdr.markForCheck();\n });\n }\n\n reset() {\n this.show2FA = false;\n this.isCurrentPasswordValid = true;\n this.passwordVerified = false;\n this.created2faDetails = {};\n }\n\n checkSSOPasswordValidity() {\n const password = this.ssoPasswordRef.nativeElement.value;\n this.isSSOPasswordInvalid = password.length <= 5;\n }\n\n validateSSOPassword() {\n const password = this.ssoPasswordRef.nativeElement.value;\n if (password) {\n this.userService.checkPassword({ password }).subscribe({\n next: data => {\n if (data?.result?.status === StatusCodes.OK) {\n this.ssoPasswordVerified = true;\n }\n this.cdr.markForCheck();\n },\n error: err => {\n this.toast.error(err.error.message);\n this.ssoPasswordRef.nativeElement.value = '';\n this.cdr.markForCheck();\n }\n });\n }\n }\n\n triggerSSO() {\n this.userService.sendSSOActivationEmail().subscribe(() => {\n this.toast.success(\n this.user?.cognito_sso_activated\n ? 'Activation email resent successfully.'\n : 'SSO activation email sent successfully.'\n );\n this.getUser();\n this.resetSSO();\n this.cdr.markForCheck();\n });\n }\n\n resetSSO() {\n this.showSSOSection = false;\n this.ssoPasswordVerified = false;\n this.isSSOPasswordInvalid = true;\n if (this.ssoPasswordRef?.nativeElement) {\n this.ssoPasswordRef.nativeElement.value = '';\n }\n }\n}\n","<div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Settings.Security.Title' | transloco }}</h2>\n </div>\n</div>\n<p-accordion>\n <p-accordion-panel value=\"0\">\n <p-accordion-header>{{ 'User.Settings.Security.TwoFactor.Title' | transloco }}</p-accordion-header>\n <p-accordion-content>\n <div class=\"row mt-2\">\n <div class=\"col-12\">\n <div class=\"d-flex\">\n <p class=\"small text-muted\">{{ 'User.Settings.Security.TwoFactor.Description' | transloco }}</p>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <!-- Disable 2FA -->\n @if (user?.enable_two_factor_authenticator) {\n <button class=\"btn btn-danger\" (click)=\"show2FA = true\">{{ 'User.Settings.Security.TwoFactor.Disable' | transloco }}</button>\n }\n <!-- Enable 2FA -->\n @if (!user?.enable_two_factor_authenticator) {\n <button class=\"btn btn-primary\"\n [disabled]=\"created2faDetails?.code\" (click)=\"show2FA = true\">{{ 'User.Settings.Security.TwoFactor.Enable' | transloco }}</button>\n }\n </div>\n </div>\n @if (show2FA) {\n <div class=\"row\">\n <div class=\"col-12 col-md-6 col-lg-4 mt-2\">\n <div class=\"mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\" class=\"form-control\" #password [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n (keyup)=\"checkValidity()\" id=\"input_current_password_800\" name=\"input_current_password_800\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n </div>\n </div>\n @if (created2faDetails?.code) {\n <div class=\"col-12\">\n <p class=\"small\">{{ 'User.Settings.Security.TwoFactor.ScanInstructions' | transloco }}</p>\n <img [src]=\"created2faDetails?.qr_uri\" [alt]=\"'User.Settings.Security.TwoFactor.QrAlt' | transloco\" class=\"qr-code img-thumbnail img-responsive\" />\n <strong>{{ 'User.Settings.Security.TwoFactor.SecretKey' | transloco: { code: created2faDetails?.code } }}</strong>\n <p class=\"small\">{{ 'User.Settings.Security.TwoFactor.AuthType' | transloco }}</p>\n </div>\n }\n </div>\n }\n @if (show2FA) {\n <div class=\"row\">\n <div class=\"col-4\">\n <div class=\"mb-3 mt-2\">\n @if (passwordVerified) {\n <input type=\"text\" #verificationCode class=\"form-control\"\n [placeholder]=\"'User.Settings.Security.TwoFactor.PasscodePlaceholder' | transloco\" id=\"input_provide_passcode_from_authenticator_app_800\" name=\"input_provide_passcode_from_authenticator_app_800\"\n [attr.aria-label]=\"'User.Settings.Security.TwoFactor.PasscodePlaceholder' | transloco\" />\n }\n </div>\n </div>\n @if (show2FA) {\n <div class=\"col-12\">\n <div class=\"d-flex mt-2\">\n <button class=\"btn btn-raised btn-outline-default me-2\" (click)=\"reset()\">{{ 'Button.Cancel' | transloco }}</button>\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\" (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">{{ 'User.Account.Validate' | transloco }}</button>\n }\n @if (passwordVerified) {\n <button class=\"btn btn-raised btn-primary\" (click)=\"verify2FA()\">{{ 'Button.Confirm' | transloco }}</button>\n }\n </div>\n </div>\n }\n </div>\n }\n </p-accordion-content>\n </p-accordion-panel>\n <p-accordion-panel value=\"1\">\n <p-accordion-header>{{ 'User.Settings.Security.Sso.Title' | transloco }}</p-accordion-header>\n <p-accordion-content>\n <div class=\"row mt-2\">\n <div class=\"col-12\">\n <p class=\"small text-muted\">{{ (user?.cognito_sso_activated ? 'User.Settings.Security.Sso.ActivatedDescription' : 'User.Settings.Security.Sso.EnableDescription') | transloco }}</p>\n </div>\n </div>\n <!-- Enable or Resend Button -->\n @if (!showSSOSection) {\n <div class=\"row\">\n <div class=\"col-12\">\n <button class=\"btn btn-primary\" (click)=\"showSSOSection = true\"> {{ (user?.cognito_sso_activated ? 'User.Settings.Security.Sso.Resend' : 'User.Settings.Security.TwoFactor.Enable') | transloco }}</button>\n </div>\n </div>\n }\n <!-- Password Validation -->\n @if (showSSOSection) {\n <div class=\"row\">\n @if (!ssoPasswordVerified) {\n <div class=\"col-12 col-md-6 col-lg-4 mt-2\">\n <div class=\"mb-3\">\n <input type=\"password\" class=\"form-control\" #ssoPassword [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n (keyup)=\"checkSSOPasswordValidity()\" id=\"input_current_password_801\" name=\"input_current_password_801\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n </div>\n </div>\n }\n <div class=\"col-12\">\n <div class=\"d-flex mt-2\">\n <button class=\"btn btn-raised btn-outline-default me-2\" (click)=\"resetSSO()\">{{ 'Button.Cancel' | transloco }}</button>\n @if (!ssoPasswordVerified) {\n <button class=\"btn btn-raised btn-primary\" (click)=\"validateSSOPassword()\"\n [disabled]=\"isSSOPasswordInvalid\">{{ 'User.Account.Validate' | transloco }}</button>\n }\n @if (ssoPasswordVerified) {\n <button class=\"btn btn-primary\" (click)=\"triggerSSO()\">{{ 'Button.Confirm' | transloco }}</button>\n }\n </div>\n </div>\n </div>\n }\n </p-accordion-content>\n </p-accordion-panel>\n</p-accordion>\n","import { Component, inject, ViewChild } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { AI_ASSISTANT_PERMISSION, PermissionService } from '@posiwise/common-services';\nimport { PwTabsComponent } from '@posiwise/shared-components';\n\nimport { MenuItem } from 'primeng/api';\n\n@Component({\n selector: 'pw-settings',\n templateUrl: './settings-tabs.component.html',\n imports: [PwTabsComponent]\n})\nexport class SettingsComponent {\n private readonly router = inject(Router);\n private readonly permissionService = inject(PermissionService);\n\n @ViewChild('menuItems', { static: true }) menu: MenuItem[];\n\n items: MenuItem[];\n activeItem: MenuItem;\n\n constructor() {\n this.items = [\n {\n id: 'communications',\n labelKey: 'User.Tabs.Communications',\n icon: 'fa fa-fw fa-cogs',\n routerLink: ['/settings/communication']\n },\n {\n id: 'security',\n labelKey: 'User.Tabs.Security',\n icon: 'fa fa-fw fa-lock',\n routerLink: ['/settings/security']\n },\n {\n id: 'ai-knowledge',\n labelKey: 'Menu.Enterprise.AiKnowledge',\n icon: 'fa fa-fw fa-brain',\n routerLink: ['/settings/ai-knowledge'],\n visible: this.permissionService.evaluatePermissions(AI_ASSISTANT_PERMISSION)\n },\n {\n id: 'other',\n labelKey: 'User.Tabs.Other',\n icon: 'fa fa-fw fa-list',\n routerLink: ['/settings/other']\n }\n ];\n this.activeItem =\n this.items[\n this.items.findIndex(\n record => record.routerLink[0] === this.router.url.split('?')[0]\n )\n ];\n }\n\n activateMenu() {\n this.activeItem = this.menu['activeItem'];\n }\n}\n","<pw-tabs [items]=\"items\"></pw-tabs>\n","import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\nimport { RouterLink } from '@angular/router';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { CommonService, PermissionService } from '@posiwise/common-services';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { DateFormatPipe } from '@posiwise/pipes';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { Accordion, AccordionContent, AccordionHeader, AccordionPanel } from 'primeng/accordion';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Ripple } from 'primeng/ripple';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-support',\n templateUrl: './support.component.html',\n styleUrls: ['./support.component.scss'],\n imports: [\n RouterLink,\n Bind,\n ProgressSpinner,\n Accordion,\n AccordionPanel,\n Ripple,\n AccordionHeader,\n AccordionContent,\n LazyImgDirective,\n NoDataComponent,\n TranslocoPipe,\n DateFormatPipe\n ]\n})\nexport class SupportComponent extends AppBaseComponent implements OnInit {\n private readonly commonService = inject(CommonService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n supports = [];\n\n subscriptionId: number;\n\n isLoading: boolean;\n\n isLoaded = false;\n\n ngOnInit(): void {\n this.subscriptionId = PermissionService.selectedSubscription?.id;\n this.getAllSupport();\n }\n\n private getAllSupport() {\n this.isLoading = true;\n this.commonService\n .getAllCustomerSupport(this.subscriptionId)\n .subscribe(({ result }) => {\n this.supports = result;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoading = false;\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n}\n","<div class=\"row m-3\">\n <div class=\"col-12 mb-3\">\n <div\n class=\"col-12 d-flex flex-wrap justify-content-between align-items-center mt-4\">\n <h2 class=\"card-title p-0 float-start\">{{ 'Support.Center.Title' | transloco }}</h2>\n <a routerLink=\"/support-details/add\"\n [attr.aria-label]=\"'Support.Center.CreateRequest' | transloco\"\n class=\"btn btn-sm btn-outline-primary float-end\"\n tabindex=\"0\"\n (keydown)=\"$event.key === 'Enter' && $event.target.click()\"\n aria-expanded=\"false\">\n <i class=\"fa fa-plus-circle\"\n aria-hidden=\"true\"></i>\n {{ 'Support.Center.CreateRequest' | transloco }}\n </a>\n </div>\n </div>\n <div class=\"col-12 my-3\">\n <h3>{{ 'Support.Center.PreviousRequests' | transloco }}</h3>\n <p>{{ 'Support.Center.ReplyByEmail' | transloco }}</p>\n </div>\n @if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (supports?.length) {\n <div class=\"col-12 mb-3\">\n <p-accordion>\n @for (item of supports; track item; let i = $index) {\n <p-accordion-panel [value]=\"i\">\n <p-accordion-header>{{ item?.created_at | dateFormat }} ({{ item?.user_name }}) {{ item?.title }}</p-accordion-header>\n <p-accordion-content>\n <p>{{ item?.description }}</p>\n <a [href]=\"item?.attachment?.version_200x200?.url\"\n target=\"_blank\">\n @if (item?.attachment?.version_200x200?.url) {\n <img [alt]=\"'Support.Center.AttachmentAlt' | transloco\"\n [src]=\"item?.attachment?.version_200x200?.url\"\n class=\"img-fluid\" />\n }</a>\n </p-accordion-content>\n </p-accordion-panel>\n }\n </p-accordion>\n </div>\n }\n @if (!supports?.length && isLoaded) {\n <div class=\"col-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"No support requests found\"> </pw-no-data>\n </div>\n }\n </div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n OnInit,\n Renderer2\n} from '@angular/core';\nimport { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { AppAdmin } from '@posiwise/admin-module-utils';\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService, CommonService, PermissionService } from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { HelperService } from '@posiwise/helper-service';\nimport { InputContainerComponent, PwStickyActionsComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { NgxCaptchaModule } from 'ngx-captcha';\nimport { Bind } from 'primeng/bind';\nimport { FileUpload } from 'primeng/fileupload';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-support-details',\n templateUrl: './support-details.component.html',\n styleUrls: ['./support-details.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n FileUpload,\n ProgressSpinner,\n NgxCaptchaModule,\n PwStickyActionsComponent,\n TranslocoPipe\n ]\n})\nexport class SupportDetailsComponent extends AppBaseComponent implements AfterViewInit, OnInit {\n private readonly commonService = inject(CommonService);\n private readonly authService = inject(AuthService);\n private readonly renderer = inject(Renderer2);\n private readonly el = inject(ElementRef);\n private readonly cdr = inject(ChangeDetectorRef);\n\n form: FormGroup;\n\n uploadedFiles = [];\n\n invalidFile = false;\n isSubmitClicked = false;\n\n siteKey: string;\n\n recaptcha = null;\n\n isLoading: boolean;\n filesUploaded: boolean;\n subscriptionId;\n\n constructor() {\n super();\n this.form = AppAdmin.customerSupportForm();\n this.form.get('product_id').setValue(PermissionService.selectedProduct.id);\n this.siteKey = this.appConfig.integrations.captcha_key_V2;\n }\n\n ngOnInit(): void {\n this.subscriptionId = PermissionService.selectedSubscription?.id;\n }\n\n ngAfterViewInit() {\n this.attachCloseButtonListener();\n }\n\n @ValidateForm('form')\n onSave() {\n this.isSubmitClicked = true;\n }\n\n handleSuccess(token: string) {\n if (token) {\n this.authService.validateReCaptcha(token).subscribe((isSuccess: boolean) => {\n this.cdr.markForCheck();\n if (isSuccess) {\n this.isLoading = true;\n const data = {\n ...this.form.value\n };\n if (this.uploadedFiles.length > 0) {\n data.attachment = this.uploadedFiles[0];\n }\n if (!data.attachment) {\n delete data.attachment;\n }\n this.commonService\n .postCustomerSupport({ ...data, subscription_id: this.subscriptionId })\n .subscribe(() => {\n this.form.markAsPristine();\n this.back();\n })\n .add(() => {\n this.isLoading = false;\n this.isSubmitClicked = false;\n this.cdr.markForCheck();\n });\n }\n });\n }\n }\n\n onSelect(event = null) {\n this.invalidFile = false;\n for (const file of event.files) {\n if (!HelperService.validateFile(file, this.toast)) {\n this.invalidFile = true;\n } else {\n this.uploadedFiles.push(file);\n }\n }\n this.filesUploaded = true;\n\n if (this.invalidFile) {\n setTimeout(() => this.attachCloseButtonListener(), 0);\n }\n }\n\n onRemove(event) {\n this.uploadedFiles = this.uploadedFiles.filter(x => event.file.name !== x.name);\n if (this.uploadedFiles.length === 0) {\n this.filesUploaded = false;\n }\n this.invalidFile = false;\n }\n\n attachCloseButtonListener() {\n const closeButton = this.el.nativeElement.querySelector('.p-message-close');\n\n if (closeButton) {\n this.renderer.listen(closeButton, 'click', () => {\n this.handleCloseButtonClick();\n });\n }\n }\n\n handleCloseButtonClick() {\n this.invalidFile = false;\n this.filesUploaded = false;\n }\n\n onUploadError(event) {\n HelperService.onUploadError(event, this.toast);\n }\n}\n","<div class=\"container-fluid pw-tab overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"me-auto col-xs-6 mt-4\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\" (click)=\"back()\" class=\"previous\"><i\n class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n <h3 class=\"mt-3\">{{ 'Label.NewSupport' | transloco }}</h3>\n </div>\n <div class=\"p-2 m-1 mt-3\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSave()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <pw-input-container controlId=\"support-details-title\"\n [label]=\"'Support.Details.Title' | transloco\"\n name=\"title\"\n errorMsg=\"Support.Details.Validation.Title\">\n <input type=\"text\"\n id=\"support-details-title\"\n class=\"form-control\"\n [placeholder]=\"'Support.Placeholder.Title' | transloco\"\n formControlName=\"title\"\n [attr.aria-label]=\"'Support.Details.Title' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <pw-input-container controlId=\"support-details-description\"\n [label]=\"'Support.Details.Description' | transloco\"\n errorMsg=\"Support.Details.Validation.Description\"\n name=\"description\">\n <textarea rows=\"3\"\n id=\"support-details-description\"\n type=\"text\"\n class=\"form-control\"\n [placeholder]=\"'Support.Placeholder.Description' | transloco\"\n formControlName=\"description\"\n [attr.aria-label]=\"'Support.Details.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <div class=\"mb-3 file-upload-support-details\">\n <span id=\"support-details-file-label\" class=\"pw-label-style\">{{ 'Support.Details.UploadPicture' | transloco }}</span>\n <p-fileupload #forms\n [attr.aria-labelledby]=\"'support-details-file-label'\"\n name=\"myfile[]\"\n [customUpload]=\"true\"\n [showUploadButton]=\"false\"\n accept=\"image/*\"\n [disabled]=\"uploadedFiles && uploadedFiles.length > 0\"\n (onSelect)=\"onSelect($event)\"\n (onRemove)=\"onRemove($event)\"\n (onError)=\"onUploadError($event)\">\n <ng-template #content>\n @if (!uploadedFiles?.length) {\n <div class=\"drag-drop-text\">\n <p>{{ 'Support.Details.DragAndDrop' | transloco }}</p>\n </div>\n }\n </ng-template>\n </p-fileupload>\n </div>\n </div>\n @if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (isSubmitClicked) {\n <div class=\"col-12 text-end mt-3\">\n <div class=\"support-details-captcha\">\n <ngx-recaptcha2 [ngModelOptions]=\"{ standalone: true }\"\n [siteKey]=\"siteKey\"\n size=\"normal\"\n [(ngModel)]=\"recaptcha\"\n (success)=\"handleSuccess($event)\">\n </ngx-recaptcha2>\n </div>\n </div>\n } @else {\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"back()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\" [disabled]=\"invalidFile\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n }\n </div>\n </form>\n </div>\n </div>\n </div>\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\n\nimport { ProfileService, ProjectPicture, WriteResponse } from '@posiwise/common-services';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport { Bind } from 'primeng/bind';\nimport { FileUpload } from 'primeng/fileupload';\nimport { forkJoin, Observable } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-portfolios',\n templateUrl: './edit-portfolios.component.html',\n styleUrls: ['./edit-portfolios.component.scss'],\n imports: [Bind, FileUpload, LazyImgDirective, ButtonBusyDirective, TranslocoPipe]\n})\nexport class EditPortfoliosComponent {\n private readonly modalService = inject(NgbModal);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n @ViewChild('form', { static: false }) uploader: FileUpload;\n\n @Output() successEvent: EventEmitter<boolean> = new EventEmitter();\n\n @Input() id: number;\n @Input() slug: string;\n\n uploadedFiles = [];\n project = [];\n projectPictures = [];\n\n busy: boolean;\n filesUploaded: boolean;\n\n openModal(id: number) {\n this.id = 0;\n this.id = id;\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n onSelect(event = null) {\n // eslint-disable-next-line no-restricted-syntax\n for (const file of event.files) {\n if (HelperService.validateFile(file)) {\n this.uploadedFiles.push(file);\n }\n }\n this.filesUploaded = true;\n }\n\n getProjectPictures() {\n this.profileService.getProjectPictures(this.slug).subscribe(({ result }) => {\n if (result.length > 0) {\n this.projectPictures = result.flatMap(x => x.project_pictures);\n }\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Uploads multiple images for the project\n * @param form\n */\n onSave(form) {\n if (this.uploadedFiles.length > 0) {\n this.busy = true;\n const subscriptions$: Observable<WriteResponse<ProjectPicture>>[] = [];\n this.uploadedFiles.forEach(file => {\n subscriptions$.push(\n this.profileService.addProjectPictures({\n project_id: Number(this.id),\n image: file\n })\n );\n });\n\n forkJoin(subscriptions$)\n .subscribe({\n next: () => {\n form.clear();\n this.successEvent.emit();\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n },\n error: () => {\n form.clear();\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.busy = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n deleteProjectPicture(id: number) {\n this.profileService.deletePicture(id).subscribe(_ => {\n this.getProjectPictures();\n this.cdr.markForCheck();\n });\n }\n\n trackByImage(_index: number, item: { id: number }) {\n return item?.id;\n }\n\n onRemove(event) {\n this.uploadedFiles = this.uploadedFiles.filter(x => event.file.name !== x.name);\n this.filesUploaded = false;\n }\n\n onUploadError(event) {\n HelperService.onUploadError(event);\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ 'User.Profile.Portfolio.EditTitle' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n {{ 'User.Profile.Portfolio.UploadHint' | transloco }}\n <p-fileupload #form\n name=\"myfile[]\"\n [customUpload]=\"true\"\n [showUploadButton]=\"false\"\n accept=\"\"\n [disabled]=\"uploadedFiles && uploadedFiles.length > 0\"\n (onSelect)=\"onSelect($event)\"\n (onRemove)=\"onRemove($event)\"\n (onError)=\"onUploadError($event)\">\n <ng-template #content>\n @if (!uploadedFiles?.length) {\n <div class=\"drag-drop-text\">\n <p>{{ 'Support.Details.DragAndDrop' | transloco }}</p>\n </div>\n }\n </ng-template>\n </p-fileupload>\n <div class=\"ui-fileupload-content ui-widget-content ui-corner-bottom\">\n <div class=\"ui-fileupload-files\">\n <div class=\"\">\n <h5>{{ 'User.Profile.Portfolio.UploadedPictures' | transloco }}</h5>\n @for (image of projectPictures; track trackByImage($index, image)) {\n <div\n class=\"ui-fileupload-row d-inline-block\">\n <div>\n <img [src]=\"image?.picture?.version_50x50?.url\"\n alt=\"\"\n width=\"50\" />\n </div>\n <div class=\"pt-1 ps-1\">\n <button icon=\"pi pi-times\"\n type=\"button\"\n (click)=\"deleteProjectPicture(image.id)\"\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only\">\n <span class=\"ui-button-icon-left ui-clickable pi pi-times\"></span>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n [buttonBusy]=\"busy\"\n (click)=\"onSave(form)\">\n {{ 'Button.Save' | transloco }}\n </button>\n </div>\n</ng-template>\n","import { NgClass } from '@angular/common';\nimport {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n OnDestroy,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProfileService, ValidationService } from '@posiwise/common-services';\nimport { Project } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { appendQueryParam, clearQueryParams, ValidateForm } from '@posiwise/utils';\n\nimport moment from 'moment';\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-project-modal',\n templateUrl: './edit-project-modal.component.html',\n styleUrls: ['./edit-project-modal.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n NgClass,\n Bind,\n Select,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditProjectModalComponent extends AppBaseComponent implements OnInit, OnDestroy {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Output() cancelEvent: EventEmitter<void> = new EventEmitter();\n @Output() saveEvent: EventEmitter<boolean> = new EventEmitter();\n\n form: FormGroup;\n\n weeks: number[] = [];\n startYears: number[];\n endYears: number[];\n\n title = 'Add Project';\n\n submitted = false;\n buttonBusy = false;\n\n private currentProject: Project;\n\n userId: number;\n\n constructor() {\n super();\n this.getForm();\n }\n\n get f() {\n return this.form.controls;\n }\n\n ngOnInit() {\n clearQueryParams(this.router, this.route);\n this.userStore().subscribe(user => {\n this.userId = user.id;\n this.cdr.markForCheck();\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n\n getStartYear() {\n const d = new Date(`01 July 1980`);\n const range = [];\n for (let i = new Date().getFullYear(); i >= d.getFullYear(); i--) {\n range.push(i);\n }\n this.startYears = range;\n }\n\n getEndYears(start_year) {\n const range = [];\n for (let i = new Date().getFullYear(); i >= start_year; i--) {\n range.push(i);\n }\n this.endYears = range;\n }\n\n private getWeeks() {\n const endYear = moment([this.form.value['end_year']]);\n const startYear = moment([this.form.value['start_year']]);\n if (endYear) {\n const weeks = endYear.diff(startYear, 'weeks');\n this.weeks = Array.from(Array(weeks).keys());\n }\n }\n\n onOpen(item = null) {\n this.currentProject = item;\n appendQueryParam(this.router, this.route, {\n modal: 'editProjects'\n });\n\n if (item) {\n this.form.patchValue(item);\n this.title = `Edit Project - ${item.title}`;\n this.getStartYear();\n this.getEndYears(item.end_year);\n this.getWeeks();\n } else {\n this.form.reset();\n this.title = 'Add Project';\n }\n\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.submitted = true;\n this.buttonBusy = true;\n const { value } = this.form;\n value.user_id = this.userId;\n\n const subscription$ = this.currentProject?.id\n ? this.profileService.updateProjects(this.currentProject.id, value)\n : this.profileService.addProjects(value);\n subscription$\n .subscribe(() => {\n this.modalService.dismissAll();\n this.toast.success(\n this.translation.translate('User.Profile.Projects.ProjectUpdated')\n );\n this.saveEvent.emit(true);\n this.cdr.markForCheck();\n })\n .add(() => {\n this.submitted = false;\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n private getForm() {\n this.form = this.fb.group({\n start_year: [\n null,\n [\n Validators.required,\n Validators.pattern(ValidationService.CustomValidatorPatterns.Year)\n ]\n ],\n end_year: [\n null,\n [\n Validators.required,\n Validators.pattern(ValidationService.CustomValidatorPatterns.Year)\n ]\n ],\n client_name: [null, Validators.required],\n title: [null, Validators.required],\n description: [null, Validators.required],\n length: ['', [Validators.required, Validators.max(5000)]],\n advertisable: [false],\n syndicated: [false]\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ title }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row p-2\">\n <!-- Title -->\n <pw-input-container class=\"col-12\"\n controlId=\"edit-project-title\"\n [label]=\"'User.Profile.Projects.Field.Title' | transloco\"\n name=\"title\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-project-title\"\n class=\"form-control\"\n formControlName=\"title\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.Title' | transloco\"\n [ngClass]=\"{ 'is-invalid': submitted && f.title.errors }\"\n [attr.aria-label]=\"'User.Profile.Projects.Field.Title' | transloco\" />\n </pw-input-container>\n <!-- Client Name -->\n <pw-input-container class=\"col-12\"\n controlId=\"edit-project-client_name\"\n [label]=\"'User.Profile.Projects.Field.ClientName' | transloco\"\n name=\"client_name\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-project-client_name\"\n class=\"form-control\"\n formControlName=\"client_name\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.ClientName' | transloco\"\n [ngClass]=\"{ 'is-invalid': submitted && f.client_name.errors }\"\n [attr.aria-label]=\"'User.Profile.Projects.Field.ClientName' | transloco\" />\n </pw-input-container>\n <!-- Project Start Year -->\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-project-start_year\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Projects.Field.Start' | transloco\"\n name=\"start_year\"\n errorMsg=\"User.Profile.Fields.Validation.YearRequired\">\n <p-select\n [attr.aria-labelledby]=\"'edit-project-start_year-label'\"\n (onShow)=\"getStartYear()\"\n formControlName=\"start_year\"\n [options]=\"startYears\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.StartYear' | transloco\"\n (onChange)=\"getEndYears($event.value)\"\n [ngClass]=\"{ 'is-invalid': submitted && f.start_year.errors }\">\n </p-select>\n </pw-input-container>\n <!-- Project End Year -->\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-project-end_year\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Projects.Field.End' | transloco\"\n name=\"end_year\"\n errorMsg=\"User.Profile.Fields.Validation.YearRequired\">\n <p-select\n [attr.aria-labelledby]=\"'edit-project-end_year-label'\"\n formControlName=\"end_year\"\n [options]=\"endYears\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.EndYear' | transloco\"\n (onChange)=\"getEndYears($event.value)\"\n [ngClass]=\"{ 'is-invalid': submitted && f.end_year.errors }\">\n </p-select>\n </pw-input-container>\n <!-- Total Weeks Worked -->\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-project-length\"\n [label]=\"'User.Profile.Projects.Field.WeeksWorked' | transloco\"\n name=\"length\"\n errorMsg=\"User.Profile.Fields.Validation.WeeksRequired\">\n <input type=\"number\"\n id=\"edit-project-length\"\n formControlName=\"length\"\n class=\"form-control\"\n [ngClass]=\"{ 'is-invalid': submitted && f.length.errors }\"\n [attr.aria-label]=\"'User.Profile.Projects.Field.WeeksWorked' | transloco\" />\n </pw-input-container>\n <!-- Description -->\n <pw-input-container class=\"col-12\"\n controlId=\"edit-project-description\"\n [label]=\"'User.Profile.Fields.Description' | transloco\"\n name=\"description\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <textarea type=\"text\"\n id=\"edit-project-description\"\n class=\"form-control\"\n formControlName=\"description\"\n required\n [placeholder]=\"'User.Profile.Projects.Placeholder.Description' | transloco\"\n [ngClass]=\"{ 'is-invalid': submitted && f.description.errors }\"\n [attr.aria-label]=\"'User.Profile.Fields.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EventEmitter,\n inject,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { QualificationService } from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { appendQueryParam, clearQueryParams, ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { DatePicker } from 'primeng/datepicker';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n/**\n * The `degree` saved for each level. It is stored text that existing records already hold, so it\n * stays this exact English whatever language the form is shown in.\n */\nconst STORED_DEGREES: Record<number, string> = {\n 0: 'No formal education',\n 1: 'Primary education',\n 2: 'Secondary educ, action or high school',\n 3: 'GED',\n 4: 'Vocational qualification',\n 5: \"Bachelor's degree\",\n 7: \"Master's degree\",\n 9: 'Doctorate or higher'\n};\n\n@Component({\n selector: 'pw-edit-qualifications-modal',\n templateUrl: './edit-qualifications-modal.component.html',\n styleUrls: ['./edit-qualifications-modal.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n DatePicker,\n Select,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditQualificationsModalComponent extends AppBaseComponent implements OnInit {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly qualificationService = inject(QualificationService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Output()\n saveEvent: EventEmitter<void> = new EventEmitter();\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n titleKey = 'User.Profile.About.AddEducation';\n\n form: FormGroup;\n\n userId: number;\n\n now: Date = new Date(); // Used for datepicker\n\n minToDate = this.now;\n\n qualifications: { value: number; label: string }[] = [];\n\n private readonly destroyRef = inject(DestroyRef);\n buttonBusy = false;\n\n constructor() {\n super();\n\n // Rebuilt when the translations load and on every language switch.\n this.translation\n .selectTranslation()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.qualifications = Object.keys(STORED_DEGREES)\n .map(Number)\n .map(value => ({\n value,\n label: this.translation.translate(\n `User.Profile.Qualifications.Degree.${value}`\n )\n }));\n this.cdr.markForCheck();\n });\n\n this.form = this.fb.group({\n id: [null],\n school: [null, Validators.required],\n course: [null, Validators.required],\n degree: [null],\n started_on: [null, Validators.required],\n ended_on: [null, Validators.required],\n description: [null],\n points: [null]\n });\n }\n\n ngOnInit() {\n clearQueryParams(this.router, this.route);\n this.userStore().subscribe(response => {\n this.userId = response.id;\n this.cdr.markForCheck();\n });\n }\n\n onOpen(value = null) {\n appendQueryParam(this.router, this.route, {\n modal: 'editQualifications'\n });\n\n if (value) {\n this.form.patchValue(value);\n this.titleKey = 'User.Profile.About.EditEducation';\n } else {\n this.form.reset();\n this.titleKey = 'User.Profile.About.AddEducation';\n }\n\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n onDateChange(): void {\n const fromDate = this.form.controls['started_on'].value;\n if (fromDate) {\n this.minToDate = new Date(fromDate);\n this.minToDate.setDate(this.minToDate.getDate() + 1);\n }\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.buttonBusy = true;\n const data = { ...this.form.value };\n data.user_id = this.userId;\n data.degree = STORED_DEGREES[data.points];\n\n const sub$ = data?.id\n ? this.qualificationService.updateQualifications(data.id, data)\n : this.qualificationService.addQualifications(data);\n\n sub$.subscribe(() => {\n const msg = data.id\n ? this.translation.translate('User.Profile.Qualifications.UpdatedMessage')\n : this.translation.translate('User.Profile.Qualifications.AddedMessage');\n this.toast.success(msg);\n this.saveEvent.emit();\n clearQueryParams(this.router, this.route);\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n }).add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ titleKey | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row p-2\">\n <pw-input-container class=\"col-12\"\n controlId=\"edit-qualifications-school\"\n [label]=\"'User.Profile.Qualifications.Field.School' | transloco\"\n name=\"school\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-qualifications-school\"\n class=\"form-control\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.School' | transloco\"\n formControlName=\"school\"\n [attr.aria-label]=\"'User.Profile.Qualifications.Field.School' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-started_on\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Qualifications.Field.DatesAttended' | transloco\"\n name=\"started_on\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <div class=\"ui-fluid\">\n <p-datepicker inputId=\"edit-qualifications-started_on\" formControlName=\"started_on\"\n [attr.aria-labelledby]=\"'edit-qualifications-started_on-label'\"\n [monthNavigator]=\"true\"\n [yearNavigator]=\"true\"\n yearRange=\"1950:2020\"\n (onSelect)=\"onDateChange()\"\n [showIcon]=\"true\"\n [placeholder]=\"'User.Profile.Fields.DatePlaceholder' | transloco\"\n dateFormat=\"yy-mm-dd\">\n </p-datepicker>\n </div>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-ended_on\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Qualifications.Field.DatesCompleted' | transloco\"\n name=\"ended_on\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <div class=\"ui-fluid\">\n <p-datepicker inputId=\"edit-qualifications-ended_on\" formControlName=\"ended_on\"\n [attr.aria-labelledby]=\"'edit-qualifications-ended_on-label'\"\n [monthNavigator]=\"true\"\n [yearNavigator]=\"true\"\n [showIcon]=\"true\"\n (onSelect)=\"onDateChange()\"\n [minDate]=\"minToDate\"\n [placeholder]=\"'User.Profile.Fields.DatePlaceholder' | transloco\"\n dateFormat=\"yy-mm-dd\"\n yearRange=\"1950:2025\"></p-datepicker>\n </div>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-points\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.About.Degree' | transloco\"\n name=\"points\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-select inputId=\"edit-qualifications-points\"\n [options]=\"qualifications\"\n [attr.aria-labelledby]=\"'edit-qualifications-points-label'\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.Degree' | transloco\"\n formControlName=\"points\"></p-select>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-course\"\n [label]=\"'User.Profile.About.Course' | transloco\"\n name=\"course\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-qualifications-course\"\n class=\"form-control\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.Course' | transloco\"\n formControlName=\"course\"\n [attr.aria-label]=\"'User.Profile.About.Course' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-qualifications-description\"\n [label]=\"'User.Profile.Fields.Description' | transloco\"\n name=\"description\">\n <textarea type=\"text\"\n id=\"edit-qualifications-description\"\n class=\"form-control\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.Description' | transloco\"\n formControlName=\"description\"\n [attr.aria-label]=\"'User.Profile.Fields.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n\n<i\n class=\"fa fa-lg pi pi-plus-circle float-end mt-2 pt-1 pt-md-0 profile-icons\"\n data-cy=\"add-qualification\"\n (keydown.enter)=\"onOpen()\"\n [attr.aria-label]=\"'User.Profile.Qualifications.Add' | transloco\"\n (click)=\"onOpen()\"\n aria-hidden=\"true\"\n></i>\n","import { ChangeDetectorRef, Component, inject, Input, TemplateRef, ViewChild } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { ProfileService } from '@posiwise/common-services';\nimport { Project, User } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { Rating } from 'primeng/rating';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-recommendation-modal',\n templateUrl: './edit-recommendation-modal.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n Rating,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditRecommendationModalComponent {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input() user: User;\n\n form: FormGroup;\n\n title = 'Endorse';\n\n buttonBusy = false;\n\n project = new Project();\n\n constructor() {\n this.form = this.fb.group({\n project_id: [null],\n user_id: [null],\n description: [null, Validators.required],\n quality: [null],\n time: [null],\n communication: [null]\n });\n }\n\n onOpen(value = null) {\n if (value) {\n this.project = value;\n }\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.buttonBusy = true;\n const data = {\n user_id: this.user.id,\n project_id: this.project.id,\n description: this.form.get('description').value,\n quality: this.form.get('quality').value,\n time: this.form.get('time').value,\n communication: this.form.get('communication').value\n } as object;\n\n this.profileService\n .postProjectRecommendation(data)\n .subscribe(_ => {\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ title }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row p-2\">\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-recommendation-quality\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Recommendations.Field.Quality' | transloco\"\n name=\"quality\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-rating formControlName=\"quality\"\n [attr.aria-labelledby]=\"'edit-recommendation-quality-label'\"\n [cancel]=\"false\"></p-rating>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-recommendation-communication\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Recommendations.Field.Communication' | transloco\"\n name=\"communication\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-rating formControlName=\"communication\"\n [attr.aria-labelledby]=\"'edit-recommendation-communication-label'\"\n [cancel]=\"false\"></p-rating>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-recommendation-time\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Recommendations.Field.Time' | transloco\"\n name=\"time\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-rating formControlName=\"time\"\n [attr.aria-labelledby]=\"'edit-recommendation-time-label'\"\n [cancel]=\"false\"></p-rating>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-recommendation-description\"\n [label]=\"'User.Profile.Fields.Description' | transloco\"\n name=\"description\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <textarea type=\"text\"\n id=\"edit-recommendation-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [attr.aria-label]=\"'User.Profile.Fields.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n\n<!-- <i class=\"fal fa-plus-circle fa-2x btn-link float-end btn-add\" (click)=\"onOpen()\" aria-hidden=\"true\"></i> -->\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { TagService } from '@posiwise/common-services';\nimport { TAG_ENTITY, TAG_TYPE } from '@posiwise/common-utilities';\nimport { appendQueryParam, clearQueryParams } from '@posiwise/utils';\n\nimport { AutoComplete } from 'primeng/autocomplete';\nimport { Bind } from 'primeng/bind';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-skills-modal',\n templateUrl: './edit-skills-modal.component.html',\n imports: [Bind, AutoComplete, FormsModule, TranslocoPipe]\n})\nexport class EditSkillsModalComponent extends AppBaseComponent {\n private readonly modalService = inject(NgbModal);\n private readonly tagService = inject(TagService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input()\n userId: number;\n\n @Input()\n slug: string;\n\n @Input()\n entityType = TAG_TYPE.SKILLS;\n\n @Input()\n entityEntity = TAG_ENTITY.USER;\n\n @Output()\n saveEvent: EventEmitter<boolean> = new EventEmitter();\n\n allSkills = [];\n\n searchSkills = [];\n\n selectedSkills = [];\n\n open() {\n this.getSkills();\n this.modalService.open(this.content, { centered: true, windowClass: 'modal-holder' });\n appendQueryParam(this.router, this.route, {\n modal: 'editskills'\n });\n }\n\n /**\n * Populate all the skills for the dropdown\n */\n private getSkills() {\n this.tagService.getTagsByType('skills', {}).subscribe(({ result }) => {\n this.allSkills = result;\n this.getEntitySkills();\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Skills Search\n * @param event: keyword to search\n */\n search(event) {\n let data = [];\n if (event.query) {\n data = this.allSkills.filter(x =>\n x.name.toLowerCase().includes(event.query.toLowerCase())\n );\n } else {\n this.allSkills.forEach(item => {\n data.push(item);\n });\n }\n this.searchSkills = data;\n }\n\n close(modal) {\n modal.close();\n this.selectedSkills = [];\n }\n\n private getEntitySkills() {\n this.tagService\n .getTagsByEntity(this.slug, this.entityEntity, this.entityType)\n .subscribe(({ result }) => {\n this.selectedSkills = this.allSkills.filter(item => {\n return result.find(x => x.id === item.id);\n });\n this.cdr.markForCheck();\n });\n }\n\n saveUserSkills() {\n const skills = [];\n this.selectedSkills.forEach(element => {\n skills.push({\n tag_id: element.id,\n rank: element.id,\n years: 0,\n preferred: true\n });\n });\n\n const postData = {\n entity_tags: skills,\n user_id: Number(this.userId),\n slug: this.slug,\n tag_entity: this.entityEntity\n };\n\n this.tagService.addTags(postData).subscribe(() => {\n this.saveEvent.emit(true);\n this.toast.success(this.translation.translate('User.Profile.Skills.UpdatedMessage'));\n clearQueryParams(this.router, this.route);\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ 'User.Profile.Skills.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"ui-fluid skills-modal skills-dropdown\">\n <p-auto-complete class=\"w-100\" appendTo=\"body\" [(ngModel)]=\"selectedSkills\"\n [suggestions]=\"searchSkills\"\n dataKey=\"id\"\n optionLabel=\"name\"\n (completeMethod)=\"search($event)\"\n [minLength]=\"1\"\n [maxlength]=\"10\"\n [placeholder]=\"'User.Profile.Skills.Placeholder' | transloco\"\n [dropdown]=\"true\"\n [multiple]=\"true\"></p-auto-complete>\n\n <small class=\"p-2\">{{ 'User.Profile.Skills.Limit' | transloco }}</small>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"close(modal)\">{{ 'Button.Cancel' | transloco }}</button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveUserSkills()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n ValidatorFn\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProfileService } from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext, ValidationError } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-social-links',\n templateUrl: './edit-social-links.component.html',\n styleUrls: ['./edit-social-links.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n LazyImgDirective,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditSocialLinksComponent extends AppBaseComponent implements OnInit {\n private readonly modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input() links: Record<string, string> = {};\n @Input() userId: number;\n\n @Output() saveEvent: EventEmitter<void> = new EventEmitter();\n\n form: FormGroup;\n\n buttonBusy = false;\n\n readonly socialNetworks: ReadonlyArray<{\n key: string;\n labelKey: string;\n icon: string;\n placeholder: string;\n }> = [\n {\n key: 'linkedin',\n labelKey: 'User.Profile.SocialLinks.Label.LinkedIn',\n icon: 'linkedin',\n placeholder: 'https://linkedin.com/in/nickname'\n },\n {\n key: 'twitter',\n labelKey: 'User.Profile.SocialLinks.Label.Twitter',\n icon: 'twitter',\n placeholder: 'https://twitter.com/nickname'\n },\n {\n key: 'facebook',\n labelKey: 'User.Profile.SocialLinks.Label.Facebook',\n icon: 'facebook',\n placeholder: 'https://www.facebook.com/nickname'\n },\n {\n key: 'youtube',\n labelKey: 'User.Profile.SocialLinks.Label.YouTube',\n icon: 'youtube',\n placeholder: 'https://www.youtube.com/nickname'\n },\n {\n key: 'instagram',\n labelKey: 'User.Profile.SocialLinks.Label.Instagram',\n icon: 'instagram',\n placeholder: 'https://www.instagram.com/nickname'\n },\n {\n key: 'github',\n labelKey: 'User.Profile.SocialLinks.Label.Github',\n icon: 'github',\n placeholder: 'https://github.com/nickname'\n },\n {\n key: 'stackoverflow',\n labelKey: 'User.Profile.SocialLinks.Label.Stackoverflow',\n icon: 'stackoverflow',\n placeholder: 'http://stackoverflow.com/users/nickname'\n }\n ];\n\n constructor() {\n super();\n this.form = this.fb.group({\n user_id: 0,\n linkedin: ['', this.urlValidator('linkedin')],\n twitter: ['', this.urlValidator('twitter')],\n facebook: ['', this.urlValidator('facebook')],\n youtube: ['', this.urlValidator('youtube')],\n instagram: ['', this.urlValidator('instagram')],\n github: ['', this.urlValidator('github')],\n stackoverflow: ['', this.urlValidator('stackoverflow')]\n });\n }\n\n /** Tenant company name (domain-metadata driven), falling back to PosiWise. */\n get companyName(): string {\n return this.appConfig?.company?.name || 'PosiWise';\n }\n\n private urlValidator(social: string): ValidatorFn {\n return (control: AbstractControl): ValidationError | null => {\n if (!control.value) {\n return null;\n }\n try {\n const parsed = new URL(control.value);\n if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {\n return { urlMalformed: { value: control.value } };\n }\n const host = parsed.hostname.toLowerCase();\n\n return host.includes(social) ? null : { urlMalformed: { value: control.value } };\n } catch {\n return { urlMalformed: { value: control.value } };\n }\n };\n }\n\n ngOnInit() {\n this.form.patchValue(this.links);\n }\n\n onOpen(links) {\n this.links = links;\n this.form.patchValue(this.links);\n this.modalService.open(this.content, {\n centered: true,\n size: 'md',\n windowClass: 'modal-holder edit-social-links-modal'\n });\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.buttonBusy = true;\n this.form.patchValue({\n user_id: this.userId\n });\n this.profileService\n .postLinks(this.form.value)\n .subscribe(_ => {\n this.toast.success(\n this.translation.translate('User.Profile.SocialLinks.AddedMessage')\n );\n this.modalService.dismissAll();\n this.saveEvent.emit();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header edit-social-links-header\">\n <h4 class=\"modal-title edit-social-links__title\"\n id=\"modal-basic-title\">{{ 'User.Profile.SocialLinks.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"modal-body edit-social-links-body\">\n <form [formGroup]=\"form\"\n class=\"edit-social-links\"\n (ngSubmit)=\"onSaveDetail()\">\n <p class=\"edit-social-links__intro\">\n {{ 'User.Profile.SocialLinks.Description' | transloco: { company: companyName } }}\n </p>\n\n <div class=\"edit-social-links__stack\">\n @for (social of socialNetworks; track social.key) {\n <div class=\"edit-social-links__field\">\n <label [for]=\"'external-portfolio-' + social.key\"\n class=\"edit-social-links__label\">\n <span class=\"edit-social-links__chip\">\n <img [src]=\"'/assets/img/icons/social/' + social.icon + '.svg'\"\n width=\"18\"\n height=\"18\"\n alt=\"\" />\n </span>\n <span class=\"edit-social-links__label-text\">{{ social.labelKey | transloco }}</span>\n </label>\n <input type=\"url\"\n [id]=\"'external-portfolio-' + social.key\"\n [name]=\"social.key\"\n [formControlName]=\"social.key\"\n class=\"form-control edit-social-links__input\"\n [placeholder]=\"social.placeholder\"\n autocomplete=\"url\" />\n </div>\n }\n </div>\n </form>\n </div>\n <div class=\"modal-footer edit-social-links-footer\">\n <button type=\"button\"\n class=\"btn edit-social-links__cancel\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary edit-social-links__save\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n","import { AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport {\n NgxGpAutocompleteDirective,\n NgxGpAutocompleteModule\n} from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { GeoService, ProfileService } from '@posiwise/common-services';\nimport { Country } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\nimport { SelectButton } from 'primeng/selectbutton';\nimport { Observable } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbDateStruct, NgbInputDatepicker, NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { EditUser, ModalContext, UserProfile } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-user-profile-modal',\n templateUrl: './edit-user-profile-modal.component.html',\n styleUrl: './edit-user-profile-modal.component.scss',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n SelectButton,\n NgbInputDatepicker,\n Select,\n NgxGpAutocompleteModule,\n ButtonBusyDirective,\n AsyncPipe,\n TranslocoPipe\n ]\n})\nexport class EditUserProfileModalComponent extends AppBaseComponent implements OnInit {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly geoService = inject(GeoService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input() slug: string;\n @Input() user: EditUser;\n\n @Output() saveEvent: EventEmitter<UserProfile> = new EventEmitter<UserProfile>();\n\n @ViewChild('ngxPlaces') placesRef: NgxGpAutocompleteDirective;\n\n form: FormGroup;\n\n countries$: Observable<Country[]>;\n\n states: Country[] = [];\n buttonBusy = false;\n\n constructor() {\n super();\n this.form = this.fb.group({\n first_name: [null, Validators.required],\n last_name: [null, Validators.required],\n headline: [null, Validators.required],\n description: [null, Validators.required],\n gender: ['M'],\n phone_number: [null],\n dob: [null, Validators.required],\n website_url: [null],\n country: [null, Validators.required],\n postcode: [null],\n location: [null],\n state: [null, Validators.required],\n province: [null, Validators.required]\n });\n }\n\n ngOnInit() {\n this.countries$ = this.geoService.getCountries();\n this.cdr.markForCheck();\n this.getValues();\n }\n\n getValues() {\n let dobObject: NgbDateStruct;\n\n const userProfile = this.user?.profile;\n if (userProfile) {\n if (userProfile?.country) {\n this.getRegion(userProfile.country);\n }\n if (userProfile?.dob) {\n dobObject = {\n year: Number(userProfile.dob.substring(0, 4)),\n month: Number(userProfile.dob.substring(5, 7)),\n day: Number(userProfile.dob.substring(8, 10))\n };\n\n this.form.patchValue({});\n }\n\n this.form.patchValue(userProfile);\n this.form.patchValue({\n first_name: this.user.first_name,\n last_name: this.user.last_name,\n dob: dobObject || {}\n });\n }\n }\n\n handleAddressChange(_event) {\n this.form.patchValue({\n latitude: _event.geometry.location.lat(),\n longitude: _event.geometry.location.lng(),\n location: _event.formatted_address\n });\n }\n\n onOpen() {\n this.form.reset();\n this.getValues();\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n getRegion(countryId) {\n if (countryId) {\n this.geoService.getRegions(countryId).subscribe(response => {\n this.states = response;\n this.cdr.markForCheck();\n });\n }\n }\n\n onSaveDetail() {\n this.form.patchValue({ province: this.form.value.state });\n this.save();\n }\n\n @ValidateForm('form')\n save() {\n this.buttonBusy = true;\n const data = { ...this.form.value };\n data.dob = HelperService.dateFormat(this.form.get('dob').value);\n\n this.profileService\n .updateUserProfile(data)\n .subscribe(({ result }) => {\n if (result?.id) {\n this.toast.success(this.translation.translate('User.Profile.ProfileUpdated'));\n this.modalService.dismissAll();\n this.saveEvent.emit(result as UserProfile);\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ 'User.Profile.Intro.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetail()\">\n <div class=\"row\">\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-first-name\"\n [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"first_name\"\n id=\"edit-intro-first-name\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.FirstName' | transloco\"\n autocomplete=\"given-name\" name=\"input_first_name_1\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-last-name\"\n [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"last_name\"\n id=\"edit-intro-last-name\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.LastName' | transloco\"\n autocomplete=\"family-name\" name=\"input_last_name_2\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-intro-headline\"\n [label]=\"'User.Profile.Fields.Headline' | transloco\"\n name=\"headline\"\n errorMsg=\"User.Profile.Fields.Validation.Headline\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"headline\"\n id=\"edit-intro-headline\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Headline' | transloco\" name=\"input_headline_3\"\n [attr.aria-label]=\"'User.Profile.Fields.Headline' | transloco\"/>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-intro-description\"\n [label]=\"'User.Profile.About.AboutMe' | transloco\"\n name=\"description\"\n errorMsg=\"User.Profile.Fields.Validation.Description\">\n <textarea class=\"form-control\"\n id=\"edit-intro-description\"\n name=\"description\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Description' | transloco\"\n formControlName=\"description\"\n [attr.aria-label]=\"'User.Profile.About.AboutMe' | transloco\"></textarea>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-gender\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.About.Gender' | transloco\"\n name=\"gender\"\n errorMsg=\"User.Profile.Fields.Validation.Gender\">\n <p-select-button [options]=\"[\n { label: 'Male', value: 'M' },\n { label: 'Female', value: 'F' }\n ]\"\n [attr.aria-labelledby]=\"'edit-intro-gender-label'\"\n formControlName=\"gender\"></p-select-button>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-dob\"\n [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"edit-intro-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Profile.Fields.DatePlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ year: 1950, month: 1, day: 1 }\"\n [maxDate]=\"{ year: 2018, month: 12, day: 31 }\"\n autocomplete=\"off\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n [attr.aria-label]=\"'User.Profile.Fields.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-phone\"\n [label]=\"'User.Profile.Fields.Phone' | transloco\"\n name=\"phone_number\"\n errorMsg=\"User.Profile.Fields.Validation.Phone\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n id=\"edit-intro-phone\"\n name=\"phone_number\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Phone' | transloco\"\n autocomplete=\"tel\"\n [attr.aria-label]=\"'User.Profile.Fields.Phone' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-postcode\"\n [label]=\"'User.Profile.Fields.Postcode' | transloco\"\n name=\"postcode\"\n errorMsg=\"User.Profile.Fields.Validation.Postcode\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"postcode\"\n id=\"edit-intro-postcode\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Postcode' | transloco\"\n autocomplete=\"postal-code\" name=\"input_postcode_6\"\n [attr.aria-label]=\"'User.Profile.Fields.Postcode' | transloco\"/>\n </pw-input-container>\n\n @if (countries$ | async; as countries) {\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-country\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'edit-intro-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-state\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'edit-intro-state-label'\"\n [options]=\"states\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n\n <!-- Location -->\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n class=\"col-12 col-md-6\"\n controlId=\"edit-intro-location\"\n [useAriaLabelledbyOnly]=\"true\"\n name=\"location\">\n <input ngx-gp-autocomplete\n id=\"edit-intro-location\"\n name=\"location\"\n class=\"form-control\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Location' | transloco\"\n [attr.aria-labelledby]=\"'edit-intro-location-label'\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-website\"\n [label]=\"'User.Profile.About.Website' | transloco\"\n name=\"website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"website_url\"\n id=\"edit-intro-website\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Website' | transloco\"\n autocomplete=\"url\" name=\"input_website_url_8\"\n [attr.aria-label]=\"'User.Profile.About.Website' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"modal-footer\">\n <input type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"modal.close()\"\n [value]=\"'Button.Cancel' | transloco\" id=\"input_field_9\" name=\"input_field_9\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"/>\n <input type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n [value]=\"'User.Profile.Fields.SaveChanges' | transloco\" id=\"input_field_10\" name=\"input_field_10\"\n [attr.aria-label]=\"'User.Profile.Fields.SaveChanges' | transloco\"/>\n </div>\n </form>\n </div>\n</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n ProfileService,\n Qualification,\n QualificationService,\n Skill,\n TagService,\n UserProfileDetails\n} from '@posiwise/common-services';\nimport { TAG_ENTITY, TAG_TYPE, User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { DateFormatPipe } from '@posiwise/pipes';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { forkJoin } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { EditQualificationsModalComponent } from '../edit-qualifications-modal/edit-qualifications-modal.component';\nimport { EditSkillsModalComponent } from '../edit-skills-modal/edit-skills-modal.component';\nimport { EditSocialLinksComponent } from '../edit-social-links/edit-social-links.component';\nimport { EditUserProfileModalComponent } from '../edit-user-profile-modal/edit-user-profile-modal.component';\n\n@Component({\n selector: 'pw-user-about',\n templateUrl: './user-about.component.html',\n styleUrls: ['./user-about.component.scss'],\n imports: [\n EditUserProfileModalComponent,\n EditSkillsModalComponent,\n EditQualificationsModalComponent,\n LazyImgDirective,\n EditSocialLinksComponent,\n Bind,\n ProgressSpinner,\n TranslocoPipe,\n DateFormatPipe\n ]\n})\nexport class UserAboutComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly profileService = inject(ProfileService);\n private readonly qualificationService = inject(QualificationService);\n private readonly tagService = inject(TagService);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n @Input() user: User;\n @Input() isEdit = false;\n\n @Output()\n saveEvent: EventEmitter<boolean> = new EventEmitter();\n\n @ViewChild(EditUserProfileModalComponent, { static: false })\n modal: EditUserProfileModalComponent;\n\n @ViewChild(EditQualificationsModalComponent, { static: false })\n qualificationModal: EditQualificationsModalComponent;\n\n @ViewChild(EditSkillsModalComponent, { static: false })\n skillsModal: EditSkillsModalComponent;\n\n @ViewChild(EditSocialLinksComponent, { static: false })\n socialModal: EditSocialLinksComponent;\n\n allSkills = [];\n\n searchSkills = [];\n\n selectedSkills: Skill[];\n\n objectKeys = Object.keys;\n\n user_profile: UserProfileDetails | null;\n\n qualifications: Qualification[] = [];\n\n userLinks: Record<string, string> = {};\n\n noUserLinks: boolean;\n\n loading = false;\n\n ngOnInit() {\n this.getUserDetails();\n this.getSkills();\n }\n\n getUserDetails() {\n this.loading = true;\n forkJoin({\n user_profile: this.profileService.getUserObject('user_profile', this.user.slug),\n qualifications: this.profileService.getUserObject('qualifications', this.user.slug),\n user_links: this.profileService.getUserObject('user_link', this.user.slug),\n user_skills: this.tagService.getGroupedSkills(\n this.user.slug,\n TAG_ENTITY.USER,\n TAG_TYPE.SKILLS\n )\n }).subscribe({\n next: response => {\n this.user_profile = response.user_profile.result;\n this.user['profile'] = this.user_profile;\n this.qualifications = response.qualifications.result;\n this.userLinks = (response.user_links.result ?? {}) as Record<string, string>;\n this.noUserLinks = Object.values(this.userLinks).some(x => !!x);\n this.selectedSkills = response.user_skills.result;\n this.loading = false;\n this.cdr.markForCheck();\n },\n error: err => {\n this.loading = false;\n this.toast.showToast(err);\n this.cdr.markForCheck();\n },\n complete: () => {\n this.loading = false;\n this.cdr.markForCheck();\n }\n });\n }\n\n private getSkills() {\n this.tagService.getTagsByType('skills', {}).subscribe(({ result }) => {\n this.allSkills = result;\n this.cdr.markForCheck();\n });\n }\n\n onProfileOpen() {\n this.modal.onOpen();\n }\n\n openSkills() {\n this.skillsModal.open();\n }\n\n onProfileSaved(_event) {\n this.getUserDetails();\n this.saveEvent.emit();\n }\n\n onOpenSocial() {\n if (this.socialModal) {\n this.socialModal.onOpen(this.userLinks); // Pass userLinks to the modal\n }\n }\n\n editQualification(item) {\n this.qualificationModal.onOpen(item);\n }\n\n deleteQualification(item) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: `Are you sure you want to delete <strong>${item.degree}</strong>?`,\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.qualificationService.deleteQualifications(item.id).subscribe(() => {\n this.toast.success(\n this.translation.translate(\n 'User.Profile.Qualifications.QualificationDelete'\n )\n );\n this.getUserDetails();\n this.cdr.markForCheck();\n });\n });\n }\n\n onSaveUserLinks() {\n this.getUserDetails();\n }\n\n trackByQualification(_index: number, item: { id: number }) {\n return item.id;\n }\n\n override ngOnDestroy() {\n // Intentionally no super.ngOnDestroy() call.\n }\n}\n","<div class=\"about\">\n <!-- Personal Information -->\n <section class=\"about-section\" data-cy=\"personal-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-user\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.PersonalInfo' | transloco }}</h2>\n @if (user && isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"onProfileOpen()\" [attr.aria-label]=\"'User.Profile.About.EditPersonalInfo' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n <div class=\"about-bio\">\n <span class=\"about-field__label\">{{ 'User.Profile.About.AboutMe' | transloco }}</span>\n <p class=\"about-bio__text\" [class.is-empty]=\"!user_profile?.description\">\n {{ user_profile?.description || ('User.Profile.About.NoDescription' | transloco) }}\n </p>\n </div>\n <dl class=\"about-grid\">\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Birthday' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.dob\">{{ (user_profile?.dob | dateFormat) || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.LivesIn' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.country\">{{ user_profile?.country || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Gender' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.gender\">\n {{\n user_profile?.gender === 'M'\n ? ('User.Profile.About.Male' | transloco)\n : user_profile?.gender === 'F'\n ? ('User.Profile.About.Female' | transloco)\n : '—'\n }}\n </dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Email' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user?.email\">\n @if (user?.email) {\n <a class=\"about-field__link\" [href]=\"'mailto:' + user.email\">{{ user.email }}</a>\n } @else {\n —\n }\n </dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.PhoneNumber' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.phone_number\">{{ user_profile?.phone_number || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Website' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.website_url\">\n @if (user_profile?.website_url) {\n <a class=\"about-field__link\" target=\"_blank\" rel=\"noopener noreferrer\" [href]=\"user_profile.website_url\">{{ user_profile.website_url }}</a>\n } @else {\n —\n }\n </dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Joined' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user?.joined_at\">{{ (user?.joined_at | dateFormat) || '—' }}</dd>\n </div>\n </dl>\n @if (user && isEdit) {\n <pw-edit-user-profile-modal [user]=\"user\" (saveEvent)=\"onProfileSaved($event)\" [slug]=\"user?.slug\"></pw-edit-user-profile-modal>\n }\n </section>\n\n <!-- Skills -->\n <section class=\"about-section\" data-cy=\"skills-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-bolt\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.Skills' | transloco }}</h2>\n @if (isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"openSkills()\" [attr.aria-label]=\"'User.Profile.About.EditSkills' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n @if (selectedSkills?.length) {\n <div class=\"about-skills\">\n @for (skill of selectedSkills; track skill) {\n <div class=\"about-skills__group\">\n <span class=\"about-skills__category\">{{ skill.category_name }}</span>\n <div class=\"about-tags\">\n @for (item of skill.tags; track item) {\n <span class=\"about-tag\">{{ item.name }}</span>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <p class=\"about-empty\">{{ (isEdit ? 'User.Profile.About.NoSkillsEdit' : 'User.Profile.About.NoSkills') | transloco }}</p>\n }\n @if (isEdit) {\n <pw-edit-skills-modal [userId]=\"user?.id\" [slug]=\"user?.slug\" (saveEvent)=\"getUserDetails()\"></pw-edit-skills-modal>\n }\n </section>\n\n <!-- Educational Information -->\n <section class=\"about-section\" data-cy=\"educational-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-graduation-cap\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.Education' | transloco }}</h2>\n @if (isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"qualificationModal.onOpen()\" [attr.aria-label]=\"'User.Profile.About.AddEducation' | transloco\">\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n @if (qualifications?.length) {\n <div class=\"about-edu\">\n @for (item of qualifications; track trackByQualification($index, item)) {\n <article class=\"about-edu__item\">\n <div class=\"about-edu__main\">\n <h4 class=\"about-edu__school\">{{ item?.school }}</h4>\n <dl class=\"about-grid about-grid--compact\">\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Period' | transloco }}</dt>\n <dd class=\"about-field__value\">{{ item?.started_on }} – {{ item?.ended_on }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Degree' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!item?.degree\">{{ item?.degree || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Course' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!item?.course\">{{ item?.course || '—' }}</dd>\n </div>\n </dl>\n </div>\n @if (isEdit) {\n <div class=\"about-edu__actions\">\n <button type=\"button\" class=\"about-icon-btn\" [attr.aria-label]=\"'User.Profile.About.EditEducation' | transloco\" (click)=\"editQualification(item)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"about-icon-btn about-icon-btn--danger\" data-cy=\"delete-qualification\" [attr.aria-label]=\"'User.Profile.About.DeleteEducation' | transloco\" (click)=\"deleteQualification(item)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n </article>\n }\n </div>\n } @else {\n <p class=\"about-empty\">{{ 'User.Profile.About.NoEducation' | transloco }}</p>\n }\n @if (isEdit) {\n <pw-edit-qualifications-modal (saveEvent)=\"getUserDetails()\"></pw-edit-qualifications-modal>\n }\n </section>\n\n <!-- External Portfolio -->\n <section class=\"about-section\" data-cy=\"portfolio-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-link\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.Portfolio' | transloco }}</h2>\n @if (isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"onOpenSocial()\" [attr.aria-label]=\"'User.Profile.About.EditPortfolio' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n @if (noUserLinks) {\n <div class=\"about-social\">\n @for (link of objectKeys(userLinks); track link) {\n @if (userLinks[link]) {\n <a class=\"about-social__link\" target=\"_blank\" rel=\"noopener noreferrer\" [href]=\"userLinks[link]\" [attr.aria-label]=\"link\">\n <img src=\"assets/img/icons/social/{{ link }}.svg\" width=\"32\" height=\"32\" [alt]=\"link\" />\n </a>\n }\n }\n </div>\n } @else {\n <p class=\"about-empty\">{{ 'User.Profile.About.NoPortfolio' | transloco }}</p>\n }\n @if (user && isEdit) {\n <pw-edit-social-links [userId]=\"user.id\" [links]=\"userLinks\" (saveEvent)=\"onSaveUserLinks()\"></pw-edit-social-links>\n }\n </section>\n\n @if (loading) {\n <div class=\"w-100 text-center p-3\"><p-progress-spinner strokeWidth=\"2\"></p-progress-spinner></div>\n }\n</div>\n","import { ChangeDetectorRef, Component, inject, Input, OnInit } from '@angular/core';\n\nimport { ProfileService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\n@Component({\n selector: 'pw-portfolios',\n templateUrl: './user-portfolios.component.html',\n styleUrls: ['./user-portfolios.component.scss'],\n imports: [Bind, ProgressSpinner, NoDataComponent, LazyImgDirective, TranslocoPipe]\n})\nexport class PortfoliosComponent implements OnInit {\n private readonly service = inject(ProfileService);\n private readonly modalService = inject(NgbModal);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() user: User;\n @Input() isEdit = false;\n\n projectPictures = [];\n\n selectedPicURL: string;\n\n isLoaded = false;\n\n ngOnInit() {\n this.getProjectPictures();\n }\n\n private getProjectPictures() {\n this.service.getProjectPictures(this.user.slug).subscribe(({ result }) => {\n if (result.length > 0) {\n this.projectPictures = result.flatMap(x => x.project_pictures);\n }\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n deletePicture(id) {\n HelperService.raiseDeletePopup().then(resp => {\n if (resp.value) {\n this.service.deletePicture(id).subscribe(_ => {\n this.getProjectPictures();\n this.cdr.markForCheck();\n });\n }\n });\n }\n\n trackByImage(_index: number, item: { id: number }) {\n return item.id;\n }\n\n showFullImage(picture, content, evt) {\n if ($(evt.target).attr('id') !== 'delete-icon') {\n this.selectedPicURL = picture.picture.url;\n this.modalService.open(content, {\n centered: true,\n size: 'lg',\n windowClass: 'img-popup'\n });\n }\n }\n}\n","<div class=\"row\">\n <div class=\"col-sm-12 mt-2\">\n <h2>{{ 'User.Profile.Portfolio.Title' | transloco }}</h2>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (projectPictures.length === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"No portfolio listed yet - please consider adding some.\"\n ></pw-no-data>\n }\n <div class=\"card-body\">\n @if (projectPictures.length) {\n <div class=\"card-block\"\n >\n <div class=\"grid-hover\">\n <div class=\"row\">\n @for (picture of projectPictures; track trackByImage($index, picture)) {\n <div class=\"col-md-4 col-12 mb-2\"\n >\n <figure class=\"effect-marley\"\n (keydown.enter)=\"showFullImage(picture, content, $event)\"\n (click)=\"showFullImage(picture, content, $event)\">\n <img [src]=\"picture.picture.url\"\n [alt]=\"'User.Profile.Portfolio.PictureAlt' | transloco\" />\n <figcaption>\n <h2>\n <span class=\"portfolio-header-text\">{{ picture.project_title }}</span>\n </h2>\n @if (isEdit) {\n <i\n class=\"fal fa-2x fa-times white\"\n id=\"delete-icon\"\n (click)=\"deletePicture(picture.id)\"\n (keydown.enter)=\"deletePicture(picture.id)\"\n aria-hidden=\"true\"\n ></i>\n }\n <p class=\"thumb-description\">\n {{ picture?.project_description }}\n </p>\n </figcaption>\n </figure>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n<ng-template #content\n let-modal>\n <div class=\"modal-img-popup\">\n <img [alt]=\"'User.Profile.Portfolio.PictureAlt' | transloco\"\n [src]=\"selectedPicURL\"\n class=\"img-fluid\" />\n <button type=\"button\"\n class=\"close close-img\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss('Cross click')\">\n <span class=\"btn\">&times;</span>\n </button>\n </div>\n</ng-template>\n","import { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { dataUrlToBlob } from '../account/account-details/account-details.utils';\nimport { slugPngFile } from '../account/subscriptions/user-subscription-details/subscription-details.utils';\n\n/** Avatar display and upload of the public user profile page (undecorated base). */\nexport abstract class UserProfileAvatar extends AppBaseComponent {\n private readonly modalService = inject(NgbModal);\n protected readonly cdr = inject(ChangeDetectorRef);\n\n slug: string;\n\n image = 'assets/img/icons/male.png';\n\n abstract get allowEdit(): boolean;\n\n handleImageError(event: Event, fallbackPath): void {\n HelperService.handleImageFallbackPath(event, fallbackPath);\n }\n\n openModal(content) {\n if (this.allowEdit) {\n this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });\n }\n }\n\n onImageSelection(event) {\n const file = slugPngFile(this.slug, dataUrlToBlob(event));\n this.userService.addAvatar(file).subscribe(res => {\n this.modalService.dismissAll();\n this.image = res?.result?.user_avatar[2]?.url;\n this.cdr.markForCheck();\n });\n }\n\n onClose() {\n this.modalService.dismissAll();\n }\n}\n","/** Waits up to 10 s for jQuery (the timeline script needs it), then loads it from a CDN. */\nexport function waitForJQuery(callback: () => void): void {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait time\n\n const checkJQuery = () => {\n if (window['jQuery']) {\n callback();\n } else if (attempts < maxAttempts) {\n attempts++;\n setTimeout(checkJQuery, 100);\n } else {\n // Load jQuery since it's needed\n loadJQueryForUserProfile(callback);\n }\n };\n checkJQuery();\n}\n\nfunction loadJQueryForUserProfile(callback: () => void): void {\n const jquerySrc = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n const script = document.createElement('script');\n script.src = jquerySrc;\n script.crossOrigin = 'anonymous';\n script.async = false;\n script.onload = () => {\n callback();\n };\n script.onerror = () => {\n console.error('Failed to load jQuery for user profile');\n // Try fallback\n const fallbackScript = document.createElement('script');\n fallbackScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n fallbackScript.crossOrigin = 'anonymous';\n fallbackScript.async = false;\n fallbackScript.onload = () => {\n callback();\n };\n fallbackScript.onerror = () => {\n console.error('All jQuery CDNs failed for user profile');\n };\n document.head.appendChild(fallbackScript);\n };\n document.head.appendChild(script);\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, Input, OnInit, ViewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProfileService } from '@posiwise/common-services';\nimport { Project, User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { ConfirmDialogService, NoDataComponent } from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Rating } from 'primeng/rating';\nimport { Tooltip } from 'primeng/tooltip';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { EditPortfoliosComponent } from '../edit-portfolios/edit-portfolios.component';\nimport { EditProjectModalComponent } from '../edit-project-modal/edit-project-modal.component';\nimport { EditRecommendationModalComponent } from '../edit-recommendation-modal/edit-recommendation-modal.component';\nimport { EditSkillsModalComponent } from '../edit-skills-modal/edit-skills-modal.component';\n\n@Component({\n selector: 'pw-user-projects',\n templateUrl: './user-projects.component.html',\n styleUrls: ['./user-projects.component.scss'],\n imports: [\n Bind,\n ProgressSpinner,\n NgClass,\n Tooltip,\n LazyImgDirective,\n Rating,\n FormsModule,\n EditSkillsModalComponent,\n EditPortfoliosComponent,\n NoDataComponent,\n EditProjectModalComponent,\n EditRecommendationModalComponent,\n TranslocoPipe\n ]\n})\nexport class UserProjectsComponent extends AppBaseComponent implements OnInit {\n private readonly service = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n @Input() user: User;\n @Input() isEdit = false;\n @Input() slug: string;\n\n @ViewChild(EditProjectModalComponent, { static: true })\n projectModal: EditProjectModalComponent;\n\n @ViewChild(EditSkillsModalComponent, { static: false })\n skillModal: EditSkillsModalComponent;\n\n @ViewChild(EditRecommendationModalComponent, { static: true })\n recommendationModal: EditRecommendationModalComponent;\n\n @ViewChild(EditPortfoliosComponent, { static: false })\n portfolios: EditPortfoliosComponent;\n\n projects: Project[] = [];\n\n submitted: boolean;\n\n isLoaded = false;\n\n ngOnInit() {\n this.getProjects();\n }\n\n onEditProject(item) {\n this.projectModal.onOpen(item);\n }\n\n editRecommendation(item) {\n this.recommendationModal.onOpen(item);\n }\n\n openSkills(project) {\n this.skillModal.slug = project.slug;\n this.skillModal.open();\n }\n\n getProjects() {\n const profileSlug = this.user?.slug || this.slug;\n this.service.getProjects(profileSlug).subscribe(({ result }) => {\n this.projects = result.projects;\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n onSkillsSave() {\n this.getProjects();\n }\n\n onSaveProject(_event) {\n this.getProjects();\n }\n\n openPortfolios(id: number) {\n this.portfolios.openModal(id);\n this.portfolios.getProjectPictures();\n }\n\n onDeleteProject(project) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: `Are you sure you want to delete ${project.title}?`,\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.service.deleteProject(project.id).subscribe(() => {\n this.projects = this.projects.filter((x: Project) => x.id !== project.id);\n this.cdr.markForCheck();\n });\n });\n }\n\n trackByProject(_index: number, item: Project) {\n return item.id;\n }\n\n deletePicture(project) {\n this.service.deletePicture(project.project_pictures[0].id).subscribe(_ => {\n this.getProjects();\n this.cdr.markForCheck();\n });\n }\n}\n","<div class=\"row\">\n <div class=\"col-sm-12 mt-2\">\n <h2>{{ 'User.Profile.Projects.Title' | transloco }}</h2>\n @if (isEdit) {\n <div class=\"row\"\n >\n <div class=\"col-12\">\n <div class=\"content-header\">\n <button class=\"btn btn-primary float-end\"\n (click)=\"onEditProject(null)\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> {{'Create Project' | transloco}}\n </button>\n </div>\n </div>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (projects?.length) {\n <div id=\"timeline\"\n class=\"timeline-center timeline-wrapper\"\n >\n <ul class=\"timeline\">\n <li class=\"timeline-line\"></li>\n </ul>\n <ul class=\"timeline\">\n <li class=\"timeline-line\"></li>\n @for (\n project of projects; track trackByProject(i,\n project); let i = $index; let odd = $odd; let even = $even) {\n <li class=\"timeline-item\"\n [ngClass]=\"{ 'mt-5': odd }\"\n >\n <div class=\"timeline-badge\">\n <span class=\"bg-red bg-lighten-1\"\n [pTooltip]=\"'User.Profile.Projects.PortfolioWork' | transloco\"\n tooltipPosition=\"right\"\n appendTo=\"body\">\n <span class=\"timeline-year\"> {{ project.start_year }} </span>\n </span>\n </div>\n <div class=\"timeline-card card pb-0\">\n <div class=\"card-header\">\n <h4 class=\"mb-0 card-title\">\n <a>{{ project.title }}</a>\n </h4>\n <div class=\"card-subtitle text-muted mt-0\">\n <span class=\"font-small-3\">\n {{ project.start_year }} - {{ project.end_year }}</span>\n </div>\n </div>\n <div class=\"card-body project-card\">\n @if (project.project_pictures?.length) {\n <i\n class=\"fal fa-times\"\n (click)=\"deletePicture(project)\"\n (keydown.enter)=\"deletePicture(project)\"\n aria-hidden=\"true\"\n ></i>\n <img class=\"img-fluid project-picture\"\n [src]=\"project.project_pictures[0].picture.url\"\n [alt]=\"'User.Profile.Projects.CoverAlt' | transloco\" />\n }\n <div class=\"card-body\">\n <div class=\"\">\n <p class=\"card-text\">{{ project.description }}</p>\n <div class=\"list-inline mb-1\">\n <!-- Skills -->\n @if (project.tags?.length) {\n <div>\n <div class=\"my-2\">\n <i class=\"fa fa-user-tag\" aria-hidden=\"true\"></i>\n {{ 'User.Profile.About.Skills' | transloco }}\n </div>\n @for (tag of project.tags; track tag) {\n <span class=\"badge bg-success me-2\">{{\n tag.name\n }}</span>\n }\n </div>\n }\n @if (project.project_recommendations?.length) {\n <div class=\"mt-2\"\n >\n <div class=\"my-2\">\n <i\n class=\"fa fa-clipboard-check me-2\"\n aria-hidden=\"true\"\n ></i>\n {{ 'User.Profile.Projects.Recommendations' | transloco }}\n </div>\n @for (\n recommendation of project.project_recommendations\n ; track\n recommendation) {\n <section class=\"mb-2\"\n >\n <div class=\"me-2\">\n {{ 'User.Profile.Projects.Client' | transloco: { name: recommendation?.client_name } }}\n </div>\n <div class=\"me-2\">\n {{ 'User.Profile.Projects.Message' | transloco: { message: recommendation?.description } }}\n </div>\n <div class=\"row recommendation\">\n <div class=\"col-4\">\n <span>{{ 'User.Profile.Recommendations.Field.Communication' | transloco }}</span>\n <p-rating [(ngModel)]=\"\n recommendation.communication\n \"\n [cancel]=\"false\"\n [readonly]=\"true\">\n </p-rating>\n </div>\n <div class=\"col-4\">\n <span>{{ 'User.Profile.Recommendations.Field.Quality' | transloco }}</span>\n <p-rating [(ngModel)]=\"recommendation.quality\"\n [cancel]=\"false\"\n [readonly]=\"true\">\n </p-rating>\n </div>\n <div class=\"col-4\">\n <span>{{ 'User.Profile.Recommendations.Field.Time' | transloco }}</span>\n <p-rating [(ngModel)]=\"recommendation.time\"\n [cancel]=\"false\"\n [readonly]=\"true\">\n </p-rating>\n </div>\n </div>\n </section>\n }\n </div>\n }\n @if (isEdit) {\n <div class=\"text-end mt-3 d-flex justify-content-end project-actions\"\n >\n <!-- Project Edit -->\n <span class=\"btn btn-link pb-0 actions\"\n (keydown.enter)=\"onEditProject(project)\"\n (click)=\"onEditProject(project)\">\n {{ 'Button.Edit' | transloco }}\n </span>\n <button class=\"btn btn-link pb-0 actions\"\n (click)=\"openSkills(project)\">\n {{ 'User.Profile.About.Skills' | transloco }}\n </button>\n <pw-edit-skills-modal [userId]=\"user?.id\"\n entityEntity=\"Project\"\n entityType=\"skills\"\n (saveEvent)=\"onSkillsSave()\"\n [slug]=\"project?.slug\">\n </pw-edit-skills-modal>\n <!-- Portfolios -->\n <button class=\"btn btn-link pb-0 actions\"\n (click)=\"openPortfolios(project.id)\">\n {{ 'User.Profile.Projects.Photos' | transloco }}\n </button>\n <pw-edit-portfolios [slug]=\"user?.slug\"\n [id]=\"project.id\"\n (successEvent)=\"getProjects()\">\n </pw-edit-portfolios>\n <span class=\"btn btn-link pb-0 delete-project actions\"\n (keydown.enter)=\"onDeleteProject(project)\"\n (click)=\"onDeleteProject(project)\">\n {{ 'Button.Delete' | transloco }}\n </span>\n </div>\n }\n <!-- Recommendation -->\n @if (!isEdit) {\n <span class=\"pe-1 mt-3\"\n (click)=\"editRecommendation(project)\"\n (keydown.enter)=\"editRecommendation(project)\"\n >\n <a class=\"primary\"><span class=\"fa fa-commenting-o\"></span> {{ 'User.Profile.Projects.Endorse' | transloco }}\n </a></span>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n </li>\n }\n </ul>\n </div>\n }\n @if (projects?.length === 0 && isLoaded) {\n<pw-no-data [withImage]=\"true\" [message]=\"\n isEdit\n ? ('User.Profile.Projects.NoProjects' | transloco)\n : ('User.Profile.Projects.NoUserProjects' | transloco)\n \"\n >\n </pw-no-data>\n }\n </div>\n</div>\n<pw-edit-project-modal (saveEvent)=\"onSaveProject($event)\"></pw-edit-project-modal>\n<pw-edit-recommendation-modal [user]=\"user\"></pw-edit-recommendation-modal>\n","import { Component, inject, OnInit } from '@angular/core';\n\nimport { ProfileService, ScriptLoaderService, UserProfileDetails } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { ProfileImageCropperComponent } from '@posiwise/utils';\n\nimport { StatusCodes } from 'http-status-codes';\nimport { MenuItem } from 'primeng/api';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Ripple } from 'primeng/ripple';\nimport { Tab, TabList, Tabs } from 'primeng/tabs';\nimport { forkJoin } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { UserAboutComponent } from './user-about/user-about.component';\nimport { PortfoliosComponent } from './user-portfolios/user-portfolios.component';\nimport { UserProfileAvatar } from './user-profile-avatar';\nimport { waitForJQuery } from './user-profile-jquery';\nimport { UserProjectsComponent } from './user-projects/user-projects.component';\n\n@Component({\n selector: 'pw-user-profile-page',\n templateUrl: './user-profile-page.component.html',\n styleUrls: ['./user-profile-page.component.scss'],\n imports: [\n LazyImgDirective,\n Bind,\n Tabs,\n TabList,\n Ripple,\n Tab,\n ProgressSpinner,\n UserAboutComponent,\n UserProjectsComponent,\n PortfoliosComponent,\n ProfileImageCropperComponent,\n TranslocoPipe\n ]\n})\nexport class UserProfilePageComponent extends UserProfileAvatar implements OnInit {\n private readonly profileService = inject(ProfileService);\n private readonly scriptLoader = inject(ScriptLoaderService);\n\n private loggedInUserDetails: User;\n\n user: User;\n\n objectKeys = Object.keys;\n\n isFollowing: boolean;\n\n isLoaded = false;\n\n userProfile: UserProfileDetails | null;\n\n items: MenuItem[];\n activeItem: MenuItem;\n /** Current tab value for p-tabs */\n activeTabValue: string;\n\n onTabChange(value: string) {\n const item = this.items.find(i => i.id === value);\n if (item) {\n this.activeItem = item;\n }\n }\n\n constructor() {\n super();\n this.route.params.subscribe(data => {\n this.slug = data['user-slug'];\n this.cdr.markForCheck();\n });\n\n this.items = [\n { id: 'about', label: 'About', labelKey: 'User.Tabs.About', icon: 'fa fa-fw fa-user' },\n {\n id: 'projects',\n label: 'Projects',\n labelKey: 'User.Tabs.Projects',\n icon: 'fa fa-fw fa-briefcase',\n state: {\n permission: this.permissionService.evaluatePermissions('Pages.Product.CRM')\n }\n },\n {\n id: 'portfolio',\n label: 'Portfolio',\n labelKey: 'User.Tabs.Portfolio',\n icon: 'fa fa-fw fa-image',\n state: {\n permission: this.permissionService.evaluatePermissions('Pages.Product.CRM')\n }\n }\n ];\n [this.activeItem] = this.items;\n this.activeTabValue = this.activeItem?.id as string;\n }\n\n get allowEdit() {\n return (\n this.loggedInUserDetails?.slug === this.slug || this.permissionService.isSuperAdmin()\n );\n }\n\n ngOnInit() {\n this.getUserBySlug();\n // Horizontal Timeline js for user timeline\n waitForJQuery(() => {\n this.scriptLoader.loadScriptOnce('head', '/assets/js/vertical-timeline.js');\n });\n }\n\n getUserBySlug() {\n forkJoin({\n user: this.profileService.getUserObject('user', this.slug),\n user_profile: this.profileService.getUserObject('user_profile', this.slug),\n avatar: this.profileService.getUserObject('avatar', this.slug)\n }).subscribe({\n next: response => {\n this.user = response.user.result;\n this.userProfile = response.user_profile.result;\n if (response.avatar.result?.length > 0) {\n this.image = response.avatar.result[2]?.url;\n }\n this.getCurrentUserDetails();\n this.isLoaded = true;\n this.cdr.markForCheck();\n },\n error: error => {\n if (error.status === StatusCodes.NOT_FOUND) {\n this.router.navigate(['NotFound']);\n }\n this.cdr.markForCheck();\n }\n });\n }\n\n private getCurrentUserDetails() {\n this.userStore().subscribe((currentUser: User) => {\n if (currentUser) {\n this.loggedInUserDetails = currentUser;\n\n this.userService\n .getCurrentUserObject('user_relationships')\n .subscribe(({ result }) => {\n this.isFollowing =\n result.length > 0\n ? result.some(\n x =>\n x.followed_id === this.user.id &&\n currentUser.id === x.follower_id\n )\n : false;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n sendMessageSlug() {\n this.router.navigate(['/message'], { fragment: this.slug });\n }\n\n followUser() {\n this.userService.followUser(this.user.id).subscribe(({ result }) => {\n const name = this.user.first_name || this.user.slug;\n if (result?.id) {\n this.isFollowing = true;\n this.toast.success(`You're now following ${name}`);\n } else {\n this.isFollowing = false;\n this.toast.success(`You've unfollowed ${name}`);\n }\n this.cdr.markForCheck();\n });\n }\n}\n","<!-- User Profile Starts -->\n<!-- Basic User Details Starts -->\n@if (user) {\n <section id=\"user-profile\"\n >\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"dashboard\">\n <div class=\"media row py-3 align-items-center\">\n <div class=\"col-3 col-sm-2\">\n <div class=\"align-self-center halfway-fab text-center\">\n <!-- User Avatar -->\n <a class=\"profile-image\">\n <img [src]=\"image\"\n width=\"100\"\n height=\"100\"\n class=\"rounded-circle img-border width-100\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\" />\n @if (allowEdit) {\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\"\n >\n <div class=\"overlay-text\">\n <!-- Change Profile Pic -->\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n </div>\n </div>\n }\n </a>\n </div>\n </div>\n <div class=\"col-9 col-sm-5\">\n <div class=\"align-self-start halfway-fab ps-3 pt-2\">\n <div>\n @if (user?.last_name) {\n <strong class=\"font-medium-2 text-uppercase\"\n >\n {{\n user?.first_name\n ? user?.first_name + ' ' + user?.last_name\n : 'Update Profile'\n }}\n </strong>\n }\n @if (!user?.last_name) {\n <strong class=\"font-medium-2 text-uppercase\"\n >\n {{ user?.first_name ? user?.first_name : 'Update Profile' }}\n </strong>\n }\n <p class=\"font-small-4\">{{ userProfile?.headline }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-sm-5\">\n @if (!allowEdit) {\n <div class=\"profile-cover-buttons\"\n >\n <div class=\"d-flex halfway-fab align-self-end\">\n <div class=\"text-end d-none d-sm-none d-md-none d-lg-block\">\n <button type=\"button\"\n (click)=\"followUser()\"\n class=\"btn btn-outline-primary btn-raised me-2\">\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\n {{ isFollowing ? 'Following' : 'Follow' }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary btn-raised me-3\"\n (click)=\"sendMessageSlug()\">\n <i class=\"fa fa-mail-bulk\" aria-hidden=\"true\"></i> {{ 'User.Profile.SendMessage' | transloco }}\n </button>\n </div>\n <div class=\"text-end d-block d-sm-block d-md-block d-lg-none\">\n <button type=\"button\"\n class=\"btn btn-primary btn-raised me-2\">\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"btn btn-primary btn-raised me-3\">\n <i class=\"fa fa-mail-bulk\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n}\n<!-- Basic User Details Ends -->\n<section>\n <div class=\"container-fluid pw-tab overflow-hidden\">\n <p-tabs [value]=\"activeTabValue\" (valueChange)=\"onTabChange($event)\">\n <p-tablist>\n @for (item of items; track item) {\n <p-tab [value]=\"item.id\">\n @if (item.icon) {\n <i [class]=\"item.icon\" aria-hidden=\"true\"></i>\n }\n <span>{{ item['labelKey'] | transloco }}</span>\n </p-tab>\n }\n </p-tablist>\n </p-tabs>\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (user && activeItem.id === 'about') {\n <pw-user-about [user]=\"user\"\n [isEdit]=\"allowEdit\"\n (saveEvent)=\"getUserBySlug()\">\n </pw-user-about>\n }\n @if (activeItem.id === 'projects') {\n <pw-user-projects [user]=\"user\"\n [slug]=\"slug\"\n [isEdit]=\"allowEdit\"></pw-user-projects>\n }\n @if (activeItem.id === 'portfolio') {\n <pw-portfolios [user]=\"user\"\n [isEdit]=\"allowEdit\"></pw-portfolios>\n }\n </div>\n </div>\n </div>\n</section>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n [userAvatar]=\"image\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\nimport { NgxGpAutocompleteModule } from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { AppLoaderModule } from '@posiwise/app-loader';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\nimport { DirectivesModule } from '@posiwise/directives';\nimport { PipesModule } from '@posiwise/pipes';\nimport { PwStickyActionsComponent, SharedComponentsModule } from '@posiwise/shared-components';\n\nimport { NgxCaptchaModule } from 'ngx-captcha';\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { AccordionModule } from 'primeng/accordion';\nimport { DatePickerModule } from 'primeng/datepicker';\nimport { FileUploadModule } from 'primeng/fileupload';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MultiSelectModule } from 'primeng/multiselect';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\nimport { RatingModule } from 'primeng/rating';\nimport { SelectModule } from 'primeng/select';\nimport { SelectButtonModule } from 'primeng/selectbutton';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { Loader } from '@googlemaps/js-api-loader';\nimport { NgbDatepickerModule, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';\n\nimport { AccountComponent } from './account/account.component';\nimport { AccountDetailsComponent } from './account/account-details/account-details.component';\nimport { AddSubscriptionComponent } from './account/subscriptions/add-subscription/add-subscription.component';\nimport { SavedCardDetailsComponent } from './account/subscriptions/saved-card-details/saved-card-details.component';\nimport { ClearMaskedOnFocusDirective } from './account/subscriptions/subscription-credential/clear-masked-on-focus.directive';\nimport {\n CredentialAvatarHuePipe,\n HumanizeCredentialNamePipe,\n SubscriptionNameByIdPipe\n} from './account/subscriptions/subscription-credential/humanize-credential-name.pipe';\nimport { SubscriptionCredentialComponent } from './account/subscriptions/subscription-credential/subscription-credential.component';\nimport { SubscriptionRemovalComponent } from './account/subscriptions/subscription-removal/subscription-removal.component';\nimport { SecondaryPaymentMethodComponent } from './account/subscriptions/update-payment-details/secondary-payment-method.component';\nimport { UpdatePaymentDetailsComponent } from './account/subscriptions/update-payment-details/update-payment-details.component';\nimport { UpgradeSubscriptionComponent } from './account/subscriptions/upgrade-subscription/upgrade-subscription.component';\nimport { UserSubscriptionDetailsComponent } from './account/subscriptions/user-subscription-details/user-subscription-details.component';\nimport { UserSubscriptionListComponent } from './account/subscriptions/user-subscriptions-list/user-subscriptions-list.component';\nimport { UserInvoiceComponent } from './account/user-invoice/user-invoice.component';\nimport { AiKnowledgeTabComponent } from './settings-tabs/ai-knowledge-tab/ai-knowledge-tab.component';\nimport { CommunicationTabComponent } from './settings-tabs/communication-tab/communication-tab.component';\nimport { OthersTabComponent } from './settings-tabs/others-tab/others-tab.component';\nimport { SecurityTabComponent } from './settings-tabs/security-tab/security-tab.component';\nimport { SettingsComponent } from './settings-tabs/settings-tabs.component';\nimport { SupportComponent } from './support/support.component';\nimport { SupportDetailsComponent } from './support/support-details/support-details.component';\nimport { EditPortfoliosComponent } from './user-profile/edit-portfolios/edit-portfolios.component';\nimport { EditProjectModalComponent } from './user-profile/edit-project-modal/edit-project-modal.component';\nimport { EditQualificationsModalComponent } from './user-profile/edit-qualifications-modal/edit-qualifications-modal.component';\nimport { EditRecommendationModalComponent } from './user-profile/edit-recommendation-modal/edit-recommendation-modal.component';\nimport { EditSkillsModalComponent } from './user-profile/edit-skills-modal/edit-skills-modal.component';\nimport { EditSocialLinksComponent } from './user-profile/edit-social-links/edit-social-links.component';\nimport { EditUserProfileModalComponent } from './user-profile/edit-user-profile-modal/edit-user-profile-modal.component';\nimport { UserAboutComponent } from './user-profile/user-about/user-about.component';\nimport { PortfoliosComponent } from './user-profile/user-portfolios/user-portfolios.component';\nimport { UserProfilePageComponent } from './user-profile/user-profile-page.component';\nimport { UserProjectsComponent } from './user-profile/user-projects/user-projects.component';\n\nconst primeNgModules = [\n DatePickerModule,\n MultiSelectModule,\n ProgressSpinnerModule,\n AccordionModule,\n FileUploadModule,\n SelectModule,\n RatingModule,\n SelectButtonModule,\n TooltipModule\n];\n\nconst ngbModule = [NgbModalModule, NgbDatepickerModule];\n\n@NgModule({\n imports: [\n PwStickyActionsComponent,\n InputTextModule,\n AppLoaderModule,\n DirectivesModule,\n CommonModule,\n RouterModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n CoreTranslocoModule,\n NgxGpAutocompleteModule,\n SharedComponentsModule,\n PipesModule,\n UiSwitchModule,\n NgxCaptchaModule,\n FormsModule,\n ...primeNgModules,\n ...ngbModule,\n AccountComponent,\n AccountDetailsComponent,\n AddSubscriptionComponent,\n SavedCardDetailsComponent,\n SubscriptionCredentialComponent,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n SubscriptionNameByIdPipe,\n ClearMaskedOnFocusDirective,\n UpdatePaymentDetailsComponent,\n SecondaryPaymentMethodComponent,\n UpgradeSubscriptionComponent,\n UserSubscriptionDetailsComponent,\n UserSubscriptionListComponent,\n SubscriptionRemovalComponent,\n UserInvoiceComponent,\n AiKnowledgeTabComponent,\n CommunicationTabComponent,\n OthersTabComponent,\n SecurityTabComponent,\n SettingsComponent,\n SupportComponent,\n EditPortfoliosComponent,\n EditProjectModalComponent,\n EditQualificationsModalComponent,\n EditRecommendationModalComponent,\n EditSkillsModalComponent,\n EditSocialLinksComponent,\n EditUserProfileModalComponent,\n UserAboutComponent,\n PortfoliosComponent,\n UserProfilePageComponent,\n UserProjectsComponent,\n SupportDetailsComponent\n ],\n exports: [\n AccountComponent,\n AccountDetailsComponent,\n AddSubscriptionComponent,\n SavedCardDetailsComponent,\n SubscriptionCredentialComponent,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n SubscriptionNameByIdPipe,\n ClearMaskedOnFocusDirective,\n UpdatePaymentDetailsComponent,\n UpgradeSubscriptionComponent,\n UserSubscriptionDetailsComponent,\n UserSubscriptionListComponent,\n UserInvoiceComponent,\n AiKnowledgeTabComponent,\n CommunicationTabComponent,\n OthersTabComponent,\n SecurityTabComponent,\n SettingsComponent,\n SupportComponent,\n EditPortfoliosComponent,\n EditProjectModalComponent,\n EditQualificationsModalComponent,\n EditRecommendationModalComponent,\n EditSkillsModalComponent,\n EditSocialLinksComponent,\n EditUserProfileModalComponent,\n UserAboutComponent,\n PortfoliosComponent,\n UserProfilePageComponent,\n UserProjectsComponent,\n SupportDetailsComponent\n ],\n providers: [\n {\n provide: Loader,\n useFactory: (appConfigService: AppConfigService) => {\n return new Loader({\n apiKey: appConfigService.getGoogleApiKey(),\n libraries: ['places']\n });\n },\n deps: [AppConfigService]\n }\n ]\n})\nexport class UserModuleModule {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAa,mBAAb,MAAa,iBAAgB;CAWzB,cAAA;EAViB,KAAA,SAAS,OAAO,MAAM;EAWnC,KAAK,QAAQ;GACT;IACI,IAAI;IACJ,UAAU;IACV,MAAM;IACN,YAAY,CAAC,kBAAkB;GAClC;GACD;IACI,IAAI;IACJ,UAAU;IACV,MAAM;IACN,YAAY,C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ACA;IACA;IACA;IACA;IACA;GAAuB;GAAA,SAAA;IAGvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAAuB;EAAA,CAAA;CAAA;CAelB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,WAbd,CACP;IACI,SAAS;IACT,aAAa,qBAAsC;KAC/C,OAAO,IAAI,OAAO;MACd,QAAQ,iBAAiB,gBAAe;MACxC,WAAW,CAAC,QAAQ;KACvB,CAAA;IACL;IACA,MAAM,CAAC,gBAAgB;GAC1B,CACJ;GAAA,SAAA;IAjGG;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACG;IACA;IACH;IACA;IACA;IAEA;IAKA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAAuB;EAAA,CAAA;CAAA;;AAiDlB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EArG5B,MAAA;EAAS,MAAA,CAAA;GACN,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;IACH,GAAG;IACH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,WAAW,CACP;IACI,SAAS;IACT,aAAa,qBAAsC;KAC/C,OAAO,IAAI,OAAO;MACd,QAAQ,iBAAiB,gBAAe;MACxC,WAAW,CAAC,QAAQ;KACvB,CAAA;IACL;IACA,MAAM,CAAC,gBAAgB;GAC1B,CACJ;EACJ,CAAA"}
1
+ {"version":3,"file":"posiwise-user-module.mjs","names":["i2","map","PasswordValidationComponent_1","PasswordValidationComponent_1","PasswordValidationComponent_1","i2","PasswordValidationComponent_1","PasswordValidationComponent_1","i1","i1","i2"],"sources":["../../../../libs/user-module/src/lib/account/account.component.ts","../../../../libs/user-module/src/lib/account/account.component.html","../../../../libs/user-module/src/lib/account/account-details/account-details.utils.ts","../../../../libs/user-module/src/lib/account/account-details/account-api-credentials.ts","../../../../libs/user-module/src/lib/account/account-details/account-mcp-connections.ts","../../../../libs/user-module/src/lib/account/account-details/account-security-forms.ts","../../../../libs/user-module/src/lib/account/account-details/account-avatar-slug.ts","../../../../libs/user-module/src/lib/account/credentials/credential-helpers.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/clear-masked-on-focus.directive.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/humanize-credential-name.pipe.ts","../../../../libs/user-module/src/lib/account/account-details/account-user-credentials/account-user-credentials.utils.ts","../../../../libs/user-module/src/lib/account/account-details/account-user-credentials/account-user-credentials.component.ts","../../../../libs/user-module/src/lib/account/account-details/account-user-credentials/account-user-credentials.component.html","../../../../libs/user-module/src/lib/account/account-details/account-details.component.ts","../../../../libs/user-module/src/lib/account/account-details/account-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/add-subscription/add-subscription.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/add-subscription/add-subscription.component.html","../../../../libs/user-module/src/lib/account/subscriptions/saved-card-details/saved-card-details.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/saved-card-details/saved-card-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential.utils.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential-actions.service.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-credential/subscription-credential.component.html","../../../../libs/user-module/src/lib/account/subscriptions/subscription-removal/subscription-removal.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/subscription-removal/subscription-removal.component.html","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/airwallex-element.helper.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/braintree-dropin.helper.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/secondary-payment-method.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/secondary-payment-method.component.html","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/update-payment-details.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/update-payment-details/update-payment-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/upgrade-subscription/upgrade-subscription-payment.ts","../../../../libs/user-module/src/lib/account/subscriptions/upgrade-subscription/upgrade-subscription.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/upgrade-subscription/upgrade-subscription.component.html","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-details.utils.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-api-tokens.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-logos.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/subscription-seats.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/user-subscription-details.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscription-details/user-subscription-details.component.html","../../../../libs/user-module/src/lib/account/subscriptions/user-subscriptions-list/subscription-list-actions.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscriptions-list/user-subscriptions-list.component.ts","../../../../libs/user-module/src/lib/account/subscriptions/user-subscriptions-list/user-subscriptions-list.component.html","../../../../libs/user-module/src/lib/account/user-invoice/user-invoice.component.ts","../../../../libs/user-module/src/lib/account/user-invoice/user-invoice.component.html","../../../../libs/user-module/src/lib/settings-tabs/ai-knowledge-tab/ai-knowledge-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/ai-knowledge-tab/ai-knowledge-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/communication-tab/communication-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/communication-tab/communication-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/others-tab/others-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/others-tab/others-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/security-tab/security-tab.component.ts","../../../../libs/user-module/src/lib/settings-tabs/security-tab/security-tab.component.html","../../../../libs/user-module/src/lib/settings-tabs/settings-tabs.component.ts","../../../../libs/user-module/src/lib/settings-tabs/settings-tabs.component.html","../../../../libs/user-module/src/lib/support/support.component.ts","../../../../libs/user-module/src/lib/support/support.component.html","../../../../libs/user-module/src/lib/support/support-details/support-details.component.ts","../../../../libs/user-module/src/lib/support/support-details/support-details.component.html","../../../../libs/user-module/src/lib/user-profile/edit-portfolios/edit-portfolios.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-portfolios/edit-portfolios.component.html","../../../../libs/user-module/src/lib/user-profile/edit-project-modal/edit-project-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-project-modal/edit-project-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-qualifications-modal/edit-qualifications-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-qualifications-modal/edit-qualifications-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-recommendation-modal/edit-recommendation-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-recommendation-modal/edit-recommendation-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-skills-modal/edit-skills-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-skills-modal/edit-skills-modal.component.html","../../../../libs/user-module/src/lib/user-profile/edit-social-links/edit-social-links.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-social-links/edit-social-links.component.html","../../../../libs/user-module/src/lib/user-profile/edit-user-profile-modal/edit-user-profile-modal.component.ts","../../../../libs/user-module/src/lib/user-profile/edit-user-profile-modal/edit-user-profile-modal.component.html","../../../../libs/user-module/src/lib/user-profile/user-about/user-about.component.ts","../../../../libs/user-module/src/lib/user-profile/user-about/user-about.component.html","../../../../libs/user-module/src/lib/user-profile/user-portfolios/user-portfolios.component.ts","../../../../libs/user-module/src/lib/user-profile/user-portfolios/user-portfolios.component.html","../../../../libs/user-module/src/lib/user-profile/user-profile-avatar.ts","../../../../libs/user-module/src/lib/user-profile/user-profile-jquery.ts","../../../../libs/user-module/src/lib/user-profile/user-projects/user-projects.component.ts","../../../../libs/user-module/src/lib/user-profile/user-projects/user-projects.component.html","../../../../libs/user-module/src/lib/user-profile/user-profile-page.component.ts","../../../../libs/user-module/src/lib/user-profile/user-profile-page.component.html","../../../../libs/user-module/src/lib/user-module.module.ts"],"sourcesContent":["import { Component, inject, ViewChild } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { PwTabsComponent } from '@posiwise/shared-components';\n\nimport { MenuItem } from 'primeng/api';\n\n@Component({\n selector: 'pw-user-account',\n templateUrl: './account.component.html',\n imports: [PwTabsComponent]\n})\nexport class AccountComponent {\n private readonly router = inject(Router);\n\n @ViewChild('menuItems', { static: true }) menu: MenuItem[];\n\n items: MenuItem[];\n\n activeItem: MenuItem;\n\n path: string;\n\n constructor() {\n this.items = [\n {\n id: 'account',\n labelKey: 'User.Tabs.Account',\n icon: 'fa fa-fw fa-list',\n routerLink: ['/account/details']\n },\n {\n id: 'subscription',\n labelKey: 'User.Tabs.Subscriptions',\n icon: 'fa fa-fw fa-file-invoice',\n routerLink: ['/account/subscriptions']\n },\n {\n id: 'invoice',\n labelKey: 'User.Tabs.Invoices',\n icon: 'fa fa-fw fa-tag',\n routerLink: ['/account/invoice']\n }\n ];\n this.activeItem =\n this.items[\n this.items.findIndex(\n record => record.routerLink[0] === this.router.url.split('?')[0]\n )\n ];\n }\n\n activateMenu() {\n this.activeItem = this.menu['activeItem'];\n }\n}\n","<pw-tabs [items]=\"items\"></pw-tabs>\n","import { AbstractControl } from '@angular/forms';\n\nimport { User } from '@posiwise/common-utilities';\n\nimport { getDomain } from 'tldts';\n\nimport { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';\n\n/** Environment segments that may already sit in front of the company domain. */\nconst MCP_ENV_SEGMENTS = ['dev', 'uat', 'staging', 'go'];\n\n/** Segment assumed when the host carries none — PROD is served from the apex too. */\nconst MCP_PROD_SEGMENT = 'go';\n\n/**\n * Company domain prefixed by its environment segment. Resolves the company\n * domain with the same `getDomain` the AppConfigService uses to identify the\n * tenant, so multi-label TLDs (acme.co.uk) and arbitrary subdomains both\n * reduce correctly. Only a recognised environment segment is carried over —\n * anything else (`www`, a custom subdomain) falls back to PROD rather than\n * being prefixed onto the host, which would misroute.\n */\nexport function mcpHostBase(hostname: string): string {\n const companyDomain = getDomain(hostname, { allowPrivateDomains: true });\n if (!companyDomain) {\n // Non-public hosts (localhost, bare IPs) carry no company domain.\n return hostname;\n }\n const prefix = hostname.slice(0, -companyDomain.length).split('.').filter(Boolean);\n const segment = prefix[prefix.length - 1];\n const env = MCP_ENV_SEGMENTS.includes(segment) ? segment : MCP_PROD_SEGMENT;\n return `${env}.${companyDomain}`;\n}\n\n/** `YYYY-MM-DD` date of birth as a datepicker struct; undefined when there is none. */\nexport function toDobStruct(dob: string | undefined): NgbDateStruct {\n let dobObject: NgbDateStruct;\n if (dob) {\n dobObject = {\n day: Number(dob.substring(8, 10)),\n month: Number(dob.substring(5, 7)),\n year: Number(dob.substring(0, 4))\n };\n }\n return dobObject;\n}\n\n/** Copies `user.api_keys` values onto the flat user fields the page reads, when those are unset. */\nexport function copyApiKeysToUser(user: User): void {\n if (user && user.api_keys) {\n if (user.api_keys.api_user_token && !user.api_user_token) {\n user.api_user_token = user.api_keys.api_user_token;\n }\n if (user.api_keys.api_user_id && !user.api_user_id) {\n user.api_user_id = user.api_keys.api_user_id;\n }\n if (user.api_keys.api_hits !== undefined && user.api_hits === undefined) {\n user.api_hits = user.api_keys.api_hits;\n }\n if (user.api_keys.api_hits_max !== undefined && user.api_hits_max === undefined) {\n user.api_hits_max = user.api_keys.api_hits_max;\n }\n }\n}\n\n/** Merges freshly refreshed API keys into `user.api_keys`. */\nexport function mergeRefreshedApiKeys(user: User, result: Pick<User, 'api_keys'> | null): void {\n if (result && result.api_keys) {\n if (!user.api_keys) {\n user.api_keys = {};\n }\n if (result.api_keys.api_user_token) {\n user.api_keys.api_user_token = result.api_keys.api_user_token;\n }\n if (result.api_keys.api_user_id) {\n user.api_keys.api_user_id = result.api_keys.api_user_id;\n }\n if (result.api_keys.api_hits !== undefined) {\n user.api_keys.api_hits = result.api_keys.api_hits;\n }\n if (result.api_keys.api_hits_max !== undefined) {\n user.api_keys.api_hits_max = result.api_keys.api_hits_max;\n }\n }\n}\n\nexport function passwordMatcher(ac: AbstractControl): null {\n const password = ac.get('newPassword').value;\n const confirmPassword = ac.get('confirmPassword').value;\n if (password !== confirmPassword) {\n ac.get('confirmPassword').setErrors({ MatchPassword: true });\n }\n\n return null;\n}\n\nexport function dataUrlToBlob(dataUrl: string): Blob {\n const arr = dataUrl.split(',');\n const mime = /^[A-Z]*[a-z]*:(.*?);[A-Z]*/.exec(arr[0])?.[1];\n const bStr = atob(arr[1]);\n let n = bStr.length;\n const u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bStr.charCodeAt(n);\n }\n\n return new Blob([u8arr], { type: mime });\n}\n","import { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { User } from '@posiwise/common-utilities';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\nimport { mergeRefreshedApiKeys } from './account-details.utils';\n\n/** API token and token-scope handling of the account page (undecorated base). */\nexport abstract class AccountApiCredentials extends AppBaseComponent {\n protected readonly cdr = inject(ChangeDetectorRef);\n protected readonly confirmDialog = inject(ConfirmDialogService);\n\n user: User;\n\n showApiToken = false;\n showApiClientId = false;\n refreshingTokens = false;\n updatingScope = false;\n\n protected abstract getUserProfile(): void;\n\n toggleApiTokenVisibility() {\n this.showApiToken = !this.showApiToken;\n }\n\n toggleApiClientIdVisibility() {\n this.showApiClientId = !this.showApiClientId;\n }\n\n refreshApiTokens() {\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmTitle'\n ),\n text: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshWarning'\n ),\n destructive: true,\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmLabel'\n )\n })\n .then(ok => {\n if (ok) {\n this.performTokenRefresh();\n }\n });\n }\n\n private performTokenRefresh() {\n this.refreshingTokens = true;\n this.userService\n .refreshUserApiTokens()\n .subscribe({\n next: ({ result }) => {\n mergeRefreshedApiKeys(this.user, result);\n\n this.showApiToken = false;\n this.showApiClientId = false;\n this.getUserProfile();\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.refreshingTokens = false;\n this.cdr.markForCheck();\n });\n }\n\n get currentApiTokenScope(): string {\n return this.user?.api_keys?.api_token_scope ?? 'read_only';\n }\n\n changeApiTokenScope(scope: string) {\n if (this.updatingScope || scope === this.currentApiTokenScope) {\n return;\n }\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.APICredentials.ScopeConfirmTitle'\n ),\n text: this.translation.translate(\n scope === 'read_write'\n ? 'User.Subscriptions.APICredentials.ScopeWriteWarning'\n : 'User.Subscriptions.APICredentials.ScopeReadWarning'\n ),\n destructive: scope === 'read_write',\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.APICredentials.ScopeConfirmLabel'\n )\n })\n .then(ok => {\n if (ok) {\n this.performScopeUpdate(scope);\n }\n });\n }\n\n private performScopeUpdate(scope: string) {\n this.updatingScope = true;\n this.userService\n .updateApiTokenScope(scope)\n .subscribe({\n next: () => {\n if (!this.user.api_keys) {\n this.user.api_keys = {};\n }\n this.user.api_keys.api_token_scope = scope;\n this.toast.success(\n this.translation.translate('User.Subscriptions.APICredentials.ScopeUpdated')\n );\n this.cdr.markForCheck();\n },\n error: () => {\n this.toast.error(\n this.translation.translate(\n 'User.Subscriptions.APICredentials.ScopeUpdateFailed'\n )\n );\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.updatingScope = false;\n this.cdr.markForCheck();\n });\n }\n}\n","import { API_MCP_ACCESS_FLAG } from '@posiwise/common-services';\n\nimport { AccountApiCredentials } from './account-api-credentials';\nimport { mcpHostBase } from './account-details.utils';\n\n/** MCP endpoint and registered-app connections of the account page (undecorated base). */\nexport abstract class AccountMcpConnections extends AccountApiCredentials {\n connections: {\n id: number;\n client_name: string;\n created_at: string;\n expires_at: string;\n last_used_at: string | null;\n }[] = [];\n loadingConnections = false;\n\n /** Gates both the credentials card and the registered apps card. */\n get apiMcpEnabled(): boolean {\n return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG];\n }\n\n /**\n * Tenant-dynamic MCP endpoint URL, resolved from the host the user is on.\n * The MCP host is always `brain-api-mcp.{env}.{company-domain}`, so the\n * environment segment has to survive the swap:\n * www.dev.posiwise.com -> brain-api-mcp.dev.posiwise.com\n * www.go.posiwise.com -> brain-api-mcp.go.posiwise.com\n * www.posiwise.com -> brain-api-mcp.go.posiwise.com (apex = PROD)\n * Stripping the first label unconditionally (the previous behaviour) broke\n * PROD, where the app is also served from the apex: it produced\n * `brain-api-mcp.posiwise.com`, which does not exist in DNS.\n */\n get mcpEndpointUrl(): string {\n const url = `https://brain-api-mcp.${mcpHostBase(window.location.hostname)}/mcp`;\n const shard = this.user?.user_shard;\n return shard ? `${url}?user_shard=${encodeURIComponent(shard)}` : url;\n }\n\n /** Tenant company name (domain-metadata driven), falling back to PosiWise. */\n get mcpCompanyName(): string {\n return this.appConfig?.company?.name || 'PosiWise';\n }\n\n loadConnections() {\n this.loadingConnections = true;\n this.userService\n .getMcpConnections()\n .subscribe({\n next: response => {\n this.connections = response?.result ?? [];\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.loadingConnections = false;\n this.cdr.markForCheck();\n });\n }\n\n deregisterConnection(id: number) {\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterConfirmTitle'\n ),\n text: this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterConfirmText'\n ),\n destructive: true,\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterConfirmButton'\n )\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n\n this.userService.deleteMcpConnection(id).subscribe({\n next: () => {\n // Success toast comes from the backend response (handled by the\n // HTTP interceptor); no client-side toast to avoid a duplicate.\n this.loadConnections();\n },\n error: () => {\n this.toast.error(\n this.translation.translate(\n 'User.Subscriptions.RegisteredApps.DeregisterFailed'\n )\n );\n }\n });\n });\n }\n}\n","import { ElementRef, inject } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\n\nimport { AuthService } from '@posiwise/common-services';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { passwordMatcher } from './account-details.utils';\nimport { AccountMcpConnections } from './account-mcp-connections';\n\n/** E-mail change and password change/reset flows of the account page (undecorated base). */\nexport abstract class AccountSecurityForms extends AccountMcpConnections {\n protected readonly fb = inject(FormBuilder);\n private readonly authService = inject(AuthService);\n\n abstract passwordRef: ElementRef;\n\n emailForm: FormGroup = this.fb.group({\n email: ['', [Validators.required, Validators.email]]\n });\n\n passwordForm: FormGroup = this.fb.group(\n {\n currentPassword: ['', [Validators.required]],\n newPassword: ['', [Validators.required, Validators.minLength(8)]],\n confirmPassword: ['', [Validators.required, Validators.minLength(8)]]\n },\n {\n validators: passwordMatcher\n }\n );\n\n validatedEmail: string;\n\n toggleEmail: boolean;\n togglePassword: boolean;\n\n passwordVerified = false;\n isCurrentPasswordValid = true;\n\n passwordBusyButton = false;\n emailBusyButton = false;\n validatePasswordBusyButton = false;\n\n /**\n * Updates Email Address\n * this needs to be separate and requires the email to be validated from email before it's actually changed\n */\n onEmailFormSubmit() {\n this.emailBusyButton = true;\n const data = this.emailForm.value;\n data.confirmation_path = 'confirm-email';\n\n if (data && this.passwordVerified) {\n this.userService\n .updateEmail(data)\n .subscribe(() => {\n this.emailForm.reset();\n this.passwordVerified = false;\n this.toast.success(\n this.translation.translate('User.Account.Message.VerificationEmailSent', {\n email: data.email\n }),\n '',\n {\n positionClass: 'toast-top-center',\n timeOut: 100000\n }\n );\n this.cdr.markForCheck();\n })\n .add(() => {\n this.emailBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n validatePassword() {\n this.validatePasswordBusyButton = true;\n const password = this.passwordRef.nativeElement.value;\n if (password) {\n this.userService\n .checkPassword({ password })\n .subscribe(data => {\n if (data?.result?.status === StatusCodes.OK) {\n this.passwordVerified = true;\n } else {\n this.toast.error(data['error'].message);\n this.passwordRef.nativeElement.value = '';\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.validatePasswordBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n checkValidity() {\n const password = this.passwordRef.nativeElement.value;\n if (password.length > 5) {\n this.isCurrentPasswordValid = false;\n } else {\n this.isCurrentPasswordValid = true;\n }\n }\n\n onPasswordFormSubmit() {\n if (this.passwordForm.valid) {\n this.passwordBusyButton = true;\n const data = {\n password: this.passwordForm.value['newPassword'],\n password_confirmation: this.passwordForm.value['confirmPassword'],\n old_password: this.passwordForm.value['currentPassword']\n };\n this.userService\n .updatePassword(data)\n .subscribe(response => {\n if (response.status_code === 200) {\n this.toast.success(response.message, '', {\n positionClass: 'toast-top-center'\n });\n this.onTogglePassword();\n } else {\n this.toast.error(response['error'].message);\n }\n this.passwordForm.reset();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.passwordBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n sendMailToResetPassword() {\n this.authService.forgotPassword(this.user.email, 'reset-password').subscribe(() => {\n this.toast.success(this.translation.translate('User.Account.Message.CheckEmail'));\n this.cdr.markForCheck();\n });\n }\n\n onToggleEmail() {\n this.emailForm.reset();\n this.passwordVerified = false;\n this.toggleEmail = false;\n }\n\n onTogglePassword() {\n this.passwordForm.reset();\n this.togglePassword = false;\n }\n\n shouldUserChangeEmail() {\n if (this.user.has_password) {\n this.toggleEmail = !this.toggleEmail;\n } else {\n this.confirmDialog.open({\n textKey: 'User.Account.Email.NoPassword',\n confirmOnly: true\n });\n }\n }\n}\n","import { inject } from '@angular/core';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { dataUrlToBlob } from './account-details.utils';\nimport { AccountSecurityForms } from './account-security-forms';\n\n/** Avatar upload and username (slug) editing of the account page (undecorated base). */\nexport abstract class AccountAvatarSlug extends AccountSecurityForms {\n protected readonly modalService = inject(NgbModal);\n\n image = 'assets/img/icons/male.png';\n\n toggleNickName: boolean;\n\n slug: string;\n\n slugBusyButton = false;\n\n openModal(content) {\n this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });\n }\n\n onUpdateSlug() {\n this.slugBusyButton = true;\n this.userService\n .updateSlug(this.slug)\n .subscribe(response => {\n this.toggleNickName = false;\n if (response?.result?.status === StatusCodes.OK) {\n this.getUserProfile();\n } else {\n this.toast.error('User.Account.UserNameError');\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.slugBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onImageSelection(event) {\n const blob = this.dataURLtoBlob(event);\n const filename = `${`${this.slug.toLocaleLowerCase()}_${Date.parse(\n new Date().toString()\n )}`}.png`;\n const file: File = new File([blob], filename);\n this.userService.addAvatar(file).subscribe(res => {\n this.image = res?.result?.user_avatar[2]?.url;\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n });\n }\n\n dataURLtoBlob(dataUrl: string) {\n return dataUrlToBlob(dataUrl);\n }\n\n onClose() {\n this.modalService.dismissAll();\n }\n}\n","import { forkJoin, Observable, of, throwError } from 'rxjs';\nimport { catchError, switchMap } from 'rxjs/operators';\n\n/** Shared by the subscription credentials page and the account page's \"My credentials\". */\n\n// Compares the label users see (\"partner_id\" → \"partner id\"), so underscores don't skew the order.\nexport function sortByLabel<T>(items: T[], label: (item: T) => string | null | undefined): T[] {\n const text = (item: T) => (label(item) ?? '').replace(/[_-]+/g, ' ').trim();\n return [...items].sort((a, b) =>\n text(a).localeCompare(text(b), undefined, { sensitivity: 'base', numeric: true })\n );\n}\n\n// An empty value keeps the stored one, and a value still starting with \"***\" is the masked copy the API\n// returned, not a new value: neither is sent.\nexport function changedCredentials<T extends { value?: unknown }>(rows: T[]): T[] {\n return rows.filter(row => row?.value && !String(row.value).startsWith('***'));\n}\n\n/** Credentials grouped by their type name, in the order the types first appear. */\nexport function credentialsByName<T extends { name: string }>(items: T[]): Map<string, T[]> {\n const groups = new Map<string, T[]>();\n for (const item of items) {\n groups.set(item.name, [...(groups.get(item.name) ?? []), item]);\n }\n return groups;\n}\n\nclass RequestFailure {\n constructor(readonly error: unknown) {}\n}\n\n/**\n * Emits every response once all requests have finished, or fails with the first error after they have.\n * forkJoin alone would cancel the rest client-side while the server still saves them, so the screen would\n * report a failure for values that were in fact stored. Emits [] when there is nothing to send.\n */\nexport function runAllThenReport(requests: Observable<unknown>[]): Observable<unknown[]> {\n if (!requests.length) {\n return of([]);\n }\n return forkJoin(\n requests.map(request => request.pipe(catchError(error => of(new RequestFailure(error)))))\n ).pipe(\n switchMap(results => {\n const failure = results.find(result => result instanceof RequestFailure);\n return failure ? throwError(() => failure.error) : of(results);\n })\n );\n}\n","import { Directive, HostListener, inject } from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\n@Directive({ selector: 'input[pwClearMaskedOnFocus]' })\nexport class ClearMaskedOnFocusDirective {\n private readonly control = inject(NgControl, { optional: true, self: true });\n\n @HostListener('focus', ['$event'])\n onFocus(event: FocusEvent): void {\n const input = event.target as HTMLInputElement;\n const value = input?.value ?? '';\n if (/\\*{3,}/.test(value)) {\n this.control?.control?.setValue('');\n input.value = '';\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nconst ACRONYMS = new Set([\n 'id',\n 'url',\n 'api',\n 'aws',\n 'smtp',\n 'ssl',\n 'tls',\n 'iam',\n 'sso',\n 'sdk',\n 'jwt',\n 'oauth'\n]);\n\n@Pipe({ name: 'subscriptionNameById' })\nexport class SubscriptionNameByIdPipe implements PipeTransform {\n transform(\n subs:\n | { id: number | string; organisation?: string; organization?: string; name?: string }[]\n | null\n | undefined,\n id: number | string | null | undefined\n ): string {\n if (!subs || id == null) return '';\n const found = subs.find(s => String(s.id) === String(id));\n return (found?.organisation || found?.organization || found?.name || '') as string;\n }\n}\n\n@Pipe({ name: 'credentialAvatarHue' })\nexport class CredentialAvatarHuePipe implements PipeTransform {\n transform(value: string | null | undefined): number {\n if (!value) return 215;\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 31 + value.charCodeAt(i)) | 0;\n }\n return Math.abs(hash) % 360;\n }\n}\n\n@Pipe({ name: 'humanizeCredentialName' })\nexport class HumanizeCredentialNamePipe implements PipeTransform {\n transform(value: string | null | undefined): string {\n if (!value) return '';\n return value\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map(word =>\n ACRONYMS.has(word.toLowerCase())\n ? word.toUpperCase()\n : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()\n )\n .join(' ');\n }\n}\n","import { FormControl, FormGroup } from '@angular/forms';\n\nimport { UserCredentialRow } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\n\nimport {\n changedCredentials,\n credentialsByName,\n sortByLabel\n} from '../../credentials/credential-helpers';\nimport { HumanizeCredentialNamePipe } from '../../subscriptions/subscription-credential/humanize-credential-name.pipe';\n\nexport type CredentialForm = FormGroup<Record<string, FormControl<string | null>>>;\n\n/** The fields of one credential type (e.g. personal_smtp), in the order the API lists them. */\nexport interface CredentialGroup {\n name: string;\n rows: UserCredentialRow[];\n configured: boolean;\n}\n\n/** A translation key with its parameters, rendered through the transloco pipe. */\nexport interface TextRef {\n key: string;\n params?: Record<string, string>;\n}\n\n/**\n * Types and fields with their own translation keys. Any other user-scoped type the API defines still\n * renders through `humanizeCredentialName` and the API's description, so a new type needs no frontend change.\n */\nconst NAME_KEYS: Record<string, string> = { personal_smtp: 'PersonalSmtp' };\nconst FIELD_KEYS: Record<string, string> = {\n address: 'Address',\n port: 'Port',\n user_name: 'UserName',\n password: 'Password',\n from_email: 'FromEmail'\n};\nconst humanize = new HumanizeCredentialNamePipe();\n\nexport function credentialGroups(rows: UserCredentialRow[]): CredentialGroup[] {\n return [...credentialsByName(rows)].map(([name, fields]) => ({\n name,\n rows: fields,\n configured: fields.some(field => field.configured)\n }));\n}\n\nexport function credentialNameKey(name: string, part: 'Title' | 'Description'): string | null {\n return NAME_KEYS[name] ? `User.Credentials.${NAME_KEYS[name]}.${part}` : null;\n}\n\n/** Dropdown options with a finished label, so the option's accessible name is the title, not the object. */\nexport function credentialTypeOptions(\n groups: CredentialGroup[],\n translate: (key: string) => string\n): { name: string; label: string }[] {\n const options = groups.map(({ name }) => {\n const key = credentialNameKey(name, 'Title');\n return { name, label: key ? translate(key) : humanize.transform(name) };\n });\n return sortByLabel(options, option => option.label);\n}\n\nexport function credentialFieldKey(field: string): string | null {\n return FIELD_KEYS[field] ? `User.Credentials.Field.${FIELD_KEYS[field]}.Label` : null;\n}\n\n/** \"Enter the …\" in sentence case (admin-edit-form.md § 4); the port, a number, has none. */\nexport function credentialPlaceholder(field: string): TextRef | null {\n if (field === 'port') {\n return null;\n }\n if (FIELD_KEYS[field]) {\n return { key: `User.Credentials.Field.${FIELD_KEYS[field]}.Placeholder` };\n }\n const noun = humanize\n .transform(field)\n .split(' ')\n .map(word => (word === word.toUpperCase() ? word : word.toLowerCase()))\n .join(' ');\n return { key: 'User.Credentials.Field.GenericPlaceholder', params: { field: noun } };\n}\n\n/** Only the fields the user typed into (shared rule: empty and still-masked values are not sent). */\nexport function enteredValues(\n rows: UserCredentialRow[],\n values: Record<string, unknown>\n): { credentialId: number; value: string }[] {\n return changedCredentials(\n rows.map(row => ({\n credentialId: row.credential_id,\n value: `${values[row.credential_id] ?? ''}`.trim()\n }))\n );\n}\n\n/**\n * One control per field, keyed by credential id, prefilled with the masked value the API returned, as on the\n * subscription credentials page: `pwClearMaskedOnFocus` empties it when clicked, and a value left masked is not sent.\n */\nexport function credentialForm(rows: UserCredentialRow[]): CredentialForm {\n return new FormGroup(\n Object.fromEntries(\n rows.map(row => [\n `${row.credential_id}`,\n new FormControl<string | null>(row.configured ? (row.value ?? '') : '')\n ])\n )\n );\n}\n\n/** A subscription in the picker: organisations repeat (one subscription per product), so its products tell them apart. */\nexport interface SubscriptionOption {\n id: number;\n organisation: string;\n products: string;\n}\n\nexport function subscriptionOptions(subscriptions: Subscription[]): SubscriptionOption[] {\n return subscriptions.map(subscription => ({\n id: subscription.id,\n organisation: subscription.organisation,\n products: (subscription.products ?? [])\n .map(product => product.name)\n .filter(Boolean)\n .join(', ')\n }));\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n inject,\n Input,\n OnInit,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\n\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { UserService } from '@posiwise/common-services';\nimport { ConfirmDialogService, InputContainerComponent } from '@posiwise/shared-components';\n\nimport { Select } from 'primeng/select';\nimport { Observable, Subscription as RxSubscription } from 'rxjs';\nimport { finalize } from 'rxjs/operators';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\n\nimport { runAllThenReport } from '../../credentials/credential-helpers';\nimport { ClearMaskedOnFocusDirective } from '../../subscriptions/subscription-credential/clear-masked-on-focus.directive';\nimport {\n CredentialAvatarHuePipe,\n HumanizeCredentialNamePipe\n} from '../../subscriptions/subscription-credential/humanize-credential-name.pipe';\n\nimport {\n credentialFieldKey,\n CredentialForm,\n credentialForm,\n CredentialGroup,\n credentialGroups,\n credentialNameKey,\n credentialPlaceholder,\n credentialTypeOptions,\n enteredValues,\n SubscriptionOption,\n subscriptionOptions\n} from './account-user-credentials.utils';\n\n/** \"My credentials\" on the account page: the user's own credentials per subscription, shown like subscription credentials. */\n@Component({\n selector: 'pw-account-user-credentials',\n templateUrl: './account-user-credentials.component.html',\n styleUrl: '../../credentials/credential-cards.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n ReactiveFormsModule,\n Select,\n InputContainerComponent,\n AppLoaderComponent,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n ClearMaskedOnFocusDirective,\n TranslocoPipe\n ]\n})\nexport class AccountUserCredentialsComponent implements OnInit {\n private readonly userService = inject(UserService);\n private readonly confirmDialog = inject(ConfirmDialogService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly transloco = inject(TranslocoService);\n private loadRequest?: RxSubscription;\n\n @Input({ required: true }) userId: number;\n\n readonly subscriptions = signal<SubscriptionOption[]>([]);\n readonly groups = signal<CredentialGroup[]>([]);\n readonly selectedName = signal<string | null>(null);\n readonly editing = signal(false);\n readonly showForm = signal(false);\n readonly form = signal<CredentialForm>(credentialForm([]));\n readonly loading = signal(true);\n readonly saving = signal(false);\n readonly subscriptionControl = new FormControl<number | null>(null);\n\n readonly saved = computed(() => this.groups().filter(group => group.configured));\n readonly addable = computed(() => this.groups().filter(group => !group.configured));\n readonly typeOptions = computed(() =>\n credentialTypeOptions(this.addable(), key => this.transloco.translate(key))\n );\n readonly selected = computed(() =>\n this.groups().find(group => group.name === this.selectedName())\n );\n\n readonly nameKey = credentialNameKey;\n readonly fieldKey = credentialFieldKey;\n readonly placeholder = credentialPlaceholder;\n\n ngOnInit() {\n this.subscriptionControl.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(id => this.loadCredentials(id));\n this.userService.getUserSubscriptions(this.userId).subscribe({\n next: ({ result }) => {\n this.subscriptions.set(subscriptionOptions(result?.subscriptions ?? []));\n const first = this.subscriptions()[0]?.id ?? null;\n if (first) {\n this.subscriptionControl.setValue(first);\n } else {\n this.loading.set(false);\n }\n },\n error: () => this.loading.set(false)\n });\n }\n\n /** No group adds a new type (picked from the dropdown); a group edits that saved credential. */\n open(group?: CredentialGroup) {\n this.editing.set(!!group);\n this.select(group?.name ?? null);\n this.showForm.set(true);\n }\n\n select(name: string | null) {\n this.selectedName.set(name);\n this.form.set(credentialForm(this.selected()?.rows ?? []));\n }\n\n cancel() {\n this.showForm.set(false);\n this.selectedName.set(null);\n }\n\n save() {\n const group = this.selected();\n const subscriptionId = this.subscriptionControl.value;\n const entries = group ? enteredValues(group.rows, this.form().getRawValue()) : [];\n if (!entries.length || !subscriptionId) {\n return;\n }\n this.run(\n runAllThenReport(\n entries.map(e =>\n this.userService.saveUserCredential(subscriptionId, e.credentialId, e.value)\n )\n )\n );\n }\n\n remove(group: CredentialGroup) {\n const subscriptionId = this.subscriptionControl.value;\n const saved = group.rows.filter(row => row.configured);\n if (!subscriptionId || !saved.length) {\n return;\n }\n this.confirmDialog\n .confirmDelete({\n titleKey: 'User.Credentials.RemoveTitle',\n textKey: 'User.Credentials.RemoveText',\n confirmLabelKey: 'User.Credentials.Remove'\n })\n .then(ok => {\n if (ok) {\n this.run(\n runAllThenReport(\n saved.map(row =>\n this.userService.deleteUserCredential(\n subscriptionId,\n row.credential_id\n )\n )\n )\n );\n }\n });\n }\n\n /** Success and error toasts come from the API response through the HTTP interceptor. */\n private run(request: Observable<unknown>) {\n this.saving.set(true);\n request.pipe(finalize(() => this.saving.set(false))).subscribe({\n next: () => {\n this.cancel();\n this.loadCredentials(this.subscriptionControl.value);\n }\n });\n }\n\n private loadCredentials(subscriptionId: number | null) {\n if (!subscriptionId) {\n return;\n }\n this.cancel();\n this.loadRequest?.unsubscribe(); // a slower reply for the previous subscription must not land after this one\n this.loading.set(true);\n this.groups.set([]); // a failed load must not leave the previous subscription's credentials on screen\n this.loadRequest = this.userService\n .getUserCredentials(subscriptionId)\n .pipe(finalize(() => this.loading.set(false)))\n .subscribe({ next: ({ result }) => this.groups.set(credentialGroups(result ?? [])) });\n }\n}\n","@if (subscriptions().length > 0) {\n <section id=\"user-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Credentials.Title' | transloco }}</h2>\n <p>{{ 'User.Credentials.Description' | transloco }}</p>\n </div>\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Subscription' | transloco\"\n name=\"credential_subscription\"\n controlId=\"user-credentials-subscription\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-subscription-label'\"\n [options]=\"subscriptions()\"\n optionLabel=\"organisation\"\n optionValue=\"id\"\n appendTo=\"body\"\n [formControl]=\"subscriptionControl\"\n placeholder=\"{{ 'User.Credentials.SelectSubscription' | transloco }}\">\n <ng-template #selectedItem let-option>\n {{ option.organisation }}\n @if (option.products) {\n <span class=\"subscription-option-products\">· {{ option.products }}</span>\n }\n </ng-template>\n <ng-template #item let-option>\n <div class=\"subscription-option\">\n <div>{{ option.organisation }}</div>\n @if (option.products) {\n <div class=\"subscription-option-products\">{{ option.products }}</div>\n }\n </div>\n </ng-template>\n </p-select>\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loading()\"></pw-loader>\n @if (!loading()) {\n @if (groups().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.NoneAvailable' | transloco }}</p>\n } @else if (showForm()) {\n <form class=\"user-credentials-form\"\n [formGroup]=\"form()\"\n (ngSubmit)=\"save()\">\n @if (editing() && selected(); as group) {\n <h3><ng-container *ngTemplateOutlet=\"titleOf; context: { $implicit: group.name }\"></ng-container></h3>\n } @else {\n <div class=\"row\">\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Type' | transloco\"\n name=\"credential_type\"\n controlId=\"user-credentials-type\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-type-label'\"\n [options]=\"typeOptions()\"\n optionLabel=\"label\"\n optionValue=\"name\"\n appendTo=\"body\"\n [placeholder]=\"'User.Credentials.SelectType' | transloco\"\n (onChange)=\"select($event.value)\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n }\n @if (selected(); as group) {\n @if (nameKey(group.name, 'Description'); as descriptionKey) {\n <p class=\"text-muted\">{{ descriptionKey | transloco }}</p>\n } @else if (group.rows[0].description) {\n <p class=\"text-muted\">{{ group.rows[0].description }}</p>\n }\n <div class=\"row\">\n @for (row of group.rows; track row.credential_id) {\n <div class=\"col-12 col-md-4\">\n @let hint = placeholder(row.field);\n <pw-input-container [label]=\"fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName)\"\n [name]=\"row.field\"\n [controlId]=\"'user-credential-' + row.credential_id\">\n <input class=\"form-control\"\n [id]=\"'user-credential-' + row.credential_id\"\n type=\"text\"\n pwClearMaskedOnFocus\n [formControlName]=\"'' + row.credential_id\"\n autocomplete=\"off\"\n [placeholder]=\"hint ? (hint.key | transloco: hint.params) : ''\"/>\n </pw-input-container>\n </div>\n }\n </div>\n }\n <div class=\"d-flex gap-2 mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n [disabled]=\"saving()\"\n (click)=\"cancel()\">\n {{ 'User.Credentials.Cancel' | transloco }}\n </button>\n @if (selected()) {\n <button type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving()\">\n {{ 'User.Credentials.Save' | transloco }}\n </button>\n }\n </div>\n </form>\n } @else {\n @if (saved().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.Empty' | transloco }}</p>\n }\n <ul class=\"credential-grid\">\n @for (group of saved(); track group.name) {\n @let title = nameKey(group.name, 'Title') ? (nameKey(group.name, 'Title')! | transloco) : (group.name | humanizeCredentialName);\n <li class=\"credential-card\">\n <header class=\"credential-card-header\" [style.--avatar-hue]=\"group.name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">{{ title.charAt(0) }}</span>\n <h3 class=\"credential-card-title\">{{ title }}</h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\"\n class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Credentials.Edit' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"open(group)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Credentials.Remove' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"remove(group)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (row of group.rows; track row.credential_id) {\n @if (row.configured) {\n <div class=\"credential-card-row\">\n <dt>{{ fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName) }}</dt>\n <dd><code class=\"credential-card-value\">{{ row.value }}</code></dd>\n </div>\n }\n }\n </dl>\n </li>\n }\n </ul>\n @if (addable().length > 0) {\n <button type=\"button\"\n class=\"btn btn-outline-primary btn-sm mt-3\"\n (click)=\"open()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Credentials.Add' | transloco }}\n </button>\n }\n }\n }\n </div>\n </div>\n </section>\n}\n<ng-template #titleOf let-name>{{ nameKey(name, 'Title') ? (nameKey(name, 'Title') | transloco) : (name | humanizeCredentialName) }}</ng-template>\n","import { AsyncPipe, DatePipe, DecimalPipe, NgClass } from '@angular/common';\nimport { Component, ElementRef, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport {\n NgxGpAutocompleteDirective,\n NgxGpAutocompleteModule\n} from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { GeoService, ProfileService, USER_CREDENTIALS_FLAG } from '@posiwise/common-services';\nimport { AppUser, Country } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { InputContainerComponent, PwStickyActionsComponent } from '@posiwise/shared-components';\nimport { ProfileImageCropperComponent, ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Select } from 'primeng/select';\nimport { Tooltip } from 'primeng/tooltip';\nimport { combineLatest, map, Observable } from 'rxjs';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { NgbInputDatepicker } from '@ng-bootstrap/ng-bootstrap';\n\nimport { AccountAvatarSlug } from './account-avatar-slug';\nimport { copyApiKeysToUser, toDobStruct } from './account-details.utils';\nimport { AccountUserCredentialsComponent } from './account-user-credentials/account-user-credentials.component';\n\n@Component({\n selector: 'pw-account-details',\n templateUrl: './account-details.component.html',\n styleUrls: ['./account-details.component.scss'],\n imports: [\n Bind,\n ProgressSpinner,\n LazyImgDirective,\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Select,\n NgbInputDatepicker,\n NgxGpAutocompleteModule,\n PwStickyActionsComponent,\n ButtonBusyDirective,\n Tooltip,\n NgClass,\n AppLoaderComponent,\n ProfileImageCropperComponent,\n AccountUserCredentialsComponent,\n AsyncPipe,\n DecimalPipe,\n DatePipe,\n TranslocoPipe\n ]\n})\nexport class AccountDetailsComponent extends AccountAvatarSlug implements OnInit, OnDestroy {\n private readonly geoService = inject(GeoService);\n private readonly profileService = inject(ProfileService);\n private readonly transloco = inject(TranslocoService);\n\n @ViewChild('ngxPlaces') placesRef: NgxGpAutocompleteDirective;\n @ViewChild('password', { static: false }) passwordRef: ElementRef;\n\n profileForm: FormGroup = AppUser.getForm(new AppUser({}));\n\n countries$: Observable<Country[]>;\n\n states: Country[] = [];\n\n selectedState;\n\n isLoaded = false;\n profileBusyButton = false;\n\n /** My credentials is Alpha only for now (posiwise-main-api#988); main-api refuses the calls too. */\n get userCredentialsEnabled(): boolean {\n return !!this.user?.feature_flags?.[USER_CREDENTIALS_FLAG];\n }\n\n ngOnInit() {\n console.log('AccountDetailsComponent.ngOnInit()');\n this.getUserProfile();\n this.loadConnections();\n this.geoService.getCountries().subscribe(() => {\n this.countries$ = combineLatest([\n this.geoService.getCountries(),\n this.transloco.selectTranslate('User.Profile.SelectCountry')\n ]).pipe(\n map(([countries, label]: [Country[], string]) => [\n { name: label, code: null },\n ...countries\n ])\n );\n this.cdr.markForCheck();\n });\n }\n\n handleAddressChange(_event) {\n this.profileForm.patchValue({\n latitude: _event.geometry.location.lat(),\n longitude: _event.geometry.location.lng(),\n location: _event.formatted_address\n });\n }\n\n protected getUserProfile() {\n this.userService\n .getUserInfo()\n .subscribe(user => {\n if (user) {\n this.user = user;\n this.slug = user.slug;\n if (user?.user_avatar?.length) {\n this.image = user?.user_avatar[2]?.url;\n }\n this.getRegion(user.country);\n copyApiKeysToUser(this.user);\n\n this.profileForm.patchValue(this.user);\n this.profileForm.patchValue({ dob: toDobStruct(user.dob) });\n this.validatedEmail = this.user.email;\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n handleImageError(event: Event, fallbackPath): void {\n HelperService.handleImageFallbackPath(event, fallbackPath);\n }\n\n @ValidateForm('profileForm')\n onProfileFormSubmit() {\n this.profileBusyButton = true;\n const data = { ...this.profileForm.value };\n data.dob = HelperService.dateFormat(this.profileForm.get('dob')?.value);\n if (data.location === '') {\n data.location = null;\n }\n Object.entries(data).forEach(([key, val]) => {\n if (val === '' || val === null) {\n delete data[key];\n }\n });\n this.profileService\n .updateUserProfile(data)\n .subscribe(() => {\n this.profileForm.markAsPristine();\n this.toast.success(this.translation.translate('User.Profile.ProfileUpdated'));\n this.cdr.markForCheck();\n })\n .add(() => {\n this.profileBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onAvatarSave() {\n const data = {\n avatar: this.profileForm.get('avatar')?.value\n };\n this.profileService.updateUserProfile(data).subscribe(() => {\n this.profileForm.markAsPristine();\n this.toast.success(this.translation.translate('User.Profile.ProfileUpdated'));\n this.cdr.markForCheck();\n });\n }\n\n getRegion(countryId: number | string) {\n if (countryId) {\n this.geoService.getRegions(countryId).subscribe(response => {\n this.states = [{ code: 0, name: 'Select State' }, ...response] as Country[];\n this.cdr.markForCheck();\n });\n }\n }\n}\n","<div class=\"w-100 text-center\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-4\">\n <section class=\"card p-4 h-100 d-flex flex-column\">\n <h2>{{ 'User.Profile.Avatar' | transloco }}</h2>\n <div class=\"text-center d-flex flex-column justify-content-center flex-grow-1 mt-1\">\n <div class=\"image-container\">\n <img [src]=\"image\"\n width=\"150\"\n height=\"150\"\n class=\"image rounded-circle\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">{{ 'User.Profile.Change' | transloco }}</div>\n </div>\n </div>\n <h4 class=\"mt-2\">{{ user?.first_name }} {{ user?.last_name }}</h4>\n <a [attr.aria-label]=\"'User.Profile.EditAvatar' | transloco\"\n class=\"d-inline-block mb-2\"\n (click)=\"openModal(content)\">\n {{ 'User.Profile.EditAvatar' | transloco }}</a>\n </div>\n </section>\n </div>\n <div class=\"col-md-8\">\n <section id=\"user-profile\"\n class=\"card p-4 overflow-visible h-100\">\n <form [formGroup]=\"profileForm\"\n (ngSubmit)=\"onProfileFormSubmit()\">\n <h2>{{ 'User.Profile.UserProfile' | transloco }}</h2>\n <div class=\"row mt-3\">\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n controlId=\"account-first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n id=\"account-first_name\"\n class=\"form-control\"\n formControlName=\"first_name\"\n autocomplete=\"given-name\" name=\"input_first_name_9\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PreferredName' | transloco\"\n name=\"preferred_name\"\n controlId=\"account-preferred_name\"\n errorMsg=\"User.Account.Details.Validation.PreferredName\">\n <input type=\"text\"\n id=\"account-preferred_name\"\n class=\"form-control\"\n formControlName=\"preferred_name\"\n autocomplete=\"username\" name=\"input_preferred_name_10\"\n [attr.aria-label]=\"'User.Account.Details.PreferredName' | transloco\"/>\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n controlId=\"account-country\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'account-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n placeholder=\"{{ 'User.Profile.SelectCountry' | transloco }}\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [label]=\"'User.Account.Details.Province' | transloco\"\n name=\"province\"\n controlId=\"account-province\"\n errorMsg=\"User.Account.Details.Validation.Province\">\n <input type=\"text\"\n id=\"account-province\"\n class=\"form-control\"\n formControlName=\"province\"\n autocomplete=\"postal-code\" name=\"input_province_11\"\n [attr.aria-label]=\"'User.Account.Details.Province' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.WebsiteUrl' | transloco\"\n name=\"website_url\"\n controlId=\"account-website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n id=\"account-website_url\"\n class=\"form-control\"\n formControlName=\"website_url\"\n autocomplete=\"url\" name=\"input_website_url_12\"\n [attr.aria-label]=\"'User.Account.Details.WebsiteUrl' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n controlId=\"account-last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n id=\"account-last_name\"\n class=\"form-control\"\n formControlName=\"last_name\"\n autocomplete=\"family-name\" name=\"input_last_name_13\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n controlId=\"account-dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"account-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Account.Details.DateOfBirthPlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ day: 1, month: 1, year: 1950 }\"\n [maxDate]=\"{ day: 31, month: 12, year: 2018 }\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n id=\"account-dob-trigger\"\n [attr.aria-label]=\"'User.Account.Details.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n controlId=\"account-state\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'account-state-label'\"\n [options]=\"states\"\n [(ngModel)]=\"selectedState\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n name=\"location\"\n controlId=\"account-location\"\n [useAriaLabelledbyOnly]=\"true\">\n <input ngx-gp-autocomplete\n id=\"account-location\"\n name=\"location\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'account-location-label'\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PhoneNumber' | transloco\"\n name=\"phone_number\"\n controlId=\"account-phone_number\"\n errorMsg=\"User.Account.Details.Validation.PhoneNumber\">\n <input type=\"text\"\n id=\"account-phone_number\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n autocomplete=\"tel\" name=\"input_phone_number_16\"\n [attr.aria-label]=\"'User.Account.Details.PhoneNumber' | transloco\"/>\n </pw-input-container>\n </div>\n <pw-sticky-actions>\n <button class=\"btn btn-raised btn-primary\" [buttonBusy]=\"profileBusyButton\">\n {{ 'Button.Save' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n </section>\n </div>\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-6\">\n <section id=\"email-section\"\n class=\"card p-4 h-100\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.RegisteredEmail' | transloco }}</h2>\n <section id=\"email-form\">\n <form [formGroup]=\"emailForm\"\n (ngSubmit)=\"onEmailFormSubmit()\">\n <!-- Email Address -->\n <div class=\"mt-0\">\n <span id=\"account-primary-email-label\" class=\"me-3 pw-label-style\">{{ 'User.Account.PrimaryEmail' | transloco }}:\n </span>\n <strong>{{ validatedEmail }}</strong>\n <div class=\"mt-1\">\n @if (!toggleEmail) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangeEmail' | transloco\"\n (click)=\"shouldUserChangeEmail()\">\n {{ 'User.Account.ChangeEmail' | transloco }}</a>\n }\n @if (toggleEmail) {\n <div class=\"row\">\n <div class=\"clearfix\"></div>\n <div class=\"col-12 mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\"\n class=\"form-control\"\n id=\"account-email-current-password\"\n name=\"currentPassword\"\n #password\n [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n autocomplete=\"current-password\"\n (keyup)=\"checkValidity()\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n @if (passwordVerified) {\n <input type=\"text\"\n class=\"form-control\"\n id=\"account-new-email\"\n name=\"newEmail\"\n [placeholder]=\"'User.Account.Details.NewEmail' | transloco\"\n autocomplete=\"email\"\n formControlName=\"email\"\n [attr.aria-label]=\"'User.Account.Details.NewEmail' | transloco\" />\n }\n </div>\n <div class=\"col-12\">\n @if (toggleEmail) {\n <a\n class=\"btn btn-raised btn-outline-default my-2 me-2\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"onToggleEmail()\">{{ 'Button.Cancel' | transloco }}</a>\n }\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\"\n type=\"submit\"\n [buttonBusy]=\"validatePasswordBusyButton\"\n (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">\n {{ 'User.Account.Validate' | transloco }}\n </button>\n }\n @if (passwordVerified) {\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [buttonBusy]=\"emailBusyButton\"\n >\n {{\n 'User.Account.SendVerification' | transloco\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n </div>\n <section id=\"slug\"\n class=\"mb-2 mt-3\">\n <div>\n <span class=\"me-3 pw-label-style\" id=\"account-nickname-label\">{{ 'User.Account.NickName' | transloco }}:</span>\n <span class=\"tooltip-wrap me-3\" [pTooltip]=\"'User.Account.HandleTooltip' | transloco\" [appendTo]=\"'body'\" tooltipPosition=\"top\"><i class=\"far fa-info-circle text-muted\"></i></span>\n <strong>{{ slug }}</strong>\n <div class=\"mt-1\">\n @if (!toggleNickName) {\n <a class=\"btn btn-raised btn-outline-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangeNickname' | transloco\"\n (click)=\"toggleNickName = true\">\n {{ 'User.Account.ChangeNickname' | transloco }}</a>\n }\n @if (toggleNickName) {\n <div class=\"mb-3\">\n <input type=\"text\"\n id=\"account-nickname\"\n name=\"nickname\"\n class=\"form-control slug-input\"\n aria-labelledby=\"account-nickname-label\"\n [(ngModel)]=\"slug\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.aria-label]=\"'User.Account.NickName' | transloco\" />\n </div>\n <div>\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default\"\n (click)=\"toggleNickName = false\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"slugBusyButton\"\n [disabled]=\"slug?.length < 2\"\n (click)=\"onUpdateSlug()\">\n {{ 'User.Account.UpdateNickname' | transloco }}\n </button>\n </div>\n }\n </div>\n </div>\n </section>\n </form>\n </section>\n </div>\n </div>\n </section>\n </div>\n <div class=\"col-md-6\">\n <section id=\"password-change\"\n class=\"card p-4 h-100\">\n <form [formGroup]=\"passwordForm\"\n (ngSubmit)=\"onPasswordFormSubmit()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.ChangePassword' | transloco }}</h2>\n </div>\n @if (!user?.has_password) {\n <div class=\"text-danger mx-3 my-2\">\n <div>\n {{ 'User.Account.Details.NoPassword' | transloco }}\n <em>{{ 'User.Account.ChangePassword' | transloco }}</em>.\n </div>\n <div>{{ 'User.Profile.PictureMessage' | transloco }}</div>\n </div>\n }\n @if (user?.has_password) {\n <div class=\"col-12\"\n >\n @if (togglePassword) {\n <div class=\"mb-3\">\n <label for=\"account-current-password\">{{ 'User.Account.CurrentPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-current-password\"\n class=\"form-control\"\n formControlName=\"currentPassword\"\n autocomplete=\"current-password\" name=\"input_currentPassword_4\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\"/>\n @if (\n !passwordForm.get('currentPassword').valid &&\n (passwordForm.get('currentPassword').dirty ||\n passwordForm.get('currentPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >\n {{ 'User.Account.Required' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-new-password\">{{ 'User.Account.NewPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autocomplete=\"new-password\" name=\"input_newPassword_5\"\n [attr.aria-label]=\"'User.Account.NewPassword' | transloco\"/>\n @if (\n !passwordForm.get('newPassword').valid &&\n (passwordForm.get('newPassword').dirty ||\n passwordForm.get('newPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >{{ 'User.Account.Validation.StrongPassword' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-confirm-password\">{{\n 'User.Account.ConfirmPassword' | transloco\n }}</label>\n <input type=\"password\"\n id=\"account-confirm-password\"\n class=\"form-control\"\n formControlName=\"confirmPassword\"\n autocomplete=\"new-password\" name=\"input_confirmPassword_6\"\n [attr.aria-label]=\"'User.Account.ConfirmPassword' | transloco\"/>\n @if (\n passwordForm.get('confirmPassword').touched &&\n passwordForm.get('confirmPassword').errors\n ?.MatchPassword\n ) {\n <div class=\"text-danger\"\n >\n {{ 'User.Account.Validation.PasswordsMatch' | transloco }}\n </div>\n }\n </div>\n <div class=\"mb-3\">\n @if (togglePassword) {\n <a class=\"btn btn-raised btn-outline-default\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n data-bs-target=\"\"\n (click)=\"onTogglePassword()\">\n {{ 'Button.Cancel' | transloco }}</a>\n }\n <button class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"passwordBusyButton\"\n [disabled]=\"!passwordForm.valid\">\n {{ 'User.Account.UpdatePassword' | transloco }}\n </button>\n </div>\n }\n <div>\n @if (!togglePassword) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"togglePassword = !togglePassword\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n }\n </div>\n </div>\n }\n @if (!user?.has_password) {\n <div class=\"col-12\"\n >\n <a class=\"btn btn-raised btn-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"sendMailToResetPassword()\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n </div>\n }\n </div>\n </form>\n </section>\n </div>\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"api-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.APICredentials.Description' | transloco: { company: mcpCompanyName } }}\n </p>\n <p class=\"text-muted small mb-2\">\n <i class=\"fas fa-link me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.McpEndpointNote' | transloco: { url: mcpEndpointUrl, company: mcpCompanyName } }}\n </p>\n <!-- pb (not mb): .card .mb-3:last-child is margin-reset in this component's scss -->\n <p class=\"text-muted small mb-0 pb-3\">\n <i class=\"fas fa-info-circle me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.SubscriptionClientIdNote' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-token\">{{ 'User.Account.APIUserToken' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? user?.api_keys?.api_user_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-client-id\">{{ 'User.Account.APIUserId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? user?.api_keys?.api_user_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (user?.api_keys?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits | number }}</span>\n }\n @if (user?.api_keys?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (user?.api_keys?.api_hits !== null && user?.api_keys?.api_hits_max !== null && user?.api_keys?.api_hits_max > 0) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.8,\n 'text-warning': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.8 && (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.9,\n 'text-danger': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((user.api_keys.api_hits / user.api_keys.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <label class=\"form-label\">{{ 'User.Subscriptions.APICredentials.ScopeLabel' | transloco }}</label>\n <div class=\"d-flex align-items-center flex-wrap gap-2\">\n <div class=\"btn-group\" role=\"group\"\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ScopeLabel' | transloco\">\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_only' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_only')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadOnly' | transloco }}\n </button>\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_write' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_write')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadWrite' | transloco }}\n </button>\n </div>\n <span class=\"text-muted small\">{{ 'User.Subscriptions.APICredentials.ScopeHint' | transloco }}</span>\n </div>\n </div>\n </div>\n </section>\n </div>\n }\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"registered-apps\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.RegisteredApps.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.RegisteredApps.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loadingConnections\"></pw-loader>\n @if (!loadingConnections) {\n @if (connections.length === 0) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.RegisteredApps.NoApps' | transloco }}</p>\n }\n @for (conn of connections; track conn.id) {\n <div class=\"d-flex align-items-center justify-content-between py-2 border-bottom\">\n <div>\n <span class=\"fw-bold me-3\">{{ conn.client_name }}</span>\n <span class=\"text-muted small\">\n {{ 'User.Subscriptions.RegisteredApps.ConnectedOn' | transloco }}\n {{ conn.created_at | date:'mediumDate' }}\n </span>\n <span class=\"text-muted small d-block\">\n {{ 'User.Subscriptions.RegisteredApps.LastUsed' | transloco }}\n @if (conn.last_used_at) {\n {{ conn.last_used_at | date:'medium' }}\n } @else {\n {{ 'User.Subscriptions.RegisteredApps.NeverUsed' | transloco }}\n }\n </span>\n </div>\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n (click)=\"deregisterConnection(conn.id)\">\n {{ 'User.Subscriptions.RegisteredApps.Deregister' | transloco }}\n </button>\n </div>\n }\n }\n </div>\n </div>\n </section>\n </div>\n }\n @if (user?.id && userCredentialsEnabled) {\n <div class=\"col-12 mt-3\">\n <pw-account-user-credentials [userId]=\"user.id\"></pw-account-user-credentials>\n </div>\n }\n</div>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n","import { DecimalPipe } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnDestroy, OnInit } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProductService } from '@posiwise/common-services';\nimport { Product, PRODUCT_CATEGORY, Subscription, User } from '@posiwise/common-utilities';\nimport { CurrencySymbolPipe } from '@posiwise/pipes';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport sortBy from 'lodash/sortBy';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-add-subscription',\n templateUrl: './add-subscription.component.html',\n styleUrls: ['./add-subscription.component.scss'],\n imports: [RouterLink, NoDataComponent, DecimalPipe, TranslocoPipe, CurrencySymbolPipe]\n})\nexport class AddSubscriptionComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly productService = inject(ProductService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n private readonly singleProducts = [];\n\n private readonly enterpriseProducts = [];\n\n form: FormGroup;\n\n busy: boolean;\n isLoaded: boolean;\n selectedProduct: boolean;\n isPurchaseAttempted: boolean;\n userLoggedIn: boolean;\n\n availableProducts: Product[] = [];\n products: Product[];\n\n user: User;\n\n unitError: string;\n\n category = PRODUCT_CATEGORY;\n\n units = 1;\n\n subscribedPermissionKeys = [];\n\n currentSubscription: Subscription;\n\n subscriptionId: number;\n\n ngOnInit() {\n this.subscriptionId = Number(this.route.snapshot.queryParamMap.get('subscription_id'));\n this.getProducts();\n }\n\n private getProducts() {\n // Gets All the products\n this.productService\n .getProductList({}, this.subscriptionId, { only_relevant: true })\n .subscribe(({ result }) => {\n this.products = result || [];\n if (this.products?.length) {\n this.products = this.products.filter(x => x.active);\n }\n\n this.isLoaded = true;\n this.userStore().subscribe(user => {\n this.user = user;\n if (this.user) {\n const subs: Subscription[] = cloneDeep(this.user.subscriptions);\n subs.forEach(subscription => {\n subscription.products.forEach(product => {\n const prod = this.products.find(x => x.id === product.id);\n if (prod) {\n prod['is_subscribed'] = true;\n prod['purchased_units'] = product?.purchased_units;\n }\n });\n });\n\n this.subscribedPermissionKeys = Array.from(\n new Set([\n ...this.user.subscriptions\n .flatMap(x => x.products)\n .map(product => product.permission_key),\n ...this.addonPermissionKeys(subs)\n ])\n );\n\n // show category only if we have products\n const prodPermissionKeys = this.products.map(p => p.permission_key);\n this.subscribedPermissionKeys = this.subscribedPermissionKeys.filter(x =>\n prodPermissionKeys.includes(x)\n );\n\n // Filtering the product with the existing permission_key\n this.availableProducts = sortBy(\n this.getSingleCategoryProducts(),\n 'is_subscribed'\n );\n }\n this.cdr.markForCheck();\n });\n this.cdr.markForCheck();\n });\n }\n\n /**\n * An add-on joins the subscription it is bought from, so it is offered — and counted as\n * subscribed — by what this subscription holds, not the user's other subscriptions.\n */\n private addonPermissionKeys(subscriptions: Subscription[]): string[] {\n const current = subscriptions.find(x => x.id === this.subscriptionId);\n const heldKeys = (current?.products ?? []).map(p => p.permission_key);\n const heldIds = (current?.products ?? []).map(p => p.id);\n const addons = this.products.filter(p =>\n p.addon_for_permission_keys?.some(key => heldKeys.includes(key))\n );\n addons.forEach(p => (p['is_subscribed'] = heldIds.includes(p.id)));\n return addons.map(p => p.permission_key);\n }\n\n private getSingleCategoryProducts(category = this.subscribedPermissionKeys[0]) {\n return this.products.filter(x => category === x.permission_key);\n }\n\n onChangeCategory(category) {\n this.availableProducts = this.getSingleCategoryProducts(category);\n this.availableProducts = sortBy(this.availableProducts, 'is_subscribed');\n }\n\n onSelection(product) {\n this.router.navigate([\n `account/subscriptions/upgrade/${this.subscriptionId}/${product.id}`\n ]);\n }\n\n trackByProduct(_index: number, item: Product) {\n return item.id;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","@if (isLoaded && !selectedProduct) {\n <div\n class=\"mt-4\">\n <div class=\"d-flex align-items-start category-tabs-row\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n [routerLink]=\"['/account/subscriptions']\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <div class=\"d-flex category-tabs\">\n @for (item of subscribedPermissionKeys; track item; let i = $index) {\n <div class=\"toggle\"\n >\n <input type=\"radio\"\n name=\"sizeBy\"\n value=\"option{{ i + 1 }}\"\n id=\"option{{ i + 1 }}\"\n (change)=\"onChangeCategory(item)\"\n [checked]=\"i === 0\"\n [attr.aria-label]=\"item\" />\n <label for=\"option{{ i + 1 }}\">{{ item }}</label>\n </div>\n }\n </div>\n </div>\n <ul class=\"row animated fadeIn d-flex\">\n @for (product of availableProducts; track trackByProduct($index, product)) {\n <li\n class=\"col-sm-12 col-md-6 col-xl-4 my-3 mt-sm-2\">\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h4 class=\"text-bold-500 primary mb-3\">{{ product.name }}</h4>\n @if (product.price_per_unit) {\n @if (product?.purchased_units) {\n <h5\n class=\"my-3 branding-color-1\">\n {{ 'User.Subscriptions.Add.Currently' | transloco }} {{ product.currency | currencySymbol\n }}{{\n (\n (product.purchased_units * product.price_per_unit) /\n 100\n ) | number:'1.2-2'\n }}&nbsp;/&nbsp;{{ product.billing_frequency }}\n </h5>\n }\n <h5 class=\"my-3\">\n {{ 'User.Subscriptions.Add.Min' | transloco }}\n {{ (product.min_units &gt; 1 ? 'User.Subscriptions.Add.SeatsCount' : 'User.Subscriptions.Add.SeatCount') | transloco: { count: product.min_units } }}\n - {{ product.currency | currencySymbol\n }}{{\n ((product.min_units * product.price_per_unit) / 100) | number:'1.2-2'\n }}&nbsp;/&nbsp;{{ product.billing_frequency }}\n </h5>\n <h5 class=\"d-inline-block text-bold-600 mb-2\">\n {{ product.currency | currencySymbol\n }}{{ (product.price_per_unit / 100) | number:'1.2-2' }}&nbsp;/&nbsp;{{\n product.billing_frequency\n }}&nbsp;/&nbsp;{{ 'User.Subscriptions.Add.PerSeat' | transloco }}\n </h5>\n } @else {\n <div class=\"d-inline-block text-bold-600 mb-2\">{{ 'User.Subscriptions.Free' | transloco }}</div>\n }\n <p class=\"mb-2\"\n [innerHTML]=\"product?.description\"></p>\n </div>\n <div class=\"card-footer px-3\">\n @if (\n !product.is_subscribed &&\n !product.trial_subscription &&\n product.stripe_plan_id\n ) {\n <a [attr.aria-label]=\"'User.Subscriptions.Subscribe' | transloco\"\n (click)=\"onSelection(product)\"\n class=\"card-btn btn btn-raised me-1 btn-primary btn-sm\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </a>\n }\n @if (\n !product.is_subscribed &&\n product.trial_subscription &&\n product.stripe_plan_id\n ) {\n <div class=\"mt-3\"\n >\n <a [attr.aria-label]=\"'Button.Upgrade' | transloco\"\n (click)=\"onSelection(product)\"\n class=\"card-btn btn btn-raised me-1 btn-primary btn-sm\">\n {{ 'Button.Upgrade' | transloco }}\n </a>\n <span class=\"badge bg-secondary position-absolute trial-badge\">{{ 'User.Subscriptions.Trial' | transloco }}\n </span>\n </div>\n }\n @if (\n product.is_subscribed &&\n !product.trial_subscription &&\n !product.is_deleted\n ) {\n <span\n class=\"card-btn badge bg-default text-white\">\n {{ 'User.Subscriptions.Subscribed' | transloco }}\n </span>\n }\n @if (\n product.is_subscribed &&\n product.trial_subscription &&\n product.price_per_unit === 0 &&\n !product.is_deleted &&\n !product.stripe_plan_id\n ) {\n <span\n class=\"card-btn badge bg-default text-white\">\n {{ 'User.Subscriptions.Free' | transloco }}\n </span>\n }\n @if (product.is_deleted) {\n <span\n class=\"card-btn badge bg-default text-white\">\n {{ 'User.Subscriptions.UnsubscribedButActive' | transloco }}\n </span>\n }\n </div>\n </div>\n </div>\n </li>\n }\n </ul>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (availableProducts && availableProducts.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"No products available under this category.\"\n >\n </pw-no-data>\n }\n </div>\n </div>\n </div>\n}\n","/**\n * @summary Shows the saved credit card details of the user\n * @author anikets43\n *\n * Created at : 2020-02-08 16:56:18\n * Last modified : 2020-02-08 17:06:29\n */\n\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-saved-card-details',\n templateUrl: './saved-card-details.component.html',\n styleUrls: ['./saved-card-details.component.scss'],\n imports: [TranslocoPipe]\n})\nexport class SavedCardDetailsComponent {\n /**\n * Credit Card details like brand, exp_month, exp_year, card_number\n */\n @Input() data: {\n brand?: string;\n exp_month?: string;\n exp_year?: string;\n card_number?: string;\n };\n\n /**\n * boolean: change payment option\n */\n @Input() isChangePayment: boolean;\n\n @Input() showNewCard: boolean;\n\n /**\n * Emitter: on payment change request\n */\n @Output() changeEvent: EventEmitter<boolean> = new EventEmitter();\n\n OnPaymentChange(value) {\n this.changeEvent.emit(value);\n }\n}\n","<div class=\"row\">\n @if (!showNewCard) {\n <div class=\"col-12\"\n >\n <h4 class=\"title\">{{ 'User.Subscriptions.SavedCard.Title' | transloco }}</h4>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'User.Subscriptions.SavedCard.Type' | transloco }}</div>\n <div class=\"summary-right\">{{ data?.brand }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'User.Subscriptions.SavedCard.Expiry' | transloco }}</div>\n <div class=\"summary-right\">{{ data.exp_month }} / {{ data.exp_year }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'User.Subscriptions.SavedCard.CardNumber' | transloco }}</div>\n <div class=\"summary-right\">{{ data?.card_number }}</div>\n </div>\n </div>\n }\n\n @if (!showNewCard) {\n <div class=\"col-12 mt-3\"\n >\n <button type=\"button\"\n class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'User.Subscriptions.SavedCard.ChangePaymentOption' | transloco\"\n (click)=\"OnPaymentChange(true)\">\n {{ 'User.Subscriptions.SavedCard.ChangePaymentOption' | transloco }}\n </button>\n </div>\n }\n</div>\n","import { FormArray, Validators } from '@angular/forms';\n\nimport {\n CredentialData,\n SubscriptionCredentialGroup\n} from '../../../shared/interface/user-module.interface';\nimport { credentialsByName, sortByLabel } from '../../credentials/credential-helpers';\n\nexport { changedCredentials, sortByLabel } from '../../credentials/credential-helpers';\n\nexport interface CredentialFormValue {\n credential_id: number;\n value: string;\n id?: number;\n}\n\nexport function uniqueByName(credentials: CredentialData[]): CredentialData[] {\n const seen = new Set<string>();\n const unique = credentials.filter(credential => {\n if (seen.has(credential.name)) {\n return false;\n }\n seen.add(credential.name);\n return true;\n });\n return sortByLabel(unique, credential => credential.name);\n}\n\nexport function groupByCredentialName(\n credentialTypes: CredentialData[],\n stored: CredentialData[]\n): SubscriptionCredentialGroup[] {\n const byName = credentialsByName(stored);\n return credentialTypes\n .map(({ name }) => ({\n credential_name: name,\n credentials: sortByLabel(byName.get(name) ?? [], credential => credential.field)\n }))\n .filter(group => group.credentials.length > 0);\n}\n\nexport function credentialFormRow(credentialType: CredentialData, stored?: CredentialData) {\n return {\n subscription_id: [0, [Validators.required]],\n credential_id: [credentialType?.id],\n field: [credentialType?.field],\n description: [credentialType?.description],\n value: [stored?.value, credentialType?.is_required ? [Validators.required] : []],\n id: [stored?.id]\n };\n}\n\n/** After a partly failed save, gives rows that did save their new id so a retry edits them. */\nexport function applyStoredIds(rows: FormArray, stored: CredentialData[]) {\n rows.controls.forEach(row => {\n const saved = stored.find(s => s.credential_id === row.value.credential_id);\n if (saved && !row.value.id) {\n row.patchValue({ id: saved.id });\n }\n });\n}\n","import { inject, Injectable } from '@angular/core';\n\nimport { SubscriptionService } from '@posiwise/common-services';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\nimport { EMPTY, forkJoin, Observable, timer } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\n\nimport {\n CredentialData,\n SubscriptionCredentialGroup\n} from '../../../shared/interface/user-module.interface';\nimport { changedCredentials, runAllThenReport } from '../../credentials/credential-helpers';\n\nimport { HumanizeCredentialNamePipe } from './humanize-credential-name.pipe';\nimport { CredentialFormValue } from './subscription-credential.utils';\n\n// Provided on the component: SubscriptionService is module-scoped, so a root provider cannot reach it.\n@Injectable()\nexport class SubscriptionCredentialActionsService {\n private readonly confirmDialog = inject(ConfirmDialogService);\n private readonly subscriptionService = inject(SubscriptionService);\n\n private readonly humanize = new HumanizeCredentialNamePipe();\n\n /**\n * The subscription's stored values and the credential types it can configure, fetched together.\n * A user-scoped type is left out: only a person holds it, and main-api refuses it for a subscription.\n */\n load(\n subscriptionId: number\n ): Observable<{ stored: CredentialData[]; types: CredentialData[] }> {\n return forkJoin({\n stored: this.storedCredentials(subscriptionId),\n types: this.subscriptionService\n .getAllCredentials()\n .pipe(map(({ result }) => result.filter(type => !type.user_scoped)))\n });\n }\n\n storedCredentials(subscriptionId: number): Observable<CredentialData[]> {\n return this.subscriptionService\n .getAllSubscriptionCredentials(subscriptionId)\n .pipe(map(({ result }) => result));\n }\n\n /**\n * Emits the saved responses once every changed value is saved, or [] when nothing changed.\n * Every request runs to completion before a failure is reported: forkJoin would otherwise\n * cancel the rest client-side while the server still saves them, and a retry would then\n * create those rows again.\n */\n saveChanged(rows: CredentialFormValue[], subscriptionId: number): Observable<unknown[]> {\n return runAllThenReport(\n changedCredentials(rows).map(row => {\n const data = {\n subscription_id: subscriptionId,\n credential_id: row.credential_id,\n value: row.value\n };\n return row.id\n ? this.subscriptionService.editSubscriptionCredential(row.id, data)\n : this.subscriptionService.postSubscriptionCredential(data);\n })\n );\n }\n\n /** Emits once every stored field of the integration is deleted; completes empty on cancel. */\n confirmAndDelete(group: SubscriptionCredentialGroup, subscriptionId: number): Observable<void> {\n // Opened a tick later: the password modal calls dismissAll() right after it emits\n // success, which would close a confirmation opened synchronously.\n return timer(0).pipe(\n switchMap(() =>\n this.confirmDialog.confirmDelete({\n textKey: 'User.Subscriptions.SubscriptionCredentials.DeleteConfirmText',\n textParams: { name: this.humanize.transform(group.credential_name) }\n })\n ),\n switchMap(ok => (ok ? this.deleteAll(group, subscriptionId) : EMPTY))\n );\n }\n\n private deleteAll(group: SubscriptionCredentialGroup, subscriptionId: number) {\n const requests: Observable<unknown>[] = group.credentials.map(credential =>\n this.subscriptionService.deleteSubscriptionCredential(credential.id, subscriptionId)\n );\n return forkJoin(requests).pipe(map(() => undefined));\n }\n}\n","import { AsyncPipe, NgClass } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport {\n FormArray,\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport {\n InputContainerComponent,\n NoDataComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1\n} from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport {\n CredentialData,\n SubscriptionCredentialGroup\n} from '../../../shared/interface/user-module.interface';\n\nimport { ClearMaskedOnFocusDirective } from './clear-masked-on-focus.directive';\nimport {\n CredentialAvatarHuePipe,\n HumanizeCredentialNamePipe,\n SubscriptionNameByIdPipe\n} from './humanize-credential-name.pipe';\nimport {\n applyStoredIds,\n credentialFormRow,\n groupByCredentialName,\n sortByLabel,\n uniqueByName\n} from './subscription-credential.utils';\nimport { SubscriptionCredentialActionsService } from './subscription-credential-actions.service';\n\n@Component({\n selector: 'pw-subscription-credential',\n templateUrl: './subscription-credential.component.html',\n styleUrls: [\n '../../credentials/credential-cards.scss',\n './subscription-credential.component.scss',\n './subscription-credential-form.scss'\n ],\n providers: [SubscriptionCredentialActionsService],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n Select,\n ClearMaskedOnFocusDirective,\n NgClass,\n ButtonBusyDirective,\n AppLoaderComponent,\n NoDataComponent,\n PasswordValidationComponent_1,\n AsyncPipe,\n TranslocoPipe,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n SubscriptionNameByIdPipe\n ]\n})\nexport class SubscriptionCredentialComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly fb = inject(FormBuilder);\n private readonly credentialActions = inject(SubscriptionCredentialActionsService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n private credentialToEdit: string;\n private credentialToDelete: SubscriptionCredentialGroup;\n\n @ViewChild('passwordValidationModalForEditCredential', { static: false })\n passwordValidationModalForEditCredential: PasswordValidationComponent;\n\n @ViewChild('passwordValidationModalForAddCredential', { static: false })\n passwordValidationModalForAddCredential: PasswordValidationComponent;\n\n @ViewChild('passwordValidationModalForDeleteCredential', { static: false })\n passwordValidationModalForDeleteCredential: PasswordValidationComponent;\n\n form: FormGroup;\n subscriptionId: number;\n\n allSubscriptionCredentials: CredentialData[];\n availableCredentials: CredentialData[] = [];\n credentialsSelect: CredentialData[];\n uniqueCredential: CredentialData[] = [];\n credentials: SubscriptionCredentialGroup[] = [];\n\n isEdit = false;\n submitted = false;\n buttonBusy = false;\n isLoaded = false;\n showForm = false;\n\n constructor() {\n super();\n this.form = this.fb.group({ credentials: this.fb.array([]) });\n }\n\n ngOnInit() {\n this.route.params.subscribe(params => {\n this.subscriptionId = params['subscriptionId'];\n if (this.subscriptionId) {\n this.getAllCredentials();\n }\n this.cdr.markForCheck();\n });\n }\n\n get credentialsGroup() {\n return this.form.get('credentials') as FormArray;\n }\n\n private getAllCredentials() {\n this.credentialActions\n .load(this.subscriptionId)\n .subscribe(({ stored, types }) => {\n this.allSubscriptionCredentials = stored;\n this.availableCredentials = types;\n this.uniqueCredential = uniqueByName(types);\n this.credentials = groupByCredentialName(this.uniqueCredential, stored);\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n selectedOption(event) {\n this.credentialsGroup.clear();\n const credentialName = this.isEdit ? event : event.value;\n this.credentialsSelect = sortByLabel(\n this.availableCredentials.filter(x => x.name === credentialName),\n credential => credential.field\n );\n this.credentialsSelect.forEach(credentialType => {\n const stored = this.allSubscriptionCredentials.find(\n credential => credential?.credential_id === credentialType?.id\n );\n this.credentialsGroup.push(this.fb.group(credentialFormRow(credentialType, stored)));\n });\n }\n\n saveCredentials() {\n this.submitted = true;\n if (!this.credentialsGroup.controls.every(control => control.valid)) {\n return;\n }\n this.buttonBusy = true;\n this.credentialActions\n .saveChanged(this.form.value.credentials, this.subscriptionId)\n .subscribe({\n next: saved => {\n if (saved.length) {\n this.notify('User.Subscriptions.SubscriptionCredentials.UpdateMessage');\n }\n this.onCancel();\n },\n // The HTTP interceptor already shows the error. The typed values stay; rows that did\n // save get their id, so a retry edits them instead of creating them again.\n error: () =>\n this.credentialActions\n .storedCredentials(this.subscriptionId)\n .subscribe(stored => applyStoredIds(this.credentialsGroup, stored))\n })\n .add(() => {\n this.submitted = false;\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n onCancel() {\n this.getAllCredentials();\n this.submitted = false;\n this.form.reset();\n this.showForm = false;\n this.isEdit = false;\n this.credentialsSelect = [];\n }\n\n openCredentialsForAdd() {\n this.passwordValidationModalForAddCredential.open();\n }\n\n openCredentialsForEdit(credentialName: string) {\n this.credentialToEdit = credentialName;\n this.passwordValidationModalForEditCredential.open();\n }\n\n openCredentialsForDelete(credential: SubscriptionCredentialGroup) {\n this.credentialToDelete = credential;\n this.passwordValidationModalForDeleteCredential.open();\n }\n\n editCredentials() {\n this.showForm = true;\n this.isEdit = true;\n this.selectedOption(this.credentialToEdit);\n }\n\n deleteCredentials() {\n this.credentialActions\n .confirmAndDelete(this.credentialToDelete, this.subscriptionId)\n .subscribe({\n next: () => {\n this.notify('User.Subscriptions.SubscriptionCredentials.DeletedMessage');\n this.getAllCredentials();\n },\n // Some fields may have been deleted before the failure, so show what is left.\n error: () => this.getAllCredentials()\n });\n }\n\n showEditForm() {\n this.isEdit = false;\n this.showForm = true;\n }\n\n private notify(messageKey: string) {\n this.toast.success(this.translation.translate(messageKey));\n this.cdr.markForCheck();\n }\n}\n","@let subName = ((userService.getUserState() | async)?.currentUser?.subscriptions | subscriptionNameById: subscriptionId);\n\n@if (showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <span>\n @if (subName) {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitle' : 'User.Subscriptions.SubscriptionCredentials.CreateTitle') | transloco: { name: subName } }}\n } @else {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitleFallback' : 'User.Subscriptions.SubscriptionCredentials.CreateTitleFallback') | transloco }}\n }\n </span>\n </h3>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitleFallback' | transloco }}\n }\n </p>\n\n <section class=\"credential-form-shell\">\n @if (credentialsSelect?.length) {\n <div class=\"credential-form-band\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n {{ (credentialsSelect[0].name | humanizeCredentialName).charAt(0) }}\n </span>\n <span class=\"credential-form-band-name\">\n {{ credentialsSelect[0].name | humanizeCredentialName }}\n </span>\n </div>\n }\n\n <form [formGroup]=\"form\" novalidate (ngSubmit)=\"saveCredentials()\" class=\"credential-form\">\n @if (!isEdit) {\n <div class=\"credential-form-row\">\n <pw-input-container\n [label]=\"'User.Subscriptions.SubscriptionCredentials.CredentialLabel' | transloco\"\n name=\"credentialType\">\n <p-select\n [options]=\"uniqueCredential\"\n [placeholder]=\"'User.Subscriptions.SubscriptionCredentials.CredentialPlaceholder' | transloco\"\n optionLabel=\"name\" optionValue=\"name\" appendTo=\"body\"\n (onChange)=\"selectedOption($event)\">\n </p-select>\n </pw-input-container>\n </div>\n }\n\n @if (credentialsSelect?.length) {\n <div formArrayName=\"credentials\" class=\"credential-form-fields\">\n @for (credential of credentialsGroup.controls; track credential; let i = $index) {\n <div [formGroupName]=\"i\" class=\"credential-form-row\">\n <pw-input-container\n [label]=\"credential.get('field').value | humanizeCredentialName\"\n [showTooltip]=\"!!credential.get('description').value\"\n [tooltipText]=\"credential.get('description').value\"\n tooltipPosition=\"top\"\n name=\"value\"\n errorMsg=\"User.Subscriptions.SubscriptionCredentials.ValueError\">\n <input type=\"text\" class=\"form-control\" formControlName=\"value\" pwClearMaskedOnFocus\n [ngClass]=\"{ 'is-invalid': submitted && credential.get('value').invalid }\"\n [id]=\"'credential-value-' + i\" [name]=\"'credential-value-' + i\"\n [attr.aria-label]=\"credential.get('field').value | humanizeCredentialName\" />\n </pw-input-container>\n </div>\n }\n </div>\n }\n\n <div class=\"credential-form-actions\">\n <button type=\"button\" class=\"btn btn-outline-default\" (click)=\"onCancel()\" (keydown.enter)=\"onCancel()\">\n {{ 'Button.Back' | transloco }}\n </button>\n @if (credentialsSelect?.length) {\n <button type=\"submit\" [buttonBusy]=\"buttonBusy\" class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n </form>\n </section>\n}\n\n@if (!showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"back()\"\n (keydown.enter)=\"back()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h2 class=\"mt-3\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitleFallback' | transloco }}\n }\n </h2>\n </div>\n <div class=\"col-12 col-md-12 text-end\">\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"openCredentialsForAdd()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Subscriptions.SubscriptionCredentials.AddButton' | transloco }}\n </button>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitleFallback' | transloco }}\n }\n </p>\n\n <pw-loader [isVisible]=\"!isLoaded\"></pw-loader>\n\n @if (isLoaded) {\n @if (allSubscriptionCredentials?.length === 0) {\n <div class=\"credential-empty\">\n <pw-no-data [withImage]=\"true\"\n [message]=\"'User.Subscriptions.SubscriptionCredentials.NoDataMessage' | transloco\"></pw-no-data>\n </div>\n } @else {\n <ul class=\"credential-grid\">\n @for (credential of credentials; track credential.credential_name) {\n <li class=\"credential-card\">\n <header class=\"credential-card-header\"\n [style.--avatar-hue]=\"credential.credential_name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">\n {{ (credential.credential_name | humanizeCredentialName).charAt(0) }}\n </span>\n <h3 class=\"credential-card-title\">\n {{ credential.credential_name | humanizeCredentialName }}\n </h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\" class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.EditAriaLabel' | transloco\"\n (click)=\"openCredentialsForEdit(credential.credential_name)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.DeleteAriaLabel' | transloco\"\n (click)=\"openCredentialsForDelete(credential)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (entry of credential.credentials; track entry.id) {\n <div class=\"credential-card-row\">\n <dt>{{ entry.field | humanizeCredentialName }}</dt>\n <dd><code class=\"credential-card-value\">{{ entry?.value }}</code></dd>\n </div>\n }\n </dl>\n </li>\n }\n </ul>\n }\n }\n}\n\n<pw-password-validation #passwordValidationModalForEditCredential (successEvent)=\"editCredentials()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForAddCredential (successEvent)=\"showEditForm()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForDeleteCredential (successEvent)=\"deleteCredentials()\"></pw-password-validation>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppState, GetUser } from '@posiwise/app-store';\nimport { CustomToastService, SubscriptionService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport {\n ConfirmDialogService,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1\n} from '@posiwise/shared-components';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\nimport { Store } from '@ngrx/store';\n\n/** No productId = delete the whole subscription. */\nexport interface SubscriptionRemovalTarget {\n subscriptionId: number;\n productId?: number;\n}\n\n/** Password check → reason → delete one product, or the whole subscription. */\n@Component({\n selector: 'pw-subscription-removal',\n templateUrl: './subscription-removal.component.html',\n imports: [PasswordValidationComponent_1, FormsModule, TranslocoPipe]\n})\nexport class SubscriptionRemovalComponent {\n private readonly subscriptionService = inject(SubscriptionService);\n private readonly modalService = inject(NgbModal);\n private readonly store = inject<Store<AppState>>(Store);\n private readonly toast = inject(CustomToastService);\n private readonly translation = inject(TranslocoService);\n private readonly confirmDialog = inject(ConfirmDialogService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() user: User;\n\n @Output() removed = new EventEmitter<void>();\n\n @ViewChild('passwordValidation', { static: false })\n passwordValidation: PasswordValidationComponent;\n\n @ViewChild('reasonModal', { static: false })\n reasonModal: TemplateRef<unknown>;\n\n target: SubscriptionRemovalTarget;\n\n reasonToCancel = '';\n\n get isWholeSubscription(): boolean {\n return !this.target?.productId;\n }\n\n start(target: SubscriptionRemovalTarget) {\n this.target = target;\n if (this.user?.has_password) {\n this.passwordValidation.open();\n return;\n }\n this.confirmDialog.open({\n titleKey: 'User.Subscriptions.SetPassword.Title',\n textKey: 'User.Subscriptions.SetPassword.Text',\n confirmOnly: true\n });\n }\n\n onPasswordValidated(isSuccess: boolean) {\n if (!isSuccess) {\n return;\n }\n // The password modal closes itself first; opening on the same tick stacks the two.\n setTimeout(() => {\n this.modalService.open(this.reasonModal, {\n centered: true,\n windowClass: 'modal-holder'\n });\n }, 100);\n }\n\n onConfirm() {\n const reason = this.reasonToCancel?.trim();\n if (!reason) {\n this.toast.error(\n this.translation.translate('User.Subscriptions.Validation.ReasonRequired')\n );\n return;\n }\n this.request(reason).subscribe(() => {\n this.store.dispatch(new GetUser());\n this.modalService.dismissAll();\n this.reset();\n this.removed.emit();\n });\n }\n\n reset() {\n this.target = null;\n this.reasonToCancel = '';\n this.cdr.markForCheck();\n }\n\n private request(reason: string) {\n const body = { reason_to_cancel: reason };\n const { subscriptionId, productId } = this.target;\n if (this.isWholeSubscription) {\n return this.subscriptionService.deleteWholeSubscription(subscriptionId, body);\n }\n return this.subscriptionService.deleteSubscription(subscriptionId, productId, body);\n }\n}\n","<pw-password-validation #passwordValidation\n [destructive]=\"true\"\n (successEvent)=\"onPasswordValidated($event)\">\n</pw-password-validation>\n\n<ng-template #reasonModal let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">\n {{ (isWholeSubscription ? 'User.Subscriptions.DeleteSubscription.Title' : 'User.Subscriptions.DeleteProduct.Title') | transloco }}\n </h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss(); reset()\">\n </button>\n </div>\n <div class=\"modal-body\">\n <p>\n {{ (isWholeSubscription ? 'User.Subscriptions.DeleteSubscription.Message' : 'User.Subscriptions.DeleteProduct.Message') | transloco }}\n </p>\n <div class=\"mb-3\">\n <label for=\"reasonToCancel\" class=\"form-label\">\n {{ 'User.Subscriptions.CancelSubscription.ReasonLabel' | transloco }} <span class=\"text-danger\">*</span>\n </label>\n <textarea\n id=\"reasonToCancel\"\n class=\"form-control\"\n rows=\"4\"\n [(ngModel)]=\"reasonToCancel\"\n [placeholder]=\"'User.Subscriptions.CancelSubscription.ReasonPlaceholder' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.CancelSubscription.ReasonPlaceholder' | transloco\"></textarea>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.dismiss(); reset()\">\n {{ 'User.Subscriptions.CancelSubscription.KeepItForNow' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-danger\"\n [disabled]=\"!reasonToCancel || !reasonToCancel.trim()\"\n (click)=\"onConfirm()\">\n {{ (isWholeSubscription ? 'User.Subscriptions.DeleteSubscription' : 'User.Subscriptions.DeleteProduct') | transloco }}\n </button>\n </div>\n</ng-template>\n","// Airwallex Drop-in for saving a backup card: card entry and the 3DS challenge happen\n// inside it. The SDK is imported lazily so it only loads on this page.\nimport type { AirwallexCardFormSetup } from '@posiwise/common-services';\n\nimport type { Payment } from '@airwallex/components-sdk';\n\n// Mirrors integrations-api Airwallex::Core::Environment::PRODUCTION_VALUES.\nconst PRODUCTION_ENVIRONMENTS = ['prod', 'production', 'live'];\nconst READY_TIMEOUT_MS = 20_000;\n\nexport class AirwallexElementHelper {\n private element: Payment.DropInElementType | null = null;\n\n async mount(host: HTMLElement, setup: AirwallexCardFormSetup): Promise<void> {\n this.teardown();\n const sdk = await import('@airwallex/components-sdk');\n await sdk.init({\n env: AirwallexElementHelper.sdkEnv(setup.environment),\n enabledElements: ['payments']\n });\n const element = await sdk.createElement('dropIn', this.options(setup));\n const ready = AirwallexElementHelper.whenReady(host);\n element.mount(host);\n this.element = element;\n await ready;\n }\n\n /**\n * mount() returns before the iframe draws its fields. SDK 1.35 announces readiness as a DOM\n * `onReady` event on the host; element.on('ready') never fires (measured in the demo env).\n */\n private static whenReady(host: HTMLElement): Promise<void> {\n return new Promise((resolve, reject) => {\n const finish = (done: () => void) => () => {\n clearTimeout(timer);\n host.removeEventListener('onReady', onReady);\n host.removeEventListener('onError', onError);\n done();\n };\n const onReady = finish(resolve);\n const onError = finish(() => reject(new Error('airwallex_form_failed')));\n const timer = setTimeout(\n finish(() => reject(new Error('airwallex_ready_timeout'))),\n READY_TIMEOUT_MS\n );\n host.addEventListener('onReady', onReady);\n host.addEventListener('onError', onError);\n });\n }\n\n /** Resolves with the intent id once the card and any 3DS challenge completed. */\n async confirm(): Promise<string> {\n if (!this.element) {\n throw new Error('airwallex_element_not_mounted');\n }\n const intent = await this.element.confirm();\n if (!intent?.id) {\n throw new Error('airwallex_confirm_failed');\n }\n return intent.id;\n }\n\n teardown(): void {\n this.element?.destroy();\n this.element = null;\n }\n\n static sdkEnv(environment: string): 'prod' | 'demo' {\n return PRODUCTION_ENVIRONMENTS.includes((environment || '').trim().toLowerCase())\n ? 'prod'\n : 'demo';\n }\n\n private options(setup: AirwallexCardFormSetup): Payment.DropInElementOptions {\n return {\n intent_id: setup.intent_id,\n client_secret: setup.client_secret,\n currency: setup.currency,\n methods: ['card'],\n showConfirmButton: false,\n payment_consent: {\n next_triggered_by: 'merchant',\n merchant_trigger_reason: 'unscheduled'\n }\n };\n }\n}\n","/**\n * Thin wrapper around the Braintree Web Drop-in script.\n * Mounts a Drop-in instance into a host DOM element and resolves the\n * payment_method_nonce on submit. Loaded as a CDN script (mirrors the Stripe\n * pattern in the same component) — see UpdatePaymentDetailsComponent.\n */\n\nconst DROPIN_CDN_URL = 'https://js.braintreegateway.com/web/dropin/1.43.0/js/dropin.min.js';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const braintree: {\n dropin: {\n create: (options: BraintreeDropinCreateOptions) => Promise<BraintreeDropinInstance>;\n };\n};\n\nexport interface BraintreeDropinCreateOptions {\n authorization: string;\n container: string | HTMLElement;\n card?: { cardholderName?: { required: boolean } };\n}\n\nexport interface BraintreeDropinInstance {\n requestPaymentMethod: () => Promise<{ nonce: string; type: string }>;\n teardown: () => Promise<void>;\n}\n\nexport class BraintreeDropinHelper {\n private dropinInstance: BraintreeDropinInstance | null = null;\n\n /**\n * Loads the Drop-in script into <head> if not already present, then mounts\n * a Drop-in instance bound to clientToken into the host element.\n */\n async mount(host: HTMLElement, clientToken: string): Promise<void> {\n await this.ensureScriptLoaded();\n await this.teardown();\n this.dropinInstance = await braintree.dropin.create({\n authorization: clientToken,\n container: host\n });\n }\n\n async requestNonce(): Promise<string> {\n if (!this.dropinInstance) {\n throw new Error('braintree_dropin_not_mounted');\n }\n const result = await this.dropinInstance.requestPaymentMethod();\n return result.nonce;\n }\n\n async teardown(): Promise<void> {\n if (!this.dropinInstance) {\n return;\n }\n try {\n await this.dropinInstance.teardown();\n } finally {\n this.dropinInstance = null;\n }\n }\n\n private ensureScriptLoaded(): Promise<void> {\n if (typeof window === 'undefined') {\n return Promise.resolve();\n }\n if ((window as unknown as { braintree?: unknown }).braintree) {\n return Promise.resolve();\n }\n const existing = document.querySelector(\n `script[src=\"${DROPIN_CDN_URL}\"]`\n ) as HTMLScriptElement | null;\n if (existing) {\n return new Promise<void>((resolve, reject) => {\n existing.addEventListener('load', () => resolve(), { once: true });\n existing.addEventListener(\n 'error',\n () => reject(new Error('braintree_script_load_failed')),\n { once: true }\n );\n });\n }\n return new Promise<void>((resolve, reject) => {\n const script = document.createElement('script');\n script.src = DROPIN_CDN_URL;\n script.async = true;\n script.addEventListener('load', () => resolve(), { once: true });\n script.addEventListener(\n 'error',\n () => reject(new Error('braintree_script_load_failed')),\n { once: true }\n );\n document.head.appendChild(script);\n });\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n Output,\n ViewChild\n} from '@angular/core';\n\nimport {\n CustomToastService,\n SecondaryCardSummary,\n SecondaryProvider,\n SubscriptionService,\n UserService\n} from '@posiwise/common-services';\nimport { ButtonBusyDirective } from '@posiwise/directives';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Tooltip } from 'primeng/tooltip';\nimport { firstValueFrom, map, Observable } from 'rxjs';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\n\nimport { SavedCardDetailsComponent } from '../saved-card-details/saved-card-details.component';\n\nimport { AirwallexElementHelper } from './airwallex-element.helper';\nimport { BraintreeDropinHelper } from './braintree-dropin.helper';\n\n// Secondary (backup card) column: Braintree or Airwallex, as the backend selected.\n@Component({\n selector: 'pw-secondary-payment-method',\n templateUrl: './secondary-payment-method.component.html',\n styleUrls: ['./secondary-payment-method.component.scss'],\n imports: [\n Tooltip,\n Bind,\n ProgressSpinner,\n SavedCardDetailsComponent,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class SecondaryPaymentMethodComponent implements OnDestroy {\n private readonly subscriptionService = inject(SubscriptionService);\n private readonly userService = inject(UserService);\n private readonly toast = inject(CustomToastService);\n private readonly transloco = inject(TranslocoService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() subscriptionId: number;\n @Input() card: SecondaryCardSummary | null = null;\n @Input() provider: SecondaryProvider = 'airwallex';\n @Input() loading = true;\n @Output() saved = new EventEmitter<void>();\n\n @ViewChild('formHost') formHost?: ElementRef<HTMLDivElement>;\n\n showForm = false;\n mounting = false; // the card form loads after showForm: its host must already exist\n busy = false;\n\n private readonly braintree = new BraintreeDropinHelper();\n private readonly airwallex = new AirwallexElementHelper();\n\n ngOnDestroy() {\n this.teardown();\n }\n\n async startFlow() {\n this.showForm = true;\n this.mounting = true;\n this.cdr.detectChanges(); // the form host only exists once showForm renders\n try {\n await this.mountForm(this.formHost.nativeElement);\n } catch (error) {\n if (!(error instanceof HttpErrorResponse)) {\n this.fail('User.Payments.Secondary.Errors.FormFailed');\n }\n this.showForm = false;\n } finally {\n this.mounting = false;\n this.cdr.markForCheck();\n }\n }\n\n async submit() {\n this.busy = true;\n this.cdr.markForCheck();\n try {\n const response = await firstValueFrom(this.register(await this.collectCard()));\n if (response?.data) {\n this.onSaved(response.message);\n }\n } catch (error) {\n // The HTTP interceptor already toasts a rejected API call.\n if (!(error instanceof HttpErrorResponse)) {\n this.fail('User.Payments.Secondary.Errors.CardNotConfirmed');\n }\n } finally {\n this.busy = false;\n this.cdr.markForCheck();\n }\n }\n\n cancel() {\n this.teardown();\n this.showForm = false;\n this.cdr.markForCheck();\n }\n\n private onSaved(message: string) {\n // Braintree's hand-built response isn't toasted by the interceptor; Airwallex's is.\n if (this.provider === 'braintree') {\n this.toast.success(message);\n }\n // Refresh the user payload so payment_methods_status is re-evaluated\n // and the secondary-payment modal in UserService stops firing.\n this.userService.getUserInfo().subscribe();\n this.teardown();\n this.showForm = false;\n this.saved.emit();\n }\n\n private async mountForm(host: HTMLElement) {\n if (this.provider === 'braintree') {\n const response = await firstValueFrom(\n this.subscriptionService.getBraintreeClientToken(this.subscriptionId)\n );\n await this.braintree.mount(host, response?.result?.data?.client_token);\n return;\n }\n const response = await firstValueFrom(\n this.subscriptionService.getAirwallexIntent(this.subscriptionId)\n );\n await this.airwallex.mount(host, response?.result);\n }\n\n /** Braintree yields a nonce; Airwallex yields the confirmed intent id (after 3DS). */\n private collectCard(): Promise<string> {\n return this.provider === 'braintree'\n ? this.braintree.requestNonce()\n : this.airwallex.confirm();\n }\n\n /** Braintree's hand-built reply nests in `result`; Airwallex's toast keeps `message` on top. */\n private register(\n reference: string\n ): Observable<{ data: SecondaryCardSummary | null; message?: string }> {\n return this.provider === 'braintree'\n ? this.subscriptionService\n .registerBraintreePaymentMethod(this.subscriptionId, reference)\n .pipe(map(({ result }) => result))\n : this.subscriptionService\n .registerAirwallexPaymentMethod(this.subscriptionId, reference)\n .pipe(map(({ result, message }) => ({ data: result, message })));\n }\n\n private teardown() {\n this.braintree.teardown();\n this.airwallex.teardown();\n }\n\n private fail(key: string) {\n this.toast.error(this.transloco.translate(key));\n }\n}\n","<h5 class=\"section-title\">{{ 'User.Payments.Secondary.Title' | transloco }}</h5>\n<p class=\"alert alert-info\" [pTooltip]=\"'User.Payments.Secondary.Tooltip' | transloco\" tooltipPosition=\"top\" appendTo=\"body\">\n {{ 'User.Payments.Secondary.Callout' | transloco }}\n</p>\n\n@if (loading || mounting) {\n <div class=\"text-center\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n\n@if (card && !showForm) {\n <pw-saved-card-details [data]=\"card\"\n (changeEvent)=\"startFlow()\">\n </pw-saved-card-details>\n}\n\n@if (!card && !showForm && !loading) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"startFlow()\">\n {{ 'User.Payments.Secondary.AddCta' | transloco }}\n </button>\n}\n\n@if (showForm) {\n <div #formHost class=\"secondary-card-form\" [class.mt-3]=\"!mounting\" [class.secondary-card-form--mounting]=\"mounting\"\n [attr.data-provider]=\"provider\"></div>\n @if (!mounting) {\n <div class=\"col-12 mt-4 text-end\">\n <button type=\"button\"\n (click)=\"cancel()\"\n class=\"btn btn-outline-default me-2\">\n {{ 'User.Payments.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n [buttonBusy]=\"busy\"\n (click)=\"submit()\">\n {{ 'User.Payments.Submit' | transloco }}\n </button>\n </div>\n }\n}\n","import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n ProductService,\n ScriptLoaderService,\n SecondaryCardSummary,\n SecondaryProvider,\n StripeCardSummary,\n SubscriptionService\n} from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { PwStickyActionsComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { StatusCodes } from 'http-status-codes';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Select } from 'primeng/select';\nimport { forkJoin } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { StripeCardResponse } from '../../../shared/interface/user-module.interface';\nimport { SavedCardDetailsComponent } from '../saved-card-details/saved-card-details.component';\n\nimport { SecondaryPaymentMethodComponent } from './secondary-payment-method.component';\nimport { StripeJsApi } from './update-payment-details.types';\n\ndeclare const Stripe: StripeJsApi;\n\n@Component({\n selector: 'pw-update-payment-details',\n templateUrl: './update-payment-details.component.html',\n styleUrls: ['./update-payment-details.component.scss'],\n imports: [\n SavedCardDetailsComponent,\n Bind,\n ProgressSpinner,\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n Select,\n LazyImgDirective,\n PwStickyActionsComponent,\n ButtonBusyDirective,\n SecondaryPaymentMethodComponent,\n TranslocoPipe\n ]\n})\nexport class UpdatePaymentDetailsComponent extends AppBaseComponent implements OnInit {\n private readonly fb = inject(FormBuilder);\n private readonly scriptLoader = inject(ScriptLoaderService);\n private readonly productService = inject(ProductService);\n private readonly subscriptionService = inject(SubscriptionService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n form: FormGroup;\n\n years = [];\n months = [];\n\n busy: boolean;\n isChangePayment: boolean;\n\n cardDetails: StripeCardSummary | null = null;\n secondaryCard: SecondaryCardSummary | null = null;\n secondaryProvider: SecondaryProvider = 'airwallex';\n\n loading = true;\n\n errorMessage: string;\n stripePublishKey: string;\n errorMsg: string;\n\n subscriptionId: number;\n productId: number;\n\n constructor() {\n super();\n\n this.route.params.subscribe(response => {\n this.subscriptionId = Number(response['subscriptionId']);\n this.productId = Number(response['productId']);\n this.refreshPaymentMethods();\n this.cdr.markForCheck();\n });\n\n this.form = this.fb.group({\n card_number: ['', Validators.required],\n cvc: ['', Validators.required],\n exp_month: ['', Validators.required],\n exp_year: ['', Validators.required]\n });\n }\n\n ngOnInit() {\n this.scriptLoader.loadScriptOnce('head', 'https://js.stripe.com/v2/');\n this.years = HelperService.getYears();\n this.months = HelperService.getMonths();\n }\n\n refreshPaymentMethods() {\n forkJoin({\n paymentMethods: this.subscriptionService.getPaymentMethods(this.subscriptionId),\n product: this.productService.getProductById(this.productId)\n })\n .subscribe(response => {\n this.stripePublishKey = response.product.result.stripe_publishable_key;\n if (response.paymentMethods.result.status === StatusCodes.OK) {\n const data = response.paymentMethods.result.data;\n this.cardDetails = data?.primary || null;\n this.secondaryCard = data?.secondary || null;\n this.secondaryProvider = data?.secondary_provider || 'braintree';\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.loading = false;\n this.cdr.markForCheck();\n });\n }\n\n onUpdatePaymentDetailsCancel() {\n this.router.navigate(['/account/subscriptions']);\n }\n\n @ValidateForm('form')\n onSave() {\n this.busy = true;\n this.errorMsg = '';\n const cardDetails = {\n number: this.form.value.card_number,\n cvc: this.form.value.cvc,\n exp_month: this.form.value.exp_month,\n exp_year: this.form.value.exp_year\n };\n Stripe.setPublishableKey(this.stripePublishKey);\n Stripe.card.createToken(cardDetails, (status, res) => this.onStripeToken(status, res));\n }\n\n private onStripeToken(status: number, res: StripeCardResponse) {\n if (status !== 200) {\n this.toast.error(res?.error?.message);\n this.busy = false;\n this.cdr.markForCheck();\n return;\n }\n this.subscriptionService\n .updateCardDetails(this.form.value, this.subscriptionId)\n .subscribe({\n next: ({ result }) => {\n if (result.error) {\n this.toast.error(result.error.errors[0].message);\n } else if (result.status === StatusCodes.CREATED) {\n this.toast.success(result.message);\n }\n this.form.markAsPristine();\n this.cancel();\n }\n })\n .add(() => {\n this.busy = false;\n this.cdr.markForCheck();\n });\n }\n\n cancel() {\n this.router.navigate(['/account/subscriptions']);\n }\n\n onChange(value) {\n this.isChangePayment = value;\n }\n}\n","<div class=\"container-fluid\">\n <div class=\"card-block\">\n <div class=\"row\">\n <div class=\"col-lg-12 ps-0\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"back()\"\n class=\"previous float-start\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n <h4 class=\"form-section my-3\">\n <i class=\"ft-edit\" aria-hidden=\"true\"></i>\n {{ 'User.Payments.UpdateTitle' | transloco }}\n </h4>\n </div>\n </div>\n\n <div class=\"row g-3 mt-1\">\n <!-- Primary payment method (Stripe) -->\n <div class=\"col-12 col-lg-6\">\n <div class=\"card payment-left p-3 h-100\">\n <div class=\"card-body\">\n <h5 class=\"section-title\">{{ 'User.Payments.Primary.Title' | transloco }}</h5>\n <p class=\"text-muted\">{{ 'User.Payments.Primary.Description' | transloco }}</p>\n\n @if (errorMsg) {\n <div class=\"alert alert-danger\">{{ errorMsg }}</div>\n }\n @if (!isChangePayment && cardDetails) {\n <pw-saved-card-details [data]=\"cardDetails\"\n (changeEvent)=\"onChange($event)\">\n </pw-saved-card-details>\n }\n\n @if (loading) {\n <div class=\"text-center\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n\n @if ((!cardDetails && !loading) || isChangePayment) {\n <form [formGroup]=\"form\" (ngSubmit)=\"onSave()\">\n <h4 class=\"title\">{{ 'User.Payments.Primary.NewCard' | transloco }}</h4>\n <div class=\"row\">\n <div class=\"col-md-9\">\n <div class=\"mb-3\">\n <label for=\"update-payment-card_number\">{{ 'User.Payments.CardNumber' | transloco }}</label>\n <input type=\"text\"\n id=\"update-payment-card_number\"\n class=\"form-control\"\n formControlName=\"card_number\"\n [placeholder]=\"'User.Payments.CardNumber' | transloco\"\n name=\"card_number\"\n [attr.aria-label]=\"'User.Payments.CardNumber' | transloco\" />\n @if (form.get('card_number').touched && form.get('card_number').errors?.required) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.CardNumberRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"mb-3\">\n <label for=\"update-payment-cvc\">{{ 'User.Payments.Cvc' | transloco }}</label>\n <input type=\"text\"\n id=\"update-payment-cvc\"\n class=\"form-control\"\n formControlName=\"cvc\"\n [placeholder]=\"'User.Payments.Cvc' | transloco\"\n name=\"cvc\"\n [attr.aria-label]=\"'User.Payments.Cvc' | transloco\" />\n @if (form.get('cvc').touched && form.get('cvc').errors?.required) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.CvcRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only\" id=\"update-payment-exp_month-label\" class=\"pw-label-style\">{{ 'User.Payments.ExpMonth' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'update-payment-exp_month-label'\"\n [options]=\"months\"\n [appendTo]=\"'body'\"\n formControlName=\"exp_month\"\n [placeholder]=\"'User.Payments.ExpMonth' | transloco\"\n optionValue=\"value\"\n optionLabel=\"value\">\n </p-select>\n @if (form.get('exp_month').touched && form.get('exp_month').errors?.required) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.ExpMonthRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only\" id=\"update-payment-exp_year-label\">{{ 'User.Payments.ExpYear' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'update-payment-exp_year-label'\"\n [options]=\"years\"\n formControlName=\"exp_year\"\n [placeholder]=\"'User.Payments.ExpYear' | transloco\"\n optionValue=\"value\"\n [appendTo]=\"'body'\"\n optionLabel=\"value\">\n </p-select>\n @if (form.get('exp_year')?.touched && form.get('exp_year')?.errors?.['required']) {\n <div class=\"danger\"><span>{{ 'User.Payments.Errors.ExpYearRequired' | transloco }}</span></div>\n }\n </div>\n </div>\n <div class=\"col-12 text-center mt-4\">\n <img src=\"/assets/img/icons/powered_by_stripe_v2.png\"\n class=\"payment-provider\"\n alt=\"\" />\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n (click)=\"cancel()\"\n class=\"btn btn-outline-default me-2\">\n {{ 'User.Payments.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\"\n [buttonBusy]=\"busy\">\n {{ 'User.Payments.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n }\n </div>\n </div>\n </div>\n\n <!-- Secondary payment method (Braintree or Airwallex, main-api #974) -->\n <div class=\"col-12 col-lg-6\">\n <div class=\"card payment-right p-3 h-100\">\n <div class=\"card-body\">\n <pw-secondary-payment-method\n [subscriptionId]=\"subscriptionId\"\n [card]=\"secondaryCard\"\n [provider]=\"secondaryProvider\"\n [loading]=\"loading\"\n (saved)=\"refreshPaymentMethods()\">\n </pw-secondary-payment-method>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n</div>\n","import { ChangeDetectorRef, inject } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AppState, GetUser } from '@posiwise/app-store';\nimport { SavedStripeCard, SubscriptionService } from '@posiwise/common-services';\nimport { Product, Subscription } from '@posiwise/common-utilities';\nimport { HelperService } from '@posiwise/helper-service';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\nimport { Store } from '@ngrx/store';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare let Stripe;\n\nfunction stripeCard(value) {\n return {\n number: value.card_number,\n cvc: value.cvc,\n exp_month: value.exp_month,\n exp_year: value.exp_year\n };\n}\n\n/** Card, Stripe token and enrolment steps of the upgrade page (undecorated base). */\nexport abstract class UpgradeSubscriptionPayment extends AppBaseComponent {\n protected readonly fb = inject(FormBuilder);\n protected readonly modalService = inject(NgbModal);\n protected readonly subscriptionService = inject(SubscriptionService);\n private readonly store = inject<Store<AppState>>(Store);\n protected readonly cdr = inject(ChangeDetectorRef);\n\n form: FormGroup = this.fb.group({\n card_number: ['', Validators.required],\n units: [],\n cvc: ['', Validators.required],\n exp_month: ['', Validators.required],\n exp_year: ['', Validators.required]\n });\n\n product: Product;\n subscription: Subscription;\n cardDetails: SavedStripeCard | null;\n\n units: number;\n subscriptionId: number;\n\n stripePublishKey: string;\n\n busy: boolean;\n isPurchaseAttempted: boolean;\n\n showNewCard: boolean;\n passwordModalVisible: boolean;\n\n errorMsg;\n\n /** No Stripe plan and no price: nothing to charge, so no card is asked for. */\n get isFree(): boolean {\n return !this.product?.stripe_plan_id && !Number(this.product?.price_per_unit);\n }\n\n private postCreateToken(cardToken) {\n const data = {\n stripe_token: cardToken,\n product_id: this.product.id,\n units: this.form.get('units').value || 1,\n subscription_id: this.subscriptionId\n };\n this.userService\n .addNewSubscriptionUsingStripe(data)\n .subscribe({\n next: () => {\n this.form.markAsPristine();\n this.toast.success(\n this.translation.translate('User.Subscriptions.SubscriptionPurchased')\n );\n this.router.navigate(['/account/subscriptions']);\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n },\n error: () => {\n this.busy = false;\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.busy = false;\n this.cdr.markForCheck();\n });\n }\n\n protected onPurchaseSubmit() {\n this.busy = true;\n this.passwordModalVisible = true;\n if (this.isFree) {\n this.enrollUserToSubscription();\n } else if (this.subscription.stripe_customer_id) {\n if (this.showNewCard) {\n this.updateCardDetails();\n } else {\n this.enrollUserToSubscription();\n }\n } else if (this.form.valid) {\n const cardDetails = stripeCard(this.form.value);\n // Get publishable key from product get id\n Stripe.card.createToken(\n cardDetails,\n (status, response) => {\n if (status === StatusCodes.OK) {\n const cardToken = response.id;\n this.postCreateToken(cardToken);\n } else {\n this.toast.error(response?.error?.message, '', { disableTimeOut: true });\n this.busy = false;\n this.isPurchaseAttempted = false;\n }\n this.cdr.markForCheck();\n },\n () => {\n this.busy = false;\n this.isPurchaseAttempted = false;\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n }\n );\n }\n }\n\n private enrollUserToSubscription() {\n const data = {\n product_id: this.product.id,\n units: this.form.get('units').value,\n subscription_id: this.subscriptionId\n };\n\n this.subscriptionService.postSubscription(data).subscribe({\n next: ({ result }) => {\n this.store.dispatch(new GetUser());\n if (result.id) {\n this.form.markAsPristine();\n this.router.navigate(['/account/subscriptions']);\n this.toast.success(\n this.translation.translate('User.Subscriptions.SubscriptionPurchased')\n );\n this.isPurchaseAttempted = false;\n this.modalService.dismissAll();\n this.back();\n }\n this.cdr.markForCheck();\n },\n error: () => {\n this.busy = false;\n this.isPurchaseAttempted = false;\n this.cdr.markForCheck();\n },\n complete: () => {\n this.busy = !this.busy;\n this.cdr.markForCheck();\n }\n });\n }\n\n @ValidateForm('form')\n updateCardDetails() {\n const cardDetails = stripeCard(this.form.value);\n Stripe.setPublishableKey(this.stripePublishKey);\n\n Stripe.card.createToken(cardDetails, (status, res) => {\n if (status !== 200) {\n this.toast.error(res.error.message);\n } else {\n this.subscriptionService\n .updateCardDetails(this.form.value, this.subscriptionId)\n .subscribe({\n next: ({ result }) => {\n if (result.error) {\n const err = result.error.errors[0].message;\n this.toast.error(err);\n } else if (result.status === StatusCodes.CREATED) {\n this.enrollUserToSubscription();\n this.toast.success(result.message);\n }\n this.cdr.markForCheck();\n },\n error: error => {\n this.errorMsg = HelperService.getErrorMessage(error);\n this.toast.error(this.errorMsg);\n this.cdr.markForCheck();\n }\n });\n }\n this.cdr.markForCheck();\n });\n }\n}\n","import { DecimalPipe } from '@angular/common';\nimport { Component, inject, OnInit, ViewChild } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\n\nimport { FormHelperService, ProductService, ScriptLoaderService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport {\n ConfirmDialogService,\n NumberPickerComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1\n} from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { SavedCardDetailsComponent } from '../saved-card-details/saved-card-details.component';\n\nimport { UpgradeSubscriptionPayment } from './upgrade-subscription-payment';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare let Stripe;\n\n@Component({\n selector: 'pw-upgrade-subscription',\n templateUrl: './upgrade-subscription.component.html',\n styleUrls: ['./upgrade-subscription.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n NumberPickerComponent,\n SavedCardDetailsComponent,\n Bind,\n Select,\n LazyImgDirective,\n RouterLink,\n ButtonBusyDirective,\n PasswordValidationComponent_1,\n DecimalPipe,\n TranslocoPipe\n ]\n})\nexport class UpgradeSubscriptionComponent extends UpgradeSubscriptionPayment implements OnInit {\n private readonly productService = inject(ProductService);\n private readonly scriptLoader = inject(ScriptLoaderService);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n @ViewChild('passwordValidationModal', { static: true })\n passwordValidationModal: PasswordValidationComponent;\n\n user: User;\n\n productId: number;\n\n unitError: string;\n password: string;\n\n months = [];\n years = [];\n\n get totalAmount() {\n if (this.product) {\n const units = Number(this.form.get('units').value);\n // eslint-disable-next-line no-restricted-globals\n if (!Number.isNaN(units)) {\n return (units * this.product.price_per_unit) / 100;\n }\n }\n\n return 0;\n }\n\n ngOnInit(): void {\n this.scriptLoader.loadScriptOnce('head', 'https://js.stripe.com/v2/');\n this.years = HelperService.getYears();\n this.months = HelperService.getMonths();\n\n this.userStore().subscribe(user => {\n this.user = user;\n this.cdr.markForCheck();\n });\n\n this.route.params.subscribe(response => {\n this.subscriptionId = +response['subscriptionId'];\n this.productId = +response['productId'];\n this.getSubscriptionDetails();\n this.getCardDetails(this.subscriptionId);\n this.cdr.markForCheck();\n });\n }\n\n getSubscriptionDetails() {\n this.subscriptionService\n .getById(this.subscriptionId)\n .subscribe(({ result }) => {\n this.subscription = result;\n const product = this.subscription.products.find(x => x.id === this.productId);\n this.form.patchValue({\n units: product?.purchased_units\n });\n\n this.units = this.form.get('units').value;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.getProductDetails();\n });\n }\n\n getProductDetails() {\n this.productService.getProductById(this.productId).subscribe(({ result }) => {\n this.product = result;\n this.stripePublishKey = result?.stripe_publishable_key;\n if (result?.stripe_publishable_key) {\n Stripe.setPublishableKey(result.stripe_publishable_key);\n }\n const prodUnits =\n this.units > this.product.min_units ? this.units : this.product.min_units || 1;\n\n this.form.patchValue({\n units: prodUnits\n });\n\n this.units = this.form.get('units').value;\n this.cdr.markForCheck();\n });\n }\n\n onMaxReached(event) {\n if (event) {\n this.unitError = `Maximum is ${this.units}`;\n }\n }\n\n onMinReached(event) {\n if (event) {\n this.unitError = `Minimum is ${this.subscription.min_units || this.product.min_units}`;\n }\n }\n\n onUnitChange(event) {\n this.units = event;\n this.form.patchValue({\n units: event\n });\n this.unitError = '';\n }\n\n onValidatePassword(isSuccess: boolean) {\n if (isSuccess) {\n this.onPurchaseSubmit();\n this.password = null;\n this.modalService.dismissAll();\n }\n }\n\n attemptPurchase() {\n if (this.user.has_password) {\n this.passwordValidationModal.open();\n } else {\n this.noPasswordModal();\n }\n }\n\n private noPasswordModal() {\n this.confirmDialog.open({\n titleKey: 'User.Subscriptions.SetPassword.Title',\n textKey: 'User.Subscriptions.SetPassword.TextWithLink',\n confirmOnly: true\n });\n }\n\n private getCardDetails(subscriptionId: number) {\n this.subscriptionService.getCardDetails(subscriptionId).subscribe(({ result }) => {\n this.cardDetails = result?.data ?? null;\n this.form.patchValue({\n units: this.units,\n card_number: this.cardDetails?.card_number,\n exp_month: this.cardDetails?.exp_month || '',\n exp_year: this.cardDetails?.exp_year || ''\n });\n this.cdr.markForCheck();\n });\n }\n\n onDiscardToggle() {\n this.form.markAllAsTouched();\n FormHelperService.markFormAsPristine(this.form);\n }\n}\n","<h4 class=\"form-section m-3\">\n <i class=\"ft-check-circle\" aria-hidden=\"true\"></i> {{ 'Button.Payment' | transloco }}\n</h4>\n<div class=\"card-block\">\n <!-- Show Payment Page when there is user.has_stripe_account===false -->\n <ng-container>\n <form class=\"form\"\n (ngSubmit)=\"attemptPurchase()\"\n [formGroup]=\"form\">\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"form-body p-3 payment-left card pb-0\">\n <div class=\"card-body\">\n @if (product?.max_units > 1) {\n <div class=\"row\"\n >\n <div class=\"col-12\">\n <div class=\"mb-3\">\n <h4 class=\"title\">\n {{ 'User.Subscriptions.LicensesRequired' | transloco }}\n </h4>\n <div class=\"row btns-row\">\n <div class=\"col-md-4 col-8\">\n <pw-number-picker name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription.min_units || product.min_units\"\n [max]=\"product.max_units\"\n step=\"1\"\n [postfix]=\"'Label.Seats' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"false\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n </div>\n <div class=\"text-center\">\n <small class=\"form-text text-muted danger\">\n {{ unitError }}\n </small>\n </div>\n </div>\n @if (!isFree) {\n <p>\n {{ 'User.Subscriptions.Upgrade.ChargeNotice' | transloco }}\n <strong>{{ product.currency }}\n {{ totalAmount | number:'1.2-2' }}</strong>\n </p>\n }\n </div>\n </div>\n }\n <!-- Shows Saved Card: Shows when user has card details and not trying to update the card details -->\n @if (cardDetails && !isFree) {\n <pw-saved-card-details [data]=\"cardDetails\"\n (changeEvent)=\"showNewCard = $event\"\n [showNewCard]=\"showNewCard\">\n </pw-saved-card-details>\n }\n <!-- Add New Payment Starts, opens up when user doesn't have stripe account or tries to change the\n card details -->\n @if (!isFree && ((user && !cardDetails) || (cardDetails && showNewCard))) {\n <h4 class=\"title\">\n {{ 'User.Subscriptions.NewCard' | transloco }}?\n </h4>\n <div class=\"row\">\n <div class=\"col-md-9\">\n <div class=\"mb-3\">\n <label for=\"upgrade-subscription-card_number\">{{\n 'User.Subscriptions.CardNumber' | transloco\n }}</label>\n <input type=\"text\"\n id=\"upgrade-subscription-card_number\"\n class=\"form-control\"\n formControlName=\"card_number\"\n [placeholder]=\"'User.Subscriptions.CardNumber' | transloco\"\n name=\"card_number\"\n [attr.aria-label]=\"'User.Subscriptions.CardNumber' | transloco\" />\n @if (\n form.get('card_number').touched &&\n form.get('card_number').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.CardNumberRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"mb-3\">\n <label for=\"upgrade-subscription-cvc\">{{\n 'User.Subscriptions.CVC' | transloco\n }}</label>\n <input type=\"text\"\n id=\"upgrade-subscription-cvc\"\n class=\"form-control\"\n formControlName=\"cvc\"\n [placeholder]=\"'User.Subscriptions.CVC' | transloco\"\n name=\"cvc\"\n [attr.aria-label]=\"'User.Subscriptions.CVC' | transloco\" />\n @if (\n form.get('cvc').touched &&\n form.get('cvc').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.CvcRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only pw-label-style\" id=\"upgrade-subscription-exp_month-label\">{{ 'User.Payments.ExpMonth' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'upgrade-subscription-exp_month-label'\"\n [options]=\"months\"\n formControlName=\"exp_month\"\n [placeholder]=\"'User.Payments.ExpMonth' | transloco\"\n optionValue=\"value\"\n [appendTo]=\"'body'\"\n optionLabel=\"value\">\n </p-select>\n @if (\n form.get('exp_month').touched &&\n form.get('exp_month').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.ExpMonthRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"mb-3\">\n <span class=\"sr-only\" id=\"upgrade-subscription-exp_year-label\">{{ 'User.Payments.ExpYear' | transloco }}</span>\n <p-select\n [attr.aria-labelledby]=\"'upgrade-subscription-exp_year-label'\"\n [options]=\"years\"\n formControlName=\"exp_year\"\n [placeholder]=\"'User.Payments.ExpYear' | transloco\"\n [appendTo]=\"'body'\"\n optionValue=\"value\"\n optionLabel=\"value\">\n </p-select>\n @if (\n form.get('exp_year').touched &&\n form.get('exp_year').errors?.required\n ) {\n <div class=\"danger\"\n >\n <span>{{ 'User.Payments.Errors.ExpYearRequired' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n @if (cardDetails) {\n <div class=\"col-12 mt-2\"\n >\n <a [attr.aria-label]=\"'User.Subscriptions.Upgrade.UseSavedCard' | transloco\"\n (click)=\"showNewCard = false; onDiscardToggle()\">{{ 'User.Subscriptions.Upgrade.UseSavedCard' | transloco }}</a>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <!-- Purchase Summary -->\n @if (product) {\n <div class=\"col-md-6\"\n >\n <div class=\"purchase-summary card p-3 payment-right\">\n <div class=\"card-body\">\n <h4 class=\"title\">{{ 'Label.PurchaseSummary' | transloco }}</h4>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Plan' | transloco }}:</div>\n <div class=\"summary-right\">{{ product.name }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Price' | transloco }}:</div>\n <div class=\"summary-right\">\n {{ product.currency }}\n {{ (product.price_per_unit / 100) | number:'1.2-2' }}\n </div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Seats' | transloco }}:</div>\n <div class=\"summary-right\">{{ form.get('units').value }}</div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">{{ 'Label.Total' | transloco }}:</div>\n <div class=\"summary-right\">\n {{ product.currency }} {{ totalAmount | number:'1.2-2' }}\n </div>\n </div>\n <div class=\"summary-row d-flex mb-2\">\n <div class=\"summary-left\">\n {{ 'Label.Recurrency' | transloco }}:\n </div>\n <div class=\"summary-right\">{{ product.billing_frequency }}</div>\n </div>\n </div>\n <div class=\"text-center\">\n <hr />\n <p>\n {{ 'User.Subscriptions.Upgrade.TermsAcknowledgement' | transloco }}\n </p>\n </div>\n </div>\n </div>\n }\n </div>\n <div class=\"row\">\n <div class=\"col-12 text-center mt-3\">\n <img src=\"/assets/img/icons/powered_by_stripe_v2.png\"\n class=\"payment-provider\"\n alt=\"\" />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"form-actions text-end\">\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default me-1\"\n [disabled]=\"isPurchaseAttempted\"\n routerLink=\"/account/subscriptions\">\n <i class=\"ft-x\" aria-hidden=\"true\"></i>{{ 'Button.Back' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [disabled]=\"isPurchaseAttempted\"\n [buttonBusy]=\"busy\">\n <i class=\"ft-check\" aria-hidden=\"true\"></i>\n {{ 'Button.Purchase' | transloco }}\n </button>\n </div>\n </div>\n </div>\n </form>\n </ng-container>\n</div>\n\n<pw-password-validation #passwordValidationModal\n (successEvent)=\"onValidatePassword($event)\">\n <div class=\"row\">\n <div class=\"col-12\">\n <p>\n @if (!isFree) {\n {{ 'User.Subscriptions.Upgrade.ChargeNotice' | transloco }}\n }\n @if (totalAmount) {\n <strong>{{ product.currency }} {{ totalAmount | number:'1.2-2' }}</strong>\n }\n </p>\n </div>\n </div>\n</pw-password-validation>\n","import {\n AbstractControl,\n FormBuilder,\n ValidationErrors,\n ValidatorFn,\n Validators\n} from '@angular/forms';\n\nimport { ValidationService } from '@posiwise/common-services';\n\nexport function commaSeparatedEmailsValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) {\n return null; // Allow empty values\n }\n\n const value = control.value as string;\n\n // Check if there are spaces around commas (comma-space or space-comma patterns)\n if (value.includes(',') && (value.includes(', ') || value.includes(' ,'))) {\n return { invalidFormat: true };\n }\n\n // Check if any email part contains spaces (after splitting by comma)\n const emailParts = value.split(',');\n if (emailParts.some((part: string) => part.trim() !== part || part.includes(' '))) {\n return { invalidFormat: true };\n }\n\n // Validate each email\n const emails = emailParts.map((email: string) => email.trim());\n for (const email of emails) {\n if (email && !ValidationService.email(email)) {\n return { invalidEmail: true };\n }\n }\n\n return null;\n };\n}\n\nexport function createSubscriptionDetailsForm(fb: FormBuilder) {\n return fb.group({\n organisation: ['', [Validators.required]],\n contact_name: ['', [Validators.required]],\n contact_email: ['', [Validators.required, Validators.email]],\n contact_tel: [''],\n tax_id: [''],\n invoice_recipient_emails: ['', [commaSeparatedEmailsValidator()]],\n address: ['', [Validators.required]],\n country_code: ['', [Validators.required]],\n facebook_handle: [''],\n twitter_handle: [''],\n linkedin_handle: [''],\n reddit_handle: [''],\n company_url: [''],\n enforce_2fa: [false],\n rag_use_own_data: [true],\n rag_keep_pii: [false],\n rag_slack_history: [false]\n });\n}\n\n/** Strips the spaces around each address of a comma-separated e-mail list. */\nexport function trimEmailList(emails: string): string {\n return emails\n .split(',')\n .map((email: string) => email.trim())\n .join(',');\n}\n\n/** `{slug}_{timestamp}.png` file for an uploaded logo image. */\nexport function slugPngFile(slug: string, blob: Blob): File {\n const filename = `${`${slug.toLocaleLowerCase()}_${Date.parse(new Date().toString())}`}.png`;\n return new File([blob], filename);\n}\n","import { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { SubscriptionService } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\n/** API token display and refresh of the subscription details page (undecorated base). */\nexport abstract class SubscriptionApiTokens extends AppBaseComponent {\n protected readonly subscriptionService = inject(SubscriptionService);\n protected readonly cdr = inject(ChangeDetectorRef);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n subscription: Subscription;\n subscriptionId: number;\n\n showApiToken = false;\n showApiClientId = false;\n refreshingTokens = false;\n\n protected abstract fetchData(): void;\n\n toggleApiTokenVisibility() {\n this.showApiToken = !this.showApiToken;\n }\n\n toggleApiClientIdVisibility() {\n this.showApiClientId = !this.showApiClientId;\n }\n\n refreshApiTokens() {\n this.confirmDialog\n .open({\n title: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmTitle'\n ),\n text: this.translation.translate('Common.Confirm.RefreshApiTokens.Text'),\n destructive: true,\n confirmLabel: this.translation.translate(\n 'User.Subscriptions.APICredentials.RefreshConfirmLabel'\n )\n })\n .then(ok => {\n if (ok) {\n this.performTokenRefresh();\n }\n });\n }\n\n private performTokenRefresh() {\n this.refreshingTokens = true;\n this.subscriptionService\n .refreshApiTokens(this.subscriptionId)\n .subscribe({\n next: ({ result }) => {\n if (result && result.api_access_token) {\n this.subscription.api_access_token = result.api_access_token;\n }\n if (result && result.api_client_id) {\n this.subscription.api_client_id = result.api_client_id;\n }\n\n this.showApiToken = false;\n this.showApiClientId = false;\n this.fetchData();\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.refreshingTokens = false;\n this.cdr.markForCheck();\n });\n }\n}\n","import { inject } from '@angular/core';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { dataUrlToBlob } from '../../account-details/account-details.utils';\n\nimport { SubscriptionApiTokens } from './subscription-api-tokens';\nimport { slugPngFile } from './subscription-details.utils';\n\n/** Full and squared logo upload of the subscription details page (undecorated base). */\nexport abstract class SubscriptionLogos extends SubscriptionApiTokens {\n protected readonly modalService = inject(NgbModal);\n\n squaredLogo: string;\n fullLogo: string;\n fullLogoBroken = false;\n squaredLogoBroken = false;\n slug: string;\n\n openModal(content) {\n this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });\n }\n\n onImageSelection(event) {\n const file = slugPngFile(this.slug, this.dataURLtoBlob(event));\n this.subscriptionService.addFullLogo(this.subscriptionId, file).subscribe(res => {\n this.modalService.dismissAll();\n this.fullLogo = res?.result?.full_logo?.url;\n this.fullLogoBroken = false;\n this.cdr.markForCheck();\n });\n }\n\n uploadSquaredLogo(event) {\n const file = slugPngFile(this.slug, this.dataURLtoBlob(event));\n this.subscriptionService.addSquaredLogo(this.subscriptionId, file).subscribe(res => {\n this.modalService.dismissAll();\n this.squaredLogo = res?.result?.squared_logo?.url;\n this.squaredLogoBroken = false;\n this.cdr.markForCheck();\n });\n }\n\n onClose() {\n this.modalService.dismissAll();\n }\n\n dataURLtoBlob(dataUrl) {\n return dataUrlToBlob(dataUrl);\n }\n}\n","import { PasswordValidationComponent } from '@posiwise/shared-components';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { SubscriptionLogos } from './subscription-logos';\n\n/** Seat (unit) count changes of the subscription details page (undecorated base). */\nexport abstract class SubscriptionSeats extends SubscriptionLogos {\n abstract modal: PasswordValidationComponent;\n\n allowUpdate: boolean;\n hasUnitChanged: boolean;\n\n unitError: string;\n\n units = 1;\n\n totalAmount() {\n const allProductsPrice = this.subscription.products.map(x => x.price_per_unit * this.units);\n\n return allProductsPrice.reduce((a: number, b: number) => a + b, 0) / 100;\n }\n\n /** *\n * Update seats for all the products of subscription\n */\n updateUnits() {\n if (this.subscription.products[0].trial_subscription) {\n return;\n }\n this.modal.open();\n }\n\n onPasswordValidation(_event) {\n this.subscriptionService\n .updateSubscriptionUnit(this.subscription.id, this.units)\n .subscribe(({ result }) => {\n if (result.status === StatusCodes.OK) {\n this.toast.success(\n this.translation.translate('User.Subscriptions.Details.UnitsUpdatedMessage')\n );\n } else {\n this.toast.error(this.translation.translate('GenericMessage.WentWrong'));\n }\n this.cdr.markForCheck();\n });\n }\n\n onMaxReached(event) {\n if (event) {\n this.unitError = this.translation.translate('Register.Units.Maximum', {\n units: this.units\n });\n }\n }\n\n onMinReached(event) {\n if (event) {\n this.unitError = this.translation.translate('Register.Units.Minimum', {\n units: this.units\n });\n }\n }\n\n onUnitChange(event) {\n this.allowUpdate = true;\n this.hasUnitChanged = true;\n this.units = event;\n this.unitError = '';\n }\n}\n","import { AsyncPipe, CurrencyPipe, DecimalPipe, NgClass } from '@angular/common';\nimport { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\nimport { NgxGpAutocompleteModule } from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppState, GetUser } from '@posiwise/app-store';\nimport { AI_ASSISTANT_FLAG, API_MCP_ACCESS_FLAG, GeoService } from '@posiwise/common-services';\nimport { Country, Product, User } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective, RbacAllowDirective } from '@posiwise/directives';\nimport { CurrencySymbolPipe } from '@posiwise/pipes';\nimport {\n InputContainerComponent,\n NumberPickerComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1,\n PwStickyActionsComponent\n} from '@posiwise/shared-components';\nimport { ProfileImageCropperComponent, ValidateForm } from '@posiwise/utils';\n\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\nimport { Tooltip } from 'primeng/tooltip';\nimport { combineLatest, map, Observable } from 'rxjs';\n\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\nimport { Store } from '@ngrx/store';\n\nimport { createSubscriptionDetailsForm, trimEmailList } from './subscription-details.utils';\nimport { SubscriptionSeats } from './subscription-seats';\n\n@Component({\n templateUrl: './user-subscription-details.component.html',\n styleUrls: ['./user-subscription-details.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n Select,\n NgxGpAutocompleteModule,\n Tooltip,\n LazyImgDirective,\n RbacAllowDirective,\n NumberPickerComponent,\n NgClass,\n UiSwitchModule,\n PwStickyActionsComponent,\n RouterLink,\n ButtonBusyDirective,\n ProfileImageCropperComponent,\n PasswordValidationComponent_1,\n AsyncPipe,\n DecimalPipe,\n CurrencyPipe,\n TranslocoPipe,\n CurrencySymbolPipe\n ]\n})\nexport class UserSubscriptionDetailsComponent\n extends SubscriptionSeats\n implements OnInit, OnDestroy\n{\n private readonly fb = inject(FormBuilder);\n private readonly geoService = inject(GeoService);\n private readonly store = inject<Store<AppState>>(Store);\n private readonly transloco = inject(TranslocoService);\n\n @ViewChild('modal', { static: true }) modal: PasswordValidationComponent;\n\n busyButton = false;\n\n form: FormGroup;\n\n countries$: Observable<Country[]>;\n\n userId: number;\n\n user: User;\n\n constructor() {\n super();\n this.form = createSubscriptionDetailsForm(this.fb);\n this.route.params.subscribe(params => {\n this.subscriptionId = +params['subscriptionId'];\n this.fetchData();\n this.cdr.markForCheck();\n });\n }\n\n ngOnInit() {\n this.geoService.getCountries().subscribe(() => {\n this.countries$ = combineLatest([\n this.geoService.getCountries(),\n this.transloco.selectTranslate('User.Profile.SelectCountry')\n ]).pipe(\n map(([countries, label]: [Country[], string]) => [\n { name: label, code: null },\n ...countries\n ])\n );\n this.cdr.markForCheck();\n });\n this.userStore().subscribe(user => {\n if (user) {\n this.slug = user.slug;\n this.user = user;\n this.userId = user.id;\n }\n this.cdr.markForCheck();\n });\n }\n\n protected fetchData() {\n this.subscriptionService.getById(this.subscriptionId).subscribe(({ result }) => {\n this.subscription = result;\n this.fullLogo = this.subscription?.full_logo.url;\n this.squaredLogo = this.subscription?.squared_logo?.url;\n this.fullLogoBroken = false;\n this.squaredLogoBroken = false;\n this.form.patchValue(this.subscription);\n this.units = this.subscription?.products[0]?.purchased_units;\n this.form.patchValue({\n units: this.units\n });\n if (this.canManage) {\n this.form.enable({ emitEvent: false });\n } else {\n this.form.disable({ emitEvent: false });\n }\n this.cdr.markForCheck();\n });\n }\n\n /** White-label company name for \"Your {brand} AI assistant\" (same source as the login page and chat widget). */\n get brandName(): string {\n return this.appConfig?.company?.name?.trim() || 'PosiWise';\n }\n\n /** Plain members can view the subscription but only its admins can change it. */\n get canManage(): boolean {\n return !!this.subscription?.can_manage;\n }\n\n get apiMcpEnabled(): boolean {\n return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG];\n }\n\n get aiAssistantEnabled(): boolean {\n return !!this.user?.feature_flags?.[AI_ASSISTANT_FLAG];\n }\n\n @ValidateForm('form')\n onSaveDetails() {\n this.busyButton = true;\n const formValue = { ...this.form.value };\n\n // Process invoice_recipient_emails: remove spaces from comma-separated emails\n if (formValue.invoice_recipient_emails) {\n formValue.invoice_recipient_emails = trimEmailList(formValue.invoice_recipient_emails);\n }\n\n this.subscriptionService\n .updateSubscription(Number(this.subscriptionId), formValue)\n .subscribe(() => {\n this.form.markAsPristine();\n this.toast.success(\n this.translation.translate('User.Subscriptions.Details.UpdatedMessage')\n );\n this.store.dispatch(new GetUser());\n this.back();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.busyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n handleAddressChange(event) {\n this.form.get('address').setValue(event.formatted_address);\n }\n\n trackByProduct(_index: number, item: Product) {\n return item.id;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.allowUpdate = false;\n }\n}\n","<!-- edit Subscription details page -->\n<div class=\"row\">\n <div class=\"col-12\">\n <h3 class=\"my-3\">{{ subscription?.organisation || subscription?.contact_name }}</h3>\n @if (subscription && !canManage) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.Details.ReadOnly' | transloco }}</p>\n }\n </div>\n</div>\n\n@if (subscription) {\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetails()\"\n class=\"row mt-4\"\n >\n <!-- 1. Contact details -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Contact' | transloco }}</h3>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactName' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactName' | transloco\"\n name=\"contact_name\"\n controlId=\"user-subscription-contact_name\"\n errorMsg=\"User.Account.Validation.ContactName\">\n <input type=\"text\"\n id=\"user-subscription-contact_name\"\n class=\"form-control\"\n formControlName=\"contact_name\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactName' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactEmail' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\"\n name=\"contact_email\"\n controlId=\"user-subscription-contact_email\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactEmail\">\n <input type=\"text\"\n id=\"user-subscription-contact_email\"\n class=\"form-control\"\n formControlName=\"contact_email\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Organization' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Organisation' | transloco\"\n name=\"organisation\"\n controlId=\"user-subscription-organisation\"\n errorMsg=\"User.Subscriptions.Details.Validation.Organisation\">\n <input type=\"text\"\n id=\"user-subscription-organisation\"\n class=\"form-control\"\n formControlName=\"organisation\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Organisation' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Phone' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactTel' | transloco\"\n name=\"contact_tel\"\n controlId=\"user-subscription-contact_tel\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactTel\">\n <input type=\"text\"\n id=\"user-subscription-contact_tel\"\n class=\"form-control\"\n formControlName=\"contact_tel\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactTel' | transloco\" />\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Country' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country_code\"\n controlId=\"user-subscription-country_code\"\n [useAriaLabelledbyOnly]=\"true\"\n [isLeftTooltip]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'user-subscription-country_code-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country_code\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Address' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Address' | transloco\"\n name=\"address\"\n controlId=\"user-subscription-address\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Address\">\n <input ngx-gp-autocomplete\n id=\"user-subscription-address\"\n name=\"address\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'user-subscription-address-label'\"\n #places=\"ngx-places\"\n formControlName=\"address\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Address' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.VatNumber' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TaxId' | transloco\"\n name=\"tax_id\"\n controlId=\"user-subscription-tax_id\"\n errorMsg=\"User.Subscriptions.Details.Validation.TaxId\">\n <input type=\"text\"\n id=\"user-subscription-tax_id\"\n class=\"form-control\"\n formControlName=\"tax_id\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TaxId' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.CompanyUrl' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\"\n name=\"company_url\"\n controlId=\"user-subscription-company_url\"\n errorMsg=\"User.Subscriptions.Details.Validation.CompanyUrl\">\n <input type=\"text\"\n id=\"user-subscription-company_url\"\n class=\"form-control\"\n formControlName=\"company_url\"\n [attr.aria-label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.InvoiceRecipientEmails' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\"\n name=\"invoice_recipient_emails\"\n controlId=\"user-subscription-invoice_recipient_emails\"\n errorMsg=\"User.Subscriptions.Details.Validation.InvoiceRecipientEmails\">\n <input type=\"text\"\n id=\"user-subscription-invoice_recipient_emails\"\n class=\"form-control\"\n formControlName=\"invoice_recipient_emails\"\n [placeholder]=\"'User.Subscriptions.Details.Placeholder.InvoiceRecipientEmails' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\" />\n </pw-input-container>\n\n <!-- 2. Branding / Logos -->\n <div class=\"col-12\">\n <div class=\"row branding-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Branding' | transloco }}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.FullLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.FullLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (fullLogo && !fullLogo.includes('no_image_uploaded') && !fullLogoBroken) {\n <img [src]=\"fullLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.FullAlt' | transloco\"\n class=\"image full-logo\"\n role=\"presentation\"\n (error)=\"fullLogoBroken = true\" />\n @if (canManage) {\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n }\n } @else {\n @if (canManage) {\n <div class=\"logo-dropzone full-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadFull' | transloco\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n }\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.SquaredLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (squaredLogo && !squaredLogo.includes('no_image_uploaded') && !squaredLogoBroken) {\n <img [src]=\"squaredLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.SquaredAlt' | transloco\"\n class=\"squared_logo\"\n role=\"presentation\"\n (error)=\"squaredLogoBroken = true\" />\n @if (canManage) {\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n }\n } @else {\n @if (canManage) {\n <div class=\"logo-dropzone squared-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadSquared' | transloco\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 3. Social Media -->\n <ng-container *rbacAllow=\"'SubscriptionSuperAdmin'\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.SocialMedia' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.SocialMedia.Description' | transloco }}\n </p>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.FacebookHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\"\n name=\"facebook_handle\"\n controlId=\"user-subscription-facebook_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.FacebookHandle\">\n <input type=\"text\"\n id=\"user-subscription-facebook_handle\"\n class=\"form-control\"\n formControlName=\"facebook_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.TwitterHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\"\n name=\"twitter_handle\"\n controlId=\"user-subscription-twitter_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.TwitterHandle\">\n <input type=\"text\"\n id=\"user-subscription-twitter_handle\"\n class=\"form-control\"\n formControlName=\"twitter_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.LinkedinHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\"\n name=\"linkedin_handle\"\n controlId=\"user-subscription-linkedin_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.LinkedinHandle\">\n <input type=\"text\"\n id=\"user-subscription-linkedin_handle\"\n class=\"form-control\"\n formControlName=\"linkedin_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RedditHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\"\n name=\"reddit_handle\"\n controlId=\"user-subscription-reddit_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.RedditHandle\">\n <input type=\"text\"\n id=\"user-subscription-reddit_handle\"\n class=\"form-control\"\n formControlName=\"reddit_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\" />\n </pw-input-container>\n </ng-container>\n\n <!-- 4. Seats -->\n <div class=\"col-12\">\n <div class=\"row seats-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</h3>\n <p>{{ 'User.Subscriptions.Details.Seats.Description' | transloco }}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (subscription?.trial_subscription && subscription?.calculated_price) {\n <small\n class=\"text-danger\">{{ 'User.Subscriptions.Details.Seats.UpgradeRequired' | transloco }}</small>\n }\n </div>\n </div>\n <div class=\"row btns-row align-items-center\">\n @if (subscription) {\n <div class=\"col-md-3 col-8\"\n >\n <label for=\"user-subscription-seats\" class=\"visually-hidden\">{{ 'User.Subscriptions.Tooltip.Seats' | transloco }}</label>\n <pw-number-picker [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Seats'|transloco\"\n inputId=\"user-subscription-seats\"\n name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription?.min_units||subscription?.products[0].min_units\"\n [max]=\"subscription?.products[0].max_units\"\n step=\"1\"\n [postfix]=\"'User.Subscriptions.Details.Seats.Postfix' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"!canManage || subscription?.products[0].trial_subscription\"\n [showUpButton]=\"canManage && !subscription?.products[0].trial_subscription\"\n [showDownButton]=\"canManage && !subscription?.products[0].trial_subscription\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n }\n\n @if (subscription) {\n <div class=\"col-md-3 col-4 p-1\"\n >\n @if (canManage && !subscription?.products[0].trial_subscription && allowUpdate) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"updateUnits()\">\n {{ 'User.Subscriptions.UpdateUnits' | transloco }}\n </button>\n } @else {\n <div>\n @if (subscription?.products[0].trial_subscription) {\n <small class=\"text-muted\"\n >{{ 'User.Subscriptions.Details.Seats.PaidOnly' | transloco }}</small>\n }\n </div>\n }\n </div>\n }\n\n @if (hasUnitChanged) {\n <div class=\"col-12 col-md-6\"\n >\n <table class=\"table table-borderless table-sm\"\n aria-describedby=\"Product details\">\n <thead>\n <tr>\n <th scope=\"true\">{{ 'Label.Product' | transloco }}</th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Seats.PricePerSeat' | transloco }} <span>({{subscription?.products[0]?.currency|currencySymbol}})</span></th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</th>\n </tr>\n </thead>\n <tbody>\n @for (product of subscription.products; track trackByProduct($index, product)) {\n <tr>\n <td>{{ product.name }}</td>\n <td>{{ product.price_per_unit / 100 }}</td>\n <td>{{ units }}</td>\n </tr>\n }\n </tbody>\n </table>\n <p>\n {{ 'User.Subscriptions.Details.Seats.NewCost' | transloco }}\n <strong>{{ totalAmount()| currency: subscription?.products[0]?.currency:'symbol-narrow'}}</strong>\n </p>\n </div>\n }\n </div>\n </div>\n\n <!-- 5. API & MCP Credentials -->\n @if (canManage && apiMcpEnabled && subscription?.api_hits_max > 0) {\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.ApiIntro' | transloco }}\n </p>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-token\">\n {{ 'User.Subscriptions.APICredentials.AccessToken' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Details.Tooltip.TokenDiscontinued' | transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? subscription?.api_access_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.AccessToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-client-id\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? subscription?.api_client_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ClientId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (subscription?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits | number }}</span>\n }\n @if (subscription?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (subscription?.api_hits !== null || subscription?.api_hits_max !== null) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (subscription.api_hits / subscription.api_hits_max) <= 0.8,\n 'text-warning': (subscription.api_hits / subscription.api_hits_max) > 0.8 && (subscription.api_hits / subscription.api_hits_max) <= 0.9,\n 'text-danger': (subscription.api_hits / subscription.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((subscription.api_hits / subscription.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- 6. Security -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Security' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.Security.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.Details.Enforce2fa' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Enforce2fa' | transloco\"\n name=\"enforce_2fa\"\n controlId=\"user-subscription-enforce_2fa\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"enforce_2fa\"\n name=\"enforce_2fa\"\n [attr.aria-labelledby]=\"'user-subscription-enforce_2fa-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n\n @if (aiAssistantEnabled) {\n <!-- 7. Brain AI data -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.BrainData.Title' | transloco: { brand: brandName } }}</h3>\n <p>{{ 'User.Subscriptions.BrainData.Description' | transloco: { brand: brandName } }}</p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.UseOwnDataLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagUseOwnData' | transloco: { brand: brandName }\"\n name=\"rag_use_own_data\"\n controlId=\"user-subscription-rag_use_own_data\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_use_own_data\"\n name=\"rag_use_own_data\"\n [attr.aria-labelledby]=\"'user-subscription-rag_use_own_data-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Keeping personal data is a question about WHAT is kept, so it only\n arises while there is something to keep. Hidden rather than disabled:\n a greyed-out switch still reads as an affordance, and the stored value\n survives in the form either way. -->\n @if (form.value.rag_use_own_data) {\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.KeepPiiLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagKeepPii' | transloco: { brand: brandName }\"\n name=\"rag_keep_pii\"\n controlId=\"user-subscription-rag_keep_pii\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_keep_pii\"\n name=\"rag_keep_pii\"\n [attr.aria-labelledby]=\"'user-subscription-rag_keep_pii-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Slack history is also the subscription's own data, so it needs \"Use subscription data\" too. -->\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.SlackHistoryLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagSlackHistory' | transloco: { brand: brandName }\"\n name=\"rag_slack_history\"\n controlId=\"user-subscription-rag_slack_history\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_slack_history\"\n name=\"rag_slack_history\"\n [attr.aria-labelledby]=\"'user-subscription-rag_slack_history-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n } @else {\n <div class=\"col-12 col-sm-6\">\n <p>{{ 'User.Subscriptions.BrainData.KeepPiiNotApplicable' | transloco: { brand: brandName } }}</p>\n </div>\n }\n }\n @if (canManage) {\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n routerLink=\"/account/subscriptions\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n [buttonBusy]=\"busyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n }\n </form>\n}\n\n<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.FullLogo' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"onImageSelection($event)\"\n aspectRatio=\"fullLogo\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<ng-template #squaredLogoContent\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"uploadSquaredLogo($event)\"\n aspectRatio=\"auto\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<pw-password-validation #modal\n(successEvent)=\"onPasswordValidation($event)\"> </pw-password-validation>\n","import { Clipboard } from '@angular/cdk/clipboard';\nimport { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AdminService } from '@posiwise/admin-module-utils';\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n API_MCP_ACCESS_FLAG,\n PermissionService,\n SubscriptionService\n} from '@posiwise/common-services';\nimport { Product, Subscription, User } from '@posiwise/common-utilities';\nimport { ConfirmDialogService, PasswordValidationComponent } from '@posiwise/shared-components';\n\nimport { CurrentItem } from '../../../shared/interface/user-module.interface';\n\n/** API-key reveal/refresh, account deletion and terms dialog of the subscriptions list (undecorated base). */\nexport abstract class SubscriptionListActions extends AppBaseComponent {\n protected readonly subscriptionService = inject(SubscriptionService);\n private readonly adminService = inject(AdminService);\n private readonly clipboard = inject(Clipboard);\n protected readonly cdr = inject(ChangeDetectorRef);\n protected readonly confirmDialog = inject(ConfirmDialogService);\n\n abstract passwordValidationModalForAccountDelete: PasswordValidationComponent;\n abstract passwordValidationModalForKey: PasswordValidationComponent;\n\n showApiKey = true;\n\n productName: string;\n\n user: User;\n\n currentItem: CurrentItem;\n\n showTos = false;\n\n productId: number;\n\n private readonly revealedClientIds = new Set<number>();\n\n protected abstract getSubscribedProduct(): void;\n\n /** Flag only, per product decision; deleted subscriptions are skipped because their ID no longer authenticates. */\n showsClientId(subscription: Subscription & { deleted?: boolean }): boolean {\n return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG] && !subscription.deleted;\n }\n\n isClientIdRevealed(subscriptionId: number): boolean {\n return this.revealedClientIds.has(subscriptionId);\n }\n\n toggleClientId(subscriptionId: number) {\n if (!this.revealedClientIds.delete(subscriptionId)) {\n this.revealedClientIds.add(subscriptionId);\n }\n }\n\n copyClientId(clientId: string) {\n if (this.clipboard.copy(clientId)) {\n this.toast.success(\n this.translation.translate('User.Subscriptions.List.ClientIdCopied')\n );\n }\n }\n\n onClipboardCopy(accessCode: string) {\n this.clipboard.copy(accessCode);\n this.toast.success(this.translation.translate('User.Subscriptions.AccessKeyCopied'));\n }\n\n updateApiKey(subscription, product) {\n this.subscriptionService\n .updateSubscriptionAPIKey(subscription.id, product.id)\n .subscribe(({ result }) => {\n product.api_access_token = result;\n this.toast.success(this.translation.translate('User.Subscriptions.UpdatedKey'));\n this.getSubscribedProduct();\n this.cdr.markForCheck();\n });\n }\n\n showKey(item) {\n this.currentItem = item;\n this.passwordValidationModalForKey.open();\n this.showApiKey = false;\n }\n\n displayApiKey() {\n this.showApiKey = true;\n this.currentItem.masked = this.currentItem?.api_access_token;\n }\n\n showModalForAccountDeletion() {\n this.confirmDialog\n .confirmDelete({\n textKey: 'Common.Confirm.Delete.TextSimple',\n textParams: { entityType: 'account' }\n })\n .then(ok => {\n if (ok) {\n this.passwordValidationModalForAccountDelete.open();\n }\n });\n }\n\n deleteUser(_event) {\n const subscriptionId = PermissionService.selectedSubscription.id;\n this.adminService.deleteUser(this.user.id, subscriptionId).subscribe(() => {\n this.router.navigate(['logout']);\n this.cdr.markForCheck();\n });\n }\n\n showPrivacyAndTos(product: Product) {\n this.productId = product.id;\n this.productName = product.name;\n this.showTos = true;\n }\n\n onCancel() {\n this.showTos = false;\n }\n}\n","import { DecimalPipe, NgClass, UpperCasePipe } from '@angular/common';\nimport { Component, OnInit, ViewChild } from '@angular/core';\nimport { RouterLink, RouterOutlet } from '@angular/router';\n\nimport { isInMobileWebView } from '@posiwise/common-services';\nimport { Product, Subscription } from '@posiwise/common-utilities';\nimport { RbacAllowDirective } from '@posiwise/directives';\nimport { DateFormatPipe } from '@posiwise/pipes';\nimport {\n NoDataComponent,\n PasswordValidationComponent,\n PasswordValidationComponent as PasswordValidationComponent_1,\n PrivacyAndTosComponent\n} from '@posiwise/shared-components';\n\nimport sortBy from 'lodash/sortBy';\nimport { MenuItem } from 'primeng/api';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Tooltip } from 'primeng/tooltip';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { AddSubscriptionComponent } from '../add-subscription/add-subscription.component';\nimport { SubscriptionRemovalComponent } from '../subscription-removal/subscription-removal.component';\n\nimport { SubscriptionListActions } from './subscription-list-actions';\n\n@Component({\n selector: 'pw-user-subscriptions-list',\n templateUrl: './user-subscriptions-list.component.html',\n styleUrls: ['./user-subscriptions-list.component.scss'],\n imports: [\n Bind,\n ProgressSpinner,\n RouterLink,\n Tooltip,\n NgClass,\n RbacAllowDirective,\n NoDataComponent,\n PasswordValidationComponent_1,\n SubscriptionRemovalComponent,\n PrivacyAndTosComponent,\n RouterOutlet,\n UpperCasePipe,\n DecimalPipe,\n TranslocoPipe,\n DateFormatPipe\n ]\n})\nexport class UserSubscriptionListComponent extends SubscriptionListActions implements OnInit {\n // Billing is managed on the website, never inside the mobile app (App Store 3.1.1).\n readonly inMobileApp = isInMobileWebView();\n\n @ViewChild('menuItems', { static: false })\n menu: MenuItem[];\n\n @ViewChild(AddSubscriptionComponent, { static: false })\n changeSubscriptionRef: AddSubscriptionComponent;\n\n @ViewChild('passwordValidationModalForAccountDelete', { static: false })\n passwordValidationModalForAccountDelete: PasswordValidationComponent;\n\n @ViewChild('passwordValidationModalForKey', { static: false })\n passwordValidationModalForKey: PasswordValidationComponent;\n\n @ViewChild(SubscriptionRemovalComponent, { static: false })\n removal: SubscriptionRemovalComponent;\n\n password: string;\n\n subscribedSubscriptions = [];\n\n activeItem: MenuItem;\n\n isAddNew: boolean;\n\n isUpdatePayment: false;\n\n selectedSubscription: { id: number; productId: number };\n\n editing: boolean;\n\n isLoaded = false;\n\n objectKeys = Object.keys;\n\n items: MenuItem[] = [\n { id: 'profile', label: 'Profile', icon: 'fa fa-fw fa-user-cog' },\n { id: 'subscription', label: 'Subscription', icon: 'fa fa-fw fa-book' },\n { id: 'invoice', label: 'Invoice', icon: 'fa fa-file-invoice-dollar' }\n ];\n\n constructor() {\n super();\n this.getSubscribedProduct = this.getSubscribedProduct.bind(this);\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe(params => {\n this.isAddNew = params['isNew'];\n this.getSubscribedProduct();\n this.selectedSubscription = null;\n this.cdr.markForCheck();\n });\n\n [this.activeItem] = this.items;\n }\n\n deleteSubscription(subscription: Subscription) {\n this.removal.start({ subscriptionId: subscription.id });\n }\n\n deleteProduct(subscription: Subscription, product: Product) {\n this.removal.start({ subscriptionId: subscription.id, productId: product.id });\n }\n\n onRemoved() {\n this.getSubscribedProduct();\n }\n\n protected getSubscribedProduct() {\n this.userStore().subscribe(user => {\n this.user = user;\n if (user) {\n this.userService.getUserSubscriptions(user.id).subscribe(response => {\n this.subscribedSubscriptions = sortBy(response.result.subscriptions, 'deleted');\n response?.result?.expired_subscriptions.forEach(subscription => {\n this.subscribedSubscriptions.push(subscription);\n });\n this.subscribedSubscriptions.forEach(subscription => {\n subscription.products.forEach((product: Product) => {\n product.masked = product.api_access_token\n ? '*************************'\n : null;\n });\n });\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n activateMenu() {\n this.activeItem = this.menu['activeItem'];\n if (this.activeItem.id === 'subscription') {\n this.getSubscribedProduct();\n }\n }\n\n discardEdit() {\n this.editing = false;\n this.selectedSubscription = null;\n }\n\n onSaveDetails() {\n this.toast.success(this.translation.translate('User.Subscriptions.UpdatedMessage'));\n this.editing = false;\n }\n\n onUpdatePaymentDetailsCancel() {\n this.router.navigate(['.'], { relativeTo: this.route, queryParams: {} });\n }\n\n attemptUpgrade(subscription: Subscription, product: Product) {\n if (this.user.has_password) {\n this.router.navigate([\n `account/subscriptions/upgrade/${subscription.id}/${product.id}`\n ]);\n } else {\n this.noPasswordModal();\n }\n }\n\n private noPasswordModal() {\n this.confirmDialog.open({\n titleKey: 'User.Subscriptions.SetPassword.Title',\n textKey: 'User.Subscriptions.SetPassword.Text',\n confirmOnly: true\n });\n }\n\n trackBySubscription(_index: number, item: { id: number }) {\n return item.id;\n }\n\n trackByProduct(_index: number, item: { id: number }) {\n return item.id;\n }\n}\n","@if (!showTos) {\n <!-- Subscriptions Tab Content -->\n @if (!editing && !isAddNew) {\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.List.Title' | transloco }}</h2>\n <p>{{ 'User.Subscriptions.List.Description' | transloco }}</p>\n </div>\n </div>\n }\n <!-- Subscribed Product Cards -->\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (\n !editing && !isAddNew && !isUpdatePayment && isLoaded && subscribedSubscriptions.length\n ) {\n <div class=\"row\"\n >\n @for (subscription of subscribedSubscriptions; track trackBySubscription($index, subscription)) {\n <div class=\"col-12 col-md-6 my-3\"\n >\n <div class=\"subscription-details mb-4\">\n <div class=\"subscription-summary d-flex flex-wrap justify-content-between align-items-start gap-2 mb-3\">\n <div class=\"subscription-summary__info\"\n [class.subscription-summary__info--client-id]=\"showsClientId(subscription)\">\n <div>\n <strong>{{ 'User.Subscriptions.List.Organisation' | transloco }}</strong>\n {{ subscription.organisation ? subscription.organisation : subscription.contact_name }}\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.TotalPriceExclTax' | transloco }}:</strong>\n @if (subscription.calculated_price) {\n {{ subscription.products[0]?.currency }} {{ subscription.calculated_price / 100 | number:'1.2-2' }}\n {{ subscription.products[0].trial_subscription ? ('User.Subscriptions.List.AfterTrial' | transloco) : '' }}\n } @else {\n {{ 'User.Subscriptions.Free' | transloco }}\n }\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.SeatsInUse' | transloco }}:</strong>\n {{ subscription.units_in_use || 1 }} / {{ subscription.purchased_units }}\n @if (subscription.purchased_units) {\n <span class=\"seats-usage\"\n [style.--seats-pct]=\"(subscription.units_in_use || 1) / subscription.purchased_units\"></span>\n }\n </div>\n @if (showsClientId(subscription)) {\n <div class=\"subscription-summary__client-id d-flex align-items-baseline gap-1\">\n <strong class=\"flex-shrink-0\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}:</strong>\n @if (subscription.api_client_id) {\n <code class=\"subscription-summary__client-id-value\"\n [attr.aria-hidden]=\"isClientIdRevealed(subscription.id) ? null : 'true'\">{{ isClientIdRevealed(subscription.id) ? subscription.api_client_id : '*************************' }}</code>\n <button type=\"button\"\n class=\"btn btn-sm flex-shrink-0\"\n [attr.aria-label]=\"(isClientIdRevealed(subscription.id) ? 'User.Subscriptions.APICredentials.Hide' : 'User.Subscriptions.APICredentials.View') | transloco\"\n [pTooltip]=\"(isClientIdRevealed(subscription.id) ? 'User.Subscriptions.APICredentials.Hide' : 'User.Subscriptions.APICredentials.View') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-pressed]=\"isClientIdRevealed(subscription.id)\"\n (click)=\"toggleClientId(subscription.id)\">\n <i class=\"fas\" [ngClass]=\"isClientIdRevealed(subscription.id) ? 'fa-eye-slash' : 'fa-eye'\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"btn btn-sm flex-shrink-0\"\n [attr.aria-label]=\"'User.Subscriptions.List.CopyClientId' | transloco\"\n [pTooltip]=\"'User.Subscriptions.List.CopyClientId' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"copyClientId(subscription.api_client_id)\">\n <i class=\"fal fa-copy\" aria-hidden=\"true\"></i>\n </button>\n } @else {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco }}</span>\n }\n </div>\n }\n </div>\n <!-- Subscription-level actions (a subscription may hold multiple products) -->\n @if (\n (subscription.is_subscription_owner || subscription.is_subscription_admin) &&\n subscription.products?.length &&\n !subscription.products[0].deleted &&\n !subscription.products[0].dependency_products?.length\n ) {\n <div class=\"subscription-summary__actions d-flex flex-wrap align-items-center gap-2\">\n <a class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'Button.Edit' | transloco\"\n [routerLink]=\"['../subscriptions', subscription.id]\">\n {{ 'Button.Edit' | transloco }}\n </a>\n @if (!subscription.products[0].expired && !subscription.products[0].trial_subscription) {\n <button [routerLink]=\"['../subscriptions', subscription.id, 'credential']\"\n class=\"btn btn-outline-secondary btn-sm\">\n {{ 'User.Subscriptions.Credentials' | transloco }}\n </button>\n }\n @if (!inMobileApp && !isUpdatePayment && subscription.stripe_customer_id) {\n <a class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"['../subscriptions', subscription.id, 'product', subscription.products[0].id, 'update-payment']\">\n <i class=\"fa fa-edit me-1\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.UpdateCardDetails' | transloco }}</a>\n }\n @if (!inMobileApp) {\n <button class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"'/account/subscriptions/add-new'\"\n [queryParams]=\"{ subscription_id: subscription.id }\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.ManageAllProducts' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <i class=\"fa fa-plus me-1\"></i>{{ 'User.Subscriptions.SeeAllProducts' | transloco }}\n </button>\n }\n @if (!subscription.has_child_subscriptions) {\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"deleteSubscription(subscription)\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.DeleteSubscription' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.DeleteSubscription' | transloco }}\n </button>\n }\n </div>\n }\n </div>\n <!-- Products list -->\n @for (\n product of subscription.products; track trackByProduct($index,\n product); let first = $first) {\n <div class=\"mb-3\">\n <div class=\"card subscription-products-cards\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <div>\n <h4 class=\"mb-3 text-bold-500 primary\">{{ product?.name }}</h4>\n <!-- Frequency -->\n <div>\n <div>\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.Frequency' | transloco\n }}:</strong>\n {{ product?.billing_frequency | uppercase }}\n </div>\n </div>\n <!-- Expiration -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n (product.expired ? 'User.Subscriptions.List.Expired' : 'User.Subscriptions.List.ExpiryDate') | transloco\n }}:</strong>\n {{ product.expires_at | dateFormat }}\n </div>\n <!-- Estimated Price -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.PriceExclTax' | transloco\n }}:</strong>\n {{ product.currency }}\n {{ (product.calculated_price / 100) | number:'1.2-2' }}\n </div>\n <!-- Product API Key (Alpha-only) -->\n <ng-container *rbacAllow=\"'Pages.Alpha'\">\n @if (\n (product.stripe_plan_id && product.max_hits > 0) ||\n product.max_hits_trial > 0\n ) {\n <div class=\"d-flex align-items-center\">\n <strong class=\"d-inline-block w-50\">\n {{ 'User.Subscriptions.ApiKey' | transloco }}:\n <i class=\"far fa-info-circle ms-1 text-muted\"\n aria-hidden=\"true\"\n [pTooltip]=\"'User.Subscriptions.ApiKey.NotUsedHint' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"></i>\n </strong>\n <code class=\"text-truncate me-2\">{{ product.masked }}</code>\n <span class=\"ms-auto d-flex align-items-center flex-shrink-0\">\n <!-- Show Access Key -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ShowKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"showKey(product)\">\n <i class=\"fas fa-eye\" aria-hidden=\"true\"></i>\n </button>\n <!-- Copy To Clipboard -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.CopyKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <i class=\"fal fa-copy\"\n aria-hidden=\"true\"\n (click)=\"onClipboardCopy(product.api_access_token)\"\n (keydown.enter)=\"onClipboardCopy(product.api_access_token)\"></i>\n </button>\n <!-- Update API Key -->\n @if (!product.expired && !product.deleted) {\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ChangeKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"updateApiKey(subscription, product)\">\n <i class=\"fal fa-sync-alt\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </div>\n }\n </ng-container>\n </div>\n </div>\n <div class=\"card-footer px-3 d-flex flex-column gap-2\">\n <div class=\"footer-status d-flex flex-wrap align-items-center gap-2\">\n @if (product.deleted && !product.expired) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.OutdatedMessage' | transloco }}\n </span>\n }\n @if (product.deleted) {\n <span class=\"badge bg-danger\">{{ 'User.Subscriptions.List.Deleted' | transloco }}</span>\n }\n @if (\n product.trial_subscription &&\n product.calculated_price\n ) {\n <span class=\"badge bg-warning\">{{ 'User.Subscriptions.Trial' | transloco }}</span>\n }\n @if (product?.pause_collection && objectKeys(product?.pause_collection)?.length) {\n <span class=\"badge bg-grey\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.PausedCollection'|transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.List.PausedCollection' | transloco }}\n </span>\n }\n @if (!product.calculated_price) {\n <span class=\"badge bg-success\">{{ 'User.Subscriptions.Free' | transloco }}</span>\n }\n @if (!product?.deleted && !subscription.is_subscription_owner) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.List.Invited' | transloco }}\n @if (subscription.is_subscription_admin) {\n <span class=\"badge bg-role-admin ms-1\">{{ 'User.Subscriptions.List.AsAdmin' | transloco }}</span>\n }\n </span>\n }\n </div>\n @if (\n subscription.is_subscription_owner ||\n subscription.is_subscription_admin\n ) {\n <div class=\"footer-actions d-flex flex-wrap align-items-center justify-content-end gap-2\">\n <!-- Secondary products only: the primary goes with the whole subscription -->\n @if (\n subscription.products.length > 1 &&\n !product.is_primary_product &&\n !product?.deleted\n ) {\n <span [pTooltip]=\"product.required_by_product_ids?.length ? ('User.Subscriptions.Tooltip.ProductRequired' | transloco) : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n [disabled]=\"product.required_by_product_ids?.length\"\n (click)=\"deleteProduct(subscription, product)\">\n {{ 'User.Subscriptions.DeleteProduct' | transloco }}\n </button>\n </span>\n }\n @if (!inMobileApp && product.stripe_plan_id && product.active) {\n <!-- Upgrade (single primary CTA) -->\n @if (product.trial_subscription && !product.deleted) {\n <button class=\"btn btn-primary btn-sm\"\n (click)=\"attemptUpgrade(subscription, product)\">\n {{ 'Button.Upgrade' | transloco }}\n </button>\n }\n <!-- Subscribe -->\n @if (subscription.expired && product.stripe_plan_id) {\n <button class=\"btn btn-primary btn-sm\"\n [routerLink]=\"'/account/subscriptions/add-new'\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </button>\n }\n }\n <!-- Privacy & Terms of Service (quiet link, not a button) -->\n @if (product?.product_privacy_service_id) {\n <button class=\"btn btn-link btn-sm p-0 footer-tos-link\"\n (click)=\"showPrivacyAndTos(product)\">\n {{\n 'User.Subscriptions.PrivacyAndTermsOfService'\n | transloco\n }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if (subscription.products.length === 0) {\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <p class=\"text-center\">\n {{ 'User.Subscriptions.List.NoProducts' | transloco }}\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n @if (!editing && !isAddNew && !isUpdatePayment) {\n <div class=\"col-12\"\n >\n @if (subscribedSubscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any subscription.\"\n >\n </pw-no-data>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n <!-- Danger zone (demoted account deletion) -->\n @if (!editing && !isAddNew && !isUpdatePayment && isLoaded) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"danger-zone mt-4\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger danger-zone__action\"\n (click)=\"showModalForAccountDeletion()\"\n [pTooltip]=\"'User.Account.Tooltip.DeleteAccount' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Account.DeleteAccount' | transloco }}\n </button>\n </div>\n </div>\n </div>\n }\n <!--\n Add New Subscription\n -->\n <!-- <ng-template [ngIf]=\"isAddNew && !isUpdatePayment\">\n <pw-subscription-details></pw-subscription-details>\n</ng-template> -->\n<!--\nValidate Password For Account Delete\n-->\n<pw-password-validation #passwordValidationModalForAccountDelete\n [destructive]=\"true\"\n (successEvent)=\"deleteUser($event)\">\n</pw-password-validation>\n<!--\nValidate Password For Display Key\n-->\n<pw-password-validation #passwordValidationModalForKey\n (successEvent)=\"displayApiKey()\">\n</pw-password-validation>\n<pw-subscription-removal [user]=\"user\" (removed)=\"onRemoved()\"></pw-subscription-removal>\n}\n\n@if (showTos) {\n <pw-privacy-and-tos [productId]=\"productId\"></pw-privacy-and-tos>\n}\n\n<router-outlet></router-outlet>\n","import { CurrencyPipe, DatePipe } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnDestroy } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { SkeletonTableComponent } from '@posiwise/app-loader';\nimport { Paging, POLL_TIMEOUT } from '@posiwise/common-utilities';\nimport { DynamicBadgeDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { NoDataComponent, RecordsSummaryComponent } from '@posiwise/shared-components';\n\nimport { LazyLoadEvent } from 'primeng/api';\nimport { Bind } from 'primeng/bind';\nimport { IconField } from 'primeng/iconfield';\nimport { InputIcon } from 'primeng/inputicon';\nimport { InputText } from 'primeng/inputtext';\nimport { ResizableColumn, SortableColumn, SortIcon, Table } from 'primeng/table';\nimport { Tooltip } from 'primeng/tooltip';\nimport { interval, Subscription } from 'rxjs';\nimport { mergeMap } from 'rxjs/operators';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-user-invoice',\n templateUrl: './user-invoice.component.html',\n styleUrls: ['./user-invoice.component.scss'],\n imports: [\n SkeletonTableComponent,\n Bind,\n Table,\n FormsModule,\n InputText,\n IconField,\n InputIcon,\n ResizableColumn,\n SortableColumn,\n SortIcon,\n DynamicBadgeDirective,\n Tooltip,\n NoDataComponent,\n RecordsSummaryComponent,\n CurrencyPipe,\n DatePipe,\n TranslocoPipe\n ]\n})\nexport class UserInvoiceComponent extends AppBaseComponent implements OnDestroy {\n private readonly cdr = inject(ChangeDetectorRef);\n\n invoices = [];\n buttonBusy = false;\n userId: number;\n totalRecordsUnFiltered = 0;\n\n searchText = '';\n subscription: Subscription;\n intervalTimer = interval(POLL_TIMEOUT * 60 * 1000);\n isLoaded = false;\n page = 0;\n totalRecords: number;\n\n invoiceFrequency = ['week', 'month', 'year'];\n\n onLazyLoad(event: LazyLoadEvent) {\n const pageDetails = HelperService.onTableLazyLoad(event);\n this.page = pageDetails.page;\n this.fetchInvoices({\n page: this.page,\n page_size: this.PAGE_SIZE,\n order_by: pageDetails.sortField,\n order_direction: pageDetails.sortOrder,\n search: this.searchText\n });\n }\n\n // isLoaded gates the FIRST paint only — paging/sort/search keep the table on screen.\n private fetchInvoices(paging: Paging) {\n this.userStore().subscribe(user => {\n if (user) {\n this.userId = user.id;\n this.userService\n .getUserInvoices(paging, user.id)\n .subscribe(({ result, page_info }) => {\n this.invoices = result;\n this.totalRecords = page_info.total_count;\n this.totalRecordsUnFiltered = page_info.total_count_unfiltered;\n this.pollForInvoices();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n private pollForInvoices() {\n this.subscription = this.intervalTimer\n .pipe(mergeMap(() => this.userService.getUserInvoices({}, this.userId)))\n .subscribe(({ result }) => {\n this.invoices = result;\n this.cdr.markForCheck();\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n","<div class=\"row\" [class.custom-disable-wrapper]=\"buttonBusy\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center\">\n <h2 class=\"card-title p-0 float-start\">{{ 'User.Invoices.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"6\" [showCaption]=\"true\" />\n </div>\n}\n<div class=\"row primeng-datatable-container actions-collapsed mt-0\" [class.d-none]=\"!isLoaded\" [class.custom-disable-wrapper]=\"buttonBusy\" [class.hideTable]=\"totalRecordsUnFiltered === 0\">\n <div class=\"col-12 px-0\">\n <p-table #tt\n [value]=\"invoices\"\n [paginator]=\"true\" [alwaysShowPaginator]=\"totalRecords !== 0\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n stateKey=\"pw-table.user-invoice\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"search-filter justify-content-end\">\n <div class=\"text-end\">\n <label for=\"user-invoice-search\" class=\"visually-hidden\">{{ 'User.Invoices.Search' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input id=\"user-invoice-search\"\n name=\"user-invoice-search\"\n [(ngModel)]=\"searchText\"\n (input)=\"tt.filterGlobal($event.target.value, 'contains')\"\n type=\"text\"\n pInputText\n [placeholder]=\"'User.Invoices.SearchPlaceholder' | transloco\"\n data-cy=\"incident-search\"\n [attr.aria-label]=\"'User.Invoices.Search' | transloco\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"date\">{{ 'User.Invoices.Date' | transloco }} <p-sort-icon field=\"date\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"frequency\">{{ 'User.Subscriptions.Frequency' | transloco }} <p-sort-icon field=\"frequency\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"seatsPurchased\">{{ 'User.Invoices.SeatsPurchased' | transloco }} <p-sort-icon field=\"seatsPurchased\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"subtotal\">{{ 'User.Invoices.Subtotal' | transloco }} <p-sort-icon field=\"subtotal\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"total\">{{ 'User.Invoices.TotalInclTax' | transloco }} <p-sort-icon field=\"total\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body let-invoice>\n <tr>\n <td>{{ invoice.date | date:'dd-MMM-yyyy' }}</td>\n <td>\n <span class=\"badge\"\n [appDynamicBadge]=\"{\n itemsArray: invoiceFrequency,\n item: invoice.product.billing_frequency\n }\"\n color=\"blue-grey\">{{ invoice.product.billing_frequency }}</span>\n </td>\n <td>{{ invoice?.subscription_product?.purchased_units }}</td>\n <td>{{ (invoice.subtotal_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td class=\"td-total\">{{ (invoice.total_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td>\n @if (invoice?.file?.url) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.file.url\" target=\"_blank\">\n <i class=\"fa fa-download\">&nbsp;{{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else if (invoice?.stripe_invoice_pdf) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.stripe_invoice_pdf\" target=\"_blank\">\n <i class=\"fa fa-download\">&nbsp;{{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-sm btn-primary invoice-download-unavailable\" aria-disabled=\"true\"\n data-cy=\"invoice-download-unavailable\"\n [pTooltip]=\"'User.Invoices.NoFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'User.Invoices.NoFile' | transloco\">\n <i class=\"fa fa-download\">&nbsp;{{ 'User.Invoices.Download' | transloco }}</i>\n </button>\n }\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (totalRecords === 0 && totalRecordsUnFiltered !== 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\" >\n </pw-no-data>\n </div>\n }\n\n @if (totalRecords !== 0) {\n <pw-records-summary [showing]=\"tt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n }\n\n </div>\n</div>\n@if (totalRecordsUnFiltered === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any invoice yet.\">\n </pw-no-data>\n}\n\n","import { Component, inject } from '@angular/core';\n\nimport { AppLoaderComponent } from '@posiwise/app-loader';\nimport { AI_ASSISTANT_PERMISSION, PermissionService } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\nimport {\n AiKnowledgeComponent,\n AiMemoryComponent,\n NoDataComponent\n} from '@posiwise/shared-components';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport {\n NgbNav,\n NgbNavContent,\n NgbNavItem,\n NgbNavLink,\n NgbNavOutlet\n} from '@ng-bootstrap/ng-bootstrap';\n\n/**\n * Settings › AI Knowledge: the member's personal Brain documents, filed under the\n * subscription currently selected in the sidebar. Read live from\n * `PermissionService.selectedSubscription` because the sidebar sets it after this\n * page can render, and switching subscription changes where the files belong.\n */\n@Component({\n selector: 'pw-ai-knowledge-tab',\n templateUrl: './ai-knowledge-tab.component.html',\n imports: [\n AppLoaderComponent,\n NoDataComponent,\n AiKnowledgeComponent,\n AiMemoryComponent,\n NgbNav,\n NgbNavItem,\n NgbNavLink,\n NgbNavContent,\n NgbNavOutlet,\n TranslocoPipe\n ]\n})\nexport class AiKnowledgeTabComponent {\n private readonly permissionService = inject(PermissionService);\n\n activeTab: 'files' | 'notes' = 'files';\n\n /** Permissions arrive after a hard refresh; decide nothing until they have. */\n get ready(): boolean {\n return !!this.permissionService.user;\n }\n\n /** Behind a flag for now. Checked here, not by a route guard — see the route. */\n get isEnabled(): boolean {\n return this.permissionService.evaluatePermissions(AI_ASSISTANT_PERMISSION);\n }\n\n get subscription(): (Subscription & { rag_use_own_data?: boolean }) | null {\n return PermissionService.selectedSubscription ?? null;\n }\n\n /** An absent flag is not consent — same rule as brain-api. */\n get useOwnData(): boolean {\n return this.subscription?.rag_use_own_data === true;\n }\n}\n","@if (!ready) {\n <pw-loader [isVisible]=\"true\"></pw-loader>\n} @else if (!isEnabled) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NotAvailable' | transloco\"></pw-no-data>\n} @else if (subscription) {\n <div class=\"title\">\n <h2>{{ 'AiKnowledge.PersonalTitle' | transloco: { name: subscription.organisation } }}</h2>\n </div>\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"activeTab\" [destroyOnHide]=\"false\" class=\"nav-tabs\">\n <li ngbNavItem=\"files\">\n <a ngbNavLink>{{ 'AiKnowledge.FilesTab' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-knowledge scope=\"personal\"\n [subscriptionId]=\"subscription.id\"\n [subscriptionName]=\"subscription.organisation\"\n [useOwnData]=\"useOwnData\"></pw-ai-knowledge>\n </ng-template>\n </li>\n <li ngbNavItem=\"notes\">\n <a ngbNavLink>{{ 'AiMemory.Title' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-memory [subscriptionId]=\"subscription.id\"></pw-ai-memory>\n </ng-template>\n </li>\n </ul>\n <div class=\"mt-3\" [ngbNavOutlet]=\"nav\"></div>\n} @else {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NoSubscription' | transloco\"></pw-no-data>\n}\n","import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AppState, getUser } from '@posiwise/app-store';\nimport { CommonService, ProfileService, UserNewsletter } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { Store } from '@ngrx/store';\n\n@Component({\n selector: 'pw-communication-tab',\n templateUrl: './communication-tab.component.html',\n styleUrl: './communication-tab.component.scss',\n imports: [Bind, ProgressSpinner, UiSwitchModule, NoDataComponent, TranslocoPipe]\n})\nexport class CommunicationTabComponent extends AppBaseComponent implements OnInit {\n private readonly commonService = inject(CommonService);\n private readonly profileService = inject(ProfileService);\n private readonly store = inject<Store<AppState>>(Store);\n private readonly cdr = inject(ChangeDetectorRef);\n\n subscriptions = [];\n userSubscription: UserNewsletter[] = [];\n\n isLoaded = false;\n\n user: User;\n\n ngOnInit() {\n this.getAllSubscription();\n }\n\n private getAllSubscription() {\n this.commonService.getAllNewsletter().subscribe(({ result }) => {\n this.store.select(getUser).subscribe(user => {\n if (user?.currentUser) {\n this.user = user.currentUser;\n this.profileService\n .getUserObject('user_newsletters', this.user.slug)\n .subscribe(newsletter => {\n this.isLoaded = true;\n this.userSubscription = newsletter.result;\n this.subscriptions = result;\n if (this.userSubscription.length > 0 && this.subscriptions.length > 0) {\n this.subscriptions.forEach(element => {\n const item = this.userSubscription?.find(\n x => x.newsletter_id === element.id\n );\n element.enabled = item ? item.send_newsletters : false;\n });\n } else {\n this.subscriptions.forEach(element => {\n element.enabled = false;\n });\n }\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n });\n }\n\n onValueChange(item, value) {\n const data = {\n send_newsletter: value\n };\n\n if (item.id === 9999) {\n const marketingSubs = {\n id: this.user.id,\n send_marketing_emails: value\n };\n this.profileService.updateUserProfile(marketingSubs).subscribe(() => {\n this.updateUser();\n this.toast.success(this.translation.translate('User.Settings.UpdatedMessage'));\n this.cdr.markForCheck();\n });\n } else {\n this.commonService.toggleNewsletter(item.id, data).subscribe(() => {\n this.updateUser();\n this.toast.success(\n this.translation.translate('User.Settings.Communications.UpdatedMessage')\n );\n this.cdr.markForCheck();\n });\n }\n }\n\n updateUser() {\n // this.userService.getUserInfo().subscribe(resp => {\n // this.localStorage.setItem('user', JSON.stringify(resp)).subscribe();\n // });\n }\n}\n","<div class=\"communication-settings\">\n <h2>{{ 'User.Settings.Communications.Title' | transloco }}</h2>\n\n <p class=\"settings-intro\">{{ 'User.Settings.Communications.Intro1' | transloco }}</p>\n <p class=\"settings-intro\">{{ 'User.Settings.Communications.Intro2' | transloco }}</p>\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n\n @if (isLoaded && subscriptions.length > 0) {\n <ul class=\"pref-list\">\n @for (item of subscriptions; track item; let idx = $index) {\n @if (item.visible || item.enabled) {\n <li class=\"pref-row\">\n <span class=\"pref-name\" [id]=\"'communication-tab-' + idx\">{{ item.name }}</span>\n <ui-switch [checked]=\"item.enabled\"\n [attr.aria-labelledby]=\"'communication-tab-' + idx\"\n (valueChange)=\"onValueChange(item, $event)\">\n </ui-switch>\n </li>\n }\n }\n </ul>\n }\n\n @if (isLoaded && subscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\"\n [message]=\"'User.Settings.Communications.NoDataMessage' | transloco\">\n </pw-no-data>\n }\n</div>\n","import { ChangeDetectorRef, Component, inject, OnDestroy, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { CommonService } from '@posiwise/common-services';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-others-tab',\n templateUrl: './others-tab.component.html',\n imports: [Bind, ProgressSpinner, UiSwitchModule, NoDataComponent, TranslocoPipe]\n})\nexport class OthersTabComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly commonService = inject(CommonService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n subscriptionConfigs = [];\n globalConfigs = [];\n\n userId: number;\n\n isLoaded = false;\n\n ngOnInit(): void {\n this.getGlobalConfigs();\n this.userStore().subscribe(res => {\n if (res) {\n this.userId = res.id;\n }\n this.cdr.markForCheck();\n });\n }\n\n private getGlobalSubscriptionConfig() {\n this.commonService\n .getAllGlobalSubscriptionConfigs()\n .subscribe(({ result }) => {\n this.subscriptionConfigs = result;\n this.globalConfigs.forEach(globalConfig => {\n const config = this.subscriptionConfigs?.find(\n subscriptionConfig =>\n subscriptionConfig.global_config_id === globalConfig?.id\n );\n globalConfig.value = config?.value;\n globalConfig.global_subscription_config_id = config?.id;\n });\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n private getGlobalConfigs() {\n this.commonService.getAllGlobalConfigs().subscribe(({ result }) => {\n this.globalConfigs = result;\n this.getGlobalSubscriptionConfig();\n this.cdr.markForCheck();\n });\n }\n\n onValueChange(item, value) {\n const data = {\n user_id: this.userId,\n value,\n global_config_id: item?.id\n };\n const sub$ = item?.global_subscription_config_id\n ? this.commonService.editGlobalSubscriptionConfig(\n item?.global_subscription_config_id,\n data\n )\n : this.commonService.postGlobalSubscriptionConfig(data);\n sub$.subscribe(() => {\n this.toast.success(this.translation.translate('User.OtherSettings.UpdatedMessage'));\n this.cdr.markForCheck();\n }).add(() => {\n this.getGlobalConfigs();\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Settings.Other.Title' | transloco }}</h2>\n </div>\n</div>\n@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n@if (isLoaded && globalConfigs?.length) {\n <div class=\"row mt-4 pt-1\"\n >\n <div class=\"col-md-6 col-sm-6\">\n @for (item of globalConfigs; track item; let idx = $index) {\n <div class=\"mb-3\">\n <div class=\"row\">\n <div class=\"col-md-10 col-sm-6\">\n <span class=\"pw-label-style\" [id]=\"'others-tab-' + idx\"> {{ item?.name }} </span>\n </div>\n <div class=\"col-md-2 col-sm-6\">\n <ui-switch [checked]=\"item.value === 'true'\"\n [attr.aria-labelledby]=\"'others-tab-' + idx\"\n (valueChange)=\"onValueChange(item, $event)\">\n </ui-switch>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n}\n\n@if (isLoaded && !globalConfigs?.length) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'User.OtherSettings.NoDataMessage' | transloco\"> </pw-no-data>\n </div>\n}\n","import { ChangeDetectorRef, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { LazyImgDirective } from '@posiwise/directives';\n\nimport { StatusCodes } from 'http-status-codes';\nimport { Accordion, AccordionContent, AccordionHeader, AccordionPanel } from 'primeng/accordion';\nimport { Bind } from 'primeng/bind';\nimport { Ripple } from 'primeng/ripple';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-security-tab',\n templateUrl: './security-tab.component.html',\n styleUrls: ['./security-tab.component.scss'],\n imports: [\n Bind,\n Accordion,\n AccordionPanel,\n Ripple,\n AccordionHeader,\n AccordionContent,\n LazyImgDirective,\n TranslocoPipe\n ]\n})\nexport class SecurityTabComponent extends AppBaseComponent implements OnInit {\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('password', { static: false }) passwordRef: ElementRef;\n @ViewChild('verificationCode', { static: false }) verificationCode: ElementRef;\n\n @ViewChild('ssoPassword', { static: false }) ssoPasswordRef: ElementRef;\n\n showSSOSection = false;\n ssoPasswordVerified = false;\n isSSOPasswordInvalid = true;\n\n user;\n\n isCurrentPasswordValid = true;\n passwordVerified = false;\n show2FA = false;\n\n created2faDetails: object;\n\n ngOnInit() {\n this.getUser();\n }\n\n private getUser() {\n this.userService.getUserInfo().subscribe(res => {\n this.user = res;\n this.cdr.markForCheck();\n });\n }\n\n validatePassword() {\n const password = this.passwordRef.nativeElement.value;\n if (password) {\n this.userService.checkPassword({ password }).subscribe({\n next: data => {\n if (data?.result?.status === StatusCodes.OK) {\n if (this.user?.enable_two_factor_authenticator === false) {\n this.passwordVerified = true;\n this.create2FA();\n } else {\n this.disable2FA();\n }\n }\n this.cdr.markForCheck();\n },\n error: err => {\n if (err) {\n this.toast.error(err.error.message);\n this.passwordRef.nativeElement.value = '';\n }\n this.cdr.markForCheck();\n }\n });\n }\n }\n\n checkValidity() {\n const password = this.passwordRef.nativeElement.value;\n if (password.length > 5) {\n this.isCurrentPasswordValid = false;\n } else {\n this.isCurrentPasswordValid = true;\n }\n }\n\n private create2FA() {\n this.userService.createTwoFactorAuthenticator().subscribe(({ result }) => {\n this.created2faDetails = result;\n this.cdr.markForCheck();\n });\n }\n\n verify2FA() {\n this.userService\n .verifyTwoFactorAuthenticator(this.verificationCode.nativeElement.value)\n .subscribe(() => {\n this.enable2FA();\n });\n }\n\n private enable2FA() {\n this.userService\n .enableTwoFactorAuthenticator(this.verificationCode.nativeElement.value)\n .subscribe(_ => {\n this.getUser();\n this.reset();\n this.cdr.markForCheck();\n });\n }\n\n private disable2FA() {\n this.userService.disableTwoFactorAuthenticator().subscribe(_ => {\n this.getUser();\n this.reset();\n this.cdr.markForCheck();\n });\n }\n\n reset() {\n this.show2FA = false;\n this.isCurrentPasswordValid = true;\n this.passwordVerified = false;\n this.created2faDetails = {};\n }\n\n checkSSOPasswordValidity() {\n const password = this.ssoPasswordRef.nativeElement.value;\n this.isSSOPasswordInvalid = password.length <= 5;\n }\n\n validateSSOPassword() {\n const password = this.ssoPasswordRef.nativeElement.value;\n if (password) {\n this.userService.checkPassword({ password }).subscribe({\n next: data => {\n if (data?.result?.status === StatusCodes.OK) {\n this.ssoPasswordVerified = true;\n }\n this.cdr.markForCheck();\n },\n error: err => {\n this.toast.error(err.error.message);\n this.ssoPasswordRef.nativeElement.value = '';\n this.cdr.markForCheck();\n }\n });\n }\n }\n\n triggerSSO() {\n this.userService.sendSSOActivationEmail().subscribe(() => {\n this.toast.success(\n this.user?.cognito_sso_activated\n ? 'Activation email resent successfully.'\n : 'SSO activation email sent successfully.'\n );\n this.getUser();\n this.resetSSO();\n this.cdr.markForCheck();\n });\n }\n\n resetSSO() {\n this.showSSOSection = false;\n this.ssoPasswordVerified = false;\n this.isSSOPasswordInvalid = true;\n if (this.ssoPasswordRef?.nativeElement) {\n this.ssoPasswordRef.nativeElement.value = '';\n }\n }\n}\n","<div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Settings.Security.Title' | transloco }}</h2>\n </div>\n</div>\n<p-accordion>\n <p-accordion-panel value=\"0\">\n <p-accordion-header>{{ 'User.Settings.Security.TwoFactor.Title' | transloco }}</p-accordion-header>\n <p-accordion-content>\n <div class=\"row mt-2\">\n <div class=\"col-12\">\n <div class=\"d-flex\">\n <p class=\"small text-muted\">{{ 'User.Settings.Security.TwoFactor.Description' | transloco }}</p>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <!-- Disable 2FA -->\n @if (user?.enable_two_factor_authenticator) {\n <button class=\"btn btn-danger\" (click)=\"show2FA = true\">{{ 'User.Settings.Security.TwoFactor.Disable' | transloco }}</button>\n }\n <!-- Enable 2FA -->\n @if (!user?.enable_two_factor_authenticator) {\n <button class=\"btn btn-primary\"\n [disabled]=\"created2faDetails?.code\" (click)=\"show2FA = true\">{{ 'User.Settings.Security.TwoFactor.Enable' | transloco }}</button>\n }\n </div>\n </div>\n @if (show2FA) {\n <div class=\"row\">\n <div class=\"col-12 col-md-6 col-lg-4 mt-2\">\n <div class=\"mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\" class=\"form-control\" #password [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n (keyup)=\"checkValidity()\" id=\"input_current_password_800\" name=\"input_current_password_800\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n </div>\n </div>\n @if (created2faDetails?.code) {\n <div class=\"col-12\">\n <p class=\"small\">{{ 'User.Settings.Security.TwoFactor.ScanInstructions' | transloco }}</p>\n <img [src]=\"created2faDetails?.qr_uri\" [alt]=\"'User.Settings.Security.TwoFactor.QrAlt' | transloco\" class=\"qr-code img-thumbnail img-responsive\" />\n <strong>{{ 'User.Settings.Security.TwoFactor.SecretKey' | transloco: { code: created2faDetails?.code } }}</strong>\n <p class=\"small\">{{ 'User.Settings.Security.TwoFactor.AuthType' | transloco }}</p>\n </div>\n }\n </div>\n }\n @if (show2FA) {\n <div class=\"row\">\n <div class=\"col-4\">\n <div class=\"mb-3 mt-2\">\n @if (passwordVerified) {\n <input type=\"text\" #verificationCode class=\"form-control\"\n [placeholder]=\"'User.Settings.Security.TwoFactor.PasscodePlaceholder' | transloco\" id=\"input_provide_passcode_from_authenticator_app_800\" name=\"input_provide_passcode_from_authenticator_app_800\"\n [attr.aria-label]=\"'User.Settings.Security.TwoFactor.PasscodePlaceholder' | transloco\" />\n }\n </div>\n </div>\n @if (show2FA) {\n <div class=\"col-12\">\n <div class=\"d-flex mt-2\">\n <button class=\"btn btn-raised btn-outline-default me-2\" (click)=\"reset()\">{{ 'Button.Cancel' | transloco }}</button>\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\" (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">{{ 'User.Account.Validate' | transloco }}</button>\n }\n @if (passwordVerified) {\n <button class=\"btn btn-raised btn-primary\" (click)=\"verify2FA()\">{{ 'Button.Confirm' | transloco }}</button>\n }\n </div>\n </div>\n }\n </div>\n }\n </p-accordion-content>\n </p-accordion-panel>\n <p-accordion-panel value=\"1\">\n <p-accordion-header>{{ 'User.Settings.Security.Sso.Title' | transloco }}</p-accordion-header>\n <p-accordion-content>\n <div class=\"row mt-2\">\n <div class=\"col-12\">\n <p class=\"small text-muted\">{{ (user?.cognito_sso_activated ? 'User.Settings.Security.Sso.ActivatedDescription' : 'User.Settings.Security.Sso.EnableDescription') | transloco }}</p>\n </div>\n </div>\n <!-- Enable or Resend Button -->\n @if (!showSSOSection) {\n <div class=\"row\">\n <div class=\"col-12\">\n <button class=\"btn btn-primary\" (click)=\"showSSOSection = true\"> {{ (user?.cognito_sso_activated ? 'User.Settings.Security.Sso.Resend' : 'User.Settings.Security.TwoFactor.Enable') | transloco }}</button>\n </div>\n </div>\n }\n <!-- Password Validation -->\n @if (showSSOSection) {\n <div class=\"row\">\n @if (!ssoPasswordVerified) {\n <div class=\"col-12 col-md-6 col-lg-4 mt-2\">\n <div class=\"mb-3\">\n <input type=\"password\" class=\"form-control\" #ssoPassword [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n (keyup)=\"checkSSOPasswordValidity()\" id=\"input_current_password_801\" name=\"input_current_password_801\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n </div>\n </div>\n }\n <div class=\"col-12\">\n <div class=\"d-flex mt-2\">\n <button class=\"btn btn-raised btn-outline-default me-2\" (click)=\"resetSSO()\">{{ 'Button.Cancel' | transloco }}</button>\n @if (!ssoPasswordVerified) {\n <button class=\"btn btn-raised btn-primary\" (click)=\"validateSSOPassword()\"\n [disabled]=\"isSSOPasswordInvalid\">{{ 'User.Account.Validate' | transloco }}</button>\n }\n @if (ssoPasswordVerified) {\n <button class=\"btn btn-primary\" (click)=\"triggerSSO()\">{{ 'Button.Confirm' | transloco }}</button>\n }\n </div>\n </div>\n </div>\n }\n </p-accordion-content>\n </p-accordion-panel>\n</p-accordion>\n","import { Component, inject, ViewChild } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { AI_ASSISTANT_PERMISSION, PermissionService } from '@posiwise/common-services';\nimport { PwTabsComponent } from '@posiwise/shared-components';\n\nimport { MenuItem } from 'primeng/api';\n\n@Component({\n selector: 'pw-settings',\n templateUrl: './settings-tabs.component.html',\n imports: [PwTabsComponent]\n})\nexport class SettingsComponent {\n private readonly router = inject(Router);\n private readonly permissionService = inject(PermissionService);\n\n @ViewChild('menuItems', { static: true }) menu: MenuItem[];\n\n items: MenuItem[];\n activeItem: MenuItem;\n\n constructor() {\n this.items = [\n {\n id: 'communications',\n labelKey: 'User.Tabs.Communications',\n icon: 'fa fa-fw fa-cogs',\n routerLink: ['/settings/communication']\n },\n {\n id: 'security',\n labelKey: 'User.Tabs.Security',\n icon: 'fa fa-fw fa-lock',\n routerLink: ['/settings/security']\n },\n {\n id: 'ai-knowledge',\n labelKey: 'Menu.Enterprise.AiKnowledge',\n icon: 'fa fa-fw fa-brain',\n routerLink: ['/settings/ai-knowledge'],\n visible: this.permissionService.evaluatePermissions(AI_ASSISTANT_PERMISSION)\n },\n {\n id: 'other',\n labelKey: 'User.Tabs.Other',\n icon: 'fa fa-fw fa-list',\n routerLink: ['/settings/other']\n }\n ];\n this.activeItem =\n this.items[\n this.items.findIndex(\n record => record.routerLink[0] === this.router.url.split('?')[0]\n )\n ];\n }\n\n activateMenu() {\n this.activeItem = this.menu['activeItem'];\n }\n}\n","<pw-tabs [items]=\"items\"></pw-tabs>\n","import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\nimport { RouterLink } from '@angular/router';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { CommonService, PermissionService } from '@posiwise/common-services';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { DateFormatPipe } from '@posiwise/pipes';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { Accordion, AccordionContent, AccordionHeader, AccordionPanel } from 'primeng/accordion';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Ripple } from 'primeng/ripple';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-support',\n templateUrl: './support.component.html',\n styleUrls: ['./support.component.scss'],\n imports: [\n RouterLink,\n Bind,\n ProgressSpinner,\n Accordion,\n AccordionPanel,\n Ripple,\n AccordionHeader,\n AccordionContent,\n LazyImgDirective,\n NoDataComponent,\n TranslocoPipe,\n DateFormatPipe\n ]\n})\nexport class SupportComponent extends AppBaseComponent implements OnInit {\n private readonly commonService = inject(CommonService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n supports = [];\n\n subscriptionId: number;\n\n isLoading: boolean;\n\n isLoaded = false;\n\n ngOnInit(): void {\n this.subscriptionId = PermissionService.selectedSubscription?.id;\n this.getAllSupport();\n }\n\n private getAllSupport() {\n this.isLoading = true;\n this.commonService\n .getAllCustomerSupport(this.subscriptionId)\n .subscribe(({ result }) => {\n this.supports = result;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoading = false;\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n}\n","<div class=\"row m-3\">\n <div class=\"col-12 mb-3\">\n <div\n class=\"col-12 d-flex flex-wrap justify-content-between align-items-center mt-4\">\n <h2 class=\"card-title p-0 float-start\">{{ 'Support.Center.Title' | transloco }}</h2>\n <a routerLink=\"/support-details/add\"\n [attr.aria-label]=\"'Support.Center.CreateRequest' | transloco\"\n class=\"btn btn-sm btn-outline-primary float-end\"\n tabindex=\"0\"\n (keydown)=\"$event.key === 'Enter' && $event.target.click()\"\n aria-expanded=\"false\">\n <i class=\"fa fa-plus-circle\"\n aria-hidden=\"true\"></i>\n {{ 'Support.Center.CreateRequest' | transloco }}\n </a>\n </div>\n </div>\n <div class=\"col-12 my-3\">\n <h3>{{ 'Support.Center.PreviousRequests' | transloco }}</h3>\n <p>{{ 'Support.Center.ReplyByEmail' | transloco }}</p>\n </div>\n @if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (supports?.length) {\n <div class=\"col-12 mb-3\">\n <p-accordion>\n @for (item of supports; track item; let i = $index) {\n <p-accordion-panel [value]=\"i\">\n <p-accordion-header>{{ item?.created_at | dateFormat }} ({{ item?.user_name }}) {{ item?.title }}</p-accordion-header>\n <p-accordion-content>\n <p>{{ item?.description }}</p>\n <a [href]=\"item?.attachment?.version_200x200?.url\"\n target=\"_blank\">\n @if (item?.attachment?.version_200x200?.url) {\n <img [alt]=\"'Support.Center.AttachmentAlt' | transloco\"\n [src]=\"item?.attachment?.version_200x200?.url\"\n class=\"img-fluid\" />\n }</a>\n </p-accordion-content>\n </p-accordion-panel>\n }\n </p-accordion>\n </div>\n }\n @if (!supports?.length && isLoaded) {\n <div class=\"col-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"No support requests found\"> </pw-no-data>\n </div>\n }\n </div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n OnInit,\n Renderer2\n} from '@angular/core';\nimport { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { AppAdmin } from '@posiwise/admin-module-utils';\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService, CommonService, PermissionService } from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { HelperService } from '@posiwise/helper-service';\nimport { InputContainerComponent, PwStickyActionsComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { NgxCaptchaModule } from 'ngx-captcha';\nimport { Bind } from 'primeng/bind';\nimport { FileUpload } from 'primeng/fileupload';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\n@Component({\n selector: 'pw-support-details',\n templateUrl: './support-details.component.html',\n styleUrls: ['./support-details.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n FileUpload,\n ProgressSpinner,\n NgxCaptchaModule,\n PwStickyActionsComponent,\n TranslocoPipe\n ]\n})\nexport class SupportDetailsComponent extends AppBaseComponent implements AfterViewInit, OnInit {\n private readonly commonService = inject(CommonService);\n private readonly authService = inject(AuthService);\n private readonly renderer = inject(Renderer2);\n private readonly el = inject(ElementRef);\n private readonly cdr = inject(ChangeDetectorRef);\n\n form: FormGroup;\n\n uploadedFiles = [];\n\n invalidFile = false;\n isSubmitClicked = false;\n\n siteKey: string;\n\n recaptcha = null;\n\n isLoading: boolean;\n filesUploaded: boolean;\n subscriptionId;\n\n constructor() {\n super();\n this.form = AppAdmin.customerSupportForm();\n this.form.get('product_id').setValue(PermissionService.selectedProduct.id);\n this.siteKey = this.appConfig.integrations.captcha_key_V2;\n }\n\n ngOnInit(): void {\n this.subscriptionId = PermissionService.selectedSubscription?.id;\n }\n\n ngAfterViewInit() {\n this.attachCloseButtonListener();\n }\n\n @ValidateForm('form')\n onSave() {\n this.isSubmitClicked = true;\n }\n\n handleSuccess(token: string) {\n if (token) {\n this.authService.validateReCaptcha(token).subscribe((isSuccess: boolean) => {\n this.cdr.markForCheck();\n if (isSuccess) {\n this.isLoading = true;\n const data = {\n ...this.form.value\n };\n if (this.uploadedFiles.length > 0) {\n data.attachment = this.uploadedFiles[0];\n }\n if (!data.attachment) {\n delete data.attachment;\n }\n this.commonService\n .postCustomerSupport({ ...data, subscription_id: this.subscriptionId })\n .subscribe(() => {\n this.form.markAsPristine();\n this.back();\n })\n .add(() => {\n this.isLoading = false;\n this.isSubmitClicked = false;\n this.cdr.markForCheck();\n });\n }\n });\n }\n }\n\n onSelect(event = null) {\n this.invalidFile = false;\n for (const file of event.files) {\n if (!HelperService.validateFile(file, this.toast)) {\n this.invalidFile = true;\n } else {\n this.uploadedFiles.push(file);\n }\n }\n this.filesUploaded = true;\n\n if (this.invalidFile) {\n setTimeout(() => this.attachCloseButtonListener(), 0);\n }\n }\n\n onRemove(event) {\n this.uploadedFiles = this.uploadedFiles.filter(x => event.file.name !== x.name);\n if (this.uploadedFiles.length === 0) {\n this.filesUploaded = false;\n }\n this.invalidFile = false;\n }\n\n attachCloseButtonListener() {\n const closeButton = this.el.nativeElement.querySelector('.p-message-close');\n\n if (closeButton) {\n this.renderer.listen(closeButton, 'click', () => {\n this.handleCloseButtonClick();\n });\n }\n }\n\n handleCloseButtonClick() {\n this.invalidFile = false;\n this.filesUploaded = false;\n }\n\n onUploadError(event) {\n HelperService.onUploadError(event, this.toast);\n }\n}\n","<div class=\"container-fluid pw-tab overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"me-auto col-xs-6 mt-4\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\" (click)=\"back()\" class=\"previous\"><i\n class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n <h3 class=\"mt-3\">{{ 'Label.NewSupport' | transloco }}</h3>\n </div>\n <div class=\"p-2 m-1 mt-3\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSave()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <pw-input-container controlId=\"support-details-title\"\n [label]=\"'Support.Details.Title' | transloco\"\n name=\"title\"\n errorMsg=\"Support.Details.Validation.Title\">\n <input type=\"text\"\n id=\"support-details-title\"\n class=\"form-control\"\n [placeholder]=\"'Support.Placeholder.Title' | transloco\"\n formControlName=\"title\"\n [attr.aria-label]=\"'Support.Details.Title' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <pw-input-container controlId=\"support-details-description\"\n [label]=\"'Support.Details.Description' | transloco\"\n errorMsg=\"Support.Details.Validation.Description\"\n name=\"description\">\n <textarea rows=\"3\"\n id=\"support-details-description\"\n type=\"text\"\n class=\"form-control\"\n [placeholder]=\"'Support.Placeholder.Description' | transloco\"\n formControlName=\"description\"\n [attr.aria-label]=\"'Support.Details.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <div class=\"mb-3 file-upload-support-details\">\n <span id=\"support-details-file-label\" class=\"pw-label-style\">{{ 'Support.Details.UploadPicture' | transloco }}</span>\n <p-fileupload #forms\n [attr.aria-labelledby]=\"'support-details-file-label'\"\n name=\"myfile[]\"\n [customUpload]=\"true\"\n [showUploadButton]=\"false\"\n accept=\"image/*\"\n [disabled]=\"uploadedFiles && uploadedFiles.length > 0\"\n (onSelect)=\"onSelect($event)\"\n (onRemove)=\"onRemove($event)\"\n (onError)=\"onUploadError($event)\">\n <ng-template #content>\n @if (!uploadedFiles?.length) {\n <div class=\"drag-drop-text\">\n <p>{{ 'Support.Details.DragAndDrop' | transloco }}</p>\n </div>\n }\n </ng-template>\n </p-fileupload>\n </div>\n </div>\n @if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (isSubmitClicked) {\n <div class=\"col-12 text-end mt-3\">\n <div class=\"support-details-captcha\">\n <ngx-recaptcha2 [ngModelOptions]=\"{ standalone: true }\"\n [siteKey]=\"siteKey\"\n size=\"normal\"\n [(ngModel)]=\"recaptcha\"\n (success)=\"handleSuccess($event)\">\n </ngx-recaptcha2>\n </div>\n </div>\n } @else {\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"back()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\" [disabled]=\"invalidFile\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n }\n </div>\n </form>\n </div>\n </div>\n </div>\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\n\nimport { ProfileService, ProjectPicture, WriteResponse } from '@posiwise/common-services';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport { Bind } from 'primeng/bind';\nimport { FileUpload } from 'primeng/fileupload';\nimport { forkJoin, Observable } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-portfolios',\n templateUrl: './edit-portfolios.component.html',\n styleUrls: ['./edit-portfolios.component.scss'],\n imports: [Bind, FileUpload, LazyImgDirective, ButtonBusyDirective, TranslocoPipe]\n})\nexport class EditPortfoliosComponent {\n private readonly modalService = inject(NgbModal);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n @ViewChild('form', { static: false }) uploader: FileUpload;\n\n @Output() successEvent: EventEmitter<boolean> = new EventEmitter();\n\n @Input() id: number;\n @Input() slug: string;\n\n uploadedFiles = [];\n project = [];\n projectPictures = [];\n\n busy: boolean;\n filesUploaded: boolean;\n\n openModal(id: number) {\n this.id = 0;\n this.id = id;\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n onSelect(event = null) {\n // eslint-disable-next-line no-restricted-syntax\n for (const file of event.files) {\n if (HelperService.validateFile(file)) {\n this.uploadedFiles.push(file);\n }\n }\n this.filesUploaded = true;\n }\n\n getProjectPictures() {\n this.profileService.getProjectPictures(this.slug).subscribe(({ result }) => {\n if (result.length > 0) {\n this.projectPictures = result.flatMap(x => x.project_pictures);\n }\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Uploads multiple images for the project\n * @param form\n */\n onSave(form) {\n if (this.uploadedFiles.length > 0) {\n this.busy = true;\n const subscriptions$: Observable<WriteResponse<ProjectPicture>>[] = [];\n this.uploadedFiles.forEach(file => {\n subscriptions$.push(\n this.profileService.addProjectPictures({\n project_id: Number(this.id),\n image: file\n })\n );\n });\n\n forkJoin(subscriptions$)\n .subscribe({\n next: () => {\n form.clear();\n this.successEvent.emit();\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n },\n error: () => {\n form.clear();\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n }\n })\n .add(() => {\n this.busy = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n deleteProjectPicture(id: number) {\n this.profileService.deletePicture(id).subscribe(_ => {\n this.getProjectPictures();\n this.cdr.markForCheck();\n });\n }\n\n trackByImage(_index: number, item: { id: number }) {\n return item?.id;\n }\n\n onRemove(event) {\n this.uploadedFiles = this.uploadedFiles.filter(x => event.file.name !== x.name);\n this.filesUploaded = false;\n }\n\n onUploadError(event) {\n HelperService.onUploadError(event);\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ 'User.Profile.Portfolio.EditTitle' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n {{ 'User.Profile.Portfolio.UploadHint' | transloco }}\n <p-fileupload #form\n name=\"myfile[]\"\n [customUpload]=\"true\"\n [showUploadButton]=\"false\"\n accept=\"\"\n [disabled]=\"uploadedFiles && uploadedFiles.length > 0\"\n (onSelect)=\"onSelect($event)\"\n (onRemove)=\"onRemove($event)\"\n (onError)=\"onUploadError($event)\">\n <ng-template #content>\n @if (!uploadedFiles?.length) {\n <div class=\"drag-drop-text\">\n <p>{{ 'Support.Details.DragAndDrop' | transloco }}</p>\n </div>\n }\n </ng-template>\n </p-fileupload>\n <div class=\"ui-fileupload-content ui-widget-content ui-corner-bottom\">\n <div class=\"ui-fileupload-files\">\n <div class=\"\">\n <h5>{{ 'User.Profile.Portfolio.UploadedPictures' | transloco }}</h5>\n @for (image of projectPictures; track trackByImage($index, image)) {\n <div\n class=\"ui-fileupload-row d-inline-block\">\n <div>\n <img [src]=\"image?.picture?.version_50x50?.url\"\n alt=\"\"\n width=\"50\" />\n </div>\n <div class=\"pt-1 ps-1\">\n <button icon=\"pi pi-times\"\n type=\"button\"\n (click)=\"deleteProjectPicture(image.id)\"\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only\">\n <span class=\"ui-button-icon-left ui-clickable pi pi-times\"></span>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n [buttonBusy]=\"busy\"\n (click)=\"onSave(form)\">\n {{ 'Button.Save' | transloco }}\n </button>\n </div>\n</ng-template>\n","import { NgClass } from '@angular/common';\nimport {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n OnDestroy,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProfileService, ValidationService } from '@posiwise/common-services';\nimport { Project } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { appendQueryParam, clearQueryParams, ValidateForm } from '@posiwise/utils';\n\nimport moment from 'moment';\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-project-modal',\n templateUrl: './edit-project-modal.component.html',\n styleUrls: ['./edit-project-modal.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n NgClass,\n Bind,\n Select,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditProjectModalComponent extends AppBaseComponent implements OnInit, OnDestroy {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Output() cancelEvent: EventEmitter<void> = new EventEmitter();\n @Output() saveEvent: EventEmitter<boolean> = new EventEmitter();\n\n form: FormGroup;\n\n weeks: number[] = [];\n startYears: number[];\n endYears: number[];\n\n title = 'Add Project';\n\n submitted = false;\n buttonBusy = false;\n\n private currentProject: Project;\n\n userId: number;\n\n constructor() {\n super();\n this.getForm();\n }\n\n get f() {\n return this.form.controls;\n }\n\n ngOnInit() {\n clearQueryParams(this.router, this.route);\n this.userStore().subscribe(user => {\n this.userId = user.id;\n this.cdr.markForCheck();\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n\n getStartYear() {\n const d = new Date(`01 July 1980`);\n const range = [];\n for (let i = new Date().getFullYear(); i >= d.getFullYear(); i--) {\n range.push(i);\n }\n this.startYears = range;\n }\n\n getEndYears(start_year) {\n const range = [];\n for (let i = new Date().getFullYear(); i >= start_year; i--) {\n range.push(i);\n }\n this.endYears = range;\n }\n\n private getWeeks() {\n const endYear = moment([this.form.value['end_year']]);\n const startYear = moment([this.form.value['start_year']]);\n if (endYear) {\n const weeks = endYear.diff(startYear, 'weeks');\n this.weeks = Array.from(Array(weeks).keys());\n }\n }\n\n onOpen(item = null) {\n this.currentProject = item;\n appendQueryParam(this.router, this.route, {\n modal: 'editProjects'\n });\n\n if (item) {\n this.form.patchValue(item);\n this.title = `Edit Project - ${item.title}`;\n this.getStartYear();\n this.getEndYears(item.end_year);\n this.getWeeks();\n } else {\n this.form.reset();\n this.title = 'Add Project';\n }\n\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.submitted = true;\n this.buttonBusy = true;\n const { value } = this.form;\n value.user_id = this.userId;\n\n const subscription$ = this.currentProject?.id\n ? this.profileService.updateProjects(this.currentProject.id, value)\n : this.profileService.addProjects(value);\n subscription$\n .subscribe(() => {\n this.modalService.dismissAll();\n this.toast.success(\n this.translation.translate('User.Profile.Projects.ProjectUpdated')\n );\n this.saveEvent.emit(true);\n this.cdr.markForCheck();\n })\n .add(() => {\n this.submitted = false;\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n private getForm() {\n this.form = this.fb.group({\n start_year: [\n null,\n [\n Validators.required,\n Validators.pattern(ValidationService.CustomValidatorPatterns.Year)\n ]\n ],\n end_year: [\n null,\n [\n Validators.required,\n Validators.pattern(ValidationService.CustomValidatorPatterns.Year)\n ]\n ],\n client_name: [null, Validators.required],\n title: [null, Validators.required],\n description: [null, Validators.required],\n length: ['', [Validators.required, Validators.max(5000)]],\n advertisable: [false],\n syndicated: [false]\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ title }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row p-2\">\n <!-- Title -->\n <pw-input-container class=\"col-12\"\n controlId=\"edit-project-title\"\n [label]=\"'User.Profile.Projects.Field.Title' | transloco\"\n name=\"title\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-project-title\"\n class=\"form-control\"\n formControlName=\"title\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.Title' | transloco\"\n [ngClass]=\"{ 'is-invalid': submitted && f.title.errors }\"\n [attr.aria-label]=\"'User.Profile.Projects.Field.Title' | transloco\" />\n </pw-input-container>\n <!-- Client Name -->\n <pw-input-container class=\"col-12\"\n controlId=\"edit-project-client_name\"\n [label]=\"'User.Profile.Projects.Field.ClientName' | transloco\"\n name=\"client_name\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-project-client_name\"\n class=\"form-control\"\n formControlName=\"client_name\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.ClientName' | transloco\"\n [ngClass]=\"{ 'is-invalid': submitted && f.client_name.errors }\"\n [attr.aria-label]=\"'User.Profile.Projects.Field.ClientName' | transloco\" />\n </pw-input-container>\n <!-- Project Start Year -->\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-project-start_year\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Projects.Field.Start' | transloco\"\n name=\"start_year\"\n errorMsg=\"User.Profile.Fields.Validation.YearRequired\">\n <p-select\n [attr.aria-labelledby]=\"'edit-project-start_year-label'\"\n (onShow)=\"getStartYear()\"\n formControlName=\"start_year\"\n [options]=\"startYears\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.StartYear' | transloco\"\n (onChange)=\"getEndYears($event.value)\"\n [ngClass]=\"{ 'is-invalid': submitted && f.start_year.errors }\">\n </p-select>\n </pw-input-container>\n <!-- Project End Year -->\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-project-end_year\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Projects.Field.End' | transloco\"\n name=\"end_year\"\n errorMsg=\"User.Profile.Fields.Validation.YearRequired\">\n <p-select\n [attr.aria-labelledby]=\"'edit-project-end_year-label'\"\n formControlName=\"end_year\"\n [options]=\"endYears\"\n [placeholder]=\"'User.Profile.Projects.Placeholder.EndYear' | transloco\"\n (onChange)=\"getEndYears($event.value)\"\n [ngClass]=\"{ 'is-invalid': submitted && f.end_year.errors }\">\n </p-select>\n </pw-input-container>\n <!-- Total Weeks Worked -->\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-project-length\"\n [label]=\"'User.Profile.Projects.Field.WeeksWorked' | transloco\"\n name=\"length\"\n errorMsg=\"User.Profile.Fields.Validation.WeeksRequired\">\n <input type=\"number\"\n id=\"edit-project-length\"\n formControlName=\"length\"\n class=\"form-control\"\n [ngClass]=\"{ 'is-invalid': submitted && f.length.errors }\"\n [attr.aria-label]=\"'User.Profile.Projects.Field.WeeksWorked' | transloco\" />\n </pw-input-container>\n <!-- Description -->\n <pw-input-container class=\"col-12\"\n controlId=\"edit-project-description\"\n [label]=\"'User.Profile.Fields.Description' | transloco\"\n name=\"description\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <textarea type=\"text\"\n id=\"edit-project-description\"\n class=\"form-control\"\n formControlName=\"description\"\n required\n [placeholder]=\"'User.Profile.Projects.Placeholder.Description' | transloco\"\n [ngClass]=\"{ 'is-invalid': submitted && f.description.errors }\"\n [attr.aria-label]=\"'User.Profile.Fields.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EventEmitter,\n inject,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { QualificationService } from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { appendQueryParam, clearQueryParams, ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { DatePicker } from 'primeng/datepicker';\nimport { Select } from 'primeng/select';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n/**\n * The `degree` saved for each level. It is stored text that existing records already hold, so it\n * stays this exact English whatever language the form is shown in.\n */\nconst STORED_DEGREES: Record<number, string> = {\n 0: 'No formal education',\n 1: 'Primary education',\n 2: 'Secondary educ, action or high school',\n 3: 'GED',\n 4: 'Vocational qualification',\n 5: \"Bachelor's degree\",\n 7: \"Master's degree\",\n 9: 'Doctorate or higher'\n};\n\n@Component({\n selector: 'pw-edit-qualifications-modal',\n templateUrl: './edit-qualifications-modal.component.html',\n styleUrls: ['./edit-qualifications-modal.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n DatePicker,\n Select,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditQualificationsModalComponent extends AppBaseComponent implements OnInit {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly qualificationService = inject(QualificationService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Output()\n saveEvent: EventEmitter<void> = new EventEmitter();\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n titleKey = 'User.Profile.About.AddEducation';\n\n form: FormGroup;\n\n userId: number;\n\n now: Date = new Date(); // Used for datepicker\n\n minToDate = this.now;\n\n qualifications: { value: number; label: string }[] = [];\n\n private readonly destroyRef = inject(DestroyRef);\n buttonBusy = false;\n\n constructor() {\n super();\n\n // Rebuilt when the translations load and on every language switch.\n this.translation\n .selectTranslation()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.qualifications = Object.keys(STORED_DEGREES)\n .map(Number)\n .map(value => ({\n value,\n label: this.translation.translate(\n `User.Profile.Qualifications.Degree.${value}`\n )\n }));\n this.cdr.markForCheck();\n });\n\n this.form = this.fb.group({\n id: [null],\n school: [null, Validators.required],\n course: [null, Validators.required],\n degree: [null],\n started_on: [null, Validators.required],\n ended_on: [null, Validators.required],\n description: [null],\n points: [null]\n });\n }\n\n ngOnInit() {\n clearQueryParams(this.router, this.route);\n this.userStore().subscribe(response => {\n this.userId = response.id;\n this.cdr.markForCheck();\n });\n }\n\n onOpen(value = null) {\n appendQueryParam(this.router, this.route, {\n modal: 'editQualifications'\n });\n\n if (value) {\n this.form.patchValue(value);\n this.titleKey = 'User.Profile.About.EditEducation';\n } else {\n this.form.reset();\n this.titleKey = 'User.Profile.About.AddEducation';\n }\n\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n onDateChange(): void {\n const fromDate = this.form.controls['started_on'].value;\n if (fromDate) {\n this.minToDate = new Date(fromDate);\n this.minToDate.setDate(this.minToDate.getDate() + 1);\n }\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.buttonBusy = true;\n const data = { ...this.form.value };\n data.user_id = this.userId;\n data.degree = STORED_DEGREES[data.points];\n\n const sub$ = data?.id\n ? this.qualificationService.updateQualifications(data.id, data)\n : this.qualificationService.addQualifications(data);\n\n sub$.subscribe(() => {\n const msg = data.id\n ? this.translation.translate('User.Profile.Qualifications.UpdatedMessage')\n : this.translation.translate('User.Profile.Qualifications.AddedMessage');\n this.toast.success(msg);\n this.saveEvent.emit();\n clearQueryParams(this.router, this.route);\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n }).add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ titleKey | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row p-2\">\n <pw-input-container class=\"col-12\"\n controlId=\"edit-qualifications-school\"\n [label]=\"'User.Profile.Qualifications.Field.School' | transloco\"\n name=\"school\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-qualifications-school\"\n class=\"form-control\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.School' | transloco\"\n formControlName=\"school\"\n [attr.aria-label]=\"'User.Profile.Qualifications.Field.School' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-started_on\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Qualifications.Field.DatesAttended' | transloco\"\n name=\"started_on\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <div class=\"ui-fluid\">\n <p-datepicker inputId=\"edit-qualifications-started_on\" formControlName=\"started_on\"\n [attr.aria-labelledby]=\"'edit-qualifications-started_on-label'\"\n [monthNavigator]=\"true\"\n [yearNavigator]=\"true\"\n yearRange=\"1950:2020\"\n (onSelect)=\"onDateChange()\"\n [showIcon]=\"true\"\n [placeholder]=\"'User.Profile.Fields.DatePlaceholder' | transloco\"\n dateFormat=\"yy-mm-dd\">\n </p-datepicker>\n </div>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-ended_on\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Qualifications.Field.DatesCompleted' | transloco\"\n name=\"ended_on\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <div class=\"ui-fluid\">\n <p-datepicker inputId=\"edit-qualifications-ended_on\" formControlName=\"ended_on\"\n [attr.aria-labelledby]=\"'edit-qualifications-ended_on-label'\"\n [monthNavigator]=\"true\"\n [yearNavigator]=\"true\"\n [showIcon]=\"true\"\n (onSelect)=\"onDateChange()\"\n [minDate]=\"minToDate\"\n [placeholder]=\"'User.Profile.Fields.DatePlaceholder' | transloco\"\n dateFormat=\"yy-mm-dd\"\n yearRange=\"1950:2025\"></p-datepicker>\n </div>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-points\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.About.Degree' | transloco\"\n name=\"points\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-select inputId=\"edit-qualifications-points\"\n [options]=\"qualifications\"\n [attr.aria-labelledby]=\"'edit-qualifications-points-label'\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.Degree' | transloco\"\n formControlName=\"points\"></p-select>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-qualifications-course\"\n [label]=\"'User.Profile.About.Course' | transloco\"\n name=\"course\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <input type=\"text\"\n id=\"edit-qualifications-course\"\n class=\"form-control\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.Course' | transloco\"\n formControlName=\"course\"\n [attr.aria-label]=\"'User.Profile.About.Course' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-qualifications-description\"\n [label]=\"'User.Profile.Fields.Description' | transloco\"\n name=\"description\">\n <textarea type=\"text\"\n id=\"edit-qualifications-description\"\n class=\"form-control\"\n [placeholder]=\"'User.Profile.Qualifications.Placeholder.Description' | transloco\"\n formControlName=\"description\"\n [attr.aria-label]=\"'User.Profile.Fields.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n\n<i\n class=\"fa fa-lg pi pi-plus-circle float-end mt-2 pt-1 pt-md-0 profile-icons\"\n data-cy=\"add-qualification\"\n (keydown.enter)=\"onOpen()\"\n [attr.aria-label]=\"'User.Profile.Qualifications.Add' | transloco\"\n (click)=\"onOpen()\"\n aria-hidden=\"true\"\n></i>\n","import { ChangeDetectorRef, Component, inject, Input, TemplateRef, ViewChild } from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\n\nimport { ProfileService } from '@posiwise/common-services';\nimport { Project, User } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { Rating } from 'primeng/rating';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-recommendation-modal',\n templateUrl: './edit-recommendation-modal.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n Rating,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditRecommendationModalComponent {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input() user: User;\n\n form: FormGroup;\n\n title = 'Endorse';\n\n buttonBusy = false;\n\n project = new Project();\n\n constructor() {\n this.form = this.fb.group({\n project_id: [null],\n user_id: [null],\n description: [null, Validators.required],\n quality: [null],\n time: [null],\n communication: [null]\n });\n }\n\n onOpen(value = null) {\n if (value) {\n this.project = value;\n }\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.buttonBusy = true;\n const data = {\n user_id: this.user.id,\n project_id: this.project.id,\n description: this.form.get('description').value,\n quality: this.form.get('quality').value,\n time: this.form.get('time').value,\n communication: this.form.get('communication').value\n } as object;\n\n this.profileService\n .postProjectRecommendation(data)\n .subscribe(_ => {\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ title }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row p-2\">\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-recommendation-quality\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Recommendations.Field.Quality' | transloco\"\n name=\"quality\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-rating formControlName=\"quality\"\n [attr.aria-labelledby]=\"'edit-recommendation-quality-label'\"\n [cancel]=\"false\"></p-rating>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-recommendation-communication\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Recommendations.Field.Communication' | transloco\"\n name=\"communication\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-rating formControlName=\"communication\"\n [attr.aria-labelledby]=\"'edit-recommendation-communication-label'\"\n [cancel]=\"false\"></p-rating>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n controlId=\"edit-recommendation-time\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.Recommendations.Field.Time' | transloco\"\n name=\"time\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <p-rating formControlName=\"time\"\n [attr.aria-labelledby]=\"'edit-recommendation-time-label'\"\n [cancel]=\"false\"></p-rating>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-recommendation-description\"\n [label]=\"'User.Profile.Fields.Description' | transloco\"\n name=\"description\"\n errorMsg=\"User.Profile.Fields.Validation.Required\">\n <textarea type=\"text\"\n id=\"edit-recommendation-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [attr.aria-label]=\"'User.Profile.Fields.Description' | transloco\"></textarea>\n </pw-input-container>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n\n<!-- <i class=\"fal fa-plus-circle fa-2x btn-link float-end btn-add\" (click)=\"onOpen()\" aria-hidden=\"true\"></i> -->\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { TagService } from '@posiwise/common-services';\nimport { TAG_ENTITY, TAG_TYPE } from '@posiwise/common-utilities';\nimport { appendQueryParam, clearQueryParams } from '@posiwise/utils';\n\nimport { AutoComplete } from 'primeng/autocomplete';\nimport { Bind } from 'primeng/bind';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-skills-modal',\n templateUrl: './edit-skills-modal.component.html',\n imports: [Bind, AutoComplete, FormsModule, TranslocoPipe]\n})\nexport class EditSkillsModalComponent extends AppBaseComponent {\n private readonly modalService = inject(NgbModal);\n private readonly tagService = inject(TagService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input()\n userId: number;\n\n @Input()\n slug: string;\n\n @Input()\n entityType = TAG_TYPE.SKILLS;\n\n @Input()\n entityEntity = TAG_ENTITY.USER;\n\n @Output()\n saveEvent: EventEmitter<boolean> = new EventEmitter();\n\n allSkills = [];\n\n searchSkills = [];\n\n selectedSkills = [];\n\n open() {\n this.getSkills();\n this.modalService.open(this.content, { centered: true, windowClass: 'modal-holder' });\n appendQueryParam(this.router, this.route, {\n modal: 'editskills'\n });\n }\n\n /**\n * Populate all the skills for the dropdown\n */\n private getSkills() {\n this.tagService.getTagsByType('skills', {}).subscribe(({ result }) => {\n this.allSkills = result;\n this.getEntitySkills();\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Skills Search\n * @param event: keyword to search\n */\n search(event) {\n let data = [];\n if (event.query) {\n data = this.allSkills.filter(x =>\n x.name.toLowerCase().includes(event.query.toLowerCase())\n );\n } else {\n this.allSkills.forEach(item => {\n data.push(item);\n });\n }\n this.searchSkills = data;\n }\n\n close(modal) {\n modal.close();\n this.selectedSkills = [];\n }\n\n private getEntitySkills() {\n this.tagService\n .getTagsByEntity(this.slug, this.entityEntity, this.entityType)\n .subscribe(({ result }) => {\n this.selectedSkills = this.allSkills.filter(item => {\n return result.find(x => x.id === item.id);\n });\n this.cdr.markForCheck();\n });\n }\n\n saveUserSkills() {\n const skills = [];\n this.selectedSkills.forEach(element => {\n skills.push({\n tag_id: element.id,\n rank: element.id,\n years: 0,\n preferred: true\n });\n });\n\n const postData = {\n entity_tags: skills,\n user_id: Number(this.userId),\n slug: this.slug,\n tag_entity: this.entityEntity\n };\n\n this.tagService.addTags(postData).subscribe(() => {\n this.saveEvent.emit(true);\n this.toast.success(this.translation.translate('User.Profile.Skills.UpdatedMessage'));\n clearQueryParams(this.router, this.route);\n this.modalService.dismissAll();\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ 'User.Profile.Skills.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"ui-fluid skills-modal skills-dropdown\">\n <p-auto-complete class=\"w-100\" appendTo=\"body\" [(ngModel)]=\"selectedSkills\"\n [suggestions]=\"searchSkills\"\n dataKey=\"id\"\n optionLabel=\"name\"\n (completeMethod)=\"search($event)\"\n [minLength]=\"1\"\n [maxlength]=\"10\"\n [placeholder]=\"'User.Profile.Skills.Placeholder' | transloco\"\n [dropdown]=\"true\"\n [multiple]=\"true\"></p-auto-complete>\n\n <small class=\"p-2\">{{ 'User.Profile.Skills.Limit' | transloco }}</small>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"close(modal)\">{{ 'Button.Cancel' | transloco }}</button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveUserSkills()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n ValidatorFn\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProfileService } from '@posiwise/common-services';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective, LazyImgDirective } from '@posiwise/directives';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ModalContext, ValidationError } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-social-links',\n templateUrl: './edit-social-links.component.html',\n styleUrls: ['./edit-social-links.component.scss'],\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n LazyImgDirective,\n ButtonBusyDirective,\n TranslocoPipe\n ]\n})\nexport class EditSocialLinksComponent extends AppBaseComponent implements OnInit {\n private readonly modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input() links: Record<string, string> = {};\n @Input() userId: number;\n\n @Output() saveEvent: EventEmitter<void> = new EventEmitter();\n\n form: FormGroup;\n\n buttonBusy = false;\n\n readonly socialNetworks: ReadonlyArray<{\n key: string;\n labelKey: string;\n icon: string;\n placeholder: string;\n }> = [\n {\n key: 'linkedin',\n labelKey: 'User.Profile.SocialLinks.Label.LinkedIn',\n icon: 'linkedin',\n placeholder: 'https://linkedin.com/in/nickname'\n },\n {\n key: 'twitter',\n labelKey: 'User.Profile.SocialLinks.Label.Twitter',\n icon: 'twitter',\n placeholder: 'https://twitter.com/nickname'\n },\n {\n key: 'facebook',\n labelKey: 'User.Profile.SocialLinks.Label.Facebook',\n icon: 'facebook',\n placeholder: 'https://www.facebook.com/nickname'\n },\n {\n key: 'youtube',\n labelKey: 'User.Profile.SocialLinks.Label.YouTube',\n icon: 'youtube',\n placeholder: 'https://www.youtube.com/nickname'\n },\n {\n key: 'instagram',\n labelKey: 'User.Profile.SocialLinks.Label.Instagram',\n icon: 'instagram',\n placeholder: 'https://www.instagram.com/nickname'\n },\n {\n key: 'github',\n labelKey: 'User.Profile.SocialLinks.Label.Github',\n icon: 'github',\n placeholder: 'https://github.com/nickname'\n },\n {\n key: 'stackoverflow',\n labelKey: 'User.Profile.SocialLinks.Label.Stackoverflow',\n icon: 'stackoverflow',\n placeholder: 'http://stackoverflow.com/users/nickname'\n }\n ];\n\n constructor() {\n super();\n this.form = this.fb.group({\n user_id: 0,\n linkedin: ['', this.urlValidator('linkedin')],\n twitter: ['', this.urlValidator('twitter')],\n facebook: ['', this.urlValidator('facebook')],\n youtube: ['', this.urlValidator('youtube')],\n instagram: ['', this.urlValidator('instagram')],\n github: ['', this.urlValidator('github')],\n stackoverflow: ['', this.urlValidator('stackoverflow')]\n });\n }\n\n /** Tenant company name (domain-metadata driven), falling back to PosiWise. */\n get companyName(): string {\n return this.appConfig?.company?.name || 'PosiWise';\n }\n\n private urlValidator(social: string): ValidatorFn {\n return (control: AbstractControl): ValidationError | null => {\n if (!control.value) {\n return null;\n }\n try {\n const parsed = new URL(control.value);\n if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {\n return { urlMalformed: { value: control.value } };\n }\n const host = parsed.hostname.toLowerCase();\n\n return host.includes(social) ? null : { urlMalformed: { value: control.value } };\n } catch {\n return { urlMalformed: { value: control.value } };\n }\n };\n }\n\n ngOnInit() {\n this.form.patchValue(this.links);\n }\n\n onOpen(links) {\n this.links = links;\n this.form.patchValue(this.links);\n this.modalService.open(this.content, {\n centered: true,\n size: 'md',\n windowClass: 'modal-holder edit-social-links-modal'\n });\n }\n\n @ValidateForm('form')\n onSaveDetail() {\n this.buttonBusy = true;\n this.form.patchValue({\n user_id: this.userId\n });\n this.profileService\n .postLinks(this.form.value)\n .subscribe(_ => {\n this.toast.success(\n this.translation.translate('User.Profile.SocialLinks.AddedMessage')\n );\n this.modalService.dismissAll();\n this.saveEvent.emit();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header edit-social-links-header\">\n <h4 class=\"modal-title edit-social-links__title\"\n id=\"modal-basic-title\">{{ 'User.Profile.SocialLinks.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"modal-body edit-social-links-body\">\n <form [formGroup]=\"form\"\n class=\"edit-social-links\"\n (ngSubmit)=\"onSaveDetail()\">\n <p class=\"edit-social-links__intro\">\n {{ 'User.Profile.SocialLinks.Description' | transloco: { company: companyName } }}\n </p>\n\n <div class=\"edit-social-links__stack\">\n @for (social of socialNetworks; track social.key) {\n <div class=\"edit-social-links__field\">\n <label [for]=\"'external-portfolio-' + social.key\"\n class=\"edit-social-links__label\">\n <span class=\"edit-social-links__chip\">\n <img [src]=\"'/assets/img/icons/social/' + social.icon + '.svg'\"\n width=\"18\"\n height=\"18\"\n alt=\"\" />\n </span>\n <span class=\"edit-social-links__label-text\">{{ social.labelKey | transloco }}</span>\n </label>\n <input type=\"url\"\n [id]=\"'external-portfolio-' + social.key\"\n [name]=\"social.key\"\n [formControlName]=\"social.key\"\n class=\"form-control edit-social-links__input\"\n [placeholder]=\"social.placeholder\"\n autocomplete=\"url\" />\n </div>\n }\n </div>\n </form>\n </div>\n <div class=\"modal-footer edit-social-links-footer\">\n <button type=\"button\"\n class=\"btn edit-social-links__cancel\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary edit-social-links__save\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n","import { AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormBuilder,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport {\n NgxGpAutocompleteDirective,\n NgxGpAutocompleteModule\n} from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { GeoService, ProfileService } from '@posiwise/common-services';\nimport { Country } from '@posiwise/common-utilities';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { ButtonBusyDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { InputContainerComponent } from '@posiwise/shared-components';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { Bind } from 'primeng/bind';\nimport { Select } from 'primeng/select';\nimport { SelectButton } from 'primeng/selectbutton';\nimport { Observable } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbDateStruct, NgbInputDatepicker, NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { EditUser, ModalContext, UserProfile } from '../../shared/interface/user-module.interface';\n\n@Component({\n selector: 'pw-edit-user-profile-modal',\n templateUrl: './edit-user-profile-modal.component.html',\n styleUrl: './edit-user-profile-modal.component.scss',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n InputContainerComponent,\n Bind,\n SelectButton,\n NgbInputDatepicker,\n Select,\n NgxGpAutocompleteModule,\n ButtonBusyDirective,\n AsyncPipe,\n TranslocoPipe\n ]\n})\nexport class EditUserProfileModalComponent extends AppBaseComponent implements OnInit {\n modalService = inject(NgbModal);\n private readonly fb = inject(FormBuilder);\n private readonly profileService = inject(ProfileService);\n private readonly geoService = inject(GeoService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('content', { static: true }) content: TemplateRef<ModalContext>;\n\n @Input() slug: string;\n @Input() user: EditUser;\n\n @Output() saveEvent: EventEmitter<UserProfile> = new EventEmitter<UserProfile>();\n\n @ViewChild('ngxPlaces') placesRef: NgxGpAutocompleteDirective;\n\n form: FormGroup;\n\n countries$: Observable<Country[]>;\n\n states: Country[] = [];\n buttonBusy = false;\n\n constructor() {\n super();\n this.form = this.fb.group({\n first_name: [null, Validators.required],\n last_name: [null, Validators.required],\n headline: [null, Validators.required],\n description: [null, Validators.required],\n gender: ['M'],\n phone_number: [null],\n dob: [null, Validators.required],\n website_url: [null],\n country: [null, Validators.required],\n postcode: [null],\n location: [null],\n state: [null, Validators.required],\n province: [null, Validators.required]\n });\n }\n\n ngOnInit() {\n this.countries$ = this.geoService.getCountries();\n this.cdr.markForCheck();\n this.getValues();\n }\n\n getValues() {\n let dobObject: NgbDateStruct;\n\n const userProfile = this.user?.profile;\n if (userProfile) {\n if (userProfile?.country) {\n this.getRegion(userProfile.country);\n }\n if (userProfile?.dob) {\n dobObject = {\n year: Number(userProfile.dob.substring(0, 4)),\n month: Number(userProfile.dob.substring(5, 7)),\n day: Number(userProfile.dob.substring(8, 10))\n };\n\n this.form.patchValue({});\n }\n\n this.form.patchValue(userProfile);\n this.form.patchValue({\n first_name: this.user.first_name,\n last_name: this.user.last_name,\n dob: dobObject || {}\n });\n }\n }\n\n handleAddressChange(_event) {\n this.form.patchValue({\n latitude: _event.geometry.location.lat(),\n longitude: _event.geometry.location.lng(),\n location: _event.formatted_address\n });\n }\n\n onOpen() {\n this.form.reset();\n this.getValues();\n this.modalService.open(this.content, {\n centered: true,\n size: 'lg',\n windowClass: 'modal-holder'\n });\n }\n\n getRegion(countryId) {\n if (countryId) {\n this.geoService.getRegions(countryId).subscribe(response => {\n this.states = response;\n this.cdr.markForCheck();\n });\n }\n }\n\n onSaveDetail() {\n this.form.patchValue({ province: this.form.value.state });\n this.save();\n }\n\n @ValidateForm('form')\n save() {\n this.buttonBusy = true;\n const data = { ...this.form.value };\n data.dob = HelperService.dateFormat(this.form.get('dob').value);\n\n this.profileService\n .updateUserProfile(data)\n .subscribe(({ result }) => {\n if (result?.id) {\n this.toast.success(this.translation.translate('User.Profile.ProfileUpdated'));\n this.modalService.dismissAll();\n this.saveEvent.emit(result as UserProfile);\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">{{ 'User.Profile.Intro.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetail()\">\n <div class=\"row\">\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-first-name\"\n [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"first_name\"\n id=\"edit-intro-first-name\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.FirstName' | transloco\"\n autocomplete=\"given-name\" name=\"input_first_name_1\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-last-name\"\n [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"last_name\"\n id=\"edit-intro-last-name\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.LastName' | transloco\"\n autocomplete=\"family-name\" name=\"input_last_name_2\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-intro-headline\"\n [label]=\"'User.Profile.Fields.Headline' | transloco\"\n name=\"headline\"\n errorMsg=\"User.Profile.Fields.Validation.Headline\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"headline\"\n id=\"edit-intro-headline\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Headline' | transloco\" name=\"input_headline_3\"\n [attr.aria-label]=\"'User.Profile.Fields.Headline' | transloco\"/>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n controlId=\"edit-intro-description\"\n [label]=\"'User.Profile.About.AboutMe' | transloco\"\n name=\"description\"\n errorMsg=\"User.Profile.Fields.Validation.Description\">\n <textarea class=\"form-control\"\n id=\"edit-intro-description\"\n name=\"description\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Description' | transloco\"\n formControlName=\"description\"\n [attr.aria-label]=\"'User.Profile.About.AboutMe' | transloco\"></textarea>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-gender\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Profile.About.Gender' | transloco\"\n name=\"gender\"\n errorMsg=\"User.Profile.Fields.Validation.Gender\">\n <p-select-button [options]=\"[\n { label: 'Male', value: 'M' },\n { label: 'Female', value: 'F' }\n ]\"\n [attr.aria-labelledby]=\"'edit-intro-gender-label'\"\n formControlName=\"gender\"></p-select-button>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-dob\"\n [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"edit-intro-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Profile.Fields.DatePlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ year: 1950, month: 1, day: 1 }\"\n [maxDate]=\"{ year: 2018, month: 12, day: 31 }\"\n autocomplete=\"off\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n [attr.aria-label]=\"'User.Profile.Fields.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-phone\"\n [label]=\"'User.Profile.Fields.Phone' | transloco\"\n name=\"phone_number\"\n errorMsg=\"User.Profile.Fields.Validation.Phone\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n id=\"edit-intro-phone\"\n name=\"phone_number\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Phone' | transloco\"\n autocomplete=\"tel\"\n [attr.aria-label]=\"'User.Profile.Fields.Phone' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-postcode\"\n [label]=\"'User.Profile.Fields.Postcode' | transloco\"\n name=\"postcode\"\n errorMsg=\"User.Profile.Fields.Validation.Postcode\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"postcode\"\n id=\"edit-intro-postcode\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Postcode' | transloco\"\n autocomplete=\"postal-code\" name=\"input_postcode_6\"\n [attr.aria-label]=\"'User.Profile.Fields.Postcode' | transloco\"/>\n </pw-input-container>\n\n @if (countries$ | async; as countries) {\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-country\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'edit-intro-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-state\"\n [useAriaLabelledbyOnly]=\"true\"\n [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'edit-intro-state-label'\"\n [options]=\"states\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n\n <!-- Location -->\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n class=\"col-12 col-md-6\"\n controlId=\"edit-intro-location\"\n [useAriaLabelledbyOnly]=\"true\"\n name=\"location\">\n <input ngx-gp-autocomplete\n id=\"edit-intro-location\"\n name=\"location\"\n class=\"form-control\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Location' | transloco\"\n [attr.aria-labelledby]=\"'edit-intro-location-label'\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-6\"\n controlId=\"edit-intro-website\"\n [label]=\"'User.Profile.About.Website' | transloco\"\n name=\"website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"website_url\"\n id=\"edit-intro-website\"\n [placeholder]=\"'User.Profile.Intro.Placeholder.Website' | transloco\"\n autocomplete=\"url\" name=\"input_website_url_8\"\n [attr.aria-label]=\"'User.Profile.About.Website' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"modal-footer\">\n <input type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"modal.close()\"\n [value]=\"'Button.Cancel' | transloco\" id=\"input_field_9\" name=\"input_field_9\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"/>\n <input type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\"\n [value]=\"'User.Profile.Fields.SaveChanges' | transloco\" id=\"input_field_10\" name=\"input_field_10\"\n [attr.aria-label]=\"'User.Profile.Fields.SaveChanges' | transloco\"/>\n </div>\n </form>\n </div>\n</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n ProfileService,\n Qualification,\n QualificationService,\n Skill,\n TagService,\n UserProfileDetails\n} from '@posiwise/common-services';\nimport { TAG_ENTITY, TAG_TYPE, User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { DateFormatPipe } from '@posiwise/pipes';\nimport { ConfirmDialogService } from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { forkJoin } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { EditQualificationsModalComponent } from '../edit-qualifications-modal/edit-qualifications-modal.component';\nimport { EditSkillsModalComponent } from '../edit-skills-modal/edit-skills-modal.component';\nimport { EditSocialLinksComponent } from '../edit-social-links/edit-social-links.component';\nimport { EditUserProfileModalComponent } from '../edit-user-profile-modal/edit-user-profile-modal.component';\n\n@Component({\n selector: 'pw-user-about',\n templateUrl: './user-about.component.html',\n styleUrls: ['./user-about.component.scss'],\n imports: [\n EditUserProfileModalComponent,\n EditSkillsModalComponent,\n EditQualificationsModalComponent,\n LazyImgDirective,\n EditSocialLinksComponent,\n Bind,\n ProgressSpinner,\n TranslocoPipe,\n DateFormatPipe\n ]\n})\nexport class UserAboutComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private readonly profileService = inject(ProfileService);\n private readonly qualificationService = inject(QualificationService);\n private readonly tagService = inject(TagService);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n @Input() user: User;\n @Input() isEdit = false;\n\n @Output()\n saveEvent: EventEmitter<boolean> = new EventEmitter();\n\n @ViewChild(EditUserProfileModalComponent, { static: false })\n modal: EditUserProfileModalComponent;\n\n @ViewChild(EditQualificationsModalComponent, { static: false })\n qualificationModal: EditQualificationsModalComponent;\n\n @ViewChild(EditSkillsModalComponent, { static: false })\n skillsModal: EditSkillsModalComponent;\n\n @ViewChild(EditSocialLinksComponent, { static: false })\n socialModal: EditSocialLinksComponent;\n\n allSkills = [];\n\n searchSkills = [];\n\n selectedSkills: Skill[];\n\n objectKeys = Object.keys;\n\n user_profile: UserProfileDetails | null;\n\n qualifications: Qualification[] = [];\n\n userLinks: Record<string, string> = {};\n\n noUserLinks: boolean;\n\n loading = false;\n\n ngOnInit() {\n this.getUserDetails();\n this.getSkills();\n }\n\n getUserDetails() {\n this.loading = true;\n forkJoin({\n user_profile: this.profileService.getUserObject('user_profile', this.user.slug),\n qualifications: this.profileService.getUserObject('qualifications', this.user.slug),\n user_links: this.profileService.getUserObject('user_link', this.user.slug),\n user_skills: this.tagService.getGroupedSkills(\n this.user.slug,\n TAG_ENTITY.USER,\n TAG_TYPE.SKILLS\n )\n }).subscribe({\n next: response => {\n this.user_profile = response.user_profile.result;\n this.user['profile'] = this.user_profile;\n this.qualifications = response.qualifications.result;\n this.userLinks = (response.user_links.result ?? {}) as Record<string, string>;\n this.noUserLinks = Object.values(this.userLinks).some(x => !!x);\n this.selectedSkills = response.user_skills.result;\n this.loading = false;\n this.cdr.markForCheck();\n },\n error: err => {\n this.loading = false;\n this.toast.showToast(err);\n this.cdr.markForCheck();\n },\n complete: () => {\n this.loading = false;\n this.cdr.markForCheck();\n }\n });\n }\n\n private getSkills() {\n this.tagService.getTagsByType('skills', {}).subscribe(({ result }) => {\n this.allSkills = result;\n this.cdr.markForCheck();\n });\n }\n\n onProfileOpen() {\n this.modal.onOpen();\n }\n\n openSkills() {\n this.skillsModal.open();\n }\n\n onProfileSaved(_event) {\n this.getUserDetails();\n this.saveEvent.emit();\n }\n\n onOpenSocial() {\n if (this.socialModal) {\n this.socialModal.onOpen(this.userLinks); // Pass userLinks to the modal\n }\n }\n\n editQualification(item) {\n this.qualificationModal.onOpen(item);\n }\n\n deleteQualification(item) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: `Are you sure you want to delete <strong>${item.degree}</strong>?`,\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.qualificationService.deleteQualifications(item.id).subscribe(() => {\n this.toast.success(\n this.translation.translate(\n 'User.Profile.Qualifications.QualificationDelete'\n )\n );\n this.getUserDetails();\n this.cdr.markForCheck();\n });\n });\n }\n\n onSaveUserLinks() {\n this.getUserDetails();\n }\n\n trackByQualification(_index: number, item: { id: number }) {\n return item.id;\n }\n\n override ngOnDestroy() {\n // Intentionally no super.ngOnDestroy() call.\n }\n}\n","<div class=\"about\">\n <!-- Personal Information -->\n <section class=\"about-section\" data-cy=\"personal-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-user\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.PersonalInfo' | transloco }}</h2>\n @if (user && isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"onProfileOpen()\" [attr.aria-label]=\"'User.Profile.About.EditPersonalInfo' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n <div class=\"about-bio\">\n <span class=\"about-field__label\">{{ 'User.Profile.About.AboutMe' | transloco }}</span>\n <p class=\"about-bio__text\" [class.is-empty]=\"!user_profile?.description\">\n {{ user_profile?.description || ('User.Profile.About.NoDescription' | transloco) }}\n </p>\n </div>\n <dl class=\"about-grid\">\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Birthday' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.dob\">{{ (user_profile?.dob | dateFormat) || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.LivesIn' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.country\">{{ user_profile?.country || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Gender' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.gender\">\n {{\n user_profile?.gender === 'M'\n ? ('User.Profile.About.Male' | transloco)\n : user_profile?.gender === 'F'\n ? ('User.Profile.About.Female' | transloco)\n : '—'\n }}\n </dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Email' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user?.email\">\n @if (user?.email) {\n <a class=\"about-field__link\" [href]=\"'mailto:' + user.email\">{{ user.email }}</a>\n } @else {\n —\n }\n </dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.PhoneNumber' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.phone_number\">{{ user_profile?.phone_number || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Website' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user_profile?.website_url\">\n @if (user_profile?.website_url) {\n <a class=\"about-field__link\" target=\"_blank\" rel=\"noopener noreferrer\" [href]=\"user_profile.website_url\">{{ user_profile.website_url }}</a>\n } @else {\n —\n }\n </dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Joined' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!user?.joined_at\">{{ (user?.joined_at | dateFormat) || '—' }}</dd>\n </div>\n </dl>\n @if (user && isEdit) {\n <pw-edit-user-profile-modal [user]=\"user\" (saveEvent)=\"onProfileSaved($event)\" [slug]=\"user?.slug\"></pw-edit-user-profile-modal>\n }\n </section>\n\n <!-- Skills -->\n <section class=\"about-section\" data-cy=\"skills-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-bolt\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.Skills' | transloco }}</h2>\n @if (isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"openSkills()\" [attr.aria-label]=\"'User.Profile.About.EditSkills' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n @if (selectedSkills?.length) {\n <div class=\"about-skills\">\n @for (skill of selectedSkills; track skill) {\n <div class=\"about-skills__group\">\n <span class=\"about-skills__category\">{{ skill.category_name }}</span>\n <div class=\"about-tags\">\n @for (item of skill.tags; track item) {\n <span class=\"about-tag\">{{ item.name }}</span>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <p class=\"about-empty\">{{ (isEdit ? 'User.Profile.About.NoSkillsEdit' : 'User.Profile.About.NoSkills') | transloco }}</p>\n }\n @if (isEdit) {\n <pw-edit-skills-modal [userId]=\"user?.id\" [slug]=\"user?.slug\" (saveEvent)=\"getUserDetails()\"></pw-edit-skills-modal>\n }\n </section>\n\n <!-- Educational Information -->\n <section class=\"about-section\" data-cy=\"educational-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-graduation-cap\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.Education' | transloco }}</h2>\n @if (isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"qualificationModal.onOpen()\" [attr.aria-label]=\"'User.Profile.About.AddEducation' | transloco\">\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n @if (qualifications?.length) {\n <div class=\"about-edu\">\n @for (item of qualifications; track trackByQualification($index, item)) {\n <article class=\"about-edu__item\">\n <div class=\"about-edu__main\">\n <h4 class=\"about-edu__school\">{{ item?.school }}</h4>\n <dl class=\"about-grid about-grid--compact\">\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Period' | transloco }}</dt>\n <dd class=\"about-field__value\">{{ item?.started_on }} – {{ item?.ended_on }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Degree' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!item?.degree\">{{ item?.degree || '—' }}</dd>\n </div>\n <div class=\"about-field\">\n <dt class=\"about-field__label\">{{ 'User.Profile.About.Course' | transloco }}</dt>\n <dd class=\"about-field__value\" [class.is-empty]=\"!item?.course\">{{ item?.course || '—' }}</dd>\n </div>\n </dl>\n </div>\n @if (isEdit) {\n <div class=\"about-edu__actions\">\n <button type=\"button\" class=\"about-icon-btn\" [attr.aria-label]=\"'User.Profile.About.EditEducation' | transloco\" (click)=\"editQualification(item)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"about-icon-btn about-icon-btn--danger\" data-cy=\"delete-qualification\" [attr.aria-label]=\"'User.Profile.About.DeleteEducation' | transloco\" (click)=\"deleteQualification(item)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n </article>\n }\n </div>\n } @else {\n <p class=\"about-empty\">{{ 'User.Profile.About.NoEducation' | transloco }}</p>\n }\n @if (isEdit) {\n <pw-edit-qualifications-modal (saveEvent)=\"getUserDetails()\"></pw-edit-qualifications-modal>\n }\n </section>\n\n <!-- External Portfolio -->\n <section class=\"about-section\" data-cy=\"portfolio-info\">\n <header class=\"about-section__head\">\n <span class=\"about-section__icon\"><i class=\"fa fa-link\" aria-hidden=\"true\"></i></span>\n <h2 class=\"about-section__title\">{{ 'User.Profile.About.Portfolio' | transloco }}</h2>\n @if (isEdit) {\n <button type=\"button\" class=\"about-section__edit\" (click)=\"onOpenSocial()\" [attr.aria-label]=\"'User.Profile.About.EditPortfolio' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n }\n </header>\n @if (noUserLinks) {\n <div class=\"about-social\">\n @for (link of objectKeys(userLinks); track link) {\n @if (userLinks[link]) {\n <a class=\"about-social__link\" target=\"_blank\" rel=\"noopener noreferrer\" [href]=\"userLinks[link]\" [attr.aria-label]=\"link\">\n <img src=\"assets/img/icons/social/{{ link }}.svg\" width=\"32\" height=\"32\" [alt]=\"link\" />\n </a>\n }\n }\n </div>\n } @else {\n <p class=\"about-empty\">{{ 'User.Profile.About.NoPortfolio' | transloco }}</p>\n }\n @if (user && isEdit) {\n <pw-edit-social-links [userId]=\"user.id\" [links]=\"userLinks\" (saveEvent)=\"onSaveUserLinks()\"></pw-edit-social-links>\n }\n </section>\n\n @if (loading) {\n <div class=\"w-100 text-center p-3\"><p-progress-spinner strokeWidth=\"2\"></p-progress-spinner></div>\n }\n</div>\n","import { ChangeDetectorRef, Component, inject, Input, OnInit } from '@angular/core';\n\nimport { ProfileService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { HelperService } from '@posiwise/helper-service';\nimport { NoDataComponent } from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\n@Component({\n selector: 'pw-portfolios',\n templateUrl: './user-portfolios.component.html',\n styleUrls: ['./user-portfolios.component.scss'],\n imports: [Bind, ProgressSpinner, NoDataComponent, LazyImgDirective, TranslocoPipe]\n})\nexport class PortfoliosComponent implements OnInit {\n private readonly service = inject(ProfileService);\n private readonly modalService = inject(NgbModal);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() user: User;\n @Input() isEdit = false;\n\n projectPictures = [];\n\n selectedPicURL: string;\n\n isLoaded = false;\n\n ngOnInit() {\n this.getProjectPictures();\n }\n\n private getProjectPictures() {\n this.service.getProjectPictures(this.user.slug).subscribe(({ result }) => {\n if (result.length > 0) {\n this.projectPictures = result.flatMap(x => x.project_pictures);\n }\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n deletePicture(id) {\n HelperService.raiseDeletePopup().then(resp => {\n if (resp.value) {\n this.service.deletePicture(id).subscribe(_ => {\n this.getProjectPictures();\n this.cdr.markForCheck();\n });\n }\n });\n }\n\n trackByImage(_index: number, item: { id: number }) {\n return item.id;\n }\n\n showFullImage(picture, content, evt) {\n if ($(evt.target).attr('id') !== 'delete-icon') {\n this.selectedPicURL = picture.picture.url;\n this.modalService.open(content, {\n centered: true,\n size: 'lg',\n windowClass: 'img-popup'\n });\n }\n }\n}\n","<div class=\"row\">\n <div class=\"col-sm-12 mt-2\">\n <h2>{{ 'User.Profile.Portfolio.Title' | transloco }}</h2>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (projectPictures.length === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"No portfolio listed yet - please consider adding some.\"\n ></pw-no-data>\n }\n <div class=\"card-body\">\n @if (projectPictures.length) {\n <div class=\"card-block\"\n >\n <div class=\"grid-hover\">\n <div class=\"row\">\n @for (picture of projectPictures; track trackByImage($index, picture)) {\n <div class=\"col-md-4 col-12 mb-2\"\n >\n <figure class=\"effect-marley\"\n (keydown.enter)=\"showFullImage(picture, content, $event)\"\n (click)=\"showFullImage(picture, content, $event)\">\n <img [src]=\"picture.picture.url\"\n [alt]=\"'User.Profile.Portfolio.PictureAlt' | transloco\" />\n <figcaption>\n <h2>\n <span class=\"portfolio-header-text\">{{ picture.project_title }}</span>\n </h2>\n @if (isEdit) {\n <i\n class=\"fal fa-2x fa-times white\"\n id=\"delete-icon\"\n (click)=\"deletePicture(picture.id)\"\n (keydown.enter)=\"deletePicture(picture.id)\"\n aria-hidden=\"true\"\n ></i>\n }\n <p class=\"thumb-description\">\n {{ picture?.project_description }}\n </p>\n </figcaption>\n </figure>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n<ng-template #content\n let-modal>\n <div class=\"modal-img-popup\">\n <img [alt]=\"'User.Profile.Portfolio.PictureAlt' | transloco\"\n [src]=\"selectedPicURL\"\n class=\"img-fluid\" />\n <button type=\"button\"\n class=\"close close-img\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss('Cross click')\">\n <span class=\"btn\">&times;</span>\n </button>\n </div>\n</ng-template>\n","import { ChangeDetectorRef, inject } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { dataUrlToBlob } from '../account/account-details/account-details.utils';\nimport { slugPngFile } from '../account/subscriptions/user-subscription-details/subscription-details.utils';\n\n/** Avatar display and upload of the public user profile page (undecorated base). */\nexport abstract class UserProfileAvatar extends AppBaseComponent {\n private readonly modalService = inject(NgbModal);\n protected readonly cdr = inject(ChangeDetectorRef);\n\n slug: string;\n\n image = 'assets/img/icons/male.png';\n\n abstract get allowEdit(): boolean;\n\n handleImageError(event: Event, fallbackPath): void {\n HelperService.handleImageFallbackPath(event, fallbackPath);\n }\n\n openModal(content) {\n if (this.allowEdit) {\n this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });\n }\n }\n\n onImageSelection(event) {\n const file = slugPngFile(this.slug, dataUrlToBlob(event));\n this.userService.addAvatar(file).subscribe(res => {\n this.modalService.dismissAll();\n this.image = res?.result?.user_avatar[2]?.url;\n this.cdr.markForCheck();\n });\n }\n\n onClose() {\n this.modalService.dismissAll();\n }\n}\n","/** Waits up to 10 s for jQuery (the timeline script needs it), then loads it from a CDN. */\nexport function waitForJQuery(callback: () => void): void {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait time\n\n const checkJQuery = () => {\n if (window['jQuery']) {\n callback();\n } else if (attempts < maxAttempts) {\n attempts++;\n setTimeout(checkJQuery, 100);\n } else {\n // Load jQuery since it's needed\n loadJQueryForUserProfile(callback);\n }\n };\n checkJQuery();\n}\n\nfunction loadJQueryForUserProfile(callback: () => void): void {\n const jquerySrc = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n const script = document.createElement('script');\n script.src = jquerySrc;\n script.crossOrigin = 'anonymous';\n script.async = false;\n script.onload = () => {\n callback();\n };\n script.onerror = () => {\n console.error('Failed to load jQuery for user profile');\n // Try fallback\n const fallbackScript = document.createElement('script');\n fallbackScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n fallbackScript.crossOrigin = 'anonymous';\n fallbackScript.async = false;\n fallbackScript.onload = () => {\n callback();\n };\n fallbackScript.onerror = () => {\n console.error('All jQuery CDNs failed for user profile');\n };\n document.head.appendChild(fallbackScript);\n };\n document.head.appendChild(script);\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, Input, OnInit, ViewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { ProfileService } from '@posiwise/common-services';\nimport { Project, User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { ConfirmDialogService, NoDataComponent } from '@posiwise/shared-components';\n\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Rating } from 'primeng/rating';\nimport { Tooltip } from 'primeng/tooltip';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { EditPortfoliosComponent } from '../edit-portfolios/edit-portfolios.component';\nimport { EditProjectModalComponent } from '../edit-project-modal/edit-project-modal.component';\nimport { EditRecommendationModalComponent } from '../edit-recommendation-modal/edit-recommendation-modal.component';\nimport { EditSkillsModalComponent } from '../edit-skills-modal/edit-skills-modal.component';\n\n@Component({\n selector: 'pw-user-projects',\n templateUrl: './user-projects.component.html',\n styleUrls: ['./user-projects.component.scss'],\n imports: [\n Bind,\n ProgressSpinner,\n NgClass,\n Tooltip,\n LazyImgDirective,\n Rating,\n FormsModule,\n EditSkillsModalComponent,\n EditPortfoliosComponent,\n NoDataComponent,\n EditProjectModalComponent,\n EditRecommendationModalComponent,\n TranslocoPipe\n ]\n})\nexport class UserProjectsComponent extends AppBaseComponent implements OnInit {\n private readonly service = inject(ProfileService);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly confirmDialog = inject(ConfirmDialogService);\n\n @Input() user: User;\n @Input() isEdit = false;\n @Input() slug: string;\n\n @ViewChild(EditProjectModalComponent, { static: true })\n projectModal: EditProjectModalComponent;\n\n @ViewChild(EditSkillsModalComponent, { static: false })\n skillModal: EditSkillsModalComponent;\n\n @ViewChild(EditRecommendationModalComponent, { static: true })\n recommendationModal: EditRecommendationModalComponent;\n\n @ViewChild(EditPortfoliosComponent, { static: false })\n portfolios: EditPortfoliosComponent;\n\n projects: Project[] = [];\n\n submitted: boolean;\n\n isLoaded = false;\n\n ngOnInit() {\n this.getProjects();\n }\n\n onEditProject(item) {\n this.projectModal.onOpen(item);\n }\n\n editRecommendation(item) {\n this.recommendationModal.onOpen(item);\n }\n\n openSkills(project) {\n this.skillModal.slug = project.slug;\n this.skillModal.open();\n }\n\n getProjects() {\n const profileSlug = this.user?.slug || this.slug;\n this.service.getProjects(profileSlug).subscribe(({ result }) => {\n this.projects = result.projects;\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n onSkillsSave() {\n this.getProjects();\n }\n\n onSaveProject(_event) {\n this.getProjects();\n }\n\n openPortfolios(id: number) {\n this.portfolios.openModal(id);\n this.portfolios.getProjectPictures();\n }\n\n onDeleteProject(project) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: `Are you sure you want to delete ${project.title}?`,\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.service.deleteProject(project.id).subscribe(() => {\n this.projects = this.projects.filter((x: Project) => x.id !== project.id);\n this.cdr.markForCheck();\n });\n });\n }\n\n trackByProject(_index: number, item: Project) {\n return item.id;\n }\n\n deletePicture(project) {\n this.service.deletePicture(project.project_pictures[0].id).subscribe(_ => {\n this.getProjects();\n this.cdr.markForCheck();\n });\n }\n}\n","<div class=\"row\">\n <div class=\"col-sm-12 mt-2\">\n <h2>{{ 'User.Profile.Projects.Title' | transloco }}</h2>\n @if (isEdit) {\n <div class=\"row\"\n >\n <div class=\"col-12\">\n <div class=\"content-header\">\n <button class=\"btn btn-primary float-end\"\n (click)=\"onEditProject(null)\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> {{'Create Project' | transloco}}\n </button>\n </div>\n </div>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (projects?.length) {\n <div id=\"timeline\"\n class=\"timeline-center timeline-wrapper\"\n >\n <ul class=\"timeline\">\n <li class=\"timeline-line\"></li>\n </ul>\n <ul class=\"timeline\">\n <li class=\"timeline-line\"></li>\n @for (\n project of projects; track trackByProject(i,\n project); let i = $index; let odd = $odd; let even = $even) {\n <li class=\"timeline-item\"\n [ngClass]=\"{ 'mt-5': odd }\"\n >\n <div class=\"timeline-badge\">\n <span class=\"bg-red bg-lighten-1\"\n [pTooltip]=\"'User.Profile.Projects.PortfolioWork' | transloco\"\n tooltipPosition=\"right\"\n appendTo=\"body\">\n <span class=\"timeline-year\"> {{ project.start_year }} </span>\n </span>\n </div>\n <div class=\"timeline-card card pb-0\">\n <div class=\"card-header\">\n <h4 class=\"mb-0 card-title\">\n <a>{{ project.title }}</a>\n </h4>\n <div class=\"card-subtitle text-muted mt-0\">\n <span class=\"font-small-3\">\n {{ project.start_year }} - {{ project.end_year }}</span>\n </div>\n </div>\n <div class=\"card-body project-card\">\n @if (project.project_pictures?.length) {\n <i\n class=\"fal fa-times\"\n (click)=\"deletePicture(project)\"\n (keydown.enter)=\"deletePicture(project)\"\n aria-hidden=\"true\"\n ></i>\n <img class=\"img-fluid project-picture\"\n [src]=\"project.project_pictures[0].picture.url\"\n [alt]=\"'User.Profile.Projects.CoverAlt' | transloco\" />\n }\n <div class=\"card-body\">\n <div class=\"\">\n <p class=\"card-text\">{{ project.description }}</p>\n <div class=\"list-inline mb-1\">\n <!-- Skills -->\n @if (project.tags?.length) {\n <div>\n <div class=\"my-2\">\n <i class=\"fa fa-user-tag\" aria-hidden=\"true\"></i>\n {{ 'User.Profile.About.Skills' | transloco }}\n </div>\n @for (tag of project.tags; track tag) {\n <span class=\"badge bg-success me-2\">{{\n tag.name\n }}</span>\n }\n </div>\n }\n @if (project.project_recommendations?.length) {\n <div class=\"mt-2\"\n >\n <div class=\"my-2\">\n <i\n class=\"fa fa-clipboard-check me-2\"\n aria-hidden=\"true\"\n ></i>\n {{ 'User.Profile.Projects.Recommendations' | transloco }}\n </div>\n @for (\n recommendation of project.project_recommendations\n ; track\n recommendation) {\n <section class=\"mb-2\"\n >\n <div class=\"me-2\">\n {{ 'User.Profile.Projects.Client' | transloco: { name: recommendation?.client_name } }}\n </div>\n <div class=\"me-2\">\n {{ 'User.Profile.Projects.Message' | transloco: { message: recommendation?.description } }}\n </div>\n <div class=\"row recommendation\">\n <div class=\"col-4\">\n <span>{{ 'User.Profile.Recommendations.Field.Communication' | transloco }}</span>\n <p-rating [(ngModel)]=\"\n recommendation.communication\n \"\n [cancel]=\"false\"\n [readonly]=\"true\">\n </p-rating>\n </div>\n <div class=\"col-4\">\n <span>{{ 'User.Profile.Recommendations.Field.Quality' | transloco }}</span>\n <p-rating [(ngModel)]=\"recommendation.quality\"\n [cancel]=\"false\"\n [readonly]=\"true\">\n </p-rating>\n </div>\n <div class=\"col-4\">\n <span>{{ 'User.Profile.Recommendations.Field.Time' | transloco }}</span>\n <p-rating [(ngModel)]=\"recommendation.time\"\n [cancel]=\"false\"\n [readonly]=\"true\">\n </p-rating>\n </div>\n </div>\n </section>\n }\n </div>\n }\n @if (isEdit) {\n <div class=\"text-end mt-3 d-flex justify-content-end project-actions\"\n >\n <!-- Project Edit -->\n <span class=\"btn btn-link pb-0 actions\"\n (keydown.enter)=\"onEditProject(project)\"\n (click)=\"onEditProject(project)\">\n {{ 'Button.Edit' | transloco }}\n </span>\n <button class=\"btn btn-link pb-0 actions\"\n (click)=\"openSkills(project)\">\n {{ 'User.Profile.About.Skills' | transloco }}\n </button>\n <pw-edit-skills-modal [userId]=\"user?.id\"\n entityEntity=\"Project\"\n entityType=\"skills\"\n (saveEvent)=\"onSkillsSave()\"\n [slug]=\"project?.slug\">\n </pw-edit-skills-modal>\n <!-- Portfolios -->\n <button class=\"btn btn-link pb-0 actions\"\n (click)=\"openPortfolios(project.id)\">\n {{ 'User.Profile.Projects.Photos' | transloco }}\n </button>\n <pw-edit-portfolios [slug]=\"user?.slug\"\n [id]=\"project.id\"\n (successEvent)=\"getProjects()\">\n </pw-edit-portfolios>\n <span class=\"btn btn-link pb-0 delete-project actions\"\n (keydown.enter)=\"onDeleteProject(project)\"\n (click)=\"onDeleteProject(project)\">\n {{ 'Button.Delete' | transloco }}\n </span>\n </div>\n }\n <!-- Recommendation -->\n @if (!isEdit) {\n <span class=\"pe-1 mt-3\"\n (click)=\"editRecommendation(project)\"\n (keydown.enter)=\"editRecommendation(project)\"\n >\n <a class=\"primary\"><span class=\"fa fa-commenting-o\"></span> {{ 'User.Profile.Projects.Endorse' | transloco }}\n </a></span>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n </li>\n }\n </ul>\n </div>\n }\n @if (projects?.length === 0 && isLoaded) {\n<pw-no-data [withImage]=\"true\" [message]=\"\n isEdit\n ? ('User.Profile.Projects.NoProjects' | transloco)\n : ('User.Profile.Projects.NoUserProjects' | transloco)\n \"\n >\n </pw-no-data>\n }\n </div>\n</div>\n<pw-edit-project-modal (saveEvent)=\"onSaveProject($event)\"></pw-edit-project-modal>\n<pw-edit-recommendation-modal [user]=\"user\"></pw-edit-recommendation-modal>\n","import { Component, inject, OnInit } from '@angular/core';\n\nimport { ProfileService, ScriptLoaderService, UserProfileDetails } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\nimport { LazyImgDirective } from '@posiwise/directives';\nimport { ProfileImageCropperComponent } from '@posiwise/utils';\n\nimport { StatusCodes } from 'http-status-codes';\nimport { MenuItem } from 'primeng/api';\nimport { Bind } from 'primeng/bind';\nimport { ProgressSpinner } from 'primeng/progressspinner';\nimport { Ripple } from 'primeng/ripple';\nimport { Tab, TabList, Tabs } from 'primeng/tabs';\nimport { forkJoin } from 'rxjs';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\n\nimport { UserAboutComponent } from './user-about/user-about.component';\nimport { PortfoliosComponent } from './user-portfolios/user-portfolios.component';\nimport { UserProfileAvatar } from './user-profile-avatar';\nimport { waitForJQuery } from './user-profile-jquery';\nimport { UserProjectsComponent } from './user-projects/user-projects.component';\n\n@Component({\n selector: 'pw-user-profile-page',\n templateUrl: './user-profile-page.component.html',\n styleUrls: ['./user-profile-page.component.scss'],\n imports: [\n LazyImgDirective,\n Bind,\n Tabs,\n TabList,\n Ripple,\n Tab,\n ProgressSpinner,\n UserAboutComponent,\n UserProjectsComponent,\n PortfoliosComponent,\n ProfileImageCropperComponent,\n TranslocoPipe\n ]\n})\nexport class UserProfilePageComponent extends UserProfileAvatar implements OnInit {\n private readonly profileService = inject(ProfileService);\n private readonly scriptLoader = inject(ScriptLoaderService);\n\n private loggedInUserDetails: User;\n\n user: User;\n\n objectKeys = Object.keys;\n\n isFollowing: boolean;\n\n isLoaded = false;\n\n userProfile: UserProfileDetails | null;\n\n items: MenuItem[];\n activeItem: MenuItem;\n /** Current tab value for p-tabs */\n activeTabValue: string;\n\n onTabChange(value: string) {\n const item = this.items.find(i => i.id === value);\n if (item) {\n this.activeItem = item;\n }\n }\n\n constructor() {\n super();\n this.route.params.subscribe(data => {\n this.slug = data['user-slug'];\n this.cdr.markForCheck();\n });\n\n this.items = [\n { id: 'about', label: 'About', labelKey: 'User.Tabs.About', icon: 'fa fa-fw fa-user' },\n {\n id: 'projects',\n label: 'Projects',\n labelKey: 'User.Tabs.Projects',\n icon: 'fa fa-fw fa-briefcase',\n state: {\n permission: this.permissionService.evaluatePermissions('Pages.Product.CRM')\n }\n },\n {\n id: 'portfolio',\n label: 'Portfolio',\n labelKey: 'User.Tabs.Portfolio',\n icon: 'fa fa-fw fa-image',\n state: {\n permission: this.permissionService.evaluatePermissions('Pages.Product.CRM')\n }\n }\n ];\n [this.activeItem] = this.items;\n this.activeTabValue = this.activeItem?.id as string;\n }\n\n get allowEdit() {\n return (\n this.loggedInUserDetails?.slug === this.slug || this.permissionService.isSuperAdmin()\n );\n }\n\n ngOnInit() {\n this.getUserBySlug();\n // Horizontal Timeline js for user timeline\n waitForJQuery(() => {\n this.scriptLoader.loadScriptOnce('head', '/assets/js/vertical-timeline.js');\n });\n }\n\n getUserBySlug() {\n forkJoin({\n user: this.profileService.getUserObject('user', this.slug),\n user_profile: this.profileService.getUserObject('user_profile', this.slug),\n avatar: this.profileService.getUserObject('avatar', this.slug)\n }).subscribe({\n next: response => {\n this.user = response.user.result;\n this.userProfile = response.user_profile.result;\n if (response.avatar.result?.length > 0) {\n this.image = response.avatar.result[2]?.url;\n }\n this.getCurrentUserDetails();\n this.isLoaded = true;\n this.cdr.markForCheck();\n },\n error: error => {\n if (error.status === StatusCodes.NOT_FOUND) {\n this.router.navigate(['NotFound']);\n }\n this.cdr.markForCheck();\n }\n });\n }\n\n private getCurrentUserDetails() {\n this.userStore().subscribe((currentUser: User) => {\n if (currentUser) {\n this.loggedInUserDetails = currentUser;\n\n this.userService\n .getCurrentUserObject('user_relationships')\n .subscribe(({ result }) => {\n this.isFollowing =\n result.length > 0\n ? result.some(\n x =>\n x.followed_id === this.user.id &&\n currentUser.id === x.follower_id\n )\n : false;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n sendMessageSlug() {\n this.router.navigate(['/message'], { fragment: this.slug });\n }\n\n followUser() {\n this.userService.followUser(this.user.id).subscribe(({ result }) => {\n const name = this.user.first_name || this.user.slug;\n if (result?.id) {\n this.isFollowing = true;\n this.toast.success(`You're now following ${name}`);\n } else {\n this.isFollowing = false;\n this.toast.success(`You've unfollowed ${name}`);\n }\n this.cdr.markForCheck();\n });\n }\n}\n","<!-- User Profile Starts -->\n<!-- Basic User Details Starts -->\n@if (user) {\n <section id=\"user-profile\"\n >\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"dashboard\">\n <div class=\"media row py-3 align-items-center\">\n <div class=\"col-3 col-sm-2\">\n <div class=\"align-self-center halfway-fab text-center\">\n <!-- User Avatar -->\n <a class=\"profile-image\">\n <img [src]=\"image\"\n width=\"100\"\n height=\"100\"\n class=\"rounded-circle img-border width-100\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\" />\n @if (allowEdit) {\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\"\n >\n <div class=\"overlay-text\">\n <!-- Change Profile Pic -->\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n </div>\n </div>\n }\n </a>\n </div>\n </div>\n <div class=\"col-9 col-sm-5\">\n <div class=\"align-self-start halfway-fab ps-3 pt-2\">\n <div>\n @if (user?.last_name) {\n <strong class=\"font-medium-2 text-uppercase\"\n >\n {{\n user?.first_name\n ? user?.first_name + ' ' + user?.last_name\n : 'Update Profile'\n }}\n </strong>\n }\n @if (!user?.last_name) {\n <strong class=\"font-medium-2 text-uppercase\"\n >\n {{ user?.first_name ? user?.first_name : 'Update Profile' }}\n </strong>\n }\n <p class=\"font-small-4\">{{ userProfile?.headline }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-sm-5\">\n @if (!allowEdit) {\n <div class=\"profile-cover-buttons\"\n >\n <div class=\"d-flex halfway-fab align-self-end\">\n <div class=\"text-end d-none d-sm-none d-md-none d-lg-block\">\n <button type=\"button\"\n (click)=\"followUser()\"\n class=\"btn btn-outline-primary btn-raised me-2\">\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\n {{ isFollowing ? 'Following' : 'Follow' }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary btn-raised me-3\"\n (click)=\"sendMessageSlug()\">\n <i class=\"fa fa-mail-bulk\" aria-hidden=\"true\"></i> {{ 'User.Profile.SendMessage' | transloco }}\n </button>\n </div>\n <div class=\"text-end d-block d-sm-block d-md-block d-lg-none\">\n <button type=\"button\"\n class=\"btn btn-primary btn-raised me-2\">\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"btn btn-primary btn-raised me-3\">\n <i class=\"fa fa-mail-bulk\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n}\n<!-- Basic User Details Ends -->\n<section>\n <div class=\"container-fluid pw-tab overflow-hidden\">\n <p-tabs [value]=\"activeTabValue\" (valueChange)=\"onTabChange($event)\">\n <p-tablist>\n @for (item of items; track item) {\n <p-tab [value]=\"item.id\">\n @if (item.icon) {\n <i [class]=\"item.icon\" aria-hidden=\"true\"></i>\n }\n <span>{{ item['labelKey'] | transloco }}</span>\n </p-tab>\n }\n </p-tablist>\n </p-tabs>\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (user && activeItem.id === 'about') {\n <pw-user-about [user]=\"user\"\n [isEdit]=\"allowEdit\"\n (saveEvent)=\"getUserBySlug()\">\n </pw-user-about>\n }\n @if (activeItem.id === 'projects') {\n <pw-user-projects [user]=\"user\"\n [slug]=\"slug\"\n [isEdit]=\"allowEdit\"></pw-user-projects>\n }\n @if (activeItem.id === 'portfolio') {\n <pw-portfolios [user]=\"user\"\n [isEdit]=\"allowEdit\"></pw-portfolios>\n }\n </div>\n </div>\n </div>\n</section>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n [userAvatar]=\"image\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\nimport { NgxGpAutocompleteModule } from '@angular-magic/ngx-gp-autocomplete';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { AppLoaderModule } from '@posiwise/app-loader';\nimport { TrackDirtyFormDirective } from '@posiwise/core-guards';\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\nimport { DirectivesModule } from '@posiwise/directives';\nimport { PipesModule } from '@posiwise/pipes';\nimport { PwStickyActionsComponent, SharedComponentsModule } from '@posiwise/shared-components';\n\nimport { NgxCaptchaModule } from 'ngx-captcha';\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { AccordionModule } from 'primeng/accordion';\nimport { DatePickerModule } from 'primeng/datepicker';\nimport { FileUploadModule } from 'primeng/fileupload';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MultiSelectModule } from 'primeng/multiselect';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\nimport { RatingModule } from 'primeng/rating';\nimport { SelectModule } from 'primeng/select';\nimport { SelectButtonModule } from 'primeng/selectbutton';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { Loader } from '@googlemaps/js-api-loader';\nimport { NgbDatepickerModule, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';\n\nimport { AccountComponent } from './account/account.component';\nimport { AccountDetailsComponent } from './account/account-details/account-details.component';\nimport { AddSubscriptionComponent } from './account/subscriptions/add-subscription/add-subscription.component';\nimport { SavedCardDetailsComponent } from './account/subscriptions/saved-card-details/saved-card-details.component';\nimport { ClearMaskedOnFocusDirective } from './account/subscriptions/subscription-credential/clear-masked-on-focus.directive';\nimport {\n CredentialAvatarHuePipe,\n HumanizeCredentialNamePipe,\n SubscriptionNameByIdPipe\n} from './account/subscriptions/subscription-credential/humanize-credential-name.pipe';\nimport { SubscriptionCredentialComponent } from './account/subscriptions/subscription-credential/subscription-credential.component';\nimport { SubscriptionRemovalComponent } from './account/subscriptions/subscription-removal/subscription-removal.component';\nimport { SecondaryPaymentMethodComponent } from './account/subscriptions/update-payment-details/secondary-payment-method.component';\nimport { UpdatePaymentDetailsComponent } from './account/subscriptions/update-payment-details/update-payment-details.component';\nimport { UpgradeSubscriptionComponent } from './account/subscriptions/upgrade-subscription/upgrade-subscription.component';\nimport { UserSubscriptionDetailsComponent } from './account/subscriptions/user-subscription-details/user-subscription-details.component';\nimport { UserSubscriptionListComponent } from './account/subscriptions/user-subscriptions-list/user-subscriptions-list.component';\nimport { UserInvoiceComponent } from './account/user-invoice/user-invoice.component';\nimport { AiKnowledgeTabComponent } from './settings-tabs/ai-knowledge-tab/ai-knowledge-tab.component';\nimport { CommunicationTabComponent } from './settings-tabs/communication-tab/communication-tab.component';\nimport { OthersTabComponent } from './settings-tabs/others-tab/others-tab.component';\nimport { SecurityTabComponent } from './settings-tabs/security-tab/security-tab.component';\nimport { SettingsComponent } from './settings-tabs/settings-tabs.component';\nimport { SupportComponent } from './support/support.component';\nimport { SupportDetailsComponent } from './support/support-details/support-details.component';\nimport { EditPortfoliosComponent } from './user-profile/edit-portfolios/edit-portfolios.component';\nimport { EditProjectModalComponent } from './user-profile/edit-project-modal/edit-project-modal.component';\nimport { EditQualificationsModalComponent } from './user-profile/edit-qualifications-modal/edit-qualifications-modal.component';\nimport { EditRecommendationModalComponent } from './user-profile/edit-recommendation-modal/edit-recommendation-modal.component';\nimport { EditSkillsModalComponent } from './user-profile/edit-skills-modal/edit-skills-modal.component';\nimport { EditSocialLinksComponent } from './user-profile/edit-social-links/edit-social-links.component';\nimport { EditUserProfileModalComponent } from './user-profile/edit-user-profile-modal/edit-user-profile-modal.component';\nimport { UserAboutComponent } from './user-profile/user-about/user-about.component';\nimport { PortfoliosComponent } from './user-profile/user-portfolios/user-portfolios.component';\nimport { UserProfilePageComponent } from './user-profile/user-profile-page.component';\nimport { UserProjectsComponent } from './user-profile/user-projects/user-projects.component';\n\nconst primeNgModules = [\n DatePickerModule,\n MultiSelectModule,\n ProgressSpinnerModule,\n AccordionModule,\n FileUploadModule,\n SelectModule,\n RatingModule,\n SelectButtonModule,\n TooltipModule\n];\n\nconst ngbModule = [NgbModalModule, NgbDatepickerModule];\n\n@NgModule({\n imports: [\n PwStickyActionsComponent,\n InputTextModule,\n AppLoaderModule,\n DirectivesModule,\n CommonModule,\n RouterModule,\n ReactiveFormsModule,\n TrackDirtyFormDirective,\n CoreTranslocoModule,\n NgxGpAutocompleteModule,\n SharedComponentsModule,\n PipesModule,\n UiSwitchModule,\n NgxCaptchaModule,\n FormsModule,\n ...primeNgModules,\n ...ngbModule,\n AccountComponent,\n AccountDetailsComponent,\n AddSubscriptionComponent,\n SavedCardDetailsComponent,\n SubscriptionCredentialComponent,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n SubscriptionNameByIdPipe,\n ClearMaskedOnFocusDirective,\n UpdatePaymentDetailsComponent,\n SecondaryPaymentMethodComponent,\n UpgradeSubscriptionComponent,\n UserSubscriptionDetailsComponent,\n UserSubscriptionListComponent,\n SubscriptionRemovalComponent,\n UserInvoiceComponent,\n AiKnowledgeTabComponent,\n CommunicationTabComponent,\n OthersTabComponent,\n SecurityTabComponent,\n SettingsComponent,\n SupportComponent,\n EditPortfoliosComponent,\n EditProjectModalComponent,\n EditQualificationsModalComponent,\n EditRecommendationModalComponent,\n EditSkillsModalComponent,\n EditSocialLinksComponent,\n EditUserProfileModalComponent,\n UserAboutComponent,\n PortfoliosComponent,\n UserProfilePageComponent,\n UserProjectsComponent,\n SupportDetailsComponent\n ],\n exports: [\n AccountComponent,\n AccountDetailsComponent,\n AddSubscriptionComponent,\n SavedCardDetailsComponent,\n SubscriptionCredentialComponent,\n HumanizeCredentialNamePipe,\n CredentialAvatarHuePipe,\n SubscriptionNameByIdPipe,\n ClearMaskedOnFocusDirective,\n UpdatePaymentDetailsComponent,\n UpgradeSubscriptionComponent,\n UserSubscriptionDetailsComponent,\n UserSubscriptionListComponent,\n UserInvoiceComponent,\n AiKnowledgeTabComponent,\n CommunicationTabComponent,\n OthersTabComponent,\n SecurityTabComponent,\n SettingsComponent,\n SupportComponent,\n EditPortfoliosComponent,\n EditProjectModalComponent,\n EditQualificationsModalComponent,\n EditRecommendationModalComponent,\n EditSkillsModalComponent,\n EditSocialLinksComponent,\n EditUserProfileModalComponent,\n UserAboutComponent,\n PortfoliosComponent,\n UserProfilePageComponent,\n UserProjectsComponent,\n SupportDetailsComponent\n ],\n providers: [\n {\n provide: Loader,\n useFactory: (appConfigService: AppConfigService) => {\n return new Loader({\n apiKey: appConfigService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AA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAhB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,SAAA;IAnGrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IA7BJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAGe;IAAgB;IAqB3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAAuB;GAAA,SAAA;IAGvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAAuB;EAAA,CAAA;CAAA;CAelB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,WAbd,CACP;IACI,SAAS;IACT,aAAa,qBAAsC;KAC/C,OAAO,IAAI,OAAO;MACd,QAAQ,iBAAiB,gBAAe;MACxC,WAAW,CAAC,QAAQ;KACvB,CAAA;IACL;IACA,MAAM,CAAC,gBAAgB;GAC1B,CACJ;GAAA,SAAA;IAjGG;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACG;IACA;IACH;IACA;IACA;IAEA;IAKA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAAuB;EAAA,CAAA;CAAA;;AAiDlB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EArG5B,MAAA;EAAS,MAAA,CAAA;GACN,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;IACH,GAAG;IACH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,WAAW,CACP;IACI,SAAS;IACT,aAAa,qBAAsC;KAC/C,OAAO,IAAI,OAAO;MACd,QAAQ,iBAAiB,gBAAe;MACxC,WAAW,CAAC,QAAQ;KACvB,CAAA;IACL;IACA,MAAM,CAAC,gBAAgB;GAC1B,CACJ;EACJ,CAAA"}