@ws-ui/http-handlers-editor 1.11.3-rc1 → 1.11.3-rc3

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.es.js CHANGED
@@ -1,37 +1,36 @@
1
- import { jsx as e, jsxs as o, Fragment as G } from "react/jsx-runtime";
2
- import { ChakraProvider as he } from "@chakra-ui/react";
3
- import { useSensors as me, useSensor as X, PointerSensor as ge, KeyboardSensor as xe, DndContext as fe, closestCenter as ye, DragOverlay as be } from "@dnd-kit/core";
4
- import { useSortable as ve, sortableKeyboardCoordinates as Ne, SortableContext as we, verticalListSortingStrategy as Ee, arrayMove as Ce } from "@dnd-kit/sortable";
5
- import { FdWarningDanger as j, FdRegex as De, FdUnRegex as Te, FdDuplicate as te, FdPen as He, FdTrash as Re, FdCloseNaked as q, FdInfoCircle as ne, FdCheckCircle as Pe, FdClose as Se, FdDragHandle as ke, FdDown as K, FdEmpty as J, FdCode as Ie, FdPlus as Y } from "@ws-ui/icons";
6
- import { useAppDispatch as B, switchEditor as Ae, useAppSelector as W, selectCatalog as re, openModal as ae, selectTabByPath as _e, setContent as Le, ReduxProvider as Fe, getStore as Oe } from "@ws-ui/store";
7
- import { ToolbarIcon as $e, chakraTheme as je } from "@ws-ui/webform-editor";
8
- import { createContext as Ge, useReducer as qe, useEffect as O, useContext as Be, useState as _, Fragment as se, useMemo as Ue } from "react";
9
- import { generate as V } from "short-uuid";
10
- import { z as A } from "zod";
11
- import { CSS as ze } from "@dnd-kit/utilities";
12
- import { Combobox as S, Transition as le } from "@headlessui/react";
13
- import { Tooltip as E, ModalColor as ie, ModalType as oe, useHotkeys as Me, ControlledSwitch as Ve, HTTP_HANDLERS_TAB_PATH as Ke } from "@ws-ui/shared";
1
+ import { jsx as e, jsxs as o, Fragment as F } from "react/jsx-runtime";
2
+ import { useSensors as he, useSensor as X, PointerSensor as me, KeyboardSensor as ge, DndContext as xe, closestCenter as fe, DragOverlay as ye } from "@dnd-kit/core";
3
+ import { useSortable as be, sortableKeyboardCoordinates as ve, SortableContext as Ne, verticalListSortingStrategy as we, arrayMove as Ee } from "@dnd-kit/sortable";
4
+ import { FdWarningDanger as q, FdRegex as Ce, FdUnRegex as De, FdDuplicate as te, FdPen as Te, FdTrash as He, FdCloseNaked as M, FdInfoCircle as ne, FdCheckCircle as Re, FdClose as Se, FdDragHandle as Pe, FdDown as J, FdEmpty as W, FdCode as Ie, FdPlus as Y } from "@ws-ui/icons";
5
+ import { useAppDispatch as G, switchEditor as Ae, useAppSelector as B, selectCatalog as re, openModal as ae, selectTabByPath as ke, setContent as _e, selectModals as Le, editModal as Oe, closeModal as Fe, ReduxProvider as $e, getStore as je } from "@ws-ui/store";
6
+ import { createContext as Ge, useReducer as qe, useEffect as $, useContext as Me, useState as _, Fragment as se, useMemo as Be } from "react";
7
+ import { generate as K } from "short-uuid";
8
+ import { z as k } from "zod";
9
+ import { ToolbarIcon as Ue, Tooltip as E, ModalColor as le, ModalType as ie, useHotkeys as ze, ControlledSwitch as Ve, Modal as Ke, HTTP_HANDLERS_TAB_PATH as Je } from "@ws-ui/shared";
10
+ import { CSS as We } from "@dnd-kit/utilities";
11
+ import { Combobox as P, Transition as oe } from "@headlessui/react";
14
12
  import C from "classnames";
15
- import { useMultipleSelection as F, useCombobox as L } from "downshift";
16
- import { omit as de, isEqual as Je } from "lodash";
17
- import { Subject as We } from "rxjs";
13
+ import { useMultipleSelection as O, useCombobox as L } from "downshift";
14
+ import { omit as de, isEqual as Qe } from "lodash";
15
+ import { Subject as Xe } from "rxjs";
18
16
  import Z from "randexp";
19
- const Qe = ({
17
+ import { HTTP_HANDLERS_EDITOR_SCOPE_CLASS as Ye } from "./common.es.js";
18
+ const Ze = ({
20
19
  label: t,
21
20
  Icon: a,
22
21
  tab: r,
23
22
  editor: i,
24
- onBeforeClick: c
23
+ onBeforeClick: d
25
24
  }) => {
26
- const x = B();
25
+ const x = G();
27
26
  return /* @__PURE__ */ e(
28
- $e,
27
+ Ue,
29
28
  {
30
29
  label: t,
31
30
  Icon: a,
32
31
  as: "button",
33
32
  onClick: () => {
34
- c == null || c(), x(
33
+ d == null || d(), x(
35
34
  Ae({
36
35
  tab: r,
37
36
  editor: i
@@ -40,7 +39,7 @@ const Qe = ({
40
39
  }
41
40
  }
42
41
  );
43
- }, ce = Ge(void 0), $ = new We(), Xe = (t, a) => {
42
+ }, ce = Ge(void 0), j = new Xe(), et = (t, a) => {
44
43
  switch (a.type) {
45
44
  case "UPDATE_HANDLERS":
46
45
  return {
@@ -57,7 +56,7 @@ const Qe = ({
57
56
  ).some(Boolean) && r.verbs.length === 0)
58
57
  return {
59
58
  ...t,
60
- content: t.content.filter((c) => c.id !== r.id),
59
+ content: t.content.filter((d) => d.id !== r.id),
61
60
  editing: a.payload
62
61
  };
63
62
  }
@@ -67,7 +66,7 @@ const Qe = ({
67
66
  };
68
67
  }
69
68
  case "ADD_HANDLER": {
70
- const r = V();
69
+ const r = K();
71
70
  return {
72
71
  ...t,
73
72
  content: [...t.content, { ...a.payload, id: r }],
@@ -103,7 +102,7 @@ const Qe = ({
103
102
  ...t,
104
103
  content: [
105
104
  ...t.content,
106
- { ...r, id: V(), isExpanded: !0 }
105
+ { ...r, id: K(), isExpanded: !0 }
107
106
  ]
108
107
  } : t;
109
108
  }
@@ -119,7 +118,7 @@ const Qe = ({
119
118
  return {
120
119
  ...t,
121
120
  content: a.payload.map((r) => {
122
- const i = t.content.find((c) => c.id === r.id);
121
+ const i = t.content.find((d) => d.id === r.id);
123
122
  return i ? {
124
123
  ...r,
125
124
  ...i
@@ -129,7 +128,7 @@ const Qe = ({
129
128
  default:
130
129
  throw new Error("Unknown action type");
131
130
  }
132
- }, Ye = ({
131
+ }, tt = ({
133
132
  children: t,
134
133
  content: a
135
134
  }) => {
@@ -137,41 +136,41 @@ const Qe = ({
137
136
  content: a,
138
137
  editing: null,
139
138
  newlyCreatedHandlerID: null
140
- }, [i, c] = qe(Xe, r);
141
- return O(() => {
142
- c({
139
+ }, [i, d] = qe(et, r);
140
+ return $(() => {
141
+ d({
143
142
  type: "SYNC_DATA",
144
143
  payload: a
145
144
  });
146
- }, [a]), /* @__PURE__ */ e(ce.Provider, { value: { state: i, dispatch: c }, children: t });
145
+ }, [a]), /* @__PURE__ */ e(ce.Provider, { value: { state: i, dispatch: d }, children: t });
147
146
  }, Q = () => {
148
- const t = Be(ce);
147
+ const t = Me(ce);
149
148
  if (!t)
150
149
  throw new Error("useHTTPHandlers must be used within a HandlerProvider");
151
150
  return t;
152
- }, Ze = ({ initialSelectedItems: t, onChange: a, touched: r, onBlur: i }) => {
153
- const c = ["GET", "POST", "PUT", "DELETE"];
151
+ }, nt = ({ initialSelectedItems: t, onChange: a, touched: r, onBlur: i }) => {
152
+ const d = ["GET", "POST", "PUT", "DELETE"];
154
153
  function x(h, u) {
155
154
  const N = u.toLowerCase();
156
- return c.filter(function(s) {
155
+ return d.filter(function(s) {
157
156
  return !h.includes(s) && s.toLowerCase().includes(N);
158
157
  });
159
158
  }
160
- const [f, g] = _(""), [d, n] = _(t);
161
- O(() => {
159
+ const [f, g] = _(""), [c, n] = _(t);
160
+ $(() => {
162
161
  n(t);
163
162
  }, [t]);
164
- const l = Ue(
165
- () => x(d, f),
166
- [d, f]
167
- ), { getSelectedItemProps: p, getDropdownProps: b, removeSelectedItem: v } = F({
168
- selectedItems: d,
163
+ const l = Be(
164
+ () => x(c, f),
165
+ [c, f]
166
+ ), { getSelectedItemProps: p, getDropdownProps: b, removeSelectedItem: v } = O({
167
+ selectedItems: c,
169
168
  onStateChange({ selectedItems: h = [], type: u }) {
170
169
  switch (u) {
171
- case F.stateChangeTypes.SelectedItemKeyDownBackspace:
172
- case F.stateChangeTypes.SelectedItemKeyDownDelete:
173
- case F.stateChangeTypes.DropdownKeyDownBackspace:
174
- case F.stateChangeTypes.FunctionRemoveSelectedItem:
170
+ case O.stateChangeTypes.SelectedItemKeyDownBackspace:
171
+ case O.stateChangeTypes.SelectedItemKeyDownDelete:
172
+ case O.stateChangeTypes.DropdownKeyDownBackspace:
173
+ case O.stateChangeTypes.FunctionRemoveSelectedItem:
175
174
  n(h);
176
175
  break;
177
176
  }
@@ -179,7 +178,7 @@ const Qe = ({
179
178
  }), {
180
179
  isOpen: y,
181
180
  getToggleButtonProps: w,
182
- getMenuProps: k,
181
+ getMenuProps: I,
183
182
  getInputProps: D,
184
183
  highlightedIndex: T,
185
184
  getItemProps: H,
@@ -194,8 +193,8 @@ const Qe = ({
194
193
  selectedItem: null,
195
194
  inputValue: f,
196
195
  stateReducer(h, u) {
197
- const { changes: N, type: P } = u;
198
- switch (P) {
196
+ const { changes: N, type: S } = u;
197
+ switch (S) {
199
198
  case L.stateChangeTypes.InputKeyDownEnter:
200
199
  case L.stateChangeTypes.ItemClick:
201
200
  return {
@@ -218,7 +217,7 @@ const Qe = ({
218
217
  case L.stateChangeTypes.InputKeyDownEnter:
219
218
  case L.stateChangeTypes.ItemClick:
220
219
  case L.stateChangeTypes.InputBlur:
221
- N && (n([...d, N]), g(""));
220
+ N && (n([...c, N]), g(""));
222
221
  break;
223
222
  case L.stateChangeTypes.InputChange:
224
223
  g(h);
@@ -226,9 +225,9 @@ const Qe = ({
226
225
  }
227
226
  }
228
227
  });
229
- return O(() => {
230
- a(d);
231
- }, [d]), /* @__PURE__ */ o("div", { className: "relative flex-1", children: [
228
+ return $(() => {
229
+ a(c);
230
+ }, [c]), /* @__PURE__ */ o("div", { className: "relative flex-1", children: [
232
231
  /* @__PURE__ */ o(
233
232
  "div",
234
233
  {
@@ -236,13 +235,13 @@ const Qe = ({
236
235
  "bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative flex items-center w-full cursor-default overflow-hidden rounded p-px text-left focus:outline-none",
237
236
  {
238
237
  "ring-1 ring-primary-dark rounded-b-none": y && l.length,
239
- "ring-1 ring-red-400 overflow-visible": d.length === 0 && r
238
+ "ring-1 ring-red-400 overflow-visible": c.length === 0 && r
240
239
  }
241
240
  ),
242
241
  onBlur: i,
243
242
  children: [
244
- d.length === 0 && !y && r && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600", children: d.length === 0 && "At least one HTTP verb is required" }),
245
- d.map(
243
+ c.length === 0 && !y && r && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600", children: c.length === 0 && "At least one HTTP verb is required" }),
244
+ c.map(
246
245
  function(u, N) {
247
246
  return /* @__PURE__ */ o(
248
247
  "span",
@@ -250,7 +249,7 @@ const Qe = ({
250
249
  className: C(
251
250
  "bg-grey-600 text-s mr-1 flex items-center rounded px-1 py-0.5 uppercase",
252
251
  {
253
- "bg-red-400": !c.includes(u)
252
+ "bg-red-400": !d.includes(u)
254
253
  }
255
254
  ),
256
255
  ...p({
@@ -262,11 +261,11 @@ const Qe = ({
262
261
  /* @__PURE__ */ e(
263
262
  "span",
264
263
  {
265
- onClick: (P) => {
266
- P.stopPropagation(), v(u);
264
+ onClick: (S) => {
265
+ S.stopPropagation(), v(u);
267
266
  },
268
267
  className: "hover:bg-primary-hover ml-2 inline-block cursor-pointer rounded p-0.5 text-gray-100 hover:text-white active:outline-none",
269
- children: /* @__PURE__ */ e(q, {})
268
+ children: /* @__PURE__ */ e(M, {})
270
269
  }
271
270
  )
272
271
  ]
@@ -285,7 +284,7 @@ const Qe = ({
285
284
  )
286
285
  ),
287
286
  className: "flex-grow border-none bg-transparent px-1 py-1 text-xs outline-none",
288
- placeholder: d.length === 0 ? "Select HTTP verbs" : "",
287
+ placeholder: c.length === 0 ? "Select HTTP verbs" : "",
289
288
  size: 1
290
289
  }
291
290
  ),
@@ -295,7 +294,7 @@ const Qe = ({
295
294
  className: "absolute inset-y-0 right-0 flex items-center pr-2",
296
295
  type: "button",
297
296
  ...w(),
298
- children: /* @__PURE__ */ e(K, { className: "h-3 w-3 text-gray-50", "aria-hidden": "true" })
297
+ children: /* @__PURE__ */ e(J, { className: "h-3 w-3 text-gray-50", "aria-hidden": "true" })
299
298
  }
300
299
  )
301
300
  ]
@@ -305,7 +304,7 @@ const Qe = ({
305
304
  "ul",
306
305
  {
307
306
  className: `ring-primary-dark bg-grey-900 text-s absolute z-10 w-full rounded-b ring-1 p-1 text-white ${!(y && l.length) && "hidden"}`,
308
- ...k(),
307
+ ...I(),
309
308
  children: y && l.map((h, u) => /* @__PURE__ */ e(
310
309
  "li",
311
310
  {
@@ -322,16 +321,16 @@ const Qe = ({
322
321
  }
323
322
  )
324
323
  ] });
325
- }, et = ({
324
+ }, rt = ({
326
325
  value: t,
327
326
  options: a,
328
327
  errorMessage: r = "",
329
328
  onChange: i,
330
- onBlur: c
329
+ onBlur: d
331
330
  }) => {
332
- const [x, f] = _(""), g = a.find((n) => n.name === t), d = x === "" ? a : a.filter((n) => n.name.toLowerCase().includes(x.toLowerCase()));
331
+ const [x, f] = _(""), g = a.find((n) => n.name === t), c = x === "" ? a : a.filter((n) => n.name.toLowerCase().includes(x.toLowerCase()));
333
332
  return /* @__PURE__ */ e(
334
- S,
333
+ P,
335
334
  {
336
335
  value: { name: t },
337
336
  onChange: (n) => i(n.name),
@@ -349,7 +348,7 @@ const Qe = ({
349
348
  ),
350
349
  children: [
351
350
  /* @__PURE__ */ e(
352
- S.Input,
351
+ P.Input,
353
352
  {
354
353
  className: C(
355
354
  "bg-grey-300 text-s w-full border-none py-1 px-2 focus:outline-none rounded",
@@ -360,12 +359,12 @@ const Qe = ({
360
359
  displayValue: (l) => l.name,
361
360
  onChange: (l) => f(l.target.value),
362
361
  style: { caretColor: "white" },
363
- onBlur: c
362
+ onBlur: d
364
363
  }
365
364
  ),
366
365
  /* @__PURE__ */ o("span", { className: "inset-y-0 right-0 flex items-center gap-1 pr-2", children: [
367
366
  !g && !n && r && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600", children: r }),
368
- t ? /* @__PURE__ */ o(G, { children: [
367
+ t ? /* @__PURE__ */ o(F, { children: [
369
368
  /* @__PURE__ */ e(
370
369
  "button",
371
370
  {
@@ -373,7 +372,7 @@ const Qe = ({
373
372
  f(""), i("");
374
373
  },
375
374
  children: /* @__PURE__ */ e(
376
- q,
375
+ M,
377
376
  {
378
377
  className: "text-grey-50 h-3 w-3",
379
378
  "aria-hidden": "true"
@@ -383,28 +382,28 @@ const Qe = ({
383
382
  ),
384
383
  /* @__PURE__ */ e("span", { className: "bg-grey-50 h-3 w-[1px] rounded-full" })
385
384
  ] }) : null,
386
- /* @__PURE__ */ e(S.Button, { children: /* @__PURE__ */ e(K, { className: "text-grey-50 h-3 w-3", "aria-hidden": "true" }) })
385
+ /* @__PURE__ */ e(P.Button, { children: /* @__PURE__ */ e(J, { className: "text-grey-50 h-3 w-3", "aria-hidden": "true" }) })
387
386
  ] })
388
387
  ]
389
388
  }
390
389
  ),
391
390
  /* @__PURE__ */ e(
392
- le,
391
+ oe,
393
392
  {
394
393
  as: se,
395
394
  leave: "transition ease-in durati pb-0.5on-100",
396
395
  leaveFrom: "opacity-100",
397
396
  leaveTo: "opacity-0",
398
397
  afterLeave: () => f(""),
399
- children: /* @__PURE__ */ e(S.Options, { className: "bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none", children: d.length === 0 ? /* @__PURE__ */ o("div", { className: "text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5 ", children: [
400
- /* @__PURE__ */ e(J, { className: "inline h-4 w-4" }),
398
+ children: /* @__PURE__ */ e(P.Options, { className: "bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none", children: c.length === 0 ? /* @__PURE__ */ o("div", { className: "text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5 ", children: [
399
+ /* @__PURE__ */ e(W, { className: "inline h-4 w-4" }),
401
400
  " Nothing found."
402
- ] }) : d.map((l, p) => /* @__PURE__ */ e(
403
- S.Option,
401
+ ] }) : c.map((l, p) => /* @__PURE__ */ e(
402
+ P.Option,
404
403
  {
405
404
  className: ({ active: b }) => `relative cursor-default select-none ${b ? "bg-primary-hover" : ""}`,
406
405
  value: l,
407
- children: ({ selected: b }) => /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
406
+ children: ({ selected: b }) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(
408
407
  "span",
409
408
  {
410
409
  className: `block truncate p-2 py-1 ${b ? "bg-primary-dark font-medium text-white" : "font-normal"}`,
@@ -420,15 +419,15 @@ const Qe = ({
420
419
  },
421
420
  t
422
421
  );
423
- }, tt = ({
422
+ }, at = ({
424
423
  value: t,
425
424
  options: a,
426
425
  onChange: r,
427
426
  errorMessage: i,
428
- onBlur: c
427
+ onBlur: d
429
428
  }) => {
430
- const [x, f] = _(""), g = a.find((l) => l.name === t), d = g && g.exposed, n = x === "" ? a : a.filter((l) => l.name.toLowerCase().includes(x.toLowerCase()));
431
- return /* @__PURE__ */ e(S, { value: { name: t }, onChange: (l) => r(l.name), children: ({ open: l }) => /* @__PURE__ */ o("div", { className: "relative", children: [
429
+ const [x, f] = _(""), g = a.find((l) => l.name === t), c = g && g.exposed, n = x === "" ? a : a.filter((l) => l.name.toLowerCase().includes(x.toLowerCase()));
430
+ return /* @__PURE__ */ e(P, { value: { name: t }, onChange: (l) => r(l.name), children: ({ open: l }) => /* @__PURE__ */ o("div", { className: "relative", children: [
432
431
  /* @__PURE__ */ o(
433
432
  "div",
434
433
  {
@@ -436,26 +435,26 @@ const Qe = ({
436
435
  "bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative w-full cursor-default overflow-hidden rounded text-left inline-flex",
437
436
  {
438
437
  "ring-1 ring-red-400": i,
439
- "ring-1 ring-yellow-500": d,
438
+ "ring-1 ring-yellow-500": c,
440
439
  "ring-1 ring-primary-dark rounded-b-none": l,
441
440
  "overflow-visible": !l && i
442
441
  }
443
442
  ),
444
443
  children: [
445
444
  /* @__PURE__ */ e(
446
- S.Input,
445
+ P.Input,
447
446
  {
448
447
  className: C(
449
448
  "bg-grey-300 text-s w-full border-none py-1 px-2 focus:outline-none truncate rounded",
450
449
  {
451
450
  "!text-red-400": i,
452
- "!text-yellow-500": d
451
+ "!text-yellow-500": c
453
452
  }
454
453
  ),
455
454
  style: { caretColor: "white" },
456
455
  displayValue: (p) => p.name,
457
456
  onChange: (p) => f(p.target.value),
458
- onBlur: c
457
+ onBlur: d
459
458
  }
460
459
  ),
461
460
  !l && i && /* @__PURE__ */ e(
@@ -463,13 +462,13 @@ const Qe = ({
463
462
  {
464
463
  className: C(
465
464
  "absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600",
466
- { "!text-yellow-500 ring-yellow-500 bg-white": d }
465
+ { "!text-yellow-500 ring-yellow-500 bg-white": c }
467
466
  ),
468
467
  children: i
469
468
  }
470
469
  ),
471
470
  /* @__PURE__ */ o("span", { className: "inset-y-0 right-0 flex items-center gap-1 pr-2", children: [
472
- t ? /* @__PURE__ */ o(G, { children: [
471
+ t ? /* @__PURE__ */ o(F, { children: [
473
472
  /* @__PURE__ */ e(
474
473
  "button",
475
474
  {
@@ -477,7 +476,7 @@ const Qe = ({
477
476
  f(""), r("");
478
477
  },
479
478
  children: /* @__PURE__ */ e(
480
- q,
479
+ M,
481
480
  {
482
481
  className: "text-grey-50 h-3 w-3",
483
482
  "aria-hidden": "true"
@@ -487,30 +486,30 @@ const Qe = ({
487
486
  ),
488
487
  /* @__PURE__ */ e("span", { className: "bg-grey-50 h-3 w-[1px] rounded-full" })
489
488
  ] }) : null,
490
- /* @__PURE__ */ e(S.Button, { children: /* @__PURE__ */ e(K, { className: "text-grey-50 h-3 w-3", "aria-hidden": "true" }) })
489
+ /* @__PURE__ */ e(P.Button, { children: /* @__PURE__ */ e(J, { className: "text-grey-50 h-3 w-3", "aria-hidden": "true" }) })
491
490
  ] })
492
491
  ]
493
492
  }
494
493
  ),
495
494
  /* @__PURE__ */ e(
496
- le,
495
+ oe,
497
496
  {
498
497
  as: se,
499
498
  leave: "transition ease-in duration-100",
500
499
  leaveFrom: "opacity-100",
501
500
  leaveTo: "opacity-0",
502
501
  afterLeave: () => f(""),
503
- children: /* @__PURE__ */ e(S.Options, { className: "bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none", children: n.length ? n.map((p, b) => /* @__PURE__ */ e(
504
- S.Option,
502
+ children: /* @__PURE__ */ e(P.Options, { className: "bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none", children: n.length ? n.map((p, b) => /* @__PURE__ */ e(
503
+ P.Option,
505
504
  {
506
505
  className: ({ active: v }) => `relative cursor-default select-none ${v ? "bg-primary-hover" : ""}`,
507
506
  value: p,
508
- children: ({ selected: v }) => /* @__PURE__ */ e(G, { children: /* @__PURE__ */ o(
507
+ children: ({ selected: v }) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ o(
509
508
  "span",
510
509
  {
511
510
  className: `text-s flex items-center gap-2 truncate p-2 py-1 ${v ? "bg-primary-dark font-medium text-white" : "font-normal"}`,
512
511
  children: [
513
- p.exposed && /* @__PURE__ */ e(j, { className: "text-yellow-500" }),
512
+ p.exposed && /* @__PURE__ */ e(q, { className: "text-yellow-500" }),
514
513
  /* @__PURE__ */ e("span", { className: "flex-1 truncate", title: p.name, children: p.name })
515
514
  ]
516
515
  }
@@ -518,13 +517,13 @@ const Qe = ({
518
517
  },
519
518
  b
520
519
  )) : /* @__PURE__ */ o("div", { className: "text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5", children: [
521
- /* @__PURE__ */ e(J, { className: "inline h-4 w-4" }),
520
+ /* @__PURE__ */ e(W, { className: "inline h-4 w-4" }),
522
521
  " Nothing found."
523
522
  ] }) })
524
523
  }
525
524
  )
526
525
  ] }) });
527
- }, pe = ({ listeners: t, attributes: a }) => /* @__PURE__ */ e("button", { ...a, ...t, children: /* @__PURE__ */ e(ke, {}) }), ue = (t) => {
526
+ }, pe = ({ listeners: t, attributes: a }) => /* @__PURE__ */ e("button", { ...a, ...t, children: /* @__PURE__ */ e(Pe, {}) }), ue = (t) => {
528
527
  var r;
529
528
  if (!t) return "";
530
529
  let a;
@@ -535,45 +534,45 @@ const Qe = ({
535
534
  a = "";
536
535
  }
537
536
  return `Requests matching regex will be handled example: ${a}`;
538
- }, nt = ({
537
+ }, st = ({
539
538
  id: t,
540
539
  class: a,
541
540
  method: r,
542
541
  pattern: i,
543
- verbs: c,
542
+ verbs: d,
544
543
  regexPattern: x,
545
544
  asRegex: f,
546
545
  listeners: g,
547
- attributes: d
546
+ attributes: c
548
547
  }) => {
549
- var P;
548
+ var S;
550
549
  const [n, l] = _({
551
550
  className: a,
552
551
  method: r,
553
552
  pattern: i,
554
- verbs: c,
553
+ verbs: d,
555
554
  asRegex: f,
556
555
  regexPattern: x
557
- }), p = W(re), b = Object.values((p == null ? void 0 : p.singletons) || {}), v = (P = b.find((s) => s.name === n.className)) == null ? void 0 : P.methods.map(({ name: s, exposed: m }) => ({ name: s, exposed: m })), {
556
+ }), p = B(re), b = Object.values((p == null ? void 0 : p.singletons) || {}), v = (S = b.find((s) => s.name === n.className)) == null ? void 0 : S.methods.map(({ name: s, exposed: m }) => ({ name: s, exposed: m })), {
558
557
  dispatch: y,
559
558
  state: { newlyCreatedHandlerID: w }
560
- } = Q(), k = B();
559
+ } = Q(), I = G();
561
560
  function D() {
562
- const { className: s, method: m, asRegex: I, regexPattern: U, pattern: z, verbs: M } = n;
563
- return !!(s && m && (I ? U : !z.endsWith("/")) && M.length);
561
+ const { className: s, method: m, asRegex: A, regexPattern: U, pattern: z, verbs: V } = n;
562
+ return !!(s && m && (A ? U : !z.endsWith("/")) && V.length);
564
563
  }
565
564
  function T() {
566
565
  if (D()) {
567
- const { className: s, method: m, asRegex: I, regexPattern: U, pattern: z, verbs: M } = n;
566
+ const { className: s, method: m, asRegex: A, regexPattern: U, pattern: z, verbs: V } = n;
568
567
  y({
569
568
  type: "UPDATE_HANDLER",
570
569
  id: t,
571
570
  payload: {
572
571
  class: s,
573
572
  method: m,
574
- verbs: M,
575
- asRegex: I,
576
- ...I ? { regexPattern: U } : { pattern: z }
573
+ verbs: V,
574
+ asRegex: A,
575
+ ...A ? { regexPattern: U } : { pattern: z }
577
576
  }
578
577
  }), y({ type: "SET_EDITING_HANDLER", payload: null });
579
578
  }
@@ -584,29 +583,29 @@ const Qe = ({
584
583
  method: r,
585
584
  pattern: i,
586
585
  regexPattern: x,
587
- verbs: c
586
+ verbs: d
588
587
  }, m = de(n, ["id", "isExpanded"]);
589
588
  if (!D()) {
590
589
  y({ type: "DELETE_HANDLER", id: `${w}` }), y({ type: "SET_EDITING_HANDLER", payload: null });
591
590
  return;
592
591
  }
593
- if (!Je(s, m)) {
594
- const { confirmed: I } = await k(
592
+ if (!Qe(s, m)) {
593
+ const { confirmed: A } = await I(
595
594
  ae({
596
595
  title: "Cancel Changes",
597
- type: oe.CONFIRM,
598
- color: ie.DANGER,
596
+ type: ie.CONFIRM,
597
+ color: le.DANGER,
599
598
  message: "Are you sure you want to cancel changes made to this Handler?",
600
599
  icon: "FdWarningDanger"
601
600
  })
602
601
  ).unwrap();
603
- if (I) {
602
+ if (A) {
604
603
  w === t && y({ type: "DELETE_HANDLER", id: t }), y({ type: "SET_EDITING_HANDLER", payload: null });
605
604
  return;
606
605
  }
607
606
  }
608
607
  };
609
- Me(
608
+ ze(
610
609
  "esc",
611
610
  () => {
612
611
  setTimeout(() => {
@@ -614,8 +613,8 @@ const Qe = ({
614
613
  }, 100);
615
614
  },
616
615
  []
617
- ), O(() => {
618
- $.subscribe((s) => {
616
+ ), $(() => {
617
+ j.subscribe((s) => {
619
618
  s === t && T();
620
619
  });
621
620
  }, [n, t]);
@@ -645,12 +644,12 @@ const Qe = ({
645
644
  pe,
646
645
  {
647
646
  listeners: g,
648
- attributes: d
647
+ attributes: c
649
648
  },
650
649
  "grab-handle"
651
650
  ),
652
651
  /* @__PURE__ */ e(
653
- et,
652
+ rt,
654
653
  {
655
654
  value: n.className,
656
655
  onChange: (s) => {
@@ -664,7 +663,7 @@ const Qe = ({
664
663
  )
665
664
  ] }),
666
665
  /* @__PURE__ */ e("div", { className: "w-60 flex-shrink-0", children: /* @__PURE__ */ e(
667
- tt,
666
+ at,
668
667
  {
669
668
  value: n.method,
670
669
  onChange: (s) => {
@@ -718,7 +717,7 @@ const Qe = ({
718
717
  },
719
718
  className: "absolute inset-y-0 right-6 flex items-center gap-2 pr-2",
720
719
  children: /* @__PURE__ */ e(
721
- q,
720
+ M,
722
721
  {
723
722
  className: "text-grey-200 h-3 w-3",
724
723
  "aria-hidden": "true"
@@ -742,7 +741,7 @@ const Qe = ({
742
741
  value: !!n.asRegex,
743
742
  onChange: (s) => {
744
743
  const m = s ? { regexPattern: i, asRegex: s } : { pattern: x, asRegex: s };
745
- l((I) => ({ ...I, ...m }));
744
+ l((A) => ({ ...A, ...m }));
746
745
  },
747
746
  className: `${n.asRegex ? "bg-primary-dark" : "bg-grey-300"}
748
747
  relative inline-flex h-5 w-8 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,
@@ -758,7 +757,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
758
757
  ) }),
759
758
  /* @__PURE__ */ o("div", { className: "flex flex-1 items-center", children: [
760
759
  /* @__PURE__ */ e(
761
- Ze,
760
+ nt,
762
761
  {
763
762
  initialSelectedItems: n.verbs || [],
764
763
  onChange: (s) => {
@@ -788,7 +787,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
788
787
  }
789
788
  ),
790
789
  onClick: T,
791
- children: /* @__PURE__ */ e(Pe, {})
790
+ children: /* @__PURE__ */ e(Re, {})
792
791
  }
793
792
  ) }),
794
793
  /* @__PURE__ */ e(E, { label: "Cancel Changes", className: "px-1 py-3", children: /* @__PURE__ */ e(
@@ -807,41 +806,41 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
807
806
  class: a,
808
807
  method: r,
809
808
  pattern: i,
810
- verbs: c,
809
+ verbs: d,
811
810
  isExpanded: x,
812
811
  regexPattern: f,
813
812
  asRegex: g
814
813
  }) => {
815
- var P;
816
- const { attributes: d, listeners: n, setNodeRef: l, transform: p, transition: b } = ve({ id: t }), v = {
817
- transform: ze.Transform.toString(p),
814
+ var S;
815
+ const { attributes: c, listeners: n, setNodeRef: l, transform: p, transition: b } = be({ id: t }), v = {
816
+ transform: We.Transform.toString(p),
818
817
  transition: b
819
818
  }, {
820
819
  dispatch: y,
821
820
  state: { editing: w }
822
- } = Q(), k = B(), D = g ? f : i, T = W(re), H = Object.values((T == null ? void 0 : T.singletons) || {}), R = (P = H == null ? void 0 : H.find((s) => s.name === a)) == null ? void 0 : P.methods.map(({ name: s, exposed: m }) => ({ name: s, exposed: m })), h = H == null ? void 0 : H.find(
821
+ } = Q(), I = G(), D = g ? f : i, T = B(re), H = Object.values((T == null ? void 0 : T.singletons) || {}), R = (S = H == null ? void 0 : H.find((s) => s.name === a)) == null ? void 0 : S.methods.map(({ name: s, exposed: m }) => ({ name: s, exposed: m })), h = H == null ? void 0 : H.find(
823
822
  (s) => s.name === a
824
823
  ), u = R == null ? void 0 : R.find((s) => s.name === r), N = u && u.exposed;
825
824
  return /* @__PURE__ */ e("div", { className: "odd:bg-grey-500", ref: l, style: v, children: w === t ? /* @__PURE__ */ e(
826
- nt,
825
+ st,
827
826
  {
828
827
  id: t,
829
828
  class: a,
830
829
  method: r,
831
830
  pattern: i,
832
- verbs: c,
831
+ verbs: d,
833
832
  isExpanded: x,
834
833
  regexPattern: f,
835
834
  asRegex: g,
836
835
  listeners: n,
837
- attributes: d
836
+ attributes: c
838
837
  }
839
838
  ) : /* @__PURE__ */ o(
840
839
  "div",
841
840
  {
842
841
  className: "flex items-center gap-2 rounded-b py-2.5 text-grey-50",
843
842
  onDoubleClick: () => {
844
- $.next(w), y({ type: "SET_EDITING_HANDLER", payload: t });
843
+ j.next(w), y({ type: "SET_EDITING_HANDLER", payload: t });
845
844
  },
846
845
  children: [
847
846
  /* @__PURE__ */ o("div", { className: "flex w-60 flex-shrink-0 items-center gap-1 ", children: [
@@ -849,7 +848,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
849
848
  pe,
850
849
  {
851
850
  listeners: n,
852
- attributes: d
851
+ attributes: c
853
852
  },
854
853
  "grab-handle"
855
854
  ),
@@ -866,7 +865,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
866
865
  {
867
866
  label: `The singleton "${a}" doesn't exist.`,
868
867
  className: "!bg-red-300 !text-red-400",
869
- children: /* @__PURE__ */ e("span", { className: "rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center", children: /* @__PURE__ */ e(j, { className: "inline h-4 w-4 pb-0.5 text-red-400" }) })
868
+ children: /* @__PURE__ */ e("span", { className: "rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center", children: /* @__PURE__ */ e(q, { className: "inline h-4 w-4 pb-0.5 text-red-400" }) })
870
869
  }
871
870
  ),
872
871
  " ",
@@ -889,7 +888,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
889
888
  {
890
889
  label: `The method "${r}" doesn't exist.`,
891
890
  className: "!bg-red-300 !text-red-400",
892
- children: /* @__PURE__ */ e("span", { className: "rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center", children: /* @__PURE__ */ e(j, { className: "inline h-4 w-4 pb-0.5 text-red-400" }) })
891
+ children: /* @__PURE__ */ e("span", { className: "rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center", children: /* @__PURE__ */ e(q, { className: "inline h-4 w-4 pb-0.5 text-red-400" }) })
893
892
  }
894
893
  ),
895
894
  " ",
@@ -898,7 +897,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
898
897
  {
899
898
  label: `Method "${r}" is already exposed`,
900
899
  className: "!bg-yellow-100 !text-yellow-500",
901
- children: /* @__PURE__ */ e("span", { className: "rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center", children: /* @__PURE__ */ e(j, { className: "inline h-4 w-4 pb-0.5 text-yellow-500" }) })
900
+ children: /* @__PURE__ */ e("span", { className: "rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center", children: /* @__PURE__ */ e(q, { className: "inline h-4 w-4 pb-0.5 text-yellow-500" }) })
902
901
  }
903
902
  ),
904
903
  " ",
@@ -913,9 +912,9 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
913
912
  children: /* @__PURE__ */ e("span", { children: D })
914
913
  }
915
914
  ) : /* @__PURE__ */ e("span", { className: "text-grey-200 italic", children: "/" }) }),
916
- /* @__PURE__ */ e("div", { className: "px-5 w-20 flex justify-center text-grey-200", children: g ? /* @__PURE__ */ e(De, {}) : /* @__PURE__ */ e(Te, {}) }),
915
+ /* @__PURE__ */ e("div", { className: "px-5 w-20 flex justify-center text-grey-200", children: g ? /* @__PURE__ */ e(Ce, {}) : /* @__PURE__ */ e(De, {}) }),
917
916
  /* @__PURE__ */ o("div", { className: "flex flex-1 items-center", children: [
918
- /* @__PURE__ */ e("div", { className: "text-s w-full", children: c.length ? c.join(",") : /* @__PURE__ */ e("span", { className: "text-grey-200 italic", children: "undefined" }) }),
917
+ /* @__PURE__ */ e("div", { className: "text-s w-full", children: d.length ? d.join(",") : /* @__PURE__ */ e("span", { className: "text-grey-200 italic", children: "undefined" }) }),
919
918
  /* @__PURE__ */ o("div", { className: "flex items-center gap-0.5 px-2", children: [
920
919
  /* @__PURE__ */ e(E, { label: "Duplicate Handler", className: "px-1 py-3", children: /* @__PURE__ */ e(
921
920
  "button",
@@ -930,9 +929,9 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
930
929
  {
931
930
  className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
932
931
  onClick: () => {
933
- $.next(w), y({ type: "SET_EDITING_HANDLER", payload: t });
932
+ j.next(w), y({ type: "SET_EDITING_HANDLER", payload: t });
934
933
  },
935
- children: /* @__PURE__ */ e(He, {})
934
+ children: /* @__PURE__ */ e(Te, {})
936
935
  }
937
936
  ) }),
938
937
  /* @__PURE__ */ e(E, { label: "Delete Handler", className: "px-1 py-3", placement: "top-end", children: /* @__PURE__ */ e(
@@ -940,18 +939,18 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
940
939
  {
941
940
  className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
942
941
  onClick: async () => {
943
- const { confirmed: s } = await k(
942
+ const { confirmed: s } = await I(
944
943
  ae({
945
944
  title: "Delete Handler",
946
- type: oe.CONFIRM,
947
- color: ie.DANGER,
945
+ type: ie.CONFIRM,
946
+ color: le.DANGER,
948
947
  message: "Are you sure you want to remove this Handler?",
949
948
  icon: "FdWarningDanger"
950
949
  })
951
950
  ).unwrap();
952
951
  s && y({ type: "DELETE_HANDLER", id: t });
953
952
  },
954
- children: /* @__PURE__ */ e(Re, {})
953
+ children: /* @__PURE__ */ e(He, {})
955
954
  }
956
955
  ) })
957
956
  ] })
@@ -959,32 +958,32 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
959
958
  ]
960
959
  }
961
960
  ) });
962
- }, rt = A.object({
963
- class: A.string().optional(),
964
- method: A.string().optional(),
965
- verbs: A.string().optional(),
966
- id: A.string().optional(),
967
- pattern: A.string().optional(),
968
- regexPattern: A.string().optional()
969
- }), at = A.array(rt), st = ({ path: t }) => {
970
- const a = W(_e(t)), {
961
+ }, lt = k.object({
962
+ class: k.string().optional(),
963
+ method: k.string().optional(),
964
+ verbs: k.string().optional(),
965
+ id: k.string().optional(),
966
+ pattern: k.string().optional(),
967
+ regexPattern: k.string().optional()
968
+ }), it = k.array(lt), ot = ({ path: t }) => {
969
+ const a = B(ke(t)), {
971
970
  dispatch: r,
972
- state: { content: i, editing: c }
973
- } = Q(), x = me(
974
- X(ge),
975
- X(xe, {
976
- coordinateGetter: Ne
971
+ state: { content: i, editing: d }
972
+ } = Q(), x = he(
973
+ X(me),
974
+ X(ge, {
975
+ coordinateGetter: ve
977
976
  })
978
- ), [f, g] = _(null), d = i.find((l) => l.id === f), n = B();
979
- return O(() => {
977
+ ), [f, g] = _(null), c = i.find((l) => l.id === f), n = G();
978
+ return $(() => {
980
979
  const l = JSON.stringify(
981
980
  i.map(
982
- ({ isExpanded: b, asRegex: v, pattern: y, regexPattern: w, ...k }) => {
981
+ ({ isExpanded: b, asRegex: v, pattern: y, regexPattern: w, ...I }) => {
983
982
  var T;
984
983
  const D = v ? { regexPattern: w } : { pattern: y };
985
984
  return {
986
- ...k,
987
- verbs: (T = k.verbs) == null ? void 0 : T.join(","),
985
+ ...I,
986
+ verbs: (T = I.verbs) == null ? void 0 : T.join(","),
988
987
  ...D
989
988
  };
990
989
  }
@@ -993,7 +992,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
993
992
  2
994
993
  ), p = typeof (a == null ? void 0 : a.content) == "string" ? a.content : JSON.stringify(a == null ? void 0 : a.content, null, 2);
995
994
  l !== p && n(
996
- Le({
995
+ _e({
997
996
  path: t,
998
997
  content: l
999
998
  })
@@ -1001,7 +1000,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1001
1000
  }, [i]), /* @__PURE__ */ o("div", { className: "bg-grey-700 flex h-full w-full flex-col text-white", children: [
1002
1001
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-black p-2", children: [
1003
1002
  a && /* @__PURE__ */ e(
1004
- Qe,
1003
+ Ze,
1005
1004
  {
1006
1005
  label: "Switch to text Editor",
1007
1006
  Icon: Ie,
@@ -1028,9 +1027,9 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1028
1027
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 text-2xl", children: /* @__PURE__ */ e(E, { label: "Add a new HTTP Handler", children: /* @__PURE__ */ e(
1029
1028
  "button",
1030
1029
  {
1031
- disabled: !!c,
1030
+ disabled: !!d,
1032
1031
  onClick: () => {
1033
- $.next(c), r({
1032
+ j.next(d), r({
1034
1033
  type: "ADD_HANDLER",
1035
1034
  payload: {
1036
1035
  class: "",
@@ -1049,10 +1048,10 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1049
1048
  ] })
1050
1049
  ] }),
1051
1050
  /* @__PURE__ */ e("div", { className: "py-3", children: /* @__PURE__ */ o(
1052
- fe,
1051
+ xe,
1053
1052
  {
1054
1053
  sensors: x,
1055
- collisionDetection: ye,
1054
+ collisionDetection: fe,
1056
1055
  onDragStart: (l) => {
1057
1056
  g(l.active.id);
1058
1057
  },
@@ -1062,25 +1061,25 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1062
1061
  const v = i.map((w) => w.id).indexOf(p.id), y = i.map((w) => w.id).indexOf(b.id);
1063
1062
  r({
1064
1063
  type: "UPDATE_HANDLERS",
1065
- payload: Ce(i, v, y)
1064
+ payload: Ee(i, v, y)
1066
1065
  });
1067
1066
  }
1068
1067
  },
1069
1068
  children: [
1070
1069
  /* @__PURE__ */ e(
1071
- we,
1070
+ Ne,
1072
1071
  {
1073
1072
  items: i,
1074
- strategy: Ee,
1073
+ strategy: we,
1075
1074
  children: i.map(({ id: l, ...p }) => /* @__PURE__ */ e(ee, { id: l, ...p }, l))
1076
1075
  }
1077
1076
  ),
1078
- /* @__PURE__ */ e(be, { children: f && d ? /* @__PURE__ */ e("div", { className: "opacity-10", children: /* @__PURE__ */ e(ee, { ...d }) }) : null })
1077
+ /* @__PURE__ */ e(ye, { children: f && c ? /* @__PURE__ */ e("div", { className: "opacity-10", children: /* @__PURE__ */ e(ee, { ...c }) }) : null })
1079
1078
  ]
1080
1079
  }
1081
1080
  ) })
1082
1081
  ] }) : /* @__PURE__ */ o("div", { className: "mt-6", children: [
1083
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(J, { className: "text-grey-200 mx-auto h-9 w-9" }) }),
1082
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(W, { className: "text-grey-200 mx-auto h-9 w-9" }) }),
1084
1083
  /* @__PURE__ */ o("div", { className: "text-s text-grey-200 mx-auto mt-3 max-w-sm text-center", children: [
1085
1084
  "There are no http handlers configured yet ",
1086
1085
  /* @__PURE__ */ e("br", {}),
@@ -1090,7 +1089,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1090
1089
  "button",
1091
1090
  {
1092
1091
  onClick: () => {
1093
- $.next(c), r({
1092
+ j.next(d), r({
1094
1093
  type: "ADD_HANDLER",
1095
1094
  payload: {
1096
1095
  class: "",
@@ -1111,40 +1110,58 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1111
1110
  ) })
1112
1111
  ] }) })
1113
1112
  ] });
1114
- }, lt = ({ content: t, path: a }) => {
1113
+ }, dt = ({ content: t, path: a }) => {
1115
1114
  const [r, i] = _(null);
1116
- function c(d) {
1115
+ function d(c) {
1117
1116
  let n;
1118
1117
  try {
1119
- n = JSON.parse(d);
1118
+ n = JSON.parse(c);
1120
1119
  } catch {
1121
1120
  i("HTTP Handler JSON is invalid"), n = [];
1122
1121
  }
1123
1122
  return n;
1124
1123
  }
1125
- const x = typeof t == "string" ? c(t) : t;
1126
- if (!at.safeParse(x).success || r)
1124
+ const x = typeof t == "string" ? d(t) : t;
1125
+ if (!it.safeParse(x).success || r)
1127
1126
  throw new Error("Invalid JSON");
1128
- const g = x.map((d) => {
1127
+ const g = x.map((c) => {
1129
1128
  var l;
1130
- const n = !!d.regexPattern;
1129
+ const n = !!c.regexPattern;
1131
1130
  return {
1132
- ...d,
1133
- id: d.id ?? V(),
1134
- verbs: (l = d.verbs) == null ? void 0 : l.split(",").map((p) => p.toLocaleUpperCase()).filter(Boolean),
1131
+ ...c,
1132
+ id: c.id ?? K(),
1133
+ verbs: (l = c.verbs) == null ? void 0 : l.split(",").map((p) => p.toLocaleUpperCase()).filter(Boolean),
1135
1134
  asRegex: n
1136
1135
  };
1137
1136
  });
1138
- return /* @__PURE__ */ e(he, { theme: je, children: /* @__PURE__ */ e(Ye, { content: g, children: /* @__PURE__ */ e(st, { path: a }) }) });
1139
- }, Tt = (t) => /* @__PURE__ */ e(Fe, { store: Oe(), children: /* @__PURE__ */ e("div", { className: "h-screen bg-grey-900", children: /* @__PURE__ */ e(
1140
- lt,
1141
- {
1142
- path: Ke,
1143
- ...t
1144
- }
1145
- ) }) });
1137
+ return /* @__PURE__ */ e(tt, { content: g, children: /* @__PURE__ */ e(ot, { path: a }) });
1138
+ }, ct = () => document.querySelector(`.${Ye}`) || document.body, pt = () => {
1139
+ const t = B(Le), a = G();
1140
+ return /* @__PURE__ */ e(F, { children: t.map((r, i) => /* @__PURE__ */ e(
1141
+ Ke,
1142
+ {
1143
+ hasOverlay: i === 0,
1144
+ ...r,
1145
+ onClose: (d) => a(Fe(d)),
1146
+ onEdit: (d) => a(Oe(d)),
1147
+ container: ct()
1148
+ },
1149
+ r.id
1150
+ )) });
1151
+ }, Pt = ({ content: t = [], ...a }) => /* @__PURE__ */ o($e, { store: je(), children: [
1152
+ /* @__PURE__ */ e("div", { className: "h-screen bg-grey-900", children: /* @__PURE__ */ e(
1153
+ dt,
1154
+ {
1155
+ path: Je,
1156
+ content: t,
1157
+ ...a
1158
+ }
1159
+ ) }),
1160
+ /* @__PURE__ */ e(pt, {})
1161
+ ] });
1146
1162
  export {
1147
- lt as HTTPHandlersEditor,
1148
- Tt as Standalone
1163
+ dt as HTTPHandlersEditor,
1164
+ Ye as HTTP_HANDLERS_EDITOR_SCOPE_CLASS,
1165
+ Pt as Standalone
1149
1166
  };
1150
1167
  //# sourceMappingURL=index.es.js.map