@shellui/core 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/dist/CookiePreferencesView.52b5aec8.js +1182 -0
- package/src/dist/CookiePreferencesView.52b5aec8.js.map +1 -0
- package/src/dist/DefaultLayout.045a82ff.js +1964 -0
- package/src/dist/DefaultLayout.045a82ff.js.map +1 -0
- package/src/dist/DefaultLayout.4454f259.js +4414 -0
- package/src/dist/DefaultLayout.4454f259.js.map +1 -0
- package/src/dist/FullscreenLayout.555c4987.js +1054 -0
- package/src/dist/FullscreenLayout.555c4987.js.map +1 -0
- package/src/dist/HomeView.ddfa7b68.js +771 -0
- package/src/dist/HomeView.ddfa7b68.js.map +1 -0
- package/src/dist/NotFoundView.c75be4f1.js +811 -0
- package/src/dist/NotFoundView.c75be4f1.js.map +1 -0
- package/src/dist/SettingsView.052b03a6.js +4965 -0
- package/src/dist/SettingsView.052b03a6.js.map +1 -0
- package/src/dist/ViewRoute.e6e3b142.js +1042 -0
- package/src/dist/ViewRoute.e6e3b142.js.map +1 -0
- package/src/dist/WindowsLayout.08724167.js +1762 -0
- package/src/dist/WindowsLayout.08724167.js.map +1 -0
- package/src/dist/esm.f0d741e6.js +29520 -0
- package/src/dist/esm.f0d741e6.js.map +1 -0
- package/src/dist/favicon.4367ac1e.svg +14 -0
- package/src/dist/index.parcel.36d65383.js +54089 -0
- package/src/dist/index.parcel.36d65383.js.map +1 -0
- package/src/dist/index.parcel.ca6d8a47.css +3493 -0
- package/src/dist/index.parcel.ca6d8a47.css.map +1 -0
- package/src/dist/index.parcel.html +88 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,1964 @@
|
|
|
1
|
+
// modules are defined as an array
|
|
2
|
+
// [ module function, map of requires ]
|
|
3
|
+
//
|
|
4
|
+
// map of requires is short require name -> numeric require
|
|
5
|
+
//
|
|
6
|
+
// anything defined in a previous bundle is accessed via the
|
|
7
|
+
// orig method which is the require for previous bundles
|
|
8
|
+
|
|
9
|
+
(function (
|
|
10
|
+
modules,
|
|
11
|
+
entry,
|
|
12
|
+
mainEntry,
|
|
13
|
+
parcelRequireName,
|
|
14
|
+
externals,
|
|
15
|
+
distDir,
|
|
16
|
+
publicUrl,
|
|
17
|
+
devServer
|
|
18
|
+
) {
|
|
19
|
+
/* eslint-disable no-undef */
|
|
20
|
+
var globalObject =
|
|
21
|
+
typeof globalThis !== 'undefined'
|
|
22
|
+
? globalThis
|
|
23
|
+
: typeof self !== 'undefined'
|
|
24
|
+
? self
|
|
25
|
+
: typeof window !== 'undefined'
|
|
26
|
+
? window
|
|
27
|
+
: typeof global !== 'undefined'
|
|
28
|
+
? global
|
|
29
|
+
: {};
|
|
30
|
+
/* eslint-enable no-undef */
|
|
31
|
+
|
|
32
|
+
// Save the require from previous bundle to this closure if any
|
|
33
|
+
var previousRequire =
|
|
34
|
+
typeof globalObject[parcelRequireName] === 'function' &&
|
|
35
|
+
globalObject[parcelRequireName];
|
|
36
|
+
|
|
37
|
+
var importMap = previousRequire.i || {};
|
|
38
|
+
var cache = previousRequire.cache || {};
|
|
39
|
+
// Do not use `require` to prevent Webpack from trying to bundle this call
|
|
40
|
+
var nodeRequire =
|
|
41
|
+
typeof module !== 'undefined' &&
|
|
42
|
+
typeof module.require === 'function' &&
|
|
43
|
+
module.require.bind(module);
|
|
44
|
+
|
|
45
|
+
function newRequire(name, jumped) {
|
|
46
|
+
if (!cache[name]) {
|
|
47
|
+
if (!modules[name]) {
|
|
48
|
+
if (externals[name]) {
|
|
49
|
+
return externals[name];
|
|
50
|
+
}
|
|
51
|
+
// if we cannot find the module within our internal map or
|
|
52
|
+
// cache jump to the current global require ie. the last bundle
|
|
53
|
+
// that was added to the page.
|
|
54
|
+
var currentRequire =
|
|
55
|
+
typeof globalObject[parcelRequireName] === 'function' &&
|
|
56
|
+
globalObject[parcelRequireName];
|
|
57
|
+
if (!jumped && currentRequire) {
|
|
58
|
+
return currentRequire(name, true);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// If there are other bundles on this page the require from the
|
|
62
|
+
// previous one is saved to 'previousRequire'. Repeat this as
|
|
63
|
+
// many times as there are bundles until the module is found or
|
|
64
|
+
// we exhaust the require chain.
|
|
65
|
+
if (previousRequire) {
|
|
66
|
+
return previousRequire(name, true);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Try the node require function if it exists.
|
|
70
|
+
if (nodeRequire && typeof name === 'string') {
|
|
71
|
+
return nodeRequire(name);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var err = new Error("Cannot find module '" + name + "'");
|
|
75
|
+
err.code = 'MODULE_NOT_FOUND';
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
localRequire.resolve = resolve;
|
|
80
|
+
localRequire.cache = {};
|
|
81
|
+
|
|
82
|
+
var module = (cache[name] = new newRequire.Module(name));
|
|
83
|
+
|
|
84
|
+
modules[name][0].call(
|
|
85
|
+
module.exports,
|
|
86
|
+
localRequire,
|
|
87
|
+
module,
|
|
88
|
+
module.exports,
|
|
89
|
+
globalObject
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return cache[name].exports;
|
|
94
|
+
|
|
95
|
+
function localRequire(x) {
|
|
96
|
+
var res = localRequire.resolve(x);
|
|
97
|
+
if (res === false) {
|
|
98
|
+
return {};
|
|
99
|
+
}
|
|
100
|
+
// Synthesize a module to follow re-exports.
|
|
101
|
+
if (Array.isArray(res)) {
|
|
102
|
+
var m = {__esModule: true};
|
|
103
|
+
res.forEach(function (v) {
|
|
104
|
+
var key = v[0];
|
|
105
|
+
var id = v[1];
|
|
106
|
+
var exp = v[2] || v[0];
|
|
107
|
+
var x = newRequire(id);
|
|
108
|
+
if (key === '*') {
|
|
109
|
+
Object.keys(x).forEach(function (key) {
|
|
110
|
+
if (
|
|
111
|
+
key === 'default' ||
|
|
112
|
+
key === '__esModule' ||
|
|
113
|
+
Object.prototype.hasOwnProperty.call(m, key)
|
|
114
|
+
) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
Object.defineProperty(m, key, {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return x[key];
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
} else if (exp === '*') {
|
|
126
|
+
Object.defineProperty(m, key, {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
value: x,
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
Object.defineProperty(m, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
if (exp === 'default') {
|
|
135
|
+
return x.__esModule ? x.default : x;
|
|
136
|
+
}
|
|
137
|
+
return x[exp];
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return m;
|
|
143
|
+
}
|
|
144
|
+
return newRequire(res);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function resolve(x) {
|
|
148
|
+
var id = modules[name][1][x];
|
|
149
|
+
return id != null ? id : x;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function Module(moduleName) {
|
|
154
|
+
this.id = moduleName;
|
|
155
|
+
this.bundle = newRequire;
|
|
156
|
+
this.require = nodeRequire;
|
|
157
|
+
this.exports = {};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
newRequire.isParcelRequire = true;
|
|
161
|
+
newRequire.Module = Module;
|
|
162
|
+
newRequire.modules = modules;
|
|
163
|
+
newRequire.cache = cache;
|
|
164
|
+
newRequire.parent = previousRequire;
|
|
165
|
+
newRequire.distDir = distDir;
|
|
166
|
+
newRequire.publicUrl = publicUrl;
|
|
167
|
+
newRequire.devServer = devServer;
|
|
168
|
+
newRequire.i = importMap;
|
|
169
|
+
newRequire.register = function (id, exports) {
|
|
170
|
+
modules[id] = [
|
|
171
|
+
function (require, module) {
|
|
172
|
+
module.exports = exports;
|
|
173
|
+
},
|
|
174
|
+
{},
|
|
175
|
+
];
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// Only insert newRequire.load when it is actually used.
|
|
179
|
+
// The code in this file is linted against ES5, so dynamic import is not allowed.
|
|
180
|
+
// INSERT_LOAD_HERE
|
|
181
|
+
|
|
182
|
+
Object.defineProperty(newRequire, 'root', {
|
|
183
|
+
get: function () {
|
|
184
|
+
return globalObject[parcelRequireName];
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
globalObject[parcelRequireName] = newRequire;
|
|
189
|
+
|
|
190
|
+
for (var i = 0; i < entry.length; i++) {
|
|
191
|
+
newRequire(entry[i]);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (mainEntry) {
|
|
195
|
+
// Expose entry point to Node, AMD or browser globals
|
|
196
|
+
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
|
|
197
|
+
var mainExports = newRequire(mainEntry);
|
|
198
|
+
|
|
199
|
+
// CommonJS
|
|
200
|
+
if (typeof exports === 'object' && typeof module !== 'undefined') {
|
|
201
|
+
module.exports = mainExports;
|
|
202
|
+
|
|
203
|
+
// RequireJS
|
|
204
|
+
} else if (typeof define === 'function' && define.amd) {
|
|
205
|
+
define(function () {
|
|
206
|
+
return mainExports;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
})({"gR7Jy":[function(require,module,exports,__globalThis) {
|
|
211
|
+
var global = arguments[3];
|
|
212
|
+
var HMR_HOST = "localhost";
|
|
213
|
+
var HMR_PORT = null;
|
|
214
|
+
var HMR_SERVER_PORT = 4000;
|
|
215
|
+
var HMR_SECURE = false;
|
|
216
|
+
var HMR_ENV_HASH = "439701173a9199ea";
|
|
217
|
+
var HMR_USE_SSE = false;
|
|
218
|
+
module.bundle.HMR_BUNDLE_ID = "63985a21045a82ff";
|
|
219
|
+
"use strict";
|
|
220
|
+
/* global HMR_HOST, HMR_PORT, HMR_SERVER_PORT, HMR_ENV_HASH, HMR_SECURE, HMR_USE_SSE, chrome, browser, __parcel__import__, __parcel__importScripts__, ServiceWorkerGlobalScope */ /*::
|
|
221
|
+
import type {
|
|
222
|
+
HMRAsset,
|
|
223
|
+
HMRMessage,
|
|
224
|
+
} from '@parcel/reporter-dev-server/src/HMRServer.js';
|
|
225
|
+
interface ParcelRequire {
|
|
226
|
+
(string): mixed;
|
|
227
|
+
cache: {|[string]: ParcelModule|};
|
|
228
|
+
hotData: {|[string]: mixed|};
|
|
229
|
+
Module: any;
|
|
230
|
+
parent: ?ParcelRequire;
|
|
231
|
+
isParcelRequire: true;
|
|
232
|
+
modules: {|[string]: [Function, {|[string]: string|}]|};
|
|
233
|
+
HMR_BUNDLE_ID: string;
|
|
234
|
+
root: ParcelRequire;
|
|
235
|
+
}
|
|
236
|
+
interface ParcelModule {
|
|
237
|
+
hot: {|
|
|
238
|
+
data: mixed,
|
|
239
|
+
accept(cb: (Function) => void): void,
|
|
240
|
+
dispose(cb: (mixed) => void): void,
|
|
241
|
+
// accept(deps: Array<string> | string, cb: (Function) => void): void,
|
|
242
|
+
// decline(): void,
|
|
243
|
+
_acceptCallbacks: Array<(Function) => void>,
|
|
244
|
+
_disposeCallbacks: Array<(mixed) => void>,
|
|
245
|
+
|};
|
|
246
|
+
}
|
|
247
|
+
interface ExtensionContext {
|
|
248
|
+
runtime: {|
|
|
249
|
+
reload(): void,
|
|
250
|
+
getURL(url: string): string;
|
|
251
|
+
getManifest(): {manifest_version: number, ...};
|
|
252
|
+
|};
|
|
253
|
+
}
|
|
254
|
+
declare var module: {bundle: ParcelRequire, ...};
|
|
255
|
+
declare var HMR_HOST: string;
|
|
256
|
+
declare var HMR_PORT: string;
|
|
257
|
+
declare var HMR_SERVER_PORT: string;
|
|
258
|
+
declare var HMR_ENV_HASH: string;
|
|
259
|
+
declare var HMR_SECURE: boolean;
|
|
260
|
+
declare var HMR_USE_SSE: boolean;
|
|
261
|
+
declare var chrome: ExtensionContext;
|
|
262
|
+
declare var browser: ExtensionContext;
|
|
263
|
+
declare var __parcel__import__: (string) => Promise<void>;
|
|
264
|
+
declare var __parcel__importScripts__: (string) => Promise<void>;
|
|
265
|
+
declare var globalThis: typeof self;
|
|
266
|
+
declare var ServiceWorkerGlobalScope: Object;
|
|
267
|
+
*/ var OVERLAY_ID = '__parcel__error__overlay__';
|
|
268
|
+
var OldModule = module.bundle.Module;
|
|
269
|
+
function Module(moduleName) {
|
|
270
|
+
OldModule.call(this, moduleName);
|
|
271
|
+
this.hot = {
|
|
272
|
+
data: module.bundle.hotData[moduleName],
|
|
273
|
+
_acceptCallbacks: [],
|
|
274
|
+
_disposeCallbacks: [],
|
|
275
|
+
accept: function(fn) {
|
|
276
|
+
this._acceptCallbacks.push(fn || function() {});
|
|
277
|
+
},
|
|
278
|
+
dispose: function(fn) {
|
|
279
|
+
this._disposeCallbacks.push(fn);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
module.bundle.hotData[moduleName] = undefined;
|
|
283
|
+
}
|
|
284
|
+
module.bundle.Module = Module;
|
|
285
|
+
module.bundle.hotData = {};
|
|
286
|
+
var checkedAssets /*: {|[string]: boolean|} */ , disposedAssets /*: {|[string]: boolean|} */ , assetsToDispose /*: Array<[ParcelRequire, string]> */ , assetsToAccept /*: Array<[ParcelRequire, string]> */ , bundleNotFound = false;
|
|
287
|
+
function getHostname() {
|
|
288
|
+
return HMR_HOST || (typeof location !== 'undefined' && location.protocol.indexOf('http') === 0 ? location.hostname : 'localhost');
|
|
289
|
+
}
|
|
290
|
+
function getPort() {
|
|
291
|
+
return HMR_PORT || (typeof location !== 'undefined' ? location.port : HMR_SERVER_PORT);
|
|
292
|
+
}
|
|
293
|
+
// eslint-disable-next-line no-redeclare
|
|
294
|
+
let WebSocket = globalThis.WebSocket;
|
|
295
|
+
if (!WebSocket && typeof module.bundle.root === 'function') try {
|
|
296
|
+
// eslint-disable-next-line no-global-assign
|
|
297
|
+
WebSocket = module.bundle.root('ws');
|
|
298
|
+
} catch {
|
|
299
|
+
// ignore.
|
|
300
|
+
}
|
|
301
|
+
var hostname = getHostname();
|
|
302
|
+
var port = getPort();
|
|
303
|
+
var protocol = HMR_SECURE || typeof location !== 'undefined' && location.protocol === 'https:' && ![
|
|
304
|
+
'localhost',
|
|
305
|
+
'127.0.0.1',
|
|
306
|
+
'0.0.0.0'
|
|
307
|
+
].includes(hostname) ? 'wss' : 'ws';
|
|
308
|
+
// eslint-disable-next-line no-redeclare
|
|
309
|
+
var parent = module.bundle.parent;
|
|
310
|
+
if (!parent || !parent.isParcelRequire) {
|
|
311
|
+
// Web extension context
|
|
312
|
+
var extCtx = typeof browser === 'undefined' ? typeof chrome === 'undefined' ? null : chrome : browser;
|
|
313
|
+
// Safari doesn't support sourceURL in error stacks.
|
|
314
|
+
// eval may also be disabled via CSP, so do a quick check.
|
|
315
|
+
var supportsSourceURL = false;
|
|
316
|
+
try {
|
|
317
|
+
(0, eval)('throw new Error("test"); //# sourceURL=test.js');
|
|
318
|
+
} catch (err) {
|
|
319
|
+
supportsSourceURL = err.stack.includes('test.js');
|
|
320
|
+
}
|
|
321
|
+
var ws;
|
|
322
|
+
if (HMR_USE_SSE) ws = new EventSource('/__parcel_hmr');
|
|
323
|
+
else try {
|
|
324
|
+
// If we're running in the dev server's node runner, listen for messages on the parent port.
|
|
325
|
+
let { workerData, parentPort } = module.bundle.root('node:worker_threads') /*: any*/ ;
|
|
326
|
+
if (workerData !== null && workerData !== void 0 && workerData.__parcel) {
|
|
327
|
+
parentPort.on('message', async (message)=>{
|
|
328
|
+
try {
|
|
329
|
+
await handleMessage(message);
|
|
330
|
+
parentPort.postMessage('updated');
|
|
331
|
+
} catch {
|
|
332
|
+
parentPort.postMessage('restart');
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
// After the bundle has finished running, notify the dev server that the HMR update is complete.
|
|
336
|
+
queueMicrotask(()=>parentPort.postMessage('ready'));
|
|
337
|
+
}
|
|
338
|
+
} catch {
|
|
339
|
+
if (typeof WebSocket !== 'undefined') try {
|
|
340
|
+
ws = new WebSocket(protocol + '://' + hostname + (port ? ':' + port : '') + '/');
|
|
341
|
+
} catch (err) {
|
|
342
|
+
// Ignore cloudflare workers error.
|
|
343
|
+
if (err.message && !err.message.includes('Disallowed operation called within global scope')) console.error(err.message);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (ws) {
|
|
347
|
+
// $FlowFixMe
|
|
348
|
+
ws.onmessage = async function(event /*: {data: string, ...} */ ) {
|
|
349
|
+
var data /*: HMRMessage */ = JSON.parse(event.data);
|
|
350
|
+
await handleMessage(data);
|
|
351
|
+
};
|
|
352
|
+
if (ws instanceof WebSocket) {
|
|
353
|
+
ws.onerror = function(e) {
|
|
354
|
+
if (e.message) console.error(e.message);
|
|
355
|
+
};
|
|
356
|
+
ws.onclose = function() {
|
|
357
|
+
console.warn("[parcel] \uD83D\uDEA8 Connection to the HMR server was lost");
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
async function handleMessage(data /*: HMRMessage */ ) {
|
|
363
|
+
checkedAssets = {} /*: {|[string]: boolean|} */ ;
|
|
364
|
+
disposedAssets = {} /*: {|[string]: boolean|} */ ;
|
|
365
|
+
assetsToAccept = [];
|
|
366
|
+
assetsToDispose = [];
|
|
367
|
+
bundleNotFound = false;
|
|
368
|
+
if (data.type === 'reload') fullReload();
|
|
369
|
+
else if (data.type === 'update') {
|
|
370
|
+
// Remove error overlay if there is one
|
|
371
|
+
if (typeof document !== 'undefined') removeErrorOverlay();
|
|
372
|
+
let assets = data.assets;
|
|
373
|
+
// Handle HMR Update
|
|
374
|
+
let handled = assets.every((asset)=>{
|
|
375
|
+
return asset.type === 'css' || asset.type === 'js' && hmrAcceptCheck(module.bundle.root, asset.id, asset.depsByBundle);
|
|
376
|
+
});
|
|
377
|
+
// Dispatch a custom event in case a bundle was not found. This might mean
|
|
378
|
+
// an asset on the server changed and we should reload the page. This event
|
|
379
|
+
// gives the client an opportunity to refresh without losing state
|
|
380
|
+
// (e.g. via React Server Components). If e.preventDefault() is not called,
|
|
381
|
+
// we will trigger a full page reload.
|
|
382
|
+
if (handled && bundleNotFound && assets.some((a)=>a.envHash !== HMR_ENV_HASH) && typeof window !== 'undefined' && typeof CustomEvent !== 'undefined') handled = !window.dispatchEvent(new CustomEvent('parcelhmrreload', {
|
|
383
|
+
cancelable: true
|
|
384
|
+
}));
|
|
385
|
+
if (handled) {
|
|
386
|
+
console.clear();
|
|
387
|
+
// Dispatch custom event so other runtimes (e.g React Refresh) are aware.
|
|
388
|
+
if (typeof window !== 'undefined' && typeof CustomEvent !== 'undefined') window.dispatchEvent(new CustomEvent('parcelhmraccept'));
|
|
389
|
+
await hmrApplyUpdates(assets);
|
|
390
|
+
hmrDisposeQueue();
|
|
391
|
+
// Run accept callbacks. This will also re-execute other disposed assets in topological order.
|
|
392
|
+
let processedAssets = {};
|
|
393
|
+
for(let i = 0; i < assetsToAccept.length; i++){
|
|
394
|
+
let id = assetsToAccept[i][1];
|
|
395
|
+
if (!processedAssets[id]) {
|
|
396
|
+
hmrAccept(assetsToAccept[i][0], id);
|
|
397
|
+
processedAssets[id] = true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
} else fullReload();
|
|
401
|
+
}
|
|
402
|
+
if (data.type === 'error') {
|
|
403
|
+
// Log parcel errors to console
|
|
404
|
+
for (let ansiDiagnostic of data.diagnostics.ansi){
|
|
405
|
+
let stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack;
|
|
406
|
+
console.error("\uD83D\uDEA8 [parcel]: " + ansiDiagnostic.message + '\n' + stack + '\n\n' + ansiDiagnostic.hints.join('\n'));
|
|
407
|
+
}
|
|
408
|
+
if (typeof document !== 'undefined') {
|
|
409
|
+
// Render the fancy html overlay
|
|
410
|
+
removeErrorOverlay();
|
|
411
|
+
var overlay = createErrorOverlay(data.diagnostics.html);
|
|
412
|
+
// $FlowFixMe
|
|
413
|
+
document.body.appendChild(overlay);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function removeErrorOverlay() {
|
|
418
|
+
var overlay = document.getElementById(OVERLAY_ID);
|
|
419
|
+
if (overlay) {
|
|
420
|
+
overlay.remove();
|
|
421
|
+
console.log("[parcel] \u2728 Error resolved");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
function createErrorOverlay(diagnostics) {
|
|
425
|
+
var overlay = document.createElement('div');
|
|
426
|
+
overlay.id = OVERLAY_ID;
|
|
427
|
+
let errorHTML = '<div style="background: black; opacity: 0.85; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; font-family: Menlo, Consolas, monospace; z-index: 9999;">';
|
|
428
|
+
for (let diagnostic of diagnostics){
|
|
429
|
+
let stack = diagnostic.frames.length ? diagnostic.frames.reduce((p, frame)=>{
|
|
430
|
+
return `${p}
|
|
431
|
+
<a href="${protocol === 'wss' ? 'https' : 'http'}://${hostname}:${port}/__parcel_launch_editor?file=${encodeURIComponent(frame.location)}" style="text-decoration: underline; color: #888" onclick="fetch(this.href); return false">${frame.location}</a>
|
|
432
|
+
${frame.code}`;
|
|
433
|
+
}, '') : diagnostic.stack;
|
|
434
|
+
errorHTML += `
|
|
435
|
+
<div>
|
|
436
|
+
<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">
|
|
437
|
+
\u{1F6A8} ${diagnostic.message}
|
|
438
|
+
</div>
|
|
439
|
+
<pre>${stack}</pre>
|
|
440
|
+
<div>
|
|
441
|
+
${diagnostic.hints.map((hint)=>"<div>\uD83D\uDCA1 " + hint + '</div>').join('')}
|
|
442
|
+
</div>
|
|
443
|
+
${diagnostic.documentation ? `<div>\u{1F4DD} <a style="color: violet" href="${diagnostic.documentation}" target="_blank">Learn more</a></div>` : ''}
|
|
444
|
+
</div>
|
|
445
|
+
`;
|
|
446
|
+
}
|
|
447
|
+
errorHTML += '</div>';
|
|
448
|
+
overlay.innerHTML = errorHTML;
|
|
449
|
+
return overlay;
|
|
450
|
+
}
|
|
451
|
+
function fullReload() {
|
|
452
|
+
if (typeof location !== 'undefined' && 'reload' in location) location.reload();
|
|
453
|
+
else if (typeof extCtx !== 'undefined' && extCtx && extCtx.runtime && extCtx.runtime.reload) extCtx.runtime.reload();
|
|
454
|
+
else try {
|
|
455
|
+
let { workerData, parentPort } = module.bundle.root('node:worker_threads') /*: any*/ ;
|
|
456
|
+
if (workerData !== null && workerData !== void 0 && workerData.__parcel) parentPort.postMessage('restart');
|
|
457
|
+
} catch (err) {
|
|
458
|
+
console.error("[parcel] \u26A0\uFE0F An HMR update was not accepted. Please restart the process.");
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function getParents(bundle, id) /*: Array<[ParcelRequire, string]> */ {
|
|
462
|
+
var modules = bundle.modules;
|
|
463
|
+
if (!modules) return [];
|
|
464
|
+
var parents = [];
|
|
465
|
+
var k, d, dep;
|
|
466
|
+
for(k in modules)for(d in modules[k][1]){
|
|
467
|
+
dep = modules[k][1][d];
|
|
468
|
+
if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) parents.push([
|
|
469
|
+
bundle,
|
|
470
|
+
k
|
|
471
|
+
]);
|
|
472
|
+
}
|
|
473
|
+
if (bundle.parent) parents = parents.concat(getParents(bundle.parent, id));
|
|
474
|
+
return parents;
|
|
475
|
+
}
|
|
476
|
+
function updateLink(link) {
|
|
477
|
+
var href = link.getAttribute('href');
|
|
478
|
+
if (!href) return;
|
|
479
|
+
var newLink = link.cloneNode();
|
|
480
|
+
newLink.onload = function() {
|
|
481
|
+
if (link.parentNode !== null) // $FlowFixMe
|
|
482
|
+
link.parentNode.removeChild(link);
|
|
483
|
+
};
|
|
484
|
+
newLink.setAttribute('href', // $FlowFixMe
|
|
485
|
+
href.split('?')[0] + '?' + Date.now());
|
|
486
|
+
// $FlowFixMe
|
|
487
|
+
link.parentNode.insertBefore(newLink, link.nextSibling);
|
|
488
|
+
}
|
|
489
|
+
var cssTimeout = null;
|
|
490
|
+
function reloadCSS() {
|
|
491
|
+
if (cssTimeout || typeof document === 'undefined') return;
|
|
492
|
+
cssTimeout = setTimeout(function() {
|
|
493
|
+
var links = document.querySelectorAll('link[rel="stylesheet"]');
|
|
494
|
+
for(var i = 0; i < links.length; i++){
|
|
495
|
+
// $FlowFixMe[incompatible-type]
|
|
496
|
+
var href /*: string */ = links[i].getAttribute('href');
|
|
497
|
+
var hostname = getHostname();
|
|
498
|
+
var servedFromHMRServer = hostname === 'localhost' ? new RegExp('^(https?:\\/\\/(0.0.0.0|127.0.0.1)|localhost):' + getPort()).test(href) : href.indexOf(hostname + ':' + getPort());
|
|
499
|
+
var absolute = /^https?:\/\//i.test(href) && href.indexOf(location.origin) !== 0 && !servedFromHMRServer;
|
|
500
|
+
if (!absolute) updateLink(links[i]);
|
|
501
|
+
}
|
|
502
|
+
cssTimeout = null;
|
|
503
|
+
}, 50);
|
|
504
|
+
}
|
|
505
|
+
function hmrDownload(asset) {
|
|
506
|
+
if (asset.type === 'js') {
|
|
507
|
+
if (typeof document !== 'undefined') {
|
|
508
|
+
let script = document.createElement('script');
|
|
509
|
+
script.src = asset.url + '?t=' + Date.now();
|
|
510
|
+
if (asset.outputFormat === 'esmodule') script.type = 'module';
|
|
511
|
+
return new Promise((resolve, reject)=>{
|
|
512
|
+
var _document$head;
|
|
513
|
+
script.onload = ()=>resolve(script);
|
|
514
|
+
script.onerror = reject;
|
|
515
|
+
(_document$head = document.head) === null || _document$head === void 0 || _document$head.appendChild(script);
|
|
516
|
+
});
|
|
517
|
+
} else if (typeof importScripts === 'function') {
|
|
518
|
+
// Worker scripts
|
|
519
|
+
if (asset.outputFormat === 'esmodule') return import(asset.url + '?t=' + Date.now());
|
|
520
|
+
else return new Promise((resolve, reject)=>{
|
|
521
|
+
try {
|
|
522
|
+
importScripts(asset.url + '?t=' + Date.now());
|
|
523
|
+
resolve();
|
|
524
|
+
} catch (err) {
|
|
525
|
+
reject(err);
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
async function hmrApplyUpdates(assets) {
|
|
532
|
+
global.parcelHotUpdate = Object.create(null);
|
|
533
|
+
let scriptsToRemove;
|
|
534
|
+
try {
|
|
535
|
+
// If sourceURL comments aren't supported in eval, we need to load
|
|
536
|
+
// the update from the dev server over HTTP so that stack traces
|
|
537
|
+
// are correct in errors/logs. This is much slower than eval, so
|
|
538
|
+
// we only do it if needed (currently just Safari).
|
|
539
|
+
// https://bugs.webkit.org/show_bug.cgi?id=137297
|
|
540
|
+
// This path is also taken if a CSP disallows eval.
|
|
541
|
+
if (!supportsSourceURL) {
|
|
542
|
+
let promises = assets.map((asset)=>{
|
|
543
|
+
var _hmrDownload;
|
|
544
|
+
return (_hmrDownload = hmrDownload(asset)) === null || _hmrDownload === void 0 ? void 0 : _hmrDownload.catch((err)=>{
|
|
545
|
+
// Web extension fix
|
|
546
|
+
if (extCtx && extCtx.runtime && extCtx.runtime.getManifest().manifest_version == 3 && typeof ServiceWorkerGlobalScope != 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
547
|
+
extCtx.runtime.reload();
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
throw err;
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
scriptsToRemove = await Promise.all(promises);
|
|
554
|
+
}
|
|
555
|
+
assets.forEach(function(asset) {
|
|
556
|
+
hmrApply(module.bundle.root, asset);
|
|
557
|
+
});
|
|
558
|
+
} finally{
|
|
559
|
+
delete global.parcelHotUpdate;
|
|
560
|
+
if (scriptsToRemove) scriptsToRemove.forEach((script)=>{
|
|
561
|
+
if (script) {
|
|
562
|
+
var _document$head2;
|
|
563
|
+
(_document$head2 = document.head) === null || _document$head2 === void 0 || _document$head2.removeChild(script);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
function hmrApply(bundle /*: ParcelRequire */ , asset /*: HMRAsset */ ) {
|
|
569
|
+
var modules = bundle.modules;
|
|
570
|
+
if (!modules) return;
|
|
571
|
+
if (asset.type === 'css') reloadCSS();
|
|
572
|
+
else if (asset.type === 'js') {
|
|
573
|
+
let deps = asset.depsByBundle[bundle.HMR_BUNDLE_ID];
|
|
574
|
+
if (deps) {
|
|
575
|
+
if (modules[asset.id]) {
|
|
576
|
+
// Remove dependencies that are removed and will become orphaned.
|
|
577
|
+
// This is necessary so that if the asset is added back again, the cache is gone, and we prevent a full page reload.
|
|
578
|
+
let oldDeps = modules[asset.id][1];
|
|
579
|
+
for(let dep in oldDeps)if (!deps[dep] || deps[dep] !== oldDeps[dep]) {
|
|
580
|
+
let id = oldDeps[dep];
|
|
581
|
+
let parents = getParents(module.bundle.root, id);
|
|
582
|
+
if (parents.length === 1) hmrDelete(module.bundle.root, id);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
if (supportsSourceURL) // Global eval. We would use `new Function` here but browser
|
|
586
|
+
// support for source maps is better with eval.
|
|
587
|
+
(0, eval)(asset.output);
|
|
588
|
+
// $FlowFixMe
|
|
589
|
+
let fn = global.parcelHotUpdate[asset.id];
|
|
590
|
+
modules[asset.id] = [
|
|
591
|
+
fn,
|
|
592
|
+
deps
|
|
593
|
+
];
|
|
594
|
+
}
|
|
595
|
+
// Always traverse to the parent bundle, even if we already replaced the asset in this bundle.
|
|
596
|
+
// This is required in case modules are duplicated. We need to ensure all instances have the updated code.
|
|
597
|
+
if (bundle.parent) hmrApply(bundle.parent, asset);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function hmrDelete(bundle, id) {
|
|
601
|
+
let modules = bundle.modules;
|
|
602
|
+
if (!modules) return;
|
|
603
|
+
if (modules[id]) {
|
|
604
|
+
// Collect dependencies that will become orphaned when this module is deleted.
|
|
605
|
+
let deps = modules[id][1];
|
|
606
|
+
let orphans = [];
|
|
607
|
+
for(let dep in deps){
|
|
608
|
+
let parents = getParents(module.bundle.root, deps[dep]);
|
|
609
|
+
if (parents.length === 1) orphans.push(deps[dep]);
|
|
610
|
+
}
|
|
611
|
+
// Delete the module. This must be done before deleting dependencies in case of circular dependencies.
|
|
612
|
+
delete modules[id];
|
|
613
|
+
delete bundle.cache[id];
|
|
614
|
+
// Now delete the orphans.
|
|
615
|
+
orphans.forEach((id)=>{
|
|
616
|
+
hmrDelete(module.bundle.root, id);
|
|
617
|
+
});
|
|
618
|
+
} else if (bundle.parent) hmrDelete(bundle.parent, id);
|
|
619
|
+
}
|
|
620
|
+
function hmrAcceptCheck(bundle /*: ParcelRequire */ , id /*: string */ , depsByBundle /*: ?{ [string]: { [string]: string } }*/ ) {
|
|
621
|
+
checkedAssets = {};
|
|
622
|
+
if (hmrAcceptCheckOne(bundle, id, depsByBundle)) return true;
|
|
623
|
+
// Traverse parents breadth first. All possible ancestries must accept the HMR update, or we'll reload.
|
|
624
|
+
let parents = getParents(module.bundle.root, id);
|
|
625
|
+
let accepted = false;
|
|
626
|
+
while(parents.length > 0){
|
|
627
|
+
let v = parents.shift();
|
|
628
|
+
let a = hmrAcceptCheckOne(v[0], v[1], null);
|
|
629
|
+
if (a) // If this parent accepts, stop traversing upward, but still consider siblings.
|
|
630
|
+
accepted = true;
|
|
631
|
+
else if (a !== null) {
|
|
632
|
+
// Otherwise, queue the parents in the next level upward.
|
|
633
|
+
let p = getParents(module.bundle.root, v[1]);
|
|
634
|
+
if (p.length === 0) {
|
|
635
|
+
// If there are no parents, then we've reached an entry without accepting. Reload.
|
|
636
|
+
accepted = false;
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
parents.push(...p);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
return accepted;
|
|
643
|
+
}
|
|
644
|
+
function hmrAcceptCheckOne(bundle /*: ParcelRequire */ , id /*: string */ , depsByBundle /*: ?{ [string]: { [string]: string } }*/ ) {
|
|
645
|
+
var modules = bundle.modules;
|
|
646
|
+
if (!modules) return;
|
|
647
|
+
if (depsByBundle && !depsByBundle[bundle.HMR_BUNDLE_ID]) {
|
|
648
|
+
// If we reached the root bundle without finding where the asset should go,
|
|
649
|
+
// there's nothing to do. Mark as "accepted" so we don't reload the page.
|
|
650
|
+
if (!bundle.parent) {
|
|
651
|
+
bundleNotFound = true;
|
|
652
|
+
return true;
|
|
653
|
+
}
|
|
654
|
+
return hmrAcceptCheckOne(bundle.parent, id, depsByBundle);
|
|
655
|
+
}
|
|
656
|
+
if (checkedAssets[id]) return null;
|
|
657
|
+
checkedAssets[id] = true;
|
|
658
|
+
var cached = bundle.cache[id];
|
|
659
|
+
if (!cached) return true;
|
|
660
|
+
assetsToDispose.push([
|
|
661
|
+
bundle,
|
|
662
|
+
id
|
|
663
|
+
]);
|
|
664
|
+
if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
|
|
665
|
+
assetsToAccept.push([
|
|
666
|
+
bundle,
|
|
667
|
+
id
|
|
668
|
+
]);
|
|
669
|
+
return true;
|
|
670
|
+
}
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
function hmrDisposeQueue() {
|
|
674
|
+
// Dispose all old assets.
|
|
675
|
+
for(let i = 0; i < assetsToDispose.length; i++){
|
|
676
|
+
let id = assetsToDispose[i][1];
|
|
677
|
+
if (!disposedAssets[id]) {
|
|
678
|
+
hmrDispose(assetsToDispose[i][0], id);
|
|
679
|
+
disposedAssets[id] = true;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
assetsToDispose = [];
|
|
683
|
+
}
|
|
684
|
+
function hmrDispose(bundle /*: ParcelRequire */ , id /*: string */ ) {
|
|
685
|
+
var cached = bundle.cache[id];
|
|
686
|
+
bundle.hotData[id] = {};
|
|
687
|
+
if (cached && cached.hot) cached.hot.data = bundle.hotData[id];
|
|
688
|
+
if (cached && cached.hot && cached.hot._disposeCallbacks.length) cached.hot._disposeCallbacks.forEach(function(cb) {
|
|
689
|
+
cb(bundle.hotData[id]);
|
|
690
|
+
});
|
|
691
|
+
delete bundle.cache[id];
|
|
692
|
+
}
|
|
693
|
+
function hmrAccept(bundle /*: ParcelRequire */ , id /*: string */ ) {
|
|
694
|
+
// Execute the module.
|
|
695
|
+
bundle(id);
|
|
696
|
+
// Run the accept callbacks in the new version of the module.
|
|
697
|
+
var cached = bundle.cache[id];
|
|
698
|
+
if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
|
|
699
|
+
let assetsToAlsoAccept = [];
|
|
700
|
+
cached.hot._acceptCallbacks.forEach(function(cb) {
|
|
701
|
+
let additionalAssets = cb(function() {
|
|
702
|
+
return getParents(module.bundle.root, id);
|
|
703
|
+
});
|
|
704
|
+
if (Array.isArray(additionalAssets) && additionalAssets.length) assetsToAlsoAccept.push(...additionalAssets);
|
|
705
|
+
});
|
|
706
|
+
if (assetsToAlsoAccept.length) {
|
|
707
|
+
let handled = assetsToAlsoAccept.every(function(a) {
|
|
708
|
+
return hmrAcceptCheck(a[0], a[1]);
|
|
709
|
+
});
|
|
710
|
+
if (!handled) return fullReload();
|
|
711
|
+
hmrDisposeQueue();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
},{}],"eOear":[function(require,module,exports,__globalThis) {
|
|
717
|
+
var $parcel$ReactRefreshHelpers$a331 = require("@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js");
|
|
718
|
+
$parcel$ReactRefreshHelpers$a331.init();
|
|
719
|
+
var prevRefreshReg = globalThis.$RefreshReg$;
|
|
720
|
+
var prevRefreshSig = globalThis.$RefreshSig$;
|
|
721
|
+
$parcel$ReactRefreshHelpers$a331.prelude(module);
|
|
722
|
+
|
|
723
|
+
try {
|
|
724
|
+
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
|
725
|
+
parcelHelpers.defineInteropFlag(exports);
|
|
726
|
+
parcelHelpers.export(exports, "DefaultLayout", ()=>DefaultLayout);
|
|
727
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
728
|
+
var _reactRouter = require("react-router");
|
|
729
|
+
var _react = require("react");
|
|
730
|
+
var _reactI18Next = require("react-i18next");
|
|
731
|
+
var _sdk = require("@shellui/sdk");
|
|
732
|
+
var _sidebar = require("@/components/ui/sidebar");
|
|
733
|
+
var _utils = require("@/lib/utils");
|
|
734
|
+
var _zIndex = require("@/lib/z-index");
|
|
735
|
+
var _utils1 = require("./utils");
|
|
736
|
+
var _layoutProviders = require("./LayoutProviders");
|
|
737
|
+
var _overlayShell = require("./OverlayShell");
|
|
738
|
+
var _s = $RefreshSig$(), _s1 = $RefreshSig$(), _s2 = $RefreshSig$();
|
|
739
|
+
// DuckDuckGo favicon URL for a given page URL (used when openIn === 'external' and no icon is set)
|
|
740
|
+
const getExternalFaviconUrl = (url)=>{
|
|
741
|
+
try {
|
|
742
|
+
const parsed = new URL(url);
|
|
743
|
+
const hostname = parsed.hostname;
|
|
744
|
+
if (!hostname) return null;
|
|
745
|
+
return `https://icons.duckduckgo.com/ip3/${hostname}.ico`;
|
|
746
|
+
} catch {
|
|
747
|
+
return null;
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
const NavigationContent = ({ navigation })=>{
|
|
751
|
+
_s();
|
|
752
|
+
const location = (0, _reactRouter.useLocation)();
|
|
753
|
+
const { i18n } = (0, _reactI18Next.useTranslation)();
|
|
754
|
+
const currentLanguage = i18n.language || 'en';
|
|
755
|
+
// Helper function to resolve localized strings
|
|
756
|
+
const resolveLocalizedString = (value, lang)=>{
|
|
757
|
+
if (typeof value === 'string') return value;
|
|
758
|
+
// Try current language first, then English as fallback
|
|
759
|
+
return value[lang] || value.en || value.fr || Object.values(value)[0] || '';
|
|
760
|
+
};
|
|
761
|
+
// Check if at least one navigation item has an icon
|
|
762
|
+
const hasAnyIcons = (0, _react.useMemo)(()=>{
|
|
763
|
+
return navigation.some((item)=>{
|
|
764
|
+
if ('title' in item && 'items' in item) // It's a group
|
|
765
|
+
return item.items.some((navItem)=>!!navItem.icon);
|
|
766
|
+
// It's a standalone item
|
|
767
|
+
return !!item.icon;
|
|
768
|
+
});
|
|
769
|
+
}, [
|
|
770
|
+
navigation
|
|
771
|
+
]);
|
|
772
|
+
// Helper to check if an item is a group
|
|
773
|
+
const isGroup = (item)=>{
|
|
774
|
+
return 'title' in item && 'items' in item;
|
|
775
|
+
};
|
|
776
|
+
// Render a single nav item link or modal/drawer trigger
|
|
777
|
+
const renderNavItem = (navItem)=>{
|
|
778
|
+
const pathPrefix = `/${navItem.path}`;
|
|
779
|
+
const isOverlay = navItem.openIn === 'modal' || navItem.openIn === 'drawer';
|
|
780
|
+
const isExternal = navItem.openIn === 'external';
|
|
781
|
+
const isActive = !isOverlay && !isExternal && (location.pathname === pathPrefix || location.pathname.startsWith(`${pathPrefix}/`));
|
|
782
|
+
const itemLabel = resolveLocalizedString(navItem.label, currentLanguage);
|
|
783
|
+
const faviconUrl = isExternal && !navItem.icon ? getExternalFaviconUrl(navItem.url) : null;
|
|
784
|
+
const iconSrc = navItem.icon ?? faviconUrl ?? null;
|
|
785
|
+
const iconEl = iconSrc ? (0, _jsxRuntime.jsx)("img", {
|
|
786
|
+
src: iconSrc,
|
|
787
|
+
alt: "",
|
|
788
|
+
className: (0, _utils.cn)('h-4 w-4', 'shrink-0')
|
|
789
|
+
}) : hasAnyIcons ? (0, _jsxRuntime.jsx)("span", {
|
|
790
|
+
className: "h-4 w-4 shrink-0"
|
|
791
|
+
}) : null;
|
|
792
|
+
const externalIcon = isExternal ? (0, _jsxRuntime.jsx)(ExternalLinkIcon, {
|
|
793
|
+
className: "ml-auto h-4 w-4 shrink-0 opacity-70"
|
|
794
|
+
}) : null;
|
|
795
|
+
const content = (0, _jsxRuntime.jsxs)((0, _jsxRuntime.Fragment), {
|
|
796
|
+
children: [
|
|
797
|
+
iconEl,
|
|
798
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
799
|
+
className: "truncate",
|
|
800
|
+
children: itemLabel
|
|
801
|
+
}),
|
|
802
|
+
externalIcon
|
|
803
|
+
]
|
|
804
|
+
});
|
|
805
|
+
const linkOrTrigger = navItem.openIn === 'modal' ? (0, _jsxRuntime.jsx)("button", {
|
|
806
|
+
type: "button",
|
|
807
|
+
onClick: ()=>(0, _sdk.shellui).openModal(navItem.url),
|
|
808
|
+
className: "flex items-center gap-2 w-full cursor-pointer text-left",
|
|
809
|
+
children: content
|
|
810
|
+
}) : navItem.openIn === 'drawer' ? (0, _jsxRuntime.jsx)("button", {
|
|
811
|
+
type: "button",
|
|
812
|
+
onClick: ()=>(0, _sdk.shellui).openDrawer({
|
|
813
|
+
url: navItem.url,
|
|
814
|
+
position: navItem.drawerPosition
|
|
815
|
+
}),
|
|
816
|
+
className: "flex items-center gap-2 w-full cursor-pointer text-left",
|
|
817
|
+
children: content
|
|
818
|
+
}) : navItem.openIn === 'external' ? (0, _jsxRuntime.jsx)("a", {
|
|
819
|
+
href: navItem.url,
|
|
820
|
+
target: "_blank",
|
|
821
|
+
rel: "noopener noreferrer",
|
|
822
|
+
className: "flex items-center gap-2 w-full",
|
|
823
|
+
children: content
|
|
824
|
+
}) : (0, _jsxRuntime.jsx)((0, _reactRouter.Link), {
|
|
825
|
+
to: `/${navItem.path}`,
|
|
826
|
+
className: "flex items-center gap-2 w-full",
|
|
827
|
+
children: content
|
|
828
|
+
});
|
|
829
|
+
return (0, _jsxRuntime.jsx)((0, _sidebar.SidebarMenuButton), {
|
|
830
|
+
asChild: true,
|
|
831
|
+
isActive: isActive,
|
|
832
|
+
className: (0, _utils.cn)('w-full', isActive && 'bg-sidebar-accent text-sidebar-accent-foreground'),
|
|
833
|
+
children: linkOrTrigger
|
|
834
|
+
});
|
|
835
|
+
};
|
|
836
|
+
// Render navigation items - handle both groups and standalone items
|
|
837
|
+
return (0, _jsxRuntime.jsx)((0, _jsxRuntime.Fragment), {
|
|
838
|
+
children: navigation.map((item)=>{
|
|
839
|
+
if (isGroup(item)) {
|
|
840
|
+
// Render as a group
|
|
841
|
+
const groupTitle = resolveLocalizedString(item.title, currentLanguage);
|
|
842
|
+
return (0, _jsxRuntime.jsxs)((0, _sidebar.SidebarGroup), {
|
|
843
|
+
className: "mt-0",
|
|
844
|
+
children: [
|
|
845
|
+
(0, _jsxRuntime.jsx)((0, _sidebar.SidebarGroupLabel), {
|
|
846
|
+
className: "mb-1",
|
|
847
|
+
children: groupTitle
|
|
848
|
+
}),
|
|
849
|
+
(0, _jsxRuntime.jsx)((0, _sidebar.SidebarGroupContent), {
|
|
850
|
+
children: (0, _jsxRuntime.jsx)((0, _sidebar.SidebarMenu), {
|
|
851
|
+
className: "gap-0.5",
|
|
852
|
+
children: item.items.map((navItem)=>(0, _jsxRuntime.jsx)((0, _sidebar.SidebarMenuItem), {
|
|
853
|
+
children: renderNavItem(navItem)
|
|
854
|
+
}, navItem.path))
|
|
855
|
+
})
|
|
856
|
+
})
|
|
857
|
+
]
|
|
858
|
+
}, groupTitle);
|
|
859
|
+
} else // Render as a standalone item
|
|
860
|
+
return (0, _jsxRuntime.jsx)((0, _sidebar.SidebarMenu), {
|
|
861
|
+
className: "gap-0.5",
|
|
862
|
+
children: (0, _jsxRuntime.jsx)((0, _sidebar.SidebarMenuItem), {
|
|
863
|
+
children: renderNavItem(item)
|
|
864
|
+
})
|
|
865
|
+
}, item.path);
|
|
866
|
+
})
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
_s(NavigationContent, "jblAEP8b2K6uaL5rE7fW1Uaq6X8=", false, function() {
|
|
870
|
+
return [
|
|
871
|
+
(0, _reactRouter.useLocation),
|
|
872
|
+
(0, _reactI18Next.useTranslation)
|
|
873
|
+
];
|
|
874
|
+
});
|
|
875
|
+
_c = NavigationContent;
|
|
876
|
+
/** Reusable sidebar inner: header, main nav, footer. Used in desktop Sidebar and mobile Drawer. */ const SidebarInner = ({ title, logo, startNav, endItems })=>(0, _jsxRuntime.jsxs)((0, _jsxRuntime.Fragment), {
|
|
877
|
+
children: [
|
|
878
|
+
(0, _jsxRuntime.jsx)((0, _sidebar.SidebarHeader), {
|
|
879
|
+
className: "border-b border-sidebar-border pb-4",
|
|
880
|
+
children: (title || logo) && (0, _jsxRuntime.jsx)((0, _reactRouter.Link), {
|
|
881
|
+
to: "/",
|
|
882
|
+
className: "flex items-center pl-1 pr-3 py-2 text-lg font-semibold text-sidebar-foreground hover:text-sidebar-foreground/80 transition-colors",
|
|
883
|
+
children: logo && logo.trim() ? (0, _jsxRuntime.jsx)("img", {
|
|
884
|
+
src: logo,
|
|
885
|
+
alt: title || 'Logo',
|
|
886
|
+
className: "h-5 w-auto shrink-0 object-contain sidebar-logo"
|
|
887
|
+
}) : title ? (0, _jsxRuntime.jsx)("span", {
|
|
888
|
+
className: "leading-none",
|
|
889
|
+
children: title
|
|
890
|
+
}) : null
|
|
891
|
+
})
|
|
892
|
+
}),
|
|
893
|
+
(0, _jsxRuntime.jsx)((0, _sidebar.SidebarContent), {
|
|
894
|
+
className: "gap-1",
|
|
895
|
+
children: (0, _jsxRuntime.jsx)(NavigationContent, {
|
|
896
|
+
navigation: startNav
|
|
897
|
+
})
|
|
898
|
+
}),
|
|
899
|
+
endItems.length > 0 && (0, _jsxRuntime.jsx)((0, _sidebar.SidebarFooter), {
|
|
900
|
+
children: (0, _jsxRuntime.jsx)(NavigationContent, {
|
|
901
|
+
navigation: endItems
|
|
902
|
+
})
|
|
903
|
+
})
|
|
904
|
+
]
|
|
905
|
+
});
|
|
906
|
+
_c1 = SidebarInner;
|
|
907
|
+
function resolveLocalizedLabel(value, lang) {
|
|
908
|
+
if (typeof value === 'string') return value;
|
|
909
|
+
return value[lang] || value.en || value.fr || Object.values(value)[0] || '';
|
|
910
|
+
}
|
|
911
|
+
/** Approximate width per slot (icon + label + padding) and gap for dynamic slot count. */ const BOTTOM_NAV_SLOT_WIDTH = 64;
|
|
912
|
+
const BOTTOM_NAV_GAP = 4;
|
|
913
|
+
const BOTTOM_NAV_PX = 12;
|
|
914
|
+
/** Max slots in the row (Home + nav + optional More) to avoid overflow/duplicated wrap. */ const BOTTOM_NAV_MAX_SLOTS = 6;
|
|
915
|
+
/** True when the icon is a local app icon (/icons/); external images (avatars, favicons) are shown as-is. */ const isAppIcon = (src)=>src.startsWith('/icons/');
|
|
916
|
+
/** Single nav item for bottom bar: icon + label, link or action. */ const BottomNavItem = ({ item, label, isActive, iconSrc, applyIconTheme })=>{
|
|
917
|
+
const pathPrefix = `/${item.path}`;
|
|
918
|
+
const content = (0, _jsxRuntime.jsxs)("span", {
|
|
919
|
+
className: "flex flex-col items-center justify-center gap-1 w-full min-w-0 max-w-full overflow-hidden",
|
|
920
|
+
children: [
|
|
921
|
+
iconSrc ? (0, _jsxRuntime.jsx)("img", {
|
|
922
|
+
src: iconSrc,
|
|
923
|
+
alt: "",
|
|
924
|
+
className: (0, _utils.cn)('size-4 shrink-0 rounded-sm object-cover', applyIconTheme && 'opacity-90 dark:opacity-100 dark:invert')
|
|
925
|
+
}) : (0, _jsxRuntime.jsx)("span", {
|
|
926
|
+
className: "size-4 shrink-0 rounded-sm bg-muted"
|
|
927
|
+
}),
|
|
928
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
929
|
+
className: "text-[11px] leading-tight truncate w-full min-w-0 text-center block",
|
|
930
|
+
children: label
|
|
931
|
+
})
|
|
932
|
+
]
|
|
933
|
+
});
|
|
934
|
+
const baseClass = (0, _utils.cn)('flex flex-col items-center justify-center rounded-md py-1.5 px-2 min-w-0 max-w-full transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', isActive ? 'bg-accent text-accent-foreground [&_span]:text-accent-foreground' : 'text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground [&_span]:inherit');
|
|
935
|
+
if (item.openIn === 'modal') return (0, _jsxRuntime.jsx)("button", {
|
|
936
|
+
type: "button",
|
|
937
|
+
onClick: ()=>(0, _sdk.shellui).openModal(item.url),
|
|
938
|
+
className: baseClass,
|
|
939
|
+
children: content
|
|
940
|
+
});
|
|
941
|
+
if (item.openIn === 'drawer') return (0, _jsxRuntime.jsx)("button", {
|
|
942
|
+
type: "button",
|
|
943
|
+
onClick: ()=>(0, _sdk.shellui).openDrawer({
|
|
944
|
+
url: item.url,
|
|
945
|
+
position: item.drawerPosition
|
|
946
|
+
}),
|
|
947
|
+
className: baseClass,
|
|
948
|
+
children: content
|
|
949
|
+
});
|
|
950
|
+
if (item.openIn === 'external') return (0, _jsxRuntime.jsx)("a", {
|
|
951
|
+
href: item.url,
|
|
952
|
+
target: "_blank",
|
|
953
|
+
rel: "noopener noreferrer",
|
|
954
|
+
className: baseClass,
|
|
955
|
+
children: content
|
|
956
|
+
});
|
|
957
|
+
return (0, _jsxRuntime.jsx)((0, _reactRouter.Link), {
|
|
958
|
+
to: pathPrefix,
|
|
959
|
+
className: baseClass,
|
|
960
|
+
children: content
|
|
961
|
+
});
|
|
962
|
+
};
|
|
963
|
+
_c2 = BottomNavItem;
|
|
964
|
+
/** Inline SVG: external-link icon. Bundled so consumers don't need to serve static SVGs. */ const ExternalLinkIcon = ({ className })=>(0, _jsxRuntime.jsxs)("svg", {
|
|
965
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
966
|
+
width: "24",
|
|
967
|
+
height: "24",
|
|
968
|
+
viewBox: "0 0 24 24",
|
|
969
|
+
fill: "none",
|
|
970
|
+
stroke: "currentColor",
|
|
971
|
+
strokeWidth: "2",
|
|
972
|
+
strokeLinecap: "round",
|
|
973
|
+
strokeLinejoin: "round",
|
|
974
|
+
className: (0, _utils.cn)('shrink-0', className),
|
|
975
|
+
"aria-hidden": true,
|
|
976
|
+
children: [
|
|
977
|
+
(0, _jsxRuntime.jsx)("path", {
|
|
978
|
+
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
|
|
979
|
+
}),
|
|
980
|
+
(0, _jsxRuntime.jsx)("polyline", {
|
|
981
|
+
points: "15 3 21 3 21 9"
|
|
982
|
+
}),
|
|
983
|
+
(0, _jsxRuntime.jsx)("line", {
|
|
984
|
+
x1: "10",
|
|
985
|
+
y1: "14",
|
|
986
|
+
x2: "21",
|
|
987
|
+
y2: "3"
|
|
988
|
+
})
|
|
989
|
+
]
|
|
990
|
+
});
|
|
991
|
+
_c3 = ExternalLinkIcon;
|
|
992
|
+
/** Caret up: expand (show second line). */ const CaretUpIcon = ({ className })=>(0, _jsxRuntime.jsx)("svg", {
|
|
993
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
994
|
+
width: "24",
|
|
995
|
+
height: "24",
|
|
996
|
+
viewBox: "0 0 24 24",
|
|
997
|
+
fill: "none",
|
|
998
|
+
stroke: "currentColor",
|
|
999
|
+
strokeWidth: "2",
|
|
1000
|
+
strokeLinecap: "round",
|
|
1001
|
+
strokeLinejoin: "round",
|
|
1002
|
+
className: (0, _utils.cn)('shrink-0', className),
|
|
1003
|
+
"aria-hidden": true,
|
|
1004
|
+
children: (0, _jsxRuntime.jsx)("path", {
|
|
1005
|
+
d: "m18 15-6-6-6 6"
|
|
1006
|
+
})
|
|
1007
|
+
});
|
|
1008
|
+
_c4 = CaretUpIcon;
|
|
1009
|
+
/** Caret down: collapse (hide second line). */ const CaretDownIcon = ({ className })=>(0, _jsxRuntime.jsx)("svg", {
|
|
1010
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1011
|
+
width: "24",
|
|
1012
|
+
height: "24",
|
|
1013
|
+
viewBox: "0 0 24 24",
|
|
1014
|
+
fill: "none",
|
|
1015
|
+
stroke: "currentColor",
|
|
1016
|
+
strokeWidth: "2",
|
|
1017
|
+
strokeLinecap: "round",
|
|
1018
|
+
strokeLinejoin: "round",
|
|
1019
|
+
className: (0, _utils.cn)('shrink-0', className),
|
|
1020
|
+
"aria-hidden": true,
|
|
1021
|
+
children: (0, _jsxRuntime.jsx)("path", {
|
|
1022
|
+
d: "m6 9 6 6 6-6"
|
|
1023
|
+
})
|
|
1024
|
+
});
|
|
1025
|
+
_c5 = CaretDownIcon;
|
|
1026
|
+
/** Home icon for mobile bottom bar (same as sidebar logo action). */ const HomeIcon = ({ className })=>(0, _jsxRuntime.jsxs)("svg", {
|
|
1027
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1028
|
+
width: "24",
|
|
1029
|
+
height: "24",
|
|
1030
|
+
viewBox: "0 0 24 24",
|
|
1031
|
+
fill: "none",
|
|
1032
|
+
stroke: "currentColor",
|
|
1033
|
+
strokeWidth: "2",
|
|
1034
|
+
strokeLinecap: "round",
|
|
1035
|
+
strokeLinejoin: "round",
|
|
1036
|
+
className: (0, _utils.cn)('shrink-0', className),
|
|
1037
|
+
"aria-hidden": true,
|
|
1038
|
+
children: [
|
|
1039
|
+
(0, _jsxRuntime.jsx)("path", {
|
|
1040
|
+
d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"
|
|
1041
|
+
}),
|
|
1042
|
+
(0, _jsxRuntime.jsx)("polyline", {
|
|
1043
|
+
points: "9 22 9 12 15 12 15 22"
|
|
1044
|
+
})
|
|
1045
|
+
]
|
|
1046
|
+
});
|
|
1047
|
+
_c6 = HomeIcon;
|
|
1048
|
+
/** Mobile bottom nav: Home + nav items; More only when not all fit. Dynamic from width. */ const MobileBottomNav = ({ items, currentLanguage })=>{
|
|
1049
|
+
_s1();
|
|
1050
|
+
const location = (0, _reactRouter.useLocation)();
|
|
1051
|
+
const [expanded, setExpanded] = (0, _react.useState)(false);
|
|
1052
|
+
const navRef = (0, _react.useRef)(null);
|
|
1053
|
+
const [rowWidth, setRowWidth] = (0, _react.useState)(0);
|
|
1054
|
+
(0, _react.useLayoutEffect)(()=>{
|
|
1055
|
+
const el = navRef.current;
|
|
1056
|
+
if (!el) return;
|
|
1057
|
+
const ro = new ResizeObserver((entries)=>{
|
|
1058
|
+
const w = entries[0]?.contentRect.width ?? 0;
|
|
1059
|
+
setRowWidth(w);
|
|
1060
|
+
});
|
|
1061
|
+
ro.observe(el);
|
|
1062
|
+
setRowWidth(el.getBoundingClientRect().width);
|
|
1063
|
+
return ()=>ro.disconnect();
|
|
1064
|
+
}, []);
|
|
1065
|
+
const { rowItems, overflowItems, hasMore } = (0, _react.useMemo)(()=>{
|
|
1066
|
+
const list = items.slice();
|
|
1067
|
+
const contentWidth = Math.max(0, rowWidth - BOTTOM_NAV_PX * 2);
|
|
1068
|
+
const slotTotal = BOTTOM_NAV_SLOT_WIDTH + BOTTOM_NAV_GAP;
|
|
1069
|
+
const computedSlots = rowWidth > 0 ? Math.floor((contentWidth + BOTTOM_NAV_GAP) / slotTotal) : 5;
|
|
1070
|
+
const totalSlots = Math.min(Math.max(0, computedSlots), BOTTOM_NAV_MAX_SLOTS);
|
|
1071
|
+
const slotsForNav = totalSlots - 1;
|
|
1072
|
+
const allFit = list.length <= slotsForNav;
|
|
1073
|
+
const maxInRow = allFit ? list.length : Math.max(0, totalSlots - 2);
|
|
1074
|
+
const row = list.slice(0, maxInRow);
|
|
1075
|
+
const rowPaths = new Set(row.map((i)=>i.path));
|
|
1076
|
+
const overflow = list.filter((item)=>!rowPaths.has(item.path));
|
|
1077
|
+
return {
|
|
1078
|
+
rowItems: row,
|
|
1079
|
+
overflowItems: overflow,
|
|
1080
|
+
hasMore: overflow.length > 0
|
|
1081
|
+
};
|
|
1082
|
+
}, [
|
|
1083
|
+
items,
|
|
1084
|
+
rowWidth
|
|
1085
|
+
]);
|
|
1086
|
+
(0, _react.useEffect)(()=>{
|
|
1087
|
+
setExpanded(false);
|
|
1088
|
+
}, [
|
|
1089
|
+
location.pathname
|
|
1090
|
+
]);
|
|
1091
|
+
const renderItem = (item, index)=>{
|
|
1092
|
+
const pathPrefix = `/${item.path}`;
|
|
1093
|
+
const isOverlayOrExternal = item.openIn === 'modal' || item.openIn === 'drawer' || item.openIn === 'external';
|
|
1094
|
+
const isActive = !isOverlayOrExternal && (location.pathname === pathPrefix || location.pathname.startsWith(`${pathPrefix}/`));
|
|
1095
|
+
const label = (0, _utils1.resolveLocalizedString)(item.label, currentLanguage);
|
|
1096
|
+
const faviconUrl = item.openIn === 'external' && !item.icon ? getExternalFaviconUrl(item.url) : null;
|
|
1097
|
+
const iconSrc = item.icon ?? faviconUrl ?? null;
|
|
1098
|
+
const applyIconTheme = iconSrc ? isAppIcon(iconSrc) : false;
|
|
1099
|
+
return (0, _jsxRuntime.jsx)(BottomNavItem, {
|
|
1100
|
+
item: item,
|
|
1101
|
+
label: label,
|
|
1102
|
+
isActive: isActive,
|
|
1103
|
+
iconSrc: iconSrc,
|
|
1104
|
+
applyIconTheme: applyIconTheme
|
|
1105
|
+
}, `${item.path}-${item.url}-${index}`);
|
|
1106
|
+
};
|
|
1107
|
+
return (0, _jsxRuntime.jsxs)("nav", {
|
|
1108
|
+
ref: navRef,
|
|
1109
|
+
className: "fixed bottom-0 left-0 right-0 z-[9999] md:hidden border-t border-sidebar-border bg-sidebar-background overflow-hidden pt-2",
|
|
1110
|
+
style: {
|
|
1111
|
+
zIndex: (0, _zIndex.Z_INDEX).SIDEBAR_TRIGGER,
|
|
1112
|
+
paddingBottom: 'calc(0.5rem + env(safe-area-inset-bottom, 0px))'
|
|
1113
|
+
},
|
|
1114
|
+
children: [
|
|
1115
|
+
(0, _jsxRuntime.jsxs)("div", {
|
|
1116
|
+
className: "flex flex-row flex-nowrap items-center justify-center gap-1 px-3 overflow-x-hidden",
|
|
1117
|
+
children: [
|
|
1118
|
+
(0, _jsxRuntime.jsxs)((0, _reactRouter.Link), {
|
|
1119
|
+
to: "/",
|
|
1120
|
+
className: (0, _utils.cn)('flex flex-col items-center justify-center gap-1 rounded-md py-1.5 px-2 min-w-0 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', location.pathname === '/' || location.pathname === '' ? 'bg-sidebar-accent text-sidebar-accent-foreground [&_span]:text-sidebar-accent-foreground' : 'text-sidebar-foreground/80 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground [&_span]:inherit'),
|
|
1121
|
+
"aria-label": "Home",
|
|
1122
|
+
children: [
|
|
1123
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
1124
|
+
className: "size-4 shrink-0 flex items-center justify-center [&_svg]:text-current",
|
|
1125
|
+
children: (0, _jsxRuntime.jsx)(HomeIcon, {
|
|
1126
|
+
className: "size-4"
|
|
1127
|
+
})
|
|
1128
|
+
}),
|
|
1129
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
1130
|
+
className: "text-[11px] leading-tight",
|
|
1131
|
+
children: "Home"
|
|
1132
|
+
})
|
|
1133
|
+
]
|
|
1134
|
+
}),
|
|
1135
|
+
rowItems.map((item, i)=>renderItem(item, i)),
|
|
1136
|
+
hasMore && (0, _jsxRuntime.jsxs)("button", {
|
|
1137
|
+
type: "button",
|
|
1138
|
+
onClick: ()=>setExpanded((e)=>!e),
|
|
1139
|
+
className: (0, _utils.cn)('flex flex-col items-center justify-center gap-1 rounded-md py-1.5 px-2 min-w-0 transition-colors cursor-pointer', 'text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2'),
|
|
1140
|
+
"aria-expanded": expanded,
|
|
1141
|
+
"aria-label": expanded ? 'Show less' : 'Show more',
|
|
1142
|
+
children: [
|
|
1143
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
1144
|
+
className: "size-4 shrink-0 flex items-center justify-center",
|
|
1145
|
+
children: expanded ? (0, _jsxRuntime.jsx)(CaretDownIcon, {
|
|
1146
|
+
className: "size-4"
|
|
1147
|
+
}) : (0, _jsxRuntime.jsx)(CaretUpIcon, {
|
|
1148
|
+
className: "size-4"
|
|
1149
|
+
})
|
|
1150
|
+
}),
|
|
1151
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
1152
|
+
className: "text-[11px] leading-tight",
|
|
1153
|
+
children: expanded ? 'Less' : 'More'
|
|
1154
|
+
})
|
|
1155
|
+
]
|
|
1156
|
+
})
|
|
1157
|
+
]
|
|
1158
|
+
}),
|
|
1159
|
+
(0, _jsxRuntime.jsx)("div", {
|
|
1160
|
+
className: (0, _utils.cn)('grid transition-[grid-template-rows] duration-300 ease-out', expanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'),
|
|
1161
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1162
|
+
className: "min-h-0 overflow-hidden",
|
|
1163
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1164
|
+
className: "px-4 pt-3 pb-2 border-t border-sidebar-border/50 mt-1",
|
|
1165
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1166
|
+
className: "grid grid-cols-5 gap-2 justify-items-center max-w-xs mx-auto",
|
|
1167
|
+
children: expanded ? overflowItems.map((item, i)=>renderItem(item, i)) : null
|
|
1168
|
+
})
|
|
1169
|
+
})
|
|
1170
|
+
})
|
|
1171
|
+
})
|
|
1172
|
+
]
|
|
1173
|
+
});
|
|
1174
|
+
};
|
|
1175
|
+
_s1(MobileBottomNav, "U2Tm7blzZXEpGbs18cOsoK4bBdQ=", false, function() {
|
|
1176
|
+
return [
|
|
1177
|
+
(0, _reactRouter.useLocation)
|
|
1178
|
+
];
|
|
1179
|
+
});
|
|
1180
|
+
_c7 = MobileBottomNav;
|
|
1181
|
+
const DefaultLayoutContent = ({ title, logo, navigation })=>{
|
|
1182
|
+
_s2();
|
|
1183
|
+
const location = (0, _reactRouter.useLocation)();
|
|
1184
|
+
const { i18n } = (0, _reactI18Next.useTranslation)();
|
|
1185
|
+
const currentLanguage = i18n.language || 'en';
|
|
1186
|
+
const { startNav, endItems, navigationItems, mobileNavItems } = (0, _react.useMemo)(()=>{
|
|
1187
|
+
const desktopNav = (0, _utils1.filterNavigationByViewport)(navigation, 'desktop');
|
|
1188
|
+
const mobileNav = (0, _utils1.filterNavigationByViewport)(navigation, 'mobile');
|
|
1189
|
+
const { start, end } = (0, _utils1.splitNavigationByPosition)(desktopNav);
|
|
1190
|
+
const flat = (0, _utils1.flattenNavigationItems)(desktopNav);
|
|
1191
|
+
const mobileFlat = (0, _utils1.flattenNavigationItems)(mobileNav);
|
|
1192
|
+
return {
|
|
1193
|
+
startNav: (0, _utils1.filterNavigationForSidebar)(start),
|
|
1194
|
+
endItems: end,
|
|
1195
|
+
navigationItems: flat,
|
|
1196
|
+
mobileNavItems: mobileFlat
|
|
1197
|
+
};
|
|
1198
|
+
}, [
|
|
1199
|
+
navigation
|
|
1200
|
+
]);
|
|
1201
|
+
(0, _react.useEffect)(()=>{
|
|
1202
|
+
if (!title) return;
|
|
1203
|
+
const pathname = location.pathname.replace(/^\/+|\/+$/g, '') || '';
|
|
1204
|
+
const segment = pathname.split('/')[0];
|
|
1205
|
+
if (!segment) {
|
|
1206
|
+
document.title = title;
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
const navItem = navigationItems.find((item)=>item.path === segment);
|
|
1210
|
+
if (navItem) {
|
|
1211
|
+
const label = resolveLocalizedLabel(navItem.label, currentLanguage);
|
|
1212
|
+
document.title = `${label} | ${title}`;
|
|
1213
|
+
} else document.title = title;
|
|
1214
|
+
}, [
|
|
1215
|
+
location.pathname,
|
|
1216
|
+
title,
|
|
1217
|
+
navigationItems,
|
|
1218
|
+
currentLanguage
|
|
1219
|
+
]);
|
|
1220
|
+
return (0, _jsxRuntime.jsx)((0, _layoutProviders.LayoutProviders), {
|
|
1221
|
+
children: (0, _jsxRuntime.jsx)((0, _sidebar.SidebarProvider), {
|
|
1222
|
+
children: (0, _jsxRuntime.jsxs)((0, _overlayShell.OverlayShell), {
|
|
1223
|
+
navigationItems: navigationItems,
|
|
1224
|
+
children: [
|
|
1225
|
+
(0, _jsxRuntime.jsxs)("div", {
|
|
1226
|
+
className: "flex h-screen overflow-hidden",
|
|
1227
|
+
children: [
|
|
1228
|
+
(0, _jsxRuntime.jsx)((0, _sidebar.Sidebar), {
|
|
1229
|
+
className: (0, _utils.cn)('hidden md:flex shrink-0'),
|
|
1230
|
+
children: (0, _jsxRuntime.jsx)(SidebarInner, {
|
|
1231
|
+
title: title,
|
|
1232
|
+
logo: logo,
|
|
1233
|
+
startNav: startNav,
|
|
1234
|
+
endItems: endItems
|
|
1235
|
+
})
|
|
1236
|
+
}),
|
|
1237
|
+
(0, _jsxRuntime.jsx)("main", {
|
|
1238
|
+
className: "flex-1 flex flex-col overflow-hidden bg-background relative min-w-0",
|
|
1239
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1240
|
+
className: "flex-1 flex flex-col overflow-auto pb-16 md:pb-0",
|
|
1241
|
+
children: (0, _jsxRuntime.jsx)((0, _reactRouter.Outlet), {})
|
|
1242
|
+
})
|
|
1243
|
+
})
|
|
1244
|
+
]
|
|
1245
|
+
}),
|
|
1246
|
+
(0, _jsxRuntime.jsx)(MobileBottomNav, {
|
|
1247
|
+
items: mobileNavItems,
|
|
1248
|
+
currentLanguage: currentLanguage
|
|
1249
|
+
})
|
|
1250
|
+
]
|
|
1251
|
+
})
|
|
1252
|
+
})
|
|
1253
|
+
});
|
|
1254
|
+
};
|
|
1255
|
+
_s2(DefaultLayoutContent, "Xr8qR4VhNRAJkJ6hNa0+/IwN6GY=", false, function() {
|
|
1256
|
+
return [
|
|
1257
|
+
(0, _reactRouter.useLocation),
|
|
1258
|
+
(0, _reactI18Next.useTranslation)
|
|
1259
|
+
];
|
|
1260
|
+
});
|
|
1261
|
+
_c8 = DefaultLayoutContent;
|
|
1262
|
+
const DefaultLayout = ({ title, appIcon, logo, navigation })=>{
|
|
1263
|
+
return (0, _jsxRuntime.jsx)(DefaultLayoutContent, {
|
|
1264
|
+
title: title,
|
|
1265
|
+
appIcon: appIcon,
|
|
1266
|
+
logo: logo,
|
|
1267
|
+
navigation: navigation
|
|
1268
|
+
});
|
|
1269
|
+
};
|
|
1270
|
+
_c9 = DefaultLayout;
|
|
1271
|
+
var _c, _c1, _c2, _c3, _c4, _c5, _c6, _c7, _c8, _c9;
|
|
1272
|
+
$RefreshReg$(_c, "NavigationContent");
|
|
1273
|
+
$RefreshReg$(_c1, "SidebarInner");
|
|
1274
|
+
$RefreshReg$(_c2, "BottomNavItem");
|
|
1275
|
+
$RefreshReg$(_c3, "ExternalLinkIcon");
|
|
1276
|
+
$RefreshReg$(_c4, "CaretUpIcon");
|
|
1277
|
+
$RefreshReg$(_c5, "CaretDownIcon");
|
|
1278
|
+
$RefreshReg$(_c6, "HomeIcon");
|
|
1279
|
+
$RefreshReg$(_c7, "MobileBottomNav");
|
|
1280
|
+
$RefreshReg$(_c8, "DefaultLayoutContent");
|
|
1281
|
+
$RefreshReg$(_c9, "DefaultLayout");
|
|
1282
|
+
|
|
1283
|
+
$parcel$ReactRefreshHelpers$a331.postlude(module);
|
|
1284
|
+
} finally {
|
|
1285
|
+
globalThis.$RefreshReg$ = prevRefreshReg;
|
|
1286
|
+
globalThis.$RefreshSig$ = prevRefreshSig;
|
|
1287
|
+
}
|
|
1288
|
+
},{"react/jsx-runtime":"05iiF","react-router":"kWH5w","react":"jMk1U","react-i18next":"gKfGQ","@shellui/sdk":"dS2fb","@/components/ui/sidebar":"7rtQS","@/lib/utils":"58RPa","@/lib/z-index":"eChN4","./utils":"4dqXA","./LayoutProviders":"go6VO","./OverlayShell":"2PvVD","@parcel/transformer-js/src/esmodule-helpers.js":"jnFvT","@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js":"7h6Pi"}],"7rtQS":[function(require,module,exports,__globalThis) {
|
|
1289
|
+
var $parcel$ReactRefreshHelpers$e68c = require("@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js");
|
|
1290
|
+
$parcel$ReactRefreshHelpers$e68c.init();
|
|
1291
|
+
var prevRefreshReg = globalThis.$RefreshReg$;
|
|
1292
|
+
var prevRefreshSig = globalThis.$RefreshSig$;
|
|
1293
|
+
$parcel$ReactRefreshHelpers$e68c.prelude(module);
|
|
1294
|
+
|
|
1295
|
+
try {
|
|
1296
|
+
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
|
1297
|
+
parcelHelpers.defineInteropFlag(exports);
|
|
1298
|
+
parcelHelpers.export(exports, "Sidebar", ()=>Sidebar);
|
|
1299
|
+
parcelHelpers.export(exports, "SidebarProvider", ()=>SidebarProvider);
|
|
1300
|
+
parcelHelpers.export(exports, "SidebarTrigger", ()=>SidebarTrigger);
|
|
1301
|
+
parcelHelpers.export(exports, "SidebarHeader", ()=>SidebarHeader);
|
|
1302
|
+
parcelHelpers.export(exports, "SidebarContent", ()=>SidebarContent);
|
|
1303
|
+
parcelHelpers.export(exports, "SidebarFooter", ()=>SidebarFooter);
|
|
1304
|
+
parcelHelpers.export(exports, "SidebarGroup", ()=>SidebarGroup);
|
|
1305
|
+
parcelHelpers.export(exports, "SidebarGroupLabel", ()=>SidebarGroupLabel);
|
|
1306
|
+
parcelHelpers.export(exports, "SidebarGroupAction", ()=>SidebarGroupAction);
|
|
1307
|
+
parcelHelpers.export(exports, "SidebarGroupContent", ()=>SidebarGroupContent);
|
|
1308
|
+
parcelHelpers.export(exports, "SidebarMenu", ()=>SidebarMenu);
|
|
1309
|
+
parcelHelpers.export(exports, "SidebarMenuButton", ()=>SidebarMenuButton);
|
|
1310
|
+
parcelHelpers.export(exports, "SidebarMenuItem", ()=>SidebarMenuItem);
|
|
1311
|
+
parcelHelpers.export(exports, "SidebarMenuAction", ()=>SidebarMenuAction);
|
|
1312
|
+
parcelHelpers.export(exports, "SidebarMenuBadge", ()=>SidebarMenuBadge);
|
|
1313
|
+
parcelHelpers.export(exports, "SidebarMenuSkeleton", ()=>SidebarMenuSkeleton);
|
|
1314
|
+
parcelHelpers.export(exports, "SidebarMenuSub", ()=>SidebarMenuSub);
|
|
1315
|
+
parcelHelpers.export(exports, "SidebarMenuSubButton", ()=>SidebarMenuSubButton);
|
|
1316
|
+
parcelHelpers.export(exports, "SidebarMenuSubItem", ()=>SidebarMenuSubItem);
|
|
1317
|
+
parcelHelpers.export(exports, "useSidebar", ()=>useSidebar);
|
|
1318
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
1319
|
+
var _react = require("react");
|
|
1320
|
+
var _reactSlot = require("@radix-ui/react-slot");
|
|
1321
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
1322
|
+
var _utils = require("@/lib/utils");
|
|
1323
|
+
var _zIndex = require("@/lib/z-index");
|
|
1324
|
+
var _s = $RefreshSig$(), _s1 = $RefreshSig$(), _s2 = $RefreshSig$(), _s3 = $RefreshSig$(), _s4 = $RefreshSig$();
|
|
1325
|
+
const SidebarContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
1326
|
+
const useSidebar = ()=>{
|
|
1327
|
+
_s();
|
|
1328
|
+
const context = (0, _react.useContext)(SidebarContext);
|
|
1329
|
+
if (!context) throw new Error('useSidebar must be used within a SidebarProvider');
|
|
1330
|
+
return context;
|
|
1331
|
+
};
|
|
1332
|
+
_s(useSidebar, "b9L3QQ+jgeyIrH0NfHrJ8nn7VMU=");
|
|
1333
|
+
const SidebarProvider = ({ children })=>{
|
|
1334
|
+
_s1();
|
|
1335
|
+
const [isCollapsed, setIsCollapsed] = (0, _react.useState)(false);
|
|
1336
|
+
const toggle = (0, _react.useCallback)(()=>{
|
|
1337
|
+
setIsCollapsed((prev)=>!prev);
|
|
1338
|
+
}, []);
|
|
1339
|
+
return (0, _jsxRuntime.jsx)(SidebarContext.Provider, {
|
|
1340
|
+
value: {
|
|
1341
|
+
isCollapsed,
|
|
1342
|
+
toggle
|
|
1343
|
+
},
|
|
1344
|
+
children: children
|
|
1345
|
+
});
|
|
1346
|
+
};
|
|
1347
|
+
_s1(SidebarProvider, "IAHIu8xIpTON6xmrCeYGL79JNNs=");
|
|
1348
|
+
_c = SidebarProvider;
|
|
1349
|
+
const Sidebar = /*#__PURE__*/ _s2((0, _react.forwardRef)(_c1 = _s2(({ className, ...props }, ref)=>{
|
|
1350
|
+
_s2();
|
|
1351
|
+
const { isCollapsed } = useSidebar();
|
|
1352
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1353
|
+
ref: ref,
|
|
1354
|
+
"data-sidebar": "sidebar",
|
|
1355
|
+
"data-collapsed": isCollapsed,
|
|
1356
|
+
className: (0, _utils.cn)('flex h-full flex-col gap-2 border-r bg-sidebar-background p-2 text-sidebar-foreground transition-all duration-300 ease-in-out overflow-hidden', isCollapsed ? 'w-0 border-r-0 p-0' : 'w-64', className),
|
|
1357
|
+
...props
|
|
1358
|
+
});
|
|
1359
|
+
}, "kpCbkCry4qXFIp34OhVPTLUoaro=", false, function() {
|
|
1360
|
+
return [
|
|
1361
|
+
useSidebar
|
|
1362
|
+
];
|
|
1363
|
+
})), "kpCbkCry4qXFIp34OhVPTLUoaro=", false, function() {
|
|
1364
|
+
return [
|
|
1365
|
+
useSidebar
|
|
1366
|
+
];
|
|
1367
|
+
});
|
|
1368
|
+
_c2 = Sidebar;
|
|
1369
|
+
Sidebar.displayName = 'Sidebar';
|
|
1370
|
+
/** Inline SVG: panel-left-open (expand sidebar) */ const PanelLeftOpenIcon = ()=>(0, _jsxRuntime.jsxs)("svg", {
|
|
1371
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1372
|
+
width: "24",
|
|
1373
|
+
height: "24",
|
|
1374
|
+
viewBox: "0 0 24 24",
|
|
1375
|
+
fill: "none",
|
|
1376
|
+
stroke: "currentColor",
|
|
1377
|
+
strokeWidth: "2",
|
|
1378
|
+
strokeLinecap: "round",
|
|
1379
|
+
strokeLinejoin: "round",
|
|
1380
|
+
className: "h-5 w-5 transition-transform duration-300",
|
|
1381
|
+
"aria-hidden": true,
|
|
1382
|
+
children: [
|
|
1383
|
+
(0, _jsxRuntime.jsx)("rect", {
|
|
1384
|
+
width: "18",
|
|
1385
|
+
height: "18",
|
|
1386
|
+
x: "3",
|
|
1387
|
+
y: "3",
|
|
1388
|
+
rx: "2"
|
|
1389
|
+
}),
|
|
1390
|
+
(0, _jsxRuntime.jsx)("path", {
|
|
1391
|
+
d: "M9 3v18"
|
|
1392
|
+
}),
|
|
1393
|
+
(0, _jsxRuntime.jsx)("path", {
|
|
1394
|
+
d: "m14 9 3 3-3 3"
|
|
1395
|
+
})
|
|
1396
|
+
]
|
|
1397
|
+
});
|
|
1398
|
+
_c3 = PanelLeftOpenIcon;
|
|
1399
|
+
/** Inline SVG: panel-left-close (collapse sidebar) */ const PanelLeftCloseIcon = ()=>(0, _jsxRuntime.jsxs)("svg", {
|
|
1400
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1401
|
+
width: "24",
|
|
1402
|
+
height: "24",
|
|
1403
|
+
viewBox: "0 0 24 24",
|
|
1404
|
+
fill: "none",
|
|
1405
|
+
stroke: "currentColor",
|
|
1406
|
+
strokeWidth: "2",
|
|
1407
|
+
strokeLinecap: "round",
|
|
1408
|
+
strokeLinejoin: "round",
|
|
1409
|
+
className: "h-5 w-5 transition-transform duration-300",
|
|
1410
|
+
"aria-hidden": true,
|
|
1411
|
+
children: [
|
|
1412
|
+
(0, _jsxRuntime.jsx)("rect", {
|
|
1413
|
+
width: "18",
|
|
1414
|
+
height: "18",
|
|
1415
|
+
x: "3",
|
|
1416
|
+
y: "3",
|
|
1417
|
+
rx: "2"
|
|
1418
|
+
}),
|
|
1419
|
+
(0, _jsxRuntime.jsx)("path", {
|
|
1420
|
+
d: "M9 3v18"
|
|
1421
|
+
}),
|
|
1422
|
+
(0, _jsxRuntime.jsx)("path", {
|
|
1423
|
+
d: "m16 15-3-3 3-3"
|
|
1424
|
+
})
|
|
1425
|
+
]
|
|
1426
|
+
});
|
|
1427
|
+
_c4 = PanelLeftCloseIcon;
|
|
1428
|
+
const SidebarTrigger = /*#__PURE__*/ _s3((0, _react.forwardRef)(_c5 = _s3(({ className, ...props }, ref)=>{
|
|
1429
|
+
_s3();
|
|
1430
|
+
const { toggle, isCollapsed } = useSidebar();
|
|
1431
|
+
return (0, _jsxRuntime.jsx)("button", {
|
|
1432
|
+
ref: ref,
|
|
1433
|
+
onClick: toggle,
|
|
1434
|
+
className: (0, _utils.cn)('relative flex items-center justify-center rounded-md p-2 text-foreground transition-colors hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring shadow-lg backdrop-blur-md cursor-pointer bg-background/95 border border-border', className),
|
|
1435
|
+
"aria-label": isCollapsed ? 'Expand sidebar' : 'Collapse sidebar',
|
|
1436
|
+
style: {
|
|
1437
|
+
zIndex: (0, _zIndex.Z_INDEX).SIDEBAR_TRIGGER
|
|
1438
|
+
},
|
|
1439
|
+
...props,
|
|
1440
|
+
children: isCollapsed ? (0, _jsxRuntime.jsx)(PanelLeftOpenIcon, {}) : (0, _jsxRuntime.jsx)(PanelLeftCloseIcon, {})
|
|
1441
|
+
});
|
|
1442
|
+
}, "vHQgmdOO9T1a5p4nyagngb+lwXA=", false, function() {
|
|
1443
|
+
return [
|
|
1444
|
+
useSidebar
|
|
1445
|
+
];
|
|
1446
|
+
})), "vHQgmdOO9T1a5p4nyagngb+lwXA=", false, function() {
|
|
1447
|
+
return [
|
|
1448
|
+
useSidebar
|
|
1449
|
+
];
|
|
1450
|
+
});
|
|
1451
|
+
_c6 = SidebarTrigger;
|
|
1452
|
+
SidebarTrigger.displayName = 'SidebarTrigger';
|
|
1453
|
+
const SidebarHeader = /*#__PURE__*/ (0, _react.forwardRef)(_c7 = ({ className, ...props }, ref)=>{
|
|
1454
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1455
|
+
ref: ref,
|
|
1456
|
+
className: (0, _utils.cn)('flex flex-col gap-2 p-2', className),
|
|
1457
|
+
...props
|
|
1458
|
+
});
|
|
1459
|
+
});
|
|
1460
|
+
_c8 = SidebarHeader;
|
|
1461
|
+
SidebarHeader.displayName = 'SidebarHeader';
|
|
1462
|
+
const SidebarContent = /*#__PURE__*/ (0, _react.forwardRef)(_c9 = ({ className, ...props }, ref)=>{
|
|
1463
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1464
|
+
ref: ref,
|
|
1465
|
+
className: (0, _utils.cn)('flex flex-1 flex-col gap-2 overflow-auto', className),
|
|
1466
|
+
...props
|
|
1467
|
+
});
|
|
1468
|
+
});
|
|
1469
|
+
_c10 = SidebarContent;
|
|
1470
|
+
SidebarContent.displayName = 'SidebarContent';
|
|
1471
|
+
const SidebarFooter = /*#__PURE__*/ (0, _react.forwardRef)(_c11 = ({ className, ...props }, ref)=>{
|
|
1472
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1473
|
+
ref: ref,
|
|
1474
|
+
className: (0, _utils.cn)('flex flex-col gap-2 p-2', className),
|
|
1475
|
+
...props
|
|
1476
|
+
});
|
|
1477
|
+
});
|
|
1478
|
+
_c12 = SidebarFooter;
|
|
1479
|
+
SidebarFooter.displayName = 'SidebarFooter';
|
|
1480
|
+
const SidebarGroup = /*#__PURE__*/ (0, _react.forwardRef)(_c13 = ({ className, ...props }, ref)=>{
|
|
1481
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1482
|
+
ref: ref,
|
|
1483
|
+
className: (0, _utils.cn)('group/sidebar-group', className),
|
|
1484
|
+
...props
|
|
1485
|
+
});
|
|
1486
|
+
});
|
|
1487
|
+
_c14 = SidebarGroup;
|
|
1488
|
+
SidebarGroup.displayName = 'SidebarGroup';
|
|
1489
|
+
const SidebarGroupLabel = /*#__PURE__*/ (0, _react.forwardRef)(_c15 = ({ className, ...props }, ref)=>{
|
|
1490
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1491
|
+
ref: ref,
|
|
1492
|
+
className: (0, _utils.cn)('flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', className),
|
|
1493
|
+
style: {
|
|
1494
|
+
fontFamily: 'var(--heading-font-family, inherit)'
|
|
1495
|
+
},
|
|
1496
|
+
...props
|
|
1497
|
+
});
|
|
1498
|
+
});
|
|
1499
|
+
_c16 = SidebarGroupLabel;
|
|
1500
|
+
SidebarGroupLabel.displayName = 'SidebarGroupLabel';
|
|
1501
|
+
const SidebarGroupAction = /*#__PURE__*/ (0, _react.forwardRef)(_c17 = ({ className, asChild = false, ...props }, ref)=>{
|
|
1502
|
+
const Comp = asChild ? (0, _reactSlot.Slot) : 'button';
|
|
1503
|
+
return (0, _jsxRuntime.jsx)(Comp, {
|
|
1504
|
+
ref: ref,
|
|
1505
|
+
className: (0, _utils.cn)('absolute right-2 top-1/2 -translate-y-1/2 rounded-md p-1.5 text-sidebar-foreground outline-none ring-sidebar-ring transition-opacity hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:opacity-100 focus-visible:ring-2 group-hover/sidebar-group:opacity-100 peer-data-[size=sm]/sidebar-group-action:opacity-0 [&>svg]:size-4 [&>svg]:shrink-0', className),
|
|
1506
|
+
...props
|
|
1507
|
+
});
|
|
1508
|
+
});
|
|
1509
|
+
_c18 = SidebarGroupAction;
|
|
1510
|
+
SidebarGroupAction.displayName = 'SidebarGroupAction';
|
|
1511
|
+
const SidebarGroupContent = /*#__PURE__*/ (0, _react.forwardRef)(_c19 = ({ className, ...props }, ref)=>{
|
|
1512
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1513
|
+
ref: ref,
|
|
1514
|
+
className: (0, _utils.cn)('w-full text-sm', className),
|
|
1515
|
+
...props
|
|
1516
|
+
});
|
|
1517
|
+
});
|
|
1518
|
+
_c20 = SidebarGroupContent;
|
|
1519
|
+
SidebarGroupContent.displayName = 'SidebarGroupContent';
|
|
1520
|
+
const sidebarMenuButtonVariants = (0, _classVarianceAuthority.cva)('flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent focus-visible:text-sidebar-accent-foreground focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground', {
|
|
1521
|
+
variants: {
|
|
1522
|
+
variant: {
|
|
1523
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
1524
|
+
outline: 'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-ring))]'
|
|
1525
|
+
},
|
|
1526
|
+
size: {
|
|
1527
|
+
default: 'h-8 text-sm',
|
|
1528
|
+
sm: 'h-7 text-xs',
|
|
1529
|
+
lg: 'h-12 text-base'
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
defaultVariants: {
|
|
1533
|
+
variant: 'default',
|
|
1534
|
+
size: 'default'
|
|
1535
|
+
}
|
|
1536
|
+
});
|
|
1537
|
+
const SidebarMenuButton = /*#__PURE__*/ _s4((0, _react.forwardRef)(_c21 = _s4(({ className, variant, size, asChild = false, isActive, children, ...props }, ref)=>{
|
|
1538
|
+
_s4();
|
|
1539
|
+
const { isCollapsed } = useSidebar();
|
|
1540
|
+
const Comp = asChild ? (0, _reactSlot.Slot) : 'button';
|
|
1541
|
+
return (0, _jsxRuntime.jsx)(Comp, {
|
|
1542
|
+
ref: ref,
|
|
1543
|
+
"data-active": isActive,
|
|
1544
|
+
"data-collapsed": isCollapsed,
|
|
1545
|
+
className: (0, _utils.cn)(sidebarMenuButtonVariants({
|
|
1546
|
+
variant,
|
|
1547
|
+
size
|
|
1548
|
+
}), isCollapsed && 'justify-center', className),
|
|
1549
|
+
...props,
|
|
1550
|
+
children: children
|
|
1551
|
+
});
|
|
1552
|
+
}, "kpCbkCry4qXFIp34OhVPTLUoaro=", false, function() {
|
|
1553
|
+
return [
|
|
1554
|
+
useSidebar
|
|
1555
|
+
];
|
|
1556
|
+
})), "kpCbkCry4qXFIp34OhVPTLUoaro=", false, function() {
|
|
1557
|
+
return [
|
|
1558
|
+
useSidebar
|
|
1559
|
+
];
|
|
1560
|
+
});
|
|
1561
|
+
_c22 = SidebarMenuButton;
|
|
1562
|
+
SidebarMenuButton.displayName = 'SidebarMenuButton';
|
|
1563
|
+
const SidebarMenu = /*#__PURE__*/ (0, _react.forwardRef)(_c23 = ({ className, ...props }, ref)=>{
|
|
1564
|
+
return (0, _jsxRuntime.jsx)("ul", {
|
|
1565
|
+
ref: ref,
|
|
1566
|
+
className: (0, _utils.cn)('flex w-full min-w-0 flex-col gap-1', className),
|
|
1567
|
+
...props
|
|
1568
|
+
});
|
|
1569
|
+
});
|
|
1570
|
+
_c24 = SidebarMenu;
|
|
1571
|
+
SidebarMenu.displayName = 'SidebarMenu';
|
|
1572
|
+
const SidebarMenuItem = /*#__PURE__*/ (0, _react.forwardRef)(_c25 = ({ className, ...props }, ref)=>{
|
|
1573
|
+
return (0, _jsxRuntime.jsx)("li", {
|
|
1574
|
+
ref: ref,
|
|
1575
|
+
className: (0, _utils.cn)('group/menu-item relative', className),
|
|
1576
|
+
...props
|
|
1577
|
+
});
|
|
1578
|
+
});
|
|
1579
|
+
_c26 = SidebarMenuItem;
|
|
1580
|
+
SidebarMenuItem.displayName = 'SidebarMenuItem';
|
|
1581
|
+
const SidebarMenuAction = /*#__PURE__*/ (0, _react.forwardRef)(_c27 = ({ className, asChild = false, ...props }, ref)=>{
|
|
1582
|
+
const Comp = asChild ? (0, _reactSlot.Slot) : 'button';
|
|
1583
|
+
return (0, _jsxRuntime.jsx)(Comp, {
|
|
1584
|
+
ref: ref,
|
|
1585
|
+
className: (0, _utils.cn)('absolute right-2 top-1/2 flex -translate-y-1/2 items-center justify-center rounded-md p-1 text-sidebar-foreground opacity-0 transition-opacity group-hover/menu-item:opacity-100 group-focus/menu-item:opacity-100 [&:has(~:hover)]:opacity-100 [&:has(~:focus)]:opacity-100', className),
|
|
1586
|
+
...props
|
|
1587
|
+
});
|
|
1588
|
+
});
|
|
1589
|
+
_c28 = SidebarMenuAction;
|
|
1590
|
+
SidebarMenuAction.displayName = 'SidebarMenuAction';
|
|
1591
|
+
const SidebarMenuBadge = /*#__PURE__*/ (0, _react.forwardRef)(_c29 = ({ className, ...props }, ref)=>{
|
|
1592
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1593
|
+
ref: ref,
|
|
1594
|
+
className: (0, _utils.cn)('absolute right-2 top-1/2 flex -translate-y-1/2 items-center justify-center rounded-md px-1.5 py-0.5 text-xs font-medium tabular-nums text-sidebar-foreground', className),
|
|
1595
|
+
...props
|
|
1596
|
+
});
|
|
1597
|
+
});
|
|
1598
|
+
_c30 = SidebarMenuBadge;
|
|
1599
|
+
SidebarMenuBadge.displayName = 'SidebarMenuBadge';
|
|
1600
|
+
const SidebarMenuSkeleton = /*#__PURE__*/ (0, _react.forwardRef)(_c31 = ({ className, showIcon = false, ...props }, ref)=>{
|
|
1601
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
1602
|
+
ref: ref,
|
|
1603
|
+
className: (0, _utils.cn)('flex items-center gap-2 px-2 py-1.5', className),
|
|
1604
|
+
...props,
|
|
1605
|
+
children: [
|
|
1606
|
+
showIcon && (0, _jsxRuntime.jsx)("div", {
|
|
1607
|
+
className: "flex h-4 w-4 rounded-md bg-sidebar-primary/10"
|
|
1608
|
+
}),
|
|
1609
|
+
(0, _jsxRuntime.jsxs)("div", {
|
|
1610
|
+
className: "flex flex-1 flex-col gap-1.5",
|
|
1611
|
+
children: [
|
|
1612
|
+
(0, _jsxRuntime.jsx)("div", {
|
|
1613
|
+
className: "h-2.5 w-16 rounded-md bg-sidebar-primary/10"
|
|
1614
|
+
}),
|
|
1615
|
+
(0, _jsxRuntime.jsx)("div", {
|
|
1616
|
+
className: "h-2.5 w-24 rounded-md bg-sidebar-primary/10"
|
|
1617
|
+
})
|
|
1618
|
+
]
|
|
1619
|
+
})
|
|
1620
|
+
]
|
|
1621
|
+
});
|
|
1622
|
+
});
|
|
1623
|
+
_c32 = SidebarMenuSkeleton;
|
|
1624
|
+
SidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';
|
|
1625
|
+
const SidebarMenuSub = /*#__PURE__*/ (0, _react.forwardRef)(_c33 = ({ className, ...props }, ref)=>{
|
|
1626
|
+
return (0, _jsxRuntime.jsx)("ul", {
|
|
1627
|
+
ref: ref,
|
|
1628
|
+
className: (0, _utils.cn)('ml-4 mt-1 flex min-w-0 flex-col gap-0.5 border-l border-sidebar-border pl-2.5', className),
|
|
1629
|
+
...props
|
|
1630
|
+
});
|
|
1631
|
+
});
|
|
1632
|
+
_c34 = SidebarMenuSub;
|
|
1633
|
+
SidebarMenuSub.displayName = 'SidebarMenuSub';
|
|
1634
|
+
const SidebarMenuSubButton = /*#__PURE__*/ (0, _react.forwardRef)(_c35 = ({ className, asChild = false, size = 'md', isActive, ...props }, ref)=>{
|
|
1635
|
+
const Comp = asChild ? (0, _reactSlot.Slot) : 'a';
|
|
1636
|
+
return (0, _jsxRuntime.jsx)(Comp, {
|
|
1637
|
+
ref: ref,
|
|
1638
|
+
"data-size": size,
|
|
1639
|
+
"data-active": isActive,
|
|
1640
|
+
className: (0, _utils.cn)('flex min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md p-2 text-sidebar-foreground outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', size === 'lg' && 'text-base', className),
|
|
1641
|
+
...props
|
|
1642
|
+
});
|
|
1643
|
+
});
|
|
1644
|
+
_c36 = SidebarMenuSubButton;
|
|
1645
|
+
SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';
|
|
1646
|
+
const SidebarMenuSubItem = /*#__PURE__*/ (0, _react.forwardRef)(_c37 = ({ className, ...props }, ref)=>{
|
|
1647
|
+
return (0, _jsxRuntime.jsx)("li", {
|
|
1648
|
+
ref: ref,
|
|
1649
|
+
className: (0, _utils.cn)('group/menu-sub-item relative', className),
|
|
1650
|
+
...props
|
|
1651
|
+
});
|
|
1652
|
+
});
|
|
1653
|
+
_c38 = SidebarMenuSubItem;
|
|
1654
|
+
SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
|
|
1655
|
+
var _c, _c1, _c2, _c3, _c4, _c5, _c6, _c7, _c8, _c9, _c10, _c11, _c12, _c13, _c14, _c15, _c16, _c17, _c18, _c19, _c20, _c21, _c22, _c23, _c24, _c25, _c26, _c27, _c28, _c29, _c30, _c31, _c32, _c33, _c34, _c35, _c36, _c37, _c38;
|
|
1656
|
+
$RefreshReg$(_c, "SidebarProvider");
|
|
1657
|
+
$RefreshReg$(_c1, "Sidebar$forwardRef");
|
|
1658
|
+
$RefreshReg$(_c2, "Sidebar");
|
|
1659
|
+
$RefreshReg$(_c3, "PanelLeftOpenIcon");
|
|
1660
|
+
$RefreshReg$(_c4, "PanelLeftCloseIcon");
|
|
1661
|
+
$RefreshReg$(_c5, "SidebarTrigger$forwardRef");
|
|
1662
|
+
$RefreshReg$(_c6, "SidebarTrigger");
|
|
1663
|
+
$RefreshReg$(_c7, "SidebarHeader$forwardRef");
|
|
1664
|
+
$RefreshReg$(_c8, "SidebarHeader");
|
|
1665
|
+
$RefreshReg$(_c9, "SidebarContent$forwardRef");
|
|
1666
|
+
$RefreshReg$(_c10, "SidebarContent");
|
|
1667
|
+
$RefreshReg$(_c11, "SidebarFooter$forwardRef");
|
|
1668
|
+
$RefreshReg$(_c12, "SidebarFooter");
|
|
1669
|
+
$RefreshReg$(_c13, "SidebarGroup$forwardRef");
|
|
1670
|
+
$RefreshReg$(_c14, "SidebarGroup");
|
|
1671
|
+
$RefreshReg$(_c15, "SidebarGroupLabel$forwardRef");
|
|
1672
|
+
$RefreshReg$(_c16, "SidebarGroupLabel");
|
|
1673
|
+
$RefreshReg$(_c17, "SidebarGroupAction$forwardRef");
|
|
1674
|
+
$RefreshReg$(_c18, "SidebarGroupAction");
|
|
1675
|
+
$RefreshReg$(_c19, "SidebarGroupContent$forwardRef");
|
|
1676
|
+
$RefreshReg$(_c20, "SidebarGroupContent");
|
|
1677
|
+
$RefreshReg$(_c21, "SidebarMenuButton$forwardRef");
|
|
1678
|
+
$RefreshReg$(_c22, "SidebarMenuButton");
|
|
1679
|
+
$RefreshReg$(_c23, "SidebarMenu$forwardRef");
|
|
1680
|
+
$RefreshReg$(_c24, "SidebarMenu");
|
|
1681
|
+
$RefreshReg$(_c25, "SidebarMenuItem$forwardRef");
|
|
1682
|
+
$RefreshReg$(_c26, "SidebarMenuItem");
|
|
1683
|
+
$RefreshReg$(_c27, "SidebarMenuAction$forwardRef");
|
|
1684
|
+
$RefreshReg$(_c28, "SidebarMenuAction");
|
|
1685
|
+
$RefreshReg$(_c29, "SidebarMenuBadge$forwardRef");
|
|
1686
|
+
$RefreshReg$(_c30, "SidebarMenuBadge");
|
|
1687
|
+
$RefreshReg$(_c31, "SidebarMenuSkeleton$forwardRef");
|
|
1688
|
+
$RefreshReg$(_c32, "SidebarMenuSkeleton");
|
|
1689
|
+
$RefreshReg$(_c33, "SidebarMenuSub$forwardRef");
|
|
1690
|
+
$RefreshReg$(_c34, "SidebarMenuSub");
|
|
1691
|
+
$RefreshReg$(_c35, "SidebarMenuSubButton$forwardRef");
|
|
1692
|
+
$RefreshReg$(_c36, "SidebarMenuSubButton");
|
|
1693
|
+
$RefreshReg$(_c37, "SidebarMenuSubItem$forwardRef");
|
|
1694
|
+
$RefreshReg$(_c38, "SidebarMenuSubItem");
|
|
1695
|
+
|
|
1696
|
+
$parcel$ReactRefreshHelpers$e68c.postlude(module);
|
|
1697
|
+
} finally {
|
|
1698
|
+
globalThis.$RefreshReg$ = prevRefreshReg;
|
|
1699
|
+
globalThis.$RefreshSig$ = prevRefreshSig;
|
|
1700
|
+
}
|
|
1701
|
+
},{"react/jsx-runtime":"05iiF","react":"jMk1U","@radix-ui/react-slot":"5D3Xb","class-variance-authority":"3GTG2","@/lib/utils":"58RPa","@/lib/z-index":"eChN4","@parcel/transformer-js/src/esmodule-helpers.js":"jnFvT","@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js":"7h6Pi"}],"iJhlx":[function(require,module,exports,__globalThis) {
|
|
1702
|
+
var $parcel$ReactRefreshHelpers$9dc4 = require("@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js");
|
|
1703
|
+
$parcel$ReactRefreshHelpers$9dc4.init();
|
|
1704
|
+
var prevRefreshReg = globalThis.$RefreshReg$;
|
|
1705
|
+
var prevRefreshSig = globalThis.$RefreshSig$;
|
|
1706
|
+
$parcel$ReactRefreshHelpers$9dc4.prelude(module);
|
|
1707
|
+
|
|
1708
|
+
try {
|
|
1709
|
+
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
|
1710
|
+
parcelHelpers.defineInteropFlag(exports);
|
|
1711
|
+
parcelHelpers.export(exports, "ContentView", ()=>ContentView);
|
|
1712
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
1713
|
+
var _sdk = require("@shellui/sdk");
|
|
1714
|
+
var _react = require("react");
|
|
1715
|
+
var _reactRouter = require("react-router");
|
|
1716
|
+
var _loadingOverlay = require("./LoadingOverlay");
|
|
1717
|
+
var _s = $RefreshSig$();
|
|
1718
|
+
const logger = (0, _sdk.getLogger)('shellcore');
|
|
1719
|
+
const ContentView = ({ url, pathPrefix, ignoreMessages = false, navItem })=>{
|
|
1720
|
+
_s();
|
|
1721
|
+
const navigate = (0, _reactRouter.useNavigate)();
|
|
1722
|
+
const iframeRef = (0, _react.useRef)(null);
|
|
1723
|
+
const isInternalNavigation = (0, _react.useRef)(false);
|
|
1724
|
+
const [initialUrl] = (0, _react.useState)(url);
|
|
1725
|
+
const [isLoading, setIsLoading] = (0, _react.useState)(true);
|
|
1726
|
+
(0, _react.useEffect)(()=>{
|
|
1727
|
+
if (!iframeRef.current) return;
|
|
1728
|
+
const iframeId = (0, _sdk.addIframe)(iframeRef.current);
|
|
1729
|
+
return ()=>{
|
|
1730
|
+
(0, _sdk.removeIframe)(iframeId);
|
|
1731
|
+
};
|
|
1732
|
+
}, []);
|
|
1733
|
+
// Sync parent URL when iframe notifies us of a change
|
|
1734
|
+
(0, _react.useEffect)(()=>{
|
|
1735
|
+
const cleanup = (0, _sdk.shellui).addMessageListener('SHELLUI_URL_CHANGED', (data, event)=>{
|
|
1736
|
+
if (ignoreMessages) return;
|
|
1737
|
+
// Ignore URL CHANGE from other than ContentView iframe
|
|
1738
|
+
if (event.source !== iframeRef.current?.contentWindow) return;
|
|
1739
|
+
const { pathname, search, hash } = data.payload;
|
|
1740
|
+
// Remove leading slash and trailing slashes from iframe pathname
|
|
1741
|
+
let cleanPathname = pathname.startsWith(navItem.url) ? pathname.slice(navItem.url.length) : pathname;
|
|
1742
|
+
cleanPathname = cleanPathname.startsWith('/') ? cleanPathname.slice(1) : cleanPathname;
|
|
1743
|
+
cleanPathname = cleanPathname.replace(/\/+$/, ''); // Remove trailing slashes
|
|
1744
|
+
// Construct the new path without trailing slashes
|
|
1745
|
+
let newShellPath = cleanPathname ? `/${pathPrefix}/${cleanPathname}${search}${hash}` : `/${pathPrefix}${search}${hash}`;
|
|
1746
|
+
// Normalize: remove trailing slashes from pathname part only (preserve query/hash)
|
|
1747
|
+
const urlParts = newShellPath.match(/^([^?#]*)([?#].*)?$/);
|
|
1748
|
+
if (urlParts) {
|
|
1749
|
+
const pathnamePart = urlParts[1].replace(/\/+$/, '') || '/';
|
|
1750
|
+
const queryHashPart = urlParts[2] || '';
|
|
1751
|
+
newShellPath = pathnamePart + queryHashPart;
|
|
1752
|
+
}
|
|
1753
|
+
// Normalize current path for comparison (remove trailing slashes from pathname)
|
|
1754
|
+
const currentPathname = window.location.pathname.replace(/\/+$/, '') || '/';
|
|
1755
|
+
const currentPath = currentPathname + window.location.search + window.location.hash;
|
|
1756
|
+
// Normalize new path for comparison
|
|
1757
|
+
const newPathParts = newShellPath.match(/^([^?#]*)([?#].*)?$/);
|
|
1758
|
+
const normalizedNewPathname = newPathParts?.[1]?.replace(/\/+$/, '') || '/';
|
|
1759
|
+
const normalizedNewPath = normalizedNewPathname + (newPathParts?.[2] || '');
|
|
1760
|
+
if (currentPath !== normalizedNewPath) {
|
|
1761
|
+
// Mark this navigation as internal so we don't try to "push" it back to the iframe
|
|
1762
|
+
isInternalNavigation.current = true;
|
|
1763
|
+
navigate(newShellPath, {
|
|
1764
|
+
replace: true
|
|
1765
|
+
});
|
|
1766
|
+
// Reset the flag after a short delay to allow the render cycle to complete
|
|
1767
|
+
setTimeout(()=>{
|
|
1768
|
+
isInternalNavigation.current = false;
|
|
1769
|
+
}, 100);
|
|
1770
|
+
}
|
|
1771
|
+
});
|
|
1772
|
+
return ()=>{
|
|
1773
|
+
cleanup();
|
|
1774
|
+
};
|
|
1775
|
+
}, [
|
|
1776
|
+
pathPrefix,
|
|
1777
|
+
navigate
|
|
1778
|
+
]);
|
|
1779
|
+
// Hide loading overlay when iframe sends SHELLUI_INITIALIZED
|
|
1780
|
+
(0, _react.useEffect)(()=>{
|
|
1781
|
+
const cleanup = (0, _sdk.shellui).addMessageListener('SHELLUI_INITIALIZED', (_data, event)=>{
|
|
1782
|
+
if (event.source === iframeRef.current?.contentWindow) setIsLoading(false);
|
|
1783
|
+
});
|
|
1784
|
+
return ()=>cleanup();
|
|
1785
|
+
}, []);
|
|
1786
|
+
// Fallback: hide overlay after 400ms if SHELLUI_INITIALIZED was not received
|
|
1787
|
+
(0, _react.useEffect)(()=>{
|
|
1788
|
+
if (!isLoading) return;
|
|
1789
|
+
const timeoutId = setTimeout(()=>{
|
|
1790
|
+
logger.info('ContentView: Timeout expired, hiding loading overlay');
|
|
1791
|
+
setIsLoading(false);
|
|
1792
|
+
}, 400);
|
|
1793
|
+
return ()=>clearTimeout(timeoutId);
|
|
1794
|
+
}, [
|
|
1795
|
+
isLoading
|
|
1796
|
+
]);
|
|
1797
|
+
// Handle external URL changes (e.g. from Sidebar)
|
|
1798
|
+
(0, _react.useEffect)(()=>{
|
|
1799
|
+
if (iframeRef.current && !isInternalNavigation.current) // Only update iframe src if it's actually different from its current src
|
|
1800
|
+
// to avoid unnecessary reloads
|
|
1801
|
+
{
|
|
1802
|
+
if (iframeRef.current.src !== url) {
|
|
1803
|
+
iframeRef.current.src = url;
|
|
1804
|
+
setIsLoading(true);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
}, [
|
|
1808
|
+
url
|
|
1809
|
+
]);
|
|
1810
|
+
// Inject script to prevent "Layout was forced" warning by deferring layout until stylesheets load
|
|
1811
|
+
(0, _react.useEffect)(()=>{
|
|
1812
|
+
const iframe = iframeRef.current;
|
|
1813
|
+
if (!iframe) return;
|
|
1814
|
+
const handleLoad = ()=>{
|
|
1815
|
+
try {
|
|
1816
|
+
const iframeWindow = iframe.contentWindow;
|
|
1817
|
+
const iframeDoc = iframe.contentDocument || iframeWindow?.document;
|
|
1818
|
+
if (!iframeDoc || !iframeWindow) return;
|
|
1819
|
+
// Inject a script that waits for stylesheets before allowing layout calculations
|
|
1820
|
+
const script = iframeDoc.createElement('script');
|
|
1821
|
+
script.textContent = `
|
|
1822
|
+
(function() {
|
|
1823
|
+
// Wait for all stylesheets to load
|
|
1824
|
+
function waitForStylesheets() {
|
|
1825
|
+
const styleSheets = Array.from(document.styleSheets);
|
|
1826
|
+
const pendingSheets = styleSheets.filter(function(sheet) {
|
|
1827
|
+
try {
|
|
1828
|
+
return sheet.cssRules === null;
|
|
1829
|
+
} catch (e) {
|
|
1830
|
+
return false; // Cross-origin stylesheets, assume loaded
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
|
|
1834
|
+
if (pendingSheets.length === 0) {
|
|
1835
|
+
// All stylesheets loaded
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
// Check again after a short delay
|
|
1840
|
+
setTimeout(waitForStylesheets, 10);
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
// Start checking after DOM is ready
|
|
1844
|
+
if (document.readyState === 'complete') {
|
|
1845
|
+
waitForStylesheets();
|
|
1846
|
+
} else {
|
|
1847
|
+
window.addEventListener('load', waitForStylesheets);
|
|
1848
|
+
}
|
|
1849
|
+
})();
|
|
1850
|
+
`;
|
|
1851
|
+
iframeDoc.head.appendChild(script);
|
|
1852
|
+
} catch (error) {
|
|
1853
|
+
// Cross-origin or other errors - ignore (this is expected for some iframes)
|
|
1854
|
+
logger.debug('Could not inject stylesheet wait script:', {
|
|
1855
|
+
error
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
};
|
|
1859
|
+
// Wait for iframe to load before injecting script
|
|
1860
|
+
iframe.addEventListener('load', handleLoad);
|
|
1861
|
+
// Also try immediately if already loaded
|
|
1862
|
+
if (iframe.contentDocument?.readyState === 'complete') handleLoad();
|
|
1863
|
+
return ()=>{
|
|
1864
|
+
iframe.removeEventListener('load', handleLoad);
|
|
1865
|
+
};
|
|
1866
|
+
}, [
|
|
1867
|
+
initialUrl
|
|
1868
|
+
]);
|
|
1869
|
+
// Suppress browser warnings that are expected and acceptable
|
|
1870
|
+
(0, _react.useEffect)(()=>{
|
|
1871
|
+
{
|
|
1872
|
+
const originalWarn = console.warn;
|
|
1873
|
+
console.warn = (...args)=>{
|
|
1874
|
+
const message = String(args[0] ?? '');
|
|
1875
|
+
// Suppress the specific sandbox warning
|
|
1876
|
+
if (message.includes('allow-scripts') && message.includes('allow-same-origin') && message.includes('sandbox')) return;
|
|
1877
|
+
// Suppress "Layout was forced" warning from iframe content
|
|
1878
|
+
// This is a performance warning that occurs when iframe content calculates layout before stylesheets load
|
|
1879
|
+
// It's harmless and common in iframe scenarios, especially with React apps
|
|
1880
|
+
if (message.includes('Layout was forced') && message.includes('before the page was fully loaded')) return;
|
|
1881
|
+
originalWarn.apply(console, args);
|
|
1882
|
+
};
|
|
1883
|
+
return ()=>{
|
|
1884
|
+
console.warn = originalWarn;
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
}, []);
|
|
1888
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
1889
|
+
style: {
|
|
1890
|
+
width: '100%',
|
|
1891
|
+
height: '100%',
|
|
1892
|
+
display: 'flex',
|
|
1893
|
+
position: 'relative'
|
|
1894
|
+
},
|
|
1895
|
+
children: [
|
|
1896
|
+
(0, _jsxRuntime.jsx)("iframe", {
|
|
1897
|
+
ref: iframeRef,
|
|
1898
|
+
src: initialUrl,
|
|
1899
|
+
style: {
|
|
1900
|
+
width: '100%',
|
|
1901
|
+
height: '100%',
|
|
1902
|
+
border: 'none',
|
|
1903
|
+
display: 'block'
|
|
1904
|
+
},
|
|
1905
|
+
title: "Content Frame",
|
|
1906
|
+
sandbox: "allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox",
|
|
1907
|
+
referrerPolicy: "no-referrer-when-downgrade"
|
|
1908
|
+
}),
|
|
1909
|
+
isLoading && (0, _jsxRuntime.jsx)((0, _loadingOverlay.LoadingOverlay), {})
|
|
1910
|
+
]
|
|
1911
|
+
});
|
|
1912
|
+
};
|
|
1913
|
+
_s(ContentView, "zBmwSNmwfZ2d1yaxlldrzHZdD2E=", false, function() {
|
|
1914
|
+
return [
|
|
1915
|
+
(0, _reactRouter.useNavigate)
|
|
1916
|
+
];
|
|
1917
|
+
});
|
|
1918
|
+
_c = ContentView;
|
|
1919
|
+
var _c;
|
|
1920
|
+
$RefreshReg$(_c, "ContentView");
|
|
1921
|
+
|
|
1922
|
+
$parcel$ReactRefreshHelpers$9dc4.postlude(module);
|
|
1923
|
+
} finally {
|
|
1924
|
+
globalThis.$RefreshReg$ = prevRefreshReg;
|
|
1925
|
+
globalThis.$RefreshSig$ = prevRefreshSig;
|
|
1926
|
+
}
|
|
1927
|
+
},{"react/jsx-runtime":"05iiF","@shellui/sdk":"dS2fb","react":"jMk1U","react-router":"kWH5w","./LoadingOverlay":"1kyE0","@parcel/transformer-js/src/esmodule-helpers.js":"jnFvT","@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js":"7h6Pi"}],"1kyE0":[function(require,module,exports,__globalThis) {
|
|
1928
|
+
var $parcel$ReactRefreshHelpers$681a = require("@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js");
|
|
1929
|
+
$parcel$ReactRefreshHelpers$681a.init();
|
|
1930
|
+
var prevRefreshReg = globalThis.$RefreshReg$;
|
|
1931
|
+
var prevRefreshSig = globalThis.$RefreshSig$;
|
|
1932
|
+
$parcel$ReactRefreshHelpers$681a.prelude(module);
|
|
1933
|
+
|
|
1934
|
+
try {
|
|
1935
|
+
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
|
1936
|
+
parcelHelpers.defineInteropFlag(exports);
|
|
1937
|
+
parcelHelpers.export(exports, "LoadingOverlay", ()=>LoadingOverlay);
|
|
1938
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
1939
|
+
function LoadingOverlay() {
|
|
1940
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
1941
|
+
className: "absolute inset-0 z-10 flex flex-col bg-background",
|
|
1942
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1943
|
+
className: "h-1 w-full overflow-hidden bg-muted/30",
|
|
1944
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
1945
|
+
className: "h-full w-0 bg-muted-foreground/50",
|
|
1946
|
+
style: {
|
|
1947
|
+
animation: 'loading-bar-slide 400ms linear infinite'
|
|
1948
|
+
}
|
|
1949
|
+
})
|
|
1950
|
+
})
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
_c = LoadingOverlay;
|
|
1954
|
+
var _c;
|
|
1955
|
+
$RefreshReg$(_c, "LoadingOverlay");
|
|
1956
|
+
|
|
1957
|
+
$parcel$ReactRefreshHelpers$681a.postlude(module);
|
|
1958
|
+
} finally {
|
|
1959
|
+
globalThis.$RefreshReg$ = prevRefreshReg;
|
|
1960
|
+
globalThis.$RefreshSig$ = prevRefreshSig;
|
|
1961
|
+
}
|
|
1962
|
+
},{"react/jsx-runtime":"05iiF","@parcel/transformer-js/src/esmodule-helpers.js":"jnFvT","@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js":"7h6Pi"}]},["gR7Jy"], null, "parcelRequire6cf0", {})
|
|
1963
|
+
|
|
1964
|
+
//# sourceMappingURL=DefaultLayout.045a82ff.js.map
|