@texonom/nreact 1.4.7 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/build/block.d.ts +20 -20
  2. package/build/components/asset-wrapper.d.ts +6 -6
  3. package/build/components/asset.d.ts +7 -7
  4. package/build/components/audio.d.ts +6 -6
  5. package/build/components/checkbox.d.ts +5 -5
  6. package/build/components/eoi.d.ts +7 -7
  7. package/build/components/file.d.ts +6 -6
  8. package/build/components/google-drive.d.ts +6 -6
  9. package/build/components/graceful-image.d.ts +3 -3
  10. package/build/components/header.d.ts +15 -15
  11. package/build/components/lazy-image.d.ts +13 -13
  12. package/build/components/lite-youtube-embed.d.ts +13 -13
  13. package/build/components/page-aside.d.ts +11 -11
  14. package/build/components/page-icon.d.ts +16 -16
  15. package/build/components/page-title.d.ts +12 -12
  16. package/build/components/search-dialog.d.ts +26 -26
  17. package/build/components/search-dialog.d.ts.map +1 -1
  18. package/build/components/sync-pointer-block.d.ts +6 -6
  19. package/build/components/text.d.ts +19 -19
  20. package/build/context.d.ts +64 -64
  21. package/build/context.d.ts.map +1 -1
  22. package/build/icons/check.d.ts +3 -3
  23. package/build/icons/chevron-down-icon.d.ts +2 -2
  24. package/build/icons/clear-icon.d.ts +2 -2
  25. package/build/icons/collection-view-board.d.ts +3 -3
  26. package/build/icons/collection-view-calendar.d.ts +3 -3
  27. package/build/icons/collection-view-gallery.d.ts +3 -3
  28. package/build/icons/collection-view-icon.d.ts +8 -8
  29. package/build/icons/collection-view-list.d.ts +3 -3
  30. package/build/icons/collection-view-table.d.ts +3 -3
  31. package/build/icons/copy.d.ts +3 -3
  32. package/build/icons/default-page-icon.d.ts +2 -2
  33. package/build/icons/empty-icon.d.ts +2 -2
  34. package/build/icons/file-icon.d.ts +2 -2
  35. package/build/icons/link-icon.d.ts +2 -2
  36. package/build/icons/loading-icon.d.ts +2 -2
  37. package/build/icons/property-icon.d.ts +44 -44
  38. package/build/icons/search-icon.d.ts +2 -2
  39. package/build/icons/type-checkbox.d.ts +3 -3
  40. package/build/icons/type-date.d.ts +3 -3
  41. package/build/icons/type-email.d.ts +3 -3
  42. package/build/icons/type-file.d.ts +3 -3
  43. package/build/icons/type-formula.d.ts +3 -3
  44. package/build/icons/type-github.d.ts +3 -3
  45. package/build/icons/type-multi-select.d.ts +3 -3
  46. package/build/icons/type-number.d.ts +3 -3
  47. package/build/icons/type-person-2.d.ts +3 -3
  48. package/build/icons/type-person.d.ts +3 -3
  49. package/build/icons/type-phone-number.d.ts +3 -3
  50. package/build/icons/type-relation.d.ts +3 -3
  51. package/build/icons/type-select.d.ts +3 -3
  52. package/build/icons/type-text.d.ts +3 -3
  53. package/build/icons/type-timestamp.d.ts +3 -3
  54. package/build/icons/type-title.d.ts +3 -3
  55. package/build/icons/type-url.d.ts +3 -3
  56. package/build/index.d.ts +24 -24
  57. package/build/index.js +1405 -675
  58. package/build/index.js.map +1 -0
  59. package/build/next.d.ts +1 -1
  60. package/build/renderer.d.ts +50 -50
  61. package/build/third-party/code.d.ts +7 -16
  62. package/build/third-party/collection-card.d.ts +3 -3
  63. package/build/third-party/collection-card.d.ts.map +1 -1
  64. package/build/third-party/collection-column-title.d.ts +5 -5
  65. package/build/third-party/collection-group.d.ts +3 -3
  66. package/build/third-party/collection-row.d.ts +7 -7
  67. package/build/third-party/collection-utils.d.ts +2 -2
  68. package/build/third-party/collection-view-board.d.ts +3 -3
  69. package/build/third-party/collection-view-gallery.d.ts +3 -3
  70. package/build/third-party/collection-view-list.d.ts +3 -3
  71. package/build/third-party/collection-view-table.d.ts +3 -3
  72. package/build/third-party/collection-view.d.ts +4 -4
  73. package/build/third-party/collection.d.ts +14 -14
  74. package/build/third-party/equation.d.ts +8 -8
  75. package/build/third-party/eval-formula.d.ts +20 -20
  76. package/build/third-party/modal.d.ts +2 -2
  77. package/build/third-party/pdf.d.ts +4 -4
  78. package/build/third-party/property.d.ts +21 -21
  79. package/build/types.d.ts +93 -93
  80. package/build/utils.d.ts +6 -6
  81. package/package.json +13 -13
  82. package/readme.md +59 -0
  83. package/LICENSE +0 -21
  84. package/README.md +0 -19
  85. package/build/.tsbuildinfo +0 -1
  86. package/build/chunk-2U7I3XVC.js +0 -157
  87. package/build/chunk-72RHNPWF.js +0 -1307
  88. package/build/chunk-C6BUIPAM.js +0 -83
  89. package/build/chunk-FCO7MUK6.js +0 -83
  90. package/build/chunk-H4QYS6CQ.js +0 -1185
  91. package/build/chunk-IMWLLIUB.js +0 -1182
  92. package/build/chunk-P7HX4BAT.js +0 -156
  93. package/build/chunk-VP33CFNB.js +0 -1358
  94. package/build/chunk-YMM43AZ3.js +0 -1207
  95. package/build/dev/chunk-64UJZ76E.js +0 -1308
  96. package/build/dev/chunk-64UJZ76E.js.map +0 -1
  97. package/build/dev/chunk-ABDRHJEI.js +0 -157
  98. package/build/dev/chunk-ABDRHJEI.js.map +0 -1
  99. package/build/dev/chunk-N6EDMIQD.js +0 -1359
  100. package/build/dev/chunk-N6EDMIQD.js.map +0 -1
  101. package/build/dev/chunk-OAIRL2FN.js +0 -84
  102. package/build/dev/chunk-OAIRL2FN.js.map +0 -1
  103. package/build/dev/chunk-P3V5A3W4.js +0 -1183
  104. package/build/dev/chunk-P3V5A3W4.js.map +0 -1
  105. package/build/dev/chunk-PM5CWL6O.js +0 -158
  106. package/build/dev/chunk-PM5CWL6O.js.map +0 -1
  107. package/build/dev/chunk-Q4G2SZRD.js +0 -84
  108. package/build/dev/chunk-Q4G2SZRD.js.map +0 -1
  109. package/build/dev/chunk-SEA7YL2O.js +0 -1308
  110. package/build/dev/chunk-SEA7YL2O.js.map +0 -1
  111. package/build/dev/chunk-SVHGWLRK.js +0 -1208
  112. package/build/dev/chunk-SVHGWLRK.js.map +0 -1
  113. package/build/dev/chunk-ZJAJPWJX.js +0 -1186
  114. package/build/dev/chunk-ZJAJPWJX.js.map +0 -1
  115. package/build/dev/index.js +0 -890
  116. package/build/dev/index.js.map +0 -1
  117. package/build/dev/third-party/code.js +0 -140
  118. package/build/dev/third-party/code.js.map +0 -1
  119. package/build/dev/third-party/collection.js +0 -4382
  120. package/build/dev/third-party/collection.js.map +0 -1
  121. package/build/dev/third-party/equation.js +0 -35
  122. package/build/dev/third-party/equation.js.map +0 -1
  123. package/build/dev/third-party/modal.js +0 -8
  124. package/build/dev/third-party/modal.js.map +0 -1
  125. package/build/dev/third-party/pdf.js +0 -21
  126. package/build/dev/third-party/pdf.js.map +0 -1
  127. package/build/third-party/code.js +0 -139
  128. package/build/third-party/collection.js +0 -4381
  129. package/build/third-party/equation.js +0 -34
  130. package/build/third-party/modal.js +0 -7
  131. package/build/third-party/pdf.js +0 -20
package/build/index.js CHANGED
@@ -1,506 +1,1230 @@
1
- import {
2
- CollectionColumnTitle,
3
- PropertyIcon,
4
- iconMap
5
- } from "./chunk-P7HX4BAT.js";
6
- import {
7
- Asset,
8
- AssetWrapper,
9
- Breadcrumbs,
10
- Checkbox,
11
- EOI,
12
- GracefulImage,
13
- Header,
14
- LazyImage,
15
- LiteYouTubeEmbed,
16
- NotionContextConsumer,
17
- NotionContextProvider,
18
- PageIcon,
19
- PageIconImpl,
20
- PageTitle,
21
- PageTitleImpl,
22
- Search,
23
- SearchDialog,
24
- Text,
25
- dummyLink,
26
- formatDate,
27
- formatNotionDateTime,
28
- getHashFragmentValue,
29
- getListNumber,
30
- getYoutubeId,
31
- isBrowser,
32
- isUrl,
33
- useNotionContext
34
- } from "./chunk-YMM43AZ3.js";
35
- import {
36
- __commonJS,
37
- __objRest,
38
- __spreadProps,
39
- __spreadValues,
40
- __toESM
41
- } from "./chunk-C6BUIPAM.js";
42
-
43
- // ../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js
44
- var require_lodash = __commonJS({
45
- "../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js"(exports, module) {
46
- var FUNC_ERROR_TEXT = "Expected a function";
47
- var NAN = 0 / 0;
48
- var symbolTag = "[object Symbol]";
49
- var reTrim = /^\s+|\s+$/g;
50
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
51
- var reIsBinary = /^0b[01]+$/i;
52
- var reIsOctal = /^0o[0-7]+$/i;
53
- var freeParseInt = parseInt;
54
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
55
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
56
- var root = freeGlobal || freeSelf || Function("return this")();
57
- var objectProto = Object.prototype;
58
- var objectToString = objectProto.toString;
59
- var nativeMax = Math.max;
60
- var nativeMin = Math.min;
61
- var now = function() {
62
- return root.Date.now();
63
- };
64
- function debounce(func, wait, options) {
65
- var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
66
- if (typeof func != "function") {
67
- throw new TypeError(FUNC_ERROR_TEXT);
68
- }
69
- wait = toNumber(wait) || 0;
70
- if (isObject(options)) {
71
- leading = !!options.leading;
72
- maxing = "maxWait" in options;
73
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
74
- trailing = "trailing" in options ? !!options.trailing : trailing;
75
- }
76
- function invokeFunc(time) {
77
- var args = lastArgs, thisArg = lastThis;
78
- lastArgs = lastThis = void 0;
79
- lastInvokeTime = time;
80
- result = func.apply(thisArg, args);
81
- return result;
82
- }
83
- function leadingEdge(time) {
84
- lastInvokeTime = time;
85
- timerId = setTimeout(timerExpired, wait);
86
- return leading ? invokeFunc(time) : result;
87
- }
88
- function remainingWait(time) {
89
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result2 = wait - timeSinceLastCall;
90
- return maxing ? nativeMin(result2, maxWait - timeSinceLastInvoke) : result2;
91
- }
92
- function shouldInvoke(time) {
93
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
94
- return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
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;
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
+ 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];
95
193
  }
96
- function timerExpired() {
97
- var time = now();
98
- if (shouldInvoke(time)) {
99
- return trailingEdge(time);
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;
100
323
  }
101
- timerId = setTimeout(timerExpired, remainingWait(time));
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;
102
363
  }
103
- function trailingEdge(time) {
104
- timerId = void 0;
105
- if (trailing && lastArgs) {
106
- return invokeFunc(time);
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
107
377
  }
108
- lastArgs = lastThis = void 0;
109
- return result;
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;
110
384
  }
111
- function cancel() {
112
- if (timerId !== void 0) {
113
- clearTimeout(timerId);
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
114
395
  }
115
- lastInvokeTime = 0;
116
- lastArgs = lastCallTime = lastThis = timerId = void 0;
117
- }
118
- function flush() {
119
- return timerId === void 0 ? result : trailingEdge(now());
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);
120
419
  }
121
- function debounced() {
122
- var time = now(), isInvoking = shouldInvoke(time);
123
- lastArgs = arguments;
124
- lastThis = this;
125
- lastCallTime = time;
126
- if (isInvoking) {
127
- if (timerId === void 0) {
128
- return leadingEdge(lastCallTime);
129
- }
130
- if (maxing) {
131
- timerId = setTimeout(timerExpired, wait);
132
- return invokeFunc(lastCallTime);
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
133
448
  }
134
- }
135
- if (timerId === void 0) {
136
- timerId = setTimeout(timerExpired, wait);
137
- }
138
- return result;
139
- }
140
- debounced.cancel = cancel;
141
- debounced.flush = flush;
142
- return debounced;
143
- }
144
- function throttle2(func, wait, options) {
145
- var leading = true, trailing = true;
146
- if (typeof func != "function") {
147
- throw new TypeError(FUNC_ERROR_TEXT);
148
- }
149
- if (isObject(options)) {
150
- leading = "leading" in options ? !!options.leading : leading;
151
- trailing = "trailing" in options ? !!options.trailing : trailing;
152
- }
153
- return debounce(func, wait, {
154
- "leading": leading,
155
- "maxWait": wait,
156
- "trailing": trailing
157
- });
158
- }
159
- function isObject(value) {
160
- var type = typeof value;
161
- return !!value && (type == "object" || type == "function");
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
162
510
  }
163
- function isObjectLike(value) {
164
- return !!value && typeof value == "object";
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, "")}`);
165
591
  }
166
- function isSymbol(value) {
167
- return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
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);
168
680
  }
169
- function toNumber(value) {
170
- if (typeof value == "number") {
171
- return value;
172
- }
173
- if (isSymbol(value)) {
174
- return NAN;
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: _
175
737
  }
176
- if (isObject(value)) {
177
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
178
- value = isObject(other) ? other + "" : other;
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
+ }
179
784
  }
180
- if (typeof value != "string") {
181
- return value === 0 ? value : +value;
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
+ );
182
841
  }
183
- value = value.replace(reTrim, "");
184
- var isBinary = reIsBinary.test(value);
185
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
186
842
  }
187
- module.exports = throttle2;
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 });
188
847
  }
189
- });
190
-
191
- // src/renderer.tsx
192
- import React9 from "react";
193
- import mediumZoom from "@fisch0920/medium-zoom";
194
-
195
- // src/block.tsx
196
- import React8 from "react";
197
- import {
198
- getBlockCollectionId,
199
- getBlockIcon,
200
- getBlockParentPage,
201
- getPageTableOfContents,
202
- getTextContent,
203
- uuidToId as uuidToId2
204
- } from "@texonom/nutils";
205
-
206
- // src/components/audio.tsx
207
- import React from "react";
208
- var Audio = ({ block, className }) => {
209
- var _a, _b, _c;
210
- const { recordMap } = useNotionContext();
211
- const source = recordMap.signed_urls[block.id] || ((_c = (_b = (_a = block.properties) == null ? void 0 : _a.source) == null ? void 0 : _b[0]) == null ? void 0 : _c[0]);
212
- return /* @__PURE__ */ React.createElement("div", { className: `notion-audio ${className || ""}` }, /* @__PURE__ */ React.createElement("audio", { controls: true, preload: "none", src: source }));
213
- };
214
-
215
- // src/components/file.tsx
216
- import React3 from "react";
217
-
218
- // src/icons/file-icon.tsx
219
- import React2 from "react";
220
- var FileIcon = (props) => {
221
- const _a = props, { className } = _a, rest = __objRest(_a, ["className"]);
222
- return /* @__PURE__ */ React2.createElement("svg", __spreadProps(__spreadValues({ className }, rest), { viewBox: "0 0 30 30" }), /* @__PURE__ */ React2.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" }));
223
- };
224
-
225
- // src/components/file.tsx
226
- var File = ({ block, className }) => {
227
- var _a, _b, _c, _d, _e;
228
- const { components, recordMap } = useNotionContext();
229
- const source = recordMap.signed_urls[block.id] || ((_c = (_b = (_a = block.properties) == null ? void 0 : _a.source) == null ? void 0 : _b[0]) == null ? void 0 : _c[0]);
230
- return /* @__PURE__ */ React3.createElement("div", { className: `notion-file ${className || ""}` }, /* @__PURE__ */ React3.createElement(components.Link, { className: "notion-file-link", href: source, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ React3.createElement(FileIcon, { className: "notion-file-icon" }), /* @__PURE__ */ React3.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ React3.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ React3.createElement(Text, { value: ((_d = block.properties) == null ? void 0 : _d.title) || [["File"]], block })), ((_e = block.properties) == null ? void 0 : _e.size) && /* @__PURE__ */ React3.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ React3.createElement(Text, { value: block.properties.size, block })))));
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;
231
883
  };
232
-
233
- // src/components/google-drive.tsx
234
- import React4 from "react";
235
- var GoogleDrive = ({ block, className }) => {
236
- var _a;
237
- const { components, mapImageUrl } = useNotionContext();
238
- const properties = (_a = block.format) == null ? void 0 : _a.drive_properties;
239
- if (!properties) return null;
240
- let domain;
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) {
241
891
  try {
242
- const url = new URL(properties.url);
243
- domain = url.hostname;
244
- } catch (err) {
892
+ return new URL(t).hostname;
893
+ } catch (o) {
894
+ return "";
245
895
  }
246
- return /* @__PURE__ */ React4.createElement("div", { className: `notion-google-drive ${className || ""}` }, /* @__PURE__ */ React4.createElement(components.Link, { className: "notion-google-drive-link", href: properties.url, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ React4.createElement(
247
- GracefulImage,
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;
913
+ try {
914
+ s = new URL(i.url).hostname;
915
+ } catch (u) {
916
+ }
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,
248
919
  {
249
- src: mapImageUrl(properties.thumbnail, block),
250
- alt: properties.title || "Google Drive Document",
920
+ src: l(i.thumbnail, t),
921
+ alt: i.title || "Google Drive Document",
251
922
  loading: "lazy"
252
923
  }
253
- )), /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-body" }, properties.title && /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-body-title" }, properties.title), properties.icon && domain && /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-body-source" }, properties.icon && /* @__PURE__ */ React4.createElement(
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(
254
925
  "div",
255
926
  {
256
927
  className: "notion-google-drive-body-source-icon",
257
928
  style: {
258
- backgroundImage: `url(${properties.icon})`
929
+ backgroundImage: `url(${i.icon})`
259
930
  }
260
931
  }
261
- ), domain && /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-body-source-domain" }, domain)))));
932
+ ), s && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source-domain" }, s)))));
262
933
  };
263
-
264
- // src/components/page-aside.tsx
265
- var import_lodash = __toESM(require_lodash(), 1);
266
- import React5 from "react";
267
- import { uuidToId } from "@texonom/nutils";
268
- var PageAside = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasAside, className }) => {
269
- const throttleMs = 100;
270
- const actionSectionScrollSpy = React5.useMemo(
271
- () => (0, import_lodash.default)(() => {
272
- const sections = document.getElementsByClassName("notion-h");
273
- let prevBBox = null;
274
- let currentSectionId = activeSection;
275
- for (let i = 0; i < sections.length; ++i) {
276
- const section = sections[i];
277
- if (!section || !(section instanceof Element)) continue;
278
- if (!currentSectionId) currentSectionId = section.getAttribute("data-id");
279
- const bbox = section.getBoundingClientRect();
280
- const prevHeight = prevBBox ? bbox.top - prevBBox.bottom : 0;
281
- const offset = Math.max(150, prevHeight / 4);
282
- if (bbox.top - offset < 0) {
283
- currentSectionId = section.getAttribute("data-id");
284
- prevBBox = bbox;
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();
944
+ };
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);
987
+ }
988
+ return R === void 0 && (R = setTimeout(Y, v)), k;
989
+ }
990
+ return te.cancel = Ee, te.flush = ve, te;
991
+ }
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
1000
+ });
1001
+ }
1002
+ function $(f) {
1003
+ var v = typeof f;
1004
+ return !!f && (v == "object" || v == "function");
1005
+ }
1006
+ function H(f) {
1007
+ return !!f && typeof f == "object";
1008
+ }
1009
+ function w(f) {
1010
+ return typeof f == "symbol" || H(f) && E.call(f) == a;
1011
+ }
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;
1026
+ }
1027
+ return Le = M, Le;
1028
+ }
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;
285
1042
  continue;
286
1043
  }
287
1044
  break;
288
1045
  }
289
- setActiveSection(currentSectionId);
290
- }, throttleMs),
1046
+ a(m);
1047
+ }, 100),
291
1048
  // eslint-disable-next-line react-hooks/exhaustive-deps
292
1049
  [
293
1050
  // explicitly not taking a dependency on activeSection
294
- setActiveSection
1051
+ a
295
1052
  ]
296
1053
  );
297
- React5.useEffect(() => {
298
- if (!hasToc) return;
299
- window.addEventListener("scroll", actionSectionScrollSpy);
300
- actionSectionScrollSpy();
301
- return () => {
302
- window.removeEventListener("scroll", actionSectionScrollSpy);
303
- };
304
- }, [hasToc, actionSectionScrollSpy]);
305
- if (!hasAside) return null;
306
- return /* @__PURE__ */ React5.createElement("aside", { className: `notion-aside ${className || ""}` }, hasToc && /* @__PURE__ */ React5.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ React5.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ React5.createElement("nav", { className: "notion-table-of-contents" }, toc.map((tocItem) => {
307
- const id = uuidToId(tocItem.id);
308
- return /* @__PURE__ */ React5.createElement(
1054
+ return e.useEffect(() => {
1055
+ if (i)
1056
+ return window.addEventListener("scroll", c), c(), () => {
1057
+ window.removeEventListener("scroll", c);
1058
+ };
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);
1061
+ return /* @__PURE__ */ e.createElement(
309
1062
  "a",
310
1063
  {
311
- key: id,
312
- href: `#${id}`,
1064
+ key: g,
1065
+ href: `#${g}`,
313
1066
  className: `notion-table-of-contents-item
314
- notion-table-of-contents-item-indent-level-${tocItem.indentLevel}
315
- ${activeSection === id && "notion-table-of-contents-active-item"}`
1067
+ notion-table-of-contents-item-indent-level-${d.indentLevel}
1068
+ ${o === g && "notion-table-of-contents-active-item"}`
316
1069
  },
317
- /* @__PURE__ */ React5.createElement(
1070
+ /* @__PURE__ */ e.createElement(
318
1071
  "span",
319
1072
  {
320
1073
  className: "notion-table-of-contents-item-body",
321
1074
  style: {
322
1075
  display: "inline-block",
323
- marginLeft: tocItem.indentLevel * 16
1076
+ marginLeft: d.indentLevel * 16
324
1077
  }
325
1078
  },
326
- tocItem.text
1079
+ d.text
327
1080
  )
328
1081
  );
329
- }))), pageAside);
330
- };
331
-
332
- // src/components/sync-pointer-block.tsx
333
- import React6 from "react";
334
- var SyncPointerBlock = ({ block, level }) => {
335
- var _a, _b;
336
- if (!block) {
337
- if (true) console.warn("missing sync pointer block", block.id);
338
- return null;
339
- }
340
- const syncPointerBlock = block;
341
- const referencePointerId = (_b = (_a = syncPointerBlock == null ? void 0 : syncPointerBlock.format) == null ? void 0 : _a.transclusion_reference_pointer) == null ? void 0 : _b.id;
342
- if (!referencePointerId) return null;
343
- return /* @__PURE__ */ React6.createElement(NotionBlockRenderer, { key: referencePointerId, level, blockId: referencePointerId });
344
- };
345
-
346
- // src/icons/link-icon.tsx
347
- import React7 from "react";
348
- var LinkIcon = (props) => {
349
- const _a = props, { className } = _a, rest = __objRest(_a, ["className"]);
350
- return /* @__PURE__ */ React7.createElement("svg", __spreadProps(__spreadValues({ className }, rest), { viewBox: "0 0 16 16", width: "16", height: "16" }), /* @__PURE__ */ React7.createElement(
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(
351
1092
  "path",
352
1093
  {
353
1094
  fillRule: "evenodd",
354
1095
  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"
355
1096
  }
356
1097
  ));
357
- };
358
-
359
- // src/block.tsx
360
- var tocIndentLevelCache = {};
361
- var pageCoverStyleCache = {};
362
- var Block = (props) => {
363
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q;
364
- const ctx = useNotionContext();
365
- const {
366
- components,
367
- fullPage,
368
- recordMap,
369
- mapPageUrl,
370
- mapImageUrl,
371
- showTableOfContents,
372
- minTableOfContentsItems,
373
- defaultPageIcon,
374
- defaultPageCover,
375
- defaultPageCoverPosition
376
- } = ctx;
377
- const [activeSection, setActiveSection] = React8.useState(null);
378
- const {
379
- block,
380
- children,
381
- level,
382
- className,
383
- bodyClassName,
384
- header,
385
- footer,
386
- pageHeader,
387
- pageFooter,
388
- pageTitle,
389
- pageAside,
390
- pageCover,
391
- hideBlockId,
392
- disableHeader
393
- } = props;
394
- if (!block) return null;
395
- if (level === 0 && block.type === "collection_view") {
396
- const view_block = block;
397
- view_block.type = "collection_view_page";
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";
398
1131
  }
399
- const blockId = hideBlockId ? "notion-block" : `notion-block-${uuidToId2(block.id)}`;
400
- switch (block.type) {
1132
+ const k = D ? "notion-block" : `notion-block-${Ce(n.id)}`;
1133
+ switch (n.type) {
401
1134
  case "collection_view_page":
402
1135
  // fallthrough
403
1136
  case "page":
404
- if (level === 0) {
1137
+ if (x === 0) {
405
1138
  const {
406
- page_icon = defaultPageIcon,
407
- page_cover = defaultPageCover,
408
- page_cover_position = defaultPageCoverPosition,
409
- page_full_width,
410
- page_small_text
411
- } = block.format || {};
412
- if (fullPage) {
413
- const properties = block.type === "page" ? block.properties : {
414
- title: (_b = (_a = recordMap.collection[getBlockCollectionId(block, recordMap)]) == null ? void 0 : _a.value) == null ? void 0 : _b.name
415
- };
416
- const coverPosition = (1 - (page_cover_position || 0.5)) * 100;
417
- const pageCoverObjectPosition = `center ${coverPosition}%`;
418
- let pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition];
419
- if (!pageCoverStyle)
420
- pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition] = {
421
- objectPosition: pageCoverObjectPosition
422
- };
423
- const pageIcon = (_c = getBlockIcon(block, recordMap)) != null ? _c : defaultPageIcon;
424
- const isPageIconUrl = pageIcon && isUrl(pageIcon);
425
- const toc = getPageTableOfContents(block, recordMap);
426
- const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems;
427
- const hasAside = (hasToc || pageAside) && !page_full_width;
428
- const hasPageCover = pageCover || page_cover;
429
- return /* @__PURE__ */ React8.createElement("div", { className: `notion notion-app ${blockId} ${className || ""}` }, /* @__PURE__ */ React8.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ React8.createElement("div", { className: "notion-frame" }, !disableHeader && /* @__PURE__ */ React8.createElement(components.Header, { block }), header, /* @__PURE__ */ React8.createElement("div", { className: "notion-page-scroller" }, hasPageCover && (pageCover ? pageCover : /* @__PURE__ */ React8.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ React8.createElement(
430
- LazyImage,
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
1152
+ });
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,
431
1156
  {
432
- src: mapImageUrl(page_cover, block),
433
- alt: getTextContent(properties == null ? void 0 : properties.title),
434
- priority: true,
1157
+ src: r(C, n),
1158
+ alt: le(B == null ? void 0 : B.title),
1159
+ priority: !0,
435
1160
  className: "notion-page-cover",
436
- style: pageCoverStyle
1161
+ style: q
437
1162
  }
438
- ))), /* @__PURE__ */ React8.createElement(
1163
+ ))), /* @__PURE__ */ e.createElement(
439
1164
  "main",
440
1165
  {
441
1166
  className: `notion-page
442
- ${hasPageCover ? "notion-page-has-cover" : "notion-page-no-cover"}
443
- ${page_icon ? "notion-page-has-icon" : "notion-page-no-icon"}
444
- ${isPageIconUrl ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
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"}
445
1170
  notion-full-page
446
- ${page_full_width && "notion-full-width"}
447
- ${page_small_text && "notion-small-text"}
448
- ${bodyClassName}`
1171
+ ${z && "notion-full-width"}
1172
+ ${j && "notion-small-text"}
1173
+ ${$}`
449
1174
  },
450
- page_icon && /* @__PURE__ */ React8.createElement(PageIcon, { block, defaultIcon: defaultPageIcon, inline: false }),
451
- pageHeader,
452
- /* @__PURE__ */ React8.createElement("h1", { className: "notion-title" }, pageTitle != null ? pageTitle : /* @__PURE__ */ React8.createElement(Text, { value: properties == null ? void 0 : properties.title, block })),
453
- (block.type === "collection_view_page" || block.type === "page" && block.parent_table === "collection") && /* @__PURE__ */ React8.createElement(components.Collection, { block, ctx }),
454
- block.type !== "collection_view_page" && /* @__PURE__ */ React8.createElement(
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(
455
1180
  "div",
456
1181
  {
457
1182
  className: `notion-page-content
458
- ${hasAside && "notion-page-content-has-aside"}
459
- ${hasToc && "notion-page-content-has-toc"}`
1183
+ ${oe && "notion-page-content-has-aside"}
1184
+ ${ye && "notion-page-content-has-toc"}`
460
1185
  },
461
- /* @__PURE__ */ React8.createElement("article", { className: "notion-page-content-inner" }, children),
462
- hasAside && /* @__PURE__ */ React8.createElement(
463
- PageAside,
1186
+ /* @__PURE__ */ e.createElement("article", { className: "notion-page-content-inner" }, p),
1187
+ oe && /* @__PURE__ */ e.createElement(
1188
+ wn,
464
1189
  {
465
- toc,
466
- activeSection,
467
- setActiveSection,
468
- hasToc,
469
- hasAside,
470
- pageAside
1190
+ toc: de,
1191
+ activeSection: E,
1192
+ setActiveSection: N,
1193
+ hasToc: ye,
1194
+ hasAside: oe,
1195
+ pageAside: _
471
1196
  }
472
1197
  )
473
1198
  ),
474
- pageFooter
475
- ), footer)));
476
- } else {
477
- return /* @__PURE__ */ React8.createElement(
1199
+ f
1200
+ ), w)));
1201
+ } else
1202
+ return /* @__PURE__ */ e.createElement(
478
1203
  "main",
479
1204
  {
480
1205
  className: `notion
481
1206
  notion-page
482
- ${page_full_width && "notion-full-width"}
483
- ${page_small_text && "notion-small-text"}
484
- ${blockId}
485
- ${className || ""}
486
- ${bodyClassName}`
1207
+ ${z && "notion-full-width"}
1208
+ ${j && "notion-small-text"}
1209
+ ${k}
1210
+ ${M || ""}
1211
+ ${$}`
487
1212
  },
488
- /* @__PURE__ */ React8.createElement("div", { className: "notion-viewport" }),
489
- pageHeader,
490
- (block.type === "collection_view_page" || block.type === "page" && block.parent_table === "collection") && /* @__PURE__ */ React8.createElement(components.Collection, { block, ctx }),
491
- block.type !== "collection_view_page" && children,
492
- pageFooter
1213
+ /* @__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
493
1218
  );
494
- }
495
1219
  } else {
496
- const blockColor = (_d = block.format) == null ? void 0 : _d.block_color;
497
- return /* @__PURE__ */ React8.createElement(
498
- components.PageLink,
1220
+ const b = (ce = n.format) == null ? void 0 : ce.block_color;
1221
+ return /* @__PURE__ */ e.createElement(
1222
+ a.PageLink,
499
1223
  {
500
- className: `notion-page-link ${blockColor && `notion-${blockColor}`} ${blockId}`,
501
- href: mapPageUrl(block.id)
1224
+ className: `notion-page-link ${b && `notion-${b}`} ${k}`,
1225
+ href: s(n.id)
502
1226
  },
503
- /* @__PURE__ */ React8.createElement(PageTitle, { block })
1227
+ /* @__PURE__ */ e.createElement(fe, { block: n })
504
1228
  );
505
1229
  }
506
1230
  case "header":
@@ -508,67 +1232,44 @@ var Block = (props) => {
508
1232
  case "sub_header":
509
1233
  // fallthrough
510
1234
  case "sub_sub_header": {
511
- if (!block.properties) return null;
512
- const blockColor = (_e = block.format) == null ? void 0 : _e.block_color;
513
- const id = uuidToId2(block.id);
514
- const title = getTextContent(block.properties.title) || `Notion Header ${id}`;
515
- let indentLevel = tocIndentLevelCache[block.id];
516
- let indentLevelClass;
517
- if (indentLevel === void 0) {
518
- const page = getBlockParentPage(block, recordMap);
519
- if (page) {
520
- const toc = getPageTableOfContents(page, recordMap);
521
- const tocItem = toc.find((tocItem2) => tocItem2.id === block.id);
522
- if (tocItem) {
523
- indentLevel = tocItem.indentLevel;
524
- tocIndentLevelCache[block.id] = indentLevel;
525
- }
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);
526
1243
  }
527
1244
  }
528
- if (indentLevel !== void 0) indentLevelClass = `notion-h-indent-${indentLevel}`;
529
- const isH1 = block.type === "header";
530
- const isH2 = block.type === "sub_header";
531
- const isH3 = block.type === "sub_sub_header";
532
- const classNameStr = `${isH1 && "notion-h notion-h1"}
533
- ${isH2 && "notion-h notion-h2"}
534
- ${isH3 && "notion-h notion-h3"}
535
- ${blockColor && `notion-${blockColor}`}
536
- ${indentLevelClass},
537
- ${blockId}`;
538
- const innerHeader = /* @__PURE__ */ React8.createElement("span", null, /* @__PURE__ */ React8.createElement("div", { id, className: "notion-header-anchor" }), !((_f = block.format) == null ? void 0 : _f.toggleable) && /* @__PURE__ */ React8.createElement("a", { className: "notion-hash-link", href: `#${id}`, title }, /* @__PURE__ */ React8.createElement(LinkIcon, null)), /* @__PURE__ */ React8.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })));
539
- let headerBlock = null;
540
- if (isH1)
541
- headerBlock = /* @__PURE__ */ React8.createElement("h2", { className: classNameStr, "data-id": id }, innerHeader);
542
- else if (isH2)
543
- headerBlock = /* @__PURE__ */ React8.createElement("h3", { className: classNameStr, "data-id": id }, innerHeader);
544
- else
545
- headerBlock = /* @__PURE__ */ React8.createElement("h4", { className: classNameStr, "data-id": id }, innerHeader);
546
- if ((_g = block.format) == null ? void 0 : _g.toggleable)
547
- return /* @__PURE__ */ React8.createElement("details", { className: `notion-toggle ${blockId}` }, /* @__PURE__ */ React8.createElement("summary", null, headerBlock), /* @__PURE__ */ React8.createElement("div", null, children));
548
- else return headerBlock;
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;
549
1254
  }
550
1255
  case "divider":
551
- return /* @__PURE__ */ React8.createElement("hr", { className: `notion-hr ${blockId}` });
1256
+ return /* @__PURE__ */ e.createElement("hr", { className: `notion-hr ${k}` });
552
1257
  case "text": {
553
- if (!block.properties && !((_h = block.content) == null ? void 0 : _h.length)) return /* @__PURE__ */ React8.createElement("div", { className: `notion-blank ${blockId}` }, "\xA0");
554
- const blockColor = (_i = block.format) == null ? void 0 : _i.block_color;
555
- return /* @__PURE__ */ React8.createElement("div", { className: `notion-text ${blockColor && `notion-${blockColor}`} ${blockId}` }, ((_j = block.properties) == null ? void 0 : _j.title) && /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block }), children && /* @__PURE__ */ React8.createElement("div", { className: "notion-text-children" }, children));
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));
556
1261
  }
557
1262
  case "bulleted_list":
558
1263
  // fallthrough
559
1264
  case "numbered_list": {
560
- const wrapList = (content, start2) => block.type === "bulleted_list" ? /* @__PURE__ */ React8.createElement("ul", { className: `notion-list notion-list-disc ${blockId}` }, content) : /* @__PURE__ */ React8.createElement("ol", { start: start2, className: `notion-list notion-list-numbered ${blockId}` }, content);
561
- let output = null;
562
- if (block.content)
563
- output = /* @__PURE__ */ React8.createElement(React8.Fragment, null, block.properties && /* @__PURE__ */ React8.createElement("li", null, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })), wrapList(children));
564
- else
565
- output = block.properties ? /* @__PURE__ */ React8.createElement("li", null, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })) : null;
566
- const isTopLevel = block.type !== ((_l = (_k = recordMap.block[block.parent_id]) == null ? void 0 : _k.value) == null ? void 0 : _l.type);
567
- const start = getListNumber(block.id, recordMap.block);
568
- return isTopLevel ? wrapList(output, start) : output;
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;
569
1270
  }
570
1271
  case "embed":
571
- return /* @__PURE__ */ React8.createElement(components.Embed, { blockId, block });
1272
+ return /* @__PURE__ */ e.createElement(a.Embed, { blockId: k, block: n });
572
1273
  case "tweet":
573
1274
  // fallthrough
574
1275
  case "maps":
@@ -588,80 +1289,63 @@ var Block = (props) => {
588
1289
  case "gist":
589
1290
  // fallthrough
590
1291
  case "video":
591
- return /* @__PURE__ */ React8.createElement(AssetWrapper, { blockId, block });
592
- case "drive": {
593
- const properties = (_m = block.format) == null ? void 0 : _m.drive_properties;
594
- if (!properties) {
595
- if ((_n = block.format) == null ? void 0 : _n.display_source)
596
- return /* @__PURE__ */ React8.createElement(AssetWrapper, { blockId, block });
597
- }
598
- return /* @__PURE__ */ React8.createElement(GoogleDrive, { block, className: blockId });
599
- }
1292
+ return /* @__PURE__ */ e.createElement(Me, { blockId: k, block: n });
1293
+ 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 });
600
1295
  case "audio":
601
- return /* @__PURE__ */ React8.createElement(Audio, { block, className: blockId });
1296
+ return /* @__PURE__ */ e.createElement(En, { block: n, className: k });
602
1297
  case "file":
603
- return /* @__PURE__ */ React8.createElement(File, { block, className: blockId });
1298
+ return /* @__PURE__ */ e.createElement(yn, { block: n, className: k });
604
1299
  case "equation":
605
- return /* @__PURE__ */ React8.createElement(components.Equation, { block, inline: false, className: blockId });
1300
+ return /* @__PURE__ */ e.createElement(a.Equation, { block: n, inline: !1, className: k });
606
1301
  case "code":
607
- return /* @__PURE__ */ React8.createElement(components.Code, { block });
1302
+ return /* @__PURE__ */ e.createElement(a.Code, { block: n });
608
1303
  case "column_list":
609
- return /* @__PURE__ */ React8.createElement("div", { className: `notion-row ${blockId}` }, children);
1304
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-row ${k}` }, p);
610
1305
  case "column": {
611
- const spacerWidth = `min(32px, 4vw)`;
612
- const ratio = ((_o = block.format) == null ? void 0 : _o.column_ratio) || 0.5;
613
- const parent = (_p = recordMap.block[block.parent_id]) == null ? void 0 : _p.value;
614
- const columns = ((_q = parent == null ? void 0 : parent.content) == null ? void 0 : _q.length) || Math.max(2, Math.ceil(1 / ratio));
615
- const width = `calc((100% - (${columns - 1} * ${spacerWidth})) * ${ratio})`;
616
- const style = { width };
617
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("div", { className: `notion-column ${blockId}`, style }, children), /* @__PURE__ */ React8.createElement("div", { className: "notion-spacer" }));
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" }));
618
1308
  }
619
1309
  case "quote": {
620
- if (!block.properties) return null;
621
- const blockColor = (_r = block.format) == null ? void 0 : _r.block_color;
622
- return /* @__PURE__ */ React8.createElement("blockquote", { className: `notion-quote ${blockColor && `notion-${blockColor}`} ${blockId}` }, /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })), children);
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);
623
1313
  }
624
1314
  case "collection_view":
625
- return /* @__PURE__ */ React8.createElement(components.Collection, { block, className: blockId, ctx });
1315
+ return /* @__PURE__ */ e.createElement(a.Collection, { block: n, className: k, ctx: o });
626
1316
  case "callout":
627
- if (components.Callout) return /* @__PURE__ */ React8.createElement(components.Callout, { block, className: blockId });
628
- else
629
- return /* @__PURE__ */ React8.createElement(
630
- "div",
631
- {
632
- className: `notion-callout ${((_s = block.format) == null ? void 0 : _s.block_color) && `notion-${(_t = block.format) == null ? void 0 : _t.block_color}_co`} ${blockId}`
633
- },
634
- /* @__PURE__ */ React8.createElement(PageIcon, { block }),
635
- /* @__PURE__ */ React8.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ React8.createElement(Text, { value: (_u = block.properties) == null ? void 0 : _u.title, block }), children)
636
- );
1317
+ return a.Callout ? /* @__PURE__ */ e.createElement(a.Callout, { block: n, className: k }) : /* @__PURE__ */ e.createElement(
1318
+ "div",
1319
+ {
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}`
1321
+ },
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)
1324
+ );
637
1325
  case "bookmark": {
638
- if (!block.properties) return null;
639
- const link = block.properties.link;
640
- if (!link || !((_v = link[0]) == null ? void 0 : _v[0])) return null;
641
- let title = getTextContent(block.properties.title);
642
- if (!title) title = getTextContent(link);
643
- if (title) {
644
- if (title.startsWith("http"))
645
- try {
646
- const url = new URL(title);
647
- title = url.hostname;
648
- } catch (err) {
649
- }
650
- }
651
- return /* @__PURE__ */ React8.createElement("div", { className: "notion-row" }, /* @__PURE__ */ React8.createElement(
652
- components.Link,
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"))
1331
+ try {
1332
+ C = new URL(C).hostname;
1333
+ } catch (S) {
1334
+ }
1335
+ return /* @__PURE__ */ e.createElement("div", { className: "notion-row" }, /* @__PURE__ */ e.createElement(
1336
+ a.Link,
653
1337
  {
654
1338
  target: "_blank",
655
1339
  rel: "noopener noreferrer",
656
- className: `notion-bookmark ${((_w = block.format) == null ? void 0 : _w.block_color) && `notion-${block.format.block_color}`} ${blockId}`,
657
- href: link[0][0]
1340
+ className: `notion-bookmark ${((Ve = n.format) == null ? void 0 : Ve.block_color) && `notion-${n.format.block_color}`} ${k}`,
1341
+ href: b[0][0]
658
1342
  },
659
- /* @__PURE__ */ React8.createElement("div", null, title && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ React8.createElement(Text, { value: [[title]], block })), ((_x = block.properties) == null ? void 0 : _x.description) && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ React8.createElement(Text, { value: (_y = block.properties) == null ? void 0 : _y.description, block })), /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-link" }, ((_z = block.format) == null ? void 0 : _z.bookmark_icon) && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ React8.createElement(LazyImage, { src: mapImageUrl((_A = block.format) == null ? void 0 : _A.bookmark_icon, block), alt: title })), /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ React8.createElement(Text, { value: link, block })))),
660
- ((_B = block.format) == null ? void 0 : _B.bookmark_cover) && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ React8.createElement(
661
- LazyImage,
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,
662
1346
  {
663
- src: mapImageUrl((_C = block.format) == null ? void 0 : _C.bookmark_cover, block),
664
- alt: getTextContent((_D = block.properties) == null ? void 0 : _D.title),
1347
+ src: r((Ae = n.format) == null ? void 0 : Ae.bookmark_cover, n),
1348
+ alt: le((qe = n.properties) == null ? void 0 : qe.title),
665
1349
  style: {
666
1350
  objectFit: "cover"
667
1351
  }
@@ -670,101 +1354,86 @@ var Block = (props) => {
670
1354
  ));
671
1355
  }
672
1356
  case "toggle":
673
- return /* @__PURE__ */ React8.createElement("details", { className: `notion-toggle ${blockId}` }, /* @__PURE__ */ React8.createElement("summary", null, /* @__PURE__ */ React8.createElement(Text, { value: (_E = block.properties) == null ? void 0 : _E.title, block })), /* @__PURE__ */ React8.createElement("div", null, children));
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));
674
1358
  case "table_of_contents": {
675
- const page = getBlockParentPage(block, recordMap);
676
- if (!page) return null;
677
- const toc = getPageTableOfContents(page, recordMap);
678
- const blockColor = (_F = block.format) == null ? void 0 : _F.block_color;
679
- return /* @__PURE__ */ React8.createElement("div", { className: `notion-table-of-contents ${blockColor && `notion-${blockColor}`} ${blockId}` }, toc.map((tocItem) => /* @__PURE__ */ React8.createElement("a", { key: tocItem.id, href: `#${uuidToId2(tocItem.id)}`, className: "notion-table-of-contents-item" }, /* @__PURE__ */ React8.createElement(
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(
680
1363
  "span",
681
1364
  {
682
1365
  className: "notion-table-of-contents-item-body",
683
1366
  style: {
684
1367
  display: "inline-block",
685
- marginLeft: tocItem.indentLevel * 24
1368
+ marginLeft: z.indentLevel * 24
686
1369
  }
687
1370
  },
688
- tocItem.text
1371
+ z.text
689
1372
  ))));
690
1373
  }
691
1374
  case "to_do": {
692
- const isChecked = ((_I = (_H = (_G = block.properties) == null ? void 0 : _G.checked) == null ? void 0 : _H[0]) == null ? void 0 : _I[0]) === "Yes";
693
- return /* @__PURE__ */ React8.createElement("div", { className: `notion-to-do ${blockId}` }, /* @__PURE__ */ React8.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ React8.createElement(components.Checkbox, { blockId, isChecked }), /* @__PURE__ */ React8.createElement("div", { className: `notion-to-do-body ${isChecked && `notion-to-do-checked`}` }, /* @__PURE__ */ React8.createElement(Text, { value: (_J = block.properties) == null ? void 0 : _J.title, block }))), /* @__PURE__ */ React8.createElement("div", { className: "notion-to-do-children" }, children));
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));
694
1377
  }
695
1378
  case "transclusion_container":
696
- return /* @__PURE__ */ React8.createElement("div", { className: `notion-sync-block ${blockId}` }, children);
1379
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-sync-block ${k}` }, p);
697
1380
  case "transclusion_reference":
698
- return /* @__PURE__ */ React8.createElement(SyncPointerBlock, __spreadValues({ block, level: level + 1 }, props));
1381
+ return /* @__PURE__ */ e.createElement(xn, h({ block: n, level: x + 1 }, t));
699
1382
  case "alias": {
700
- const blockPointerId = (_L = (_K = block == null ? void 0 : block.format) == null ? void 0 : _K.alias_pointer) == null ? void 0 : _L.id;
701
- const linkedBlock = (_M = recordMap.block[blockPointerId]) == null ? void 0 : _M.value;
702
- if (!linkedBlock) {
703
- console.debug('"alias" missing block', blockPointerId);
704
- return null;
705
- }
706
- return /* @__PURE__ */ React8.createElement(components.PageLink, { className: `notion-page-link ${blockPointerId}}`, href: mapPageUrl(blockPointerId) }, /* @__PURE__ */ React8.createElement(PageTitle, { block: linkedBlock }));
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);
707
1385
  }
708
1386
  case "table":
709
- return /* @__PURE__ */ React8.createElement("table", { className: `notion-simple-table ${blockId}` }, /* @__PURE__ */ React8.createElement("tbody", null, children));
1387
+ return /* @__PURE__ */ e.createElement("table", { className: `notion-simple-table ${k}` }, /* @__PURE__ */ e.createElement("tbody", null, p));
710
1388
  case "table_row": {
711
- const tableBlock = (_N = recordMap.block[block.parent_id]) == null ? void 0 : _N.value;
712
- const order = (_O = tableBlock.format) == null ? void 0 : _O.table_block_column_order;
713
- const formatMap = (_P = tableBlock.format) == null ? void 0 : _P.table_block_column_format;
714
- const backgroundColor = (_Q = block.format) == null ? void 0 : _Q.block_color;
715
- if (!tableBlock || !order) return null;
716
- return /* @__PURE__ */ React8.createElement("tr", { className: `notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}` }, order.map((column) => {
717
- var _a2, _b2, _c2;
718
- const color = (_a2 = formatMap == null ? void 0 : formatMap[column]) == null ? void 0 : _a2.color;
719
- return /* @__PURE__ */ React8.createElement(
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;
1393
+ return /* @__PURE__ */ e.createElement(
720
1394
  "td",
721
1395
  {
722
- key: column,
723
- className: color ? `notion-${color}` : "",
1396
+ key: j,
1397
+ className: B ? `notion-${B}` : "",
724
1398
  style: {
725
- width: ((_b2 = formatMap == null ? void 0 : formatMap[column]) == null ? void 0 : _b2.width) || 120
1399
+ width: ((Q = S == null ? void 0 : S[j]) == null ? void 0 : Q.width) || 120
726
1400
  }
727
1401
  },
728
- /* @__PURE__ */ React8.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ React8.createElement(Text, { value: ((_c2 = block.properties) == null ? void 0 : _c2[column]) || [["\u3164"]], block }))
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 }))
729
1403
  );
730
1404
  }));
731
1405
  }
732
1406
  case "external_object_instance":
733
- return /* @__PURE__ */ React8.createElement(EOI, { block, className: blockId });
1407
+ return /* @__PURE__ */ e.createElement(yt, { block: n, className: k });
734
1408
  default:
735
- if (true)
736
- console.debug("Unsupported type " + block.type, JSON.stringify(block, null, 2));
737
- return /* @__PURE__ */ React8.createElement("div", null);
1409
+ return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + n.type, JSON.stringify(n, null, 2)), /* @__PURE__ */ e.createElement("div", null);
738
1410
  }
739
- };
740
-
741
- // src/renderer.tsx
742
- var NotionRenderer = (_a) => {
743
- var _b = _a, {
744
- components,
745
- recordMap,
746
- mapPageUrl,
747
- mapImageUrl,
748
- searchNotion,
749
- isShowingSearch,
750
- onHideSearch,
751
- fullPage,
752
- rootPageId,
753
- rootDomain,
754
- rootSpaceId,
755
- darkMode,
756
- previewImages,
757
- forceCustomImages,
758
- showCollectionViewDropdown,
759
- linkTableTitleProperties,
760
- isLinkCollectionToUrlProperty,
761
- isImageZoomable = true,
762
- showTableOfContents,
763
- minTableOfContentsItems,
764
- defaultPageIcon,
765
- defaultPageCover,
766
- defaultPageCoverPosition
767
- } = _b, rest = __objRest(_b, [
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, [
768
1437
  "components",
769
1438
  "recordMap",
770
1439
  "mapPageUrl",
@@ -789,101 +1458,162 @@ var NotionRenderer = (_a) => {
789
1458
  "defaultPageCover",
790
1459
  "defaultPageCoverPosition"
791
1460
  ]);
792
- const zoom = React9.useMemo(
793
- () => typeof window !== "undefined" && mediumZoom({
1461
+ const D = e.useMemo(
1462
+ () => typeof window != "undefined" && xt({
794
1463
  background: "rgba(0, 0, 0, 0.8)",
795
1464
  minZoomScale: 2,
796
- margin: getMediumZoomMargin()
1465
+ margin: In()
797
1466
  }),
798
1467
  []
799
1468
  );
800
- return /* @__PURE__ */ React9.createElement(
801
- NotionContextProvider,
1469
+ return /* @__PURE__ */ e.createElement(
1470
+ kt,
802
1471
  {
803
- components,
804
- recordMap,
805
- mapPageUrl,
806
- mapImageUrl,
807
- searchNotion,
808
- isShowingSearch,
809
- onHideSearch,
810
- fullPage,
811
- rootPageId,
812
- rootDomain,
813
- rootSpaceId,
814
- darkMode,
815
- previewImages,
816
- forceCustomImages,
817
- showCollectionViewDropdown,
818
- linkTableTitleProperties,
819
- isLinkCollectionToUrlProperty,
820
- showTableOfContents,
821
- minTableOfContentsItems,
822
- defaultPageIcon,
823
- defaultPageCover,
824
- defaultPageCoverPosition,
825
- zoom: isImageZoomable ? zoom : null
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
826
1495
  },
827
- /* @__PURE__ */ React9.createElement(NotionBlockRenderer, __spreadValues({}, rest))
1496
+ /* @__PURE__ */ e.createElement(Te, h({}, v))
828
1497
  );
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);
829
1503
  };
830
- var NotionBlockRenderer = (_a) => {
831
- var _b = _a, { level = 0, blockId } = _b, props = __objRest(_b, ["level", "blockId"]);
832
- var _a2, _b2;
833
- const { recordMap } = useNotionContext();
834
- const id = blockId || Object.keys(recordMap.block)[0];
835
- const block = (_a2 = recordMap.block[id]) == null ? void 0 : _a2.value;
836
- if (!block) {
837
- if (true) console.warn("missing block", blockId);
838
- return null;
839
- }
840
- return /* @__PURE__ */ React9.createElement(Block, __spreadValues({ key: id, level, block }, props), (_b2 = block == null ? void 0 : block.content) == null ? void 0 : _b2.map((contentBlockId) => /* @__PURE__ */ React9.createElement(NotionBlockRenderer, __spreadValues({ key: contentBlockId, blockId: contentBlockId, level: level + 1 }, props))));
841
- };
842
- function getMediumZoomMargin() {
843
- const width = window.innerWidth;
844
- if (width < 500) return 8;
845
- else if (width < 800) return 20;
846
- else if (width < 1280) return 30;
847
- else if (width < 1600) return 40;
848
- else if (width < 1920) return 48;
849
- else return 72;
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" }));
850
1555
  }
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));
851
1580
  export {
852
- Asset,
853
- AssetWrapper,
854
- Audio,
855
- Block,
856
- Breadcrumbs,
857
- Checkbox,
858
- CollectionColumnTitle,
859
- EOI,
860
- File,
861
- GoogleDrive,
862
- GracefulImage,
863
- Header,
864
- LiteYouTubeEmbed,
865
- NotionBlockRenderer,
866
- NotionContextConsumer,
867
- NotionContextProvider,
868
- NotionRenderer,
869
- PageAside,
870
- PageIcon,
871
- PageIconImpl,
872
- PageTitle,
873
- PageTitleImpl,
874
- PropertyIcon,
875
- Search,
876
- SearchDialog,
877
- SyncPointerBlock,
878
- Text,
879
- dummyLink,
880
- formatDate,
881
- formatNotionDateTime,
882
- getHashFragmentValue,
883
- getListNumber,
884
- getYoutubeId,
885
- iconMap,
886
- isBrowser,
887
- isUrl,
888
- useNotionContext
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
889
1618
  };
1619
+ //# sourceMappingURL=index.js.map