react-pebble-editor 0.0.1-dev2 → 0.0.1-dev4

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.
@@ -1,4 +1,4 @@
1
- import Oe, { useRef as lr, useEffect as fr } from "react";
1
+ import Pe, { forwardRef as fr, useRef as we, useImperativeHandle as cr, useEffect as dr } from "react";
2
2
  var X = { exports: {} }, I = {};
3
3
  /**
4
4
  * @license React
@@ -9,19 +9,19 @@ var X = { exports: {} }, I = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var we;
13
- function cr() {
14
- if (we) return I;
15
- we = 1;
16
- var R = Oe, h = Symbol.for("react.element"), b = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, E = R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
17
- function w(T, f, j) {
18
- var p, _ = {}, O = null, W = null;
19
- j !== void 0 && (O = "" + j), f.key !== void 0 && (O = "" + f.key), f.ref !== void 0 && (W = f.ref);
20
- for (p in f) y.call(f, p) && !C.hasOwnProperty(p) && (_[p] = f[p]);
21
- if (T && T.defaultProps) for (p in f = T.defaultProps, f) _[p] === void 0 && (_[p] = f[p]);
22
- return { $$typeof: h, type: T, key: O, ref: W, props: _, _owner: E.current };
12
+ var Te;
13
+ function vr() {
14
+ if (Te) return I;
15
+ Te = 1;
16
+ var P = Pe, h = Symbol.for("react.element"), R = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, j = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function y(_, s, g) {
18
+ var c, d = {}, w = null, W = null;
19
+ g !== void 0 && (w = "" + g), s.key !== void 0 && (w = "" + s.key), s.ref !== void 0 && (W = s.ref);
20
+ for (c in s) m.call(s, c) && !T.hasOwnProperty(c) && (d[c] = s[c]);
21
+ if (_ && _.defaultProps) for (c in s = _.defaultProps, s) d[c] === void 0 && (d[c] = s[c]);
22
+ return { $$typeof: h, type: _, key: w, ref: W, props: d, _owner: j.current };
23
23
  }
24
- return I.Fragment = b, I.jsx = w, I.jsxs = w, I;
24
+ return I.Fragment = R, I.jsx = y, I.jsxs = y, I;
25
25
  }
26
26
  var $ = {};
27
27
  /**
@@ -33,91 +33,91 @@ var $ = {};
33
33
  * This source code is licensed under the MIT license found in the
34
34
  * LICENSE file in the root directory of this source tree.
35
35
  */
36
- var Te;
37
- function dr() {
38
- return Te || (Te = 1, process.env.NODE_ENV !== "production" && function() {
39
- var R = Oe, h = Symbol.for("react.element"), b = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), T = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), H = Symbol.iterator, Pe = "@@iterator";
40
- function Se(e) {
36
+ var Oe;
37
+ function pr() {
38
+ return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() {
39
+ var P = Pe, h = Symbol.for("react.element"), R = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), _ = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), H = Symbol.iterator, Se = "@@iterator";
40
+ function Ce(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
43
- var r = H && e[H] || e[Pe];
43
+ var r = H && e[H] || e[Se];
44
44
  return typeof r == "function" ? r : null;
45
45
  }
46
- var x = R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
- function c(e) {
46
+ var x = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
+ function v(e) {
48
48
  {
49
49
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
50
50
  t[n - 1] = arguments[n];
51
- Ce("error", e, t);
51
+ je("error", e, t);
52
52
  }
53
53
  }
54
- function Ce(e, r, t) {
54
+ function je(e, r, t) {
55
55
  {
56
- var n = x.ReactDebugCurrentFrame, o = n.getStackAddendum();
57
- o !== "" && (r += "%s", t = t.concat([o]));
58
- var u = t.map(function(i) {
59
- return String(i);
56
+ var n = x.ReactDebugCurrentFrame, i = n.getStackAddendum();
57
+ i !== "" && (r += "%s", t = t.concat([i]));
58
+ var u = t.map(function(o) {
59
+ return String(o);
60
60
  });
61
61
  u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
62
62
  }
63
63
  }
64
- var je = !1, xe = !1, ke = !1, De = !1, Fe = !1, Z;
64
+ var xe = !1, ke = !1, De = !1, Fe = !1, Ae = !1, Z;
65
65
  Z = Symbol.for("react.module.reference");
66
- function Ae(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === y || e === C || Fe || e === E || e === j || e === p || De || e === W || je || xe || ke || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === _ || e.$$typeof === w || e.$$typeof === T || e.$$typeof === f || // This needs to include all possible module reference object
66
+ function Ie(e) {
67
+ return !!(typeof e == "string" || typeof e == "function" || e === m || e === T || Ae || e === j || e === g || e === c || Fe || e === W || xe || ke || De || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === d || e.$$typeof === y || e.$$typeof === _ || e.$$typeof === s || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
71
71
  e.$$typeof === Z || e.getModuleId !== void 0));
72
72
  }
73
- function Ie(e, r, t) {
73
+ function $e(e, r, t) {
74
74
  var n = e.displayName;
75
75
  if (n)
76
76
  return n;
77
- var o = r.displayName || r.name || "";
78
- return o !== "" ? t + "(" + o + ")" : t;
77
+ var i = r.displayName || r.name || "";
78
+ return i !== "" ? t + "(" + i + ")" : t;
79
79
  }
80
80
  function Q(e) {
81
81
  return e.displayName || "Context";
82
82
  }
83
- function m(e) {
83
+ function O(e) {
84
84
  if (e == null)
85
85
  return null;
86
- if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
86
+ if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
87
  return e.displayName || e.name || null;
88
88
  if (typeof e == "string")
89
89
  return e;
90
90
  switch (e) {
91
- case y:
91
+ case m:
92
92
  return "Fragment";
93
- case b:
93
+ case R:
94
94
  return "Portal";
95
- case C:
95
+ case T:
96
96
  return "Profiler";
97
- case E:
98
- return "StrictMode";
99
97
  case j:
98
+ return "StrictMode";
99
+ case g:
100
100
  return "Suspense";
101
- case p:
101
+ case c:
102
102
  return "SuspenseList";
103
103
  }
104
104
  if (typeof e == "object")
105
105
  switch (e.$$typeof) {
106
- case T:
106
+ case _:
107
107
  var r = e;
108
108
  return Q(r) + ".Consumer";
109
- case w:
109
+ case y:
110
110
  var t = e;
111
111
  return Q(t._context) + ".Provider";
112
- case f:
113
- return Ie(e, e.render, "ForwardRef");
114
- case _:
112
+ case s:
113
+ return $e(e, e.render, "ForwardRef");
114
+ case d:
115
115
  var n = e.displayName || null;
116
- return n !== null ? n : m(e.type) || "Memo";
117
- case O: {
118
- var o = e, u = o._payload, i = o._init;
116
+ return n !== null ? n : O(e.type) || "Memo";
117
+ case w: {
118
+ var i = e, u = i._payload, o = i._init;
119
119
  try {
120
- return m(i(u));
120
+ return O(o(u));
121
121
  } catch {
122
122
  return null;
123
123
  }
@@ -125,14 +125,14 @@ function dr() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var P = Object.assign, F = 0, ee, re, te, ne, ae, ie, oe;
128
+ var S = Object.assign, F = 0, ee, re, te, ne, ae, oe, ie;
129
129
  function ue() {
130
130
  }
131
131
  ue.__reactDisabledLog = !0;
132
- function $e() {
132
+ function We() {
133
133
  {
134
134
  if (F === 0) {
135
- ee = console.log, re = console.info, te = console.warn, ne = console.error, ae = console.group, ie = console.groupCollapsed, oe = console.groupEnd;
135
+ ee = console.log, re = console.info, te = console.warn, ne = console.error, ae = console.group, oe = console.groupCollapsed, ie = console.groupEnd;
136
136
  var e = {
137
137
  configurable: !0,
138
138
  enumerable: !0,
@@ -152,7 +152,7 @@ function dr() {
152
152
  F++;
153
153
  }
154
154
  }
155
- function We() {
155
+ function Ye() {
156
156
  {
157
157
  if (F--, F === 0) {
158
158
  var e = {
@@ -161,30 +161,30 @@ function dr() {
161
161
  writable: !0
162
162
  };
163
163
  Object.defineProperties(console, {
164
- log: P({}, e, {
164
+ log: S({}, e, {
165
165
  value: ee
166
166
  }),
167
- info: P({}, e, {
167
+ info: S({}, e, {
168
168
  value: re
169
169
  }),
170
- warn: P({}, e, {
170
+ warn: S({}, e, {
171
171
  value: te
172
172
  }),
173
- error: P({}, e, {
173
+ error: S({}, e, {
174
174
  value: ne
175
175
  }),
176
- group: P({}, e, {
176
+ group: S({}, e, {
177
177
  value: ae
178
178
  }),
179
- groupCollapsed: P({}, e, {
180
- value: ie
181
- }),
182
- groupEnd: P({}, e, {
179
+ groupCollapsed: S({}, e, {
183
180
  value: oe
181
+ }),
182
+ groupEnd: S({}, e, {
183
+ value: ie
184
184
  })
185
185
  });
186
186
  }
187
- F < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
187
+ F < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
188
  }
189
189
  }
190
190
  var U = x.ReactCurrentDispatcher, q;
@@ -193,8 +193,8 @@ function dr() {
193
193
  if (q === void 0)
194
194
  try {
195
195
  throw Error();
196
- } catch (o) {
197
- var n = o.stack.trim().match(/\n( *(at )?)/);
196
+ } catch (i) {
197
+ var n = i.stack.trim().match(/\n( *(at )?)/);
198
198
  q = n && n[1] || "";
199
199
  }
200
200
  return `
@@ -203,8 +203,8 @@ function dr() {
203
203
  }
204
204
  var N = !1, L;
205
205
  {
206
- var Ye = typeof WeakMap == "function" ? WeakMap : Map;
207
- L = new Ye();
206
+ var Le = typeof WeakMap == "function" ? WeakMap : Map;
207
+ L = new Le();
208
208
  }
209
209
  function se(e, r) {
210
210
  if (!e || N)
@@ -216,75 +216,75 @@ function dr() {
216
216
  }
217
217
  var n;
218
218
  N = !0;
219
- var o = Error.prepareStackTrace;
219
+ var i = Error.prepareStackTrace;
220
220
  Error.prepareStackTrace = void 0;
221
221
  var u;
222
- u = U.current, U.current = null, $e();
222
+ u = U.current, U.current = null, We();
223
223
  try {
224
224
  if (r) {
225
- var i = function() {
225
+ var o = function() {
226
226
  throw Error();
227
227
  };
228
- if (Object.defineProperty(i.prototype, "props", {
228
+ if (Object.defineProperty(o.prototype, "props", {
229
229
  set: function() {
230
230
  throw Error();
231
231
  }
232
232
  }), typeof Reflect == "object" && Reflect.construct) {
233
233
  try {
234
- Reflect.construct(i, []);
235
- } catch (v) {
236
- n = v;
234
+ Reflect.construct(o, []);
235
+ } catch (E) {
236
+ n = E;
237
237
  }
238
- Reflect.construct(e, [], i);
238
+ Reflect.construct(e, [], o);
239
239
  } else {
240
240
  try {
241
- i.call();
242
- } catch (v) {
243
- n = v;
241
+ o.call();
242
+ } catch (E) {
243
+ n = E;
244
244
  }
245
- e.call(i.prototype);
245
+ e.call(o.prototype);
246
246
  }
247
247
  } else {
248
248
  try {
249
249
  throw Error();
250
- } catch (v) {
251
- n = v;
250
+ } catch (E) {
251
+ n = E;
252
252
  }
253
253
  e();
254
254
  }
255
- } catch (v) {
256
- if (v && n && typeof v.stack == "string") {
257
- for (var a = v.stack.split(`
258
- `), d = n.stack.split(`
259
- `), s = a.length - 1, l = d.length - 1; s >= 1 && l >= 0 && a[s] !== d[l]; )
260
- l--;
261
- for (; s >= 1 && l >= 0; s--, l--)
262
- if (a[s] !== d[l]) {
263
- if (s !== 1 || l !== 1)
255
+ } catch (E) {
256
+ if (E && n && typeof E.stack == "string") {
257
+ for (var a = E.stack.split(`
258
+ `), p = n.stack.split(`
259
+ `), l = a.length - 1, f = p.length - 1; l >= 1 && f >= 0 && a[l] !== p[f]; )
260
+ f--;
261
+ for (; l >= 1 && f >= 0; l--, f--)
262
+ if (a[l] !== p[f]) {
263
+ if (l !== 1 || f !== 1)
264
264
  do
265
- if (s--, l--, l < 0 || a[s] !== d[l]) {
266
- var g = `
267
- ` + a[s].replace(" at new ", " at ");
268
- return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, g), g;
265
+ if (l--, f--, f < 0 || a[l] !== p[f]) {
266
+ var b = `
267
+ ` + a[l].replace(" at new ", " at ");
268
+ return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, b), b;
269
269
  }
270
- while (s >= 1 && l >= 0);
270
+ while (l >= 1 && f >= 0);
271
271
  break;
272
272
  }
273
273
  }
274
274
  } finally {
275
- N = !1, U.current = u, We(), Error.prepareStackTrace = o;
275
+ N = !1, U.current = u, Ye(), Error.prepareStackTrace = i;
276
276
  }
277
- var D = e ? e.displayName || e.name : "", S = D ? Y(D) : "";
278
- return typeof e == "function" && L.set(e, S), S;
277
+ var D = e ? e.displayName || e.name : "", C = D ? Y(D) : "";
278
+ return typeof e == "function" && L.set(e, C), C;
279
279
  }
280
- function Le(e, r, t) {
280
+ function Ve(e, r, t) {
281
281
  return se(e, !1);
282
282
  }
283
283
  function Me(e) {
284
284
  var r = e.prototype;
285
285
  return !!(r && r.isReactComponent);
286
286
  }
287
- function M(e, r, t) {
287
+ function V(e, r, t) {
288
288
  if (e == null)
289
289
  return "";
290
290
  if (typeof e == "function")
@@ -292,21 +292,21 @@ function dr() {
292
292
  if (typeof e == "string")
293
293
  return Y(e);
294
294
  switch (e) {
295
- case j:
295
+ case g:
296
296
  return Y("Suspense");
297
- case p:
297
+ case c:
298
298
  return Y("SuspenseList");
299
299
  }
300
300
  if (typeof e == "object")
301
301
  switch (e.$$typeof) {
302
- case f:
303
- return Le(e.render);
304
- case _:
305
- return M(e.type, r, t);
306
- case O: {
307
- var n = e, o = n._payload, u = n._init;
302
+ case s:
303
+ return Ve(e.render);
304
+ case d:
305
+ return V(e.type, r, t);
306
+ case w: {
307
+ var n = e, i = n._payload, u = n._init;
308
308
  try {
309
- return M(u(o), r, t);
309
+ return V(u(i), r, t);
310
310
  } catch {
311
311
  }
312
312
  }
@@ -314,43 +314,43 @@ function dr() {
314
314
  return "";
315
315
  }
316
316
  var A = Object.prototype.hasOwnProperty, le = {}, fe = x.ReactDebugCurrentFrame;
317
- function V(e) {
317
+ function M(e) {
318
318
  if (e) {
319
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
319
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
320
320
  fe.setExtraStackFrame(t);
321
321
  } else
322
322
  fe.setExtraStackFrame(null);
323
323
  }
324
- function Ve(e, r, t, n, o) {
324
+ function Ue(e, r, t, n, i) {
325
325
  {
326
326
  var u = Function.call.bind(A);
327
- for (var i in e)
328
- if (u(e, i)) {
327
+ for (var o in e)
328
+ if (u(e, o)) {
329
329
  var a = void 0;
330
330
  try {
331
- if (typeof e[i] != "function") {
332
- var d = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
- throw d.name = "Invariant Violation", d;
331
+ if (typeof e[o] != "function") {
332
+ var p = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ throw p.name = "Invariant Violation", p;
334
334
  }
335
- a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
- } catch (s) {
337
- a = s;
335
+ a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
+ } catch (l) {
337
+ a = l;
338
338
  }
339
- a && !(a instanceof Error) && (V(o), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), V(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, V(o), c("Failed %s type: %s", t, a.message), V(null));
339
+ a && !(a instanceof Error) && (M(i), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), M(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, M(i), v("Failed %s type: %s", t, a.message), M(null));
340
340
  }
341
341
  }
342
342
  }
343
- var Ue = Array.isArray;
344
- function J(e) {
345
- return Ue(e);
343
+ var qe = Array.isArray;
344
+ function B(e) {
345
+ return qe(e);
346
346
  }
347
- function qe(e) {
347
+ function Ne(e) {
348
348
  {
349
349
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
350
  return t;
351
351
  }
352
352
  }
353
- function Ne(e) {
353
+ function Be(e) {
354
354
  try {
355
355
  return ce(e), !1;
356
356
  } catch {
@@ -361,16 +361,16 @@ function dr() {
361
361
  return "" + e;
362
362
  }
363
363
  function de(e) {
364
- if (Ne(e))
365
- return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ce(e);
364
+ if (Be(e))
365
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), ce(e);
366
366
  }
367
367
  var ve = x.ReactCurrentOwner, Je = {
368
368
  key: !0,
369
369
  ref: !0,
370
370
  __self: !0,
371
371
  __source: !0
372
- }, pe, be;
373
- function Be(e) {
372
+ }, pe, ge;
373
+ function ze(e) {
374
374
  if (A.call(e, "ref")) {
375
375
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
376
376
  if (r && r.isReactWarning)
@@ -389,10 +389,10 @@ function dr() {
389
389
  function Ge(e, r) {
390
390
  typeof e.ref == "string" && ve.current;
391
391
  }
392
- function ze(e, r) {
392
+ function Xe(e, r) {
393
393
  {
394
394
  var t = function() {
395
- pe || (pe = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
395
+ pe || (pe = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
396
396
  };
397
397
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
398
398
  get: t,
@@ -400,10 +400,10 @@ function dr() {
400
400
  });
401
401
  }
402
402
  }
403
- function Xe(e, r) {
403
+ function He(e, r) {
404
404
  {
405
405
  var t = function() {
406
- be || (be = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
406
+ ge || (ge = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
407
407
  };
408
408
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
409
409
  get: t,
@@ -411,7 +411,7 @@ function dr() {
411
411
  });
412
412
  }
413
413
  }
414
- var He = function(e, r, t, n, o, u, i) {
414
+ var Ze = function(e, r, t, n, i, u, o) {
415
415
  var a = {
416
416
  // This tag allows us to uniquely identify this as a React Element
417
417
  $$typeof: h,
@@ -419,7 +419,7 @@ function dr() {
419
419
  type: e,
420
420
  key: r,
421
421
  ref: t,
422
- props: i,
422
+ props: o,
423
423
  // Record the component responsible for creating this element.
424
424
  _owner: u
425
425
  };
@@ -437,44 +437,44 @@ function dr() {
437
437
  configurable: !1,
438
438
  enumerable: !1,
439
439
  writable: !1,
440
- value: o
440
+ value: i
441
441
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
442
442
  };
443
- function Ze(e, r, t, n, o) {
443
+ function Qe(e, r, t, n, i) {
444
444
  {
445
- var u, i = {}, a = null, d = null;
446
- t !== void 0 && (de(t), a = "" + t), Ke(r) && (de(r.key), a = "" + r.key), Be(r) && (d = r.ref, Ge(r, o));
445
+ var u, o = {}, a = null, p = null;
446
+ t !== void 0 && (de(t), a = "" + t), Ke(r) && (de(r.key), a = "" + r.key), ze(r) && (p = r.ref, Ge(r, i));
447
447
  for (u in r)
448
- A.call(r, u) && !Je.hasOwnProperty(u) && (i[u] = r[u]);
448
+ A.call(r, u) && !Je.hasOwnProperty(u) && (o[u] = r[u]);
449
449
  if (e && e.defaultProps) {
450
- var s = e.defaultProps;
451
- for (u in s)
452
- i[u] === void 0 && (i[u] = s[u]);
450
+ var l = e.defaultProps;
451
+ for (u in l)
452
+ o[u] === void 0 && (o[u] = l[u]);
453
453
  }
454
- if (a || d) {
455
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
- a && ze(i, l), d && Xe(i, l);
454
+ if (a || p) {
455
+ var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
+ a && Xe(o, f), p && He(o, f);
457
457
  }
458
- return He(e, a, d, o, n, ve.current, i);
458
+ return Ze(e, a, p, i, n, ve.current, o);
459
459
  }
460
460
  }
461
- var B = x.ReactCurrentOwner, ge = x.ReactDebugCurrentFrame;
461
+ var J = x.ReactCurrentOwner, Ee = x.ReactDebugCurrentFrame;
462
462
  function k(e) {
463
463
  if (e) {
464
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
465
- ge.setExtraStackFrame(t);
464
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
465
+ Ee.setExtraStackFrame(t);
466
466
  } else
467
- ge.setExtraStackFrame(null);
467
+ Ee.setExtraStackFrame(null);
468
468
  }
469
- var K;
470
- K = !1;
471
- function G(e) {
469
+ var z;
470
+ z = !1;
471
+ function K(e) {
472
472
  return typeof e == "object" && e !== null && e.$$typeof === h;
473
473
  }
474
- function Ee() {
474
+ function be() {
475
475
  {
476
- if (B.current) {
477
- var e = m(B.current.type);
476
+ if (J.current) {
477
+ var e = O(J.current.type);
478
478
  if (e)
479
479
  return `
480
480
 
@@ -483,13 +483,13 @@ Check the render method of \`` + e + "`.";
483
483
  return "";
484
484
  }
485
485
  }
486
- function Qe(e) {
486
+ function er(e) {
487
487
  return "";
488
488
  }
489
489
  var he = {};
490
- function er(e) {
490
+ function rr(e) {
491
491
  {
492
- var r = Ee();
492
+ var r = be();
493
493
  if (!r) {
494
494
  var t = typeof e == "string" ? e : e.displayName || e.name;
495
495
  t && (r = `
@@ -504,34 +504,34 @@ Check the top-level render call using <` + t + ">.");
504
504
  if (!e._store || e._store.validated || e.key != null)
505
505
  return;
506
506
  e._store.validated = !0;
507
- var t = er(r);
507
+ var t = rr(r);
508
508
  if (he[t])
509
509
  return;
510
510
  he[t] = !0;
511
511
  var n = "";
512
- e && e._owner && e._owner !== B.current && (n = " It was passed a child from " + m(e._owner.type) + "."), k(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
512
+ e && e._owner && e._owner !== J.current && (n = " It was passed a child from " + O(e._owner.type) + "."), k(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
513
513
  }
514
514
  }
515
515
  function Re(e, r) {
516
516
  {
517
517
  if (typeof e != "object")
518
518
  return;
519
- if (J(e))
519
+ if (B(e))
520
520
  for (var t = 0; t < e.length; t++) {
521
521
  var n = e[t];
522
- G(n) && ye(n, r);
522
+ K(n) && ye(n, r);
523
523
  }
524
- else if (G(e))
524
+ else if (K(e))
525
525
  e._store && (e._store.validated = !0);
526
526
  else if (e) {
527
- var o = Se(e);
528
- if (typeof o == "function" && o !== e.entries)
529
- for (var u = o.call(e), i; !(i = u.next()).done; )
530
- G(i.value) && ye(i.value, r);
527
+ var i = Ce(e);
528
+ if (typeof i == "function" && i !== e.entries)
529
+ for (var u = i.call(e), o; !(o = u.next()).done; )
530
+ K(o.value) && ye(o.value, r);
531
531
  }
532
532
  }
533
533
  }
534
- function rr(e) {
534
+ function tr(e) {
535
535
  {
536
536
  var r = e.type;
537
537
  if (r == null || typeof r == "string")
@@ -539,122 +539,143 @@ Check the top-level render call using <` + t + ">.");
539
539
  var t;
540
540
  if (typeof r == "function")
541
541
  t = r.propTypes;
542
- else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
542
+ else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
543
543
  // Inner props are checked in the reconciler.
544
- r.$$typeof === _))
544
+ r.$$typeof === d))
545
545
  t = r.propTypes;
546
546
  else
547
547
  return;
548
548
  if (t) {
549
- var n = m(r);
550
- Ve(t, e.props, "prop", n, e);
551
- } else if (r.PropTypes !== void 0 && !K) {
552
- K = !0;
553
- var o = m(r);
554
- c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
549
+ var n = O(r);
550
+ Ue(t, e.props, "prop", n, e);
551
+ } else if (r.PropTypes !== void 0 && !z) {
552
+ z = !0;
553
+ var i = O(r);
554
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
555
555
  }
556
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
556
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
557
  }
558
558
  }
559
- function tr(e) {
559
+ function nr(e) {
560
560
  {
561
561
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
562
562
  var n = r[t];
563
563
  if (n !== "children" && n !== "key") {
564
- k(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
564
+ k(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
565
565
  break;
566
566
  }
567
567
  }
568
- e.ref !== null && (k(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
568
+ e.ref !== null && (k(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
569
569
  }
570
570
  }
571
- var _e = {};
572
- function me(e, r, t, n, o, u) {
571
+ var me = {};
572
+ function _e(e, r, t, n, i, u) {
573
573
  {
574
- var i = Ae(e);
575
- if (!i) {
574
+ var o = Ie(e);
575
+ if (!o) {
576
576
  var a = "";
577
577
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
578
- var d = Qe();
579
- d ? a += d : a += Ee();
580
- var s;
581
- e === null ? s = "null" : J(e) ? s = "array" : e !== void 0 && e.$$typeof === h ? (s = "<" + (m(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
578
+ var p = er();
579
+ p ? a += p : a += be();
580
+ var l;
581
+ e === null ? l = "null" : B(e) ? l = "array" : e !== void 0 && e.$$typeof === h ? (l = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
582
582
  }
583
- var l = Ze(e, r, t, o, u);
584
- if (l == null)
585
- return l;
586
- if (i) {
587
- var g = r.children;
588
- if (g !== void 0)
583
+ var f = Qe(e, r, t, i, u);
584
+ if (f == null)
585
+ return f;
586
+ if (o) {
587
+ var b = r.children;
588
+ if (b !== void 0)
589
589
  if (n)
590
- if (J(g)) {
591
- for (var D = 0; D < g.length; D++)
592
- Re(g[D], e);
593
- Object.freeze && Object.freeze(g);
590
+ if (B(b)) {
591
+ for (var D = 0; D < b.length; D++)
592
+ Re(b[D], e);
593
+ Object.freeze && Object.freeze(b);
594
594
  } else
595
- c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
595
+ v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
596
  else
597
- Re(g, e);
597
+ Re(b, e);
598
598
  }
599
599
  if (A.call(r, "key")) {
600
- var S = m(e), v = Object.keys(r).filter(function(sr) {
601
- return sr !== "key";
602
- }), z = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
603
- if (!_e[S + z]) {
604
- var ur = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
605
- c(`A props object containing a "key" prop is being spread into JSX:
600
+ var C = O(e), E = Object.keys(r).filter(function(lr) {
601
+ return lr !== "key";
602
+ }), G = E.length > 0 ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}";
603
+ if (!me[C + G]) {
604
+ var sr = E.length > 0 ? "{" + E.join(": ..., ") + ": ...}" : "{}";
605
+ v(`A props object containing a "key" prop is being spread into JSX:
606
606
  let props = %s;
607
607
  <%s {...props} />
608
608
  React keys must be passed directly to JSX without using spread:
609
609
  let props = %s;
610
- <%s key={someKey} {...props} />`, z, S, ur, S), _e[S + z] = !0;
610
+ <%s key={someKey} {...props} />`, G, C, sr, C), me[C + G] = !0;
611
611
  }
612
612
  }
613
- return e === y ? tr(l) : rr(l), l;
613
+ return e === m ? nr(f) : tr(f), f;
614
614
  }
615
615
  }
616
- function nr(e, r, t) {
617
- return me(e, r, t, !0);
618
- }
619
616
  function ar(e, r, t) {
620
- return me(e, r, t, !1);
617
+ return _e(e, r, t, !0);
618
+ }
619
+ function or(e, r, t) {
620
+ return _e(e, r, t, !1);
621
621
  }
622
- var ir = ar, or = nr;
623
- $.Fragment = y, $.jsx = ir, $.jsxs = or;
622
+ var ir = or, ur = ar;
623
+ $.Fragment = m, $.jsx = ir, $.jsxs = ur;
624
624
  }()), $;
625
625
  }
626
- process.env.NODE_ENV === "production" ? X.exports = cr() : X.exports = dr();
627
- var vr = X.exports;
628
- function pr() {
629
- return new Promise((R, h) => {
630
- if (window.require) return R(window.require);
631
- const b = document.createElement("script");
632
- b.src = "/vs/loader.js", b.onload = () => {
626
+ process.env.NODE_ENV === "production" ? X.exports = vr() : X.exports = pr();
627
+ var gr = X.exports;
628
+ function Er() {
629
+ return new Promise((P, h) => {
630
+ if (window.require) return P(window.require);
631
+ const R = document.createElement("script");
632
+ R.src = "/vs/loader.js", R.onload = () => {
633
633
  if (!window.require) return h(new Error("RequireJS not available"));
634
- window.require.config({ paths: { vs: "/vs" } }), R(window.require);
635
- }, b.onerror = h, document.body.appendChild(b);
634
+ window.require.config({ paths: { vs: "/vs" } }), P(window.require);
635
+ }, R.onerror = h, document.body.appendChild(R);
636
636
  });
637
637
  }
638
- function gr({ value: R, theme: h, onChange: b }) {
639
- const y = lr(null);
640
- return fr(() => {
641
- let E;
642
- return pr().then((C) => {
643
- C(["vs/editor/editor.main"], () => {
638
+ const hr = fr(function({ value: h, theme: R, onChange: m }, j) {
639
+ const T = we(null), y = we(null);
640
+ cr(j, () => ({
641
+ getValue() {
642
+ var s;
643
+ return ((s = y.current) == null ? void 0 : s.getValue()) ?? "";
644
+ },
645
+ layout() {
646
+ _();
647
+ }
648
+ }));
649
+ function _() {
650
+ const s = T.current, g = y.current;
651
+ if (!s || !g) return;
652
+ const { width: c, height: d } = s.getBoundingClientRect();
653
+ g.layout({ width: c, height: d });
654
+ }
655
+ return dr(() => {
656
+ const s = T.current;
657
+ if (!s) return;
658
+ let g = null;
659
+ const c = () => {
660
+ requestAnimationFrame(() => _());
661
+ };
662
+ return Er().then((d) => {
663
+ d(["vs/editor/editor.main"], () => {
644
664
  const w = window.monaco;
645
- y.current && (E = w.editor.create(y.current, {
646
- value: R,
665
+ s && (g = w.editor.create(s, {
666
+ value: h,
647
667
  language: "pebble",
648
- theme: h || "vs-dark"
649
- }), E.onDidChangeModelContent(() => {
650
- b == null || b(E.getValue());
651
- }));
668
+ theme: R || "vs-dark"
669
+ }), y.current = g, g.onDidChangeModelContent(() => {
670
+ m == null || m(g.getValue());
671
+ }), window.addEventListener("resize", c));
652
672
  });
653
673
  }), () => {
654
- E == null || E.dispose();
674
+ var d;
675
+ window.removeEventListener("resize", c), (d = y.current) == null || d.dispose(), y.current = null;
655
676
  };
656
- }, [R]), /* @__PURE__ */ vr.jsx("div", { ref: y, style: { height: "100%", width: "100%" } });
657
- }
677
+ }, [h]), /* @__PURE__ */ gr.jsx("div", { ref: T, style: { height: "100%", width: "100%" } });
678
+ });
658
679
  export {
659
- gr as PebbleEditor
680
+ hr as PebbleEditor
660
681
  };
@@ -1,4 +1,4 @@
1
- (function(w,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(w=typeof globalThis<"u"?globalThis:w||self,m(w.ReactPebbleEditor={},w.React))})(this,function(w,m){"use strict";var q={exports:{}},I={};/**
1
+ (function(S,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(S=typeof globalThis<"u"?globalThis:S||self,y(S.ReactPebbleEditor={},S.React))})(this,function(S,y){"use strict";var B={exports:{}},I={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Q;function Se(){if(Q)return I;Q=1;var R=m,y=Symbol.for("react.element"),b=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,g=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function O(P,l,k){var p,_={},S=null,L=null;k!==void 0&&(S=""+k),l.key!==void 0&&(S=""+l.key),l.ref!==void 0&&(L=l.ref);for(p in l)h.call(l,p)&&!x.hasOwnProperty(p)&&(_[p]=l[p]);if(P&&P.defaultProps)for(p in l=P.defaultProps,l)_[p]===void 0&&(_[p]=l[p]);return{$$typeof:y,type:P,key:S,ref:L,props:_,_owner:g.current}}return I.Fragment=b,I.jsx=O,I.jsxs=O,I}var W={};/**
9
+ */var Q;function Se(){if(Q)return I;Q=1;var C=y,h=Symbol.for("react.element"),m=Symbol.for("react.fragment"),_=Object.prototype.hasOwnProperty,k=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O={key:!0,ref:!0,__self:!0,__source:!0};function R(w,s,b){var c,d={},T=null,V=null;b!==void 0&&(T=""+b),s.key!==void 0&&(T=""+s.key),s.ref!==void 0&&(V=s.ref);for(c in s)_.call(s,c)&&!O.hasOwnProperty(c)&&(d[c]=s[c]);if(w&&w.defaultProps)for(c in s=w.defaultProps,s)d[c]===void 0&&(d[c]=s[c]);return{$$typeof:h,type:w,key:T,ref:V,props:d,_owner:k.current}}return I.Fragment=m,I.jsx=R,I.jsxs=R,I}var W={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,17 +14,17 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ee;function Ce(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){var R=m,y=Symbol.for("react.element"),b=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),P=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),re=Symbol.iterator,De="@@iterator";function Fe(e){if(e===null||typeof e!="object")return null;var r=re&&e[re]||e[De];return typeof r=="function"?r:null}var D=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ae("error",e,t)}}function Ae(e,r,t){{var n=D.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Ie=!1,We=!1,Ye=!1,Me=!1,Le=!1,te;te=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===x||Le||e===g||e===k||e===p||Me||e===L||Ie||We||Ye||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===_||e.$$typeof===O||e.$$typeof===P||e.$$typeof===l||e.$$typeof===te||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ne(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case b:return"Portal";case x:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case P:var r=e;return ne(r)+".Consumer";case O:var t=e;return ne(t._context)+".Provider";case l:return $e(e,e.render,"ForwardRef");case _:var n=e.displayName||null;return n!==null?n:T(e.type)||"Memo";case S:{var o=e,u=o._payload,i=o._init;try{return T(i(u))}catch{return null}}}return null}var C=Object.assign,Y=0,ae,ie,oe,ue,se,fe,le;function ce(){}ce.__reactDisabledLog=!0;function Ue(){{if(Y===0){ae=console.log,ie=console.info,oe=console.warn,ue=console.error,se=console.group,fe=console.groupCollapsed,le=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Ne(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:ae}),info:C({},e,{value:ie}),warn:C({},e,{value:oe}),error:C({},e,{value:ue}),group:C({},e,{value:se}),groupCollapsed:C({},e,{value:fe}),groupEnd:C({},e,{value:le})})}Y<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=D.ReactCurrentDispatcher,B;function V(e,r,t){{if(B===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
18
- `+B+e}}var K=!1,$;{var qe=typeof WeakMap=="function"?WeakMap:Map;$=new qe}function de(e,r){if(!e||K)return"";{var t=$.get(e);if(t!==void 0)return t}var n;K=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Ue();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(v){n=v}Reflect.construct(e,[],i)}else{try{i.call()}catch(v){n=v}e.call(i.prototype)}}else{try{throw Error()}catch(v){n=v}e()}}catch(v){if(v&&n&&typeof v.stack=="string"){for(var a=v.stack.split(`
19
- `),d=n.stack.split(`
20
- `),s=a.length-1,f=d.length-1;s>=1&&f>=0&&a[s]!==d[f];)f--;for(;s>=1&&f>=0;s--,f--)if(a[s]!==d[f]){if(s!==1||f!==1)do if(s--,f--,f<0||a[s]!==d[f]){var E=`
21
- `+a[s].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,E),E}while(s>=1&&f>=0);break}}}finally{K=!1,J.current=u,Ne(),Error.prepareStackTrace=o}var A=e?e.displayName||e.name:"",j=A?V(A):"";return typeof e=="function"&&$.set(e,j),j}function Je(e,r,t){return de(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return de(e,Be(e));if(typeof e=="string")return V(e);switch(e){case k:return V("Suspense");case p:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Je(e.render);case _:return U(e.type,r,t);case S:{var n=e,o=n._payload,u=n._init;try{return U(u(o),r,t)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,ve={},pe=D.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}function Ke(e,r,t,n,o){{var u=Function.call.bind(M);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(N(o),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),N(null)),a instanceof Error&&!(a.message in ve)&&(ve[a.message]=!0,N(o),c("Failed %s type: %s",t,a.message),N(null))}}}var Ge=Array.isArray;function G(e){return Ge(e)}function ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function Ee(e){if(Xe(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),be(e)}var ge=D.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},ye,he;function Ze(e){if(M.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Qe(e){if(M.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function er(e,r){typeof e.ref=="string"&&ge.current}function rr(e,r){{var t=function(){ye||(ye=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function tr(e,r){{var t=function(){he||(he=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var nr=function(e,r,t,n,o,u,i){var a={$$typeof:y,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ar(e,r,t,n,o){{var u,i={},a=null,d=null;t!==void 0&&(Ee(t),a=""+t),Qe(r)&&(Ee(r.key),a=""+r.key),Ze(r)&&(d=r.ref,er(r,o));for(u in r)M.call(r,u)&&!He.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||d){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&rr(i,f),d&&tr(i,f)}return nr(e,a,d,o,n,ge.current,i)}}var z=D.ReactCurrentOwner,Re=D.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var X;X=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function _e(){{if(z.current){var e=T(z.current.type);if(e)return`
17
+ */var ee;function Ce(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){var C=y,h=Symbol.for("react.element"),m=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),w=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),re=Symbol.iterator,De="@@iterator";function Fe(e){if(e===null||typeof e!="object")return null;var r=re&&e[re]||e[De];return typeof r=="function"?r:null}var D=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ae("error",e,t)}}function Ae(e,r,t){{var n=D.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Ie=!1,We=!1,Ye=!1,Le=!1,Ve=!1,te;te=Symbol.for("react.module.reference");function Me(e){return!!(typeof e=="string"||typeof e=="function"||e===_||e===O||Ve||e===k||e===b||e===c||Le||e===V||Ie||We||Ye||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===d||e.$$typeof===R||e.$$typeof===w||e.$$typeof===s||e.$$typeof===te||e.getModuleId!==void 0))}function Ue(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ne(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case m:return"Portal";case O:return"Profiler";case k:return"StrictMode";case b:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return ne(r)+".Consumer";case R:var t=e;return ne(t._context)+".Provider";case s:return Ue(e,e.render,"ForwardRef");case d:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case T:{var i=e,u=i._payload,o=i._init;try{return P(o(u))}catch{return null}}}return null}var j=Object.assign,Y=0,ae,oe,ie,ue,se,le,fe;function ce(){}ce.__reactDisabledLog=!0;function Ne(){{if(Y===0){ae=console.log,oe=console.info,ie=console.warn,ue=console.error,se=console.group,le=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function $e(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:ae}),info:j({},e,{value:oe}),warn:j({},e,{value:ie}),error:j({},e,{value:ue}),group:j({},e,{value:se}),groupCollapsed:j({},e,{value:le}),groupEnd:j({},e,{value:fe})})}Y<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=D.ReactCurrentDispatcher,q;function M(e,r,t){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
18
+ `+q+e}}var z=!1,U;{var Be=typeof WeakMap=="function"?WeakMap:Map;U=new Be}function de(e,r){if(!e||z)return"";{var t=U.get(e);if(t!==void 0)return t}var n;z=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Ne();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(g){n=g}Reflect.construct(e,[],o)}else{try{o.call()}catch(g){n=g}e.call(o.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
19
+ `),p=n.stack.split(`
20
+ `),l=a.length-1,f=p.length-1;l>=1&&f>=0&&a[l]!==p[f];)f--;for(;l>=1&&f>=0;l--,f--)if(a[l]!==p[f]){if(l!==1||f!==1)do if(l--,f--,f<0||a[l]!==p[f]){var E=`
21
+ `+a[l].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,E),E}while(l>=1&&f>=0);break}}}finally{z=!1,J.current=u,$e(),Error.prepareStackTrace=i}var A=e?e.displayName||e.name:"",x=A?M(A):"";return typeof e=="function"&&U.set(e,x),x}function Je(e,r,t){return de(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return de(e,qe(e));if(typeof e=="string")return M(e);switch(e){case b:return M("Suspense");case c:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return Je(e.render);case d:return N(e.type,r,t);case T:{var n=e,i=n._payload,u=n._init;try{return N(u(i),r,t)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,ve={},pe=D.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}function ze(e,r,t,n,i){{var u=Function.call.bind(L);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&($(i),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),$(null)),a instanceof Error&&!(a.message in ve)&&(ve[a.message]=!0,$(i),v("Failed %s type: %s",t,a.message),$(null))}}}var Ke=Array.isArray;function K(e){return Ke(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function ge(e){if(Xe(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),be(e)}var Ee=D.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},ye,he;function Ze(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Qe(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function er(e,r){typeof e.ref=="string"&&Ee.current}function rr(e,r){{var t=function(){ye||(ye=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function tr(e,r){{var t=function(){he||(he=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var nr=function(e,r,t,n,i,u,o){var a={$$typeof:h,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ar(e,r,t,n,i){{var u,o={},a=null,p=null;t!==void 0&&(ge(t),a=""+t),Qe(r)&&(ge(r.key),a=""+r.key),Ze(r)&&(p=r.ref,er(r,i));for(u in r)L.call(r,u)&&!He.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)o[u]===void 0&&(o[u]=l[u])}if(a||p){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&rr(o,f),p&&tr(o,f)}return nr(e,a,p,i,n,Ee.current,o)}}var G=D.ReactCurrentOwner,Re=D.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var X;X=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===h}function me(){{if(G.current){var e=P(G.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function ir(e){return""}var me={};function or(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
23
+ Check the render method of \``+e+"`."}return""}}function or(e){return""}var _e={};function ir(e){{var r=me();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
24
 
25
- Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(me[t])return;me[t]=!0;var n="";e&&e._owner&&e._owner!==z.current&&(n=" It was passed a child from "+T(e._owner.type)+"."),F(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),F(null)}}function we(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&Te(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var o=Fe(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)H(i.value)&&Te(i.value,r)}}}function ur(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===_))t=r.propTypes;else return;if(t){var n=T(r);Ke(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var o=T(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){F(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),F(null);break}}e.ref!==null&&(F(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}var Oe={};function Pe(e,r,t,n,o,u){{var i=Ve(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=ir();d?a+=d:a+=_e();var s;e===null?s="null":G(e)?s="array":e!==void 0&&e.$$typeof===y?(s="<"+(T(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var f=ar(e,r,t,o,u);if(f==null)return f;if(i){var E=r.children;if(E!==void 0)if(n)if(G(E)){for(var A=0;A<E.length;A++)we(E[A],e);Object.freeze&&Object.freeze(E)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else we(E,e)}if(M.call(r,"key")){var j=T(e),v=Object.keys(r).filter(function(pr){return pr!=="key"}),Z=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[j+Z]){var vr=v.length>0?"{"+v.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+t+">.")}return r}}function we(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),F(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),F(null)}}function Te(e,r){{if(typeof e!="object")return;if(K(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&we(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var i=Fe(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)H(o.value)&&we(o.value,r)}}}function ur(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===s||r.$$typeof===d))t=r.propTypes;else return;if(t){var n=P(r);ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var i=P(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){F(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),F(null);break}}e.ref!==null&&(F(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}var Oe={};function Pe(e,r,t,n,i,u){{var o=Me(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=or();p?a+=p:a+=me();var l;e===null?l="null":K(e)?l="array":e!==void 0&&e.$$typeof===h?(l="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=ar(e,r,t,i,u);if(f==null)return f;if(o){var E=r.children;if(E!==void 0)if(n)if(K(E)){for(var A=0;A<E.length;A++)Te(E[A],e);Object.freeze&&Object.freeze(E)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Te(E,e)}if(L.call(r,"key")){var x=P(e),g=Object.keys(r).filter(function(pr){return pr!=="key"}),Z=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[x+Z]){var vr=g.length>0?"{"+g.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Z,j,vr,j),Oe[j+Z]=!0}}return e===h?sr(f):ur(f),f}}function fr(e,r,t){return Pe(e,r,t,!0)}function lr(e,r,t){return Pe(e,r,t,!1)}var cr=lr,dr=fr;W.Fragment=h,W.jsx=cr,W.jsxs=dr}()),W}process.env.NODE_ENV==="production"?q.exports=Se():q.exports=Ce();var je=q.exports;function xe(){return new Promise((R,y)=>{if(window.require)return R(window.require);const b=document.createElement("script");b.src="/vs/loader.js",b.onload=()=>{if(!window.require)return y(new Error("RequireJS not available"));window.require.config({paths:{vs:"/vs"}}),R(window.require)},b.onerror=y,document.body.appendChild(b)})}function ke({value:R,theme:y,onChange:b}){const h=m.useRef(null);return m.useEffect(()=>{let g;return xe().then(x=>{x(["vs/editor/editor.main"],()=>{const O=window.monaco;h.current&&(g=O.editor.create(h.current,{value:R,language:"pebble",theme:y||"vs-dark"}),g.onDidChangeModelContent(()=>{b==null||b(g.getValue())}))})}),()=>{g==null||g.dispose()}},[R]),je.jsx("div",{ref:h,style:{height:"100%",width:"100%"}})}w.PebbleEditor=ke,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
30
+ <%s key={someKey} {...props} />`,Z,x,vr,x),Oe[x+Z]=!0}}return e===_?sr(f):ur(f),f}}function lr(e,r,t){return Pe(e,r,t,!0)}function fr(e,r,t){return Pe(e,r,t,!1)}var cr=fr,dr=lr;W.Fragment=_,W.jsx=cr,W.jsxs=dr}()),W}process.env.NODE_ENV==="production"?B.exports=Se():B.exports=Ce();var je=B.exports;function xe(){return new Promise((C,h)=>{if(window.require)return C(window.require);const m=document.createElement("script");m.src="/vs/loader.js",m.onload=()=>{if(!window.require)return h(new Error("RequireJS not available"));window.require.config({paths:{vs:"/vs"}}),C(window.require)},m.onerror=h,document.body.appendChild(m)})}const ke=y.forwardRef(function({value:h,theme:m,onChange:_},k){const O=y.useRef(null),R=y.useRef(null);y.useImperativeHandle(k,()=>({getValue(){var s;return((s=R.current)==null?void 0:s.getValue())??""},layout(){w()}}));function w(){const s=O.current,b=R.current;if(!s||!b)return;const{width:c,height:d}=s.getBoundingClientRect();b.layout({width:c,height:d})}return y.useEffect(()=>{const s=O.current;if(!s)return;let b=null;const c=()=>{requestAnimationFrame(()=>w())};return xe().then(d=>{d(["vs/editor/editor.main"],()=>{const T=window.monaco;s&&(b=T.editor.create(s,{value:h,language:"pebble",theme:m||"vs-dark"}),R.current=b,b.onDidChangeModelContent(()=>{_==null||_(b.getValue())}),window.addEventListener("resize",c))})}),()=>{var d;window.removeEventListener("resize",c),(d=R.current)==null||d.dispose(),R.current=null}},[h]),je.jsx("div",{ref:O,style:{height:"100%",width:"100%"}})});S.PebbleEditor=ke,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-pebble-editor",
3
- "version": "0.0.1-dev2",
3
+ "version": "0.0.1-dev4",
4
4
  "description": "React wrap component for monaco pebble editor",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "devDependencies": {
21
- "@harmoniclabs/plu-ts": "^0.9.0",
21
+ "@harmoniclabs/pebble": "0.1.3-dev4",
22
22
  "@types/node": "18.0.0",
23
23
  "@types/react": "^18.0.0",
24
24
  "@types/react-dom": "^18.0.0",
@@ -30,6 +30,6 @@
30
30
  "vite": "^5.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@harmoniclabs/monaco-editor": "^0.1.0-dev2"
33
+ "@harmoniclabs/monaco-editor": "^0.1.1"
34
34
  }
35
35
  }
@@ -1,36 +1,74 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import React, { useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
2
2
  import { loadMonacoLoader } from '../utils/monaco-loader';
3
3
 
4
+ export interface PebbleEditorHandle {
5
+ getValue(): string;
6
+ layout(): void;
7
+ }
4
8
 
5
- export default function PebbleEditor({ value, theme, onChange }: {
9
+ const PebbleEditor = forwardRef<PebbleEditorHandle, {
6
10
  value: string;
7
11
  theme?: string;
8
12
  onChange?: (v: string) => void;
9
- }) {
10
- const containerRef = useRef<HTMLDivElement>(null);
13
+ }>(function PebbleEditor({ value, theme, onChange }, ref) {
14
+ const outerRef = useRef<HTMLDivElement>(null);
15
+ const editorRef = useRef<any>(null);
16
+
17
+ useImperativeHandle(ref, () => ({
18
+ getValue() {
19
+ return editorRef.current?.getValue() ?? '';
20
+ },
21
+ layout() {
22
+ doLayout();
23
+ }
24
+ }));
25
+
26
+ function doLayout() {
27
+ const outer = outerRef.current;
28
+ const editor = editorRef.current;
29
+ if (!outer || !editor) return;
30
+ // Read size from the outer div which is sized by CSS, not by Monaco
31
+ const { width, height } = outer.getBoundingClientRect();
32
+ editor.layout({ width, height });
33
+ }
11
34
 
12
35
  useEffect(() => {
13
- let editor: any;
36
+ const outer = outerRef.current;
37
+ if (!outer) return;
38
+
39
+ let editor: any = null;
40
+
41
+ const onResize = () => {
42
+ requestAnimationFrame(() => doLayout());
43
+ };
44
+
14
45
  loadMonacoLoader().then((require) => {
15
46
  require(['vs/editor/editor.main'], () => {
16
47
  const monaco = window.monaco;
17
- if (!containerRef.current) return; // Ensure containerRef.current is valid
18
- editor = monaco.editor.create(containerRef.current, {
48
+ if (!outer) return;
49
+ editor = monaco.editor.create(outer, {
19
50
  value,
20
51
  language: 'pebble',
21
52
  theme: theme || 'vs-dark',
22
53
  });
54
+ editorRef.current = editor;
23
55
 
24
56
  editor.onDidChangeModelContent(() => {
25
57
  onChange?.(editor.getValue());
26
58
  });
59
+
60
+ window.addEventListener('resize', onResize);
27
61
  });
28
62
  });
29
63
 
30
64
  return () => {
31
- editor?.dispose();
65
+ window.removeEventListener('resize', onResize);
66
+ editorRef.current?.dispose();
67
+ editorRef.current = null;
32
68
  };
33
69
  }, [value]);
34
70
 
35
- return <div ref={containerRef} style={{ height: '100%', width: '100%' }} />;
36
- }
71
+ return <div ref={outerRef} style={{ height: '100%', width: '100%' }} />;
72
+ });
73
+
74
+ export default PebbleEditor;
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default as PebbleEditor } from "./components/PebbleEditor";
2
+ export type { PebbleEditorHandle } from "./components/PebbleEditor";