sales-frontend-components 0.0.68 → 0.0.70

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.js CHANGED
@@ -8,13 +8,9 @@ var method = require('sales-frontend-api/method');
8
8
  var styles = require('./modal/pre-standard/job-search-modal/job-search-modal.module.scss');
9
9
  var styles$1 = require('./step-indicator/step-indicator.module.scss');
10
10
  var styles$2 = require('./camera/camera.module.scss');
11
- var styles$3 = require('./debug-tool/debug-tool.module.scss');
12
- var salesFrontendUtils = require('sales-frontend-utils');
13
- var salesFrontendApi = require('sales-frontend-api');
14
- var styles$4 = require('./debug-tool/features/network-log/network-log.module.scss');
15
- var styles$5 = require('./modal/standard/address-search/select-address.module.scss');
16
- var styles$6 = require('./modal/pre-standard/job-vehicle-search-modal/job-vehicle-search-modal.module.scss');
17
- var styles$7 = require('./modal/pre-standard/vehicle-search-modal/vehicle-search-modal.module.scss');
11
+ var styles$3 = require('./modal/standard/address-search/select-address.module.scss');
12
+ var styles$4 = require('./modal/pre-standard/job-vehicle-search-modal/job-vehicle-search-modal.module.scss');
13
+ var styles$5 = require('./modal/pre-standard/vehicle-search-modal/vehicle-search-modal.module.scss');
18
14
 
19
15
  const FormCheckboxButton = ({
20
16
  name,
@@ -654,7 +650,6 @@ const FormSearchJobField = ({
654
650
  name,
655
651
  control,
656
652
  disabled,
657
- rootProps,
658
653
  error,
659
654
  size = "medium",
660
655
  placeholder = "\uC9C1\uC885 \uAC80\uC0C9",
@@ -672,21 +667,16 @@ const FormSearchJobField = ({
672
667
  }, [selectedJob]);
673
668
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
674
669
  /* @__PURE__ */ jsxRuntime.jsx(
675
- salesFrontendDesignSystem.FormField.TextField,
670
+ salesFrontendDesignSystem.FormField.ComboBox,
676
671
  {
677
672
  ...props,
678
673
  ...field,
679
674
  id: field.name,
680
675
  error: fieldState.invalid || error,
681
676
  value: selected?.occupationIndustryName ?? "",
682
- rootProps: {
683
- ...rootProps,
684
- endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "sub-ui/search" })
685
- },
686
- readOnly: true,
677
+ icon: "search",
687
678
  size,
688
679
  placeholder,
689
- style: { background: "#fff", cursor: "pointer" },
690
680
  autoComplete: "off",
691
681
  onClick: openJobSearchModal
692
682
  }
@@ -1385,758 +1375,7 @@ function useCanvasPaint(paintProps = {}) {
1385
1375
 
1386
1376
  const testSignatureBase64Data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAABkCAYAAACoy2Z3AAAQAElEQVR4AeydV6g2ORnHj733smvBiliws9jbhYoFREVQsYIFVBBRUBQRvbCgKIgFCyqoCCqiXiioN/ZesKEXYlkVXV11Xdde/z+/L/u95z0zSeadlmT+h+RkJvMkeZ5/kudJm3kveeQ/I1AvAncX67+S/+8B/glKM6X7uzIbwofI7YxA3QjYgNRdf1vl/p4S/Dz5L8qfLT/UfVkJLpSfymE8LjtVZs7HCNSCgA1ILTVlPkHg4/r3Z/nPy19XPteh4En7ICW4sjwzl48qHOMwQP9RBsw6hhoP0h0dKbGdEagZARuQmmuvfd6fLhF/Kv9veRT1gxVeUT7HMUN5nwjvKn95+YfKf0IeA6RglIOfqyiHS8jnun+IEHr8pXRtZwSqR8AGpPoqbE6Ar0miv8pjMN6q8Mbyue30t6J9vjxKmqWtx+n6q/JTOWYy8JXDz67BgJ/LTcWE8zECpSCQ0xFK4XWPD982gsBLJMfv5VHM+HN0zYxBQbY7V5S3l2dZ6zUKp3bMWuAtd6nqn2LABkMg2LWNgA1I2/VbqnTvFmP/kkcpv0zhNeQPcT9SolvIM0v5rsKpXTAcuctmyMPMI9fQTM2v8zMCiyJgA7Io3JstjKUolpcYmaNkOUJ76D4A6X8oJK8vj/HAiOhyUjfUcDCDYpmK/rSJmcekaDuzahGgwVfLvBkvFoEPiTNOGqHs8WyGX1txl5Y/xGF4vqWEN5Knzd5a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BF1sQAjYgBVWGWTECRsAI1ISADUhNtWVejYARMAIFIWADUlBlLMGKyzACRsAITIWADchUSDofI2AEjMDGELAB2ViFW1wjYATWQqC9cm1A2qtTS2QEjIARWAQBG5BFYHYhRsAIGIH2ELABaa9OW5XIchkBI1AYAjYghVWI2TECRsAI1IKADUgtNWU+jYARMAJrIdBTrg1IDzCONgJGwAgYgTgCNiBxfPzUCBgBI2AEehCwAekBxtFGYDoEnJMRaBMBG5A269VSGQEjYARmR8AGZHaIXYARMAJGoE0EajAgbSJvqYyAETAClSNgA1J5BZp9I2AEjMBaCNiArIW8yzUCNSBgHo1ABAEbkAg4fmQEjIARMAL9CNiA9GPjJ0bACBgBIxBBwAYkAs74R87BCBgBI9AuAjYg7datJTMCRsAIzIqADcis8DpzI2AE1kLA5c6PwP8AAAD//+3/3TsAAAAGSURBVAMAJI6e9smFlTAAAAAASUVORK5CYII=";
1387
1377
 
1388
- const FloatingButton = ({ onClick }) => {
1389
- const [position, setPosition] = React.useState({ x: 0, y: 0 });
1390
- const [isDragging, setIsDragging] = React.useState(false);
1391
- const dragHappened = React.useRef(false);
1392
- const dragStartPos = React.useRef({ x: 0, y: 0 });
1393
- const elementStartPos = React.useRef({ x: 0, y: 0 });
1394
- const handleMouseDown = (e) => {
1395
- if (e.button !== 0) {
1396
- return;
1397
- }
1398
- dragHappened.current = false;
1399
- setIsDragging(true);
1400
- dragStartPos.current = { x: e.clientX, y: e.clientY };
1401
- elementStartPos.current = { ...position };
1402
- const handleMouseMove = (event) => {
1403
- const dx = event.clientX - dragStartPos.current.x;
1404
- const dy = event.clientY - dragStartPos.current.y;
1405
- if (!dragHappened.current && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {
1406
- dragHappened.current = true;
1407
- }
1408
- setPosition({
1409
- x: elementStartPos.current.x + dx,
1410
- y: elementStartPos.current.y + dy
1411
- });
1412
- };
1413
- const handleMouseUp = () => {
1414
- window.removeEventListener("mousemove", handleMouseMove);
1415
- window.removeEventListener("mouseup", handleMouseUp);
1416
- setIsDragging(false);
1417
- };
1418
- window.addEventListener("mousemove", handleMouseMove);
1419
- window.addEventListener("mouseup", handleMouseUp);
1420
- };
1421
- const handleClick = (e) => {
1422
- if (dragHappened.current) {
1423
- e.preventDefault();
1424
- e.stopPropagation();
1425
- return;
1426
- }
1427
- onClick();
1428
- };
1429
- return /* @__PURE__ */ jsxRuntime.jsx(
1430
- salesFrontendDesignSystem.Button,
1431
- {
1432
- variant: "secondary",
1433
- appearance: "filled",
1434
- size: "xsmall",
1435
- className: styles$3["debug-floating-button"],
1436
- style: {
1437
- transform: `translate(${position.x}px, ${position.y}px)`,
1438
- cursor: isDragging ? "grabbing" : "grab"
1439
- },
1440
- onMouseDown: handleMouseDown,
1441
- onClick: handleClick,
1442
- children: "DEBUG"
1443
- }
1444
- );
1445
- };
1446
-
1447
- const MenuPanel = ({ menuItems, onMenuItemClick, onClose }) => {
1448
- return /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "small", children: [
1449
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
1450
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1451
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "Debug Menu", showCloseButton: true }),
1452
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.List, { selectable: true, children: menuItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.ListItem, { onClick: () => onMenuItemClick(item.component), children: item.label }, item.id)) }) })
1453
- ] })
1454
- ] });
1455
- };
1456
-
1457
- let globalLogs = [];
1458
- let listeners = [];
1459
- const originalConsoleMethods = {};
1460
- let isConsoleOverridden = false;
1461
- const addLog = (type, ...args) => {
1462
- const newLog = {
1463
- id: Date.now() + Math.random(),
1464
- type,
1465
- timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
1466
- message: args
1467
- };
1468
- globalLogs = [...globalLogs, newLog];
1469
- listeners.forEach((listener) => listener([...globalLogs]));
1470
- };
1471
- const initializeConsoleLogOverride = () => {
1472
- if (!salesFrontendUtils.isClient() || isConsoleOverridden) {
1473
- return;
1474
- }
1475
- const logTypes = ["log", "info", "warn", "error", "debug"];
1476
- logTypes.forEach((type) => {
1477
- originalConsoleMethods[type] = console[type];
1478
- console[type] = (...args) => {
1479
- if (originalConsoleMethods[type]) {
1480
- originalConsoleMethods[type]?.apply(console, args);
1481
- }
1482
- addLog(type, ...args);
1483
- };
1484
- });
1485
- isConsoleOverridden = true;
1486
- };
1487
- const restoreConsoleLog = () => {
1488
- if (!salesFrontendUtils.isClient() || !isConsoleOverridden) {
1489
- return;
1490
- }
1491
- const logTypes = ["log", "info", "warn", "error", "debug"];
1492
- logTypes.forEach((type) => {
1493
- if (originalConsoleMethods[type]) {
1494
- console[type] = originalConsoleMethods[type];
1495
- }
1496
- });
1497
- isConsoleOverridden = false;
1498
- };
1499
- const useConsoleLog = () => {
1500
- const [logs, setLogs] = React.useState(globalLogs);
1501
- React.useEffect(() => {
1502
- listeners.push(setLogs);
1503
- return () => {
1504
- listeners = listeners.filter((l) => l !== setLogs);
1505
- };
1506
- }, []);
1507
- const clearLogs = React.useCallback(() => {
1508
- globalLogs = [];
1509
- listeners.forEach((listener) => listener([]));
1510
- }, []);
1511
- return { logs, clearLogs };
1512
- };
1513
-
1514
- const safeStringify$1 = (obj) => {
1515
- try {
1516
- return JSON.stringify(obj, null, 2);
1517
- } catch (e) {
1518
- return "[Unserializable Object]";
1519
- }
1520
- };
1521
- const LogMessage = ({ entry }) => {
1522
- const messageParts = entry.message.map((part) => {
1523
- if (typeof part === "object" && part !== null) {
1524
- return safeStringify$1(part);
1525
- }
1526
- return String(part);
1527
- });
1528
- return /* @__PURE__ */ jsxRuntime.jsx("pre", { className: `${styles$3["log-message"]} ${styles$3[`log-${entry.type}`]}`, children: messageParts.join(" ") });
1529
- };
1530
- const ConsoleLogPanel = ({ onClose }) => {
1531
- const { logs, clearLogs } = useConsoleLog();
1532
- const [filter, setFilter] = React.useState("all");
1533
- const logContainerRef = React.useRef(null);
1534
- const filteredLogs = React.useMemo(() => {
1535
- if (filter === "all") {
1536
- return logs;
1537
- }
1538
- return logs.filter((log) => log.type === filter);
1539
- }, [logs, filter]);
1540
- React.useEffect(() => {
1541
- if (logContainerRef.current) {
1542
- logContainerRef.current.scrollTop = logContainerRef.current.scrollHeight;
1543
- }
1544
- }, [filteredLogs]);
1545
- return /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1546
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "Console Logs", showCloseButton: true }),
1547
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
1548
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["panel-toolbar"], children: [
1549
- /* @__PURE__ */ jsxRuntime.jsxs(
1550
- salesFrontendDesignSystem.Segment.Root,
1551
- {
1552
- size: "xsmall",
1553
- appearance: "outline",
1554
- align: "left",
1555
- defaultValue: filter,
1556
- onValueChange: (value) => setFilter(value),
1557
- children: [
1558
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Segment.Item, { value: "all", children: "All" }),
1559
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Segment.Item, { value: "log", children: "Log" }),
1560
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Segment.Item, { value: "warn", children: "Warn" }),
1561
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Segment.Item, { value: "error", children: "Error" })
1562
- ]
1563
- }
1564
- ),
1565
- /* @__PURE__ */ jsxRuntime.jsx(
1566
- salesFrontendDesignSystem.Button,
1567
- {
1568
- variant: "neutral",
1569
- appearance: "outline",
1570
- size: "xsmall",
1571
- onClick: clearLogs,
1572
- style: { marginLeft: "auto" },
1573
- children: "Clear"
1574
- }
1575
- )
1576
- ] }),
1577
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3["log-list-container"], ref: logContainerRef, children: filteredLogs.map((log) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["log-item"], children: [
1578
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$3["log-timestamp"], children: log.timestamp }),
1579
- /* @__PURE__ */ jsxRuntime.jsx(LogMessage, { entry: log })
1580
- ] }, log.id)) })
1581
- ] })
1582
- ] }) });
1583
- };
1584
-
1585
- const LoginPanel = ({ onClose, onLogin }) => {
1586
- const [selectedTypeId, setSelectedTypeId] = React.useState(loginTypes[0]?.id || "");
1587
- const [formData, setFormData] = React.useState({});
1588
- const selectedType = React.useMemo(() => loginTypes.find((t) => t.id === selectedTypeId), [selectedTypeId]);
1589
- const handleInputChange = (e) => {
1590
- const { name, value } = e.target;
1591
- setFormData((prev) => ({ ...prev, [name]: value }));
1592
- };
1593
- const handleSubmit = (e) => {
1594
- e.preventDefault();
1595
- if (selectedType) {
1596
- onLogin(selectedType.id, formData);
1597
- onClose();
1598
- }
1599
- };
1600
- React.useEffect(() => {
1601
- setFormData({});
1602
- }, [selectedType]);
1603
- return /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1604
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uAC04\uD3B8 \uB85C\uADF8\uC778", showCloseButton: true }),
1605
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: styles$3["login-form-container"], onSubmit: handleSubmit, children: [
1606
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.FormField.FieldControl, { children: [
1607
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.FormField.Label, { htmlFor: "login-type-select", children: "\uB85C\uADF8\uC778 \uC720\uD615" }),
1608
- /* @__PURE__ */ jsxRuntime.jsx(
1609
- salesFrontendDesignSystem.Select,
1610
- {
1611
- value: selectedTypeId,
1612
- onChange: setSelectedTypeId,
1613
- size: "xsmall",
1614
- rootProps: { style: { width: "100%" } },
1615
- children: loginTypes.map((type) => /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Select.Option, { value: type.id, children: type.label }, type.id))
1616
- }
1617
- )
1618
- ] }),
1619
- selectedType?.fields.map((field) => /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.FormField.FieldControl, { children: [
1620
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.FormField.Label, { htmlFor: field.name, children: field.label }),
1621
- /* @__PURE__ */ jsxRuntime.jsx(
1622
- salesFrontendDesignSystem.FormField.TextField,
1623
- {
1624
- size: "xsmall",
1625
- type: field.type,
1626
- id: field.name,
1627
- name: field.name,
1628
- placeholder: field.placeholder,
1629
- value: formData[field.name] || "",
1630
- onChange: handleInputChange,
1631
- required: true
1632
- }
1633
- )
1634
- ] }, field.name)),
1635
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3["form-actions"], children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { type: "submit", variant: "primary", appearance: "filled", size: "xsmall", children: "\uB85C\uADF8\uC778" }) })
1636
- ] }) })
1637
- ] }) });
1638
- };
1639
-
1640
- const SEARCH_SECTIONS = [
1641
- { value: "all", label: "\uC804\uCCB4" },
1642
- { value: "url", label: "\uC8FC\uC18C" },
1643
- { value: "headers", label: "\uD5E4\uB354" },
1644
- { value: "params", label: "\uD30C\uB77C\uBBF8\uD130" },
1645
- { value: "data", label: "\uC694\uCCAD" },
1646
- { value: "response", label: "\uC751\uB2F5" },
1647
- { value: "error", label: "\uC5D0\uB7EC" }
1648
- ];
1649
- const getLogInfo = (log) => {
1650
- if (log.holdStatus === "held") {
1651
- if ("request" in log) {
1652
- return log.request;
1653
- }
1654
- if ("response" in log) {
1655
- return log.response;
1656
- }
1657
- if ("error" in log) {
1658
- return log.error;
1659
- }
1660
- }
1661
- return log;
1662
- };
1663
- const NetworkLog = ({ onClose }) => {
1664
- const {
1665
- requests,
1666
- responses,
1667
- errors,
1668
- clear,
1669
- isHold,
1670
- toggleHold,
1671
- heldRequests,
1672
- heldResponses,
1673
- heldErrors,
1674
- playAllRequests,
1675
- playAllResponses
1676
- } = salesFrontendApi.useDebugStore();
1677
- const [searchTerm, setSearchTerm] = React.useState("");
1678
- const [searchSection, setSearchSection] = React.useState(SEARCH_SECTIONS[0]?.value);
1679
- const allLogs = React.useMemo(() => {
1680
- const logs = [];
1681
- requests.forEach((req) => logs.push({ ...req, type: "request" }));
1682
- responses.forEach((res) => logs.push({ ...res, type: "response" }));
1683
- errors.forEach((err) => logs.push({ ...err, type: "error" }));
1684
- heldRequests.forEach((req) => logs.push({ ...req, type: "request", holdStatus: "held" }));
1685
- heldResponses.forEach((res) => logs.push({ ...res, type: "response", holdStatus: "held" }));
1686
- heldErrors.forEach((err) => logs.push({ ...err, type: "error", holdStatus: "held" }));
1687
- logs.sort((a, b) => {
1688
- const aInfo = getLogInfo(a);
1689
- const bInfo = getLogInfo(b);
1690
- const aTime = "startTime" in aInfo ? aInfo.startTime : 0;
1691
- const bTime = "startTime" in bInfo ? bInfo.startTime : 0;
1692
- return bTime - aTime;
1693
- });
1694
- return logs;
1695
- }, [requests, responses, errors, heldRequests, heldResponses, heldErrors]);
1696
- const filteredLogs = React.useMemo(() => {
1697
- if (!searchTerm) {
1698
- return allLogs;
1699
- }
1700
- const lowercasedTerm = searchTerm.toLowerCase();
1701
- return allLogs.filter((log) => {
1702
- const logInfo = getLogInfo(log);
1703
- switch (searchSection) {
1704
- case "url":
1705
- return logInfo.url?.toLowerCase().includes(lowercasedTerm);
1706
- case "headers":
1707
- return "headers" in logInfo && logInfo.headers && JSON.stringify(logInfo.headers)?.toLowerCase().includes(lowercasedTerm);
1708
- case "params":
1709
- return "params" in logInfo && logInfo.params && JSON.stringify(logInfo.params)?.toLowerCase().includes(lowercasedTerm);
1710
- case "data":
1711
- return "data" in logInfo && logInfo.data && log.type === "request" && JSON.stringify(logInfo.data)?.toLowerCase().includes(lowercasedTerm);
1712
- case "response":
1713
- return "data" in logInfo && logInfo.data && log.type === "response" && JSON.stringify(logInfo.data)?.toLowerCase().includes(lowercasedTerm);
1714
- case "error":
1715
- return log.type === "error" && JSON.stringify(logInfo)?.toLowerCase().includes(lowercasedTerm);
1716
- case "all":
1717
- default:
1718
- return JSON.stringify(logInfo).toLowerCase().includes(lowercasedTerm);
1719
- }
1720
- });
1721
- }, [allLogs, searchTerm, searchSection]);
1722
- const renderLogSummary = (log) => {
1723
- const logInfo = getLogInfo(log);
1724
- const prefix = log.holdStatus === "held" ? "[HELD] " : "";
1725
- if (log.type === "request") {
1726
- return `${prefix}[REQ] ${logInfo.method.toUpperCase()} ${logInfo.url}`;
1727
- }
1728
- if (log.type === "response" && "status" in logInfo) {
1729
- return `${prefix}[RES] ${logInfo.method.toUpperCase()} ${logInfo.url} - ${logInfo.status}`;
1730
- }
1731
- if (log.type === "error" && "message" in logInfo) {
1732
- return `${prefix}[ERR] ${logInfo.method.toUpperCase()} ${logInfo.url} - ${logInfo.message}`;
1733
- }
1734
- return "Unknown Log";
1735
- };
1736
- const renderLogContent = (log) => {
1737
- const logInfo = getLogInfo(log);
1738
- return /* @__PURE__ */ jsxRuntime.jsx("pre", { children: JSON.stringify(logInfo, null, 2) });
1739
- };
1740
- return /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: [
1741
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
1742
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1743
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uB124\uD2B8\uC6CC\uD06C \uB85C\uADF8", showCloseButton: true }),
1744
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
1745
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$4["search-container"], children: [
1746
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Select, { value: searchSection, onChange: (value) => setSearchSection(value), size: "xsmall", children: SEARCH_SECTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Select.Option, { value: option.value, children: option.label }, option.value)) }),
1747
- /* @__PURE__ */ jsxRuntime.jsx(
1748
- salesFrontendDesignSystem.FormField.TextField,
1749
- {
1750
- placeholder: "\uAC80\uC0C9...",
1751
- value: searchTerm,
1752
- size: "xsmall",
1753
- onChange: (e) => setSearchTerm(e.target.value)
1754
- }
1755
- ),
1756
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Checkbox, { id: "hold-checkbox", checked: isHold, onChange: toggleHold, size: "small", variant: "main", children: "Hold" }),
1757
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: clear, children: "clear" })
1758
- ] }),
1759
- isHold && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "row" }, children: [
1760
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { size: "xsmall", onClick: () => playAllRequests(), variant: "primary", appearance: "outline", children: "REQ Resolve" }),
1761
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { size: "xsmall", onClick: () => playAllResponses(), variant: "primary", appearance: "outline", children: "RES Resolve" })
1762
- ] }),
1763
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$4["log-list"], children: filteredLogs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: "\uD45C\uC2DC\uD560 \uB85C\uADF8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." }) : /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: filteredLogs.map((log, index) => /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Accordion.Item, { children: [
1764
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.HeaderButton, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles$4["log-summary"], children: renderLogSummary(log) }) }),
1765
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$4["log-content"], children: renderLogContent(log) }) })
1766
- ] }, index)) }) })
1767
- ] })
1768
- ] })
1769
- ] });
1770
- };
1771
-
1772
- const PageNavigationPanel = ({ onClose }) => {
1773
- const [url, setUrl] = React.useState("");
1774
- const handleNavigate = () => {
1775
- if (url) {
1776
- self.location.href = url;
1777
- }
1778
- };
1779
- return /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1780
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uD398\uC774\uC9C0 \uC774\uB3D9", showCloseButton: true }),
1781
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["page-navigation-content"], children: [
1782
- /* @__PURE__ */ jsxRuntime.jsx(
1783
- salesFrontendDesignSystem.FormField.TextField,
1784
- {
1785
- size: "xsmall",
1786
- type: "text",
1787
- value: url,
1788
- onChange: (e) => setUrl(e.target.value),
1789
- placeholder: "\uC774\uB3D9\uD560 URL\uC744 \uC785\uB825\uD558\uC138\uC694 (\uC608: /main)",
1790
- rootProps: { style: { flex: 1 } }
1791
- }
1792
- ),
1793
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", appearance: "filled", size: "xsmall", onClick: handleNavigate, children: "\uC774\uB3D9" })
1794
- ] }) })
1795
- ] }) });
1796
- };
1797
-
1798
- const safeStringify = (obj) => {
1799
- try {
1800
- const replacer = (key, value) => typeof value === "bigint" ? value.toString() : value;
1801
- return JSON.stringify(obj, replacer, 2);
1802
- } catch (e) {
1803
- return "[Unserializable Object]";
1804
- }
1805
- };
1806
- const ResultMessage = ({ log }) => {
1807
- const messageParts = log.message.map((part) => {
1808
- if (typeof part === "object" && part !== null) {
1809
- return safeStringify(part);
1810
- }
1811
- return String(part);
1812
- });
1813
- const prefix = log.type === "return" ? "\u21A9 " : "";
1814
- return /* @__PURE__ */ jsxRuntime.jsxs("pre", { className: `${styles$3["log-message"]} ${styles$3[`log-${log.type}`]}`, children: [
1815
- prefix,
1816
- messageParts.join(" ")
1817
- ] });
1818
- };
1819
- const ScriptExecutorPanel = ({ onClose }) => {
1820
- const [code, setCode] = React.useState('// \uC5EC\uAE30\uC5D0 \uC2E4\uD589\uD560 \uCF54\uB4DC\uB97C \uC785\uB825\uD558\uC138\uC694\nconsole.log("Hello, World!");');
1821
- const [results, setResults] = React.useState([]);
1822
- const addResult = (type, ...args) => {
1823
- setResults((prevResults) => [
1824
- ...prevResults,
1825
- {
1826
- id: Date.now() + Math.random(),
1827
- type,
1828
- timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
1829
- message: args
1830
- }
1831
- ]);
1832
- };
1833
- const handleExecute = () => {
1834
- const originalConsole = { ...console };
1835
- const newConsole = {
1836
- log: (...args) => {
1837
- originalConsole.log(...args);
1838
- addResult("log", ...args);
1839
- },
1840
- warn: (...args) => {
1841
- originalConsole.warn(...args);
1842
- addResult("warn", ...args);
1843
- },
1844
- error: (...args) => {
1845
- originalConsole.error(...args);
1846
- addResult("error", ...args);
1847
- }
1848
- };
1849
- try {
1850
- Object.assign(console, newConsole);
1851
- const result = new Function(code)();
1852
- if (result !== void 0) {
1853
- addResult("return", result);
1854
- }
1855
- } catch (e) {
1856
- addResult("error", e.name, e.message);
1857
- } finally {
1858
- Object.assign(console, originalConsole);
1859
- }
1860
- };
1861
- const handleClear = () => {
1862
- setResults([]);
1863
- };
1864
- return /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1865
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC2A4\uD06C\uB9BD\uD2B8 \uC2E4\uD589", showCloseButton: true }),
1866
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles$3["debug-feature-panel"]} ${styles$3["script-executor-panel"]}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["script-executor-content"], children: [
1867
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["script-input-section"], children: [
1868
- /* @__PURE__ */ jsxRuntime.jsx(
1869
- "textarea",
1870
- {
1871
- className: styles$3["script-textarea"],
1872
- value: code,
1873
- onChange: (e) => setCode(e.target.value),
1874
- spellCheck: "false"
1875
- }
1876
- ),
1877
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["script-actions"], children: [
1878
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleExecute, children: "\uC2E4\uD589 (\u25B6)" }),
1879
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleClear, children: "\uACB0\uACFC \uC9C0\uC6B0\uAE30" })
1880
- ] })
1881
- ] }),
1882
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["script-output-section"], children: [
1883
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3["panel-header"], children: /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "\uACB0\uACFC" }) }),
1884
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3["log-list-container"], children: results.map((log) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3["log-item"], children: [
1885
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$3["log-timestamp"], children: log.timestamp }),
1886
- /* @__PURE__ */ jsxRuntime.jsx(ResultMessage, { log })
1887
- ] }, log.id)) })
1888
- ] })
1889
- ] }) }) })
1890
- ] }) });
1891
- };
1892
-
1893
- const setCookie = (name, value) => {
1894
- document.cookie = `${name}=${encodeURIComponent(value)};path=/`;
1895
- };
1896
- const removeCookie = (name) => {
1897
- document.cookie = `${name}=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
1898
- };
1899
- const useStorage = (storageType) => {
1900
- const [items, setItems] = React.useState([]);
1901
- const loadItems = React.useCallback(() => {
1902
- const newItems = [];
1903
- if (storageType === "localStorage") {
1904
- for (let i = 0; i < localStorage.length; i++) {
1905
- const key = localStorage.key(i);
1906
- if (key) {
1907
- newItems.push({ key, value: localStorage.getItem(key) || "" });
1908
- }
1909
- }
1910
- } else {
1911
- const cookies = document.cookie.split(";");
1912
- cookies.forEach((cookie) => {
1913
- const parts = cookie.split("=");
1914
- const key = parts.shift()?.trim();
1915
- if (key) {
1916
- newItems.push({ key, value: decodeURIComponent(parts.join("=")) });
1917
- }
1918
- });
1919
- }
1920
- setItems(newItems);
1921
- }, [storageType]);
1922
- React.useEffect(() => {
1923
- loadItems();
1924
- }, [loadItems]);
1925
- const setItem = React.useCallback(
1926
- (key, value) => {
1927
- if (storageType === "localStorage") {
1928
- localStorage.setItem(key, value);
1929
- } else {
1930
- setCookie(key, value);
1931
- }
1932
- loadItems();
1933
- },
1934
- [storageType, loadItems]
1935
- );
1936
- const removeItem = React.useCallback(
1937
- (key) => {
1938
- if (storageType === "localStorage") {
1939
- localStorage.removeItem(key);
1940
- } else {
1941
- removeCookie(key);
1942
- }
1943
- loadItems();
1944
- },
1945
- [storageType, loadItems]
1946
- );
1947
- return { items, setItem, removeItem, loadItems };
1948
- };
1949
-
1950
- const ValueDisplay = ({ value }) => {
1951
- try {
1952
- const parsed = JSON.parse(value);
1953
- if (typeof parsed === "object" && parsed !== null) {
1954
- return /* @__PURE__ */ jsxRuntime.jsx("pre", { className: styles$3["log-content"], children: JSON.stringify(parsed, null, 2) });
1955
- }
1956
- } catch (e) {
1957
- }
1958
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3["log-content"], children: value });
1959
- };
1960
- const EditableRow = ({ item, onSave, onRemove }) => {
1961
- const [isEditing, setIsEditing] = React.useState(false);
1962
- const [value, setValue] = React.useState(item.value);
1963
- const handleSave = () => {
1964
- onSave(item.key, value);
1965
- setIsEditing(false);
1966
- };
1967
- const handleEdit = () => {
1968
- setValue(item.value);
1969
- setIsEditing(true);
1970
- };
1971
- return /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Accordion.Item, { children: [
1972
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Accordion.HeaderButton, { children: [
1973
- " ",
1974
- item.key
1975
- ] }),
1976
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Accordion.Content, { variant: "text", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [
1977
- isEditing ? /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleSave, children: "Save" }) : /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleEdit, children: "Edit" }),
1978
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: () => onRemove(item.key), children: "Remove" }),
1979
- isEditing ? /* @__PURE__ */ jsxRuntime.jsx("textarea", { value, onChange: (e) => setValue(e.target.value) }) : /* @__PURE__ */ jsxRuntime.jsx(ValueDisplay, { value: item.value })
1980
- ] })
1981
- ] }) });
1982
- };
1983
- const StoragePanel = ({ onClose, storageType }) => {
1984
- const { items, setItem, removeItem } = useStorage(storageType);
1985
- const [filter, setFilter] = React.useState("");
1986
- const filteredItems = React.useMemo(() => {
1987
- if (!filter) {
1988
- return items;
1989
- }
1990
- return items.filter(
1991
- (item) => item.key.toLowerCase().includes(filter.toLowerCase()) || item.value.toLowerCase().includes(filter.toLowerCase())
1992
- );
1993
- }, [items, filter]);
1994
- return /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1995
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: storageType === "localStorage" ? "Local Storage" : "Cookies", showCloseButton: true }),
1996
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
1997
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3["panel-toolbar"], children: /* @__PURE__ */ jsxRuntime.jsx(
1998
- salesFrontendDesignSystem.FormField.TextField,
1999
- {
2000
- placeholder: "Search key or value...",
2001
- size: "xsmall",
2002
- value: filter,
2003
- onChange: (e) => setFilter(e.target.value),
2004
- rootProps: { style: { width: "100%" } }
2005
- }
2006
- ) }),
2007
- /* @__PURE__ */ jsxRuntime.jsx("ul", { children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(EditableRow, { item, onSave: setItem, onRemove: removeItem }) }, item.key)) })
2008
- ] })
2009
- ] }) });
2010
- };
2011
-
2012
- const loginTypes = [
2013
- {
2014
- id: "fp",
2015
- label: "FP \uB85C\uADF8\uC778",
2016
- fields: [{ name: "employeeId", label: "\uC0AC\uBC88", type: "text", placeholder: "\uC0AC\uBC88\uC744 \uC785\uB825\uD558\uC138\uC694" }]
2017
- },
2018
- {
2019
- id: "customer",
2020
- label: "\uACE0\uAC1D \uB85C\uADF8\uC778",
2021
- fields: [
2022
- { name: "name", label: "\uC774\uB984", type: "text", placeholder: "\uC774\uB984" },
2023
- { name: "phone", label: "\uC804\uD654\uBC88\uD638", type: "tel", placeholder: "\uC804\uD654\uBC88\uD638" },
2024
- { name: "residentNumber", label: "\uC8FC\uBBFC\uBC88\uD638", type: "text", placeholder: "\uC8FC\uBBFC\uBC88\uD638 \uC55E 7\uC790\uB9AC" },
2025
- { name: "userId", label: "\uC544\uC774\uB514", type: "text", placeholder: "\uC544\uC774\uB514" },
2026
- { name: "password", label: "\uBE44\uBC00\uBC88\uD638", type: "password", placeholder: "\uBE44\uBC00\uBC88\uD638" }
2027
- ]
2028
- }
2029
- ];
2030
- const menuItems = [
2031
- {
2032
- id: "network-log",
2033
- label: "\uB124\uD2B8\uC6CC\uD06C \uB85C\uADF8",
2034
- component: NetworkLog,
2035
- display: true
2036
- },
2037
- {
2038
- id: "console-log",
2039
- label: "\uCF58\uC194 \uB85C\uADF8 \uD655\uC778",
2040
- component: ConsoleLogPanel,
2041
- display: true
2042
- },
2043
- {
2044
- id: "local-storage",
2045
- label: "\uB85C\uCEEC \uC2A4\uD1A0\uB9AC\uC9C0 \uAD00\uB9AC",
2046
- // StoragePanel은 재사용 가능한 컴포넌트이므로, props를 통해 어떤 스토리지를 다룰지 지정합니다.
2047
- component: (props) => /* @__PURE__ */ jsxRuntime.jsx(StoragePanel, { ...props, storageType: "localStorage" }),
2048
- display: true
2049
- },
2050
- {
2051
- id: "cookie-management",
2052
- label: "\uCFE0\uD0A4 \uAD00\uB9AC",
2053
- component: (props) => /* @__PURE__ */ jsxRuntime.jsx(StoragePanel, { ...props, storageType: "cookie" }),
2054
- display: true
2055
- },
2056
- {
2057
- id: "quick-login",
2058
- label: "\uAC04\uD3B8 \uB85C\uADF8\uC778",
2059
- component: LoginPanel,
2060
- display: true
2061
- // 실제 표시는 DebugTool.tsx에서 onLogin prop 존재 여부에 따라 결정됩니다.
2062
- },
2063
- {
2064
- id: "script-executor",
2065
- label: "\uC2A4\uD06C\uB9BD\uD2B8 \uC2E4\uD589",
2066
- component: ScriptExecutorPanel,
2067
- display: true
2068
- },
2069
- {
2070
- id: "page-navigation",
2071
- label: "\uD398\uC774\uC9C0 \uC774\uB3D9",
2072
- component: PageNavigationPanel,
2073
- display: true
2074
- }
2075
- ];
2076
-
2077
- const useEnvironment = () => {
2078
- const [envInfo, setEnvInfo] = React.useState({
2079
- env: "prd"
2080
- });
2081
- React.useEffect(() => {
2082
- const { hostname } = window.location;
2083
- setEnvInfo({ env: salesFrontendUtils.getEnvironmentFromHostname(hostname) });
2084
- }, []);
2085
- return envInfo;
2086
- };
2087
-
2088
- const DebugTool = ({ onLogin, envOverride, menuItemsOverride }) => {
2089
- React.useEffect(() => {
2090
- initializeConsoleLogOverride();
2091
- return () => {
2092
- restoreConsoleLog();
2093
- };
2094
- }, []);
2095
- const environment = useEnvironment();
2096
- const env = envOverride || environment.env;
2097
- const menuItems$1 = menuItemsOverride || menuItems;
2098
- const [isMenuOpen, setMenuOpen] = React.useState(false);
2099
- const [activeFeature, setActiveFeature] = React.useState(null);
2100
- const isVisible = ["local", "dev", "stg"].includes(env);
2101
- const handleMenuClick = (itemComponent) => {
2102
- setActiveFeature(() => itemComponent);
2103
- setMenuOpen(false);
2104
- };
2105
- const handleCloseFeature = () => {
2106
- setActiveFeature(null);
2107
- };
2108
- if (!isVisible) {
2109
- return null;
2110
- }
2111
- const toggleMenu = () => {
2112
- setMenuOpen((prev) => !prev);
2113
- if (!isMenuOpen) {
2114
- setActiveFeature(null);
2115
- }
2116
- };
2117
- const availableMenuItems = menuItems$1.filter(
2118
- (item) => item.display && // config에서 display가 true인 항목만 필터링합니다.
2119
- // 'quick-login' 기능은 onLogin prop이 제공된 경우에만 활성화합니다.
2120
- (item.id !== "quick-login" || item.id === "quick-login" && onLogin)
2121
- );
2122
- if (activeFeature) {
2123
- const FeatureComponent = activeFeature;
2124
- return /* @__PURE__ */ jsxRuntime.jsx(FeatureComponent, { onClose: handleCloseFeature, onLogin });
2125
- }
2126
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "debug-tool-container", children: [
2127
- /* @__PURE__ */ jsxRuntime.jsx(FloatingButton, { onClick: toggleMenu }),
2128
- isMenuOpen && /* @__PURE__ */ jsxRuntime.jsx(
2129
- MenuPanel,
2130
- {
2131
- menuItems: availableMenuItems,
2132
- onMenuItemClick: handleMenuClick,
2133
- onClose: () => setMenuOpen(false)
2134
- }
2135
- )
2136
- ] });
2137
- };
2138
-
2139
- const cx$3 = classNames.bind(styles$5);
1378
+ const cx$3 = classNames.bind(styles$3);
2140
1379
  const { InputBox, Input } = salesFrontendDesignSystem.FormCore;
2141
1380
  const AddressSearchInitialText = () => {
2142
1381
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -2426,7 +1665,7 @@ const useAddressComponent = () => {
2426
1665
  };
2427
1666
  };
2428
1667
 
2429
- const cx$2 = classNames.bind(styles$6);
1668
+ const cx$2 = classNames.bind(styles$4);
2430
1669
  const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
2431
1670
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$2("grade-section"), children: [
2432
1671
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$2("icon-title"), children: [
@@ -2447,7 +1686,7 @@ const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
2447
1686
  ] });
2448
1687
  };
2449
1688
 
2450
- const cx$1 = classNames.bind(styles$7);
1689
+ const cx$1 = classNames.bind(styles$5);
2451
1690
  function VehicleSearch({ vehicles, onVehicleSelect }) {
2452
1691
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$1("vehicle-search-section"), children: [
2453
1692
  /* @__PURE__ */ jsxRuntime.jsx("p", { children: "\uC6B4\uC804 \uCC28\uC885" }),
@@ -2513,7 +1752,7 @@ const useJobVehicleSearch = () => {
2513
1752
  };
2514
1753
  };
2515
1754
 
2516
- const cx = classNames.bind(styles$6);
1755
+ const cx = classNames.bind(styles$4);
2517
1756
  function useJobVehicleSearchModal() {
2518
1757
  const {
2519
1758
  selectedVehicle,
@@ -2619,7 +1858,6 @@ const JobSearchModal = ({ onClose }) => {
2619
1858
  };
2620
1859
 
2621
1860
  exports.Attachment = Attachment;
2622
- exports.DebugTool = DebugTool;
2623
1861
  exports.FormCheckbox = FormCheckbox;
2624
1862
  exports.FormCheckboxButton = FormCheckboxButton;
2625
1863
  exports.FormDatePicker = FormDatePicker;