@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/cjs/index.cjs
CHANGED
|
@@ -278,7 +278,7 @@ var getIntlLocale = (locale) => {
|
|
|
278
278
|
};
|
|
279
279
|
var package_default = {
|
|
280
280
|
name: "@layerfi/components",
|
|
281
|
-
version: "0.1.132-alpha.
|
|
281
|
+
version: "0.1.132-alpha.2",
|
|
282
282
|
description: "Layer React Components",
|
|
283
283
|
main: "dist/cjs/index.cjs",
|
|
284
284
|
module: "dist/esm/index.mjs",
|
|
@@ -46866,10 +46866,7 @@ var SummaryCard = ({ slots, children, className }) => {
|
|
|
46866
46866
|
children: [legend && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46867
46867
|
className: "Layer__SummaryCard__HeaderLegend",
|
|
46868
46868
|
children: legend
|
|
46869
|
-
}), primaryAction
|
|
46870
|
-
className: "Layer__SummaryCard__HeaderPrimaryAction",
|
|
46871
|
-
children: primaryAction
|
|
46872
|
-
})]
|
|
46869
|
+
}), primaryAction]
|
|
46873
46870
|
})]
|
|
46874
46871
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46875
46872
|
className: "Layer__SummaryCard__Content",
|
|
@@ -46952,88 +46949,89 @@ var ExpensesSummaryCard = ({ stylingProps, interactionProps, stringOverrides, cl
|
|
|
46952
46949
|
};
|
|
46953
46950
|
//#endregion
|
|
46954
46951
|
//#region src/components/MileageTrackingSummary/MileageTrackingSummary.tsx
|
|
46955
|
-
var
|
|
46952
|
+
var Content$1 = () => {
|
|
46956
46953
|
const { t } = (0, react_i18next.useTranslation)();
|
|
46957
46954
|
const { formatDate } = useIntlFormatter();
|
|
46958
46955
|
const { data, selectedYear, selectedYearData, chartData, isLoading, isError } = useMileageTrackingYearlySummary();
|
|
46959
46956
|
const { isDesktop, isMobile } = useSizeClass();
|
|
46960
46957
|
const inYearLabel = t("mileageTracking:label.in_year", "In {{year}}", { year: formatDate(new Date(selectedYear, 0, 1), DateFormat.Year) });
|
|
46961
|
-
const title = headerOverride !== null && headerOverride !== void 0 ? headerOverride : t("mileageTracking:label.mileage_tracking", "Mileage Tracking");
|
|
46962
46958
|
const statsProps = isDesktop ? { direction: "column" } : isMobile ? { direction: "column" } : { direction: "row" };
|
|
46963
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
46964
|
-
|
|
46965
|
-
|
|
46966
|
-
|
|
46967
|
-
|
|
46968
|
-
|
|
46969
|
-
|
|
46970
|
-
|
|
46971
|
-
|
|
46972
|
-
|
|
46973
|
-
|
|
46974
|
-
|
|
46975
|
-
|
|
46976
|
-
|
|
46959
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
46960
|
+
data,
|
|
46961
|
+
isLoading,
|
|
46962
|
+
isError,
|
|
46963
|
+
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
46964
|
+
className: "Layer__MileageTrackingSummary__Content",
|
|
46965
|
+
gap: "lg",
|
|
46966
|
+
justify: "center",
|
|
46967
|
+
align: "center",
|
|
46968
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader, {})
|
|
46969
|
+
}),
|
|
46970
|
+
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
46971
|
+
status: DataStateStatus.failed,
|
|
46972
|
+
title: t("mileageTracking:error.load_mileage_summary_data", "Failed to load mileage summary data"),
|
|
46973
|
+
spacing: true
|
|
46974
|
+
}),
|
|
46975
|
+
children: () => {
|
|
46976
|
+
var _selectedYearData$est, _selectedYearData$mil, _selectedYearData$tri;
|
|
46977
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
|
|
46977
46978
|
className: "Layer__MileageTrackingSummary__Content",
|
|
46979
|
+
direction: isDesktop ? "row" : "column",
|
|
46978
46980
|
gap: "lg",
|
|
46979
|
-
|
|
46980
|
-
|
|
46981
|
-
|
|
46982
|
-
|
|
46983
|
-
|
|
46984
|
-
|
|
46985
|
-
|
|
46986
|
-
|
|
46987
|
-
|
|
46988
|
-
|
|
46989
|
-
|
|
46990
|
-
|
|
46991
|
-
|
|
46992
|
-
|
|
46993
|
-
|
|
46994
|
-
|
|
46995
|
-
|
|
46996
|
-
|
|
46997
|
-
|
|
46998
|
-
|
|
46999
|
-
|
|
47000
|
-
|
|
47001
|
-
|
|
47002
|
-
|
|
47003
|
-
|
|
47004
|
-
|
|
47005
|
-
|
|
47006
|
-
}),
|
|
47007
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47008
|
-
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
47009
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
47010
|
-
title: t("mileageTracking:label.total_miles", "Total Miles"),
|
|
47011
|
-
amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
|
|
47012
|
-
description: inYearLabel
|
|
47013
|
-
})
|
|
47014
|
-
}),
|
|
47015
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47016
|
-
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
47017
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
47018
|
-
title: t("trips:label.trips", "Trips"),
|
|
47019
|
-
amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
|
|
47020
|
-
description: inYearLabel
|
|
47021
|
-
})
|
|
46981
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, _objectSpread2(_objectSpread2({}, statsProps), {}, {
|
|
46982
|
+
className: "Layer__MileageTrackingSummary__Cards",
|
|
46983
|
+
gap: "md",
|
|
46984
|
+
children: [
|
|
46985
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46986
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
46987
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
46988
|
+
title: t("mileageTracking:label.total_deduction", "Total Deduction"),
|
|
46989
|
+
amount: (_selectedYearData$est = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.estimatedDeduction) !== null && _selectedYearData$est !== void 0 ? _selectedYearData$est : 0,
|
|
46990
|
+
formatAsMoney: true,
|
|
46991
|
+
description: inYearLabel
|
|
46992
|
+
})
|
|
46993
|
+
}),
|
|
46994
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46995
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
46996
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
46997
|
+
title: t("mileageTracking:label.total_miles", "Total Miles"),
|
|
46998
|
+
amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
|
|
46999
|
+
description: inYearLabel
|
|
47000
|
+
})
|
|
47001
|
+
}),
|
|
47002
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47003
|
+
className: "Layer__MileageTrackingSummary__StatCardSlot",
|
|
47004
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingStatsCard, {
|
|
47005
|
+
title: t("trips:label.trips", "Trips"),
|
|
47006
|
+
amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
|
|
47007
|
+
description: inYearLabel
|
|
47022
47008
|
})
|
|
47023
|
-
]
|
|
47024
|
-
})), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
47025
|
-
className: "Layer__MileageTrackingSummary__Chart",
|
|
47026
|
-
fluid: true,
|
|
47027
|
-
justify: "end",
|
|
47028
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageDeductionChart, {
|
|
47029
|
-
data: chartData,
|
|
47030
|
-
selectedYear,
|
|
47031
|
-
chartHeight: isDesktop ? 250 : 200
|
|
47032
47009
|
})
|
|
47033
|
-
|
|
47034
|
-
})
|
|
47035
|
-
|
|
47036
|
-
|
|
47010
|
+
]
|
|
47011
|
+
})), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
47012
|
+
className: "Layer__MileageTrackingSummary__Chart",
|
|
47013
|
+
fluid: true,
|
|
47014
|
+
justify: "end",
|
|
47015
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageDeductionChart, {
|
|
47016
|
+
data: chartData,
|
|
47017
|
+
selectedYear,
|
|
47018
|
+
chartHeight: isDesktop ? 250 : 200
|
|
47019
|
+
})
|
|
47020
|
+
})]
|
|
47021
|
+
});
|
|
47022
|
+
}
|
|
47023
|
+
});
|
|
47024
|
+
};
|
|
47025
|
+
var MileageTrackingSummary = ({ stringOverrides, interactionProps } = {}) => {
|
|
47026
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
47027
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryCard, {
|
|
47028
|
+
className: "Layer__MileageTrackingSummary",
|
|
47029
|
+
slots: useSummaryCardSlots({
|
|
47030
|
+
defaultTitle: t("mileageTracking:label.mileage_tracking", "Mileage Tracking"),
|
|
47031
|
+
interactionProps,
|
|
47032
|
+
stringOverrides
|
|
47033
|
+
}),
|
|
47034
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content$1, {})
|
|
47037
47035
|
});
|
|
47038
47036
|
};
|
|
47039
47037
|
//#endregion
|
|
@@ -47092,16 +47090,224 @@ var ProfitAndLossSummaryCard = ({ interactionProps, stringOverrides, className }
|
|
|
47092
47090
|
interactionProps,
|
|
47093
47091
|
stringOverrides
|
|
47094
47092
|
});
|
|
47095
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
47096
|
-
className: (0, classnames.default)("Layer__ProfitAndLossSummaryCard", className),
|
|
47093
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SummaryCard, {
|
|
47094
|
+
className: (0, classnames.default)("Layer__ProfitAndLossSummaryCard", "Layer__UI__Chart--focusReset", className),
|
|
47097
47095
|
slots,
|
|
47098
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
47099
|
-
|
|
47100
|
-
|
|
47101
|
-
|
|
47102
|
-
|
|
47103
|
-
|
|
47104
|
-
|
|
47096
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossChart, {
|
|
47097
|
+
tagFilter,
|
|
47098
|
+
hideLegend: true
|
|
47099
|
+
}), !isDesktop && legend]
|
|
47100
|
+
});
|
|
47101
|
+
};
|
|
47102
|
+
//#endregion
|
|
47103
|
+
//#region src/types/location.ts
|
|
47104
|
+
var US_STATES_CONFIG = [
|
|
47105
|
+
_objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
|
|
47106
|
+
_objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
|
|
47107
|
+
_objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
|
|
47108
|
+
_objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
|
|
47109
|
+
_objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
|
|
47110
|
+
_objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
|
|
47111
|
+
_objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
|
|
47112
|
+
_objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
|
|
47113
|
+
_objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
|
|
47114
|
+
_objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
|
|
47115
|
+
_objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
|
|
47116
|
+
_objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
|
|
47117
|
+
_objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
|
|
47118
|
+
_objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
|
|
47119
|
+
_objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
|
|
47120
|
+
_objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
|
|
47121
|
+
_objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
|
|
47122
|
+
_objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
|
|
47123
|
+
_objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
|
|
47124
|
+
_objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
|
|
47125
|
+
_objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
|
|
47126
|
+
_objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
|
|
47127
|
+
_objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
|
|
47128
|
+
_objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
|
|
47129
|
+
_objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
|
|
47130
|
+
_objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
|
|
47131
|
+
_objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
|
|
47132
|
+
_objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
|
|
47133
|
+
_objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
|
|
47134
|
+
_objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
|
|
47135
|
+
_objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
|
|
47136
|
+
_objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
|
|
47137
|
+
_objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
|
|
47138
|
+
_objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
|
|
47139
|
+
_objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
|
|
47140
|
+
_objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
|
|
47141
|
+
_objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
|
|
47142
|
+
_objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
|
|
47143
|
+
_objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
|
|
47144
|
+
_objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
|
|
47145
|
+
_objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
|
|
47146
|
+
_objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
|
|
47147
|
+
_objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
|
|
47148
|
+
_objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
|
|
47149
|
+
_objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
|
|
47150
|
+
_objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
|
|
47151
|
+
_objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
|
|
47152
|
+
_objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
|
|
47153
|
+
_objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
|
|
47154
|
+
_objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
|
|
47155
|
+
_objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
|
|
47156
|
+
_objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
|
|
47157
|
+
];
|
|
47158
|
+
var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
|
|
47159
|
+
//#endregion
|
|
47160
|
+
//#region src/schemas/taxEstimates/filingStatus.ts
|
|
47161
|
+
var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
|
|
47162
|
+
FilingStatus["SINGLE"] = "SINGLE";
|
|
47163
|
+
FilingStatus["MARRIED"] = "MARRIED";
|
|
47164
|
+
FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
|
|
47165
|
+
FilingStatus["HEAD"] = "HEAD";
|
|
47166
|
+
FilingStatus["WIDOWER"] = "WIDOWER";
|
|
47167
|
+
return FilingStatus;
|
|
47168
|
+
}({});
|
|
47169
|
+
var FilingStatusSchema = effect.Schema.Enums(FilingStatus);
|
|
47170
|
+
//#endregion
|
|
47171
|
+
//#region src/schemas/taxEstimates/profile.ts
|
|
47172
|
+
var USStateCodeSchema = effect.Schema.Literal(...US_STATE_VALUES);
|
|
47173
|
+
var WithholdingSchema = effect.Schema.Struct({
|
|
47174
|
+
useCustomWithholding: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_custom_withholding")),
|
|
47175
|
+
amount: effect.Schema.NullishOr(effect.Schema.Number)
|
|
47176
|
+
});
|
|
47177
|
+
var HomeOfficeDeductionSchema = effect.Schema.Struct({
|
|
47178
|
+
useHomeOfficeDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_home_office_deduction")),
|
|
47179
|
+
homeOfficeArea: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("home_office_area"))
|
|
47180
|
+
});
|
|
47181
|
+
var VehicleDeductionSchema = effect.Schema.Struct({ useMileageDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_mileage_deduction")) });
|
|
47182
|
+
var DeductionsSchema = effect.Schema.Struct({
|
|
47183
|
+
homeOffice: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(HomeOfficeDeductionSchema)), effect.Schema.fromKey("home_office")),
|
|
47184
|
+
vehicle: effect.Schema.NullishOr(VehicleDeductionSchema)
|
|
47185
|
+
});
|
|
47186
|
+
var FederalConfigurationSchema = effect.Schema.Struct({
|
|
47187
|
+
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47188
|
+
annualW2Income: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("annual_w2_income")),
|
|
47189
|
+
tipIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("tip_income")),
|
|
47190
|
+
overtimeIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("overtime_income")),
|
|
47191
|
+
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47192
|
+
});
|
|
47193
|
+
var StateConfigurationSchema = effect.Schema.Struct({
|
|
47194
|
+
taxState: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(USStateCodeSchema)), effect.Schema.fromKey("tax_state")),
|
|
47195
|
+
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47196
|
+
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47197
|
+
});
|
|
47198
|
+
var UsConfigurationSchema = effect.Schema.Struct({
|
|
47199
|
+
federal: effect.Schema.NullishOr(FederalConfigurationSchema),
|
|
47200
|
+
state: effect.Schema.NullishOr(StateConfigurationSchema),
|
|
47201
|
+
deductions: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(DeductionsSchema)), effect.Schema.fromKey("deductions"))
|
|
47202
|
+
});
|
|
47203
|
+
var TaxProfileSchema = effect.Schema.Struct({
|
|
47204
|
+
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47205
|
+
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration")),
|
|
47206
|
+
userHasSavedTaxProfile: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Boolean), effect.Schema.fromKey("user_has_saved_tax_profile"))
|
|
47207
|
+
});
|
|
47208
|
+
var TaxProfileResponseSchema = effect.Schema.Struct({ data: TaxProfileSchema });
|
|
47209
|
+
var TaxProfileRequestSchema = effect.Schema.Struct({
|
|
47210
|
+
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47211
|
+
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration"))
|
|
47212
|
+
});
|
|
47213
|
+
//#endregion
|
|
47214
|
+
//#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
|
|
47215
|
+
var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
47216
|
+
var getTaxProfile = get$1(({ businessId }) => {
|
|
47217
|
+
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
47218
|
+
});
|
|
47219
|
+
function buildKey$17({ access_token: accessToken, apiUrl, businessId }) {
|
|
47220
|
+
if (accessToken && apiUrl) return {
|
|
47221
|
+
accessToken,
|
|
47222
|
+
apiUrl,
|
|
47223
|
+
businessId,
|
|
47224
|
+
tags: [TAX_PROFILE_TAG_KEY]
|
|
47225
|
+
};
|
|
47226
|
+
}
|
|
47227
|
+
function useTaxProfile() {
|
|
47228
|
+
const withLocale = useLocalizedKey();
|
|
47229
|
+
const { data: auth } = useAuth();
|
|
47230
|
+
const { businessId } = useLayerContext();
|
|
47231
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$17(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
47232
|
+
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
47233
|
+
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
47234
|
+
});
|
|
47235
|
+
return function(_x) {
|
|
47236
|
+
return _ref.apply(this, arguments);
|
|
47237
|
+
};
|
|
47238
|
+
}()));
|
|
47239
|
+
}
|
|
47240
|
+
function useTaxProfileGlobalCacheActions() {
|
|
47241
|
+
const { patchCache } = useGlobalCacheActions();
|
|
47242
|
+
return { patchTaxProfile: (0, react.useCallback)((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
|
|
47243
|
+
}
|
|
47244
|
+
//#endregion
|
|
47245
|
+
//#region src/components/SolopreneurOnboardingBanner/SolopreneurOnboardingBanner.tsx
|
|
47246
|
+
var OnboardingBannerState = /* @__PURE__ */ function(OnboardingBannerState) {
|
|
47247
|
+
OnboardingBannerState["Loading"] = "Loading";
|
|
47248
|
+
OnboardingBannerState["NoBankAccountsLinked"] = "NoBankAccountsLinked";
|
|
47249
|
+
OnboardingBannerState["NoTaxProfile"] = "NoTaxProfile";
|
|
47250
|
+
OnboardingBannerState["Onboarded"] = "Onboarded";
|
|
47251
|
+
return OnboardingBannerState;
|
|
47252
|
+
}(OnboardingBannerState || {});
|
|
47253
|
+
var getOnboardingBannerState = ({ isLoading, hasLinkedAccounts, hasSavedTaxProfile }) => {
|
|
47254
|
+
if (isLoading) return OnboardingBannerState.Loading;
|
|
47255
|
+
if (!hasLinkedAccounts) return OnboardingBannerState.NoBankAccountsLinked;
|
|
47256
|
+
if (!hasSavedTaxProfile) return OnboardingBannerState.NoTaxProfile;
|
|
47257
|
+
return OnboardingBannerState.Onboarded;
|
|
47258
|
+
};
|
|
47259
|
+
var NoBankAccountsLinkedBanner = () => {
|
|
47260
|
+
const { addConnection } = (0, react.useContext)(LinkedAccountsContext);
|
|
47261
|
+
const { isMobile } = useSizeClass();
|
|
47262
|
+
const handleLinkBankAccounts = (0, react.useCallback)(() => {
|
|
47263
|
+
addConnection("PLAID");
|
|
47264
|
+
}, [addConnection]);
|
|
47265
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Banner, {
|
|
47266
|
+
title: "Link your bank accounts",
|
|
47267
|
+
description: "Linking your bank accounts allows us to load your bank transactions and automatically categorize them.",
|
|
47268
|
+
slots: {
|
|
47269
|
+
Icon: isMobile ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Info, { size: 16 }),
|
|
47270
|
+
Button: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
|
|
47271
|
+
onPress: handleLinkBankAccounts,
|
|
47272
|
+
variant: "outlined-light",
|
|
47273
|
+
children: "Link your bank accounts"
|
|
47274
|
+
})
|
|
47275
|
+
}
|
|
47276
|
+
});
|
|
47277
|
+
};
|
|
47278
|
+
var NoTaxProfileBanner = ({ onSetupTaxProfile }) => {
|
|
47279
|
+
const { isMobile } = useSizeClass();
|
|
47280
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Banner, {
|
|
47281
|
+
title: "Set up your tax profile",
|
|
47282
|
+
description: "Configuring your tax profile allows us to provide you with tax estimates and avoid any surprises come tax time.",
|
|
47283
|
+
slots: {
|
|
47284
|
+
Icon: isMobile ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Info, { size: 16 }),
|
|
47285
|
+
Button: onSetupTaxProfile ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
|
|
47286
|
+
onPress: onSetupTaxProfile,
|
|
47287
|
+
variant: "outlined-light",
|
|
47288
|
+
children: "Setup your tax profile"
|
|
47289
|
+
}) : null
|
|
47290
|
+
}
|
|
47291
|
+
});
|
|
47292
|
+
};
|
|
47293
|
+
function SolopreneurOnboardingBannerInternal({ onSetupTaxProfile }) {
|
|
47294
|
+
const state = useSolopreneurOnboardingBannerState();
|
|
47295
|
+
if (state === OnboardingBannerState.Loading || state === OnboardingBannerState.Onboarded) return null;
|
|
47296
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
47297
|
+
className: "Layer__SolopreneurLayout__OnboardingBanner",
|
|
47298
|
+
children: [state === OnboardingBannerState.NoBankAccountsLinked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoBankAccountsLinkedBanner, {}), state === OnboardingBannerState.NoTaxProfile && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoTaxProfileBanner, { onSetupTaxProfile })]
|
|
47299
|
+
});
|
|
47300
|
+
}
|
|
47301
|
+
function SolopreneurOnboardingBanner({ onSetupTaxProfile }) {
|
|
47302
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkedAccountsProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SolopreneurOnboardingBannerInternal, { onSetupTaxProfile }) });
|
|
47303
|
+
}
|
|
47304
|
+
var useSolopreneurOnboardingBannerState = () => {
|
|
47305
|
+
const { data: linkedAccounts, isLoading: isLinkedAccountsLoading, loadingStatus: linkedAccountsLoadingStatus } = (0, react.useContext)(LinkedAccountsContext);
|
|
47306
|
+
const { data: taxProfile, isLoading: isTaxProfileLoading } = useTaxProfile();
|
|
47307
|
+
return getOnboardingBannerState({
|
|
47308
|
+
isLoading: isLinkedAccountsLoading || isTaxProfileLoading || linkedAccountsLoadingStatus === "loading" || linkedAccountsLoadingStatus === "initial",
|
|
47309
|
+
hasLinkedAccounts: Array.isArray(linkedAccounts) && linkedAccounts.length > 0,
|
|
47310
|
+
hasSavedTaxProfile: (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true
|
|
47105
47311
|
});
|
|
47106
47312
|
};
|
|
47107
47313
|
//#endregion
|
|
@@ -47234,11 +47440,18 @@ var CHART_MARGIN$1 = {
|
|
|
47234
47440
|
};
|
|
47235
47441
|
var CHART_BORDER_RADIUS$1 = 8;
|
|
47236
47442
|
var Y_AXIS_CATEGORY_KEY = "__layer_hbar_category";
|
|
47443
|
+
var SMALL_SEGMENT_THRESHOLD = .25;
|
|
47444
|
+
function determineLabelMode(requestedLabelMode, positiveItems, legendDenominator) {
|
|
47445
|
+
if (legendDenominator <= 0) return LegendLayout.Table;
|
|
47446
|
+
if (positiveItems.some((item) => item.value / legendDenominator < SMALL_SEGMENT_THRESHOLD)) return LegendLayout.Table;
|
|
47447
|
+
return requestedLabelMode;
|
|
47448
|
+
}
|
|
47237
47449
|
var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true, labelMode = LegendLayout.Table, slots }) => {
|
|
47238
47450
|
const { data: items, total } = data;
|
|
47239
47451
|
const positiveItems = (0, react.useMemo)(() => items.filter((item) => item.value > 0), [items]);
|
|
47240
47452
|
const positiveTotal = positiveItems.reduce((sum, item) => sum + item.value, 0);
|
|
47241
47453
|
const legendDenominator = positiveTotal > 0 ? positiveTotal : total;
|
|
47454
|
+
const effectiveLabelMode = determineLabelMode(labelMode, positiveItems, legendDenominator);
|
|
47242
47455
|
const chartData = (0, react.useMemo)(() => {
|
|
47243
47456
|
return [positiveItems.reduce((acc, item) => {
|
|
47244
47457
|
acc[item.name] = item.value;
|
|
@@ -47251,7 +47464,7 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
|
|
|
47251
47464
|
total: legendDenominator,
|
|
47252
47465
|
colorSelector: stylingProps.colorSelector,
|
|
47253
47466
|
formatValue,
|
|
47254
|
-
layout:
|
|
47467
|
+
layout: effectiveLabelMode
|
|
47255
47468
|
});
|
|
47256
47469
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
47257
47470
|
className: "Layer__HorizontalBarChart Layer__UI__Chart--focusReset",
|
|
@@ -47346,7 +47559,7 @@ var getTaxSummary = get$1(({ businessId, year, reportingBasis, fullYearProjectio
|
|
|
47346
47559
|
full_year_projection: fullYearProjection
|
|
47347
47560
|
})}`;
|
|
47348
47561
|
});
|
|
47349
|
-
function buildKey$
|
|
47562
|
+
function buildKey$16({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection, enabled = true }) {
|
|
47350
47563
|
if (!enabled) return;
|
|
47351
47564
|
if (accessToken && apiUrl) return {
|
|
47352
47565
|
accessToken,
|
|
@@ -47362,7 +47575,7 @@ function useTaxSummary({ year, reportingBasis, fullYearProjection, enabled = tru
|
|
|
47362
47575
|
const withLocale = useLocalizedKey();
|
|
47363
47576
|
const { data: auth } = useAuth();
|
|
47364
47577
|
const { businessId } = useLayerContext();
|
|
47365
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
47578
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
47366
47579
|
businessId,
|
|
47367
47580
|
year,
|
|
47368
47581
|
reportingBasis,
|
|
@@ -47574,10 +47787,10 @@ function allTaxSectionsAreEmpty(summary) {
|
|
|
47574
47787
|
function TaxEstimatesSummaryCardEmpty() {
|
|
47575
47788
|
const { t } = (0, react_i18next.useTranslation)();
|
|
47576
47789
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
47790
|
+
className: "Layer__TaxEstimatesSummaryCard--empty",
|
|
47577
47791
|
status: DataStateStatus.info,
|
|
47578
47792
|
title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
|
|
47579
|
-
description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
|
|
47580
|
-
spacing: true
|
|
47793
|
+
description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
|
|
47581
47794
|
});
|
|
47582
47795
|
}
|
|
47583
47796
|
var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
|
|
@@ -47642,11 +47855,9 @@ var PieChartContent = ({ data, commonProps, layout }) => {
|
|
|
47642
47855
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
|
|
47643
47856
|
});
|
|
47644
47857
|
};
|
|
47645
|
-
var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart,
|
|
47858
|
+
var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, interactionProps, stringOverrides } = {}) => {
|
|
47646
47859
|
const { detailData, layout, title: defaultTitle, isLoading, isError } = useTaxEstimatesSummaryCard();
|
|
47647
|
-
const { isDesktop } = useSizeClass();
|
|
47648
47860
|
const isSummaryCardLayout = layout === "summaryCard";
|
|
47649
|
-
const title = titleOverride !== null && titleOverride !== void 0 ? titleOverride : defaultTitle;
|
|
47650
47861
|
const commonProps = (0, react.useMemo)(() => {
|
|
47651
47862
|
var _detailData$data;
|
|
47652
47863
|
const colorByKey = detailData === null || detailData === void 0 || (_detailData$data = detailData.data) === null || _detailData$data === void 0 ? void 0 : _detailData$data.reduce((acc, item) => {
|
|
@@ -47664,82 +47875,69 @@ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, ti
|
|
|
47664
47875
|
} }
|
|
47665
47876
|
};
|
|
47666
47877
|
}, [detailData === null || detailData === void 0 ? void 0 : detailData.data]);
|
|
47667
|
-
|
|
47668
|
-
|
|
47669
|
-
|
|
47670
|
-
|
|
47671
|
-
|
|
47672
|
-
|
|
47673
|
-
|
|
47674
|
-
|
|
47675
|
-
|
|
47676
|
-
|
|
47677
|
-
|
|
47678
|
-
|
|
47679
|
-
|
|
47680
|
-
|
|
47681
|
-
|
|
47682
|
-
|
|
47683
|
-
|
|
47684
|
-
|
|
47685
|
-
|
|
47686
|
-
isError,
|
|
47687
|
-
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingState$1, { mode }),
|
|
47688
|
-
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorState$2, {}),
|
|
47689
|
-
children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content, {
|
|
47690
|
-
data,
|
|
47691
|
-
mode,
|
|
47692
|
-
commonProps,
|
|
47693
|
-
layout
|
|
47694
|
-
})
|
|
47695
|
-
})]
|
|
47878
|
+
const slots = useSummaryCardSlots({
|
|
47879
|
+
defaultTitle,
|
|
47880
|
+
interactionProps,
|
|
47881
|
+
stringOverrides
|
|
47882
|
+
});
|
|
47883
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryCard, {
|
|
47884
|
+
className: (0, classnames.default)("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
|
|
47885
|
+
slots,
|
|
47886
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
47887
|
+
data: detailData,
|
|
47888
|
+
isLoading,
|
|
47889
|
+
isError,
|
|
47890
|
+
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingState$1, { mode }),
|
|
47891
|
+
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorState$2, {}),
|
|
47892
|
+
children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content, {
|
|
47893
|
+
data,
|
|
47894
|
+
mode,
|
|
47895
|
+
commonProps,
|
|
47896
|
+
layout
|
|
47696
47897
|
})
|
|
47697
47898
|
})
|
|
47698
47899
|
});
|
|
47699
47900
|
};
|
|
47700
47901
|
//#endregion
|
|
47701
47902
|
//#region src/views/SolopreneurOverview/SolopreneurOverview.tsx
|
|
47702
|
-
var SolopreneurOverview = ({
|
|
47703
|
-
var
|
|
47903
|
+
var SolopreneurOverview = ({ interactionProps, chartColorsList, stringOverrides }) => {
|
|
47904
|
+
var _interactionProps$ban, _interactionProps$pro, _stringOverrides$summ, _interactionProps$sum, _stringOverrides$summ2, _interactionProps$sum2, _stringOverrides$summ3, _interactionProps$sum3, _interactionProps$sum4, _stringOverrides$summ4;
|
|
47704
47905
|
const { t } = (0, react_i18next.useTranslation)();
|
|
47705
47906
|
const { value: sizeClass } = useSizeClass();
|
|
47706
|
-
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;
|
|
47707
47907
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss, {
|
|
47708
47908
|
asContainer: false,
|
|
47709
|
-
tagFilter: tagFilter ? {
|
|
47710
|
-
key: tagFilter.tagKey,
|
|
47711
|
-
values: tagFilter.tagValues
|
|
47712
|
-
} : void 0,
|
|
47713
47909
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(View, {
|
|
47714
47910
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || t("common:label.overview", "Overview"),
|
|
47715
|
-
showHeader:
|
|
47911
|
+
showHeader: true,
|
|
47716
47912
|
header: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header$1, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderCol, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
|
|
47717
47913
|
children: [
|
|
47718
|
-
|
|
47719
|
-
onTransactionsToReviewClick,
|
|
47720
|
-
onboardingStepOverride
|
|
47721
|
-
}),
|
|
47914
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SolopreneurOnboardingBanner, { onSetupTaxProfile: interactionProps === null || interactionProps === void 0 || (_interactionProps$ban = interactionProps.banner) === null || _interactionProps$ban === void 0 ? void 0 : _interactionProps$ban.onSetupTaxProfile }),
|
|
47722
47915
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossSummaries, {
|
|
47723
47916
|
stringOverrides: stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.profitAndLossSummaries,
|
|
47724
47917
|
chartColorsList,
|
|
47725
|
-
onTransactionsToReviewClick
|
|
47726
|
-
variants: profitAndLossSummariesVariants
|
|
47918
|
+
onTransactionsToReviewClick: interactionProps === null || interactionProps === void 0 || (_interactionProps$pro = interactionProps.profitAndLossSummaries) === null || _interactionProps$pro === void 0 ? void 0 : _interactionProps$pro.onTransactionsToReviewClick
|
|
47727
47919
|
}),
|
|
47728
|
-
middleBanner,
|
|
47729
47920
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
47730
47921
|
className: "Layer__SolopreneurOverview__Grid",
|
|
47731
47922
|
children: [
|
|
47732
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossSummaryCard, {
|
|
47923
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossSummaryCard, {
|
|
47924
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ = stringOverrides.summaryCards) === null || _stringOverrides$summ === void 0 ? void 0 : _stringOverrides$summ.profitAndLoss,
|
|
47925
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum = interactionProps.summaryCards) === null || _interactionProps$sum === void 0 ? void 0 : _interactionProps$sum.profitAndLoss
|
|
47926
|
+
}),
|
|
47733
47927
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpensesSummaryCard, {
|
|
47734
47928
|
stylingProps: { chartColorsList },
|
|
47735
|
-
stringOverrides:
|
|
47929
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ2 = stringOverrides.summaryCards) === null || _stringOverrides$summ2 === void 0 ? void 0 : _stringOverrides$summ2.expenses,
|
|
47930
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum2 = interactionProps.summaryCards) === null || _interactionProps$sum2 === void 0 ? void 0 : _interactionProps$sum2.expenses
|
|
47736
47931
|
}),
|
|
47737
47932
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaxEstimatesSummaryCard, {
|
|
47738
47933
|
mode: TaxEstimatesSummaryCardMode.HorizontalBarChart,
|
|
47739
|
-
|
|
47740
|
-
|
|
47934
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ3 = stringOverrides.summaryCards) === null || _stringOverrides$summ3 === void 0 ? void 0 : _stringOverrides$summ3.taxEstimates,
|
|
47935
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum3 = interactionProps.summaryCards) === null || _interactionProps$sum3 === void 0 ? void 0 : _interactionProps$sum3.taxEstimates
|
|
47741
47936
|
}),
|
|
47742
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingSummary,
|
|
47937
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MileageTrackingSummary, {
|
|
47938
|
+
interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum4 = interactionProps.summaryCards) === null || _interactionProps$sum4 === void 0 ? void 0 : _interactionProps$sum4.mileageTracking,
|
|
47939
|
+
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ4 = stringOverrides.summaryCards) === null || _stringOverrides$summ4 === void 0 ? void 0 : _stringOverrides$summ4.mileageTracking
|
|
47940
|
+
})
|
|
47743
47941
|
]
|
|
47744
47942
|
})
|
|
47745
47943
|
]
|
|
@@ -47747,148 +47945,6 @@ var SolopreneurOverview = ({ showTitle = true, enableOnboarding = false, onboard
|
|
|
47747
47945
|
});
|
|
47748
47946
|
};
|
|
47749
47947
|
//#endregion
|
|
47750
|
-
//#region src/types/location.ts
|
|
47751
|
-
var US_STATES_CONFIG = [
|
|
47752
|
-
_objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
|
|
47753
|
-
_objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
|
|
47754
|
-
_objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
|
|
47755
|
-
_objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
|
|
47756
|
-
_objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
|
|
47757
|
-
_objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
|
|
47758
|
-
_objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
|
|
47759
|
-
_objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
|
|
47760
|
-
_objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
|
|
47761
|
-
_objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
|
|
47762
|
-
_objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
|
|
47763
|
-
_objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
|
|
47764
|
-
_objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
|
|
47765
|
-
_objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
|
|
47766
|
-
_objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
|
|
47767
|
-
_objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
|
|
47768
|
-
_objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
|
|
47769
|
-
_objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
|
|
47770
|
-
_objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
|
|
47771
|
-
_objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
|
|
47772
|
-
_objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
|
|
47773
|
-
_objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
|
|
47774
|
-
_objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
|
|
47775
|
-
_objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
|
|
47776
|
-
_objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
|
|
47777
|
-
_objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
|
|
47778
|
-
_objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
|
|
47779
|
-
_objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
|
|
47780
|
-
_objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
|
|
47781
|
-
_objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
|
|
47782
|
-
_objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
|
|
47783
|
-
_objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
|
|
47784
|
-
_objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
|
|
47785
|
-
_objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
|
|
47786
|
-
_objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
|
|
47787
|
-
_objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
|
|
47788
|
-
_objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
|
|
47789
|
-
_objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
|
|
47790
|
-
_objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
|
|
47791
|
-
_objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
|
|
47792
|
-
_objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
|
|
47793
|
-
_objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
|
|
47794
|
-
_objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
|
|
47795
|
-
_objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
|
|
47796
|
-
_objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
|
|
47797
|
-
_objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
|
|
47798
|
-
_objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
|
|
47799
|
-
_objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
|
|
47800
|
-
_objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
|
|
47801
|
-
_objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
|
|
47802
|
-
_objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
|
|
47803
|
-
_objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
|
|
47804
|
-
];
|
|
47805
|
-
var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
|
|
47806
|
-
//#endregion
|
|
47807
|
-
//#region src/schemas/taxEstimates/filingStatus.ts
|
|
47808
|
-
var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
|
|
47809
|
-
FilingStatus["SINGLE"] = "SINGLE";
|
|
47810
|
-
FilingStatus["MARRIED"] = "MARRIED";
|
|
47811
|
-
FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
|
|
47812
|
-
FilingStatus["HEAD"] = "HEAD";
|
|
47813
|
-
FilingStatus["WIDOWER"] = "WIDOWER";
|
|
47814
|
-
return FilingStatus;
|
|
47815
|
-
}({});
|
|
47816
|
-
var FilingStatusSchema = effect.Schema.Enums(FilingStatus);
|
|
47817
|
-
//#endregion
|
|
47818
|
-
//#region src/schemas/taxEstimates/profile.ts
|
|
47819
|
-
var USStateCodeSchema = effect.Schema.Literal(...US_STATE_VALUES);
|
|
47820
|
-
var WithholdingSchema = effect.Schema.Struct({
|
|
47821
|
-
useCustomWithholding: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_custom_withholding")),
|
|
47822
|
-
amount: effect.Schema.NullishOr(effect.Schema.Number)
|
|
47823
|
-
});
|
|
47824
|
-
var HomeOfficeDeductionSchema = effect.Schema.Struct({
|
|
47825
|
-
useHomeOfficeDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_home_office_deduction")),
|
|
47826
|
-
homeOfficeArea: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("home_office_area"))
|
|
47827
|
-
});
|
|
47828
|
-
var VehicleDeductionSchema = effect.Schema.Struct({ useMileageDeduction: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Boolean)), effect.Schema.fromKey("use_mileage_deduction")) });
|
|
47829
|
-
var DeductionsSchema = effect.Schema.Struct({
|
|
47830
|
-
homeOffice: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(HomeOfficeDeductionSchema)), effect.Schema.fromKey("home_office")),
|
|
47831
|
-
vehicle: effect.Schema.NullishOr(VehicleDeductionSchema)
|
|
47832
|
-
});
|
|
47833
|
-
var FederalConfigurationSchema = effect.Schema.Struct({
|
|
47834
|
-
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47835
|
-
annualW2Income: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("annual_w2_income")),
|
|
47836
|
-
tipIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("tip_income")),
|
|
47837
|
-
overtimeIncome: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Number)), effect.Schema.fromKey("overtime_income")),
|
|
47838
|
-
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47839
|
-
});
|
|
47840
|
-
var StateConfigurationSchema = effect.Schema.Struct({
|
|
47841
|
-
taxState: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(USStateCodeSchema)), effect.Schema.fromKey("tax_state")),
|
|
47842
|
-
filingStatus: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(FilingStatusSchema)), effect.Schema.fromKey("filing_status")),
|
|
47843
|
-
withholding: effect.Schema.NullishOr(WithholdingSchema)
|
|
47844
|
-
});
|
|
47845
|
-
var UsConfigurationSchema = effect.Schema.Struct({
|
|
47846
|
-
federal: effect.Schema.NullishOr(FederalConfigurationSchema),
|
|
47847
|
-
state: effect.Schema.NullishOr(StateConfigurationSchema),
|
|
47848
|
-
deductions: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(DeductionsSchema)), effect.Schema.fromKey("deductions"))
|
|
47849
|
-
});
|
|
47850
|
-
var TaxProfileSchema = effect.Schema.Struct({
|
|
47851
|
-
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47852
|
-
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration")),
|
|
47853
|
-
userHasSavedTaxProfile: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.Boolean), effect.Schema.fromKey("user_has_saved_tax_profile"))
|
|
47854
|
-
});
|
|
47855
|
-
var TaxProfileResponseSchema = effect.Schema.Struct({ data: TaxProfileSchema });
|
|
47856
|
-
var TaxProfileRequestSchema = effect.Schema.Struct({
|
|
47857
|
-
taxCountryCode: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)), effect.Schema.fromKey("tax_country_code")),
|
|
47858
|
-
usConfiguration: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(UsConfigurationSchema)), effect.Schema.fromKey("us_configuration"))
|
|
47859
|
-
});
|
|
47860
|
-
//#endregion
|
|
47861
|
-
//#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
|
|
47862
|
-
var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
47863
|
-
var getTaxProfile = get$1(({ businessId }) => {
|
|
47864
|
-
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
47865
|
-
});
|
|
47866
|
-
function buildKey$16({ access_token: accessToken, apiUrl, businessId }) {
|
|
47867
|
-
if (accessToken && apiUrl) return {
|
|
47868
|
-
accessToken,
|
|
47869
|
-
apiUrl,
|
|
47870
|
-
businessId,
|
|
47871
|
-
tags: [TAX_PROFILE_TAG_KEY]
|
|
47872
|
-
};
|
|
47873
|
-
}
|
|
47874
|
-
function useTaxProfile() {
|
|
47875
|
-
const withLocale = useLocalizedKey();
|
|
47876
|
-
const { data: auth } = useAuth();
|
|
47877
|
-
const { businessId } = useLayerContext();
|
|
47878
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
47879
|
-
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
47880
|
-
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
47881
|
-
});
|
|
47882
|
-
return function(_x) {
|
|
47883
|
-
return _ref.apply(this, arguments);
|
|
47884
|
-
};
|
|
47885
|
-
}()));
|
|
47886
|
-
}
|
|
47887
|
-
function useTaxProfileGlobalCacheActions() {
|
|
47888
|
-
const { patchCache } = useGlobalCacheActions();
|
|
47889
|
-
return { patchTaxProfile: (0, react.useCallback)((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
|
|
47890
|
-
}
|
|
47891
|
-
//#endregion
|
|
47892
47948
|
//#region src/hooks/features/taxEstimates/useTaxEstimatesOnboardingStatus.ts
|
|
47893
47949
|
var OnboardingStatus = /* @__PURE__ */ function(OnboardingStatus) {
|
|
47894
47950
|
OnboardingStatus["Loading"] = "Loading";
|