@mounaji_npm/saas-template 0.1.1 → 0.1.2

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.
@@ -1,6 +1,6 @@
1
- import de, { createContext as ue, useState as A, useCallback as U, useMemo as re, useContext as fe, useEffect as ne, useRef as pe } from "react";
2
- import { TOKEN_CSS_MAP as te, TokensProvider as me } from "@mounaji_npm/tokens";
3
- var C = { exports: {} }, S = {};
1
+ import je, { createContext as we, useState as B, useCallback as N, useMemo as me, useContext as Ee, useEffect as Y, useRef as O, useLayoutEffect as ae } from "react";
2
+ import { TokensProvider as Se } from "@mounaji_npm/tokens";
3
+ var ee = { exports: {} }, Z = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var C = { exports: {} }, S = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var K;
14
- function xe() {
15
- if (K) return S;
16
- K = 1;
17
- var r = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
18
- function t(i, a, s) {
19
- var u = null;
20
- if (s !== void 0 && (u = "" + s), a.key !== void 0 && (u = "" + a.key), "key" in a) {
21
- s = {};
22
- for (var c in a)
23
- c !== "key" && (s[c] = a[c]);
24
- } else s = a;
25
- return a = s.ref, {
26
- $$typeof: r,
27
- type: i,
28
- key: u,
29
- ref: a !== void 0 ? a : null,
30
- props: s
13
+ var le;
14
+ function _e() {
15
+ if (le) return Z;
16
+ le = 1;
17
+ var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
18
+ function o(s, i, l) {
19
+ var f = null;
20
+ if (l !== void 0 && (f = "" + l), i.key !== void 0 && (f = "" + i.key), "key" in i) {
21
+ l = {};
22
+ for (var a in i)
23
+ a !== "key" && (l[a] = i[a]);
24
+ } else l = i;
25
+ return i = l.ref, {
26
+ $$typeof: e,
27
+ type: s,
28
+ key: f,
29
+ ref: i !== void 0 ? i : null,
30
+ props: l
31
31
  };
32
32
  }
33
- return S.Fragment = o, S.jsx = t, S.jsxs = t, S;
33
+ return Z.Fragment = n, Z.jsx = o, Z.jsxs = o, Z;
34
34
  }
35
- var R = {};
35
+ var Q = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,428 +42,406 @@ var R = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var Q;
46
- function he() {
47
- return Q || (Q = 1, process.env.NODE_ENV !== "production" && (function() {
48
- function r(e) {
49
- if (e == null) return null;
50
- if (typeof e == "function")
51
- return e.$$typeof === se ? null : e.displayName || e.name || null;
52
- if (typeof e == "string") return e;
53
- switch (e) {
54
- case _:
45
+ var de;
46
+ function ke() {
47
+ return de || (de = 1, process.env.NODE_ENV !== "production" && (function() {
48
+ function e(r) {
49
+ if (r == null) return null;
50
+ if (typeof r == "function")
51
+ return r.$$typeof === P ? null : r.displayName || r.name || null;
52
+ if (typeof r == "string") return r;
53
+ switch (r) {
54
+ case M:
55
55
  return "Fragment";
56
- case O:
56
+ case T:
57
57
  return "Profiler";
58
58
  case j:
59
59
  return "StrictMode";
60
- case w:
60
+ case k:
61
61
  return "Suspense";
62
- case D:
62
+ case W:
63
63
  return "SuspenseList";
64
- case ie:
64
+ case X:
65
65
  return "Activity";
66
66
  }
67
- if (typeof e == "object")
68
- switch (typeof e.tag == "number" && console.error(
67
+ if (typeof r == "object")
68
+ switch (typeof r.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
- ), e.$$typeof) {
71
- case d:
72
- return "Portal";
70
+ ), r.$$typeof) {
73
71
  case I:
74
- return e.displayName || "Context";
75
- case P:
76
- return (e._context.displayName || "Context") + ".Consumer";
72
+ return "Portal";
73
+ case E:
74
+ return r.displayName || "Context";
75
+ case x:
76
+ return (r._context.displayName || "Context") + ".Consumer";
77
+ case b:
78
+ var c = r.render;
79
+ return r = r.displayName, r || (r = c.displayName || c.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
80
+ case L:
81
+ return c = r.displayName || null, c !== null ? c : e(r.type) || "Memo";
77
82
  case F:
78
- var l = e.render;
79
- return e = e.displayName, e || (e = l.displayName || l.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
- case B:
81
- return l = e.displayName || null, l !== null ? l : r(e.type) || "Memo";
82
- case z:
83
- l = e._payload, e = e._init;
83
+ c = r._payload, r = r._init;
84
84
  try {
85
- return r(e(l));
85
+ return e(r(c));
86
86
  } catch {
87
87
  }
88
88
  }
89
89
  return null;
90
90
  }
91
- function o(e) {
92
- return "" + e;
91
+ function n(r) {
92
+ return "" + r;
93
93
  }
94
- function t(e) {
94
+ function o(r) {
95
95
  try {
96
- o(e);
97
- var l = !1;
96
+ n(r);
97
+ var c = !1;
98
98
  } catch {
99
- l = !0;
99
+ c = !0;
100
100
  }
101
- if (l) {
102
- l = console;
103
- var p = l.error, m = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
- return p.call(
105
- l,
101
+ if (c) {
102
+ c = console;
103
+ var w = c.error, S = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
104
+ return w.call(
105
+ c,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- m
108
- ), o(e);
107
+ S
108
+ ), n(r);
109
109
  }
110
110
  }
111
- function i(e) {
112
- if (e === _) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === z)
111
+ function s(r) {
112
+ if (r === M) return "<>";
113
+ if (typeof r == "object" && r !== null && r.$$typeof === F)
114
114
  return "<...>";
115
115
  try {
116
- var l = r(e);
117
- return l ? "<" + l + ">" : "<...>";
116
+ var c = e(r);
117
+ return c ? "<" + c + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
- function a() {
123
- var e = N.A;
124
- return e === null ? null : e.getOwner();
122
+ function i() {
123
+ var r = $.A;
124
+ return r === null ? null : r.getOwner();
125
125
  }
126
- function s() {
126
+ function l() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function u(e) {
130
- if (J.call(e, "key")) {
131
- var l = Object.getOwnPropertyDescriptor(e, "key").get;
132
- if (l && l.isReactWarning) return !1;
129
+ function f(r) {
130
+ if (z.call(r, "key")) {
131
+ var c = Object.getOwnPropertyDescriptor(r, "key").get;
132
+ if (c && c.isReactWarning) return !1;
133
133
  }
134
- return e.key !== void 0;
134
+ return r.key !== void 0;
135
135
  }
136
- function c(e, l) {
137
- function p() {
138
- V || (V = !0, console.error(
136
+ function a(r, c) {
137
+ function w() {
138
+ m || (m = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
- l
140
+ c
141
141
  ));
142
142
  }
143
- p.isReactWarning = !0, Object.defineProperty(e, "key", {
144
- get: p,
143
+ w.isReactWarning = !0, Object.defineProperty(r, "key", {
144
+ get: w,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function f() {
149
- var e = r(this.type);
150
- return X[e] || (X[e] = !0, console.error(
148
+ function h() {
149
+ var r = e(this.type);
150
+ return A[r] || (A[r] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
- )), e = this.props.ref, e !== void 0 ? e : null;
152
+ )), r = this.props.ref, r !== void 0 ? r : null;
153
153
  }
154
- function b(e, l, p, m, T, M) {
155
- var x = p.ref;
156
- return e = {
157
- $$typeof: k,
158
- type: e,
159
- key: l,
160
- props: p,
161
- _owner: m
162
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(e, "ref", {
154
+ function d(r, c, w, S, K, te) {
155
+ var _ = w.ref;
156
+ return r = {
157
+ $$typeof: C,
158
+ type: r,
159
+ key: c,
160
+ props: w,
161
+ _owner: S
162
+ }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(r, "ref", {
163
163
  enumerable: !1,
164
- get: f
165
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
164
+ get: h
165
+ }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
169
  value: 0
170
- }), Object.defineProperty(e, "_debugInfo", {
170
+ }), Object.defineProperty(r, "_debugInfo", {
171
171
  configurable: !1,
172
172
  enumerable: !1,
173
173
  writable: !0,
174
174
  value: null
175
- }), Object.defineProperty(e, "_debugStack", {
175
+ }), Object.defineProperty(r, "_debugStack", {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: T
180
- }), Object.defineProperty(e, "_debugTask", {
179
+ value: K
180
+ }), Object.defineProperty(r, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: M
185
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
184
+ value: te
185
+ }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
186
186
  }
187
- function h(e, l, p, m, T, M) {
188
- var x = l.children;
189
- if (x !== void 0)
190
- if (m)
191
- if (le(x)) {
192
- for (m = 0; m < x.length; m++)
193
- v(x[m]);
194
- Object.freeze && Object.freeze(x);
187
+ function y(r, c, w, S, K, te) {
188
+ var _ = c.children;
189
+ if (_ !== void 0)
190
+ if (S)
191
+ if (U(_)) {
192
+ for (S = 0; S < _.length; S++)
193
+ u(_[S]);
194
+ Object.freeze && Object.freeze(_);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else v(x);
200
- if (J.call(l, "key")) {
201
- x = r(e);
202
- var E = Object.keys(l).filter(function(ce) {
203
- return ce !== "key";
199
+ else u(_);
200
+ if (z.call(c, "key")) {
201
+ _ = e(r);
202
+ var J = Object.keys(c).filter(function(ve) {
203
+ return ve !== "key";
204
204
  });
205
- m = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", Z[x + m] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ S = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", se[_ + S] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
211
  <%s key={someKey} {...props} />`,
212
- m,
213
- x,
214
- E,
215
- x
216
- ), Z[x + m] = !0);
212
+ S,
213
+ _,
214
+ J,
215
+ _
216
+ ), se[_ + S] = !0);
217
217
  }
218
- if (x = null, p !== void 0 && (t(p), x = "" + p), u(l) && (t(l.key), x = "" + l.key), "key" in l) {
219
- p = {};
220
- for (var L in l)
221
- L !== "key" && (p[L] = l[L]);
222
- } else p = l;
223
- return x && c(
224
- p,
225
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), b(
227
- e,
228
- x,
229
- p,
230
- a(),
231
- T,
232
- M
218
+ if (_ = null, w !== void 0 && (o(w), _ = "" + w), f(c) && (o(c.key), _ = "" + c.key), "key" in c) {
219
+ w = {};
220
+ for (var re in c)
221
+ re !== "key" && (w[re] = c[re]);
222
+ } else w = c;
223
+ return _ && a(
224
+ w,
225
+ typeof r == "function" ? r.displayName || r.name || "Unknown" : r
226
+ ), d(
227
+ r,
228
+ _,
229
+ w,
230
+ i(),
231
+ K,
232
+ te
233
233
  );
234
234
  }
235
- function v(e) {
236
- y(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === z && (e._payload.status === "fulfilled" ? y(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
235
+ function u(r) {
236
+ v(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === F && (r._payload.status === "fulfilled" ? v(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
237
237
  }
238
- function y(e) {
239
- return typeof e == "object" && e !== null && e.$$typeof === k;
238
+ function v(r) {
239
+ return typeof r == "object" && r !== null && r.$$typeof === C;
240
240
  }
241
- var g = de, k = Symbol.for("react.transitional.element"), d = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), I = Symbol.for("react.context"), F = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), ie = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), N = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, le = Array.isArray, W = console.createTask ? console.createTask : function() {
241
+ var p = je, C = Symbol.for("react.transitional.element"), I = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), E = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), X = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), $ = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, U = Array.isArray, H = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- g = {
245
- react_stack_bottom_frame: function(e) {
246
- return e();
244
+ p = {
245
+ react_stack_bottom_frame: function(r) {
246
+ return r();
247
247
  }
248
248
  };
249
- var V, X = {}, H = g.react_stack_bottom_frame.bind(
250
- g,
251
- s
252
- )(), G = W(i(s)), Z = {};
253
- R.Fragment = _, R.jsx = function(e, l, p) {
254
- var m = 1e4 > N.recentlyCreatedOwnerStacks++;
255
- return h(
256
- e,
257
- l,
258
- p,
249
+ var m, A = {}, q = p.react_stack_bottom_frame.bind(
250
+ p,
251
+ l
252
+ )(), ie = H(s(l)), se = {};
253
+ Q.Fragment = M, Q.jsx = function(r, c, w) {
254
+ var S = 1e4 > $.recentlyCreatedOwnerStacks++;
255
+ return y(
256
+ r,
257
+ c,
258
+ w,
259
259
  !1,
260
- m ? Error("react-stack-top-frame") : H,
261
- m ? W(i(e)) : G
260
+ S ? Error("react-stack-top-frame") : q,
261
+ S ? H(s(r)) : ie
262
262
  );
263
- }, R.jsxs = function(e, l, p) {
264
- var m = 1e4 > N.recentlyCreatedOwnerStacks++;
265
- return h(
266
- e,
267
- l,
268
- p,
263
+ }, Q.jsxs = function(r, c, w) {
264
+ var S = 1e4 > $.recentlyCreatedOwnerStacks++;
265
+ return y(
266
+ r,
267
+ c,
268
+ w,
269
269
  !0,
270
- m ? Error("react-stack-top-frame") : H,
271
- m ? W(i(e)) : G
270
+ S ? Error("react-stack-top-frame") : q,
271
+ S ? H(s(r)) : ie
272
272
  );
273
273
  };
274
- })()), R;
274
+ })()), Q;
275
275
  }
276
- var ee;
277
- function be() {
278
- return ee || (ee = 1, process.env.NODE_ENV === "production" ? C.exports = xe() : C.exports = he()), C.exports;
276
+ var ce;
277
+ function Re() {
278
+ return ce || (ce = 1, process.env.NODE_ENV === "production" ? ee.exports = _e() : ee.exports = ke()), ee.exports;
279
279
  }
280
- var n = be();
281
- const oe = ue({
280
+ var t = Re();
281
+ const be = we({
282
282
  modules: [],
283
283
  register: () => {
284
284
  },
285
285
  unregister: () => {
286
286
  }
287
287
  });
288
- function ge({ children: r, initialModules: o = [] }) {
289
- const [t, i] = A([]), a = U((c) => {
290
- i((f) => f.find((h) => h.id === c.id) ? f.map((h) => h.id === c.id ? c : h) : [...f, c]);
291
- }, []), s = U((c) => {
292
- i((f) => f.filter((b) => b.id !== c));
293
- }, []), u = re(() => {
294
- const c = /* @__PURE__ */ new Map();
295
- return [...o, ...t].forEach((f) => c.set(f.id, f)), Array.from(c.values());
296
- }, [o, t]);
297
- return /* @__PURE__ */ n.jsx(oe.Provider, { value: { modules: u, register: a, unregister: s }, children: r });
288
+ function Ce({ children: e, initialModules: n = [] }) {
289
+ const [o, s] = B([]), i = N((a) => {
290
+ s((h) => h.find((y) => y.id === a.id) ? h.map((y) => y.id === a.id ? a : y) : [...h, a]);
291
+ }, []), l = N((a) => {
292
+ s((h) => h.filter((d) => d.id !== a));
293
+ }, []), f = me(() => {
294
+ const a = /* @__PURE__ */ new Map();
295
+ return [...n, ...o].forEach((h) => a.set(h.id, h)), Array.from(a.values());
296
+ }, [n, o]);
297
+ return /* @__PURE__ */ t.jsx(be.Provider, { value: { modules: f, register: i, unregister: l }, children: e });
298
298
  }
299
- function ae() {
300
- return fe(oe);
299
+ function ge() {
300
+ return Ee(be);
301
301
  }
302
- function Me(r, o = !0) {
303
- const { register: t, unregister: i } = ae();
304
- ne(() => {
305
- if (!(!o || !(r != null && r.id)))
306
- return t(r), () => i(r.id);
307
- }, [r == null ? void 0 : r.id, o]);
302
+ function Je(e, n = !0) {
303
+ const { register: o, unregister: s } = ge();
304
+ Y(() => {
305
+ if (!(!n || !(e != null && e.id)))
306
+ return o(e), () => s(e.id);
307
+ }, [e == null ? void 0 : e.id, n]);
308
308
  }
309
- function ve() {
310
- const { modules: r } = ae();
311
- return re(() => {
312
- const o = r.filter((a) => !a.hidden), t = /* @__PURE__ */ new Map();
313
- o.forEach((a) => {
314
- const s = a.section ?? "__TOP__";
315
- t.has(s) || t.set(s, []), t.get(s).push(a);
316
- }), t.forEach((a) => a.sort((s, u) => (s.order ?? 99) - (u.order ?? 99)));
317
- const i = [];
318
- return t.has("__TOP__") && i.push({ label: null, items: t.get("__TOP__") }), Array.from(t.entries()).filter(([a]) => a !== "__TOP__").sort(([a], [s]) => a.localeCompare(s)).forEach(([a, s]) => i.push({ label: a, items: s })), i;
319
- }, [r]);
309
+ function Te() {
310
+ const { modules: e } = ge();
311
+ return me(() => {
312
+ const n = e.filter((i) => !i.hidden), o = /* @__PURE__ */ new Map();
313
+ n.forEach((i) => {
314
+ const l = i.section ?? "__TOP__";
315
+ o.has(l) || o.set(l, []), o.get(l).push(i);
316
+ }), o.forEach((i) => i.sort((l, f) => (l.order ?? 99) - (f.order ?? 99)));
317
+ const s = [];
318
+ return o.has("__TOP__") && s.push({ label: null, items: o.get("__TOP__") }), Array.from(o.entries()).filter(([i]) => i !== "__TOP__").sort(([i], [l]) => i.localeCompare(l)).forEach(([i, l]) => s.push({ label: i, items: l })), s;
319
+ }, [e]);
320
320
  }
321
- function ye(r) {
322
- if (!r) return {};
323
- const o = {};
324
- return Object.entries(r).forEach(([t, i]) => {
325
- const a = te[t];
326
- a && (o[a] = i);
327
- }), o;
321
+ const D = 3e3, ue = 1024;
322
+ function fe(e, n = "width") {
323
+ const o = {
324
+ fast: { dur: "340ms", ease: "cubic-bezier(0.16, 1, 0.3, 1)" },
325
+ normal: { dur: "380ms", ease: "cubic-bezier(0.16, 1, 0.3, 1)" },
326
+ slow: { dur: "700ms", ease: "cubic-bezier(0.4, 0, 0.2, 1)" }
327
+ }, { dur: s, ease: i } = o[e] ?? o.normal;
328
+ return n.split(",").map((l) => `${l.trim()} ${s} ${i}`).join(", ");
328
329
  }
329
- const ke = 220, je = 60;
330
- function _e({
331
- logo: r,
332
- bottomItems: o = [],
333
- collapsed: t = !1,
334
- onCollapse: i,
335
- activePath: a = "/",
336
- onNavigate: s,
337
- LinkComponent: u = "a",
338
- tokens: c,
339
- style: f
340
- }) {
341
- const b = ve(), [h, v] = A(/* @__PURE__ */ new Set()), y = U((d) => {
342
- v((_) => {
343
- const j = new Set(_);
344
- return j.has(d) ? j.delete(d) : j.add(d), j;
345
- });
330
+ function V(e, n, o, s, i) {
331
+ return e ? `var(${n}, ${o})` : `var(${s}, ${i})`;
332
+ }
333
+ const g = {
334
+ navBg: (e) => V(e, "--mn-color-nav-dark", "#07091C", "--mn-color-nav-light", "#E1DAD0"),
335
+ border: (e) => V(e, "--mn-border-dark", "rgba(255,255,255,0.07)", "--mn-border-light", "#C9C2B6"),
336
+ borderMd: (e) => V(e, "--mn-border-md-dark", "rgba(255,255,255,0.13)", "--mn-border-md-light", "#BDB5A8"),
337
+ textPri: (e) => V(e, "--mn-text-primary-dark", "#F0F4FF", "--mn-text-primary-light", "#1C1915"),
338
+ textSec: (e) => V(e, "--mn-text-secondary-dark", "#94A3B8", "--mn-text-secondary-light", "#47413C"),
339
+ textMuted: (e) => V(e, "--mn-text-muted-dark", "#64748B", "--mn-text-muted-light", "#7A7470"),
340
+ activeItemBg: (e) => e ? "rgba(255,255,255,0.08)" : "rgba(59,130,246,0.10)",
341
+ hoverItemBg: (e) => e ? "rgba(255,255,255,0.04)" : "rgba(0,0,0,0.04)",
342
+ bottomBg: (e) => e ? "rgba(0,0,0,0.20)" : "rgba(0,0,0,0.03)",
343
+ userCard: (e) => e ? "rgba(255,255,255,0.04)" : "rgba(0,0,0,0.04)",
344
+ mobileTopBg: (e) => e ? "rgba(0,0,0,0)" : "rgba(255,255,255,0.95)"
345
+ }, Ae = ({ size: e = 16, style: n }) => /* @__PURE__ */ t.jsx("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: n, children: /* @__PURE__ */ t.jsx("path", { d: "M15 18l-6-6 6-6" }) }), ye = ({ size: e = 16, style: n }) => /* @__PURE__ */ t.jsx("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: n, children: /* @__PURE__ */ t.jsx("path", { d: "M9 18l6-6-6-6" }) }), xe = ({ size: e = 14, style: n }) => /* @__PURE__ */ t.jsx("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: n, children: /* @__PURE__ */ t.jsx("path", { d: "M6 9l6 6 6-6" }) }), Me = ({ size: e = 18 }) => /* @__PURE__ */ t.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
346
+ /* @__PURE__ */ t.jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
347
+ /* @__PURE__ */ t.jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
348
+ /* @__PURE__ */ t.jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
349
+ ] }), Ie = ({ size: e = 16 }) => /* @__PURE__ */ t.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
350
+ /* @__PURE__ */ t.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
351
+ /* @__PURE__ */ t.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
352
+ ] });
353
+ function Be({ onCollapse: e, onExpand: n }) {
354
+ const o = O(null), s = O({ active: !1, startX: 0, startY: 0, moved: !1 });
355
+ Y(() => {
356
+ const a = o.current;
357
+ a && (a.style.opacity = "1", a.style.transform = "");
346
358
  }, []);
347
- function g(d) {
348
- return d === "/" ? a === "/" : a === d || a.startsWith(d + "/");
349
- }
350
- const k = t ? je : ke;
351
- return /* @__PURE__ */ n.jsxs(
352
- "aside",
359
+ const i = N((a) => {
360
+ const h = a.touches[0];
361
+ s.current = { active: !0, startX: h.clientX, startY: h.clientY, moved: !1 };
362
+ const d = o.current;
363
+ d && (d.style.transition = "box-shadow 0.1s ease", d.style.transform = "scale(1.12)", d.style.boxShadow = "0 0 0 6px rgba(99,102,241,0.2), 0 8px 28px rgba(99,102,241,0.55)");
364
+ }, []), l = N((a) => {
365
+ if (!s.current.active) return;
366
+ const h = a.touches[0], d = h.clientX - s.current.startX, y = h.clientY - s.current.startY;
367
+ (Math.abs(d) > 5 || Math.abs(y) > 5) && (s.current.moved = !0);
368
+ const u = o.current;
369
+ u && (u.style.transition = "none", u.style.transform = `translate(${d * 0.45}px, ${y * 0.45}px) scale(1.1)`);
370
+ }, []), f = N((a) => {
371
+ if (!s.current.active) return;
372
+ const h = a.changedTouches[0], d = h.clientX - s.current.startX, y = h.clientY - s.current.startY;
373
+ s.current.active = !1;
374
+ const u = o.current;
375
+ if (u && (u.style.transition = "transform 0.38s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s ease", u.style.boxShadow = "0 4px 18px rgba(99,102,241,0.4)"), s.current.moved) {
376
+ const v = Math.abs(d), p = Math.abs(y);
377
+ v >= p * 0.75 && v > 22 ? (u && (u.style.transform = `translateX(${d > 0 ? 24 : -24}px) scale(0.85)`, u.style.opacity = "0"), setTimeout(() => n(), 80)) : p > v && p > 22 ? (u && (u.style.transform = "translateY(-10px) scale(1.06)"), setTimeout(() => {
378
+ u && (u.style.transform = "scale(1) translateY(0)");
379
+ }, 80)) : u && (u.style.transform = "scale(1) translate(0,0)");
380
+ } else
381
+ u && (u.style.transform = "scale(1) translate(0,0)"), e();
382
+ }, [e, n]);
383
+ return /* @__PURE__ */ t.jsx(
384
+ "button",
353
385
  {
386
+ ref: o,
387
+ onTouchStart: i,
388
+ onTouchMove: l,
389
+ onTouchEnd: f,
390
+ onClick: e,
391
+ title: "Open sidebar",
354
392
  style: {
355
393
  position: "fixed",
356
- top: 0,
357
- left: 0,
358
- bottom: 0,
359
- width: k,
394
+ top: 12,
395
+ left: 12,
396
+ zIndex: 50,
397
+ width: 40,
398
+ height: 40,
399
+ borderRadius: "50%",
360
400
  display: "flex",
361
- flexDirection: "column",
362
- backgroundColor: "var(--mn-color-nav-dark, #07091C)",
363
- borderRight: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
364
- transition: "width 340ms cubic-bezier(0.16,1,0.3,1)",
365
- overflow: "hidden",
366
- zIndex: 40,
367
- fontFamily: "var(--mn-font-family, inherit)",
368
- ...ye(c),
369
- ...f
401
+ alignItems: "center",
402
+ justifyContent: "center",
403
+ background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)",
404
+ border: "1px solid rgba(139,92,246,0.5)",
405
+ color: "#fff",
406
+ cursor: "pointer",
407
+ touchAction: "none",
408
+ boxShadow: "0 4px 18px rgba(99,102,241,0.4)",
409
+ animation: "mn-fab-appear 0.42s cubic-bezier(0.16,1,0.3,1) both, mn-fab-ring 2.8s ease-in-out 0.6s infinite"
370
410
  },
371
- children: [
372
- /* @__PURE__ */ n.jsxs("div", { style: {
373
- height: 56,
374
- display: "flex",
375
- alignItems: "center",
376
- justifyContent: t ? "center" : "space-between",
377
- padding: t ? "0" : "0 12px 0 16px",
378
- borderBottom: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
379
- flexShrink: 0,
380
- gap: 8
381
- }, children: [
382
- !t && /* @__PURE__ */ n.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0, overflow: "hidden" }, children: r ?? /* @__PURE__ */ n.jsx(we, {}) }),
383
- /* @__PURE__ */ n.jsx(Re, { collapsed: t, onCollapse: () => i == null ? void 0 : i(!t) })
384
- ] }),
385
- /* @__PURE__ */ n.jsx("nav", { style: { flex: 1, overflowY: "auto", overflowX: "hidden", padding: "8px 0" }, children: b.map((d) => /* @__PURE__ */ n.jsx(
386
- Ee,
387
- {
388
- section: d,
389
- collapsed: t,
390
- isActive: g,
391
- expandedIds: h,
392
- onToggle: y,
393
- onNavigate: s,
394
- LinkComponent: u
395
- },
396
- d.label ?? "__top__"
397
- )) }),
398
- o.length > 0 && /* @__PURE__ */ n.jsx("div", { style: {
399
- borderTop: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
400
- padding: "8px 0",
401
- flexShrink: 0
402
- }, children: o.map((d) => /* @__PURE__ */ n.jsx(
403
- q,
404
- {
405
- item: d,
406
- collapsed: t,
407
- active: g(d.path),
408
- onNavigate: s,
409
- LinkComponent: u
410
- },
411
- d.id
412
- )) })
413
- ]
411
+ children: /* @__PURE__ */ t.jsx(Me, { size: 18 })
414
412
  }
415
413
  );
416
414
  }
417
- function Ee({ section: r, collapsed: o, isActive: t, expandedIds: i, onToggle: a, onNavigate: s, LinkComponent: u }) {
418
- return /* @__PURE__ */ n.jsxs("div", { style: { marginBottom: 4 }, children: [
419
- r.label && !o && /* @__PURE__ */ n.jsx("p", { style: {
420
- padding: "8px 16px 4px",
421
- fontSize: 10,
422
- fontWeight: 600,
423
- letterSpacing: "0.08em",
415
+ function Oe({ label: e, isDark: n }) {
416
+ return /* @__PURE__ */ t.jsxs("div", { style: { padding: "20px 12px 4px", display: "flex", alignItems: "center", gap: 8 }, children: [
417
+ /* @__PURE__ */ t.jsx("span", { className: "mn-text-reveal", style: {
418
+ fontSize: 9,
419
+ fontWeight: 700,
424
420
  textTransform: "uppercase",
425
- color: "var(--mn-text-muted-dark, #64748B)",
426
- margin: 0,
427
- whiteSpace: "nowrap",
428
- overflow: "hidden"
429
- }, children: r.label }),
430
- r.label && o && /* @__PURE__ */ n.jsx("div", { style: { height: 8 } }),
431
- r.items.map((c) => /* @__PURE__ */ n.jsx(
432
- q,
433
- {
434
- item: c,
435
- collapsed: o,
436
- active: t(c.path),
437
- expanded: i.has(c.id),
438
- onToggle: () => {
439
- var f;
440
- return ((f = c.children) == null ? void 0 : f.length) && a(c.id);
441
- },
442
- onNavigate: s,
443
- LinkComponent: u,
444
- isActive: t
445
- },
446
- c.id
447
- ))
421
+ letterSpacing: "0.15em",
422
+ color: g.textMuted(n),
423
+ whiteSpace: "nowrap"
424
+ }, children: e }),
425
+ /* @__PURE__ */ t.jsx("div", { style: { flex: 1, height: 1, backgroundColor: g.border(n) } })
448
426
  ] });
449
427
  }
450
- function q({ item: r, collapsed: o, active: t, expanded: i, onToggle: a, onNavigate: s, LinkComponent: u, isActive: c }) {
451
- var k;
452
- const f = ((k = r.children) == null ? void 0 : k.length) > 0, b = !!r.disabled, h = {
428
+ function ne({ item: e, collapsed: n, active: o, expanded: s, onToggle: i, onNavigate: l, onLinkClick: f, LinkComponent: a, isActiveFn: h, isDark: d }) {
429
+ var E;
430
+ const [y, u] = B(!1), v = ((E = e.children) == null ? void 0 : E.length) > 0, p = !!e.disabled, C = {
453
431
  display: "flex",
454
432
  alignItems: "center",
455
- justifyContent: o ? "center" : "flex-start",
456
- gap: o ? 0 : 10,
457
- width: "100%",
458
- padding: o ? "0" : "0 12px",
459
- margin: "1px 6px",
460
- width: "calc(100% - 12px)",
461
- height: 36,
433
+ position: "relative",
434
+ justifyContent: n ? "center" : "flex-start",
435
+ gap: n ? 0 : 10,
436
+ padding: n ? 0 : "0 10px",
437
+ margin: n ? "1px auto" : "1px 6px",
438
+ width: n ? 40 : "calc(100% - 12px)",
439
+ height: n ? 40 : 36,
462
440
  borderRadius: "var(--mn-radius-lg, 0.75rem)",
463
441
  fontSize: "var(--mn-font-size-sm, 0.875rem)",
464
- fontWeight: 500,
465
- cursor: b ? "not-allowed" : "pointer",
466
- opacity: b ? 0.4 : 1,
442
+ fontWeight: o && !v ? 600 : 500,
443
+ cursor: p ? "not-allowed" : "pointer",
444
+ opacity: p ? 0.4 : 1,
467
445
  textDecoration: "none",
468
446
  border: "none",
469
447
  outline: "none",
@@ -471,445 +449,794 @@ function q({ item: r, collapsed: o, active: t, expanded: i, onToggle: a, onNavig
471
449
  whiteSpace: "nowrap",
472
450
  overflow: "hidden",
473
451
  fontFamily: "var(--mn-font-family, inherit)",
474
- ...t ? {
475
- backgroundColor: "rgba(255,255,255,0.08)",
476
- color: "var(--mn-text-primary-dark, #F0F4FF)"
477
- } : {
478
- backgroundColor: "transparent",
479
- color: "var(--mn-text-secondary-dark, #94A3B8)"
480
- }
481
- }, v = /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
482
- /* @__PURE__ */ n.jsx(Se, { icon: r.icon, active: t }),
483
- !o && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
484
- /* @__PURE__ */ n.jsx("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: r.label }),
485
- r.badge && /* @__PURE__ */ n.jsx("span", { style: {
452
+ backgroundColor: o && !v ? g.activeItemBg(d) : y && !p ? g.hoverItemBg(d) : "transparent",
453
+ color: o && !v ? g.textPri(d) : g.textSec(d)
454
+ }, I = o && !v ? "var(--mn-color-primary, #3B82F6)" : g.textMuted(d), M = e.icon ? typeof e.icon == "string" ? /* @__PURE__ */ t.jsx("span", { style: { fontSize: 14, width: 16, textAlign: "center", flexShrink: 0 }, children: e.icon }) : typeof e.icon == "function" ? e.icon({ style: { width: 16, height: 16, color: I, flexShrink: 0 } }) : /* @__PURE__ */ t.jsx("span", { style: { width: 16, height: 16, color: I, flexShrink: 0, display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }) : /* @__PURE__ */ t.jsx("span", { style: { width: 16, flexShrink: 0 } }), j = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
455
+ o && !v && /* @__PURE__ */ t.jsx("span", { style: {
456
+ position: "absolute",
457
+ left: 0,
458
+ top: "50%",
459
+ transform: "translateY(-50%)",
460
+ width: 3,
461
+ height: n ? 24 : 20,
462
+ borderRadius: "0 4px 4px 0",
463
+ backgroundColor: "var(--mn-color-primary, #3B82F6)"
464
+ } }),
465
+ M,
466
+ !n && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
467
+ /* @__PURE__ */ t.jsx("span", { className: "mn-text-reveal", style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: e.label }),
468
+ e.badge && /* @__PURE__ */ t.jsx("span", { className: "mn-text-reveal", style: {
486
469
  fontSize: 10,
487
470
  fontWeight: 600,
488
471
  padding: "1px 6px",
489
472
  borderRadius: "var(--mn-radius-full, 9999px)",
490
- backgroundColor: "rgba(99,102,241,0.2)",
473
+ backgroundColor: "rgba(99,102,241,0.15)",
491
474
  color: "var(--mn-color-accent, #8B5CF6)",
492
- flexShrink: 0
493
- }, children: r.badge }),
494
- f && /* @__PURE__ */ n.jsx("span", { style: {
495
- fontSize: 10,
496
- color: "var(--mn-text-muted-dark, #64748B)",
497
475
  flexShrink: 0,
498
- transform: i ? "rotate(180deg)" : "none",
476
+ marginLeft: "auto"
477
+ }, children: e.badge }),
478
+ o && !v && /* @__PURE__ */ t.jsx("span", { style: {
479
+ width: 6,
480
+ height: 6,
481
+ borderRadius: "50%",
482
+ flexShrink: 0,
483
+ backgroundColor: "var(--mn-color-primary, #3B82F6)"
484
+ } }),
485
+ v && /* @__PURE__ */ t.jsx(xe, { size: 14, style: {
486
+ flexShrink: 0,
487
+ color: g.textMuted(d),
488
+ transform: s ? "rotate(180deg)" : "none",
499
489
  transition: "transform 200ms"
500
- }, children: "▾" })
490
+ } })
501
491
  ] })
502
- ] }), y = (d) => {
503
- if (b) {
504
- d.preventDefault();
492
+ ] }), T = (b) => {
493
+ if (p) {
494
+ b.preventDefault();
505
495
  return;
506
496
  }
507
- if (f) {
508
- d.preventDefault(), a == null || a();
497
+ if (v) {
498
+ b.preventDefault(), i == null || i();
509
499
  return;
510
500
  }
511
- r.external || s && (d.preventDefault(), s(r.path));
512
- }, g = {
513
- href: r.path,
514
- onClick: y,
515
- style: h,
516
- ...r.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
517
- title: o ? r.label : void 0
501
+ f == null || f(), !e.external && l && (b.preventDefault(), l(e.path));
502
+ }, x = {
503
+ onMouseEnter: () => u(!0),
504
+ onMouseLeave: () => u(!1)
518
505
  };
519
- return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
520
- f ? /* @__PURE__ */ n.jsx("button", { style: { ...h, background: t ? "rgba(255,255,255,0.08)" : "transparent", width: "calc(100% - 12px)", margin: "1px 6px" }, onClick: y, children: v }) : /* @__PURE__ */ n.jsx(u, { ...g, children: v }),
521
- f && i && !o && /* @__PURE__ */ n.jsx("div", { style: { paddingLeft: 16, marginBottom: 4 }, children: r.children.map((d) => /* @__PURE__ */ n.jsx(
522
- q,
523
- {
524
- item: { id: d.id ?? d.path, ...d },
525
- collapsed: !1,
526
- active: c ? c(d.path) : !1,
527
- onNavigate: s,
528
- LinkComponent: u
529
- },
530
- d.id ?? d.path
531
- )) })
532
- ] });
533
- }
534
- function Se({ icon: r, active: o }) {
535
- const t = {
536
- width: 16,
537
- height: 16,
538
- flexShrink: 0,
539
- color: o ? "var(--mn-color-primary, #3B82F6)" : "inherit"
540
- };
541
- return r ? typeof r == "string" ? /* @__PURE__ */ n.jsx("span", { style: { fontSize: 14, width: 16, textAlign: "center" }, children: r }) : typeof r == "function" ? r({ style: t }) : /* @__PURE__ */ n.jsx("span", { style: t, children: r }) : /* @__PURE__ */ n.jsx("span", { style: { width: 16 } });
542
- }
543
- function Re({ collapsed: r, onCollapse: o }) {
544
- return /* @__PURE__ */ n.jsx(
545
- "button",
506
+ return v ? n ? /* @__PURE__ */ t.jsx(a, { href: e.path, style: C, title: e.label, ...x, children: j }) : /* @__PURE__ */ t.jsxs(
507
+ "div",
546
508
  {
547
- onClick: o,
548
- "aria-label": r ? "Expand sidebar" : "Collapse sidebar",
549
- style: {
550
- width: 28,
551
- height: 28,
552
- borderRadius: "var(--mn-radius-md, 0.5rem)",
553
- background: "rgba(255,255,255,0.04)",
554
- border: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
555
- cursor: "pointer",
556
- display: "flex",
557
- alignItems: "center",
558
- justifyContent: "center",
559
- color: "var(--mn-text-muted-dark, #64748B)",
560
- fontSize: 12,
561
- flexShrink: 0,
562
- transition: "background-color 150ms"
563
- },
564
- children: r ? "›" : "‹"
565
- }
566
- );
567
- }
568
- function we() {
569
- return /* @__PURE__ */ n.jsx("div", { style: {
570
- width: 24,
571
- height: 24,
572
- borderRadius: 6,
573
- background: "var(--mn-color-primary, #3B82F6)",
574
- display: "flex",
575
- alignItems: "center",
576
- justifyContent: "center",
577
- fontSize: 11,
578
- fontWeight: 800,
579
- color: "#fff"
580
- }, children: "M" });
581
- }
582
- function Te(r) {
583
- if (!r) return {};
584
- const o = {};
585
- return Object.entries(r).forEach(([t, i]) => {
586
- const a = te[t];
587
- a && (o[a] = i);
588
- }), o;
589
- }
590
- function Ce({
591
- org: r,
592
- project: o,
593
- onOrgClick: t,
594
- onProjectClick: i,
595
- onNewProject: a,
596
- user: s,
597
- onThemeToggle: u,
598
- isDark: c = !0,
599
- leftSlot: f,
600
- centerSlot: b,
601
- rightSlot: h,
602
- onLogout: v,
603
- tokens: y,
604
- style: g
605
- }) {
606
- return /* @__PURE__ */ n.jsxs(
607
- "header",
608
- {
609
- style: {
610
- height: 52,
611
- display: "flex",
612
- alignItems: "center",
613
- gap: 12,
614
- padding: "0 16px",
615
- backgroundColor: "var(--mn-color-nav-dark, #07091C)",
616
- borderBottom: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
617
- backdropFilter: "blur(12px)",
618
- WebkitBackdropFilter: "blur(12px)",
619
- position: "sticky",
620
- top: 0,
621
- zIndex: 30,
622
- fontFamily: "var(--mn-font-family, inherit)",
623
- ...Te(y),
624
- ...g
625
- },
509
+ style: { ...C, cursor: "default", backgroundColor: y ? g.hoverItemBg(d) : "transparent" },
510
+ ...x,
626
511
  children: [
627
- /* @__PURE__ */ n.jsx("div", { style: { flex: 1, display: "flex", alignItems: "center", gap: 6, minWidth: 0 }, children: f ?? /* @__PURE__ */ n.jsx(
628
- Ae,
512
+ /* @__PURE__ */ t.jsxs(
513
+ a,
629
514
  {
630
- org: r,
631
- project: o,
632
- onOrgClick: t,
633
- onProjectClick: i,
634
- onNewProject: a
515
+ href: e.path,
516
+ onClick: (b) => {
517
+ f == null || f(), l && (b.preventDefault(), l(e.path));
518
+ },
519
+ style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0, textDecoration: "none", color: "inherit" },
520
+ children: [
521
+ M,
522
+ /* @__PURE__ */ t.jsx("span", { className: "mn-text-reveal", style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", fontSize: "var(--mn-font-size-sm, 0.875rem)", fontWeight: 500 }, children: e.label })
523
+ ]
635
524
  }
636
- ) }),
637
- b && /* @__PURE__ */ n.jsx("div", { style: { flexShrink: 0 }, children: b }),
638
- /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexShrink: 0 }, children: [
639
- u && /* @__PURE__ */ n.jsx(Fe, { onClick: u, title: c ? "Light mode" : "Dark mode", children: c ? "☀" : "☾" }),
640
- h,
641
- s && /* @__PURE__ */ n.jsx(Pe, { user: s, onLogout: v })
642
- ] })
525
+ ),
526
+ /* @__PURE__ */ t.jsx(
527
+ "button",
528
+ {
529
+ onClick: (b) => {
530
+ b.stopPropagation(), i == null || i();
531
+ },
532
+ style: { background: "none", border: "none", cursor: "pointer", padding: "0 8px 0 0", display: "flex", color: g.textMuted(d) },
533
+ children: /* @__PURE__ */ t.jsx(xe, { size: 14, style: { transform: s ? "rotate(180deg)" : "none", transition: "transform 200ms" } })
534
+ }
535
+ )
643
536
  ]
644
537
  }
538
+ ) : p ? /* @__PURE__ */ t.jsx("div", { style: C, "aria-disabled": "true", title: n ? e.label : void 0, ...x, children: j }) : /* @__PURE__ */ t.jsx(
539
+ a,
540
+ {
541
+ href: e.path,
542
+ onClick: T,
543
+ title: n ? e.label : void 0,
544
+ style: C,
545
+ ...e.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
546
+ ...x,
547
+ children: j
548
+ }
645
549
  );
646
550
  }
647
- function Ae({ org: r, project: o, onOrgClick: t, onProjectClick: i, onNewProject: a }) {
648
- return !r && !o ? null : /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4, minWidth: 0 }, children: [
649
- r && /* @__PURE__ */ n.jsxs(
551
+ function he({ collapsed: e, isDark: n, sections: o, bottomItems: s, activePath: i, onNavigate: l, onLinkClick: f, LinkComponent: a, logo: h, user: d, onCollapseClick: y, collapseLabel: u, showExpandBtn: v, onExpandClick: p }) {
552
+ var T;
553
+ const [C, I] = B(/* @__PURE__ */ new Set()), M = N((x) => {
554
+ I((E) => {
555
+ const b = new Set(E);
556
+ return b.has(x) ? b.delete(x) : b.add(x), b;
557
+ });
558
+ }, []);
559
+ function j(x) {
560
+ return x ? x === "/" ? i === "/" : i === x || i.startsWith(x + "/") : !1;
561
+ }
562
+ return /* @__PURE__ */ t.jsxs("div", { style: { position: "relative", display: "flex", flexDirection: "column", height: "100%", width: "100%", overflow: "hidden" }, children: [
563
+ !e && /* @__PURE__ */ t.jsx("div", { "aria-hidden": "true", style: {
564
+ position: "absolute",
565
+ top: 0,
566
+ right: 0,
567
+ width: 1,
568
+ height: "100%",
569
+ zIndex: 1,
570
+ pointerEvents: "none",
571
+ background: "linear-gradient(to bottom, transparent 0%, rgba(99,102,241,0) 15%, rgba(99,102,241,0.7) 50%, rgba(99,102,241,0) 85%, transparent 100%)",
572
+ animation: "mn-scan 0.55s cubic-bezier(0.16,1,0.3,1) both"
573
+ } }),
574
+ /* @__PURE__ */ t.jsxs("div", { style: {
575
+ height: 60,
576
+ display: "flex",
577
+ alignItems: "center",
578
+ flexShrink: 0,
579
+ justifyContent: e ? "center" : "space-between",
580
+ padding: e ? "0 14px" : "0 8px 0 16px",
581
+ borderBottom: `1px solid ${g.border(n)}`,
582
+ backgroundColor: n ? "transparent" : "rgba(255,255,255,0.95)"
583
+ }, children: [
584
+ /* @__PURE__ */ t.jsx(a, { href: "/", onClick: f, style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0, textDecoration: "none", overflow: "hidden" }, children: h ?? /* @__PURE__ */ t.jsx(Fe, {}) }),
585
+ !e && y && /* @__PURE__ */ t.jsx(
586
+ "button",
587
+ {
588
+ onClick: y,
589
+ title: u,
590
+ style: { flexShrink: 0, width: 28, height: 28, borderRadius: 8, background: "none", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", color: g.textMuted(n) },
591
+ children: /* @__PURE__ */ t.jsx(Ae, { size: 16 })
592
+ }
593
+ )
594
+ ] }),
595
+ e && v && /* @__PURE__ */ t.jsx("div", { style: { display: "flex", justifyContent: "center", padding: "8px 0", borderBottom: `1px solid ${g.border(n)}`, flexShrink: 0 }, children: /* @__PURE__ */ t.jsx(
650
596
  "button",
651
597
  {
652
- onClick: t,
653
- style: Y,
654
- children: [
655
- /* @__PURE__ */ n.jsx(Oe, {}),
656
- /* @__PURE__ */ n.jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: r.name })
657
- ]
598
+ onClick: p,
599
+ title: "Expand sidebar",
600
+ style: { width: 32, height: 32, borderRadius: 8, background: "none", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", color: g.textMuted(n) },
601
+ children: /* @__PURE__ */ t.jsx(ye, { size: 16 })
602
+ }
603
+ ) }),
604
+ /* @__PURE__ */ t.jsx("nav", { style: { flex: 1, overflowY: "auto", overflowX: "hidden", padding: "12px 0", scrollbarWidth: "thin" }, children: o.map((x) => /* @__PURE__ */ t.jsxs("div", { style: { marginBottom: 4 }, children: [
605
+ x.label && !e && /* @__PURE__ */ t.jsx(Oe, { label: x.label, isDark: n }),
606
+ x.label && e && /* @__PURE__ */ t.jsx("div", { style: { height: 8 } }),
607
+ /* @__PURE__ */ t.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: x.items.map((E) => {
608
+ var b;
609
+ return /* @__PURE__ */ t.jsxs("div", { children: [
610
+ /* @__PURE__ */ t.jsx(
611
+ ne,
612
+ {
613
+ item: E,
614
+ collapsed: e,
615
+ active: j(E.path),
616
+ expanded: C.has(E.id),
617
+ onToggle: () => {
618
+ var k;
619
+ return ((k = E.children) == null ? void 0 : k.length) && M(E.id);
620
+ },
621
+ onNavigate: l,
622
+ onLinkClick: f,
623
+ LinkComponent: a,
624
+ isActiveFn: j,
625
+ isDark: n
626
+ }
627
+ ),
628
+ !e && C.has(E.id) && ((b = E.children) == null ? void 0 : b.length) > 0 && /* @__PURE__ */ t.jsx("div", { style: { marginLeft: 12, paddingLeft: 12, borderLeft: `1px solid ${g.border(n)}`, marginBottom: 4 }, children: E.children.map((k) => /* @__PURE__ */ t.jsx(
629
+ ne,
630
+ {
631
+ item: { id: k.id ?? k.path, ...k },
632
+ collapsed: !1,
633
+ active: j(k.path),
634
+ onNavigate: l,
635
+ onLinkClick: f,
636
+ LinkComponent: a,
637
+ isDark: n
638
+ },
639
+ k.id ?? k.path
640
+ )) })
641
+ ] }, E.id);
642
+ }) })
643
+ ] }, x.label ?? "__top__")) }),
644
+ s.length > 0 && /* @__PURE__ */ t.jsxs("div", { style: { flexShrink: 0, borderTop: `1px solid ${g.border(n)}`, padding: "8px 0", backgroundColor: g.bottomBg(n) }, children: [
645
+ /* @__PURE__ */ t.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: s.map((x) => /* @__PURE__ */ t.jsx(
646
+ ne,
647
+ {
648
+ item: x,
649
+ collapsed: e,
650
+ active: i === x.path || i.startsWith(x.path + "/"),
651
+ onNavigate: l,
652
+ onLinkClick: f,
653
+ LinkComponent: a,
654
+ isDark: n
655
+ },
656
+ x.id
657
+ )) }),
658
+ d && !e && /* @__PURE__ */ t.jsxs("div", { style: { margin: "8px 8px 0", padding: "10px 12px", borderRadius: "var(--mn-radius-lg, 0.75rem)", backgroundColor: g.userCard(n), border: `1px solid ${g.border(n)}`, display: "flex", alignItems: "center", gap: 10 }, children: [
659
+ /* @__PURE__ */ t.jsx("div", { style: { width: 28, height: 28, borderRadius: 8, background: "linear-gradient(135deg, #3B82F6, #7C3AED)", display: "flex", alignItems: "center", justifyContent: "center", color: "#fff", fontSize: 11, fontWeight: 700, flexShrink: 0 }, children: (d.name || d.email || "U")[0].toUpperCase() }),
660
+ /* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0, flex: 1 }, children: [
661
+ /* @__PURE__ */ t.jsx("p", { className: "mn-text-reveal", style: { margin: 0, fontSize: 12, fontWeight: 600, color: g.textPri(n), overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.2 }, children: d.name || ((T = d.email) == null ? void 0 : T.split("@")[0]) }),
662
+ d.email && /* @__PURE__ */ t.jsx("p", { className: "mn-text-reveal", style: { margin: 0, fontSize: 10, color: g.textMuted(n), overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.2 }, children: d.email })
663
+ ] })
664
+ ] }),
665
+ d && e && /* @__PURE__ */ t.jsx("div", { style: { marginTop: 8, display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ t.jsx("div", { title: d.name || d.email, style: { width: 32, height: 32, borderRadius: 8, background: "linear-gradient(135deg, #3B82F6, #7C3AED)", display: "flex", alignItems: "center", justifyContent: "center", color: "#fff", fontSize: 11, fontWeight: 700 }, children: (d.name || d.email || "U")[0].toUpperCase() }) })
666
+ ] })
667
+ ] });
668
+ }
669
+ function Fe() {
670
+ return /* @__PURE__ */ t.jsx("div", { style: { width: 28, height: 28, borderRadius: 8, background: "linear-gradient(135deg, #3B82F6, #7C3AED)", display: "flex", alignItems: "center", justifyContent: "center", fontSize: 12, fontWeight: 800, color: "#fff", flexShrink: 0 }, children: "M" });
671
+ }
672
+ function Pe({
673
+ logo: e,
674
+ bottomItems: n = [],
675
+ collapsed: o = !1,
676
+ onCollapse: s,
677
+ activePath: i = "/",
678
+ onNavigate: l,
679
+ LinkComponent: f = "a",
680
+ isDark: a = !0,
681
+ user: h,
682
+ style: d
683
+ }) {
684
+ const y = Te(), [u, v] = B(
685
+ () => typeof window < "u" ? window.innerWidth < ue : !1
686
+ );
687
+ Y(() => {
688
+ const m = window.matchMedia(`(max-width: ${ue - 1}px)`), A = (q) => v(q.matches);
689
+ return m.addEventListener("change", A), () => m.removeEventListener("change", A);
690
+ }, []);
691
+ const [p, C] = B("hidden"), [I, M] = B("normal");
692
+ function j(m, A = "normal") {
693
+ M(A), C(m);
694
+ }
695
+ const T = p === "hidden", x = p === "collapsed", E = p === "expanded", b = p === "fading", k = O(null), W = O(null), L = O(null), F = O(null);
696
+ ae(() => {
697
+ const m = fe(I, "width, transform");
698
+ k.current && (k.current.style.transition = m), W.current && (W.current.style.transition = m);
699
+ }, [I]);
700
+ const X = O(o);
701
+ Y(() => {
702
+ const m = X.current;
703
+ X.current = o;
704
+ const A = L.current;
705
+ if (A) {
706
+ if (!o) {
707
+ A.style.animation = "";
708
+ return;
709
+ }
710
+ m === !1 && (A.style.animation = "mn-content-dip 570ms ease-in-out both");
711
+ }
712
+ }, [o]);
713
+ const P = O(null), $ = O(p), z = N(() => {
714
+ const m = F.current;
715
+ m && (m.style.transition = "none", m.style.opacity = "1", m.offsetHeight, m.style.transition = `opacity ${D}ms ease-in`, m.style.opacity = "0", clearTimeout(P.current), P.current = setTimeout(() => j("hidden", "fast"), D));
716
+ }, []), U = N(() => {
717
+ clearTimeout(P.current);
718
+ const m = F.current;
719
+ m && (m.style.transition = "opacity 300ms ease-out", m.style.opacity = "1");
720
+ }, []);
721
+ Y(() => {
722
+ const m = $.current;
723
+ if ($.current = p, p === "collapsed") {
724
+ const q = setTimeout(z, m === "expanded" ? 50 : 0);
725
+ return () => {
726
+ clearTimeout(q), clearTimeout(P.current);
727
+ };
728
+ }
729
+ return U(), () => clearTimeout(P.current);
730
+ }, [p, z, U]), ae(() => {
731
+ if (!b) return;
732
+ const m = W.current;
733
+ if (!m) return;
734
+ m.style.animation = `mn-mobile-fade-out ${D}ms ease-in both`;
735
+ const A = setTimeout(() => j("hidden", "fast"), D);
736
+ return () => {
737
+ clearTimeout(A), m.style.animation = "", m.style.transition = fe("fast", "width, transform");
738
+ };
739
+ }, [b]);
740
+ const H = {
741
+ isDark: a,
742
+ sections: y,
743
+ bottomItems: n,
744
+ activePath: i,
745
+ onNavigate: l,
746
+ LinkComponent: f,
747
+ logo: e,
748
+ user: h
749
+ };
750
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
751
+ u && T && /* @__PURE__ */ t.jsx(
752
+ Be,
753
+ {
754
+ onCollapse: () => j("collapsed", "fast"),
755
+ onExpand: () => j("expanded", "fast")
658
756
  }
659
757
  ),
660
- r && o && /* @__PURE__ */ n.jsx("span", { style: { color: "var(--mn-text-muted-dark, #64748B)", fontSize: 14 }, children: "/" }),
661
- o ? /* @__PURE__ */ n.jsxs("button", { onClick: i, style: Y, children: [
662
- /* @__PURE__ */ n.jsx("span", { style: { fontSize: 12 }, children: "📁" }),
663
- /* @__PURE__ */ n.jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: o.name })
664
- ] }) : a && /* @__PURE__ */ n.jsx(
758
+ u && !T && !b && /* @__PURE__ */ t.jsx(
665
759
  "button",
666
760
  {
667
- onClick: a,
668
- style: { ...Y, color: "var(--mn-color-primary, #3B82F6)", opacity: 0.7 },
669
- children: "+ New Project"
761
+ onClick: () => {
762
+ j(x ? "expanded" : "hidden", "fast");
763
+ },
764
+ title: x ? "Expand sidebar" : "Hide sidebar",
765
+ style: {
766
+ position: "fixed",
767
+ top: 14,
768
+ left: 16,
769
+ zIndex: 50,
770
+ width: 36,
771
+ height: 36,
772
+ borderRadius: 10,
773
+ display: "flex",
774
+ alignItems: "center",
775
+ justifyContent: "center",
776
+ backgroundColor: a ? "#060919" : "#fff",
777
+ border: `1px solid ${g.border(a)}`,
778
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
779
+ cursor: "pointer",
780
+ color: g.textSec(a)
781
+ },
782
+ children: x ? /* @__PURE__ */ t.jsx(ye, { size: 18 }) : /* @__PURE__ */ t.jsx(Ie, { size: 16 })
783
+ }
784
+ ),
785
+ u && (E || b) && /* @__PURE__ */ t.jsx(
786
+ "div",
787
+ {
788
+ onClick: b ? void 0 : () => j("collapsed", "fast"),
789
+ style: {
790
+ position: "fixed",
791
+ inset: 0,
792
+ zIndex: 40,
793
+ backgroundColor: "rgba(0,0,0,0.6)",
794
+ backdropFilter: "blur(4px)",
795
+ animation: b ? `mn-backdrop-out ${D}ms ease-in forwards` : "mn-backdrop-in 0.22s ease both",
796
+ pointerEvents: b ? "none" : void 0
797
+ }
670
798
  }
671
- )
799
+ ),
800
+ u && /* @__PURE__ */ t.jsx(
801
+ "aside",
802
+ {
803
+ ref: W,
804
+ onTouchStart: () => {
805
+ x && z(), b && j("expanded", "fast");
806
+ },
807
+ onClick: () => {
808
+ b && j("expanded", "fast");
809
+ },
810
+ style: {
811
+ position: "fixed",
812
+ top: 0,
813
+ left: 0,
814
+ zIndex: 40,
815
+ height: "100vh",
816
+ overflow: "hidden",
817
+ backgroundColor: g.navBg(a),
818
+ borderRight: `1px solid ${g.border(a)}`,
819
+ boxShadow: "0 0 40px rgba(0,0,0,0.3)",
820
+ width: T || x ? 60 : 288,
821
+ transform: T ? "translateX(-100%)" : "translateX(0)"
822
+ },
823
+ children: /* @__PURE__ */ t.jsx("div", { ref: F, style: { display: "flex", flexDirection: "column", height: "100%", width: "100%" }, children: /* @__PURE__ */ t.jsx(
824
+ he,
825
+ {
826
+ ...H,
827
+ collapsed: x || T,
828
+ onLinkClick: () => j("collapsed", "fast"),
829
+ onCollapseClick: () => j("collapsed", "fast"),
830
+ collapseLabel: "Minimize sidebar"
831
+ }
832
+ ) })
833
+ }
834
+ ),
835
+ !u && /* @__PURE__ */ t.jsx(
836
+ "aside",
837
+ {
838
+ ref: k,
839
+ style: {
840
+ position: "fixed",
841
+ top: 0,
842
+ left: 0,
843
+ zIndex: 30,
844
+ height: "100vh",
845
+ overflow: "hidden",
846
+ display: "flex",
847
+ flexDirection: "column",
848
+ backgroundColor: g.navBg(a),
849
+ borderRight: `1px solid ${g.border(a)}`,
850
+ backdropFilter: "blur(20px)",
851
+ boxShadow: a ? "1px 0 0 0 rgba(255,255,255,0.04)" : "1px 0 0 0 rgba(0,0,0,0.04)",
852
+ width: o ? 60 : 220,
853
+ fontFamily: "var(--mn-font-family, inherit)",
854
+ ...d
855
+ },
856
+ children: /* @__PURE__ */ t.jsx("div", { ref: L, style: { display: "flex", flexDirection: "column", height: "100%", width: "100%" }, children: /* @__PURE__ */ t.jsx(
857
+ he,
858
+ {
859
+ ...H,
860
+ collapsed: o,
861
+ onCollapseClick: () => s == null ? void 0 : s(!o),
862
+ collapseLabel: "Collapse sidebar",
863
+ showExpandBtn: o,
864
+ onExpandClick: () => s == null ? void 0 : s(!1)
865
+ }
866
+ ) })
867
+ }
868
+ ),
869
+ /* @__PURE__ */ t.jsx("style", { children: `
870
+ .mn-text-reveal {
871
+ animation: mn-text-in 0.28s cubic-bezier(0.16,1,0.3,1) both;
872
+ }
873
+ @keyframes mn-text-in {
874
+ 0% { opacity: 0; filter: blur(5px); transform: translateX(-10px); }
875
+ 55% { filter: blur(1px); }
876
+ 100% { opacity: 1; filter: blur(0); transform: translateX(0); }
877
+ }
878
+ @keyframes mn-scan {
879
+ 0% { transform: translateY(-100%); opacity: 0; }
880
+ 15% { opacity: 1; }
881
+ 85% { opacity: 1; }
882
+ 100% { transform: translateY(100%); opacity: 0; }
883
+ }
884
+ @keyframes mn-fab-appear {
885
+ 0% { opacity: 0; transform: scale(0.5); filter: blur(4px); }
886
+ 60% { filter: blur(0); }
887
+ 100% { opacity: 1; transform: scale(1); filter: blur(0); }
888
+ }
889
+ @keyframes mn-fab-ring {
890
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.5), 0 4px 18px rgba(99,102,241,0.4); }
891
+ 55% { box-shadow: 0 0 0 10px rgba(99,102,241,0), 0 4px 18px rgba(99,102,241,0.4); }
892
+ }
893
+ @keyframes mn-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
894
+ @keyframes mn-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
895
+ @keyframes mn-content-dip {
896
+ 0% { opacity: 1; }
897
+ 55% { opacity: 0; }
898
+ 100% { opacity: 1; }
899
+ }
900
+ @keyframes mn-mobile-fade-out {
901
+ from { opacity: 1; transform: translateX(0); }
902
+ to { opacity: 0; transform: translateX(-100%); }
903
+ }
904
+ ` })
672
905
  ] });
673
906
  }
674
- const Y = {
675
- display: "inline-flex",
676
- alignItems: "center",
677
- gap: 6,
678
- padding: "4px 8px",
679
- borderRadius: "var(--mn-radius-md, 0.5rem)",
680
- background: "none",
681
- border: "none",
682
- color: "var(--mn-text-secondary-dark, #94A3B8)",
683
- fontSize: "var(--mn-font-size-sm, 0.875rem)",
684
- fontWeight: 500,
685
- cursor: "pointer",
686
- maxWidth: 160,
687
- fontFamily: "inherit",
688
- transition: "background-color 150ms"
907
+ function G(e, n, o, s, i) {
908
+ return e ? `var(${n}, ${o})` : `var(${s}, ${i})`;
909
+ }
910
+ const R = {
911
+ navBg: (e) => G(e, "--mn-color-nav-dark", "#07091C", "--mn-color-nav-light", "#E1DAD0"),
912
+ border: (e) => G(e, "--mn-border-dark", "rgba(255,255,255,0.07)", "--mn-border-light", "#C9C2B6"),
913
+ cardBg: (e) => G(e, "--mn-color-card-dark", "#0B0F23", "--mn-color-card-light", "#EDE8DE"),
914
+ textPri: (e) => G(e, "--mn-text-primary-dark", "#F0F4FF", "--mn-text-primary-light", "#1C1915"),
915
+ textSec: (e) => G(e, "--mn-text-secondary-dark", "#94A3B8", "--mn-text-secondary-light", "#47413C"),
916
+ textMuted: (e) => G(e, "--mn-text-muted-dark", "#64748B", "--mn-text-muted-light", "#7A7470"),
917
+ iconBg: (e) => e ? "rgba(255,255,255,0.04)" : "rgba(0,0,0,0.04)",
918
+ menuHover: (e) => e ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.04)"
689
919
  };
690
- function Oe() {
691
- return /* @__PURE__ */ n.jsx("span", { style: { width: 8, height: 8, borderRadius: "50%", backgroundColor: "var(--mn-color-accent, #8B5CF6)", flexShrink: 0, display: "inline-block" } });
920
+ function $e({
921
+ org: e,
922
+ project: n,
923
+ onOrgClick: o,
924
+ onProjectClick: s,
925
+ onNewProject: i,
926
+ user: l,
927
+ onLogout: f,
928
+ isDark: a = !0,
929
+ onThemeToggle: h,
930
+ leftSlot: d,
931
+ centerSlot: y,
932
+ rightSlot: u,
933
+ style: v
934
+ }) {
935
+ return /* @__PURE__ */ t.jsxs("header", { style: {
936
+ height: 52,
937
+ display: "flex",
938
+ alignItems: "center",
939
+ gap: 12,
940
+ padding: "0 16px",
941
+ backgroundColor: R.navBg(a),
942
+ borderBottom: `1px solid ${R.border(a)}`,
943
+ backdropFilter: "blur(12px)",
944
+ WebkitBackdropFilter: "blur(12px)",
945
+ position: "sticky",
946
+ top: 0,
947
+ zIndex: 30,
948
+ fontFamily: "var(--mn-font-family, inherit)",
949
+ transition: "background-color 300ms, border-color 300ms",
950
+ ...v
951
+ }, children: [
952
+ /* @__PURE__ */ t.jsx("div", { style: { flex: 1, display: "flex", alignItems: "center", gap: 6, minWidth: 0 }, children: d ?? /* @__PURE__ */ t.jsx(
953
+ ze,
954
+ {
955
+ org: e,
956
+ project: n,
957
+ onOrgClick: o,
958
+ onProjectClick: s,
959
+ onNewProject: i,
960
+ isDark: a
961
+ }
962
+ ) }),
963
+ y && /* @__PURE__ */ t.jsx("div", { style: { flexShrink: 0 }, children: y }),
964
+ /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexShrink: 0 }, children: [
965
+ h && /* @__PURE__ */ t.jsx(Ye, { onClick: h, title: a ? "Light mode" : "Dark mode", isDark: a, children: /* @__PURE__ */ t.jsx("span", { style: { fontSize: 15 }, children: a ? "☀" : "☾" }) }),
966
+ u,
967
+ l && /* @__PURE__ */ t.jsx(We, { user: l, onLogout: f, isDark: a })
968
+ ] })
969
+ ] });
692
970
  }
693
- function Pe({ user: r, onLogout: o }) {
694
- var s;
695
- const [t, i] = A(!1), a = pe(null);
696
- return ne(() => {
697
- if (!t) return;
698
- function u(c) {
699
- a.current && !a.current.contains(c.target) && i(!1);
971
+ function ze({ org: e, project: n, onOrgClick: o, onProjectClick: s, onNewProject: i, isDark: l }) {
972
+ if (!e && !n) return null;
973
+ const f = {
974
+ display: "inline-flex",
975
+ alignItems: "center",
976
+ gap: 6,
977
+ padding: "4px 8px",
978
+ borderRadius: "var(--mn-radius-md, 0.5rem)",
979
+ background: "none",
980
+ border: "none",
981
+ color: R.textSec(l),
982
+ fontSize: "var(--mn-font-size-sm, 0.875rem)",
983
+ fontWeight: 500,
984
+ cursor: "pointer",
985
+ maxWidth: 160,
986
+ fontFamily: "inherit",
987
+ transition: "background-color 150ms",
988
+ whiteSpace: "nowrap",
989
+ overflow: "hidden",
990
+ textOverflow: "ellipsis"
991
+ };
992
+ return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4, minWidth: 0 }, children: [
993
+ e && /* @__PURE__ */ t.jsxs("button", { onClick: o, style: f, children: [
994
+ /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, borderRadius: "50%", backgroundColor: "var(--mn-color-accent, #8B5CF6)", flexShrink: 0, display: "inline-block" } }),
995
+ /* @__PURE__ */ t.jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: e.name })
996
+ ] }),
997
+ e && n && /* @__PURE__ */ t.jsx("span", { style: { color: R.textMuted(l), fontSize: 14 }, children: "/" }),
998
+ n ? /* @__PURE__ */ t.jsxs("button", { onClick: s, style: f, children: [
999
+ /* @__PURE__ */ t.jsx("span", { style: { fontSize: 12 }, children: "📁" }),
1000
+ /* @__PURE__ */ t.jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: n.name })
1001
+ ] }) : i && /* @__PURE__ */ t.jsx("button", { onClick: i, style: { ...f, color: "var(--mn-color-primary, #3B82F6)", opacity: 0.7 }, children: "+ New Project" })
1002
+ ] });
1003
+ }
1004
+ function We({ user: e, onLogout: n, isDark: o }) {
1005
+ var f;
1006
+ const [s, i] = B(!1), l = O(null);
1007
+ return Y(() => {
1008
+ if (!s) return;
1009
+ function a(h) {
1010
+ l.current && !l.current.contains(h.target) && i(!1);
700
1011
  }
701
- return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
702
- }, [t]), /* @__PURE__ */ n.jsxs("div", { ref: a, style: { position: "relative" }, children: [
703
- /* @__PURE__ */ n.jsxs(
1012
+ return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
1013
+ }, [s]), /* @__PURE__ */ t.jsxs("div", { ref: l, style: { position: "relative" }, children: [
1014
+ /* @__PURE__ */ t.jsxs(
704
1015
  "button",
705
1016
  {
706
- onClick: () => i((u) => !u),
1017
+ onClick: () => i((a) => !a),
707
1018
  style: {
708
1019
  display: "flex",
709
1020
  alignItems: "center",
710
1021
  gap: 6,
711
- padding: "4px 6px",
1022
+ padding: "4px 8px",
712
1023
  borderRadius: "var(--mn-radius-md, 0.5rem)",
713
- background: "none",
1024
+ background: s ? R.iconBg(o) : "none",
714
1025
  border: "none",
715
1026
  cursor: "pointer",
716
- color: "var(--mn-text-secondary-dark, #94A3B8)",
717
- fontFamily: "inherit"
1027
+ color: R.textSec(o),
1028
+ fontFamily: "inherit",
1029
+ transition: "background-color 150ms"
718
1030
  },
719
1031
  children: [
720
- /* @__PURE__ */ n.jsx(Ie, { user: r, size: 26 }),
721
- /* @__PURE__ */ n.jsx("span", { style: { fontSize: "var(--mn-font-size-sm, 0.875rem)", fontWeight: 500 }, children: ((s = r.name) == null ? void 0 : s.split(" ")[0]) ?? "Account" }),
722
- /* @__PURE__ */ n.jsx("span", { style: { fontSize: 10 }, children: "▾" })
1032
+ /* @__PURE__ */ t.jsx(Ne, { user: e, size: 26 }),
1033
+ /* @__PURE__ */ t.jsx("span", { style: { fontSize: "var(--mn-font-size-sm, 0.875rem)", fontWeight: 500 }, children: ((f = e.name) == null ? void 0 : f.split(" ")[0]) ?? "Account" }),
1034
+ /* @__PURE__ */ t.jsx("span", { style: { fontSize: 10, color: R.textMuted(o) }, children: "▾" })
723
1035
  ]
724
1036
  }
725
1037
  ),
726
- t && /* @__PURE__ */ n.jsxs("div", { style: {
1038
+ s && /* @__PURE__ */ t.jsxs("div", { style: {
727
1039
  position: "absolute",
728
- top: "100%",
1040
+ top: "calc(100% + 6px)",
729
1041
  right: 0,
730
- marginTop: 6,
731
- width: 200,
1042
+ width: 210,
732
1043
  borderRadius: "var(--mn-radius-lg, 0.75rem)",
733
- backgroundColor: "var(--mn-color-card-dark, #0B0F23)",
734
- border: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
1044
+ backgroundColor: R.cardBg(o),
1045
+ border: `1px solid ${R.border(o)}`,
735
1046
  boxShadow: "var(--mn-shadow-lg, 0 4px 30px rgba(0,0,0,0.4))",
736
1047
  zIndex: 100,
737
1048
  overflow: "hidden"
738
1049
  }, children: [
739
- /* @__PURE__ */ n.jsxs("div", { style: { padding: "12px 14px", borderBottom: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))" }, children: [
740
- /* @__PURE__ */ n.jsx("p", { style: { margin: 0, fontSize: "0.8125rem", fontWeight: 600, color: "var(--mn-text-primary-dark, #F0F4FF)" }, children: r.name }),
741
- r.email && /* @__PURE__ */ n.jsx("p", { style: { margin: "2px 0 0", fontSize: 11, color: "var(--mn-text-muted-dark, #64748B)" }, children: r.email })
1050
+ /* @__PURE__ */ t.jsxs("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${R.border(o)}` }, children: [
1051
+ /* @__PURE__ */ t.jsx("p", { style: { margin: 0, fontSize: "0.8125rem", fontWeight: 600, color: R.textPri(o) }, children: e.name }),
1052
+ e.email && /* @__PURE__ */ t.jsx("p", { style: { margin: "2px 0 0", fontSize: 11, color: R.textMuted(o) }, children: e.email })
742
1053
  ] }),
743
- /* @__PURE__ */ n.jsxs("div", { style: { padding: "6px 0" }, children: [
744
- /* @__PURE__ */ n.jsx($, { onClick: () => i(!1), children: "Profile settings" }),
745
- /* @__PURE__ */ n.jsx($, { onClick: () => i(!1), children: "API Keys" }),
746
- o && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
747
- /* @__PURE__ */ n.jsx("div", { style: { height: 1, backgroundColor: "var(--mn-border-dark, rgba(255,255,255,0.05))", margin: "6px 0" } }),
748
- /* @__PURE__ */ n.jsx($, { onClick: () => {
749
- i(!1), o();
750
- }, danger: !0, children: "Log out" })
1054
+ /* @__PURE__ */ t.jsxs("div", { style: { padding: "6px 0" }, children: [
1055
+ /* @__PURE__ */ t.jsx(oe, { onClick: () => i(!1), isDark: o, children: "Profile settings" }),
1056
+ /* @__PURE__ */ t.jsx(oe, { onClick: () => i(!1), isDark: o, children: "API Keys" }),
1057
+ n && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1058
+ /* @__PURE__ */ t.jsx("div", { style: { height: 1, backgroundColor: R.border(o), margin: "6px 0" } }),
1059
+ /* @__PURE__ */ t.jsx(oe, { onClick: () => {
1060
+ i(!1), n();
1061
+ }, isDark: o, danger: !0, children: "Log out" })
751
1062
  ] })
752
1063
  ] })
753
1064
  ] })
754
1065
  ] });
755
1066
  }
756
- function $({ children: r, onClick: o, danger: t }) {
757
- return /* @__PURE__ */ n.jsx(
1067
+ function oe({ children: e, onClick: n, isDark: o, danger: s }) {
1068
+ const [i, l] = B(!1);
1069
+ return /* @__PURE__ */ t.jsx(
758
1070
  "button",
759
1071
  {
760
- onClick: o,
1072
+ onClick: n,
1073
+ onMouseEnter: () => l(!0),
1074
+ onMouseLeave: () => l(!1),
761
1075
  style: {
762
1076
  display: "block",
763
1077
  width: "100%",
764
1078
  textAlign: "left",
765
1079
  padding: "8px 14px",
766
- background: "none",
1080
+ background: i ? R.menuHover(o) : "none",
767
1081
  border: "none",
768
1082
  fontSize: "var(--mn-font-size-sm, 0.875rem)",
769
- color: t ? "var(--mn-color-danger, #EF4444)" : "var(--mn-text-secondary-dark, #94A3B8)",
1083
+ color: s ? "var(--mn-color-danger, #EF4444)" : R.textSec(o),
770
1084
  cursor: "pointer",
771
1085
  fontFamily: "inherit",
772
1086
  transition: "background-color 100ms"
773
1087
  },
774
- children: r
1088
+ children: e
775
1089
  }
776
1090
  );
777
1091
  }
778
- function Ie({ user: r, size: o = 28 }) {
779
- const t = (r.name ?? "?").split(" ").slice(0, 2).map((i) => i[0]).join("").toUpperCase();
780
- return /* @__PURE__ */ n.jsx("div", { style: {
781
- width: o,
782
- height: o,
1092
+ function Ne({ user: e, size: n = 28 }) {
1093
+ const o = (e.name ?? e.email ?? "?").split(" ").slice(0, 2).map((s) => s[0]).join("").toUpperCase();
1094
+ return /* @__PURE__ */ t.jsx("div", { style: {
1095
+ width: n,
1096
+ height: n,
783
1097
  borderRadius: "50%",
784
- backgroundColor: "var(--mn-color-accent, #8B5CF6)",
1098
+ background: e.avatar ? `url(${e.avatar}) center/cover` : "linear-gradient(135deg, #6366f1, #8b5cf6)",
785
1099
  display: "flex",
786
1100
  alignItems: "center",
787
1101
  justifyContent: "center",
788
- fontSize: o * 0.38,
1102
+ fontSize: n * 0.38,
789
1103
  fontWeight: 700,
790
1104
  color: "#fff",
791
1105
  flexShrink: 0,
792
- backgroundImage: r.avatar ? `url(${r.avatar})` : "none",
793
- backgroundSize: "cover",
794
1106
  overflow: "hidden"
795
- }, children: !r.avatar && t });
1107
+ }, children: !e.avatar && o });
796
1108
  }
797
- function Fe({ children: r, onClick: o, title: t }) {
798
- return /* @__PURE__ */ n.jsx(
1109
+ function Ye({ children: e, onClick: n, title: o, isDark: s }) {
1110
+ const [i, l] = B(!1);
1111
+ return /* @__PURE__ */ t.jsx(
799
1112
  "button",
800
1113
  {
801
- onClick: o,
802
- title: t,
1114
+ onClick: n,
1115
+ title: o,
1116
+ onMouseEnter: () => l(!0),
1117
+ onMouseLeave: () => l(!1),
803
1118
  style: {
804
1119
  width: 32,
805
1120
  height: 32,
806
1121
  borderRadius: "var(--mn-radius-md, 0.5rem)",
807
- background: "rgba(255,255,255,0.04)",
808
- border: "1px solid var(--mn-border-dark, rgba(255,255,255,0.07))",
1122
+ background: i ? R.iconBg(s) : "transparent",
1123
+ border: `1px solid ${R.border(s)}`,
809
1124
  cursor: "pointer",
810
1125
  display: "flex",
811
1126
  alignItems: "center",
812
1127
  justifyContent: "center",
813
- color: "var(--mn-text-secondary-dark, #94A3B8)",
814
- fontSize: 14,
1128
+ color: R.textSec(s),
815
1129
  transition: "background-color 150ms"
816
1130
  },
817
- children: r
1131
+ children: e
818
1132
  }
819
1133
  );
820
1134
  }
821
- const De = 220, Be = 60;
822
- function Le({
1135
+ const Le = 220, Xe = 60, pe = 1024;
1136
+ function Ve({
823
1137
  // Nav
824
- modules: r = [],
825
- bottomModules: o = ze,
826
- activePath: t = "/",
827
- onNavigate: i,
828
- LinkComponent: a = "a",
829
- logo: s,
1138
+ modules: e = [],
1139
+ bottomModules: n = Ue,
1140
+ activePath: o = "/",
1141
+ onNavigate: s,
1142
+ LinkComponent: i = "a",
1143
+ logo: l,
830
1144
  // TopNav
831
- org: u,
832
- project: c,
833
- onOrgClick: f,
834
- onProjectClick: b,
835
- onNewProject: h,
836
- user: v,
837
- onLogout: y,
838
- isDark: g = !0,
839
- onThemeToggle: k,
840
- topNavLeft: d,
841
- topNavCenter: _,
1145
+ org: f,
1146
+ project: a,
1147
+ onOrgClick: h,
1148
+ onProjectClick: d,
1149
+ onNewProject: y,
1150
+ user: u,
1151
+ onLogout: v,
1152
+ isDark: p = !0,
1153
+ onThemeToggle: C,
1154
+ topNavLeft: I,
1155
+ topNavCenter: M,
842
1156
  topNavRight: j,
843
1157
  // Tokens
844
- tokens: O,
845
- tokenPersist: P = !0,
846
- tokenStorageKey: I = "mn_design_tokens",
1158
+ tokens: T,
1159
+ tokenPersist: x = !0,
1160
+ tokenStorageKey: E = "mn_design_tokens",
847
1161
  // Content
848
- children: F
1162
+ children: b
849
1163
  }) {
850
- const [w, D] = A(!1), B = w ? Be : De;
851
- return /* @__PURE__ */ n.jsx(
852
- me,
1164
+ const [k, W] = B(!1), [L, F] = B(
1165
+ () => typeof window < "u" ? window.innerWidth < pe : !1
1166
+ );
1167
+ Y(() => {
1168
+ const $ = window.matchMedia(`(max-width: ${pe - 1}px)`), z = (U) => F(U.matches);
1169
+ return $.addEventListener("change", z), () => $.removeEventListener("change", z);
1170
+ }, []);
1171
+ const X = L ? 0 : k ? Xe : Le, P = p ? "var(--mn-color-bg-dark, #060919)" : "var(--mn-color-bg-light, #E5DED2)";
1172
+ return /* @__PURE__ */ t.jsx(Se, { initialTokens: T, persist: x, storageKey: E, children: /* @__PURE__ */ t.jsx(Ce, { initialModules: e, children: /* @__PURE__ */ t.jsxs(
1173
+ "div",
853
1174
  {
854
- initialTokens: O,
855
- persist: P,
856
- storageKey: I,
857
- children: /* @__PURE__ */ n.jsx(ge, { initialModules: r, children: /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", minHeight: "100vh", backgroundColor: "var(--mn-color-bg-dark, #060919)" }, children: [
858
- /* @__PURE__ */ n.jsx(
859
- _e,
1175
+ "data-mn-theme": p ? "dark" : "light",
1176
+ style: {
1177
+ display: "flex",
1178
+ minHeight: "100vh",
1179
+ backgroundColor: P,
1180
+ fontFamily: "var(--mn-font-family, system-ui, sans-serif)"
1181
+ },
1182
+ children: [
1183
+ /* @__PURE__ */ t.jsx(
1184
+ Pe,
860
1185
  {
861
- logo: s,
862
- bottomItems: o,
863
- collapsed: w,
864
- onCollapse: D,
865
- activePath: t,
866
- onNavigate: i,
867
- LinkComponent: a
1186
+ logo: l,
1187
+ bottomItems: n,
1188
+ collapsed: k,
1189
+ onCollapse: W,
1190
+ activePath: o,
1191
+ onNavigate: s,
1192
+ LinkComponent: i,
1193
+ isDark: p,
1194
+ user: u
868
1195
  }
869
1196
  ),
870
- /* @__PURE__ */ n.jsxs("div", { style: {
1197
+ /* @__PURE__ */ t.jsxs("div", { style: {
871
1198
  flex: 1,
872
- marginLeft: B,
1199
+ marginLeft: X,
873
1200
  transition: "margin-left 340ms cubic-bezier(0.16,1,0.3,1)",
874
1201
  display: "flex",
875
1202
  flexDirection: "column",
876
1203
  minWidth: 0
877
1204
  }, children: [
878
- /* @__PURE__ */ n.jsx(
879
- Ce,
1205
+ /* @__PURE__ */ t.jsx(
1206
+ $e,
880
1207
  {
881
- org: u,
882
- project: c,
883
- onOrgClick: f,
884
- onProjectClick: b,
885
- onNewProject: h,
886
- user: v,
887
- onLogout: y,
888
- isDark: g,
889
- onThemeToggle: k,
890
- leftSlot: d,
891
- centerSlot: _,
1208
+ org: f,
1209
+ project: a,
1210
+ onOrgClick: h,
1211
+ onProjectClick: d,
1212
+ onNewProject: y,
1213
+ user: u,
1214
+ onLogout: v,
1215
+ isDark: p,
1216
+ onThemeToggle: C,
1217
+ leftSlot: I,
1218
+ centerSlot: M,
892
1219
  rightSlot: j
893
1220
  }
894
1221
  ),
895
- /* @__PURE__ */ n.jsx("main", { style: { flex: 1, minHeight: 0 }, children: F })
1222
+ /* @__PURE__ */ t.jsx("main", { style: { flex: 1, minHeight: 0 }, children: b })
896
1223
  ] })
897
- ] }) })
1224
+ ]
898
1225
  }
899
- );
1226
+ ) }) });
900
1227
  }
901
- const ze = [
1228
+ const Ue = [
902
1229
  { id: "settings", label: "Settings", icon: "⚙", path: "/settings", order: 1 },
903
1230
  { id: "help", label: "Help", icon: "?", path: "/help", order: 2 }
904
1231
  ];
905
1232
  export {
906
- Le as AppShell,
907
- ze as DEFAULT_BOTTOM_MODULES,
908
- ge as ModuleRegistryProvider,
909
- _e as Sidebar,
910
- Ce as TopNav,
911
- ae as useModuleRegistry,
912
- ve as useNavTree,
913
- Me as useRegisterModule
1233
+ Ve as AppShell,
1234
+ Ue as DEFAULT_BOTTOM_MODULES,
1235
+ Ce as ModuleRegistryProvider,
1236
+ Pe as Sidebar,
1237
+ $e as TopNav,
1238
+ ge as useModuleRegistry,
1239
+ Te as useNavTree,
1240
+ Je as useRegisterModule
914
1241
  };
915
1242
  //# sourceMappingURL=mounajisaastemplate.es.js.map