@layerfi/components 0.1.132-alpha.1 → 0.1.132-alpha.2
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.
- package/dist/cjs/index.cjs +341 -285
- package/dist/esm/index.mjs +341 -285
- package/dist/index.css +14 -16
- package/dist/index.d.ts +30 -23
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -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.
|
|
253
|
+
version: "0.1.132-alpha.2",
|
|
254
254
|
description: "Layer React Components",
|
|
255
255
|
main: "dist/cjs/index.cjs",
|
|
256
256
|
module: "dist/esm/index.mjs",
|
|
@@ -43507,10 +43507,7 @@ var SummaryCard = ({ slots, children, className }) => {
|
|
|
43507
43507
|
children: [legend && /* @__PURE__ */ jsx("div", {
|
|
43508
43508
|
className: "Layer__SummaryCard__HeaderLegend",
|
|
43509
43509
|
children: legend
|
|
43510
|
-
}), primaryAction
|
|
43511
|
-
className: "Layer__SummaryCard__HeaderPrimaryAction",
|
|
43512
|
-
children: primaryAction
|
|
43513
|
-
})]
|
|
43510
|
+
}), primaryAction]
|
|
43514
43511
|
})]
|
|
43515
43512
|
}), /* @__PURE__ */ jsx("div", {
|
|
43516
43513
|
className: "Layer__SummaryCard__Content",
|
|
@@ -43593,88 +43590,89 @@ var ExpensesSummaryCard = ({ stylingProps, interactionProps, stringOverrides, cl
|
|
|
43593
43590
|
};
|
|
43594
43591
|
//#endregion
|
|
43595
43592
|
//#region src/components/MileageTrackingSummary/MileageTrackingSummary.tsx
|
|
43596
|
-
var
|
|
43593
|
+
var Content$1 = () => {
|
|
43597
43594
|
const { t } = useTranslation();
|
|
43598
43595
|
const { formatDate } = useIntlFormatter();
|
|
43599
43596
|
const { data, selectedYear, selectedYearData, chartData, isLoading, isError } = useMileageTrackingYearlySummary();
|
|
43600
43597
|
const { isDesktop, isMobile } = useSizeClass();
|
|
43601
43598
|
const inYearLabel = t("mileageTracking:label.in_year", "In {{year}}", { year: formatDate(new Date(selectedYear, 0, 1), DateFormat.Year) });
|
|
43602
|
-
const title = headerOverride !== null && headerOverride !== void 0 ? headerOverride : t("mileageTracking:label.mileage_tracking", "Mileage Tracking");
|
|
43603
43599
|
const statsProps = isDesktop ? { direction: "column" } : isMobile ? { direction: "column" } : { direction: "row" };
|
|
43604
|
-
return /* @__PURE__ */
|
|
43605
|
-
|
|
43606
|
-
|
|
43607
|
-
|
|
43608
|
-
|
|
43609
|
-
|
|
43610
|
-
|
|
43611
|
-
|
|
43612
|
-
|
|
43613
|
-
|
|
43614
|
-
|
|
43615
|
-
|
|
43616
|
-
|
|
43617
|
-
|
|
43600
|
+
return /* @__PURE__ */ jsx(ConditionalBlock, {
|
|
43601
|
+
data,
|
|
43602
|
+
isLoading,
|
|
43603
|
+
isError,
|
|
43604
|
+
Loading: /* @__PURE__ */ jsx(HStack, {
|
|
43605
|
+
className: "Layer__MileageTrackingSummary__Content",
|
|
43606
|
+
gap: "lg",
|
|
43607
|
+
justify: "center",
|
|
43608
|
+
align: "center",
|
|
43609
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
43610
|
+
}),
|
|
43611
|
+
Error: /* @__PURE__ */ jsx(DataState, {
|
|
43612
|
+
status: DataStateStatus.failed,
|
|
43613
|
+
title: t("mileageTracking:error.load_mileage_summary_data", "Failed to load mileage summary data"),
|
|
43614
|
+
spacing: true
|
|
43615
|
+
}),
|
|
43616
|
+
children: () => {
|
|
43617
|
+
var _selectedYearData$est, _selectedYearData$mil, _selectedYearData$tri;
|
|
43618
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
43618
43619
|
className: "Layer__MileageTrackingSummary__Content",
|
|
43620
|
+
direction: isDesktop ? "row" : "column",
|
|
43619
43621
|
gap: "lg",
|
|
43620
|
-
|
|
43621
|
-
|
|
43622
|
-
|
|
43623
|
-
|
|
43624
|
-
|
|
43625
|
-
|
|
43626
|
-
|
|
43627
|
-
|
|
43628
|
-
|
|
43629
|
-
|
|
43630
|
-
|
|
43631
|
-
|
|
43632
|
-
|
|
43633
|
-
|
|
43634
|
-
|
|
43635
|
-
|
|
43636
|
-
|
|
43637
|
-
|
|
43638
|
-
|
|
43639
|
-
|
|
43640
|
-
|
|
43641
|
-
|
|
43642
|
-
|
|
43643
|
-
|
|
43644
|
-
|
|
43645
|
-
|
|
43646
|
-
|
|
43647
|
-
}),
|
|
43648
|
-
/* @__PURE__ */ jsx("div", {
|
|
43649
|
-
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
43650
|
-
children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
|
|
43651
|
-
title: t("mileageTracking:label.total_miles", "Total Miles"),
|
|
43652
|
-
amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
|
|
43653
|
-
description: inYearLabel
|
|
43654
|
-
})
|
|
43655
|
-
}),
|
|
43656
|
-
/* @__PURE__ */ jsx("div", {
|
|
43657
|
-
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
43658
|
-
children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
|
|
43659
|
-
title: t("trips:label.trips", "Trips"),
|
|
43660
|
-
amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
|
|
43661
|
-
description: inYearLabel
|
|
43662
|
-
})
|
|
43622
|
+
children: [/* @__PURE__ */ jsxs(Stack, _objectSpread2(_objectSpread2({}, statsProps), {}, {
|
|
43623
|
+
className: "Layer__MileageTrackingSummary__Cards",
|
|
43624
|
+
gap: "md",
|
|
43625
|
+
children: [
|
|
43626
|
+
/* @__PURE__ */ jsx("div", {
|
|
43627
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
43628
|
+
children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
|
|
43629
|
+
title: t("mileageTracking:label.total_deduction", "Total Deduction"),
|
|
43630
|
+
amount: (_selectedYearData$est = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.estimatedDeduction) !== null && _selectedYearData$est !== void 0 ? _selectedYearData$est : 0,
|
|
43631
|
+
formatAsMoney: true,
|
|
43632
|
+
description: inYearLabel
|
|
43633
|
+
})
|
|
43634
|
+
}),
|
|
43635
|
+
/* @__PURE__ */ jsx("div", {
|
|
43636
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
43637
|
+
children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
|
|
43638
|
+
title: t("mileageTracking:label.total_miles", "Total Miles"),
|
|
43639
|
+
amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
|
|
43640
|
+
description: inYearLabel
|
|
43641
|
+
})
|
|
43642
|
+
}),
|
|
43643
|
+
/* @__PURE__ */ jsx("div", {
|
|
43644
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
43645
|
+
children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
|
|
43646
|
+
title: t("trips:label.trips", "Trips"),
|
|
43647
|
+
amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
|
|
43648
|
+
description: inYearLabel
|
|
43663
43649
|
})
|
|
43664
|
-
]
|
|
43665
|
-
})), /* @__PURE__ */ jsx(VStack, {
|
|
43666
|
-
className: "Layer__MileageTrackingSummary__Chart",
|
|
43667
|
-
fluid: true,
|
|
43668
|
-
justify: "end",
|
|
43669
|
-
children: /* @__PURE__ */ jsx(MileageDeductionChart, {
|
|
43670
|
-
data: chartData,
|
|
43671
|
-
selectedYear,
|
|
43672
|
-
chartHeight: isDesktop ? 250 : 200
|
|
43673
43650
|
})
|
|
43674
|
-
|
|
43675
|
-
})
|
|
43676
|
-
|
|
43677
|
-
|
|
43651
|
+
]
|
|
43652
|
+
})), /* @__PURE__ */ jsx(VStack, {
|
|
43653
|
+
className: "Layer__MileageTrackingSummary__Chart",
|
|
43654
|
+
fluid: true,
|
|
43655
|
+
justify: "end",
|
|
43656
|
+
children: /* @__PURE__ */ jsx(MileageDeductionChart, {
|
|
43657
|
+
data: chartData,
|
|
43658
|
+
selectedYear,
|
|
43659
|
+
chartHeight: isDesktop ? 250 : 200
|
|
43660
|
+
})
|
|
43661
|
+
})]
|
|
43662
|
+
});
|
|
43663
|
+
}
|
|
43664
|
+
});
|
|
43665
|
+
};
|
|
43666
|
+
var MileageTrackingSummary = ({ stringOverrides, interactionProps } = {}) => {
|
|
43667
|
+
const { t } = useTranslation();
|
|
43668
|
+
return /* @__PURE__ */ jsx(SummaryCard, {
|
|
43669
|
+
className: "Layer__MileageTrackingSummary",
|
|
43670
|
+
slots: useSummaryCardSlots({
|
|
43671
|
+
defaultTitle: t("mileageTracking:label.mileage_tracking", "Mileage Tracking"),
|
|
43672
|
+
interactionProps,
|
|
43673
|
+
stringOverrides
|
|
43674
|
+
}),
|
|
43675
|
+
children: /* @__PURE__ */ jsx(Content$1, {})
|
|
43678
43676
|
});
|
|
43679
43677
|
};
|
|
43680
43678
|
//#endregion
|
|
@@ -43733,16 +43731,224 @@ var ProfitAndLossSummaryCard = ({ interactionProps, stringOverrides, className }
|
|
|
43733
43731
|
interactionProps,
|
|
43734
43732
|
stringOverrides
|
|
43735
43733
|
});
|
|
43736
|
-
return /* @__PURE__ */
|
|
43737
|
-
className: classNames("Layer__ProfitAndLossSummaryCard", className),
|
|
43734
|
+
return /* @__PURE__ */ jsxs(SummaryCard, {
|
|
43735
|
+
className: classNames("Layer__ProfitAndLossSummaryCard", "Layer__UI__Chart--focusReset", className),
|
|
43738
43736
|
slots,
|
|
43739
|
-
children: /* @__PURE__ */
|
|
43740
|
-
|
|
43741
|
-
|
|
43742
|
-
|
|
43743
|
-
|
|
43744
|
-
|
|
43745
|
-
|
|
43737
|
+
children: [/* @__PURE__ */ jsx(ProfitAndLossChart, {
|
|
43738
|
+
tagFilter,
|
|
43739
|
+
hideLegend: true
|
|
43740
|
+
}), !isDesktop && legend]
|
|
43741
|
+
});
|
|
43742
|
+
};
|
|
43743
|
+
//#endregion
|
|
43744
|
+
//#region src/types/location.ts
|
|
43745
|
+
var US_STATES_CONFIG = [
|
|
43746
|
+
_objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
|
|
43747
|
+
_objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
|
|
43748
|
+
_objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
|
|
43749
|
+
_objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
|
|
43750
|
+
_objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
|
|
43751
|
+
_objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
|
|
43752
|
+
_objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
|
|
43753
|
+
_objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
|
|
43754
|
+
_objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
|
|
43755
|
+
_objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
|
|
43756
|
+
_objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
|
|
43757
|
+
_objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
|
|
43758
|
+
_objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
|
|
43759
|
+
_objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
|
|
43760
|
+
_objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
|
|
43761
|
+
_objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
|
|
43762
|
+
_objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
|
|
43763
|
+
_objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
|
|
43764
|
+
_objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
|
|
43765
|
+
_objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
|
|
43766
|
+
_objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
|
|
43767
|
+
_objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
|
|
43768
|
+
_objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
|
|
43769
|
+
_objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
|
|
43770
|
+
_objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
|
|
43771
|
+
_objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
|
|
43772
|
+
_objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
|
|
43773
|
+
_objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
|
|
43774
|
+
_objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
|
|
43775
|
+
_objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
|
|
43776
|
+
_objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
|
|
43777
|
+
_objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
|
|
43778
|
+
_objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
|
|
43779
|
+
_objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
|
|
43780
|
+
_objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
|
|
43781
|
+
_objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
|
|
43782
|
+
_objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
|
|
43783
|
+
_objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
|
|
43784
|
+
_objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
|
|
43785
|
+
_objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
|
|
43786
|
+
_objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
|
|
43787
|
+
_objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
|
|
43788
|
+
_objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
|
|
43789
|
+
_objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
|
|
43790
|
+
_objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
|
|
43791
|
+
_objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
|
|
43792
|
+
_objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
|
|
43793
|
+
_objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
|
|
43794
|
+
_objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
|
|
43795
|
+
_objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
|
|
43796
|
+
_objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
|
|
43797
|
+
_objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
|
|
43798
|
+
];
|
|
43799
|
+
var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
|
|
43800
|
+
//#endregion
|
|
43801
|
+
//#region src/schemas/taxEstimates/filingStatus.ts
|
|
43802
|
+
var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
|
|
43803
|
+
FilingStatus["SINGLE"] = "SINGLE";
|
|
43804
|
+
FilingStatus["MARRIED"] = "MARRIED";
|
|
43805
|
+
FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
|
|
43806
|
+
FilingStatus["HEAD"] = "HEAD";
|
|
43807
|
+
FilingStatus["WIDOWER"] = "WIDOWER";
|
|
43808
|
+
return FilingStatus;
|
|
43809
|
+
}({});
|
|
43810
|
+
var FilingStatusSchema = Schema.Enums(FilingStatus);
|
|
43811
|
+
//#endregion
|
|
43812
|
+
//#region src/schemas/taxEstimates/profile.ts
|
|
43813
|
+
var USStateCodeSchema = Schema.Literal(...US_STATE_VALUES);
|
|
43814
|
+
var WithholdingSchema = Schema.Struct({
|
|
43815
|
+
useCustomWithholding: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_custom_withholding")),
|
|
43816
|
+
amount: Schema.NullishOr(Schema.Number)
|
|
43817
|
+
});
|
|
43818
|
+
var HomeOfficeDeductionSchema = Schema.Struct({
|
|
43819
|
+
useHomeOfficeDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_home_office_deduction")),
|
|
43820
|
+
homeOfficeArea: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("home_office_area"))
|
|
43821
|
+
});
|
|
43822
|
+
var VehicleDeductionSchema = Schema.Struct({ useMileageDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_mileage_deduction")) });
|
|
43823
|
+
var DeductionsSchema = Schema.Struct({
|
|
43824
|
+
homeOffice: pipe(Schema.propertySignature(Schema.NullishOr(HomeOfficeDeductionSchema)), Schema.fromKey("home_office")),
|
|
43825
|
+
vehicle: Schema.NullishOr(VehicleDeductionSchema)
|
|
43826
|
+
});
|
|
43827
|
+
var FederalConfigurationSchema = Schema.Struct({
|
|
43828
|
+
filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
|
|
43829
|
+
annualW2Income: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("annual_w2_income")),
|
|
43830
|
+
tipIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("tip_income")),
|
|
43831
|
+
overtimeIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("overtime_income")),
|
|
43832
|
+
withholding: Schema.NullishOr(WithholdingSchema)
|
|
43833
|
+
});
|
|
43834
|
+
var StateConfigurationSchema = Schema.Struct({
|
|
43835
|
+
taxState: pipe(Schema.propertySignature(Schema.NullishOr(USStateCodeSchema)), Schema.fromKey("tax_state")),
|
|
43836
|
+
filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
|
|
43837
|
+
withholding: Schema.NullishOr(WithholdingSchema)
|
|
43838
|
+
});
|
|
43839
|
+
var UsConfigurationSchema = Schema.Struct({
|
|
43840
|
+
federal: Schema.NullishOr(FederalConfigurationSchema),
|
|
43841
|
+
state: Schema.NullishOr(StateConfigurationSchema),
|
|
43842
|
+
deductions: pipe(Schema.propertySignature(Schema.NullishOr(DeductionsSchema)), Schema.fromKey("deductions"))
|
|
43843
|
+
});
|
|
43844
|
+
var TaxProfileSchema = Schema.Struct({
|
|
43845
|
+
taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
|
|
43846
|
+
usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration")),
|
|
43847
|
+
userHasSavedTaxProfile: pipe(Schema.propertySignature(Schema.Boolean), Schema.fromKey("user_has_saved_tax_profile"))
|
|
43848
|
+
});
|
|
43849
|
+
var TaxProfileResponseSchema = Schema.Struct({ data: TaxProfileSchema });
|
|
43850
|
+
var TaxProfileRequestSchema = Schema.Struct({
|
|
43851
|
+
taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
|
|
43852
|
+
usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration"))
|
|
43853
|
+
});
|
|
43854
|
+
//#endregion
|
|
43855
|
+
//#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
|
|
43856
|
+
var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
43857
|
+
var getTaxProfile = get(({ businessId }) => {
|
|
43858
|
+
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
43859
|
+
});
|
|
43860
|
+
function buildKey$17({ access_token: accessToken, apiUrl, businessId }) {
|
|
43861
|
+
if (accessToken && apiUrl) return {
|
|
43862
|
+
accessToken,
|
|
43863
|
+
apiUrl,
|
|
43864
|
+
businessId,
|
|
43865
|
+
tags: [TAX_PROFILE_TAG_KEY]
|
|
43866
|
+
};
|
|
43867
|
+
}
|
|
43868
|
+
function useTaxProfile() {
|
|
43869
|
+
const withLocale = useLocalizedKey();
|
|
43870
|
+
const { data: auth } = useAuth();
|
|
43871
|
+
const { businessId } = useLayerContext();
|
|
43872
|
+
return new SWRQueryResult(useSWR(() => withLocale(buildKey$17(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
43873
|
+
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
43874
|
+
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
43875
|
+
});
|
|
43876
|
+
return function(_x) {
|
|
43877
|
+
return _ref.apply(this, arguments);
|
|
43878
|
+
};
|
|
43879
|
+
}()));
|
|
43880
|
+
}
|
|
43881
|
+
function useTaxProfileGlobalCacheActions() {
|
|
43882
|
+
const { patchCache } = useGlobalCacheActions();
|
|
43883
|
+
return { patchTaxProfile: useCallback((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
|
|
43884
|
+
}
|
|
43885
|
+
//#endregion
|
|
43886
|
+
//#region src/components/SolopreneurOnboardingBanner/SolopreneurOnboardingBanner.tsx
|
|
43887
|
+
var OnboardingBannerState = /* @__PURE__ */ function(OnboardingBannerState) {
|
|
43888
|
+
OnboardingBannerState["Loading"] = "Loading";
|
|
43889
|
+
OnboardingBannerState["NoBankAccountsLinked"] = "NoBankAccountsLinked";
|
|
43890
|
+
OnboardingBannerState["NoTaxProfile"] = "NoTaxProfile";
|
|
43891
|
+
OnboardingBannerState["Onboarded"] = "Onboarded";
|
|
43892
|
+
return OnboardingBannerState;
|
|
43893
|
+
}(OnboardingBannerState || {});
|
|
43894
|
+
var getOnboardingBannerState = ({ isLoading, hasLinkedAccounts, hasSavedTaxProfile }) => {
|
|
43895
|
+
if (isLoading) return OnboardingBannerState.Loading;
|
|
43896
|
+
if (!hasLinkedAccounts) return OnboardingBannerState.NoBankAccountsLinked;
|
|
43897
|
+
if (!hasSavedTaxProfile) return OnboardingBannerState.NoTaxProfile;
|
|
43898
|
+
return OnboardingBannerState.Onboarded;
|
|
43899
|
+
};
|
|
43900
|
+
var NoBankAccountsLinkedBanner = () => {
|
|
43901
|
+
const { addConnection } = useContext(LinkedAccountsContext);
|
|
43902
|
+
const { isMobile } = useSizeClass();
|
|
43903
|
+
const handleLinkBankAccounts = useCallback(() => {
|
|
43904
|
+
addConnection("PLAID");
|
|
43905
|
+
}, [addConnection]);
|
|
43906
|
+
return /* @__PURE__ */ jsx(Banner, {
|
|
43907
|
+
title: "Link your bank accounts",
|
|
43908
|
+
description: "Linking your bank accounts allows us to load your bank transactions and automatically categorize them.",
|
|
43909
|
+
slots: {
|
|
43910
|
+
Icon: isMobile ? null : /* @__PURE__ */ jsx(Info, { size: 16 }),
|
|
43911
|
+
Button: /* @__PURE__ */ jsx(Button$1, {
|
|
43912
|
+
onPress: handleLinkBankAccounts,
|
|
43913
|
+
variant: "outlined-light",
|
|
43914
|
+
children: "Link your bank accounts"
|
|
43915
|
+
})
|
|
43916
|
+
}
|
|
43917
|
+
});
|
|
43918
|
+
};
|
|
43919
|
+
var NoTaxProfileBanner = ({ onSetupTaxProfile }) => {
|
|
43920
|
+
const { isMobile } = useSizeClass();
|
|
43921
|
+
return /* @__PURE__ */ jsx(Banner, {
|
|
43922
|
+
title: "Set up your tax profile",
|
|
43923
|
+
description: "Configuring your tax profile allows us to provide you with tax estimates and avoid any surprises come tax time.",
|
|
43924
|
+
slots: {
|
|
43925
|
+
Icon: isMobile ? null : /* @__PURE__ */ jsx(Info, { size: 16 }),
|
|
43926
|
+
Button: onSetupTaxProfile ? /* @__PURE__ */ jsx(Button$1, {
|
|
43927
|
+
onPress: onSetupTaxProfile,
|
|
43928
|
+
variant: "outlined-light",
|
|
43929
|
+
children: "Setup your tax profile"
|
|
43930
|
+
}) : null
|
|
43931
|
+
}
|
|
43932
|
+
});
|
|
43933
|
+
};
|
|
43934
|
+
function SolopreneurOnboardingBannerInternal({ onSetupTaxProfile }) {
|
|
43935
|
+
const state = useSolopreneurOnboardingBannerState();
|
|
43936
|
+
if (state === OnboardingBannerState.Loading || state === OnboardingBannerState.Onboarded) return null;
|
|
43937
|
+
return /* @__PURE__ */ jsxs(HStack, {
|
|
43938
|
+
className: "Layer__SolopreneurLayout__OnboardingBanner",
|
|
43939
|
+
children: [state === OnboardingBannerState.NoBankAccountsLinked && /* @__PURE__ */ jsx(NoBankAccountsLinkedBanner, {}), state === OnboardingBannerState.NoTaxProfile && /* @__PURE__ */ jsx(NoTaxProfileBanner, { onSetupTaxProfile })]
|
|
43940
|
+
});
|
|
43941
|
+
}
|
|
43942
|
+
function SolopreneurOnboardingBanner({ onSetupTaxProfile }) {
|
|
43943
|
+
return /* @__PURE__ */ jsx(LinkedAccountsProvider, { children: /* @__PURE__ */ jsx(SolopreneurOnboardingBannerInternal, { onSetupTaxProfile }) });
|
|
43944
|
+
}
|
|
43945
|
+
var useSolopreneurOnboardingBannerState = () => {
|
|
43946
|
+
const { data: linkedAccounts, isLoading: isLinkedAccountsLoading, loadingStatus: linkedAccountsLoadingStatus } = useContext(LinkedAccountsContext);
|
|
43947
|
+
const { data: taxProfile, isLoading: isTaxProfileLoading } = useTaxProfile();
|
|
43948
|
+
return getOnboardingBannerState({
|
|
43949
|
+
isLoading: isLinkedAccountsLoading || isTaxProfileLoading || linkedAccountsLoadingStatus === "loading" || linkedAccountsLoadingStatus === "initial",
|
|
43950
|
+
hasLinkedAccounts: Array.isArray(linkedAccounts) && linkedAccounts.length > 0,
|
|
43951
|
+
hasSavedTaxProfile: (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true
|
|
43746
43952
|
});
|
|
43747
43953
|
};
|
|
43748
43954
|
//#endregion
|
|
@@ -43875,11 +44081,18 @@ var CHART_MARGIN$1 = {
|
|
|
43875
44081
|
};
|
|
43876
44082
|
var CHART_BORDER_RADIUS$1 = 8;
|
|
43877
44083
|
var Y_AXIS_CATEGORY_KEY = "__layer_hbar_category";
|
|
44084
|
+
var SMALL_SEGMENT_THRESHOLD = .25;
|
|
44085
|
+
function determineLabelMode(requestedLabelMode, positiveItems, legendDenominator) {
|
|
44086
|
+
if (legendDenominator <= 0) return LegendLayout.Table;
|
|
44087
|
+
if (positiveItems.some((item) => item.value / legendDenominator < SMALL_SEGMENT_THRESHOLD)) return LegendLayout.Table;
|
|
44088
|
+
return requestedLabelMode;
|
|
44089
|
+
}
|
|
43878
44090
|
var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true, labelMode = LegendLayout.Table, slots }) => {
|
|
43879
44091
|
const { data: items, total } = data;
|
|
43880
44092
|
const positiveItems = useMemo(() => items.filter((item) => item.value > 0), [items]);
|
|
43881
44093
|
const positiveTotal = positiveItems.reduce((sum, item) => sum + item.value, 0);
|
|
43882
44094
|
const legendDenominator = positiveTotal > 0 ? positiveTotal : total;
|
|
44095
|
+
const effectiveLabelMode = determineLabelMode(labelMode, positiveItems, legendDenominator);
|
|
43883
44096
|
const chartData = useMemo(() => {
|
|
43884
44097
|
return [positiveItems.reduce((acc, item) => {
|
|
43885
44098
|
acc[item.name] = item.value;
|
|
@@ -43892,7 +44105,7 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
|
|
|
43892
44105
|
total: legendDenominator,
|
|
43893
44106
|
colorSelector: stylingProps.colorSelector,
|
|
43894
44107
|
formatValue,
|
|
43895
|
-
layout:
|
|
44108
|
+
layout: effectiveLabelMode
|
|
43896
44109
|
});
|
|
43897
44110
|
return /* @__PURE__ */ jsxs(VStack, {
|
|
43898
44111
|
className: "Layer__HorizontalBarChart Layer__UI__Chart--focusReset",
|
|
@@ -43987,7 +44200,7 @@ var getTaxSummary = get(({ businessId, year, reportingBasis, fullYearProjection
|
|
|
43987
44200
|
full_year_projection: fullYearProjection
|
|
43988
44201
|
})}`;
|
|
43989
44202
|
});
|
|
43990
|
-
function buildKey$
|
|
44203
|
+
function buildKey$16({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection, enabled = true }) {
|
|
43991
44204
|
if (!enabled) return;
|
|
43992
44205
|
if (accessToken && apiUrl) return {
|
|
43993
44206
|
accessToken,
|
|
@@ -44003,7 +44216,7 @@ function useTaxSummary({ year, reportingBasis, fullYearProjection, enabled = tru
|
|
|
44003
44216
|
const withLocale = useLocalizedKey();
|
|
44004
44217
|
const { data: auth } = useAuth();
|
|
44005
44218
|
const { businessId } = useLayerContext();
|
|
44006
|
-
return new SWRQueryResult(useSWR(() => withLocale(buildKey$
|
|
44219
|
+
return new SWRQueryResult(useSWR(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
44007
44220
|
businessId,
|
|
44008
44221
|
year,
|
|
44009
44222
|
reportingBasis,
|
|
@@ -44215,10 +44428,10 @@ function allTaxSectionsAreEmpty(summary) {
|
|
|
44215
44428
|
function TaxEstimatesSummaryCardEmpty() {
|
|
44216
44429
|
const { t } = useTranslation();
|
|
44217
44430
|
return /* @__PURE__ */ jsx(DataState, {
|
|
44431
|
+
className: "Layer__TaxEstimatesSummaryCard--empty",
|
|
44218
44432
|
status: DataStateStatus.info,
|
|
44219
44433
|
title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
|
|
44220
|
-
description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
|
|
44221
|
-
spacing: true
|
|
44434
|
+
description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
|
|
44222
44435
|
});
|
|
44223
44436
|
}
|
|
44224
44437
|
var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
|
|
@@ -44283,11 +44496,9 @@ var PieChartContent = ({ data, commonProps, layout }) => {
|
|
|
44283
44496
|
children: [/* @__PURE__ */ jsx(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ jsx(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
|
|
44284
44497
|
});
|
|
44285
44498
|
};
|
|
44286
|
-
var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart,
|
|
44499
|
+
var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, interactionProps, stringOverrides } = {}) => {
|
|
44287
44500
|
const { detailData, layout, title: defaultTitle, isLoading, isError } = useTaxEstimatesSummaryCard();
|
|
44288
|
-
const { isDesktop } = useSizeClass();
|
|
44289
44501
|
const isSummaryCardLayout = layout === "summaryCard";
|
|
44290
|
-
const title = titleOverride !== null && titleOverride !== void 0 ? titleOverride : defaultTitle;
|
|
44291
44502
|
const commonProps = useMemo(() => {
|
|
44292
44503
|
var _detailData$data;
|
|
44293
44504
|
const colorByKey = detailData === null || detailData === void 0 || (_detailData$data = detailData.data) === null || _detailData$data === void 0 ? void 0 : _detailData$data.reduce((acc, item) => {
|
|
@@ -44305,82 +44516,69 @@ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, ti
|
|
|
44305
44516
|
} }
|
|
44306
44517
|
};
|
|
44307
44518
|
}, [detailData === null || detailData === void 0 ? void 0 : detailData.data]);
|
|
44308
|
-
|
|
44309
|
-
|
|
44310
|
-
|
|
44311
|
-
|
|
44312
|
-
|
|
44313
|
-
|
|
44314
|
-
|
|
44315
|
-
|
|
44316
|
-
|
|
44317
|
-
|
|
44318
|
-
|
|
44319
|
-
|
|
44320
|
-
|
|
44321
|
-
|
|
44322
|
-
|
|
44323
|
-
|
|
44324
|
-
|
|
44325
|
-
|
|
44326
|
-
|
|
44327
|
-
isError,
|
|
44328
|
-
Loading: /* @__PURE__ */ jsx(LoadingState$1, { mode }),
|
|
44329
|
-
Error: /* @__PURE__ */ jsx(ErrorState$2, {}),
|
|
44330
|
-
children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ jsx(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ jsx(Content, {
|
|
44331
|
-
data,
|
|
44332
|
-
mode,
|
|
44333
|
-
commonProps,
|
|
44334
|
-
layout
|
|
44335
|
-
})
|
|
44336
|
-
})]
|
|
44519
|
+
const slots = useSummaryCardSlots({
|
|
44520
|
+
defaultTitle,
|
|
44521
|
+
interactionProps,
|
|
44522
|
+
stringOverrides
|
|
44523
|
+
});
|
|
44524
|
+
return /* @__PURE__ */ jsx(SummaryCard, {
|
|
44525
|
+
className: classNames("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
|
|
44526
|
+
slots,
|
|
44527
|
+
children: /* @__PURE__ */ jsx(ConditionalBlock, {
|
|
44528
|
+
data: detailData,
|
|
44529
|
+
isLoading,
|
|
44530
|
+
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, {
|
|
44534
|
+
data,
|
|
44535
|
+
mode,
|
|
44536
|
+
commonProps,
|
|
44537
|
+
layout
|
|
44337
44538
|
})
|
|
44338
44539
|
})
|
|
44339
44540
|
});
|
|
44340
44541
|
};
|
|
44341
44542
|
//#endregion
|
|
44342
44543
|
//#region src/views/SolopreneurOverview/SolopreneurOverview.tsx
|
|
44343
|
-
var SolopreneurOverview = ({
|
|
44344
|
-
var
|
|
44544
|
+
var SolopreneurOverview = ({ interactionProps, chartColorsList, stringOverrides }) => {
|
|
44545
|
+
var _interactionProps$ban, _interactionProps$pro, _stringOverrides$summ, _interactionProps$sum, _stringOverrides$summ2, _interactionProps$sum2, _stringOverrides$summ3, _interactionProps$sum3, _interactionProps$sum4, _stringOverrides$summ4;
|
|
44345
44546
|
const { t } = useTranslation();
|
|
44346
44547
|
const { value: sizeClass } = useSizeClass();
|
|
44347
|
-
const profitAndLossSummariesVariants = slotProps === null || slotProps === void 0 || (_slotProps$profitAndL = slotProps.profitAndLoss) === null || _slotProps$profitAndL === void 0 || (_slotProps$profitAndL = _slotProps$profitAndL.summaries) === null || _slotProps$profitAndL === void 0 ? void 0 : _slotProps$profitAndL.variants;
|
|
44348
44548
|
return /* @__PURE__ */ jsx(ProfitAndLoss, {
|
|
44349
44549
|
asContainer: false,
|
|
44350
|
-
tagFilter: tagFilter ? {
|
|
44351
|
-
key: tagFilter.tagKey,
|
|
44352
|
-
values: tagFilter.tagValues
|
|
44353
|
-
} : void 0,
|
|
44354
44550
|
children: /* @__PURE__ */ jsxs(View, {
|
|
44355
44551
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || t("common:label.overview", "Overview"),
|
|
44356
|
-
showHeader:
|
|
44552
|
+
showHeader: true,
|
|
44357
44553
|
header: /* @__PURE__ */ jsx(Header$2, { children: /* @__PURE__ */ jsx(HeaderRow, { children: /* @__PURE__ */ jsx(HeaderCol, { children: /* @__PURE__ */ jsx(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
|
|
44358
44554
|
children: [
|
|
44359
|
-
|
|
44360
|
-
onTransactionsToReviewClick,
|
|
44361
|
-
onboardingStepOverride
|
|
44362
|
-
}),
|
|
44555
|
+
/* @__PURE__ */ jsx(SolopreneurOnboardingBanner, { onSetupTaxProfile: interactionProps === null || interactionProps === void 0 || (_interactionProps$ban = interactionProps.banner) === null || _interactionProps$ban === void 0 ? void 0 : _interactionProps$ban.onSetupTaxProfile }),
|
|
44363
44556
|
/* @__PURE__ */ jsx(ProfitAndLossSummaries, {
|
|
44364
44557
|
stringOverrides: stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.profitAndLossSummaries,
|
|
44365
44558
|
chartColorsList,
|
|
44366
|
-
onTransactionsToReviewClick
|
|
44367
|
-
variants: profitAndLossSummariesVariants
|
|
44559
|
+
onTransactionsToReviewClick: interactionProps === null || interactionProps === void 0 || (_interactionProps$pro = interactionProps.profitAndLossSummaries) === null || _interactionProps$pro === void 0 ? void 0 : _interactionProps$pro.onTransactionsToReviewClick
|
|
44368
44560
|
}),
|
|
44369
|
-
middleBanner,
|
|
44370
44561
|
/* @__PURE__ */ jsxs("div", {
|
|
44371
44562
|
className: "Layer__SolopreneurOverview__Grid",
|
|
44372
44563
|
children: [
|
|
44373
|
-
/* @__PURE__ */ jsx(ProfitAndLossSummaryCard, {
|
|
44564
|
+
/* @__PURE__ */ jsx(ProfitAndLossSummaryCard, {
|
|
44565
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ = stringOverrides.summaryCards) === null || _stringOverrides$summ === void 0 ? void 0 : _stringOverrides$summ.profitAndLoss,
|
|
44566
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum = interactionProps.summaryCards) === null || _interactionProps$sum === void 0 ? void 0 : _interactionProps$sum.profitAndLoss
|
|
44567
|
+
}),
|
|
44374
44568
|
/* @__PURE__ */ jsx(ExpensesSummaryCard, {
|
|
44375
44569
|
stylingProps: { chartColorsList },
|
|
44376
|
-
stringOverrides:
|
|
44570
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ2 = stringOverrides.summaryCards) === null || _stringOverrides$summ2 === void 0 ? void 0 : _stringOverrides$summ2.expenses,
|
|
44571
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum2 = interactionProps.summaryCards) === null || _interactionProps$sum2 === void 0 ? void 0 : _interactionProps$sum2.expenses
|
|
44377
44572
|
}),
|
|
44378
44573
|
/* @__PURE__ */ jsx(TaxEstimatesSummaryCard, {
|
|
44379
44574
|
mode: TaxEstimatesSummaryCardMode.HorizontalBarChart,
|
|
44380
|
-
|
|
44381
|
-
|
|
44575
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ3 = stringOverrides.summaryCards) === null || _stringOverrides$summ3 === void 0 ? void 0 : _stringOverrides$summ3.taxEstimates,
|
|
44576
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum3 = interactionProps.summaryCards) === null || _interactionProps$sum3 === void 0 ? void 0 : _interactionProps$sum3.taxEstimates
|
|
44382
44577
|
}),
|
|
44383
|
-
/* @__PURE__ */ jsx(MileageTrackingSummary,
|
|
44578
|
+
/* @__PURE__ */ jsx(MileageTrackingSummary, {
|
|
44579
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum4 = interactionProps.summaryCards) === null || _interactionProps$sum4 === void 0 ? void 0 : _interactionProps$sum4.mileageTracking,
|
|
44580
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ4 = stringOverrides.summaryCards) === null || _stringOverrides$summ4 === void 0 ? void 0 : _stringOverrides$summ4.mileageTracking
|
|
44581
|
+
})
|
|
44384
44582
|
]
|
|
44385
44583
|
})
|
|
44386
44584
|
]
|
|
@@ -44388,148 +44586,6 @@ var SolopreneurOverview = ({ showTitle = true, enableOnboarding = false, onboard
|
|
|
44388
44586
|
});
|
|
44389
44587
|
};
|
|
44390
44588
|
//#endregion
|
|
44391
|
-
//#region src/types/location.ts
|
|
44392
|
-
var US_STATES_CONFIG = [
|
|
44393
|
-
_objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
|
|
44394
|
-
_objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
|
|
44395
|
-
_objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
|
|
44396
|
-
_objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
|
|
44397
|
-
_objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
|
|
44398
|
-
_objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
|
|
44399
|
-
_objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
|
|
44400
|
-
_objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
|
|
44401
|
-
_objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
|
|
44402
|
-
_objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
|
|
44403
|
-
_objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
|
|
44404
|
-
_objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
|
|
44405
|
-
_objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
|
|
44406
|
-
_objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
|
|
44407
|
-
_objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
|
|
44408
|
-
_objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
|
|
44409
|
-
_objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
|
|
44410
|
-
_objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
|
|
44411
|
-
_objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
|
|
44412
|
-
_objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
|
|
44413
|
-
_objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
|
|
44414
|
-
_objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
|
|
44415
|
-
_objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
|
|
44416
|
-
_objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
|
|
44417
|
-
_objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
|
|
44418
|
-
_objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
|
|
44419
|
-
_objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
|
|
44420
|
-
_objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
|
|
44421
|
-
_objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
|
|
44422
|
-
_objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
|
|
44423
|
-
_objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
|
|
44424
|
-
_objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
|
|
44425
|
-
_objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
|
|
44426
|
-
_objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
|
|
44427
|
-
_objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
|
|
44428
|
-
_objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
|
|
44429
|
-
_objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
|
|
44430
|
-
_objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
|
|
44431
|
-
_objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
|
|
44432
|
-
_objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
|
|
44433
|
-
_objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
|
|
44434
|
-
_objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
|
|
44435
|
-
_objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
|
|
44436
|
-
_objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
|
|
44437
|
-
_objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
|
|
44438
|
-
_objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
|
|
44439
|
-
_objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
|
|
44440
|
-
_objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
|
|
44441
|
-
_objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
|
|
44442
|
-
_objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
|
|
44443
|
-
_objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
|
|
44444
|
-
_objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
|
|
44445
|
-
];
|
|
44446
|
-
var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
|
|
44447
|
-
//#endregion
|
|
44448
|
-
//#region src/schemas/taxEstimates/filingStatus.ts
|
|
44449
|
-
var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
|
|
44450
|
-
FilingStatus["SINGLE"] = "SINGLE";
|
|
44451
|
-
FilingStatus["MARRIED"] = "MARRIED";
|
|
44452
|
-
FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
|
|
44453
|
-
FilingStatus["HEAD"] = "HEAD";
|
|
44454
|
-
FilingStatus["WIDOWER"] = "WIDOWER";
|
|
44455
|
-
return FilingStatus;
|
|
44456
|
-
}({});
|
|
44457
|
-
var FilingStatusSchema = Schema.Enums(FilingStatus);
|
|
44458
|
-
//#endregion
|
|
44459
|
-
//#region src/schemas/taxEstimates/profile.ts
|
|
44460
|
-
var USStateCodeSchema = Schema.Literal(...US_STATE_VALUES);
|
|
44461
|
-
var WithholdingSchema = Schema.Struct({
|
|
44462
|
-
useCustomWithholding: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_custom_withholding")),
|
|
44463
|
-
amount: Schema.NullishOr(Schema.Number)
|
|
44464
|
-
});
|
|
44465
|
-
var HomeOfficeDeductionSchema = Schema.Struct({
|
|
44466
|
-
useHomeOfficeDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_home_office_deduction")),
|
|
44467
|
-
homeOfficeArea: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("home_office_area"))
|
|
44468
|
-
});
|
|
44469
|
-
var VehicleDeductionSchema = Schema.Struct({ useMileageDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_mileage_deduction")) });
|
|
44470
|
-
var DeductionsSchema = Schema.Struct({
|
|
44471
|
-
homeOffice: pipe(Schema.propertySignature(Schema.NullishOr(HomeOfficeDeductionSchema)), Schema.fromKey("home_office")),
|
|
44472
|
-
vehicle: Schema.NullishOr(VehicleDeductionSchema)
|
|
44473
|
-
});
|
|
44474
|
-
var FederalConfigurationSchema = Schema.Struct({
|
|
44475
|
-
filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
|
|
44476
|
-
annualW2Income: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("annual_w2_income")),
|
|
44477
|
-
tipIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("tip_income")),
|
|
44478
|
-
overtimeIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("overtime_income")),
|
|
44479
|
-
withholding: Schema.NullishOr(WithholdingSchema)
|
|
44480
|
-
});
|
|
44481
|
-
var StateConfigurationSchema = Schema.Struct({
|
|
44482
|
-
taxState: pipe(Schema.propertySignature(Schema.NullishOr(USStateCodeSchema)), Schema.fromKey("tax_state")),
|
|
44483
|
-
filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
|
|
44484
|
-
withholding: Schema.NullishOr(WithholdingSchema)
|
|
44485
|
-
});
|
|
44486
|
-
var UsConfigurationSchema = Schema.Struct({
|
|
44487
|
-
federal: Schema.NullishOr(FederalConfigurationSchema),
|
|
44488
|
-
state: Schema.NullishOr(StateConfigurationSchema),
|
|
44489
|
-
deductions: pipe(Schema.propertySignature(Schema.NullishOr(DeductionsSchema)), Schema.fromKey("deductions"))
|
|
44490
|
-
});
|
|
44491
|
-
var TaxProfileSchema = Schema.Struct({
|
|
44492
|
-
taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
|
|
44493
|
-
usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration")),
|
|
44494
|
-
userHasSavedTaxProfile: pipe(Schema.propertySignature(Schema.Boolean), Schema.fromKey("user_has_saved_tax_profile"))
|
|
44495
|
-
});
|
|
44496
|
-
var TaxProfileResponseSchema = Schema.Struct({ data: TaxProfileSchema });
|
|
44497
|
-
var TaxProfileRequestSchema = Schema.Struct({
|
|
44498
|
-
taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
|
|
44499
|
-
usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration"))
|
|
44500
|
-
});
|
|
44501
|
-
//#endregion
|
|
44502
|
-
//#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
|
|
44503
|
-
var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
44504
|
-
var getTaxProfile = get(({ businessId }) => {
|
|
44505
|
-
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
44506
|
-
});
|
|
44507
|
-
function buildKey$16({ access_token: accessToken, apiUrl, businessId }) {
|
|
44508
|
-
if (accessToken && apiUrl) return {
|
|
44509
|
-
accessToken,
|
|
44510
|
-
apiUrl,
|
|
44511
|
-
businessId,
|
|
44512
|
-
tags: [TAX_PROFILE_TAG_KEY]
|
|
44513
|
-
};
|
|
44514
|
-
}
|
|
44515
|
-
function useTaxProfile() {
|
|
44516
|
-
const withLocale = useLocalizedKey();
|
|
44517
|
-
const { data: auth } = useAuth();
|
|
44518
|
-
const { businessId } = useLayerContext();
|
|
44519
|
-
return new SWRQueryResult(useSWR(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
44520
|
-
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
44521
|
-
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
44522
|
-
});
|
|
44523
|
-
return function(_x) {
|
|
44524
|
-
return _ref.apply(this, arguments);
|
|
44525
|
-
};
|
|
44526
|
-
}()));
|
|
44527
|
-
}
|
|
44528
|
-
function useTaxProfileGlobalCacheActions() {
|
|
44529
|
-
const { patchCache } = useGlobalCacheActions();
|
|
44530
|
-
return { patchTaxProfile: useCallback((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
|
|
44531
|
-
}
|
|
44532
|
-
//#endregion
|
|
44533
44589
|
//#region src/hooks/features/taxEstimates/useTaxEstimatesOnboardingStatus.ts
|
|
44534
44590
|
var OnboardingStatus = /* @__PURE__ */ function(OnboardingStatus) {
|
|
44535
44591
|
OnboardingStatus["Loading"] = "Loading";
|