sanity 3.94.1-next.4.3a875e37ff → 3.94.1

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 (113) hide show
  1. package/dist/BehaviorSubject-CU-WJrzA.mjs +30 -0
  2. package/dist/BehaviorSubject-CU-WJrzA.mjs.map +1 -0
  3. package/dist/BroadcastDisplayedDocument-BSV9T3BU.mjs +20 -0
  4. package/dist/BroadcastDisplayedDocument-BSV9T3BU.mjs.map +1 -0
  5. package/dist/DisplayedDocumentBroadcaster-DZ65n35Q.mjs +62 -0
  6. package/dist/DisplayedDocumentBroadcaster-DZ65n35Q.mjs.map +1 -0
  7. package/dist/LiveQueries-Crz53eU5.mjs +407 -0
  8. package/dist/LiveQueries-Crz53eU5.mjs.map +1 -0
  9. package/dist/Observable-CCQtH8Gg.mjs +546 -0
  10. package/dist/Observable-CCQtH8Gg.mjs.map +1 -0
  11. package/dist/PostMessageDocuments-BjgsJxz4.mjs +72 -0
  12. package/dist/PostMessageDocuments-BjgsJxz4.mjs.map +1 -0
  13. package/dist/PostMessagePerspective-pucY-E6a.mjs +22 -0
  14. package/dist/PostMessagePerspective-pucY-E6a.mjs.map +1 -0
  15. package/dist/PostMessagePreviewSnapshots-CRQgRg4_.mjs +71 -0
  16. package/dist/PostMessagePreviewSnapshots-CRQgRg4_.mjs.map +1 -0
  17. package/dist/PostMessageRefreshMutations-D944RbO3.mjs +66 -0
  18. package/dist/PostMessageRefreshMutations-D944RbO3.mjs.map +1 -0
  19. package/dist/PostMessageSchema-3eOtr1bs.mjs +516 -0
  20. package/dist/PostMessageSchema-3eOtr1bs.mjs.map +1 -0
  21. package/dist/PostMessageTelemetry-DMTQDJeN.mjs +20 -0
  22. package/dist/PostMessageTelemetry-DMTQDJeN.mjs.map +1 -0
  23. package/dist/PresentationToolGrantsCheck-B0q4AQ3b.mjs +3999 -0
  24. package/dist/PresentationToolGrantsCheck-B0q4AQ3b.mjs.map +1 -0
  25. package/dist/QRCodeSVG-hyTW2xeN.mjs +648 -0
  26. package/dist/QRCodeSVG-hyTW2xeN.mjs.map +1 -0
  27. package/dist/Refractor-Zss2QEe8.mjs +2568 -0
  28. package/dist/Refractor-Zss2QEe8.mjs.map +1 -0
  29. package/dist/SourceContext-QxJD1Wrm.mjs +111 -0
  30. package/dist/SourceContext-QxJD1Wrm.mjs.map +1 -0
  31. package/dist/StructureToolProvider-B-7cwz7l.mjs +2287 -0
  32. package/dist/StructureToolProvider-B-7cwz7l.mjs.map +1 -0
  33. package/dist/ViteDevServerStopped-CgIEqy9p.mjs +57 -0
  34. package/dist/ViteDevServerStopped-CgIEqy9p.mjs.map +1 -0
  35. package/dist/_createContext.mjs +38 -0
  36. package/dist/_createContext.mjs.map +1 -0
  37. package/dist/_singletons.mjs +216 -0
  38. package/dist/_singletons.mjs.map +1 -0
  39. package/dist/browser-B0Q9qZJS.mjs +478 -0
  40. package/dist/browser-B0Q9qZJS.mjs.map +1 -0
  41. package/dist/browser-DmX5VEcE.mjs +324 -0
  42. package/dist/browser-DmX5VEcE.mjs.map +1 -0
  43. package/dist/desk.mjs +53 -0
  44. package/dist/desk.mjs.map +1 -0
  45. package/dist/first-Cz545eV-.mjs +42 -0
  46. package/dist/first-Cz545eV-.mjs.map +1 -0
  47. package/dist/index-B2GCDfau.mjs +96 -0
  48. package/dist/index-B2GCDfau.mjs.map +1 -0
  49. package/dist/index-BRIelBPK.mjs +6946 -0
  50. package/dist/index-BRIelBPK.mjs.map +1 -0
  51. package/dist/index-BUB137yJ.mjs +144 -0
  52. package/dist/index-BUB137yJ.mjs.map +1 -0
  53. package/dist/index-C3PGPrdL.mjs +1192 -0
  54. package/dist/index-C3PGPrdL.mjs.map +1 -0
  55. package/dist/index-C9NvTy6s.mjs +319 -0
  56. package/dist/index-C9NvTy6s.mjs.map +1 -0
  57. package/dist/index-DCkQlgdi.mjs +4001 -0
  58. package/dist/index-DCkQlgdi.mjs.map +1 -0
  59. package/dist/index-DG-3plB0.mjs +71 -0
  60. package/dist/index-DG-3plB0.mjs.map +1 -0
  61. package/dist/index-RoxwhtVB.mjs +5600 -0
  62. package/dist/index-RoxwhtVB.mjs.map +1 -0
  63. package/dist/index-iMZR29eF.mjs +756 -0
  64. package/dist/index-iMZR29eF.mjs.map +1 -0
  65. package/dist/index-wVXq9rWS.mjs +244 -0
  66. package/dist/index-wVXq9rWS.mjs.map +1 -0
  67. package/dist/index.mjs +137385 -0
  68. package/dist/index.mjs.map +1 -0
  69. package/dist/lodash-Vz5dH_Dm.mjs +3679 -0
  70. package/dist/lodash-Vz5dH_Dm.mjs.map +1 -0
  71. package/dist/pane-Bm_57XKB.mjs +5 -0
  72. package/dist/pane-Bm_57XKB.mjs.map +1 -0
  73. package/dist/pane-Dopl4BjD.mjs +5 -0
  74. package/dist/pane-Dopl4BjD.mjs.map +1 -0
  75. package/dist/presentation-DsIky7Cj.mjs +556 -0
  76. package/dist/presentation-DsIky7Cj.mjs.map +1 -0
  77. package/dist/presentation.mjs +10 -0
  78. package/dist/presentation.mjs.map +1 -0
  79. package/dist/publishReplay-PuJoYJpp.mjs +92 -0
  80. package/dist/publishReplay-PuJoYJpp.mjs.map +1 -0
  81. package/dist/refractor-Bg1S3YDK.mjs +26 -0
  82. package/dist/refractor-Bg1S3YDK.mjs.map +1 -0
  83. package/dist/resources-BQsCEzu1.mjs +60 -0
  84. package/dist/resources-BQsCEzu1.mjs.map +1 -0
  85. package/dist/resources-BahMtJuO.mjs +177 -0
  86. package/dist/resources-BahMtJuO.mjs.map +1 -0
  87. package/dist/resources-CjkBN4z6.mjs +126 -0
  88. package/dist/resources-CjkBN4z6.mjs.map +1 -0
  89. package/dist/resources-Dc-6ZcPg.mjs +157 -0
  90. package/dist/resources-Dc-6ZcPg.mjs.map +1 -0
  91. package/dist/resources-DqxSuDsr.mjs +37 -0
  92. package/dist/resources-DqxSuDsr.mjs.map +1 -0
  93. package/dist/resources-_gTjFWLH.mjs +517 -0
  94. package/dist/resources-_gTjFWLH.mjs.map +1 -0
  95. package/dist/resources-kA1bao30.mjs +358 -0
  96. package/dist/resources-kA1bao30.mjs.map +1 -0
  97. package/dist/router.mjs +721 -0
  98. package/dist/router.mjs.map +1 -0
  99. package/dist/stegaEncodeSourceMap-DCG9Ba1H.mjs +358 -0
  100. package/dist/stegaEncodeSourceMap-DCG9Ba1H.mjs.map +1 -0
  101. package/dist/structure.mjs +57 -0
  102. package/dist/structure.mjs.map +1 -0
  103. package/dist/structureTool-Bth1vd8r.mjs +13150 -0
  104. package/dist/structureTool-Bth1vd8r.mjs.map +1 -0
  105. package/dist/switchMap-DHVUskpL.mjs +54 -0
  106. package/dist/switchMap-DHVUskpL.mjs.map +1 -0
  107. package/dist/v4-zH-CAum7.mjs +24798 -0
  108. package/dist/v4-zH-CAum7.mjs.map +1 -0
  109. package/dist/version-DoE_JnhG.mjs +5 -0
  110. package/dist/version-DoE_JnhG.mjs.map +1 -0
  111. package/lib/_chunks-cjs/version.js +1 -1
  112. package/lib/_chunks-es/version.mjs +1 -1
  113. package/package.json +23 -23
@@ -0,0 +1,1192 @@
1
+ var qe = Object.defineProperty;
2
+ var Ue = (r, e, n) => e in r ? qe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
+ var re = (r, e, n) => Ue(r, typeof e != "symbol" ? e + "" : e, n);
4
+ import { jsx as g, jsxs as M } from "react/jsx-runtime";
5
+ import { d as k } from "./index-C9NvTy6s.mjs";
6
+ import { forwardRef as ge, useContext as Ne, useState as J, useEffect as V, memo as Pe, lazy as se, Suspense as Je, Fragment as Ye } from "react";
7
+ import { useUnique as Re, isRecord as Ie, useDocumentStore as Qe, useTranslation as ce, Translate as ke, usePerspective as Xe, useEditState as Ze, useSchema as Me, unstable_useValuePreview as et, _isCustomDocumentTypeDefinition as tt, useWorkspace as nt, SourceProvider as rt } from "sanity";
8
+ import { m as st, B as ot, i as de, L as X, l as at, a as it, P as lt, o as xe, b as ct, p as we } from "./structureTool-Bth1vd8r.mjs";
9
+ import { s as ue, S as me, A as dt } from "./StructureToolProvider-B-7cwz7l.mjs";
10
+ import { n as ut, l as Oe, o as pt, q as Be, R as ft, B as mt, u as ht } from "./index-RoxwhtVB.mjs";
11
+ import { o as yt, c as gt, j as Pt, q as It, g as oe, m as U, v as xt, S as ye, T as B, s as Te, B as ie, H as wt, t as vt, C as le, a as Ae, W as bt, F as Ce, w as St, x as $t, P as _t } from "./v4-zH-CAum7.mjs";
12
+ import { styled as Ve } from "styled-components";
13
+ import { t as We, s as Rt, a as Ee, d as kt, i as Tt } from "./index-BRIelBPK.mjs";
14
+ import { StateLink as Ge, useRouter as ve, useRouterState as be } from "sanity/router";
15
+ import { l as Z } from "./lodash-Vz5dH_Dm.mjs";
16
+ import { s as Se, N as Ct } from "./switchMap-DHVUskpL.mjs";
17
+ import { p as Et, r as Dt } from "./publishReplay-PuJoYJpp.mjs";
18
+ import { PaneRouterContext as $e } from "sanity/_singletons";
19
+ function Lt() {
20
+ return yt(function(r, e) {
21
+ var n, t = !1;
22
+ r.subscribe(gt(e, function(a) {
23
+ var o = n;
24
+ n = a, t && e.next([o, a]), t = !0;
25
+ }));
26
+ });
27
+ }
28
+ const He = ge(function(e, n) {
29
+ const t = k.c(19);
30
+ let a, o, i, s;
31
+ t[0] !== e ? ({
32
+ childId: a,
33
+ childPayload: i,
34
+ childParameters: o,
35
+ ...s
36
+ } = e, t[0] = e, t[1] = a, t[2] = o, t[3] = i, t[4] = s) : (a = t[1], o = t[2], i = t[3], s = t[4]);
37
+ const {
38
+ routerPanesState: c,
39
+ groupIndex: l
40
+ } = Ne($e);
41
+ let d;
42
+ if (t[5] !== a || t[6] !== o || t[7] !== i || t[8] !== l || t[9] !== c) {
43
+ let f;
44
+ t[11] !== a || t[12] !== o || t[13] !== i ? (f = [{
45
+ id: a,
46
+ params: o,
47
+ payload: i
48
+ }], t[11] = a, t[12] = o, t[13] = i, t[14] = f) : f = t[14], d = {
49
+ panes: [...c.slice(0, l + 1), f]
50
+ }, t[5] = a, t[6] = o, t[7] = i, t[8] = l, t[9] = c, t[10] = d;
51
+ } else
52
+ d = t[10];
53
+ let u;
54
+ return t[15] !== n || t[16] !== s || t[17] !== d ? (u = /* @__PURE__ */ g(Ge, { ...s, ref: n, state: d }), t[15] = n, t[16] = s, t[17] = d, t[18] = u) : u = t[18], u;
55
+ }), zt = ge(function(e, n) {
56
+ const t = k.c(22), {
57
+ routerPanesState: a,
58
+ groupIndex: o,
59
+ siblingIndex: i
60
+ } = Ne($e);
61
+ let s, c, l;
62
+ t[0] !== e ? ({
63
+ params: s,
64
+ payload: c,
65
+ ...l
66
+ } = e, t[0] = e, t[1] = s, t[2] = c, t[3] = l) : (s = t[1], c = t[2], l = t[3]);
67
+ const d = Re(s), u = Re(c);
68
+ let f;
69
+ const p = a[o], m = p[i], h = d ?? m.params, I = u ?? m.payload;
70
+ let x;
71
+ t[4] !== m || t[5] !== h || t[6] !== I ? (x = {
72
+ ...m,
73
+ params: h,
74
+ payload: I
75
+ }, t[4] = m, t[5] = h, t[6] = I, t[7] = x) : x = t[7];
76
+ const y = x;
77
+ let w;
78
+ t[8] !== p || t[9] !== y || t[10] !== i ? (w = [...p.slice(0, i), y, ...p.slice(i + 1)], t[8] = p, t[9] = y, t[10] = i, t[11] = w) : w = t[11];
79
+ const v = w;
80
+ let $;
81
+ t[12] !== a || t[13] !== o || t[14] !== v ? ($ = [...a.slice(0, o), v, ...a.slice(o + 1)], t[12] = a, t[13] = o, t[14] = v, t[15] = $) : $ = t[15];
82
+ const P = $;
83
+ let _;
84
+ t[16] !== P ? (_ = {
85
+ panes: P
86
+ }, t[16] = P, t[17] = _) : _ = t[17], f = _;
87
+ const R = f;
88
+ let T;
89
+ return t[18] !== R || t[19] !== n || t[20] !== l ? (T = /* @__PURE__ */ g(Ge, { ref: n, ...l, state: R }), t[18] = R, t[19] = n, t[20] = l, t[21] = T) : T = t[21], T;
90
+ }), Nt = ge(function(e, n) {
91
+ const t = k.c(22);
92
+ let a, o, i, s, c, l;
93
+ t[0] !== e ? ({
94
+ documentId: o,
95
+ documentType: i,
96
+ parentRefPath: s,
97
+ children: a,
98
+ template: l,
99
+ ...c
100
+ } = e, t[0] = e, t[1] = a, t[2] = o, t[3] = i, t[4] = s, t[5] = c, t[6] = l) : (a = t[1], o = t[2], i = t[3], s = t[4], c = t[5], l = t[6]);
101
+ const d = l == null ? void 0 : l.params;
102
+ let u;
103
+ t[7] !== s ? (u = We(s), t[7] = s, t[8] = u) : u = t[8];
104
+ let f;
105
+ t[9] !== l ? (f = l && {
106
+ template: l == null ? void 0 : l.id
107
+ }, t[9] = l, t[10] = f) : f = t[10];
108
+ let p;
109
+ t[11] !== i || t[12] !== u || t[13] !== f ? (p = {
110
+ type: i,
111
+ parentRefPath: u,
112
+ ...f
113
+ }, t[11] = i, t[12] = u, t[13] = f, t[14] = p) : p = t[14];
114
+ let m;
115
+ return t[15] !== a || t[16] !== o || t[17] !== n || t[18] !== c || t[19] !== d || t[20] !== p ? (m = /* @__PURE__ */ g(He, { ...c, ref: n, childId: o, childPayload: d, childParameters: p, children: a }), t[15] = a, t[16] = o, t[17] = n, t[18] = c, t[19] = d, t[20] = p, t[21] = m) : m = t[21], m;
116
+ }), Mt = [];
117
+ function Ot(r) {
118
+ const e = k.c(60), {
119
+ children: n,
120
+ flatIndex: t,
121
+ index: a,
122
+ params: o,
123
+ payload: i,
124
+ siblingIndex: s
125
+ } = r, {
126
+ navigate: c,
127
+ navigateIntent: l,
128
+ resolvePathFromState: d
129
+ } = ve(), u = be(), {
130
+ panes: f,
131
+ expand: p
132
+ } = st();
133
+ u == null || u.panes;
134
+ let m;
135
+ m = (u == null ? void 0 : u.panes) || Mt;
136
+ const h = m;
137
+ let I;
138
+ I = f == null ? void 0 : f[f.length - 2];
139
+ const x = I, y = a - 1;
140
+ let w;
141
+ e[0] !== y || e[1] !== h || e[2] !== u || e[3] !== s ? (w = (b) => {
142
+ const S = h[y] || [], C = S[s], G = b(S, C), ne = [...h.slice(0, y), G, ...h.slice(y + 1)];
143
+ return {
144
+ ...u,
145
+ panes: ne
146
+ };
147
+ }, e[0] = y, e[1] = h, e[2] = u, e[3] = s, e[4] = w) : w = e[4];
148
+ const v = w;
149
+ let $;
150
+ e[5] !== v || e[6] !== c ? ($ = (b) => {
151
+ const S = v(b);
152
+ return setTimeout(() => c(S), 0), S;
153
+ }, e[5] = v, e[6] = c, e[7] = $) : $ = e[7];
154
+ const P = $;
155
+ let _;
156
+ e[8] !== v || e[9] !== d || e[10] !== s ? (_ = (b) => {
157
+ const S = v((C, G) => [...C.slice(0, s), {
158
+ ...G,
159
+ params: b
160
+ }, ...C.slice(s + 1)]);
161
+ return d(S);
162
+ }, e[8] = v, e[9] = d, e[10] = s, e[11] = _) : _ = e[11];
163
+ const R = _;
164
+ let T;
165
+ e[12] !== P || e[13] !== s ? (T = (b) => {
166
+ P((S, C) => [...S.slice(0, s), {
167
+ ...C,
168
+ payload: b
169
+ }, ...S.slice(s + 1)]);
170
+ }, e[12] = P, e[13] = s, e[14] = T) : T = e[14];
171
+ const Q = T;
172
+ let D;
173
+ e[15] !== P || e[16] !== s ? (D = (b) => {
174
+ P((S, C) => [...S.slice(0, s), {
175
+ ...C,
176
+ params: b
177
+ }, ...S.slice(s + 1)]);
178
+ }, e[15] = P, e[16] = s, e[17] = D) : D = e[17];
179
+ const E = D;
180
+ let L;
181
+ e[18] !== y || e[19] !== c || e[20] !== h ? (L = (b) => {
182
+ const {
183
+ id: S,
184
+ parentRefPath: C,
185
+ type: G,
186
+ template: ne,
187
+ version: _e
188
+ } = b;
189
+ c({
190
+ panes: [...h.slice(0, y + 1), [{
191
+ id: S,
192
+ params: {
193
+ template: ne.id,
194
+ parentRefPath: We(C),
195
+ type: G,
196
+ version: _e
197
+ },
198
+ payload: ne.params
199
+ }]]
200
+ });
201
+ }, e[18] = y, e[19] = c, e[20] = h, e[21] = L) : L = e[21];
202
+ const N = L;
203
+ let W;
204
+ const A = h[y] ? h[y].length > 1 : !1, H = h[y] ? h[y].length : 0, z = t ? ot : void 0;
205
+ let O, K;
206
+ e[22] !== P ? (O = (b) => {
207
+ const S = b === void 0 ? {} : b;
208
+ P(() => [{
209
+ id: S.id || "",
210
+ payload: S.payload,
211
+ params: S.params || {}
212
+ }]);
213
+ }, K = () => {
214
+ P(Bt);
215
+ }, e[22] = P, e[23] = O, e[24] = K) : (O = e[23], K = e[24]);
216
+ let F;
217
+ e[25] !== p || e[26] !== y || e[27] !== x || e[28] !== c || e[29] !== h ? (F = (b) => {
218
+ (b === void 0 ? !0 : b) && x && p(x.element), c({
219
+ panes: h.slice(0, y)
220
+ });
221
+ }, e[25] = p, e[26] = y, e[27] = x, e[28] = c, e[29] = h, e[30] = F) : F = e[30];
222
+ let j;
223
+ e[31] !== P || e[32] !== s ? (j = (b) => {
224
+ P((S, C) => {
225
+ const G = {
226
+ ...C,
227
+ payload: (b == null ? void 0 : b.payload) || C.payload,
228
+ params: (b == null ? void 0 : b.params) || C.params
229
+ };
230
+ return [...S.slice(0, s), G, ...S.slice(s)];
231
+ });
232
+ }, e[31] = P, e[32] = s, e[33] = j) : j = e[33];
233
+ let q;
234
+ e[34] !== o || e[35] !== E ? (q = (b) => {
235
+ const S = Z.omit(o, "view");
236
+ return E(b ? {
237
+ ...S,
238
+ view: b
239
+ } : S);
240
+ }, e[34] = o, e[35] = E, e[36] = q) : q = e[36];
241
+ let ee;
242
+ e[37] !== R || e[38] !== t || e[39] !== y || e[40] !== N || e[41] !== l || e[42] !== o || e[43] !== i || e[44] !== h || e[45] !== E || e[46] !== Q || e[47] !== s || e[48] !== H || e[49] !== z || e[50] !== O || e[51] !== K || e[52] !== F || e[53] !== j || e[54] !== q || e[55] !== A ? (ee = {
243
+ index: t,
244
+ groupIndex: y,
245
+ siblingIndex: s,
246
+ payload: i,
247
+ params: o,
248
+ hasGroupSiblings: A,
249
+ groupLength: H,
250
+ routerPanesState: h,
251
+ ChildLink: He,
252
+ BackLink: z,
253
+ ReferenceChildLink: Nt,
254
+ handleEditReference: N,
255
+ ParameterizedLink: zt,
256
+ replaceCurrent: O,
257
+ closeCurrent: K,
258
+ closeCurrentAndAfter: F,
259
+ duplicateCurrent: j,
260
+ setView: q,
261
+ setParams: E,
262
+ setPayload: Q,
263
+ createPathWithParams: R,
264
+ navigateIntent: l
265
+ }, e[37] = R, e[38] = t, e[39] = y, e[40] = N, e[41] = l, e[42] = o, e[43] = i, e[44] = h, e[45] = E, e[46] = Q, e[47] = s, e[48] = H, e[49] = z, e[50] = O, e[51] = K, e[52] = F, e[53] = j, e[54] = q, e[55] = A, e[56] = ee) : ee = e[56], W = ee;
266
+ const fe = W;
267
+ let te;
268
+ return e[57] !== n || e[58] !== fe ? (te = /* @__PURE__ */ g($e.Provider, { value: fe, children: n }), e[57] = n, e[58] = fe, e[59] = te) : te = e[59], te;
269
+ }
270
+ function Bt(r, e) {
271
+ return r.length > 1 ? r.filter((n) => n !== e) : r;
272
+ }
273
+ class Y extends Error {
274
+ constructor({
275
+ message: n,
276
+ context: t,
277
+ helpId: a,
278
+ cause: o
279
+ }) {
280
+ super(n);
281
+ re(this, "cause");
282
+ re(this, "context");
283
+ re(this, "helpId");
284
+ this.name = "PaneResolutionError", this.context = t, this.helpId = a, this.cause = o;
285
+ }
286
+ }
287
+ const De = /* @__PURE__ */ new WeakMap();
288
+ function pe(r) {
289
+ const e = De.get(r);
290
+ if (e) return e;
291
+ const n = ut();
292
+ return De.set(r, n), n;
293
+ }
294
+ const At = (r) => !!r && typeof (r == null ? void 0 : r.then) == "function", Vt = (r) => Ie(r) ? typeof r.serialize == "function" : !1, Wt = (r) => (e, n, t) => {
295
+ try {
296
+ return r(e, n, t);
297
+ } catch (a) {
298
+ throw a instanceof Y ? a : new Y({
299
+ message: typeof (a == null ? void 0 : a.message) == "string" ? a.message : "",
300
+ context: n,
301
+ cause: a
302
+ });
303
+ }
304
+ }, Gt = (r) => (...e) => r(...e).pipe(
305
+ // need to add publishReplay + refCount to ensure new subscribers always
306
+ // get an emission. without this, memoized observables may get stuck
307
+ // waiting for their first emissions resulting in a loading pane
308
+ Et(1),
309
+ Dt()
310
+ );
311
+ function Ke(r) {
312
+ const e = Wt(Gt(r((n, t, a) => {
313
+ if (!n)
314
+ throw new Y({
315
+ message: "Pane returned no child",
316
+ context: t,
317
+ helpId: "structure-item-returned-no-child"
318
+ });
319
+ return At(n) || Pt(n) ? It(n).pipe(Se((o) => e(o, t, a))) : Vt(n) ? e(n.serialize(t), t, a) : typeof n == "function" ? e(n(t.id, t), t, a) : oe(n);
320
+ })));
321
+ return e;
322
+ }
323
+ const Le = /* @__PURE__ */ new WeakMap();
324
+ function Fe(r, e) {
325
+ const n = Le.get(r) || /* @__PURE__ */ new Map();
326
+ if (n) {
327
+ const o = n.get(e);
328
+ if (o) return o;
329
+ }
330
+ const t = r[e];
331
+ if (typeof t != "function")
332
+ throw new Error(`Expected property \`${e}\` to be a function but got ${typeof t} instead.`);
333
+ const a = t.bind(r);
334
+ return n.set(e, a), Le.set(r, n), a;
335
+ }
336
+ async function Ht(r) {
337
+ const e = /* @__PURE__ */ new Map(), t = Ke((c) => (l, d, u) => {
338
+ const f = l && `${pe(l)}-${d.path.join("__")}`, p = f && e.get(f);
339
+ if (p) return p;
340
+ const m = c(l, d, u);
341
+ return f && e.set(f, m), m;
342
+ }), a = [[{
343
+ id: `__edit__${r.params.id}`,
344
+ params: {
345
+ ...Z.omit(r.params, ["id"]),
346
+ type: r.params.type
347
+ },
348
+ payload: r.payload
349
+ }]];
350
+ async function o({
351
+ currentId: c,
352
+ flatIndex: l,
353
+ intent: d,
354
+ params: u,
355
+ parent: f,
356
+ path: p,
357
+ payload: m,
358
+ unresolvedPane: h,
359
+ levelIndex: I,
360
+ structureContext: x
361
+ }) {
362
+ var _;
363
+ if (!h) return [];
364
+ const {
365
+ id: y,
366
+ type: w,
367
+ ...v
368
+ } = u, P = await Oe(t(h, {
369
+ id: c,
370
+ splitIndex: 0,
371
+ parent: f,
372
+ path: p,
373
+ index: l,
374
+ params: {},
375
+ payload: void 0,
376
+ structureContext: x
377
+ }, l));
378
+ return P.type === "document" && P.id === y ? [{
379
+ panes: [...p.slice(0, p.length - 1).map((R) => [{
380
+ id: R
381
+ }]), [{
382
+ id: y,
383
+ params: v,
384
+ payload: m
385
+ }]],
386
+ depthIndex: p.length,
387
+ levelIndex: I
388
+ }] : (
389
+ // if the resolve pane's `canHandleIntent` returns true, then resolve
390
+ (_ = P.canHandleIntent) != null && _.call(P, d, u, {
391
+ pane: P,
392
+ index: l
393
+ }) || // if the pane's `canHandleIntent` did not return true, then match against
394
+ // this default case. we will resolve the intent if:
395
+ P.type === "documentList" && // 1. the schema type matches (this required for the document to render)
396
+ P.schemaTypeName === w && // 2. the filter is the default filter.
397
+ //
398
+ // NOTE: this case is to prevent false positive matches where the user
399
+ // has configured a more specific filter for a particular type. In that
400
+ // case, the user can implement their own `canHandleIntent` function
401
+ P.options.filter === "_type == $type" ? [{
402
+ panes: [
403
+ // map the current path to router panes
404
+ ...p.map((R) => [{
405
+ id: R
406
+ }]),
407
+ // then augment with the intents IDs and params
408
+ [{
409
+ id: u.id,
410
+ params: v,
411
+ payload: m
412
+ }]
413
+ ],
414
+ depthIndex: p.length,
415
+ levelIndex: I
416
+ }] : P.type === "list" && P.child && P.items ? (await Promise.all(P.items.map((R, T) => R.type === "divider" ? Promise.resolve([]) : o({
417
+ currentId: R._id || R.id,
418
+ flatIndex: l + 1,
419
+ intent: d,
420
+ params: u,
421
+ parent: P,
422
+ path: [...p, R.id],
423
+ payload: m,
424
+ unresolvedPane: typeof P.child == "function" ? Fe(P, "child") : P.child,
425
+ levelIndex: T,
426
+ structureContext: x
427
+ })))).flat() : []
428
+ );
429
+ }
430
+ const s = (await o({
431
+ currentId: "root",
432
+ flatIndex: 0,
433
+ levelIndex: 0,
434
+ intent: r.intent,
435
+ params: r.params,
436
+ parent: null,
437
+ path: [],
438
+ payload: r.payload,
439
+ unresolvedPane: r.rootPaneNode,
440
+ structureContext: r.structureContext
441
+ })).sort((c, l) => c.depthIndex === l.depthIndex ? c.levelIndex - l.levelIndex : c.depthIndex - l.depthIndex)[0];
442
+ return s ? s.panes : a;
443
+ }
444
+ const Kt = (r, e) => {
445
+ const n = r.replace(/^__edit__/, ""), {
446
+ params: t,
447
+ payload: a,
448
+ structureContext: {
449
+ resolveDocumentNode: o
450
+ }
451
+ } = e, {
452
+ type: i,
453
+ template: s
454
+ } = t;
455
+ if (!i)
456
+ throw new Error(`Document type for document with ID ${n} was not provided in the router params.`);
457
+ let c = o({
458
+ schemaType: i,
459
+ documentId: n
460
+ }).id("editor");
461
+ return s && (c = c.initialValueTemplate(s, a)), c.serialize();
462
+ };
463
+ function Ft(r) {
464
+ var e, n;
465
+ return `contextHash(${JSON.stringify({
466
+ id: r.id,
467
+ parentId: parent && pe(parent),
468
+ path: r.path,
469
+ index: r.index,
470
+ splitIndex: r.splitIndex,
471
+ serializeOptionsIndex: (e = r.serializeOptions) == null ? void 0 : e.index,
472
+ serializeOptionsPath: (n = r.serializeOptions) == null ? void 0 : n.path
473
+ })})`;
474
+ }
475
+ const ze = (r) => {
476
+ const e = {
477
+ type: r.type,
478
+ id: r.routerPaneSibling.id,
479
+ params: r.routerPaneSibling.params || {},
480
+ payload: r.routerPaneSibling.payload || null,
481
+ flatIndex: r.flatIndex,
482
+ groupIndex: r.groupIndex,
483
+ siblingIndex: r.siblingIndex,
484
+ path: r.path,
485
+ paneNode: r.type === "resolvedMeta" ? pe(r.paneNode) : null
486
+ };
487
+ return `metaHash(${JSON.stringify(e)})`;
488
+ };
489
+ function ae({
490
+ unresolvedPane: r,
491
+ flattenedRouterPanes: e,
492
+ parent: n,
493
+ path: t,
494
+ resolvePane: a,
495
+ structureContext: o
496
+ }) {
497
+ const [i, ...s] = e, c = s[0], l = {
498
+ id: i.routerPaneSibling.id,
499
+ splitIndex: i.siblingIndex,
500
+ parent: n,
501
+ path: [...t, i.routerPaneSibling.id],
502
+ index: i.flatIndex,
503
+ params: i.routerPaneSibling.params || {},
504
+ payload: i.routerPaneSibling.payload,
505
+ structureContext: o
506
+ };
507
+ try {
508
+ return a(r, l, i.flatIndex).pipe(
509
+ // this switch map receives a resolved pane
510
+ Se((d) => {
511
+ const u = {
512
+ type: "resolvedMeta",
513
+ ...i,
514
+ paneNode: d,
515
+ path: l.path
516
+ }, f = s.map((m, h) => ({
517
+ type: "loading",
518
+ path: [...l.path, ...s.slice(h).map((y, w) => `[${m.flatIndex + w}]`)],
519
+ paneNode: null,
520
+ ...m
521
+ }));
522
+ if (!s.length)
523
+ return oe([u]);
524
+ let p;
525
+ return /* the fallback editor case */ c != null && c.routerPaneSibling.id.startsWith("__edit__") ? p = ae({
526
+ unresolvedPane: Kt,
527
+ flattenedRouterPanes: s,
528
+ parent: n,
529
+ path: l.path,
530
+ resolvePane: a,
531
+ structureContext: o
532
+ }) : i.groupIndex === (c == null ? void 0 : c.groupIndex) ? p = ae({
533
+ unresolvedPane: r,
534
+ flattenedRouterPanes: s,
535
+ parent: n,
536
+ path: t,
537
+ resolvePane: a,
538
+ structureContext: o
539
+ }) : p = ae({
540
+ unresolvedPane: typeof d.child == "function" ? Fe(d, "child") : d.child,
541
+ flattenedRouterPanes: s,
542
+ parent: d,
543
+ path: l.path,
544
+ resolvePane: a,
545
+ structureContext: o
546
+ }), pt(
547
+ // we emit the loading panes first in a concat (this emits immediately)
548
+ oe([u, ...f]),
549
+ // then whenever the next stream is done, the results will be combined.
550
+ p.pipe(U((m) => [u, ...m]))
551
+ );
552
+ })
553
+ );
554
+ } catch (d) {
555
+ if (d instanceof Y && (d.context && console.warn(`Pane resolution error at index ${d.context.index}${d.context.splitIndex > 0 ? ` for split pane index ${d.context.splitIndex}` : ""}: ${d.message}${d.helpId ? ` - see ${Be(d.helpId)}` : ""}`, d), d.helpId === "structure-item-returned-no-child"))
556
+ return oe([]);
557
+ throw d;
558
+ }
559
+ }
560
+ function jt({
561
+ routerPanesStream: r,
562
+ rootPaneNode: e,
563
+ initialCacheState: n = {
564
+ cacheKeysByFlatIndex: [],
565
+ flattenedRouterPanes: [],
566
+ resolvedPaneCache: /* @__PURE__ */ new Map(),
567
+ resolvePane: () => Ct
568
+ },
569
+ structureContext: t
570
+ }) {
571
+ return r.pipe(
572
+ // add in implicit "root" router pane
573
+ U((o) => [[{
574
+ id: "root"
575
+ }], ...o]),
576
+ // create flattened router panes
577
+ U((o) => o.flatMap((s, c) => s.map((l, d) => ({
578
+ routerPaneSibling: l,
579
+ groupIndex: c,
580
+ siblingIndex: d
581
+ }))).map((s, c) => ({
582
+ ...s,
583
+ flatIndex: c
584
+ }))),
585
+ // calculate a "diffIndex" used for clearing the memo cache
586
+ Rt([]),
587
+ Lt(),
588
+ U(([o, i]) => {
589
+ for (let s = 0; s < i.length; s++) {
590
+ const c = o[s], l = i[s];
591
+ if (!Z.isEqual(c, l))
592
+ return {
593
+ flattenedRouterPanes: i,
594
+ diffIndex: s
595
+ };
596
+ }
597
+ return {
598
+ flattenedRouterPanes: i,
599
+ diffIndex: i.length
600
+ };
601
+ }),
602
+ // create the memoized `resolvePane` function and manage the memo cache
603
+ Ee((o, i) => {
604
+ const {
605
+ cacheKeysByFlatIndex: s,
606
+ resolvedPaneCache: c
607
+ } = o, {
608
+ flattenedRouterPanes: l,
609
+ diffIndex: d
610
+ } = i, u = s.slice(0, d + 1), f = s.slice(d + 1), p = new Set(u.flatMap((I) => Array.from(I))), m = f.flatMap((I) => Array.from(I)).filter((I) => !p.has(I));
611
+ for (const I of m)
612
+ c.delete(I);
613
+ return {
614
+ flattenedRouterPanes: l,
615
+ cacheKeysByFlatIndex: s,
616
+ resolvedPaneCache: c,
617
+ resolvePane: Ke((I) => (x, y, w) => {
618
+ const v = x && `${pe(x)}-${Ft(y)}`, $ = v && c.get(v);
619
+ if ($) return $;
620
+ const P = I(x, y, w);
621
+ if (!v) return P;
622
+ const _ = s[w] || /* @__PURE__ */ new Set();
623
+ return _.add(v), s[w] = _, c.set(v, P), P;
624
+ })
625
+ };
626
+ }, n),
627
+ // run the memoized, recursive resolving
628
+ Se(({
629
+ flattenedRouterPanes: o,
630
+ resolvePane: i
631
+ }) => ae({
632
+ unresolvedPane: e,
633
+ flattenedRouterPanes: o,
634
+ parent: null,
635
+ path: [],
636
+ resolvePane: i,
637
+ structureContext: t
638
+ }))
639
+ ).pipe(
640
+ // this diffs the previous emission with the current one. if there is a new
641
+ // loading pane at the same position where a previous pane already had a
642
+ // resolved value (looking at the IDs to compare), then return the previous
643
+ // pane instead of the loading pane
644
+ Ee((o, i) => i.map((s, c) => {
645
+ const l = o[c];
646
+ return !l || s.type !== "loading" ? s : l.routerPaneSibling.id === s.routerPaneSibling.id ? l : s;
647
+ }), []),
648
+ // this prevents duplicate emissions
649
+ kt((o, i) => {
650
+ if (o.length !== i.length) return !1;
651
+ for (let s = 0; s < i.length; s++) {
652
+ const c = o[s], l = i[s];
653
+ if (ze(c) !== ze(l))
654
+ return !1;
655
+ }
656
+ return !0;
657
+ })
658
+ );
659
+ }
660
+ function qt() {
661
+ const r = k.c(6), [e] = J(Jt);
662
+ let n, t;
663
+ r[0] !== e ? (t = e.asObservable().pipe(U(Ut)), r[0] = e, r[1] = t) : t = r[1], n = t;
664
+ const a = n, {
665
+ state: o
666
+ } = ve();
667
+ let i, s;
668
+ return r[2] !== o || r[3] !== e ? (i = () => {
669
+ e.next(o);
670
+ }, s = [o, e], r[2] = o, r[3] = e, r[4] = i, r[5] = s) : (i = r[4], s = r[5]), V(i, s), a;
671
+ }
672
+ function Ut(r) {
673
+ return (r == null ? void 0 : r.panes) || [];
674
+ }
675
+ function Jt() {
676
+ return new ft(1);
677
+ }
678
+ function Yt() {
679
+ const r = k.c(6), [e, n] = J();
680
+ if (e)
681
+ throw e;
682
+ const {
683
+ structureContext: t,
684
+ rootPaneNode: a
685
+ } = de();
686
+ let o;
687
+ r[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {
688
+ paneDataItems: [],
689
+ resolvedPanes: [],
690
+ routerPanes: []
691
+ }, r[0] = o) : o = r[0];
692
+ const [i, s] = J(o), c = qt();
693
+ let l, d;
694
+ return r[1] !== a || r[2] !== c || r[3] !== t ? (l = () => {
695
+ const f = jt({
696
+ rootPaneNode: a,
697
+ routerPanesStream: c,
698
+ structureContext: t
699
+ }).pipe(U(Qt)).subscribe({
700
+ next: (p) => s(p),
701
+ error: (p) => n(p)
702
+ });
703
+ return () => f.unsubscribe();
704
+ }, d = [a, c, t], r[1] = a, r[2] = c, r[3] = t, r[4] = l, r[5] = d) : (l = r[4], d = r[5]), V(l, d), i;
705
+ }
706
+ function Qt(r) {
707
+ const e = r.reduce(Zt, []), n = e.length, t = r.map((a) => {
708
+ const {
709
+ groupIndex: o,
710
+ flatIndex: i,
711
+ siblingIndex: s,
712
+ routerPaneSibling: c,
713
+ path: l
714
+ } = a, d = c.id, u = e[o + 1];
715
+ return {
716
+ active: o === n - 2,
717
+ childItemId: (u == null ? void 0 : u[0].id) ?? null,
718
+ index: i,
719
+ itemId: c.id,
720
+ groupIndex: o,
721
+ key: `${a.type === "loading" ? "unknown" : a.paneNode.id}-${d}-${s}`,
722
+ pane: a.type === "loading" ? X : a.paneNode,
723
+ params: c.params || {},
724
+ path: l.join(";"),
725
+ payload: c.payload,
726
+ selected: i === r.length - 1,
727
+ siblingIndex: s
728
+ };
729
+ });
730
+ return {
731
+ paneDataItems: t,
732
+ routerPanes: e,
733
+ resolvedPanes: t.map(Xt)
734
+ };
735
+ }
736
+ function Xt(r) {
737
+ return r.pane;
738
+ }
739
+ function Zt(r, e) {
740
+ const n = r[e.groupIndex] || [];
741
+ return n[e.siblingIndex] = e.routerPaneSibling, r[e.groupIndex] = n, r;
742
+ }
743
+ async function en(r, e, n) {
744
+ if (e && n) return {
745
+ id: e,
746
+ type: n
747
+ };
748
+ if (!e && n) return {
749
+ id: xt(),
750
+ type: n
751
+ };
752
+ if (e && !n) {
753
+ const t = await Oe(r.resolveTypeForDocument(e));
754
+ return {
755
+ id: e,
756
+ type: t
757
+ };
758
+ }
759
+ throw new Y({
760
+ message: "Neither document `id` or `type` was provided when trying to resolve intent."
761
+ });
762
+ }
763
+ const tn = {}, nn = Pe(function() {
764
+ const e = k.c(7), {
765
+ navigate: n
766
+ } = ve(), t = be(rn), {
767
+ rootPaneNode: a,
768
+ structureContext: o
769
+ } = de(), i = Qe(), [s, c] = J(null);
770
+ if (s)
771
+ throw s;
772
+ let l, d;
773
+ return e[0] !== i || e[1] !== t || e[2] !== n || e[3] !== a || e[4] !== o ? (l = () => {
774
+ if (t) {
775
+ const {
776
+ intent: u,
777
+ params: f,
778
+ payload: p
779
+ } = t;
780
+ let m = !1;
781
+ return async function() {
782
+ const {
783
+ id: x,
784
+ type: y
785
+ } = await en(i, typeof f.id == "string" ? f.id : void 0, typeof f.type == "string" ? f.type : void 0);
786
+ if (m)
787
+ return;
788
+ const w = await Ht({
789
+ intent: u,
790
+ params: {
791
+ ...f,
792
+ id: x,
793
+ type: y
794
+ },
795
+ payload: p,
796
+ rootPaneNode: a,
797
+ structureContext: o
798
+ });
799
+ m || n({
800
+ panes: w
801
+ }, {
802
+ replace: !0
803
+ });
804
+ }().catch(c), () => {
805
+ m = !0;
806
+ };
807
+ }
808
+ }, d = [i, t, n, a, o], e[0] = i, e[1] = t, e[2] = n, e[3] = a, e[4] = o, e[5] = l, e[6] = d) : (l = e[5], d = e[6]), V(l, d), null;
809
+ });
810
+ function rn(r) {
811
+ const e = typeof r.intent == "string" ? r.intent : void 0;
812
+ return e ? {
813
+ intent: e,
814
+ params: Ie(r.params) ? r.params : tn,
815
+ payload: r.payload
816
+ } : void 0;
817
+ }
818
+ const sn = Ve.span`
819
+ &:not(:last-child)::after {
820
+ content: ' ➝ ';
821
+ opacity: 0.5;
822
+ }
823
+ `;
824
+ function on(r) {
825
+ return r.replace(/\(\.\.\.\)\./g, `(...)
826
+ .`).replace(/__WEBPACK_IMPORTED_MODULE_\d+_+/g, "").replace(/___default\./g, ".").replace(new RegExp(` \\(https?:\\/\\/${window.location.host}`, "g"), " (");
827
+ }
828
+ function an(r) {
829
+ const e = k.c(37), {
830
+ error: n
831
+ } = r;
832
+ if (!(n instanceof Y))
833
+ throw n;
834
+ const {
835
+ cause: t
836
+ } = n, {
837
+ t: a
838
+ } = ce(ue), o = (t == null ? void 0 : t.stack) || n.stack, i = o && !(t instanceof me) && !n.message.includes("Module build failed:");
839
+ let s;
840
+ e[0] !== t ? (s = t instanceof me ? t.path : [], e[0] = t, e[1] = s) : s = e[1];
841
+ const c = s, l = t instanceof me && t.helpId || n.helpId, d = cn;
842
+ let u;
843
+ e[2] !== a ? (u = a("structure-error.header.text"), e[2] = a, e[3] = u) : u = e[3];
844
+ let f;
845
+ e[4] !== u ? (f = /* @__PURE__ */ g(wt, { as: "h2", children: u }), e[4] = u, e[5] = f) : f = e[5];
846
+ let p;
847
+ e[6] !== c || e[7] !== a ? (p = c.length > 0 && /* @__PURE__ */ M(ye, { space: 2, children: [
848
+ /* @__PURE__ */ g(B, { size: 1, weight: "medium", children: a("structure-error.structure-path.label") }),
849
+ /* @__PURE__ */ g(Te, { children: c.slice(1).map(ln) })
850
+ ] }), e[6] = c, e[7] = a, e[8] = p) : p = e[8];
851
+ let m;
852
+ e[9] !== a ? (m = a("structure-error.error.label"), e[9] = a, e[10] = m) : m = e[10];
853
+ let h;
854
+ e[11] !== m ? (h = /* @__PURE__ */ g(B, { size: 1, weight: "medium", children: m }), e[11] = m, e[12] = h) : h = e[12];
855
+ let I;
856
+ e[13] !== n.message || e[14] !== i || e[15] !== o ? (I = i ? on(o) : n.message, e[13] = n.message, e[14] = i, e[15] = o, e[16] = I) : I = e[16];
857
+ let x;
858
+ e[17] !== I ? (x = /* @__PURE__ */ g(Te, { children: I }), e[17] = I, e[18] = x) : x = e[18];
859
+ let y;
860
+ e[19] !== h || e[20] !== x ? (y = /* @__PURE__ */ M(ye, { marginTop: 4, space: 2, children: [
861
+ h,
862
+ x
863
+ ] }), e[19] = h, e[20] = x, e[21] = y) : y = e[21];
864
+ let w;
865
+ e[22] !== l || e[23] !== a ? (w = l && /* @__PURE__ */ g(ie, { marginTop: 4, children: /* @__PURE__ */ g(B, { children: /* @__PURE__ */ g("a", { href: Be(l), rel: "noopener noreferrer", target: "_blank", children: a("structure-error.docs-link.text") }) }) }), e[22] = l, e[23] = a, e[24] = w) : w = e[24];
866
+ let v;
867
+ e[25] !== a ? (v = a("structure-error.reload-button.text"), e[25] = a, e[26] = v) : v = e[26];
868
+ let $;
869
+ e[27] !== v ? ($ = /* @__PURE__ */ g(ie, { marginTop: 4, children: /* @__PURE__ */ g(mt, { text: v, icon: vt, tone: "primary", onClick: d }) }), e[27] = v, e[28] = $) : $ = e[28];
870
+ let P;
871
+ e[29] !== w || e[30] !== $ || e[31] !== p || e[32] !== y ? (P = /* @__PURE__ */ M(le, { marginTop: 4, padding: 4, radius: 2, overflow: "auto", shadow: 1, tone: "inherit", children: [
872
+ p,
873
+ y,
874
+ w,
875
+ $
876
+ ] }), e[29] = w, e[30] = $, e[31] = p, e[32] = y, e[33] = P) : P = e[33];
877
+ let _;
878
+ return e[34] !== P || e[35] !== f ? (_ = /* @__PURE__ */ g(le, { height: "fill", overflow: "auto", padding: 4, sizing: "border", tone: "critical", children: /* @__PURE__ */ M(Ae, { children: [
879
+ f,
880
+ P
881
+ ] }) }), e[34] = P, e[35] = f, e[36] = _) : _ = e[36], _;
882
+ }
883
+ function ln(r, e) {
884
+ return /* @__PURE__ */ g(sn, { children: r }, `${r}-${e}`);
885
+ }
886
+ function cn() {
887
+ window.location.reload();
888
+ }
889
+ function dn(r) {
890
+ const e = k.c(14), {
891
+ isSelected: n,
892
+ pane: t,
893
+ paneKey: a
894
+ } = r;
895
+ let o;
896
+ e[0] !== t ? (o = Ie(t) && t.type || null, e[0] = t, e[1] = o) : o = e[1];
897
+ const i = o, {
898
+ t: s
899
+ } = ce(ue);
900
+ let c;
901
+ e[2] !== s ? (c = s("panes.unknown-pane-type.title"), e[2] = s, e[3] = c) : c = e[3];
902
+ let l;
903
+ e[4] !== c ? (l = /* @__PURE__ */ g(at, { title: c }), e[4] = c, e[5] = l) : l = e[5];
904
+ let d;
905
+ e[6] !== s || e[7] !== i ? (d = /* @__PURE__ */ g(it, { children: /* @__PURE__ */ g(ie, { padding: 4, children: typeof i == "string" ? /* @__PURE__ */ g(B, { as: "p", muted: !0, children: /* @__PURE__ */ g(ke, { t: s, i18nKey: "panes.unknown-pane-type.unknown-type.text", values: {
906
+ type: i
907
+ } }) }) : /* @__PURE__ */ g(B, { as: "p", muted: !0, children: /* @__PURE__ */ g(ke, { t: s, i18nKey: "panes.unknown-pane-type.missing-type.text" }) }) }) }), e[6] = s, e[7] = i, e[8] = d) : d = e[8];
908
+ let u;
909
+ return e[9] !== n || e[10] !== a || e[11] !== l || e[12] !== d ? (u = /* @__PURE__ */ M(lt, { id: a, selected: n, children: [
910
+ l,
911
+ d
912
+ ] }), e[9] = n, e[10] = a, e[11] = l, e[12] = d, e[13] = u) : u = e[13], u;
913
+ }
914
+ const un = {
915
+ component: se(() => import("./index-B2GCDfau.mjs")),
916
+ document: se(() => import("./pane-Bm_57XKB.mjs")),
917
+ documentList: se(() => import("./pane-Dopl4BjD.mjs")),
918
+ list: se(() => import("./index-BUB137yJ.mjs"))
919
+ }, pn = Pe(function(e) {
920
+ const n = k.c(23), {
921
+ active: t,
922
+ childItemId: a,
923
+ groupIndex: o,
924
+ index: i,
925
+ itemId: s,
926
+ pane: c,
927
+ paneKey: l,
928
+ params: d,
929
+ payload: u,
930
+ path: f,
931
+ selected: p,
932
+ siblingIndex: m
933
+ } = e, h = un[c.type] || dn;
934
+ let I;
935
+ n[0] !== l || n[1] !== f || n[2] !== p ? (I = /* @__PURE__ */ g(xe, { paneKey: l, path: f, selected: p }), n[0] = l, n[1] = f, n[2] = p, n[3] = I) : I = n[3];
936
+ const x = a || "";
937
+ let y;
938
+ n[4] !== h || n[5] !== t || n[6] !== i || n[7] !== s || n[8] !== c || n[9] !== l || n[10] !== p || n[11] !== x ? (y = /* @__PURE__ */ g(h, { childItemId: x, index: i, itemId: s, isActive: t, isSelected: p, paneKey: l, pane: c }), n[4] = h, n[5] = t, n[6] = i, n[7] = s, n[8] = c, n[9] = l, n[10] = p, n[11] = x, n[12] = y) : y = n[12];
939
+ let w;
940
+ n[13] !== I || n[14] !== y ? (w = /* @__PURE__ */ g(Je, { fallback: I, children: y }), n[13] = I, n[14] = y, n[15] = w) : w = n[15];
941
+ let v;
942
+ return n[16] !== o || n[17] !== i || n[18] !== d || n[19] !== u || n[20] !== m || n[21] !== w ? (v = /* @__PURE__ */ g(Ot, { flatIndex: i, index: o, params: d, payload: u, siblingIndex: m, children: w }), n[16] = o, n[17] = i, n[18] = d, n[19] = u, n[20] = m, n[21] = w, n[22] = v) : v = n[22], v;
943
+ }, ({
944
+ params: r = {},
945
+ payload: e = null,
946
+ ...n
947
+ }, {
948
+ params: t = {},
949
+ payload: a = null,
950
+ ...o
951
+ }) => {
952
+ if (!Z.isEqual(r, t) || !Z.isEqual(e, a)) return !1;
953
+ const i = /* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(o)]);
954
+ for (const s of i)
955
+ if (n[s] !== o[s]) return !1;
956
+ return !0;
957
+ });
958
+ function fn() {
959
+ const r = k.c(17), {
960
+ t: e
961
+ } = ce(ue);
962
+ let n;
963
+ r[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ g(ie, { children: /* @__PURE__ */ g(B, { size: 1, children: /* @__PURE__ */ g(bt, {}) }) }), r[0] = n) : n = r[0];
964
+ let t;
965
+ r[1] !== e ? (t = e("no-document-types-screen.title"), r[1] = e, r[2] = t) : t = r[2];
966
+ let a;
967
+ r[3] !== t ? (a = /* @__PURE__ */ g(B, { as: "h1", size: 1, weight: "medium", children: t }), r[3] = t, r[4] = a) : a = r[4];
968
+ let o;
969
+ r[5] !== e ? (o = e("no-document-types-screen.subtitle"), r[5] = e, r[6] = o) : o = r[6];
970
+ let i;
971
+ r[7] !== o ? (i = /* @__PURE__ */ g(B, { as: "p", muted: !0, size: 1, children: o }), r[7] = o, r[8] = i) : i = r[8];
972
+ let s;
973
+ r[9] !== e ? (s = e("no-document-types-screen.link-text"), r[9] = e, r[10] = s) : s = r[10];
974
+ let c;
975
+ r[11] !== s ? (c = /* @__PURE__ */ g(B, { as: "p", muted: !0, size: 1, children: /* @__PURE__ */ g("a", { href: "https://www.sanity.io/docs/create-a-schema-and-configure-sanity-studio", target: "_blank", rel: "noreferrer", children: s }) }), r[11] = s, r[12] = c) : c = r[12];
976
+ let l;
977
+ return r[13] !== a || r[14] !== i || r[15] !== c ? (l = /* @__PURE__ */ g(le, { height: "fill", children: /* @__PURE__ */ g(Ce, { align: "center", height: "fill", justify: "center", padding: 4, sizing: "border", children: /* @__PURE__ */ g(Ae, { width: 0, children: /* @__PURE__ */ g(le, { padding: 4, radius: 2, shadow: 1, tone: "caution", children: /* @__PURE__ */ M(Ce, { children: [
978
+ n,
979
+ /* @__PURE__ */ M(ye, { flex: 1, marginLeft: 3, space: 3, children: [
980
+ a,
981
+ i,
982
+ c
983
+ ] })
984
+ ] }) }) }) }) }), r[13] = a, r[14] = i, r[15] = c, r[16] = l) : l = r[16], l;
985
+ }
986
+ const mn = (r) => {
987
+ const e = k.c(7), {
988
+ documentId: n,
989
+ documentType: t
990
+ } = r, {
991
+ selectedReleaseId: a
992
+ } = Xe(), o = Ze(n, t, "default", a), i = Me(), {
993
+ t: s
994
+ } = ce(ue), c = !(o != null && o.published) && !(o != null && o.draft), l = (o == null ? void 0 : o.version) || (o == null ? void 0 : o.draft) || (o == null ? void 0 : o.published), d = i.get(t), {
995
+ value: u,
996
+ isLoading: f
997
+ } = et({
998
+ enabled: !0,
999
+ schemaType: d,
1000
+ value: l
1001
+ }), p = c ? s("browser-document-title.new-document", {
1002
+ schemaType: (d == null ? void 0 : d.title) || (d == null ? void 0 : d.name)
1003
+ }) : (u == null ? void 0 : u.title) || s("browser-document-title.untitled-document"), m = o.ready && !f, h = je(p);
1004
+ let I;
1005
+ e[0] !== h || e[1] !== m ? (I = () => {
1006
+ m && (document.title = h);
1007
+ }, e[0] = h, e[1] = m, e[2] = I) : I = e[2];
1008
+ let x;
1009
+ return e[3] !== p || e[4] !== h || e[5] !== m ? (x = [p, m, h], e[3] = p, e[4] = h, e[5] = m, e[6] = x) : x = e[6], V(I, x), null;
1010
+ }, he = (r) => {
1011
+ const e = k.c(5), {
1012
+ title: n
1013
+ } = r, t = je(n);
1014
+ let a;
1015
+ e[0] !== t ? (a = () => {
1016
+ document.title = t;
1017
+ }, e[0] = t, e[1] = a) : a = e[1];
1018
+ let o;
1019
+ return e[2] !== t || e[3] !== n ? (o = [t, n], e[2] = t, e[3] = n, e[4] = o) : o = e[4], V(a, o), null;
1020
+ }, hn = (r) => {
1021
+ const e = k.c(8), {
1022
+ resolvedPanes: n
1023
+ } = r;
1024
+ if (!(n != null && n.length))
1025
+ return null;
1026
+ const t = n[n.length - 1];
1027
+ if (Pn(t)) {
1028
+ let i;
1029
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ g(he, {}), e[0] = i) : i = e[0], i;
1030
+ }
1031
+ if (gn(t)) {
1032
+ if (t != null && t.title) {
1033
+ let s;
1034
+ return e[1] !== t.title ? (s = /* @__PURE__ */ g(he, { title: t.title }), e[1] = t.title, e[2] = s) : s = e[2], s;
1035
+ }
1036
+ let i;
1037
+ return e[3] !== t.options.id || e[4] !== t.options.type ? (i = /* @__PURE__ */ g(mn, { documentId: t.options.id, documentType: t.options.type }), e[3] = t.options.id, e[4] = t.options.type, e[5] = i) : i = e[5], i;
1038
+ }
1039
+ const a = t == null ? void 0 : t.title;
1040
+ let o;
1041
+ return e[6] !== a ? (o = /* @__PURE__ */ g(he, { title: a }), e[6] = a, e[7] = o) : o = e[7], o;
1042
+ };
1043
+ function je(r) {
1044
+ const e = k.c(3), n = de().structureContext.title;
1045
+ let t;
1046
+ return e[0] !== r || e[1] !== n ? (t = [r, n].filter(yn), e[0] = r, e[1] = n, e[2] = t) : t = e[2], t.join(" | ");
1047
+ }
1048
+ function yn(r) {
1049
+ return r;
1050
+ }
1051
+ function gn(r) {
1052
+ return r !== X && r.type === "document";
1053
+ }
1054
+ function Pn(r) {
1055
+ return r === X;
1056
+ }
1057
+ const In = Ve(ct)`
1058
+ min-height: 100%;
1059
+ min-width: 320px;
1060
+ `, xn = Tt("mod+s"), wn = Pe(function(e) {
1061
+ var H;
1062
+ const n = k.c(31), {
1063
+ onPaneChange: t
1064
+ } = e, {
1065
+ push: a
1066
+ } = St(), o = Me(), {
1067
+ layoutCollapsed: i,
1068
+ setLayoutCollapsed: s
1069
+ } = de(), {
1070
+ paneDataItems: c,
1071
+ resolvedPanes: l
1072
+ } = Yt(), d = be(vn), {
1073
+ sanity: u
1074
+ } = $t(), {
1075
+ media: f
1076
+ } = u, [p, m] = J(null);
1077
+ let h;
1078
+ n[0] !== s ? (h = () => s(!0), n[0] = s, n[1] = h) : h = n[1];
1079
+ const I = h;
1080
+ let x;
1081
+ n[2] !== s ? (x = () => s(!1), n[2] = s, n[3] = x) : x = n[3];
1082
+ const y = x;
1083
+ let w, v;
1084
+ n[4] !== t || n[5] !== l ? (w = () => {
1085
+ l.length && t(l);
1086
+ }, v = [t, l], n[4] = t, n[5] = l, n[6] = w, n[7] = v) : (w = n[6], v = n[7]), V(w, v);
1087
+ let $, P;
1088
+ if (n[8] !== a ? ($ = () => {
1089
+ const z = (O) => {
1090
+ xn(O) && (O.preventDefault(), a({
1091
+ closable: !0,
1092
+ id: "auto-save-message",
1093
+ status: "info",
1094
+ title: "Your work is automatically saved!",
1095
+ duration: 4e3
1096
+ }));
1097
+ };
1098
+ return window.addEventListener("keydown", z), () => window.removeEventListener("keydown", z);
1099
+ }, P = [a], n[8] = a, n[9] = $, n[10] = P) : ($ = n[9], P = n[10]), V($, P), !((H = o._original) == null ? void 0 : H.types.some(tt))) {
1100
+ let z;
1101
+ return n[11] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ g(fn, {}), n[11] = z) : z = n[11], z;
1102
+ }
1103
+ const R = p || null, T = i ? void 0 : "fill", Q = f[1];
1104
+ let D;
1105
+ n[12] !== c ? (D = c.map(bn), n[12] = c, n[13] = D) : D = n[13];
1106
+ let E;
1107
+ n[14] !== d || n[15] !== c.length ? (E = c.length <= 1 && d && /* @__PURE__ */ g(xe, { paneKey: "intent-resolver" }), n[14] = d, n[15] = c.length, n[16] = E) : E = n[16];
1108
+ let L;
1109
+ n[17] !== I || n[18] !== y || n[19] !== f[1] || n[20] !== D || n[21] !== E || n[22] !== T ? (L = /* @__PURE__ */ M(In, { flex: 1, height: T, minWidth: Q, onCollapse: I, onExpand: y, children: [
1110
+ D,
1111
+ E
1112
+ ] }), n[17] = I, n[18] = y, n[19] = f[1], n[20] = D, n[21] = E, n[22] = T, n[23] = L) : L = n[23];
1113
+ let N;
1114
+ n[24] !== l ? (N = /* @__PURE__ */ g(hn, { resolvedPanes: l }), n[24] = l, n[25] = N) : N = n[25];
1115
+ let W;
1116
+ n[26] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ g("div", { "data-portal": "", ref: m }), n[26] = W) : W = n[26];
1117
+ let A;
1118
+ return n[27] !== L || n[28] !== N || n[29] !== R ? (A = /* @__PURE__ */ M(_t, { element: R, children: [
1119
+ L,
1120
+ N,
1121
+ W
1122
+ ] }), n[27] = L, n[28] = N, n[29] = R, n[30] = A) : A = n[30], A;
1123
+ });
1124
+ function vn(r) {
1125
+ return typeof r.intent == "string";
1126
+ }
1127
+ function bn(r) {
1128
+ const {
1129
+ active: e,
1130
+ childItemId: n,
1131
+ groupIndex: t,
1132
+ itemId: a,
1133
+ key: o,
1134
+ pane: i,
1135
+ index: s,
1136
+ params: c,
1137
+ path: l,
1138
+ payload: d,
1139
+ siblingIndex: u,
1140
+ selected: f
1141
+ } = r;
1142
+ return /* @__PURE__ */ g(Ye, { children: i === X ? /* @__PURE__ */ g(xe, { paneKey: o, path: l, selected: f }) : /* @__PURE__ */ g(pn, { active: e, groupIndex: t, index: s, pane: i, childItemId: n, itemId: a, paneKey: o, params: c, payload: d, path: l, selected: f, siblingIndex: u }) }, `${i === X ? "loading" : i.type}-${s}`);
1143
+ }
1144
+ function Gn(r) {
1145
+ const e = k.c(14), {
1146
+ tool: n
1147
+ } = r, {
1148
+ options: t
1149
+ } = n, {
1150
+ unstable_sources: a
1151
+ } = nt(), [o] = a;
1152
+ let i;
1153
+ e[0] !== t ? (i = t || {}, e[0] = t, e[1] = i) : i = e[1];
1154
+ const {
1155
+ source: s,
1156
+ defaultDocumentNode: c,
1157
+ structure: l
1158
+ } = i;
1159
+ let d;
1160
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (d = [], e[2] = d) : d = e[2], V(Sn, d);
1161
+ let u;
1162
+ e[3] === Symbol.for("react.memo_cache_sentinel") ? (u = {
1163
+ error: null
1164
+ }, e[3] = u) : u = e[3];
1165
+ const [f, p] = J(u), {
1166
+ error: m
1167
+ } = f;
1168
+ if (m) {
1169
+ let v;
1170
+ return e[4] !== m ? (v = /* @__PURE__ */ g(an, { error: m }), e[4] = m, e[5] = v) : v = e[5], v;
1171
+ }
1172
+ const h = s || o.name;
1173
+ let I, x;
1174
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ g(wn, { onPaneChange: we }), x = /* @__PURE__ */ g(nn, {}), e[6] = I, e[7] = x) : (I = e[6], x = e[7]);
1175
+ let y;
1176
+ e[8] !== c || e[9] !== l ? (y = /* @__PURE__ */ M(dt, { defaultDocumentNode: c, structure: l, children: [
1177
+ I,
1178
+ x
1179
+ ] }), e[8] = c, e[9] = l, e[10] = y) : y = e[10];
1180
+ let w;
1181
+ return e[11] !== h || e[12] !== y ? (w = /* @__PURE__ */ g(ht, { onCatch: p, children: /* @__PURE__ */ g(rt, { name: h, children: y }) }), e[11] = h, e[12] = y, e[13] = w) : w = e[13], w;
1182
+ }
1183
+ function Sn() {
1184
+ return we([]), $n;
1185
+ }
1186
+ function $n() {
1187
+ return we([]);
1188
+ }
1189
+ export {
1190
+ Gn as default
1191
+ };
1192
+ //# sourceMappingURL=index-C3PGPrdL.mjs.map