@yenio-pld/blocks 1.2.0-rc.14 → 1.2.0-rc.15
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/index.cjs +414 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +312 -25
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React6 = require('react');
|
|
5
5
|
var skeleton_js = require('./ui/skeleton.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var lucideReact = require('lucide-react');
|
|
@@ -48,11 +48,11 @@ function _interopNamespace(e) {
|
|
|
48
48
|
return Object.freeze(n);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
|
|
52
52
|
|
|
53
|
-
var LanguageContext =
|
|
53
|
+
var LanguageContext = React6.createContext(null);
|
|
54
54
|
function useLanguageContext() {
|
|
55
|
-
return
|
|
55
|
+
return React6.useContext(LanguageContext);
|
|
56
56
|
}
|
|
57
57
|
function PageTitle({
|
|
58
58
|
title,
|
|
@@ -296,8 +296,8 @@ function renderShellLink({
|
|
|
296
296
|
}
|
|
297
297
|
function DismissMobileSidebar({ pathname }) {
|
|
298
298
|
const { setOpenMobile } = sidebar_js.useSidebar();
|
|
299
|
-
const previous =
|
|
300
|
-
|
|
299
|
+
const previous = React6.useRef(pathname);
|
|
300
|
+
React6.useEffect(() => {
|
|
301
301
|
if (previous.current === pathname) return;
|
|
302
302
|
previous.current = pathname;
|
|
303
303
|
setOpenMobile(false);
|
|
@@ -486,7 +486,7 @@ function NavTabs({
|
|
|
486
486
|
"aria-current": active ? "page" : void 0,
|
|
487
487
|
children: label2
|
|
488
488
|
});
|
|
489
|
-
return
|
|
489
|
+
return React6.cloneElement(link, { key: tab.href });
|
|
490
490
|
})
|
|
491
491
|
}
|
|
492
492
|
);
|
|
@@ -686,14 +686,14 @@ function LoadMoreControls({
|
|
|
686
686
|
pending,
|
|
687
687
|
onLoadMore
|
|
688
688
|
}) {
|
|
689
|
-
const sentinelRef =
|
|
690
|
-
const pendingRef =
|
|
691
|
-
const onLoadMoreRef =
|
|
692
|
-
const armedRef =
|
|
693
|
-
const wasPendingRef =
|
|
689
|
+
const sentinelRef = React6.useRef(null);
|
|
690
|
+
const pendingRef = React6.useRef(pending);
|
|
691
|
+
const onLoadMoreRef = React6.useRef(onLoadMore);
|
|
692
|
+
const armedRef = React6.useRef(true);
|
|
693
|
+
const wasPendingRef = React6.useRef(false);
|
|
694
694
|
pendingRef.current = pending;
|
|
695
695
|
onLoadMoreRef.current = onLoadMore;
|
|
696
|
-
|
|
696
|
+
React6.useEffect(() => {
|
|
697
697
|
const node = sentinelRef.current;
|
|
698
698
|
if (!node || typeof IntersectionObserver === "undefined") return;
|
|
699
699
|
function maybeLoad() {
|
|
@@ -711,7 +711,7 @@ function LoadMoreControls({
|
|
|
711
711
|
observer.observe(node);
|
|
712
712
|
return () => observer.disconnect();
|
|
713
713
|
}, []);
|
|
714
|
-
|
|
714
|
+
React6.useEffect(() => {
|
|
715
715
|
if (pending) {
|
|
716
716
|
wasPendingRef.current = true;
|
|
717
717
|
return;
|
|
@@ -851,15 +851,15 @@ function NavigationProgress({
|
|
|
851
851
|
ariaLabel = "Loading",
|
|
852
852
|
forceVisible = false
|
|
853
853
|
}) {
|
|
854
|
-
const [visible, setVisible] =
|
|
855
|
-
const [runId, setRunId] =
|
|
856
|
-
const startedAt =
|
|
857
|
-
const startedRoute =
|
|
858
|
-
const committedRoute =
|
|
859
|
-
|
|
854
|
+
const [visible, setVisible] = React6.useState(forceVisible);
|
|
855
|
+
const [runId, setRunId] = React6.useState(0);
|
|
856
|
+
const startedAt = React6.useRef(0);
|
|
857
|
+
const startedRoute = React6.useRef(null);
|
|
858
|
+
const committedRoute = React6.useRef(null);
|
|
859
|
+
React6.useEffect(() => {
|
|
860
860
|
committedRoute.current = routeKey(pathname, search);
|
|
861
861
|
}, [pathname, search]);
|
|
862
|
-
|
|
862
|
+
React6.useEffect(() => {
|
|
863
863
|
if (forceVisible) return;
|
|
864
864
|
function begin(route) {
|
|
865
865
|
if (navigationSuppressed) return;
|
|
@@ -896,12 +896,12 @@ function NavigationProgress({
|
|
|
896
896
|
window.removeEventListener("popstate", onPopState);
|
|
897
897
|
};
|
|
898
898
|
}, [forceVisible, pathname, search]);
|
|
899
|
-
|
|
899
|
+
React6.useEffect(() => {
|
|
900
900
|
if (forceVisible || !visible) return;
|
|
901
901
|
const safety = window.setTimeout(() => setVisible(false), SAFETY_MS);
|
|
902
902
|
return () => window.clearTimeout(safety);
|
|
903
903
|
}, [forceVisible, runId, visible]);
|
|
904
|
-
|
|
904
|
+
React6.useEffect(() => {
|
|
905
905
|
if (forceVisible || !visible) return;
|
|
906
906
|
const started = startedRoute.current;
|
|
907
907
|
if (!started) return;
|
|
@@ -1384,20 +1384,20 @@ function useEditableSection({
|
|
|
1384
1384
|
...DEFAULT_EDITABLE_SECTION_LABELS,
|
|
1385
1385
|
...labels
|
|
1386
1386
|
};
|
|
1387
|
-
const [mode, setMode] =
|
|
1388
|
-
const [status, setStatus] =
|
|
1389
|
-
const [confirmOpen, setConfirmOpen] =
|
|
1390
|
-
const [minHeightPx, setMinHeightPx] =
|
|
1391
|
-
const contentRef =
|
|
1392
|
-
const editButtonRef =
|
|
1393
|
-
const measuredHeightRef =
|
|
1394
|
-
const shouldFocusEditRef =
|
|
1395
|
-
const shouldFocusFirstFieldRef =
|
|
1396
|
-
const editButtonId =
|
|
1397
|
-
const contentFormId =
|
|
1387
|
+
const [mode, setMode] = React6.useState("reading");
|
|
1388
|
+
const [status, setStatus] = React6.useState(null);
|
|
1389
|
+
const [confirmOpen, setConfirmOpen] = React6.useState(false);
|
|
1390
|
+
const [minHeightPx, setMinHeightPx] = React6.useState(void 0);
|
|
1391
|
+
const contentRef = React6.useRef(null);
|
|
1392
|
+
const editButtonRef = React6.useRef(null);
|
|
1393
|
+
const measuredHeightRef = React6.useRef(0);
|
|
1394
|
+
const shouldFocusEditRef = React6.useRef(false);
|
|
1395
|
+
const shouldFocusFirstFieldRef = React6.useRef(false);
|
|
1396
|
+
const editButtonId = React6.useId();
|
|
1397
|
+
const contentFormId = React6.useId();
|
|
1398
1398
|
const isEditing = mode === "editing" || mode === "saving";
|
|
1399
1399
|
const isSaving = mode === "saving";
|
|
1400
|
-
|
|
1400
|
+
React6.useEffect(() => {
|
|
1401
1401
|
if (mode === "reading" && shouldFocusEditRef.current) {
|
|
1402
1402
|
shouldFocusEditRef.current = false;
|
|
1403
1403
|
editButtonRef.current?.focus();
|
|
@@ -1415,18 +1415,18 @@ function useEditableSection({
|
|
|
1415
1415
|
focusFirstField(contentRef.current);
|
|
1416
1416
|
}
|
|
1417
1417
|
}, [mode]);
|
|
1418
|
-
const exitToReading =
|
|
1418
|
+
const exitToReading = React6.useCallback(() => {
|
|
1419
1419
|
setConfirmOpen(false);
|
|
1420
1420
|
shouldFocusEditRef.current = true;
|
|
1421
1421
|
setMode("reading");
|
|
1422
1422
|
onDiscard?.();
|
|
1423
1423
|
}, [onDiscard]);
|
|
1424
|
-
const startEdit =
|
|
1424
|
+
const startEdit = React6.useCallback(() => {
|
|
1425
1425
|
setStatus(null);
|
|
1426
1426
|
shouldFocusFirstFieldRef.current = true;
|
|
1427
1427
|
setMode("editing");
|
|
1428
1428
|
}, []);
|
|
1429
|
-
const requestCancel =
|
|
1429
|
+
const requestCancel = React6.useCallback(() => {
|
|
1430
1430
|
if (isSaving) return;
|
|
1431
1431
|
if (isDirty) {
|
|
1432
1432
|
setConfirmOpen(true);
|
|
@@ -1434,7 +1434,7 @@ function useEditableSection({
|
|
|
1434
1434
|
}
|
|
1435
1435
|
exitToReading();
|
|
1436
1436
|
}, [exitToReading, isDirty, isSaving]);
|
|
1437
|
-
const handleSubmit =
|
|
1437
|
+
const handleSubmit = React6.useCallback(
|
|
1438
1438
|
(event) => {
|
|
1439
1439
|
event.preventDefault();
|
|
1440
1440
|
if (isSaving) return;
|
|
@@ -1454,7 +1454,7 @@ function useEditableSection({
|
|
|
1454
1454
|
},
|
|
1455
1455
|
[isSaving, onSave, resolvedLabels.saved]
|
|
1456
1456
|
);
|
|
1457
|
-
const handleFormKeyDown =
|
|
1457
|
+
const handleFormKeyDown = React6.useCallback(
|
|
1458
1458
|
(event) => {
|
|
1459
1459
|
if (event.key !== "Escape") return;
|
|
1460
1460
|
event.preventDefault();
|
|
@@ -1462,7 +1462,7 @@ function useEditableSection({
|
|
|
1462
1462
|
},
|
|
1463
1463
|
[requestCancel]
|
|
1464
1464
|
);
|
|
1465
|
-
|
|
1465
|
+
React6.useEffect(() => {
|
|
1466
1466
|
if (!stableHeight || !isEditing) return;
|
|
1467
1467
|
const el = contentRef.current;
|
|
1468
1468
|
if (!el) return;
|
|
@@ -1708,16 +1708,16 @@ function SafeImage({
|
|
|
1708
1708
|
className,
|
|
1709
1709
|
...imgProps
|
|
1710
1710
|
}) {
|
|
1711
|
-
const [failed, setFailed] =
|
|
1712
|
-
const [loaded, setLoaded] =
|
|
1713
|
-
const imgRef =
|
|
1711
|
+
const [failed, setFailed] = React6.useState(false);
|
|
1712
|
+
const [loaded, setLoaded] = React6.useState(false);
|
|
1713
|
+
const imgRef = React6.useRef(null);
|
|
1714
1714
|
const resolvedSrc = typeof src === "string" && src.length > 0 ? src : null;
|
|
1715
1715
|
const resolvedBlur = resolveBlurDataUrl(blurDataUrl);
|
|
1716
|
-
|
|
1716
|
+
React6.useLayoutEffect(() => {
|
|
1717
1717
|
setFailed(false);
|
|
1718
1718
|
setLoaded(false);
|
|
1719
1719
|
}, [resolvedSrc]);
|
|
1720
|
-
|
|
1720
|
+
React6.useLayoutEffect(() => {
|
|
1721
1721
|
const img = imgRef.current;
|
|
1722
1722
|
if (!img) return;
|
|
1723
1723
|
if (isBrokenImage(img)) {
|
|
@@ -1827,17 +1827,17 @@ function ThemeSwitcher({
|
|
|
1827
1827
|
labels: userLabels
|
|
1828
1828
|
}) {
|
|
1829
1829
|
const { theme, setTheme } = nextThemes.useTheme();
|
|
1830
|
-
const [mounted, setMounted] =
|
|
1830
|
+
const [mounted, setMounted] = React6.useState(false);
|
|
1831
1831
|
const sizes = sizeClasses[size];
|
|
1832
1832
|
const shapeClass = shapeClasses[shape];
|
|
1833
1833
|
const labels = { ...defaultLabels, ...userLabels };
|
|
1834
|
-
const handleThemeClick =
|
|
1834
|
+
const handleThemeClick = React6.useCallback(
|
|
1835
1835
|
(themeKey) => {
|
|
1836
1836
|
setTheme(themeKey);
|
|
1837
1837
|
},
|
|
1838
1838
|
[setTheme]
|
|
1839
1839
|
);
|
|
1840
|
-
|
|
1840
|
+
React6.useEffect(() => {
|
|
1841
1841
|
setMounted(true);
|
|
1842
1842
|
}, []);
|
|
1843
1843
|
if (!mounted) {
|
|
@@ -3086,8 +3086,8 @@ function CountryPicker({
|
|
|
3086
3086
|
"aria-invalid": ariaInvalid
|
|
3087
3087
|
}) {
|
|
3088
3088
|
const labels = { ...defaultLabels2(purpose, locale), ...labelsProp };
|
|
3089
|
-
const items =
|
|
3090
|
-
const selected =
|
|
3089
|
+
const items = React6__namespace.useMemo(() => countryPickerItems(locale), [locale]);
|
|
3090
|
+
const selected = React6__namespace.useMemo(() => findItem(items, value), [items, value]);
|
|
3091
3091
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3092
3092
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3093
3093
|
name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim().toUpperCase() }) : null,
|
|
@@ -3187,9 +3187,296 @@ function CountryPicker({
|
|
|
3187
3187
|
)
|
|
3188
3188
|
] });
|
|
3189
3189
|
}
|
|
3190
|
+
|
|
3191
|
+
// src/data/sat-tax-regimes.json
|
|
3192
|
+
var sat_tax_regimes_default = {
|
|
3193
|
+
items: [
|
|
3194
|
+
{
|
|
3195
|
+
code: "601",
|
|
3196
|
+
labelEs: "General de Ley Personas Morales",
|
|
3197
|
+
labelEn: "General regime \u2014 legal entities"
|
|
3198
|
+
},
|
|
3199
|
+
{
|
|
3200
|
+
code: "603",
|
|
3201
|
+
labelEs: "Personas Morales con Fines no Lucrativos",
|
|
3202
|
+
labelEn: "Non-profit legal entities"
|
|
3203
|
+
},
|
|
3204
|
+
{
|
|
3205
|
+
code: "605",
|
|
3206
|
+
labelEs: "Sueldos y Salarios e Ingresos Asimilados a Salarios",
|
|
3207
|
+
labelEn: "Wages and salary-assimilated income"
|
|
3208
|
+
},
|
|
3209
|
+
{
|
|
3210
|
+
code: "606",
|
|
3211
|
+
labelEs: "Arrendamiento",
|
|
3212
|
+
labelEn: "Leasing"
|
|
3213
|
+
},
|
|
3214
|
+
{
|
|
3215
|
+
code: "607",
|
|
3216
|
+
labelEs: "R\xE9gimen de Enajenaci\xF3n o Adquisici\xF3n de Bienes",
|
|
3217
|
+
labelEn: "Transfer or acquisition of goods"
|
|
3218
|
+
},
|
|
3219
|
+
{
|
|
3220
|
+
code: "608",
|
|
3221
|
+
labelEs: "Dem\xE1s ingresos",
|
|
3222
|
+
labelEn: "Other income"
|
|
3223
|
+
},
|
|
3224
|
+
{
|
|
3225
|
+
code: "610",
|
|
3226
|
+
labelEs: "Residentes en el Extranjero sin Establecimiento Permanente en M\xE9xico",
|
|
3227
|
+
labelEn: "Foreign residents without permanent establishment in Mexico"
|
|
3228
|
+
},
|
|
3229
|
+
{
|
|
3230
|
+
code: "611",
|
|
3231
|
+
labelEs: "Ingresos por Dividendos (socios y accionistas)",
|
|
3232
|
+
labelEn: "Dividend income (partners and shareholders)"
|
|
3233
|
+
},
|
|
3234
|
+
{
|
|
3235
|
+
code: "612",
|
|
3236
|
+
labelEs: "Personas F\xEDsicas con Actividades Empresariales y Profesionales",
|
|
3237
|
+
labelEn: "Individuals with business and professional activities"
|
|
3238
|
+
},
|
|
3239
|
+
{
|
|
3240
|
+
code: "614",
|
|
3241
|
+
labelEs: "Ingresos por intereses",
|
|
3242
|
+
labelEn: "Interest income"
|
|
3243
|
+
},
|
|
3244
|
+
{
|
|
3245
|
+
code: "615",
|
|
3246
|
+
labelEs: "R\xE9gimen de los ingresos por obtenci\xF3n de premios",
|
|
3247
|
+
labelEn: "Prize income"
|
|
3248
|
+
},
|
|
3249
|
+
{
|
|
3250
|
+
code: "616",
|
|
3251
|
+
labelEs: "Sin obligaciones fiscales",
|
|
3252
|
+
labelEn: "No tax obligations"
|
|
3253
|
+
},
|
|
3254
|
+
{
|
|
3255
|
+
code: "620",
|
|
3256
|
+
labelEs: "Sociedades Cooperativas de Producci\xF3n que optan por diferir sus ingresos",
|
|
3257
|
+
labelEn: "Production cooperatives deferring income"
|
|
3258
|
+
},
|
|
3259
|
+
{
|
|
3260
|
+
code: "621",
|
|
3261
|
+
labelEs: "Incorporaci\xF3n Fiscal",
|
|
3262
|
+
labelEn: "Tax incorporation"
|
|
3263
|
+
},
|
|
3264
|
+
{
|
|
3265
|
+
code: "622",
|
|
3266
|
+
labelEs: "Actividades Agr\xEDcolas, Ganaderas, Silv\xEDcolas y Pesqueras",
|
|
3267
|
+
labelEn: "Agriculture, livestock, forestry, and fishing"
|
|
3268
|
+
},
|
|
3269
|
+
{
|
|
3270
|
+
code: "623",
|
|
3271
|
+
labelEs: "Opcional para Grupos de Sociedades",
|
|
3272
|
+
labelEn: "Optional regime for corporate groups"
|
|
3273
|
+
},
|
|
3274
|
+
{
|
|
3275
|
+
code: "624",
|
|
3276
|
+
labelEs: "Coordinados",
|
|
3277
|
+
labelEn: "Coordinated entities"
|
|
3278
|
+
},
|
|
3279
|
+
{
|
|
3280
|
+
code: "625",
|
|
3281
|
+
labelEs: "R\xE9gimen de las Actividades Empresariales con ingresos a trav\xE9s de Plataformas Tecnol\xF3gicas",
|
|
3282
|
+
labelEn: "Business income through digital platforms"
|
|
3283
|
+
},
|
|
3284
|
+
{
|
|
3285
|
+
code: "626",
|
|
3286
|
+
labelEs: "R\xE9gimen Simplificado de Confianza",
|
|
3287
|
+
labelEn: "Simplified trust regime (RESICO)"
|
|
3288
|
+
}
|
|
3289
|
+
]
|
|
3290
|
+
};
|
|
3291
|
+
|
|
3292
|
+
// src/lib/tax-regimes.ts
|
|
3293
|
+
var ITEMS2 = sat_tax_regimes_default.items;
|
|
3294
|
+
var SAT_TAX_REGIME_CODES = Object.freeze(
|
|
3295
|
+
ITEMS2.map((item) => item.code)
|
|
3296
|
+
);
|
|
3297
|
+
var TAX_REGIME_OPTIONS = Object.freeze(
|
|
3298
|
+
[...ITEMS2].sort(
|
|
3299
|
+
(left, right) => left.labelEs.localeCompare(right.labelEs, "es")
|
|
3300
|
+
)
|
|
3301
|
+
);
|
|
3302
|
+
var CODE_SET2 = new Set(ITEMS2.map((item) => item.code));
|
|
3303
|
+
var BY_CODE2 = new Map(ITEMS2.map((item) => [item.code, item]));
|
|
3304
|
+
function titleCaseEs2(labelEs) {
|
|
3305
|
+
return labelEs.toLocaleLowerCase("es-MX").split(/\s+/).filter(Boolean).map((word) => word.charAt(0).toLocaleUpperCase("es-MX") + word.slice(1)).join(" ");
|
|
3306
|
+
}
|
|
3307
|
+
function normalizeCode(code) {
|
|
3308
|
+
return code.trim();
|
|
3309
|
+
}
|
|
3310
|
+
function isKnownTaxRegimeCode(code) {
|
|
3311
|
+
return CODE_SET2.has(normalizeCode(code));
|
|
3312
|
+
}
|
|
3313
|
+
function taxRegimeLabel(code, locale) {
|
|
3314
|
+
const normalized = normalizeCode(code);
|
|
3315
|
+
const record = BY_CODE2.get(normalized);
|
|
3316
|
+
if (!record) return normalized;
|
|
3317
|
+
if (locale === "es-MX") {
|
|
3318
|
+
return titleCaseEs2(record.labelEs);
|
|
3319
|
+
}
|
|
3320
|
+
return record.labelEn;
|
|
3321
|
+
}
|
|
3322
|
+
function formatTaxRegimeOptionLabel(code, locale) {
|
|
3323
|
+
const normalized = normalizeCode(code);
|
|
3324
|
+
return `${normalized} \u2014 ${taxRegimeLabel(normalized, locale)}`;
|
|
3325
|
+
}
|
|
3326
|
+
function taxRegimePickerItems(locale) {
|
|
3327
|
+
return TAX_REGIME_OPTIONS.map((item) => ({
|
|
3328
|
+
value: item.code,
|
|
3329
|
+
label: formatTaxRegimeOptionLabel(item.code, locale)
|
|
3330
|
+
}));
|
|
3331
|
+
}
|
|
3332
|
+
function foldForSearch2(text) {
|
|
3333
|
+
return text.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
|
|
3334
|
+
}
|
|
3335
|
+
function filterTaxRegimes(query, locale) {
|
|
3336
|
+
const items = taxRegimePickerItems(locale);
|
|
3337
|
+
const trimmed = query.trim();
|
|
3338
|
+
if (!trimmed) return items;
|
|
3339
|
+
const needle = foldForSearch2(trimmed);
|
|
3340
|
+
return items.filter((item) => {
|
|
3341
|
+
const code = foldForSearch2(item.value);
|
|
3342
|
+
const label = foldForSearch2(item.label);
|
|
3343
|
+
return code.includes(needle) || label.includes(needle);
|
|
3344
|
+
});
|
|
3345
|
+
}
|
|
3346
|
+
var INPUT_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
3347
|
+
function defaultLabels3(locale) {
|
|
3348
|
+
const es = locale === "es-MX";
|
|
3349
|
+
return {
|
|
3350
|
+
placeholder: es ? "Buscar r\xE9gimen fiscal\u2026" : "Search tax regime\u2026",
|
|
3351
|
+
search: es ? "Buscar r\xE9gimen fiscal" : "Search tax regime",
|
|
3352
|
+
noResults: es ? "Sin resultados" : "No results",
|
|
3353
|
+
clear: es ? "Limpiar" : "Clear",
|
|
3354
|
+
open: es ? "Abrir lista" : "Open list"
|
|
3355
|
+
};
|
|
3356
|
+
}
|
|
3357
|
+
function findItem2(items, code) {
|
|
3358
|
+
const normalized = code.trim();
|
|
3359
|
+
if (!normalized) return null;
|
|
3360
|
+
return items.find((item) => item.value === normalized) ?? null;
|
|
3361
|
+
}
|
|
3362
|
+
function TaxRegimePicker({
|
|
3363
|
+
value,
|
|
3364
|
+
onValueChange,
|
|
3365
|
+
locale = "es-MX",
|
|
3366
|
+
id,
|
|
3367
|
+
name,
|
|
3368
|
+
disabled,
|
|
3369
|
+
required,
|
|
3370
|
+
allowEmpty = true,
|
|
3371
|
+
className,
|
|
3372
|
+
labels: labelsProp,
|
|
3373
|
+
"aria-invalid": ariaInvalid
|
|
3374
|
+
}) {
|
|
3375
|
+
const labels = { ...defaultLabels3(locale), ...labelsProp };
|
|
3376
|
+
const items = React6__namespace.useMemo(() => taxRegimePickerItems(locale), [locale]);
|
|
3377
|
+
const selected = React6__namespace.useMemo(() => findItem2(items, value), [items, value]);
|
|
3378
|
+
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3379
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3380
|
+
name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim() }) : null,
|
|
3381
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3382
|
+
combobox_js.Combobox.Root,
|
|
3383
|
+
{
|
|
3384
|
+
items,
|
|
3385
|
+
value: selected,
|
|
3386
|
+
onValueChange: (item) => {
|
|
3387
|
+
onValueChange(item?.value ?? "");
|
|
3388
|
+
},
|
|
3389
|
+
disabled,
|
|
3390
|
+
itemToStringLabel: (item) => item.label,
|
|
3391
|
+
itemToStringValue: (item) => item.value,
|
|
3392
|
+
isItemEqualToValue: (item, current) => item.value === current.value,
|
|
3393
|
+
children: [
|
|
3394
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3395
|
+
combobox_js.Combobox.InputGroup,
|
|
3396
|
+
{
|
|
3397
|
+
className: cn("relative flex w-full items-center", className),
|
|
3398
|
+
children: [
|
|
3399
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3400
|
+
combobox_js.Combobox.Input,
|
|
3401
|
+
{
|
|
3402
|
+
id,
|
|
3403
|
+
required,
|
|
3404
|
+
"aria-invalid": ariaInvalid,
|
|
3405
|
+
...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
|
|
3406
|
+
placeholder: labels.placeholder,
|
|
3407
|
+
className: cn(INPUT_CLASS2, "pr-16")
|
|
3408
|
+
}
|
|
3409
|
+
),
|
|
3410
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
|
|
3411
|
+
allowEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3412
|
+
combobox_js.Combobox.Clear,
|
|
3413
|
+
{
|
|
3414
|
+
className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3415
|
+
"aria-label": labels.clear,
|
|
3416
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
|
|
3417
|
+
}
|
|
3418
|
+
) : null,
|
|
3419
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3420
|
+
combobox_js.Combobox.Trigger,
|
|
3421
|
+
{
|
|
3422
|
+
className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3423
|
+
"aria-label": labels.open,
|
|
3424
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4", "aria-hidden": true })
|
|
3425
|
+
}
|
|
3426
|
+
)
|
|
3427
|
+
] })
|
|
3428
|
+
]
|
|
3429
|
+
}
|
|
3430
|
+
),
|
|
3431
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { container: dialogPortalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3432
|
+
combobox_js.Combobox.Positioner,
|
|
3433
|
+
{
|
|
3434
|
+
className: "pointer-events-auto isolate z-[60] outline-none",
|
|
3435
|
+
sideOffset: 4,
|
|
3436
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3437
|
+
combobox_js.Combobox.Popup,
|
|
3438
|
+
{
|
|
3439
|
+
className: cn(
|
|
3440
|
+
"pointer-events-auto z-[60] max-h-60 w-(--anchor-width) min-w-[16rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
|
|
3441
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
|
|
3442
|
+
),
|
|
3443
|
+
children: [
|
|
3444
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "px-3 py-2 text-sm text-muted-foreground", children: labels.noResults }),
|
|
3445
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3446
|
+
combobox_js.Combobox.List,
|
|
3447
|
+
{
|
|
3448
|
+
className: "max-h-60 overflow-y-auto p-1 outline-none",
|
|
3449
|
+
onWheel: (event) => event.stopPropagation(),
|
|
3450
|
+
children: (item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3451
|
+
combobox_js.Combobox.Item,
|
|
3452
|
+
{
|
|
3453
|
+
value: item,
|
|
3454
|
+
className: cn(
|
|
3455
|
+
"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none",
|
|
3456
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
3457
|
+
),
|
|
3458
|
+
children: [
|
|
3459
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) }),
|
|
3460
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
3461
|
+
]
|
|
3462
|
+
},
|
|
3463
|
+
item.value
|
|
3464
|
+
)
|
|
3465
|
+
}
|
|
3466
|
+
)
|
|
3467
|
+
]
|
|
3468
|
+
}
|
|
3469
|
+
)
|
|
3470
|
+
}
|
|
3471
|
+
) })
|
|
3472
|
+
]
|
|
3473
|
+
}
|
|
3474
|
+
)
|
|
3475
|
+
] });
|
|
3476
|
+
}
|
|
3190
3477
|
function useMediaQuery(query) {
|
|
3191
|
-
const [matches, setMatches] =
|
|
3192
|
-
|
|
3478
|
+
const [matches, setMatches] = React6.useState(false);
|
|
3479
|
+
React6.useEffect(() => {
|
|
3193
3480
|
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
3194
3481
|
const mql = window.matchMedia(query);
|
|
3195
3482
|
const onChange = () => setMatches(mql.matches);
|
|
@@ -3243,21 +3530,21 @@ function SearchablePicker({
|
|
|
3243
3530
|
}) {
|
|
3244
3531
|
const isMdUp = useMediaQuery(MD_UP);
|
|
3245
3532
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3246
|
-
const [open, setOpen] =
|
|
3247
|
-
const searchRef =
|
|
3533
|
+
const [open, setOpen] = React6__namespace.useState(false);
|
|
3534
|
+
const searchRef = React6__namespace.useRef(null);
|
|
3248
3535
|
function setOpenState(next) {
|
|
3249
3536
|
setOpen(next);
|
|
3250
3537
|
onOpenChange?.(next);
|
|
3251
3538
|
if (!next) onQueryChange("");
|
|
3252
3539
|
}
|
|
3253
|
-
const selected =
|
|
3540
|
+
const selected = React6__namespace.useMemo(() => {
|
|
3254
3541
|
if (!value) return null;
|
|
3255
3542
|
return options.find((option) => option.id === value) ?? {
|
|
3256
3543
|
id: value,
|
|
3257
3544
|
label: selectedLabel || value
|
|
3258
3545
|
};
|
|
3259
3546
|
}, [options, selectedLabel, value]);
|
|
3260
|
-
|
|
3547
|
+
React6__namespace.useEffect(() => {
|
|
3261
3548
|
if (!open || isMdUp) return;
|
|
3262
3549
|
const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
|
|
3263
3550
|
return () => window.clearTimeout(handle);
|
|
@@ -3540,7 +3827,7 @@ function SearchablePicker({
|
|
|
3540
3827
|
] }) })
|
|
3541
3828
|
] });
|
|
3542
3829
|
}
|
|
3543
|
-
var
|
|
3830
|
+
var INPUT_CLASS3 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
3544
3831
|
var DEFAULT_LABELS = {
|
|
3545
3832
|
placeholder: "Search\u2026",
|
|
3546
3833
|
noResults: "No results",
|
|
@@ -3578,18 +3865,18 @@ function PaginatedCombobox({
|
|
|
3578
3865
|
}) {
|
|
3579
3866
|
const labels = { ...DEFAULT_LABELS, ...labelsProp };
|
|
3580
3867
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3581
|
-
const selected =
|
|
3868
|
+
const selected = React6__namespace.useMemo(
|
|
3582
3869
|
() => resolveSelected(value, items, selectedItem),
|
|
3583
3870
|
[value, items, selectedItem]
|
|
3584
3871
|
);
|
|
3585
|
-
const listItems =
|
|
3872
|
+
const listItems = React6__namespace.useMemo(() => {
|
|
3586
3873
|
if (!selected) return items;
|
|
3587
3874
|
if (items.some((item) => item.value === selected.value)) return items;
|
|
3588
3875
|
return [selected, ...items];
|
|
3589
3876
|
}, [items, selected]);
|
|
3590
|
-
const queryRef =
|
|
3591
|
-
const debounceRef =
|
|
3592
|
-
|
|
3877
|
+
const queryRef = React6__namespace.useRef("");
|
|
3878
|
+
const debounceRef = React6__namespace.useRef(null);
|
|
3879
|
+
React6__namespace.useEffect(() => {
|
|
3593
3880
|
return () => {
|
|
3594
3881
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
3595
3882
|
};
|
|
@@ -3646,7 +3933,7 @@ function PaginatedCombobox({
|
|
|
3646
3933
|
"aria-invalid": ariaInvalid,
|
|
3647
3934
|
...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
|
|
3648
3935
|
placeholder: labels.placeholder,
|
|
3649
|
-
className: cn(
|
|
3936
|
+
className: cn(INPUT_CLASS3, "pr-16")
|
|
3650
3937
|
}
|
|
3651
3938
|
),
|
|
3652
3939
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
|
|
@@ -3862,7 +4149,7 @@ function PasswordInput({
|
|
|
3862
4149
|
hideLabel = "Hide password",
|
|
3863
4150
|
...props
|
|
3864
4151
|
}) {
|
|
3865
|
-
const [visible, setVisible] =
|
|
4152
|
+
const [visible, setVisible] = React6__namespace.useState(false);
|
|
3866
4153
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
3867
4154
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3868
4155
|
input_js.Input,
|
|
@@ -3985,32 +4272,32 @@ function PhoneInput({
|
|
|
3985
4272
|
...props
|
|
3986
4273
|
}) {
|
|
3987
4274
|
const resolvedDefault = resolveCountry(defaultCountry, "MX");
|
|
3988
|
-
const [country, setCountry] =
|
|
4275
|
+
const [country, setCountry] = React6__namespace.useState(
|
|
3989
4276
|
() => parseIncoming(value, resolvedDefault).country
|
|
3990
4277
|
);
|
|
3991
|
-
const [national, setNational] =
|
|
4278
|
+
const [national, setNational] = React6__namespace.useState(
|
|
3992
4279
|
() => parseIncoming(value, resolvedDefault).national
|
|
3993
4280
|
);
|
|
3994
|
-
const [open, setOpen] =
|
|
3995
|
-
const [query, setQuery] =
|
|
3996
|
-
const lastEmittedRef =
|
|
4281
|
+
const [open, setOpen] = React6__namespace.useState(false);
|
|
4282
|
+
const [query, setQuery] = React6__namespace.useState("");
|
|
4283
|
+
const lastEmittedRef = React6__namespace.useRef(value);
|
|
3997
4284
|
const isMdUp = useMediaQuery(MD_UP2);
|
|
3998
4285
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3999
|
-
const searchRef =
|
|
4000
|
-
|
|
4286
|
+
const searchRef = React6__namespace.useRef(null);
|
|
4287
|
+
React6__namespace.useEffect(() => {
|
|
4001
4288
|
if (value === lastEmittedRef.current) return;
|
|
4002
4289
|
lastEmittedRef.current = value;
|
|
4003
4290
|
const next = parseIncoming(value, resolvedDefault);
|
|
4004
4291
|
setCountry(next.country);
|
|
4005
4292
|
setNational(next.national);
|
|
4006
4293
|
}, [value, resolvedDefault]);
|
|
4007
|
-
|
|
4294
|
+
React6__namespace.useEffect(() => {
|
|
4008
4295
|
if (!open || isMdUp) return;
|
|
4009
4296
|
const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
|
|
4010
4297
|
return () => window.clearTimeout(handle);
|
|
4011
4298
|
}, [isMdUp, open]);
|
|
4012
4299
|
const selected = COUNTRY_OPTIONS2.find((option) => option.id === country) ?? COUNTRY_OPTIONS2.find((option) => option.id === resolvedDefault);
|
|
4013
|
-
const filtered =
|
|
4300
|
+
const filtered = React6__namespace.useMemo(
|
|
4014
4301
|
() => filterCountries2(COUNTRY_OPTIONS2, query),
|
|
4015
4302
|
[query]
|
|
4016
4303
|
);
|
|
@@ -4256,18 +4543,18 @@ function AvatarEditor({
|
|
|
4256
4543
|
labels
|
|
4257
4544
|
}) {
|
|
4258
4545
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
4259
|
-
const canvasRef =
|
|
4260
|
-
const fileInputRef =
|
|
4261
|
-
const containerRef =
|
|
4262
|
-
const [image, setImage] =
|
|
4263
|
-
const [imageLoaded, setImageLoaded] =
|
|
4264
|
-
const [zoom, setZoom] =
|
|
4265
|
-
const [rotation, setRotation] =
|
|
4266
|
-
const [position, setPosition] =
|
|
4267
|
-
const [isDragging, setIsDragging] =
|
|
4268
|
-
const [dragStart, setDragStart] =
|
|
4269
|
-
const [showGrid, setShowGrid] =
|
|
4270
|
-
const generateOutput =
|
|
4546
|
+
const canvasRef = React6.useRef(null);
|
|
4547
|
+
const fileInputRef = React6.useRef(null);
|
|
4548
|
+
const containerRef = React6.useRef(null);
|
|
4549
|
+
const [image, setImage] = React6.useState(null);
|
|
4550
|
+
const [imageLoaded, setImageLoaded] = React6.useState(false);
|
|
4551
|
+
const [zoom, setZoom] = React6.useState(1);
|
|
4552
|
+
const [rotation, setRotation] = React6.useState(0);
|
|
4553
|
+
const [position, setPosition] = React6.useState({ x: 0, y: 0 });
|
|
4554
|
+
const [isDragging, setIsDragging] = React6.useState(false);
|
|
4555
|
+
const [dragStart, setDragStart] = React6.useState({ x: 0, y: 0 });
|
|
4556
|
+
const [showGrid, setShowGrid] = React6.useState(initialShowGrid);
|
|
4557
|
+
const generateOutput = React6.useCallback(() => {
|
|
4271
4558
|
if (!canvasRef.current || !image) return null;
|
|
4272
4559
|
const outputCanvas = document.createElement("canvas");
|
|
4273
4560
|
outputCanvas.width = outputSize;
|
|
@@ -4278,7 +4565,7 @@ function AvatarEditor({
|
|
|
4278
4565
|
const mimeType = `image/${outputFormat}`;
|
|
4279
4566
|
return outputCanvas.toDataURL(mimeType, outputQuality);
|
|
4280
4567
|
}, [image, outputSize, outputFormat, outputQuality]);
|
|
4281
|
-
|
|
4568
|
+
React6.useEffect(() => {
|
|
4282
4569
|
if (!canvasRef.current || !image || !imageLoaded) return;
|
|
4283
4570
|
const canvas = canvasRef.current;
|
|
4284
4571
|
const ctx = canvas.getContext("2d");
|
|
@@ -4322,12 +4609,12 @@ function AvatarEditor({
|
|
|
4322
4609
|
generateOutput,
|
|
4323
4610
|
onChange
|
|
4324
4611
|
]);
|
|
4325
|
-
const resetTransforms =
|
|
4612
|
+
const resetTransforms = React6.useCallback(() => {
|
|
4326
4613
|
setZoom(1);
|
|
4327
4614
|
setRotation(0);
|
|
4328
4615
|
setPosition({ x: 0, y: 0 });
|
|
4329
4616
|
}, []);
|
|
4330
|
-
const handleFileSelect =
|
|
4617
|
+
const handleFileSelect = React6.useCallback(
|
|
4331
4618
|
(e) => {
|
|
4332
4619
|
const file = e.target.files?.[0];
|
|
4333
4620
|
if (!file) return;
|
|
@@ -4346,7 +4633,7 @@ function AvatarEditor({
|
|
|
4346
4633
|
},
|
|
4347
4634
|
[resetTransforms]
|
|
4348
4635
|
);
|
|
4349
|
-
const handleMouseDown =
|
|
4636
|
+
const handleMouseDown = React6.useCallback(
|
|
4350
4637
|
(e) => {
|
|
4351
4638
|
if (!imageLoaded) return;
|
|
4352
4639
|
setIsDragging(true);
|
|
@@ -4354,7 +4641,7 @@ function AvatarEditor({
|
|
|
4354
4641
|
},
|
|
4355
4642
|
[imageLoaded, position]
|
|
4356
4643
|
);
|
|
4357
|
-
const handleMouseMove =
|
|
4644
|
+
const handleMouseMove = React6.useCallback(
|
|
4358
4645
|
(e) => {
|
|
4359
4646
|
if (!isDragging) return;
|
|
4360
4647
|
setPosition({
|
|
@@ -4364,10 +4651,10 @@ function AvatarEditor({
|
|
|
4364
4651
|
},
|
|
4365
4652
|
[isDragging, dragStart]
|
|
4366
4653
|
);
|
|
4367
|
-
const handleMouseUp =
|
|
4654
|
+
const handleMouseUp = React6.useCallback(() => {
|
|
4368
4655
|
setIsDragging(false);
|
|
4369
4656
|
}, []);
|
|
4370
|
-
const handleTouchStart =
|
|
4657
|
+
const handleTouchStart = React6.useCallback(
|
|
4371
4658
|
(e) => {
|
|
4372
4659
|
if (!imageLoaded) return;
|
|
4373
4660
|
const touch = e.touches[0];
|
|
@@ -4379,7 +4666,7 @@ function AvatarEditor({
|
|
|
4379
4666
|
},
|
|
4380
4667
|
[imageLoaded, position]
|
|
4381
4668
|
);
|
|
4382
|
-
const handleTouchMove =
|
|
4669
|
+
const handleTouchMove = React6.useCallback(
|
|
4383
4670
|
(e) => {
|
|
4384
4671
|
if (!isDragging) return;
|
|
4385
4672
|
const touch = e.touches[0];
|
|
@@ -4390,7 +4677,7 @@ function AvatarEditor({
|
|
|
4390
4677
|
},
|
|
4391
4678
|
[isDragging, dragStart]
|
|
4392
4679
|
);
|
|
4393
|
-
const handleDiscard =
|
|
4680
|
+
const handleDiscard = React6.useCallback(() => {
|
|
4394
4681
|
setImage(null);
|
|
4395
4682
|
setImageLoaded(false);
|
|
4396
4683
|
resetTransforms();
|
|
@@ -4761,8 +5048,8 @@ function AvatarEditor({
|
|
|
4761
5048
|
);
|
|
4762
5049
|
}
|
|
4763
5050
|
function useMediaQuery2(query) {
|
|
4764
|
-
const [matches, setMatches] =
|
|
4765
|
-
|
|
5051
|
+
const [matches, setMatches] = React6.useState(false);
|
|
5052
|
+
React6.useEffect(() => {
|
|
4766
5053
|
const media = window.matchMedia(query);
|
|
4767
5054
|
if (media.matches !== matches) {
|
|
4768
5055
|
setMatches(media.matches);
|
|
@@ -4792,17 +5079,17 @@ function AvatarEditorDialog({
|
|
|
4792
5079
|
className,
|
|
4793
5080
|
editorLabels
|
|
4794
5081
|
}) {
|
|
4795
|
-
const [isOpen, setIsOpen] =
|
|
4796
|
-
const [editedValue, setEditedValue] =
|
|
4797
|
-
const [displaySrc, setDisplaySrc] =
|
|
4798
|
-
const [isSaving, setIsSaving] =
|
|
4799
|
-
const [feedback, setFeedback] =
|
|
4800
|
-
|
|
5082
|
+
const [isOpen, setIsOpen] = React6.useState(false);
|
|
5083
|
+
const [editedValue, setEditedValue] = React6.useState(value ?? null);
|
|
5084
|
+
const [displaySrc, setDisplaySrc] = React6.useState(value ?? null);
|
|
5085
|
+
const [isSaving, setIsSaving] = React6.useState(false);
|
|
5086
|
+
const [feedback, setFeedback] = React6.useState(null);
|
|
5087
|
+
React6.useEffect(() => {
|
|
4801
5088
|
setDisplaySrc(value ?? null);
|
|
4802
5089
|
}, [value]);
|
|
4803
5090
|
const isMobile = useMediaQuery2("(max-width: 640px)");
|
|
4804
5091
|
const caption = (placeholder ?? "").trim();
|
|
4805
|
-
const handleOpenChange =
|
|
5092
|
+
const handleOpenChange = React6.useCallback(
|
|
4806
5093
|
(open) => {
|
|
4807
5094
|
if (open) {
|
|
4808
5095
|
setEditedValue(value ?? null);
|
|
@@ -4812,7 +5099,7 @@ function AvatarEditorDialog({
|
|
|
4812
5099
|
},
|
|
4813
5100
|
[value]
|
|
4814
5101
|
);
|
|
4815
|
-
const handleAccept =
|
|
5102
|
+
const handleAccept = React6.useCallback(async () => {
|
|
4816
5103
|
if (!editedValue) return;
|
|
4817
5104
|
setIsSaving(true);
|
|
4818
5105
|
setFeedback(null);
|
|
@@ -5079,10 +5366,10 @@ function FileDropzone({
|
|
|
5079
5366
|
className
|
|
5080
5367
|
}) {
|
|
5081
5368
|
const labels = { ...DEFAULT_FILE_DROPZONE_LABELS, ...labelOverrides };
|
|
5082
|
-
const inputId =
|
|
5083
|
-
const inputRef =
|
|
5084
|
-
const [dragging, setDragging] =
|
|
5085
|
-
const [message, setMessage] =
|
|
5369
|
+
const inputId = React6.useId();
|
|
5370
|
+
const inputRef = React6.useRef(null);
|
|
5371
|
+
const [dragging, setDragging] = React6.useState(false);
|
|
5372
|
+
const [message, setMessage] = React6.useState(null);
|
|
5086
5373
|
function takeFile(file) {
|
|
5087
5374
|
if (!file || disabled) return;
|
|
5088
5375
|
if (!fileMatchesAccept(file, accept)) {
|
|
@@ -5336,7 +5623,7 @@ function FileUploadMenu({
|
|
|
5336
5623
|
}) {
|
|
5337
5624
|
const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
|
|
5338
5625
|
const visible = jobs.filter((job) => job.status !== "cancelled");
|
|
5339
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
5626
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React6.useState(false);
|
|
5340
5627
|
const isControlled = open !== void 0;
|
|
5341
5628
|
const resolvedOpen = isControlled ? open : uncontrolledOpen;
|
|
5342
5629
|
function setResolvedOpen(next) {
|
|
@@ -5947,10 +6234,10 @@ function CookieConsentBanner({
|
|
|
5947
6234
|
className
|
|
5948
6235
|
}) {
|
|
5949
6236
|
const copy = { ...DEFAULT_COOKIE_CONSENT_BANNER_LABELS, ...labels };
|
|
5950
|
-
const [consent, setConsent] =
|
|
6237
|
+
const [consent, setConsent] = React6.useState(
|
|
5951
6238
|
"pending"
|
|
5952
6239
|
);
|
|
5953
|
-
|
|
6240
|
+
React6.useEffect(() => {
|
|
5954
6241
|
if (variant === "embed" || isEmbeddedWindow()) {
|
|
5955
6242
|
setConsent("necessary");
|
|
5956
6243
|
return;
|
|
@@ -6427,7 +6714,7 @@ function FormSection({
|
|
|
6427
6714
|
);
|
|
6428
6715
|
}
|
|
6429
6716
|
function useDirtyGuard(dirty) {
|
|
6430
|
-
|
|
6717
|
+
React6.useEffect(() => {
|
|
6431
6718
|
if (!dirty) return;
|
|
6432
6719
|
function onBeforeUnload(event) {
|
|
6433
6720
|
event.preventDefault();
|
|
@@ -6579,7 +6866,7 @@ function useQueueKeys({
|
|
|
6579
6866
|
selectedId,
|
|
6580
6867
|
onSelect
|
|
6581
6868
|
}) {
|
|
6582
|
-
const move =
|
|
6869
|
+
const move = React6.useCallback(
|
|
6583
6870
|
(delta) => {
|
|
6584
6871
|
if (ids.length === 0) return;
|
|
6585
6872
|
const currentIndex = selectedId ? ids.indexOf(selectedId) : -1;
|
|
@@ -6594,7 +6881,7 @@ function useQueueKeys({
|
|
|
6594
6881
|
},
|
|
6595
6882
|
[ids, onSelect, selectedId]
|
|
6596
6883
|
);
|
|
6597
|
-
|
|
6884
|
+
React6.useEffect(() => {
|
|
6598
6885
|
if (!enabled) return;
|
|
6599
6886
|
function onKeyDown(event) {
|
|
6600
6887
|
if (isTypingTarget(event.target)) return;
|
|
@@ -6698,8 +6985,8 @@ function prefersReducedMotion() {
|
|
|
6698
6985
|
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6699
6986
|
}
|
|
6700
6987
|
function useSectionNav(sections) {
|
|
6701
|
-
const [active, setActive] =
|
|
6702
|
-
|
|
6988
|
+
const [active, setActive] = React6.useState(sections[0]?.id ?? "");
|
|
6989
|
+
React6.useEffect(() => {
|
|
6703
6990
|
const elements = sections.map((section) => document.getElementById(section.id)).filter((node) => node !== null);
|
|
6704
6991
|
if (elements.length === 0) return;
|
|
6705
6992
|
const observer = new IntersectionObserver(
|
|
@@ -7178,8 +7465,8 @@ function MatchReview({
|
|
|
7178
7465
|
className
|
|
7179
7466
|
}) {
|
|
7180
7467
|
const copy = { ...DEFAULT_MATCH_REVIEW_LABELS, ...labels };
|
|
7181
|
-
const reasonId =
|
|
7182
|
-
const [reason, setReason] =
|
|
7468
|
+
const reasonId = React6.useId();
|
|
7469
|
+
const [reason, setReason] = React6.useState("");
|
|
7183
7470
|
const trimmed = reason.trim();
|
|
7184
7471
|
if (!hit) {
|
|
7185
7472
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7362,6 +7649,7 @@ exports.QueueLayout = QueueLayout;
|
|
|
7362
7649
|
exports.RfcInput = RfcInput;
|
|
7363
7650
|
exports.RiskBadge = RiskBadge;
|
|
7364
7651
|
exports.RouteLoading = RouteLoading;
|
|
7652
|
+
exports.SAT_TAX_REGIME_CODES = SAT_TAX_REGIME_CODES;
|
|
7365
7653
|
exports.SafeImage = SafeImage;
|
|
7366
7654
|
exports.SearchablePicker = SearchablePicker;
|
|
7367
7655
|
exports.SectionCard = SectionCard;
|
|
@@ -7374,11 +7662,13 @@ exports.StatHighlightCard = StatHighlightCard;
|
|
|
7374
7662
|
exports.StatusBadge = StatusBadge;
|
|
7375
7663
|
exports.StepProgress = StepProgress;
|
|
7376
7664
|
exports.StickyActionBar = StickyActionBar;
|
|
7665
|
+
exports.TAX_REGIME_OPTIONS = TAX_REGIME_OPTIONS;
|
|
7377
7666
|
exports.THEME_INIT_SCRIPT = THEME_INIT_SCRIPT;
|
|
7378
7667
|
exports.THEME_INIT_SCRIPT_ID = THEME_INIT_SCRIPT_ID;
|
|
7379
7668
|
exports.THEME_STORAGE_KEY = THEME_STORAGE_KEY;
|
|
7380
7669
|
exports.TIME_RANGE_OPTIONS = TIME_RANGE_OPTIONS;
|
|
7381
7670
|
exports.TableSkeleton = TableSkeleton;
|
|
7671
|
+
exports.TaxRegimePicker = TaxRegimePicker;
|
|
7382
7672
|
exports.ThemeSwitcher = ThemeSwitcher;
|
|
7383
7673
|
exports.TimeRangePicker = TimeRangePicker;
|
|
7384
7674
|
exports.WizardLayout = WizardLayout;
|
|
@@ -7394,12 +7684,15 @@ exports.dataTableBodyMinClass = dataTableBodyMinClass;
|
|
|
7394
7684
|
exports.defaultLanguages = defaultLanguages;
|
|
7395
7685
|
exports.fileMatchesAccept = fileMatchesAccept;
|
|
7396
7686
|
exports.filterCountries = filterCountries;
|
|
7687
|
+
exports.filterTaxRegimes = filterTaxRegimes;
|
|
7397
7688
|
exports.formatCountryOptionLabel = formatCountryOptionLabel;
|
|
7689
|
+
exports.formatTaxRegimeOptionLabel = formatTaxRegimeOptionLabel;
|
|
7398
7690
|
exports.getAvatarColors = getAvatarColors;
|
|
7399
7691
|
exports.getInitials = getInitials;
|
|
7400
7692
|
exports.isCookieConsentValue = isCookieConsentValue;
|
|
7401
7693
|
exports.isEmbeddedWindow = isEmbeddedWindow;
|
|
7402
7694
|
exports.isKnownCountryCode = isKnownCountryCode;
|
|
7695
|
+
exports.isKnownTaxRegimeCode = isKnownTaxRegimeCode;
|
|
7403
7696
|
exports.matchClaimIsUnverified = matchClaimIsUnverified;
|
|
7404
7697
|
exports.normalizeCurpInput = normalizeCurpInput;
|
|
7405
7698
|
exports.normalizeRfc = normalizeRfc;
|
|
@@ -7414,6 +7707,8 @@ exports.serializeCookieConsent = serializeCookieConsent;
|
|
|
7414
7707
|
exports.signalNavigationStart = signalNavigationStart;
|
|
7415
7708
|
exports.sourceUrlIsHttps = sourceUrlIsHttps;
|
|
7416
7709
|
exports.suppressNavigationProgress = suppressNavigationProgress;
|
|
7710
|
+
exports.taxRegimeLabel = taxRegimeLabel;
|
|
7711
|
+
exports.taxRegimePickerItems = taxRegimePickerItems;
|
|
7417
7712
|
exports.useDirtyGuard = useDirtyGuard;
|
|
7418
7713
|
exports.useEditableSection = useEditableSection;
|
|
7419
7714
|
exports.useLanguageContext = useLanguageContext;
|