@texonom/nreact 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1,1071 +1,200 @@
1
- var Ct = Object.defineProperty, _t = Object.defineProperties;
2
- var wt = Object.getOwnPropertyDescriptors;
3
- var Ne = Object.getOwnPropertySymbols;
4
- var lt = Object.prototype.hasOwnProperty, it = Object.prototype.propertyIsEnumerable;
5
- var rt = (t, o, a) => o in t ? Ct(t, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[o] = a, h = (t, o) => {
6
- for (var a in o || (o = {}))
7
- lt.call(o, a) && rt(t, a, o[a]);
8
- if (Ne)
9
- for (var a of Ne(o))
10
- it.call(o, a) && rt(t, a, o[a]);
11
- return t;
12
- }, U = (t, o) => _t(t, wt(o));
13
- var T = (t, o) => {
14
- var a = {};
15
- for (var l in t)
16
- lt.call(t, l) && o.indexOf(l) < 0 && (a[l] = t[l]);
17
- if (t != null && Ne)
18
- for (var l of Ne(t))
19
- o.indexOf(l) < 0 && it.call(t, l) && (a[l] = t[l]);
20
- return a;
1
+ var ot = Object.defineProperty, at = Object.defineProperties;
2
+ var rt = Object.getOwnPropertyDescriptors;
3
+ var ge = Object.getOwnPropertySymbols;
4
+ var Ye = Object.prototype.hasOwnProperty, Ze = Object.prototype.propertyIsEnumerable;
5
+ var Ge = (n, a, o) => a in n ? ot(n, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[a] = o, W = (n, a) => {
6
+ for (var o in a || (a = {}))
7
+ Ye.call(a, o) && Ge(n, o, a[o]);
8
+ if (ge)
9
+ for (var o of ge(a))
10
+ Ze.call(a, o) && Ge(n, o, a[o]);
11
+ return n;
12
+ }, be = (n, a) => at(n, rt(a));
13
+ var le = (n, a) => {
14
+ var o = {};
15
+ for (var m in n)
16
+ Ye.call(n, m) && a.indexOf(m) < 0 && (o[m] = n[m]);
17
+ if (n != null && ge)
18
+ for (var m of ge(n))
19
+ a.indexOf(m) < 0 && Ze.call(n, m) && (o[m] = n[m]);
20
+ return o;
21
21
  };
22
- var we = (t, o, a) => new Promise((l, i) => {
23
- var s = (c) => {
24
- try {
25
- u(a.next(c));
26
- } catch (d) {
27
- i(d);
28
- }
29
- }, r = (c) => {
30
- try {
31
- u(a.throw(c));
32
- } catch (d) {
33
- i(d);
34
- }
35
- }, u = (c) => c.done ? l(c.value) : Promise.resolve(c.value).then(s, r);
36
- u((a = a.apply(t, o)).next());
37
- });
38
22
  import e from "react";
39
- import xt from "@fisch0920/medium-zoom";
40
- import { normalizeUrl as $t, getBlockIcon as ft, getBlockTitle as ze, isUrl as gt, formatNotionDateTime as Lt, formatDate as xe, parsePageId as _e, getBlockParentPage as Ie, getPageBreadcrumbs as It, defaultMapImageUrl as ht, defaultMapPageUrl as Et, getTextContent as le, uuidToId as Ce, getPageTableOfContents as $e, getBlockCollectionId as St } from "@texonom/nutils";
41
- import { formatDate as oa, formatNotionDateTime as ra, isUrl as la } from "@texonom/nutils";
42
- import { useHotkeys as ct } from "react-hotkeys-hook";
43
- import { Img as Mt } from "react-image";
44
- import zt from "react-fast-compare";
45
- function Pt(t) {
46
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M5.5 12L14 3.5 12.5 2l-7 7-4-4.003L0 6.499z" }));
47
- }
48
- const Tt = ({ isChecked: t }) => {
49
- let o = null;
50
- return t ? o = /* @__PURE__ */ e.createElement("div", { className: "notion-property-checkbox-checked" }, /* @__PURE__ */ e.createElement(Pt, null)) : o = /* @__PURE__ */ e.createElement("div", { className: "notion-property-checkbox-unchecked" }), /* @__PURE__ */ e.createElement("span", { className: "notion-property notion-property-checkbox" }, o);
51
- }, vt = (t) => {
52
- const l = t, { className: o } = l, a = T(l, ["className"]);
53
- return /* @__PURE__ */ e.createElement("svg", h({ className: `notion-icon ${o || ""}`, viewBox: "0 0 17 17" }, a), /* @__PURE__ */ e.createElement("path", { d: "M6.78027 13.6729C8.24805 13.6729 9.60156 13.1982 10.709 12.4072L14.875 16.5732C15.0684 16.7666 15.3232 16.8633 15.5957 16.8633C16.167 16.8633 16.5713 16.4238 16.5713 15.8613C16.5713 15.5977 16.4834 15.3516 16.29 15.1582L12.1504 11.0098C13.0205 9.86719 13.5391 8.45215 13.5391 6.91406C13.5391 3.19629 10.498 0.155273 6.78027 0.155273C3.0625 0.155273 0.0214844 3.19629 0.0214844 6.91406C0.0214844 10.6318 3.0625 13.6729 6.78027 13.6729ZM6.78027 12.2139C3.87988 12.2139 1.48047 9.81445 1.48047 6.91406C1.48047 4.01367 3.87988 1.61426 6.78027 1.61426C9.68066 1.61426 12.0801 4.01367 12.0801 6.91406C12.0801 9.81445 9.68066 12.2139 6.78027 12.2139Z" }));
54
- }, Bt = (t) => {
55
- const l = t, { className: o } = l, a = T(l, ["className"]);
56
- return /* @__PURE__ */ e.createElement("svg", U(h({ className: o }, a), { viewBox: "0 0 30 30", width: "16" }), /* @__PURE__ */ e.createElement("path", { d: "M16,1H4v28h22V11L16,1z M16,3.828L23.172,11H16V3.828z M24,27H6V3h8v10h10V27z M8,17h14v-2H8V17z M8,21h14v-2H8V21z M8,25h14v-2H8V25z" }));
57
- }, Ht = (t) => {
58
- const o = [];
59
- let a, l = -1;
60
- return Object.keys(t).forEach((i) => {
61
- var r, u;
62
- const s = (r = t[i]) == null ? void 0 : r.value;
63
- s && ((u = s.content) == null || u.forEach((c) => {
64
- var g, m;
65
- const d = (m = (g = t[c]) == null ? void 0 : g.value) == null ? void 0 : m.type;
66
- d && d !== a && (l++, a = d, o[l] = []), l > -1 && o[l].push(c);
67
- })), a = void 0;
68
- }), o;
69
- }, Ot = (t, o) => {
70
- const l = Ht(o).find((i) => i.includes(t));
71
- if (l)
72
- return l.indexOf(t) + 1;
73
- }, Vt = (t) => t.includes("#") ? t.replace(/^.+(#.+)$/, "$1") : "", Rt = typeof window != "undefined", jt = /* @__PURE__ */ new Set([
74
- "youtu.be",
75
- "youtube.com",
76
- "www.youtube.com",
77
- "youtube-nocookie.com",
78
- "www.youtube-nocookie.com"
79
- ]), Dt = (t) => {
80
- try {
81
- const { hostname: o } = new URL(t);
82
- if (!jt.has(o)) return null;
83
- const a = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/i, l = t.match(a);
84
- if (l && l[2].length == 11) return l[2];
85
- } catch (o) {
86
- }
87
- return null;
88
- }, ie = (c) => {
89
- var d = c, { src: t, alt: o, className: a, style: l, zoomable: i = !1, priority: s = !1, height: r } = d, u = T(d, ["src", "alt", "className", "style", "zoomable", "priority", "height"]);
90
- var w, y, f;
91
- const { recordMap: g, zoom: m, previewImages: E, forceCustomImages: N, components: n } = V(), p = e.useRef(m ? m.clone() : null), x = E ? (f = (w = g == null ? void 0 : g.preview_images) == null ? void 0 : w[t]) != null ? f : (y = g == null ? void 0 : g.preview_images) == null ? void 0 : y[$t(t)] : null, M = e.useCallback(
92
- (v) => {
93
- i && (v.target.src || v.target.srcset) && p.current && p.current.attach(v.target);
94
- },
95
- [p, i]
96
- ), $ = e.useCallback(
97
- (v) => {
98
- p.current && v && p.current.attach(v);
99
- },
100
- [p]
101
- ), H = e.useMemo(() => i ? $ : void 0, [i, $]);
102
- return x && n.Image ? /* @__PURE__ */ e.createElement(
103
- n.Image,
104
- {
105
- src: t,
106
- alt: o,
107
- style: l,
108
- className: a,
109
- width: x.originalWidth,
110
- height: x.originalHeight,
111
- blurDataURL: x.dataURIBase64,
112
- placeholder: "blur",
113
- priority: s,
114
- onLoad: M
115
- }
116
- ) : n.Image && N ? /* @__PURE__ */ e.createElement(
117
- n.Image,
118
- {
119
- src: t,
120
- alt: o,
121
- className: a,
122
- style: l,
123
- width: null,
124
- height: r || null,
125
- priority: s,
126
- onLoad: M
127
- }
128
- ) : /* @__PURE__ */ e.createElement(
129
- "img",
130
- h({
131
- className: a,
132
- style: l,
133
- src: t,
134
- alt: o,
135
- ref: H,
136
- loading: "lazy",
137
- decoding: "async"
138
- }, u)
139
- );
140
- }, Ft = (t) => t.type === "page" || t.type === "callout" || t.type === "collection_view" || t.type === "collection_view_page", Ut = ({ block: t, className: o, inline: a = !0, hideDefaultIcon: l = !1, defaultIcon: i }) => {
141
- var g;
142
- const { mapImageUrl: s, recordMap: r, darkMode: u } = V();
143
- let c = !1, d = null;
144
- if (Ft(t)) {
145
- const m = ((g = ft(t, r)) == null ? void 0 : g.trim()) || i, E = ze(t, r);
146
- if (m && gt(m)) {
147
- const N = s(m, t);
148
- c = !0, d = /* @__PURE__ */ e.createElement(ie, { src: N, alt: E || "page icon", className: `${o || ""} notion-page-icon` });
149
- } else if (m && m.startsWith("/icons/")) {
150
- const N = "https://www.notion.so" + m + "?mode=" + (u ? "dark" : "light");
151
- d = /* @__PURE__ */ e.createElement(ie, { src: N, alt: E || "page icon", className: `${o || ""} notion-page-icon` });
152
- } else m ? (c = !1, d = /* @__PURE__ */ e.createElement("span", { className: `${o || ""} notion-page-icon`, role: "img", "aria-label": m }, m)) : l || (c = !0, d = /* @__PURE__ */ e.createElement(Bt, { className: `${o || ""} notion-page-icon`, alt: E || "page icon" }));
153
- }
154
- return d ? /* @__PURE__ */ e.createElement(
155
- "div",
156
- {
157
- className: `
158
- ${a ? "notion-page-icon-inline" : "notion-page-icon-hero"}
159
- ${c ? "notion-page-icon-image" : "notion-page-icon-span"}
160
- `
161
- },
162
- d
163
- ) : null;
164
- }, pe = e.memo(Ut), At = (t) => {
165
- const l = t, { className: o } = l, a = T(l, ["className"]);
166
- return /* @__PURE__ */ e.createElement("svg", U(h({ className: `notion-icon ${o || ""}` }, a), { viewBox: "0 0 30 30" }), /* @__PURE__ */ e.createElement("path", { d: "M15,0C6.716,0,0,6.716,0,15s6.716,15,15,15s15-6.716,15-15S23.284,0,15,0z M22,20.6L20.6,22L15,16.4L9.4,22L8,20.6l5.6-5.6 L8,9.4L9.4,8l5.6,5.6L20.6,8L22,9.4L16.4,15L22,20.6z" }));
167
- }, qt = (t) => {
168
- const l = t, { className: o } = l, a = T(l, ["className"]);
169
- return /* @__PURE__ */ e.createElement("svg", U(h({ className: `notion-icon ${o || ""}` }, a), { viewBox: "0 0 24 24" }), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("linearGradient", { x1: "28.1542969%", y1: "63.7402344%", x2: "74.6289062%", y2: "17.7832031%", id: "linearGradient-1" }, /* @__PURE__ */ e.createElement("stop", { stopColor: "rgba(164, 164, 164, 1)", offset: "0%" }), /* @__PURE__ */ e.createElement("stop", { stopColor: "rgba(164, 164, 164, 0)", stopOpacity: "0", offset: "100%" }))), /* @__PURE__ */ e.createElement("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none" }, /* @__PURE__ */ e.createElement("g", { transform: "translate(-236.000000, -286.000000)" }, /* @__PURE__ */ e.createElement("g", { transform: "translate(238.000000, 286.000000)" }, /* @__PURE__ */ e.createElement("circle", { id: "Oval-2", stroke: "url(#linearGradient-1)", strokeWidth: "4", cx: "10", cy: "12", r: "10" }), /* @__PURE__ */ e.createElement("path", { d: "M10,2 C4.4771525,2 0,6.4771525 0,12", id: "Oval-2", stroke: "rgba(164, 164, 164, 1)", strokeWidth: "4" }), /* @__PURE__ */ e.createElement("rect", { id: "Rectangle-1", fill: "rgba(164, 164, 164, 1)", x: "8", y: "0", width: "4", height: "4", rx: "8" })))));
170
- };
171
- function Wt(t) {
172
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 260 260" }, t), /* @__PURE__ */ e.createElement("g", null, /* @__PURE__ */ e.createElement(
173
- "path",
174
- {
175
- d: "M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z",
176
- fill: "#161614"
177
- }
178
- )));
179
- }
180
- const yt = ({ block: t, inline: o, className: a }) => {
181
- var E, N, n;
182
- const { components: l } = V(), { original_url: i, attributes: s, domain: r } = (t == null ? void 0 : t.format) || {};
183
- if (!i || !s) return null;
184
- const u = (E = s.find((p) => p.id === "title")) == null ? void 0 : E.values[0];
185
- let c = (N = s.find((p) => p.id === "owner")) == null ? void 0 : N.values[0];
186
- const d = (n = s.find((p) => p.id === "updated_at")) == null ? void 0 : n.values[0], g = d ? Lt(d) : null;
187
- let m;
188
- switch (r) {
189
- case "github.com":
190
- if (m = /* @__PURE__ */ e.createElement(Wt, null), c) {
191
- const p = c.split("/");
192
- c = p[p.length - 1];
193
- }
194
- break;
195
- default:
196
- return process.env.NODE_ENV !== "production" && console.debug(`Unsupported external_object_instance domain "${r}"`, JSON.stringify(t, null, 2)), null;
197
- }
198
- return /* @__PURE__ */ e.createElement(
199
- l.Link,
200
- {
201
- target: "_blank",
202
- rel: "noopener noreferrer",
203
- href: i,
204
- className: `notion-external ${o ? "notion-external-mention" : "notion-external-block notion-row"} ${a || ""}`
205
- },
206
- m && /* @__PURE__ */ e.createElement("div", { className: "notion-external-image" }, m),
207
- /* @__PURE__ */ e.createElement("div", { className: "notion-external-description" }, /* @__PURE__ */ e.createElement("div", { className: "notion-external-title" }, u), (c || g) && /* @__PURE__ */ e.createElement("div", { className: "notion-external-subtitle" }, c && /* @__PURE__ */ e.createElement("span", null, c), c && g && /* @__PURE__ */ e.createElement("span", null, " • "), g && /* @__PURE__ */ e.createElement("span", null, "Updated ", g)))
208
- );
209
- }, Se = (t) => Rt ? /* @__PURE__ */ e.createElement(Mt, h({}, t)) : /* @__PURE__ */ e.createElement("img", h({}, t)), P = ({ value: t, block: o, linkProps: a, linkProtocol: l }) => {
210
- const { components: i, recordMap: s, mapPageUrl: r, mapImageUrl: u, rootDomain: c } = V();
211
- return /* @__PURE__ */ e.createElement(e.Fragment, null, t == null ? void 0 : t.map((d, g) => {
212
- const [m, E] = d;
213
- if (!E)
214
- return m === "," ? /* @__PURE__ */ e.createElement("span", { key: g, style: { padding: "0.5em" } }) : /* @__PURE__ */ e.createElement(e.Fragment, { key: g }, m);
215
- const N = E.reduce(
216
- (n, p) => {
217
- var x, M, $, H, w;
218
- switch (p[0]) {
219
- case "p": {
220
- const y = p[1], f = (x = s.block[y]) == null ? void 0 : x.value;
221
- return f ? /* @__PURE__ */ e.createElement(i.PageLink, { className: "notion-link", href: r(y) }, /* @__PURE__ */ e.createElement(fe, { block: f })) : (console.debug('"p" missing block', y), null);
222
- }
223
- case "‣": {
224
- const y = p[1][0], f = p[1][1];
225
- switch (y) {
226
- case "u": {
227
- const v = (M = s.notion_user[f]) == null ? void 0 : M.value;
228
- if (!v)
229
- return console.debug('"‣" missing user', f), null;
230
- const _ = [v.given_name, v.family_name].filter(Boolean).join(" "), L = v.email;
231
- return /* @__PURE__ */ e.createElement(i.Link, h({ className: "notion-link", href: `mailto:${L}` }, a), /* @__PURE__ */ e.createElement(
232
- Se,
233
- {
234
- className: "notion-user",
235
- src: u(v.profile_photo, o),
236
- alt: _,
237
- style: { display: "inline", marginRight: "0.3em", marginBottom: "0.3em" }
238
- }
239
- ), _);
240
- }
241
- default: {
242
- const v = ($ = s.block[f]) == null ? void 0 : $.value;
243
- return v ? /* @__PURE__ */ e.createElement(
244
- i.PageLink,
245
- U(h({
246
- className: "notion-link",
247
- href: r(f)
248
- }, a), {
249
- target: "_blank",
250
- rel: "noopener noreferrer"
251
- }),
252
- /* @__PURE__ */ e.createElement(fe, { block: v })
253
- ) : (console.debug('"‣" missing block', y, f), null);
254
- }
255
- }
256
- }
257
- case "h":
258
- return /* @__PURE__ */ e.createElement("span", { className: `notion-${p[1]}` }, n);
259
- case "c":
260
- return /* @__PURE__ */ e.createElement("code", { className: "notion-inline-code" }, n);
261
- case "b":
262
- return /* @__PURE__ */ e.createElement("b", null, n);
263
- case "i":
264
- return /* @__PURE__ */ e.createElement("em", null, n);
265
- case "s":
266
- return /* @__PURE__ */ e.createElement("s", null, n);
267
- case "_":
268
- return /* @__PURE__ */ e.createElement("span", { className: "notion-inline-underscore" }, n);
269
- case "e":
270
- return /* @__PURE__ */ e.createElement(i.Equation, { math: p[1], inline: !0 });
271
- case "m":
272
- return n;
273
- //still need to return the base element
274
- case "a": {
275
- const y = p[1], f = y.substring(1), v = _e(f, { uuid: !0 });
276
- if ((y[0] === "/" || y.includes(c)) && v) {
277
- const _ = y.includes(c) ? y : `${r(v)}${Vt(y)}`;
278
- return /* @__PURE__ */ e.createElement(i.PageLink, h({ className: "notion-link", href: _ }, a), n);
279
- } else
280
- return /* @__PURE__ */ e.createElement(
281
- i.Link,
282
- h({
283
- className: "notion-link",
284
- href: l ? `${l}:${p[1]}` : p[1]
285
- }, a),
286
- n
287
- );
288
- }
289
- // Date
290
- case "d": {
291
- const y = p[1], f = y == null ? void 0 : y.type;
292
- if (f === "date") {
293
- const v = y.start_date;
294
- return xe(v);
295
- } else if (f === "daterange") {
296
- const v = y.start_date, _ = y.end_date;
297
- return `${xe(v)} → ${xe(_)}`;
298
- } else
299
- return n;
300
- }
301
- // User
302
- case "u": {
303
- const y = p[1], f = (H = s.notion_user[y]) == null ? void 0 : H.value;
304
- if (!f)
305
- return console.debug("missing user", y), null;
306
- const v = f.name, _ = f.email;
307
- return /* @__PURE__ */ e.createElement(i.Link, h({ className: "notion-link", href: `mailto:${_}` }, a), /* @__PURE__ */ e.createElement(
308
- Se,
309
- {
310
- className: "notion-user",
311
- src: u(f.profile_photo, o),
312
- alt: v,
313
- style: { display: "inline", marginRight: "0.3em", marginBottom: "0.3em" }
314
- }
315
- ), v);
316
- }
317
- case "eoi": {
318
- const y = p[1], f = (w = s.block[y]) == null ? void 0 : w.value;
319
- return /* @__PURE__ */ e.createElement(yt, { block: f, inline: !0 });
320
- }
321
- default:
322
- return process.env.NODE_ENV !== "production" && console.debug("unsupported text format", p), n;
323
- }
324
- },
325
- /* @__PURE__ */ e.createElement(e.Fragment, null, m)
326
- );
327
- return /* @__PURE__ */ e.createElement(e.Fragment, { key: g }, N);
328
- }));
329
- }, Zt = (i) => {
330
- var s = i, { block: t, className: o, defaultIcon: a } = s, l = T(s, ["block", "className", "defaultIcon"]);
331
- var u, c;
332
- const { recordMap: r } = V();
333
- if (!t) return null;
334
- if (t.type === "collection_view_page" || t.type === "collection_view") {
335
- const d = ze(t, r);
336
- if (!d) return null;
337
- const g = [[d]];
338
- return /* @__PURE__ */ e.createElement("span", h({ className: `notion-page-title ${o || ""}` }, l), /* @__PURE__ */ e.createElement(pe, { block: t, defaultIcon: a, className: "notion-page-title-icon" }), /* @__PURE__ */ e.createElement("span", { className: "notion-page-title-text" }, /* @__PURE__ */ e.createElement(P, { value: g, block: t })));
339
- }
340
- return (u = t.properties) != null && u.title ? /* @__PURE__ */ e.createElement("span", h({ className: `notion-page-title ${o || ""}` }, l), /* @__PURE__ */ e.createElement(pe, { block: t, defaultIcon: a, className: "notion-page-title-icon" }), /* @__PURE__ */ e.createElement("span", { className: "notion-page-title-text" }, /* @__PURE__ */ e.createElement(P, { value: (c = t.properties) == null ? void 0 : c.title, block: t }))) : null;
341
- }, fe = e.memo(Zt), Gt = (t, o) => {
342
- let a;
343
- return (...l) => {
344
- a && clearTimeout(a), a = setTimeout(() => t(...l), o);
345
- };
346
- };
347
- class Qt extends e.Component {
348
- constructor(o) {
349
- super(o), this.state = {
350
- isLoading: !1,
351
- query: "",
352
- searchResult: null,
353
- searchError: null
354
- }, this._onAfterOpen = () => {
355
- this._inputRef.current && this._inputRef.current.focus();
356
- }, this._onChangeQuery = (a) => {
357
- const l = a.target.value;
358
- if (this.setState({ query: l }), l.trim())
359
- this._search();
360
- else {
361
- this.setState({ isLoading: !1, searchResult: null, searchError: null });
362
- return;
363
- }
364
- }, this._onClearQuery = () => {
365
- this._onChangeQuery({ target: { value: "" } });
366
- }, this._warmupSearch = () => we(this, null, function* () {
367
- const { searchNotion: a, rootBlockId: l, rootSpaceId: i } = this.props;
368
- yield a({
369
- query: "",
370
- spaceId: i,
371
- filters: {
372
- ancestors: [l],
373
- isDeletedOnly: !1,
374
- excludeTemplates: !0,
375
- navigableBlockContentOnly: !0,
376
- requireEditPermissions: !1
377
- }
378
- });
379
- }), this._searchImpl = () => we(this, null, function* () {
380
- const { searchNotion: a, rootBlockId: l, rootSpaceId: i } = this.props, { query: s } = this.state;
381
- if (!s.trim()) {
382
- this.setState({ isLoading: !1, searchResult: null, searchError: null });
383
- return;
384
- }
385
- this.setState({ isLoading: !0 });
386
- const r = yield a({
387
- query: s,
388
- spaceId: i,
389
- filters: {
390
- ancestors: [l],
391
- isDeletedOnly: !1,
392
- excludeTemplates: !0,
393
- navigableBlockContentOnly: !0,
394
- requireEditPermissions: !1
395
- }
396
- });
397
- console.debug("search", s, r);
398
- let u = null, c = null;
399
- if (r.error || r.errorId)
400
- c = r;
401
- else {
402
- u = h({}, r);
403
- const g = u.results.map((m) => {
404
- var n, p;
405
- const E = (n = u.recordMap.block[m.id]) == null ? void 0 : n.value;
406
- if (!E) return;
407
- const N = ze(E, u.recordMap);
408
- if (N && (m.title = N, m.block = E, m.recordMap = u.recordMap, m.page = Ie(E, u.recordMap, {
409
- inclusive: !0
410
- }) || E, !!m.page.id))
411
- return (p = m.highlight) != null && p.text && (m.highlight.html = m.highlight.text.replace(/<gzkNfoUU>/gi, "<b>").replace(/<\/gzkNfoUU>/gi, "</b>")), m;
412
- }).filter(Boolean).reduce(
413
- (m, E) => U(h({}, m), {
414
- [E.page.id]: E
415
- }),
416
- {}
417
- );
418
- u.results = Object.values(g);
419
- }
420
- this.state.query === s && this.setState({ isLoading: !1, searchResult: u, searchError: c });
421
- }), this._inputRef = e.createRef();
422
- }
423
- componentDidMount() {
424
- this._search = Gt(this._searchImpl.bind(this), 500), this._warmupSearch();
425
- }
426
- render() {
427
- const { isOpen: o, onClose: a } = this.props, { isLoading: l, query: i, searchResult: s, searchError: r } = this.state, u = !!i.trim();
428
- return /* @__PURE__ */ e.createElement(cn, null, (c) => {
429
- const { components: d, defaultPageIcon: g, mapPageUrl: m } = c;
430
- return /* @__PURE__ */ e.createElement(
431
- d.Modal,
432
- {
433
- isOpen: o,
434
- contentLabel: "Search",
435
- className: "notion-search",
436
- overlayClassName: "notion-search-overlay",
437
- onRequestClose: a,
438
- onAfterOpen: this._onAfterOpen
439
- },
440
- /* @__PURE__ */ e.createElement("div", { className: "quickFindMenu" }, /* @__PURE__ */ e.createElement("div", { className: "searchBar" }, /* @__PURE__ */ e.createElement("div", { className: "inlineIcon" }, l ? /* @__PURE__ */ e.createElement(qt, { className: "loadingIcon" }) : /* @__PURE__ */ e.createElement(vt, null)), /* @__PURE__ */ e.createElement(
441
- "input",
442
- {
443
- className: "searchInput",
444
- placeholder: "Search",
445
- value: i,
446
- ref: this._inputRef,
447
- onInput: this._onChangeQuery
448
- }
449
- ), i && /* @__PURE__ */ e.createElement("div", { role: "button", className: "clearButton", onClick: this._onClearQuery }, /* @__PURE__ */ e.createElement(At, { className: "clearIcon" }))), u && s && /* @__PURE__ */ e.createElement(e.Fragment, null, s.results.length ? /* @__PURE__ */ e.createElement(kt, U(h({}, c), { recordMap: s.recordMap }), /* @__PURE__ */ e.createElement("div", { className: "resultsPane" }, s.results.map((E) => {
450
- var N;
451
- return /* @__PURE__ */ e.createElement(
452
- d.PageLink,
453
- {
454
- key: E.id,
455
- className: "result notion-page-link",
456
- href: m(E.page.id, s.recordMap)
457
- },
458
- /* @__PURE__ */ e.createElement(fe, { block: E.page, defaultIcon: g }),
459
- ((N = E.highlight) == null ? void 0 : N.html) && /* @__PURE__ */ e.createElement(
460
- "div",
461
- {
462
- className: "notion-search-result-highlight",
463
- dangerouslySetInnerHTML: {
464
- __html: E.highlight.html
465
- }
466
- }
467
- )
468
- );
469
- })), /* @__PURE__ */ e.createElement("footer", { className: "resultsFooter" }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", { className: "resultsCount" }, s.total), s.total === 1 ? " result" : " results"))) : /* @__PURE__ */ e.createElement("div", { className: "noResultsPane" }, /* @__PURE__ */ e.createElement("div", { className: "noResults" }, "No results"), /* @__PURE__ */ e.createElement("div", { className: "noResultsDetail" }, "Try different search terms"))), u && !s && r && /* @__PURE__ */ e.createElement("div", { className: "noResultsPane" }, /* @__PURE__ */ e.createElement("div", { className: "noResults" }, "Search error")))
470
- );
471
- });
472
- }
473
- }
474
- const Yt = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { className: "notion-header" }, /* @__PURE__ */ e.createElement("div", { className: "notion-nav-header" }, /* @__PURE__ */ e.createElement(Xt, { block: t }), /* @__PURE__ */ e.createElement(Jt, { block: t }))), Xt = ({ block: t, rootOnly: o = !1 }) => {
475
- const { recordMap: a, mapPageUrl: l, components: i } = V(), s = e.useMemo(() => {
476
- const r = It(a, t.id);
477
- return o ? [r[0]].filter(Boolean) : r;
478
- }, [a, t.id, o]);
479
- return /* @__PURE__ */ e.createElement("div", { className: "breadcrumbs", key: "breadcrumbs" }, s.map((r, u) => {
480
- if (!r) return null;
481
- const c = {}, d = {
482
- pageLink: i.PageLink
483
- };
484
- return r.active ? d.pageLink = (g) => /* @__PURE__ */ e.createElement("div", h({}, g)) : c.href = l(r.pageId), /* @__PURE__ */ e.createElement(e.Fragment, { key: r.pageId }, /* @__PURE__ */ e.createElement(d.pageLink, h({ className: `breadcrumb ${r.active && "active"}` }, c), r.icon && /* @__PURE__ */ e.createElement(pe, { className: "icon", block: r.block }), r.title && /* @__PURE__ */ e.createElement("span", { className: "title" }, r.title)), u < s.length - 1 && /* @__PURE__ */ e.createElement("span", { className: "spacer" }, "/"));
485
- }));
486
- }, Jt = ({ block: t, search: o, title: a = "Search" }) => {
487
- const { searchNotion: l, rootPageId: i, isShowingSearch: s, onHideSearch: r, rootSpaceId: u } = V(), c = o || l, [d, g] = e.useState(s);
488
- e.useEffect(() => {
489
- g(s);
490
- }, [s]);
491
- const m = e.useCallback(() => {
492
- g(!0);
493
- }, []), E = e.useCallback(() => {
494
- g(!1), r && r();
495
- }, [r]);
496
- ct("cmd+p", (n) => {
497
- m(), n.preventDefault(), n.stopPropagation();
498
- }), ct("cmd+k", (n) => {
499
- m(), n.preventDefault(), n.stopPropagation();
500
- });
501
- const N = !!c;
502
- return /* @__PURE__ */ e.createElement(e.Fragment, null, N && /* @__PURE__ */ e.createElement("div", { role: "button", className: "breadcrumb button notion-search-button", onClick: m }, /* @__PURE__ */ e.createElement(vt, { className: "searchIcon" }), a && /* @__PURE__ */ e.createElement("span", { className: "title" }, a)), d && N && /* @__PURE__ */ e.createElement(
503
- Qt,
504
- {
505
- isOpen: d,
506
- rootBlockId: i || (t == null ? void 0 : t.id),
507
- rootSpaceId: u,
508
- onClose: E,
509
- searchNotion: c
510
- }
511
- ));
512
- }, Kt = (t) => e.memo(function(g) {
513
- var m = g, {
514
- src: a,
515
- alt: l,
516
- width: i,
517
- height: s,
518
- className: r,
519
- style: u,
520
- layout: c
521
- } = m, d = T(m, [
522
- "src",
523
- "alt",
524
- "width",
525
- "height",
526
- "className",
527
- "style",
528
- "layout"
529
- ]);
530
- return c || (c = i && s ? "intrinsic" : "fill"), /* @__PURE__ */ e.createElement(
531
- t,
532
- h({
533
- className: r,
534
- src: a,
535
- alt: l,
536
- width: c === "intrinsic" && i,
537
- height: c === "intrinsic" && s,
538
- objectFit: u == null ? void 0 : u.objectFit,
539
- objectPosition: u == null ? void 0 : u.objectPosition,
540
- layout: c
541
- }, d)
542
- );
543
- }, zt), en = (t) => function(N) {
544
- var n = N, {
545
- href: a,
546
- as: l,
547
- passHref: i,
548
- prefetch: s,
549
- replace: r,
550
- scroll: u,
551
- shallow: c,
552
- locale: d,
553
- className: g,
554
- style: m
555
- } = n, E = T(n, [
556
- "href",
557
- "as",
558
- "passHref",
559
- "prefetch",
560
- "replace",
561
- "scroll",
562
- "shallow",
563
- "locale",
564
- "className",
565
- "style"
566
- ]);
567
- return /* @__PURE__ */ e.createElement(
568
- t,
569
- h({
570
- href: a,
571
- as: l,
572
- prefetch: s,
573
- replace: r,
574
- scroll: u,
575
- shallow: c,
576
- locale: d,
577
- className: g,
578
- style: m
579
- }, E)
580
- );
581
- }, tn = (t) => /* @__PURE__ */ e.createElement("a", h({ target: "_blank", rel: "noopener noreferrer" }, t)), nn = e.memo(tn), an = (a) => {
582
- var l = a, { href: t } = l, o = T(l, ["href"]);
583
- var u, c;
584
- const { recordMap: i, rootSpaceId: s } = V();
585
- let r = t;
586
- if (typeof t == "string" && s) {
587
- const d = _e(t);
588
- if (d) {
589
- const g = (c = (u = i == null ? void 0 : i.block) == null ? void 0 : u[d]) == null ? void 0 : c.value;
590
- (!g || g.space_id !== s) && (r = `https://notion.so/${d.replace(/-/g, "")}`);
591
- }
592
- }
593
- return /* @__PURE__ */ e.createElement("a", h({ href: r }, o));
594
- }, on = e.memo(an), rn = (t) => /* @__PURE__ */ e.createElement(Me, h({}, t)), ln = Yt, Kn = (s) => {
595
- var r = s, { href: t, rel: o, target: a, title: l } = r, i = T(r, ["href", "rel", "target", "title"]);
596
- return /* @__PURE__ */ e.createElement("span", h({}, i));
597
- }, re = (t) => () => (console.warn(`Warning: using empty component "${t}" (you should override this in NotionRenderer.components)`), null), O = (t, o) => o(), bt = {
598
- Image: null,
599
- // disable custom images by default
600
- Link: nn,
601
- PageLink: on,
602
- Checkbox: Tt,
603
- Callout: void 0,
604
- // use the built-in callout rendering by default
605
- Code: re("Code"),
606
- Equation: re("Equation"),
607
- Collection: re("Collection"),
608
- Property: void 0,
609
- // use the built-in property rendering by default
610
- propertyTextValue: O,
611
- propertySelectValue: O,
612
- propertyRelationValue: O,
613
- propertyFormulaValue: O,
614
- propertyTitleValue: O,
615
- propertyPersonValue: O,
616
- propertyFileValue: O,
617
- propertyCheckboxValue: O,
618
- propertyUrlValue: O,
619
- propertyEmailValue: O,
620
- propertyPhoneNumberValue: O,
621
- propertyNumberValue: O,
622
- propertyLastEditedTimeValue: O,
623
- propertyCreatedTimeValue: O,
624
- propertyDateValue: O,
625
- Pdf: re("Pdf"),
626
- Tweet: re("Tweet"),
627
- Modal: re("Modal"),
628
- Header: ln,
629
- Embed: rn
630
- }, Nt = {
631
- recordMap: {
632
- block: {},
633
- collection: {},
634
- collection_view: {},
635
- collection_query: {},
636
- notion_user: {},
637
- signed_urls: {}
638
- },
639
- components: bt,
640
- mapPageUrl: Et(),
641
- mapImageUrl: ht,
642
- searchNotion: null,
643
- isShowingSearch: !1,
644
- onHideSearch: null,
645
- fullPage: !1,
646
- darkMode: !1,
647
- previewImages: !1,
648
- forceCustomImages: !1,
649
- showCollectionViewDropdown: !0,
650
- linkTableTitleProperties: !0,
651
- isLinkCollectionToUrlProperty: !1,
652
- showTableOfContents: !1,
653
- minTableOfContentsItems: 3,
654
- defaultPageIcon: null,
655
- defaultPageCover: null,
656
- defaultPageCoverPosition: 0.5,
657
- zoom: null
658
- }, Pe = e.createContext(Nt), kt = (u) => {
659
- var c = u, {
660
- components: t = {},
661
- children: o,
662
- mapPageUrl: a,
663
- mapImageUrl: l,
664
- rootPageId: i,
665
- rootSpaceId: s
666
- } = c, r = T(c, [
667
- "components",
668
- "children",
669
- "mapPageUrl",
670
- "mapImageUrl",
671
- "rootPageId",
672
- "rootSpaceId"
673
- ]);
674
- for (const m of Object.keys(r)) r[m] === void 0 && delete r[m];
675
- const d = e.useMemo(() => {
676
- const m = h({}, t);
677
- if (m.nextImage && (m.Image = Kt(m.nextImage)), m.nextLink) {
678
- const E = en(m.nextLink);
679
- m.nextLink = E, m.PageLink || (m.PageLink = E), m.Link || (m.Link = E);
680
- }
681
- for (const E of Object.keys(m)) m[E] || delete m[E];
682
- return m;
683
- }, [t]), g = e.useMemo(
684
- () => U(h(h({}, Nt), r), {
685
- rootPageId: i,
686
- rootSpaceId: s,
687
- mapPageUrl: a != null ? a : Et(i),
688
- mapImageUrl: l != null ? l : ht,
689
- components: h(h({}, bt), d)
690
- }),
691
- [l, a, d, i, s, r]
692
- );
693
- return /* @__PURE__ */ e.createElement(Pe.Provider, { value: g }, o);
694
- }, cn = Pe.Consumer, V = () => e.useContext(Pe), sn = (t) => Object.keys(t).map((o) => `${encodeURIComponent(o)}=${encodeURIComponent(t[o])}`).join("&"), mn = ({
695
- id: t,
696
- defaultPlay: o = !1,
697
- mute: a = !1,
698
- lazyImage: l = !1,
699
- iframeTitle: i = "YouTube video",
700
- alt: s = "Video preview",
701
- params: r = {},
702
- adLinksPreconnect: u = !0,
703
- style: c,
704
- className: d
705
- }) => {
706
- const g = a || o ? "1" : "0", m = e.useMemo(() => sn(h({ autoplay: "1", mute: g }, r)), [g, r]), N = `https://i.ytimg.com/vi/${t}/hqdefault.jpg`, n = "https://www.youtube-nocookie.com", p = `${n}/embed/${t}?${m}`, [x, M] = e.useState(!1), [$, H] = e.useState(o), [w, y] = e.useState(!1), f = e.useCallback(() => {
707
- x || M(!0);
708
- }, [x]), v = e.useCallback(() => {
709
- $ || H(!0);
710
- }, [$]), _ = e.useCallback(() => {
711
- y(!0);
712
- }, []);
713
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preload", href: N, as: "image" }), x && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: n }), /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://www.google.com" })), x && u && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://static.doubleclick.net" }), /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://googleads.g.doubleclick.net" })), /* @__PURE__ */ e.createElement(
714
- "div",
715
- {
716
- onClick: v,
717
- onPointerOver: f,
718
- className: `notion-yt-lite
719
- ${w && "notion-yt-loaded"}
720
- ${$ && "notion-yt-initialized"}
721
- ${d || ""}`,
722
- style: c
723
- },
724
- /* @__PURE__ */ e.createElement("img", { src: N, className: "notion-yt-thumbnail", loading: l ? "lazy" : void 0, alt: s }),
725
- /* @__PURE__ */ e.createElement("div", { className: "notion-yt-playbtn" }),
726
- $ && /* @__PURE__ */ e.createElement(
727
- "iframe",
728
- {
729
- width: "560",
730
- height: "315",
731
- frameBorder: "0",
732
- allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
733
- allowFullScreen: !0,
734
- title: i,
735
- src: p,
736
- onLoad: _
737
- }
738
- )
739
- ));
740
- }, un = typeof window == "undefined", dn = [
741
- "video",
742
- "image",
743
- "embed",
744
- "figma",
745
- "typeform",
746
- "excalidraw",
747
- "maps",
748
- "tweet",
749
- "pdf",
750
- "gist",
751
- "codepen",
752
- "drive"
753
- ], pn = ({ block: t, zoomable: o = !0, children: a }) => {
754
- var g, m, E, N, n, p, x, M, $, H;
755
- const { recordMap: l, mapImageUrl: i, components: s } = V();
756
- if (!t || !dn.includes(t.type)) return null;
757
- const r = {
758
- position: "relative",
759
- display: "flex",
760
- justifyContent: "center",
761
- alignSelf: "center",
762
- width: "100%",
763
- maxWidth: "100%",
764
- flexDirection: "column"
765
- }, u = {};
766
- if (t.format) {
767
- const { block_aspect_ratio: w, block_height: y, block_width: f, block_full_width: v, block_page_width: _, block_preserve_scale: L } = t.format;
768
- if (v || _)
769
- v ? r.width = "100vw" : r.width = "100%", t.type === "video" ? y ? r.height = y : w ? r.paddingBottom = `${w * 100}%` : L && (r.objectFit = "contain") : w && t.type !== "image" ? r.paddingBottom = `${w * 100}%` : y ? r.height = y : L && (t.type === "image" ? r.height = "100%" : (r.paddingBottom = "75%", r.minHeight = 100));
770
- else {
771
- switch ((g = t.format) == null ? void 0 : g.block_alignment) {
772
- case "center": {
773
- r.alignSelf = "center";
774
- break;
775
- }
776
- case "left": {
777
- r.alignSelf = "start";
778
- break;
779
- }
780
- case "right": {
781
- r.alignSelf = "end";
782
- break;
783
- }
784
- }
785
- f && (r.width = f), L && t.type !== "image" ? (r.paddingBottom = "50%", r.minHeight = 100) : y && t.type !== "image" && (r.height = y);
786
- }
787
- t.type === "image" ? u.objectFit = "cover" : L && (u.objectFit = "contain");
788
- }
789
- let c = ((m = l.signed_urls) == null ? void 0 : m[t.id]) || ((n = (N = (E = t.properties) == null ? void 0 : E.source) == null ? void 0 : N[0]) == null ? void 0 : n[0]), d = null;
790
- if (!c) return null;
791
- if (t.type === "tweet") {
792
- const w = c;
793
- if (!w) return null;
794
- const y = w.split("?")[0].split("/").pop();
795
- if (!y) return null;
796
- d = /* @__PURE__ */ e.createElement(
797
- "div",
798
- {
799
- style: U(h({}, u), {
800
- maxWidth: 420,
801
- width: "100%",
802
- marginLeft: "auto",
803
- marginRight: "auto"
804
- })
805
- },
806
- /* @__PURE__ */ e.createElement(s.Tweet, { id: y })
807
- );
808
- } else if (t.type === "pdf")
809
- r.overflow = "auto", r.background = "rgb(226, 226, 226)", r.display = "block", r.padding || (r.padding = "8px 16px"), un || (d = /* @__PURE__ */ e.createElement(s.Pdf, { file: c }));
810
- else if (t.type === "embed" || t.type === "video" || t.type === "figma" || t.type === "typeform" || t.type === "gist" || t.type === "maps" || t.type === "excalidraw" || t.type === "codepen" || t.type === "drive")
811
- if (t.type === "video" && c && c.indexOf("youtube") < 0 && c.indexOf("youtu.be") < 0 && c.indexOf("vimeo") < 0 && c.indexOf("wistia") < 0 && c.indexOf("loom") < 0 && c.indexOf("videoask") < 0 && c.indexOf("getcloudapp") < 0)
812
- r.paddingBottom = void 0, d = /* @__PURE__ */ e.createElement("video", { playsInline: !0, controls: !0, preload: "metadata", style: u, src: c, title: t.type });
813
- else {
814
- let w = ((p = t.format) == null ? void 0 : p.display_source) || c;
815
- if (w) {
816
- const y = t.type === "video" ? Dt(w) : null;
817
- y ? d = /* @__PURE__ */ e.createElement(mn, { id: y, style: u, className: "notion-asset-object-fit" }) : t.type === "gist" ? (w.endsWith(".pibb") || (w = `${w}.pibb`), u.width = "100%", r.paddingBottom = "50%", d = /* @__PURE__ */ e.createElement(
818
- "iframe",
819
- {
820
- style: u,
821
- className: "notion-asset-object-fit",
822
- src: w,
823
- title: "GitHub Gist",
824
- frameBorder: "0",
825
- loading: "lazy",
826
- scrolling: "auto"
827
- }
828
- )) : d = /* @__PURE__ */ e.createElement(
829
- "iframe",
830
- {
831
- className: "notion-asset-object-fit",
832
- style: u,
833
- src: w,
834
- title: `iframe ${t.type}`,
835
- frameBorder: "0",
836
- allowFullScreen: !0,
837
- loading: "lazy",
838
- scrolling: "auto"
839
- }
840
- );
841
- }
842
- }
843
- else if (t.type === "image") {
844
- c.includes("file.notion.so") && (c = ($ = (M = (x = t.properties) == null ? void 0 : x.source) == null ? void 0 : M[0]) == null ? void 0 : $[0]);
845
- const w = i(c, t), f = le((H = t.properties) == null ? void 0 : H.caption) || "notion image";
846
- d = /* @__PURE__ */ e.createElement(ie, { src: w, alt: f, zoomable: o, height: r.height, style: u });
847
- }
848
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: r }, d, t.type === "image" && a), t.type !== "image" && a);
849
- }, fn = { width: "100%" }, Me = ({ blockId: t, block: o }) => {
850
- var d, g, m, E, N, n;
851
- const a = o, { components: l, mapPageUrl: i, rootDomain: s, zoom: r } = V();
852
- let u = !1;
853
- if (o.type === "image") {
854
- const p = (m = (g = (d = a == null ? void 0 : a.properties) == null ? void 0 : d.caption) == null ? void 0 : g[0]) == null ? void 0 : m[0];
855
- if (p) {
856
- const x = _e(p, { uuid: !0 });
857
- (p.charAt(0) === "/" && x || gn(p)) && (u = !0);
858
- }
859
- }
860
- const c = /* @__PURE__ */ e.createElement(
861
- "figure",
862
- {
863
- className: `notion-asset-wrapper
864
- notion-asset-wrapper-${o.type}
865
- ${(E = a.format) != null && E.block_full_width ? "notion-asset-wrapper-full" : ""}
866
- ${t}`
867
- },
868
- /* @__PURE__ */ e.createElement(pn, { block: a, zoomable: r && !u }, ((N = a == null ? void 0 : a.properties) == null ? void 0 : N.caption) && !u && /* @__PURE__ */ e.createElement("figcaption", { className: "notion-asset-caption" }, /* @__PURE__ */ e.createElement(P, { value: a.properties.caption, block: o })))
869
- );
870
- if (u) {
871
- const p = (n = a == null ? void 0 : a.properties) == null ? void 0 : n.caption[0][0], x = _e(p, { uuid: !0 }), M = p.charAt(0) === "/" && x, $ = hn(p);
872
- return /* @__PURE__ */ e.createElement(
873
- l.PageLink,
874
- {
875
- style: fn,
876
- href: M ? i(x) : p,
877
- target: $ && $ !== s && !p.startsWith("/") ? "blank_" : null
878
- },
879
- c
880
- );
881
- }
882
- return c;
883
- };
884
- function gn(t) {
885
- return !!new RegExp(
886
- "^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$",
887
- "i"
888
- ).test(t);
889
- }
890
- function hn(t) {
891
- try {
892
- return new URL(t).hostname;
893
- } catch (o) {
894
- return "";
895
- }
896
- }
897
- const En = ({ block: t, className: o }) => {
898
- var i, s, r;
899
- const { recordMap: a } = V(), l = a.signed_urls[t.id] || ((r = (s = (i = t.properties) == null ? void 0 : i.source) == null ? void 0 : s[0]) == null ? void 0 : r[0]);
900
- return /* @__PURE__ */ e.createElement("div", { className: `notion-audio ${o || ""}` }, /* @__PURE__ */ e.createElement("audio", { controls: !0, preload: "none", src: l }));
901
- }, vn = (t) => {
902
- const l = t, { className: o } = l, a = T(l, ["className"]);
903
- return /* @__PURE__ */ e.createElement("svg", U(h({ className: o }, a), { viewBox: "0 0 30 30" }), /* @__PURE__ */ e.createElement("path", { d: "M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z" }));
904
- }, yn = ({ block: t, className: o }) => {
905
- var s, r, u, c, d;
906
- const { components: a, recordMap: l } = V(), i = l.signed_urls[t.id] || ((u = (r = (s = t.properties) == null ? void 0 : s.source) == null ? void 0 : r[0]) == null ? void 0 : u[0]);
907
- return /* @__PURE__ */ e.createElement("div", { className: `notion-file ${o || ""}` }, /* @__PURE__ */ e.createElement(a.Link, { className: "notion-file-link", href: i, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement(vn, { className: "notion-file-icon" }), /* @__PURE__ */ e.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ e.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ e.createElement(P, { value: ((c = t.properties) == null ? void 0 : c.title) || [["File"]], block: t })), ((d = t.properties) == null ? void 0 : d.size) && /* @__PURE__ */ e.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ e.createElement(P, { value: t.properties.size, block: t })))));
908
- }, bn = ({ block: t, className: o }) => {
909
- var r;
910
- const { components: a, mapImageUrl: l } = V(), i = (r = t.format) == null ? void 0 : r.drive_properties;
911
- if (!i) return null;
912
- let s;
23
+ import lt from "@fisch0920/medium-zoom";
24
+ import { uuidToId as ve, getBlockParentPage as Je, getPageTableOfContents as he, getTextContent as ie, getBlockCollectionId as it, getBlockIcon as ct, isUrl as st } from "@texonom/nutils";
25
+ import { formatDate as Mt, formatNotionDateTime as Ht, isUrl as At } from "@texonom/nutils";
26
+ import { u as ce, T as C, G as mt, E as dt, P as Xe, L as Ne, a as Ke, A as Qe, g as ut, N as pt } from "./asset-wrapper-CaHInqoM.js";
27
+ import { l as Dt, B as Rt, C as zt, H as Ut, k as Wt, e as Vt, f as qt, j as Gt, S as Yt, h as Zt, d as Jt, b as Xt, c as Kt, i as Qt } from "./asset-wrapper-CaHInqoM.js";
28
+ import { c as Ee, g as ft } from "./_commonjsHelpers-bAxELxBV.js";
29
+ import { C as tn, P as nn, i as on } from "./collection-column-title-l4hmVo49.js";
30
+ const gt = ({ block: n, className: a }) => {
31
+ var r, d, v;
32
+ const { recordMap: o } = ce(), m = o.signed_urls[n.id] || ((v = (d = (r = n.properties) == null ? void 0 : r.source) == null ? void 0 : d[0]) == null ? void 0 : v[0]);
33
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-audio ${a || ""}` }, /* @__PURE__ */ e.createElement("audio", { controls: !0, preload: "none", src: m }));
34
+ }, Et = (n) => {
35
+ const m = n, { className: a } = m, o = le(m, ["className"]);
36
+ return /* @__PURE__ */ e.createElement("svg", be(W({ className: a }, o), { viewBox: "0 0 30 30" }), /* @__PURE__ */ e.createElement("path", { d: "M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z" }));
37
+ }, vt = ({ block: n, className: a }) => {
38
+ var d, v, N, y, b;
39
+ const { components: o, recordMap: m } = ce(), r = m.signed_urls[n.id] || ((N = (v = (d = n.properties) == null ? void 0 : d.source) == null ? void 0 : v[0]) == null ? void 0 : N[0]);
40
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-file ${a || ""}` }, /* @__PURE__ */ e.createElement(o.Link, { className: "notion-file-link", href: r, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement(Et, { className: "notion-file-icon" }), /* @__PURE__ */ e.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ e.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ e.createElement(C, { value: ((y = n.properties) == null ? void 0 : y.title) || [["File"]], block: n })), ((b = n.properties) == null ? void 0 : b.size) && /* @__PURE__ */ e.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ e.createElement(C, { value: n.properties.size, block: n })))));
41
+ }, bt = ({ block: n, className: a }) => {
42
+ var v;
43
+ const { components: o, mapImageUrl: m } = ce(), r = (v = n.format) == null ? void 0 : v.drive_properties;
44
+ if (!r) return null;
45
+ let d;
913
46
  try {
914
- s = new URL(i.url).hostname;
915
- } catch (u) {
47
+ d = new URL(r.url).hostname;
48
+ } catch (N) {
916
49
  }
917
- return /* @__PURE__ */ e.createElement("div", { className: `notion-google-drive ${o || ""}` }, /* @__PURE__ */ e.createElement(a.Link, { className: "notion-google-drive-link", href: i.url, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ e.createElement(
918
- Se,
50
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-google-drive ${a || ""}` }, /* @__PURE__ */ e.createElement(o.Link, { className: "notion-google-drive-link", href: r.url, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ e.createElement(
51
+ mt,
919
52
  {
920
- src: l(i.thumbnail, t),
921
- alt: i.title || "Google Drive Document",
53
+ src: m(r.thumbnail, n),
54
+ alt: r.title || "Google Drive Document",
922
55
  loading: "lazy"
923
56
  }
924
- )), /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body" }, i.title && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-title" }, i.title), i.icon && s && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source" }, i.icon && /* @__PURE__ */ e.createElement(
57
+ )), /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body" }, r.title && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-title" }, r.title), r.icon && d && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source" }, r.icon && /* @__PURE__ */ e.createElement(
925
58
  "div",
926
59
  {
927
60
  className: "notion-google-drive-body-source-icon",
928
61
  style: {
929
- backgroundImage: `url(${i.icon})`
62
+ backgroundImage: `url(${r.icon})`
930
63
  }
931
64
  }
932
- ), s && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source-domain" }, s)))));
65
+ ), d && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source-domain" }, d)))));
933
66
  };
934
- var ke = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
935
- function Nn(t) {
936
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
937
- }
938
- var Le, st;
939
- function kn() {
940
- if (st) return Le;
941
- st = 1;
942
- var t = "Expected a function", o = NaN, a = "[object Symbol]", l = /^\s+|\s+$/g, i = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, r = /^0o[0-7]+$/i, u = parseInt, c = typeof ke == "object" && ke && ke.Object === Object && ke, d = typeof self == "object" && self && self.Object === Object && self, g = c || d || Function("return this")(), m = Object.prototype, E = m.toString, N = Math.max, n = Math.min, p = function() {
943
- return g.Date.now();
67
+ var ke, et;
68
+ function ht() {
69
+ if (et) return ke;
70
+ et = 1;
71
+ var n = "Expected a function", a = NaN, o = "[object Symbol]", m = /^\s+|\s+$/g, r = /^[-+]0x[0-9a-f]+$/i, d = /^0b[01]+$/i, v = /^0o[0-7]+$/i, N = parseInt, y = typeof Ee == "object" && Ee && Ee.Object === Object && Ee, b = typeof self == "object" && self && self.Object === Object && self, _ = y || b || Function("return this")(), T = Object.prototype, O = T.toString, L = Math.max, t = Math.min, g = function() {
72
+ return _.Date.now();
944
73
  };
945
- function x(f, v, _) {
946
- var L, D, J, k, R, A, W = 0, ce = !1, Z = !1, K = !0;
947
- if (typeof f != "function")
948
- throw new TypeError(t);
949
- v = y(v) || 0, $(_) && (ce = !!_.leading, Z = "maxWait" in _, J = Z ? N(y(_.maxWait) || 0, v) : J, K = "trailing" in _ ? !!_.trailing : K);
950
- function ee(I) {
951
- var F = L, G = D;
952
- return L = D = void 0, W = I, k = f.apply(G, F), k;
953
- }
954
- function ge(I) {
955
- return W = I, R = setTimeout(Y, v), ce ? ee(I) : k;
956
- }
957
- function he(I) {
958
- var F = I - A, G = I - W, ue = v - F;
959
- return Z ? n(ue, J - G) : ue;
960
- }
961
- function se(I) {
962
- var F = I - A, G = I - W;
963
- return A === void 0 || F >= v || F < 0 || Z && G >= J;
964
- }
965
- function Y() {
966
- var I = p();
967
- if (se(I))
968
- return me(I);
969
- R = setTimeout(Y, he(I));
970
- }
971
- function me(I) {
972
- return R = void 0, K && L ? ee(I) : (L = D = void 0, k);
973
- }
974
- function Ee() {
975
- R !== void 0 && clearTimeout(R), W = 0, L = A = D = R = void 0;
976
- }
977
- function ve() {
978
- return R === void 0 ? k : me(p());
979
- }
980
- function te() {
981
- var I = p(), F = se(I);
982
- if (L = arguments, D = this, A = I, F) {
983
- if (R === void 0)
984
- return ge(A);
985
- if (Z)
986
- return R = setTimeout(Y, v), ee(A);
74
+ function B(i, p, h) {
75
+ var k, I, q, c, x, S, H = 0, te = !1, A = !1, G = !0;
76
+ if (typeof i != "function")
77
+ throw new TypeError(n);
78
+ p = R(p) || 0, M(h) && (te = !!h.leading, A = "maxWait" in h, q = A ? L(R(h.maxWait) || 0, p) : q, G = "trailing" in h ? !!h.trailing : G);
79
+ function Y(E) {
80
+ var P = k, F = I;
81
+ return k = I = void 0, H = E, c = i.apply(F, P), c;
82
+ }
83
+ function se(E) {
84
+ return H = E, x = setTimeout(z, p), te ? Y(E) : c;
85
+ }
86
+ function me(E) {
87
+ var P = E - S, F = E - H, ae = p - P;
88
+ return A ? t(ae, q - F) : ae;
89
+ }
90
+ function ne(E) {
91
+ var P = E - S, F = E - H;
92
+ return S === void 0 || P >= p || P < 0 || A && F >= q;
93
+ }
94
+ function z() {
95
+ var E = g();
96
+ if (ne(E))
97
+ return oe(E);
98
+ x = setTimeout(z, me(E));
99
+ }
100
+ function oe(E) {
101
+ return x = void 0, G && k ? Y(E) : (k = I = void 0, c);
102
+ }
103
+ function de() {
104
+ x !== void 0 && clearTimeout(x), H = 0, k = S = I = x = void 0;
105
+ }
106
+ function ue() {
107
+ return x === void 0 ? c : oe(g());
108
+ }
109
+ function Z() {
110
+ var E = g(), P = ne(E);
111
+ if (k = arguments, I = this, S = E, P) {
112
+ if (x === void 0)
113
+ return se(S);
114
+ if (A)
115
+ return x = setTimeout(z, p), Y(S);
987
116
  }
988
- return R === void 0 && (R = setTimeout(Y, v)), k;
117
+ return x === void 0 && (x = setTimeout(z, p)), c;
989
118
  }
990
- return te.cancel = Ee, te.flush = ve, te;
119
+ return Z.cancel = de, Z.flush = ue, Z;
991
120
  }
992
- function M(f, v, _) {
993
- var L = !0, D = !0;
994
- if (typeof f != "function")
995
- throw new TypeError(t);
996
- return $(_) && (L = "leading" in _ ? !!_.leading : L, D = "trailing" in _ ? !!_.trailing : D), x(f, v, {
997
- leading: L,
998
- maxWait: v,
999
- trailing: D
121
+ function V(i, p, h) {
122
+ var k = !0, I = !0;
123
+ if (typeof i != "function")
124
+ throw new TypeError(n);
125
+ return M(h) && (k = "leading" in h ? !!h.leading : k, I = "trailing" in h ? !!h.trailing : I), B(i, p, {
126
+ leading: k,
127
+ maxWait: p,
128
+ trailing: I
1000
129
  });
1001
130
  }
1002
- function $(f) {
1003
- var v = typeof f;
1004
- return !!f && (v == "object" || v == "function");
131
+ function M(i) {
132
+ var p = typeof i;
133
+ return !!i && (p == "object" || p == "function");
1005
134
  }
1006
- function H(f) {
1007
- return !!f && typeof f == "object";
135
+ function Q(i) {
136
+ return !!i && typeof i == "object";
1008
137
  }
1009
- function w(f) {
1010
- return typeof f == "symbol" || H(f) && E.call(f) == a;
138
+ function ee(i) {
139
+ return typeof i == "symbol" || Q(i) && O.call(i) == o;
1011
140
  }
1012
- function y(f) {
1013
- if (typeof f == "number")
1014
- return f;
1015
- if (w(f))
1016
- return o;
1017
- if ($(f)) {
1018
- var v = typeof f.valueOf == "function" ? f.valueOf() : f;
1019
- f = $(v) ? v + "" : v;
1020
- }
1021
- if (typeof f != "string")
1022
- return f === 0 ? f : +f;
1023
- f = f.replace(l, "");
1024
- var _ = s.test(f);
1025
- return _ || r.test(f) ? u(f.slice(2), _ ? 2 : 8) : i.test(f) ? o : +f;
141
+ function R(i) {
142
+ if (typeof i == "number")
143
+ return i;
144
+ if (ee(i))
145
+ return a;
146
+ if (M(i)) {
147
+ var p = typeof i.valueOf == "function" ? i.valueOf() : i;
148
+ i = M(p) ? p + "" : p;
149
+ }
150
+ if (typeof i != "string")
151
+ return i === 0 ? i : +i;
152
+ i = i.replace(m, "");
153
+ var h = d.test(i);
154
+ return h || v.test(i) ? N(i.slice(2), h ? 2 : 8) : r.test(i) ? a : +i;
1026
155
  }
1027
- return Le = M, Le;
156
+ return ke = V, ke;
1028
157
  }
1029
- var Cn = kn();
1030
- const _n = /* @__PURE__ */ Nn(Cn), wn = ({ toc: t, activeSection: o, setActiveSection: a, pageAside: l, hasToc: i, hasAside: s, className: r }) => {
1031
- const c = e.useMemo(
1032
- () => _n(() => {
1033
- const d = document.getElementsByClassName("notion-h");
1034
- let g = null, m = o;
1035
- for (let E = 0; E < d.length; ++E) {
1036
- const N = d[E];
1037
- if (!N || !(N instanceof Element)) continue;
1038
- m || (m = N.getAttribute("data-id"));
1039
- const n = N.getBoundingClientRect(), p = g ? n.top - g.bottom : 0, x = Math.max(150, p / 4);
1040
- if (n.top - x < 0) {
1041
- m = N.getAttribute("data-id"), g = n;
158
+ var Nt = ht();
159
+ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSection: o, pageAside: m, hasToc: r, hasAside: d, className: v }) => {
160
+ const y = e.useMemo(
161
+ () => kt(() => {
162
+ const b = document.getElementsByClassName("notion-h");
163
+ let _ = null, T = a;
164
+ for (let O = 0; O < b.length; ++O) {
165
+ const L = b[O];
166
+ if (!L || !(L instanceof Element)) continue;
167
+ T || (T = L.getAttribute("data-id"));
168
+ const t = L.getBoundingClientRect(), g = _ ? t.top - _.bottom : 0, B = Math.max(150, g / 4);
169
+ if (t.top - B < 0) {
170
+ T = L.getAttribute("data-id"), _ = t;
1042
171
  continue;
1043
172
  }
1044
173
  break;
1045
174
  }
1046
- a(m);
175
+ o(T);
1047
176
  }, 100),
1048
177
  // eslint-disable-next-line react-hooks/exhaustive-deps
1049
178
  [
1050
179
  // explicitly not taking a dependency on activeSection
1051
- a
180
+ o
1052
181
  ]
1053
182
  );
1054
183
  return e.useEffect(() => {
1055
- if (i)
1056
- return window.addEventListener("scroll", c), c(), () => {
1057
- window.removeEventListener("scroll", c);
184
+ if (r)
185
+ return window.addEventListener("scroll", y), y(), () => {
186
+ window.removeEventListener("scroll", y);
1058
187
  };
1059
- }, [i, c]), s ? /* @__PURE__ */ e.createElement("aside", { className: `notion-aside ${r || ""}` }, i && /* @__PURE__ */ e.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ e.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ e.createElement("nav", { className: "notion-table-of-contents" }, t.map((d) => {
1060
- const g = Ce(d.id);
188
+ }, [r, y]), d ? /* @__PURE__ */ e.createElement("aside", { className: `notion-aside ${v || ""}` }, r && /* @__PURE__ */ e.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ e.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ e.createElement("nav", { className: "notion-table-of-contents" }, n.map((b) => {
189
+ const _ = ve(b.id);
1061
190
  return /* @__PURE__ */ e.createElement(
1062
191
  "a",
1063
192
  {
1064
- key: g,
1065
- href: `#${g}`,
193
+ key: _,
194
+ href: `#${_}`,
1066
195
  className: `notion-table-of-contents-item
1067
- notion-table-of-contents-item-indent-level-${d.indentLevel}
1068
- ${o === g && "notion-table-of-contents-active-item"}`
196
+ notion-table-of-contents-item-indent-level-${b.indentLevel}
197
+ ${a === _ && "notion-table-of-contents-active-item"}`
1069
198
  },
1070
199
  /* @__PURE__ */ e.createElement(
1071
200
  "span",
@@ -1073,158 +202,158 @@ const _n = /* @__PURE__ */ Nn(Cn), wn = ({ toc: t, activeSection: o, setActiveSe
1073
202
  className: "notion-table-of-contents-item-body",
1074
203
  style: {
1075
204
  display: "inline-block",
1076
- marginLeft: d.indentLevel * 16
205
+ marginLeft: b.indentLevel * 16
1077
206
  }
1078
207
  },
1079
- d.text
208
+ b.text
1080
209
  )
1081
210
  );
1082
- }))), l) : null;
1083
- }, xn = ({ block: t, level: o }) => {
1084
- var i, s;
1085
- if (!t)
1086
- return process.env.NODE_ENV !== "production" && console.warn("missing sync pointer block", t.id), null;
1087
- const a = t, l = (s = (i = a == null ? void 0 : a.format) == null ? void 0 : i.transclusion_reference_pointer) == null ? void 0 : s.id;
1088
- return l ? /* @__PURE__ */ e.createElement(Te, { key: l, level: o, blockId: l }) : null;
1089
- }, $n = (t) => {
1090
- const l = t, { className: o } = l, a = T(l, ["className"]);
1091
- return /* @__PURE__ */ e.createElement("svg", U(h({ className: o }, a), { viewBox: "0 0 16 16", width: "16", height: "16" }), /* @__PURE__ */ e.createElement(
211
+ }))), m) : null;
212
+ }, _t = ({ block: n, level: a }) => {
213
+ var r, d;
214
+ if (!n)
215
+ return process.env.NODE_ENV !== "production" && console.warn("missing sync pointer block", n.id), null;
216
+ const o = n, m = (d = (r = o == null ? void 0 : o.format) == null ? void 0 : r.transclusion_reference_pointer) == null ? void 0 : d.id;
217
+ return m ? /* @__PURE__ */ e.createElement(ye, { key: m, level: a, blockId: m }) : null;
218
+ }, $t = (n) => {
219
+ const m = n, { className: a } = m, o = le(m, ["className"]);
220
+ return /* @__PURE__ */ e.createElement("svg", be(W({ className: a }, o), { viewBox: "0 0 16 16", width: "16", height: "16" }), /* @__PURE__ */ e.createElement(
1092
221
  "path",
1093
222
  {
1094
223
  fillRule: "evenodd",
1095
224
  d: "M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"
1096
225
  }
1097
226
  ));
1098
- }, mt = {}, ut = {}, Ln = (t) => {
1099
- var R, A, W, ce, Z, K, ee, ge, he, se, Y, me, Ee, ve, te, I, F, G, ue, Be, He, Oe, Ve, Re, je, De, Fe, Ue, Ae, qe, We, Ze, Ge, Qe, Ye, Xe, Je, Ke, et, tt, nt, at, ot;
1100
- const o = V(), {
1101
- components: a,
1102
- fullPage: l,
1103
- recordMap: i,
1104
- mapPageUrl: s,
1105
- mapImageUrl: r,
1106
- showTableOfContents: u,
1107
- minTableOfContentsItems: c,
1108
- defaultPageIcon: d,
1109
- defaultPageCover: g,
1110
- defaultPageCoverPosition: m
1111
- } = o, [E, N] = e.useState(null), {
1112
- block: n,
1113
- children: p,
1114
- level: x,
1115
- className: M,
1116
- bodyClassName: $,
1117
- header: H,
1118
- footer: w,
1119
- pageHeader: y,
1120
- pageFooter: f,
1121
- pageTitle: v,
1122
- pageAside: _,
1123
- pageCover: L,
1124
- hideBlockId: D,
1125
- disableHeader: J
1126
- } = t;
1127
- if (!n) return null;
1128
- if (x === 0 && n.type === "collection_view") {
1129
- const b = n;
1130
- b.type = "collection_view_page";
227
+ }, tt = {}, nt = {}, Ct = (n) => {
228
+ var x, S, H, te, A, G, Y, se, me, ne, z, oe, de, ue, Z, E, P, F, ae, _e, $e, Ce, xe, we, Ie, Le, Pe, Te, Se, je, Oe, Be, Me, He, Ae, Fe, De, Re, ze, Ue, We, Ve, qe;
229
+ const a = ce(), {
230
+ components: o,
231
+ fullPage: m,
232
+ recordMap: r,
233
+ mapPageUrl: d,
234
+ mapImageUrl: v,
235
+ showTableOfContents: N,
236
+ minTableOfContentsItems: y,
237
+ defaultPageIcon: b,
238
+ defaultPageCover: _,
239
+ defaultPageCoverPosition: T
240
+ } = a, [O, L] = e.useState(null), {
241
+ block: t,
242
+ children: g,
243
+ level: B,
244
+ className: V,
245
+ bodyClassName: M,
246
+ header: Q,
247
+ footer: ee,
248
+ pageHeader: R,
249
+ pageFooter: i,
250
+ pageTitle: p,
251
+ pageAside: h,
252
+ pageCover: k,
253
+ hideBlockId: I,
254
+ disableHeader: q
255
+ } = n;
256
+ if (!t) return null;
257
+ if (B === 0 && t.type === "collection_view") {
258
+ const l = t;
259
+ l.type = "collection_view_page";
1131
260
  }
1132
- const k = D ? "notion-block" : `notion-block-${Ce(n.id)}`;
1133
- switch (n.type) {
261
+ const c = I ? "notion-block" : `notion-block-${ve(t.id)}`;
262
+ switch (t.type) {
1134
263
  case "collection_view_page":
1135
264
  // fallthrough
1136
265
  case "page":
1137
- if (x === 0) {
266
+ if (B === 0) {
1138
267
  const {
1139
- page_icon: b = d,
1140
- page_cover: C = g,
1141
- page_cover_position: S = m,
1142
- page_full_width: z,
1143
- page_small_text: j
1144
- } = n.format || {};
1145
- if (l) {
1146
- const B = n.type === "page" ? n.properties : {
1147
- title: (A = (R = i.collection[St(n, i)]) == null ? void 0 : R.value) == null ? void 0 : A.name
1148
- }, Q = `center ${(1 - (S || 0.5)) * 100}%`;
1149
- let q = ut[Q];
1150
- q || (q = ut[Q] = {
1151
- objectPosition: Q
268
+ page_icon: l = b,
269
+ page_cover: s = _,
270
+ page_cover_position: u = T,
271
+ page_full_width: f,
272
+ page_small_text: w
273
+ } = t.format || {};
274
+ if (m) {
275
+ const $ = t.type === "page" ? t.properties : {
276
+ title: (S = (x = r.collection[it(t, r)]) == null ? void 0 : x.value) == null ? void 0 : S.name
277
+ }, D = `center ${(1 - (u || 0.5)) * 100}%`;
278
+ let j = nt[D];
279
+ j || (j = nt[D] = {
280
+ objectPosition: D
1152
281
  });
1153
- const ae = (W = ft(n, i)) != null ? W : d, X = ae && gt(ae), de = $e(n, i), ye = u && de.length >= c, oe = (ye || _) && !z, be = L || C;
1154
- return /* @__PURE__ */ e.createElement("div", { className: `notion notion-app ${k} ${M || ""}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ e.createElement("div", { className: "notion-frame" }, !J && /* @__PURE__ */ e.createElement(a.Header, { block: n }), H, /* @__PURE__ */ e.createElement("div", { className: "notion-page-scroller" }, be && (L || /* @__PURE__ */ e.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ e.createElement(
1155
- ie,
282
+ const X = (H = ct(t, r)) != null ? H : b, U = X && st(X), re = he(t, r), pe = N && re.length >= y, K = (pe || h) && !f, fe = k || s;
283
+ return /* @__PURE__ */ e.createElement("div", { className: `notion notion-app ${c} ${V || ""}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ e.createElement("div", { className: "notion-frame" }, !q && /* @__PURE__ */ e.createElement(o.Header, { block: t }), Q, /* @__PURE__ */ e.createElement("div", { className: "notion-page-scroller" }, fe && (k || /* @__PURE__ */ e.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ e.createElement(
284
+ Ne,
1156
285
  {
1157
- src: r(C, n),
1158
- alt: le(B == null ? void 0 : B.title),
286
+ src: v(s, t),
287
+ alt: ie($ == null ? void 0 : $.title),
1159
288
  priority: !0,
1160
289
  className: "notion-page-cover",
1161
- style: q
290
+ style: j
1162
291
  }
1163
292
  ))), /* @__PURE__ */ e.createElement(
1164
293
  "main",
1165
294
  {
1166
295
  className: `notion-page
1167
- ${be ? "notion-page-has-cover" : "notion-page-no-cover"}
1168
- ${b ? "notion-page-has-icon" : "notion-page-no-icon"}
1169
- ${X ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
296
+ ${fe ? "notion-page-has-cover" : "notion-page-no-cover"}
297
+ ${l ? "notion-page-has-icon" : "notion-page-no-icon"}
298
+ ${U ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
1170
299
  notion-full-page
1171
- ${z && "notion-full-width"}
1172
- ${j && "notion-small-text"}
1173
- ${$}`
300
+ ${f && "notion-full-width"}
301
+ ${w && "notion-small-text"}
302
+ ${M}`
1174
303
  },
1175
- b && /* @__PURE__ */ e.createElement(pe, { block: n, defaultIcon: d, inline: !1 }),
1176
- y,
1177
- /* @__PURE__ */ e.createElement("h1", { className: "notion-title" }, v != null ? v : /* @__PURE__ */ e.createElement(P, { value: B == null ? void 0 : B.title, block: n })),
1178
- (n.type === "collection_view_page" || n.type === "page" && n.parent_table === "collection") && /* @__PURE__ */ e.createElement(a.Collection, { block: n, ctx: o }),
1179
- n.type !== "collection_view_page" && /* @__PURE__ */ e.createElement(
304
+ l && /* @__PURE__ */ e.createElement(Ke, { block: t, defaultIcon: b, inline: !1 }),
305
+ R,
306
+ /* @__PURE__ */ e.createElement("h1", { className: "notion-title" }, p != null ? p : /* @__PURE__ */ e.createElement(C, { value: $ == null ? void 0 : $.title, block: t })),
307
+ (t.type === "collection_view_page" || t.type === "page" && t.parent_table === "collection") && /* @__PURE__ */ e.createElement(o.Collection, { block: t, ctx: a }),
308
+ t.type !== "collection_view_page" && /* @__PURE__ */ e.createElement(
1180
309
  "div",
1181
310
  {
1182
311
  className: `notion-page-content
1183
- ${oe && "notion-page-content-has-aside"}
1184
- ${ye && "notion-page-content-has-toc"}`
312
+ ${K && "notion-page-content-has-aside"}
313
+ ${pe && "notion-page-content-has-toc"}`
1185
314
  },
1186
- /* @__PURE__ */ e.createElement("article", { className: "notion-page-content-inner" }, p),
1187
- oe && /* @__PURE__ */ e.createElement(
1188
- wn,
315
+ /* @__PURE__ */ e.createElement("article", { className: "notion-page-content-inner" }, g),
316
+ K && /* @__PURE__ */ e.createElement(
317
+ yt,
1189
318
  {
1190
- toc: de,
1191
- activeSection: E,
1192
- setActiveSection: N,
1193
- hasToc: ye,
1194
- hasAside: oe,
1195
- pageAside: _
319
+ toc: re,
320
+ activeSection: O,
321
+ setActiveSection: L,
322
+ hasToc: pe,
323
+ hasAside: K,
324
+ pageAside: h
1196
325
  }
1197
326
  )
1198
327
  ),
1199
- f
1200
- ), w)));
328
+ i
329
+ ), ee)));
1201
330
  } else
1202
331
  return /* @__PURE__ */ e.createElement(
1203
332
  "main",
1204
333
  {
1205
334
  className: `notion
1206
335
  notion-page
1207
- ${z && "notion-full-width"}
1208
- ${j && "notion-small-text"}
1209
- ${k}
1210
- ${M || ""}
1211
- ${$}`
336
+ ${f && "notion-full-width"}
337
+ ${w && "notion-small-text"}
338
+ ${c}
339
+ ${V || ""}
340
+ ${M}`
1212
341
  },
1213
342
  /* @__PURE__ */ e.createElement("div", { className: "notion-viewport" }),
1214
- y,
1215
- (n.type === "collection_view_page" || n.type === "page" && n.parent_table === "collection") && /* @__PURE__ */ e.createElement(a.Collection, { block: n, ctx: o }),
1216
- n.type !== "collection_view_page" && p,
1217
- f
343
+ R,
344
+ (t.type === "collection_view_page" || t.type === "page" && t.parent_table === "collection") && /* @__PURE__ */ e.createElement(o.Collection, { block: t, ctx: a }),
345
+ t.type !== "collection_view_page" && g,
346
+ i
1218
347
  );
1219
348
  } else {
1220
- const b = (ce = n.format) == null ? void 0 : ce.block_color;
349
+ const l = (te = t.format) == null ? void 0 : te.block_color;
1221
350
  return /* @__PURE__ */ e.createElement(
1222
- a.PageLink,
351
+ o.PageLink,
1223
352
  {
1224
- className: `notion-page-link ${b && `notion-${b}`} ${k}`,
1225
- href: s(n.id)
353
+ className: `notion-page-link ${l && `notion-${l}`} ${c}`,
354
+ href: d(t.id)
1226
355
  },
1227
- /* @__PURE__ */ e.createElement(fe, { block: n })
356
+ /* @__PURE__ */ e.createElement(Xe, { block: t })
1228
357
  );
1229
358
  }
1230
359
  case "header":
@@ -1232,44 +361,44 @@ const _n = /* @__PURE__ */ Nn(Cn), wn = ({ toc: t, activeSection: o, setActiveSe
1232
361
  case "sub_header":
1233
362
  // fallthrough
1234
363
  case "sub_sub_header": {
1235
- if (!n.properties) return null;
1236
- const b = (Z = n.format) == null ? void 0 : Z.block_color, C = Ce(n.id), S = le(n.properties.title) || `Notion Header ${C}`;
1237
- let z = mt[n.id], j;
1238
- if (z === void 0) {
1239
- const de = Ie(n, i);
1240
- if (de) {
1241
- const oe = $e(de, i).find((be) => be.id === n.id);
1242
- oe && (z = oe.indentLevel, mt[n.id] = z);
364
+ if (!t.properties) return null;
365
+ const l = (A = t.format) == null ? void 0 : A.block_color, s = ve(t.id), u = ie(t.properties.title) || `Notion Header ${s}`;
366
+ let f = tt[t.id], w;
367
+ if (f === void 0) {
368
+ const re = Je(t, r);
369
+ if (re) {
370
+ const K = he(re, r).find((fe) => fe.id === t.id);
371
+ K && (f = K.indentLevel, tt[t.id] = f);
1243
372
  }
1244
373
  }
1245
- z !== void 0 && (j = `notion-h-indent-${z}`);
1246
- const B = n.type === "header", ne = n.type === "sub_header", Q = n.type === "sub_sub_header", q = `${B && "notion-h notion-h1"}
1247
- ${ne && "notion-h notion-h2"}
1248
- ${Q && "notion-h notion-h3"}
1249
- ${b && `notion-${b}`}
1250
- ${j},
1251
- ${k}`, ae = /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement("div", { id: C, className: "notion-header-anchor" }), !((K = n.format) != null && K.toggleable) && /* @__PURE__ */ e.createElement("a", { className: "notion-hash-link", href: `#${C}`, title: S }, /* @__PURE__ */ e.createElement($n, null)), /* @__PURE__ */ e.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ e.createElement(P, { value: n.properties.title, block: n })));
1252
- let X = null;
1253
- return B ? X = /* @__PURE__ */ e.createElement("h2", { className: q, "data-id": C }, ae) : ne ? X = /* @__PURE__ */ e.createElement("h3", { className: q, "data-id": C }, ae) : X = /* @__PURE__ */ e.createElement("h4", { className: q, "data-id": C }, ae), (ee = n.format) != null && ee.toggleable ? /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${k}` }, /* @__PURE__ */ e.createElement("summary", null, X), /* @__PURE__ */ e.createElement("div", null, p)) : X;
374
+ f !== void 0 && (w = `notion-h-indent-${f}`);
375
+ const $ = t.type === "header", J = t.type === "sub_header", D = t.type === "sub_sub_header", j = `${$ && "notion-h notion-h1"}
376
+ ${J && "notion-h notion-h2"}
377
+ ${D && "notion-h notion-h3"}
378
+ ${l && `notion-${l}`}
379
+ ${w},
380
+ ${c}`, X = /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement("div", { id: s, className: "notion-header-anchor" }), !((G = t.format) != null && G.toggleable) && /* @__PURE__ */ e.createElement("a", { className: "notion-hash-link", href: `#${s}`, title: u }, /* @__PURE__ */ e.createElement($t, null)), /* @__PURE__ */ e.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })));
381
+ let U = null;
382
+ return $ ? U = /* @__PURE__ */ e.createElement("h2", { className: j, "data-id": s }, X) : J ? U = /* @__PURE__ */ e.createElement("h3", { className: j, "data-id": s }, X) : U = /* @__PURE__ */ e.createElement("h4", { className: j, "data-id": s }, X), (Y = t.format) != null && Y.toggleable ? /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${c}` }, /* @__PURE__ */ e.createElement("summary", null, U), /* @__PURE__ */ e.createElement("div", null, g)) : U;
1254
383
  }
1255
384
  case "divider":
1256
- return /* @__PURE__ */ e.createElement("hr", { className: `notion-hr ${k}` });
385
+ return /* @__PURE__ */ e.createElement("hr", { className: `notion-hr ${c}` });
1257
386
  case "text": {
1258
- if (!n.properties && !((ge = n.content) != null && ge.length)) return /* @__PURE__ */ e.createElement("div", { className: `notion-blank ${k}` }, " ");
1259
- const b = (he = n.format) == null ? void 0 : he.block_color;
1260
- return /* @__PURE__ */ e.createElement("div", { className: `notion-text ${b && `notion-${b}`} ${k}` }, ((se = n.properties) == null ? void 0 : se.title) && /* @__PURE__ */ e.createElement(P, { value: n.properties.title, block: n }), p && /* @__PURE__ */ e.createElement("div", { className: "notion-text-children" }, p));
387
+ if (!t.properties && !((se = t.content) != null && se.length)) return /* @__PURE__ */ e.createElement("div", { className: `notion-blank ${c}` }, " ");
388
+ const l = (me = t.format) == null ? void 0 : me.block_color;
389
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-text ${l && `notion-${l}`} ${c}` }, ((ne = t.properties) == null ? void 0 : ne.title) && /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t }), g && /* @__PURE__ */ e.createElement("div", { className: "notion-text-children" }, g));
1261
390
  }
1262
391
  case "bulleted_list":
1263
392
  // fallthrough
1264
393
  case "numbered_list": {
1265
- const b = (j, B) => n.type === "bulleted_list" ? /* @__PURE__ */ e.createElement("ul", { className: `notion-list notion-list-disc ${k}` }, j) : /* @__PURE__ */ e.createElement("ol", { start: B, className: `notion-list notion-list-numbered ${k}` }, j);
1266
- let C = null;
1267
- n.content ? C = /* @__PURE__ */ e.createElement(e.Fragment, null, n.properties && /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(P, { value: n.properties.title, block: n })), b(p)) : C = n.properties ? /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(P, { value: n.properties.title, block: n })) : null;
1268
- const S = n.type !== ((me = (Y = i.block[n.parent_id]) == null ? void 0 : Y.value) == null ? void 0 : me.type), z = Ot(n.id, i.block);
1269
- return S ? b(C, z) : C;
394
+ const l = (w, $) => t.type === "bulleted_list" ? /* @__PURE__ */ e.createElement("ul", { className: `notion-list notion-list-disc ${c}` }, w) : /* @__PURE__ */ e.createElement("ol", { start: $, className: `notion-list notion-list-numbered ${c}` }, w);
395
+ let s = null;
396
+ t.content ? s = /* @__PURE__ */ e.createElement(e.Fragment, null, t.properties && /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })), l(g)) : s = t.properties ? /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })) : null;
397
+ const u = t.type !== ((oe = (z = r.block[t.parent_id]) == null ? void 0 : z.value) == null ? void 0 : oe.type), f = ut(t.id, r.block);
398
+ return u ? l(s, f) : s;
1270
399
  }
1271
400
  case "embed":
1272
- return /* @__PURE__ */ e.createElement(a.Embed, { blockId: k, block: n });
401
+ return /* @__PURE__ */ e.createElement(o.Embed, { blockId: c, block: t });
1273
402
  case "tweet":
1274
403
  // fallthrough
1275
404
  case "maps":
@@ -1289,151 +418,165 @@ const _n = /* @__PURE__ */ Nn(Cn), wn = ({ toc: t, activeSection: o, setActiveSe
1289
418
  case "gist":
1290
419
  // fallthrough
1291
420
  case "video":
1292
- return /* @__PURE__ */ e.createElement(Me, { blockId: k, block: n });
421
+ return /* @__PURE__ */ e.createElement(Qe, { blockId: c, block: t });
1293
422
  case "drive":
1294
- return !((Ee = n.format) == null ? void 0 : Ee.drive_properties) && (ve = n.format) != null && ve.display_source ? /* @__PURE__ */ e.createElement(Me, { blockId: k, block: n }) : /* @__PURE__ */ e.createElement(bn, { block: n, className: k });
423
+ return !((de = t.format) == null ? void 0 : de.drive_properties) && (ue = t.format) != null && ue.display_source ? /* @__PURE__ */ e.createElement(Qe, { blockId: c, block: t }) : /* @__PURE__ */ e.createElement(bt, { block: t, className: c });
1295
424
  case "audio":
1296
- return /* @__PURE__ */ e.createElement(En, { block: n, className: k });
425
+ return /* @__PURE__ */ e.createElement(gt, { block: t, className: c });
1297
426
  case "file":
1298
- return /* @__PURE__ */ e.createElement(yn, { block: n, className: k });
427
+ return /* @__PURE__ */ e.createElement(vt, { block: t, className: c });
1299
428
  case "equation":
1300
- return /* @__PURE__ */ e.createElement(a.Equation, { block: n, inline: !1, className: k });
429
+ return /* @__PURE__ */ e.createElement(o.Equation, { block: t, inline: !1, className: c });
1301
430
  case "code":
1302
- return /* @__PURE__ */ e.createElement(a.Code, { block: n });
431
+ return /* @__PURE__ */ e.createElement(o.Code, { block: t });
1303
432
  case "column_list":
1304
- return /* @__PURE__ */ e.createElement("div", { className: `notion-row ${k}` }, p);
433
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-row ${c}` }, g);
1305
434
  case "column": {
1306
- const b = "min(32px, 4vw)", C = ((te = n.format) == null ? void 0 : te.column_ratio) || 0.5, S = (I = i.block[n.parent_id]) == null ? void 0 : I.value, B = { width: `calc((100% - (${(((F = S == null ? void 0 : S.content) == null ? void 0 : F.length) || Math.max(2, Math.ceil(1 / C))) - 1} * ${b})) * ${C})` };
1307
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: `notion-column ${k}`, style: B }, p), /* @__PURE__ */ e.createElement("div", { className: "notion-spacer" }));
435
+ const l = "min(32px, 4vw)", s = ((Z = t.format) == null ? void 0 : Z.column_ratio) || 0.5, u = (E = r.block[t.parent_id]) == null ? void 0 : E.value, $ = { width: `calc((100% - (${(((P = u == null ? void 0 : u.content) == null ? void 0 : P.length) || Math.max(2, Math.ceil(1 / s))) - 1} * ${l})) * ${s})` };
436
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: `notion-column ${c}`, style: $ }, g), /* @__PURE__ */ e.createElement("div", { className: "notion-spacer" }));
1308
437
  }
1309
438
  case "quote": {
1310
- if (!n.properties) return null;
1311
- const b = (G = n.format) == null ? void 0 : G.block_color;
1312
- return /* @__PURE__ */ e.createElement("blockquote", { className: `notion-quote ${b && `notion-${b}`} ${k}` }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(P, { value: n.properties.title, block: n })), p);
439
+ if (!t.properties) return null;
440
+ const l = (F = t.format) == null ? void 0 : F.block_color;
441
+ return /* @__PURE__ */ e.createElement("blockquote", { className: `notion-quote ${l && `notion-${l}`} ${c}` }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })), g);
1313
442
  }
1314
443
  case "collection_view":
1315
- return /* @__PURE__ */ e.createElement(a.Collection, { block: n, className: k, ctx: o });
444
+ return /* @__PURE__ */ e.createElement(o.Collection, { block: t, className: c, ctx: a });
1316
445
  case "callout":
1317
- return a.Callout ? /* @__PURE__ */ e.createElement(a.Callout, { block: n, className: k }) : /* @__PURE__ */ e.createElement(
446
+ return o.Callout ? /* @__PURE__ */ e.createElement(o.Callout, { block: t, className: c }) : /* @__PURE__ */ e.createElement(
1318
447
  "div",
1319
448
  {
1320
- className: `notion-callout ${((ue = n.format) == null ? void 0 : ue.block_color) && `notion-${(Be = n.format) == null ? void 0 : Be.block_color}_co`} ${k}`
449
+ className: `notion-callout ${((ae = t.format) == null ? void 0 : ae.block_color) && `notion-${(_e = t.format) == null ? void 0 : _e.block_color}_co`} ${c}`
1321
450
  },
1322
- /* @__PURE__ */ e.createElement(pe, { block: n }),
1323
- /* @__PURE__ */ e.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ e.createElement(P, { value: (He = n.properties) == null ? void 0 : He.title, block: n }), p)
451
+ /* @__PURE__ */ e.createElement(Ke, { block: t }),
452
+ /* @__PURE__ */ e.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ e.createElement(C, { value: ($e = t.properties) == null ? void 0 : $e.title, block: t }), g)
1324
453
  );
1325
454
  case "bookmark": {
1326
- if (!n.properties) return null;
1327
- const b = n.properties.link;
1328
- if (!b || !((Oe = b[0]) != null && Oe[0])) return null;
1329
- let C = le(n.properties.title);
1330
- if (C || (C = le(b)), C && C.startsWith("http"))
455
+ if (!t.properties) return null;
456
+ const l = t.properties.link;
457
+ if (!l || !((Ce = l[0]) != null && Ce[0])) return null;
458
+ let s = ie(t.properties.title);
459
+ if (s || (s = ie(l)), s && s.startsWith("http"))
1331
460
  try {
1332
- C = new URL(C).hostname;
1333
- } catch (S) {
461
+ s = new URL(s).hostname;
462
+ } catch (u) {
1334
463
  }
1335
- return /* @__PURE__ */ e.createElement("div", { className: "notion-row" }, /* @__PURE__ */ e.createElement(
1336
- a.Link,
464
+ return /* @__PURE__ */ e.createElement(
465
+ o.Link,
1337
466
  {
1338
467
  target: "_blank",
1339
468
  rel: "noopener noreferrer",
1340
- className: `notion-bookmark ${((Ve = n.format) == null ? void 0 : Ve.block_color) && `notion-${n.format.block_color}`} ${k}`,
1341
- href: b[0][0]
469
+ className: `notion-bookmark ${((xe = t.format) == null ? void 0 : xe.block_color) && `notion-${t.format.block_color}`} ${c}`,
470
+ href: l[0][0]
1342
471
  },
1343
- /* @__PURE__ */ e.createElement("div", null, C && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ e.createElement(P, { value: [[C]], block: n })), ((Re = n.properties) == null ? void 0 : Re.description) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ e.createElement(P, { value: (je = n.properties) == null ? void 0 : je.description, block: n })), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link" }, ((De = n.format) == null ? void 0 : De.bookmark_icon) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ e.createElement(ie, { src: r((Fe = n.format) == null ? void 0 : Fe.bookmark_icon, n), alt: C })), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ e.createElement(P, { value: b, block: n })))),
1344
- ((Ue = n.format) == null ? void 0 : Ue.bookmark_cover) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ e.createElement(
1345
- ie,
472
+ /* @__PURE__ */ e.createElement("div", null, s && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ e.createElement(C, { value: [[s]], block: t })), ((we = t.properties) == null ? void 0 : we.description) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ e.createElement(C, { value: (Ie = t.properties) == null ? void 0 : Ie.description, block: t })), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link" }, ((Le = t.format) == null ? void 0 : Le.bookmark_icon) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ e.createElement(
473
+ Ne,
1346
474
  {
1347
- src: r((Ae = n.format) == null ? void 0 : Ae.bookmark_cover, n),
1348
- alt: le((qe = n.properties) == null ? void 0 : qe.title),
475
+ src: v((Pe = t.format) == null ? void 0 : Pe.bookmark_icon, t),
476
+ alt: s,
477
+ onError: (u) => {
478
+ const f = u.currentTarget;
479
+ f.style.display = "none";
480
+ }
481
+ }
482
+ )), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ e.createElement(C, { value: l, block: t })))),
483
+ ((Te = t.format) == null ? void 0 : Te.bookmark_cover) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ e.createElement(
484
+ Ne,
485
+ {
486
+ src: v((Se = t.format) == null ? void 0 : Se.bookmark_cover, t),
487
+ alt: ie((je = t.properties) == null ? void 0 : je.title),
1349
488
  style: {
1350
489
  objectFit: "cover"
490
+ },
491
+ onError: (u) => {
492
+ const f = u.currentTarget;
493
+ f.style.display = "none";
1351
494
  }
1352
495
  }
1353
496
  ))
1354
- ));
497
+ );
1355
498
  }
1356
499
  case "toggle":
1357
- return /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${k}` }, /* @__PURE__ */ e.createElement("summary", null, /* @__PURE__ */ e.createElement(P, { value: (We = n.properties) == null ? void 0 : We.title, block: n })), /* @__PURE__ */ e.createElement("div", null, p));
500
+ return /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${c}` }, /* @__PURE__ */ e.createElement("summary", null, /* @__PURE__ */ e.createElement(C, { value: (Oe = t.properties) == null ? void 0 : Oe.title, block: t })), /* @__PURE__ */ e.createElement("div", null, g));
1358
501
  case "table_of_contents": {
1359
- const b = Ie(n, i);
1360
- if (!b) return null;
1361
- const C = $e(b, i), S = (Ze = n.format) == null ? void 0 : Ze.block_color;
1362
- return /* @__PURE__ */ e.createElement("div", { className: `notion-table-of-contents ${S && `notion-${S}`} ${k}` }, C.map((z) => /* @__PURE__ */ e.createElement("a", { key: z.id, href: `#${Ce(z.id)}`, className: "notion-table-of-contents-item" }, /* @__PURE__ */ e.createElement(
502
+ const l = Je(t, r);
503
+ if (!l) return null;
504
+ const s = he(l, r), u = (Be = t.format) == null ? void 0 : Be.block_color;
505
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-table-of-contents ${u && `notion-${u}`} ${c}` }, s.map((f) => /* @__PURE__ */ e.createElement("a", { key: f.id, href: `#${ve(f.id)}`, className: "notion-table-of-contents-item" }, /* @__PURE__ */ e.createElement(
1363
506
  "span",
1364
507
  {
1365
508
  className: "notion-table-of-contents-item-body",
1366
509
  style: {
1367
510
  display: "inline-block",
1368
- marginLeft: z.indentLevel * 24
511
+ marginLeft: f.indentLevel * 24
1369
512
  }
1370
513
  },
1371
- z.text
514
+ f.text
1372
515
  ))));
1373
516
  }
1374
517
  case "to_do": {
1375
- const b = ((Ye = (Qe = (Ge = n.properties) == null ? void 0 : Ge.checked) == null ? void 0 : Qe[0]) == null ? void 0 : Ye[0]) === "Yes";
1376
- return /* @__PURE__ */ e.createElement("div", { className: `notion-to-do ${k}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ e.createElement(a.Checkbox, { blockId: k, isChecked: b }), /* @__PURE__ */ e.createElement("div", { className: `notion-to-do-body ${b && "notion-to-do-checked"}` }, /* @__PURE__ */ e.createElement(P, { value: (Xe = n.properties) == null ? void 0 : Xe.title, block: n }))), /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-children" }, p));
518
+ const l = ((Ae = (He = (Me = t.properties) == null ? void 0 : Me.checked) == null ? void 0 : He[0]) == null ? void 0 : Ae[0]) === "Yes";
519
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-to-do ${c}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ e.createElement(o.Checkbox, { blockId: c, isChecked: l }), /* @__PURE__ */ e.createElement("div", { className: `notion-to-do-body ${l && "notion-to-do-checked"}` }, /* @__PURE__ */ e.createElement(C, { value: (Fe = t.properties) == null ? void 0 : Fe.title, block: t }))), /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-children" }, g));
1377
520
  }
1378
521
  case "transclusion_container":
1379
- return /* @__PURE__ */ e.createElement("div", { className: `notion-sync-block ${k}` }, p);
522
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-sync-block ${c}` }, g);
1380
523
  case "transclusion_reference":
1381
- return /* @__PURE__ */ e.createElement(xn, h({ block: n, level: x + 1 }, t));
524
+ return /* @__PURE__ */ e.createElement(_t, W({ block: t, level: B + 1 }, n));
1382
525
  case "alias": {
1383
- const b = (Ke = (Je = n == null ? void 0 : n.format) == null ? void 0 : Je.alias_pointer) == null ? void 0 : Ke.id, C = (et = i.block[b]) == null ? void 0 : et.value;
1384
- return C ? /* @__PURE__ */ e.createElement(a.PageLink, { className: `notion-page-link ${b}}`, href: s(b) }, /* @__PURE__ */ e.createElement(fe, { block: C })) : (console.debug('"alias" missing block', b), null);
526
+ const l = (Re = (De = t == null ? void 0 : t.format) == null ? void 0 : De.alias_pointer) == null ? void 0 : Re.id, s = (ze = r.block[l]) == null ? void 0 : ze.value;
527
+ return s ? /* @__PURE__ */ e.createElement(o.PageLink, { className: `notion-page-link ${l}}`, href: d(l) }, /* @__PURE__ */ e.createElement(Xe, { block: s })) : (console.debug('"alias" missing block', l), null);
1385
528
  }
1386
529
  case "table":
1387
- return /* @__PURE__ */ e.createElement("table", { className: `notion-simple-table ${k}` }, /* @__PURE__ */ e.createElement("tbody", null, p));
530
+ return /* @__PURE__ */ e.createElement("table", { className: `notion-simple-table ${c}` }, /* @__PURE__ */ e.createElement("tbody", null, g));
1388
531
  case "table_row": {
1389
- const b = (tt = i.block[n.parent_id]) == null ? void 0 : tt.value, C = (nt = b.format) == null ? void 0 : nt.table_block_column_order, S = (at = b.format) == null ? void 0 : at.table_block_column_format, z = (ot = n.format) == null ? void 0 : ot.block_color;
1390
- return !b || !C ? null : /* @__PURE__ */ e.createElement("tr", { className: `notion-simple-table-row ${z && `notion-${z}`} ${k}` }, C.map((j) => {
1391
- var ne, Q, q;
1392
- const B = (ne = S == null ? void 0 : S[j]) == null ? void 0 : ne.color;
532
+ const l = (Ue = r.block[t.parent_id]) == null ? void 0 : Ue.value, s = (We = l.format) == null ? void 0 : We.table_block_column_order, u = (Ve = l.format) == null ? void 0 : Ve.table_block_column_format, f = (qe = t.format) == null ? void 0 : qe.block_color;
533
+ return !l || !s ? null : /* @__PURE__ */ e.createElement("tr", { className: `notion-simple-table-row ${f && `notion-${f}`} ${c}` }, s.map((w) => {
534
+ var J, D, j;
535
+ const $ = (J = u == null ? void 0 : u[w]) == null ? void 0 : J.color;
1393
536
  return /* @__PURE__ */ e.createElement(
1394
537
  "td",
1395
538
  {
1396
- key: j,
1397
- className: B ? `notion-${B}` : "",
539
+ key: w,
540
+ className: $ ? `notion-${$}` : "",
1398
541
  style: {
1399
- width: ((Q = S == null ? void 0 : S[j]) == null ? void 0 : Q.width) || 120
542
+ width: ((D = u == null ? void 0 : u[w]) == null ? void 0 : D.width) || 120
1400
543
  }
1401
544
  },
1402
- /* @__PURE__ */ e.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ e.createElement(P, { value: ((q = n.properties) == null ? void 0 : q[j]) || [["ㅤ"]], block: n }))
545
+ /* @__PURE__ */ e.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ e.createElement(C, { value: ((j = t.properties) == null ? void 0 : j[w]) || [["ㅤ"]], block: t }))
1403
546
  );
1404
547
  }));
1405
548
  }
1406
549
  case "external_object_instance":
1407
- return /* @__PURE__ */ e.createElement(yt, { block: n, className: k });
550
+ return /* @__PURE__ */ e.createElement(dt, { block: t, className: c });
1408
551
  default:
1409
- return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + n.type, JSON.stringify(n, null, 2)), /* @__PURE__ */ e.createElement("div", null);
552
+ return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + t.type, JSON.stringify(t, null, 2)), /* @__PURE__ */ e.createElement("div", null);
1410
553
  }
1411
- }, ea = (_) => {
1412
- var L = _, {
1413
- components: t,
1414
- recordMap: o,
1415
- mapPageUrl: a,
1416
- mapImageUrl: l,
1417
- searchNotion: i,
1418
- isShowingSearch: s,
1419
- onHideSearch: r,
1420
- fullPage: u,
1421
- rootPageId: c,
1422
- rootDomain: d,
1423
- rootSpaceId: g,
1424
- darkMode: m,
1425
- previewImages: E,
1426
- forceCustomImages: N,
1427
- showCollectionViewDropdown: n,
1428
- linkTableTitleProperties: p,
1429
- isLinkCollectionToUrlProperty: x,
1430
- isImageZoomable: M = !0,
1431
- showTableOfContents: $,
1432
- minTableOfContentsItems: H,
1433
- defaultPageIcon: w,
1434
- defaultPageCover: y,
1435
- defaultPageCoverPosition: f
1436
- } = L, v = T(L, [
554
+ }, jt = (h) => {
555
+ var k = h, {
556
+ components: n,
557
+ recordMap: a,
558
+ mapPageUrl: o,
559
+ mapImageUrl: m,
560
+ searchNotion: r,
561
+ isShowingSearch: d,
562
+ onHideSearch: v,
563
+ fullPage: N,
564
+ rootPageId: y,
565
+ rootDomain: b,
566
+ rootSpaceId: _,
567
+ darkMode: T,
568
+ previewImages: O,
569
+ forceCustomImages: L,
570
+ showCollectionViewDropdown: t,
571
+ linkTableTitleProperties: g,
572
+ isLinkCollectionToUrlProperty: B,
573
+ isImageZoomable: V = !0,
574
+ showTableOfContents: M,
575
+ minTableOfContentsItems: Q,
576
+ defaultPageIcon: ee,
577
+ defaultPageCover: R,
578
+ defaultPageCoverPosition: i
579
+ } = k, p = le(k, [
1437
580
  "components",
1438
581
  "recordMap",
1439
582
  "mapPageUrl",
@@ -1458,162 +601,90 @@ const _n = /* @__PURE__ */ Nn(Cn), wn = ({ toc: t, activeSection: o, setActiveSe
1458
601
  "defaultPageCover",
1459
602
  "defaultPageCoverPosition"
1460
603
  ]);
1461
- const D = e.useMemo(
1462
- () => typeof window != "undefined" && xt({
604
+ const I = e.useMemo(
605
+ () => typeof window != "undefined" && lt({
1463
606
  background: "rgba(0, 0, 0, 0.8)",
1464
607
  minZoomScale: 2,
1465
- margin: In()
608
+ margin: xt()
1466
609
  }),
1467
610
  []
1468
611
  );
1469
612
  return /* @__PURE__ */ e.createElement(
1470
- kt,
613
+ pt,
1471
614
  {
1472
- components: t,
1473
- recordMap: o,
1474
- mapPageUrl: a,
1475
- mapImageUrl: l,
1476
- searchNotion: i,
1477
- isShowingSearch: s,
1478
- onHideSearch: r,
1479
- fullPage: u,
1480
- rootPageId: c,
1481
- rootDomain: d,
1482
- rootSpaceId: g,
1483
- darkMode: m,
1484
- previewImages: E,
1485
- forceCustomImages: N,
1486
- showCollectionViewDropdown: n,
1487
- linkTableTitleProperties: p,
1488
- isLinkCollectionToUrlProperty: x,
1489
- showTableOfContents: $,
1490
- minTableOfContentsItems: H,
1491
- defaultPageIcon: w,
1492
- defaultPageCover: y,
1493
- defaultPageCoverPosition: f,
1494
- zoom: M ? D : null
615
+ components: n,
616
+ recordMap: a,
617
+ mapPageUrl: o,
618
+ mapImageUrl: m,
619
+ searchNotion: r,
620
+ isShowingSearch: d,
621
+ onHideSearch: v,
622
+ fullPage: N,
623
+ rootPageId: y,
624
+ rootDomain: b,
625
+ rootSpaceId: _,
626
+ darkMode: T,
627
+ previewImages: O,
628
+ forceCustomImages: L,
629
+ showCollectionViewDropdown: t,
630
+ linkTableTitleProperties: g,
631
+ isLinkCollectionToUrlProperty: B,
632
+ showTableOfContents: M,
633
+ minTableOfContentsItems: Q,
634
+ defaultPageIcon: ee,
635
+ defaultPageCover: R,
636
+ defaultPageCoverPosition: i,
637
+ zoom: V ? I : null
1495
638
  },
1496
- /* @__PURE__ */ e.createElement(Te, h({}, v))
639
+ /* @__PURE__ */ e.createElement(ye, W({}, p))
1497
640
  );
1498
- }, Te = (l) => {
1499
- var i = l, { level: t = 0, blockId: o } = i, a = T(i, ["level", "blockId"]);
1500
- var c, d;
1501
- const { recordMap: s } = V(), r = o || Object.keys(s.block)[0], u = (c = s.block[r]) == null ? void 0 : c.value;
1502
- return u ? /* @__PURE__ */ e.createElement(Ln, h({ key: r, level: t, block: u }, a), (d = u == null ? void 0 : u.content) == null ? void 0 : d.map((g) => /* @__PURE__ */ e.createElement(Te, h({ key: g, blockId: g, level: t + 1 }, a)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", o), null);
641
+ }, ye = (m) => {
642
+ var r = m, { level: n = 0, blockId: a } = r, o = le(r, ["level", "blockId"]);
643
+ var y, b;
644
+ const { recordMap: d } = ce(), v = a || Object.keys(d.block)[0], N = (y = d.block[v]) == null ? void 0 : y.value;
645
+ return N ? /* @__PURE__ */ e.createElement(Ct, W({ key: v, level: n, block: N }, o), (b = N == null ? void 0 : N.content) == null ? void 0 : b.map((_) => /* @__PURE__ */ e.createElement(ye, W({ key: _, blockId: _, level: n + 1 }, o)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", a), null);
1503
646
  };
1504
- function In() {
1505
- const t = window.innerWidth;
1506
- return t < 500 ? 8 : t < 800 ? 20 : t < 1280 ? 30 : t < 1600 ? 40 : t < 1920 ? 48 : 72;
1507
- }
1508
- function Sn(t) {
1509
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M0 3a3 3 0 013-3h8a3 3 0 013 3v8a3 3 0 01-3 3H3a3 3 0 01-3-3V3zm3-1.5A1.5 1.5 0 001.5 3v8A1.5 1.5 0 003 12.5h8a1.5 1.5 0 001.5-1.5V3A1.5 1.5 0 0011 1.5H3zm-.167 5.316l.566-.542.177-.17.347-.332.346.334.176.17 1.139 1.098 3.699-3.563.177-.17.347-.335.347.334.177.17.563.543.177.171.372.36-.372.36-.177.17-4.786 4.615-.177.171-.347.334-.347-.334-.177-.17-2.23-2.15-.177-.172-.375-.361.376-.36.179-.17z" }));
1510
- }
1511
- function Mn(t) {
1512
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M10.889 5.5H3.11v1.556h7.778V5.5zm1.555-4.444h-.777V0H10.11v1.056H3.89V0H2.333v1.056h-.777c-.864 0-1.548.7-1.548 1.555L0 12.5c0 .856.692 1.5 1.556 1.5h10.888C13.3 14 14 13.356 14 12.5V2.611c0-.855-.7-1.555-1.556-1.555zm0 11.444H1.556V3.944h10.888V12.5zM8.556 8.611H3.11v1.556h5.445V8.61z" }));
1513
- }
1514
- function zn(t) {
1515
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M14 6.225c0 .822-.133 1.574-.4 2.256-.267.683-.644 1.218-1.13 1.606-.488.388-.946.6-1.494.6-.429 0-.808-.102-1.139-.305a1.753 1.753 0 01-.713-.8c-.613.736-1.563 1.104-2.531 1.104-1.027 0-1.835-.304-2.427-.912-.591-.608-.887-1.44-.887-2.496 0-1.204.389-2.175 1.166-2.911.776-.736 1.791-1.105 3.044-1.105.498 0 2.032.212 2.252.268.51.13.86.593.835 1.112l-.156 3.287c0 .794.22 1.19.66 1.19.372 0 .668-.267.888-.8.22-.534.33-1.232.33-2.094 0-.919-.194-1.731-.582-2.436a3.924 3.924 0 00-1.64-1.614c-.704-.371-1.509-.557-2.413-.557-1.172 0-2.19.237-3.053.711a4.785 4.785 0 00-1.988 2.05c-.46.894-.691 1.926-.691 3.096 0 1.576.428 2.784 1.283 3.627.855.841 2.094 1.262 3.718 1.262.615 0 1.29-.067 2.027-.2.225-.042.518-.108.877-.2a.863.863 0 011.025.527.76.76 0 01-.502.993c-1.052.316-2.17.488-3.357.516-2.204 0-3.922-.57-5.154-1.713C.616 11.146 0 9.56 0 7.527c0-1.41.315-2.69.944-3.84A6.792 6.792 0 013.63.98C4.794.327 6.131 0 7.645 0c1.276 0 2.514.29 3.418.77.905.481 1.574 1.228 2.12 2.176.544.947.817 2.04.817 3.28zm-8.615 1.01c0 1.208.488 1.811 1.466 1.811.511 0 .9-.181 1.168-.545.267-.363.429-.954.486-1.772l.11-1.896a4.638 4.638 0 00-.98-.095c-.71 0-1.263.224-1.658.67-.395.446-.592 1.055-.592 1.828z" }));
1516
- }
1517
- function Pn(t) {
1518
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M5.946 14a4.975 4.975 0 01-3.497-1.415A4.731 4.731 0 011 9.174c0-1.288.515-2.5 1.449-3.41L7.456.986c1.345-1.313 3.722-1.318 5.08.007a3.453 3.453 0 010 4.961L8.03 10.241c-.867.847-2.293.848-3.17-.006a2.158 2.158 0 010-3.102l1.744-1.701 1.272 1.24-1.744 1.701a.43.43 0 000 .621c.23.223.405.223.636 0l4.503-4.288a1.723 1.723 0 00-.007-2.473c-.68-.663-1.864-.663-2.543 0L3.713 7.011a3.006 3.006 0 00-.915 2.163c0 .82.328 1.591.922 2.17 1.19 1.162 3.262 1.162 4.451 0l2.248-2.192 1.272 1.24-2.248 2.193A4.978 4.978 0 015.946 14z" }));
1519
- }
1520
- function Tn(t) {
1521
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M7.779 7.063l-3.157 4.224a.49.49 0 00-.072.218.35.35 0 00.346.357h6.242c.476 0 .862.398.862.889v.36c0 .491-.386.889-.862.889H1.862A.876.876 0 011 13.111v-.425a.82.82 0 01.177-.54L4.393 7.8a1.367 1.367 0 00-.006-1.625L1.4 2.194a.822.822 0 01-.18-.544V.89C1.22.398 1.604 0 2.08 0h8.838c.476 0 .861.398.861.889v.36c0 .491-.385.89-.86.89H5.135c-.19 0-.345.159-.345.356a.489.489 0 00.07.216l2.92 3.975c.049.062.063.107.06.188a.246.246 0 01-.062.189z" }));
1522
- }
1523
- function Bn(t) {
1524
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M4 3a1 1 0 011-1h7a1 1 0 110 2H5a1 1 0 01-1-1zm0 4a1 1 0 011-1h7a1 1 0 110 2H5a1 1 0 01-1-1zm0 4a1 1 0 011-1h7a1 1 0 110 2H5a1 1 0 01-1-1zM2 4a1 1 0 110-2 1 1 0 010 2zm0 4a1 1 0 110-2 1 1 0 010 2zm0 4a1 1 0 110-2 1 1 0 010 2z" }));
1525
- }
1526
- function Hn(t) {
1527
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M4.462 0c-.595 0-1.078.482-1.078 1.078v2.306H1.078a1.078 1.078 0 100 2.155h2.306v2.922H1.078a1.078 1.078 0 100 2.155h2.306v2.306a1.078 1.078 0 002.155 0v-2.306H8.46v2.306a1.078 1.078 0 002.156 0v-2.306h2.306a1.078 1.078 0 100-2.155h-2.306V5.539h2.306a1.078 1.078 0 100-2.155h-2.306V1.078a1.078 1.078 0 00-2.156 0v2.306H5.54V1.078C5.54.482 5.056 0 4.461 0zm1.077 8.46V5.54H8.46v2.92H5.54z" }));
1528
- }
1529
- function On(t) {
1530
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M9.625 10.847C8.912 10.289 8.121 9.926 7 9.26v-.54a3.33 3.33 0 00.538-.888c.408-.1.774-.498.774-.832 0-.482-.202-.673-.44-.829 0-.015.003-.03.003-.046 0-.711-.438-2.625-2.625-2.625-2.188 0-2.625 1.915-2.625 2.625 0 .017.003.03.003.046-.238.156-.44.347-.44.829 0 .334.366.731.774.833.146.343.326.643.538.886v.541c-1.12.665-1.912 1.028-2.625 1.587C.041 11.498 0 12.469 0 14h10.5c0-1.531-.041-2.502-.875-3.153zm3.5-3.5c-.713-.558-1.504-.921-2.625-1.587v-.54c.212-.244.392-.544.538-.888.408-.1.774-.498.774-.832 0-.482-.202-.673-.44-.829 0-.015.003-.03.003-.046C11.375 1.914 10.937 0 8.75 0 6.562 0 6.125 1.915 6.125 2.625c0 .017.003.03.003.046-.016.012-.03.025-.047.036 1.751.359 2.516 1.841 2.647 3.04.248.262.46.65.46 1.253 0 .603-.417 1.203-1.004 1.515-.057.109-.117.214-.181.315l.437.245c.64.357 1.194.666 1.724 1.081.138.108.256.224.365.343H14c0-1.53-.041-2.5-.875-3.153z" }));
1531
- }
1532
- function dt(t) {
1533
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M13.125 10.035c-.571-.55-2.324-1.504-3.5-2.16v-.834c.224-.322.42-.671.566-1.055.394-.242.746-.702.746-1.173 0-.458-.005-.87-.47-1.208C10.305 1.558 9.436 0 7 0S3.695 1.558 3.533 3.605c-.465.338-.47.75-.47 1.208 0 .471.352.93.746 1.173.146.384.342.733.566 1.055v.834c-1.176.656-2.929 1.61-3.5 2.16C.165 10.72 0 11.812 0 14h14c0-2.188-.164-3.281-.875-3.965z" }));
1534
- }
1535
- function Vn(t) {
1536
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M2.207.013a.487.487 0 00-.29.02C.87.438.213 1.93.058 2.955c-.484 3.33 2.15 6.215 4.57 8.113 2.149 1.684 6.273 4.453 8.713 1.781.31-.329.678-.813.658-1.297-.058-.813-.813-1.394-1.394-1.84-.445-.329-1.375-1.239-1.956-1.22-.522.02-.851.562-1.18.891l-.582.581c-.096.097-1.336-.716-1.471-.813a9.881 9.881 0 01-1.414-1.104A9.13 9.13 0 014.86 6.732c-.097-.136-.89-1.317-.813-1.414 0 0 .677-.736.871-1.026.407-.62.717-1.104.252-1.84-.174-.27-.387-.484-.62-.716-.406-.387-.813-.794-1.278-1.123-.251-.194-.677-.542-1.065-.6z" }));
1537
- }
1538
- function Rn(t) {
1539
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M4.5 1v2h5.086L1 11.586 2.414 13 11 4.414V9.5h2V1z" }));
1540
- }
1541
- function jn(t) {
1542
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M7 13A6 6 0 107 1a6 6 0 000 12zM3.751 5.323A.2.2 0 013.909 5h6.182a.2.2 0 01.158.323L7.158 9.297a.2.2 0 01-.316 0L3.751 5.323z" }));
1543
- }
1544
- function Dn(t) {
1545
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M7 4.568a.5.5 0 00-.5-.5h-6a.5.5 0 00-.5.5v1.046a.5.5 0 00.5.5h6a.5.5 0 00.5-.5V4.568zM.5 1a.5.5 0 00-.5.5v1.045a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V1.5a.5.5 0 00-.5-.5H.5zM0 8.682a.5.5 0 00.5.5h11a.5.5 0 00.5-.5V7.636a.5.5 0 00-.5-.5H.5a.5.5 0 00-.5.5v1.046zm0 3.068a.5.5 0 00.5.5h9a.5.5 0 00.5-.5v-1.045a.5.5 0 00-.5-.5h-9a.5.5 0 00-.5.5v1.045z" }));
1546
- }
1547
- function pt(t) {
1548
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M6.986 14c-1.79 0-3.582-.69-4.944-2.068-2.723-2.72-2.723-7.172 0-9.892 2.725-2.72 7.182-2.72 9.906 0A6.972 6.972 0 0114 6.996c0 1.88-.728 3.633-2.052 4.955A7.058 7.058 0 016.986 14zm3.285-6.99v1.645H5.526v-5.47h1.841v3.63h2.904v.194zm1.89-.014c0-1.379-.542-2.67-1.522-3.648-2.006-2.005-5.287-2.007-7.297-.009l-.009.009a5.168 5.168 0 000 7.295c2.01 2.007 5.297 2.007 7.306 0a5.119 5.119 0 001.521-3.647z" }));
1549
- }
1550
- function Fn(t) {
1551
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M7.74 8.697a.81.81 0 01.073.308.894.894 0 01-.9.888.867.867 0 01-.825-.592l-.333-.961H2.058l-.333.961a.882.882 0 01-.838.592A.884.884 0 010 9.005c0-.11.025-.222.062-.308l2.403-6.211c.222-.58.776-.986 1.442-.986.653 0 1.22.407 1.442.986l2.39 6.211zM2.6 6.824h2.613L3.907 3.102 2.6 6.824zm8.8-3.118c1.355 0 2.6.542 2.6 2.255V9.08a.8.8 0 01-.789.814.797.797 0 01-.788-.703c-.395.468-1.097.764-1.874.764-.949 0-2.07-.64-2.07-1.972 0-1.392 1.121-1.897 2.07-1.897.789 0 1.491.246 1.886.727v-.826c0-.604-.518-.998-1.306-.998-.469 0-.888.123-1.32.394a.64.64 0 01-.307.086.602.602 0 01-.592-.604c0-.221.123-.419.284-.517a3.963 3.963 0 012.206-.641zm-.222 5.188c.505 0 .998-.172 1.257-.517v-.74c-.259-.345-.752-.517-1.257-.517-.616 0-1.122.332-1.122.9 0 .554.506.874 1.122.874zM.656 11.125h12.688a.656.656 0 110 1.313H.656a.656.656 0 110-1.313z" }));
1552
- }
1553
- function Un(t) {
1554
- return /* @__PURE__ */ e.createElement("svg", h({ viewBox: "0 0 14 14" }, t), /* @__PURE__ */ e.createElement("path", { d: "M3.733 3.867h3.734c1.03 0 1.866.837 1.866 1.866 0 1.03-.837 1.867-1.866 1.867h-.934a.934.934 0 000 1.867h.934a3.734 3.734 0 000-7.467H3.733A3.73 3.73 0 001.89 8.977a4.637 4.637 0 01.314-2.18 1.854 1.854 0 01-.336-1.064c0-1.03.837-1.866 1.866-1.866zm8.377 1.422a4.6 4.6 0 01-.316 2.176c.212.303.34.67.34 1.068 0 1.03-.838 1.867-1.867 1.867H6.533a1.869 1.869 0 01-1.866-1.867c0-1.03.837-1.866 1.866-1.866h.934a.934.934 0 000-1.867h-.934a3.733 3.733 0 000 7.467h3.734a3.73 3.73 0 001.843-6.978z" }));
647
+ function xt() {
648
+ const n = window.innerWidth;
649
+ return n < 500 ? 8 : n < 800 ? 20 : n < 1280 ? 30 : n < 1600 ? 40 : n < 1920 ? 48 : 72;
1555
650
  }
1556
- const An = {
1557
- title: Fn,
1558
- text: Dn,
1559
- number: Hn,
1560
- select: jn,
1561
- multi_select: Bn,
1562
- date: Mn,
1563
- person: On,
1564
- file: Pn,
1565
- checkbox: Sn,
1566
- url: Un,
1567
- email: zn,
1568
- phone_number: Vn,
1569
- formula: Tn,
1570
- relation: Rn,
1571
- created_time: pt,
1572
- last_edited_time: pt,
1573
- created_by: dt,
1574
- last_edited_by: dt
1575
- }, qn = (a) => {
1576
- var l = a, { type: t } = l, o = T(l, ["type"]);
1577
- const i = An[t];
1578
- return i ? i(o) : null;
1579
- }, ta = ({ schema: t }) => /* @__PURE__ */ e.createElement("div", { className: "notion-collection-column-title" }, /* @__PURE__ */ e.createElement(qn, { className: "notion-collection-column-title-icon", type: t.type }), /* @__PURE__ */ e.createElement("div", { className: "notion-collection-column-title-body" }, t.name));
1580
651
  export {
1581
- pn as Asset,
1582
- Me as AssetWrapper,
1583
- En as Audio,
1584
- Ln as Block,
1585
- Xt as Breadcrumbs,
1586
- Tt as Checkbox,
1587
- ta as CollectionColumnTitle,
1588
- yt as EOI,
1589
- yn as File,
1590
- bn as GoogleDrive,
1591
- Se as GracefulImage,
1592
- Yt as Header,
1593
- mn as LiteYouTubeEmbed,
1594
- Te as NotionBlockRenderer,
1595
- cn as NotionContextConsumer,
1596
- kt as NotionContextProvider,
1597
- ea as NotionRenderer,
1598
- wn as PageAside,
1599
- pe as PageIcon,
1600
- Ut as PageIconImpl,
1601
- fe as PageTitle,
1602
- Zt as PageTitleImpl,
1603
- qn as PropertyIcon,
1604
- Jt as Search,
1605
- Qt as SearchDialog,
1606
- xn as SyncPointerBlock,
1607
- P as Text,
1608
- Kn as dummyLink,
1609
- oa as formatDate,
1610
- ra as formatNotionDateTime,
1611
- Vt as getHashFragmentValue,
1612
- Ot as getListNumber,
1613
- Dt as getYoutubeId,
1614
- An as iconMap,
1615
- Rt as isBrowser,
1616
- la as isUrl,
1617
- V as useNotionContext
652
+ Dt as Asset,
653
+ Qe as AssetWrapper,
654
+ gt as Audio,
655
+ Ct as Block,
656
+ Rt as Breadcrumbs,
657
+ zt as Checkbox,
658
+ tn as CollectionColumnTitle,
659
+ dt as EOI,
660
+ vt as File,
661
+ bt as GoogleDrive,
662
+ mt as GracefulImage,
663
+ Ut as Header,
664
+ Wt as LiteYouTubeEmbed,
665
+ ye as NotionBlockRenderer,
666
+ Vt as NotionContextConsumer,
667
+ pt as NotionContextProvider,
668
+ jt as NotionRenderer,
669
+ yt as PageAside,
670
+ Ke as PageIcon,
671
+ qt as PageIconImpl,
672
+ Xe as PageTitle,
673
+ Gt as PageTitleImpl,
674
+ nn as PropertyIcon,
675
+ Yt as Search,
676
+ Zt as SearchDialog,
677
+ _t as SyncPointerBlock,
678
+ C as Text,
679
+ Jt as dummyLink,
680
+ Mt as formatDate,
681
+ Ht as formatNotionDateTime,
682
+ Xt as getHashFragmentValue,
683
+ ut as getListNumber,
684
+ Kt as getYoutubeId,
685
+ on as iconMap,
686
+ Qt as isBrowser,
687
+ At as isUrl,
688
+ ce as useNotionContext
1618
689
  };
1619
690
  //# sourceMappingURL=index.js.map