zudoku 0.25.1 → 0.25.3

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.
Files changed (142) hide show
  1. package/dist/app/demo.js +0 -1
  2. package/dist/app/demo.js.map +1 -1
  3. package/dist/app/standalone.js +0 -1
  4. package/dist/app/standalone.js.map +1 -1
  5. package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
  6. package/dist/config/validators/validate.d.ts +4 -4
  7. package/dist/lib/authentication/providers/openid.js +1 -1
  8. package/dist/lib/authentication/providers/openid.js.map +1 -1
  9. package/dist/lib/oas/graphql/index.d.ts +3 -0
  10. package/dist/lib/oas/graphql/index.js +12 -13
  11. package/dist/lib/oas/graphql/index.js.map +1 -1
  12. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +10 -2
  13. package/dist/lib/plugins/openapi/ColorizedParam.js +16 -7
  14. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  15. package/dist/lib/plugins/openapi/ParameterListItem.js +3 -2
  16. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  17. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -0
  18. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  19. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +1 -1
  20. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -5
  21. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  22. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +2 -6
  23. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  24. package/dist/lib/plugins/openapi/{ExampleDisplay.d.ts → SidecarExamples.d.ts} +2 -6
  25. package/dist/lib/plugins/openapi/SidecarExamples.js +62 -0
  26. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -0
  27. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  28. package/dist/lib/plugins/openapi/client/GraphQLClient.js +22 -93
  29. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  30. package/dist/lib/plugins/openapi/client/createServer.d.ts +2 -1
  31. package/dist/lib/plugins/openapi/client/createServer.js +5 -2
  32. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -1
  33. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +1 -1
  34. package/dist/lib/plugins/openapi/client/useCreateQuery.js +2 -13
  35. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  36. package/dist/lib/plugins/openapi/index.d.ts +2 -1
  37. package/dist/lib/plugins/openapi/index.js.map +1 -1
  38. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +8 -0
  39. package/dist/lib/plugins/openapi/playground/EnumSelector.js +21 -0
  40. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +1 -0
  41. package/dist/lib/plugins/openapi/playground/PathParams.js +9 -4
  42. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  43. package/dist/lib/plugins/openapi/playground/Playground.d.ts +3 -0
  44. package/dist/lib/plugins/openapi/playground/Playground.js +5 -2
  45. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  46. package/dist/lib/plugins/openapi/playground/QueryParams.js +23 -8
  47. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  48. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +2 -1
  49. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  50. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +19 -11
  51. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  52. package/dist/lib/ui/Badge.js +1 -1
  53. package/dist/lib/ui/Badge.js.map +1 -1
  54. package/dist/lib/ui/Button.d.ts +1 -1
  55. package/dist/lib/ui/Checkbox.d.ts +8 -2
  56. package/dist/lib/ui/Checkbox.js +13 -1
  57. package/dist/lib/ui/Checkbox.js.map +1 -1
  58. package/dist/lib/util/traverse.d.ts +8 -1
  59. package/dist/lib/util/traverse.js +7 -3
  60. package/dist/lib/util/traverse.js.map +1 -1
  61. package/dist/vite/api/schema-codegen.d.ts +12 -0
  62. package/dist/vite/api/schema-codegen.js +62 -0
  63. package/dist/vite/api/schema-codegen.js.map +1 -0
  64. package/dist/vite/api/schema-codegen.test.d.ts +1 -0
  65. package/dist/vite/api/schema-codegen.test.js +247 -0
  66. package/dist/vite/api/schema-codegen.test.js.map +1 -0
  67. package/dist/vite/config.js +0 -7
  68. package/dist/vite/config.js.map +1 -1
  69. package/dist/vite/plugin-api.js +110 -82
  70. package/dist/vite/plugin-api.js.map +1 -1
  71. package/dist/vite/plugin-component.js +0 -1
  72. package/dist/vite/plugin-component.js.map +1 -1
  73. package/lib/Command-9x_kZHr4.js +611 -0
  74. package/lib/Command-9x_kZHr4.js.map +1 -0
  75. package/lib/{OperationList-BLdHAQ39.js → OperationList-B8bHMKme.js} +1440 -1434
  76. package/lib/OperationList-B8bHMKme.js.map +1 -0
  77. package/lib/{createServer-Bf5_6o6G.js → createServer-BznDkeSA.js} +4227 -5154
  78. package/lib/createServer-BznDkeSA.js.map +1 -0
  79. package/lib/index-TaRXY2w1.js +43 -0
  80. package/lib/index-TaRXY2w1.js.map +1 -0
  81. package/lib/index-sD8L1_Dl.js +1292 -0
  82. package/lib/index-sD8L1_Dl.js.map +1 -0
  83. package/lib/post-processors/traverse.js +11 -8
  84. package/lib/post-processors/traverse.js.map +1 -1
  85. package/lib/ui/Badge.js +1 -1
  86. package/lib/ui/Badge.js.map +1 -1
  87. package/lib/ui/Checkbox.js +25 -14
  88. package/lib/ui/Checkbox.js.map +1 -1
  89. package/lib/ui/Command.js +14 -550
  90. package/lib/ui/Command.js.map +1 -1
  91. package/lib/zudoku.auth-openid.js +36 -36
  92. package/lib/zudoku.auth-openid.js.map +1 -1
  93. package/lib/zudoku.plugin-openapi.js +1 -1
  94. package/package.json +1 -6
  95. package/src/app/demo.tsx +0 -1
  96. package/src/app/standalone.tsx +0 -1
  97. package/src/lib/authentication/providers/openid.tsx +1 -1
  98. package/src/lib/oas/graphql/index.ts +19 -15
  99. package/src/lib/plugins/openapi/ColorizedParam.tsx +29 -12
  100. package/src/lib/plugins/openapi/ParameterListItem.tsx +9 -7
  101. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +2 -0
  102. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -7
  103. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +5 -8
  104. package/src/lib/plugins/openapi/SidecarExamples.tsx +155 -0
  105. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +28 -120
  106. package/src/lib/plugins/openapi/client/createServer.ts +6 -2
  107. package/src/lib/plugins/openapi/client/useCreateQuery.ts +2 -17
  108. package/src/lib/plugins/openapi/index.tsx +2 -1
  109. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +86 -0
  110. package/src/lib/plugins/openapi/playground/PathParams.tsx +72 -64
  111. package/src/lib/plugins/openapi/playground/Playground.tsx +26 -13
  112. package/src/lib/plugins/openapi/playground/QueryParams.tsx +102 -73
  113. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +4 -7
  114. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +26 -11
  115. package/src/lib/ui/Badge.tsx +1 -1
  116. package/src/lib/ui/Checkbox.tsx +24 -7
  117. package/src/lib/util/traverse.ts +15 -5
  118. package/dist/lib/plugins/openapi/ExampleDisplay.js +0 -78
  119. package/dist/lib/plugins/openapi/ExampleDisplay.js.map +0 -1
  120. package/dist/lib/plugins/openapi/client/worker.d.ts +0 -4
  121. package/dist/lib/plugins/openapi/client/worker.js +0 -29
  122. package/dist/lib/plugins/openapi/client/worker.js.map +0 -1
  123. package/dist/lib/plugins/openapi-worker.d.ts +0 -1
  124. package/dist/lib/plugins/openapi-worker.js +0 -8
  125. package/dist/lib/plugins/openapi-worker.js.map +0 -1
  126. package/lib/Dialog-Bxv1yEIg.js +0 -67
  127. package/lib/Dialog-Bxv1yEIg.js.map +0 -1
  128. package/lib/OperationList-BLdHAQ39.js.map +0 -1
  129. package/lib/assets/index-C7jnHK4b.js +0 -4841
  130. package/lib/assets/index-C7jnHK4b.js.map +0 -1
  131. package/lib/assets/worker-Cbp2r2BQ.js +0 -18592
  132. package/lib/assets/worker-Cbp2r2BQ.js.map +0 -1
  133. package/lib/createServer-Bf5_6o6G.js.map +0 -1
  134. package/lib/index-BNx95gkf.js +0 -1284
  135. package/lib/index-BNx95gkf.js.map +0 -1
  136. package/lib/index-DyBL--Kz.js +0 -826
  137. package/lib/index-DyBL--Kz.js.map +0 -1
  138. package/lib/zudoku.openapi-worker.js +0 -15
  139. package/lib/zudoku.openapi-worker.js.map +0 -1
  140. package/src/lib/plugins/openapi/ExampleDisplay.tsx +0 -163
  141. package/src/lib/plugins/openapi/client/worker.ts +0 -44
  142. package/src/lib/plugins/openapi-worker.ts +0 -11
package/lib/ui/Command.js CHANGED
@@ -1,553 +1,17 @@
1
- import { j as A } from "../jsx-runtime-Dx-03ztt.js";
2
- import * as Q from "@radix-ui/react-dialog";
3
- import * as a from "react";
4
- import _e from "react";
5
- import { Primitive as j } from "@radix-ui/react-primitive";
6
- import { useId as F } from "@radix-ui/react-id";
7
- import { Search as De } from "lucide-react";
8
- import { D as je, a as Me } from "../Dialog-Bxv1yEIg.js";
9
- import { c as q } from "../cn-qaFjX9_3.js";
10
- var Se = 1, Ve = 0.9, $e = 0.8, Te = 0.17, ae = 0.1, le = 0.999, Ke = 0.9999, qe = 0.99, Ue = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Fe = /[\s-]/, ke = /[\s-]/g;
11
- function ce(e, n, t, f, l, i, s) {
12
- if (i === n.length) return l === e.length ? Se : qe;
13
- var v = `${l},${i}`;
14
- if (s[v] !== void 0) return s[v];
15
- for (var g = f.charAt(i), m = t.indexOf(g, l), c = 0, u, S, E, R; m >= 0; ) u = ce(e, n, t, f, m + 1, i + 1, s), u > c && (m === l ? u *= Se : Ue.test(e.charAt(m - 1)) ? (u *= $e, E = e.slice(l, m - 1).match(Ge), E && l > 0 && (u *= Math.pow(le, E.length))) : Fe.test(e.charAt(m - 1)) ? (u *= Ve, R = e.slice(l, m - 1).match(ke), R && l > 0 && (u *= Math.pow(le, R.length))) : (u *= Te, l > 0 && (u *= Math.pow(le, m - l))), e.charAt(m) !== n.charAt(i) && (u *= Ke)), (u < ae && t.charAt(m - 1) === f.charAt(i + 1) || f.charAt(i + 1) === f.charAt(i) && t.charAt(m - 1) !== f.charAt(i)) && (S = ce(e, n, t, f, m + 1, i + 2, s), S * ae > u && (u = S * ae)), u > c && (c = u), m = t.indexOf(g, m + 1);
16
- return s[v] = c, c;
17
- }
18
- function ye(e) {
19
- return e.toLowerCase().replace(ke, " ");
20
- }
21
- function Pe(e, n, t) {
22
- return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, ce(e, n, ye(e), ye(n), 0, 0, {});
23
- }
24
- var Z = { exports: {} }, oe = {};
25
- /**
26
- * @license React
27
- * use-sync-external-store-shim.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */
34
- var Ee;
35
- function Be() {
36
- if (Ee) return oe;
37
- Ee = 1;
38
- var e = _e;
39
- function n(u, S) {
40
- return u === S && (u !== 0 || 1 / u === 1 / S) || u !== u && S !== S;
41
- }
42
- var t = typeof Object.is == "function" ? Object.is : n, f = e.useState, l = e.useEffect, i = e.useLayoutEffect, s = e.useDebugValue;
43
- function v(u, S) {
44
- var E = S(), R = f({ inst: { value: E, getSnapshot: S } }), C = R[0].inst, I = R[1];
45
- return i(function() {
46
- C.value = E, C.getSnapshot = S, g(C) && I({ inst: C });
47
- }, [u, E, S]), l(function() {
48
- return g(C) && I({ inst: C }), u(function() {
49
- g(C) && I({ inst: C });
50
- });
51
- }, [u]), s(E), E;
52
- }
53
- function g(u) {
54
- var S = u.getSnapshot;
55
- u = u.value;
56
- try {
57
- var E = S();
58
- return !t(u, E);
59
- } catch {
60
- return !0;
61
- }
62
- }
63
- function m(u, S) {
64
- return S();
65
- }
66
- var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? m : v;
67
- return oe.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : c, oe;
68
- }
69
- var ue = {};
70
- /**
71
- * @license React
72
- * use-sync-external-store-shim.development.js
73
- *
74
- * Copyright (c) Facebook, Inc. and its affiliates.
75
- *
76
- * This source code is licensed under the MIT license found in the
77
- * LICENSE file in the root directory of this source tree.
78
- */
79
- var xe;
80
- function He() {
81
- return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
82
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
83
- var e = _e, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
84
- function t(w) {
85
- {
86
- for (var x = arguments.length, k = new Array(x > 1 ? x - 1 : 0), p = 1; p < x; p++)
87
- k[p - 1] = arguments[p];
88
- f("error", w, k);
89
- }
90
- }
91
- function f(w, x, k) {
92
- {
93
- var p = n.ReactDebugCurrentFrame, _ = p.getStackAddendum();
94
- _ !== "" && (x += "%s", k = k.concat([_]));
95
- var D = k.map(function(N) {
96
- return String(N);
97
- });
98
- D.unshift("Warning: " + x), Function.prototype.apply.call(console[w], console, D);
99
- }
100
- }
101
- function l(w, x) {
102
- return w === x && (w !== 0 || 1 / w === 1 / x) || w !== w && x !== x;
103
- }
104
- var i = typeof Object.is == "function" ? Object.is : l, s = e.useState, v = e.useEffect, g = e.useLayoutEffect, m = e.useDebugValue, c = !1, u = !1;
105
- function S(w, x, k) {
106
- c || e.startTransition !== void 0 && (c = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
107
- var p = x();
108
- if (!u) {
109
- var _ = x();
110
- i(p, _) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
111
- }
112
- var D = s({
113
- inst: {
114
- value: p,
115
- getSnapshot: x
116
- }
117
- }), N = D[0].inst, M = D[1];
118
- return g(function() {
119
- N.value = p, N.getSnapshot = x, E(N) && M({
120
- inst: N
121
- });
122
- }, [w, p, x]), v(function() {
123
- E(N) && M({
124
- inst: N
125
- });
126
- var P = function() {
127
- E(N) && M({
128
- inst: N
129
- });
130
- };
131
- return w(P);
132
- }, [w]), m(p), p;
133
- }
134
- function E(w) {
135
- var x = w.getSnapshot, k = w.value;
136
- try {
137
- var p = x();
138
- return !i(k, p);
139
- } catch {
140
- return !0;
141
- }
142
- }
143
- function R(w, x, k) {
144
- return x();
145
- }
146
- var C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", I = !C, U = I ? R : S, J = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : U;
147
- ue.useSyncExternalStore = J, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
148
- }()), ue;
149
- }
150
- var be;
151
- function We() {
152
- return be || (be = 1, process.env.NODE_ENV === "production" ? Z.exports = Be() : Z.exports = He()), Z.exports;
153
- }
154
- var ze = We(), W = '[cmdk-group=""]', ie = '[cmdk-group-items=""]', Ye = '[cmdk-group-heading=""]', se = '[cmdk-item=""]', we = `${se}:not([aria-disabled="true"])`, de = "cmdk-item-select", $ = "data-value", Je = (e, n, t) => Pe(e, n, t), Re = a.createContext(void 0), Y = () => a.useContext(Re), Ce = a.createContext(void 0), fe = () => a.useContext(Ce), Oe = a.createContext(void 0), Ie = a.forwardRef((e, n) => {
155
- let t = G(() => {
156
- var r, d;
157
- return { search: "", value: (d = (r = e.value) != null ? r : e.defaultValue) != null ? d : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
158
- }), f = G(() => /* @__PURE__ */ new Set()), l = G(() => /* @__PURE__ */ new Map()), i = G(() => /* @__PURE__ */ new Map()), s = G(() => /* @__PURE__ */ new Set()), v = Ne(e), { label: g, children: m, value: c, onValueChange: u, filter: S, shouldFilter: E, loop: R, disablePointerSelection: C = !1, vimBindings: I = !0, ...U } = e, J = F(), w = F(), x = F(), k = a.useRef(null), p = ut();
159
- T(() => {
160
- if (c !== void 0) {
161
- let r = c.trim();
162
- t.current.value = r, _.emit();
163
- }
164
- }, [c]), T(() => {
165
- p(6, me);
166
- }, []);
167
- let _ = a.useMemo(() => ({ subscribe: (r) => (s.current.add(r), () => s.current.delete(r)), snapshot: () => t.current, setState: (r, d, h) => {
168
- var o, y, b;
169
- if (!Object.is(t.current[r], d)) {
170
- if (t.current[r] = d, r === "search") te(), M(), p(1, P);
171
- else if (r === "value" && (h || p(5, me), ((o = v.current) == null ? void 0 : o.value) !== void 0)) {
172
- let L = d ?? "";
173
- (b = (y = v.current).onValueChange) == null || b.call(y, L);
174
- return;
175
- }
176
- _.emit();
177
- }
178
- }, emit: () => {
179
- s.current.forEach((r) => r());
180
- } }), []), D = a.useMemo(() => ({ value: (r, d, h) => {
181
- var o;
182
- d !== ((o = i.current.get(r)) == null ? void 0 : o.value) && (i.current.set(r, { value: d, keywords: h }), t.current.filtered.items.set(r, N(d, h)), p(2, () => {
183
- M(), _.emit();
184
- }));
185
- }, item: (r, d) => (f.current.add(r), d && (l.current.has(d) ? l.current.get(d).add(r) : l.current.set(d, /* @__PURE__ */ new Set([r]))), p(3, () => {
186
- te(), M(), t.current.value || P(), _.emit();
187
- }), () => {
188
- i.current.delete(r), f.current.delete(r), t.current.filtered.items.delete(r);
189
- let h = B();
190
- p(4, () => {
191
- te(), (h == null ? void 0 : h.getAttribute("id")) === r && P(), _.emit();
192
- });
193
- }), group: (r) => (l.current.has(r) || l.current.set(r, /* @__PURE__ */ new Set()), () => {
194
- i.current.delete(r), l.current.delete(r);
195
- }), filter: () => v.current.shouldFilter, label: g || e["aria-label"], getDisablePointerSelection: () => v.current.disablePointerSelection, listId: J, inputId: x, labelId: w, listInnerRef: k }), []);
196
- function N(r, d) {
197
- var h, o;
198
- let y = (o = (h = v.current) == null ? void 0 : h.filter) != null ? o : Je;
199
- return r ? y(r, t.current.search, d) : 0;
200
- }
201
- function M() {
202
- if (!t.current.search || v.current.shouldFilter === !1) return;
203
- let r = t.current.filtered.items, d = [];
204
- t.current.filtered.groups.forEach((o) => {
205
- let y = l.current.get(o), b = 0;
206
- y.forEach((L) => {
207
- let V = r.get(L);
208
- b = Math.max(V, b);
209
- }), d.push([o, b]);
210
- });
211
- let h = k.current;
212
- H().sort((o, y) => {
213
- var b, L;
214
- let V = o.getAttribute("id"), X = y.getAttribute("id");
215
- return ((b = r.get(X)) != null ? b : 0) - ((L = r.get(V)) != null ? L : 0);
216
- }).forEach((o) => {
217
- let y = o.closest(ie);
218
- y ? y.appendChild(o.parentElement === y ? o : o.closest(`${ie} > *`)) : h.appendChild(o.parentElement === h ? o : o.closest(`${ie} > *`));
219
- }), d.sort((o, y) => y[1] - o[1]).forEach((o) => {
220
- var y;
221
- let b = (y = k.current) == null ? void 0 : y.querySelector(`${W}[${$}="${encodeURIComponent(o[0])}"]`);
222
- b == null || b.parentElement.appendChild(b);
223
- });
224
- }
225
- function P() {
226
- let r = H().find((h) => h.getAttribute("aria-disabled") !== "true"), d = r == null ? void 0 : r.getAttribute($);
227
- _.setState("value", d || void 0);
228
- }
229
- function te() {
230
- var r, d, h, o;
231
- if (!t.current.search || v.current.shouldFilter === !1) {
232
- t.current.filtered.count = f.current.size;
233
- return;
234
- }
235
- t.current.filtered.groups = /* @__PURE__ */ new Set();
236
- let y = 0;
237
- for (let b of f.current) {
238
- let L = (d = (r = i.current.get(b)) == null ? void 0 : r.value) != null ? d : "", V = (o = (h = i.current.get(b)) == null ? void 0 : h.keywords) != null ? o : [], X = N(L, V);
239
- t.current.filtered.items.set(b, X), X > 0 && y++;
240
- }
241
- for (let [b, L] of l.current) for (let V of L) if (t.current.filtered.items.get(V) > 0) {
242
- t.current.filtered.groups.add(b);
243
- break;
244
- }
245
- t.current.filtered.count = y;
246
- }
247
- function me() {
248
- var r, d, h;
249
- let o = B();
250
- o && (((r = o.parentElement) == null ? void 0 : r.firstChild) === o && ((h = (d = o.closest(W)) == null ? void 0 : d.querySelector(Ye)) == null || h.scrollIntoView({ block: "nearest" })), o.scrollIntoView({ block: "nearest" }));
251
- }
252
- function B() {
253
- var r;
254
- return (r = k.current) == null ? void 0 : r.querySelector(`${se}[aria-selected="true"]`);
255
- }
256
- function H() {
257
- var r;
258
- return Array.from(((r = k.current) == null ? void 0 : r.querySelectorAll(we)) || []);
259
- }
260
- function re(r) {
261
- let d = H()[r];
262
- d && _.setState("value", d.getAttribute($));
263
- }
264
- function ne(r) {
265
- var d;
266
- let h = B(), o = H(), y = o.findIndex((L) => L === h), b = o[y + r];
267
- (d = v.current) != null && d.loop && (b = y + r < 0 ? o[o.length - 1] : y + r === o.length ? o[0] : o[y + r]), b && _.setState("value", b.getAttribute($));
268
- }
269
- function pe(r) {
270
- let d = B(), h = d == null ? void 0 : d.closest(W), o;
271
- for (; h && !o; ) h = r > 0 ? lt(h, W) : ot(h, W), o = h == null ? void 0 : h.querySelector(we);
272
- o ? _.setState("value", o.getAttribute($)) : ne(r);
273
- }
274
- let ve = () => re(H().length - 1), he = (r) => {
275
- r.preventDefault(), r.metaKey ? ve() : r.altKey ? pe(1) : ne(1);
276
- }, ge = (r) => {
277
- r.preventDefault(), r.metaKey ? re(0) : r.altKey ? pe(-1) : ne(-1);
278
- };
279
- return a.createElement(j.div, { ref: n, tabIndex: -1, ...U, "cmdk-root": "", onKeyDown: (r) => {
280
- var d;
281
- if ((d = U.onKeyDown) == null || d.call(U, r), !r.defaultPrevented) switch (r.key) {
282
- case "n":
283
- case "j": {
284
- I && r.ctrlKey && he(r);
285
- break;
286
- }
287
- case "ArrowDown": {
288
- he(r);
289
- break;
290
- }
291
- case "p":
292
- case "k": {
293
- I && r.ctrlKey && ge(r);
294
- break;
295
- }
296
- case "ArrowUp": {
297
- ge(r);
298
- break;
299
- }
300
- case "Home": {
301
- r.preventDefault(), re(0);
302
- break;
303
- }
304
- case "End": {
305
- r.preventDefault(), ve();
306
- break;
307
- }
308
- case "Enter":
309
- if (!r.nativeEvent.isComposing && r.keyCode !== 229) {
310
- r.preventDefault();
311
- let h = B();
312
- if (h) {
313
- let o = new Event(de);
314
- h.dispatchEvent(o);
315
- }
316
- }
317
- }
318
- } }, a.createElement("label", { "cmdk-label": "", htmlFor: D.inputId, id: D.labelId, style: ct }, g), ee(e, (r) => a.createElement(Ce.Provider, { value: _ }, a.createElement(Re.Provider, { value: D }, r))));
319
- }), Xe = a.forwardRef((e, n) => {
320
- var t, f;
321
- let l = F(), i = a.useRef(null), s = a.useContext(Oe), v = Y(), g = Ne(e), m = (f = (t = g.current) == null ? void 0 : t.forceMount) != null ? f : s == null ? void 0 : s.forceMount;
322
- T(() => {
323
- if (!m) return v.item(l, s == null ? void 0 : s.id);
324
- }, [m]);
325
- let c = Ae(l, i, [e.value, e.children, i], e.keywords), u = fe(), S = K((p) => p.value && p.value === c.current), E = K((p) => m || v.filter() === !1 ? !0 : p.search ? p.filtered.items.get(l) > 0 : !0);
326
- a.useEffect(() => {
327
- let p = i.current;
328
- if (!(!p || e.disabled)) return p.addEventListener(de, R), () => p.removeEventListener(de, R);
329
- }, [E, e.onSelect, e.disabled]);
330
- function R() {
331
- var p, _;
332
- C(), (_ = (p = g.current).onSelect) == null || _.call(p, c.current);
333
- }
334
- function C() {
335
- u.setState("value", c.current, !0);
336
- }
337
- if (!E) return null;
338
- let { disabled: I, value: U, onSelect: J, forceMount: w, keywords: x, ...k } = e;
339
- return a.createElement(j.div, { ref: z([i, n]), ...k, id: l, "cmdk-item": "", role: "option", "aria-disabled": !!I, "aria-selected": !!S, "data-disabled": !!I, "data-selected": !!S, onPointerMove: I || v.getDisablePointerSelection() ? void 0 : C, onClick: I ? void 0 : R }, e.children);
340
- }), Qe = a.forwardRef((e, n) => {
341
- let { heading: t, children: f, forceMount: l, ...i } = e, s = F(), v = a.useRef(null), g = a.useRef(null), m = F(), c = Y(), u = K((E) => l || c.filter() === !1 ? !0 : E.search ? E.filtered.groups.has(s) : !0);
342
- T(() => c.group(s), []), Ae(s, v, [e.value, e.heading, g]);
343
- let S = a.useMemo(() => ({ id: s, forceMount: l }), [l]);
344
- return a.createElement(j.div, { ref: z([v, n]), ...i, "cmdk-group": "", role: "presentation", hidden: u ? void 0 : !0 }, t && a.createElement("div", { ref: g, "cmdk-group-heading": "", "aria-hidden": !0, id: m }, t), ee(e, (E) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? m : void 0 }, a.createElement(Oe.Provider, { value: S }, E))));
345
- }), Ze = a.forwardRef((e, n) => {
346
- let { alwaysRender: t, ...f } = e, l = a.useRef(null), i = K((s) => !s.search);
347
- return !t && !i ? null : a.createElement(j.div, { ref: z([l, n]), ...f, "cmdk-separator": "", role: "separator" });
348
- }), et = a.forwardRef((e, n) => {
349
- let { onValueChange: t, ...f } = e, l = e.value != null, i = fe(), s = K((c) => c.search), v = K((c) => c.value), g = Y(), m = a.useMemo(() => {
350
- var c;
351
- let u = (c = g.listInnerRef.current) == null ? void 0 : c.querySelector(`${se}[${$}="${encodeURIComponent(v)}"]`);
352
- return u == null ? void 0 : u.getAttribute("id");
353
- }, []);
354
- return a.useEffect(() => {
355
- e.value != null && i.setState("search", e.value);
356
- }, [e.value]), a.createElement(j.input, { ref: n, ...f, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": g.listId, "aria-labelledby": g.labelId, "aria-activedescendant": m, id: g.inputId, type: "text", value: l ? e.value : s, onChange: (c) => {
357
- l || i.setState("search", c.target.value), t == null || t(c.target.value);
358
- } });
359
- }), tt = a.forwardRef((e, n) => {
360
- let { children: t, label: f = "Suggestions", ...l } = e, i = a.useRef(null), s = a.useRef(null), v = Y();
361
- return a.useEffect(() => {
362
- if (s.current && i.current) {
363
- let g = s.current, m = i.current, c, u = new ResizeObserver(() => {
364
- c = requestAnimationFrame(() => {
365
- let S = g.offsetHeight;
366
- m.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
367
- });
368
- });
369
- return u.observe(g), () => {
370
- cancelAnimationFrame(c), u.unobserve(g);
371
- };
372
- }
373
- }, []), a.createElement(j.div, { ref: z([i, n]), ...l, "cmdk-list": "", role: "listbox", "aria-label": f, id: v.listId }, ee(e, (g) => a.createElement("div", { ref: z([s, v.listInnerRef]), "cmdk-list-sizer": "" }, g)));
374
- }), rt = a.forwardRef((e, n) => {
375
- let { open: t, onOpenChange: f, overlayClassName: l, contentClassName: i, container: s, ...v } = e;
376
- return a.createElement(Q.Root, { open: t, onOpenChange: f }, a.createElement(Q.Portal, { container: s }, a.createElement(Q.Overlay, { "cmdk-overlay": "", className: l }), a.createElement(Q.Content, { "aria-label": e.label, "cmdk-dialog": "", className: i }, a.createElement(Ie, { ref: n, ...v }))));
377
- }), nt = a.forwardRef((e, n) => K((t) => t.filtered.count === 0) ? a.createElement(j.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), at = a.forwardRef((e, n) => {
378
- let { progress: t, children: f, label: l = "Loading...", ...i } = e;
379
- return a.createElement(j.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": l }, ee(e, (s) => a.createElement("div", { "aria-hidden": !0 }, s)));
380
- }), O = Object.assign(Ie, { List: tt, Item: Xe, Input: et, Group: Qe, Separator: Ze, Dialog: rt, Empty: nt, Loading: at });
381
- function lt(e, n) {
382
- let t = e.nextElementSibling;
383
- for (; t; ) {
384
- if (t.matches(n)) return t;
385
- t = t.nextElementSibling;
386
- }
387
- }
388
- function ot(e, n) {
389
- let t = e.previousElementSibling;
390
- for (; t; ) {
391
- if (t.matches(n)) return t;
392
- t = t.previousElementSibling;
393
- }
394
- }
395
- function Ne(e) {
396
- let n = a.useRef(e);
397
- return T(() => {
398
- n.current = e;
399
- }), n;
400
- }
401
- var T = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
402
- function G(e) {
403
- let n = a.useRef();
404
- return n.current === void 0 && (n.current = e()), n;
405
- }
406
- function z(e) {
407
- return (n) => {
408
- e.forEach((t) => {
409
- typeof t == "function" ? t(n) : t != null && (t.current = n);
410
- });
411
- };
412
- }
413
- function K(e) {
414
- let n = fe(), t = () => e(n.snapshot());
415
- return ze.useSyncExternalStore(n.subscribe, t, t);
416
- }
417
- function Ae(e, n, t, f = []) {
418
- let l = a.useRef(), i = Y();
419
- return T(() => {
420
- var s;
421
- let v = (() => {
422
- var m;
423
- for (let c of t) {
424
- if (typeof c == "string") return c.trim();
425
- if (typeof c == "object" && "current" in c) return c.current ? (m = c.current.textContent) == null ? void 0 : m.trim() : l.current;
426
- }
427
- })(), g = f.map((m) => m.trim());
428
- i.value(e, v, g), (s = n.current) == null || s.setAttribute($, v), l.current = v;
429
- }), l;
430
- }
431
- var ut = () => {
432
- let [e, n] = a.useState(), t = G(() => /* @__PURE__ */ new Map());
433
- return T(() => {
434
- t.current.forEach((f) => f()), t.current = /* @__PURE__ */ new Map();
435
- }, [e]), (f, l) => {
436
- t.current.set(f, l), n({});
437
- };
438
- };
439
- function it(e) {
440
- let n = e.type;
441
- return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
442
- }
443
- function ee({ asChild: e, children: n }, t) {
444
- return e && a.isValidElement(n) ? a.cloneElement(it(n), { ref: n.ref }, t(n.props.children)) : t(n);
445
- }
446
- var ct = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
447
- const Le = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ A.jsx(
448
- O,
449
- {
450
- ref: t,
451
- className: q(
452
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
453
- e
454
- ),
455
- ...n
456
- }
457
- ));
458
- Le.displayName = O.displayName;
459
- const _t = ({ children: e, ...n }) => /* @__PURE__ */ A.jsx(je, { ...n, children: /* @__PURE__ */ A.jsx(Me, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ A.jsx(Le, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), dt = a.forwardRef(({ className: e, ...n }, t) => (
460
- // eslint-disable-next-line react/no-unknown-property
461
- /* @__PURE__ */ A.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
462
- /* @__PURE__ */ A.jsx(De, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
463
- /* @__PURE__ */ A.jsx(
464
- O.Input,
465
- {
466
- ref: t,
467
- className: q(
468
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
469
- e
470
- ),
471
- ...n
472
- }
473
- )
474
- ] })
475
- ));
476
- dt.displayName = O.Input.displayName;
477
- const st = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ A.jsx(
478
- O.List,
479
- {
480
- ref: t,
481
- className: q("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
482
- ...n
483
- }
484
- ));
485
- st.displayName = O.List.displayName;
486
- const ft = a.forwardRef((e, n) => /* @__PURE__ */ A.jsx(
487
- O.Empty,
488
- {
489
- ref: n,
490
- className: "py-6 text-center text-sm",
491
- ...e
492
- }
493
- ));
494
- ft.displayName = O.Empty.displayName;
495
- const mt = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ A.jsx(
496
- O.Group,
497
- {
498
- ref: t,
499
- className: q(
500
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
501
- e
502
- ),
503
- ...n
504
- }
505
- ));
506
- mt.displayName = O.Group.displayName;
507
- const pt = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ A.jsx(
508
- O.Separator,
509
- {
510
- ref: t,
511
- className: q("-mx-1 h-px bg-border", e),
512
- ...n
513
- }
514
- ));
515
- pt.displayName = O.Separator.displayName;
516
- const vt = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ A.jsx(
517
- O.Item,
518
- {
519
- ref: t,
520
- className: q(
521
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
522
- e
523
- ),
524
- ...n
525
- }
526
- ));
527
- vt.displayName = O.Item.displayName;
528
- const ht = ({
529
- className: e,
530
- ...n
531
- }) => /* @__PURE__ */ A.jsx(
532
- "span",
533
- {
534
- className: q(
535
- "ml-auto text-xs tracking-widest text-muted-foreground",
536
- e
537
- ),
538
- ...n
539
- }
540
- );
541
- ht.displayName = "CommandShortcut";
1
+ import "../jsx-runtime-Dx-03ztt.js";
2
+ import { C as r, h as s, c as C, i as p, a as i, d as e, b as u, j as c, k as h } from "../Command-9x_kZHr4.js";
3
+ import "lucide-react";
4
+ import "react";
5
+ import "../cn-qaFjX9_3.js";
542
6
  export {
543
- Le as Command,
544
- _t as CommandDialog,
545
- ft as CommandEmpty,
546
- mt as CommandGroup,
547
- dt as CommandInput,
548
- vt as CommandItem,
549
- st as CommandList,
550
- pt as CommandSeparator,
551
- ht as CommandShortcut
7
+ r as Command,
8
+ s as CommandDialog,
9
+ C as CommandEmpty,
10
+ p as CommandGroup,
11
+ i as CommandInput,
12
+ e as CommandItem,
13
+ u as CommandList,
14
+ c as CommandSeparator,
15
+ h as CommandShortcut
552
16
  };
553
17
  //# sourceMappingURL=Command.js.map