@posiwise/user-module 0.0.183 → 0.0.185

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.
@@ -31,7 +31,7 @@ import { Loader } from "@googlemaps/js-api-loader";
31
31
  import { NgbDatepickerModule, NgbInputDatepicker, NgbModal, NgbModalModule } from "@ng-bootstrap/ng-bootstrap";
32
32
  import { __decorate } from "tslib";
33
33
  import { AppBaseComponent } from "@posiwise/app-base-component";
34
- import { AuthService, CommonService, CustomToastService, FormHelperService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService, ValidationService, hasKnowledgeAlpha } from "@posiwise/common-services";
34
+ import { AuthService, CommonService, CustomToastService, FormHelperService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService, ValidationService, hasKnowledgeAlpha, isInMobileWebView } from "@posiwise/common-services";
35
35
  import { AppUser, POLL_TIMEOUT, PRODUCT_CATEGORY, Project, TAG_ENTITY, TAG_TYPE } from "@posiwise/common-utilities";
36
36
  import { HelperService } from "@posiwise/helper-service";
37
37
  import { ProfileImageCropperComponent, ValidateForm, appendQueryParam, clearQueryParams } from "@posiwise/utils";
@@ -241,9 +241,9 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
241
241
  this.validatePasswordBusyButton = true;
242
242
  const password = this.passwordRef.nativeElement.value;
243
243
  if (password) this.userService.checkPassword({ password }).subscribe((data) => {
244
- if (data?.status === StatusCodes.OK) this.passwordVerified = true;
244
+ if (data?.result?.status === StatusCodes.OK) this.passwordVerified = true;
245
245
  else {
246
- this.toast.error(data.error.message);
246
+ this.toast.error(data["error"].message);
247
247
  this.passwordRef.nativeElement.value = "";
248
248
  }
249
249
  this.cdr.markForCheck();
@@ -271,7 +271,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
271
271
  if (response.status_code === 200) {
272
272
  this.toast.success(response.message, "", { positionClass: "toast-top-center" });
273
273
  this.onTogglePassword();
274
- } else this.toast.error(response.error.message);
274
+ } else this.toast.error(response["error"].message);
275
275
  this.passwordForm.reset();
276
276
  this.cdr.markForCheck();
277
277
  }).add(() => {
@@ -315,7 +315,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
315
315
  this.slugBusyButton = true;
316
316
  this.userService.updateSlug(this.slug).subscribe((response) => {
317
317
  this.toggleNickName = false;
318
- if (response?.status === StatusCodes.OK) this.getUserProfile();
318
+ if (response?.result?.status === StatusCodes.OK) this.getUserProfile();
319
319
  else this.toast.error("User.Account.UserNameError");
320
320
  this.cdr.markForCheck();
321
321
  }).add(() => {
@@ -328,7 +328,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
328
328
  const filename = `${`${this.slug.toLocaleLowerCase()}_${Date.parse((/* @__PURE__ */ new Date()).toString())}`}.png`;
329
329
  const file = new File([blob], filename);
330
330
  this.userService.addAvatar(file).subscribe((res) => {
331
- this.image = res?.user_avatar[2]?.url;
331
+ this.image = res?.result?.user_avatar[2]?.url;
332
332
  this.modalService.dismissAll();
333
333
  this.cdr.markForCheck();
334
334
  });
@@ -351,7 +351,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
351
351
  loadConnections() {
352
352
  this.loadingConnections = true;
353
353
  this.userService.getMcpConnections().subscribe({ next: (response) => {
354
- this.connections = response?.mcp_oauth_connections ?? [];
354
+ this.connections = response?.result ?? [];
355
355
  this.cdr.markForCheck();
356
356
  } }).add(() => {
357
357
  this.loadingConnections = false;
@@ -435,7 +435,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
435
435
  }
436
436
  performTokenRefresh() {
437
437
  this.refreshingTokens = true;
438
- this.userService.refreshUserApiTokens().subscribe({ next: (response) => {
438
+ this.userService.refreshUserApiTokens().subscribe({ next: ({ result: response }) => {
439
439
  if (response && response.api_keys) {
440
440
  if (!this.user.api_keys) this.user.api_keys = {};
441
441
  if (response.api_keys.api_user_token) this.user.api_keys.api_user_token = response.api_keys.api_user_token;
@@ -913,7 +913,7 @@ var AddSubscriptionComponent = class AddSubscriptionComponent extends AppBaseCom
913
913
  }
914
914
  getProducts() {
915
915
  this.productService.getProductList({}, this.subscriptionId, { only_relevant: true }).subscribe((response) => {
916
- this.products = response.products || [];
916
+ this.products = response.result || [];
917
917
  if (this.products?.length) this.products = this.products.filter((x) => x.active);
918
918
  this.isLoaded = true;
919
919
  this.userStore().subscribe((user) => {
@@ -1292,18 +1292,25 @@ i0.ɵɵngDeclareClassMetadata({
1292
1292
  args: [{ name: "humanizeCredentialName" }]
1293
1293
  }]
1294
1294
  });
1295
+ function sortByLabel(items, label) {
1296
+ const text = (item) => (label(item) ?? "").replace(/[_-]+/g, " ").trim();
1297
+ return [...items].sort((a, b) => text(a).localeCompare(text(b), void 0, {
1298
+ sensitivity: "base",
1299
+ numeric: true
1300
+ }));
1301
+ }
1295
1302
  function uniqueByName(credentials) {
1296
1303
  const seen = /* @__PURE__ */ new Set();
1297
- return credentials.filter((credential) => {
1304
+ return sortByLabel(credentials.filter((credential) => {
1298
1305
  if (seen.has(credential.name)) return false;
1299
1306
  seen.add(credential.name);
1300
1307
  return true;
1301
- });
1308
+ }), (credential) => credential.name);
1302
1309
  }
1303
1310
  function groupByCredentialName(credentialTypes, stored) {
1304
1311
  return credentialTypes.map(({ name }) => ({
1305
1312
  credential_name: name,
1306
- credentials: stored.filter((credential) => credential.name === name)
1313
+ credentials: sortByLabel(stored.filter((credential) => credential.name === name), (credential) => credential.field)
1307
1314
  })).filter((group) => group.credentials.length > 0);
1308
1315
  }
1309
1316
  function credentialFormRow(credentialType, stored) {
@@ -1339,11 +1346,11 @@ var SubscriptionCredentialActionsService = class SubscriptionCredentialActionsSe
1339
1346
  load(subscriptionId) {
1340
1347
  return forkJoin({
1341
1348
  stored: this.storedCredentials(subscriptionId),
1342
- types: this.subscriptionService.getAllCredentials().pipe(map$1((r) => r.credentials))
1349
+ types: this.subscriptionService.getAllCredentials().pipe(map$1((r) => r.result))
1343
1350
  });
1344
1351
  }
1345
1352
  storedCredentials(subscriptionId) {
1346
- return this.subscriptionService.getAllSubscriptionCredentials(subscriptionId).pipe(map$1((r) => r.subscription_credentials));
1353
+ return this.subscriptionService.getAllSubscriptionCredentials(subscriptionId).pipe(map$1((r) => r.result));
1347
1354
  }
1348
1355
  saveChanged(rows, subscriptionId) {
1349
1356
  const requests = changedCredentials(rows).map((row) => {
@@ -1436,7 +1443,7 @@ var SubscriptionCredentialComponent = class SubscriptionCredentialComponent exte
1436
1443
  selectedOption(event) {
1437
1444
  this.credentialsGroup.clear();
1438
1445
  const credentialName = this.isEdit ? event : event.value;
1439
- this.credentialsSelect = this.availableCredentials.filter((x) => x.name === credentialName);
1446
+ this.credentialsSelect = sortByLabel(this.availableCredentials.filter((x) => x.name === credentialName), (credential) => credential.field);
1440
1447
  this.credentialsSelect.forEach((credentialType) => {
1441
1448
  const stored = this.allSubscriptionCredentials.find((credential) => credential?.credential_id === credentialType?.id);
1442
1449
  this.credentialsGroup.push(this.fb.group(credentialFormRow(credentialType, stored)));
@@ -2161,17 +2168,20 @@ var SecondaryPaymentMethodComponent = class SecondaryPaymentMethodComponent {
2161
2168
  async mountForm(host) {
2162
2169
  if (this.provider === "braintree") {
2163
2170
  const response = await firstValueFrom(this.subscriptionService.getBraintreeClientToken(this.subscriptionId));
2164
- await this.braintree.mount(host, response?.data?.client_token);
2171
+ await this.braintree.mount(host, response?.result?.data?.client_token);
2165
2172
  return;
2166
2173
  }
2167
2174
  const response = await firstValueFrom(this.subscriptionService.getAirwallexIntent(this.subscriptionId));
2168
- await this.airwallex.mount(host, response?.data);
2175
+ await this.airwallex.mount(host, response?.result);
2169
2176
  }
2170
2177
  collectCard() {
2171
2178
  return this.provider === "braintree" ? this.braintree.requestNonce() : this.airwallex.confirm();
2172
2179
  }
2173
2180
  register(reference) {
2174
- return this.provider === "braintree" ? this.subscriptionService.registerBraintreePaymentMethod(this.subscriptionId, reference) : this.subscriptionService.registerAirwallexPaymentMethod(this.subscriptionId, reference);
2181
+ return this.provider === "braintree" ? this.subscriptionService.registerBraintreePaymentMethod(this.subscriptionId, reference).pipe(map(({ result }) => result)) : this.subscriptionService.registerAirwallexPaymentMethod(this.subscriptionId, reference).pipe(map(({ result, message }) => ({
2182
+ data: result,
2183
+ message
2184
+ })));
2175
2185
  }
2176
2186
  teardown() {
2177
2187
  this.braintree.teardown();
@@ -2352,12 +2362,12 @@ var UpdatePaymentDetailsComponent = class UpdatePaymentDetailsComponent extends
2352
2362
  paymentMethods: this.subscriptionService.getPaymentMethods(this.subscriptionId),
2353
2363
  product: this.productService.getProductById(this.productId)
2354
2364
  }).subscribe((response) => {
2355
- this.stripePublishKey = response.product.stripe_publishable_key;
2356
- if (response.paymentMethods.status === StatusCodes.OK) {
2357
- const data = response.paymentMethods.data || {};
2358
- this.cardDetails = data.primary || null;
2359
- this.secondaryCard = data.secondary || null;
2360
- this.secondaryProvider = data.secondary_provider || "braintree";
2365
+ this.stripePublishKey = response.product.result.stripe_publishable_key;
2366
+ if (response.paymentMethods.result.status === StatusCodes.OK) {
2367
+ const data = response.paymentMethods.result.data;
2368
+ this.cardDetails = data?.primary || null;
2369
+ this.secondaryCard = data?.secondary || null;
2370
+ this.secondaryProvider = data?.secondary_provider || "braintree";
2361
2371
  }
2362
2372
  this.cdr.markForCheck();
2363
2373
  }).add(() => {
@@ -2387,7 +2397,7 @@ var UpdatePaymentDetailsComponent = class UpdatePaymentDetailsComponent extends
2387
2397
  this.cdr.markForCheck();
2388
2398
  return;
2389
2399
  }
2390
- this.subscriptionService.updateCardDetails(this.form.value, this.subscriptionId).subscribe({ next: (response) => {
2400
+ this.subscriptionService.updateCardDetails(this.form.value, this.subscriptionId).subscribe({ next: ({ result: response }) => {
2391
2401
  if (response.error) this.toast.error(response.error.errors[0].message);
2392
2402
  else if (response.status === StatusCodes.CREATED) this.toast.success(response.message);
2393
2403
  this.form.markAsPristine();
@@ -2688,7 +2698,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
2688
2698
  });
2689
2699
  }
2690
2700
  getSubscriptionDetails() {
2691
- this.subscriptionService.getById(this.subscriptionId).subscribe((response) => {
2701
+ this.subscriptionService.getById(this.subscriptionId).subscribe(({ result: response }) => {
2692
2702
  this.subscription = response;
2693
2703
  const product = this.subscription.products.find((x) => x.id === this.productId);
2694
2704
  this.form.patchValue({ units: product?.purchased_units });
@@ -2699,7 +2709,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
2699
2709
  });
2700
2710
  }
2701
2711
  getProductDetails() {
2702
- this.productService.getProductById(this.productId).subscribe((response) => {
2712
+ this.productService.getProductById(this.productId).subscribe(({ result: response }) => {
2703
2713
  this.product = response;
2704
2714
  this.stripePublishKey = response?.stripe_publishable_key;
2705
2715
  if (response?.stripe_publishable_key) Stripe.setPublishableKey(response.stripe_publishable_key);
@@ -2794,7 +2804,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
2794
2804
  subscription_id: this.subscriptionId
2795
2805
  };
2796
2806
  this.subscriptionService.postSubscription(data).subscribe({
2797
- next: (response) => {
2807
+ next: ({ result: response }) => {
2798
2808
  this.store.dispatch(new GetUser());
2799
2809
  if (response.id) {
2800
2810
  this.form.markAsPristine();
@@ -2826,7 +2836,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
2826
2836
  }
2827
2837
  getCardDetails(subscriptionId) {
2828
2838
  this.subscriptionService.getCardDetails(subscriptionId).subscribe((data) => {
2829
- this.cardDetails = data.data || null;
2839
+ this.cardDetails = data.result.data || null;
2830
2840
  this.form.patchValue({
2831
2841
  units: this.units,
2832
2842
  card_number: this.cardDetails?.card_number,
@@ -2852,7 +2862,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
2852
2862
  Stripe.card.createToken(cardDetails, (status, res) => {
2853
2863
  if (status !== 200) this.toast.error(res.error.message);
2854
2864
  else this.subscriptionService.updateCardDetails(this.form.value, this.subscriptionId).subscribe({
2855
- next: (response) => {
2865
+ next: ({ result: response }) => {
2856
2866
  if (response.error) {
2857
2867
  const err = response.error.errors[0].message;
2858
2868
  this.toast.error(err);
@@ -3209,7 +3219,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
3209
3219
  });
3210
3220
  }
3211
3221
  fetchData() {
3212
- this.subscriptionService.getById(this.subscriptionId).subscribe((response) => {
3222
+ this.subscriptionService.getById(this.subscriptionId).subscribe(({ result: response }) => {
3213
3223
  this.subscription = response;
3214
3224
  this.fullLogo = this.subscription?.full_logo.url;
3215
3225
  this.squaredLogo = this.subscription?.squared_logo?.url;
@@ -3272,7 +3282,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
3272
3282
  const file = new File([blob], filename);
3273
3283
  this.subscriptionService.addFullLogo(this.subscriptionId, file).subscribe((res) => {
3274
3284
  this.modalService.dismissAll();
3275
- this.fullLogo = res?.full_logo?.url;
3285
+ this.fullLogo = res?.result?.full_logo?.url;
3276
3286
  this.fullLogoBroken = false;
3277
3287
  this.cdr.markForCheck();
3278
3288
  });
@@ -3283,7 +3293,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
3283
3293
  const file = new File([blob], filename);
3284
3294
  this.subscriptionService.addSquaredLogo(this.subscriptionId, file).subscribe((res) => {
3285
3295
  this.modalService.dismissAll();
3286
- this.squaredLogo = res?.squared_logo?.url;
3296
+ this.squaredLogo = res?.result?.squared_logo?.url;
3287
3297
  this.squaredLogoBroken = false;
3288
3298
  this.cdr.markForCheck();
3289
3299
  });
@@ -3316,7 +3326,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
3316
3326
  });
3317
3327
  }
3318
3328
  onPasswordValidation(_event) {
3319
- this.subscriptionService.updateSubscriptionUnit(this.subscription.id, this.units).subscribe((response) => {
3329
+ this.subscriptionService.updateSubscriptionUnit(this.subscription.id, this.units).subscribe(({ result: response }) => {
3320
3330
  if (response.status === StatusCodes.OK) this.toast.success(this.translation.translate("User.Subscriptions.Details.UnitsUpdatedMessage"));
3321
3331
  else this.toast.error(this.translation.translate("GenericMessage.WentWrong"));
3322
3332
  this.cdr.markForCheck();
@@ -3355,7 +3365,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
3355
3365
  }
3356
3366
  performTokenRefresh() {
3357
3367
  this.refreshingTokens = true;
3358
- this.subscriptionService.refreshApiTokens(this.subscriptionId).subscribe({ next: (response) => {
3368
+ this.subscriptionService.refreshApiTokens(this.subscriptionId).subscribe({ next: ({ result: response }) => {
3359
3369
  if (response && response.api_access_token) this.subscription.api_access_token = response.api_access_token;
3360
3370
  if (response && response.api_client_id) this.subscription.api_client_id = response.api_client_id;
3361
3371
  this.showApiToken = false;
@@ -3807,6 +3817,7 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
3807
3817
  this.clipboard = inject(Clipboard);
3808
3818
  this.cdr = inject(ChangeDetectorRef);
3809
3819
  this.confirmDialog = inject(ConfirmDialogService);
3820
+ this.inMobileApp = isInMobileWebView();
3810
3821
  this.showApiKey = true;
3811
3822
  this.subscribedSubscriptions = [];
3812
3823
  this.isLoaded = false;
@@ -3860,8 +3871,8 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
3860
3871
  this.userStore().subscribe((user) => {
3861
3872
  this.user = user;
3862
3873
  if (user) this.userService.getUserSubscriptions(user.id).subscribe((response) => {
3863
- this.subscribedSubscriptions = sortBy(response.subscriptions, "deleted");
3864
- response?.expired_subscriptions.forEach((subscription) => {
3874
+ this.subscribedSubscriptions = sortBy(response.result.subscriptions, "deleted");
3875
+ response?.result?.expired_subscriptions.forEach((subscription) => {
3865
3876
  this.subscribedSubscriptions.push(subscription);
3866
3877
  });
3867
3878
  this.subscribedSubscriptions.forEach((subscription) => {
@@ -3877,7 +3888,7 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
3877
3888
  }
3878
3889
  updateApiKey(subscription, product) {
3879
3890
  this.subscriptionService.updateSubscriptionAPIKey(subscription.id, product.id).subscribe((response) => {
3880
- product.api_access_token = response;
3891
+ product.api_access_token = response.result;
3881
3892
  this.toast.success(this.translation.translate("User.Subscriptions.UpdatedKey"));
3882
3893
  this.getSubscribedProduct();
3883
3894
  this.cdr.markForCheck();
@@ -4004,7 +4015,7 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
4004
4015
  ],
4005
4016
  usesInheritance: true,
4006
4017
  ngImport: i0,
4007
- template: "@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 <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 </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 (!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 <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 @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 (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",
4018
+ template: "@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 <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 </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",
4008
4019
  styles: [".btn-list{bottom:24px;left:0;padding:0 38px;right:0}.shadow-md{padding-bottom:70px!important}.bg-dark{border:0}.subscription-details{background:#fff;border:1px solid #e2e5ea;border-radius:12px;padding:16px 16px 6px;font-size:14px;font-variant-numeric:tabular-nums}.subscription-summary{border-bottom:1px solid #eef0f3;padding-bottom:12px}.seats-usage{display:inline-block;width:120px;height:6px;margin-left:8px;border-radius:999px;vertical-align:middle;overflow:hidden;background:linear-gradient(#5a6473,#5a6473) left/calc(var(--seats-pct, 0) * 100%) 100% no-repeat,#e2e5ea}.subscription-products-cards{padding-bottom:0!important}.subscription-products-cards .card-footer{position:static!important}.subscription-products-cards.card{background:#f7f8fa;border:1px solid #eef0f3;border-radius:8px;box-shadow:none!important;font-size:14px}.card-footer{background:transparent;border-top:1px solid #eef0f3}.card-footer .footer-note{color:#5a6473;font-size:.875rem}.card-footer .footer-tos-link{color:#5a6473;font-weight:500;text-decoration:underline}.card-footer .footer-tos-link:hover{color:var(--first)}.badge{font-weight:600;border-radius:4px}.badge.bg-success{background-color:#e6f4ec!important;color:#0f6b3a!important}.badge.bg-danger{background-color:#fbeae8!important;color:#c0392b!important}.badge.bg-warning{background-color:#fbf1e3!important;color:#8a5a00!important}.badge.bg-grey,.badge.bg-role-admin{background-color:#eef0f3!important;color:#5a6473!important}code{color:var(--text);min-width:0}.danger-zone{border-top:1px solid #e2e5ea;padding-top:16px;text-align:right}\n"],
4009
4020
  dependencies: [
4010
4021
  {
@@ -4173,7 +4184,7 @@ i0.ɵɵngDeclareClassMetadata({
4173
4184
  TranslocoPipe,
4174
4185
  DateFormatPipe
4175
4186
  ],
4176
- template: "@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 <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 </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 (!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 <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 @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 (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",
4187
+ template: "@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 <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 </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",
4177
4188
  styles: [".btn-list{bottom:24px;left:0;padding:0 38px;right:0}.shadow-md{padding-bottom:70px!important}.bg-dark{border:0}.subscription-details{background:#fff;border:1px solid #e2e5ea;border-radius:12px;padding:16px 16px 6px;font-size:14px;font-variant-numeric:tabular-nums}.subscription-summary{border-bottom:1px solid #eef0f3;padding-bottom:12px}.seats-usage{display:inline-block;width:120px;height:6px;margin-left:8px;border-radius:999px;vertical-align:middle;overflow:hidden;background:linear-gradient(#5a6473,#5a6473) left/calc(var(--seats-pct, 0) * 100%) 100% no-repeat,#e2e5ea}.subscription-products-cards{padding-bottom:0!important}.subscription-products-cards .card-footer{position:static!important}.subscription-products-cards.card{background:#f7f8fa;border:1px solid #eef0f3;border-radius:8px;box-shadow:none!important;font-size:14px}.card-footer{background:transparent;border-top:1px solid #eef0f3}.card-footer .footer-note{color:#5a6473;font-size:.875rem}.card-footer .footer-tos-link{color:#5a6473;font-weight:500;text-decoration:underline}.card-footer .footer-tos-link:hover{color:var(--first)}.badge{font-weight:600;border-radius:4px}.badge.bg-success{background-color:#e6f4ec!important;color:#0f6b3a!important}.badge.bg-danger{background-color:#fbeae8!important;color:#c0392b!important}.badge.bg-warning{background-color:#fbf1e3!important;color:#8a5a00!important}.badge.bg-grey,.badge.bg-role-admin{background-color:#eef0f3!important;color:#5a6473!important}code{color:var(--text);min-width:0}.danger-zone{border-top:1px solid #e2e5ea;padding-top:16px;text-align:right}\n"]
4178
4189
  }]
4179
4190
  }],
@@ -4234,9 +4245,9 @@ var UserInvoiceComponent = class UserInvoiceComponent extends AppBaseComponent {
4234
4245
  if (user) {
4235
4246
  this.userId = user.id;
4236
4247
  this.userService.getUserInvoices(paging, user.id).subscribe((response) => {
4237
- this.invoices = response.invoices;
4238
- this.totalRecords = response.object_count;
4239
- this.totalRecordsUnFiltered = response.unfiltered_count;
4248
+ this.invoices = response.result;
4249
+ this.totalRecords = response.page_info.total_count;
4250
+ this.totalRecordsUnFiltered = response.page_info.total_count_unfiltered;
4240
4251
  this.pollForInvoices();
4241
4252
  this.cdr.markForCheck();
4242
4253
  }).add(() => {
@@ -4249,7 +4260,7 @@ var UserInvoiceComponent = class UserInvoiceComponent extends AppBaseComponent {
4249
4260
  }
4250
4261
  pollForInvoices() {
4251
4262
  this.subscription = this.intervalTimer.pipe(mergeMap(() => this.userService.getUserInvoices({}, this.userId))).subscribe((data) => {
4252
- this.invoices = data.invoices;
4263
+ this.invoices = data.result;
4253
4264
  this.cdr.markForCheck();
4254
4265
  });
4255
4266
  }
@@ -4276,7 +4287,7 @@ var UserInvoiceComponent = class UserInvoiceComponent extends AppBaseComponent {
4276
4287
  selector: "pw-user-invoice",
4277
4288
  usesInheritance: true,
4278
4289
  ngImport: i0,
4279
- template: "<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]=\"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",
4290
+ template: "<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",
4280
4291
  styles: [".page-heading{background:#fcfcfc;border-bottom:1px solid rgba(0,0,0,.1);position:relative;width:100%}.page-heading:after{clear:both;content:\"\";display:table}.page-heading .page-heading__container{padding:15px 20px;position:relative}.page-heading .page-heading__container .title{color:#242437;font-size:15px;font-weight:500;line-height:20px;margin:3px 0 0;overflow:hidden;padding:0;text-overflow:ellipsis;width:95%}.card .card-container{position:absolute;right:20px;top:25px;z-index:1}.td-total{font-weight:700}.card-inner-container{background:#0000000d;border:1px dashed rgba(0,0,0,.1);border-radius:3px;margin-bottom:20px;padding:20px}.invoice-text{display:flex;font-size:13px;justify-content:space-between;margin:10px 0}.invoice-template{min-height:calc(100vh - 190px)}.btn.btn-primary.invoice-download-unavailable{cursor:not-allowed;opacity:var(--bs-btn-disabled-opacity)}.btn.btn-primary.invoice-download-unavailable:hover,.btn.btn-primary.invoice-download-unavailable:active{background-color:var(--first)!important;border-color:var(--first)!important;color:rgba(var(--bs-light-rgb),1)!important}\n"],
4281
4292
  dependencies: [
4282
4293
  {
@@ -4564,7 +4575,7 @@ i0.ɵɵngDeclareClassMetadata({
4564
4575
  DatePipe,
4565
4576
  TranslocoPipe
4566
4577
  ],
4567
- template: "<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]=\"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",
4578
+ template: "<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",
4568
4579
  styles: [".page-heading{background:#fcfcfc;border-bottom:1px solid rgba(0,0,0,.1);position:relative;width:100%}.page-heading:after{clear:both;content:\"\";display:table}.page-heading .page-heading__container{padding:15px 20px;position:relative}.page-heading .page-heading__container .title{color:#242437;font-size:15px;font-weight:500;line-height:20px;margin:3px 0 0;overflow:hidden;padding:0;text-overflow:ellipsis;width:95%}.card .card-container{position:absolute;right:20px;top:25px;z-index:1}.td-total{font-weight:700}.card-inner-container{background:#0000000d;border:1px dashed rgba(0,0,0,.1);border-radius:3px;margin-bottom:20px;padding:20px}.invoice-text{display:flex;font-size:13px;justify-content:space-between;margin:10px 0}.invoice-template{min-height:calc(100vh - 190px)}.btn.btn-primary.invoice-download-unavailable{cursor:not-allowed;opacity:var(--bs-btn-disabled-opacity)}.btn.btn-primary.invoice-download-unavailable:hover,.btn.btn-primary.invoice-download-unavailable:active{background-color:var(--first)!important;border-color:var(--first)!important;color:rgba(var(--bs-light-rgb),1)!important}\n"]
4569
4580
  }]
4570
4581
  }]
@@ -4685,8 +4696,8 @@ var CommunicationTabComponent = class CommunicationTabComponent extends AppBaseC
4685
4696
  this.user = user.currentUser;
4686
4697
  this.profileService.getUserObject("user_newsletters", this.user.slug).subscribe((newsletter) => {
4687
4698
  this.isLoaded = true;
4688
- this.userSubscription = newsletter;
4689
- this.subscriptions = response.newsletters;
4699
+ this.userSubscription = newsletter.result;
4700
+ this.subscriptions = response.result;
4690
4701
  if (this.userSubscription.length > 0 && this.subscriptions.length > 0) this.subscriptions.forEach((element) => {
4691
4702
  const item = this.userSubscription?.find((x) => x.newsletter_id === element.id);
4692
4703
  element.enabled = item ? item.send_newsletters : false;
@@ -4846,7 +4857,7 @@ var OthersTabComponent = class OthersTabComponent extends AppBaseComponent {
4846
4857
  }
4847
4858
  getGlobalSubscriptionConfig() {
4848
4859
  this.commonService.getAllGlobalSubscriptionConfigs().subscribe((response) => {
4849
- this.subscriptionConfigs = response.global_subscription_configs;
4860
+ this.subscriptionConfigs = response.result;
4850
4861
  this.globalConfigs.forEach((globalConfig) => {
4851
4862
  const config = this.subscriptionConfigs?.find((subscriptionConfig) => subscriptionConfig.global_config_id === globalConfig?.id);
4852
4863
  globalConfig.value = config?.value;
@@ -4860,7 +4871,7 @@ var OthersTabComponent = class OthersTabComponent extends AppBaseComponent {
4860
4871
  }
4861
4872
  getGlobalConfigs() {
4862
4873
  this.commonService.getAllGlobalConfigs().subscribe((response) => {
4863
- this.globalConfigs = response.global_configs;
4874
+ this.globalConfigs = response.result;
4864
4875
  this.getGlobalSubscriptionConfig();
4865
4876
  this.cdr.markForCheck();
4866
4877
  });
@@ -5011,7 +5022,7 @@ var SecurityTabComponent = class SecurityTabComponent extends AppBaseComponent {
5011
5022
  const password = this.passwordRef.nativeElement.value;
5012
5023
  if (password) this.userService.checkPassword({ password }).subscribe({
5013
5024
  next: (data) => {
5014
- if (data?.status === StatusCodes.OK) {
5025
+ if (data?.result?.status === StatusCodes.OK) {
5015
5026
  if (this.user?.enable_two_factor_authenticator === false) {
5016
5027
  this.passwordVerified = true;
5017
5028
  this.create2FA();
@@ -5034,7 +5045,7 @@ var SecurityTabComponent = class SecurityTabComponent extends AppBaseComponent {
5034
5045
  }
5035
5046
  create2FA() {
5036
5047
  this.userService.createTwoFactorAuthenticator().subscribe((res) => {
5037
- this.created2faDetails = res;
5048
+ this.created2faDetails = res.result;
5038
5049
  this.cdr.markForCheck();
5039
5050
  });
5040
5051
  }
@@ -5071,7 +5082,7 @@ var SecurityTabComponent = class SecurityTabComponent extends AppBaseComponent {
5071
5082
  const password = this.ssoPasswordRef.nativeElement.value;
5072
5083
  if (password) this.userService.checkPassword({ password }).subscribe({
5073
5084
  next: (data) => {
5074
- if (data?.status === StatusCodes.OK) this.ssoPasswordVerified = true;
5085
+ if (data?.result?.status === StatusCodes.OK) this.ssoPasswordVerified = true;
5075
5086
  this.cdr.markForCheck();
5076
5087
  },
5077
5088
  error: (err) => {
@@ -5329,7 +5340,7 @@ var SupportComponent = class SupportComponent extends AppBaseComponent {
5329
5340
  getAllSupport() {
5330
5341
  this.isLoading = true;
5331
5342
  this.commonService.getAllCustomerSupport(this.subscriptionId).subscribe((response) => {
5332
- this.supports = response;
5343
+ this.supports = response.result;
5333
5344
  this.cdr.markForCheck();
5334
5345
  }).add(() => {
5335
5346
  this.isLoading = false;
@@ -5816,7 +5827,7 @@ var EditPortfoliosComponent = class EditPortfoliosComponent {
5816
5827
  }
5817
5828
  getProjectPictures() {
5818
5829
  this.profileService.getProjectPictures(this.slug).subscribe((response) => {
5819
- if (response.length > 0) this.projectPictures = response.flatMap((x) => x.project_pictures);
5830
+ if (response.result.length > 0) this.projectPictures = response.result.flatMap((x) => x.project_pictures);
5820
5831
  this.cdr.markForCheck();
5821
5832
  });
5822
5833
  }
@@ -6984,7 +6995,7 @@ var EditSkillsModalComponent = class EditSkillsModalComponent extends AppBaseCom
6984
6995
  }
6985
6996
  getSkills() {
6986
6997
  this.tagService.getTagsByType("skills", {}).subscribe((response) => {
6987
- this.allSkills = response.tags;
6998
+ this.allSkills = response.result;
6988
6999
  this.getEntitySkills();
6989
7000
  this.cdr.markForCheck();
6990
7001
  });
@@ -7004,7 +7015,7 @@ var EditSkillsModalComponent = class EditSkillsModalComponent extends AppBaseCom
7004
7015
  getEntitySkills() {
7005
7016
  this.tagService.getTagsByEntity(this.slug, this.entityEntity, this.entityType).subscribe((response) => {
7006
7017
  this.selectedSkills = this.allSkills.filter((item) => {
7007
- return response.tags.find((x) => x.id === item.id);
7018
+ return response.result.find((x) => x.id === item.id);
7008
7019
  });
7009
7020
  this.cdr.markForCheck();
7010
7021
  });
@@ -7543,10 +7554,10 @@ var EditUserProfileModalComponent = class EditUserProfileModalComponent extends
7543
7554
  const data = { ...this.form.value };
7544
7555
  data.dob = HelperService.dateFormat(this.form.get("dob").value);
7545
7556
  this.profileService.updateUserProfile(data).subscribe((response) => {
7546
- if (response.id) {
7557
+ if (response.result?.id) {
7547
7558
  this.toast.success(this.translation.translate("User.Profile.ProfileUpdated"));
7548
7559
  this.modalService.dismissAll();
7549
- this.saveEvent.emit(response);
7560
+ this.saveEvent.emit(response.result);
7550
7561
  }
7551
7562
  this.cdr.markForCheck();
7552
7563
  }).add(() => {
@@ -7901,12 +7912,12 @@ var UserAboutComponent = class UserAboutComponent extends AppBaseComponent {
7901
7912
  user_skills: this.tagService.getGroupedSkills(this.user.slug, TAG_ENTITY.USER, TAG_TYPE.SKILLS)
7902
7913
  }).subscribe({
7903
7914
  next: (response) => {
7904
- this.user_profile = response.user_profile;
7905
- this.user["profile"] = response.user_profile;
7906
- this.qualifications = response.qualifications;
7907
- this.userLinks = response.user_links || [];
7915
+ this.user_profile = response.user_profile.result;
7916
+ this.user["profile"] = this.user_profile;
7917
+ this.qualifications = response.qualifications.result;
7918
+ this.userLinks = response.user_links.result || [];
7908
7919
  this.noUserLinks = Object.values(this.userLinks).some((x) => !!x);
7909
- this.selectedSkills = response.user_skills;
7920
+ this.selectedSkills = response.user_skills.result;
7910
7921
  this.loading = false;
7911
7922
  this.cdr.markForCheck();
7912
7923
  },
@@ -7923,7 +7934,7 @@ var UserAboutComponent = class UserAboutComponent extends AppBaseComponent {
7923
7934
  }
7924
7935
  getSkills() {
7925
7936
  this.tagService.getTagsByType("skills", {}).subscribe((response) => {
7926
- this.allSkills = response.skills;
7937
+ this.allSkills = response.result;
7927
7938
  this.cdr.markForCheck();
7928
7939
  });
7929
7940
  }
@@ -8144,7 +8155,7 @@ var PortfoliosComponent = class PortfoliosComponent {
8144
8155
  }
8145
8156
  getProjectPictures() {
8146
8157
  this.service.getProjectPictures(this.user.slug).subscribe((response) => {
8147
- if (response.length > 0) this.projectPictures = response.flatMap((x) => x.project_pictures);
8158
+ if (response.result.length > 0) this.projectPictures = response.result.flatMap((x) => x.project_pictures);
8148
8159
  this.isLoaded = true;
8149
8160
  this.cdr.markForCheck();
8150
8161
  });
@@ -8284,7 +8295,7 @@ var UserProjectsComponent = class UserProjectsComponent extends AppBaseComponent
8284
8295
  getProjects() {
8285
8296
  const profileSlug = this.user?.slug || this.slug;
8286
8297
  this.service.getProjects(profileSlug).subscribe((response) => {
8287
- this.projects = response.projects;
8298
+ this.projects = response.result.projects;
8288
8299
  this.isLoaded = true;
8289
8300
  this.cdr.markForCheck();
8290
8301
  });
@@ -8648,7 +8659,7 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
8648
8659
  const file = new File([blob], filename);
8649
8660
  this.userService.addAvatar(file).subscribe((res) => {
8650
8661
  this.modalService.dismissAll();
8651
- this.image = res?.user_avatar[2]?.url;
8662
+ this.image = res?.result?.user_avatar[2]?.url;
8652
8663
  this.cdr.markForCheck();
8653
8664
  });
8654
8665
  }
@@ -8659,9 +8670,9 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
8659
8670
  avatar: this.profileService.getUserObject("avatar", this.slug)
8660
8671
  }).subscribe({
8661
8672
  next: (response) => {
8662
- this.user = response.user;
8663
- this.userProfile = response.user_profile;
8664
- if (response.avatar && response.avatar.length > 0) this.image = response?.avatar[2]?.url;
8673
+ this.user = response.user.result;
8674
+ this.userProfile = response.user_profile.result;
8675
+ if (response.avatar.result?.length > 0) this.image = response.avatar.result[2]?.url;
8665
8676
  this.getCurrentUserDetails();
8666
8677
  this.isLoaded = true;
8667
8678
  this.cdr.markForCheck();
@@ -8679,7 +8690,7 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
8679
8690
  this.userStore().subscribe((currentUser) => {
8680
8691
  if (currentUser) {
8681
8692
  this.loggedInUserDetails = currentUser;
8682
- this.userService.getCurrentUserObject("user_relationships").subscribe((response) => {
8693
+ this.userService.getCurrentUserObject("user_relationships").subscribe(({ result: response }) => {
8683
8694
  this.isFollowing = response.length > 0 ? response.some((x) => x.followed_id === this.user.id && currentUser.id === x.follower_id) : false;
8684
8695
  this.cdr.markForCheck();
8685
8696
  });
@@ -8691,9 +8702,9 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
8691
8702
  this.router.navigate(["/message"], { fragment: this.slug });
8692
8703
  }
8693
8704
  followUser() {
8694
- this.userService.followUser(this.user.id).subscribe((response) => {
8705
+ this.userService.followUser(this.user.id).subscribe(({ result }) => {
8695
8706
  const name = this.user.first_name || this.user.slug;
8696
- if (response.id) {
8707
+ if (result?.id) {
8697
8708
  this.isFollowing = true;
8698
8709
  this.toast.success(`You're now following ${name}`);
8699
8710
  } else {