sales-frontend-debug 0.0.62 → 0.0.64

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.d.cts CHANGED
@@ -48,9 +48,18 @@ declare function addRequestLog(config: InternalAxiosRequestConfig): Promise<unkn
48
48
  declare function addResponseLog(response: AxiosResponse): Promise<unknown> | undefined;
49
49
  declare function addErrorLog(error: AxiosError): Promise<unknown> | undefined;
50
50
 
51
+ type DebugFilterKey = 'downloader' | 'console-log' | 'auth-token' | 'validation-off' | 'http-log' | 'data-init-button';
52
+
53
+ /**
54
+ * @deprecated isDebugByFilterName('validation-off') 를 사용하세요. 해당 함수는 삭제 예정
55
+ * @returns boolean
56
+ */
51
57
  declare function isDebugStepValidationOff(): boolean;
52
- declare function isDebugMode(): boolean;
53
- declare function getDebugFileConvertType(): string;
54
- declare function isDebugByFilterName(name: string): boolean;
58
+ /**
59
+ * @description 원하는 기능에 따라 쿠키를 확인하여 true/false를 리턴한다.
60
+ * @param name DebugFilterKey
61
+ * @returns boolean
62
+ */
63
+ declare function isDebugByFilterName(name: DebugFilterKey): boolean;
55
64
 
56
- export { DebugTool, addErrorLog, addRequestLog, addResponseLog, getDebugFileConvertType, isDebugByFilterName, isDebugMode, isDebugStepValidationOff };
65
+ export { DebugTool, addErrorLog, addRequestLog, addResponseLog, isDebugByFilterName, isDebugStepValidationOff };
package/dist/index.d.ts CHANGED
@@ -48,9 +48,18 @@ declare function addRequestLog(config: InternalAxiosRequestConfig): Promise<unkn
48
48
  declare function addResponseLog(response: AxiosResponse): Promise<unknown> | undefined;
49
49
  declare function addErrorLog(error: AxiosError): Promise<unknown> | undefined;
50
50
 
51
+ type DebugFilterKey = 'downloader' | 'console-log' | 'auth-token' | 'validation-off' | 'http-log' | 'data-init-button';
52
+
53
+ /**
54
+ * @deprecated isDebugByFilterName('validation-off') 를 사용하세요. 해당 함수는 삭제 예정
55
+ * @returns boolean
56
+ */
51
57
  declare function isDebugStepValidationOff(): boolean;
52
- declare function isDebugMode(): boolean;
53
- declare function getDebugFileConvertType(): string;
54
- declare function isDebugByFilterName(name: string): boolean;
58
+ /**
59
+ * @description 원하는 기능에 따라 쿠키를 확인하여 true/false를 리턴한다.
60
+ * @param name DebugFilterKey
61
+ * @returns boolean
62
+ */
63
+ declare function isDebugByFilterName(name: DebugFilterKey): boolean;
55
64
 
56
- export { DebugTool, addErrorLog, addRequestLog, addResponseLog, getDebugFileConvertType, isDebugByFilterName, isDebugMode, isDebugStepValidationOff };
65
+ export { DebugTool, addErrorLog, addRequestLog, addResponseLog, isDebugByFilterName, isDebugStepValidationOff };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React9, { useEffect, useState, useMemo, useRef, useCallback } from 'react';
2
- import { getCookie, setCookie, deleteCookie } from 'sales-frontend-utils/cookie';
3
- import { isClient, getEnvironmentFromHostname } from 'sales-frontend-utils';
2
+ import { getCookie, setCookie, deleteCookie as deleteCookie$1 } from 'sales-frontend-utils/cookie';
3
+ import { isClient, getEnvironmentFromHostname, deleteCookie } from 'sales-frontend-utils';
4
4
  import { useDebugStore } from 'sales-frontend-stores';
5
5
 
6
6
  // src/debug-tool.tsx
@@ -361,30 +361,72 @@ function ChangeHost() {
361
361
  };
362
362
  return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "API\uD638\uC2A4\uD2B8")), /* @__PURE__ */ React9.createElement("ul", null, /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleHost("local") }, "local"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleHost("dev") }, "dev"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleHost("stg") }, "stg")));
363
363
  }
364
- var fileConvertTypeCookieKey = "dsp-debug-mode-file-convert-type";
365
- function FileConvert() {
366
- const handleFileConvertType = (host) => {
367
- setCookie(fileConvertTypeCookieKey, host);
368
- alert(`file convert type \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.:${host}`);
369
- console.log("file convert type \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
370
- [fileConvertTypeCookieKey]: getCookie(fileConvertTypeCookieKey)
371
- });
372
- };
373
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "File Convert Type")), /* @__PURE__ */ React9.createElement("ul", null, /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleFileConvertType("fetch") }, "fetch"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleFileConvertType("canvas") }, "canvas"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleFileConvertType("xhr") }, "xhr")));
374
- }
375
364
  var filterNameCookieKey = "dsp-debug-mode-filter-name";
365
+ var filterList = [
366
+ {
367
+ key: "downloader",
368
+ description: "\uB2E4\uC6B4\uB85C\uB354 \uD6C5 \uBD84\uAE30 \uD655\uC778\uC6A9"
369
+ },
370
+ {
371
+ key: "console-log",
372
+ description: "\uCF58\uC194\uB85C\uADF8 on/off"
373
+ },
374
+ {
375
+ key: "auth-token",
376
+ description: "\uCFE0\uD0A4\uC5D0\uC11C \uD1A0\uD070\uD68D\uB4DD"
377
+ },
378
+ {
379
+ key: "validation-off",
380
+ description: "\uC720\uD6A8\uC131\uAC80\uC0AC off"
381
+ },
382
+ {
383
+ key: "http-log",
384
+ description: "http \uC694\uCCAD/\uC751\uB2F5 \uB85C\uADF8 on/off"
385
+ },
386
+ {
387
+ key: "data-init-button",
388
+ description: "\uC11C\uC2DD\uB2E8\uACC4,\uCD08\uAE30\uD654 \uBC84\uD2BC \uCD94\uAC00"
389
+ }
390
+ ];
376
391
  function Filter() {
377
392
  const [filterName, setFilterName] = React9.useState("");
378
- const handleFilterNameChange = (e) => {
379
- const filterName2 = e.target.value;
380
- setCookie(filterNameCookieKey, filterName2);
381
- setFilterName(filterName2);
382
- };
383
393
  useEffect(() => {
384
394
  const filterName2 = getCookie(filterNameCookieKey);
385
395
  setFilterName(filterName2);
386
396
  }, []);
387
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "Filter ex: filter1,filter2")), /* @__PURE__ */ React9.createElement("ul", null, /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle }, "filter-name:", /* @__PURE__ */ React9.createElement("input", { type: "text", onChange: handleFilterNameChange, value: filterName }))));
397
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "\uB514\uBC84\uAE45 \uC635\uC158")), /* @__PURE__ */ React9.createElement("ul", null, filterList.map((filter) => /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, key: filter.key }, /* @__PURE__ */ React9.createElement(
398
+ "input",
399
+ {
400
+ type: "checkbox",
401
+ checked: filterName.includes(filter.key),
402
+ onChange: (e) => {
403
+ if (e.target.checked) {
404
+ setFilterName((prev) => {
405
+ if (prev) {
406
+ const newFilterName = `${prev},${filter.key}`;
407
+ setCookie(filterNameCookieKey, newFilterName);
408
+ return newFilterName;
409
+ } else {
410
+ setCookie(filterNameCookieKey, filter.key);
411
+ return filter.key;
412
+ }
413
+ });
414
+ } else {
415
+ setFilterName((prev) => {
416
+ if (prev.includes(",")) {
417
+ const arr = prev.split(",");
418
+ const newFilterName = arr.filter((item) => item !== filter.key).join(",");
419
+ setCookie(filterNameCookieKey, newFilterName);
420
+ return newFilterName;
421
+ } else {
422
+ deleteCookie$1(filterNameCookieKey);
423
+ return "";
424
+ }
425
+ });
426
+ }
427
+ }
428
+ }
429
+ ), filter.key))));
388
430
  }
389
431
  function FormFactor() {
390
432
  const handleFormFactor = (formFactor) => {
@@ -398,30 +440,30 @@ function FormFactor() {
398
440
  }
399
441
  function InitRefresh() {
400
442
  const handleDeleteHostCookie = () => {
401
- deleteCookie("dsp-debug-mode-env");
443
+ deleteCookie$1("dsp-debug-mode-env");
402
444
  alert("\uD638\uC2A4\uD2B8\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
403
445
  console.log("\uD638\uC2A4\uD2B8\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
404
446
  "dsp-debug-mode-env": getCookie("dsp-debug-mode-env")
405
447
  });
406
448
  };
407
449
  const handleDeleteTokenCookie = () => {
408
- deleteCookie("accessToken");
450
+ deleteCookie$1("accessToken");
409
451
  alert("\uD1A0\uD070\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
410
452
  console.log("\uD1A0\uD070\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
411
453
  accessToken: getCookie("accessToken")
412
454
  });
413
455
  };
414
456
  const handleDeleteCustomCookie = () => {
415
- deleteCookie("x-channel-appversion");
416
- deleteCookie("x-channel-deviceid");
417
- deleteCookie("x-channel-devicemodel");
418
- deleteCookie("x-channel-formfactor");
419
- deleteCookie("x-channel-loginchannel");
420
- deleteCookie("x-channel-logintype");
421
- deleteCookie("x-channel-platformname");
422
- deleteCookie("x-channel-platformversion");
423
- deleteCookie("x-channel-screenid");
424
- deleteCookie("x-channel-business-work-division-code");
457
+ deleteCookie$1("x-channel-appversion");
458
+ deleteCookie$1("x-channel-deviceid");
459
+ deleteCookie$1("x-channel-devicemodel");
460
+ deleteCookie$1("x-channel-formfactor");
461
+ deleteCookie$1("x-channel-loginchannel");
462
+ deleteCookie$1("x-channel-logintype");
463
+ deleteCookie$1("x-channel-platformname");
464
+ deleteCookie$1("x-channel-platformversion");
465
+ deleteCookie$1("x-channel-screenid");
466
+ deleteCookie$1("x-channel-business-work-division-code");
425
467
  alert("\uCEE4\uC2A4\uD140\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
426
468
  console.log("\uCEE4\uC2A4\uD140\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
427
469
  "x-channel-appversion": getCookie("x-channel-appversion"),
@@ -449,13 +491,23 @@ function InitRefresh() {
449
491
 
450
492
  // src/components/menu-panel.tsx
451
493
  var MenuPanel = ({ menuItems: menuItems2, onMenuItemClick, onClose, serviceCode }) => {
452
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugMenuPanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "Debug Menu"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("ul", null, menuItems2.map((item) => /* @__PURE__ */ React9.createElement("li", { key: item.id, onClick: () => onMenuItemClick(item.component), style: menuItemStyle }, item.label))), serviceCode === "dsp" && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(FormFactor, null), /* @__PURE__ */ React9.createElement(ChangeHost, null), /* @__PURE__ */ React9.createElement(InitRefresh, null), /* @__PURE__ */ React9.createElement(FileConvert, null), /* @__PURE__ */ React9.createElement(Filter, null))));
494
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugMenuPanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "Debug Menu"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("ul", null, menuItems2.map((item) => /* @__PURE__ */ React9.createElement("li", { key: item.id, onClick: () => onMenuItemClick(item.component), style: menuItemStyle }, item.label))), serviceCode === "dsp" && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Filter, null), /* @__PURE__ */ React9.createElement(FormFactor, null), /* @__PURE__ */ React9.createElement(ChangeHost, null), /* @__PURE__ */ React9.createElement(InitRefresh, null))));
453
495
  };
454
496
  var menu_panel_default = MenuPanel;
497
+ function isDebugStepValidationOff() {
498
+ return isDebugByFilterName("validation-off");
499
+ }
500
+ function isDebugByFilterName(name) {
501
+ const filterNames = getCookie(filterNameCookieKey)?.split(",");
502
+ return filterNames?.includes(name) || false;
503
+ }
504
+
505
+ // src/features/console-log/use-console-log.ts
455
506
  var globalLogs = [];
456
507
  var listeners = [];
457
508
  var originalConsoleMethods = {};
458
509
  var isConsoleOverridden = false;
510
+ var MAX_LOGS = 10;
459
511
  var addLog = (type, ...args) => {
460
512
  const newLog = {
461
513
  id: Date.now() + Math.random(),
@@ -463,6 +515,11 @@ var addLog = (type, ...args) => {
463
515
  timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
464
516
  message: args
465
517
  };
518
+ if (globalLogs.length >= MAX_LOGS) {
519
+ if (!isDebugByFilterName("console-log")) {
520
+ globalLogs.shift();
521
+ }
522
+ }
466
523
  globalLogs = [...globalLogs, newLog];
467
524
  listeners.forEach((listener) => listener([...globalLogs]));
468
525
  };
@@ -549,10 +606,6 @@ var console_log_panel_default = ConsoleLogPanel;
549
606
  var LoginPanel = ({ onClose, onLogin }) => {
550
607
  const [selectedTypeId, setSelectedTypeId] = useState(loginTypes[0]?.id || "");
551
608
  const [formData, setFormData] = useState({});
552
- const [mode, setMode] = useState(getCookie("dsp-debug-mode") === "on");
553
- const [stepValidationOff, SetStepValidationOff] = useState(
554
- getCookie("Debug-Step-Validation-Off") === "true"
555
- );
556
609
  const selectedType = useMemo(() => loginTypes.find((t) => t.id === selectedTypeId), [selectedTypeId]);
557
610
  const handleInputChange = (e) => {
558
611
  const { name, value } = e.target;
@@ -561,74 +614,15 @@ var LoginPanel = ({ onClose, onLogin }) => {
561
614
  const handleSubmit = (e) => {
562
615
  e.preventDefault();
563
616
  if (selectedType) {
617
+ deleteCookie("accessToken");
564
618
  onLogin(selectedType.id, formData);
565
619
  onClose();
566
620
  }
567
621
  };
568
- const handleDebugOn = (e) => {
569
- const checkbox = e.target;
570
- if (checkbox.checked) {
571
- setCookie("dsp-debug-mode", "on", { path: "/" });
572
- setMode(true);
573
- } else {
574
- setCookie("dsp-debug-mode", "off", { path: "/" });
575
- setMode(false);
576
- }
577
- };
578
- const handleStepValidationOff = (e) => {
579
- const checkbox = e.target;
580
- if (checkbox.checked) {
581
- setCookie("Debug-Step-Validation-Off", "true", { path: "/" });
582
- SetStepValidationOff(true);
583
- } else {
584
- setCookie("Debug-Step-Validation-Off", "false", { path: "/" });
585
- SetStepValidationOff(false);
586
- }
587
- };
588
- const handleTermsPathPolyNo = (e) => {
589
- const val = e.target.value.trim();
590
- if (!val) {
591
- deleteCookie("Debug-Terms-PolyNo");
592
- } else {
593
- setCookie("Debug-Terms-PolyNo", val, { path: "/" });
594
- }
595
- };
596
- const handleTermsPathSaleDate = (e) => {
597
- const val = e.target.value.trim();
598
- if (!val) {
599
- deleteCookie("Debug-Terms-SaleDate");
600
- } else {
601
- setCookie("Debug-Terms-SaleDate", val, { path: "/" });
602
- }
603
- };
604
622
  useEffect(() => {
605
623
  setFormData({});
606
624
  }, [selectedType]);
607
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugFeaturePanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "\uAC04\uD3B8 \uB85C\uADF8\uC778"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("form", { style: loginFormContainerStyle, onSubmit: handleSubmit }, /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("ul", { style: { listStyleType: "circle" } }, /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "debug-on" }, "Debug On"), /* @__PURE__ */ React9.createElement("input", { type: "checkbox", id: "debug-on", onChange: handleDebugOn, checked: mode }), /* @__PURE__ */ React9.createElement("ul", { style: { listStyleType: "square", paddingLeft: "20px" } }, /* @__PURE__ */ React9.createElement("li", null, "(\uCFE0\uD0A4\uC5D0 \uC14B\uD305\uB41C \uD1A0\uD070\uAC12\uC73C\uB85C \uD5E4\uB354\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4. \uAC04\uD3B8\uB85C\uADF8\uC778 \uC0AC\uC6A9\uC2DC \uD544\uC218\uCCB4\uD06C)"))), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "step-validation-off" }, "\uC11C\uC2DD Validation Off"), /* @__PURE__ */ React9.createElement(
608
- "input",
609
- {
610
- type: "checkbox",
611
- id: "step-validation-off",
612
- onChange: handleStepValidationOff,
613
- checked: stepValidationOff
614
- }
615
- ), /* @__PURE__ */ React9.createElement("ul", { style: { listStyleType: "square", paddingLeft: "20px" } }, /* @__PURE__ */ React9.createElement("li", null, "(\uC11C\uC2DD \uB2E8\uACC4 \uC774\uB3D9\uC2DC, validation\uC744 \uB044\uACE0 \uBBF8\uC791\uC131 \uB2E8\uACC4\uB3C4 \uC774\uB3D9\uAC00\uB2A5\uD558\uB3C4\uB85D \uD569\uB2C8\uB2E4.)"))), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "terms-path-poly-no" }, "\uC57D\uAD00 polyNo"), /* @__PURE__ */ React9.createElement(
616
- "input",
617
- {
618
- type: "text",
619
- id: "terms-path-poly-no",
620
- onChange: handleTermsPathPolyNo,
621
- placeholder: "polyNo,saleDate\uB458\uB2E4\uC785\uB825"
622
- }
623
- )), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "terms-path-sale-date" }, "\uC57D\uAD00 saleDate"), /* @__PURE__ */ React9.createElement(
624
- "input",
625
- {
626
- type: "text",
627
- id: "terms-path-sale-date",
628
- onChange: handleTermsPathSaleDate,
629
- placeholder: "polyNo,saleDate\uB458\uB2E4\uC785\uB825"
630
- }
631
- ), /* @__PURE__ */ React9.createElement("br", null), /* @__PURE__ */ React9.createElement("strong", null, "\uC57D\uAD00\uD655\uC778\uD6C4 \uD574\uB2F9\uCFE0\uD0A4 \uBC18\uB4DC\uC2DC \uC0AD\uC81C"))), /* @__PURE__ */ React9.createElement("br", null), " ", /* @__PURE__ */ React9.createElement("br", null), /* @__PURE__ */ React9.createElement("label", { htmlFor: "login-type-select" }, "\uB85C\uADF8\uC778 \uC720\uD615"), /* @__PURE__ */ React9.createElement("select", { id: "login-type-select", value: selectedTypeId, onChange: (e) => setSelectedTypeId(e.target.value) }, loginTypes.map((type) => /* @__PURE__ */ React9.createElement("option", { key: type.id, value: type.id }, type.label)))), selectedType?.fields.map((field) => /* @__PURE__ */ React9.createElement("div", { key: field.name }, /* @__PURE__ */ React9.createElement("label", { htmlFor: field.name }, field.label), /* @__PURE__ */ React9.createElement(
625
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugFeaturePanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "\uAC04\uD3B8 \uB85C\uADF8\uC778"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("form", { style: loginFormContainerStyle, onSubmit: handleSubmit }, /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "login-type-select" }, "\uB85C\uADF8\uC778 \uC720\uD615"), /* @__PURE__ */ React9.createElement("select", { id: "login-type-select", value: selectedTypeId, onChange: (e) => setSelectedTypeId(e.target.value) }, loginTypes.map((type) => /* @__PURE__ */ React9.createElement("option", { key: type.id, value: type.id }, type.label)))), selectedType?.fields.map((field) => /* @__PURE__ */ React9.createElement("div", { key: field.name }, /* @__PURE__ */ React9.createElement("label", { htmlFor: field.name }, field.label), /* @__PURE__ */ React9.createElement(
632
626
  "input",
633
627
  {
634
628
  type: field.type,
@@ -904,7 +898,7 @@ var useStorage = (storageType) => {
904
898
  if (storageType === "localStorage") {
905
899
  localStorage.removeItem(key);
906
900
  } else {
907
- deleteCookie(key);
901
+ deleteCookie$1(key);
908
902
  }
909
903
  loadItems();
910
904
  },
@@ -967,17 +961,6 @@ var loginTypes = [
967
961
  id: "fp",
968
962
  label: "FP \uB85C\uADF8\uC778",
969
963
  fields: [{ name: "employeeId", label: "\uC0AC\uBC88", type: "text", placeholder: "\uC0AC\uBC88\uC744 \uC785\uB825\uD558\uC138\uC694" }]
970
- },
971
- {
972
- id: "customer",
973
- label: "\uACE0\uAC1D \uB85C\uADF8\uC778",
974
- fields: [
975
- { name: "name", label: "\uC774\uB984", type: "text", placeholder: "\uC774\uB984" },
976
- { name: "phone", label: "\uC804\uD654\uBC88\uD638", type: "tel", placeholder: "\uC804\uD654\uBC88\uD638" },
977
- { name: "residentNumber", label: "\uC8FC\uBBFC\uBC88\uD638", type: "text", placeholder: "\uC8FC\uBBFC\uBC88\uD638 \uC55E 7\uC790\uB9AC" },
978
- { name: "userId", label: "\uC544\uC774\uB514", type: "text", placeholder: "\uC544\uC774\uB514" },
979
- { name: "password", label: "\uBE44\uBC00\uBC88\uD638", type: "password", placeholder: "\uBE44\uBC00\uBC88\uD638" }
980
- ]
981
964
  }
982
965
  ];
983
966
  var menuItems = [
@@ -1103,13 +1086,19 @@ var DebugTool = ({
1103
1086
  )
1104
1087
  );
1105
1088
  };
1089
+ var MAX_LOGS2 = 20;
1106
1090
  function addRequestLog(config) {
1107
1091
  if (!isClient()) {
1108
1092
  return;
1109
1093
  }
1110
1094
  const env = getEnvironmentFromHostname(location.hostname);
1111
1095
  if (env !== "prd") {
1112
- const { addRequest, isHold, holdRequest } = useDebugStore.getState();
1096
+ const { addRequest, isHold, holdRequest, requests } = useDebugStore.getState();
1097
+ if (requests.length >= MAX_LOGS2) {
1098
+ if (!isDebugByFilterName("http-log")) {
1099
+ requests.shift();
1100
+ }
1101
+ }
1113
1102
  const startTime = Date.now();
1114
1103
  const requestInfo = {
1115
1104
  url: config.url || "",
@@ -1134,7 +1123,12 @@ function addResponseLog(response) {
1134
1123
  }
1135
1124
  const env = getEnvironmentFromHostname(location.hostname);
1136
1125
  if (env !== "prd") {
1137
- const { addResponse, isHold, holdResponse } = useDebugStore.getState();
1126
+ const { addResponse, isHold, holdResponse, responses } = useDebugStore.getState();
1127
+ if (responses.length >= MAX_LOGS2) {
1128
+ if (!isDebugByFilterName("http-log")) {
1129
+ responses.shift();
1130
+ }
1131
+ }
1138
1132
  const { config } = response;
1139
1133
  const responseInfo = {
1140
1134
  url: config.url || "",
@@ -1154,9 +1148,17 @@ function addResponseLog(response) {
1154
1148
  }
1155
1149
  }
1156
1150
  function addErrorLog(error) {
1151
+ if (!isClient()) {
1152
+ return;
1153
+ }
1157
1154
  const env = getEnvironmentFromHostname(location.hostname);
1158
1155
  if (env !== "prd") {
1159
- const { addError, isHold, holdError } = useDebugStore.getState();
1156
+ const { addError, isHold, holdError, errors } = useDebugStore.getState();
1157
+ if (errors.length >= MAX_LOGS2) {
1158
+ if (!isDebugByFilterName("http-log")) {
1159
+ errors.shift();
1160
+ }
1161
+ }
1160
1162
  const { config } = error;
1161
1163
  const errorInfo = {
1162
1164
  url: config?.url || "",
@@ -1181,23 +1183,7 @@ function addErrorLog(error) {
1181
1183
  }
1182
1184
  }
1183
1185
  }
1184
- function isDebugStepValidationOff() {
1185
- const debugStepValidationOff = getCookie("Debug-Step-Validation-Off") === "true";
1186
- return debugStepValidationOff;
1187
- }
1188
- function isDebugMode() {
1189
- const debugMode = getCookie("dsp-debug-mode") === "on";
1190
- return debugMode;
1191
- }
1192
- function getDebugFileConvertType() {
1193
- const fileConvertType = getCookie(fileConvertTypeCookieKey);
1194
- return fileConvertType;
1195
- }
1196
- function isDebugByFilterName(name) {
1197
- const filterNames = getCookie(filterNameCookieKey)?.split(",");
1198
- return filterNames?.includes(name) || false;
1199
- }
1200
1186
 
1201
- export { DebugTool, addErrorLog, addRequestLog, addResponseLog, getDebugFileConvertType, isDebugByFilterName, isDebugMode, isDebugStepValidationOff };
1187
+ export { DebugTool, addErrorLog, addRequestLog, addResponseLog, isDebugByFilterName, isDebugStepValidationOff };
1202
1188
  //# sourceMappingURL=index.js.map
1203
1189
  //# sourceMappingURL=index.js.map