@layerfi/components 0.1.132-alpha.2 → 0.1.132-alpha.4

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.
@@ -250,7 +250,7 @@ var getIntlLocale = (locale) => {
250
250
  };
251
251
  var package_default = {
252
252
  name: "@layerfi/components",
253
- version: "0.1.132-alpha.2",
253
+ version: "0.1.132-alpha.4",
254
254
  description: "Layer React Components",
255
255
  main: "dist/cjs/index.cjs",
256
256
  module: "dist/esm/index.mjs",
@@ -1571,43 +1571,24 @@ var invoices_default$1 = {
1571
1571
  var landingPage_default$1 = {
1572
1572
  action: {
1573
1573
  "book_call": "Book a call",
1574
- "get_started": "Get Started",
1575
1574
  "learn_more": "Learn more"
1576
1575
  },
1577
1576
  label: {
1578
1577
  "all_finances_in_one_place": "All your finances in one place",
1579
1578
  "best_accounting_software_for_industry": "The best accounting software for {{industry}} businesses. Fast to set up and easy to use.",
1580
- "books_organized_and_tax_ready": "Your books will be organized and tax-ready with accurate categorization and financial statements prepared by professionals.",
1581
1579
  "built_for_industry": "Built for {{industry}}",
1582
- "business_bank_accounts_icon": "Business bank accounts and credit cards connection icon",
1583
- "business_overview_dashboard_charts": "Business overview dashboard with charts and financial metrics",
1584
- "calendar_scheduling_icon_bookkeeper": "Calendar scheduling icon for bookkeeper consultation",
1585
- "categorize_expenses": "Categorize expenses",
1586
1580
  "complete_bookkeeping_service": "A complete bookkeeping service",
1587
1581
  "complete_financial_reports": "Complete financial reports and end of year tax packet",
1588
- "connect_business_accounts": "Connect your business accounts",
1589
- "connect_business_bank_accounts": "Connect your business bank accounts and credit cards right within {{platformName}}.",
1590
1582
  "direct_integration_with_platform_name": "Direct integration with {{platformName}}",
1591
1583
  "directly_integrated_with_platform_name": "Directly integrated with your {{platformName}} data, so you can see your business performance and profit in real-time.",
1592
1584
  "easy_to_understand_profitability_charts": "Easy to understand profitability charts and reports",
1593
1585
  "easy_to_use_software": "Easy to use software",
1594
- "expense_categorization_organization_icon": "Expense categorization and organization icon",
1595
1586
  "full_service_bookkeeping": "Full-service Bookkeeping",
1596
- "get_clear_picture_of_business": "Get a clear picture of your business",
1597
1587
  "get_dedicated_bookkeeper": "Get a dedicated bookkeeper who will organize and manage your books for you.",
1598
- "get_notified_on_bookkeeping_clarifications": "Get notified on bookkeeping clarifications",
1599
- "get_personalized_guidance": "Get personalized guidance from your dedicated bookkeeper to review your finances and answer questions.",
1600
- "get_ready_for_tax_season": "Get ready for tax season",
1601
1588
  "monthly_books_done_for_you": "Monthly books done for you",
1602
- "notification_bell_icon_bookkeeping": "Notification bell icon for bookkeeping task updates and clarifications",
1603
- "organize_transaction_into_categories": "Organize transactions into categories built for {{industry}}.",
1604
1589
  "personalized_setup_bookkeeper": "Personalized setup with your bookkeeper",
1605
1590
  "platform_name_accounting": "{{platformName}} Accounting",
1606
1591
  "platform_name_accounting_dashboard": "{{platformName}} Accounting dashboard interface showing financial data and business insights",
1607
- "profit_loss_statement_chart": "Profit and loss statement chart for tax preparation and business analysis",
1608
- "receive_clear_notifications": "Receive clear notifications when your bookkeeper needs additional information or clarification on transactions.",
1609
- "schedule_call_with_bookkeeper": "Schedule a call with your Bookkeeper",
1610
- "see_business_profitability": "See your business profitability and stay organized for tax time.",
1611
1592
  "self_service_accounting_business_health": "Self-service accounting to understand your business health",
1612
1593
  "starting_at": "Starting at",
1613
1594
  "track_business_finances_within_platform": "Track your business finances, right within {{platformName}}.",
@@ -1843,6 +1824,7 @@ var taxEstimates_default$1 = {
1843
1824
  "categorization_incomplete": "Categorization incomplete",
1844
1825
  "deductions": "Deductions",
1845
1826
  "due": "Due",
1827
+ "due_at": "Due on {{date}}",
1846
1828
  "due_with_date": "Due: {{date}}",
1847
1829
  "enter_amount": "Enter amount",
1848
1830
  "enter_area": "Enter area",
@@ -1888,7 +1870,6 @@ var taxEstimates_default$1 = {
1888
1870
  "taxable_income_estimate_to_date_for_year_projected": "Taxable income projection for year {{year}}",
1889
1871
  "taxable_income_for_year": "Taxable income for {{year}}",
1890
1872
  "taxable_income_for_year_projected": "Projected taxable income for {{year}}",
1891
- "taxes_due_at": "Taxes due on {{date}}",
1892
1873
  "taxes_owed": "Taxes Owed",
1893
1874
  "taxes_owed_projected": "Projected Taxes Owed",
1894
1875
  "taxes_paid": "Taxes Paid",
@@ -2199,6 +2180,7 @@ var vehicles_default$1 = {
2199
2180
  "enter_vin": "Enter VIN",
2200
2181
  "license_plate": "License plate",
2201
2182
  "make_model": "Make and model",
2183
+ "unnamed_vehicle": "Unnamed Vehicle",
2202
2184
  "vehicle": "Vehicle",
2203
2185
  "vehicle_name_hidden_from_active_list": "{{vehicleName}} will be hidden from your active vehicles list. You can reactivate it at any time.",
2204
2186
  "vehicle_name_restored_to_active_list": "{{vehicleName}} will be restored to your active vehicles list and available for tracking trips.",
@@ -2374,6 +2356,7 @@ var bookkeeping_default = {
2374
2356
  "bookkeeping_tasks": "Tâches de tenue de livres",
2375
2357
  "complete_bookkeeping_onboarding_call": "Une fois votre appel d’intégration à la tenue de livres terminé, vos tâches de tenue de livres s’afficheront ici.",
2376
2358
  "completed_over_total_done_one": "<completed>{{displayCompletedTaskCount}}</completed>/{{displayTotalTaskCount}} terminée",
2359
+ "completed_over_total_done_many": "",
2377
2360
  "completed_over_total_done_other": "<completed>{{displayCompletedTaskCount}}</completed>/{{displayTotalTaskCount}} terminées",
2378
2361
  "count_open_tasks_one": "{{displayCount}} tâche ouverte en {{displayYear}}",
2379
2362
  "count_open_tasks_other": "{{displayCount}} tâches ouvertes en {{displayYear}}",
@@ -3016,43 +2999,24 @@ var invoices_default = {
3016
2999
  var landingPage_default = {
3017
3000
  action: {
3018
3001
  "book_call": "Réserver un appel",
3019
- "get_started": "Commencer",
3020
3002
  "learn_more": "En savoir plus"
3021
3003
  },
3022
3004
  label: {
3023
3005
  "all_finances_in_one_place": "Toutes vos finances en un seul endroit",
3024
3006
  "best_accounting_software_for_industry": "Le meilleur logiciel de comptabilité pour les entreprises du secteur {{industry}}. Rapide à configurer et facile à utiliser.",
3025
- "books_organized_and_tax_ready": "Vos livres seront organisés et prêts pour les impôts grâce à une catégorisation précise et à des états financiers préparés par des professionnels.",
3026
3007
  "built_for_industry": "Conçu pour le secteur {{industry}}",
3027
- "business_bank_accounts_icon": "Icône de connexion des comptes bancaires professionnels et des cartes de crédit",
3028
- "business_overview_dashboard_charts": "Tableau de bord de l’entreprise avec graphiques et indicateurs financiers",
3029
- "calendar_scheduling_icon_bookkeeper": "Icône de calendrier pour planifier une consultation avec un teneur de livres",
3030
- "categorize_expenses": "Catégoriser les dépenses",
3031
3008
  "complete_bookkeeping_service": "Un service complet de tenue de livres",
3032
3009
  "complete_financial_reports": "Rapports financiers complets et dossier fiscal de fin d’année",
3033
- "connect_business_accounts": "Connectez vos comptes d’entreprise",
3034
- "connect_business_bank_accounts": "Connectez vos comptes bancaires professionnels et vos cartes de crédit directement dans {{platformName}}.",
3035
3010
  "direct_integration_with_platform_name": "Intégration directe avec {{platformName}}",
3036
3011
  "directly_integrated_with_platform_name": "Intégré directement à vos données {{platformName}}, pour vous permettre de voir la performance et la rentabilité de votre entreprise en temps réel.",
3037
3012
  "easy_to_understand_profitability_charts": "Graphiques et rapports de rentabilité faciles à comprendre",
3038
3013
  "easy_to_use_software": "Logiciel facile à utiliser",
3039
- "expense_categorization_organization_icon": "Icône de catégorisation et d’organisation des dépenses",
3040
3014
  "full_service_bookkeeping": "Tenue de livres complète",
3041
- "get_clear_picture_of_business": "Obtenez un portrait clair de votre entreprise",
3042
3015
  "get_dedicated_bookkeeper": "Obtenez un teneur de livres attitré qui organisera et gérera vos livres pour vous.",
3043
- "get_notified_on_bookkeeping_clarifications": "Recevez des notifications concernant les demandes de clarification en tenue de livres",
3044
- "get_personalized_guidance": "Obtenez des conseils personnalisés de votre teneur de livres attitré pour passer en revue vos finances et répondre à vos questions.",
3045
- "get_ready_for_tax_season": "Préparez-vous pour la saison des impôts",
3046
3016
  "monthly_books_done_for_you": "Tenue de livres mensuelle faite pour vous",
3047
- "notification_bell_icon_bookkeeping": "Icône de cloche de notification pour les mises à jour des tâches de tenue de livres et les demandes de clarification",
3048
- "organize_transaction_into_categories": "Organisez les transactions dans des catégories conçues pour le secteur {{industry}}.",
3049
3017
  "personalized_setup_bookkeeper": "Configuration personnalisée avec votre teneur de livres",
3050
3018
  "platform_name_accounting": "{{platformName}} Accounting",
3051
3019
  "platform_name_accounting_dashboard": "Interface du tableau de bord {{platformName}} Accounting affichant des données financières et des renseignements sur l’entreprise",
3052
- "profit_loss_statement_chart": "Graphique de l’état des résultats pour la préparation fiscale et l’analyse de l’entreprise",
3053
- "receive_clear_notifications": "Recevez des notifications claires lorsque votre teneur de livres a besoin de renseignements supplémentaires ou d’éclaircissements sur des opérations.",
3054
- "schedule_call_with_bookkeeper": "Planifiez un appel avec votre teneur de livres",
3055
- "see_business_profitability": "Visualisez la rentabilité de votre entreprise et restez organisé en vue de la période des impôts.",
3056
3020
  "self_service_accounting_business_health": "Comptabilité en libre-service pour comprendre la santé de votre entreprise",
3057
3021
  "starting_at": "À partir de",
3058
3022
  "track_business_finances_within_platform": "Suivez les finances de votre entreprise, directement dans {{platformName}}.",
@@ -3288,6 +3252,7 @@ var taxEstimates_default = {
3288
3252
  "categorization_incomplete": "Catégorisation incomplète",
3289
3253
  "deductions": "Déductions",
3290
3254
  "due": "Échéance",
3255
+ "due_at": "",
3291
3256
  "due_with_date": "Échéance : {{date}}",
3292
3257
  "enter_amount": "Saisissez un montant",
3293
3258
  "enter_area": "Saisissez la superficie",
@@ -3333,7 +3298,6 @@ var taxEstimates_default = {
3333
3298
  "taxable_income_estimate_to_date_for_year_projected": "Projection du revenu imposable pour l’année {{year}}",
3334
3299
  "taxable_income_for_year": "Revenu imposable pour {{year}}",
3335
3300
  "taxable_income_for_year_projected": "Revenu imposable projeté pour {{year}}",
3336
- "taxes_due_at": "Taxes à payer le {{date}}",
3337
3301
  "taxes_owed": "Impôts dus",
3338
3302
  "taxes_owed_projected": "Impôts dus projetés",
3339
3303
  "taxes_paid": "Impôts payés",
@@ -3644,6 +3608,7 @@ var vehicles_default = {
3644
3608
  "enter_vin": "Saisissez le NIV",
3645
3609
  "license_plate": "Plaque d’immatriculation",
3646
3610
  "make_model": "Marque et modèle",
3611
+ "unnamed_vehicle": "",
3647
3612
  "vehicle": "Véhicule",
3648
3613
  "vehicle_name_hidden_from_active_list": "{{vehicleName}} sera masqué de votre liste de véhicules actifs. Vous pourrez le réactiver en tout temps.",
3649
3614
  "vehicle_name_restored_to_active_list": "{{vehicleName}} sera restauré dans votre liste de véhicules actifs et pourra être utilisé pour faire le suivi de vos déplacements.",
@@ -11453,7 +11418,7 @@ var EmptyState$7 = () => {
11453
11418
  children: t("common:empty.results", "No results found")
11454
11419
  });
11455
11420
  };
11456
- var ErrorState$6 = () => {
11421
+ var ErrorState$5 = () => {
11457
11422
  const { t } = useTranslation();
11458
11423
  return /* @__PURE__ */ jsx(Span, {
11459
11424
  size: "sm",
@@ -11496,7 +11461,7 @@ var MobileSelectionDrawerList = (_ref) => {
11496
11461
  data,
11497
11462
  slots: {
11498
11463
  EmptyState: EmptyState$7,
11499
- ErrorState: ErrorState$6
11464
+ ErrorState: ErrorState$5
11500
11465
  },
11501
11466
  renderItem,
11502
11467
  onClickItem,
@@ -14694,7 +14659,7 @@ var VirtualizedDataTable = ({ columnConfig, data, isLoading, isError, componentN
14694
14659
  var ROW_HEIGHT = 52;
14695
14660
  var TABLE_HEIGHT = ROW_HEIGHT * 9 - 1;
14696
14661
  var EmptyState$6 = () => null;
14697
- var ErrorState$5 = () => null;
14662
+ var ErrorState$4 = () => null;
14698
14663
  function ValidateCsvTable({ data, headers, formatters, className }) {
14699
14664
  const { t } = useTranslation();
14700
14665
  const sortedData = useMemo(() => [...data].sort((a, b) => {
@@ -14750,7 +14715,7 @@ function ValidateCsvTable({ data, headers, formatters, className }) {
14750
14715
  shrinkHeightToFitRows: true,
14751
14716
  slots: {
14752
14717
  EmptyState: EmptyState$6,
14753
- ErrorState: ErrorState$5
14718
+ ErrorState: ErrorState$4
14754
14719
  }
14755
14720
  })
14756
14721
  });
@@ -21108,7 +21073,7 @@ var TransactionColumns = /* @__PURE__ */ function(TransactionColumns) {
21108
21073
  TransactionColumns["Amount"] = "Amount";
21109
21074
  return TransactionColumns;
21110
21075
  }(TransactionColumns || {});
21111
- var ErrorState$4 = () => {
21076
+ var ErrorState$3 = () => {
21112
21077
  const { t } = useTranslation();
21113
21078
  return /* @__PURE__ */ jsx(DataState, {
21114
21079
  spacing: true,
@@ -21172,7 +21137,7 @@ var AffectedTransactionsTable = ({ transactions, isLoading = false, isError = fa
21172
21137
  shrinkHeightToFitRows: true,
21173
21138
  slots: {
21174
21139
  EmptyState: EmptyState$5,
21175
- ErrorState: ErrorState$4
21140
+ ErrorState: ErrorState$3
21176
21141
  }
21177
21142
  })
21178
21143
  });
@@ -24584,6 +24549,9 @@ var DetailedChart = ({ data, isLoading, interactionProps, stylingProps, slots })
24584
24549
  x: x + width / 2,
24585
24550
  textAnchor: "middle",
24586
24551
  verticalAnchor: "middle",
24552
+ breakAll: true,
24553
+ maxLines: 2,
24554
+ width: Math.max(width - 40, 0),
24587
24555
  className: "Layer__DetailedChart__centerLabelTitle",
24588
24556
  children: text
24589
24557
  }),
@@ -25695,7 +25663,7 @@ var PnlDetailColumns = /* @__PURE__ */ function(PnlDetailColumns) {
25695
25663
  PnlDetailColumns["Balance"] = "Balance";
25696
25664
  return PnlDetailColumns;
25697
25665
  }(PnlDetailColumns || {});
25698
- var ErrorState$3 = () => {
25666
+ var ErrorState$2 = () => {
25699
25667
  const { t } = useTranslation();
25700
25668
  return /* @__PURE__ */ jsx(DataState, {
25701
25669
  spacing: true,
@@ -25878,7 +25846,7 @@ var ProfitAndLossDetailReport = ({ lineItemName, breadcrumbPath, onClose, onBrea
25878
25846
  shrinkHeightToFitRows: true,
25879
25847
  slots: {
25880
25848
  EmptyState: EmptyState$4,
25881
- ErrorState: ErrorState$3
25849
+ ErrorState: ErrorState$2
25882
25850
  }
25883
25851
  }), rowsWithRunningBalance.lines.length > 0 && /* @__PURE__ */ jsxs(HStack, {
25884
25852
  pb: "sm",
@@ -26181,7 +26149,7 @@ var ProfitAndLossDetailedCharts = ({ scope, hideClose = false, hideHeader = fals
26181
26149
  }, [_oldSortByScope, activeScope]);
26182
26150
  const handleClose = useCallback(() => setSidebarScope(void 0), [setSidebarScope]);
26183
26151
  return /* @__PURE__ */ jsxs("div", {
26184
- className: "Layer__profit-and-loss-detailed-charts",
26152
+ className: "Layer__profit-and-loss-detailed-charts Layer__ProfitAndLossDetailedCharts",
26185
26153
  children: [
26186
26154
  !hideHeader && /* @__PURE__ */ jsx(ProfitAndLossDetailedChartsHeader, {
26187
26155
  mode: isDesktop ? "desktop" : "tablet",
@@ -34457,7 +34425,7 @@ var VehicleSchema = Schema.Struct({
34457
34425
  businessId: pipe(Schema.propertySignature(Schema.UUID), Schema.fromKey("business_id")),
34458
34426
  externalId: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("external_id")),
34459
34427
  makeAndModel: pipe(Schema.propertySignature(Schema.String), Schema.fromKey("make_and_model")),
34460
- year: Schema.Number,
34428
+ year: Schema.NullishOr(Schema.Number),
34461
34429
  licensePlate: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("license_plate")),
34462
34430
  vin: Schema.NullishOr(Schema.String),
34463
34431
  description: Schema.NullishOr(Schema.String),
@@ -34470,7 +34438,7 @@ var VehicleSchema = Schema.Struct({
34470
34438
  });
34471
34439
  Schema.Struct({
34472
34440
  makeAndModel: Schema.String,
34473
- year: Schema.Number,
34441
+ year: Schema.NullishOr(Schema.Number),
34474
34442
  licensePlate: Schema.String,
34475
34443
  vin: Schema.String,
34476
34444
  description: Schema.String,
@@ -34478,7 +34446,7 @@ Schema.Struct({
34478
34446
  });
34479
34447
  var UpsertVehicleSchema = Schema.Struct({
34480
34448
  makeAndModel: pipe(Schema.propertySignature(Schema.String), Schema.fromKey("make_and_model")),
34481
- year: Schema.Number,
34449
+ year: Schema.NullishOr(Schema.Number),
34482
34450
  licensePlate: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("license_plate")),
34483
34451
  vin: Schema.NullishOr(Schema.String),
34484
34452
  description: Schema.NullishOr(Schema.String),
@@ -34880,19 +34848,27 @@ var TripPurposeComboBox = ({ value, onValueChange, isReadOnly, className }) => {
34880
34848
  };
34881
34849
  //#endregion
34882
34850
  //#region src/utils/vehicles.ts
34883
- var getVehicleDisplayName = (vehicle) => vehicle ? `${vehicle.year} ${vehicle.makeAndModel}` : "";
34851
+ var unnamedVehicle = translationKey("vehicles:label.unnamed_vehicle", "Unnamed vehicle");
34852
+ var getVehicleDisplayName = (vehicle, t) => {
34853
+ if (!vehicle) return "";
34854
+ const makeAndModel = vehicle.makeAndModel.trim();
34855
+ if (vehicle.year == null) return makeAndModel || t(unnamedVehicle.i18nKey, unnamedVehicle.defaultValue);
34856
+ return `${vehicle.year} ${makeAndModel}`.trim();
34857
+ };
34884
34858
  //#endregion
34885
34859
  //#region src/components/VehicleManagement/VehicleSelector/VehicleSelector.tsx
34886
34860
  var VehicleAsOption = class {
34887
- constructor(vehicle) {
34861
+ constructor(vehicle, t) {
34888
34862
  _defineProperty(this, "internalVehicle", void 0);
34863
+ _defineProperty(this, "t", void 0);
34889
34864
  this.internalVehicle = vehicle;
34865
+ this.t = t;
34890
34866
  }
34891
34867
  get original() {
34892
34868
  return this.internalVehicle;
34893
34869
  }
34894
34870
  get label() {
34895
- return getVehicleDisplayName(this.internalVehicle);
34871
+ return getVehicleDisplayName(this.internalVehicle, this.t);
34896
34872
  }
34897
34873
  get id() {
34898
34874
  return this.internalVehicle.id;
@@ -34906,15 +34882,15 @@ function VehicleSelector({ selectedVehicle, onSelectedVehicleChange, placeholder
34906
34882
  const combinedClassName = classNames("Layer__VehicleSelector", inline && "Layer__VehicleSelector--inline", containerClassName);
34907
34883
  const { data, isLoading, isError } = useListVehicles();
34908
34884
  const options = useMemo(() => {
34909
- return (data === null || data === void 0 ? void 0 : data.map((vehicle) => new VehicleAsOption(vehicle))) || [];
34910
- }, [data]);
34885
+ return (data === null || data === void 0 ? void 0 : data.map((vehicle) => new VehicleAsOption(vehicle, t))) || [];
34886
+ }, [data, t]);
34911
34887
  const onSelectedValueChange = useCallback((option) => {
34912
34888
  onSelectedVehicleChange((option === null || option === void 0 ? void 0 : option.original) || null);
34913
34889
  }, [onSelectedVehicleChange]);
34914
34890
  const selectedVehicleForComboBox = useMemo(() => {
34915
34891
  if (selectedVehicle === null) return null;
34916
- return new VehicleAsOption(selectedVehicle);
34917
- }, [selectedVehicle]);
34892
+ return new VehicleAsOption(selectedVehicle, t);
34893
+ }, [selectedVehicle, t]);
34918
34894
  const EmptyMessage = useMemo(() => /* @__PURE__ */ jsx(P, {
34919
34895
  variant: "subtle",
34920
34896
  children: t("vehicles:empty.matching_vehicle", "No matching vehicle")
@@ -42220,7 +42196,7 @@ var getColumnConfig$2 = ({ onViewOrUpsertTrip, onDeleteTrip }, t) => [
42220
42196
  cell: (row) => /* @__PURE__ */ jsx(Span, {
42221
42197
  ellipsis: true,
42222
42198
  withTooltip: true,
42223
- children: getVehicleDisplayName(row.original.vehicle)
42199
+ children: getVehicleDisplayName(row.original.vehicle, t)
42224
42200
  }),
42225
42201
  isRowHeader: true
42226
42202
  },
@@ -42563,7 +42539,7 @@ var validateVehicleForm = ({ vehicle }) => {
42563
42539
  reason: VehicleFormInvalidReason.YearRequired
42564
42540
  });
42565
42541
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
42566
- if (!Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) errors.push({
42542
+ if (year != null && !Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) errors.push({
42567
42543
  field: "year",
42568
42544
  reason: VehicleFormInvalidReason.YearRange
42569
42545
  });
@@ -42841,7 +42817,7 @@ function VehicleArchiveConfirmationModal({ isOpen, onOpenChange, vehicle, useDra
42841
42817
  const onConfirm = useCallback(_asyncToGenerator(function* () {
42842
42818
  yield archiveVehicle();
42843
42819
  }), [archiveVehicle]);
42844
- const vehicleName = getVehicleDisplayName(vehicle);
42820
+ const vehicleName = getVehicleDisplayName(vehicle, t);
42845
42821
  return /* @__PURE__ */ jsx(BaseConfirmationModal, {
42846
42822
  isOpen,
42847
42823
  onOpenChange,
@@ -42902,7 +42878,7 @@ function VehicleDeleteConfirmationModal({ isOpen, onOpenChange, vehicle, useDraw
42902
42878
  const onConfirm = useCallback(_asyncToGenerator(function* () {
42903
42879
  yield deleteVehicle();
42904
42880
  }), [deleteVehicle]);
42905
- const vehicleName = getVehicleDisplayName(vehicle);
42881
+ const vehicleName = getVehicleDisplayName(vehicle, t);
42906
42882
  return /* @__PURE__ */ jsx(BaseConfirmationModal, {
42907
42883
  isOpen,
42908
42884
  onOpenChange,
@@ -42964,7 +42940,7 @@ function VehicleReactivateConfirmationModal({ isOpen, onOpenChange, vehicle, use
42964
42940
  const onConfirm = useCallback(_asyncToGenerator(function* () {
42965
42941
  yield reactivateVehicle();
42966
42942
  }), [reactivateVehicle]);
42967
- const vehicleName = getVehicleDisplayName(vehicle);
42943
+ const vehicleName = getVehicleDisplayName(vehicle, t);
42968
42944
  return /* @__PURE__ */ jsx(BaseConfirmationModal, {
42969
42945
  isOpen,
42970
42946
  onOpenChange,
@@ -42995,7 +42971,7 @@ var VehicleCard = ({ vehicle, onEdit }) => {
42995
42971
  label: t(opt.i18nKey, opt.defaultValue),
42996
42972
  key: opt.fieldKey
42997
42973
  })), [t]);
42998
- const vehicleName = getVehicleDisplayName(vehicle);
42974
+ const vehicleName = getVehicleDisplayName(vehicle, t);
42999
42975
  const isArchived = vehicle.archivedAt !== null && vehicle.archivedAt !== void 0;
43000
42976
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
43001
42977
  /* @__PURE__ */ jsx(Card, {
@@ -43952,6 +43928,108 @@ var useSolopreneurOnboardingBannerState = () => {
43952
43928
  });
43953
43929
  };
43954
43930
  //#endregion
43931
+ //#region src/components/TaxEstimatesSummaryCard/constants.ts
43932
+ var resolveCategoryColor = ({ key }) => {
43933
+ var _federal$state$key;
43934
+ return (_federal$state$key = {
43935
+ federal: DEFAULT_CHART_COLORS[0],
43936
+ state: DEFAULT_CHART_COLORS[1]
43937
+ }[key]) !== null && _federal$state$key !== void 0 ? _federal$state$key : DEFAULT_CHART_COLORS[0];
43938
+ };
43939
+ var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
43940
+ TaxEstimatesSummaryCardMode["PieChart"] = "PieChart";
43941
+ TaxEstimatesSummaryCardMode["HorizontalBarChart"] = "HorizontalBarChart";
43942
+ return TaxEstimatesSummaryCardMode;
43943
+ }({});
43944
+ //#endregion
43945
+ //#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardError.tsx
43946
+ var TaxEstimatesSummaryCardError = () => {
43947
+ const { t } = useTranslation();
43948
+ return /* @__PURE__ */ jsx(DataState, {
43949
+ className: "Layer__TaxEstimatesSummaryCard__DataState Layer__data-state--reset",
43950
+ status: DataStateStatus.failed,
43951
+ title: t("taxEstimates:error.load_tax_estimates_summary", "We couldn't load your tax summary"),
43952
+ description: t("taxEstimates:error.while_loading_tax_estimates_summary", "An error occurred while loading your tax summary. Please check your connection and try again.")
43953
+ });
43954
+ };
43955
+ //#endregion
43956
+ //#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardLoading.tsx
43957
+ var TaxEstimatesSummaryCardLoading = ({ mode }) => {
43958
+ if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ jsxs(VStack, {
43959
+ gap: "md",
43960
+ className: "Layer__TaxEstimatesSummaryCard__Content",
43961
+ pb: "md",
43962
+ pi: "lg",
43963
+ children: [
43964
+ /* @__PURE__ */ jsx(SkeletonLoader, {
43965
+ height: "24px",
43966
+ width: "40%"
43967
+ }),
43968
+ /* @__PURE__ */ jsx(SkeletonLoader, {
43969
+ height: "24px",
43970
+ width: "100%"
43971
+ }),
43972
+ /* @__PURE__ */ jsx(SkeletonLoader, {
43973
+ height: "16px",
43974
+ width: "100%"
43975
+ })
43976
+ ]
43977
+ });
43978
+ return /* @__PURE__ */ jsxs(VStack, {
43979
+ gap: "md",
43980
+ className: "Layer__TaxEstimatesSummaryCard__Content",
43981
+ pb: "md",
43982
+ pi: "lg",
43983
+ align: "center",
43984
+ children: [
43985
+ /* @__PURE__ */ jsx(CircleSkeletonLoader, {
43986
+ height: "128px",
43987
+ width: "128px"
43988
+ }),
43989
+ /* @__PURE__ */ jsx(SkeletonLoader, {
43990
+ height: "24px",
43991
+ width: "80%"
43992
+ }),
43993
+ /* @__PURE__ */ jsx(SkeletonLoader, {
43994
+ height: "24px",
43995
+ width: "80%"
43996
+ }),
43997
+ /* @__PURE__ */ jsx(SkeletonLoader, {
43998
+ height: "24px",
43999
+ width: "80%"
44000
+ })
44001
+ ]
44002
+ });
44003
+ };
44004
+ //#endregion
44005
+ //#region src/schemas/taxEstimates/summary.ts
44006
+ var TaxSummarySectionTypeSchema = Schema.Literal("federal", "state");
44007
+ var TaxSummaryState = /* @__PURE__ */ function(TaxSummaryState) {
44008
+ TaxSummaryState["NO_TRANSACTIONS"] = "NO_TRANSACTIONS";
44009
+ TaxSummaryState["NO_TAXES_OWED"] = "NO_TAXES_OWED";
44010
+ TaxSummaryState["TAXES_OWED"] = "TAXES_OWED";
44011
+ TaxSummaryState["UNKNOWN"] = "UNKNOWN";
44012
+ return TaxSummaryState;
44013
+ }({});
44014
+ var TransformedTaxSummaryStateSchema = createTransformedEnumSchema(Schema.Enums(TaxSummaryState), TaxSummaryState, TaxSummaryState.UNKNOWN);
44015
+ var TaxSummarySectionSchema = Schema.Struct({
44016
+ type: TaxSummarySectionTypeSchema,
44017
+ key: Schema.NullishOr(Schema.String),
44018
+ label: Schema.String,
44019
+ total: Schema.Number,
44020
+ taxesPaid: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("taxes_paid")),
44021
+ taxesOwed: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("taxes_owed"))
44022
+ });
44023
+ var TaxSummarySchema = Schema.Struct({
44024
+ year: Schema.Number,
44025
+ state: TransformedTaxSummaryStateSchema,
44026
+ projectedTaxesOwed: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("projected_taxes_owed")),
44027
+ taxesDueAt: pipe(Schema.propertySignature(Schema.Date), Schema.fromKey("taxes_due_at")),
44028
+ uncategorizedTaxPayments: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("uncategorized_tax_payments")),
44029
+ sections: Schema.Array(TaxSummarySectionSchema)
44030
+ });
44031
+ var TaxSummaryResponseSchema = Schema.Struct({ data: TaxSummarySchema });
44032
+ //#endregion
43955
44033
  //#region src/components/ui/Swatch/Swatch.tsx
43956
44034
  var Swatch = ({ color, opacity, pattern }) => {
43957
44035
  const patternId = useId();
@@ -44163,33 +44241,106 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
44163
44241
  });
44164
44242
  };
44165
44243
  //#endregion
44166
- //#region src/components/TaxEstimatesSummaryCard/constants.ts
44167
- var resolveCategoryColor = ({ key }) => {
44168
- var _federal$state$key;
44169
- return (_federal$state$key = {
44170
- federal: DEFAULT_CHART_COLORS[0],
44171
- state: DEFAULT_CHART_COLORS[1]
44172
- }[key]) !== null && _federal$state$key !== void 0 ? _federal$state$key : DEFAULT_CHART_COLORS[0];
44244
+ //#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardEmpty.tsx
44245
+ function TaxEstimatesSummaryCardEmpty() {
44246
+ const { t } = useTranslation();
44247
+ return /* @__PURE__ */ jsx(DataState, {
44248
+ className: "Layer__TaxEstimatesSummaryCard__DataState Layer__data-state--reset",
44249
+ status: DataStateStatus.info,
44250
+ title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
44251
+ description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions.")
44252
+ });
44253
+ }
44254
+ //#endregion
44255
+ //#region src/components/TaxEstimatesSummaryCard/states/TaxEstimatesSummaryCardNegativeOrZero.tsx
44256
+ var TaxEstimatesSummaryCardNegativeOrZero = () => {
44257
+ const { t } = useTranslation();
44258
+ return /* @__PURE__ */ jsx(DataState, {
44259
+ className: "Layer__TaxEstimatesSummaryCard__DataState Layer__data-state--reset",
44260
+ status: DataStateStatus.info,
44261
+ title: t("taxEstimates:error.tax_due_is_negative_or_zero", "No taxes owed this year"),
44262
+ description: t("taxEstimates:error.tax_due_is_negative_or_zero_description", "Your deductible losses exceed your income for this period, bringing your tax liability to zero.")
44263
+ });
44173
44264
  };
44174
44265
  //#endregion
44175
- //#region src/schemas/taxEstimates/summary.ts
44176
- var TaxSummarySectionTypeSchema = Schema.Literal("federal", "state");
44177
- var TaxSummarySectionSchema = Schema.Struct({
44178
- type: TaxSummarySectionTypeSchema,
44179
- key: Schema.NullishOr(Schema.String),
44180
- label: Schema.String,
44181
- total: Schema.Number,
44182
- taxesPaid: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("taxes_paid")),
44183
- taxesOwed: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("taxes_owed"))
44184
- });
44185
- var TaxSummarySchema = Schema.Struct({
44186
- year: Schema.Number,
44187
- projectedTaxesOwed: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("projected_taxes_owed")),
44188
- taxesDueAt: pipe(Schema.propertySignature(Schema.Date), Schema.fromKey("taxes_due_at")),
44189
- uncategorizedTaxPayments: pipe(Schema.propertySignature(Schema.Number), Schema.fromKey("uncategorized_tax_payments")),
44190
- sections: Schema.Array(TaxSummarySectionSchema)
44191
- });
44192
- var TaxSummaryResponseSchema = Schema.Struct({ data: TaxSummarySchema });
44266
+ //#region src/components/TaxEstimatesSummaryCard/TaxEstimatesSummaryCardContent.tsx
44267
+ var Content = ({ state, data, mode, layout }) => {
44268
+ const commonProps = useMemo(() => {
44269
+ var _data$data;
44270
+ const colorByKey = data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.reduce((acc, item) => {
44271
+ acc[item.name] = resolveCategoryColor({ key: item.name });
44272
+ return acc;
44273
+ }, {});
44274
+ return {
44275
+ interactionProps: NO_OP_INTERACTION_PROPS,
44276
+ stylingProps: { colorSelector: (item) => {
44277
+ var _colorByKey$item$name;
44278
+ return {
44279
+ color: (_colorByKey$item$name = colorByKey === null || colorByKey === void 0 ? void 0 : colorByKey[item.name]) !== null && _colorByKey$item$name !== void 0 ? _colorByKey$item$name : "var(--color-base-300)",
44280
+ opacity: 1
44281
+ };
44282
+ } }
44283
+ };
44284
+ }, [data]);
44285
+ switch (state) {
44286
+ case TaxSummaryState.NO_TRANSACTIONS: return /* @__PURE__ */ jsx(TaxEstimatesSummaryCardEmpty, {});
44287
+ case TaxSummaryState.NO_TAXES_OWED: return /* @__PURE__ */ jsx(TaxEstimatesSummaryCardNegativeOrZero, {});
44288
+ case TaxSummaryState.UNKNOWN:
44289
+ case TaxSummaryState.TAXES_OWED:
44290
+ if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ jsx(HorizontalBarChartContent, {
44291
+ data,
44292
+ commonProps
44293
+ });
44294
+ return /* @__PURE__ */ jsx(PieChartContent, {
44295
+ data,
44296
+ commonProps,
44297
+ layout
44298
+ });
44299
+ }
44300
+ };
44301
+ var HorizontalBarChartContent = ({ data, commonProps }) => {
44302
+ const { t } = useTranslation();
44303
+ const { formatCurrencyFromCents } = useIntlFormatter();
44304
+ const { isDesktop } = useSizeClass();
44305
+ return /* @__PURE__ */ jsxs(VStack, {
44306
+ className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--horizontal",
44307
+ gap: "md",
44308
+ pi: "lg",
44309
+ pbe: "lg",
44310
+ children: [/* @__PURE__ */ jsxs(HStack, {
44311
+ className: "Layer__TaxEstimatesSummaryCard__TotalRow",
44312
+ justify: "space-between",
44313
+ align: "baseline",
44314
+ gap: "md",
44315
+ children: [/* @__PURE__ */ jsx(Span, {
44316
+ size: "md",
44317
+ variant: "subtle",
44318
+ children: t("common:label.total", "Total")
44319
+ }), /* @__PURE__ */ jsx(Span, {
44320
+ size: "xl",
44321
+ weight: "bold",
44322
+ numeric: "tabular-nums",
44323
+ className: "Layer__TaxEstimatesSummaryCard__TotalValue",
44324
+ children: formatCurrencyFromCents(data.total)
44325
+ })]
44326
+ }), /* @__PURE__ */ jsx(HorizontalBarChart, {
44327
+ data,
44328
+ stylingProps: commonProps.stylingProps,
44329
+ formatValue: formatCurrencyFromCents,
44330
+ labelMode: isDesktop ? LegendLayout.Aligned : LegendLayout.Table
44331
+ })]
44332
+ });
44333
+ };
44334
+ var PieChartContent = ({ data, commonProps, layout }) => {
44335
+ const { isMobile } = useSizeClass();
44336
+ const isVerticalLayout = isMobile || layout === "summaryCard";
44337
+ return /* @__PURE__ */ jsxs(Stack, _objectSpread2(_objectSpread2({}, {
44338
+ direction: isVerticalLayout ? "column" : "row",
44339
+ className: classNames("Layer__TaxEstimatesSummaryCard__Content", isVerticalLayout && "Layer__TaxEstimatesSummaryCard__Content--mobile"),
44340
+ gap: "lg",
44341
+ align: isVerticalLayout ? void 0 : "center"
44342
+ }), {}, { children: [/* @__PURE__ */ jsx(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ jsx(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))] }));
44343
+ };
44193
44344
  //#endregion
44194
44345
  //#region src/hooks/api/businesses/[business-id]/tax-estimates/summary/useTaxSummary.ts
44195
44346
  var TAX_SUMMARY_TAG_KEY = "#tax-summary";
@@ -44326,6 +44477,7 @@ var prepareTaxSummaryData = (taxSummaryData, shortenedDisplayName, isMobile) =>
44326
44477
  }));
44327
44478
  };
44328
44479
  var useTaxEstimatesSummaryCard = () => {
44480
+ var _taxSummaryData$state;
44329
44481
  const { year } = useTaxEstimatesYear();
44330
44482
  const { fullYearProjection } = useFullYearProjection();
44331
44483
  const { t } = useTranslation();
@@ -44355,167 +44507,16 @@ var useTaxEstimatesSummaryCard = () => {
44355
44507
  ]),
44356
44508
  isLoading,
44357
44509
  isError,
44510
+ state: (_taxSummaryData$state = taxSummaryData === null || taxSummaryData === void 0 ? void 0 : taxSummaryData.state) !== null && _taxSummaryData$state !== void 0 ? _taxSummaryData$state : TaxSummaryState.TAXES_OWED,
44358
44511
  layout: isDesktop ? "taxOverview" : "summaryCard",
44359
44512
  title: t("taxEstimates:label.tax_summary", "Tax Summary")
44360
44513
  };
44361
44514
  };
44362
44515
  //#endregion
44363
44516
  //#region src/components/TaxEstimatesSummaryCard/TaxEstimatesSummaryCard.tsx
44364
- var LoadingState$1 = ({ mode }) => {
44365
- if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ jsxs(VStack, {
44366
- gap: "md",
44367
- className: "Layer__TaxEstimatesSummaryCard__Content",
44368
- pb: "md",
44369
- pi: "lg",
44370
- children: [
44371
- /* @__PURE__ */ jsx(SkeletonLoader, {
44372
- height: "24px",
44373
- width: "40%"
44374
- }),
44375
- /* @__PURE__ */ jsx(SkeletonLoader, {
44376
- height: "24px",
44377
- width: "100%"
44378
- }),
44379
- /* @__PURE__ */ jsx(SkeletonLoader, {
44380
- height: "16px",
44381
- width: "100%"
44382
- })
44383
- ]
44384
- });
44385
- return /* @__PURE__ */ jsxs(VStack, {
44386
- gap: "md",
44387
- className: "Layer__TaxEstimatesSummaryCard__Content",
44388
- pb: "md",
44389
- pi: "lg",
44390
- align: "center",
44391
- children: [
44392
- /* @__PURE__ */ jsx(CircleSkeletonLoader, {
44393
- height: "128px",
44394
- width: "128px"
44395
- }),
44396
- /* @__PURE__ */ jsx(SkeletonLoader, {
44397
- height: "24px",
44398
- width: "80%"
44399
- }),
44400
- /* @__PURE__ */ jsx(SkeletonLoader, {
44401
- height: "24px",
44402
- width: "80%"
44403
- }),
44404
- /* @__PURE__ */ jsx(SkeletonLoader, {
44405
- height: "24px",
44406
- width: "80%"
44407
- })
44408
- ]
44409
- });
44410
- };
44411
- var ErrorState$2 = () => {
44412
- const { t } = useTranslation();
44413
- return /* @__PURE__ */ jsx(VStack, {
44414
- gap: "md",
44415
- className: "Layer__TaxEstimatesSummaryCard__Content",
44416
- pb: "md",
44417
- pi: "lg",
44418
- align: "center",
44419
- children: /* @__PURE__ */ jsx(Span, {
44420
- size: "lg",
44421
- children: t("taxEstimates:error.load_tax_estimates_summary", "We couldn't load your tax summary")
44422
- })
44423
- });
44424
- };
44425
- function allTaxSectionsAreEmpty(summary) {
44426
- return summary.data.every((section) => section.value === 0);
44427
- }
44428
- function TaxEstimatesSummaryCardEmpty() {
44429
- const { t } = useTranslation();
44430
- return /* @__PURE__ */ jsx(DataState, {
44431
- className: "Layer__TaxEstimatesSummaryCard--empty",
44432
- status: DataStateStatus.info,
44433
- title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
44434
- description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
44435
- });
44436
- }
44437
- var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
44438
- TaxEstimatesSummaryCardMode["PieChart"] = "PieChart";
44439
- TaxEstimatesSummaryCardMode["HorizontalBarChart"] = "HorizontalBarChart";
44440
- return TaxEstimatesSummaryCardMode;
44441
- }({});
44442
- var Content = ({ data, mode, commonProps, layout }) => {
44443
- if (mode === TaxEstimatesSummaryCardMode.HorizontalBarChart) return /* @__PURE__ */ jsx(HorizontalBarChartContent, {
44444
- data,
44445
- commonProps
44446
- });
44447
- return /* @__PURE__ */ jsx(PieChartContent, {
44448
- data,
44449
- commonProps,
44450
- layout
44451
- });
44452
- };
44453
- var HorizontalBarChartContent = ({ data, commonProps }) => {
44454
- const { t } = useTranslation();
44455
- const { formatCurrencyFromCents } = useIntlFormatter();
44456
- const { isDesktop } = useSizeClass();
44457
- return /* @__PURE__ */ jsxs(VStack, {
44458
- className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--horizontal",
44459
- gap: "md",
44460
- pi: "lg",
44461
- pbe: "lg",
44462
- children: [/* @__PURE__ */ jsxs(HStack, {
44463
- className: "Layer__TaxEstimatesSummaryCard__TotalRow",
44464
- justify: "space-between",
44465
- align: "baseline",
44466
- gap: "md",
44467
- children: [/* @__PURE__ */ jsx(Span, {
44468
- size: "md",
44469
- variant: "subtle",
44470
- children: t("common:label.total", "Total")
44471
- }), /* @__PURE__ */ jsx(Span, {
44472
- size: "xl",
44473
- weight: "bold",
44474
- numeric: "tabular-nums",
44475
- className: "Layer__TaxEstimatesSummaryCard__TotalValue",
44476
- children: formatCurrencyFromCents(data.total)
44477
- })]
44478
- }), /* @__PURE__ */ jsx(HorizontalBarChart, {
44479
- data,
44480
- stylingProps: commonProps.stylingProps,
44481
- formatValue: formatCurrencyFromCents,
44482
- labelMode: isDesktop ? LegendLayout.Aligned : LegendLayout.Table
44483
- })]
44484
- });
44485
- };
44486
- var PieChartContent = ({ data, commonProps, layout }) => {
44487
- const { isMobile } = useSizeClass();
44488
- return isMobile || layout === "summaryCard" ? /* @__PURE__ */ jsxs(VStack, {
44489
- className: "Layer__TaxEstimatesSummaryCard__Content Layer__TaxEstimatesSummaryCard__Content--mobile",
44490
- gap: "lg",
44491
- children: [/* @__PURE__ */ jsx(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ jsx(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
44492
- }) : /* @__PURE__ */ jsxs(HStack, {
44493
- className: "Layer__TaxEstimatesSummaryCard__Content",
44494
- align: "center",
44495
- gap: "lg",
44496
- children: [/* @__PURE__ */ jsx(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ jsx(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
44497
- });
44498
- };
44499
44517
  var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, interactionProps, stringOverrides } = {}) => {
44500
- const { detailData, layout, title: defaultTitle, isLoading, isError } = useTaxEstimatesSummaryCard();
44518
+ const { title: defaultTitle, isLoading, isError, layout, detailData, state } = useTaxEstimatesSummaryCard();
44501
44519
  const isSummaryCardLayout = layout === "summaryCard";
44502
- const commonProps = useMemo(() => {
44503
- var _detailData$data;
44504
- const colorByKey = detailData === null || detailData === void 0 || (_detailData$data = detailData.data) === null || _detailData$data === void 0 ? void 0 : _detailData$data.reduce((acc, item) => {
44505
- acc[item.name] = resolveCategoryColor({ key: item.name });
44506
- return acc;
44507
- }, {});
44508
- return {
44509
- interactionProps: NO_OP_INTERACTION_PROPS,
44510
- stylingProps: { colorSelector: (item) => {
44511
- var _colorByKey$item$name;
44512
- return {
44513
- color: (_colorByKey$item$name = colorByKey === null || colorByKey === void 0 ? void 0 : colorByKey[item.name]) !== null && _colorByKey$item$name !== void 0 ? _colorByKey$item$name : "var(--color-base-300)",
44514
- opacity: 1
44515
- };
44516
- } }
44517
- };
44518
- }, [detailData === null || detailData === void 0 ? void 0 : detailData.data]);
44519
44520
  const slots = useSummaryCardSlots({
44520
44521
  defaultTitle,
44521
44522
  interactionProps,
@@ -44528,12 +44529,12 @@ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, in
44528
44529
  data: detailData,
44529
44530
  isLoading,
44530
44531
  isError,
44531
- Loading: /* @__PURE__ */ jsx(LoadingState$1, { mode }),
44532
- Error: /* @__PURE__ */ jsx(ErrorState$2, {}),
44533
- children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ jsx(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ jsx(Content, {
44532
+ Loading: /* @__PURE__ */ jsx(TaxEstimatesSummaryCardLoading, { mode }),
44533
+ Error: /* @__PURE__ */ jsx(TaxEstimatesSummaryCardError, {}),
44534
+ children: ({ data }) => /* @__PURE__ */ jsx(Content, {
44535
+ state,
44534
44536
  data,
44535
44537
  mode,
44536
- commonProps,
44537
44538
  layout
44538
44539
  })
44539
44540
  })
@@ -44991,6 +44992,7 @@ var taxDetailsRowFields = {
44991
44992
  var TaxDetailsRowSchema = Schema.Struct(_objectSpread2(_objectSpread2({}, taxDetailsRowFields), {}, { breakdown: Schema.optional(Schema.Array(Schema.suspend(() => TaxDetailsRowSchema))) }));
44992
44993
  var TaxDetailsMetaSchema = Schema.Struct({
44993
44994
  year: Schema.Number,
44995
+ state: TransformedTaxSummaryStateSchema,
44994
44996
  filingStatus: pipe(Schema.propertySignature(Schema.String), Schema.fromKey("filing_status"))
44995
44997
  });
44996
44998
  var TaxDetailsSchema = Schema.Struct({
@@ -45348,9 +45350,10 @@ var TaxProfile = () => {
45348
45350
  const { t } = useTranslation();
45349
45351
  const navigate = useTaxEstimatesNavigation();
45350
45352
  const { data: taxProfile } = useTaxProfile();
45353
+ const hasSavedTaxProfile = (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true;
45351
45354
  const handleGoBack = useCallback(() => {
45352
- navigate.toEstimates();
45353
- }, [navigate]);
45355
+ if (hasSavedTaxProfile) navigate.toEstimates();
45356
+ }, [navigate, hasSavedTaxProfile]);
45354
45357
  return /* @__PURE__ */ jsx(BaseDetailView, {
45355
45358
  slots: {
45356
45359
  Header: useCallback(() => {
@@ -45362,7 +45365,7 @@ var TaxProfile = () => {
45362
45365
  BackIcon: BackArrow
45363
45366
  },
45364
45367
  name: "TaxProfile",
45365
- onGoBack: handleGoBack,
45368
+ onGoBack: hasSavedTaxProfile ? handleGoBack : void 0,
45366
45369
  children: /* @__PURE__ */ jsx(TaxProfileForm, { taxProfile })
45367
45370
  });
45368
45371
  };
@@ -45567,7 +45570,7 @@ var tConditional = (translate, key, _ref) => {
45567
45570
  var AmountWithLabel = ({ slotProps }) => /* @__PURE__ */ jsxs(VStack, {
45568
45571
  className: "Layer__TaxSummaryCard__AmountWithLabel",
45569
45572
  gap: "2xs",
45570
- align: "start",
45573
+ align: "center",
45571
45574
  children: [/* @__PURE__ */ jsx(MoneySpan, _objectSpread2({}, slotProps.MoneySpan)), /* @__PURE__ */ jsx(Badge, _objectSpread2({
45572
45575
  size: BadgeSize.SMALL,
45573
45576
  variant: BadgeVariant.NEUTRAL
@@ -45587,7 +45590,6 @@ var EquationRow = ({ section, size = "md" }) => {
45587
45590
  Badge: { children: t("common:label.total", "Total") }
45588
45591
  } }),
45589
45592
  /* @__PURE__ */ jsx(Span, {
45590
- className: "Layer__TaxSummaryCard__Operator",
45591
45593
  size,
45592
45594
  variant: "subtle",
45593
45595
  children: "-"
@@ -45600,7 +45602,6 @@ var EquationRow = ({ section, size = "md" }) => {
45600
45602
  Badge: { children: t("taxEstimates:label.taxes_paid", "Taxes Paid") }
45601
45603
  } }),
45602
45604
  /* @__PURE__ */ jsx(Span, {
45603
- className: "Layer__TaxSummaryCard__Operator",
45604
45605
  size,
45605
45606
  variant: "subtle",
45606
45607
  children: "="
@@ -45673,7 +45674,7 @@ var TaxSummaryCardDesktop = ({ data }) => {
45673
45674
  }), /* @__PURE__ */ jsx(Span, {
45674
45675
  size: "sm",
45675
45676
  variant: "subtle",
45676
- children: t("taxEstimates:label.taxes_due_at", "Taxes due on {{date}}", { date: formatDate(data.taxesDueAt) })
45677
+ children: t("taxEstimates:label.due_at", "Due on {{date}}", { date: formatDate(data.taxesDueAt) })
45677
45678
  })]
45678
45679
  }),
45679
45680
  data.sections.map((section) => {
@@ -45728,7 +45729,7 @@ var TaxSummaryCardMobile = ({ data }) => {
45728
45729
  }), /* @__PURE__ */ jsx(Span, {
45729
45730
  size: "sm",
45730
45731
  variant: "subtle",
45731
- children: t("taxEstimates:label.taxes_due_at", "Taxes due on {{date}}", { date: formatDate(data.taxesDueAt) })
45732
+ children: t("taxEstimates:label.due_at", "Due on {{date}}", { date: formatDate(data.taxesDueAt) })
45732
45733
  })]
45733
45734
  }),
45734
45735
  /* @__PURE__ */ jsxs(HStack, {