@book.dev/ui 1.60.0 → 1.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EmojiGrid-xK5mPJPo.js → EmojiGrid-BjFEmkhL.js} +75 -84
- package/dist/blockeditor/BlockEditor.d.ts +16 -0
- package/dist/blockeditor/EmojiMenu.d.ts +17 -0
- package/dist/blockeditor/__tests__/EmojiMenu.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/readOnly.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/titleHandoff.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/triggerMenus.test.d.ts +1 -0
- package/dist/blockeditor/kit/KitFrame.d.ts +5 -0
- package/dist/blockeditor/kit/groupSync.d.ts +10 -1
- package/dist/blockeditor/kit/lock.d.ts +14 -0
- package/dist/components/LastEditedBy.d.ts +11 -0
- package/dist/components/OnboardingNudge.d.ts +11 -0
- package/dist/components/ShareDialog.d.ts +25 -0
- package/dist/components/__tests__/lastEditedBy.test.d.ts +1 -0
- package/dist/components/__tests__/membersSettings.test.d.ts +1 -0
- package/dist/components/__tests__/sharingSettings.test.d.ts +1 -0
- package/dist/components/settings/AccountSettings.d.ts +4 -0
- package/dist/components/settings/AccountSwitcher.d.ts +12 -0
- package/dist/components/settings/MembersSettings.d.ts +1 -0
- package/dist/components/settings/SharingSettings.d.ts +9 -0
- package/dist/emoji-Bmft6RPl.js +11 -0
- package/dist/{format-CLQoRoYP.js → format-BXeG5xQH.js} +61 -61
- package/dist/i18n/messages/en.d.ts +169 -0
- package/dist/index.js +7328 -6057
- package/dist/lib/__tests__/useCanWrite.test.d.ts +1 -0
- package/dist/lib/hud.d.ts +2 -2
- package/dist/lib/sidebarStyles.d.ts +7 -0
- package/dist/lib/useCanWrite.d.ts +45 -0
- package/dist/{lucideIcons-B6pmC-WQ.js → lucideIcons-DvomlmkS.js} +2093 -1180
- package/dist/providers/AccountProvider.d.ts +47 -7
- package/dist/providers/ForwardingProvider.d.ts +19 -0
- package/dist/providers/PlatformLibraryProvider.d.ts +20 -0
- package/dist/providers/PreferencesProvider.d.ts +8 -1
- package/dist/providers/WorkspaceProvider.d.ts +4 -2
- package/dist/providers/__tests__/AccountProvider.test.d.ts +1 -0
- package/dist/providers/__tests__/forwardingAudience.test.d.ts +9 -0
- package/dist/providers/forwardingAudience.d.ts +165 -0
- package/dist/screens/pageChrome.d.ts +11 -0
- package/dist/style.css +1 -1
- package/dist/{toHtml-BoPr8Ce4.js → toHtml-B6gQeUnu.js} +2 -2
- package/package.json +7 -2
|
@@ -5,22 +5,22 @@ import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
|
5
5
|
import { clsx as h } from "clsx";
|
|
6
6
|
import { twMerge as g } from "tailwind-merge";
|
|
7
7
|
import { Cross2Icon as _ } from "@radix-ui/react-icons";
|
|
8
|
-
import { AccountClient as
|
|
9
|
-
import * as
|
|
10
|
-
import { Slot as
|
|
11
|
-
import { cva as
|
|
12
|
-
import { useImmer as
|
|
13
|
-
import { Activity as
|
|
8
|
+
import { AccountClient as ee, AccountError as v, ForwardingClient as te, decodeIdentity as ne, defaultDatabaseSchema as y, emptyPageSnapshot as b, getForwardingAudience as re, getServerUrlOverride as x, resolveAccountUrl as S, setForwardingAudience as C, setGuestName as w, setIdentityToken as T, setServerUrlOverride as E } from "@book.dev/sdk";
|
|
9
|
+
import * as D from "@radix-ui/react-dialog";
|
|
10
|
+
import { Slot as O } from "@radix-ui/react-slot";
|
|
11
|
+
import { cva as k } from "class-variance-authority";
|
|
12
|
+
import { useImmer as A } from "use-immer";
|
|
13
|
+
import { Activity as j, AlarmClock as M, AlertTriangle as N, Anchor as P, Aperture as F, Archive as I, Award as L, Backpack as R, BarChart3 as ie, Battery as z, Beaker as B, Bell as V, Bike as ae, Binary as oe, Bird as H, Book as se, BookOpen as U, Bookmark as W, Box as G, Brain as K, Briefcase as ce, Brush as le, Bug as ue, Building2 as de, Bus as fe, Cake as pe, Calculator as me, Calendar as he, Camera as ge, Car as _e, Carrot as ve, Check as ye, CheckCircle2 as be, ChefHat as xe, Cherry as Se, Circle as Ce, Clapperboard as we, Clipboard as Te, Clock as Ee, Cloud as De, Code2 as Oe, Coffee as ke, Cog as Ae, Coins as je, Compass as Me, Cpu as Ne, CreditCard as Pe, Crown as Fe, Database as Ie, Diamond as Le, Dog as Re, DollarSign as ze, Download as Be, Droplet as Ve, Dumbbell as He, Egg as Ue, Eye as We, Feather as Ge, FileText as Ke, Film as qe, Filter as Je, Flag as Ye, Flame as Xe, FlaskConical as Ze, Flower2 as Qe, Folder as $e, Footprints as et, Gamepad2 as tt, Gauge as nt, Gem as rt, Gift as it, GitBranch as at, Globe as ot, GraduationCap as st, Grid3x3 as ct, Hammer as lt, Hand as ut, Hash as dt, Headphones as ft, Heart as pt, HelpCircle as mt, Home as ht, Image as gt, Inbox as _t, Infinity as vt, Info as yt, Key as bt, Keyboard as xt, Lamp as St, Laptop as Ct, Layers as wt, Layout as Tt, Leaf as Et, Library as Dt, Lightbulb as Ot, Link as kt, List as At, Lock as jt, Mail as Mt, Map as Nt, MapPin as Pt, Megaphone as Ft, MessageCircle as It, MessageSquare as Lt, Mic as Rt, Monitor as zt, Moon as Bt, Mountain as Vt, Mouse as Ht, Music as Ut, Navigation as Wt, Newspaper as Gt, Package as Kt, Palette as qt, PanelLeft as Jt, Paperclip as Yt, PartyPopper as Xt, PenTool as Zt, Pencil as Qt, Phone as $t, PieChart as en, PiggyBank as tn, Pin as nn, Plane as rn, Play as an, Plug as on, Plus as sn, Puzzle as cn, Rabbit as ln, Radio as un, Rocket as dn, Ruler as fn, Save as pn, Scale as mn, Scissors as hn, Search as gn, Send as _n, Settings as vn, Share2 as yn, Shield as bn, ShoppingBag as xn, ShoppingCart as Sn, Smile as Cn, Snowflake as wn, Sparkles as Tn, Speaker as En, Sprout as Dn, Star as On, Sticker as kn, Sun as An, Sword as jn, Table as Mn, Tag as Nn, Target as Pn, Tent as Fn, Terminal as In, ThumbsUp as Ln, Ticket as Rn, Timer as zn, ToggleLeft as Bn, Trash2 as Vn, TreePine as Hn, TrendingUp as Un, Trophy as Wn, Truck as Gn, Tv as Kn, Umbrella as qn, User as Jn, Users as Yn, Utensils as Xn, Video as Zn, Wallet as Qn, Wand2 as $n, Watch as er, Waves as tr, Wifi as nr, Wind as rr, Wrench as ir, Zap as ar } from "lucide-react";
|
|
14
14
|
//#region src/lib/utils.ts
|
|
15
|
-
function
|
|
15
|
+
function q(...e) {
|
|
16
16
|
return g(h(e));
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/providers/PlatformLibraryProvider.tsx
|
|
20
|
-
var
|
|
20
|
+
var or = o({}), sr = () => c(or), cr = ({ value: e = {}, children: t }) => /* @__PURE__ */ p(or.Provider, {
|
|
21
21
|
value: e,
|
|
22
22
|
children: t
|
|
23
|
-
}),
|
|
23
|
+
}), J = {
|
|
24
24
|
profile: {
|
|
25
25
|
name: "",
|
|
26
26
|
displayName: "",
|
|
@@ -33,72 +33,80 @@ var sr = o({}), cr = () => c(sr), lr = ({ value: e = {}, children: t }) => /* @_
|
|
|
33
33
|
spellcheck: !0
|
|
34
34
|
},
|
|
35
35
|
features: {}
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
|
+
function lr(e, t) {
|
|
38
|
+
return {
|
|
39
|
+
profile: {
|
|
40
|
+
...e.profile,
|
|
41
|
+
...t.profile
|
|
42
|
+
},
|
|
43
|
+
general: {
|
|
44
|
+
...e.general,
|
|
45
|
+
...t.general
|
|
46
|
+
},
|
|
47
|
+
features: {
|
|
48
|
+
...e.features,
|
|
49
|
+
...t.features
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var ur = o(null), dr = "openbook.preferences";
|
|
37
54
|
function fr(e) {
|
|
38
55
|
return {
|
|
39
56
|
profile: {
|
|
40
|
-
...
|
|
57
|
+
...J.profile,
|
|
41
58
|
...e?.profile
|
|
42
59
|
},
|
|
43
60
|
general: {
|
|
44
|
-
...
|
|
61
|
+
...J.general,
|
|
45
62
|
...e?.general
|
|
46
63
|
},
|
|
47
64
|
features: {
|
|
48
|
-
...
|
|
65
|
+
...J.features,
|
|
49
66
|
...e?.features
|
|
50
67
|
}
|
|
51
68
|
};
|
|
52
69
|
}
|
|
53
70
|
function pr() {
|
|
54
|
-
if (typeof window > "u") return
|
|
71
|
+
if (typeof window > "u") return J;
|
|
55
72
|
try {
|
|
56
73
|
let e = localStorage.getItem(dr);
|
|
57
|
-
return e ? fr(JSON.parse(e)) :
|
|
74
|
+
return e ? fr(JSON.parse(e)) : J;
|
|
58
75
|
} catch {
|
|
59
|
-
return
|
|
76
|
+
return J;
|
|
60
77
|
}
|
|
61
78
|
}
|
|
62
79
|
var mr = ({ children: e }) => {
|
|
63
|
-
let [t, n] = f(
|
|
80
|
+
let [t, n] = f(J);
|
|
64
81
|
l(() => {
|
|
65
82
|
let e = pr();
|
|
66
|
-
e !==
|
|
83
|
+
e !== J && n(e);
|
|
67
84
|
}, []);
|
|
68
|
-
let r =
|
|
85
|
+
let r = t.profile.displayName || t.profile.name;
|
|
86
|
+
l(() => {
|
|
87
|
+
w(r);
|
|
88
|
+
}, [r]);
|
|
89
|
+
let i = s((e) => {
|
|
69
90
|
n((t) => {
|
|
70
|
-
let n =
|
|
71
|
-
profile: {
|
|
72
|
-
...t.profile,
|
|
73
|
-
...e.profile
|
|
74
|
-
},
|
|
75
|
-
general: {
|
|
76
|
-
...t.general,
|
|
77
|
-
...e.general
|
|
78
|
-
},
|
|
79
|
-
features: {
|
|
80
|
-
...t.features,
|
|
81
|
-
...e.features
|
|
82
|
-
}
|
|
83
|
-
};
|
|
91
|
+
let n = lr(t, e);
|
|
84
92
|
try {
|
|
85
93
|
localStorage.setItem(dr, JSON.stringify(n));
|
|
86
94
|
} catch {}
|
|
87
95
|
return n;
|
|
88
96
|
});
|
|
89
|
-
}, []),
|
|
97
|
+
}, []), a = u(() => ({
|
|
90
98
|
preferences: t,
|
|
91
|
-
update:
|
|
92
|
-
}), [t,
|
|
99
|
+
update: i
|
|
100
|
+
}), [t, i]);
|
|
93
101
|
return /* @__PURE__ */ p(ur.Provider, {
|
|
94
|
-
value:
|
|
102
|
+
value: a,
|
|
95
103
|
children: e
|
|
96
104
|
});
|
|
97
105
|
}, hr = () => {
|
|
98
106
|
let e = c(ur);
|
|
99
107
|
if (!e) throw Error("usePreferences must be used within a <PreferencesProvider>");
|
|
100
108
|
return e;
|
|
101
|
-
}, gr = "openbook.workspaces",
|
|
109
|
+
}, gr = "openbook.workspaces", Y = {
|
|
102
110
|
id: "local",
|
|
103
111
|
icon: "🏡",
|
|
104
112
|
name: "My Workspace",
|
|
@@ -111,13 +119,13 @@ var mr = ({ children: e }) => {
|
|
|
111
119
|
return e;
|
|
112
120
|
}
|
|
113
121
|
}, br = () => {
|
|
114
|
-
if (typeof localStorage > "u") return [
|
|
115
|
-
let e = [
|
|
122
|
+
if (typeof localStorage > "u") return [Y];
|
|
123
|
+
let e = [Y];
|
|
116
124
|
try {
|
|
117
125
|
let t = localStorage.getItem(gr), n = t ? JSON.parse(t) : null;
|
|
118
126
|
Array.isArray(n) && n.length > 0 && (e = n);
|
|
119
127
|
} catch {}
|
|
120
|
-
e.some((e) => e.serverUrl === null) || (e = [
|
|
128
|
+
e.some((e) => e.serverUrl === null) || (e = [Y, ...e]);
|
|
121
129
|
let t = x();
|
|
122
130
|
return t && !e.some((e) => _r(e.serverUrl, t)) && (e = [...e, {
|
|
123
131
|
id: vr(),
|
|
@@ -125,12 +133,12 @@ var mr = ({ children: e }) => {
|
|
|
125
133
|
name: yr(t),
|
|
126
134
|
serverUrl: t
|
|
127
135
|
}]), e;
|
|
128
|
-
}, W = (e) => {
|
|
129
|
-
typeof localStorage > "u" || localStorage.setItem(gr, JSON.stringify(e));
|
|
130
136
|
}, xr = (e) => {
|
|
137
|
+
typeof localStorage > "u" || localStorage.setItem(gr, JSON.stringify(e));
|
|
138
|
+
}, Sr = (e) => {
|
|
131
139
|
let t = x();
|
|
132
140
|
return (e.find((e) => _r(e.serverUrl, t)) ?? e[0]).id;
|
|
133
|
-
},
|
|
141
|
+
}, Cr = (e) => {
|
|
134
142
|
if (e === null) return !0;
|
|
135
143
|
if (typeof e != "string") return !1;
|
|
136
144
|
try {
|
|
@@ -139,28 +147,28 @@ var mr = ({ children: e }) => {
|
|
|
139
147
|
} catch {
|
|
140
148
|
return !1;
|
|
141
149
|
}
|
|
142
|
-
},
|
|
143
|
-
workspaces: [
|
|
144
|
-
workspace:
|
|
150
|
+
}, wr = (e) => !!e && typeof e == "object" && typeof e.id == "string" && typeof e.name == "string" && Cr(e.serverUrl), Tr = o({
|
|
151
|
+
workspaces: [Y],
|
|
152
|
+
workspace: Y,
|
|
145
153
|
selectWorkspace: () => void 0,
|
|
146
|
-
addWorkspace: () =>
|
|
154
|
+
addWorkspace: () => Y,
|
|
147
155
|
removeWorkspace: () => void 0,
|
|
148
156
|
updateWorkspace: () => void 0,
|
|
149
|
-
replaceWorkspaces: () =>
|
|
150
|
-
}),
|
|
151
|
-
let [t, n] = f([
|
|
157
|
+
replaceWorkspaces: () => []
|
|
158
|
+
}), Er = () => c(Tr), Dr = ({ children: e }) => {
|
|
159
|
+
let [t, n] = f([Y]), [r, i] = f(Y.id);
|
|
152
160
|
l(() => {
|
|
153
161
|
let e = br();
|
|
154
|
-
n(e), i(
|
|
162
|
+
n(e), i(Sr(e)), xr(e);
|
|
155
163
|
}, []);
|
|
156
|
-
let a = u(() => t.find((e) => e.id === r) ?? t[0] ??
|
|
164
|
+
let a = u(() => t.find((e) => e.id === r) ?? t[0] ?? Y, [t, r]), o = s((e) => {
|
|
157
165
|
let n = t.find((t) => t.id === e);
|
|
158
166
|
if (n) {
|
|
159
167
|
if (_r(n.serverUrl, x())) {
|
|
160
168
|
i(e);
|
|
161
169
|
return;
|
|
162
170
|
}
|
|
163
|
-
|
|
171
|
+
E(n.serverUrl), typeof window < "u" && window.location.reload();
|
|
164
172
|
}
|
|
165
173
|
}, [t]), c = s((e) => {
|
|
166
174
|
let t = e.serverUrl?.trim(), r = {
|
|
@@ -171,13 +179,13 @@ var mr = ({ children: e }) => {
|
|
|
171
179
|
};
|
|
172
180
|
return n((e) => {
|
|
173
181
|
let t = [...e, r];
|
|
174
|
-
return
|
|
182
|
+
return xr(t), t;
|
|
175
183
|
}), r;
|
|
176
184
|
}, []), d = s((e) => {
|
|
177
185
|
n((t) => {
|
|
178
186
|
if (t.length <= 1 || e === r) return t;
|
|
179
187
|
let n = t.filter((t) => t.id !== e);
|
|
180
|
-
return
|
|
188
|
+
return xr(n), n;
|
|
181
189
|
});
|
|
182
190
|
}, [r]), m = s((e, t) => {
|
|
183
191
|
n((n) => {
|
|
@@ -185,18 +193,18 @@ var mr = ({ children: e }) => {
|
|
|
185
193
|
...n,
|
|
186
194
|
...t
|
|
187
195
|
} : n);
|
|
188
|
-
return
|
|
196
|
+
return xr(r), r;
|
|
189
197
|
});
|
|
190
198
|
}, []), h = s((e) => {
|
|
191
|
-
let t = (Array.isArray(e) ? e : []).filter(
|
|
192
|
-
t.some((e) => e.serverUrl === null) || (t = [
|
|
199
|
+
let t = (Array.isArray(e) ? e : []).filter(wr);
|
|
200
|
+
t.some((e) => e.serverUrl === null) || (t = [Y, ...t]);
|
|
193
201
|
let r = x();
|
|
194
|
-
r && !t.some((e) => _r(e.serverUrl, r)) && (t = [...t, {
|
|
202
|
+
return r && !t.some((e) => _r(e.serverUrl, r)) && (t = [...t, {
|
|
195
203
|
id: vr(),
|
|
196
204
|
icon: "🌐",
|
|
197
205
|
name: yr(r),
|
|
198
206
|
serverUrl: r
|
|
199
|
-
}]), n(t), i(
|
|
207
|
+
}]), n(t), i(Sr(t)), xr(t), t;
|
|
200
208
|
}, []), g = u(() => ({
|
|
201
209
|
workspaces: t,
|
|
202
210
|
workspace: a,
|
|
@@ -214,597 +222,47 @@ var mr = ({ children: e }) => {
|
|
|
214
222
|
m,
|
|
215
223
|
h
|
|
216
224
|
]);
|
|
217
|
-
return /* @__PURE__ */ p(
|
|
225
|
+
return /* @__PURE__ */ p(Tr.Provider, {
|
|
218
226
|
value: g,
|
|
219
227
|
children: e
|
|
220
228
|
});
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return n[1];
|
|
244
|
-
}
|
|
245
|
-
return /\s/.test(t) || t.includes("://") ? null : t;
|
|
246
|
-
}
|
|
247
|
-
var Nr = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
|
|
248
|
-
function Pr() {
|
|
249
|
-
if (typeof localStorage > "u") return "web";
|
|
250
|
-
let e = localStorage.getItem(Or);
|
|
251
|
-
return e || (e = Nr().slice(0, 12), localStorage.setItem(Or, e)), e;
|
|
252
|
-
}
|
|
253
|
-
function Fr() {
|
|
254
|
-
if (typeof localStorage > "u") return null;
|
|
255
|
-
try {
|
|
256
|
-
let e = localStorage.getItem(G);
|
|
257
|
-
if (!e) return null;
|
|
258
|
-
let t = JSON.parse(e);
|
|
259
|
-
return t && typeof t.token == "string" && t.token ? t : null;
|
|
260
|
-
} catch {
|
|
261
|
-
return null;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
var Ir = "openbook.account.pending", Lr = 600 * 1e3;
|
|
265
|
-
function Rr(e) {
|
|
266
|
-
try {
|
|
267
|
-
sessionStorage.setItem(Ir, JSON.stringify({
|
|
268
|
-
state: e,
|
|
269
|
-
at: Date.now()
|
|
270
|
-
}));
|
|
271
|
-
} catch {}
|
|
272
|
-
}
|
|
273
|
-
function zr() {
|
|
274
|
-
try {
|
|
275
|
-
let e = sessionStorage.getItem(Ir);
|
|
276
|
-
if (!e) return null;
|
|
277
|
-
let t = JSON.parse(e);
|
|
278
|
-
if (typeof t.state == "string" && typeof t.at == "number" && Date.now() - t.at < Lr) return t.state;
|
|
279
|
-
} catch {}
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
function Br() {
|
|
283
|
-
try {
|
|
284
|
-
sessionStorage.removeItem(Ir);
|
|
285
|
-
} catch {}
|
|
286
|
-
}
|
|
287
|
-
var Vr = ({ children: e }) => {
|
|
288
|
-
let { account: t } = cr(), { preferences: n, update: r } = hr(), { workspaces: i, replaceWorkspaces: a } = Tr(), [o, c] = f("disconnected"), [m, h] = f(null), [g, _] = f(null), [te, y] = f(null), b = u(() => new v(), []), x = u(() => ne(), []), S = u(() => `OpenBook ${t?.redirectUri?.startsWith("openbook:") ? "Desktop" : "Web"} · ${Pr()}`, [t]), C = d(null), w = d(null), T = d({
|
|
289
|
-
preferences: n,
|
|
290
|
-
workspaces: i
|
|
291
|
-
});
|
|
292
|
-
T.current = {
|
|
293
|
-
preferences: n,
|
|
294
|
-
workspaces: i
|
|
295
|
-
};
|
|
296
|
-
let E = s(() => ({
|
|
297
|
-
preferences: T.current.preferences,
|
|
298
|
-
workspaces: T.current.workspaces
|
|
299
|
-
}), []), D = s((e, t) => {
|
|
300
|
-
let n = {
|
|
301
|
-
token: e,
|
|
302
|
-
connectedAt: Date.now(),
|
|
303
|
-
lastServerUpdatedAt: t
|
|
304
|
-
};
|
|
305
|
-
try {
|
|
306
|
-
localStorage.setItem(G, JSON.stringify(n));
|
|
307
|
-
} catch {}
|
|
308
|
-
h(e), _(t);
|
|
309
|
-
}, []), O = s((e) => {
|
|
310
|
-
e.preferences && typeof e.preferences == "object" && r(e.preferences), Array.isArray(e.workspaces) && a(e.workspaces);
|
|
311
|
-
}, [r, a]), k = s(async (e) => {
|
|
312
|
-
c("syncing"), y(null);
|
|
313
|
-
try {
|
|
314
|
-
let { settings: t, updatedAt: n } = await b.getSettings(e);
|
|
315
|
-
if (n === null || !t.preferences && !t.workspaces) {
|
|
316
|
-
let t = E(), n = await b.putSettings(e, t);
|
|
317
|
-
w.current = JSON.stringify(t), D(e, n.updatedAt);
|
|
318
|
-
} else O(t), w.current = JSON.stringify(t), D(e, n);
|
|
319
|
-
c("connected");
|
|
320
|
-
} catch (t) {
|
|
321
|
-
if (t instanceof ee && t.status === 401) {
|
|
322
|
-
try {
|
|
323
|
-
localStorage.removeItem(G);
|
|
324
|
-
} catch {}
|
|
325
|
-
h(null), c("error"), y("That sign-in was rejected. Please try again.");
|
|
326
|
-
} else c(e ? "error" : "disconnected"), y("Could not reach account.book.pub. Check your connection.");
|
|
327
|
-
}
|
|
328
|
-
}, [
|
|
329
|
-
b,
|
|
330
|
-
E,
|
|
331
|
-
O,
|
|
332
|
-
D
|
|
333
|
-
]), A = s((e, t) => {
|
|
334
|
-
let n = C.current ?? zr();
|
|
335
|
-
!e || !n || !t || t !== n || (C.current = null, Br(), k(e));
|
|
336
|
-
}, [k]);
|
|
337
|
-
l(() => {
|
|
338
|
-
if (t?.onCallback) return t.onCallback(({ token: e, state: t }) => A(e, t));
|
|
339
|
-
if (typeof window > "u") return;
|
|
340
|
-
let e = (e) => {
|
|
341
|
-
let t = e;
|
|
342
|
-
t?.type === "openbook-account-token" && typeof t.token == "string" && A(t.token, t.state ?? "");
|
|
343
|
-
}, n = typeof BroadcastChannel < "u" ? new BroadcastChannel(kr) : null;
|
|
344
|
-
n?.addEventListener("message", (t) => e(t.data));
|
|
345
|
-
let r = (t) => {
|
|
346
|
-
if (t.key === "openbook.account.handoff" && t.newValue) try {
|
|
347
|
-
e(JSON.parse(t.newValue));
|
|
348
|
-
} catch {}
|
|
349
|
-
};
|
|
350
|
-
window.addEventListener("storage", r);
|
|
351
|
-
try {
|
|
352
|
-
let t = localStorage.getItem(Ar);
|
|
353
|
-
t && (localStorage.removeItem(Ar), e(JSON.parse(t)));
|
|
354
|
-
} catch {}
|
|
355
|
-
return () => {
|
|
356
|
-
n?.close(), window.removeEventListener("storage", r);
|
|
357
|
-
};
|
|
358
|
-
}, [t, A]);
|
|
359
|
-
let j = d(k);
|
|
360
|
-
j.current = k, l(() => {
|
|
361
|
-
let e = Fr();
|
|
362
|
-
e && (h(e.token), _(e.lastServerUpdatedAt), j.current(e.token));
|
|
363
|
-
}, []), l(() => {
|
|
364
|
-
if (!m) return;
|
|
365
|
-
let e = {
|
|
366
|
-
preferences: n,
|
|
367
|
-
workspaces: i
|
|
368
|
-
}, t = JSON.stringify(e);
|
|
369
|
-
if (t === w.current) return;
|
|
370
|
-
let r = setTimeout(() => {
|
|
371
|
-
c("syncing"), b.putSettings(m, e).then((e) => {
|
|
372
|
-
w.current = t, _(e.updatedAt), c("connected"), y(null);
|
|
373
|
-
let n = Fr();
|
|
374
|
-
if (n) try {
|
|
375
|
-
localStorage.setItem(G, JSON.stringify({
|
|
376
|
-
...n,
|
|
377
|
-
lastServerUpdatedAt: e.updatedAt
|
|
378
|
-
}));
|
|
379
|
-
} catch {}
|
|
380
|
-
}).catch(() => {
|
|
381
|
-
c("error"), y("Sync failed — will retry on the next change.");
|
|
382
|
-
});
|
|
383
|
-
}, 1200);
|
|
384
|
-
return () => clearTimeout(r);
|
|
385
|
-
}, [
|
|
386
|
-
m,
|
|
387
|
-
n,
|
|
388
|
-
i,
|
|
389
|
-
b
|
|
390
|
-
]);
|
|
391
|
-
let M = s(() => {
|
|
392
|
-
let e = Nr();
|
|
393
|
-
C.current = e, Rr(e), c("connecting"), y(null);
|
|
394
|
-
let n = t?.redirectUri ?? (typeof window < "u" ? `${window.location.origin}/account/callback` : ""), r = b.connectUrl({
|
|
395
|
-
redirectUri: n,
|
|
396
|
-
state: e,
|
|
397
|
-
name: S
|
|
398
|
-
});
|
|
399
|
-
t?.openSignIn ? t.openSignIn(r) : typeof window < "u" && (window.open(r, "openbook-signin", "width=520,height=720") || (window.location.href = r));
|
|
400
|
-
}, [
|
|
401
|
-
b,
|
|
402
|
-
S,
|
|
403
|
-
t
|
|
404
|
-
]), N = s((e) => {
|
|
405
|
-
let t = Mr(e);
|
|
406
|
-
if (!t) {
|
|
407
|
-
c((e) => m ? e : "error"), y("That doesn’t look like a valid code. Paste the code (or the whole openbook:// link) from the browser.");
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
C.current = null, Br(), c("connecting"), y(null), k(t);
|
|
411
|
-
}, [k, m]), P = s(() => {
|
|
412
|
-
C.current = null, Br(), c((e) => m ? e : "disconnected"), y(null);
|
|
413
|
-
}, [m]), re = s(() => {
|
|
414
|
-
try {
|
|
415
|
-
localStorage.removeItem(G);
|
|
416
|
-
} catch {}
|
|
417
|
-
C.current = null, Br(), w.current = null, h(null), _(null), y(null), c("disconnected");
|
|
418
|
-
}, []), F = s(() => {
|
|
419
|
-
m && k(m);
|
|
420
|
-
}, [m, k]), I = u(() => ({
|
|
421
|
-
status: o,
|
|
422
|
-
connected: !!m && (o === "connected" || o === "syncing"),
|
|
423
|
-
token: m,
|
|
424
|
-
deviceName: S,
|
|
425
|
-
lastSyncedAt: g,
|
|
426
|
-
error: te,
|
|
427
|
-
accountUrl: x,
|
|
428
|
-
signIn: M,
|
|
429
|
-
submitCode: N,
|
|
430
|
-
cancel: P,
|
|
431
|
-
signOut: re,
|
|
432
|
-
syncNow: F
|
|
433
|
-
}), [
|
|
434
|
-
o,
|
|
435
|
-
m,
|
|
436
|
-
S,
|
|
437
|
-
g,
|
|
438
|
-
te,
|
|
439
|
-
x,
|
|
440
|
-
M,
|
|
441
|
-
N,
|
|
442
|
-
P,
|
|
443
|
-
re,
|
|
444
|
-
F
|
|
445
|
-
]);
|
|
446
|
-
return /* @__PURE__ */ p(Dr.Provider, {
|
|
447
|
-
value: I,
|
|
448
|
-
children: e
|
|
449
|
-
});
|
|
450
|
-
}, Hr = () => {
|
|
451
|
-
let e = c(Dr);
|
|
452
|
-
if (!e) throw Error("useAccount must be used within an <AccountProvider>");
|
|
453
|
-
return e;
|
|
454
|
-
}, Ur = C.Root, Wr = C.Trigger, Gr = C.Portal, Kr = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(C.Overlay, {
|
|
455
|
-
ref: n,
|
|
456
|
-
className: V("fixed inset-0 z-50 bg-background/80 backdrop-blur-[var(--overlay-blur)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", e),
|
|
457
|
-
...t
|
|
458
|
-
}));
|
|
459
|
-
Kr.displayName = C.Overlay.displayName;
|
|
460
|
-
var qr = i.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ m(Gr, { children: [/* @__PURE__ */ p(Kr, {}), /* @__PURE__ */ p("div", {
|
|
461
|
-
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
462
|
-
children: /* @__PURE__ */ m(C.Content, {
|
|
463
|
-
ref: r,
|
|
464
|
-
className: V("relative grid w-full max-w-lg gap-4 border bg-background p-6 shadow-overlay duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg", e),
|
|
465
|
-
...n,
|
|
466
|
-
children: [t, /* @__PURE__ */ m(C.Close, {
|
|
467
|
-
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-hover data-[state=open]:text-muted-foreground",
|
|
468
|
-
children: [/* @__PURE__ */ p(_, { className: "h-4 w-4" }), /* @__PURE__ */ p("span", {
|
|
469
|
-
className: "sr-only",
|
|
470
|
-
children: "Close"
|
|
471
|
-
})]
|
|
472
|
-
})]
|
|
473
|
-
})
|
|
474
|
-
})] }));
|
|
475
|
-
qr.displayName = C.Content.displayName;
|
|
476
|
-
var Jr = ({ className: e, ...t }) => /* @__PURE__ */ p("div", {
|
|
477
|
-
className: V("flex flex-col space-y-1.5 text-center sm:text-left", e),
|
|
478
|
-
...t
|
|
479
|
-
});
|
|
480
|
-
Jr.displayName = "DialogHeader";
|
|
481
|
-
var Yr = ({ className: e, ...t }) => /* @__PURE__ */ p("div", {
|
|
482
|
-
className: V("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
483
|
-
...t
|
|
484
|
-
});
|
|
485
|
-
Yr.displayName = "DialogFooter";
|
|
486
|
-
var Xr = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(C.Title, {
|
|
487
|
-
ref: n,
|
|
488
|
-
className: V("text-lg font-semibold leading-none tracking-tight", e),
|
|
489
|
-
...t
|
|
490
|
-
}));
|
|
491
|
-
Xr.displayName = C.Title.displayName;
|
|
492
|
-
var Zr = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(C.Description, {
|
|
493
|
-
ref: n,
|
|
494
|
-
className: V("text-sm text-muted-foreground", e),
|
|
495
|
-
...t
|
|
496
|
-
}));
|
|
497
|
-
Zr.displayName = C.Description.displayName;
|
|
498
|
-
//#endregion
|
|
499
|
-
//#region src/components/ui/button.tsx
|
|
500
|
-
var Qr = T("inline-flex items-center justify-center rounded-md text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] active:scale-[0.97] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100", {
|
|
501
|
-
variants: {
|
|
502
|
-
variant: {
|
|
503
|
-
default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
504
|
-
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
|
|
505
|
-
outline: "border border-input bg-transparent shadow-xs hover:bg-hover hover:text-accent-foreground",
|
|
506
|
-
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
507
|
-
ghost: "hover:bg-hover hover:text-accent-foreground",
|
|
508
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
229
|
+
}, Or = {
|
|
230
|
+
common: {
|
|
231
|
+
cancel: "Cancel",
|
|
232
|
+
close: "Close",
|
|
233
|
+
delete: "Delete",
|
|
234
|
+
save: "Save",
|
|
235
|
+
add: "Add",
|
|
236
|
+
remove: "Remove",
|
|
237
|
+
untitled: "Untitled",
|
|
238
|
+
settings: "Settings"
|
|
239
|
+
},
|
|
240
|
+
settings: {
|
|
241
|
+
title: "Settings",
|
|
242
|
+
comingSoon: "These settings are coming soon.",
|
|
243
|
+
fullscreen: "Full screen",
|
|
244
|
+
exitFullscreen: "Exit full screen",
|
|
245
|
+
enterFullscreen: "Enter full screen",
|
|
246
|
+
closeSettings: "Close settings",
|
|
247
|
+
section: {
|
|
248
|
+
preferences: "Preferences",
|
|
249
|
+
account: "Account",
|
|
250
|
+
workspace: "Workspace"
|
|
509
251
|
},
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
size: n,
|
|
525
|
-
className: e
|
|
526
|
-
})),
|
|
527
|
-
ref: a,
|
|
528
|
-
...i
|
|
529
|
-
}));
|
|
530
|
-
$r.displayName = "Button";
|
|
531
|
-
//#endregion
|
|
532
|
-
//#region src/providers/ConfirmProvider.tsx
|
|
533
|
-
var ei = o(null);
|
|
534
|
-
function ti({ children: e }) {
|
|
535
|
-
let [t, n] = f(null), r = d(null), i = s((e) => {
|
|
536
|
-
r.current?.(e), r.current = null, n(null);
|
|
537
|
-
}, []), a = s((e) => (r.current?.(!1), new Promise((t) => {
|
|
538
|
-
r.current = t, n(e);
|
|
539
|
-
})), []), o = s((e) => {
|
|
540
|
-
e || i(!1);
|
|
541
|
-
}, [i]);
|
|
542
|
-
return /* @__PURE__ */ m(ei.Provider, {
|
|
543
|
-
value: a,
|
|
544
|
-
children: [e, /* @__PURE__ */ p(Ur, {
|
|
545
|
-
open: t !== null,
|
|
546
|
-
onOpenChange: o,
|
|
547
|
-
children: t && /* @__PURE__ */ m(qr, {
|
|
548
|
-
className: "sm:max-w-[420px]",
|
|
549
|
-
children: [/* @__PURE__ */ m(Jr, { children: [/* @__PURE__ */ p(Xr, { children: t.title }), t.description && /* @__PURE__ */ p(Zr, { children: t.description })] }), /* @__PURE__ */ m(Yr, { children: [!t.hideCancel && /* @__PURE__ */ p($r, {
|
|
550
|
-
variant: "outline",
|
|
551
|
-
onClick: () => i(!1),
|
|
552
|
-
children: t.cancelText ?? "Cancel"
|
|
553
|
-
}), /* @__PURE__ */ p($r, {
|
|
554
|
-
variant: t.destructive ? "destructive" : "default",
|
|
555
|
-
onClick: () => i(!0),
|
|
556
|
-
children: t.confirmText ?? "Confirm"
|
|
557
|
-
})] })]
|
|
558
|
-
})
|
|
559
|
-
})]
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
function ni() {
|
|
563
|
-
let e = c(ei);
|
|
564
|
-
if (!e) throw Error("useConfirm must be used within a <ConfirmProvider>");
|
|
565
|
-
return e;
|
|
566
|
-
}
|
|
567
|
-
//#endregion
|
|
568
|
-
//#region src/providers/ForwardingProvider.tsx
|
|
569
|
-
var ri = "openbook.forwarding.enabled", ii = o({
|
|
570
|
-
supported: !1,
|
|
571
|
-
enabled: !1,
|
|
572
|
-
status: "idle",
|
|
573
|
-
host: null,
|
|
574
|
-
busy: !1,
|
|
575
|
-
error: null,
|
|
576
|
-
enable: async () => void 0,
|
|
577
|
-
disable: () => void 0
|
|
578
|
-
}), ai = () => typeof localStorage < "u" && localStorage.getItem(ri) === "1", oi = (e) => {
|
|
579
|
-
typeof localStorage < "u" && localStorage.setItem(ri, e ? "1" : "0");
|
|
580
|
-
}, si = ({ children: e }) => {
|
|
581
|
-
let { forwarding: t } = cr(), { connected: n, token: r, accountUrl: i, signIn: a } = Hr(), o = !!t, c = d(null), [m, h] = f(() => ai()), [g, _] = f("idle"), [v, ee] = f(null), [y, b] = f(!1), [x, ne] = f(null);
|
|
582
|
-
l(() => {
|
|
583
|
-
t && t.keyStore.load().then((e) => e && ee(e.host)).catch(() => void 0);
|
|
584
|
-
}, [t]);
|
|
585
|
-
let S = s(async () => {
|
|
586
|
-
if (!(!t || !r || c.current)) {
|
|
587
|
-
b(!0), ne(null);
|
|
588
|
-
try {
|
|
589
|
-
let e = new te({
|
|
590
|
-
accountUrl: i,
|
|
591
|
-
authToken: r,
|
|
592
|
-
keyStore: t.keyStore,
|
|
593
|
-
localOrigin: "",
|
|
594
|
-
localFetchImpl: t.localFetch,
|
|
595
|
-
onStatus: _
|
|
596
|
-
});
|
|
597
|
-
c.current = e;
|
|
598
|
-
let { host: n } = await e.start();
|
|
599
|
-
ee(n);
|
|
600
|
-
} catch (e) {
|
|
601
|
-
c.current = null, _("offline"), ne(e instanceof Error ? e.message : String(e));
|
|
602
|
-
} finally {
|
|
603
|
-
b(!1);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}, [
|
|
607
|
-
t,
|
|
608
|
-
r,
|
|
609
|
-
i
|
|
610
|
-
]);
|
|
611
|
-
l(() => {
|
|
612
|
-
o && m && n && r && !c.current && S();
|
|
613
|
-
}, [
|
|
614
|
-
o,
|
|
615
|
-
m,
|
|
616
|
-
n,
|
|
617
|
-
r,
|
|
618
|
-
S
|
|
619
|
-
]), l(() => () => c.current?.stop(), []);
|
|
620
|
-
let C = s(async () => {
|
|
621
|
-
if (!n || !r) {
|
|
622
|
-
a();
|
|
623
|
-
return;
|
|
624
|
-
}
|
|
625
|
-
h(!0), oi(!0), await S();
|
|
626
|
-
}, [
|
|
627
|
-
n,
|
|
628
|
-
r,
|
|
629
|
-
a,
|
|
630
|
-
S
|
|
631
|
-
]), w = s(() => {
|
|
632
|
-
c.current?.stop(), c.current = null, _("offline"), h(!1), oi(!1);
|
|
633
|
-
}, []), T = u(() => ({
|
|
634
|
-
supported: o,
|
|
635
|
-
enabled: m,
|
|
636
|
-
status: g,
|
|
637
|
-
host: v,
|
|
638
|
-
busy: y,
|
|
639
|
-
error: x,
|
|
640
|
-
enable: C,
|
|
641
|
-
disable: w
|
|
642
|
-
}), [
|
|
643
|
-
o,
|
|
644
|
-
m,
|
|
645
|
-
g,
|
|
646
|
-
v,
|
|
647
|
-
y,
|
|
648
|
-
x,
|
|
649
|
-
C,
|
|
650
|
-
w
|
|
651
|
-
]);
|
|
652
|
-
return /* @__PURE__ */ p(ii.Provider, {
|
|
653
|
-
value: T,
|
|
654
|
-
children: e
|
|
655
|
-
});
|
|
656
|
-
}, ci = () => c(ii), li = [
|
|
657
|
-
{
|
|
658
|
-
id: "preferences",
|
|
659
|
-
tabs: [
|
|
660
|
-
"general",
|
|
661
|
-
"appearance",
|
|
662
|
-
"customisation"
|
|
663
|
-
]
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
id: "account",
|
|
667
|
-
tabs: [
|
|
668
|
-
"profile",
|
|
669
|
-
"signup",
|
|
670
|
-
"signin",
|
|
671
|
-
"support"
|
|
672
|
-
]
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
id: "workspace",
|
|
676
|
-
tabs: [
|
|
677
|
-
"connection",
|
|
678
|
-
"integrations",
|
|
679
|
-
"extensions",
|
|
680
|
-
"ai",
|
|
681
|
-
"admin"
|
|
682
|
-
]
|
|
683
|
-
}
|
|
684
|
-
], ui = li.flatMap((e) => e.tabs), di = li[0].tabs[0], fi = (e) => typeof e == "string" && ui.includes(e), pi = {
|
|
685
|
-
server: "connection",
|
|
686
|
-
backup: "admin"
|
|
687
|
-
}, mi = (e) => fi(e) ? e : typeof e == "string" && e in pi ? pi[e] : di, K = {
|
|
688
|
-
commandPalette: { open: !1 },
|
|
689
|
-
settings: {
|
|
690
|
-
open: !1,
|
|
691
|
-
mode: "modal",
|
|
692
|
-
tab: di
|
|
693
|
-
},
|
|
694
|
-
present: {
|
|
695
|
-
open: !1,
|
|
696
|
-
mode: "fullscreen",
|
|
697
|
-
pageId: null
|
|
698
|
-
},
|
|
699
|
-
sideNav: {
|
|
700
|
-
open: !0,
|
|
701
|
-
docked: !0
|
|
702
|
-
},
|
|
703
|
-
trash: { open: !1 },
|
|
704
|
-
templates: { open: !1 },
|
|
705
|
-
ai: { open: !1 },
|
|
706
|
-
agent: { open: !1 }
|
|
707
|
-
}, hi = () => {
|
|
708
|
-
if (typeof window > "u" || localStorage.getItem("hud") === null) return K;
|
|
709
|
-
let e = JSON.parse(localStorage.getItem("hud") ?? "{}"), t = {
|
|
710
|
-
...K.settings,
|
|
711
|
-
...e.settings
|
|
712
|
-
};
|
|
713
|
-
return {
|
|
714
|
-
commandPalette: {
|
|
715
|
-
...K.commandPalette,
|
|
716
|
-
...e.commandPalette
|
|
717
|
-
},
|
|
718
|
-
settings: {
|
|
719
|
-
...t,
|
|
720
|
-
tab: mi(t.tab)
|
|
721
|
-
},
|
|
722
|
-
sideNav: {
|
|
723
|
-
...K.sideNav,
|
|
724
|
-
...e.sideNav
|
|
725
|
-
},
|
|
726
|
-
trash: { open: !1 },
|
|
727
|
-
templates: { open: !1 },
|
|
728
|
-
ai: { open: !1 },
|
|
729
|
-
agent: { open: !1 },
|
|
730
|
-
present: { ...K.present }
|
|
731
|
-
};
|
|
732
|
-
}, gi = (e) => {
|
|
733
|
-
let t = {
|
|
734
|
-
...e,
|
|
735
|
-
settings: {
|
|
736
|
-
...e.settings,
|
|
737
|
-
open: !1
|
|
738
|
-
},
|
|
739
|
-
trash: { open: !1 },
|
|
740
|
-
templates: { open: !1 },
|
|
741
|
-
ai: { open: !1 },
|
|
742
|
-
agent: { open: !1 },
|
|
743
|
-
present: { ...K.present }
|
|
744
|
-
};
|
|
745
|
-
localStorage.setItem("hud", JSON.stringify(t));
|
|
746
|
-
}, _i = o({
|
|
747
|
-
hud: K,
|
|
748
|
-
setHud: () => !1
|
|
749
|
-
}), vi = () => c(_i), yi = ({ children: e }) => {
|
|
750
|
-
let [t, n] = E(hi), r = a.useRef(typeof window < "u" && localStorage.getItem("hud") !== null);
|
|
751
|
-
a.useEffect(() => {
|
|
752
|
-
gi(t);
|
|
753
|
-
}, [t]), a.useEffect(() => {
|
|
754
|
-
!r.current && window.innerWidth < 768 && n((e) => (e.sideNav.open = !1, e.sideNav.docked = !1, e));
|
|
755
|
-
}, [n]);
|
|
756
|
-
let i = a.useCallback((e) => {
|
|
757
|
-
t.sideNav.docked || (e.clientX > 320 || e.clientX <= 1 ? n((e) => (e.sideNav.open = !1, e)) : e.clientX < 16 && n((e) => (e.sideNav.open = !0, e)));
|
|
758
|
-
}, [
|
|
759
|
-
t,
|
|
760
|
-
t.sideNav,
|
|
761
|
-
n
|
|
762
|
-
]);
|
|
763
|
-
a.useEffect(() => (document.addEventListener("mousemove", i), () => document.removeEventListener("mousemove", i)), [i]);
|
|
764
|
-
let o = {
|
|
765
|
-
hud: t,
|
|
766
|
-
setHud: n
|
|
767
|
-
};
|
|
768
|
-
return /* @__PURE__ */ p(_i.Provider, {
|
|
769
|
-
value: o,
|
|
770
|
-
children: e
|
|
771
|
-
});
|
|
772
|
-
}, bi = {
|
|
773
|
-
common: {
|
|
774
|
-
cancel: "Cancel",
|
|
775
|
-
close: "Close",
|
|
776
|
-
delete: "Delete",
|
|
777
|
-
save: "Save",
|
|
778
|
-
add: "Add",
|
|
779
|
-
remove: "Remove",
|
|
780
|
-
untitled: "Untitled",
|
|
781
|
-
settings: "Settings"
|
|
782
|
-
},
|
|
783
|
-
settings: {
|
|
784
|
-
title: "Settings",
|
|
785
|
-
comingSoon: "These settings are coming soon.",
|
|
786
|
-
fullscreen: "Full screen",
|
|
787
|
-
exitFullscreen: "Exit full screen",
|
|
788
|
-
enterFullscreen: "Enter full screen",
|
|
789
|
-
closeSettings: "Close settings",
|
|
790
|
-
section: {
|
|
791
|
-
preferences: "Preferences",
|
|
792
|
-
account: "Account",
|
|
793
|
-
workspace: "Workspace"
|
|
794
|
-
},
|
|
795
|
-
tab: {
|
|
796
|
-
general: "General",
|
|
797
|
-
profile: "Profile",
|
|
798
|
-
appearance: "Appearance",
|
|
799
|
-
customisation: "Customisation",
|
|
800
|
-
signup: "Sign up",
|
|
801
|
-
signin: "Sign-in & email",
|
|
802
|
-
support: "Support OpenBook",
|
|
803
|
-
connection: "Connection",
|
|
804
|
-
integrations: "Integrations",
|
|
805
|
-
extensions: "Extensions",
|
|
806
|
-
ai: "AI",
|
|
807
|
-
admin: "Admin"
|
|
252
|
+
tab: {
|
|
253
|
+
general: "General",
|
|
254
|
+
profile: "Profile",
|
|
255
|
+
appearance: "Appearance",
|
|
256
|
+
customisation: "Customisation",
|
|
257
|
+
signup: "Sign up",
|
|
258
|
+
signin: "Sign-in & email",
|
|
259
|
+
support: "Support OpenBook",
|
|
260
|
+
connection: "Connection",
|
|
261
|
+
members: "Members",
|
|
262
|
+
integrations: "Integrations",
|
|
263
|
+
extensions: "Extensions",
|
|
264
|
+
ai: "AI",
|
|
265
|
+
admin: "Admin"
|
|
808
266
|
}
|
|
809
267
|
},
|
|
810
268
|
appearance: {
|
|
@@ -932,6 +390,51 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
932
390
|
linkToPage: "Link to page"
|
|
933
391
|
}
|
|
934
392
|
},
|
|
393
|
+
share: {
|
|
394
|
+
open: "Share",
|
|
395
|
+
title: "Share this page",
|
|
396
|
+
description: "Choose who can access this page, and invite people to view or edit it.",
|
|
397
|
+
loadError: "Couldn’t load sharing settings for this page.",
|
|
398
|
+
unclaimedNotice: "Sharing takes effect once you claim this instance. Until then, anyone who can reach it can view and edit — these settings are saved but not yet enforced.",
|
|
399
|
+
enforcementCaveat: "People you invite may not be able to open this page through its published book.pub link yet — that’s rolling out. Direct access is already limited as set here.",
|
|
400
|
+
scopeLabel: "Who can access",
|
|
401
|
+
scope: {
|
|
402
|
+
inherit: "Workspace default",
|
|
403
|
+
inheritHint: "Follows the workspace’s default access setting.",
|
|
404
|
+
public: "Anyone with the link",
|
|
405
|
+
publicHint: "Visible to anyone, including people who aren’t signed in.",
|
|
406
|
+
authenticated: "Anyone signed in",
|
|
407
|
+
authenticatedHint: "Limits viewing to people who are signed in.",
|
|
408
|
+
members: "Workspace members",
|
|
409
|
+
membersHint: "Limits viewing to members of this workspace.",
|
|
410
|
+
restricted: "Only people invited",
|
|
411
|
+
restrictedHint: "Limits access to you and the people you invite below."
|
|
412
|
+
},
|
|
413
|
+
addLabel: "Invite people",
|
|
414
|
+
addPlaceholder: "Email or handle",
|
|
415
|
+
levelLabel: "Access level",
|
|
416
|
+
levelRead: "Can view",
|
|
417
|
+
levelWrite: "Can edit",
|
|
418
|
+
peopleLabel: "People with access",
|
|
419
|
+
loadingPeople: "Loading people…",
|
|
420
|
+
noPeople: "No one’s been invited yet.",
|
|
421
|
+
remove: "Remove {name}",
|
|
422
|
+
linkHints: {
|
|
423
|
+
inherit: "People with workspace access can open this link.",
|
|
424
|
+
public: "Anyone with the link can open this page.",
|
|
425
|
+
authenticated: "Anyone signed in who opens this link can view this page.",
|
|
426
|
+
members: "Only workspace members who open this link can view this page.",
|
|
427
|
+
restricted: "Only the people you invite can open this link."
|
|
428
|
+
},
|
|
429
|
+
copyLink: "Copy link",
|
|
430
|
+
copied: "Copied",
|
|
431
|
+
error: {
|
|
432
|
+
network: "Couldn’t reach the server. Check your connection and try again.",
|
|
433
|
+
forbidden: "You don’t have permission to change sharing for this page.",
|
|
434
|
+
notFound: "This page no longer exists.",
|
|
435
|
+
generic: "Something went wrong. Please try again."
|
|
436
|
+
}
|
|
437
|
+
},
|
|
935
438
|
command: {
|
|
936
439
|
title: "Command palette",
|
|
937
440
|
placeholder: "Search pages or run a command…",
|
|
@@ -1106,8 +609,38 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1106
609
|
confirmBody: "Restoring in place will replace the current content of {count} pages. This can’t be undone.",
|
|
1107
610
|
confirmBodyNone: "No existing pages match — these will be added as new pages.",
|
|
1108
611
|
confirmOverwrite: "Overwrite"
|
|
612
|
+
},
|
|
613
|
+
schedule: {
|
|
614
|
+
heading: "Scheduled backups",
|
|
615
|
+
intro: "Automatic snapshots on a rolling schedule — kept alongside your manual exports, with older ones pruned for you.",
|
|
616
|
+
webOnly: "Scheduled backups run in the desktop app or on a connected server. In the browser, use Export above to save a copy.",
|
|
617
|
+
enable: "Enable scheduled backups",
|
|
618
|
+
enableHint: "When on, OpenBook writes snapshots to the folder below and keeps a rolling set per interval.",
|
|
619
|
+
cadenceDaily: "Daily",
|
|
620
|
+
cadenceWeekly: "Weekly",
|
|
621
|
+
cadenceMonthly: "Monthly",
|
|
622
|
+
cadenceYearly: "Yearly",
|
|
623
|
+
keptLast: "Last {when} · {count} kept",
|
|
624
|
+
never: "No backup yet",
|
|
625
|
+
backupNow: "Back up now",
|
|
626
|
+
backingUp: "Backing up…",
|
|
627
|
+
ranNow: "Backed up — {file}",
|
|
628
|
+
folder: "Backup folder"
|
|
1109
629
|
}
|
|
1110
630
|
},
|
|
631
|
+
storage: {
|
|
632
|
+
heading: "Storage",
|
|
633
|
+
intro: "Compact the local database to reclaim disk space. Editing leaves behind storage overhead that this rewrites away; the app pauses briefly while it runs.",
|
|
634
|
+
compact: "Compact database",
|
|
635
|
+
compacting: "Compacting…",
|
|
636
|
+
confirmTitle: "Compact the database?",
|
|
637
|
+
confirmBody: "This rewrites the local database to reclaim space and may take a moment. The app will pause until it finishes.",
|
|
638
|
+
confirmAction: "Compact",
|
|
639
|
+
reclaimed: "Reclaimed {amount} — database is now {size}.",
|
|
640
|
+
alreadyCompact: "Already compact — nothing to reclaim ({size}).",
|
|
641
|
+
unavailable: "Compaction isn’t available for this server.",
|
|
642
|
+
failed: "Compaction failed: {error}"
|
|
643
|
+
},
|
|
1111
644
|
workspace: {
|
|
1112
645
|
workspaces: "Workspaces",
|
|
1113
646
|
addWorkspace: "Add a workspace…",
|
|
@@ -1655,6 +1188,33 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1655
1188
|
manualPlaceholder: "Paste your code or openbook://auth-callback#token=… link",
|
|
1656
1189
|
manualSubmit: "Sign in with code"
|
|
1657
1190
|
},
|
|
1191
|
+
switcher: {
|
|
1192
|
+
heading: "Accounts",
|
|
1193
|
+
activeAccount: "Active account",
|
|
1194
|
+
active: "Active",
|
|
1195
|
+
syncing: "Syncing…",
|
|
1196
|
+
error: "Needs attention",
|
|
1197
|
+
dormant: "Signed in",
|
|
1198
|
+
switchTo: "Switch to {name}",
|
|
1199
|
+
addAnother: "Add another account",
|
|
1200
|
+
removeAccount: "Remove {name} from this device",
|
|
1201
|
+
removeConfirmTitle: "Remove {name}?",
|
|
1202
|
+
removeConfirmBody: "This forgets {name} on this device only — sign in again any time to restore it. Your other accounts and your local data are untouched.",
|
|
1203
|
+
signOutActiveHint: "Sign out forgets the active account on this device; your other accounts stay signed in. To fully revoke a device, remove it in your account dashboard."
|
|
1204
|
+
},
|
|
1205
|
+
error: {
|
|
1206
|
+
rejected: "That sign-in was rejected. Please try again.",
|
|
1207
|
+
rejectedReauth: "That sign-in was rejected. Please sign in again.",
|
|
1208
|
+
unreachable: "Could not reach account.book.pub. Check your connection.",
|
|
1209
|
+
syncFailed: "Sync failed — will retry on the next change.",
|
|
1210
|
+
invalidCode: "That doesn’t look like a valid code. Paste the code (or the whole openbook:// link) from the browser."
|
|
1211
|
+
},
|
|
1212
|
+
nudge: {
|
|
1213
|
+
title: "Sync and publish",
|
|
1214
|
+
body: "Sign up free to keep your preferences and workspaces in sync across devices — then publish your work to the web. Local-first stays the default.",
|
|
1215
|
+
cta: "Get started free",
|
|
1216
|
+
dismiss: "Dismiss"
|
|
1217
|
+
},
|
|
1658
1218
|
support: {
|
|
1659
1219
|
title: "Support OpenBook",
|
|
1660
1220
|
description: "OpenBook is independent and open source. Sharing it and sending feedback helps it grow. Sponsorship options are on the way."
|
|
@@ -1672,6 +1232,14 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1672
1232
|
copy: "Copy",
|
|
1673
1233
|
copied: "Copied",
|
|
1674
1234
|
failed: "Couldn’t register: {error}",
|
|
1235
|
+
partialUnscoped: "Forwarding is on, but your account did not issue a site-scoped owner token, so strict audience isolation stays off (a token minted for a different site is still rejected, and the tunnel works normally).",
|
|
1236
|
+
ensureRescope: "Forwarding resumed, but this session could not scope your owner token to the site yet. Your existing access is unchanged; sign in again if a request is refused.",
|
|
1237
|
+
bindFailed: "Forwarding is on, but securing the site audience didn’t finish: {error}",
|
|
1238
|
+
unbindHeld: "Couldn’t fully relax the audience binding while turning forwarding off: {error}",
|
|
1239
|
+
claimWarning: "The first time you turn this on, this device’s books are claimed to your account and made private — only you and members you invite can open them. This can’t be undone.",
|
|
1240
|
+
claimRefusedUnverified: "To publish, your account identity needs to be verified first.",
|
|
1241
|
+
refreshIdentity: "Refresh identity",
|
|
1242
|
+
claimFailed: "Couldn’t claim this device for your account, so it wasn’t published. Try again.",
|
|
1675
1243
|
status: {
|
|
1676
1244
|
live: "Live",
|
|
1677
1245
|
connecting: "Connecting",
|
|
@@ -1716,6 +1284,64 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1716
1284
|
changeFolder: "Change…",
|
|
1717
1285
|
reveal: "Reveal in Finder"
|
|
1718
1286
|
},
|
|
1287
|
+
sharing: {
|
|
1288
|
+
title: "Guests & access",
|
|
1289
|
+
description: "Control what people who haven’t signed in can do on this shared workspace. Your own access is never affected.",
|
|
1290
|
+
youUser: "You’re acting as {name}.",
|
|
1291
|
+
youGuestNamed: "You’re editing as guest “{name}”.",
|
|
1292
|
+
youGuestAnon: "You’re editing as an anonymous guest.",
|
|
1293
|
+
guestAccess: "Guest access",
|
|
1294
|
+
guestAccessHint: "Applies to anyone reaching this workspace without signing in — over the network or a shared ✦.book.pub link.",
|
|
1295
|
+
guestWrite: "Read & edit",
|
|
1296
|
+
guestRead: "Read only",
|
|
1297
|
+
guestOff: "No access",
|
|
1298
|
+
ownerLocked: "Only the workspace owner can change this.",
|
|
1299
|
+
saveError: "Couldn’t update access — {error}"
|
|
1300
|
+
},
|
|
1301
|
+
members: {
|
|
1302
|
+
title: "Members",
|
|
1303
|
+
description: "People with a role on this workspace. Invite by email or handle, change who can manage, and remove access.",
|
|
1304
|
+
youUser: "You’re signed in as {name}.",
|
|
1305
|
+
youGuest: "You’re browsing as a guest.",
|
|
1306
|
+
loading: "Loading members…",
|
|
1307
|
+
empty: "No members yet. Invite someone above to get started.",
|
|
1308
|
+
loadError: "Couldn’t load members — {error}",
|
|
1309
|
+
retry: "Try again",
|
|
1310
|
+
unavailable: "This workspace’s server doesn’t support members yet.",
|
|
1311
|
+
lockedTitle: "Members are managed by admins",
|
|
1312
|
+
locked: "Ask a workspace admin to invite you or change a role.",
|
|
1313
|
+
lockedRoleOwner: "You can’t change the owner’s role",
|
|
1314
|
+
lockedRoleSelf: "You can’t change your own role here",
|
|
1315
|
+
lockedRemoveOwner: "You can’t remove the owner",
|
|
1316
|
+
lockedRemoveSelf: "You can’t remove yourself",
|
|
1317
|
+
inviteLabel: "Invite a member",
|
|
1318
|
+
inviteHint: "Enter an email address or a handle (iss#sub). An email invite is claimed when that person first signs in.",
|
|
1319
|
+
invitePlaceholder: "name@example.com or iss#sub",
|
|
1320
|
+
inviteRole: "Role for the invite",
|
|
1321
|
+
invite: "Invite",
|
|
1322
|
+
inviteError: "Couldn’t invite — {error}",
|
|
1323
|
+
listLabel: "Current members",
|
|
1324
|
+
roleAdmin: "Admin",
|
|
1325
|
+
roleViewer: "Viewer",
|
|
1326
|
+
changeRole: "Change role for {name}",
|
|
1327
|
+
statusActive: "Active",
|
|
1328
|
+
statusInvited: "Invited",
|
|
1329
|
+
statusSuspended: "Suspended",
|
|
1330
|
+
you: "You",
|
|
1331
|
+
owner: "Owner",
|
|
1332
|
+
remove: "Remove {name}",
|
|
1333
|
+
removeTitle: "Remove {name}?",
|
|
1334
|
+
removeBody: "They’ll lose their role on this workspace. An email invite can be re-sent later.",
|
|
1335
|
+
removeConfirm: "Remove",
|
|
1336
|
+
actionError: "Couldn’t update member — {error}"
|
|
1337
|
+
},
|
|
1338
|
+
provenance: {
|
|
1339
|
+
editedBy: "Edited by {name}",
|
|
1340
|
+
justNow: "just now",
|
|
1341
|
+
aGuest: "a guest",
|
|
1342
|
+
someone: "someone",
|
|
1343
|
+
unverified: "unverified identity"
|
|
1344
|
+
},
|
|
1719
1345
|
integrations: {
|
|
1720
1346
|
title: "Integrations",
|
|
1721
1347
|
description: "Connect OpenBook to other tools. Integrations aren’t available yet — this is where they’ll live."
|
|
@@ -1732,7 +1358,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1732
1358
|
resetConfirmBody: "This clears appearance, language, and layout settings on this device and reloads. Your pages and workspaces are not affected.",
|
|
1733
1359
|
resetConfirmButton: "Reset"
|
|
1734
1360
|
}
|
|
1735
|
-
},
|
|
1361
|
+
}, kr = {
|
|
1736
1362
|
common: {
|
|
1737
1363
|
cancel: "Abbrechen",
|
|
1738
1364
|
close: "Schließen",
|
|
@@ -1764,6 +1390,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1764
1390
|
signin: "Anmeldung & E-Mail",
|
|
1765
1391
|
support: "OpenBook unterstützen",
|
|
1766
1392
|
connection: "Verbindung",
|
|
1393
|
+
members: "Mitglieder",
|
|
1767
1394
|
integrations: "Integrationen",
|
|
1768
1395
|
extensions: "Erweiterungen",
|
|
1769
1396
|
ai: "KI",
|
|
@@ -1838,6 +1465,51 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
1838
1465
|
linkToPage: "Mit Seite verknüpfen"
|
|
1839
1466
|
}
|
|
1840
1467
|
},
|
|
1468
|
+
share: {
|
|
1469
|
+
open: "Teilen",
|
|
1470
|
+
title: "Diese Seite teilen",
|
|
1471
|
+
description: "Lege fest, wer auf diese Seite zugreifen darf, und lade Personen zum Ansehen oder Bearbeiten ein.",
|
|
1472
|
+
loadError: "Die Freigabeeinstellungen für diese Seite konnten nicht geladen werden.",
|
|
1473
|
+
unclaimedNotice: "Die Freigabe wird erst wirksam, wenn du diese Instanz beanspruchst. Bis dahin kann jede Person mit Zugriff ansehen und bearbeiten — diese Einstellungen werden gespeichert, aber noch nicht durchgesetzt.",
|
|
1474
|
+
enforcementCaveat: "Von dir eingeladene Personen können diese Seite über ihren veröffentlichten book.pub-Link möglicherweise noch nicht öffnen — das wird gerade ausgerollt. Der direkte Zugriff ist bereits wie hier festgelegt eingeschränkt.",
|
|
1475
|
+
scopeLabel: "Wer hat Zugriff",
|
|
1476
|
+
scope: {
|
|
1477
|
+
inherit: "Arbeitsbereich-Standard",
|
|
1478
|
+
inheritHint: "Folgt der Standard-Zugriffseinstellung des Arbeitsbereichs.",
|
|
1479
|
+
public: "Alle mit dem Link",
|
|
1480
|
+
publicHint: "Für alle sichtbar, auch für nicht angemeldete Personen.",
|
|
1481
|
+
authenticated: "Alle Angemeldeten",
|
|
1482
|
+
authenticatedHint: "Beschränkt das Ansehen auf angemeldete Personen.",
|
|
1483
|
+
members: "Arbeitsbereich-Mitglieder",
|
|
1484
|
+
membersHint: "Beschränkt das Ansehen auf Mitglieder dieses Arbeitsbereichs.",
|
|
1485
|
+
restricted: "Nur eingeladene Personen",
|
|
1486
|
+
restrictedHint: "Beschränkt den Zugriff auf dich und die unten eingeladenen Personen."
|
|
1487
|
+
},
|
|
1488
|
+
addLabel: "Personen einladen",
|
|
1489
|
+
addPlaceholder: "E-Mail oder Handle",
|
|
1490
|
+
levelLabel: "Zugriffsebene",
|
|
1491
|
+
levelRead: "Kann ansehen",
|
|
1492
|
+
levelWrite: "Kann bearbeiten",
|
|
1493
|
+
peopleLabel: "Personen mit Zugriff",
|
|
1494
|
+
loadingPeople: "Personen werden geladen …",
|
|
1495
|
+
noPeople: "Es wurde noch niemand eingeladen.",
|
|
1496
|
+
remove: "{name} entfernen",
|
|
1497
|
+
linkHints: {
|
|
1498
|
+
inherit: "Personen mit Arbeitsbereich-Zugriff können diesen Link öffnen.",
|
|
1499
|
+
public: "Jede Person mit dem Link kann diese Seite öffnen.",
|
|
1500
|
+
authenticated: "Jede angemeldete Person, die diesen Link öffnet, kann diese Seite ansehen.",
|
|
1501
|
+
members: "Nur Arbeitsbereich-Mitglieder, die diesen Link öffnen, können diese Seite ansehen.",
|
|
1502
|
+
restricted: "Nur die von dir eingeladenen Personen können diesen Link öffnen."
|
|
1503
|
+
},
|
|
1504
|
+
copyLink: "Link kopieren",
|
|
1505
|
+
copied: "Kopiert",
|
|
1506
|
+
error: {
|
|
1507
|
+
network: "Server nicht erreichbar. Prüfe deine Verbindung und versuche es erneut.",
|
|
1508
|
+
forbidden: "Du hast keine Berechtigung, die Freigabe dieser Seite zu ändern.",
|
|
1509
|
+
notFound: "Diese Seite existiert nicht mehr.",
|
|
1510
|
+
generic: "Etwas ist schiefgelaufen. Bitte versuche es erneut."
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1841
1513
|
command: {
|
|
1842
1514
|
title: "Befehlspalette",
|
|
1843
1515
|
search: "Suchen",
|
|
@@ -2347,11 +2019,64 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
2347
2019
|
title: "Anmeldung & E-Mail",
|
|
2348
2020
|
description: "E-Mail und verbundene Anmeldung (Google, GitHub, Apple) kommen mit den Konten. Es gibt noch nichts, wo man sich anmelden könnte."
|
|
2349
2021
|
},
|
|
2022
|
+
switcher: {
|
|
2023
|
+
heading: "Konten",
|
|
2024
|
+
activeAccount: "Aktives Konto",
|
|
2025
|
+
active: "Aktiv",
|
|
2026
|
+
syncing: "Wird synchronisiert…",
|
|
2027
|
+
error: "Aktion erforderlich",
|
|
2028
|
+
dormant: "Angemeldet",
|
|
2029
|
+
switchTo: "Zu {name} wechseln",
|
|
2030
|
+
addAnother: "Weiteres Konto hinzufügen",
|
|
2031
|
+
removeAccount: "{name} von diesem Gerät entfernen",
|
|
2032
|
+
removeConfirmTitle: "{name} entfernen?",
|
|
2033
|
+
removeConfirmBody: "Damit wird {name} nur auf diesem Gerät vergessen – melde dich jederzeit wieder an, um es wiederherzustellen. Deine anderen Konten und lokalen Daten bleiben unberührt.",
|
|
2034
|
+
signOutActiveHint: "Beim Abmelden wird das aktive Konto auf diesem Gerät vergessen; deine anderen Konten bleiben angemeldet. Um ein Gerät vollständig zu widerrufen, entferne es im Konto-Dashboard."
|
|
2035
|
+
},
|
|
2036
|
+
error: {
|
|
2037
|
+
rejected: "Diese Anmeldung wurde abgelehnt. Bitte versuche es erneut.",
|
|
2038
|
+
rejectedReauth: "Diese Anmeldung wurde abgelehnt. Bitte melde dich erneut an.",
|
|
2039
|
+
unreachable: "account.book.pub war nicht erreichbar. Prüfe deine Verbindung.",
|
|
2040
|
+
syncFailed: "Synchronisierung fehlgeschlagen – wird bei der nächsten Änderung erneut versucht.",
|
|
2041
|
+
invalidCode: "Das sieht nicht nach einem gültigen Code aus. Füge den Code (oder den ganzen openbook://-Link) aus dem Browser ein."
|
|
2042
|
+
},
|
|
2043
|
+
nudge: {
|
|
2044
|
+
title: "Synchronisieren und veröffentlichen",
|
|
2045
|
+
body: "Registriere dich kostenlos, damit deine Einstellungen und Arbeitsbereiche geräteübergreifend synchron bleiben – danach kannst du deine Arbeit im Web veröffentlichen. Local-First bleibt Standard.",
|
|
2046
|
+
cta: "Kostenlos starten",
|
|
2047
|
+
dismiss: "Schließen"
|
|
2048
|
+
},
|
|
2350
2049
|
support: {
|
|
2351
2050
|
title: "OpenBook unterstützen",
|
|
2352
2051
|
description: "OpenBook ist unabhängig und quelloffen. Es zu teilen und Feedback zu senden hilft beim Wachsen. Sponsoring-Optionen sind in Arbeit."
|
|
2353
2052
|
}
|
|
2354
2053
|
},
|
|
2054
|
+
forwarding: {
|
|
2055
|
+
title: "Ins Web weiterleiten",
|
|
2056
|
+
description: "Sichere dir eine private ✦.book.pub-Adresse, die die Bücher dieses Geräts in jedem Browser öffnet — nichts zu hosten, nichts im Netzwerk freizugeben.",
|
|
2057
|
+
toggle: "Dieses Gerät weiterleiten",
|
|
2058
|
+
signInHint: "Melde dich zuerst bei deinem Konto an, um eine Adresse zu sichern.",
|
|
2059
|
+
signIn: "Anmelden",
|
|
2060
|
+
registering: "Verbinden…",
|
|
2061
|
+
address: "Deine Adresse",
|
|
2062
|
+
addressHint: "Öffnet die Bücher dieses Geräts in jedem Browser, solange es online ist.",
|
|
2063
|
+
copy: "Kopieren",
|
|
2064
|
+
copied: "Kopiert",
|
|
2065
|
+
failed: "Registrierung fehlgeschlagen: {error}",
|
|
2066
|
+
partialUnscoped: "Die Weiterleitung ist aktiv, aber dein Konto hat kein auf die Site begrenztes Owner-Token ausgestellt, daher bleibt die strikte Audience-Isolierung aus (ein für eine andere Site ausgestelltes Token wird weiterhin abgewiesen, und der Tunnel funktioniert normal).",
|
|
2067
|
+
ensureRescope: "Die Weiterleitung wurde fortgesetzt, aber diese Sitzung konnte dein Owner-Token noch nicht auf die Site begrenzen. Dein bestehender Zugriff bleibt unverändert; melde dich erneut an, falls eine Anfrage abgelehnt wird.",
|
|
2068
|
+
bindFailed: "Die Weiterleitung ist aktiv, aber das Absichern der Site-Audience wurde nicht abgeschlossen: {error}",
|
|
2069
|
+
unbindHeld: "Die Audience-Bindung konnte beim Ausschalten der Weiterleitung nicht vollständig gelöst werden: {error}",
|
|
2070
|
+
claimWarning: "Beim ersten Einschalten werden die Bücher dieses Geräts deinem Konto zugeordnet und privat geschaltet — nur du und von dir eingeladene Mitglieder können sie öffnen. Das lässt sich nicht rückgängig machen.",
|
|
2071
|
+
claimRefusedUnverified: "Zum Veröffentlichen muss die Identität deines Kontos zuerst verifiziert werden.",
|
|
2072
|
+
refreshIdentity: "Identität aktualisieren",
|
|
2073
|
+
claimFailed: "Dieses Gerät konnte deinem Konto nicht zugeordnet werden und wurde daher nicht veröffentlicht. Versuche es erneut.",
|
|
2074
|
+
status: {
|
|
2075
|
+
live: "Live",
|
|
2076
|
+
connecting: "Verbinden",
|
|
2077
|
+
offline: "Offline"
|
|
2078
|
+
}
|
|
2079
|
+
},
|
|
2355
2080
|
connection: {
|
|
2356
2081
|
title: "Verbindung",
|
|
2357
2082
|
description: "Wähle, wo dieses Gerät Seiten liest und schreibt.",
|
|
@@ -2387,6 +2112,43 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
2387
2112
|
resetConfirmBody: "Dies löscht Darstellungs-, Sprach- und Layout-Einstellungen auf diesem Gerät und lädt neu. Deine Seiten und Arbeitsbereiche sind nicht betroffen.",
|
|
2388
2113
|
resetConfirmButton: "Zurücksetzen"
|
|
2389
2114
|
},
|
|
2115
|
+
members: {
|
|
2116
|
+
title: "Mitglieder",
|
|
2117
|
+
description: "Personen mit einer Rolle in diesem Arbeitsbereich. Lade per E-Mail oder Handle ein, ändere die Verwaltung und entferne Zugriff.",
|
|
2118
|
+
youUser: "Du bist angemeldet als {name}.",
|
|
2119
|
+
youGuest: "Du bist als Gast unterwegs.",
|
|
2120
|
+
loading: "Mitglieder werden geladen…",
|
|
2121
|
+
empty: "Noch keine Mitglieder. Lade oben jemanden ein, um zu beginnen.",
|
|
2122
|
+
loadError: "Mitglieder konnten nicht geladen werden — {error}",
|
|
2123
|
+
retry: "Erneut versuchen",
|
|
2124
|
+
unavailable: "Der Server dieses Arbeitsbereichs unterstützt noch keine Mitglieder.",
|
|
2125
|
+
lockedTitle: "Mitglieder werden von Admins verwaltet",
|
|
2126
|
+
locked: "Bitte eine Admin-Person, dich einzuladen oder eine Rolle zu ändern.",
|
|
2127
|
+
lockedRoleOwner: "Die Rolle des Eigentümers kannst du nicht ändern",
|
|
2128
|
+
lockedRoleSelf: "Deine eigene Rolle kannst du hier nicht ändern",
|
|
2129
|
+
lockedRemoveOwner: "Den Eigentümer kannst du nicht entfernen",
|
|
2130
|
+
lockedRemoveSelf: "Dich selbst kannst du nicht entfernen",
|
|
2131
|
+
inviteLabel: "Mitglied einladen",
|
|
2132
|
+
inviteHint: "Gib eine E-Mail-Adresse oder ein Handle (iss#sub) ein. Eine E-Mail-Einladung wird bei der ersten Anmeldung übernommen.",
|
|
2133
|
+
invitePlaceholder: "name@example.com oder iss#sub",
|
|
2134
|
+
inviteRole: "Rolle für die Einladung",
|
|
2135
|
+
invite: "Einladen",
|
|
2136
|
+
inviteError: "Einladung fehlgeschlagen — {error}",
|
|
2137
|
+
listLabel: "Aktuelle Mitglieder",
|
|
2138
|
+
roleAdmin: "Admin",
|
|
2139
|
+
roleViewer: "Betrachter",
|
|
2140
|
+
changeRole: "Rolle ändern für {name}",
|
|
2141
|
+
statusActive: "Aktiv",
|
|
2142
|
+
statusInvited: "Eingeladen",
|
|
2143
|
+
statusSuspended: "Gesperrt",
|
|
2144
|
+
you: "Du",
|
|
2145
|
+
owner: "Eigentümer",
|
|
2146
|
+
remove: "{name} entfernen",
|
|
2147
|
+
removeTitle: "{name} entfernen?",
|
|
2148
|
+
removeBody: "Die Person verliert ihre Rolle in diesem Arbeitsbereich. Eine E-Mail-Einladung kann später erneut gesendet werden.",
|
|
2149
|
+
removeConfirm: "Entfernen",
|
|
2150
|
+
actionError: "Mitglied konnte nicht aktualisiert werden — {error}"
|
|
2151
|
+
},
|
|
2390
2152
|
properties: {
|
|
2391
2153
|
owner: "Verantwortlich",
|
|
2392
2154
|
setOwner: "Verantwortliche Person festlegen",
|
|
@@ -2402,7 +2164,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
2402
2164
|
noBacklinks: "Noch keine Backlinks",
|
|
2403
2165
|
refresh: "Aktualisieren"
|
|
2404
2166
|
}
|
|
2405
|
-
},
|
|
2167
|
+
}, Ar = {
|
|
2406
2168
|
common: {
|
|
2407
2169
|
cancel: "キャンセル",
|
|
2408
2170
|
close: "閉じる",
|
|
@@ -2434,6 +2196,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
2434
2196
|
signin: "サインインとメール",
|
|
2435
2197
|
support: "OpenBook を支援",
|
|
2436
2198
|
connection: "接続",
|
|
2199
|
+
members: "メンバー",
|
|
2437
2200
|
integrations: "連携",
|
|
2438
2201
|
extensions: "拡張機能",
|
|
2439
2202
|
ai: "AI",
|
|
@@ -2508,6 +2271,51 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
2508
2271
|
linkToPage: "ページにリンク"
|
|
2509
2272
|
}
|
|
2510
2273
|
},
|
|
2274
|
+
share: {
|
|
2275
|
+
open: "共有",
|
|
2276
|
+
title: "このページを共有",
|
|
2277
|
+
description: "このページにアクセスできる人を選び、閲覧または編集に招待します。",
|
|
2278
|
+
loadError: "このページの共有設定を読み込めませんでした。",
|
|
2279
|
+
unclaimedNotice: "共有はこのインスタンスを要求したあとに有効になります。それまでは、アクセスできる人なら誰でも閲覧・編集できます。設定は保存されますが、まだ適用されません。",
|
|
2280
|
+
enforcementCaveat: "招待した人は、公開された book.pub リンクからこのページをまだ開けない場合があります — 現在順次対応中です。直接アクセスはここで設定したとおりすでに制限されています。",
|
|
2281
|
+
scopeLabel: "アクセスできる人",
|
|
2282
|
+
scope: {
|
|
2283
|
+
inherit: "ワークスペースの既定",
|
|
2284
|
+
inheritHint: "ワークスペースの既定のアクセス設定に従います。",
|
|
2285
|
+
public: "リンクを知っている全員",
|
|
2286
|
+
publicHint: "サインインしていない人を含め、誰でも閲覧できます。",
|
|
2287
|
+
authenticated: "サインイン済みの全員",
|
|
2288
|
+
authenticatedHint: "閲覧をサインイン済みの人に制限します。",
|
|
2289
|
+
members: "ワークスペースのメンバー",
|
|
2290
|
+
membersHint: "閲覧をこのワークスペースのメンバーに制限します。",
|
|
2291
|
+
restricted: "招待した人のみ",
|
|
2292
|
+
restrictedHint: "アクセスをあなたと下で招待した人に制限します。"
|
|
2293
|
+
},
|
|
2294
|
+
addLabel: "人を招待",
|
|
2295
|
+
addPlaceholder: "メールまたはハンドル",
|
|
2296
|
+
levelLabel: "アクセス権限",
|
|
2297
|
+
levelRead: "閲覧可能",
|
|
2298
|
+
levelWrite: "編集可能",
|
|
2299
|
+
peopleLabel: "アクセスできる人",
|
|
2300
|
+
loadingPeople: "読み込み中…",
|
|
2301
|
+
noPeople: "まだ誰も招待されていません。",
|
|
2302
|
+
remove: "{name} を削除",
|
|
2303
|
+
linkHints: {
|
|
2304
|
+
inherit: "ワークスペースにアクセスできる人はこのリンクを開けます。",
|
|
2305
|
+
public: "リンクを知っている人なら誰でもこのページを開けます。",
|
|
2306
|
+
authenticated: "サインイン済みの人がこのリンクを開くと、このページを閲覧できます。",
|
|
2307
|
+
members: "このリンクを開いたワークスペースのメンバーのみがこのページを閲覧できます。",
|
|
2308
|
+
restricted: "あなたが招待した人のみがこのリンクを開けます。"
|
|
2309
|
+
},
|
|
2310
|
+
copyLink: "リンクをコピー",
|
|
2311
|
+
copied: "コピーしました",
|
|
2312
|
+
error: {
|
|
2313
|
+
network: "サーバーに接続できませんでした。接続を確認して、もう一度お試しください。",
|
|
2314
|
+
forbidden: "このページの共有を変更する権限がありません。",
|
|
2315
|
+
notFound: "このページは存在しません。",
|
|
2316
|
+
generic: "問題が発生しました。もう一度お試しください。"
|
|
2317
|
+
}
|
|
2318
|
+
},
|
|
2511
2319
|
command: {
|
|
2512
2320
|
title: "コマンドパレット",
|
|
2513
2321
|
search: "検索",
|
|
@@ -3017,11 +2825,64 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3017
2825
|
title: "サインインとメール",
|
|
3018
2826
|
description: "メールと連携サインイン(Google、GitHub、Apple)はアカウントとともに登場します。まだサインインできる先はありません。"
|
|
3019
2827
|
},
|
|
2828
|
+
switcher: {
|
|
2829
|
+
heading: "アカウント",
|
|
2830
|
+
activeAccount: "使用中のアカウント",
|
|
2831
|
+
active: "使用中",
|
|
2832
|
+
syncing: "同期中…",
|
|
2833
|
+
error: "対応が必要",
|
|
2834
|
+
dormant: "サインイン済み",
|
|
2835
|
+
switchTo: "{name} に切り替える",
|
|
2836
|
+
addAnother: "別のアカウントを追加",
|
|
2837
|
+
removeAccount: "{name} をこの端末から削除",
|
|
2838
|
+
removeConfirmTitle: "{name} を削除しますか?",
|
|
2839
|
+
removeConfirmBody: "この端末から {name} を解除するだけです。いつでも再度サインインすれば復元できます。他のアカウントやローカルデータには影響しません。",
|
|
2840
|
+
signOutActiveHint: "サインアウトすると、この端末で使用中のアカウントが解除されます。他のアカウントはサインインしたままです。端末を完全に無効化するには、アカウントのダッシュボードから削除してください。"
|
|
2841
|
+
},
|
|
2842
|
+
error: {
|
|
2843
|
+
rejected: "サインインが拒否されました。もう一度お試しください。",
|
|
2844
|
+
rejectedReauth: "サインインが拒否されました。もう一度サインインしてください。",
|
|
2845
|
+
unreachable: "account.book.pub に接続できませんでした。接続を確認してください。",
|
|
2846
|
+
syncFailed: "同期に失敗しました。次の変更時に再試行します。",
|
|
2847
|
+
invalidCode: "有効なコードではないようです。ブラウザからコード(または openbook:// リンク全体)を貼り付けてください。"
|
|
2848
|
+
},
|
|
2849
|
+
nudge: {
|
|
2850
|
+
title: "同期して公開",
|
|
2851
|
+
body: "無料で登録すると、設定とワークスペースを端末間で同期できます。そのうえで、作品をウェブに公開できます。ローカルファーストが既定のままです。",
|
|
2852
|
+
cta: "無料で始める",
|
|
2853
|
+
dismiss: "閉じる"
|
|
2854
|
+
},
|
|
3020
2855
|
support: {
|
|
3021
2856
|
title: "OpenBook を支援",
|
|
3022
2857
|
description: "OpenBook は独立したオープンソースです。共有やフィードバックが成長を助けます。スポンサーの仕組みも準備中です。"
|
|
3023
2858
|
}
|
|
3024
2859
|
},
|
|
2860
|
+
forwarding: {
|
|
2861
|
+
partialUnscoped: "転送は有効ですが、アカウントがサイト用にスコープされたオーナートークンを発行しなかったため、厳格なオーディエンス分離はオフのままです(別のサイト向けに発行されたトークンは引き続き拒否され、トンネルは正常に動作します)。",
|
|
2862
|
+
ensureRescope: "転送を再開しましたが、このセッションではオーナートークンをまだサイトにスコープできませんでした。既存のアクセスは変わりません。リクエストが拒否される場合は、もう一度サインインしてください。",
|
|
2863
|
+
bindFailed: "転送は有効ですが、サイトのオーディエンスの保護を完了できませんでした: {error}",
|
|
2864
|
+
unbindHeld: "転送をオフにする際に、オーディエンスのバインドを完全に解除できませんでした: {error}",
|
|
2865
|
+
title: "ウェブに転送",
|
|
2866
|
+
description: "プライベートな ✦.book.pub アドレスを取得すると、このデバイスのブックをどのブラウザーからでも開けます。ホスティングもネットワークでの公開も不要です。",
|
|
2867
|
+
toggle: "このデバイスを転送",
|
|
2868
|
+
signInHint: "アドレスを取得するには、まずアカウントにサインインしてください。",
|
|
2869
|
+
signIn: "サインイン",
|
|
2870
|
+
registering: "接続中…",
|
|
2871
|
+
address: "あなたのアドレス",
|
|
2872
|
+
addressHint: "オンラインの間、このデバイスのブックをどのブラウザーからでも開けます。",
|
|
2873
|
+
copy: "コピー",
|
|
2874
|
+
copied: "コピーしました",
|
|
2875
|
+
failed: "登録できませんでした: {error}",
|
|
2876
|
+
claimWarning: "初めてオンにすると、このデバイスのブックはあなたのアカウントに紐付けられ、非公開になります。あなたと招待したメンバーだけが開けます。この操作は取り消せません。",
|
|
2877
|
+
claimRefusedUnverified: "公開するには、まずアカウントのアイデンティティを検証する必要があります。",
|
|
2878
|
+
refreshIdentity: "アイデンティティを更新",
|
|
2879
|
+
claimFailed: "このデバイスをあなたのアカウントに紐付けできず、公開されませんでした。もう一度お試しください。",
|
|
2880
|
+
status: {
|
|
2881
|
+
live: "稼働中",
|
|
2882
|
+
connecting: "接続中",
|
|
2883
|
+
offline: "オフライン"
|
|
2884
|
+
}
|
|
2885
|
+
},
|
|
3025
2886
|
connection: {
|
|
3026
2887
|
title: "接続",
|
|
3027
2888
|
description: "このデバイスがページを読み書きする場所を選びます。",
|
|
@@ -3057,6 +2918,43 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3057
2918
|
resetConfirmBody: "このデバイスの外観・言語・レイアウト設定を消去して再読み込みします。ページとワークスペースには影響しません。",
|
|
3058
2919
|
resetConfirmButton: "リセット"
|
|
3059
2920
|
},
|
|
2921
|
+
members: {
|
|
2922
|
+
title: "メンバー",
|
|
2923
|
+
description: "このワークスペースで役割を持つ人。メールまたはハンドルで招待し、管理権限を変更したり、アクセスを削除したりできます。",
|
|
2924
|
+
youUser: "{name} としてサインインしています。",
|
|
2925
|
+
youGuest: "ゲストとして閲覧しています。",
|
|
2926
|
+
loading: "メンバーを読み込み中…",
|
|
2927
|
+
empty: "まだメンバーがいません。上から誰かを招待して始めましょう。",
|
|
2928
|
+
loadError: "メンバーを読み込めませんでした — {error}",
|
|
2929
|
+
retry: "再試行",
|
|
2930
|
+
unavailable: "このワークスペースのサーバーはまだメンバーに対応していません。",
|
|
2931
|
+
lockedTitle: "メンバーは管理者が管理します",
|
|
2932
|
+
locked: "管理者に招待や役割の変更を依頼してください。",
|
|
2933
|
+
lockedRoleOwner: "オーナーの役割は変更できません",
|
|
2934
|
+
lockedRoleSelf: "自分の役割はここでは変更できません",
|
|
2935
|
+
lockedRemoveOwner: "オーナーは削除できません",
|
|
2936
|
+
lockedRemoveSelf: "自分自身は削除できません",
|
|
2937
|
+
inviteLabel: "メンバーを招待",
|
|
2938
|
+
inviteHint: "メールアドレスまたはハンドル(iss#sub)を入力します。メール招待は、その人が初めてサインインしたときに引き継がれます。",
|
|
2939
|
+
invitePlaceholder: "name@example.com または iss#sub",
|
|
2940
|
+
inviteRole: "招待の役割",
|
|
2941
|
+
invite: "招待",
|
|
2942
|
+
inviteError: "招待できませんでした — {error}",
|
|
2943
|
+
listLabel: "現在のメンバー",
|
|
2944
|
+
roleAdmin: "管理者",
|
|
2945
|
+
roleViewer: "閲覧者",
|
|
2946
|
+
changeRole: "{name} の役割を変更",
|
|
2947
|
+
statusActive: "アクティブ",
|
|
2948
|
+
statusInvited: "招待済み",
|
|
2949
|
+
statusSuspended: "停止中",
|
|
2950
|
+
you: "あなた",
|
|
2951
|
+
owner: "オーナー",
|
|
2952
|
+
remove: "{name} を削除",
|
|
2953
|
+
removeTitle: "{name} を削除しますか?",
|
|
2954
|
+
removeBody: "この人はこのワークスペースでの役割を失います。メール招待は後で再送できます。",
|
|
2955
|
+
removeConfirm: "削除",
|
|
2956
|
+
actionError: "メンバーを更新できませんでした — {error}"
|
|
2957
|
+
},
|
|
3060
2958
|
properties: {
|
|
3061
2959
|
owner: "担当者",
|
|
3062
2960
|
setOwner: "担当者を設定",
|
|
@@ -3072,7 +2970,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3072
2970
|
noBacklinks: "バックリンクはまだありません",
|
|
3073
2971
|
refresh: "更新"
|
|
3074
2972
|
}
|
|
3075
|
-
},
|
|
2973
|
+
}, jr = {
|
|
3076
2974
|
common: {
|
|
3077
2975
|
cancel: "取消",
|
|
3078
2976
|
close: "关闭",
|
|
@@ -3104,6 +3002,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3104
3002
|
signin: "登录与邮箱",
|
|
3105
3003
|
support: "支持 OpenBook",
|
|
3106
3004
|
connection: "连接",
|
|
3005
|
+
members: "成员",
|
|
3107
3006
|
integrations: "集成",
|
|
3108
3007
|
extensions: "扩展",
|
|
3109
3008
|
ai: "AI",
|
|
@@ -3178,6 +3077,51 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3178
3077
|
linkToPage: "链接到页面"
|
|
3179
3078
|
}
|
|
3180
3079
|
},
|
|
3080
|
+
share: {
|
|
3081
|
+
open: "共享",
|
|
3082
|
+
title: "共享此页面",
|
|
3083
|
+
description: "选择谁可以访问此页面,并邀请他人查看或编辑。",
|
|
3084
|
+
loadError: "无法加载此页面的共享设置。",
|
|
3085
|
+
unclaimedNotice: "共享将在你认领此实例后生效。在此之前,任何能够访问它的人都可以查看和编辑——这些设置已保存,但尚未强制执行。",
|
|
3086
|
+
enforcementCaveat: "你邀请的人可能还无法通过已发布的 book.pub 链接打开此页面——此功能正在逐步推出。直接访问已按此处的设置受到限制。",
|
|
3087
|
+
scopeLabel: "谁可以访问",
|
|
3088
|
+
scope: {
|
|
3089
|
+
inherit: "工作区默认",
|
|
3090
|
+
inheritHint: "沿用工作区的默认访问设置。",
|
|
3091
|
+
public: "任何获得链接的人",
|
|
3092
|
+
publicHint: "所有人可见,包括未登录的人。",
|
|
3093
|
+
authenticated: "任何已登录的人",
|
|
3094
|
+
authenticatedHint: "将查看权限限制为已登录的人。",
|
|
3095
|
+
members: "工作区成员",
|
|
3096
|
+
membersHint: "将查看权限限制为此工作区的成员。",
|
|
3097
|
+
restricted: "仅受邀请的人",
|
|
3098
|
+
restrictedHint: "将访问权限限制为你和下面邀请的人。"
|
|
3099
|
+
},
|
|
3100
|
+
addLabel: "邀请他人",
|
|
3101
|
+
addPlaceholder: "电子邮件或用户名",
|
|
3102
|
+
levelLabel: "访问权限",
|
|
3103
|
+
levelRead: "可查看",
|
|
3104
|
+
levelWrite: "可编辑",
|
|
3105
|
+
peopleLabel: "有权访问的人",
|
|
3106
|
+
loadingPeople: "正在加载…",
|
|
3107
|
+
noPeople: "尚未邀请任何人。",
|
|
3108
|
+
remove: "移除 {name}",
|
|
3109
|
+
linkHints: {
|
|
3110
|
+
inherit: "拥有工作区访问权限的人可以打开此链接。",
|
|
3111
|
+
public: "任何获得链接的人都可以打开此页面。",
|
|
3112
|
+
authenticated: "任何已登录的人打开此链接即可查看此页面。",
|
|
3113
|
+
members: "只有打开此链接的工作区成员才能查看此页面。",
|
|
3114
|
+
restricted: "只有你邀请的人才能打开此链接。"
|
|
3115
|
+
},
|
|
3116
|
+
copyLink: "复制链接",
|
|
3117
|
+
copied: "已复制",
|
|
3118
|
+
error: {
|
|
3119
|
+
network: "无法连接服务器。请检查你的网络连接后重试。",
|
|
3120
|
+
forbidden: "你没有权限更改此页面的共享设置。",
|
|
3121
|
+
notFound: "此页面已不存在。",
|
|
3122
|
+
generic: "出现了一些问题。请重试。"
|
|
3123
|
+
}
|
|
3124
|
+
},
|
|
3181
3125
|
command: {
|
|
3182
3126
|
title: "命令面板",
|
|
3183
3127
|
search: "搜索",
|
|
@@ -3687,11 +3631,64 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3687
3631
|
title: "登录与邮箱",
|
|
3688
3632
|
description: "邮箱和第三方登录(Google、GitHub、Apple)将随账户一起推出。目前还没有可登录的对象。"
|
|
3689
3633
|
},
|
|
3634
|
+
switcher: {
|
|
3635
|
+
heading: "账户",
|
|
3636
|
+
activeAccount: "当前账户",
|
|
3637
|
+
active: "使用中",
|
|
3638
|
+
syncing: "同步中…",
|
|
3639
|
+
error: "需要处理",
|
|
3640
|
+
dormant: "已登录",
|
|
3641
|
+
switchTo: "切换到 {name}",
|
|
3642
|
+
addAnother: "添加另一个账户",
|
|
3643
|
+
removeAccount: "从此设备移除 {name}",
|
|
3644
|
+
removeConfirmTitle: "移除 {name}?",
|
|
3645
|
+
removeConfirmBody: "这只会在此设备上忘记 {name}——随时重新登录即可恢复。你的其他账户和本地数据不受影响。",
|
|
3646
|
+
signOutActiveHint: "退出登录会在此设备上忘记当前账户;你的其他账户仍保持登录。若要彻底吊销某台设备,请在账户面板中将其移除。"
|
|
3647
|
+
},
|
|
3648
|
+
error: {
|
|
3649
|
+
rejected: "此次登录被拒绝。请重试。",
|
|
3650
|
+
rejectedReauth: "此次登录被拒绝。请重新登录。",
|
|
3651
|
+
unreachable: "无法连接 account.book.pub。请检查你的网络连接。",
|
|
3652
|
+
syncFailed: "同步失败——将在下次更改时重试。",
|
|
3653
|
+
invalidCode: "这看起来不是有效的代码。请粘贴浏览器中的代码(或完整的 openbook:// 链接)。"
|
|
3654
|
+
},
|
|
3655
|
+
nudge: {
|
|
3656
|
+
title: "同步并发布",
|
|
3657
|
+
body: "免费注册即可让你的偏好设置和工作区在多设备间保持同步——随后即可将你的作品发布到网络上。本地优先仍是默认。",
|
|
3658
|
+
cta: "免费开始",
|
|
3659
|
+
dismiss: "关闭"
|
|
3660
|
+
},
|
|
3690
3661
|
support: {
|
|
3691
3662
|
title: "支持 OpenBook",
|
|
3692
3663
|
description: "OpenBook 是独立的开源项目。分享它并提供反馈有助于它成长。赞助方式即将推出。"
|
|
3693
3664
|
}
|
|
3694
3665
|
},
|
|
3666
|
+
forwarding: {
|
|
3667
|
+
partialUnscoped: "转发已开启,但你的账户未签发限定到本站点的所有者令牌,因此严格的受众隔离仍处于关闭状态(为其他站点签发的令牌仍会被拒绝,隧道可正常使用)。",
|
|
3668
|
+
ensureRescope: "转发已恢复,但本次会话尚无法将你的所有者令牌限定到该站点。你现有的访问不受影响;若请求被拒绝,请重新登录。",
|
|
3669
|
+
bindFailed: "转发已开启,但未能完成站点受众的加固:{error}",
|
|
3670
|
+
unbindHeld: "关闭转发时未能完全解除受众绑定:{error}",
|
|
3671
|
+
title: "转发到网络",
|
|
3672
|
+
description: "获取一个私有的 ✦.book.pub 地址,即可在任意浏览器中打开本设备的图书 —— 无需托管,也无需在网络中暴露。",
|
|
3673
|
+
toggle: "转发本设备",
|
|
3674
|
+
signInHint: "请先登录你的账户以获取地址。",
|
|
3675
|
+
signIn: "登录",
|
|
3676
|
+
registering: "连接中…",
|
|
3677
|
+
address: "你的地址",
|
|
3678
|
+
addressHint: "只要设备在线,就能在任意浏览器中打开本设备的图书。",
|
|
3679
|
+
copy: "复制",
|
|
3680
|
+
copied: "已复制",
|
|
3681
|
+
failed: "注册失败:{error}",
|
|
3682
|
+
claimWarning: "首次开启时,本设备的图书将归属到你的账户并默认设为私有 —— 只有你和你邀请的成员可以打开。此操作无法撤销。",
|
|
3683
|
+
claimRefusedUnverified: "要发布,需先验证你的账户身份。",
|
|
3684
|
+
refreshIdentity: "刷新身份",
|
|
3685
|
+
claimFailed: "无法将本设备归属到你的账户,因此未发布。请重试。",
|
|
3686
|
+
status: {
|
|
3687
|
+
live: "在线",
|
|
3688
|
+
connecting: "连接中",
|
|
3689
|
+
offline: "离线"
|
|
3690
|
+
}
|
|
3691
|
+
},
|
|
3695
3692
|
connection: {
|
|
3696
3693
|
title: "连接",
|
|
3697
3694
|
description: "选择本设备读写页面的位置。",
|
|
@@ -3727,6 +3724,43 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3727
3724
|
resetConfirmBody: "这将清除本设备上的外观、语言和布局设置并重新加载。你的页面和工作区不受影响。",
|
|
3728
3725
|
resetConfirmButton: "重置"
|
|
3729
3726
|
},
|
|
3727
|
+
members: {
|
|
3728
|
+
title: "成员",
|
|
3729
|
+
description: "在此工作区拥有角色的人员。可通过邮箱或句柄邀请、更改管理权限并移除访问权限。",
|
|
3730
|
+
youUser: "你已登录为 {name}。",
|
|
3731
|
+
youGuest: "你正在以访客身份浏览。",
|
|
3732
|
+
loading: "正在加载成员…",
|
|
3733
|
+
empty: "还没有成员。在上方邀请某人即可开始。",
|
|
3734
|
+
loadError: "无法加载成员 — {error}",
|
|
3735
|
+
retry: "重试",
|
|
3736
|
+
unavailable: "此工作区的服务器尚不支持成员功能。",
|
|
3737
|
+
lockedTitle: "成员由管理员管理",
|
|
3738
|
+
locked: "请联系工作区管理员邀请你或更改角色。",
|
|
3739
|
+
lockedRoleOwner: "无法更改所有者的角色",
|
|
3740
|
+
lockedRoleSelf: "无法在此更改你自己的角色",
|
|
3741
|
+
lockedRemoveOwner: "无法移除所有者",
|
|
3742
|
+
lockedRemoveSelf: "无法移除你自己",
|
|
3743
|
+
inviteLabel: "邀请成员",
|
|
3744
|
+
inviteHint: "输入邮箱地址或句柄(iss#sub)。邮箱邀请将在对方首次登录时生效。",
|
|
3745
|
+
invitePlaceholder: "name@example.com 或 iss#sub",
|
|
3746
|
+
inviteRole: "邀请的角色",
|
|
3747
|
+
invite: "邀请",
|
|
3748
|
+
inviteError: "无法邀请 — {error}",
|
|
3749
|
+
listLabel: "当前成员",
|
|
3750
|
+
roleAdmin: "管理员",
|
|
3751
|
+
roleViewer: "查看者",
|
|
3752
|
+
changeRole: "更改 {name} 的角色",
|
|
3753
|
+
statusActive: "活跃",
|
|
3754
|
+
statusInvited: "已邀请",
|
|
3755
|
+
statusSuspended: "已暂停",
|
|
3756
|
+
you: "你",
|
|
3757
|
+
owner: "所有者",
|
|
3758
|
+
remove: "移除 {name}",
|
|
3759
|
+
removeTitle: "移除 {name}?",
|
|
3760
|
+
removeBody: "此人将失去在此工作区的角色。邮箱邀请稍后可重新发送。",
|
|
3761
|
+
removeConfirm: "移除",
|
|
3762
|
+
actionError: "无法更新成员 — {error}"
|
|
3763
|
+
},
|
|
3730
3764
|
properties: {
|
|
3731
3765
|
owner: "负责人",
|
|
3732
3766
|
setOwner: "设置负责人",
|
|
@@ -3742,7 +3776,7 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3742
3776
|
noBacklinks: "还没有反向链接",
|
|
3743
3777
|
refresh: "刷新"
|
|
3744
3778
|
}
|
|
3745
|
-
},
|
|
3779
|
+
}, Mr = [
|
|
3746
3780
|
{
|
|
3747
3781
|
code: "en",
|
|
3748
3782
|
name: "English"
|
|
@@ -3760,77 +3794,686 @@ var ri = "openbook.forwarding.enabled", ii = o({
|
|
|
3760
3794
|
name: "中文"
|
|
3761
3795
|
}
|
|
3762
3796
|
];
|
|
3763
|
-
function
|
|
3797
|
+
function Nr(e, t = "", n = {}) {
|
|
3764
3798
|
for (let [r, i] of Object.entries(e)) {
|
|
3765
3799
|
let e = t ? `${t}.${r}` : r;
|
|
3766
|
-
typeof i == "string" ? n[e] = i : i && typeof i == "object" &&
|
|
3800
|
+
typeof i == "string" ? n[e] = i : i && typeof i == "object" && Nr(i, e, n);
|
|
3767
3801
|
}
|
|
3768
3802
|
return n;
|
|
3769
3803
|
}
|
|
3770
|
-
var
|
|
3771
|
-
en:
|
|
3772
|
-
de:
|
|
3773
|
-
ja:
|
|
3774
|
-
zh:
|
|
3804
|
+
var Pr = {
|
|
3805
|
+
en: Nr(Or),
|
|
3806
|
+
de: Nr(kr),
|
|
3807
|
+
ja: Nr(Ar),
|
|
3808
|
+
zh: Nr(jr)
|
|
3775
3809
|
};
|
|
3776
|
-
function
|
|
3810
|
+
function Fr(e, t) {
|
|
3777
3811
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
3778
3812
|
}
|
|
3779
|
-
var
|
|
3780
|
-
|
|
3781
|
-
},
|
|
3813
|
+
var Ir = "en", Lr = () => Ir, Rr = (e) => {
|
|
3814
|
+
Ir = e;
|
|
3815
|
+
}, zr = new Set([
|
|
3782
3816
|
"en",
|
|
3783
3817
|
"de",
|
|
3784
3818
|
"ja",
|
|
3785
3819
|
"zh"
|
|
3786
3820
|
]);
|
|
3787
|
-
function
|
|
3821
|
+
function Br(e) {
|
|
3788
3822
|
let t = (e ?? "").toLowerCase().split("-")[0];
|
|
3789
|
-
return
|
|
3823
|
+
return zr.has(t) ? t : "en";
|
|
3824
|
+
}
|
|
3825
|
+
function X(e, t) {
|
|
3826
|
+
let n = e, r = Pr[Ir][n] ?? Pr.en[n] ?? n;
|
|
3827
|
+
return t ? Fr(r, t) : r;
|
|
3828
|
+
}
|
|
3829
|
+
//#endregion
|
|
3830
|
+
//#region src/providers/AccountProvider.tsx
|
|
3831
|
+
var Vr = o(null), Hr = "openbook.deviceId", Ur = "openbook.accounts", Wr = "openbook.accounts.active", Gr = "openbook.account", Kr = "openbook.account.token.", qr = "openbook.account", Jr = "openbook.account.handoff";
|
|
3832
|
+
function Yr(e, t, n) {
|
|
3833
|
+
let r = {
|
|
3834
|
+
type: "openbook-account-token",
|
|
3835
|
+
token: e,
|
|
3836
|
+
state: t
|
|
3837
|
+
};
|
|
3838
|
+
if (n === "broadcast") try {
|
|
3839
|
+
let e = new BroadcastChannel(qr);
|
|
3840
|
+
e.postMessage(r), e.close();
|
|
3841
|
+
} catch {}
|
|
3842
|
+
try {
|
|
3843
|
+
n === "storage" && localStorage.setItem(Jr, JSON.stringify(r));
|
|
3844
|
+
} catch {}
|
|
3845
|
+
}
|
|
3846
|
+
function Xr(e) {
|
|
3847
|
+
let t = (e ?? "").trim();
|
|
3848
|
+
if (!t) return null;
|
|
3849
|
+
let n = t.match(/[#?&]token=([^&\s#]+)/) ?? t.match(/^token=([^&\s#]+)/);
|
|
3850
|
+
if (n) try {
|
|
3851
|
+
return decodeURIComponent(n[1]);
|
|
3852
|
+
} catch {
|
|
3853
|
+
return n[1];
|
|
3854
|
+
}
|
|
3855
|
+
return /\s/.test(t) || t.includes("://") ? null : t;
|
|
3856
|
+
}
|
|
3857
|
+
var Zr = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
|
|
3858
|
+
function Qr() {
|
|
3859
|
+
if (typeof localStorage > "u") return "web";
|
|
3860
|
+
let e = localStorage.getItem(Hr);
|
|
3861
|
+
return e || (e = Zr().slice(0, 12), localStorage.setItem(Hr, e)), e;
|
|
3862
|
+
}
|
|
3863
|
+
var $r = () => Zr().slice(0, 12);
|
|
3864
|
+
function ei(e) {
|
|
3865
|
+
try {
|
|
3866
|
+
return new URL(e).host || e;
|
|
3867
|
+
} catch {
|
|
3868
|
+
return e.replace(/^https?:\/\//, "");
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
function ti() {
|
|
3872
|
+
if (typeof localStorage > "u") return [];
|
|
3873
|
+
try {
|
|
3874
|
+
let e = localStorage.getItem(Ur);
|
|
3875
|
+
if (!e) return [];
|
|
3876
|
+
let t = JSON.parse(e);
|
|
3877
|
+
return Array.isArray(t) ? t.filter((e) => !!e && typeof e.id == "string") : [];
|
|
3878
|
+
} catch {
|
|
3879
|
+
return [];
|
|
3880
|
+
}
|
|
3881
|
+
}
|
|
3882
|
+
function ni(e) {
|
|
3883
|
+
try {
|
|
3884
|
+
localStorage.setItem(Ur, JSON.stringify(e));
|
|
3885
|
+
} catch {}
|
|
3886
|
+
}
|
|
3887
|
+
function ri() {
|
|
3888
|
+
if (typeof localStorage > "u") return null;
|
|
3889
|
+
try {
|
|
3890
|
+
return localStorage.getItem(Wr) || null;
|
|
3891
|
+
} catch {
|
|
3892
|
+
return null;
|
|
3893
|
+
}
|
|
3894
|
+
}
|
|
3895
|
+
function ii(e) {
|
|
3896
|
+
try {
|
|
3897
|
+
e ? localStorage.setItem(Wr, e) : localStorage.removeItem(Wr);
|
|
3898
|
+
} catch {}
|
|
3899
|
+
}
|
|
3900
|
+
function ai() {
|
|
3901
|
+
if (typeof localStorage > "u") return null;
|
|
3902
|
+
try {
|
|
3903
|
+
let e = localStorage.getItem(Gr);
|
|
3904
|
+
if (!e) return null;
|
|
3905
|
+
let t = JSON.parse(e);
|
|
3906
|
+
return t && typeof t.token == "string" && t.token ? {
|
|
3907
|
+
token: t.token,
|
|
3908
|
+
connectedAt: t.connectedAt,
|
|
3909
|
+
lastServerUpdatedAt: t.lastServerUpdatedAt ?? null
|
|
3910
|
+
} : null;
|
|
3911
|
+
} catch {
|
|
3912
|
+
return null;
|
|
3913
|
+
}
|
|
3914
|
+
}
|
|
3915
|
+
function oi() {
|
|
3916
|
+
return {
|
|
3917
|
+
async get(e) {
|
|
3918
|
+
try {
|
|
3919
|
+
return typeof localStorage < "u" ? localStorage.getItem(Kr + e) : null;
|
|
3920
|
+
} catch {
|
|
3921
|
+
return null;
|
|
3922
|
+
}
|
|
3923
|
+
},
|
|
3924
|
+
async set(e, t) {
|
|
3925
|
+
try {
|
|
3926
|
+
localStorage.setItem(Kr + e, t);
|
|
3927
|
+
} catch {}
|
|
3928
|
+
},
|
|
3929
|
+
async delete(e) {
|
|
3930
|
+
try {
|
|
3931
|
+
localStorage.removeItem(Kr + e);
|
|
3932
|
+
} catch {}
|
|
3933
|
+
}
|
|
3934
|
+
};
|
|
3935
|
+
}
|
|
3936
|
+
var si = "openbook.account.pending", ci = 600 * 1e3;
|
|
3937
|
+
function li(e) {
|
|
3938
|
+
try {
|
|
3939
|
+
sessionStorage.setItem(si, JSON.stringify({
|
|
3940
|
+
state: e,
|
|
3941
|
+
at: Date.now()
|
|
3942
|
+
}));
|
|
3943
|
+
} catch {}
|
|
3944
|
+
}
|
|
3945
|
+
function ui() {
|
|
3946
|
+
try {
|
|
3947
|
+
let e = sessionStorage.getItem(si);
|
|
3948
|
+
if (!e) return null;
|
|
3949
|
+
let t = JSON.parse(e);
|
|
3950
|
+
if (typeof t.state == "string" && typeof t.at == "number" && Date.now() - t.at < ci) return t.state;
|
|
3951
|
+
} catch {}
|
|
3952
|
+
return null;
|
|
3953
|
+
}
|
|
3954
|
+
function di() {
|
|
3955
|
+
try {
|
|
3956
|
+
sessionStorage.removeItem(si);
|
|
3957
|
+
} catch {}
|
|
3958
|
+
}
|
|
3959
|
+
function fi() {
|
|
3960
|
+
let e = x();
|
|
3961
|
+
if (e) try {
|
|
3962
|
+
return new URL(e).host || void 0;
|
|
3963
|
+
} catch {
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
}
|
|
3967
|
+
var pi = ({ children: e }) => {
|
|
3968
|
+
let { account: t } = sr(), { preferences: n, update: r } = hr(), { workspaces: i, replaceWorkspaces: a } = Er(), [o, c] = f("disconnected"), [m, h] = f(null), [g, _] = f(null), [te, y] = f(null), [b, x] = f(() => ti()), [C, w] = f(() => ri()), E = u(() => new ee(), []), D = u(() => S(), []), O = u(() => `OpenBook ${t?.redirectUri?.startsWith("openbook:") ? "Desktop" : "Web"} · ${Qr()}`, [t]), k = u(() => t?.secretStore ?? oi(), [t]), A = d(k);
|
|
3969
|
+
A.current = k;
|
|
3970
|
+
let j = d(null), M = d(null), N = d(/* @__PURE__ */ new Map()), P = d(0), F = d({
|
|
3971
|
+
preferences: n,
|
|
3972
|
+
workspaces: i
|
|
3973
|
+
});
|
|
3974
|
+
F.current = {
|
|
3975
|
+
preferences: n,
|
|
3976
|
+
workspaces: i
|
|
3977
|
+
};
|
|
3978
|
+
let I = s(() => ({
|
|
3979
|
+
preferences: F.current.preferences,
|
|
3980
|
+
workspaces: F.current.workspaces
|
|
3981
|
+
}), []), L = d(b);
|
|
3982
|
+
L.current = b;
|
|
3983
|
+
let R = s((e) => {
|
|
3984
|
+
L.current = e, x(e), ni(e);
|
|
3985
|
+
}, []), ie = s((e) => R([...L.current.filter((t) => t.id !== e.id), e]), [R]), z = s((e, t) => R(L.current.map((n) => n.id === e ? {
|
|
3986
|
+
...n,
|
|
3987
|
+
...t
|
|
3988
|
+
} : n)), [R]), B = d(C);
|
|
3989
|
+
B.current = C;
|
|
3990
|
+
let V = s((e) => {
|
|
3991
|
+
B.current = e, w(e), ii(e);
|
|
3992
|
+
}, []), ae = s((e) => {
|
|
3993
|
+
let t = F.current.preferences;
|
|
3994
|
+
if (e.preferences && typeof e.preferences == "object") {
|
|
3995
|
+
let n = e.preferences;
|
|
3996
|
+
t = lr(t, n), r(n);
|
|
3997
|
+
}
|
|
3998
|
+
let n = F.current.workspaces;
|
|
3999
|
+
return Array.isArray(e.workspaces) && (n = a(e.workspaces)), {
|
|
4000
|
+
preferences: t,
|
|
4001
|
+
workspaces: n
|
|
4002
|
+
};
|
|
4003
|
+
}, [r, a]), oe = s(async (e, t) => {
|
|
4004
|
+
let { settings: n, updatedAt: r } = await E.getSettings(e);
|
|
4005
|
+
if (r === null || !n.preferences && !n.workspaces) {
|
|
4006
|
+
if (t) {
|
|
4007
|
+
let t = I(), n = await E.putSettings(e, t);
|
|
4008
|
+
return M.current = JSON.stringify(t), n.updatedAt;
|
|
4009
|
+
}
|
|
4010
|
+
return M.current = JSON.stringify(I()), r;
|
|
4011
|
+
}
|
|
4012
|
+
return M.current = JSON.stringify(ae(n)), r;
|
|
4013
|
+
}, [
|
|
4014
|
+
E,
|
|
4015
|
+
I,
|
|
4016
|
+
ae
|
|
4017
|
+
]), H = d(null), se = s(async (e) => {
|
|
4018
|
+
try {
|
|
4019
|
+
let t = re() ?? fi(), n = await E.getIdentityToken(e, t);
|
|
4020
|
+
if (T(n?.identity ?? null), H.current && clearTimeout(H.current), !n) return null;
|
|
4021
|
+
let r = Math.max(3e4, new Date(n.expiresAt).getTime() - Date.now() - 6e4);
|
|
4022
|
+
H.current = setTimeout(() => void U.current(e), r);
|
|
4023
|
+
let i = ne(n.identity);
|
|
4024
|
+
return i ? {
|
|
4025
|
+
subject: `${i.claims.iss}#${i.claims.sub}`,
|
|
4026
|
+
email: i.claims.email ? i.claims.email.toLowerCase() : null,
|
|
4027
|
+
name: i.claims.name ?? null,
|
|
4028
|
+
aud: i.claims.aud ?? null
|
|
4029
|
+
} : null;
|
|
4030
|
+
} catch {
|
|
4031
|
+
return null;
|
|
4032
|
+
}
|
|
4033
|
+
}, [E]), U = d(se);
|
|
4034
|
+
U.current = se;
|
|
4035
|
+
let W = s(() => {
|
|
4036
|
+
H.current && clearTimeout(H.current), H.current = null, T(null);
|
|
4037
|
+
}, []), G = d(async () => {}), K = d(async () => {});
|
|
4038
|
+
K.current = s(async (e) => {
|
|
4039
|
+
let t = B.current === e;
|
|
4040
|
+
t && W();
|
|
4041
|
+
try {
|
|
4042
|
+
await A.current.delete(e);
|
|
4043
|
+
} catch {}
|
|
4044
|
+
N.current.delete(e);
|
|
4045
|
+
let n = L.current.filter((t) => t.id !== e);
|
|
4046
|
+
if (R(n), !t) return;
|
|
4047
|
+
let r = n[0];
|
|
4048
|
+
if (r) {
|
|
4049
|
+
let e = N.current.get(r.id) ?? await A.current.get(r.id);
|
|
4050
|
+
if (e) {
|
|
4051
|
+
await G.current(r.id, e);
|
|
4052
|
+
return;
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
M.current = null, h(null), _(null), V(null), c("disconnected");
|
|
4056
|
+
}, [
|
|
4057
|
+
R,
|
|
4058
|
+
V,
|
|
4059
|
+
W
|
|
4060
|
+
]), G.current = s(async (e, t) => {
|
|
4061
|
+
P.current += 1, c("syncing"), y(null), V(e), h(t), N.current.set(e, t);
|
|
4062
|
+
try {
|
|
4063
|
+
let n = await oe(t, !1);
|
|
4064
|
+
z(e, { lastServerUpdatedAt: n }), _(n), c("connected");
|
|
4065
|
+
let r = await U.current(t);
|
|
4066
|
+
if (r) {
|
|
4067
|
+
let t = L.current.find((t) => t.id === e);
|
|
4068
|
+
z(e, {
|
|
4069
|
+
email: r.email,
|
|
4070
|
+
subject: r.subject,
|
|
4071
|
+
name: r.email ?? r.name ?? t?.name ?? ei(D)
|
|
4072
|
+
});
|
|
4073
|
+
}
|
|
4074
|
+
} catch (t) {
|
|
4075
|
+
t instanceof v && t.status === 401 ? (c("error"), y(X("account.error.rejectedReauth")), await K.current(e)) : (c("error"), y(X("account.error.unreachable")));
|
|
4076
|
+
} finally {
|
|
4077
|
+
P.current = Math.max(0, P.current - 1);
|
|
4078
|
+
}
|
|
4079
|
+
}, [
|
|
4080
|
+
V,
|
|
4081
|
+
oe,
|
|
4082
|
+
z,
|
|
4083
|
+
D
|
|
4084
|
+
]);
|
|
4085
|
+
let ce = s(async (e) => {
|
|
4086
|
+
P.current += 1;
|
|
4087
|
+
let t = L.current.length === 0;
|
|
4088
|
+
c("syncing"), y(null);
|
|
4089
|
+
try {
|
|
4090
|
+
let n = await oe(e, t), r = await U.current(e), i = r?.subject ? L.current.find((e) => e.subject === r.subject) : L.current.find((e) => e.subject === null && e.accountUrl === D), a = i?.id ?? $r(), o = {
|
|
4091
|
+
id: a,
|
|
4092
|
+
name: r?.email ?? r?.name ?? i?.name ?? ei(D),
|
|
4093
|
+
email: r?.email ?? null,
|
|
4094
|
+
subject: r?.subject ?? i?.subject ?? null,
|
|
4095
|
+
accountUrl: D,
|
|
4096
|
+
connectedAt: Date.now(),
|
|
4097
|
+
lastServerUpdatedAt: n
|
|
4098
|
+
};
|
|
4099
|
+
await k.set(a, e), N.current.set(a, e), ie(o), V(a), h(e), _(n), c("connected");
|
|
4100
|
+
} catch (e) {
|
|
4101
|
+
e instanceof v && e.status === 401 ? (W(), c("error"), y(X("account.error.rejected"))) : (c(B.current ? "connected" : "disconnected"), y(X("account.error.unreachable")));
|
|
4102
|
+
} finally {
|
|
4103
|
+
P.current = Math.max(0, P.current - 1);
|
|
4104
|
+
}
|
|
4105
|
+
}, [
|
|
4106
|
+
oe,
|
|
4107
|
+
k,
|
|
4108
|
+
ie,
|
|
4109
|
+
V,
|
|
4110
|
+
W,
|
|
4111
|
+
D
|
|
4112
|
+
]), le = s((e, t) => {
|
|
4113
|
+
let n = j.current ?? ui();
|
|
4114
|
+
!e || !n || !t || t !== n || (j.current = null, di(), ce(e));
|
|
4115
|
+
}, [ce]);
|
|
4116
|
+
l(() => {
|
|
4117
|
+
if (t?.onCallback) return t.onCallback(({ token: e, state: t }) => le(e, t));
|
|
4118
|
+
if (typeof window > "u") return;
|
|
4119
|
+
let e = (e) => {
|
|
4120
|
+
let t = e;
|
|
4121
|
+
t?.type === "openbook-account-token" && typeof t.token == "string" && le(t.token, t.state ?? "");
|
|
4122
|
+
}, n = typeof BroadcastChannel < "u" ? new BroadcastChannel(qr) : null;
|
|
4123
|
+
n?.addEventListener("message", (t) => e(t.data));
|
|
4124
|
+
let r = (t) => {
|
|
4125
|
+
if (t.key === "openbook.account.handoff" && t.newValue) try {
|
|
4126
|
+
e(JSON.parse(t.newValue));
|
|
4127
|
+
} catch {}
|
|
4128
|
+
};
|
|
4129
|
+
window.addEventListener("storage", r);
|
|
4130
|
+
try {
|
|
4131
|
+
let t = localStorage.getItem(Jr);
|
|
4132
|
+
t && (localStorage.removeItem(Jr), e(JSON.parse(t)));
|
|
4133
|
+
} catch {}
|
|
4134
|
+
return () => {
|
|
4135
|
+
n?.close(), window.removeEventListener("storage", r);
|
|
4136
|
+
};
|
|
4137
|
+
}, [t, le]), l(() => {
|
|
4138
|
+
(async () => {
|
|
4139
|
+
let e = ti(), t = ri();
|
|
4140
|
+
if (e.length === 0) {
|
|
4141
|
+
let n = ai();
|
|
4142
|
+
if (n) {
|
|
4143
|
+
let r = $r(), i = {
|
|
4144
|
+
id: r,
|
|
4145
|
+
name: ei(S()),
|
|
4146
|
+
email: null,
|
|
4147
|
+
subject: null,
|
|
4148
|
+
accountUrl: S(),
|
|
4149
|
+
connectedAt: n.connectedAt ?? Date.now(),
|
|
4150
|
+
lastServerUpdatedAt: n.lastServerUpdatedAt ?? null
|
|
4151
|
+
}, a = !1;
|
|
4152
|
+
try {
|
|
4153
|
+
await A.current.set(r, n.token), a = !0;
|
|
4154
|
+
} catch {}
|
|
4155
|
+
if (a) {
|
|
4156
|
+
e = [i], t = r, ni(e), ii(t);
|
|
4157
|
+
try {
|
|
4158
|
+
localStorage.removeItem(Gr);
|
|
4159
|
+
} catch {}
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4162
|
+
}
|
|
4163
|
+
!t && e.length && (t = e[0].id), e.length && (L.current = e, x(e));
|
|
4164
|
+
let n = t ? e.find((e) => e.id === t) : void 0;
|
|
4165
|
+
if (!n) return;
|
|
4166
|
+
V(n.id), _(n.lastServerUpdatedAt);
|
|
4167
|
+
let r = await A.current.get(n.id);
|
|
4168
|
+
r && await G.current(n.id, r);
|
|
4169
|
+
})();
|
|
4170
|
+
}, []), l(() => {
|
|
4171
|
+
if (!m || P.current > 0) return;
|
|
4172
|
+
let e = {
|
|
4173
|
+
preferences: n,
|
|
4174
|
+
workspaces: i
|
|
4175
|
+
}, t = JSON.stringify(e);
|
|
4176
|
+
if (t === M.current) return;
|
|
4177
|
+
let r = setTimeout(() => {
|
|
4178
|
+
t === M.current || P.current > 0 || (c("syncing"), E.putSettings(m, e).then((e) => {
|
|
4179
|
+
M.current = t, _(e.updatedAt), c("connected"), y(null);
|
|
4180
|
+
let n = B.current;
|
|
4181
|
+
n && z(n, { lastServerUpdatedAt: e.updatedAt });
|
|
4182
|
+
}).catch(() => {
|
|
4183
|
+
c("error"), y(X("account.error.syncFailed"));
|
|
4184
|
+
}));
|
|
4185
|
+
}, 1200);
|
|
4186
|
+
return () => clearTimeout(r);
|
|
4187
|
+
}, [
|
|
4188
|
+
m,
|
|
4189
|
+
n,
|
|
4190
|
+
i,
|
|
4191
|
+
E,
|
|
4192
|
+
z
|
|
4193
|
+
]);
|
|
4194
|
+
let ue = s(() => {
|
|
4195
|
+
let e = Zr();
|
|
4196
|
+
j.current = e, li(e), c("connecting"), y(null);
|
|
4197
|
+
let n = t?.redirectUri ?? (typeof window < "u" ? `${window.location.origin}/account/callback` : ""), r = E.connectUrl({
|
|
4198
|
+
redirectUri: n,
|
|
4199
|
+
state: e,
|
|
4200
|
+
name: O
|
|
4201
|
+
});
|
|
4202
|
+
t?.openSignIn ? t.openSignIn(r) : typeof window < "u" && (window.open(r, "openbook-signin", "width=520,height=720") || (window.location.href = r));
|
|
4203
|
+
}, [
|
|
4204
|
+
E,
|
|
4205
|
+
O,
|
|
4206
|
+
t
|
|
4207
|
+
]), de = s((e) => {
|
|
4208
|
+
let t = Xr(e);
|
|
4209
|
+
if (!t) {
|
|
4210
|
+
c((e) => m ? e : "error"), y(X("account.error.invalidCode"));
|
|
4211
|
+
return;
|
|
4212
|
+
}
|
|
4213
|
+
j.current = null, di(), c("connecting"), y(null), ce(t);
|
|
4214
|
+
}, [ce, m]), fe = s(() => {
|
|
4215
|
+
j.current = null, di(), c((e) => m ? e : "disconnected"), y(null);
|
|
4216
|
+
}, [m]), pe = s(() => {
|
|
4217
|
+
j.current = null, di(), M.current = null, y(null);
|
|
4218
|
+
let e = B.current;
|
|
4219
|
+
e ? K.current(e) : (W(), h(null), _(null), c("disconnected"));
|
|
4220
|
+
}, [W]), me = s(() => {
|
|
4221
|
+
let e = B.current;
|
|
4222
|
+
e && m && G.current(e, m);
|
|
4223
|
+
}, [m]), he = s((e) => {
|
|
4224
|
+
e !== B.current && L.current.some((t) => t.id === e) && (async () => {
|
|
4225
|
+
W();
|
|
4226
|
+
let t = N.current.get(e) ?? await A.current.get(e);
|
|
4227
|
+
if (!t) {
|
|
4228
|
+
await K.current(e);
|
|
4229
|
+
return;
|
|
4230
|
+
}
|
|
4231
|
+
await G.current(e, t);
|
|
4232
|
+
})();
|
|
4233
|
+
}, [W]), ge = s((e) => {
|
|
4234
|
+
K.current(e);
|
|
4235
|
+
}, []), _e = u(() => b.map((e) => ({
|
|
4236
|
+
id: e.id,
|
|
4237
|
+
name: e.name,
|
|
4238
|
+
email: e.email,
|
|
4239
|
+
accountUrl: e.accountUrl,
|
|
4240
|
+
status: e.id === C ? o : "connected"
|
|
4241
|
+
})), [
|
|
4242
|
+
b,
|
|
4243
|
+
C,
|
|
4244
|
+
o
|
|
4245
|
+
]), ve = u(() => b.find((e) => e.id === C)?.accountUrl ?? D, [
|
|
4246
|
+
b,
|
|
4247
|
+
C,
|
|
4248
|
+
D
|
|
4249
|
+
]), ye = s(async () => m ? (await U.current(m))?.aud ?? null : null, [m]), be = u(() => ({
|
|
4250
|
+
status: o,
|
|
4251
|
+
connected: !!m && (o === "connected" || o === "syncing"),
|
|
4252
|
+
token: m,
|
|
4253
|
+
deviceName: O,
|
|
4254
|
+
lastSyncedAt: g,
|
|
4255
|
+
error: te,
|
|
4256
|
+
accountUrl: ve,
|
|
4257
|
+
signIn: ue,
|
|
4258
|
+
submitCode: de,
|
|
4259
|
+
cancel: fe,
|
|
4260
|
+
signOut: pe,
|
|
4261
|
+
syncNow: me,
|
|
4262
|
+
accounts: _e,
|
|
4263
|
+
activeAccountId: C,
|
|
4264
|
+
setActiveAccount: he,
|
|
4265
|
+
addAccount: ue,
|
|
4266
|
+
removeAccount: ge,
|
|
4267
|
+
remintIdentity: ye
|
|
4268
|
+
}), [
|
|
4269
|
+
o,
|
|
4270
|
+
m,
|
|
4271
|
+
O,
|
|
4272
|
+
g,
|
|
4273
|
+
te,
|
|
4274
|
+
ve,
|
|
4275
|
+
ue,
|
|
4276
|
+
de,
|
|
4277
|
+
fe,
|
|
4278
|
+
pe,
|
|
4279
|
+
me,
|
|
4280
|
+
_e,
|
|
4281
|
+
C,
|
|
4282
|
+
he,
|
|
4283
|
+
ge,
|
|
4284
|
+
ye
|
|
4285
|
+
]);
|
|
4286
|
+
return /* @__PURE__ */ p(Vr.Provider, {
|
|
4287
|
+
value: be,
|
|
4288
|
+
children: e
|
|
4289
|
+
});
|
|
4290
|
+
}, mi = () => {
|
|
4291
|
+
let e = c(Vr);
|
|
4292
|
+
if (!e) throw Error("useAccount must be used within an <AccountProvider>");
|
|
4293
|
+
return e;
|
|
4294
|
+
}, hi = D.Root, gi = D.Trigger, _i = D.Portal, vi = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(D.Overlay, {
|
|
4295
|
+
ref: n,
|
|
4296
|
+
className: q("fixed inset-0 z-50 bg-background/80 backdrop-blur-[var(--overlay-blur)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", e),
|
|
4297
|
+
...t
|
|
4298
|
+
}));
|
|
4299
|
+
vi.displayName = D.Overlay.displayName;
|
|
4300
|
+
var yi = i.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ m(_i, { children: [/* @__PURE__ */ p(vi, {}), /* @__PURE__ */ p("div", {
|
|
4301
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
4302
|
+
children: /* @__PURE__ */ m(D.Content, {
|
|
4303
|
+
ref: r,
|
|
4304
|
+
className: q("relative grid w-full max-w-lg gap-4 border bg-background p-6 shadow-overlay duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg", e),
|
|
4305
|
+
...n,
|
|
4306
|
+
children: [t, /* @__PURE__ */ m(D.Close, {
|
|
4307
|
+
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-hover data-[state=open]:text-muted-foreground",
|
|
4308
|
+
children: [/* @__PURE__ */ p(_, { className: "h-4 w-4" }), /* @__PURE__ */ p("span", {
|
|
4309
|
+
className: "sr-only",
|
|
4310
|
+
children: "Close"
|
|
4311
|
+
})]
|
|
4312
|
+
})]
|
|
4313
|
+
})
|
|
4314
|
+
})] }));
|
|
4315
|
+
yi.displayName = D.Content.displayName;
|
|
4316
|
+
var bi = ({ className: e, ...t }) => /* @__PURE__ */ p("div", {
|
|
4317
|
+
className: q("flex flex-col space-y-1.5 text-center sm:text-left", e),
|
|
4318
|
+
...t
|
|
4319
|
+
});
|
|
4320
|
+
bi.displayName = "DialogHeader";
|
|
4321
|
+
var xi = ({ className: e, ...t }) => /* @__PURE__ */ p("div", {
|
|
4322
|
+
className: q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
4323
|
+
...t
|
|
4324
|
+
});
|
|
4325
|
+
xi.displayName = "DialogFooter";
|
|
4326
|
+
var Si = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(D.Title, {
|
|
4327
|
+
ref: n,
|
|
4328
|
+
className: q("text-lg font-semibold leading-none tracking-tight", e),
|
|
4329
|
+
...t
|
|
4330
|
+
}));
|
|
4331
|
+
Si.displayName = D.Title.displayName;
|
|
4332
|
+
var Ci = i.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(D.Description, {
|
|
4333
|
+
ref: n,
|
|
4334
|
+
className: q("text-sm text-muted-foreground", e),
|
|
4335
|
+
...t
|
|
4336
|
+
}));
|
|
4337
|
+
Ci.displayName = D.Description.displayName;
|
|
4338
|
+
//#endregion
|
|
4339
|
+
//#region src/components/ui/button.tsx
|
|
4340
|
+
var wi = k("inline-flex items-center justify-center rounded-md text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] active:scale-[0.97] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100", {
|
|
4341
|
+
variants: {
|
|
4342
|
+
variant: {
|
|
4343
|
+
default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
4344
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
|
|
4345
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-hover hover:text-accent-foreground",
|
|
4346
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
4347
|
+
ghost: "hover:bg-hover hover:text-accent-foreground",
|
|
4348
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
4349
|
+
},
|
|
4350
|
+
size: {
|
|
4351
|
+
default: "h-9 px-4 py-2",
|
|
4352
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
4353
|
+
lg: "h-10 rounded-md px-8",
|
|
4354
|
+
icon: "h-9 w-9"
|
|
4355
|
+
}
|
|
4356
|
+
},
|
|
4357
|
+
defaultVariants: {
|
|
4358
|
+
variant: "default",
|
|
4359
|
+
size: "default"
|
|
4360
|
+
}
|
|
4361
|
+
}), Ti = i.forwardRef(({ className: e, variant: t, size: n, asChild: r = !1, ...i }, a) => /* @__PURE__ */ p(r ? O : "button", {
|
|
4362
|
+
className: q(wi({
|
|
4363
|
+
variant: t,
|
|
4364
|
+
size: n,
|
|
4365
|
+
className: e
|
|
4366
|
+
})),
|
|
4367
|
+
ref: a,
|
|
4368
|
+
...i
|
|
4369
|
+
}));
|
|
4370
|
+
Ti.displayName = "Button";
|
|
4371
|
+
//#endregion
|
|
4372
|
+
//#region src/providers/ConfirmProvider.tsx
|
|
4373
|
+
var Ei = o(null);
|
|
4374
|
+
function Di({ children: e }) {
|
|
4375
|
+
let [t, n] = f(null), r = d(null), i = s((e) => {
|
|
4376
|
+
r.current?.(e), r.current = null, n(null);
|
|
4377
|
+
}, []), a = s((e) => (r.current?.(!1), new Promise((t) => {
|
|
4378
|
+
r.current = t, n(e);
|
|
4379
|
+
})), []), o = s((e) => {
|
|
4380
|
+
e || i(!1);
|
|
4381
|
+
}, [i]);
|
|
4382
|
+
return /* @__PURE__ */ m(Ei.Provider, {
|
|
4383
|
+
value: a,
|
|
4384
|
+
children: [e, /* @__PURE__ */ p(hi, {
|
|
4385
|
+
open: t !== null,
|
|
4386
|
+
onOpenChange: o,
|
|
4387
|
+
children: t && /* @__PURE__ */ m(yi, {
|
|
4388
|
+
className: "sm:max-w-[420px]",
|
|
4389
|
+
children: [/* @__PURE__ */ m(bi, { children: [/* @__PURE__ */ p(Si, { children: t.title }), t.description && /* @__PURE__ */ p(Ci, { children: t.description })] }), /* @__PURE__ */ m(xi, { children: [!t.hideCancel && /* @__PURE__ */ p(Ti, {
|
|
4390
|
+
variant: "outline",
|
|
4391
|
+
onClick: () => i(!1),
|
|
4392
|
+
children: t.cancelText ?? "Cancel"
|
|
4393
|
+
}), /* @__PURE__ */ p(Ti, {
|
|
4394
|
+
variant: t.destructive ? "destructive" : "default",
|
|
4395
|
+
onClick: () => i(!0),
|
|
4396
|
+
children: t.confirmText ?? "Confirm"
|
|
4397
|
+
})] })]
|
|
4398
|
+
})
|
|
4399
|
+
})]
|
|
4400
|
+
});
|
|
4401
|
+
}
|
|
4402
|
+
function Oi() {
|
|
4403
|
+
let e = c(Ei);
|
|
4404
|
+
if (!e) throw Error("useConfirm must be used within a <ConfirmProvider>");
|
|
4405
|
+
return e;
|
|
4406
|
+
}
|
|
4407
|
+
//#endregion
|
|
4408
|
+
//#region src/providers/forwardingAudience.ts
|
|
4409
|
+
var ki = (e) => e instanceof Error ? e.message : String(e), Ai = "Forwarding is on, but your account did not issue a site-scoped owner token, so strict audience isolation stays off (a token minted for a different site is still rejected, and the tunnel works normally).", ji = "Forwarding resumed, but this session could not scope your owner token to the site yet. Your existing access is unchanged; sign in again if a request is refused.";
|
|
4410
|
+
async function Mi(e, t) {
|
|
4411
|
+
try {
|
|
4412
|
+
return await t.setInstancePolicy({
|
|
4413
|
+
audience: e,
|
|
4414
|
+
requireAudience: !1
|
|
4415
|
+
}), t.setLocalAudience(e), await t.remintIdentity() === e ? (await t.setInstancePolicy({ requireAudience: !0 }), { status: "bound" }) : {
|
|
4416
|
+
status: "partial",
|
|
4417
|
+
code: "partialUnscoped",
|
|
4418
|
+
reason: Ai
|
|
4419
|
+
};
|
|
4420
|
+
} catch (e) {
|
|
4421
|
+
try {
|
|
4422
|
+
await t.setInstancePolicy({ requireAudience: !1 });
|
|
4423
|
+
} catch {}
|
|
4424
|
+
return {
|
|
4425
|
+
status: "failed",
|
|
4426
|
+
code: "bindFailed",
|
|
4427
|
+
reason: ki(e)
|
|
4428
|
+
};
|
|
4429
|
+
}
|
|
3790
4430
|
}
|
|
3791
|
-
function
|
|
3792
|
-
let n =
|
|
3793
|
-
|
|
4431
|
+
async function Ni(e, t) {
|
|
4432
|
+
let n = null;
|
|
4433
|
+
try {
|
|
4434
|
+
n = await t.getInstanceInfo();
|
|
4435
|
+
} catch {
|
|
4436
|
+
n = null;
|
|
4437
|
+
}
|
|
4438
|
+
return n && n.audience === e && n.requireAudience ? (t.setLocalAudience(e), await t.remintIdentity() === e ? { status: "bound" } : {
|
|
4439
|
+
status: "partial",
|
|
4440
|
+
code: "ensureRescope",
|
|
4441
|
+
reason: ji
|
|
4442
|
+
}) : Mi(e, t);
|
|
3794
4443
|
}
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
if (
|
|
4444
|
+
var Pi = "To publish, your account identity needs to be verified first.", Fi = "Couldn’t claim this device for your account, so it wasn’t published. Try again.";
|
|
4445
|
+
async function Ii(e) {
|
|
4446
|
+
let t = await e.getInstanceInfo();
|
|
4447
|
+
if (t.ownerSubject) return { status: "already" };
|
|
4448
|
+
if (t.you.verifiedVia !== "jws") return {
|
|
4449
|
+
status: "refused",
|
|
4450
|
+
code: "unverified",
|
|
4451
|
+
reason: Pi
|
|
4452
|
+
};
|
|
3800
4453
|
try {
|
|
3801
|
-
|
|
3802
|
-
if (e) return ji(e);
|
|
4454
|
+
if ((await e.setInstancePolicy({ ownerSubject: t.you.subject })).ownerSubject) return { status: "claimed" };
|
|
3803
4455
|
} catch {}
|
|
3804
|
-
return
|
|
4456
|
+
return (await e.getInstanceInfo()).ownerSubject ? { status: "claimed" } : {
|
|
4457
|
+
status: "refused",
|
|
4458
|
+
code: "claim-failed",
|
|
4459
|
+
reason: Fi
|
|
4460
|
+
};
|
|
3805
4461
|
}
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
setLocale: r,
|
|
3822
|
-
t: Mi,
|
|
3823
|
-
locales: wi
|
|
3824
|
-
}), [t, r]);
|
|
3825
|
-
return /* @__PURE__ */ p(Ni.Provider, {
|
|
3826
|
-
value: i,
|
|
3827
|
-
children: e
|
|
3828
|
-
});
|
|
3829
|
-
}, Li = () => {
|
|
3830
|
-
let e = c(Ni);
|
|
3831
|
-
if (!e) throw Error("useTranslation must be used within an <I18nProvider>");
|
|
3832
|
-
return e;
|
|
3833
|
-
}, Ri = o(null), zi = ({ client: e, children: t }) => /* @__PURE__ */ p(Ri.Provider, {
|
|
4462
|
+
async function Li(e) {
|
|
4463
|
+
try {
|
|
4464
|
+
await e.setInstancePolicy({ requireAudience: !1 });
|
|
4465
|
+
} catch (e) {
|
|
4466
|
+
return {
|
|
4467
|
+
status: "held",
|
|
4468
|
+
code: "unbindHeld",
|
|
4469
|
+
reason: ki(e)
|
|
4470
|
+
};
|
|
4471
|
+
}
|
|
4472
|
+
return e.setLocalAudience(null), await e.remintIdentity(), { status: "relaxed" };
|
|
4473
|
+
}
|
|
4474
|
+
//#endregion
|
|
4475
|
+
//#region src/data/DataProvider.tsx
|
|
4476
|
+
var Ri = o(null), zi = ({ client: e, children: t }) => /* @__PURE__ */ p(Ri.Provider, {
|
|
3834
4477
|
value: e,
|
|
3835
4478
|
children: t
|
|
3836
4479
|
}), Bi = () => {
|
|
@@ -3865,154 +4508,424 @@ var Ii = ({ children: e }) => {
|
|
|
3865
4508
|
if (typeof localStorage > "u") throw Error("getOrCreateCurrentPageId requires a browser environment");
|
|
3866
4509
|
let e = localStorage.getItem(Hi);
|
|
3867
4510
|
return e || (e = crypto.randomUUID(), localStorage.setItem(Hi, e)), e;
|
|
3868
|
-
},
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
4511
|
+
}, Gi = "openbook.forwarding.enabled", Ki = o({
|
|
4512
|
+
supported: !1,
|
|
4513
|
+
enabled: !1,
|
|
4514
|
+
status: "idle",
|
|
4515
|
+
host: null,
|
|
4516
|
+
busy: !1,
|
|
4517
|
+
error: null,
|
|
4518
|
+
audienceNotice: null,
|
|
4519
|
+
claimRefusal: null,
|
|
4520
|
+
enable: async () => void 0,
|
|
4521
|
+
disable: () => void 0
|
|
4522
|
+
}), qi = () => typeof localStorage < "u" && localStorage.getItem(Gi) === "1", Ji = (e) => {
|
|
4523
|
+
typeof localStorage < "u" && localStorage.setItem(Gi, e ? "1" : "0");
|
|
4524
|
+
}, Yi = ({ children: e }) => {
|
|
4525
|
+
let { forwarding: t } = sr(), { connected: n, token: r, accountUrl: i, signIn: a, remintIdentity: o } = mi(), c = Bi(), m = !!t, h = d(null), [g, _] = f(() => qi()), [ee, v] = f("idle"), [ne, y] = f(null), [b, re] = f(!1), [x, S] = f(null), [w, T] = f(null), [E, D] = f(null);
|
|
4526
|
+
l(() => {
|
|
4527
|
+
t && t.keyStore.load().then((e) => e && y(e.host)).catch(() => void 0);
|
|
4528
|
+
}, [t]);
|
|
4529
|
+
let O = u(() => ({
|
|
4530
|
+
setInstancePolicy: (e) => c.setInstancePolicy(e),
|
|
4531
|
+
getInstanceInfo: () => c.getInstanceInfo(),
|
|
4532
|
+
remintIdentity: () => o(),
|
|
4533
|
+
setLocalAudience: C
|
|
4534
|
+
}), [c, o]), k = s(async (e) => {
|
|
4535
|
+
let t = await Ni(e, O);
|
|
4536
|
+
T(t.status === "bound" ? null : {
|
|
4537
|
+
code: t.code,
|
|
4538
|
+
detail: t.reason
|
|
4539
|
+
});
|
|
4540
|
+
}, [O]), A = s(async () => {
|
|
4541
|
+
if (!(!t || !r || h.current)) {
|
|
4542
|
+
re(!0), S(null), T(null), D(null);
|
|
4543
|
+
try {
|
|
4544
|
+
let e = await Ii(O);
|
|
4545
|
+
if (e.status === "refused") {
|
|
4546
|
+
_(!1), Ji(!1), v("offline"), D(e.code);
|
|
4547
|
+
return;
|
|
4548
|
+
}
|
|
4549
|
+
let n = new te({
|
|
4550
|
+
accountUrl: i,
|
|
4551
|
+
authToken: r,
|
|
4552
|
+
keyStore: t.keyStore,
|
|
4553
|
+
localOrigin: "",
|
|
4554
|
+
localFetchImpl: t.localFetch,
|
|
4555
|
+
onStatus: v
|
|
4556
|
+
});
|
|
4557
|
+
h.current = n;
|
|
4558
|
+
let { host: a } = await n.start();
|
|
4559
|
+
y(a), await k(a);
|
|
4560
|
+
} catch (e) {
|
|
4561
|
+
h.current = null, v("offline"), S(e instanceof Error ? e.message : String(e));
|
|
4562
|
+
} finally {
|
|
4563
|
+
re(!1);
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4566
|
+
}, [
|
|
4567
|
+
t,
|
|
4568
|
+
r,
|
|
4569
|
+
i,
|
|
4570
|
+
k,
|
|
4571
|
+
O
|
|
4572
|
+
]);
|
|
4573
|
+
l(() => {
|
|
4574
|
+
m && g && n && r && !h.current && A();
|
|
4575
|
+
}, [
|
|
4576
|
+
m,
|
|
4577
|
+
g,
|
|
4578
|
+
n,
|
|
4579
|
+
r,
|
|
4580
|
+
A
|
|
4581
|
+
]), l(() => () => h.current?.stop(), []);
|
|
4582
|
+
let j = s(async () => {
|
|
4583
|
+
if (!n || !r) {
|
|
4584
|
+
a();
|
|
4585
|
+
return;
|
|
4586
|
+
}
|
|
4587
|
+
_(!0), Ji(!0), await A();
|
|
4588
|
+
}, [
|
|
4589
|
+
n,
|
|
4590
|
+
r,
|
|
4591
|
+
a,
|
|
4592
|
+
A
|
|
4593
|
+
]), M = s(() => {
|
|
4594
|
+
h.current?.stop(), h.current = null, v("offline"), _(!1), Ji(!1), T(null), D(null), (async () => {
|
|
4595
|
+
let e = await Li(O);
|
|
4596
|
+
e.status === "held" && T({
|
|
4597
|
+
code: e.code,
|
|
4598
|
+
detail: e.reason
|
|
4599
|
+
});
|
|
4600
|
+
})();
|
|
4601
|
+
}, [O]), N = u(() => ({
|
|
4602
|
+
supported: m,
|
|
4603
|
+
enabled: g,
|
|
4604
|
+
status: ee,
|
|
4605
|
+
host: ne,
|
|
4606
|
+
busy: b,
|
|
4607
|
+
error: x,
|
|
4608
|
+
audienceNotice: w,
|
|
4609
|
+
claimRefusal: E,
|
|
4610
|
+
enable: j,
|
|
4611
|
+
disable: M
|
|
4612
|
+
}), [
|
|
4613
|
+
m,
|
|
4614
|
+
g,
|
|
4615
|
+
ee,
|
|
4616
|
+
ne,
|
|
4617
|
+
b,
|
|
4618
|
+
x,
|
|
4619
|
+
w,
|
|
4620
|
+
E,
|
|
4621
|
+
j,
|
|
4622
|
+
M
|
|
4623
|
+
]);
|
|
4624
|
+
return /* @__PURE__ */ p(Ki.Provider, {
|
|
4625
|
+
value: N,
|
|
4626
|
+
children: e
|
|
4627
|
+
});
|
|
4628
|
+
}, Xi = () => c(Ki), Zi = [
|
|
4629
|
+
{
|
|
4630
|
+
id: "preferences",
|
|
4631
|
+
tabs: [
|
|
4632
|
+
"general",
|
|
4633
|
+
"appearance",
|
|
4634
|
+
"customisation"
|
|
4635
|
+
]
|
|
4636
|
+
},
|
|
4637
|
+
{
|
|
4638
|
+
id: "account",
|
|
4639
|
+
tabs: [
|
|
4640
|
+
"profile",
|
|
4641
|
+
"signup",
|
|
4642
|
+
"signin",
|
|
4643
|
+
"support"
|
|
4644
|
+
]
|
|
4645
|
+
},
|
|
4646
|
+
{
|
|
4647
|
+
id: "workspace",
|
|
4648
|
+
tabs: [
|
|
4649
|
+
"connection",
|
|
4650
|
+
"members",
|
|
4651
|
+
"integrations",
|
|
4652
|
+
"extensions",
|
|
4653
|
+
"ai",
|
|
4654
|
+
"admin"
|
|
4655
|
+
]
|
|
4656
|
+
}
|
|
4657
|
+
], Qi = Zi.flatMap((e) => e.tabs), $i = Zi[0].tabs[0], ea = (e) => typeof e == "string" && Qi.includes(e), ta = {
|
|
4658
|
+
server: "connection",
|
|
4659
|
+
backup: "admin"
|
|
4660
|
+
}, na = (e) => ea(e) ? e : typeof e == "string" && e in ta ? ta[e] : $i, ra = {
|
|
4661
|
+
commandPalette: { open: !1 },
|
|
4662
|
+
settings: {
|
|
4663
|
+
open: !1,
|
|
4664
|
+
mode: "modal",
|
|
4665
|
+
tab: $i
|
|
4666
|
+
},
|
|
4667
|
+
present: {
|
|
4668
|
+
open: !1,
|
|
4669
|
+
mode: "fullscreen",
|
|
4670
|
+
pageId: null
|
|
4671
|
+
},
|
|
4672
|
+
sideNav: {
|
|
4673
|
+
open: !0,
|
|
4674
|
+
docked: !0
|
|
4675
|
+
},
|
|
4676
|
+
trash: { open: !1 },
|
|
4677
|
+
templates: { open: !1 },
|
|
4678
|
+
ai: { open: !1 },
|
|
4679
|
+
agent: { open: !1 }
|
|
4680
|
+
}, ia = () => {
|
|
4681
|
+
if (typeof window > "u" || localStorage.getItem("hud") === null) return ra;
|
|
4682
|
+
let e = JSON.parse(localStorage.getItem("hud") ?? "{}"), t = {
|
|
4683
|
+
...ra.settings,
|
|
4684
|
+
...e.settings
|
|
4685
|
+
};
|
|
4686
|
+
return {
|
|
4687
|
+
commandPalette: {
|
|
4688
|
+
...ra.commandPalette,
|
|
4689
|
+
...e.commandPalette
|
|
4690
|
+
},
|
|
4691
|
+
settings: {
|
|
4692
|
+
...t,
|
|
4693
|
+
tab: na(t.tab)
|
|
4694
|
+
},
|
|
4695
|
+
sideNav: {
|
|
4696
|
+
...ra.sideNav,
|
|
4697
|
+
...e.sideNav
|
|
4698
|
+
},
|
|
4699
|
+
trash: { open: !1 },
|
|
4700
|
+
templates: { open: !1 },
|
|
4701
|
+
ai: { open: !1 },
|
|
4702
|
+
agent: { open: !1 },
|
|
4703
|
+
present: { ...ra.present }
|
|
4704
|
+
};
|
|
4705
|
+
}, aa = (e) => {
|
|
4706
|
+
let t = {
|
|
4707
|
+
...e,
|
|
4708
|
+
settings: {
|
|
4709
|
+
...e.settings,
|
|
4710
|
+
open: !1
|
|
4711
|
+
},
|
|
4712
|
+
trash: { open: !1 },
|
|
4713
|
+
templates: { open: !1 },
|
|
4714
|
+
ai: { open: !1 },
|
|
4715
|
+
agent: { open: !1 },
|
|
4716
|
+
present: { ...ra.present }
|
|
4717
|
+
};
|
|
4718
|
+
localStorage.setItem("hud", JSON.stringify(t));
|
|
4719
|
+
}, oa = o({
|
|
4720
|
+
hud: ra,
|
|
4721
|
+
setHud: () => !1
|
|
4722
|
+
}), sa = () => c(oa), ca = ({ children: e }) => {
|
|
4723
|
+
let [t, n] = A(ia), r = a.useRef(typeof window < "u" && localStorage.getItem("hud") !== null);
|
|
4724
|
+
a.useEffect(() => {
|
|
4725
|
+
aa(t);
|
|
4726
|
+
}, [t]), a.useEffect(() => {
|
|
4727
|
+
!r.current && window.innerWidth < 768 && n((e) => (e.sideNav.open = !1, e.sideNav.docked = !1, e));
|
|
4728
|
+
}, [n]);
|
|
4729
|
+
let i = a.useCallback((e) => {
|
|
4730
|
+
t.sideNav.docked || (e.clientX > 320 || e.clientX <= 1 ? n((e) => (e.sideNav.open = !1, e)) : e.clientX < 16 && n((e) => (e.sideNav.open = !0, e)));
|
|
4731
|
+
}, [
|
|
4732
|
+
t,
|
|
4733
|
+
t.sideNav,
|
|
4734
|
+
n
|
|
4735
|
+
]);
|
|
4736
|
+
a.useEffect(() => (document.addEventListener("mousemove", i), () => document.removeEventListener("mousemove", i)), [i]);
|
|
4737
|
+
let o = {
|
|
4738
|
+
hud: t,
|
|
4739
|
+
setHud: n
|
|
4740
|
+
};
|
|
4741
|
+
return /* @__PURE__ */ p(oa.Provider, {
|
|
4742
|
+
value: o,
|
|
4743
|
+
children: e
|
|
4744
|
+
});
|
|
4745
|
+
}, la = o(null), ua = "openbook.locale";
|
|
4746
|
+
function da() {
|
|
4747
|
+
if (typeof window > "u") return "en";
|
|
4748
|
+
try {
|
|
4749
|
+
let e = localStorage.getItem(ua);
|
|
4750
|
+
if (e) return Br(e);
|
|
4751
|
+
} catch {}
|
|
4752
|
+
return Br(navigator.language);
|
|
4753
|
+
}
|
|
4754
|
+
var fa = ({ children: e }) => {
|
|
4755
|
+
let [t, n] = f("en");
|
|
4756
|
+
l(() => {
|
|
4757
|
+
let e = da();
|
|
4758
|
+
e !== "en" && n(e);
|
|
4759
|
+
}, []), Lr() !== t && Rr(t), l(() => {
|
|
4760
|
+
typeof document < "u" && (document.documentElement.lang = t);
|
|
4761
|
+
}, [t]);
|
|
4762
|
+
let r = s((e) => {
|
|
4763
|
+
n(e);
|
|
4764
|
+
try {
|
|
4765
|
+
localStorage.setItem(ua, e);
|
|
4766
|
+
} catch {}
|
|
4767
|
+
}, []), i = u(() => ({
|
|
4768
|
+
locale: t,
|
|
4769
|
+
setLocale: r,
|
|
4770
|
+
t: X,
|
|
4771
|
+
locales: Mr
|
|
4772
|
+
}), [t, r]);
|
|
4773
|
+
return /* @__PURE__ */ p(la.Provider, {
|
|
4774
|
+
value: i,
|
|
4775
|
+
children: e
|
|
4776
|
+
});
|
|
4777
|
+
}, pa = () => {
|
|
4778
|
+
let e = c(la);
|
|
4779
|
+
if (!e) throw Error("useTranslation must be used within an <I18nProvider>");
|
|
4780
|
+
return e;
|
|
4781
|
+
}, Z = null, ma = /* @__PURE__ */ new Set(), ha = (e) => {
|
|
4782
|
+
Z = e, ma.forEach((e) => e());
|
|
4783
|
+
}, ga = (e) => (ma.add(e), () => ma.delete(e)), _a = {
|
|
4784
|
+
createSubpage: (e, t) => Z ? Z.createSubpage(e, t) : Promise.reject(/* @__PURE__ */ Error("page links not ready")),
|
|
4785
|
+
openPage: (e, t) => Z?.openPage(e, t),
|
|
4786
|
+
label: (e) => Z?.label(e) ?? "Untitled",
|
|
4787
|
+
icon: (e) => Z?.icon(e) ?? "📄",
|
|
4788
|
+
searchPages: (e, t) => Z?.searchPages(e, t) ?? [],
|
|
4789
|
+
createPage: (e) => Z ? Z.createPage(e) : Promise.reject(/* @__PURE__ */ Error("page links not ready"))
|
|
4790
|
+
}, va = "openbook.recents";
|
|
4791
|
+
function ya(e, t, n = 12) {
|
|
3879
4792
|
return [t, ...e.filter((e) => e !== t)].slice(0, n);
|
|
3880
4793
|
}
|
|
3881
|
-
var
|
|
4794
|
+
var ba = () => {
|
|
3882
4795
|
if (typeof localStorage > "u") return [];
|
|
3883
4796
|
try {
|
|
3884
|
-
let e = localStorage.getItem(
|
|
4797
|
+
let e = localStorage.getItem(va), t = e ? JSON.parse(e) : [];
|
|
3885
4798
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
3886
4799
|
} catch {
|
|
3887
4800
|
return [];
|
|
3888
4801
|
}
|
|
3889
|
-
},
|
|
3890
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
3891
|
-
},
|
|
3892
|
-
let t =
|
|
3893
|
-
n[0] === e && n.length === t.length ||
|
|
3894
|
-
},
|
|
4802
|
+
}, xa = /* @__PURE__ */ new Set(), Sa = (e) => {
|
|
4803
|
+
typeof localStorage < "u" && localStorage.setItem(va, JSON.stringify(e)), xa.forEach((e) => e());
|
|
4804
|
+
}, Ca = () => ba(), wa = (e) => {
|
|
4805
|
+
let t = ya(ba(), e), n = ba();
|
|
4806
|
+
n[0] === e && n.length === t.length || Sa(t);
|
|
4807
|
+
}, Ta = (e) => (xa.add(e), () => xa.delete(e)), Ea = "home", Da = "flow", Oa = "config", ka = "customise", Aa = "review", ja = "agent", Ma = {
|
|
3895
4808
|
actions: !0,
|
|
3896
4809
|
recents: !0,
|
|
3897
4810
|
favorites: !0,
|
|
3898
4811
|
edited: !0
|
|
3899
|
-
},
|
|
3900
|
-
function
|
|
4812
|
+
}, Na = "openbook.home.widgets";
|
|
4813
|
+
function Pa() {
|
|
3901
4814
|
try {
|
|
3902
|
-
let e = typeof localStorage < "u" ? localStorage.getItem(
|
|
4815
|
+
let e = typeof localStorage < "u" ? localStorage.getItem(Na) : null, t = e ? JSON.parse(e) : {};
|
|
3903
4816
|
return {
|
|
3904
|
-
...
|
|
4817
|
+
...Ma,
|
|
3905
4818
|
...t
|
|
3906
4819
|
};
|
|
3907
4820
|
} catch {
|
|
3908
|
-
return
|
|
4821
|
+
return Ma;
|
|
3909
4822
|
}
|
|
3910
4823
|
}
|
|
3911
|
-
function
|
|
4824
|
+
function Fa(e) {
|
|
3912
4825
|
try {
|
|
3913
|
-
localStorage.setItem(
|
|
4826
|
+
localStorage.setItem(Na, JSON.stringify(e));
|
|
3914
4827
|
} catch {}
|
|
3915
4828
|
}
|
|
3916
|
-
function
|
|
4829
|
+
function Ia(e) {
|
|
3917
4830
|
return e >= 5 && e < 12 ? "morning" : e >= 12 && e < 18 ? "afternoon" : "evening";
|
|
3918
4831
|
}
|
|
3919
4832
|
//#endregion
|
|
3920
4833
|
//#region src/blockeditor/kit/kitPanel.ts
|
|
3921
|
-
var
|
|
3922
|
-
function
|
|
3923
|
-
|
|
4834
|
+
var La = null, Ra = /* @__PURE__ */ new Set(), za = null, Ba = /* @__PURE__ */ new Set(), Va = null, Ha = null, Ua = (e) => e.forEach((e) => e());
|
|
4835
|
+
function Wa(e, t) {
|
|
4836
|
+
La = {
|
|
3924
4837
|
blockId: e,
|
|
3925
4838
|
title: t
|
|
3926
|
-
},
|
|
4839
|
+
}, Ua(Ra), Va?.(e);
|
|
3927
4840
|
}
|
|
3928
|
-
function
|
|
3929
|
-
|
|
4841
|
+
function Ga(e) {
|
|
4842
|
+
La && (La = null, Ua(Ra), e?.keepPane || Ha?.());
|
|
3930
4843
|
}
|
|
3931
|
-
var
|
|
3932
|
-
function
|
|
3933
|
-
return
|
|
4844
|
+
var Ka = () => La;
|
|
4845
|
+
function qa(e) {
|
|
4846
|
+
return Ra.add(e), () => Ra.delete(e);
|
|
3934
4847
|
}
|
|
3935
|
-
function
|
|
3936
|
-
|
|
4848
|
+
function Ja(e) {
|
|
4849
|
+
za !== e && (za = e, Ua(Ba));
|
|
3937
4850
|
}
|
|
3938
|
-
var
|
|
3939
|
-
function
|
|
3940
|
-
return
|
|
4851
|
+
var Ya = () => za;
|
|
4852
|
+
function Xa(e) {
|
|
4853
|
+
return Ba.add(e), () => Ba.delete(e);
|
|
3941
4854
|
}
|
|
3942
|
-
function
|
|
3943
|
-
return
|
|
3944
|
-
|
|
4855
|
+
function Za(e, t) {
|
|
4856
|
+
return Va = e, Ha = t, () => {
|
|
4857
|
+
Va === e && (Va = null), Ha === t && (Ha = null);
|
|
3945
4858
|
};
|
|
3946
4859
|
}
|
|
3947
4860
|
//#endregion
|
|
3948
4861
|
//#region src/lib/favorites.ts
|
|
3949
|
-
var
|
|
3950
|
-
function
|
|
4862
|
+
var Qa = "openbook.favorites";
|
|
4863
|
+
function $a(e, t) {
|
|
3951
4864
|
return e.includes(t) ? e.filter((e) => e !== t) : [t, ...e];
|
|
3952
4865
|
}
|
|
3953
|
-
var
|
|
4866
|
+
var eo = () => {
|
|
3954
4867
|
if (typeof localStorage > "u") return [];
|
|
3955
4868
|
try {
|
|
3956
|
-
let e = localStorage.getItem(
|
|
4869
|
+
let e = localStorage.getItem(Qa), t = e ? JSON.parse(e) : [];
|
|
3957
4870
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
3958
4871
|
} catch {
|
|
3959
4872
|
return [];
|
|
3960
4873
|
}
|
|
3961
|
-
},
|
|
3962
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
3963
|
-
},
|
|
3964
|
-
let t =
|
|
3965
|
-
t.includes(e) &&
|
|
3966
|
-
},
|
|
3967
|
-
id:
|
|
4874
|
+
}, to = /* @__PURE__ */ new Set(), no = (e) => {
|
|
4875
|
+
typeof localStorage < "u" && localStorage.setItem(Qa, JSON.stringify(e)), to.forEach((e) => e());
|
|
4876
|
+
}, ro = () => eo(), io = (e) => eo().includes(e), ao = (e) => no($a(eo(), e)), oo = (e) => {
|
|
4877
|
+
let t = eo();
|
|
4878
|
+
t.includes(e) && no(t.filter((t) => t !== e));
|
|
4879
|
+
}, so = (e) => (to.add(e), () => to.delete(e)), co = 0, lo = () => (co += 1, `tab_${typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().slice(0, 8) : `${co}`}`), uo = (e, t = null) => ({
|
|
4880
|
+
id: lo(),
|
|
3968
4881
|
history: [e],
|
|
3969
4882
|
index: 0,
|
|
3970
4883
|
split: t && t !== e ? t : null,
|
|
3971
4884
|
focused: "primary"
|
|
3972
|
-
}),
|
|
4885
|
+
}), fo = (e) => e.history[e.index], po = (e) => e.split !== null, mo = (e) => {
|
|
3973
4886
|
let t = [{
|
|
3974
4887
|
id: "primary",
|
|
3975
|
-
pageId:
|
|
4888
|
+
pageId: fo(e)
|
|
3976
4889
|
}];
|
|
3977
4890
|
return e.split !== null && t.push({
|
|
3978
4891
|
id: "secondary",
|
|
3979
4892
|
pageId: e.split
|
|
3980
4893
|
}), t;
|
|
3981
|
-
},
|
|
3982
|
-
if (
|
|
4894
|
+
}, ho = (e) => e.focused === "secondary" && e.split !== null ? e.split : fo(e), go = (e, t) => {
|
|
4895
|
+
if (fo(e) === t) return e;
|
|
3983
4896
|
let n = e.history.slice(0, e.index + 1);
|
|
3984
4897
|
return n.push(t), {
|
|
3985
4898
|
...e,
|
|
3986
4899
|
history: n,
|
|
3987
4900
|
index: n.length - 1
|
|
3988
4901
|
};
|
|
3989
|
-
},
|
|
4902
|
+
}, _o = (e, t, n) => t === "secondary" && po(e) ? e.split === n ? e : {
|
|
3990
4903
|
...e,
|
|
3991
4904
|
split: n
|
|
3992
|
-
} :
|
|
4905
|
+
} : go(e, n), vo = (e, t) => _o(e, e.focused, t), yo = (e, t) => {
|
|
3993
4906
|
let n = e.index + t;
|
|
3994
4907
|
return n >= 0 && n < e.history.length ? {
|
|
3995
4908
|
...e,
|
|
3996
4909
|
index: n
|
|
3997
4910
|
} : e;
|
|
3998
|
-
},
|
|
4911
|
+
}, bo = (e, t) => ({
|
|
3999
4912
|
...e,
|
|
4000
4913
|
split: t,
|
|
4001
4914
|
focused: "secondary"
|
|
4002
|
-
}),
|
|
4915
|
+
}), xo = (e) => po(e) ? {
|
|
4003
4916
|
...e,
|
|
4004
4917
|
split: null,
|
|
4005
4918
|
focused: "primary"
|
|
4006
|
-
} : e,
|
|
4919
|
+
} : e, So = (e, t) => t === "secondary" ? xo(e) : po(e) ? {
|
|
4007
4920
|
...e,
|
|
4008
4921
|
history: [e.split],
|
|
4009
4922
|
index: 0,
|
|
4010
4923
|
split: null,
|
|
4011
4924
|
focused: "primary"
|
|
4012
|
-
} : e,
|
|
4925
|
+
} : e, Co = (e, t) => t === e.focused ? e : {
|
|
4013
4926
|
...e,
|
|
4014
4927
|
focused: t
|
|
4015
|
-
},
|
|
4928
|
+
}, wo = (e, t) => {
|
|
4016
4929
|
let n = e.history.filter(t), r = e;
|
|
4017
4930
|
if (n.length !== e.history.length) {
|
|
4018
4931
|
if (n.length === 0) return null;
|
|
@@ -4027,55 +4940,55 @@ var ja = () => {
|
|
|
4027
4940
|
split: null,
|
|
4028
4941
|
focused: "primary"
|
|
4029
4942
|
}), r;
|
|
4030
|
-
},
|
|
4031
|
-
let n =
|
|
4943
|
+
}, To = (e, t = null) => {
|
|
4944
|
+
let n = uo(e, t);
|
|
4032
4945
|
return {
|
|
4033
4946
|
tabs: [n],
|
|
4034
4947
|
activeTabId: n.id
|
|
4035
4948
|
};
|
|
4036
|
-
},
|
|
4037
|
-
let n =
|
|
4949
|
+
}, Q = (e) => e.tabs.find((t) => t.id === e.activeTabId) ?? e.tabs[0], Eo = (e, t) => {
|
|
4950
|
+
let n = Q(e), r = t(n);
|
|
4038
4951
|
return r === n ? e : {
|
|
4039
4952
|
...e,
|
|
4040
4953
|
tabs: e.tabs.map((e) => e.id === n.id ? r : e)
|
|
4041
4954
|
};
|
|
4042
|
-
},
|
|
4043
|
-
let t =
|
|
4955
|
+
}, Do = (e) => fo(e), Oo = (e) => fo(Q(e)), ko = (e) => mo(Q(e)), Ao = (e) => ho(Q(e)), jo = (e) => Q(e).focused, Mo = (e) => Q(e).split !== null, No = (e) => Q(e).index > 0, Po = (e) => {
|
|
4956
|
+
let t = Q(e);
|
|
4044
4957
|
return t.index < t.history.length - 1;
|
|
4045
|
-
},
|
|
4046
|
-
let r = t === "secondary" &&
|
|
4047
|
-
return
|
|
4048
|
-
}),
|
|
4049
|
-
let n =
|
|
4958
|
+
}, Fo = (e, t) => Eo(e, (e) => vo(e, t)), Io = (e, t, n) => Eo(e, (e) => {
|
|
4959
|
+
let r = t === "secondary" && po(e) ? "secondary" : "primary";
|
|
4960
|
+
return _o(Co(e, r), r, n);
|
|
4961
|
+
}), Lo = (e) => Eo(e, (e) => yo(e, -1)), Ro = (e) => Eo(e, (e) => yo(e, 1)), zo = (e, t) => Eo(e, (e) => bo(e, t)), Bo = (e) => Eo(e, xo), Vo = (e, t) => Eo(e, (e) => So(e, t)), Ho = (e, t) => Eo(e, (e) => Co(e, t)), Uo = (e, t) => {
|
|
4962
|
+
let n = uo(t);
|
|
4050
4963
|
return {
|
|
4051
4964
|
tabs: [...e.tabs, n],
|
|
4052
4965
|
activeTabId: n.id
|
|
4053
4966
|
};
|
|
4054
|
-
},
|
|
4967
|
+
}, Wo = (e, t) => e.tabs.some((e) => e.id === t) ? {
|
|
4055
4968
|
...e,
|
|
4056
4969
|
activeTabId: t
|
|
4057
|
-
} : e,
|
|
4970
|
+
} : e, Go = (e, t) => {
|
|
4058
4971
|
if (e.tabs.length <= 1) return e;
|
|
4059
4972
|
let n = e.tabs.findIndex((e) => e.id === t), r = e.tabs.filter((e) => e.id !== t);
|
|
4060
4973
|
return {
|
|
4061
4974
|
tabs: r,
|
|
4062
4975
|
activeTabId: e.activeTabId === t ? r[Math.min(n, r.length - 1)].id : e.activeTabId
|
|
4063
4976
|
};
|
|
4064
|
-
},
|
|
4977
|
+
}, Ko = (e, t, n) => {
|
|
4065
4978
|
let r = !1, i = [];
|
|
4066
4979
|
for (let n of e.tabs) {
|
|
4067
|
-
let e =
|
|
4980
|
+
let e = wo(n, t);
|
|
4068
4981
|
e === null ? r = !0 : (e !== n && (r = !0), i.push(e));
|
|
4069
4982
|
}
|
|
4070
|
-
return i.length === 0 ? n ?
|
|
4983
|
+
return i.length === 0 ? n ? To(n) : e : r ? {
|
|
4071
4984
|
tabs: i,
|
|
4072
4985
|
activeTabId: i.some((t) => t.id === e.activeTabId) ? e.activeTabId : i[0].id
|
|
4073
4986
|
} : e;
|
|
4074
|
-
},
|
|
4075
|
-
let e = c(
|
|
4987
|
+
}, qo = o(null), Jo = () => {
|
|
4988
|
+
let e = c(qo);
|
|
4076
4989
|
if (!e) throw Error("useNavigation must be used within a <NavigationProvider>");
|
|
4077
4990
|
return e;
|
|
4078
|
-
},
|
|
4991
|
+
}, Yo = "openbook.currentPageId", Xo = () => {
|
|
4079
4992
|
if (typeof window > "u") return {
|
|
4080
4993
|
page: null,
|
|
4081
4994
|
split: null
|
|
@@ -4085,42 +4998,42 @@ var ja = () => {
|
|
|
4085
4998
|
page: e.get("page"),
|
|
4086
4999
|
split: e.get("split")
|
|
4087
5000
|
};
|
|
4088
|
-
},
|
|
5001
|
+
}, Zo = (e, t) => {
|
|
4089
5002
|
if (typeof window > "u") return;
|
|
4090
5003
|
let n = new URL(window.location.href);
|
|
4091
5004
|
n.searchParams.set("page", e), t ? n.searchParams.set("split", t) : n.searchParams.delete("split"), window.history.replaceState(null, "", `${n.pathname}${n.search}${n.hash}`);
|
|
4092
5005
|
try {
|
|
4093
|
-
localStorage.setItem(
|
|
5006
|
+
localStorage.setItem(Yo, e);
|
|
4094
5007
|
} catch {}
|
|
4095
|
-
},
|
|
5008
|
+
}, Qo = (e) => {
|
|
4096
5009
|
let t = new URL(window.location.href);
|
|
4097
5010
|
return t.searchParams.set("page", e), t.searchParams.delete("split"), t.toString();
|
|
4098
|
-
},
|
|
5011
|
+
}, $o = () => {
|
|
4099
5012
|
try {
|
|
4100
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
5013
|
+
return typeof localStorage < "u" ? localStorage.getItem(Yo) : null;
|
|
4101
5014
|
} catch {
|
|
4102
5015
|
return null;
|
|
4103
5016
|
}
|
|
4104
|
-
},
|
|
4105
|
-
let a = Bi(), o =
|
|
5017
|
+
}, es = ({ children: i }) => {
|
|
5018
|
+
let a = Bi(), o = sr(), [c, m] = f([]), [h, g] = f(null), [_, ee] = f({}), [v, te] = f(!0), [ne, re] = f(null), x = d(null), S = d(/* @__PURE__ */ new Set());
|
|
4106
5019
|
l(() => {
|
|
4107
5020
|
if (!h) return;
|
|
4108
|
-
let e =
|
|
4109
|
-
|
|
5021
|
+
let e = Q(h).split, t = e === "config" || e === "customise" || e === "review";
|
|
5022
|
+
Zo(Oo(h), t ? null : e);
|
|
4110
5023
|
}, [h]);
|
|
4111
|
-
let
|
|
5024
|
+
let C = s((e) => {
|
|
4112
5025
|
g((t) => t && e(t));
|
|
4113
|
-
}, []),
|
|
5026
|
+
}, []), w = s(async () => {
|
|
4114
5027
|
let e = await a.listPages();
|
|
4115
5028
|
return m(e), e;
|
|
4116
|
-
}, [a]),
|
|
5029
|
+
}, [a]), T = s((e) => C((t) => Fo(t, e)), [C]), E = s((e, t) => C((n) => Io(n, t, e)), [C]), D = s(() => C(Lo), [C]), O = s(() => C(Ro), [C]), k = s((e) => C((t) => Ho(t, e)), [C]), A = s((e) => C((t) => zo(t, e)), [C]), j = s(() => C(Bo), [C]), M = s((e) => C((t) => Vo(t, e)), [C]), N = s((e) => C((t) => Wo(t, e)), [C]), P = s((e) => C((t) => Go(t, e)), [C]), F = s((e) => g((t) => t && Ko(t, (t) => t !== e, c[0]?.id ?? null)), [c]), I = s((e, t) => {
|
|
4117
5030
|
if (t === "tab") {
|
|
4118
|
-
o.tabs?.inWindow ?
|
|
5031
|
+
o.tabs?.inWindow ? C((t) => Uo(t, e)) : typeof window < "u" && window.open(Qo(e), "_blank", "noopener");
|
|
4119
5032
|
return;
|
|
4120
5033
|
}
|
|
4121
|
-
o.tabs ? o.tabs.openWindow(e) : typeof window < "u" && window.open(
|
|
4122
|
-
}, [o,
|
|
4123
|
-
|
|
5034
|
+
o.tabs ? o.tabs.openWindow(e) : typeof window < "u" && window.open(Qo(e), "_blank", "noopener,popup,width=1280,height=860");
|
|
5035
|
+
}, [o, C]), L = s((e, t) => {
|
|
5036
|
+
ee((n) => {
|
|
4124
5037
|
let r = t && t.trim().length > 0 ? t : "Untitled";
|
|
4125
5038
|
return n[e] === r ? n : {
|
|
4126
5039
|
...n,
|
|
@@ -4128,8 +5041,8 @@ var ja = () => {
|
|
|
4128
5041
|
};
|
|
4129
5042
|
});
|
|
4130
5043
|
}, []), R = s((e) => {
|
|
4131
|
-
if (e === "home") return
|
|
4132
|
-
if (e === "flow") return
|
|
5044
|
+
if (e === "home") return X("nav.home");
|
|
5045
|
+
if (e === "flow") return X("flow.title");
|
|
4133
5046
|
if (e === "config") return "Settings";
|
|
4134
5047
|
if (e === "customise") return "Customise";
|
|
4135
5048
|
if (e === "review") return "Review";
|
|
@@ -4141,12 +5054,12 @@ var ja = () => {
|
|
|
4141
5054
|
data: b(),
|
|
4142
5055
|
parentId: t
|
|
4143
5056
|
});
|
|
4144
|
-
return await
|
|
5057
|
+
return await w(), T(n.id), n.id;
|
|
4145
5058
|
}, [
|
|
4146
5059
|
a,
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
]),
|
|
5060
|
+
w,
|
|
5061
|
+
T
|
|
5062
|
+
]), z = s(async (e = null) => {
|
|
4150
5063
|
let t = await a.savePage({
|
|
4151
5064
|
name: null,
|
|
4152
5065
|
data: b(),
|
|
@@ -4156,12 +5069,12 @@ var ja = () => {
|
|
|
4156
5069
|
pageId: t.id,
|
|
4157
5070
|
name: null,
|
|
4158
5071
|
schema: y()
|
|
4159
|
-
}), await
|
|
5072
|
+
}), await w(), T(t.id), t.id;
|
|
4160
5073
|
}, [
|
|
4161
5074
|
a,
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
]),
|
|
5075
|
+
w,
|
|
5076
|
+
T
|
|
5077
|
+
]), B = s(async (e, t = "page") => {
|
|
4165
5078
|
let n = await a.savePage({
|
|
4166
5079
|
name: null,
|
|
4167
5080
|
data: b(),
|
|
@@ -4171,18 +5084,18 @@ var ja = () => {
|
|
|
4171
5084
|
pageId: n.id,
|
|
4172
5085
|
name: null,
|
|
4173
5086
|
schema: y()
|
|
4174
|
-
}), await
|
|
4175
|
-
}, [a,
|
|
5087
|
+
}), await w(), n.id;
|
|
5088
|
+
}, [a, w]), V = s(async (e) => {
|
|
4176
5089
|
let t = await a.savePage({
|
|
4177
5090
|
name: null,
|
|
4178
5091
|
data: b()
|
|
4179
5092
|
});
|
|
4180
|
-
await
|
|
5093
|
+
await w(), I(t.id, e);
|
|
4181
5094
|
}, [
|
|
4182
5095
|
a,
|
|
4183
|
-
|
|
5096
|
+
w,
|
|
4184
5097
|
I
|
|
4185
|
-
]),
|
|
5098
|
+
]), ae = s(async (t) => {
|
|
4186
5099
|
let r = await a.getPage(t);
|
|
4187
5100
|
if (!r) return;
|
|
4188
5101
|
let i = r.name && r.name.trim().length > 0 ? `${r.name} (copy)` : null, o = await a.savePage({
|
|
@@ -4190,27 +5103,27 @@ var ja = () => {
|
|
|
4190
5103
|
data: r.data,
|
|
4191
5104
|
parentId: r.parentId
|
|
4192
5105
|
}), s = e(t);
|
|
4193
|
-
s && n(o.id, s), await
|
|
5106
|
+
s && n(o.id, s), await w(), T(o.id);
|
|
4194
5107
|
}, [
|
|
4195
5108
|
a,
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
]),
|
|
4199
|
-
await a.deletePage(e),
|
|
4200
|
-
let t = await
|
|
4201
|
-
g((n) => n &&
|
|
4202
|
-
}, [a,
|
|
4203
|
-
await a.renamePage(e, t), L(e, t), await
|
|
5109
|
+
w,
|
|
5110
|
+
T
|
|
5111
|
+
]), oe = s(async (e) => {
|
|
5112
|
+
await a.deletePage(e), oo(e);
|
|
5113
|
+
let t = await w();
|
|
5114
|
+
g((n) => n && Ko(n, (t) => t !== e, t[0]?.id ?? null));
|
|
5115
|
+
}, [a, w]), H = s(async (e, t) => {
|
|
5116
|
+
await a.renamePage(e, t), L(e, t), await w();
|
|
4204
5117
|
}, [
|
|
4205
5118
|
a,
|
|
4206
|
-
|
|
5119
|
+
w,
|
|
4207
5120
|
L
|
|
4208
|
-
]),
|
|
5121
|
+
]), se = s(async (e, t, n) => {
|
|
4209
5122
|
await a.movePage(e, {
|
|
4210
5123
|
parentId: t,
|
|
4211
5124
|
orderedIds: n
|
|
4212
|
-
}), await
|
|
4213
|
-
}, [a,
|
|
5125
|
+
}), await w();
|
|
5126
|
+
}, [a, w]), U = s((e, n) => {
|
|
4214
5127
|
let r = e.trim().toLowerCase(), i = c.filter((e) => !n?.databasesOnly || e.hostedDatabaseId).map((e) => ({
|
|
4215
5128
|
id: e.id,
|
|
4216
5129
|
label: R(e.id),
|
|
@@ -4220,27 +5133,27 @@ var ja = () => {
|
|
|
4220
5133
|
return t === r ? 2 : +!!t.startsWith(r);
|
|
4221
5134
|
};
|
|
4222
5135
|
return i.sort((e, t) => a(t.label) - a(e.label)).slice(0, 8);
|
|
4223
|
-
}, [c, R]),
|
|
5136
|
+
}, [c, R]), W = s(async (e) => {
|
|
4224
5137
|
let t = await a.savePage({
|
|
4225
5138
|
name: e.trim() || null,
|
|
4226
5139
|
data: b()
|
|
4227
5140
|
});
|
|
4228
|
-
return await
|
|
4229
|
-
}, [a,
|
|
5141
|
+
return await w(), t.id;
|
|
5142
|
+
}, [a, w]);
|
|
4230
5143
|
l(() => {
|
|
4231
|
-
|
|
5144
|
+
x.current ||= (async () => {
|
|
4232
5145
|
try {
|
|
4233
5146
|
let e = await a.listPages();
|
|
4234
5147
|
e.length === 0 && (await a.savePage({
|
|
4235
5148
|
name: null,
|
|
4236
5149
|
data: b()
|
|
4237
|
-
}), e = await a.listPages()), m(e),
|
|
4238
|
-
let t = new Set(e.map((e) => e.id)), n = async (e) => e ? e === "home" || e === "flow" || t.has(e) ? e : await a.getPage(e) === null ? null : e : null, { page: r, split: i } =
|
|
4239
|
-
o ||= await n(
|
|
5150
|
+
}), e = await a.listPages()), m(e), S.current = new Set(e.map((e) => e.id));
|
|
5151
|
+
let t = new Set(e.map((e) => e.id)), n = async (e) => e ? e === "home" || e === "flow" || t.has(e) ? e : await a.getPage(e) === null ? null : e : null, { page: r, split: i } = Xo(), o = await n(r);
|
|
5152
|
+
o ||= await n($o()), o ||= e[0]?.id ?? null;
|
|
4240
5153
|
let s = o ? await n(i && i !== o ? i : null) : null;
|
|
4241
|
-
g(o ?
|
|
5154
|
+
g(o ? To(o, s) : null);
|
|
4242
5155
|
} catch (e) {
|
|
4243
|
-
|
|
5156
|
+
re(e instanceof Error ? e.message : String(e));
|
|
4244
5157
|
} finally {
|
|
4245
5158
|
te(!1);
|
|
4246
5159
|
}
|
|
@@ -4249,119 +5162,119 @@ var ja = () => {
|
|
|
4249
5162
|
r(c);
|
|
4250
5163
|
}, [c]), l(() => a.subscribePages((e) => {
|
|
4251
5164
|
m(e);
|
|
4252
|
-
let t = new Set(e.map((e) => e.id)), n = [...
|
|
4253
|
-
if (
|
|
4254
|
-
n.forEach(
|
|
5165
|
+
let t = new Set(e.map((e) => e.id)), n = [...S.current].filter((e) => !t.has(e));
|
|
5166
|
+
if (S.current = t, n.length === 0) return;
|
|
5167
|
+
n.forEach(oo);
|
|
4255
5168
|
let r = new Set(n);
|
|
4256
|
-
g((t) => t &&
|
|
4257
|
-
}), [a]), l(() => (
|
|
4258
|
-
createSubpage: (e, t) =>
|
|
4259
|
-
openPage: (e, t) => t ?
|
|
5169
|
+
g((t) => t && Ko(t, (e) => !r.has(e), e[0]?.id ?? null));
|
|
5170
|
+
}), [a]), l(() => (ha({
|
|
5171
|
+
createSubpage: (e, t) => B(e, t),
|
|
5172
|
+
openPage: (e, t) => t ? E(e, t) : T(e),
|
|
4260
5173
|
label: (e) => R(e),
|
|
4261
5174
|
icon: (e) => t(e),
|
|
4262
|
-
searchPages:
|
|
4263
|
-
createPage:
|
|
4264
|
-
}), () =>
|
|
4265
|
-
|
|
5175
|
+
searchPages: U,
|
|
5176
|
+
createPage: W
|
|
5177
|
+
}), () => ha(null)), [
|
|
5178
|
+
B,
|
|
5179
|
+
T,
|
|
4266
5180
|
E,
|
|
4267
|
-
D,
|
|
4268
5181
|
R,
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
]), l(() =>
|
|
4272
|
-
c.length !== 0 &&
|
|
5182
|
+
U,
|
|
5183
|
+
W
|
|
5184
|
+
]), l(() => Za(() => A(Oa), () => j()), [A, j]), l(() => {
|
|
5185
|
+
c.length !== 0 && ee((e) => {
|
|
4273
5186
|
let t = { ...e };
|
|
4274
5187
|
for (let e of c) t[e.id] = e.name && e.name.trim().length > 0 ? e.name : "Untitled";
|
|
4275
5188
|
return t;
|
|
4276
5189
|
});
|
|
4277
5190
|
}, [c]);
|
|
4278
|
-
let
|
|
5191
|
+
let G = h ? Ao(h) : null, K = h ? Oo(h) : null;
|
|
4279
5192
|
l(() => {
|
|
4280
|
-
|
|
4281
|
-
}, [
|
|
4282
|
-
let
|
|
5193
|
+
G && G !== "home" && G !== "flow" && G !== "config" && G !== "customise" && G !== "review" && wa(G);
|
|
5194
|
+
}, [G]);
|
|
5195
|
+
let ce = h ? ko(h) : [], le = h ? jo(h) : "primary", ue = h ? Mo(h) : !1, de = h ? No(h) : !1, fe = h ? Po(h) : !1, pe = o.tabs?.inWindow ?? !1, me = h ? h.tabs.map((e) => ({
|
|
4283
5196
|
id: e.id,
|
|
4284
|
-
pageId:
|
|
4285
|
-
})) : [],
|
|
5197
|
+
pageId: Do(e)
|
|
5198
|
+
})) : [], he = h?.activeTabId ?? "", ge = u(() => ({
|
|
4286
5199
|
pages: c,
|
|
4287
|
-
currentPageId:
|
|
4288
|
-
primaryPageId:
|
|
4289
|
-
loading:
|
|
4290
|
-
error:
|
|
4291
|
-
inWindowTabs:
|
|
4292
|
-
tabs:
|
|
4293
|
-
activeTabId:
|
|
4294
|
-
selectTab:
|
|
4295
|
-
closeTab:
|
|
4296
|
-
panes:
|
|
4297
|
-
focusedPaneId:
|
|
4298
|
-
splitOpen:
|
|
4299
|
-
focusPane:
|
|
4300
|
-
openInSplit:
|
|
4301
|
-
closeSplit:
|
|
4302
|
-
closePane:
|
|
5200
|
+
currentPageId: G,
|
|
5201
|
+
primaryPageId: K,
|
|
5202
|
+
loading: v,
|
|
5203
|
+
error: ne,
|
|
5204
|
+
inWindowTabs: pe,
|
|
5205
|
+
tabs: me,
|
|
5206
|
+
activeTabId: he,
|
|
5207
|
+
selectTab: N,
|
|
5208
|
+
closeTab: P,
|
|
5209
|
+
panes: ce,
|
|
5210
|
+
focusedPaneId: le,
|
|
5211
|
+
splitOpen: ue,
|
|
5212
|
+
focusPane: k,
|
|
5213
|
+
openInSplit: A,
|
|
5214
|
+
closeSplit: j,
|
|
5215
|
+
closePane: M,
|
|
4303
5216
|
openInNew: I,
|
|
4304
|
-
newPageIn:
|
|
5217
|
+
newPageIn: V,
|
|
4305
5218
|
closePage: F,
|
|
4306
5219
|
pageLabel: R,
|
|
4307
5220
|
setPageHint: L,
|
|
4308
|
-
selectPage:
|
|
4309
|
-
selectPageInPane:
|
|
4310
|
-
goBack:
|
|
4311
|
-
goForward:
|
|
4312
|
-
canGoBack:
|
|
4313
|
-
canGoForward:
|
|
5221
|
+
selectPage: T,
|
|
5222
|
+
selectPageInPane: E,
|
|
5223
|
+
goBack: D,
|
|
5224
|
+
goForward: O,
|
|
5225
|
+
canGoBack: de,
|
|
5226
|
+
canGoForward: fe,
|
|
4314
5227
|
createPage: ie,
|
|
4315
|
-
createDatabasePage:
|
|
4316
|
-
createSubpage:
|
|
4317
|
-
duplicatePage:
|
|
4318
|
-
deletePage:
|
|
4319
|
-
renamePage:
|
|
4320
|
-
movePage:
|
|
4321
|
-
reload:
|
|
5228
|
+
createDatabasePage: z,
|
|
5229
|
+
createSubpage: B,
|
|
5230
|
+
duplicatePage: ae,
|
|
5231
|
+
deletePage: oe,
|
|
5232
|
+
renamePage: H,
|
|
5233
|
+
movePage: se,
|
|
5234
|
+
reload: w
|
|
4322
5235
|
}), [
|
|
4323
5236
|
c,
|
|
4324
|
-
|
|
5237
|
+
G,
|
|
5238
|
+
K,
|
|
5239
|
+
v,
|
|
5240
|
+
ne,
|
|
4325
5241
|
pe,
|
|
4326
|
-
ee,
|
|
4327
|
-
x,
|
|
4328
|
-
ye,
|
|
4329
|
-
be,
|
|
4330
|
-
xe,
|
|
4331
|
-
P,
|
|
4332
|
-
re,
|
|
4333
5242
|
me,
|
|
4334
5243
|
he,
|
|
4335
|
-
|
|
5244
|
+
N,
|
|
5245
|
+
P,
|
|
5246
|
+
ce,
|
|
5247
|
+
le,
|
|
5248
|
+
ue,
|
|
5249
|
+
k,
|
|
4336
5250
|
A,
|
|
4337
5251
|
j,
|
|
4338
5252
|
M,
|
|
4339
|
-
N,
|
|
4340
5253
|
I,
|
|
4341
|
-
|
|
5254
|
+
V,
|
|
4342
5255
|
F,
|
|
4343
5256
|
R,
|
|
4344
5257
|
L,
|
|
5258
|
+
T,
|
|
4345
5259
|
E,
|
|
4346
5260
|
D,
|
|
4347
5261
|
O,
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
ve,
|
|
5262
|
+
de,
|
|
5263
|
+
fe,
|
|
4351
5264
|
ie,
|
|
4352
|
-
ae,
|
|
4353
5265
|
z,
|
|
5266
|
+
B,
|
|
5267
|
+
ae,
|
|
5268
|
+
oe,
|
|
5269
|
+
H,
|
|
4354
5270
|
se,
|
|
4355
|
-
|
|
4356
|
-
le,
|
|
4357
|
-
ue,
|
|
4358
|
-
T
|
|
5271
|
+
w
|
|
4359
5272
|
]);
|
|
4360
|
-
return /* @__PURE__ */ p(
|
|
4361
|
-
value:
|
|
5273
|
+
return /* @__PURE__ */ p(qo.Provider, {
|
|
5274
|
+
value: ge,
|
|
4362
5275
|
children: i
|
|
4363
5276
|
});
|
|
4364
|
-
},
|
|
5277
|
+
}, ts = {
|
|
4365
5278
|
background: "0 0% 100%",
|
|
4366
5279
|
foreground: "34 9% 19%",
|
|
4367
5280
|
card: "0 0% 100%",
|
|
@@ -4388,7 +5301,7 @@ var ja = () => {
|
|
|
4388
5301
|
brand: "207 76% 47%",
|
|
4389
5302
|
brandForeground: "0 0% 100%",
|
|
4390
5303
|
brandSubtle: "207 86% 95%"
|
|
4391
|
-
},
|
|
5304
|
+
}, ns = {
|
|
4392
5305
|
background: "0 0% 13%",
|
|
4393
5306
|
foreground: "0 0% 82%",
|
|
4394
5307
|
card: "0 0% 16%",
|
|
@@ -4416,7 +5329,7 @@ var ja = () => {
|
|
|
4416
5329
|
brandForeground: "0 0% 100%",
|
|
4417
5330
|
brandSubtle: "208 48% 22%"
|
|
4418
5331
|
};
|
|
4419
|
-
function
|
|
5332
|
+
function $(e, t, n, r, i) {
|
|
4420
5333
|
let a = (e, t) => ({
|
|
4421
5334
|
...e,
|
|
4422
5335
|
primary: t.primary,
|
|
@@ -4431,19 +5344,19 @@ function Q(e, t, n, r, i) {
|
|
|
4431
5344
|
nameKey: `theme.${e}`,
|
|
4432
5345
|
group: t,
|
|
4433
5346
|
neutral: i,
|
|
4434
|
-
light: a(
|
|
4435
|
-
dark: a(
|
|
5347
|
+
light: a(ts, n),
|
|
5348
|
+
dark: a(ns, r)
|
|
4436
5349
|
};
|
|
4437
5350
|
}
|
|
4438
|
-
var
|
|
5351
|
+
var rs = "default", is = [
|
|
4439
5352
|
{
|
|
4440
5353
|
id: "default",
|
|
4441
5354
|
nameKey: "theme.default",
|
|
4442
5355
|
group: "bold",
|
|
4443
|
-
light:
|
|
4444
|
-
dark:
|
|
5356
|
+
light: ts,
|
|
5357
|
+
dark: ns
|
|
4445
5358
|
},
|
|
4446
|
-
|
|
5359
|
+
$("sandstone", "gray", {
|
|
4447
5360
|
primary: "28 12% 34%",
|
|
4448
5361
|
brandSubtle: "30 24% 92%"
|
|
4449
5362
|
}, {
|
|
@@ -4451,7 +5364,7 @@ var Mo = "default", $ = [
|
|
|
4451
5364
|
primaryForeground: "30 16% 12%",
|
|
4452
5365
|
brandSubtle: "30 12% 22%"
|
|
4453
5366
|
}, "warm"),
|
|
4454
|
-
|
|
5367
|
+
$("graphite", "gray", {
|
|
4455
5368
|
primary: "0 0% 34%",
|
|
4456
5369
|
brandSubtle: "0 0% 92%"
|
|
4457
5370
|
}, {
|
|
@@ -4459,7 +5372,7 @@ var Mo = "default", $ = [
|
|
|
4459
5372
|
primaryForeground: "0 0% 12%",
|
|
4460
5373
|
brandSubtle: "0 0% 22%"
|
|
4461
5374
|
}, "neutral"),
|
|
4462
|
-
|
|
5375
|
+
$("slate", "gray", {
|
|
4463
5376
|
primary: "220 14% 36%",
|
|
4464
5377
|
brandSubtle: "216 24% 92%"
|
|
4465
5378
|
}, {
|
|
@@ -4467,49 +5380,49 @@ var Mo = "default", $ = [
|
|
|
4467
5380
|
primaryForeground: "220 22% 12%",
|
|
4468
5381
|
brandSubtle: "218 16% 22%"
|
|
4469
5382
|
}, "cool"),
|
|
4470
|
-
|
|
5383
|
+
$("ocean", "bold", {
|
|
4471
5384
|
primary: "221 83% 53%",
|
|
4472
5385
|
brandSubtle: "221 86% 95%"
|
|
4473
5386
|
}, {
|
|
4474
5387
|
primary: "217 91% 60%",
|
|
4475
5388
|
brandSubtle: "221 55% 21%"
|
|
4476
5389
|
}),
|
|
4477
|
-
|
|
5390
|
+
$("forest", "bold", {
|
|
4478
5391
|
primary: "142 71% 38%",
|
|
4479
5392
|
brandSubtle: "142 60% 94%"
|
|
4480
5393
|
}, {
|
|
4481
5394
|
primary: "142 65% 45%",
|
|
4482
5395
|
brandSubtle: "142 40% 18%"
|
|
4483
5396
|
}),
|
|
4484
|
-
|
|
5397
|
+
$("violet", "bold", {
|
|
4485
5398
|
primary: "262 83% 58%",
|
|
4486
5399
|
brandSubtle: "262 80% 96%"
|
|
4487
5400
|
}, {
|
|
4488
5401
|
primary: "263 70% 55%",
|
|
4489
5402
|
brandSubtle: "263 45% 24%"
|
|
4490
5403
|
}),
|
|
4491
|
-
|
|
5404
|
+
$("sunset", "bold", {
|
|
4492
5405
|
primary: "25 95% 53%",
|
|
4493
5406
|
brandSubtle: "28 90% 94%"
|
|
4494
5407
|
}, {
|
|
4495
5408
|
primary: "21 90% 50%",
|
|
4496
5409
|
brandSubtle: "25 60% 22%"
|
|
4497
5410
|
}),
|
|
4498
|
-
|
|
5411
|
+
$("rose", "bold", {
|
|
4499
5412
|
primary: "346 77% 50%",
|
|
4500
5413
|
brandSubtle: "346 80% 96%"
|
|
4501
5414
|
}, {
|
|
4502
5415
|
primary: "346 75% 55%",
|
|
4503
5416
|
brandSubtle: "346 45% 24%"
|
|
4504
5417
|
}),
|
|
4505
|
-
|
|
5418
|
+
$("teal", "bold", {
|
|
4506
5419
|
primary: "174 72% 38%",
|
|
4507
5420
|
brandSubtle: "174 60% 93%"
|
|
4508
5421
|
}, {
|
|
4509
5422
|
primary: "173 70% 46%",
|
|
4510
5423
|
brandSubtle: "174 45% 18%"
|
|
4511
5424
|
}),
|
|
4512
|
-
|
|
5425
|
+
$("amber", "bold", {
|
|
4513
5426
|
primary: "38 92% 48%",
|
|
4514
5427
|
primaryForeground: "30 40% 14%",
|
|
4515
5428
|
brandSubtle: "40 90% 92%"
|
|
@@ -4518,7 +5431,7 @@ var Mo = "default", $ = [
|
|
|
4518
5431
|
primaryForeground: "30 45% 12%",
|
|
4519
5432
|
brandSubtle: "38 55% 20%"
|
|
4520
5433
|
}),
|
|
4521
|
-
|
|
5434
|
+
$("pastel-sky", "pastel", {
|
|
4522
5435
|
primary: "205 74% 70%",
|
|
4523
5436
|
primaryForeground: "205 50% 22%",
|
|
4524
5437
|
brandSubtle: "205 70% 95%"
|
|
@@ -4527,7 +5440,7 @@ var Mo = "default", $ = [
|
|
|
4527
5440
|
primaryForeground: "205 45% 14%",
|
|
4528
5441
|
brandSubtle: "205 38% 24%"
|
|
4529
5442
|
}),
|
|
4530
|
-
|
|
5443
|
+
$("pastel-mint", "pastel", {
|
|
4531
5444
|
primary: "152 48% 66%",
|
|
4532
5445
|
primaryForeground: "152 45% 20%",
|
|
4533
5446
|
brandSubtle: "152 50% 94%"
|
|
@@ -4536,7 +5449,7 @@ var Mo = "default", $ = [
|
|
|
4536
5449
|
primaryForeground: "152 45% 12%",
|
|
4537
5450
|
brandSubtle: "152 32% 22%"
|
|
4538
5451
|
}),
|
|
4539
|
-
|
|
5452
|
+
$("pastel-lavender", "pastel", {
|
|
4540
5453
|
primary: "258 60% 76%",
|
|
4541
5454
|
primaryForeground: "258 45% 28%",
|
|
4542
5455
|
brandSubtle: "258 60% 96%"
|
|
@@ -4545,7 +5458,7 @@ var Mo = "default", $ = [
|
|
|
4545
5458
|
primaryForeground: "258 40% 14%",
|
|
4546
5459
|
brandSubtle: "258 35% 26%"
|
|
4547
5460
|
}),
|
|
4548
|
-
|
|
5461
|
+
$("pastel-rose", "pastel", {
|
|
4549
5462
|
primary: "344 72% 78%",
|
|
4550
5463
|
primaryForeground: "344 50% 30%",
|
|
4551
5464
|
brandSubtle: "344 72% 96%"
|
|
@@ -4554,7 +5467,7 @@ var Mo = "default", $ = [
|
|
|
4554
5467
|
primaryForeground: "344 45% 14%",
|
|
4555
5468
|
brandSubtle: "344 38% 26%"
|
|
4556
5469
|
}),
|
|
4557
|
-
|
|
5470
|
+
$("pastel-peach", "pastel", {
|
|
4558
5471
|
primary: "24 84% 74%",
|
|
4559
5472
|
primaryForeground: "20 55% 28%",
|
|
4560
5473
|
brandSubtle: "26 84% 94%"
|
|
@@ -4563,7 +5476,7 @@ var Mo = "default", $ = [
|
|
|
4563
5476
|
primaryForeground: "20 50% 14%",
|
|
4564
5477
|
brandSubtle: "24 45% 24%"
|
|
4565
5478
|
}),
|
|
4566
|
-
|
|
5479
|
+
$("pastel-butter", "pastel", {
|
|
4567
5480
|
primary: "46 80% 70%",
|
|
4568
5481
|
primaryForeground: "40 55% 24%",
|
|
4569
5482
|
brandSubtle: "46 84% 92%"
|
|
@@ -4572,11 +5485,11 @@ var Mo = "default", $ = [
|
|
|
4572
5485
|
primaryForeground: "40 50% 12%",
|
|
4573
5486
|
brandSubtle: "44 42% 22%"
|
|
4574
5487
|
})
|
|
4575
|
-
],
|
|
5488
|
+
], as = {
|
|
4576
5489
|
warm: "sandstone",
|
|
4577
5490
|
neutral: "graphite",
|
|
4578
5491
|
cool: "slate"
|
|
4579
|
-
},
|
|
5492
|
+
}, os = (e) => is.find((t) => t.id === e) ?? is.find((t) => t.id === as[e]) ?? is[0], ss = {
|
|
4580
5493
|
gray: {
|
|
4581
5494
|
light: "0 0% 96.5%",
|
|
4582
5495
|
dark: "0 0% 15%"
|
|
@@ -4609,17 +5522,17 @@ var Mo = "default", $ = [
|
|
|
4609
5522
|
light: "330 58% 97.5%",
|
|
4610
5523
|
dark: "330 24% 15.5%"
|
|
4611
5524
|
}
|
|
4612
|
-
},
|
|
4613
|
-
themeId:
|
|
5525
|
+
}, cs = {
|
|
5526
|
+
themeId: rs,
|
|
4614
5527
|
interfaceIntensity: 2,
|
|
4615
5528
|
controlIntensity: 2,
|
|
4616
5529
|
blurOverlays: !1
|
|
4617
5530
|
};
|
|
4618
|
-
function
|
|
5531
|
+
function ls(e) {
|
|
4619
5532
|
let t = { ...e };
|
|
4620
|
-
return t.tint !== void 0 && t.interfaceIntensity === void 0 && (t.interfaceIntensity = t.tint), t.accentIntensity !== void 0 && t.controlIntensity === void 0 && (t.controlIntensity = t.accentIntensity), typeof t.themeId == "string" &&
|
|
5533
|
+
return t.tint !== void 0 && t.interfaceIntensity === void 0 && (t.interfaceIntensity = t.tint), t.accentIntensity !== void 0 && t.controlIntensity === void 0 && (t.controlIntensity = t.accentIntensity), typeof t.themeId == "string" && as[t.themeId] && (t.themeId = as[t.themeId]), delete t.tint, delete t.accentIntensity, delete t.neutral, delete t.tintedSidebar, t;
|
|
4621
5534
|
}
|
|
4622
|
-
function
|
|
5535
|
+
function us(e, t) {
|
|
4623
5536
|
if (!t) return e;
|
|
4624
5537
|
let n = { ...e };
|
|
4625
5538
|
for (let e of Object.keys(t)) {
|
|
@@ -4628,8 +5541,8 @@ function Ro(e, t) {
|
|
|
4628
5541
|
}
|
|
4629
5542
|
return n;
|
|
4630
5543
|
}
|
|
4631
|
-
var
|
|
4632
|
-
function
|
|
5544
|
+
var ds = (e, t, n) => Math.min(n, Math.max(t, e));
|
|
5545
|
+
function fs(e) {
|
|
4633
5546
|
let [t, n, r] = e.replace(/%/g, "").trim().split(/\s+/).map(Number);
|
|
4634
5547
|
return {
|
|
4635
5548
|
h: t || 0,
|
|
@@ -4637,37 +5550,37 @@ function Bo(e) {
|
|
|
4637
5550
|
l: r || 0
|
|
4638
5551
|
};
|
|
4639
5552
|
}
|
|
4640
|
-
var
|
|
5553
|
+
var ps = (e) => String(Number.isInteger(e) ? e : Math.round(e * 10) / 10), ms = ({ h: e, s: t, l: n }) => `${ps((e % 360 + 360) % 360)} ${ps(ds(t, 0, 100))}% ${ps(ds(n, 0, 100))}%`, hs = (e) => fs(e).h, gs = [
|
|
4641
5554
|
0,
|
|
4642
5555
|
.55,
|
|
4643
5556
|
1,
|
|
4644
5557
|
1.5
|
|
4645
|
-
],
|
|
5558
|
+
], _s = [
|
|
4646
5559
|
0,
|
|
4647
5560
|
0,
|
|
4648
5561
|
0,
|
|
4649
5562
|
3
|
|
4650
|
-
],
|
|
5563
|
+
], vs = [
|
|
4651
5564
|
0,
|
|
4652
5565
|
0,
|
|
4653
5566
|
0,
|
|
4654
5567
|
6
|
|
4655
|
-
],
|
|
5568
|
+
], ys = [
|
|
4656
5569
|
0,
|
|
4657
5570
|
.55,
|
|
4658
5571
|
1,
|
|
4659
5572
|
1.7
|
|
4660
|
-
],
|
|
5573
|
+
], bs = [
|
|
4661
5574
|
0,
|
|
4662
5575
|
0,
|
|
4663
5576
|
0,
|
|
4664
5577
|
6
|
|
4665
|
-
],
|
|
5578
|
+
], xs = [
|
|
4666
5579
|
0,
|
|
4667
5580
|
0,
|
|
4668
5581
|
0,
|
|
4669
5582
|
11
|
|
4670
|
-
],
|
|
5583
|
+
], Ss = {
|
|
4671
5584
|
background: .35,
|
|
4672
5585
|
card: .35,
|
|
4673
5586
|
popover: .32,
|
|
@@ -4677,32 +5590,32 @@ var Vo = (e) => String(Number.isInteger(e) ? e : Math.round(e * 10) / 10), Ho =
|
|
|
4677
5590
|
border: .85,
|
|
4678
5591
|
sheet1: 1.2,
|
|
4679
5592
|
sheet2: 1.3
|
|
4680
|
-
},
|
|
5593
|
+
}, Cs = Object.keys(Ss), ws = {
|
|
4681
5594
|
warm: 40,
|
|
4682
5595
|
cool: 220,
|
|
4683
5596
|
neutral: 0
|
|
4684
5597
|
};
|
|
4685
|
-
function
|
|
4686
|
-
let n =
|
|
4687
|
-
for (let t of
|
|
4688
|
-
let n =
|
|
4689
|
-
i[t] =
|
|
5598
|
+
function Ts(e, t) {
|
|
5599
|
+
let n = os(e.themeId), r = t === "dark" ? n.dark : n.light, i = { ...r }, a = hs(r.primary), o = n.neutral ?? "warm", s = ws[o], c = o === "neutral", l = (t === "dark" ? vs : _s)[e.interfaceIntensity];
|
|
5600
|
+
for (let t of Cs) {
|
|
5601
|
+
let n = fs(r[t]), a = Ss[t], o = c ? 0 : Math.max(n.s * gs[e.interfaceIntensity], l * a);
|
|
5602
|
+
i[t] = ms({
|
|
4690
5603
|
h: c ? n.h : s,
|
|
4691
5604
|
s: o,
|
|
4692
5605
|
l: n.l
|
|
4693
5606
|
});
|
|
4694
5607
|
}
|
|
4695
5608
|
{
|
|
4696
|
-
let n =
|
|
4697
|
-
i.accent =
|
|
5609
|
+
let n = fs(r.accent), a = (t === "dark" ? xs : bs)[e.controlIntensity], o = c ? 0 : Math.max(n.s * ys[e.controlIntensity], a);
|
|
5610
|
+
i.accent = ms({
|
|
4698
5611
|
h: c ? n.h : s,
|
|
4699
5612
|
s: o,
|
|
4700
5613
|
l: n.l
|
|
4701
5614
|
});
|
|
4702
5615
|
}
|
|
4703
|
-
e.background &&
|
|
5616
|
+
e.background && ss[e.background] && (i.background = ss[e.background][t]);
|
|
4704
5617
|
{
|
|
4705
|
-
let n =
|
|
5618
|
+
let n = gs[e.interfaceIntensity], r = t === "dark" ? {
|
|
4706
5619
|
s1: 34,
|
|
4707
5620
|
l1: 16,
|
|
4708
5621
|
s2: 40,
|
|
@@ -4713,11 +5626,11 @@ function $o(e, t) {
|
|
|
4713
5626
|
s2: 50,
|
|
4714
5627
|
l2: 90.5
|
|
4715
5628
|
};
|
|
4716
|
-
i.sheet1 =
|
|
5629
|
+
i.sheet1 = ms({
|
|
4717
5630
|
h: a,
|
|
4718
5631
|
s: c ? 0 : r.s1 * n,
|
|
4719
5632
|
l: r.l1
|
|
4720
|
-
}), i.sheet2 =
|
|
5633
|
+
}), i.sheet2 = ms({
|
|
4721
5634
|
h: a,
|
|
4722
5635
|
s: c ? 0 : r.s2 * n,
|
|
4723
5636
|
l: r.l2
|
|
@@ -4725,50 +5638,50 @@ function $o(e, t) {
|
|
|
4725
5638
|
}
|
|
4726
5639
|
return i;
|
|
4727
5640
|
}
|
|
4728
|
-
var
|
|
4729
|
-
function
|
|
4730
|
-
let n =
|
|
4731
|
-
for (let [e, t] of Object.entries(n)) r[
|
|
5641
|
+
var Es = (e) => `--${e.replace(/([A-Z0-9])/g, "-$1").toLowerCase()}`;
|
|
5642
|
+
function Ds(e, t) {
|
|
5643
|
+
let n = Ts(e, t), r = {};
|
|
5644
|
+
for (let [e, t] of Object.entries(n)) r[Es(e)] = t;
|
|
4732
5645
|
return r;
|
|
4733
5646
|
}
|
|
4734
|
-
function
|
|
5647
|
+
function Os(e, t, n) {
|
|
4735
5648
|
let r = n ?? (typeof document > "u" ? null : document.documentElement);
|
|
4736
5649
|
if (!r) return;
|
|
4737
|
-
let i =
|
|
4738
|
-
for (let [e, t] of Object.entries(i)) r.style.setProperty(
|
|
5650
|
+
let i = Ts(e, t);
|
|
5651
|
+
for (let [e, t] of Object.entries(i)) r.style.setProperty(Es(e), t);
|
|
4739
5652
|
}
|
|
4740
5653
|
//#endregion
|
|
4741
5654
|
//#region src/providers/ThemeProvider.tsx
|
|
4742
|
-
var
|
|
4743
|
-
function
|
|
4744
|
-
if (typeof window > "u") return
|
|
5655
|
+
var ks = "openbook.appearance", As = "openbook.theme";
|
|
5656
|
+
function js() {
|
|
5657
|
+
if (typeof window > "u") return cs;
|
|
4745
5658
|
try {
|
|
4746
|
-
let e = localStorage.getItem(
|
|
5659
|
+
let e = localStorage.getItem(ks);
|
|
4747
5660
|
if (e) return {
|
|
4748
|
-
...
|
|
4749
|
-
...
|
|
5661
|
+
...cs,
|
|
5662
|
+
...ls(JSON.parse(e))
|
|
4750
5663
|
};
|
|
4751
5664
|
} catch {}
|
|
4752
|
-
let e = localStorage.getItem(
|
|
5665
|
+
let e = localStorage.getItem(As);
|
|
4753
5666
|
return e ? {
|
|
4754
|
-
...
|
|
5667
|
+
...cs,
|
|
4755
5668
|
themeId: e
|
|
4756
|
-
} :
|
|
5669
|
+
} : cs;
|
|
4757
5670
|
}
|
|
4758
|
-
var
|
|
5671
|
+
var Ms = {
|
|
4759
5672
|
mode: "system",
|
|
4760
5673
|
colorScheme: "light",
|
|
4761
5674
|
setMode: () => null,
|
|
4762
|
-
appearance:
|
|
5675
|
+
appearance: cs,
|
|
4763
5676
|
setAppearance: () => null,
|
|
4764
|
-
themeId:
|
|
5677
|
+
themeId: rs,
|
|
4765
5678
|
setThemeId: () => null,
|
|
4766
|
-
themes:
|
|
4767
|
-
},
|
|
4768
|
-
function
|
|
4769
|
-
let [i, o] = a.useState(() => typeof window < "u" && localStorage.getItem(n) || t), [s, c] = a.useState("light"), [l, u] = a.useState(
|
|
5679
|
+
themes: is
|
|
5680
|
+
}, Ns = a.createContext(Ms);
|
|
5681
|
+
function Ps({ children: e, defaultColorMode: t = "system", storageKey: n = "theme", ...r }) {
|
|
5682
|
+
let [i, o] = a.useState(() => typeof window < "u" && localStorage.getItem(n) || t), [s, c] = a.useState("light"), [l, u] = a.useState(js), d = i === "system" ? s : i;
|
|
4770
5683
|
a.useEffect(() => {
|
|
4771
|
-
|
|
5684
|
+
Os(l, d);
|
|
4772
5685
|
}, [l, d]), a.useEffect(() => {
|
|
4773
5686
|
typeof document > "u" || document.documentElement.style.setProperty("--overlay-blur", l.blurOverlays ? "8px" : "0px");
|
|
4774
5687
|
}, [l.blurOverlays]), a.useEffect(() => {
|
|
@@ -4789,7 +5702,7 @@ function cs({ children: e, defaultColorMode: t = "system", storageKey: n = "them
|
|
|
4789
5702
|
...e
|
|
4790
5703
|
};
|
|
4791
5704
|
try {
|
|
4792
|
-
localStorage.setItem(
|
|
5705
|
+
localStorage.setItem(ks, JSON.stringify(n));
|
|
4793
5706
|
} catch {}
|
|
4794
5707
|
return n;
|
|
4795
5708
|
});
|
|
@@ -4803,201 +5716,201 @@ function cs({ children: e, defaultColorMode: t = "system", storageKey: n = "them
|
|
|
4803
5716
|
setAppearance: f,
|
|
4804
5717
|
themeId: l.themeId,
|
|
4805
5718
|
setThemeId: (e) => f({ themeId: e }),
|
|
4806
|
-
themes:
|
|
5719
|
+
themes: is
|
|
4807
5720
|
};
|
|
4808
|
-
return /* @__PURE__ */ p(
|
|
5721
|
+
return /* @__PURE__ */ p(Ns.Provider, {
|
|
4809
5722
|
...r,
|
|
4810
5723
|
value: m,
|
|
4811
5724
|
children: e
|
|
4812
5725
|
});
|
|
4813
5726
|
}
|
|
4814
|
-
var
|
|
4815
|
-
let e = a.useContext(
|
|
5727
|
+
var Fs = () => {
|
|
5728
|
+
let e = a.useContext(Ns);
|
|
4816
5729
|
if (e === void 0) throw Error("useTheme must be used within a ThemeProvider");
|
|
4817
5730
|
return e;
|
|
4818
|
-
},
|
|
4819
|
-
Star:
|
|
4820
|
-
Heart:
|
|
4821
|
-
Bookmark:
|
|
4822
|
-
Flag:
|
|
4823
|
-
Pin:
|
|
4824
|
-
Tag:
|
|
4825
|
-
Crown:
|
|
4826
|
-
Award:
|
|
4827
|
-
Trophy:
|
|
4828
|
-
Gem:
|
|
4829
|
-
Diamond:
|
|
4830
|
-
Sparkles:
|
|
4831
|
-
Flame:
|
|
4832
|
-
Zap:
|
|
4833
|
-
Gift:
|
|
4834
|
-
PartyPopper:
|
|
4835
|
-
Smile:
|
|
4836
|
-
ThumbsUp:
|
|
4837
|
-
Check:
|
|
4838
|
-
CheckCircle2:
|
|
4839
|
-
Target:
|
|
4840
|
-
Infinity:
|
|
4841
|
-
FileText:
|
|
4842
|
-
Folder:
|
|
4843
|
-
Book:
|
|
4844
|
-
BookOpen:
|
|
4845
|
-
Library:
|
|
4846
|
-
Newspaper:
|
|
4847
|
-
Clipboard:
|
|
4848
|
-
List:
|
|
4849
|
-
Archive:
|
|
4850
|
-
Inbox:
|
|
4851
|
-
Briefcase:
|
|
4852
|
-
Calendar:
|
|
4853
|
-
Clock:
|
|
4854
|
-
AlarmClock:
|
|
4855
|
-
Timer:
|
|
4856
|
-
Paperclip:
|
|
4857
|
-
BarChart3:
|
|
4858
|
-
PieChart:
|
|
4859
|
-
TrendingUp:
|
|
4860
|
-
Table:
|
|
4861
|
-
Grid3x3:
|
|
4862
|
-
Database:
|
|
4863
|
-
Layers:
|
|
4864
|
-
Gauge:
|
|
4865
|
-
Calculator:
|
|
4866
|
-
DollarSign:
|
|
4867
|
-
Coins:
|
|
4868
|
-
Wallet:
|
|
4869
|
-
CreditCard:
|
|
4870
|
-
PiggyBank:
|
|
4871
|
-
ShoppingBag:
|
|
4872
|
-
ShoppingCart:
|
|
4873
|
-
Scale:
|
|
4874
|
-
Code2:
|
|
4875
|
-
Terminal:
|
|
4876
|
-
Cpu:
|
|
4877
|
-
Binary:
|
|
4878
|
-
GitBranch:
|
|
4879
|
-
Bug:
|
|
4880
|
-
Cog:
|
|
4881
|
-
Settings:
|
|
4882
|
-
Wrench:
|
|
4883
|
-
Hammer:
|
|
4884
|
-
Plug:
|
|
4885
|
-
Key:
|
|
4886
|
-
Lock:
|
|
4887
|
-
Shield:
|
|
4888
|
-
Wifi:
|
|
4889
|
-
Monitor:
|
|
4890
|
-
Laptop:
|
|
4891
|
-
Keyboard:
|
|
4892
|
-
Mouse:
|
|
4893
|
-
Mail:
|
|
4894
|
-
MessageCircle:
|
|
4895
|
-
MessageSquare:
|
|
4896
|
-
Send:
|
|
4897
|
-
Bell:
|
|
4898
|
-
Megaphone:
|
|
4899
|
-
Phone:
|
|
4900
|
-
Share2:
|
|
4901
|
-
Link:
|
|
4902
|
-
Hash:
|
|
4903
|
-
Image:
|
|
4904
|
-
Camera:
|
|
4905
|
-
Video:
|
|
4906
|
-
Film:
|
|
4907
|
-
Clapperboard:
|
|
4908
|
-
Music:
|
|
4909
|
-
Headphones:
|
|
4910
|
-
Mic:
|
|
4911
|
-
Speaker:
|
|
4912
|
-
Radio:
|
|
4913
|
-
Tv:
|
|
4914
|
-
Play:
|
|
4915
|
-
Gamepad2:
|
|
4916
|
-
Palette:
|
|
4917
|
-
Brush:
|
|
4918
|
-
PenTool:
|
|
4919
|
-
Pencil:
|
|
4920
|
-
Aperture:
|
|
4921
|
-
User:
|
|
4922
|
-
Users:
|
|
4923
|
-
Hand:
|
|
4924
|
-
Eye:
|
|
4925
|
-
Brain:
|
|
4926
|
-
Footprints:
|
|
4927
|
-
GraduationCap:
|
|
4928
|
-
Dumbbell:
|
|
4929
|
-
Leaf:
|
|
4930
|
-
Sprout:
|
|
4931
|
-
Flower2:
|
|
4932
|
-
TreePine:
|
|
4933
|
-
Mountain:
|
|
4934
|
-
Globe:
|
|
4935
|
-
Sun:
|
|
4936
|
-
Moon:
|
|
4937
|
-
Cloud:
|
|
4938
|
-
Snowflake:
|
|
4939
|
-
Droplet:
|
|
4940
|
-
Waves:
|
|
4941
|
-
Wind:
|
|
4942
|
-
Umbrella:
|
|
4943
|
-
Feather:
|
|
4944
|
-
Bird:
|
|
4945
|
-
Dog:
|
|
4946
|
-
Rabbit:
|
|
4947
|
-
Coffee:
|
|
4948
|
-
Utensils:
|
|
4949
|
-
Cake:
|
|
4950
|
-
ChefHat:
|
|
4951
|
-
Carrot:
|
|
4952
|
-
Cherry:
|
|
4953
|
-
Egg:
|
|
4954
|
-
Beaker:
|
|
4955
|
-
FlaskConical:
|
|
4956
|
-
Home:
|
|
4957
|
-
Building2:
|
|
4958
|
-
Tent:
|
|
4959
|
-
MapPin:
|
|
4960
|
-
Map:
|
|
4961
|
-
Compass:
|
|
4962
|
-
Navigation:
|
|
4963
|
-
Rocket:
|
|
4964
|
-
Plane:
|
|
4965
|
-
Car:
|
|
4966
|
-
Bus:
|
|
4967
|
-
Bike:
|
|
4968
|
-
Truck:
|
|
4969
|
-
Anchor:
|
|
4970
|
-
Backpack:
|
|
4971
|
-
Ticket:
|
|
4972
|
-
Lamp:
|
|
4973
|
-
Lightbulb:
|
|
4974
|
-
Box:
|
|
4975
|
-
Package:
|
|
4976
|
-
Puzzle:
|
|
4977
|
-
Ruler:
|
|
4978
|
-
Scissors:
|
|
4979
|
-
Sword:
|
|
4980
|
-
Sticker:
|
|
4981
|
-
Watch:
|
|
4982
|
-
Battery:
|
|
4983
|
-
Wand2:
|
|
4984
|
-
Activity:
|
|
4985
|
-
Search:
|
|
4986
|
-
Filter:
|
|
4987
|
-
Plus:
|
|
4988
|
-
Download:
|
|
4989
|
-
Save:
|
|
4990
|
-
Trash2:
|
|
4991
|
-
Info:
|
|
4992
|
-
HelpCircle:
|
|
4993
|
-
AlertTriangle:
|
|
4994
|
-
ToggleLeft:
|
|
4995
|
-
PanelLeft:
|
|
4996
|
-
Layout:
|
|
4997
|
-
Circle:
|
|
4998
|
-
},
|
|
4999
|
-
function
|
|
5000
|
-
return
|
|
5731
|
+
}, Is = "lucide:", Ls = (e) => !!e && e.startsWith("lucide:"), Rs = (e) => !e || Ls(e) ? "" : e, zs = {
|
|
5732
|
+
Star: On,
|
|
5733
|
+
Heart: pt,
|
|
5734
|
+
Bookmark: W,
|
|
5735
|
+
Flag: Ye,
|
|
5736
|
+
Pin: nn,
|
|
5737
|
+
Tag: Nn,
|
|
5738
|
+
Crown: Fe,
|
|
5739
|
+
Award: L,
|
|
5740
|
+
Trophy: Wn,
|
|
5741
|
+
Gem: rt,
|
|
5742
|
+
Diamond: Le,
|
|
5743
|
+
Sparkles: Tn,
|
|
5744
|
+
Flame: Xe,
|
|
5745
|
+
Zap: ar,
|
|
5746
|
+
Gift: it,
|
|
5747
|
+
PartyPopper: Xt,
|
|
5748
|
+
Smile: Cn,
|
|
5749
|
+
ThumbsUp: Ln,
|
|
5750
|
+
Check: ye,
|
|
5751
|
+
CheckCircle2: be,
|
|
5752
|
+
Target: Pn,
|
|
5753
|
+
Infinity: vt,
|
|
5754
|
+
FileText: Ke,
|
|
5755
|
+
Folder: $e,
|
|
5756
|
+
Book: se,
|
|
5757
|
+
BookOpen: U,
|
|
5758
|
+
Library: Dt,
|
|
5759
|
+
Newspaper: Gt,
|
|
5760
|
+
Clipboard: Te,
|
|
5761
|
+
List: At,
|
|
5762
|
+
Archive: I,
|
|
5763
|
+
Inbox: _t,
|
|
5764
|
+
Briefcase: ce,
|
|
5765
|
+
Calendar: he,
|
|
5766
|
+
Clock: Ee,
|
|
5767
|
+
AlarmClock: M,
|
|
5768
|
+
Timer: zn,
|
|
5769
|
+
Paperclip: Yt,
|
|
5770
|
+
BarChart3: ie,
|
|
5771
|
+
PieChart: en,
|
|
5772
|
+
TrendingUp: Un,
|
|
5773
|
+
Table: Mn,
|
|
5774
|
+
Grid3x3: ct,
|
|
5775
|
+
Database: Ie,
|
|
5776
|
+
Layers: wt,
|
|
5777
|
+
Gauge: nt,
|
|
5778
|
+
Calculator: me,
|
|
5779
|
+
DollarSign: ze,
|
|
5780
|
+
Coins: je,
|
|
5781
|
+
Wallet: Qn,
|
|
5782
|
+
CreditCard: Pe,
|
|
5783
|
+
PiggyBank: tn,
|
|
5784
|
+
ShoppingBag: xn,
|
|
5785
|
+
ShoppingCart: Sn,
|
|
5786
|
+
Scale: mn,
|
|
5787
|
+
Code2: Oe,
|
|
5788
|
+
Terminal: In,
|
|
5789
|
+
Cpu: Ne,
|
|
5790
|
+
Binary: oe,
|
|
5791
|
+
GitBranch: at,
|
|
5792
|
+
Bug: ue,
|
|
5793
|
+
Cog: Ae,
|
|
5794
|
+
Settings: vn,
|
|
5795
|
+
Wrench: ir,
|
|
5796
|
+
Hammer: lt,
|
|
5797
|
+
Plug: on,
|
|
5798
|
+
Key: bt,
|
|
5799
|
+
Lock: jt,
|
|
5800
|
+
Shield: bn,
|
|
5801
|
+
Wifi: nr,
|
|
5802
|
+
Monitor: zt,
|
|
5803
|
+
Laptop: Ct,
|
|
5804
|
+
Keyboard: xt,
|
|
5805
|
+
Mouse: Ht,
|
|
5806
|
+
Mail: Mt,
|
|
5807
|
+
MessageCircle: It,
|
|
5808
|
+
MessageSquare: Lt,
|
|
5809
|
+
Send: _n,
|
|
5810
|
+
Bell: V,
|
|
5811
|
+
Megaphone: Ft,
|
|
5812
|
+
Phone: $t,
|
|
5813
|
+
Share2: yn,
|
|
5814
|
+
Link: kt,
|
|
5815
|
+
Hash: dt,
|
|
5816
|
+
Image: gt,
|
|
5817
|
+
Camera: ge,
|
|
5818
|
+
Video: Zn,
|
|
5819
|
+
Film: qe,
|
|
5820
|
+
Clapperboard: we,
|
|
5821
|
+
Music: Ut,
|
|
5822
|
+
Headphones: ft,
|
|
5823
|
+
Mic: Rt,
|
|
5824
|
+
Speaker: En,
|
|
5825
|
+
Radio: un,
|
|
5826
|
+
Tv: Kn,
|
|
5827
|
+
Play: an,
|
|
5828
|
+
Gamepad2: tt,
|
|
5829
|
+
Palette: qt,
|
|
5830
|
+
Brush: le,
|
|
5831
|
+
PenTool: Zt,
|
|
5832
|
+
Pencil: Qt,
|
|
5833
|
+
Aperture: F,
|
|
5834
|
+
User: Jn,
|
|
5835
|
+
Users: Yn,
|
|
5836
|
+
Hand: ut,
|
|
5837
|
+
Eye: We,
|
|
5838
|
+
Brain: K,
|
|
5839
|
+
Footprints: et,
|
|
5840
|
+
GraduationCap: st,
|
|
5841
|
+
Dumbbell: He,
|
|
5842
|
+
Leaf: Et,
|
|
5843
|
+
Sprout: Dn,
|
|
5844
|
+
Flower2: Qe,
|
|
5845
|
+
TreePine: Hn,
|
|
5846
|
+
Mountain: Vt,
|
|
5847
|
+
Globe: ot,
|
|
5848
|
+
Sun: An,
|
|
5849
|
+
Moon: Bt,
|
|
5850
|
+
Cloud: De,
|
|
5851
|
+
Snowflake: wn,
|
|
5852
|
+
Droplet: Ve,
|
|
5853
|
+
Waves: tr,
|
|
5854
|
+
Wind: rr,
|
|
5855
|
+
Umbrella: qn,
|
|
5856
|
+
Feather: Ge,
|
|
5857
|
+
Bird: H,
|
|
5858
|
+
Dog: Re,
|
|
5859
|
+
Rabbit: ln,
|
|
5860
|
+
Coffee: ke,
|
|
5861
|
+
Utensils: Xn,
|
|
5862
|
+
Cake: pe,
|
|
5863
|
+
ChefHat: xe,
|
|
5864
|
+
Carrot: ve,
|
|
5865
|
+
Cherry: Se,
|
|
5866
|
+
Egg: Ue,
|
|
5867
|
+
Beaker: B,
|
|
5868
|
+
FlaskConical: Ze,
|
|
5869
|
+
Home: ht,
|
|
5870
|
+
Building2: de,
|
|
5871
|
+
Tent: Fn,
|
|
5872
|
+
MapPin: Pt,
|
|
5873
|
+
Map: Nt,
|
|
5874
|
+
Compass: Me,
|
|
5875
|
+
Navigation: Wt,
|
|
5876
|
+
Rocket: dn,
|
|
5877
|
+
Plane: rn,
|
|
5878
|
+
Car: _e,
|
|
5879
|
+
Bus: fe,
|
|
5880
|
+
Bike: ae,
|
|
5881
|
+
Truck: Gn,
|
|
5882
|
+
Anchor: P,
|
|
5883
|
+
Backpack: R,
|
|
5884
|
+
Ticket: Rn,
|
|
5885
|
+
Lamp: St,
|
|
5886
|
+
Lightbulb: Ot,
|
|
5887
|
+
Box: G,
|
|
5888
|
+
Package: Kt,
|
|
5889
|
+
Puzzle: cn,
|
|
5890
|
+
Ruler: fn,
|
|
5891
|
+
Scissors: hn,
|
|
5892
|
+
Sword: jn,
|
|
5893
|
+
Sticker: kn,
|
|
5894
|
+
Watch: er,
|
|
5895
|
+
Battery: z,
|
|
5896
|
+
Wand2: $n,
|
|
5897
|
+
Activity: j,
|
|
5898
|
+
Search: gn,
|
|
5899
|
+
Filter: Je,
|
|
5900
|
+
Plus: sn,
|
|
5901
|
+
Download: Be,
|
|
5902
|
+
Save: pn,
|
|
5903
|
+
Trash2: Vn,
|
|
5904
|
+
Info: yt,
|
|
5905
|
+
HelpCircle: mt,
|
|
5906
|
+
AlertTriangle: N,
|
|
5907
|
+
ToggleLeft: Bn,
|
|
5908
|
+
PanelLeft: Jt,
|
|
5909
|
+
Layout: Tt,
|
|
5910
|
+
Circle: Ce
|
|
5911
|
+
}, Bs = Object.keys(zs);
|
|
5912
|
+
function Vs(e) {
|
|
5913
|
+
return zs[e.startsWith("lucide:") ? e.slice(7) : e] ?? null;
|
|
5001
5914
|
}
|
|
5002
5915
|
//#endregion
|
|
5003
|
-
export {
|
|
5916
|
+
export { Wi as $, ka as A, hr as At, _a as B, Ya as C, Dr as Ct, Xa as D, dr as Dt, qa as E, J as Et, Ia as F, ca as G, fa as H, Pa as I, Qi as J, sa as K, Fa as L, Da as M, sr as Mt, Ea as N, q as Nt, ja as O, mr as Ot, Aa as P, zi as Q, Ca as R, Ka as S, Tr as St, Ja as T, yr as Tt, pa as U, ga as V, oa as W, Yi as X, ea as Y, Xi as Z, io as _, pi as _t, Ls as a, Ti as at, ao as b, mi as bt, Fs as c, Ci as ct, os as d, vi as dt, Ui as et, us as f, _i as ft, Jo as g, Jr as gt, es as h, qr as ht, Is as i, Oi as it, Ma as j, cr as jt, Oa as k, lr as kt, ss as l, xi as lt, is as m, gi as mt, Bs as n, Vi as nt, Rs as o, hi as ot, ls as p, Si as pt, Zi as q, Vs as r, Di as rt, Ps as s, yi as st, zs as t, Bi as tt, Ds as u, bi as ut, ro as v, Xr as vt, Wa as w, Er as wt, Ga as x, X as xt, so as y, Yr as yt, Ta as z };
|